bison-patches
[Top][All Lists]
Advanced

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

glr.c: remove (broken) support for YYPRINT


From: Akim Demaille
Subject: glr.c: remove (broken) support for YYPRINT
Date: Thu, 15 Mar 2012 17:16:53 +0100

Unless someone is both happy and fast enough, I will install
this in master (and will try to install it in maint if not
too hard) in a couple of days.


From 1f12f7589674632fa9fcc4f1393903200223464e Mon Sep 17 00:00:00 2001
From: Akim Demaille <address@hidden>
Date: Thu, 15 Mar 2012 14:34:06 +0100
Subject: [PATCH 2/6] glr.c: remove (broken) support for YYPRINT.

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      |    7 -------
 data/c.m4 |    9 ++++++---
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/TODO b/TODO
index 24af226..13c1f85 100644
--- 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?
 
-** 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
diff --git a/data/c.m4 b/data/c.m4
index 78d8e9c..bc7b4c5 100644
--- 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)
-    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
-  switch (yytype)
+])dnl
+[  switch (yytype)
     {
 ]b4_symbol_foreach([b4_symbol_printer])dnl
 [      default:
-- 
1.7.9.2





reply via email to

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