bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/3] YYFAIL: remove.


From: Akim Demaille
Subject: [PATCH 2/3] YYFAIL: remove.
Date: Mon, 23 Jul 2012 14:07:45 +0200

* data/lalr1.java, data/yacc.c, src/scan-code.l: Remove YYFAIL support.
* NEWS, TODO: Update.
---
 NEWS            |  6 ++++++
 TODO            |  3 ---
 data/lalr1.java |  5 -----
 data/yacc.c     | 25 +++----------------------
 src/scan-code.l | 15 +--------------
 5 files changed, 10 insertions(+), 44 deletions(-)

diff --git a/NEWS b/NEWS
index 8db03d6..fa339ae 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,12 @@ GNU Bison NEWS
 
 * Noteworthy changes in release ?.? (????-??-??) [?]
 
+** Incompatible changes
+
+*** Obsolete features
+
+  Support for YYFAIL is removed, as announced since Bison 2.4.2.
+
 ** Warnings
 
 *** Warning categories are now displayed in warnings
diff --git a/TODO b/TODO
index 5b333e2..dfd6cfe 100644
--- a/TODO
+++ b/TODO
@@ -77,9 +77,6 @@ so both 256 and 257 are "mysterious".
   "\"end of command\"", "error", "$undefined", "\"=\"", "\"break\"",
 
 
-** YYFAIL
-It is seems to be *really* obsolete now, shall we remove it?
-
 ** yychar == yyempty_
 The code in yyerrlab reads:
 
diff --git a/data/lalr1.java b/data/lalr1.java
index 9952491..d3729c6 100644
--- a/data/lalr1.java
+++ b/data/lalr1.java
@@ -728,11 +728,6 @@ m4_popdef([b4_at_dollar])])dnl
     if (yyErrorVerbose)
       {
         /* There are many possibilities here to consider:
-           - Assume YYFAIL is not used.  It's too flawed to consider.
-             See
-             
<http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
-             for details.  YYERROR is fine as it does not invoke this
-             function.
            - If this state is a consistent state with a default action,
              then the only way this function was invoked is if the
              default action is an error action.  In that case, don't
diff --git a/data/yacc.c b/data/yacc.c
index 80b7ab5..b3864e9 100644
--- a/data/yacc.c
+++ b/data/yacc.c
@@ -638,21 +638,6 @@ static const ]b4_int_type_for([b4_toknum])[ yytoknum[] =
 #define YYERROR         goto yyerrorlab
 
 
-/* Like YYERROR except do call yyerror.  This remains here temporarily
-   to ease the transition to the new meaning of YYERROR, for GCC.
-   Once GCC version 2 has supplanted version 1, this can go.  However,
-   YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
-   in Bison 2.4.2's NEWS entry, where a plan to phase it out is
-   discussed.  */
-
-#define YYFAIL          goto yyerrlab
-#if defined YYFAIL
-  /* This is here to suppress warnings from the GCC cpp's
-     -Wunused-macros.  Normally we don't worry about that warning, but
-     some users do, and we want to make it easy for users to remove
-     YYFAIL uses, which will produce warnings from Bison 2.5.  */
-#endif
-
 #define YYRECOVERING()  (!!yyerrstatus)
 
 #define YYBACKUP(Token, Value)                                  \
@@ -1177,10 +1162,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
   int yycount = 0;
 
   /* There are many possibilities here to consider:
-     - Assume YYFAIL is not used.  It's too flawed to consider.  See
-       <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
-       for details.  YYERROR is fine as it does not invoke this
-       function.
      - If this state is a consistent state with a default action, then
        the only way this function was invoked is if the default action
        is an error action.  In that case, don't check for expected
@@ -1769,9 +1750,9 @@ yyreduce:
   goto yynewstate;
 
 
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
+/*--------------------------------------.
+| yyerrlab -- here on detecting error.  |
+`--------------------------------------*/
 yyerrlab:
   /* Make sure we have latest lookahead translation.  See comments at
      user semantic actions for why this is necessary.  */
diff --git a/src/scan-code.l b/src/scan-code.l
index cacd256..f6efeff 100644
--- a/src/scan-code.l
+++ b/src/scan-code.l
@@ -248,20 +248,7 @@ ref      -?[0-9]+|{id}|"["{id}"]"|"$"
   {splice}  STRING_GROW;
   [\n\r]    STRING_GROW; if (in_cpp) in_cpp = need_semicolon = false;
   [ \t\f]   STRING_GROW;
-
-  /* YYFAIL is undocumented and was formally deprecated in Bison
-     2.4.2.  */
-  YYFAIL {
-    STRING_GROW; need_semicolon = true;
-    complain_at (*loc, Wother,
-                 _("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;
+  .         STRING_GROW; need_semicolon = true;
 }
 
 <SC_SYMBOL_ACTION>
-- 
1.7.11.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]