Professional Documents
Culture Documents
CD - R20 Model Paper
CD - R20 Model Paper
(R20)
R.V.R & J.C COLLEGE OF ENGINEERING
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
B.TECH. DEGREE EXAMINATION
PROFESSIONAL ELECTIVE – II
CSE – 324 (CSE L04) COMPILER DESIGN
UNIT – I
2. (a) Explain with block diagram different phases of a compiler. (7M) CO1 L2
(b) Interpret the outputs generated by various phases of the L2
compiler for the statement, position: =initial +rate*60. (7M) CO1
(OR)
3. (a) Explain the input buffering scheme with suitable example. L2
(7M) CO1
(b) Design the NFA for abb(a+b)* . Convert it into a DFA and L4
minimize the DFA using subset construction algorithm. (7M) CO1
UNIT – II
4. (a) With a neat sketch explain the role of the parser. (7M) CO2 L2
(b) Explain YACC tool with the help of simple YACC program. (7M) CO2 L2
(OR)
5. (a) Construct the recursive descent parser for the following L4
grammar. E → E+T | T T → T*F | F F → (E) | id (7M) CO2
(b) Compute the FIRST and FOLLOW for the following grammar. L3
S→iEtS | iEtSeS | aE→b (7M) CO2
UNIT – III
6. (a) Construct Syntax Tree for the following string: a + b ∗ c − d. (7M) CO3 L4
(b) Differentiate S-attributed and L-attributed syntax directed L4
definitions wit examples. (7M) CO3
(OR)
7. (a) Construct SDT scheme for Boolean expressions with an L4
example. (7M) CO3
(b) Show the quadruple, triples and indirect triples for following L2
expression: (x + y) * (y + z) + (x + y + z). (7M) CO3
UNIT – IV
Begin
Prod:=10;
i:=1;
Do begin
Prod:=prod+a[i]*b[i];
i:=i+1;
end
while i<=10
end (7M) CO4
(OR)
9. (a) Explain optimization techniques on basic blocks. (7M) CO5 L2
(b) Explain loop optimization techniques with examples. (7M) CO5 L2
****
(R20)