www.jntuworld.
com
Code No: B0501
Jawaharlal Nehru Technological University Hyderabad
M. Tech II-Semester Regular Examinations September – 2009
COMPILER DESIGN
(Computer Science)
Time : 3 Hours Max. Marks: 60
Answer Any Five Questions
All Questions Carry Equal marks
----
1.a) What are the different phases of a compiler, discuss them with illustrations
b) Explain the bootstrapping process with suitable diagrams.
2. a) What are preprocessing steps required for predictive parsing. Explain with
examples.
b) Construct the Predictive Parsing Table for the following grammar
SÆ aAB | bA | ∈
A Æ aAb | ∈
B Æ bB| ∈
3. a) Write an LR parsing algorithm
b) Construct LALR(1) parsing table for the following grammar.
L D
R
SÆ Aa|aAc|Bc |bBa
AÆd
O
BÆd
4. a) Design a syntax directed translation scheme for finding the value of the
E → TE’
E’ → +TE’ | ε
U W
expression given by the following grammar.
T
T → FT’
T’ → *FT’ | ε
N
F → (E) | id
J
b) What is a type expression? Explain equivalence of type expressions with
appropriate examples.
5. a) Explain about Static, Runtime stack and Heap storage allocation.
b) What is a symbol table ? Explain various data structures for ‘Symbol
Tables’ ?
6.a) Explain Register Allocation by Graph Coloring with examples.
b) Explain Simple code generation with example.
7. Discuss the different local optimizing techniques with detailed examples.
8. Explain the following Transformations using Dataflow Analyses
a) Copmmon-subexpression elimination
b) Constant propagation
c) Copy propagation
d) Dead code elimination
****
www.jntuworld.com