Hi, > Bison does not do that matching for the longest rule, so you end up with an
> grammar ambiguity. If one writes it like you did, you will end up with a
> state
> Token -> A .
> C -> A . B
> That is, a shift/reduce conflict. If you want to have the longest match,
> you should shift here, which Bison does by default, so you can ask it to if bison shifts by default then why does the output file with the verbose option give $default [reduce ....] > ignore the conflict by %expect.
>
> You might also try a precedence declaration like
> %nonassoc A
> %nonassoc B
> to see if the shift/reduce conflict is resolved.
>
> The stuff above applies to a non-GLR parser.
>
> Hans Aberg
Bye. Regds Ram