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:
@@ -110,13 +110,13 @@ class CalcLexer implements Calc.Lexer {
|
||||
{
|
||||
final int ARGMAX = 10;
|
||||
int[] arg = new int[ARGMAX];
|
||||
int n = Calc.yysyntaxErrorArguments (ctx, arg, ARGMAX);
|
||||
int n = ctx.yysyntaxErrorArguments (arg, ARGMAX);
|
||||
System.err.print (ctx.yylocation + ": syntax error");
|
||||
for (int i = 1; i < n; ++i)
|
||||
System.err.print ((i == 1 ? ": expected " : " or ")
|
||||
+ Calc.yysymbolName (arg[i]));
|
||||
+ ctx.yysymbolName (arg[i]));
|
||||
if (n != 0)
|
||||
System.err.print (" before " + Calc.yysymbolName (arg[0]));
|
||||
System.err.print (" before " + ctx.yysymbolName (arg[0]));
|
||||
System.err.println ("");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user