help-bison
[Top][All Lists]
Advanced

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

Re: Why Bison prefer reduce to shift in dangling else?


From: Hans Aberg
Subject: Re: Why Bison prefer reduce to shift in dangling else?
Date: Tue, 25 Feb 2003 21:29:17 +0100

At 19:19 +0100 2003/02/25, Akim Demaille wrote:
>| I am swamped by the following dangling else problem. Bison prefers reduce to
>| shift for the following gramma. Any suggestions to resolve this problem will
>| be appreciated.
>
>If it does, that's a serious bug.  I very much doubt it reduces here,
>check your files again, it certainly shifts.

Bison prefers shift over reduce (as in the Bison manual sec. 5.2). So this
is probably a misunderstanding: So just forgetting about it will give the
right parsing.

But it is better to use %nonassoc, as the grammr then becomes fully specified.

For some reason, the Bison manual, sec. 5.2, does not mention the %nonassoc
method. -- I think it should. It would be good if somebody added that, I
think. (Sorry, I can't do that right now.)

  Hans Aberg






reply via email to

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