SYNERGY INSTITUTE OF ENGINEERING AND TECHNOLOGY, DHENKANAL
Near NH-55, Banamali Prasad – 759001
Assignment-II [CO2]
Full Marks-40 Duration-Within 1 Week
from Notification
Name- Registration No-
Subject with Code: Compiler Design (RCS6C002) Course & Branch: B. Tech: CSE
Year & Semester: 3rd & VI
Section-A
Answer All Questions
1. What is Reduce-Reduce conflict in CLR Parser. [2 Marks][L2]
2. Calculate FIRST and FOLLOW for all non-terminals. [2 Marks][L3]
S→AB
A→a|↋
B→b
3. Differentiate between Top-Down and Bottom-Up Parsing. [2 Marks}[L2]
4. Test the following Grammar LL(1) or not? [2 Marks][L3]
S→AaAb | BbBa
A→↋
B→↋
Section-B
Answer All Questions
1. Construct the CLR Parser for the following Grammar. [6 Marks[]L3]
S→(L) | a
L→L,S | S
2. Show that the following Grammar is LR(1) but not LALR(1). [6 Marks][L3]
S→Aa | bAc | Bc | bBa
A→d
B→d
Section-C
Answer All Questions
1. Find LR(0) Automaton for the following Grammar, Construct SLR parsing table
and show the moves for “ id*id+id”. [10 Marks][L3]
E→E+T | T
T→T*F | F
F→ (E) | id
2. Construct Predictive Top-Down Parsing table for the following Grammar and show
the moves for input “id+id*id”. [10 Marks][L3]
E→TE’
E’→+TE’ | ↋
T→FT’
T’→*FT’ | ↋
F→(E) | id