java: don't expose the Context's members

* data/skeletons/lalr1.java (Context): Make data members private.
(Context.getLocation): New.
* examples/java/calc/Calc.y, tests/java.at, tests/local.at: Adjust.
This commit is contained in:
Akim Demaille
2020-02-11 08:14:03 +01:00
parent 8637f2c7d6
commit 126252333d
4 changed files with 19 additions and 12 deletions

View File

@@ -935,7 +935,7 @@ m4_define([AT_YYERROR_DEFINE(java)],
{
int[] arg = new int[ctx.yyntokens];
int n = ctx.yysyntaxErrorArguments (arg, ctx.yyntokens);
System.err.print (]AT_LOCATION_IF([[ctx.yylocation + ": "]]
System.err.print (]AT_LOCATION_IF([[ctx.getLocation () + ": "]]
+ )["syntax error on token @<:@" + ctx.yysymbolName (arg[0]) + "@:>@");
if (1 < n)
{