Compiler design-BE-WINTER-2020
Compiler design-BE-WINTER-2020
___________
Q.3 (a) Consider the following grammar to construct leftmost and right most 03
derivation for the sentence abab.
SaSbS|bSaS|ε
(b) Write rule(s) to check grammar is left recursive or not. Remove left 04
recursive from the following grammar.
SaBDh
BBb|c
DEF
Eg| ε
Ff| ε
(c) Construct the SLR parsing table for the following Grammar. 07
E E+T | T
T T*F | F
F (E) | id
S -> CC
C -> cC
C -> d
1
Q.5 (a) Define : 1) synthesized attribute 2) inherited attribute 03
(b) Explain any two parameter passing methods. 04
(c) Write SDD for arithmetic expression and Construct annotated parse tree for 07
the input expression (4*7+1)*2 .
*************