Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

JIS University, Department of Computer Science and Engineering

Compiler Design (CS604A)


Assignment 2
Due Thursday, June 02, 2021 at 11:59 PM

Consider the following context-free grammar:

A → aBDe
B → cC
C → bB | ε
D→d|ε

where {A, B, C, D} is the set of non-terminal symbols, A is the start symbol and {a,b,c,d,e} is the
set of terminal symbols.

1. For the given grammar, find the left-most and right-most derivations of input string ”acbcbce”.
Show the corresponding parse trees for each of these derivations as part of your answer.

2. Verify whether the above grammar is LL(1) or not. As part of your answer show the FIRST
and FOLLOW sets for each non-terminal symbol.

3. Construct the corresponding non-recursive predictive parsing table for the above grammar.

4. Construct the corresponding SLR parsing table for the above grammar.

You might also like