GTU Computer Engineering (Semester 7)
Compiler Design
June 2014
Total marks: --
Total time: --
INSTRUCTIONS
(1) Assume appropriate data and state your reasons
(2) Marks are given to the right of every question
(3) Draw neat diagrams wherever necessary


1 (a) What is the pass of a compiler? Explain how the single and multi-pass compilers work.
7 M
1 (b) Draw Deterministic Finite Automata for :
1. (0+1)*101(0+1)*
2. 10(0+1)*1
7 M

2 (a) List out phases of a compiles. Write a brief not on Lexical Analyzer.
6 M
2 (b) Implement the following grammar using Table Driven parser and check whether it is
LL(1) or not.S -> aBDh, B -> cC, C -> bC / ^, D -> EF, E -> g / ^, F-> f / ^
8 M
2 (c) Implement the following grammar using Recursive Descent Parser.
S -> Aa | bAc | bBa, A -> d, B -> d
8 M

3 (a) What is bottom-up parsing? Discuss Shift Reduce parsing technique in brief. What is a handle?
8 M
3 (b) Write a syntax directed definition of a simple desk calculator and draw an annotated parse tree for 4*3 + 2*5 n.
6 M
3 (c) Define an Operator Precedence Grammar. Also write down the rules to find relationship between each pair of terminal symbols.
8 M
3 (d) Convert the following into quadruple, triple and indirect triple forms : -(a+b)*(c-d).
6 M

4 (a) Construct SLR parsing table for the following grammar :
E->E+T E->T T->T*F T->F F->(E) F->a.
10 M
4 (b) Differentiate Synthesized and Inherited attributes.
4 M
4 (c) Error Recovery strategies of compiler.
7 M
4 (d) What is the use of a symbol table? How the identifiers are stored in the symbol table?
7 M

5 (a) Write a note on peephole optimization.
7 M
5 (b) Write a note on static and dynamic memory allocation. What do you mean by dangling reference?
7 M
5 (c) What is an activation record? Explain how they are used to access various local and global variables.
7 M
5 (d) Write a brief note on input buffering techniques.
7 M



More question papers from Compiler Design
SPONSORED ADVERTISEMENTS