]> git.saurik.com Git - bison.git/blobdiff - NEWS
Merge remote-tracking branch 'origin/maint'
[bison.git] / NEWS
diff --git a/NEWS b/NEWS
index 0dfc63f034f25853f294b87b8f8d126f2a736a13..41e685196e2558c0dab97d8b89fa2f6651cc7f72 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,23 @@ GNU Bison NEWS
 
 * Noteworthy changes in release ?.? (????-??-??) [?]
 
 
 * Noteworthy changes in release ?.? (????-??-??) [?]
 
+** Warnings about useless semantic types
+
+  Bison now warns about useless (uninhabited) semantic types.  Since
+  semantic types are not declared to Bison (they are defined in the opaque
+  %union structure), it is %printer/%destructor directives about useless
+  types that trigger the warning:
+
+    %token <type1> term
+    %type  <type2> nterm
+    %printer    {} <type1> <type3>
+    %destructor {} <type2> <type4>
+    %%
+    nterm: term { $$ = $1; };
+
+    3.28-34: warning: type <type3> is used, but is not associated to any symbol
+    4.28-34: warning: type <type4> is used, but is not associated to any symbol
+
 ** Warnings about undeclared symbols
 
   Bison used to raise an error for %printer and %destructor directives for
 ** Warnings about undeclared symbols
 
   Bison used to raise an error for %printer and %destructor directives for
@@ -14,6 +31,20 @@ GNU Bison NEWS
 
   This is now only a warning.
 
 
   This is now only a warning.
 
+** Warnings about useless destructors or printers
+
+  Bison now warns about useless destructors or printers.  In the following
+  example, the printer for <type1>, and the destructor for <type2> are
+  useless: all symbols of <type1> (token1) already have a printer, and all
+  symbols of type <type2> (token2) already have a destructor.
+
+    %token <type1> token1
+           <type2> token2
+           <type3> token3
+           <type4> token4
+    %printer    {} token1 <type1> <type3>
+    %destructor {} token2 <type2> <type4>
+
 ** Additional yylex/yyparse arguments
 
   The new directive %param declares additional arguments to both yylex and
 ** Additional yylex/yyparse arguments
 
   The new directive %param declares additional arguments to both yylex and
@@ -82,19 +113,33 @@ GNU Bison NEWS
 
 * Noteworthy changes in release ?.? (????-??-??) [?]
 
 
 * Noteworthy changes in release ?.? (????-??-??) [?]
 
-** Future changes:
+** Future changes
 
 
-  The next major release will drop support for generating parsers in K&R C,
-  and remove the definitions of yystype and yyltype (removal announced since
-  Bison 1.875).  YYPARSE_PARAM and YYLEX_PARAM, which were deprecated in
-  favor of %parse-param and %lex-param (introduced in Bison 1.875 too), will
-  no longer be supported.
+  The next major release of Bison will drop support for the following
+  deprecated features.  Please report disagreements to bug-bison@gnu.org.
 
 
-** The generated header is included (yacc.c)
+*** K&C parsers
+
+  Support for generating parsers in K&R C will be removed.  Parsers
+  generated for C supprt ISO C90, and are tested with ISO C99 and ISO C11
+  compilers.
+
+*** Deprecated features
+
+  The definitions of yystype and yyltype will be removed, as announced since
+  Bison 1.875.  Use YYSTYPE and YYLTYPE only.
+
+  YYPARSE_PARAM and YYLEX_PARAM, which were deprecated in favor of
+  %parse-param and %lex-param (introduced in Bison 1.875), will no longer be
+  supported.
+
+*** The generated header will be included (yacc.c)
 
   Instead of duplicating the content of the generated header (definition of
 
   Instead of duplicating the content of the generated header (definition of
-  YYSTYPE, yyltype etc.), the generated parser now includes it, as was
-  already the case for GLR or C++ parsers.
+  YYSTYPE, yyparse declaration etc.), the generated parser will include it,
+  as is already the case for GLR or C++ parsers.  This change is deferred
+  because existing versions of ylwrap (e.g., Automake 1.12.1) do not support
+  it.
 
 ** Headers (yacc.c, glr.c, glr.cc)
 
 
 ** Headers (yacc.c, glr.c, glr.cc)
 
@@ -160,10 +205,10 @@ GNU Bison NEWS
   The header files such as "parser.hh", "location.hh", etc. used a constant
   name for preprocessor guards, for instance:
 
   The header files such as "parser.hh", "location.hh", etc. used a constant
   name for preprocessor guards, for instance:
 
-  #ifndef BISON_LOCATION_HH
-  # define BISON_LOCATION_HH
-  ...
-  #endif // !BISON_LOCATION_HH
+    #ifndef BISON_LOCATION_HH
+    # define BISON_LOCATION_HH
+    ...
+    #endif // !BISON_LOCATION_HH
 
   The inclusion guard is now computed from "PREFIX/FILE-NAME", where lower
   case characters are converted to upper case, and series of
 
   The inclusion guard is now computed from "PREFIX/FILE-NAME", where lower
   case characters are converted to upper case, and series of
