Assignment-2
Compiler Design (Direct Reading)
Submission Deadline:- 27/04/25
Answer All Questions (25X4)
1. a. Write a brief note on input buffering techniques.
b. Explain phases of compiler with example.
c. What is symbol table? For what purpose , compiler uses symbol table?
d. Construct NFA for following regular expression using Thompson’s
notation and then convert it into DFA. (a/b)*abb#
2 a. Explain subset construction method with example.
b. Define handle and handle pruning. Explain the stack implementation of shift reduce
parser with the help of example.
c. Give the translation scheme that converts infix to postfix notation.
Generate the annotated parse tree for input string 3-5+4.
d. Check given grammar is LL(1) but not SLR(1).
S -> AaAb | BbBa
A -> €
B -> €
3 a. What is left factoring and left recursion? Explain it with suitable example.
b. Define syntax tree. What is s-attributed definition? Explain construction of syntax tree
for the expression a-4+c using SD.
c. Explain parameter passing techniques for procedure.
d. Construct LL(1) parsing table for the following Grammar:
E -> E+T | T
T -> T*F | F F -> (E)
4. a. Explain three loop optimization techniques with example.
b. What is code optimization? Explain data flow equation.
c. Describe code generator design issues.
e. Define following : DAG, Basic Blocks, Flow graph