Is the following grammar ambiguous?
S -> AS | ε
A -> A1 | 0A1 | 01
It's seemed to me that they are ambiguious as
A -> A1->0A11->00111
Again,
A-> 0A1 ->0A11->00111
Am I right?
Is the following grammar ambiguous?
S -> AS | ε
A -> A1 | 0A1 | 01
It's seemed to me that they are ambiguious as
A -> A1->0A11->00111
Again,
A-> 0A1 ->0A11->00111
Am I right?
Yes, you're right. It's ambiguous as there is more than one leftmost derivation for a given string.