Professional Documents
Culture Documents
Assignment - 2
Assignment - 2
S.No Questions
Q1 Discuss about shift-reduce parsing.
Q2 Consider the following grammar:
S→B |SabS
B→bB| ε
Compute FOLLOW(B)
Q3 Consider the following left recursive grammar and eliminate the left recursion. Also
construct the predictive parsing table:
EE+T | T
TT*F | F
Fa | b
Q4 Check whether the given grammar is LR(0) or not:
S→PQy
P→Sy|x
Q→yS
Q5 Construct the CLR(1) parsing table for the following grammar:
S→AA
A→aA|b
Q6 Give the algorithm to construct LALR parsing table. Construct the LAlRparsing
table for following grammar :
S AA
AaA
Ab
Q7 Find the precedence and function table of the following grammar by using operator
precedence technique.
P→SR | S
R→bSR | bS
S→WbS | W
W→L*W | L
L→id