retagged by
878 views
2 votes
2 votes

Consider the grammar:

S → aSa | bSb | aa | bb

A shift-reduce parser works by identifying the handle of each right-sentential form and replacing it by the head of the corresponding production. In this question, we indicate the handle of a right-sentential form by surrounding it by square brackets [...]. Which of the following shows a right-sentential form of the above grammar with the handle properly marked?

 a) 

abab[aababa]

 b) 

ababaS[ababa]

 c) 

ababbS[bbaba]

 d) 

abab[bSb]baba

retagged by

Please log in or register to answer this question.

Related questions

0 votes
0 votes
1 answer
1
Ana_101 asked 6 days ago
72 views
S - A BA - f S fA - b b B dB - ƐB - cFirst(S) =First(A) =First(B) =Follow(S) =Follow(A) =Follow(B) =
2 votes
2 votes
2 answers
2
Subhrangsu asked Apr 16, 2022
9,556 views
Is the following grammar LL(1) ?S→ aABbCD | ϵA→ ASd | ϵB→ Sac| hC | ϵC→ Sf |CgD→ aBD | ϵDraw the LL(1) parsing table for the given grammar.
0 votes
0 votes
1 answer
3
Subhrangsu asked Apr 15, 2022
2,301 views
Compute FIRST and FOLLOW sets:S→ aAC | bBA→ Abc| Abd | eB→ f | gC→ h | i
1 votes
1 votes
3 answers
4
Satbir asked Jan 13, 2020
2,303 views
A grammar is defined as$A \rightarrow BC$$B \rightarrow x \mid Bx$$C \rightarrow B \mid D$$D \rightarrow y \mid Ey$$E \rightarrow z$The non terminal alphabet of the gram...