[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 5/7] java: let the Context give access to yyntokens
From: |
Akim Demaille |
Subject: |
[PATCH 5/7] java: let the Context give access to yyntokens |
Date: |
Sun, 9 Feb 2020 14:02:25 +0100 |
* data/skeletons/lalr1.java (Context.yytokens): New.
---
data/skeletons/lalr1.java | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/data/skeletons/lalr1.java b/data/skeletons/lalr1.java
index a85f38b0..c5095ce1 100644
--- a/data/skeletons/lalr1.java
+++ b/data/skeletons/lalr1.java
@@ -855,7 +855,7 @@ b4_dollar_popdef[]dnl
}
]])[
- public final class Context
+ public static final class Context
{
public YYStack yystack;
public int yytoken;
@@ -1027,22 +1027,24 @@ b4_dollar_popdef[]dnl
First, the terminals, then, starting at \a yyntokens_, nonterminals. */
]b4_typed_parser_table_define([String], [tname], [b4_tname])[
+ /* The user-facing name of the symbol whose (internal) number is
+ YYSYMBOL. No bounds checking. */
static String yysymbolName (int yysymbol)
{
return yytnamerr_ (yytname_[yysymbol]);
}
]],
[custom\|detailed],
-[[/* The user-facing name of the symbol whose (internal) number is
- YYSYMBOL. No bounds checking. */
-static String yysymbolName (int yysymbol)
-{
- String[] yy_sname =
+[[ /* The user-facing name of the symbol whose (internal) number is
+ YYSYMBOL. No bounds checking. */
+ static String yysymbolName (int yysymbol)
{
- ]b4_symbol_names[
- };
- return yy_sname[yysymbol];
-}]])[
+ String[] yy_sname =
+ {
+ ]b4_symbol_names[
+ };
+ return yy_sname[yysymbol];
+ }]])[
]b4_parse_trace_if([[
]b4_integral_parser_table_define([rline], [b4_rline],
--
2.25.0
- [PATCH 0/7] Java: add support for parse.error custom|detailed, Akim Demaille, 2020/02/09
- [PATCH 1/7] m4: fix b4_token_format, Akim Demaille, 2020/02/09
- [PATCH 2/7] java: add support for parse.error=detailed, Akim Demaille, 2020/02/09
- [PATCH 5/7] java: let the Context give access to yyntokens,
Akim Demaille <=
- [PATCH 4/7] java: make the syntax error format string translatable, Akim Demaille, 2020/02/09
- [PATCH 3/7] java: introduce yyexpectedTokens, Akim Demaille, 2020/02/09
- [PATCH 6/7] java: add support for parse.error custom, Akim Demaille, 2020/02/09
- [PATCH 7/7] java: provide Context with a more OO interface, Akim Demaille, 2020/02/09