mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 09:13:04 +00:00
YYFAIL: warn about uses and remove from lalr1.java.
* NEWS (2.5): Document.
* data/lalr1.java (parser::YYStack::YYFAIL): Rename to YYERRLAB,
and make it private. Update all uses.
* src/scan-code.l (SC_RULE_ACTION): Implement warning.
(cherry picked from commit 4395a9ff4f)
Conflicts:
data/lalr1.java
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
2009-12-21 Joel E. Denny <jdenny@clemson.edu>
|
||||||
|
|
||||||
|
YYFAIL: warn about uses and remove from lalr1.java.
|
||||||
|
* NEWS (2.5): Document.
|
||||||
|
* data/lalr1.java (parser::YYStack::YYFAIL): Rename to YYERRLAB,
|
||||||
|
and make it private. Update all uses.
|
||||||
|
* src/scan-code.l (SC_RULE_ACTION): Implement warning.
|
||||||
|
|
||||||
2009-12-21 Joel E. Denny <jdenny@clemson.edu>
|
2009-12-21 Joel E. Denny <jdenny@clemson.edu>
|
||||||
|
|
||||||
YYFAIL: deprecate.
|
YYFAIL: deprecate.
|
||||||
|
|||||||
11
NEWS
11
NEWS
@@ -119,6 +119,17 @@ Bison News
|
|||||||
POSIX Yacc whose use is reported by -Wyacc, and rejected in Yacc
|
POSIX Yacc whose use is reported by -Wyacc, and rejected in Yacc
|
||||||
mode (--yacc).
|
mode (--yacc).
|
||||||
|
|
||||||
|
** YYFAIL now produces warnings and Java parsers no longer implement it.
|
||||||
|
|
||||||
|
YYFAIL has existed for many years as an undocumented feature of
|
||||||
|
deterministic parsers in C generated by Bison. More recently, it was
|
||||||
|
a documented feature of Bison's experimental Java parsers. As
|
||||||
|
promised in Bison 2.4.2's NEWS entry, any appearance of YYFAIL in a
|
||||||
|
semantic action now produces a deprecation warning, and Java parsers
|
||||||
|
no longer implement YYFAIL at all. For further details, including a
|
||||||
|
discussion of how to suppress C preprocessor warnings about YYFAIL
|
||||||
|
being unused, see the Bison 2.4.2 NEWS entry.
|
||||||
|
|
||||||
** Temporary hack for adding a semicolon to the user action.
|
** Temporary hack for adding a semicolon to the user action.
|
||||||
|
|
||||||
Previously, Bison appended a semicolon to every user action for
|
Previously, Bison appended a semicolon to every user action for
|
||||||
|
|||||||
@@ -308,12 +308,9 @@ b4_lexer_if([[
|
|||||||
* printing an error message. */
|
* printing an error message. */
|
||||||
public static final int YYERROR = 2;
|
public static final int YYERROR = 2;
|
||||||
|
|
||||||
/**
|
// Internal return codes that are not supported for user semantic
|
||||||
* Returned by a Bison action in order to print an error message and start
|
// actions.
|
||||||
* error recovery. Formally deprecated in Bison 2.4.2's NEWS entry, where
|
private static final int YYERRLAB = 3;
|
||||||
* a plan to phase it out is discussed. */
|
|
||||||
public static final int YYFAIL = 3;
|
|
||||||
|
|
||||||
private static final int YYNEWSTATE = 4;
|
private static final int YYNEWSTATE = 4;
|
||||||
private static final int YYDEFAULT = 5;
|
private static final int YYDEFAULT = 5;
|
||||||
private static final int YYREDUCE = 6;
|
private static final int YYREDUCE = 6;
|
||||||
@@ -530,7 +527,7 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
else if ((yyn = yytable_[yyn]) <= 0)
|
else if ((yyn = yytable_[yyn]) <= 0)
|
||||||
{
|
{
|
||||||
if (yy_table_value_is_error_ (yyn))
|
if (yy_table_value_is_error_ (yyn))
|
||||||
label = YYFAIL;
|
label = YYERRLAB;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
yyn = -yyn;
|
yyn = -yyn;
|
||||||
@@ -564,7 +561,7 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
case YYDEFAULT:
|
case YYDEFAULT:
|
||||||
yyn = yydefact_[yystate];
|
yyn = yydefact_[yystate];
|
||||||
if (yyn == 0)
|
if (yyn == 0)
|
||||||
label = YYFAIL;
|
label = YYERRLAB;
|
||||||
else
|
else
|
||||||
label = YYREDUCE;
|
label = YYREDUCE;
|
||||||
break;
|
break;
|
||||||
@@ -581,7 +578,7 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
/*------------------------------------.
|
/*------------------------------------.
|
||||||
| yyerrlab -- here on detecting error |
|
| yyerrlab -- here on detecting error |
|
||||||
`------------------------------------*/
|
`------------------------------------*/
|
||||||
case YYFAIL:
|
case YYERRLAB:
|
||||||
/* If not already recovering from an error, report this error. */
|
/* If not already recovering from an error, report this error. */
|
||||||
if (yyerrstatus_ == 0)
|
if (yyerrstatus_ == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -245,7 +245,20 @@ ref -?[0-9]+|{id}|"["{id}"]"|"$"
|
|||||||
{splice} STRING_GROW;
|
{splice} STRING_GROW;
|
||||||
[\n\r] STRING_GROW; if (in_cpp) in_cpp = need_semicolon = false;
|
[\n\r] STRING_GROW; if (in_cpp) in_cpp = need_semicolon = false;
|
||||||
[ \t\f] STRING_GROW;
|
[ \t\f] STRING_GROW;
|
||||||
. STRING_GROW; need_semicolon = true;
|
|
||||||
|
/* YYFAIL is undocumented and was formally deprecated in Bison
|
||||||
|
2.4.2. */
|
||||||
|
YYFAIL {
|
||||||
|
STRING_GROW; need_semicolon = true;
|
||||||
|
warn_at (*loc, _("use of YYFAIL, which is deprecated and will be"
|
||||||
|
" removed"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The sole purpose of this is to make sure identifiers that merely
|
||||||
|
contain YYFAIL don't produce the above warning. */
|
||||||
|
[A-Za-z_][0-9A-Za-z_]* STRING_GROW; need_semicolon = true;
|
||||||
|
|
||||||
|
. STRING_GROW; need_semicolon = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
<SC_SYMBOL_ACTION>
|
<SC_SYMBOL_ACTION>
|
||||||
|
|||||||
Reference in New Issue
Block a user