bug-bison
[Top][All Lists]
Advanced

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

Re: Bison Files and Token Order


From: Tim Josling
Subject: Re: Bison Files and Token Order
Date: Tue, 22 Jan 2008 16:22:48 +1100

On Mon, 2008-01-21 at 17:04 -0500, Joel E. Denny wrote:
> On Tue, 22 Jan 2008, tim wrote:
> > 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.
> 
> I haven't encountered this in any recent releases.  Please post an example 
> if the problem persists.
> 

You are right this has been fixed, in terms of the provided skeletons. 

In my lisp skeleton it is still a problem because some things are still
not escaped going into m4.

I need to apply edit changes to the actions, which may contain commas,
parentheses etc. 

In the official grammar skeletons the actions are just copied across
verbatim.

yacc.c:

  switch (yyn)
    {
      ]b4_user_actions[
      default: break;
    }

So in the official grammar skeletons the problem does not occur.

In my case I apply m4 functions to the actions.

This means, in my case, that if the actions have embedded commas or
mismatched parentheses, then the m4 step fails in an ugly way. There may
be some m4 magic way around this but I haven't been able to find it.
(please tell me if there is a way around this!).

>From my perspective it would be a win if the commas and parentheses in
actions were escaped. I would be happy to submit a patch for this if
needed.

> > a) Keep incompatible changes to the absolute minimum to reduce impact on
> > downstream projects.
> 
> Of course, we try.  Please continue to report problems as you find them.

--no-parser option was dropped in 2.3a - this should be mentioned in the
NEWS file.

=

Here is another issue I came across. If you specify a token with number
0, numerous spurious messages (reduce/reduce conflicts) will generally
appear and the resulting grammar doesn't work.

It is mentioned in the NEWS file that TK_EOF can be specified. It gives
an example where it is 0 (so EOF is zero?). But it is not mentioned in
the manual anywhere I can find that using a token value of zero has
these specific implications. The manual just says the token number must
be an integer, that is: ... -2, -1, 0, +1, +2, ... .

Regards,
Tim Josling





reply via email to

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