written 7.9 years ago by |
System Programming And Compiler Construction - May 2016
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) What is the role of an automata in compiler design.(5 marks)
1(b) Elliminate Left recursion in the following grammar (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 is the difference between Compiler and Interpreter.(5 marks)
2(a) Explain with an example Quadruples , Triples, Indirect triples.(10 marks)
2(b) What is the difference between Dynamic Loading and Dynamic Linking explain 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 FOLLOW Set for given grammer below
E → T E' E' → + T E' | ε
T → F T' T' → * F T' | ε
F → (E) F → id(5 marks)
4(a) Explain different Code Optimization technics along with an example.(10 marks)
4(b) Foe the following grammer construct LR(0) parser table
S → aCDe
C → Cbc
C → b
D → d
And parse the string abbcbcde. Show contents of stack and i/p buffer and action taken after each step.(10 marks)
5(a) Draw and explain DAG and represent the following with it.
(a / b) + (a / b) * (C * d)(10 marks)
5(b) What are the different phases of Compiler? Lllustrate compilers internal representation of source program for following statement after each phase Amount = P + P * N * R/100(10 marks)
6(a) With reference to Assembler explain following tables with suitable example.
(i) POT
(ii) MOT
(iii) ST
(iv) LT(10 marks)
6(b) What are the different issues in design of Code Generator? Explain with an example.(10 marks)