written 8.4 years ago by |
System Programming And Compiler Construction - Dec 2015
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 upto its execution. Assemblers, Loaders, Linker, Macro processor, compiler, Editor.(5 marks)
1 (b) Eliminate Left recursion in the following grammer (Remove Direct and Indirect recursion)
S→Aa|b A→Ac|Sd|ε(5 marks)
1 (c) What is an activation record? Draw 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.(5 marks)
2 (a) For a given grammer below, construct an operator precedence relation matrix, assuming , +are binary operators and id as terminal Symbol and E as non-terminal.
E→E+E E→EE E→id
Apply operator precedence parsing algorithm for the statement id+idid.(10 marks)
2 (b) Explain the role of code optimization in compiler designing? Explain Peep-hole optimization along with an example.(10 marks)
3 (a) Write a note on JAVA compiler environment.(5 marks)
3 (b) Write a brief note on Design of an Editor.(5 marks)
3 (c) Explain synthesized and Inherited attributes used in Syntax Directed Definition.(5 marks)
3 (d) Find FIRST and FOLLOWS set for given grammer below
E→T E' E'→+T E'|ε
T→F T' F T'| ε
F→(E) F→id.(5 marks)
4 (a) Explain Design of Dynamic Linking Loader along with example.(10 marks)
4 (b) For the following grammer construct LL(1) parser table
S→F S→(S-F) F→a
And Parse the string (a-a). Show contents of stack and i/p buffer and action taken after each up.(10 marks)
5 (a) Explain different pseudo-ops usd for conditional macro expansion along with an example.(10 marks)
5 (b) What are the different phases of Compiler? Illustrate compilers internal representation of source program for following statement after each phase
Position= initial+rate60.(10 marks)
6 (a) With reference to Assembler explain following tables with suitable example. (i) POT, (ii) MOT, (iii) ST, (v) LT(10 marks)
6 (b) Explain Back-patching with an example.(10 marks)