mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-12 13:53:03 +00:00
java: use SymbolType
The Java enums are very different from the C model. As a consequence, one cannot "build" an enum directly from an integer, we must retrieve it. That's the purpose of the SymbolType.get class method. * data/skeletons/java.m4 (b4_symbol_enum, b4_case_code_symbol) (b4_declare_symbol_enum): New. * data/skeletons/lalr1.java: Use SymbolType, SymbolType.YYSYMBOL_YYEMPTY, etc. * examples/java/calc/Calc.y, tests/local.at: Adjust.
This commit is contained in:
@@ -975,12 +975,12 @@ m4_define([AT_YYERROR_DEFINE(java)],
|
||||
System.err.print (]AT_LOCATION_IF([[ctx.getLocation () + ": "]]
|
||||
+ )["syntax error");
|
||||
{
|
||||
int token = ctx.getToken ();
|
||||
if (token != ctx.EMPTY)
|
||||
Calc.SymbolType token = ctx.getToken ();
|
||||
if (token != Calc.SymbolType.YYSYMBOL_YYEMPTY)
|
||||
System.err.print (" on token @<:@" + ctx.yysymbolName (token) + "@:>@");
|
||||
}
|
||||
{
|
||||
int[] arg = new int[ctx.NTOKENS];
|
||||
Calc.SymbolType[] arg = new Calc.SymbolType[ctx.NTOKENS];
|
||||
int n = ctx.yyexpectedTokens (arg, ctx.NTOKENS);
|
||||
if (0 < n)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user