[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Why Bison prefer reduce to shift in dangling else?
From: |
Lunjin Lu |
Subject: |
RE: Why Bison prefer reduce to shift in dangling else? |
Date: |
Mon, 24 Feb 2003 10:15:05 -0500 |
Dear Hans,
I tried to use both
%left THEN
%left ELSE
and
%left ELSE
%left THEN
but bison still does not make the right choice. Is there any way to force
bison to choose shift in a shift/reduce conflict?
Many thanks!
Lunjin Lu
> -----Original Message-----
> From: Hans Aberg [mailto:address@hidden
> Sent: Saturday, February 22, 2003 4:28 AM
> To: Lunjin Lu
> Cc: address@hidden; address@hidden
> Subject: Re: Why Bison prefer reduce to shift in dangling else?
>
>
> PLease reply to: address@hidden
>
> At 23:01 -0500 2003/02/21, Lunjin Lu 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.
>
> >%token NIL IF THEN ELSE
>
> You can use the %left (etc) (see Bison manual) to give different
> priorities
> to the tokens THEN & ELSE.
>
> Hans Aberg
>
>
Re: Why Bison prefer reduce to shift in dangling else?, Akim Demaille, 2003/02/25
RE: Why Bison prefer reduce to shift in dangling else?, Lunjin Lu, 2003/02/25