Consider the following grammar:
Which of the following can be the viable prefixes?
b will be pushed and before pushing next letter b will be reduced to X, so baab as viable prefix is not possible
with similar reason 3 and 4 are not viable prefixes,
but aab is
a.ab (a is pushed,no handle found)
aa.b (a is pushed and viable prefix is aa still no handle found)
aab. (b is pushed and handle found and will be reduced in next step but aab is a valid viable prefix)
For practice you can refer this one
check this link.
Why can't C be the answer?
By following MK Utkarsh sir's method for option C -
aaab.ab [ b is reducible to X]
aaaX.ab [ aX is reducible to X]
aaX.ab [ aX is reducible to X]
aX.ab [ aX is reducible to X]
Xab. [ b is reducible to X]
XaX. [ aX is reducible to X]
XX. [ XX is reducible to S]
Where am I going wrong ? Can someone please point out ?
@ Mk Utkarsh sir, @ Anup dogrial sir.