mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
java: clean up the definition of token kinds
From
public interface Lexer {
/* Token kinds. */
/** Token number, to be returned by the scanner. */
static final int YYEOF = 0;
/** Token number, to be returned by the scanner. */
static final int YYERRCODE = 256;
/** Token number, to be returned by the scanner. */
static final int YYUNDEF = 257;
/** Token number, to be returned by the scanner. */
static final int BANG = 258;
...
/** Deprecated, use b4_symbol(0, id) instead. */
public static final int EOF = YYEOF;
to
public interface Lexer {
/* Token kinds. */
/** Token "end of file", to be returned by the scanner. */
static final int YYEOF = 0;
/** Token error, to be returned by the scanner. */
static final int YYerror = 256;
/** Token "invalid token", to be returned by the scanner. */
static final int YYUNDEF = 257;
/** Token "!", to be returned by the scanner. */
static final int BANG = 258;
...
/** Deprecated, use YYEOF instead. */
public static final int EOF = YYEOF;
* data/skeletons/java.m4 (b4_token_enum): Display the symbol's tag in
comment.
* data/skeletons/lalr1.java: Address overquotation issue.
* examples/java/calc/Calc.y, examples/java/simple/Calc.y: Use YYEOF,
not EOF.
This commit is contained in:
@@ -137,9 +137,14 @@ m4_define([b4_integral_parser_table_define],
|
||||
# ------------------------
|
||||
# Output the definition of this token as an enum.
|
||||
m4_define([b4_token_enum],
|
||||
[b4_token_format([ /** Token number, to be returned by the scanner. */
|
||||
static final int %s = %s;
|
||||
], [$1])])
|
||||
[b4_token_visible_if([$1],
|
||||
[m4_format([[ /** Token %s, to be returned by the scanner. */
|
||||
static final int %s = %s%s;
|
||||
]],
|
||||
b4_symbol([$1], [tag]),
|
||||
b4_symbol([$1], [id]),
|
||||
b4_symbol([$1], b4_api_token_raw_if([[number]], [[user_number]])))])])
|
||||
|
||||
|
||||
# b4_token_enums
|
||||
# --------------
|
||||
|
||||
@@ -180,7 +180,7 @@ import java.text.MessageFormat;
|
||||
*/
|
||||
public interface Lexer {
|
||||
]b4_token_enums[
|
||||
/** Deprecated, use b4_symbol(0, id) instead. */
|
||||
/** Deprecated, use ]b4_symbol(0, id)[ instead. */
|
||||
public static final int EOF = ]b4_symbol(0, id)[;
|
||||
|
||||
]b4_locations_if([[
|
||||
|
||||
Reference in New Issue
Block a user