In my notebook I wrote:
The necessary condition for grammar ambiguity is
- It contains the rule
A->BB, where A and B are non-terminals. - OR it contains the rule
A->a|b, where A is a non-terminal and {a,b} are terminals.
Would you please confirm or refute this statement?
That's not true because there are other ambiguous grammars that don't have either of those rules.
For example
cccan be produced byA -> Bc -> ccbut also byA -> cC -> ccin the following grammar: