Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Hall Ticket Number:

(R20)
R.V.R & J.C COLLEGE OF ENGINEERING
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
B.TECH. DEGREE EXAMINATION

Semester VI [Third Year]

PROFESSIONAL ELECTIVE – II
CSE – 324 (CSE L04) COMPILER DESIGN

Time: Three hours Maximum Marks: 70

Answer Question No.1 compulsorily. (14 x 1 = 14)


Answer One Question from each unit. (4 x 14 = 56)

1. Answer the following: COs Blooms


Levels
(a) Define Lexeme, Token and pattern. CO1 L1
(b) List out the cousins of a compiler. CO1 L1
(c) Define LR(0) item. CO2 L1
(d) What is Handle pruning? CO2 L1
(e) Differentiate Top down and Bottom-up Parsing. CO2 L4
(f) What are the different types of conflicts in shift reduce parsing. CO2 L1
(g) Define semantic analysis. CO3 L1
(h) Differentiate synthesized and inherited attributes. CO3 L4
(i) Write the types of intermediate code representations. CO3 L1
(j) Define flow graph. CO4 L1
(k) Give the example of code optimization. CO4 L1
(l) What is basic block. CO5 L1
(m) Define Symbol Table. CO5 L1
(n) Define peephole optimization. CO5 L1

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

8. (a) Explain code generation algorithm. Generating Code for L2


Assignment Statements: The assignment statement d:= (a-b)
+ (a-c) + (a-c). (7M) CO4
(b) Demonstrate an algorithm for basic block construction. L4
Construct the basic blocks of the following code fragment for
dot product of two vectors a and b of length 10:

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)

You might also like