Professional Documents
Culture Documents
PART B
12)a)i)Evaluate predictive parsing table and parse the string id+id*id. (7)
And find FIRST and FOLLOW.
E→E+T | T
T→T*F | F
F→(E) | id
ii)Construct Stack implementation of shift reduce parsing for the (6)
grammar
E->E+E
E->E*E
E->(E)
E->id and the input string id1+id2*id3
(or)
b)Construct SLR for the following grammar
S->CC
C->cC/d
(or)
b)i)Give an example to identify the dead code in the DAG. (5)
(ii)Describe the representation of array using DAG with example. (8)
Part C
Analyze the LR parsing algorithm with an example.(15)
(or)
Explain the steps for constructing a DAG.Construct the DAG for the following expression
((x+y)-((x+y)*(x-y)))+((x+y)*(x-y)) (15)