S->aAB
A->bBb
B->A|epsilon
It seems that the string abbbb
can be derived by using more than one ways.
After using the starting production and the production for A, we get:
S=>abBbB
.
From here, either of the B's can be replaced with epsilon and the other one replaced with bBb. So, there are two ways of deriving abbbb
.
Isn't this ambiguous grammar?
It's a question from Formal Languages and Automata by Peter Linz (5th edition) Exercise 5.2.16