help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ambiguous Grammar: Clarification


From: Ramaswamy
Subject: Re: Ambiguous Grammar: Clarification
Date: Tue, 27 May 2003 13:46:20 +0200

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]