Gene <gene.ressler@gmail.com> writes:>It's also worth noting that any grammar with A->A in it is ambiguous>in a way that should cause LR table generation to fail. How would a>parser know how many times to reduce A->A?

S -> A|B
A -> A
B -> t

This grammar can derive only the word "t", and only in one way. I see
no ambiguity; no word can be derived in two ways in this grammar.

As for warning about these useless cycles, sure, they may indicate a
programming mistake, so better warn about them. I still don't see
that they are a problem as far as their meaning is concerned, nor
wrt. implementability in general. Apparently the Bison implementors
thought so, too, or Bison would produce an error, not a warning.