help-bison
[Top][All Lists]
Advanced

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

Re: Interpreting shift/reduce conflicts from .output file


From: Henrik Sorensen
Subject: Re: Interpreting shift/reduce conflicts from .output file
Date: Sun, 12 Jun 2005 19:07:15 +0200
User-agent: KMail/1.7.2

look in the output file for all of the 'go to state 118', this will give you 
the hints were the grammar are conflicting.

hope this helps
Henrik

On Sunday 12 June 2005 15.04, Frans Englich wrote:
> Hi,
>
> In my grammar I have 2 shift/reduce conflicts. I could find those by
> staring at my grammar until I find where I introduced it, but I thought I
> could learn to make use of Bison's nifty debugging -- the output file.
>
> At the top of my .output file it says:
>
> State 118 conflicts: 2 shift/reduce
>
>
> And state 118 looks like this:
>
> ---------------------------------------------------
> state 118
>
>    72 SequenceType: ItemType .
>    73             | ItemType . STAR
>    74             | ItemType . PLUS
>    75             | ItemType . QUESTION_MARK
>
>     PLUS           shift, and go to state 134
>     STAR           shift, and go to state 135
>     QUESTION_MARK  shift, and go to state 136
>
>     PLUS      [reduce using rule 72 (SequenceType)]
>     STAR      [reduce using rule 72 (SequenceType)]
>     $default  reduce using rule 72 (SequenceType)
>
> ---------------------------------------------------
> State 134, 135, and 136 looks all very similar. For example, state 134
> looks like this:
>
> state 134
>
>    74 SequenceType: ItemType PLUS .
>
>     $default  reduce using rule 74 (SequenceType)
>
>
> I fail to understand what is the problem, and hence how to fix it. AFAICT,
> both (for example) state 134 and 118 reduces the tokens to a SequenceType.
> I don't see where the ambiguity is. I'm neither fully sure about what the
> brackets are communicating in state 118.
>
> Perhaps my confusion can be cleared from what I've written so far?
>
> For those interested, the grammar can be found here:
>
> http://websvn.kde.org/*checkout*/branches/work/kdom/xpath/impl/parser/Parse
>r.output?rev=424401
> http://websvn.kde.org/*checkout*/branches/work/kdom/xpath/impl/parser/Parse
>r.ypp?rev=424401
>
>
> Cheers,
>
>               Frans
>
>
> _______________________________________________
> address@hidden http://lists.gnu.org/mailman/listinfo/help-bison




reply via email to

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