diff options
author | Akim Demaille <akim.demaille@gmail.com> | 2020-04-28 07:46:33 +0200 |
---|---|---|
committer | Akim Demaille <akim.demaille@gmail.com> | 2020-04-28 07:56:00 +0200 |
commit | 11027558c8a304012f7336933061a47ca31e81b0 (patch) | |
tree | bf3c22893729187ec432f5c39eed1b0547f130f7 /examples/java | |
parent | cd4e799da482d0fdfc2305ff66a9ea43cea5ad7b (diff) | |
download | bison-11027558c8a304012f7336933061a47ca31e81b0.tar.gz |
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.
Diffstat (limited to 'examples/java')
-rw-r--r-- | examples/java/calc/Calc.y | 2 | ||||
-rw-r--r-- | examples/java/simple/Calc.y | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/java/calc/Calc.y b/examples/java/calc/Calc.y index 8070e0c1..d0b507f3 100644 --- a/examples/java/calc/Calc.y +++ b/examples/java/calc/Calc.y @@ -150,7 +150,7 @@ class CalcLexer implements Calc.Lexer { end.set(reader.getPosition()); switch (ttype) { case StreamTokenizer.TT_EOF: - return EOF; + return YYEOF; case StreamTokenizer.TT_EOL: end.line += 1; end.column = 0; diff --git a/examples/java/simple/Calc.y b/examples/java/simple/Calc.y index 59df5758..7f6dacd7 100644 --- a/examples/java/simple/Calc.y +++ b/examples/java/simple/Calc.y @@ -93,7 +93,7 @@ class CalcLexer implements Calc.Lexer { int ttype = st.nextToken(); switch (ttype) { case StreamTokenizer.TT_EOF: - return EOF; + return YYEOF; case StreamTokenizer.TT_EOL: return (int) '\n'; case StreamTokenizer.TT_WORD: |