help-bison
[Top][All Lists]
Advanced

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

Re: Regression in 2.4 ??


From: Nelson Ferreira
Subject: Re: Regression in 2.4 ??
Date: Sun, 09 Nov 2008 16:06:25 -0500


Or maybe bison should give an error when %token<val> is used without a %union ?

On Nov 9, 2008, at 3:59 PM, Nelson Ferreira wrote:


On Nov 9, 2008, at 3:45 PM, Joel E. Denny wrote:

On Sun, 9 Nov 2008, Nelson Ferreira wrote:

Attached is the .y file.
This is a part of the SXEmacs source, where we had a report of a build failure
with bison 2.4 which we tracked down to this behavior.
The relevant files would be under modules/cl.
You can get them from http://downloads.sxemacs.org

As far as defining manually the YYSTYPE I did it by adding on line 30:

typedef int YYSTYPE;

If YYSTYPE needs to default to an int, then it doesn't make sense to
declare semantic types, which are fields of a union YYSTYPE. For example,
you have:

  %token <forkeys>

Bison 2.3 ignored this. Bison 2.4 logically assumes you want a union when
you use a <...> construct.  Moreover, POSIX requires the corrected
behavior as discussed in the NEWS entry for Bison 2.3a.

I'm going to assume the other issues you mentioned are symptoms of this
problem.  Let us know if this doesn't fix them.

Ok, I'll try that, because it seems to be a better way to specify the grammar,
but I still am confused then about what this actually does:

#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED

# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif

I mean, is this not misleading other code that interfaces with yours?
After all you are stating with #define YYSTYPE_IS_DECLARED 1 that YYSTYPE is available
when you cannot actually say that.
AFAICS probably this code should not even be there?






reply via email to

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