written 8.7 years ago by |
System Programming And Compiler Construction - May 2013
Computer Engineering (Semester 6)
TOTAL MARKS: 80
TOTAL TIME: 3 HOURS
(1) Question 1 is compulsory.
(2) Attempt any three from the remaining questions.
(3) Assume data if required.
(4) Figures to the right indicate full marks.
1 (a) Differentiate between Application program and system program. Indicate the order in which following system programs are used, from developing program to its execution.
Assemblers, loaders, linker, macro processor, compiler, editor.(5 marks)
1 (b) Eliminate left recursion present in following grammar (Remove Direct and Indirect recursion both)
S → Aa |b
A → Ac | Sd | ε(5 marks)
1 (c) What is activation record? Draw the diagram of General Activation record and explain the purpose of different fields of an activation record.(5 marks)
1 (d) What are the different functions of loader? Explain in brief.(5 marks)
2 (a) With reference to assembler explain the following tables with suitable examples:
(i) POT
(ii) MOT
(iii) ST
(iv) LT (10 marks)
2 (b) Let L be the language consisting of strings of a's and b's having same number of a's and b's:
(i) Construct LL(1) grammer for L
(ii) Construct a predictive parsing table for the grammer obtained in (i).(10 marks)
3 (a) Explain different pseudo-ops used for conditional macro expansion, along with example.(10 marks)
3 (b) What are the different phases of compiler? Illustrate compilers internal presentation of source program for following statement after each phase =
position = initial + rate * 60 (10 marks)
4 (a) Explain working of a direct linking loader with a proper example. Clearly show the entries in different databases built by the direct linking loader.(10 marks)
4 (b) Generate three address code for given expression
while (a < b) do
if (c < d) then
x = y + z
else
x = y - z(10 marks)
5 (a) For the given grammar below, construct operator precedence relations matrix, assuming , + are binary operators and id as terminal symbol and E as non terminal symbol.
E → E + E
E → E * E
E → id
Apply operator precedence parsing algorithm to obtain skeletal syntax tree for the statement
id + id * id(10 marks)
5 (b) Explain role of code optimisation in compiler designing with suitable example. (10 marks)
6 (a) For regular expression (a|b)abb construct NFA and construct it into DFA. (10 marks)
6 (b) With reference to stack allocation and heap allocation explain runtime storage organisation.(10 marks)
7 (a) Write a note on JAVA compiler environment.(5 marks)
7 (b) Explain synthesized and inherited attributes used in syntax directed definitions.(5 marks)
7 (c) Explain DAG.(5 marks)
7 (d) Find first and follow set for given grammar below:
E → TE' E' → + TE' | ε
T → FT' T' → *FT' | ε
F → (E) F → id(5 marks)