[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bison 1.50 Bug - Parsing Error - Examples Enclosed - Correct Attachm
From: |
Paul Eggert |
Subject: |
Re: Bison 1.50 Bug - Parsing Error - Examples Enclosed - Correct Attachments |
Date: |
Sat, 12 Oct 2002 16:23:45 -0700 (PDT) |
> From: "Jim Gifford" <address@hidden>
> Date: Sat, 12 Oct 2002 10:58:43 -0700
>
> I was received numerous errors while compiling the new kbd package.
Thanks for the bug report. I installed the following patch; it should
appear in the next release.
2002-10-12 Paul Eggert <address@hidden>
* data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
* data/glr.c, data/lalr1.cc, data/yacc.c:
Output token definitions before the first part of user declarations.
Fixes compatibility problem reported by Jim Gifford for kbd in
<http://mail.gnu.org/pipermail/bug-bison/2002-October/001672.html>.
Index: data/c.m4
===================================================================
RCS file: /cvsroot/bison/bison/data/c.m4,v
retrieving revision 1.5
diff -p -u -r1.5 c.m4
--- data/c.m4 7 Sep 2002 06:31:32 -0000 1.5
+++ data/c.m4 12 Oct 2002 23:16:24 -0000
@@ -107,8 +107,7 @@ m4_define([b4_token_enum],
m4_define([b4_token_defines],
[m4_if(address@hidden, [[]], [],
[/* Tokens. */
-#ifndef YYTOKENTYPE
-# if defined (__STDC__) || defined (__cplusplus)
+#if defined (__STDC__) || defined (__cplusplus)
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
@@ -116,10 +115,7 @@ m4_map_sep([ b4_token_enum], [,
],
address@hidden)
};
-# endif
- /* POSIX requires `int' for tokens in interfaces. */
-# define YYTOKENTYPE int
-#endif /* !YYTOKENTYPE */
+#endif
m4_map([b4_token_define], address@hidden)
])
])
Index: data/glr.c
===================================================================
RCS file: /cvsroot/bison/bison/data/glr.c,v
retrieving revision 1.9
diff -p -u -r1.9 glr.c
--- data/glr.c 12 Aug 2002 14:02:32 -0000 1.9
+++ data/glr.c 12 Oct 2002 23:16:25 -0000
@@ -136,10 +136,10 @@ b4_copyright([Skeleton parser for GLR pa
#define yynerrs b4_prefix[]nerrs
b4_location_if([#define yylloc b4_prefix[]lloc])])
-/* Copy the first part of user declarations. */
-b4_pre_prologue
+b4_token_defines(b4_tokens)
-b4_token_defines(b4_tokens)[
+/* Copy the first part of user declarations. */
+b4_pre_prologue[
/* Enabling traces. */
#ifndef YYDEBUG
Index: data/lalr1.cc
===================================================================
RCS file: /cvsroot/bison/bison/data/lalr1.cc,v
retrieving revision 1.7
diff -p -u -r1.7 lalr1.cc
--- data/lalr1.cc 6 Sep 2002 11:54:05 -0000 1.7
+++ data/lalr1.cc 12 Oct 2002 23:16:25 -0000
@@ -104,14 +104,13 @@ b4_copyright([C++ Skeleton parser for LA
/* Using locations. */
#define YYLSP_NEEDED b4_locations_flag
+b4_token_defines(b4_tokens)
+
/* Copy the first part of user declarations. */
b4_pre_prologue
/* Line __line__ of __file__. */
#line __oline__ "__ofile__"
-
-/* Tokens. */
-b4_token_defines(b4_tokens)
/* Enabling traces. */
#ifndef YYDEBUG
Index: data/yacc.c
===================================================================
RCS file: /cvsroot/bison/bison/data/yacc.c,v
retrieving revision 1.15
diff -p -u -r1.15 yacc.c
--- data/yacc.c 11 Oct 2002 20:53:39 -0000 1.15
+++ data/yacc.c 12 Oct 2002 23:16:25 -0000
@@ -166,10 +166,10 @@ m4_if(b4_prefix[], [yy], [],
#define yynerrs b4_prefix[]nerrs
b4_location_if([#define yylloc b4_prefix[]lloc])])
+b4_token_defines(b4_tokens)
+
/* Copy the first part of user declarations. */
b4_pre_prologue
-
-b4_token_defines(b4_tokens)
/* Enabling traces. */
#ifndef YYDEBUG
Re: Bison 1.50 Bug - Parsing Error - Examples Enclosed - Correct Attachments, Akim Demaille, 2002/10/13