INDERPRASTHA ENGINEERING COLLEGE, GHAZIABAD
Department( AIML)
Assignment (Odd Semester 2022-23)
Compiler Design (KCS-502)
Q.1 Attempt all parts:
1) Differentiate between parse tree, Syntax tree and annotated parse tree with example.
2) Consider the following grammar
E-> E+T/T
T-> TF/F
F-> F*/a/b
Construct the SLR parsing table for this grammar.Also parse the input string a*b+a using the
grammar.
3)Consider the grammar
S’->S#
S-> qABC
A-> a|bbD
B-> a|e
C-> b|e
D-> c|e
Design a LL(1) parsing table for the grammar
4) Explain Recursive descent parsing.Consider the following grammar-
E → iE’
E’ → +iE’/𝜖
Draw the parse tree for input string i+i $.
5) What is CLR (1) grammar? For the following grammar check whether it is CLR (1) or not
S →Aa / bAc / Bc / bBa
A→d
B→d