[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bison Files and Token Order
From: |
tim |
Subject: |
Re: Bison Files and Token Order |
Date: |
Tue, 22 Jan 2008 08:02:39 +1100 |
On Mon, 2008-01-21 at 09:30 -0600, Tom Browder wrote:
> Tim, digging into bison a little more, it seems that the problem is
> the use of precedence keywords is not compatible with assigning a
> token number.
>
> I believe the list of tokens has to be first and then list the
> precedence without the token number, e.g.,
>
> %token BLAH 1
> ...
> %token BLAHN 300
>
> %nonassoc BLAH
> %nonassoc BLAHN
>
> I'll try that unless you think I'm going down a rabbit hole (it seems
> to work in my small test case).
>
> -Tom
That looks OK. It used to work (putting token numbers on %left/%right/%
nonassoc), but bison has had a number of incompatible changes over past
years.
The user code also now has to be M4-friendly, otherwise large slabs of
your code silently disappear or strange error messages appear, as I
found.
The upcoming release also flags various (4) long-standing syntaxes as
deprecated eg %pure-parser.
You used to be able to specify the token numbers on left/right/nonassoc.
Now you have to have a separate token declaration. As far as I can tell
the bison info file is not clear about this point.
It might be difficult to get autogen to do this change for you though.
Most tokens are just tokens not left/right etc.
My suggestion to the bison team is
a) Keep incompatible changes to the absolute minimum to reduce impact on
downstream projects.
b) Prominently highlight such changes (more so than the m4 changes were
highlighted).
Tim Josling
- Re: Bison Files and Token Order,
tim <=