retagged by
839 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

2 votes
2 votes
2 answers
1
Subhrangsu asked Apr 16, 2022
8,574 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
2
Subhrangsu asked Apr 15, 2022
2,022 views
Compute FIRST and FOLLOW sets:S→ aAC | bBA→ Abc| Abd | eB→ f | gC→ h | i
1 votes
1 votes
3 answers
3
Satbir asked Jan 13, 2020
2,251 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...