CD Model Exam Set 2
CD Model Exam Set 2
NO:
(ii) Construct parsing table for the grammar and find moves
made by predictive parser on input 1d+id*id and find FIRST and
FOLLOW. (10)
E→E+T/T
T→T*F/F
F→ (E)/id
OR
b) (i) Explain ambiguous grammer
G: E→E+E| E*E| (E) | -E| id for the sentence
id+id*id.
(ii) Construct SLR parsing Table for the following belong to that grammar or not.(15)
grammer: (i) (a,a) (ii) (a, (a ,a)) (iii) (a, ((a , a), (a , a)) )
G: E→E+T| T,T→T*F| F,F→(E) | id.
15. a) Construct DAG and optimal target code for the expression
x=((a+b)/(b-c))-(a+b)*(b-c)+/. And What are the advantages of
DAG representation. (13)
OR
(b) Explain global data flow analysis with necessary equations.(13)