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.
This commit is contained in:
Akim Demaille
2012-03-15 14:34:06 +01:00
parent 35880c82dc
commit fc25770394
2 changed files with 6 additions and 10 deletions

7
TODO
View File

@@ -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 Warnings about type tags that are used in printer and dtors, but not
for symbols? 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 ** YYERRCODE
Defined to 256, but not used, not documented. Probably the token Defined to 256, but not used, not documented. Probably the token
number for the error token, which POSIX wants to be 256, but which number for the error token, which POSIX wants to be 256, but which

View File

@@ -485,12 +485,15 @@ m4_ifset([b4_parse_param], [, b4_parse_param]))[
{ {
]b4_parse_param_use([yyoutput], [yylocationp])[ ]b4_parse_param_use([yyoutput], [yylocationp])[
if (!yyvaluep) if (!yyvaluep)
return; return;]
# ifdef YYPRINT dnl glr.c does not feature yytoknum.
m4_if(b4_skeleton, ["yacc.c"],
[[# ifdef YYPRINT
if (yytype < YYNTOKENS) if (yytype < YYNTOKENS)
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
# endif # endif
switch (yytype) ]])dnl
[ switch (yytype)
{ {
]b4_symbol_foreach([b4_symbol_printer])dnl ]b4_symbol_foreach([b4_symbol_printer])dnl
[ default: [ default: