* data/yacc.cc, data/glr.cc (yydestruct): Accept an additional

argument, an informative message.
Call YY_SYMBOL_PRINT.
Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
* data/lalr1.cc (destruct_): Likewise.
In addition, no longer depend on b4_yysymprint_generate and
b4_yydestruct_generate to generate these functions, do it "by
hand".
This commit is contained in:
Akim Demaille
2004-09-06 10:29:52 +00:00
parent e757bb10bc
commit a0e68930d8
5 changed files with 81 additions and 79 deletions

View File

@@ -352,6 +352,7 @@ m4_define([b4_yydestruct_generate],
]$1([yydestruct],
[static void],
[[const char *yymsg], [yymsg]],
[[int yytype], [yytype]],
[[YYSTYPE *yyvaluep], [yyvaluep]]b4_location_if([,
[[YYLTYPE *yylocationp], [yylocationp]]]))[
@@ -360,6 +361,10 @@ m4_define([b4_yydestruct_generate],
(void) yyvaluep;
]b4_location_if([ (void) yylocationp;
])[
if (!yymsg)
yymsg = "Deleting";
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
switch (yytype)
{
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_destructors]))[