mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-17 08:13:02 +00:00
java: handle eof in yytranslate
* data/skeletons/lalr1.java (yytranslate_): Handle eof here, as is done in lalr1.cc. * tests/javapush.at: Adjust.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
# Java skeleton for Bison -*- autoconf -*-
|
# Java skeleton for Bison -*- autoconf -*-
|
||||||
|
|
||||||
# Copyright (C) 2007-2015, 2018-2019 Free Software Foundation, Inc.
|
# Copyright (C) 2007-2015, 2018-2019 Free Software Foundation, Inc.
|
||||||
|
|
||||||
@@ -631,17 +631,9 @@ b4_dollar_popdef[]dnl
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Convert token to internal form. */
|
/* Convert token to internal form. */
|
||||||
if (yychar <= Lexer.EOF)
|
yytoken = yytranslate_ (yychar);]b4_parse_trace_if([[
|
||||||
{
|
yySymbolPrint ("Next token is", yytoken,
|
||||||
yychar = yytoken = Lexer.EOF;]b4_parse_trace_if([[
|
yylval]b4_locations_if([, yylloc])[);]])[
|
||||||
yycdebug ("Now at end of input.\n");]])[
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
yytoken = yytranslate_ (yychar);]b4_parse_trace_if([[
|
|
||||||
yySymbolPrint ("Next token is", yytoken,
|
|
||||||
yylval]b4_locations_if([, yylloc])[);]])[
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If the proper action on seeing token YYTOKEN is to reduce or to
|
/* If the proper action on seeing token YYTOKEN is to reduce or to
|
||||||
detect an error, take that action. */
|
detect an error, take that action. */
|
||||||
@@ -1026,7 +1018,9 @@ b4_dollar_popdef[]dnl
|
|||||||
}
|
}
|
||||||
]],
|
]],
|
||||||
[[ {
|
[[ {
|
||||||
if (0 <= t && t <= yyuser_token_number_max_)
|
if (t <= 0)
|
||||||
|
return Lexer.EOF;
|
||||||
|
else if (t <= yyuser_token_number_max_)
|
||||||
return yytranslate_table_[t];
|
return yytranslate_table_[t];
|
||||||
else
|
else
|
||||||
return yyundef_token_;
|
return yyundef_token_;
|
||||||
|
|||||||
@@ -826,6 +826,7 @@ Next token is token '=' (13.8: 3)
|
|||||||
Next token is token "number" (13.9: 64)
|
Next token is token "number" (13.9: 64)
|
||||||
Next token is token '\n' (14.0: 64)
|
Next token is token '\n' (14.0: 64)
|
||||||
Next token is token '\n' (14.0: 64)
|
Next token is token '\n' (14.0: 64)
|
||||||
|
Next token is token $end (14.1: 64)
|
||||||
]])
|
]])
|
||||||
|
|
||||||
# Define the calculator input.
|
# Define the calculator input.
|
||||||
|
|||||||
Reference in New Issue
Block a user