@@ -171,10 +216,10 @@ GNU Bison NEWS
 
   With "bison -o lang++/parser.cc", "location.hh" would now include:
 
 
   With "bison -o lang++/parser.cc", "location.hh" would now include:
 
-  #ifndef YY_LANG_LOCATION_HH
-  # define YY_LANG_LOCATION_HH
-  ...
-  #endif // !YY_LANG_LOCATION_HH
+    #ifndef YY_LANG_LOCATION_HH
+    # define YY_LANG_LOCATION_HH
+    ...
+    #endif // !YY_LANG_LOCATION_HH
 
 *** C++ locations:
 
 
 *** C++ locations:
 
@@ -405,33 +450,33 @@ GNU Bison NEWS
   to use it.  If, for instance, your location structure has "first"
   and "last" members, instead of
 
   to use it.  If, for instance, your location structure has "first"
   and "last" members, instead of
 
-      # define YYLLOC_DEFAULT(Current, Rhs, N)                             \
-        do                                                                 \
-          if (N)                                                           \
-            {                                                              \
-              (Current).first = (Rhs)[1].location.first;                   \
-              (Current).last  = (Rhs)[N].location.last;                    \
-            }                                                              \
-          else                                                             \
-            {                                                              \
-              (Current).first = (Current).last = (Rhs)[0].location.last;   \
-            }                                                              \
-        while (false)
+    # define YYLLOC_DEFAULT(Current, Rhs, N)                             \
+      do                                                                 \
+        if (N)                                                           \
+          {                                                              \
+            (Current).first = (Rhs)[1].location.first;                   \
+            (Current).last  = (Rhs)[N].location.last;                    \
+          }                                                              \
+        else                                                             \
+          {                                                              \
+            (Current).first = (Current).last = (Rhs)[0].location.last;   \
+          }                                                              \
+      while (false)
 
   use:
 
 
   use:
 
-      # define YYLLOC_DEFAULT(Current, Rhs, N)                             \
-        do                                                                 \
-          if (N)                                                           \
-            {                                                              \
-              (Current).first = YYRHSLOC (Rhs, 1).first;                   \
-              (Current).last  = YYRHSLOC (Rhs, N).last;                    \
-            }                                                              \
-          else                                                             \
-            {                                                              \
-              (Current).first = (Current).last = YYRHSLOC (Rhs, 0).last;   \
-            }                                                              \
-        while (false)
+    # define YYLLOC_DEFAULT(Current, Rhs, N)                             \
+      do                                                                 \
+        if (N)                                                           \
+          {                                                              \
+            (Current).first = YYRHSLOC (Rhs, 1).first;                   \
+            (Current).last  = YYRHSLOC (Rhs, N).last;                    \
+          }                                                              \
+        else                                                             \
+          {                                                              \
+            (Current).first = (Current).last = YYRHSLOC (Rhs, 0).last;   \
+          }                                                              \
+      while (false)
 
 ** YYLLOC_DEFAULT in C++:
 
 
 ** YYLLOC_DEFAULT in C++:
 
@@ -1431,9 +1476,9 @@ GNU Bison NEWS
 ** Incorrect "Token not used"
   On a grammar such as
 
 ** Incorrect "Token not used"
   On a grammar such as
 
-           %token useless useful
-           %%
-           exp: '0' %prec useful;
+    %token useless useful
+    %%
+    exp: '0' %prec useful;
 
   where a token was used to set the precedence of the last rule,
   bison reported both "useful" and "useless" as useless tokens.
 
   where a token was used to set the precedence of the last rule,
   bison reported both "useful" and "useless" as useless tokens.
@@ -1452,9 +1497,9 @@ GNU Bison NEWS
   the user symbol is used in the reports, the graphs, and the verbose
   error messages instead of "$end", which remains being the default.
   For instance
   the user symbol is used in the reports, the graphs, and the verbose
   error messages instead of "$end", which remains being the default.
   For instance
-     %token MYEOF 0
+    %token MYEOF 0
   or
   or
-     %token MYEOF 0 "end of file"
+    %token MYEOF 0 "end of file"
 
 ** Semantic parser
   This old option, which has been broken for ages, is removed.
 
 ** Semantic parser
   This old option, which has been broken for ages, is removed.
@@ -1490,9 +1535,9 @@ GNU Bison NEWS
   Previous versions don't complain when there is a type clash on
   the default action if the rule has a mid-rule action, such as in:
 
   Previous versions don't complain when there is a type clash on
   the default action if the rule has a mid-rule action, such as in:
 
-      %type <foo> bar
-      %%
-      bar: '0' {} '0';
+    %type <foo> bar
+    %%
+    bar: '0' {} '0';
 
   This is fixed.
 
 
   This is fixed.