bug-bison
[Top][All Lists]
Advanced

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

Re: bison small misc


From: Paul Eggert
Subject: Re: bison small misc
Date: Wed, 18 Jan 2006 22:52:35 -0800
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

twlevo <address@hidden> writes:

> GLR test 110 and 111 fail with g++ 3.4.2 but not with g++ 3.3.3
> (it looks like Yet Another Compiler Compilation version issue)

Thanks, I just now discovered that it also fails with GCC 4.0.2.  I
sent a bug report to bug-bison a few minutes ago.  I hope some C++
expert can fix this one.

> data/glr.c line 178, should be __LINE__ not __line__ ?
> same at data/yacc.c line 194
> /* Line __LINE__ of glr.c.  */

__LINE__ is a builtin C macro, right?  So it wouldn't be expanded
inside a C comment like that.

> Makefile.maint line 586, should be bison, not coreutils

The "emit_upload_commands" command doesn't work at all for Bison.  I'm
not sure it's worth the effort to tailor; in the meantime let's just
leave it the same as coreutils.

> Makefile.maint line 366, now year 2006

Thanks.  I fixed that one today, by merging from coreutils.

> the new and nice %union feature is not yet mentioned in NEWS.
> and the notice on %union in TODO file:
> `The #line must now appear *inside* the definition of yystype.'

Thanks for mentioning that.  I installed this:

2006-01-18  Paul Eggert  <address@hidden>

        * NEWS: Document the fact that multiple %unions are now allowed.
        * doc/bison.texinfo (Union Decl): Likewise.
        * TODO: This feature is now implemented, so remove it from
        the wishlist.

Index: NEWS
===================================================================
RCS file: /cvsroot/bison/bison/NEWS,v
retrieving revision 1.140
diff -p -u -r1.140 NEWS
--- NEWS        4 Jan 2006 09:18:37 -0000       1.140
+++ NEWS        19 Jan 2006 06:43:43 -0000
@@ -3,6 +3,9 @@ Bison News
 
 Changes in version 2.1a:
 
+* Bison now allows multiple %union declarations, and concatenates
+  their contents together.
+
 * New warning: unused values
   Typed right-hand side symbols whose value are not used are reported.
   For instance:
@@ -695,8 +698,8 @@ End:
 
 -----
 
-Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
+Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+2004, 2005, 2006 Free Software Foundation, Inc.
 
 This file is part of Bison, the GNU Compiler Compiler.
 
Index: doc/bison.texinfo
===================================================================
RCS file: /cvsroot/bison/bison/doc/bison.texinfo,v
retrieving revision 1.172
diff -p -u -r1.172 bison.texinfo
--- doc/bison.texinfo   11 Jan 2006 22:39:27 -0000      1.172
+++ doc/bison.texinfo   19 Jan 2006 06:43:43 -0000
@@ -3802,10 +3802,15 @@ As an extension to @acronym{POSIX}, a ta
 @end group
 @end example
 
address@hidden
 specifies the union tag @code{value}, so the corresponding C type is
 @code{union value}.  If you do not specify a tag, it defaults to
 @code{YYSTYPE}.
 
+As another extension to @acronym{POSIX}, you may specify multiple
address@hidden declarations; their contents are concatenated.  However,
+only the first @code{%union} declaration can specify a tag.
+
 Note that, unlike making a @code{union} declaration in C, you need not write
 a semicolon after the closing brace.
 
Index: TODO
===================================================================
RCS file: /cvsroot/bison/bison/TODO,v
retrieving revision 1.93
retrieving revision 1.94
diff -p -u -r1.93 -r1.94
--- TODO        13 Jul 2005 11:55:16 -0000      1.93
+++ TODO        19 Jan 2006 06:48:52 -0000      1.94
@@ -92,27 +92,6 @@ It should be improved, in particular whe
 locations, and YYPARSE_PARAMS.  For the time being, it is almost
 recommended to yyprint to steal internal variables...
 
-** Several %unions
-I think this is a pleasant (but useless currently) feature, but in the
-future, I want a means to %include other bits of grammars, and _then_
-it will be important for the various bits to define their needs in
-%union.
-
-When implementing multiple-%union support, bare the following in mind:
-
-- when --yacc, this must be flagged as an error.  Don't make it fatal
-  though.
-
-- The #line must now appear *inside* the definition of yystype.
-  Something like
-
-       {
-       #line 12 "foo.y"
-         int ival;
-       #line 23 "foo.y"
-         char *sval;
-       }
-
 ** %if and the like
 It should be possible to have %if/%else/%endif.  The implementation is
 not clear: should it be lexical or syntactic.  Vadim Maslow thinks it
@@ -345,16 +324,17 @@ the parser with a means to create the (v
 
 -----
 
-Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation,
+Inc.
 
-This file is part of GNU Bison.
+This file is part of Bison, the GNU Compiler Compiler.
 
-GNU Bison is free software; you can redistribute it and/or modify
+Bison is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2, or (at your option)
 any later version.
 
-GNU Bison is distributed in the hope that it will be useful,
+Bison is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.




reply via email to

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