diff --git a/TODO b/TODO index 1e589ddc..6d5a1480 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,7 @@ * Bison 3.6 +** syntax_error_arguments +Don't store the lookahead if !argv. + ** Documentation - yyexpected_tokens in all the languages. - YYNOMEM diff --git a/data/skeletons/lalr1.java b/data/skeletons/lalr1.java index 328c8bf7..f2e64e44 100644 --- a/data/skeletons/lalr1.java +++ b/data/skeletons/lalr1.java @@ -55,7 +55,7 @@ b4_use_push_for_pull_if([ m4_define([b4_define_state],[[ /* Lookahead and lookahead in internal form. */ int yychar = YYEMPTY_; - SymbolKind yytoken = SymbolKind.YYSYMBOL_YYEMPTY; + SymbolKind yytoken = null; /* State. */ int yyn = 0; @@ -681,7 +681,7 @@ b4_dollar_popdef[]dnl { ++yynerrs; if (yychar == YYEMPTY_) - yytoken = SymbolKind.YYSYMBOL_YYEMPTY; + yytoken = null; yyreportSyntaxError (new Context (yystack, yytoken]b4_locations_if([[, yylloc]])[)); } @@ -795,7 +795,7 @@ b4_dollar_popdef[]dnl { /* Lookahead and lookahead in internal form. */ this.yychar = YYEMPTY_; - this.yytoken = SymbolKind.YYSYMBOL_YYEMPTY; + this.yytoken = null; /* State. */ this.yyn = 0; @@ -972,7 +972,7 @@ b4_dollar_popdef[]dnl to an error action in a later state. */ int yycount = 0; - if (yyctx.getToken () != SymbolKind.YYSYMBOL_YYEMPTY) + if (yyctx.getToken () != null) { yyarg[yycount++] = yyctx.getToken (); yycount += yyctx.getExpectedTokens (yyarg, 1, yyargn); diff --git a/examples/java/calc/Calc.y b/examples/java/calc/Calc.y index 790f6f47..edccb94c 100644 --- a/examples/java/calc/Calc.y +++ b/examples/java/calc/Calc.y @@ -129,7 +129,7 @@ class CalcLexer implements Calc.Lexer { } { Calc.SymbolKind lookahead = ctx.getToken (); - if (lookahead != Calc.SymbolKind.YYSYMBOL_YYEMPTY) + if (lookahead != null) System.err.print (" before " + ctx.yysymbolName (lookahead)); } System.err.println (""); diff --git a/tests/local.at b/tests/local.at index cd16419b..1b656a80 100644 --- a/tests/local.at +++ b/tests/local.at @@ -982,7 +982,7 @@ m4_define([AT_YYERROR_DEFINE(java)], + )["syntax error"); { Calc.SymbolKind token = ctx.getToken (); - if (token != Calc.SymbolKind.YYSYMBOL_YYEMPTY) + if (token != null) System.err.print (" on token @<:@" + ctx.yysymbolName (token) + "@:>@"); } {