P.E.S. College of Engineering, Mandya - 571 401
P.E.S. College of Engineering, Mandya - 571 401
P.E.S. College of Engineering, Mandya - 571 401
1
U.S.N
Contd…2
P15CS63 Page No... 2
c. Construct LR(0) item for given grammar : A → (A) | a 8
6 a. Write the algorithm for constructing set of LR(1) items. 8
b. Construct LALR parsing table for the following grammar :
S → CC 12
C → cC | d
UNIT - IV
7 a. Define the following terms with an example :
i) Syntax directed definition
ii) Inherited attribute 10
iii) Synthesized attribute
iv) Annotated parse tree
b. Give the syntax directed definition to process a simple variable declaration in C and draw
10
dependency graph for int id1, id2, id3.
8 a. Explain in detail different dynamic storage allocation strategies. 10
b. Describe an activation record. Explain the purpose of each item in an activation record with
10
an example.
UNIT - V
9 a. What is DAG? Write DAG for the expression :
4
((x+y) – ((x+y) * (x – y))) + ((x+y) * (x – y).
b. Name the different types of representation of 3-address code and translate the given
arithmetic expression into each type. 6
a–b*c+d–a+b
c. Describe the method of generating intermediate code for the branching statement (if/if-else). 10
10 a. Briefly explain main issues in code generation. 10
b. Explain the code generation algorithm and generate code for the following expression :
10
x = (a - b) + (a + c).
****