Assignments 3 39copies
Assignments 3 39copies
2. Write LMD, RMD and parse tree for the string "aaabbabbba" that belongs to the given
grammar:
S-> aB | bA
A-> a | aS | bAA
B-> b | bS | aBB.
3. Construct LL(1) parsing table and show the moves made for respective strings for the
following grammar:
S → a | (L)
L → L,S | S
Show moves for: (a,(a,a))
4. Construct a PDA for the following languages and write the ID as directed:
a) L = {anb2n | n ≥ 1}; Write the ID for string: aabbbb.
b) L = {wCwR | w € (a + b)* } where wR is the reverse of the string w. Write the ID for
string: aababb.
5. Identify LR(0) canonical items for the following and Write LR(0) & SLR(1) parsing table
for the following. Also, explain the parsing of a suitable string.
S → AA
A → aA | b
Due Date: 04/03/2024