You are on page 1of 1

KIET Group of Institutions, Ghaziabad

B.Tech CSE Semester – 5th Session 2022-23


Assignment – 2
Compiler Design (KCS-502)

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:
EE+T | T
TT*F | F
Fa | 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
AaA
Ab
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

You might also like