]> git.saurik.com Git - bison.git/commitdiff
glr.c: remove (broken) support for YYPRINT.
authorAkim Demaille <akim@lrde.epita.fr>
Thu, 15 Mar 2012 13:34:06 +0000 (14:34 +0100)
committerAkim Demaille <akim@lrde.epita.fr>
Mon, 19 Mar 2012 09:05:14 +0000 (10:05 +0100)
YYPRINT uses yytoknum which glr does not define.  Since YYPRINT
is considered obsolete, and did not work, don't fix its support,
remove it from glr.c.

* data/c.m4 (yy_symbol_value_print): Use YYPRINT only for yacc.c.
* TODO: Done.

TODO
data/c.m4

diff --git a/TODO b/TODO
index 24af226c42ab757c223c919b968ead8d68ec916d..13c1f85877e1e1dd22ac69e3b1f8c629af0da95f 100644 (file)
--- a/TODO
+++ b/TODO
@@ -43,13 +43,6 @@ Enhance bench.pl with %b to run different bisons.
 Warnings about type tags that are used in printer and dtors, but not
 for symbols?
 
 Warnings about type tags that are used in printer and dtors, but not
 for symbols?
 
-** YYPRINT
-glr.c inherits its symbol_print function from c.m4, which supports
-YYPRINT.  But to use YYPRINT yytoknum is needed, which not defined by
-glr.c.
-
-Anyway, IMHO YYPRINT is obsolete and should be restricted to yacc.c.
-
 ** YYERRCODE
 Defined to 256, but not used, not documented.  Probably the token
 number for the error token, which POSIX wants to be 256, but which
 ** YYERRCODE
 Defined to 256, but not used, not documented.  Probably the token
 number for the error token, which POSIX wants to be 256, but which
index 78d8e9c0b7f82c896e6efd41a9ae84cf9ef44ecf..c0cf9e4d55c1896a1b4161c618bc9aac88822ffb 100644 (file)
--- a/data/c.m4
+++ b/data/c.m4
@@ -485,12 +485,15 @@ m4_ifset([b4_parse_param], [, b4_parse_param]))[
 {
 ]b4_parse_param_use([yyoutput], [yylocationp])[
   if (!yyvaluep)
 {
 ]b4_parse_param_use([yyoutput], [yylocationp])[
   if (!yyvaluep)
-    return;
-# ifdef YYPRINT
+    return;]
+dnl glr.c does not feature yytoknum.
+m4_if(b4_skeleton, ["yacc.c"],
+[[# ifdef YYPRINT
   if (yytype < YYNTOKENS)
     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
 # endif
   if (yytype < YYNTOKENS)
     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
 # endif
-  switch (yytype)
+]])dnl
+[  switch (yytype)
     {
 ]b4_symbol_foreach([b4_symbol_printer])dnl
 [      default:
     {
 ]b4_symbol_foreach([b4_symbol_printer])dnl
 [      default: