mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
java: prefer null to YYSYMBOL_YYEMPTY
That's one nice benefit from using enums. * data/skeletons/lalr1.java (YYSYMBOL_YYEMPTY): No longer define it. Use 'null' instead. * examples/java/calc/Calc.y, tests/local.at: Adjust.
This commit is contained in:
3
TODO
3
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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 ("");
|
||||
|
||||
@@ -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) + "@:>@");
|
||||
}
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user