mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
java: provide Context with a more OO interface
* data/skeletons/lalr1.java (yyexpectedTokens) (yysyntaxErrorArguments): Make them methods of Context. (Context.yysymbolName): New. * tests/local.at: Adjust.
This commit is contained in:
@@ -934,14 +934,14 @@ m4_define([AT_YYERROR_DEFINE(java)],
|
||||
public void yyreportSyntaxError (Calc.Context ctx)
|
||||
{
|
||||
int[] arg = new int[ctx.yyntokens];
|
||||
int n = Calc.yysyntaxErrorArguments (ctx, arg, ctx.yyntokens);
|
||||
int n = ctx.yysyntaxErrorArguments (arg, ctx.yyntokens);
|
||||
System.err.print (]AT_LOCATION_IF([[ctx.yylocation + ": "]]
|
||||
+ )["syntax error on token @<:@" + Calc.yysymbolName(arg[0]) + "@:>@");
|
||||
+ )["syntax error on token @<:@" + ctx.yysymbolName (arg[0]) + "@:>@");
|
||||
if (1 < n)
|
||||
{
|
||||
System.err.print (" (expected:");
|
||||
for (int i = 1; i < n; ++i)
|
||||
System.err.print (" @<:@" + Calc.yysymbolName (arg[i]) + "@:>@");
|
||||
System.err.print (" @<:@" + ctx.yysymbolName (arg[i]) + "@:>@");
|
||||
System.err.print (")");
|
||||
}
|
||||
System.err.println ("");
|
||||
|
||||
Reference in New Issue
Block a user