summaryrefslogtreecommitdiff
path: root/examples/java
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2020-02-08 15:36:18 +0100
committerAkim Demaille <akim.demaille@gmail.com>2020-02-08 16:17:53 +0100
commit80a43893774263ad5db12883eb35af2d882898e6 (patch)
tree65e9773c9bda5ddf06049cb5ce114d07c11de63a /examples/java
parentef097719eaf5ca80c18c101f21d57741f8178be9 (diff)
downloadbison-80a43893774263ad5db12883eb35af2d882898e6.tar.gz
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.
Diffstat (limited to 'examples/java')
-rw-r--r--examples/java/calc/Calc.y6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/java/calc/Calc.y b/examples/java/calc/Calc.y
index bc832aba..b1d21ac7 100644
--- a/examples/java/calc/Calc.y
+++ b/examples/java/calc/Calc.y
@@ -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 ("");
}