Formal Languages and Compiler Design
Formal Languages and Compiler Design
OR
3. a) Convert the following NFA with ε moves to DFA without ε moves. 5M
b) Define NFA. What are the differences between DFA & NFA? 5M
UNIT-II
4. a) Write the procedure and Eliminate left recursion from the following Grammar 5M
b) Explain about derivation and parse trees. Construct the string 0100110 from the 5M
Leftmost and Rightmost derivation.
OR
5. a) Explain Left recursion and Left factoring. 5M
b) Perform left factor for the following grammar 5M
Page 1 of 2
Code: AM20APC504 R 20
UNIT-III
6. a) What is Chomsky’s hierarchy? Explain 5M
b) Explain different Intermediate code generation techniques. 5M
OR
7. a) Write about context sensitive features using examples. 5M
b) Explain about type conversions with suitable examples. 5M
UNIT-IV
8. a) With a neat diagram explain the format of the Symbol Table and discuss the tree 5M
structures representation of scope information.
b) Explain the following code optimization techniques with examples. 5M
i) Constant propagation
ii) Strength reduction.
OR
9. a) What is an induction variable? Explain with an example. 5M
b) Explain about peephole optimization. 5M
UNIT-V
10. a) Explain various issues in the design of the code generation. 5M
b) Explain the code generation algorithm in detail. 5M
OR
11. a) What is DAG and flow graph? Explain their role in compilation process. 5M
b) What is the role of code Optimizer in compiler? Is it a mandatory phase? 5M
*****
Page 2 of 2