Compiler Design and Construction 2078
Section A
Attempt any two questions.(2*10=20)
1. List out the tasks performed by Lexical Analyser. Define DFA. Convert the Regular Expression (a+b)*a(a+b) to DFA directly. (3+1+6)
2. Differentiate between LR(0) and LR(1) algorithm. Construct LR(1) parse table of the following grammar.(3+7)
S->AA
A->aA | b
3. Define type checking. Differentiate between type casting and coercion? Write SDD to carry out type checking for the following expression.
E->n|E*E| E==|E[E] | E↑
Section B
Attempt any eight questions. (8*5 = 40)
4. Define compiler and differentiate it with an interpreter.
5. What are the typical entries made in symbol table? Explain.
6. Define Left recursive grammar. Remove left recursion from the following grammar.
S→SB | Ca
B→Bb | c
C→aB | a
7. What are the disadvantages of shift reduce parsing. Perform shift reduce parsing of string
w= (x-x) -(x/x) for given grammar.
E→ E-E | E/E | (E) | x
8. Define attribute grammar with example of inherited and synthesized attributes.
9. Define three address codes. Write down Quadruples for,
a = -b*(c+d)/e
10. List out different types of run time storage management techniques. Explain any one of them.
11. What is the advantages of code optimization? Explain about dead - code elimination.
12. Explain about the factors affecting target code generation.