"Fossies" - the Fresh Open Source Software Archive

Member "bison-3.8.2/NEWS" (25 Sep 2021, 164484 Bytes) of package /linux/misc/bison-3.8.2.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "NEWS": 3.8.1_vs_3.8.2.

    1 GNU Bison NEWS
    2 
    3 * Noteworthy changes in release 3.8.2 (2021-09-25) [stable]
    4 
    5   Fixed portability issues of bison on Cygwin.
    6 
    7   Improvements in glr2.cc: add support for custom error messages (`%define
    8   parse.error custom`), allow linking several parsers together.
    9 
   10 * Noteworthy changes in release 3.8.1 (2021-09-11) [stable]
   11 
   12   The generation of prototypes for yylex and yyerror in Yacc mode is
   13   breaking existing grammar files.  To avoid breaking too many grammars, the
   14   prototypes are now generated when `-y/--yacc` is used *and* the
   15   `POSIXLY_CORRECT` environment variable is defined.
   16 
   17   Avoid using `-y`/`--yacc` simply to comply with Yacc's file name
   18   conventions, rather, use `-o y.tab.c`.  Autoconf's AC_PROG_YACC macro uses
   19   `-y`.  Avoid it if possible, for instance by using gnulib's gl_PROG_BISON.
   20 
   21 * Noteworthy changes in release 3.8 (2021-09-07) [stable]
   22 
   23 ** Backward incompatible changes
   24 
   25   In conformance with the recommendations of the Graphviz team
   26   (https://marc.info/?l=graphviz-devel&m=129418103126092), `-g`/`--graph`
   27   now generates a *.gv file by default, instead of *.dot.  A transition
   28   started in Bison 3.4.
   29 
   30   To comply with the latest POSIX standard, in Yacc compatibility mode
   31   (options `-y`/`--yacc`) Bison now generates prototypes for yyerror and
   32   yylex.  In some situations, this is breaking compatibility: if the user
   33   has already declared these functions but with some differences (e.g., to
   34   declare them as static, or to use specific attributes), the generated
   35   parser will fail to compile.  To disable these prototypes, #define yyerror
   36   (to `yyerror`), and likewise for yylex.
   37 
   38 ** Deprecated features
   39 
   40   Support for the YYPRINT macro is removed. It worked only with yacc.c and
   41   only for tokens.  It was obsoleted by %printer, introduced in Bison 1.50
   42   (November 2002).
   43 
   44   It has always been recommended to prefer `%define api.value.type foo` to
   45   `#define YYSTYPE foo`.  The latter is supported in C for compatibility
   46   with Yacc, but not in C++.  Warnings are now issued if `#define YYSTYPE`
   47   is used in C++, and eventually support will be removed.
   48 
   49   In C++ code, prefer value_type to semantic_type to denote the semantic
   50   value type, which is specified by the `api.value.type` %define variable.
   51 
   52 ** New features
   53 
   54 *** A skeleton for the D programming language
   55 
   56   The "lalr1.d" skeleton is now officially part of Bison.
   57 
   58   It was originally contributed by Oliver Mangold, based on Paolo Bonzini's
   59   lalr1.java, and was improved by H. S. Teoh.  Adela Vais then took over
   60   maintenance and invested a lot of efforts to complete, test and document
   61   it.
   62 
   63   It now supports all the bells and whistles of the other deterministic
   64   parsers, which include: pull/push interfaces, verbose and custom error
   65   messages, lookahead correction, token constructors, internationalization,
   66   locations, printers, token and symbol prefixes, etc.
   67 
   68   Two examples demonstrate the D parsers: a basic one (examples/d/simple),
   69   and an advanced one (examples/d/calc).
   70 
   71 *** Option -H, --header and directive %header
   72 
   73   The option `-H`/`--header` supersedes the option `--defines`, and the
   74   directive %header supersedes %defines.  Both `--defines` and `%defines`
   75   are, of course, maintained for backward compatibility.
   76 
   77 *** Option --html
   78 
   79   Since version 2.4 Bison can be used to generate HTML reports.  However it
   80   was a two-step process: first bison must be invoked with option `--xml`,
   81   and then xsltproc must be run to the convert the XML reports into HTML.
   82 
   83   The new option `--html` combines these steps.  The xsltproc program must
   84   be available.
   85 
   86 *** A C++ native GLR parser
   87 
   88   A new version of the C++ GLR parser was added: "glr2.cc".  It generates
   89   "true C++11", instead of a C++ wrapper around a C parser as does the
   90   existing "glr.cc" parser.  As a first significant consequence, it supports
   91   `%define api.value.type variant`, contrary to glr.cc.
   92 
   93   It should be upward compatible in terms of interface, feature and
   94   performance to "glr.cc". To try it out, simply use
   95 
   96   %skeleton "glr2.cc"
   97 
   98   It will eventually replace "glr.cc".  However we need user feedback on
   99   this skeleton.  _Please_ report your results and comments about it.
  100 
  101 *** Counterexamples
  102 
  103   Counterexamples now show the rule numbers, and always show ε for rules
  104   with an empty right-hand side.  For instance
  105 
  106     exp
  107     ↳ 1: e1       e2     "a"
  108          ↳ 3: ε • ↳ 1: ε
  109 
  110   instead of
  111 
  112     exp
  113     ↳ e1  e2  "a"
  114       ↳ • ↳ ε
  115 
  116 *** Lookahead correction in Java
  117 
  118   The Java skeleton (lalr1.java) now supports LAC, via the `parse.lac`
  119   %define variable.
  120 
  121 *** Abort parsing for memory exhaustion (C)
  122 
  123   User actions may now use `YYNOMEM` (similar to `YYACCEPT` and `YYABORT`)
  124   to abort the current parse with memory exhaustion.
  125 
  126 *** Printing locations in debug traces (C)
  127 
  128   The `YYLOCATION_PRINT(File, Loc)` macro prints a location.  It is defined
  129   when (i) locations are enabled, (ii) the default type for locations is
  130   used, (iii) debug traces are enabled, and (iv) `YYLOCATION_PRINT` is not
  131   already defined.
  132 
  133   Users may define `YYLOCATION_PRINT` to cover other cases.
  134 
  135 *** GLR traces
  136 
  137   There were no debug traces for deferred calls to user actions.  They are
  138   logged now.
  139 
  140 
  141 * Noteworthy changes in release 3.7.6 (2021-03-08) [stable]
  142 
  143 ** Bug fixes
  144 
  145 *** Reused Push Parsers
  146 
  147   When a push-parser state structure is used for multiple parses, it was
  148   possible for some state to leak from one run into the following one.
  149 
  150 *** Fix Table Generation
  151 
  152   In some very rare conditions, when there are many useless tokens, it was
  153   possible to generate incorrect parsers.
  154 
  155 
  156 * Noteworthy changes in release 3.7.5 (2021-01-24) [stable]
  157 
  158 ** Bug fixes
  159 
  160 *** Counterexample Generation
  161 
  162   In some cases counterexample generation could crash.  This is fixed.
  163 
  164 *** Fix Table Generation
  165 
  166   In some very rare conditions, when there are many useless tokens, it was
  167   possible to generate incorrect parsers.
  168 
  169 *** GLR parsers now support %merge together with api.value.type=union.
  170 
  171 *** C++ parsers use noexcept in more places.
  172 
  173 *** Generated parsers avoid some warnings about signedness issues.
  174 
  175 *** C-language parsers now avoid warnings from pedantic clang.
  176 
  177 *** C-language parsers now work around quirks of HP-UX 11.23 (2003).
  178 
  179 
  180 * Noteworthy changes in release 3.7.4 (2020-11-14) [stable]
  181 
  182 ** Bug fixes
  183 
  184 *** Bug fixes in yacc.c
  185 
  186   In Yacc mode, all the tokens are defined twice: once as an enum, and then
  187   as a macro.  YYEMPTY was missing its macro.
  188 
  189 *** Bug fixes in lalr1.cc
  190 
  191   The lalr1.cc skeleton used to emit internal assertions (using YY_ASSERT)
  192   even when the `parse.assert` %define variable is not enabled.  It no
  193   longer does.
  194 
  195   The private internal macro YY_ASSERT now obeys the `api.prefix` %define
  196   variable.
  197 
  198   When there is a very large number of tokens, some assertions could be long
  199   enough to hit arbitrary limits in Visual C++.  They have been rewritten to
  200   work around this limitation.
  201 
  202 ** Changes
  203 
  204   The YYBISON macro in generated "regular C parsers" (from the "yacc.c"
  205   skeleton) used to be defined to 1.  It is now defined to the version of
  206   Bison as an integer (e.g., 30704 for version 3.7.4).
  207 
  208 
  209 * Noteworthy changes in release 3.7.3 (2020-10-13) [stable]
  210 
  211 ** Bug fixes
  212 
  213   Fix concurrent build issues.
  214 
  215   The bison executable is no longer linked uselessly against libreadline.
  216 
  217   Fix incorrect use of yytname in glr.cc.
  218 
  219 
  220 * Noteworthy changes in release 3.7.2 (2020-09-05) [stable]
  221 
  222   This release of Bison fixes all known bugs reported for Bison in MITRE's
  223   Common Vulnerabilities and Exposures (CVE) system.  These vulnerabilities
  224   are only about bison-the-program itself, not the generated code.
  225 
  226   Although these bugs are typically irrelevant to how Bison is used, they
  227   are worth fixing if only to give users peace of mind.
  228 
  229   There is no known vulnerability in the generated parsers.
  230 
  231 ** Bug fixes
  232 
  233   Fix concurrent build issues (introduced in Bison 3.5).
  234 
  235   Push parsers always use YYMALLOC/YYFREE (no direct calls to malloc/free).
  236 
  237   Fix portability issues of the test suite, and of bison itself.
  238 
  239   Some unlikely crashes found by fuzzing have been fixed.  This is only
  240   about bison itself, not the generated parsers.
  241 
  242 
  243 * Noteworthy changes in release 3.7.1 (2020-08-02) [stable]
  244 
  245 ** Bug fixes
  246 
  247   Crash when a token alias contains a NUL byte.
  248 
  249   Portability issues with libtextstyle.
  250 
  251   Portability issues of Bison itself with MSVC.
  252 
  253 ** Changes
  254 
  255   Improvements and fixes in the documentation.
  256 
  257   More precise location about symbol type redefinitions.
  258 
  259 
  260 * Noteworthy changes in release 3.7 (2020-07-23) [stable]
  261 
  262 ** Deprecated features
  263 
  264   The YYPRINT macro, which works only with yacc.c and only for tokens, was
  265   obsoleted long ago by %printer, introduced in Bison 1.50 (November 2002).
  266   It is deprecated and its support will be removed eventually.
  267 
  268   In conformance with the recommendations of the Graphviz team, in the next
  269   version Bison the option `--graph` will generate a *.gv file by default,
  270   instead of *.dot.  A transition started in Bison 3.4.
  271 
  272 ** New features
  273 
  274 *** Counterexample Generation
  275 
  276   Contributed by Vincent Imbimbo.
  277 
  278   When given `-Wcounterexamples`/`-Wcex`, bison will now output
  279   counterexamples for conflicts.
  280 
  281 **** Unifying Counterexamples
  282 
  283   Unifying counterexamples are strings which can be parsed in two ways due
  284   to the conflict.  For example on a grammar that contains the usual
  285   "dangling else" ambiguity:
  286 
  287     $ bison else.y
  288     else.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
  289     else.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
  290 
  291     $ bison else.y -Wcex
  292     else.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
  293     else.y: warning: shift/reduce conflict on token "else" [-Wcounterexamples]
  294       Example: "if" exp "then" "if" exp "then" exp • "else" exp
  295       Shift derivation
  296         exp
  297         ↳ "if" exp "then" exp
  298                           ↳ "if" exp "then" exp • "else" exp
  299       Example: "if" exp "then" "if" exp "then" exp • "else" exp
  300       Reduce derivation
  301         exp
  302         ↳ "if" exp "then" exp                     "else" exp
  303                           ↳ "if" exp "then" exp •
  304 
  305   When text styling is enabled, colors are used in the examples and the
  306   derivations to highlight the structure of both analyses.  In this case,
  307 
  308     "if" exp "then" [ "if" exp "then" exp • ] "else" exp
  309 
  310   vs.
  311 
  312     "if" exp "then" [ "if" exp "then" exp • "else" exp ]
  313 
  314 
  315   The counterexamples are "focused", in two different ways.  First, they do
  316   not clutter the output with all the derivations from the start symbol,
  317   rather they start on the "conflicted nonterminal". They go straight to the
  318   point.  Second, they don't "expand" nonterminal symbols uselessly.
  319 
  320 **** Nonunifying Counterexamples
  321 
  322   In the case of the dangling else, Bison found an example that can be
  323   parsed in two ways (therefore proving that the grammar is ambiguous).
  324   When it cannot find such an example, it instead generates two examples
  325   that are the same up until the dot:
  326 
  327     $ bison foo.y
  328     foo.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
  329     foo.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
  330     foo.y:4.4-7: warning: rule useless in parser due to conflicts [-Wother]
  331         4 | a: expr
  332           |    ^~~~
  333 
  334     $ bison -Wcex foo.y
  335     foo.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
  336     foo.y: warning: shift/reduce conflict on token ID [-Wcounterexamples]
  337       First example: expr • ID ',' ID $end
  338       Shift derivation
  339         $accept
  340         ↳ s                      $end
  341           ↳ a                 ID
  342             ↳ expr
  343               ↳ expr • ID ','
  344       Second example: expr • ID $end
  345       Reduce derivation
  346         $accept
  347         ↳ s             $end
  348           ↳ a        ID
  349             ↳ expr •
  350     foo.y:4.4-7: warning: rule useless in parser due to conflicts [-Wother]
  351         4 | a: expr
  352           |    ^~~~
  353 
  354   In these cases, the parser usually doesn't have enough lookahead to
  355   differentiate the two given examples.
  356 
  357 **** Reports
  358 
  359   Counterexamples are also included in the report when given
  360   `--report=counterexamples`/`-rcex` (or `--report=all`), with more
  361   technical details:
  362 
  363     State 7
  364 
  365       1 exp: "if" exp "then" exp •  [$end, "then", "else"]
  366       2    | "if" exp "then" exp • "else" exp
  367 
  368       "else"  shift, and go to state 8
  369 
  370       "else"    [reduce using rule 1 (exp)]
  371       $default  reduce using rule 1 (exp)
  372 
  373       shift/reduce conflict on token "else":
  374           1 exp: "if" exp "then" exp •
  375           2 exp: "if" exp "then" exp • "else" exp
  376         Example: "if" exp "then" "if" exp "then" exp • "else" exp
  377         Shift derivation
  378           exp
  379           ↳ "if" exp "then" exp
  380                             ↳ "if" exp "then" exp • "else" exp
  381         Example: "if" exp "then" "if" exp "then" exp • "else" exp
  382         Reduce derivation
  383           exp
  384           ↳ "if" exp "then" exp                     "else" exp
  385                             ↳ "if" exp "then" exp •
  386 
  387 *** File prefix mapping
  388 
  389   Contributed by Joshua Watt.
  390 
  391   Bison learned a new argument, `--file-prefix-map OLD=NEW`.  Any file path
  392   in the output (specifically `#line` directives and `#ifdef` header guards)
  393   that begins with the prefix OLD will have it replaced with the prefix NEW,
  394   similar to the `-ffile-prefix-map` in GCC.  This option can be used to
  395   make bison output reproducible.
  396 
  397 ** Changes
  398 
  399 *** Diagnostics
  400 
  401   When text styling is enabled and the terminal supports it, the warnings
  402   now include hyperlinks to the documentation.
  403 
  404 *** Relocatable installation
  405 
  406   When installed to be relocatable (via `configure --enable-relocatable`),
  407   bison will now also look for a relocated m4.
  408 
  409 *** C++ file names
  410 
  411   The `filename_type` %define variable was renamed `api.filename.type`.
  412   Instead of
  413 
  414     %define filename_type "symbol"
  415 
  416   write
  417 
  418     %define api.filename.type {symbol}
  419 
  420   (Or let `bison --update` do it for you).
  421 
  422   It now defaults to `const std::string` instead of `std::string`.
  423 
  424 *** Deprecated %define variable names
  425 
  426   The following variables have been renamed for consistency.  Backward
  427   compatibility is ensured, but upgrading is recommended.
  428 
  429     filename_type       -> api.filename.type
  430     package             -> api.package
  431 
  432 *** Push parsers no longer clear their state when parsing is finished
  433 
  434   Previously push-parsers cleared their state when parsing was finished (on
  435   success and on failure).  This made it impossible to check if there were
  436   parse errors, since `yynerrs` was also reset.  This can be especially
  437   troublesome when used in autocompletion, since a parser with error
  438   recovery would suggest (irrelevant) expected tokens even if there were
  439   failures.
  440 
  441   Now the parser state can be examined when parsing is finished.  The parser
  442   state is reset when starting a new parse.
  443 
  444 ** Documentation
  445 
  446 *** Examples
  447 
  448   The bistromathic demonstrates %param and how to quote sources in the error
  449   messages:
  450 
  451     > 123 456
  452     1.5-7: syntax error: expected end of file or + or - or * or / or ^ before number
  453         1 | 123 456
  454           |     ^~~
  455 
  456 ** Bug fixes
  457 
  458 *** Include the generated header (yacc.c)
  459 
  460   Historically, when --defines was used, bison generated a header and pasted
  461   an exact copy of it into the generated parser implementation file.  Since
  462   Bison 3.4 it is possible to specify that the header should be `#include`d,
  463   and how.  For instance
  464 
  465     %define api.header.include {"parse.h"}
  466 
  467   or
  468 
  469     %define api.header.include {<parser/parse.h>}
  470 
  471   Now api.header.include defaults to `"header-basename"`, as was intended in
  472   Bison 3.4, where `header-basename` is the basename of the generated
  473   header.  This is disabled when the generated header is `y.tab.h`, to
  474   comply with Automake's ylwrap.
  475 
  476 *** String aliases are faithfully propagated
  477 
  478   Bison used to interpret user strings (i.e., decoding backslash escapes)
  479   when reading them, and to escape them (i.e., issue non-printable
  480   characters as backslash escapes, taking the locale into account) when
  481   outputting them.  As a consequence non-ASCII strings (say in UTF-8) ended
  482   up "ciphered" as sequences of backslash escapes.  This happened not only
  483   in the generated sources (where the compiler will reinterpret them), but
  484   also in all the generated reports (text, xml, html, dot, etc.).  Reports
  485   were therefore not readable when string aliases were not pure ASCII.
  486   Worse yet: the output depended on the user's locale.
  487 
  488   Now Bison faithfully treats the string aliases exactly the way the user
  489   spelled them.  This fixes all the aforementioned problems.  However, now,
  490   string aliases semantically equivalent but syntactically different (e.g.,
  491   "A", "\x41", "\101") are considered to be different.
  492 
  493 *** Crash when generating IELR
  494 
  495   An old, well hidden, bug in the generation of IELR parsers was fixed.
  496 
  497 
  498 * Noteworthy changes in release 3.6.4 (2020-06-15) [stable]
  499 
  500 ** Bug fixes
  501 
  502   In glr.cc some internal macros leaked in the user's code, and could damage
  503   access to the token kinds.
  504 
  505 
  506 * Noteworthy changes in release 3.6.3 (2020-06-03) [stable]
  507 
  508 ** Bug fixes
  509 
  510   Incorrect comments in the generated parsers.
  511 
  512   Warnings in push parsers (yacc.c).
  513 
  514   Incorrect display of gotos in LAC traces (lalr1.cc).
  515 
  516 
  517 * Noteworthy changes in release 3.6.2 (2020-05-17) [stable]
  518 
  519 ** Bug fixes
  520 
  521   Some tests were fixed.
  522 
  523   When token aliases contain comment delimiters:
  524 
  525     %token FOO "/* foo */"
  526 
  527   bison used to emit "nested" comments, which is invalid C.
  528 
  529 
  530 * Noteworthy changes in release 3.6.1 (2020-05-10) [stable]
  531 
  532 ** Bug fixes
  533 
  534   Restored ANSI-C compliance in yacc.c.
  535 
  536   GNU readline portability issues.
  537 
  538   In C++, yy::parser::symbol_name is now a public member, as was intended.
  539 
  540 ** New features
  541 
  542   In C++, yy::parser::symbol_type now has a public name() member function.
  543 
  544 
  545 * Noteworthy changes in release 3.6 (2020-05-08) [stable]
  546 
  547 ** Backward incompatible changes
  548 
  549   TL;DR: replace "#define YYERROR_VERBOSE 1" by "%define parse.error verbose".
  550 
  551   The YYERROR_VERBOSE macro is no longer supported; the parsers that still
  552   depend on it will now produce Yacc-like error messages (just "syntax
  553   error").  It was superseded by the "%error-verbose" directive in Bison
  554   1.875 (2003-01-01).  Bison 2.6 (2012-07-19) clearly announced that support
  555   for YYERROR_VERBOSE would be removed.  Note that since Bison 3.0
  556   (2013-07-25), "%error-verbose" is deprecated in favor of "%define
  557   parse.error verbose".
  558 
  559 ** Deprecated features
  560 
  561   The YYPRINT macro, which works only with yacc.c and only for tokens, was
  562   obsoleted long ago by %printer, introduced in Bison 1.50 (November 2002).
  563   It is deprecated and its support will be removed eventually.
  564 
  565 ** New features
  566 
  567 *** Improved syntax error messages
  568 
  569   Two new values for the %define parse.error variable offer more control to
  570   the user.  Available in all the skeletons (C, C++, Java).
  571 
  572 **** %define parse.error detailed
  573 
  574   The behavior of "%define parse.error detailed" is closely resembling that
  575   of "%define parse.error verbose" with a few exceptions.  First, it is safe
  576   to use non-ASCII characters in token aliases (with 'verbose', the result
  577   depends on the locale with which bison was run).  Second, a yysymbol_name
  578   function is exposed to the user, instead of the yytnamerr function and the
  579   yytname table.  Third, token internationalization is supported (see
  580   below).
  581 
  582 **** %define parse.error custom
  583 
  584   With this directive, the user forges and emits the syntax error message
  585   herself by defining the yyreport_syntax_error function.  A new type,
  586   yypcontext_t, captures the circumstances of the error, and provides the
  587   user with functions to get details, such as yypcontext_expected_tokens to
  588   get the list of expected token kinds.
  589 
  590   A possible implementation of yyreport_syntax_error is:
  591 
  592     int
  593     yyreport_syntax_error (const yypcontext_t *ctx)
  594     {
  595       int res = 0;
  596       YY_LOCATION_PRINT (stderr, *yypcontext_location (ctx));
  597       fprintf (stderr, ": syntax error");
  598       // Report the tokens expected at this point.
  599       {
  600         enum { TOKENMAX = 10 };
  601         yysymbol_kind_t expected[TOKENMAX];
  602         int n = yypcontext_expected_tokens (ctx, expected, TOKENMAX);
  603         if (n < 0)
  604           // Forward errors to yyparse.
  605           res = n;
  606         else
  607           for (int i = 0; i < n; ++i)
  608             fprintf (stderr, "%s %s",
  609                      i == 0 ? ": expected" : " or", yysymbol_name (expected[i]));
  610       }
  611       // Report the unexpected token.
  612       {
  613         yysymbol_kind_t lookahead = yypcontext_token (ctx);
  614         if (lookahead != YYSYMBOL_YYEMPTY)
  615           fprintf (stderr, " before %s", yysymbol_name (lookahead));
  616       }
  617       fprintf (stderr, "\n");
  618       return res;
  619     }
  620 
  621 **** Token aliases internationalization
  622 
  623   When the %define variable parse.error is set to `custom` or `detailed`,
  624   one may specify which token aliases are to be translated using _().  For
  625   instance
  626 
  627     %token
  628         PLUS   "+"
  629         MINUS  "-"
  630       <double>
  631         NUM _("number")
  632       <symrec*>
  633         FUN _("function")
  634         VAR _("variable")
  635 
  636   In that case the user must define _() and N_(), and yysymbol_name returns
  637   the translated symbol (i.e., it returns '_("variable")' rather that
  638   '"variable"').  In Java, the user must provide an i18n() function.
  639 
  640 *** List of expected tokens (yacc.c)
  641 
  642   Push parsers may invoke yypstate_expected_tokens at any point during
  643   parsing (including even before submitting the first token) to get the list
  644   of possible tokens.  This feature can be used to propose autocompletion
  645   (see below the "bistromathic" example).
  646 
  647   It makes little sense to use this feature without enabling LAC (lookahead
  648   correction).
  649 
  650 *** Returning the error token
  651 
  652   When the scanner returns an invalid token or the undefined token
  653   (YYUNDEF), the parser generates an error message and enters error
  654   recovery.  Because of that error message, most scanners that find lexical
  655   errors generate an error message, and then ignore the invalid input
  656   without entering the error-recovery.
  657 
  658   The scanners may now return YYerror, the error token, to enter the
  659   error-recovery mode without triggering an additional error message.  See
  660   the bistromathic for an example.
  661 
  662 *** Deep overhaul of the symbol and token kinds
  663 
  664   To avoid the confusion with types in programming languages, we now refer
  665   to token and symbol "kinds" instead of token and symbol "types".  The
  666   documentation and error messages have been revised.
  667 
  668   All the skeletons have been updated to use dedicated enum types rather
  669   than integral types.  Special symbols are now regular citizens, instead of
  670   being declared in ad hoc ways.
  671 
  672 **** Token kinds
  673 
  674   The "token kind" is what is returned by the scanner, e.g., PLUS, NUMBER,
  675   LPAREN, etc.  While backward compatibility is of course ensured, users are
  676   nonetheless invited to replace their uses of "enum yytokentype" by
  677   "yytoken_kind_t".
  678 
  679   This type now also includes tokens that were previously hidden: YYEOF (end
  680   of input), YYUNDEF (undefined token), and YYerror (error token).  They
  681   now have string aliases, internationalized when internationalization is
  682   enabled.  Therefore, by default, error messages now refer to "end of file"
  683   (internationalized) rather than the cryptic "$end", or to "invalid token"
  684   rather than "$undefined".
  685 
  686   Therefore in most cases it is now useless to define the end-of-line token
  687   as follows:
  688 
  689     %token T_EOF 0 "end of file"
  690 
  691   Rather simply use "YYEOF" in your scanner.
  692 
  693 **** Symbol kinds
  694 
  695   The "symbol kinds" is what the parser actually uses.  (Unless the
  696   api.token.raw %define variable is used, the symbol kind of a terminal
  697   differs from the corresponding token kind.)
  698 
  699   They are now exposed as a enum, "yysymbol_kind_t".
  700 
  701   This allows users to tailor the error messages the way they want, or to
  702   process some symbols in a specific way in autocompletion (see the
  703   bistromathic example below).
  704 
  705 *** Modernize display of explanatory statements in diagnostics
  706 
  707   Since Bison 2.7, output was indented four spaces for explanatory
  708   statements.  For example:
  709 
  710     input.y:2.7-13: error: %type redeclaration for exp
  711     input.y:1.7-11:     previous declaration
  712 
  713   Since the introduction of caret-diagnostics, it became less clear.  This
  714   indentation has been removed and submessages are displayed similarly as in
  715   GCC:
  716 
  717     input.y:2.7-13: error: %type redeclaration for exp
  718         2 | %type <float> exp
  719           |       ^~~~~~~
  720     input.y:1.7-11: note: previous declaration
  721         1 | %type <int> exp
  722           |       ^~~~~
  723 
  724   Contributed by Victor Morales Cayuela.
  725 
  726 *** C++
  727 
  728   The token and symbol kinds are yy::parser::token_kind_type and
  729   yy::parser::symbol_kind_type.
  730 
  731   The symbol_type::kind() member function allows to get the kind of a
  732   symbol.  This can be used to write unit tests for scanners, e.g.,
  733 
  734     yy::parser::symbol_type t = make_NUMBER ("123");
  735     assert (t.kind () == yy::parser::symbol_kind::S_NUMBER);
  736     assert (t.value.as<int> () == 123);
  737 
  738 ** Documentation
  739 
  740 *** User Manual
  741 
  742   In order to avoid ambiguities with "type" as in "typing", we now refer to
  743   the "token kind" (e.g., `PLUS`, `NUMBER`, etc.) rather than the "token
  744   type".  We now also refer to the "symbol type" (e.g., `PLUS`, `expr`,
  745   etc.).
  746 
  747 *** Examples
  748 
  749   There are now examples/java: a very simple calculator, and a more complete
  750   one (push-parser, location tracking, and debug traces).
  751 
  752   The lexcalc example (a simple example in C based on Flex and Bison) now
  753   also demonstrates location tracking.
  754 
  755 
  756   A new C example, bistromathic, is a fully featured interactive calculator
  757   using many Bison features: pure interface, push parser, autocompletion
  758   based on the current parser state (using yypstate_expected_tokens),
  759   location tracking, internationalized custom error messages, lookahead
  760   correction, rich debug traces, etc.
  761 
  762   It shows how to depend on the symbol kinds to tailor autocompletion.  For
  763   instance it recognizes the symbol kind "VARIABLE" to propose
  764   autocompletion on the existing variables, rather than of the word
  765   "variable".
  766 
  767 
  768 * Noteworthy changes in release 3.5.4 (2020-04-05) [stable]
  769 
  770 ** WARNING: Future backward-incompatibilities!
  771 
  772   TL;DR: replace "#define YYERROR_VERBOSE 1" by "%define parse.error verbose".
  773 
  774   Bison 3.6 will no longer support the YYERROR_VERBOSE macro; the parsers
  775   that still depend on it will produce Yacc-like error messages (just
  776   "syntax error").  It was superseded by the "%error-verbose" directive in
  777   Bison 1.875 (2003-01-01).  Bison 2.6 (2012-07-19) clearly announced that
  778   support for YYERROR_VERBOSE would be removed.  Note that since Bison 3.0
  779   (2013-07-25), "%error-verbose" is deprecated in favor of "%define
  780   parse.error verbose".
  781 
  782 ** Bug fixes
  783 
  784   Fix portability issues of the package itself on old compilers.
  785 
  786   Fix api.token.raw support in Java.
  787 
  788 
  789 * Noteworthy changes in release 3.5.3 (2020-03-08) [stable]
  790 
  791 ** Bug fixes
  792 
  793   Error messages could quote lines containing zero-width characters (such as
  794   \005) with incorrect styling.  Fixes for similar issues with unexpectedly
  795   short lines (e.g., the file was changed between parsing and diagnosing).
  796 
  797   Some unlikely crashes found by fuzzing have been fixed.  This is only
  798   about bison itself, not the generated parsers.
  799 
  800 
  801 * Noteworthy changes in release 3.5.2 (2020-02-13) [stable]
  802 
  803 ** Bug fixes
  804 
  805   Portability issues and minor cosmetic issues.
  806 
  807   The lalr1.cc skeleton properly rejects unsupported values for parse.lac
  808   (as yacc.c does).
  809 
  810 
  811 * Noteworthy changes in release 3.5.1 (2020-01-19) [stable]
  812 
  813 ** Bug fixes
  814 
  815   Portability fixes.
  816 
  817   Fix compiler warnings.
  818 
  819 
  820 * Noteworthy changes in release 3.5 (2019-12-11) [stable]
  821 
  822 ** Backward incompatible changes
  823 
  824   Lone carriage-return characters (aka \r or ^M) in the grammar files are no
  825   longer treated as end-of-lines.  This changes the diagnostics, and in
  826   particular their locations.
  827 
  828   In C++, line numbers and columns are now represented as 'int' not
  829   'unsigned', so that integer overflow on positions is easily checkable via
  830   'gcc -fsanitize=undefined' and the like.  This affects the API for
  831   positions.  The default position and location classes now expose
  832   'counter_type' (int), used to define line and column numbers.
  833 
  834 ** Deprecated features
  835 
  836   The YYPRINT macro, which works only with yacc.c and only for tokens, was
  837   obsoleted long ago by %printer, introduced in Bison 1.50 (November 2002).
  838   It is deprecated and its support will be removed eventually.
  839 
  840 ** New features
  841 
  842 *** Lookahead correction in C++
  843 
  844   Contributed by Adrian Vogelsgesang.
  845 
  846   The C++ deterministic skeleton (lalr1.cc) now supports LAC, via the
  847   %define variable parse.lac.
  848 
  849 *** Variable api.token.raw: Optimized token numbers (all skeletons)
  850 
  851   In the generated parsers, tokens have two numbers: the "external" token
  852   number as returned by yylex (which starts at 257), and the "internal"
  853   symbol number (which starts at 3).  Each time yylex is called, a table
  854   lookup maps the external token number to the internal symbol number.
  855 
  856   When the %define variable api.token.raw is set, tokens are assigned their
  857   internal number, which saves one table lookup per token, and also saves
  858   the generation of the mapping table.
  859 
  860   The gain is typically moderate, but in extreme cases (very simple user
  861   actions), a 10% improvement can be observed.
  862 
  863 *** Generated parsers use better types for states
  864 
  865   Stacks now use the best integral type for state numbers, instead of always
  866   using 15 bits.  As a result "small" parsers now have a smaller memory
  867   footprint (they use 8 bits), and there is support for large automata (16
  868   bits), and extra large (using int, i.e., typically 31 bits).
  869 
  870 *** Generated parsers prefer signed integer types
  871 
  872   Bison skeletons now prefer signed to unsigned integer types when either
  873   will do, as the signed types are less error-prone and allow for better
  874   checking with 'gcc -fsanitize=undefined'.  Also, the types chosen are now
  875   portable to unusual machines where char, short and int are all the same
  876   width.  On non-GNU platforms this may entail including <limits.h> and (if
  877   available) <stdint.h> to define integer types and constants.
  878 
  879 *** A skeleton for the D programming language
  880 
  881   For the last few releases, Bison has shipped a stealth experimental
  882   skeleton: lalr1.d.  It was first contributed by Oliver Mangold, based on
  883   Paolo Bonzini's lalr1.java, and was cleaned and improved thanks to
  884   H. S. Teoh.
  885 
  886   However, because nobody has committed to improving, testing, and
  887   documenting this skeleton, it is not clear that it will be supported in
  888   the future.
  889 
  890   The lalr1.d skeleton *is functional*, and works well, as demonstrated in
  891   examples/d/calc.d.  Please try it, enjoy it, and... commit to support it.
  892 
  893 *** Debug traces in Java
  894 
  895   The Java backend no longer emits code and data for parser tracing if the
  896   %define variable parse.trace is not defined.
  897 
  898 ** Diagnostics
  899 
  900 *** New diagnostic: -Wdangling-alias
  901 
  902   String literals, which allow for better error messages, are (too)
  903   liberally accepted by Bison, which might result in silent errors.  For
  904   instance
  905 
  906     %type <exVal> cond "condition"
  907 
  908   does not define "condition" as a string alias to 'cond' (nonterminal
  909   symbols do not have string aliases).  It is rather equivalent to
  910 
  911     %nterm <exVal> cond
  912     %token <exVal> "condition"
  913 
  914   i.e., it gives the type 'exVal' to the "condition" token, which was
  915   clearly not the intention.
  916 
  917   Also, because string aliases need not be defined, typos such as "baz"
  918   instead of "bar" will be not reported.
  919 
  920   The option `-Wdangling-alias` catches these situations.  On
  921 
  922     %token BAR "bar"
  923     %type <ival> foo "foo"
  924     %%
  925     foo: "baz" {}
  926 
  927   bison -Wdangling-alias reports
  928 
  929     warning: string literal not attached to a symbol
  930           | %type <ival> foo "foo"
  931           |                  ^~~~~
  932     warning: string literal not attached to a symbol
  933           | foo: "baz" {}
  934           |      ^~~~~
  935 
  936    The `-Wall` option does not (yet?) include `-Wdangling-alias`.
  937 
  938 *** Better POSIX Yacc compatibility diagnostics
  939 
  940   POSIX Yacc restricts %type to nonterminals.  This is now diagnosed by
  941   -Wyacc.
  942 
  943     %token TOKEN1
  944     %type  <ival> TOKEN1 TOKEN2 't'
  945     %token TOKEN2
  946     %%
  947     expr:
  948 
  949   gives with -Wyacc
  950 
  951     input.y:2.15-20: warning: POSIX yacc reserves %type to nonterminals [-Wyacc]
  952         2 | %type  <ival> TOKEN1 TOKEN2 't'
  953           |               ^~~~~~
  954     input.y:2.29-31: warning: POSIX yacc reserves %type to nonterminals [-Wyacc]
  955         2 | %type  <ival> TOKEN1 TOKEN2 't'
  956           |                             ^~~
  957     input.y:2.22-27: warning: POSIX yacc reserves %type to nonterminals [-Wyacc]
  958         2 | %type  <ival> TOKEN1 TOKEN2 't'
  959           |                      ^~~~~~
  960 
  961 *** Diagnostics with insertion
  962 
  963   The diagnostics now display the suggestion below the underlined source.
  964   Replacement for undeclared symbols are now also suggested.
  965 
  966     $ cat /tmp/foo.y
  967     %%
  968     list: lis '.' |
  969 
  970     $ bison -Wall foo.y
  971     foo.y:2.7-9: error: symbol 'lis' is used, but is not defined as a token and has no rules; did you mean 'list'?
  972         2 | list: lis '.' |
  973           |       ^~~
  974           |       list
  975     foo.y:2.16: warning: empty rule without %empty [-Wempty-rule]
  976         2 | list: lis '.' |
  977           |                ^
  978           |                %empty
  979     foo.y: warning: fix-its can be applied.  Rerun with option '--update'. [-Wother]
  980 
  981 *** Diagnostics about long lines
  982 
  983   Quoted sources may now be truncated to fit the screen.  For instance, on a
  984   30-column wide terminal:
  985 
  986     $ cat foo.y
  987     %token FOO                       FOO                         FOO
  988     %%
  989     exp: FOO
  990     $ bison foo.y
  991     foo.y:1.34-36: warning: symbol FOO redeclared [-Wother]
  992         1 | …         FOO                  …
  993           |           ^~~
  994     foo.y:1.8-10:      previous declaration
  995         1 | %token FOO                     …
  996           |        ^~~
  997     foo.y:1.62-64: warning: symbol FOO redeclared [-Wother]
  998         1 | …         FOO
  999           |           ^~~
 1000     foo.y:1.8-10:      previous declaration
 1001         1 | %token FOO                     …
 1002           |        ^~~
 1003 
 1004 ** Changes
 1005 
 1006 *** Debugging glr.c and glr.cc
 1007 
 1008   The glr.c skeleton always had asserts to check its own behavior (not the
 1009   user's).  These assertions are now under the control of the parse.assert
 1010   %define variable (disabled by default).
 1011 
 1012 *** Clean up
 1013 
 1014   Several new compiler warnings in the generated output have been avoided.
 1015   Some unused features are no longer emitted.  Cleaner generated code in
 1016   general.
 1017 
 1018 ** Bug Fixes
 1019 
 1020   Portability issues in the test suite.
 1021 
 1022   In theory, parsers using %nonassoc could crash when reporting verbose
 1023   error messages. This unlikely bug has been fixed.
 1024 
 1025   In Java, %define api.prefix was ignored.  It now behaves as expected.
 1026 
 1027 
 1028 * Noteworthy changes in release 3.4.2 (2019-09-12) [stable]
 1029 
 1030 ** Bug fixes
 1031 
 1032   In some cases, when warnings are disabled, bison could emit tons of white
 1033   spaces as diagnostics.
 1034 
 1035   When running out of memory, bison could crash (found by fuzzing).
 1036 
 1037   When defining twice the EOF token, bison would crash.
 1038 
 1039   New warnings from recent compilers have been addressed in the generated
 1040   parsers (yacc.c, glr.c, glr.cc).
 1041 
 1042   When lone carriage-return characters appeared in the input file,
 1043   diagnostics could hang forever.
 1044 
 1045 
 1046 * Noteworthy changes in release 3.4.1 (2019-05-22) [stable]
 1047 
 1048 ** Bug fixes
 1049 
 1050   Portability fixes.
 1051 
 1052 
 1053 * Noteworthy changes in release 3.4 (2019-05-19) [stable]
 1054 
 1055 ** Deprecated features
 1056 
 1057   The %pure-parser directive is deprecated in favor of '%define api.pure'
 1058   since Bison 2.3b (2008-05-27), but no warning was issued; there is one
 1059   now.  Note that since Bison 2.7 you are strongly encouraged to use
 1060   '%define api.pure full' instead of '%define api.pure'.
 1061 
 1062 ** New features
 1063 
 1064 *** Colored diagnostics
 1065 
 1066   As an experimental feature, diagnostics are now colored, controlled by the
 1067   new options --color and --style.
 1068 
 1069   To use them, install the libtextstyle library before configuring Bison.
 1070   It is available from
 1071 
 1072     https://alpha.gnu.org/gnu/gettext/
 1073 
 1074   for instance
 1075 
 1076     https://alpha.gnu.org/gnu/gettext/libtextstyle-0.8.tar.gz
 1077 
 1078   The option --color supports the following arguments:
 1079     - always, yes: Enable colors.
 1080     - never, no: Disable colors.
 1081     - auto, tty (default): Enable colors if the output device is a tty.
 1082 
 1083   To customize the styles, create a CSS file similar to
 1084 
 1085     /* bison-bw.css */
 1086     .warning   { }
 1087     .error     { font-weight: 800; text-decoration: underline; }
 1088     .note      { }
 1089 
 1090   then invoke bison with --style=bison-bw.css, or set the BISON_STYLE
 1091   environment variable to "bison-bw.css".
 1092 
 1093 *** Disabling output
 1094 
 1095   When given -fsyntax-only, the diagnostics are reported, but no output is
 1096   generated.
 1097 
 1098   The name of this option is somewhat misleading as bison does more than
 1099   just checking the syntax: every stage is run (including checking for
 1100   conflicts for instance), except the generation of the output files.
 1101 
 1102 *** Include the generated header (yacc.c)
 1103 
 1104   Before, when --defines is used, bison generated a header, and pasted an
 1105   exact copy of it into the generated parser implementation file.  If the
 1106   header name is not "y.tab.h", it is now #included instead of being
 1107   duplicated.
 1108 
 1109   To use an '#include' even if the header name is "y.tab.h" (which is what
 1110   happens with --yacc, or when using the Autotools' ylwrap), define
 1111   api.header.include to the exact argument to pass to #include.  For
 1112   instance:
 1113 
 1114     %define api.header.include {"parse.h"}
 1115 
 1116   or
 1117 
 1118     %define api.header.include {<parser/parse.h>}
 1119 
 1120 *** api.location.type is now supported in C (yacc.c, glr.c)
 1121 
 1122   The %define variable api.location.type defines the name of the type to use
 1123   for locations.  When defined, Bison no longer defines YYLTYPE.
 1124 
 1125   This can be used in programs with several parsers to factor their
 1126   definition of locations: let one of them generate them, and the others
 1127   just use them.
 1128 
 1129 ** Changes
 1130 
 1131 *** Graphviz output
 1132 
 1133   In conformance with the recommendations of the Graphviz team, if %require
 1134   "3.4" (or better) is specified, the option --graph generates a *.gv file
 1135   by default, instead of *.dot.
 1136 
 1137 *** Diagnostics overhaul
 1138 
 1139   Column numbers were wrong with multibyte characters, which would also
 1140   result in skewed diagnostics with carets.  Beside, because we were
 1141   indenting the quoted source with a single space, lines with tab characters
 1142   were incorrectly underlined.
 1143 
 1144   To address these issues, and to be clearer, Bison now issues diagnostics
 1145   as GCC9 does.  For instance it used to display (there's a tab before the
 1146   opening brace):
 1147 
 1148     foo.y:3.37-38: error: $2 of ‘expr’ has no declared type
 1149      expr: expr '+' "number"        { $$ = $1 + $2; }
 1150                                          ^~
 1151   It now reports
 1152 
 1153     foo.y:3.37-38: error: $2 of ‘expr’ has no declared type
 1154         3 | expr: expr '+' "number" { $$ = $1 + $2; }
 1155           |                                     ^~
 1156 
 1157   Other constructs now also have better locations, resulting in more precise
 1158   diagnostics.
 1159 
 1160 *** Fix-it hints for %empty
 1161 
 1162   Running Bison with -Wempty-rules and --update will remove incorrect %empty
 1163   annotations, and add the missing ones.
 1164 
 1165 *** Generated reports
 1166 
 1167   The format of the reports (parse.output) was improved for readability.
 1168 
 1169 *** Better support for --no-line.
 1170 
 1171   When --no-line is used, the generated files are now cleaner: no lines are
 1172   generated instead of empty lines.  Together with using api.header.include,
 1173   that should help people saving the generated files into version control
 1174   systems get smaller diffs.
 1175 
 1176 ** Documentation
 1177 
 1178   A new example in C shows an simple infix calculator with a hand-written
 1179   scanner (examples/c/calc).
 1180 
 1181   A new example in C shows a reentrant parser (capable of recursive calls)
 1182   built with Flex and Bison (examples/c/reccalc).
 1183 
 1184   There is a new section about the history of Yaccs and Bison.
 1185 
 1186 ** Bug fixes
 1187 
 1188   A few obscure bugs were fixed, including the second oldest (known) bug in
 1189   Bison: it was there when Bison was entered in the RCS version control
 1190   system, in December 1987.  See the NEWS of Bison 3.3 for the previous
 1191   oldest bug.
 1192 
 1193 
 1194 * Noteworthy changes in release 3.3.2 (2019-02-03) [stable]
 1195 
 1196 ** Bug fixes
 1197 
 1198   Bison 3.3 failed to generate parsers for grammars with unused nonterminal
 1199   symbols.
 1200 
 1201 
 1202 * Noteworthy changes in release 3.3.1 (2019-01-27) [stable]
 1203 
 1204 ** Changes
 1205 
 1206   The option -y/--yacc used to imply -Werror=yacc, which turns uses of Bison
 1207   extensions into errors.  It now makes them simple warnings (-Wyacc).
 1208 
 1209 
 1210 * Noteworthy changes in release 3.3 (2019-01-26) [stable]
 1211 
 1212   A new mailing list was created, Bison Announce.  It is low traffic, and is
 1213   only about announcing new releases and important messages (e.g., polls
 1214   about major decisions to make).
 1215 
 1216   https://lists.gnu.org/mailman/listinfo/bison-announce
 1217 
 1218 ** Backward incompatible changes
 1219 
 1220   Support for DJGPP, which has been unmaintained and untested for years, is
 1221   removed.
 1222 
 1223 ** Deprecated features
 1224 
 1225   A new feature, --update (see below) helps adjusting existing grammars to
 1226   deprecations.
 1227 
 1228 *** Deprecated directives
 1229 
 1230   The %error-verbose directive is deprecated in favor of '%define
 1231   parse.error verbose' since Bison 3.0, but no warning was issued.
 1232 
 1233   The '%name-prefix "xx"' directive is deprecated in favor of '%define
 1234   api.prefix {xx}' since Bison 3.0, but no warning was issued.  These
 1235   directives are slightly different, you might need to adjust your code.
 1236   %name-prefix renames only symbols with external linkage, while api.prefix
 1237   also renames types and macros, including YYDEBUG, YYTOKENTYPE,
 1238   yytokentype, YYSTYPE, YYLTYPE, etc.
 1239 
 1240   Users of Flex that move from '%name-prefix "xx"' to '%define api.prefix
 1241   {xx}' will typically have to update YY_DECL from
 1242 
 1243     #define YY_DECL int xxlex (YYSTYPE *yylval, YYLTYPE *yylloc)
 1244 
 1245   to
 1246 
 1247     #define YY_DECL int xxlex (XXSTYPE *yylval, XXLTYPE *yylloc)
 1248 
 1249 *** Deprecated %define variable names
 1250 
 1251   The following variables, mostly related to parsers in Java, have been
 1252   renamed for consistency.  Backward compatibility is ensured, but upgrading
 1253   is recommended.
 1254 
 1255     abstract           -> api.parser.abstract
 1256     annotations        -> api.parser.annotations
 1257     extends            -> api.parser.extends
 1258     final              -> api.parser.final
 1259     implements         -> api.parser.implements
 1260     parser_class_name  -> api.parser.class
 1261     public             -> api.parser.public
 1262     strictfp           -> api.parser.strictfp
 1263 
 1264 ** New features
 1265 
 1266 *** Generation of fix-its for IDEs/Editors
 1267 
 1268   When given the new option -ffixit (aka -fdiagnostics-parseable-fixits),
 1269   bison now generates machine readable editing instructions to fix some
 1270   issues.  Currently, this is mostly limited to updating deprecated
 1271   directives and removing duplicates.  For instance:
 1272 
 1273     $ cat foo.y
 1274     %error-verbose
 1275     %define parser_class_name "Parser"
 1276     %define api.parser.class "Parser"
 1277     %%
 1278     exp:;
 1279 
 1280   See the "fix-it:" lines below:
 1281 
 1282     $ bison -ffixit foo.y
 1283     foo.y:1.1-14: warning: deprecated directive, use '%define parse.error verbose' [-Wdeprecated]
 1284      %error-verbose
 1285      ^~~~~~~~~~~~~~
 1286     fix-it:"foo.y":{1:1-1:15}:"%define parse.error verbose"
 1287     foo.y:2.1-34: warning: deprecated directive, use '%define api.parser.class {Parser}' [-Wdeprecated]
 1288      %define parser_class_name "Parser"
 1289      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1290     fix-it:"foo.y":{2:1-2:35}:"%define api.parser.class {Parser}"
 1291     foo.y:3.1-33: error: %define variable 'api.parser.class' redefined
 1292      %define api.parser.class "Parser"
 1293      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1294     foo.y:2.1-34:     previous definition
 1295      %define parser_class_name "Parser"
 1296      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1297     fix-it:"foo.y":{3:1-3:34}:""
 1298     foo.y: warning: fix-its can be applied.  Rerun with option '--update'. [-Wother]
 1299 
 1300   This uses the same output format as GCC and Clang.
 1301 
 1302 *** Updating grammar files
 1303 
 1304   Fixes can be applied on the fly.  The previous example ends with the
 1305   suggestion to re-run bison with the option -u/--update, which results in a
 1306   cleaner grammar file.
 1307 
 1308     $ bison --update foo.y
 1309     [...]
 1310     bison: file 'foo.y' was updated (backup: 'foo.y~')
 1311 
 1312     $ cat foo.y
 1313     %define parse.error verbose
 1314     %define api.parser.class {Parser}
 1315     %%
 1316     exp:;
 1317 
 1318 *** Bison is now relocatable
 1319 
 1320   If you pass '--enable-relocatable' to 'configure', Bison is relocatable.
 1321 
 1322   A relocatable program can be moved or copied to a different location on
 1323   the file system.  It can also be used through mount points for network
 1324   sharing.  It is possible to make symbolic links to the installed and moved
 1325   programs, and invoke them through the symbolic link.
 1326 
 1327 *** %expect and %expect-rr modifiers on individual rules
 1328 
 1329   One can now document (and check) which rules participate in shift/reduce
 1330   and reduce/reduce conflicts.  This is particularly important GLR parsers,
 1331   where conflicts are a normal occurrence.  For example,
 1332 
 1333       %glr-parser
 1334       %expect 1
 1335       %%
 1336 
 1337       ...
 1338 
 1339       argument_list:
 1340         arguments %expect 1
 1341       | arguments ','
 1342       | %empty
 1343       ;
 1344 
 1345       arguments:
 1346         expression
 1347       | argument_list ',' expression
 1348       ;
 1349 
 1350       ...
 1351 
 1352   Looking at the output from -v, one can see that the shift/reduce conflict
 1353   here is due to the fact that the parser does not know whether to reduce
 1354   arguments to argument_list until it sees the token _after_ the following
 1355   ','.  By marking the rule with %expect 1 (because there is a conflict in
 1356   one state), we document the source of the 1 overall shift/reduce conflict.
 1357 
 1358   In GLR parsers, we can use %expect-rr in a rule for reduce/reduce
 1359   conflicts.  In this case, we mark each of the conflicting rules.  For
 1360   example,
 1361 
 1362       %glr-parser
 1363       %expect-rr 1
 1364 
 1365       %%
 1366 
 1367       stmt:
 1368         target_list '=' expr ';'
 1369       | expr_list ';'
 1370       ;
 1371 
 1372       target_list:
 1373         target
 1374       | target ',' target_list
 1375       ;
 1376 
 1377       target:
 1378         ID %expect-rr 1
 1379       ;
 1380 
 1381       expr_list:
 1382         expr
 1383       | expr ',' expr_list
 1384       ;
 1385 
 1386       expr:
 1387         ID %expect-rr 1
 1388       | ...
 1389       ;
 1390 
 1391   In a statement such as
 1392 
 1393       x, y = 3, 4;
 1394 
 1395   the parser must reduce x to a target or an expr, but does not know which
 1396   until it sees the '='.  So we notate the two possible reductions to
 1397   indicate that each conflicts in one rule.
 1398 
 1399   This feature needs user feedback, and might evolve in the future.
 1400 
 1401 *** C++: Actual token constructors
 1402 
 1403   When variants and token constructors are enabled, in addition to the
 1404   type-safe named token constructors (make_ID, make_INT, etc.), we now
 1405   generate genuine constructors for symbol_type.
 1406 
 1407   For instance with these declarations
 1408 
 1409     %token           ':'
 1410        <std::string> ID
 1411        <int>         INT;
 1412 
 1413   you may use these constructors:
 1414 
 1415     symbol_type (int token, const std::string&);
 1416     symbol_type (int token, const int&);
 1417     symbol_type (int token);
 1418 
 1419   Correct matching between token types and value types is checked via
 1420   'assert'; for instance, 'symbol_type (ID, 42)' would abort.  Named
 1421   constructors are preferable, as they offer better type safety (for
 1422   instance 'make_ID (42)' would not even compile), but symbol_type
 1423   constructors may help when token types are discovered at run-time, e.g.,
 1424 
 1425      [a-z]+   {
 1426                 if (auto i = lookup_keyword (yytext))
 1427                   return yy::parser::symbol_type (i);
 1428                 else
 1429                   return yy::parser::make_ID (yytext);
 1430               }
 1431 
 1432 *** C++: Variadic emplace
 1433 
 1434   If your application requires C++11 and you don't use symbol constructors,
 1435   you may now use a variadic emplace for semantic values:
 1436 
 1437     %define api.value.type variant
 1438     %token <std::pair<int, int>> PAIR
 1439 
 1440   in your scanner:
 1441 
 1442     int yylex (parser::semantic_type *lvalp)
 1443     {
 1444       lvalp->emplace <std::pair<int, int>> (1, 2);
 1445       return parser::token::PAIR;
 1446     }
 1447 
 1448 *** C++: Syntax error exceptions in GLR
 1449 
 1450   The glr.cc skeleton now supports syntax_error exceptions thrown from user
 1451   actions, or from the scanner.
 1452 
 1453 *** More POSIX Yacc compatibility warnings
 1454 
 1455   More Bison specific directives are now reported with -y or -Wyacc.  This
 1456   change was ready since the release of Bison 3.0 in September 2015.  It was
 1457   delayed because Autoconf used to define YACC as `bison -y`, which resulted
 1458   in numerous warnings for Bison users that use the GNU Build System.
 1459 
 1460   If you still experience that problem, either redefine YACC as `bison -o
 1461   y.tab.c`, or pass -Wno-yacc to Bison.
 1462 
 1463 *** The tables yyrhs and yyphrs are back
 1464 
 1465   Because no Bison skeleton uses them, these tables were removed (no longer
 1466   passed to the skeletons, not even computed) in 2008.  However, some users
 1467   have expressed interest in being able to use them in their own skeletons.
 1468 
 1469 ** Bug fixes
 1470 
 1471 *** Incorrect number of reduce/reduce conflicts
 1472 
 1473   On a grammar such as
 1474 
 1475      exp: "num" | "num" | "num"
 1476 
 1477   bison used to report a single RR conflict, instead of two.  This is now
 1478   fixed.  This was the oldest (known) bug in Bison: it was there when Bison
 1479   was entered in the RCS version control system, in December 1987.
 1480 
 1481   Some grammar files might have to adjust their %expect-rr.
 1482 
 1483 *** Parser directives that were not careful enough
 1484 
 1485   Passing invalid arguments to %nterm, for instance character literals, used
 1486   to result in unclear error messages.
 1487 
 1488 ** Documentation
 1489 
 1490   The examples/ directory (installed in .../share/doc/bison/examples) has
 1491   been restructured per language for clarity.  The examples come with a
 1492   README and a Makefile.  Not only can they be used to toy with Bison, they
 1493   can also be starting points for your own grammars.
 1494 
 1495   There is now a Java example, and a simple example in C based on Flex and
 1496   Bison (examples/c/lexcalc/).
 1497 
 1498 ** Changes
 1499 
 1500 *** Parsers in C++
 1501 
 1502   They now use noexcept and constexpr.  Please, report missing annotations.
 1503 
 1504 *** Symbol Declarations
 1505 
 1506   The syntax of the variation directives to declare symbols was overhauled
 1507   for more consistency, and also better POSIX Yacc compliance (which, for
 1508   instance, allows "%type" without actually providing a type).  The %nterm
 1509   directive, supported by Bison since its inception, is now documented and
 1510   officially supported.
 1511 
 1512   The syntax is now as follows:
 1513 
 1514     %token TAG? ( ID NUMBER? STRING? )+ ( TAG ( ID NUMBER? STRING? )+ )*
 1515     %left  TAG? ( ID NUMBER? )+ ( TAG ( ID NUMBER? )+ )*
 1516     %type  TAG? ( ID | CHAR | STRING )+ ( TAG ( ID | CHAR | STRING )+ )*
 1517     %nterm TAG? ID+ ( TAG ID+ )*
 1518 
 1519   where TAG denotes a type tag such as ‘<ival>’, ID denotes an identifier
 1520   such as ‘NUM’, NUMBER a decimal or hexadecimal integer such as ‘300’ or
 1521   ‘0x12d’, CHAR a character literal such as ‘'+'’, and STRING a string
 1522   literal such as ‘"number"’.  The post-fix quantifiers are ‘?’ (zero or
 1523   one), ‘*’ (zero or more) and ‘+’ (one or more).
 1524 
 1525 
 1526 * Noteworthy changes in release 3.2.4 (2018-12-24) [stable]
 1527 
 1528 ** Bug fixes
 1529 
 1530   Fix the move constructor of symbol_type.
 1531 
 1532   Always provide a copy constructor for symbol_type, even in modern C++.
 1533 
 1534 
 1535 * Noteworthy changes in release 3.2.3 (2018-12-18) [stable]
 1536 
 1537 ** Bug fixes
 1538 
 1539   Properly support token constructors in C++ with types that include commas
 1540   (e.g., std::pair<int, int>).  A regression introduced in Bison 3.2.
 1541 
 1542 
 1543 * Noteworthy changes in release 3.2.2 (2018-11-21) [stable]
 1544 
 1545 ** Bug fixes
 1546 
 1547   C++ portability issues.
 1548 
 1549 
 1550 * Noteworthy changes in release 3.2.1 (2018-11-09) [stable]
 1551 
 1552 ** Bug fixes
 1553 
 1554   Several portability issues have been fixed in the build system, in the
 1555   test suite, and in the generated parsers in C++.
 1556 
 1557 
 1558 * Noteworthy changes in release 3.2 (2018-10-29) [stable]
 1559 
 1560 ** Backward incompatible changes
 1561 
 1562   Support for DJGPP, which has been unmaintained and untested for years, is
 1563   obsolete.  Unless there is activity to revive it, it will be removed.
 1564 
 1565 ** Changes
 1566 
 1567   %printers should use yyo rather than yyoutput to denote the output stream.
 1568 
 1569   Variant-based symbols in C++ should use emplace() rather than build().
 1570 
 1571   In C++ parsers, parser::operator() is now a synonym for the parser::parse.
 1572 
 1573 ** Documentation
 1574 
 1575   A new section, "A Simple C++ Example", is a tutorial for parsers in C++.
 1576 
 1577   A comment in the generated code now emphasizes that users should not
 1578   depend upon non-documented implementation details, such as macros starting
 1579   with YY_.
 1580 
 1581 ** New features
 1582 
 1583 *** C++: Support for move semantics (lalr1.cc)
 1584 
 1585   The lalr1.cc skeleton now fully supports C++ move semantics, while
 1586   maintaining compatibility with C++98.  You may now store move-only types
 1587   when using Bison's variants.  For instance:
 1588 
 1589     %code {
 1590       #include <memory>
 1591       #include <vector>
 1592     }
 1593 
 1594     %skeleton "lalr1.cc"
 1595     %define api.value.type variant
 1596 
 1597     %%
 1598 
 1599     %token <int> INT "int";
 1600     %type <std::unique_ptr<int>> int;
 1601     %type <std::vector<std::unique_ptr<int>>> list;
 1602 
 1603     list:
 1604       %empty    {}
 1605     | list int  { $$ = std::move($1); $$.emplace_back(std::move($2)); }
 1606 
 1607     int: "int"  { $$ = std::make_unique<int>($1); }
 1608 
 1609 *** C++: Implicit move of right-hand side values (lalr1.cc)
 1610 
 1611   In modern C++ (C++11 and later), you should always use 'std::move' with
 1612   the values of the right-hand side symbols ($1, $2, etc.), as they will be
 1613   popped from the stack anyway.  Using 'std::move' is mandatory for
 1614   move-only types such as unique_ptr, and it provides a significant speedup
 1615   for large types such as std::string, or std::vector, etc.
 1616 
 1617   If '%define api.value.automove' is set, every occurrence '$n' is replaced
 1618   by 'std::move ($n)'.  The second rule in the previous grammar can be
 1619   simplified to:
 1620 
 1621     list: list int  { $$ = $1; $$.emplace_back($2); }
 1622 
 1623   With automove enabled, the semantic values are no longer lvalues, so do
 1624   not use the swap idiom:
 1625 
 1626     list: list int  { std::swap($$, $1); $$.emplace_back($2); }
 1627 
 1628   This idiom is anyway obsolete: it is preferable to move than to swap.
 1629 
 1630   A warning is issued when automove is enabled, and a value is used several
 1631   times.
 1632 
 1633     input.yy:16.31-32: warning: multiple occurrences of $2 with api.value.automove enabled [-Wother]
 1634     exp: "twice" exp   { $$ = $2 + $2; }
 1635                                    ^^
 1636 
 1637   Enabling api.value.automove does not require support for modern C++.  The
 1638   generated code is valid C++98/03, but will use copies instead of moves.
 1639 
 1640   The new examples/c++/variant-11.yy shows these features in action.
 1641 
 1642 *** C++: The implicit default semantic action is always run
 1643 
 1644   When variants are enabled, the default action was not run, so
 1645 
 1646     exp: "number"
 1647 
 1648   was equivalent to
 1649 
 1650     exp: "number"  {}
 1651 
 1652   It now behaves like in all the other cases, as
 1653 
 1654     exp: "number"  { $$ = $1; }
 1655 
 1656   possibly using std::move if automove is enabled.
 1657 
 1658   We do not expect backward compatibility issues.  However, beware of
 1659   forward compatibility issues: if you rely on default actions with
 1660   variants, be sure to '%require "3.2"' to avoid older versions of Bison to
 1661   generate incorrect parsers.
 1662 
 1663 *** C++: Renaming location.hh
 1664 
 1665   When both %defines and %locations are enabled, Bison generates a
 1666   location.hh file.  If you don't use locations outside of the parser, you
 1667   may avoid its creation with:
 1668 
 1669     %define api.location.file none
 1670 
 1671   However this file is useful if, for instance, your parser builds an AST
 1672   decorated with locations: you may use Bison's location independently of
 1673   Bison's parser.  You can now give it another name, for instance:
 1674 
 1675     %define api.location.file "my-location.hh"
 1676 
 1677   This name can have directory components, and even be absolute.  The name
 1678   under which the location file is included is controlled by
 1679   api.location.include.
 1680 
 1681   This way it is possible to have several parsers share the same location
 1682   file.
 1683 
 1684   For instance, in src/foo/parser.hh, generate the include/ast/loc.hh file:
 1685 
 1686     %locations
 1687     %define api.namespace {foo}
 1688     %define api.location.file "include/ast/loc.hh"
 1689     %define api.location.include {<ast/loc.hh>}
 1690 
 1691   and use it in src/bar/parser.hh:
 1692 
 1693     %locations
 1694     %define api.namespace {bar}
 1695     %code requires {#include <ast/loc.hh>}
 1696     %define api.location.type {bar::location}
 1697 
 1698   Absolute file names are supported, so in your Makefile, passing the flag
 1699   -Dapi.location.file='"$(top_srcdir)/include/ast/location.hh"' to bison is
 1700   safe.
 1701 
 1702 *** C++: stack.hh and position.hh are deprecated
 1703 
 1704   When asked to generate a header file (%defines), the lalr1.cc skeleton
 1705   generates a stack.hh file.  This file had no interest for users; it is now
 1706   made useless: its content is included in the parser definition.  It is
 1707   still generated for backward compatibility.
 1708 
 1709   When in addition to %defines, location support is requested (%locations),
 1710   the file position.hh is also generated.  It is now also useless: its
 1711   content is now included in location.hh.
 1712 
 1713   These files are no longer generated when your grammar file requires at
 1714   least Bison 3.2 (%require "3.2").
 1715 
 1716 ** Bug fixes
 1717 
 1718   Portability issues on MinGW and VS2015.
 1719 
 1720   Portability issues in the test suite.
 1721 
 1722   Portability/warning issues with Flex.
 1723 
 1724 
 1725 * Noteworthy changes in release 3.1 (2018-08-27) [stable]
 1726 
 1727 ** Backward incompatible changes
 1728 
 1729   Compiling Bison now requires a C99 compiler---as announced during the
 1730   release of Bison 3.0, five years ago.  Generated parsers do not require a
 1731   C99 compiler.
 1732 
 1733   Support for DJGPP, which has been unmaintained and untested for years, is
 1734   obsolete. Unless there is activity to revive it, the next release of Bison
 1735   will have it removed.
 1736 
 1737 ** New features
 1738 
 1739 *** Typed midrule actions
 1740 
 1741   Because their type is unknown to Bison, the values of midrule actions are
 1742   not treated like the others: they don't have %printer and %destructor
 1743   support.  It also prevents C++ (Bison) variants to handle them properly.
 1744 
 1745   Typed midrule actions address these issues.  Instead of:
 1746 
 1747     exp: { $<ival>$ = 1; } { $<ival>$ = 2; }   { $$ = $<ival>1 + $<ival>2; }
 1748 
 1749   write:
 1750 
 1751     exp: <ival>{ $$ = 1; } <ival>{ $$ = 2; }   { $$ = $1 + $2; }
 1752 
 1753 *** Reports include the type of the symbols
 1754 
 1755   The sections about terminal and nonterminal symbols of the '*.output' file
 1756   now specify their declared type.  For instance, for:
 1757 
 1758     %token <ival> NUM
 1759 
 1760   the report now shows '<ival>':
 1761 
 1762     Terminals, with rules where they appear
 1763 
 1764     NUM <ival> (258) 5
 1765 
 1766 *** Diagnostics about useless rules
 1767 
 1768   In the following grammar, the 'exp' nonterminal is trivially useless.  So,
 1769   of course, its rules are useless too.
 1770 
 1771     %%
 1772     input: '0' | exp
 1773     exp: exp '+' exp | exp '-' exp | '(' exp ')'
 1774 
 1775   Previously all the useless rules were reported, including those whose
 1776   left-hand side is the 'exp' nonterminal:
 1777 
 1778     warning: 1 nonterminal useless in grammar [-Wother]
 1779     warning: 4 rules useless in grammar [-Wother]
 1780     2.14-16: warning: nonterminal useless in grammar: exp [-Wother]
 1781      input: '0' | exp
 1782                   ^^^
 1783     2.14-16: warning: rule useless in grammar [-Wother]
 1784      input: '0' | exp
 1785                   ^^^
 1786     3.6-16: warning: rule useless in grammar [-Wother]
 1787      exp: exp '+' exp | exp '-' exp | '(' exp ')'
 1788           ^^^^^^^^^^^
 1789     3.20-30: warning: rule useless in grammar [-Wother]
 1790      exp: exp '+' exp | exp '-' exp | '(' exp ')'
 1791                         ^^^^^^^^^^^
 1792     3.34-44: warning: rule useless in grammar [-Wother]
 1793      exp: exp '+' exp | exp '-' exp | '(' exp ')'
 1794                                       ^^^^^^^^^^^
 1795 
 1796   Now, rules whose left-hand side symbol is useless are no longer reported
 1797   as useless.  The locations of the errors have also been adjusted to point
 1798   to the first use of the nonterminal as a left-hand side of a rule:
 1799 
 1800     warning: 1 nonterminal useless in grammar [-Wother]
 1801     warning: 4 rules useless in grammar [-Wother]
 1802     3.1-3: warning: nonterminal useless in grammar: exp [-Wother]
 1803      exp: exp '+' exp | exp '-' exp | '(' exp ')'
 1804      ^^^
 1805     2.14-16: warning: rule useless in grammar [-Wother]
 1806      input: '0' | exp
 1807                   ^^^
 1808 
 1809 *** C++: Generated parsers can be compiled with -fno-exceptions (lalr1.cc)
 1810 
 1811   When compiled with exceptions disabled, the generated parsers no longer
 1812   uses try/catch clauses.
 1813 
 1814   Currently only GCC and Clang are supported.
 1815 
 1816 ** Documentation
 1817 
 1818 *** A demonstration of variants
 1819 
 1820   A new example was added (installed in .../share/doc/bison/examples),
 1821   'variant.yy', which shows how to use (Bison) variants in C++.
 1822 
 1823   The other examples were made nicer to read.
 1824 
 1825 *** Some features are no longer 'experimental'
 1826 
 1827   The following features, mature enough, are no longer flagged as
 1828   experimental in the documentation: push parsers, default %printer and
 1829   %destructor (typed: <*> and untyped: <>), %define api.value.type union and
 1830   variant, Java parsers, XML output, LR family (lr, ielr, lalr), and
 1831   semantic predicates (%?).
 1832 
 1833 ** Bug fixes
 1834 
 1835 *** GLR: Predicates support broken by #line directives
 1836 
 1837   Predicates (%?) in GLR such as
 1838 
 1839     widget:
 1840       %? {new_syntax} 'w' id new_args
 1841     | %?{!new_syntax} 'w' id old_args
 1842 
 1843   were issued with #lines in the middle of C code.
 1844 
 1845 *** Printer and destructor with broken #line directives
 1846 
 1847   The #line directives were not properly escaped when emitting the code for
 1848   %printer/%destructor, which resulted in compiler errors if there are
 1849   backslashes or double-quotes in the grammar file name.
 1850 
 1851 *** Portability on ICC
 1852 
 1853   The Intel compiler claims compatibility with GCC, yet rejects its _Pragma.
 1854   Generated parsers now work around this.
 1855 
 1856 *** Various
 1857 
 1858   There were several small fixes in the test suite and in the build system,
 1859   many warnings in bison and in the generated parsers were eliminated.  The
 1860   documentation also received its share of minor improvements.
 1861 
 1862   Useless code was removed from C++ parsers, and some of the generated
 1863   constructors are more 'natural'.
 1864 
 1865 
 1866 * Noteworthy changes in release 3.0.5 (2018-05-27) [stable]
 1867 
 1868 ** Bug fixes
 1869 
 1870 *** C++: Fix support of 'syntax_error'
 1871 
 1872   One incorrect 'inline' resulted in linking errors about the constructor of
 1873   the syntax_error exception.
 1874 
 1875 *** C++: Fix warnings
 1876 
 1877   GCC 7.3 (with -O1 or -O2 but not -O0 or -O3) issued null-dereference
 1878   warnings about yyformat being possibly null.  It also warned about the
 1879   deprecated implicit definition of copy constructors when there's a
 1880   user-defined (copy) assignment operator.
 1881 
 1882 *** Location of errors
 1883 
 1884   In C++ parsers, out-of-bounds errors can happen when a rule with an empty
 1885   ride-hand side raises a syntax error.  The behavior of the default parser
 1886   (yacc.c) in such a condition was undefined.
 1887 
 1888   Now all the parsers match the behavior of glr.c: @$ is used as the
 1889   location of the error.  This handles gracefully rules with and without
 1890   rhs.
 1891 
 1892 *** Portability fixes in the test suite
 1893 
 1894   On some platforms, some Java and/or C++ tests were failing.
 1895 
 1896 
 1897 * Noteworthy changes in release 3.0.4 (2015-01-23) [stable]
 1898 
 1899 ** Bug fixes
 1900 
 1901 *** C++ with Variants (lalr1.cc)
 1902 
 1903   Fix a compiler warning when no %destructor use $$.
 1904 
 1905 *** Test suites
 1906 
 1907   Several portability issues in tests were fixed.
 1908 
 1909 
 1910 * Noteworthy changes in release 3.0.3 (2015-01-15) [stable]
 1911 
 1912 ** Bug fixes
 1913 
 1914 *** C++ with Variants (lalr1.cc)
 1915 
 1916   Problems with %destructor and '%define parse.assert' have been fixed.
 1917 
 1918 *** Named %union support (yacc.c, glr.c)
 1919 
 1920   Bison 3.0 introduced a regression on named %union such as
 1921 
 1922     %union foo { int ival; };
 1923 
 1924   The possibility to use a name was introduced "for Yacc compatibility".
 1925   It is however not required by POSIX Yacc, and its usefulness is not clear.
 1926 
 1927 *** %define api.value.type union with %defines (yacc.c, glr.c)
 1928 
 1929   The C parsers were broken when %defines was used together with "%define
 1930   api.value.type union".
 1931 
 1932 *** Redeclarations are reported in proper order
 1933 
 1934   On
 1935 
 1936     %token FOO "foo"
 1937     %printer {} "foo"
 1938     %printer {} FOO
 1939 
 1940   bison used to report:
 1941 
 1942     foo.yy:2.10-11: error: %printer redeclaration for FOO
 1943      %printer {} "foo"
 1944               ^^
 1945     foo.yy:3.10-11:     previous declaration
 1946      %printer {} FOO
 1947               ^^
 1948 
 1949   Now, the "previous" declaration is always the first one.
 1950 
 1951 
 1952 ** Documentation
 1953 
 1954   Bison now installs various files in its docdir (which defaults to
 1955   '/usr/local/share/doc/bison'), including the three fully blown examples
 1956   extracted from the documentation:
 1957 
 1958    - rpcalc
 1959      Reverse Polish Calculator, a simple introductory example.
 1960    - mfcalc
 1961      Multi-function Calc, a calculator with memory and functions and located
 1962      error messages.
 1963    - calc++
 1964      a calculator in C++ using variant support and token constructors.
 1965 
 1966 
 1967 * Noteworthy changes in release 3.0.2 (2013-12-05) [stable]
 1968 
 1969 ** Bug fixes
 1970 
 1971 *** Generated source files when errors are reported
 1972 
 1973   When warnings are issued and -Werror is set, bison would still generate
 1974   the source files (*.c, *.h...).  As a consequence, some runs of "make"
 1975   could fail the first time, but not the second (as the files were generated
 1976   anyway).
 1977 
 1978   This is fixed: bison no longer generates this source files, but, of
 1979   course, still produces the various reports (*.output, *.xml, etc.).
 1980 
 1981 *** %empty is used in reports
 1982 
 1983   Empty right-hand sides are denoted by '%empty' in all the reports (text,
 1984   dot, XML and formats derived from it).
 1985 
 1986 *** YYERROR and variants
 1987 
 1988   When C++ variant support is enabled, an error triggered via YYERROR, but
 1989   not caught via error recovery, resulted in a double deletion.
 1990 
 1991 
 1992 * Noteworthy changes in release 3.0.1 (2013-11-12) [stable]
 1993 
 1994 ** Bug fixes
 1995 
 1996 *** Errors in caret diagnostics
 1997 
 1998   On some platforms, some errors could result in endless diagnostics.
 1999 
 2000 *** Fixes of the -Werror option
 2001 
 2002   Options such as "-Werror -Wno-error=foo" were still turning "foo"
 2003   diagnostics into errors instead of warnings.  This is fixed.
 2004 
 2005   Actually, for consistency with GCC, "-Wno-error=foo -Werror" now also
 2006   leaves "foo" diagnostics as warnings.  Similarly, with "-Werror=foo
 2007   -Wno-error", "foo" diagnostics are now errors.
 2008 
 2009 *** GLR Predicates
 2010 
 2011   As demonstrated in the documentation, one can now leave spaces between
 2012   "%?" and its "{".
 2013 
 2014 *** Installation
 2015 
 2016   The yacc.1 man page is no longer installed if --disable-yacc was
 2017   specified.
 2018 
 2019 *** Fixes in the test suite
 2020 
 2021   Bugs and portability issues.
 2022 
 2023 
 2024 * Noteworthy changes in release 3.0 (2013-07-25) [stable]
 2025 
 2026 ** WARNING: Future backward-incompatibilities!
 2027 
 2028   Like other GNU packages, Bison will start using some of the C99 features
 2029   for its own code, especially the definition of variables after statements.
 2030   The generated C parsers still aim at C90.
 2031 
 2032 ** Backward incompatible changes
 2033 
 2034 *** Obsolete features
 2035 
 2036   Support for YYFAIL is removed (deprecated in Bison 2.4.2): use YYERROR.
 2037 
 2038   Support for yystype and yyltype is removed (deprecated in Bison 1.875):
 2039   use YYSTYPE and YYLTYPE.
 2040 
 2041   Support for YYLEX_PARAM and YYPARSE_PARAM is removed (deprecated in Bison
 2042   1.875): use %lex-param, %parse-param, or %param.
 2043 
 2044   Missing semicolons at the end of actions are no longer added (as announced
 2045   in the release 2.5).
 2046 
 2047 *** Use of YACC='bison -y'
 2048 
 2049   TL;DR: With Autoconf <= 2.69, pass -Wno-yacc to (AM_)YFLAGS if you use
 2050   Bison extensions.
 2051 
 2052   Traditional Yacc generates 'y.tab.c' whatever the name of the input file.
 2053   Therefore Makefiles written for Yacc expect 'y.tab.c' (and possibly
 2054   'y.tab.h' and 'y.output') to be generated from 'foo.y'.
 2055 
 2056   To this end, for ages, AC_PROG_YACC, Autoconf's macro to look for an
 2057   implementation of Yacc, was using Bison as 'bison -y'.  While it does
 2058   ensure compatible output file names, it also enables warnings for
 2059   incompatibilities with POSIX Yacc.  In other words, 'bison -y' triggers
 2060   warnings for Bison extensions.
 2061 
 2062   Autoconf 2.70+ fixes this incompatibility by using YACC='bison -o y.tab.c'
 2063   (which also generates 'y.tab.h' and 'y.output' when needed).
 2064   Alternatively, disable Yacc warnings by passing '-Wno-yacc' to your Yacc
 2065   flags (YFLAGS, or AM_YFLAGS with Automake).
 2066 
 2067 ** Bug fixes
 2068 
 2069 *** The epilogue is no longer affected by internal #defines (glr.c)
 2070 
 2071   The glr.c skeleton uses defines such as #define yylval (yystackp->yyval) in
 2072   generated code.  These weren't properly undefined before the inclusion of
 2073   the user epilogue, so functions such as the following were butchered by the
 2074   preprocessor expansion:
 2075 
 2076     int yylex (YYSTYPE *yylval);
 2077 
 2078   This is fixed: yylval, yynerrs, yychar, and yylloc are now valid
 2079   identifiers for user-provided variables.
 2080 
 2081 *** stdio.h is no longer needed when locations are enabled (yacc.c)
 2082 
 2083   Changes in Bison 2.7 introduced a dependency on FILE and fprintf when
 2084   locations are enabled.  This is fixed.
 2085 
 2086 *** Warnings about useless %pure-parser/%define api.pure are restored
 2087 
 2088 ** Diagnostics reported by Bison
 2089 
 2090   Most of these features were contributed by Théophile Ranquet and Victor
 2091   Santet.
 2092 
 2093 *** Carets
 2094 
 2095   Version 2.7 introduced caret errors, for a prettier output.  These are now
 2096   activated by default.  The old format can still be used by invoking Bison
 2097   with -fno-caret (or -fnone).
 2098 
 2099   Some error messages that reproduced excerpts of the grammar are now using
 2100   the caret information only.  For instance on:
 2101 
 2102     %%
 2103     exp: 'a' | 'a';
 2104 
 2105   Bison 2.7 reports:
 2106 
 2107     in.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
 2108     in.y:2.12-14: warning: rule useless in parser due to conflicts: exp: 'a' [-Wother]
 2109 
 2110   Now bison reports:
 2111 
 2112     in.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
 2113     in.y:2.12-14: warning: rule useless in parser due to conflicts [-Wother]
 2114      exp: 'a' | 'a';
 2115                 ^^^
 2116 
 2117   and "bison -fno-caret" reports:
 2118 
 2119     in.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
 2120     in.y:2.12-14: warning: rule useless in parser due to conflicts [-Wother]
 2121 
 2122 *** Enhancements of the -Werror option
 2123 
 2124   The -Werror=CATEGORY option is now recognized, and will treat specified
 2125   warnings as errors. The warnings need not have been explicitly activated
 2126   using the -W option, this is similar to what GCC 4.7 does.
 2127 
 2128   For example, given the following command line, Bison will treat both
 2129   warnings related to POSIX Yacc incompatibilities and S/R conflicts as
 2130   errors (and only those):
 2131 
 2132     $ bison -Werror=yacc,error=conflicts-sr input.y
 2133 
 2134   If no categories are specified, -Werror will make all active warnings into
 2135   errors. For example, the following line does the same the previous example:
 2136 
 2137     $ bison -Werror -Wnone -Wyacc -Wconflicts-sr input.y
 2138 
 2139   (By default -Wconflicts-sr,conflicts-rr,deprecated,other is enabled.)
 2140 
 2141   Note that the categories in this -Werror option may not be prefixed with
 2142   "no-". However, -Wno-error[=CATEGORY] is valid.
 2143 
 2144   Note that -y enables -Werror=yacc. Therefore it is now possible to require
 2145   Yacc-like behavior (e.g., always generate y.tab.c), but to report
 2146   incompatibilities as warnings: "-y -Wno-error=yacc".
 2147 
 2148 *** The display of warnings is now richer
 2149 
 2150   The option that controls a given warning is now displayed:
 2151 
 2152     foo.y:4.6: warning: type clash on default action: <foo> != <bar> [-Wother]
 2153 
 2154   In the case of warnings treated as errors, the prefix is changed from
 2155   "warning: " to "error: ", and the suffix is displayed, in a manner similar
 2156   to GCC, as [-Werror=CATEGORY].
 2157 
 2158   For instance, where the previous version of Bison would report (and exit
 2159   with failure):
 2160 
 2161     bison: warnings being treated as errors
 2162     input.y:1.1: warning: stray ',' treated as white space
 2163 
 2164   it now reports:
 2165 
 2166     input.y:1.1: error: stray ',' treated as white space [-Werror=other]
 2167 
 2168 *** Deprecated constructs
 2169 
 2170   The new 'deprecated' warning category flags obsolete constructs whose
 2171   support will be discontinued.  It is enabled by default.  These warnings
 2172   used to be reported as 'other' warnings.
 2173 
 2174 *** Useless semantic types
 2175 
 2176   Bison now warns about useless (uninhabited) semantic types.  Since
 2177   semantic types are not declared to Bison (they are defined in the opaque
 2178   %union structure), it is %printer/%destructor directives about useless
 2179   types that trigger the warning:
 2180 
 2181     %token <type1> term
 2182     %type  <type2> nterm
 2183     %printer    {} <type1> <type3>
 2184     %destructor {} <type2> <type4>
 2185     %%
 2186     nterm: term { $$ = $1; };
 2187 
 2188     3.28-34: warning: type <type3> is used, but is not associated to any symbol
 2189     4.28-34: warning: type <type4> is used, but is not associated to any symbol
 2190 
 2191 *** Undefined but unused symbols
 2192 
 2193   Bison used to raise an error for undefined symbols that are not used in
 2194   the grammar.  This is now only a warning.
 2195 
 2196     %printer    {} symbol1
 2197     %destructor {} symbol2
 2198     %type <type>   symbol3
 2199     %%
 2200     exp: "a";
 2201 
 2202 *** Useless destructors or printers
 2203 
 2204   Bison now warns about useless destructors or printers.  In the following
 2205   example, the printer for <type1>, and the destructor for <type2> are
 2206   useless: all symbols of <type1> (token1) already have a printer, and all
 2207   symbols of type <type2> (token2) already have a destructor.
 2208 
 2209     %token <type1> token1
 2210            <type2> token2
 2211            <type3> token3
 2212            <type4> token4
 2213     %printer    {} token1 <type1> <type3>
 2214     %destructor {} token2 <type2> <type4>
 2215 
 2216 *** Conflicts
 2217 
 2218   The warnings and error messages about shift/reduce and reduce/reduce
 2219   conflicts have been normalized.  For instance on the following foo.y file:
 2220 
 2221     %glr-parser
 2222     %%
 2223     exp: exp '+' exp | '0' | '0';
 2224 
 2225   compare the previous version of bison:
 2226 
 2227     $ bison foo.y
 2228     foo.y: conflicts: 1 shift/reduce, 2 reduce/reduce
 2229     $ bison -Werror foo.y
 2230     bison: warnings being treated as errors
 2231     foo.y: conflicts: 1 shift/reduce, 2 reduce/reduce
 2232 
 2233   with the new behavior:
 2234 
 2235     $ bison foo.y
 2236     foo.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
 2237     foo.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr]
 2238     $ bison -Werror foo.y
 2239     foo.y: error: 1 shift/reduce conflict [-Werror=conflicts-sr]
 2240     foo.y: error: 2 reduce/reduce conflicts [-Werror=conflicts-rr]
 2241 
 2242   When %expect or %expect-rr is used, such as with bar.y:
 2243 
 2244     %expect 0
 2245     %glr-parser
 2246     %%
 2247     exp: exp '+' exp | '0' | '0';
 2248 
 2249   Former behavior:
 2250 
 2251     $ bison bar.y
 2252     bar.y: conflicts: 1 shift/reduce, 2 reduce/reduce
 2253     bar.y: expected 0 shift/reduce conflicts
 2254     bar.y: expected 0 reduce/reduce conflicts
 2255 
 2256   New one:
 2257 
 2258     $ bison bar.y
 2259     bar.y: error: shift/reduce conflicts: 1 found, 0 expected
 2260     bar.y: error: reduce/reduce conflicts: 2 found, 0 expected
 2261 
 2262 ** Incompatibilities with POSIX Yacc
 2263 
 2264   The 'yacc' category is no longer part of '-Wall', enable it explicitly
 2265   with '-Wyacc'.
 2266 
 2267 ** Additional yylex/yyparse arguments
 2268 
 2269   The new directive %param declares additional arguments to both yylex and
 2270   yyparse.  The %lex-param, %parse-param, and %param directives support one
 2271   or more arguments.  Instead of
 2272 
 2273     %lex-param   {arg1_type *arg1}
 2274     %lex-param   {arg2_type *arg2}
 2275     %parse-param {arg1_type *arg1}
 2276     %parse-param {arg2_type *arg2}
 2277 
 2278   one may now declare
 2279 
 2280     %param {arg1_type *arg1} {arg2_type *arg2}
 2281 
 2282 ** Types of values for %define variables
 2283 
 2284   Bison used to make no difference between '%define foo bar' and '%define
 2285   foo "bar"'.  The former is now called a 'keyword value', and the latter a
 2286   'string value'.  A third kind was added: 'code values', such as '%define
 2287   foo {bar}'.
 2288 
 2289   Keyword variables are used for fixed value sets, e.g.,
 2290 
 2291     %define lr.type lalr
 2292 
 2293   Code variables are used for value in the target language, e.g.,
 2294 
 2295     %define api.value.type {struct semantic_type}
 2296 
 2297   String variables are used remaining cases, e.g. file names.
 2298 
 2299 ** Variable api.token.prefix
 2300 
 2301   The variable api.token.prefix changes the way tokens are identified in
 2302   the generated files.  This is especially useful to avoid collisions
 2303   with identifiers in the target language.  For instance
 2304 
 2305     %token FILE for ERROR
 2306     %define api.token.prefix {TOK_}
 2307     %%
 2308     start: FILE for ERROR;
 2309 
 2310   will generate the definition of the symbols TOK_FILE, TOK_for, and
 2311   TOK_ERROR in the generated sources.  In particular, the scanner must
 2312   use these prefixed token names, although the grammar itself still
 2313   uses the short names (as in the sample rule given above).
 2314 
 2315 ** Variable api.value.type
 2316 
 2317   This new %define variable supersedes the #define macro YYSTYPE.  The use
 2318   of YYSTYPE is discouraged.  In particular, #defining YYSTYPE *and* either
 2319   using %union or %defining api.value.type results in undefined behavior.
 2320 
 2321   Either define api.value.type, or use "%union":
 2322 
 2323     %union
 2324     {
 2325       int ival;
 2326       char *sval;
 2327     }
 2328     %token <ival> INT "integer"
 2329     %token <sval> STRING "string"
 2330     %printer { fprintf (yyo, "%d", $$); } <ival>
 2331     %destructor { free ($$); } <sval>
 2332 
 2333     /* In yylex().  */
 2334     yylval.ival = 42; return INT;
 2335     yylval.sval = "42"; return STRING;
 2336 
 2337   The %define variable api.value.type supports both keyword and code values.
 2338 
 2339   The keyword value 'union' means that the user provides genuine types, not
 2340   union member names such as "ival" and "sval" above (WARNING: will fail if
 2341   -y/--yacc/%yacc is enabled).
 2342 
 2343     %define api.value.type union
 2344     %token <int> INT "integer"
 2345     %token <char *> STRING "string"
 2346     %printer { fprintf (yyo, "%d", $$); } <int>
 2347     %destructor { free ($$); } <char *>
 2348 
 2349     /* In yylex().  */
 2350     yylval.INT = 42; return INT;
 2351     yylval.STRING = "42"; return STRING;
 2352 
 2353   The keyword value variant is somewhat equivalent, but for C++ special
 2354   provision is made to allow classes to be used (more about this below).
 2355 
 2356     %define api.value.type variant
 2357     %token <int> INT "integer"
 2358     %token <std::string> STRING "string"
 2359 
 2360   Code values (in braces) denote user defined types.  This is where YYSTYPE
 2361   used to be used.
 2362 
 2363     %code requires
 2364     {
 2365       struct my_value
 2366       {
 2367         enum
 2368         {
 2369           is_int, is_string
 2370         } kind;
 2371         union
 2372         {
 2373           int ival;
 2374           char *sval;
 2375         } u;
 2376       };
 2377     }
 2378     %define api.value.type {struct my_value}
 2379     %token <u.ival> INT "integer"
 2380     %token <u.sval> STRING "string"
 2381     %printer { fprintf (yyo, "%d", $$); } <u.ival>
 2382     %destructor { free ($$); } <u.sval>
 2383 
 2384     /* In yylex().  */
 2385     yylval.u.ival = 42; return INT;
 2386     yylval.u.sval = "42"; return STRING;
 2387 
 2388 ** Variable parse.error
 2389 
 2390   This variable controls the verbosity of error messages.  The use of the
 2391   %error-verbose directive is deprecated in favor of "%define parse.error
 2392   verbose".
 2393 
 2394 ** Deprecated %define variable names
 2395 
 2396   The following variables have been renamed for consistency.  Backward
 2397   compatibility is ensured, but upgrading is recommended.
 2398 
 2399     lr.default-reductions      -> lr.default-reduction
 2400     lr.keep-unreachable-states -> lr.keep-unreachable-state
 2401     namespace                  -> api.namespace
 2402     stype                      -> api.value.type
 2403 
 2404 ** Semantic predicates
 2405 
 2406   Contributed by Paul Hilfinger.
 2407 
 2408   The new, experimental, semantic-predicate feature allows actions of the
 2409   form "%?{ BOOLEAN-EXPRESSION }", which cause syntax errors (as for
 2410   YYERROR) if the expression evaluates to 0, and are evaluated immediately
 2411   in GLR parsers, rather than being deferred.  The result is that they allow
 2412   the programmer to prune possible parses based on the values of run-time
 2413   expressions.
 2414 
 2415 ** The directive %expect-rr is now an error in non GLR mode
 2416 
 2417   It used to be an error only if used in non GLR mode, _and_ if there are
 2418   reduce/reduce conflicts.
 2419 
 2420 ** Tokens are numbered in their order of appearance
 2421 
 2422   Contributed by Valentin Tolmer.
 2423 
 2424   With '%token A B', A had a number less than the one of B.  However,
 2425   precedence declarations used to generate a reversed order.  This is now
 2426   fixed, and introducing tokens with any of %token, %left, %right,
 2427   %precedence, or %nonassoc yields the same result.
 2428 
 2429   When mixing declarations of tokens with a literal character (e.g., 'a') or
 2430   with an identifier (e.g., B) in a precedence declaration, Bison numbered
 2431   the literal characters first.  For example
 2432 
 2433     %right A B 'c' 'd'
 2434 
 2435   would lead to the tokens declared in this order: 'c' 'd' A B.  Again, the
 2436   input order is now preserved.
 2437 
 2438   These changes were made so that one can remove useless precedence and
 2439   associativity declarations (i.e., map %nonassoc, %left or %right to
 2440   %precedence, or to %token) and get exactly the same output.
 2441 
 2442 ** Useless precedence and associativity
 2443 
 2444   Contributed by Valentin Tolmer.
 2445 
 2446   When developing and maintaining a grammar, useless associativity and
 2447   precedence directives are common.  They can be a nuisance: new ambiguities
 2448   arising are sometimes masked because their conflicts are resolved due to
 2449   the extra precedence or associativity information.  Furthermore, it can
 2450   hinder the comprehension of a new grammar: one will wonder about the role
 2451   of a precedence, where in fact it is useless.  The following changes aim
 2452   at detecting and reporting these extra directives.
 2453 
 2454 *** Precedence warning category
 2455 
 2456   A new category of warning, -Wprecedence, was introduced. It flags the
 2457   useless precedence and associativity directives.
 2458 
 2459 *** Useless associativity
 2460 
 2461   Bison now warns about symbols with a declared associativity that is never
 2462   used to resolve conflicts.  In that case, using %precedence is sufficient;
 2463   the parsing tables will remain unchanged.  Solving these warnings may raise
 2464   useless precedence warnings, as the symbols no longer have associativity.
 2465   For example:
 2466 
 2467     %left '+'
 2468     %left '*'
 2469     %%
 2470     exp:
 2471       "number"
 2472     | exp '+' "number"
 2473     | exp '*' exp
 2474     ;
 2475 
 2476   will produce a
 2477 
 2478     warning: useless associativity for '+', use %precedence [-Wprecedence]
 2479      %left '+'
 2480            ^^^
 2481 
 2482 *** Useless precedence
 2483 
 2484   Bison now warns about symbols with a declared precedence and no declared
 2485   associativity (i.e., declared with %precedence), and whose precedence is
 2486   never used.  In that case, the symbol can be safely declared with %token
 2487   instead, without modifying the parsing tables.  For example:
 2488 
 2489     %precedence '='
 2490     %%
 2491     exp: "var" '=' "number";
 2492 
 2493   will produce a
 2494 
 2495     warning: useless precedence for '=' [-Wprecedence]
 2496      %precedence '='
 2497                  ^^^
 2498 
 2499 *** Useless precedence and associativity
 2500 
 2501   In case of both useless precedence and associativity, the issue is flagged
 2502   as follows:
 2503 
 2504     %nonassoc '='
 2505     %%
 2506     exp: "var" '=' "number";
 2507 
 2508   The warning is:
 2509 
 2510     warning: useless precedence and associativity for '=' [-Wprecedence]
 2511      %nonassoc '='
 2512                ^^^
 2513 
 2514 ** Empty rules
 2515 
 2516   With help from Joel E. Denny and Gabriel Rassoul.
 2517 
 2518   Empty rules (i.e., with an empty right-hand side) can now be explicitly
 2519   marked by the new %empty directive.  Using %empty on a non-empty rule is
 2520   an error.  The new -Wempty-rule warning reports empty rules without
 2521   %empty.  On the following grammar:
 2522 
 2523     %%
 2524     s: a b c;
 2525     a: ;
 2526     b: %empty;
 2527     c: 'a' %empty;
 2528 
 2529   bison reports:
 2530 
 2531     3.4-5: warning: empty rule without %empty [-Wempty-rule]
 2532      a: {}
 2533         ^^
 2534     5.8-13: error: %empty on non-empty rule
 2535      c: 'a' %empty {};
 2536             ^^^^^^
 2537 
 2538 ** Java skeleton improvements
 2539 
 2540   The constants for token names were moved to the Lexer interface.  Also, it
 2541   is possible to add code to the parser's constructors using "%code init"
 2542   and "%define init_throws".
 2543   Contributed by Paolo Bonzini.
 2544 
 2545   The Java skeleton now supports push parsing.
 2546   Contributed by Dennis Heimbigner.
 2547 
 2548 ** C++ skeletons improvements
 2549 
 2550 *** The parser header is no longer mandatory (lalr1.cc, glr.cc)
 2551 
 2552   Using %defines is now optional.  Without it, the needed support classes
 2553   are defined in the generated parser, instead of additional files (such as
 2554   location.hh, position.hh and stack.hh).
 2555 
 2556 *** Locations are no longer mandatory (lalr1.cc, glr.cc)
 2557 
 2558   Both lalr1.cc and glr.cc no longer require %location.
 2559 
 2560 *** syntax_error exception (lalr1.cc)
 2561 
 2562   The C++ parser features a syntax_error exception, which can be
 2563   thrown from the scanner or from user rules to raise syntax errors.
 2564   This facilitates reporting errors caught in sub-functions (e.g.,
 2565   rejecting too large integral literals from a conversion function
 2566   used by the scanner, or rejecting invalid combinations from a
 2567   factory invoked by the user actions).
 2568 
 2569 *** %define api.value.type variant
 2570 
 2571   This is based on a submission from Michiel De Wilde.  With help
 2572   from Théophile Ranquet.
 2573 
 2574   In this mode, complex C++ objects can be used as semantic values.  For
 2575   instance:
 2576 
 2577     %token <::std::string> TEXT;
 2578     %token <int> NUMBER;
 2579     %token SEMICOLON ";"
 2580     %type <::std::string> item;
 2581     %type <::std::list<std::string>> list;
 2582     %%
 2583     result:
 2584       list  { std::cout << $1 << std::endl; }
 2585     ;
 2586 
 2587     list:
 2588       %empty        { /* Generates an empty string list. */ }
 2589     | list item ";" { std::swap ($$, $1); $$.push_back ($2); }
 2590     ;
 2591 
 2592     item:
 2593       TEXT    { std::swap ($$, $1); }
 2594     | NUMBER  { $$ = string_cast ($1); }
 2595     ;
 2596 
 2597 *** %define api.token.constructor
 2598 
 2599   When variants are enabled, Bison can generate functions to build the
 2600   tokens.  This guarantees that the token type (e.g., NUMBER) is consistent
 2601   with the semantic value (e.g., int):
 2602 
 2603     parser::symbol_type yylex ()
 2604     {
 2605       parser::location_type loc = ...;
 2606       ...
 2607       return parser::make_TEXT ("Hello, world!", loc);
 2608       ...
 2609       return parser::make_NUMBER (42, loc);
 2610       ...
 2611       return parser::make_SEMICOLON (loc);
 2612       ...
 2613     }
 2614 
 2615 *** C++ locations
 2616 
 2617   There are operator- and operator-= for 'location'.  Negative line/column
 2618   increments can no longer underflow the resulting value.
 2619 
 2620 
 2621 * Noteworthy changes in release 2.7.1 (2013-04-15) [stable]
 2622 
 2623 ** Bug fixes
 2624 
 2625 *** Fix compiler attribute portability (yacc.c)
 2626 
 2627   With locations enabled, __attribute__ was used unprotected.
 2628 
 2629 *** Fix some compiler warnings (lalr1.cc)
 2630 
 2631 
 2632 * Noteworthy changes in release 2.7 (2012-12-12) [stable]
 2633 
 2634 ** Bug fixes
 2635 
 2636   Warnings about uninitialized yylloc in yyparse have been fixed.
 2637 
 2638   Restored C90 compliance (yet no report was ever made).
 2639 
 2640 ** Diagnostics are improved
 2641 
 2642   Contributed by Théophile Ranquet.
 2643 
 2644 *** Changes in the format of error messages
 2645 
 2646   This used to be the format of many error reports:
 2647 
 2648     input.y:2.7-12: %type redeclaration for exp
 2649     input.y:1.7-12: previous declaration
 2650 
 2651   It is now:
 2652 
 2653     input.y:2.7-12: error: %type redeclaration for exp
 2654     input.y:1.7-12:     previous declaration
 2655 
 2656 *** New format for error reports: carets
 2657 
 2658   Caret errors have been added to Bison:
 2659 
 2660     input.y:2.7-12: error: %type redeclaration for exp
 2661      %type <sval> exp
 2662            ^^^^^^
 2663     input.y:1.7-12:     previous declaration
 2664      %type <ival> exp
 2665            ^^^^^^
 2666 
 2667   or
 2668 
 2669     input.y:3.20-23: error: ambiguous reference: '$exp'
 2670      exp: exp '+' exp { $exp = $1 + $3; };
 2671                         ^^^^
 2672     input.y:3.1-3:       refers to: $exp at $$
 2673      exp: exp '+' exp { $exp = $1 + $3; };
 2674      ^^^
 2675     input.y:3.6-8:       refers to: $exp at $1
 2676      exp: exp '+' exp { $exp = $1 + $3; };
 2677           ^^^
 2678     input.y:3.14-16:     refers to: $exp at $3
 2679      exp: exp '+' exp { $exp = $1 + $3; };
 2680                   ^^^
 2681 
 2682   The default behavior for now is still not to display these unless
 2683   explicitly asked with -fcaret (or -fall). However, in a later release, it
 2684   will be made the default behavior (but may still be deactivated with
 2685   -fno-caret).
 2686 
 2687 ** New value for %define variable: api.pure full
 2688 
 2689   The %define variable api.pure requests a pure (reentrant) parser. However,
 2690   for historical reasons, using it in a location-tracking Yacc parser
 2691   resulted in a yyerror function that did not take a location as a
 2692   parameter. With this new value, the user may request a better pure parser,
 2693   where yyerror does take a location as a parameter (in location-tracking
 2694   parsers).
 2695 
 2696   The use of "%define api.pure true" is deprecated in favor of this new
 2697   "%define api.pure full".
 2698 
 2699 ** New %define variable: api.location.type (glr.cc, lalr1.cc, lalr1.java)
 2700 
 2701   The %define variable api.location.type defines the name of the type to use
 2702   for locations.  When defined, Bison no longer generates the position.hh
 2703   and location.hh files, nor does the parser will include them: the user is
 2704   then responsible to define her type.
 2705 
 2706   This can be used in programs with several parsers to factor their location
 2707   and position files: let one of them generate them, and the others just use
 2708   them.
 2709 
 2710   This feature was actually introduced, but not documented, in Bison 2.5,
 2711   under the name "location_type" (which is maintained for backward
 2712   compatibility).
 2713 
 2714   For consistency, lalr1.java's %define variables location_type and
 2715   position_type are deprecated in favor of api.location.type and
 2716   api.position.type.
 2717 
 2718 ** Exception safety (lalr1.cc)
 2719 
 2720   The parse function now catches exceptions, uses the %destructors to
 2721   release memory (the lookahead symbol and the symbols pushed on the stack)
 2722   before re-throwing the exception.
 2723 
 2724   This feature is somewhat experimental.  User feedback would be
 2725   appreciated.
 2726 
 2727 ** Graph improvements in DOT and XSLT
 2728 
 2729   Contributed by Théophile Ranquet.
 2730 
 2731   The graphical presentation of the states is more readable: their shape is
 2732   now rectangular, the state number is clearly displayed, and the items are
 2733   numbered and left-justified.
 2734 
 2735   The reductions are now explicitly represented as transitions to other
 2736   diamond shaped nodes.
 2737 
 2738   These changes are present in both --graph output and xml2dot.xsl XSLT
 2739   processing, with minor (documented) differences.
 2740 
 2741 ** %language is no longer an experimental feature.
 2742 
 2743   The introduction of this feature, in 2.4, was four years ago. The
 2744   --language option and the %language directive are no longer experimental.
 2745 
 2746 ** Documentation
 2747 
 2748   The sections about shift/reduce and reduce/reduce conflicts resolution
 2749   have been fixed and extended.
 2750 
 2751   Although introduced more than four years ago, XML and Graphviz reports
 2752   were not properly documented.
 2753 
 2754   The translation of midrule actions is now described.
 2755 
 2756 
 2757 * Noteworthy changes in release 2.6.5 (2012-11-07) [stable]
 2758 
 2759   We consider compiler warnings about Bison generated parsers to be bugs.
 2760   Rather than working around them in your own project, please consider
 2761   reporting them to us.
 2762 
 2763 ** Bug fixes
 2764 
 2765   Warnings about uninitialized yylval and/or yylloc for push parsers with a
 2766   pure interface have been fixed for GCC 4.0 up to 4.8, and Clang 2.9 to
 2767   3.2.
 2768 
 2769   Other issues in the test suite have been addressed.
 2770 
 2771   Null characters are correctly displayed in error messages.
 2772 
 2773   When possible, yylloc is correctly initialized before calling yylex.  It
 2774   is no longer necessary to initialize it in the %initial-action.
 2775 
 2776 
 2777 * Noteworthy changes in release 2.6.4 (2012-10-23) [stable]
 2778 
 2779   Bison 2.6.3's --version was incorrect.  This release fixes this issue.
 2780 
 2781 
 2782 * Noteworthy changes in release 2.6.3 (2012-10-22) [stable]
 2783 
 2784 ** Bug fixes
 2785 
 2786   Bugs and portability issues in the test suite have been fixed.
 2787 
 2788   Some errors in translations have been addressed, and --help now directs
 2789   users to the appropriate place to report them.
 2790 
 2791   Stray Info files shipped by accident are removed.
 2792 
 2793   Incorrect definitions of YY_, issued by yacc.c when no parser header is
 2794   generated, are removed.
 2795 
 2796   All the generated headers are self-contained.
 2797 
 2798 ** Header guards (yacc.c, glr.c, glr.cc)
 2799 
 2800   In order to avoid collisions, the header guards are now
 2801   YY_<PREFIX>_<FILE>_INCLUDED, instead of merely <PREFIX>_<FILE>.
 2802   For instance the header generated from
 2803 
 2804     %define api.prefix "calc"
 2805     %defines "lib/parse.h"
 2806 
 2807   will use YY_CALC_LIB_PARSE_H_INCLUDED as guard.
 2808 
 2809 ** Fix compiler warnings in the generated parser (yacc.c, glr.c)
 2810 
 2811   The compilation of pure parsers (%define api.pure) can trigger GCC
 2812   warnings such as:
 2813 
 2814     input.c: In function 'yyparse':
 2815     input.c:1503:12: warning: 'yylval' may be used uninitialized in this
 2816                               function [-Wmaybe-uninitialized]
 2817        *++yyvsp = yylval;
 2818                 ^
 2819 
 2820   This is now fixed; pragmas to avoid these warnings are no longer needed.
 2821 
 2822   Warnings from clang ("equality comparison with extraneous parentheses" and
 2823   "function declared 'noreturn' should not return") have also been
 2824   addressed.
 2825 
 2826 
 2827 * Noteworthy changes in release 2.6.2 (2012-08-03) [stable]
 2828 
 2829 ** Bug fixes
 2830 
 2831   Buffer overruns, complaints from Flex, and portability issues in the test
 2832   suite have been fixed.
 2833 
 2834 ** Spaces in %lex- and %parse-param (lalr1.cc, glr.cc)
 2835 
 2836   Trailing end-of-lines in %parse-param or %lex-param would result in
 2837   invalid C++.  This is fixed.
 2838 
 2839 ** Spurious spaces and end-of-lines
 2840 
 2841   The generated files no longer end (nor start) with empty lines.
 2842 
 2843 
 2844 * Noteworthy changes in release 2.6.1 (2012-07-30) [stable]
 2845 
 2846  Bison no longer executes user-specified M4 code when processing a grammar.
 2847 
 2848 ** Future Changes
 2849 
 2850   In addition to the removal of the features announced in Bison 2.6, the
 2851   next major release will remove the "Temporary hack for adding a semicolon
 2852   to the user action", as announced in the release 2.5.  Instead of:
 2853 
 2854     exp: exp "+" exp { $$ = $1 + $3 };
 2855 
 2856   write:
 2857 
 2858     exp: exp "+" exp { $$ = $1 + $3; };
 2859 
 2860 ** Bug fixes
 2861 
 2862 *** Type names are now properly escaped.
 2863 
 2864 *** glr.cc: set_debug_level and debug_level work as expected.
 2865 
 2866 *** Stray @ or $ in actions
 2867 
 2868   While Bison used to warn about stray $ or @ in action rules, it did not
 2869   for other actions such as printers, destructors, or initial actions.  It
 2870   now does.
 2871 
 2872 ** Type names in actions
 2873 
 2874   For consistency with rule actions, it is now possible to qualify $$ by a
 2875   type-name in destructors, printers, and initial actions.  For instance:
 2876 
 2877     %printer { fprintf (yyo, "(%d, %f)", $<ival>$, $<fval>$); } <*> <>;
 2878 
 2879   will display two values for each typed and untyped symbol (provided
 2880   that YYSTYPE has both "ival" and "fval" fields).
 2881 
 2882 
 2883 * Noteworthy changes in release 2.6 (2012-07-19) [stable]
 2884 
 2885 ** Future changes
 2886 
 2887   The next major release of Bison will drop support for the following
 2888   deprecated features.  Please report disagreements to bug-bison@gnu.org.
 2889 
 2890 *** K&R C parsers
 2891 
 2892   Support for generating parsers in K&R C will be removed.  Parsers
 2893   generated for C support ISO C90, and are tested with ISO C99 and ISO C11
 2894   compilers.
 2895 
 2896 *** Features deprecated since Bison 1.875
 2897 
 2898   The definitions of yystype and yyltype will be removed; use YYSTYPE and
 2899   YYLTYPE.
 2900 
 2901   YYPARSE_PARAM and YYLEX_PARAM, deprecated in favor of %parse-param and
 2902   %lex-param, will no longer be supported.
 2903 
 2904   Support for the preprocessor symbol YYERROR_VERBOSE will be removed, use
 2905   %error-verbose.
 2906 
 2907 *** The generated header will be included (yacc.c)
 2908 
 2909   Instead of duplicating the content of the generated header (definition of
 2910   YYSTYPE, yyparse declaration etc.), the generated parser will include it,
 2911   as is already the case for GLR or C++ parsers.  This change is deferred
 2912   because existing versions of ylwrap (e.g., Automake 1.12.1) do not support
 2913   it.
 2914 
 2915 ** Generated Parser Headers
 2916 
 2917 *** Guards (yacc.c, glr.c, glr.cc)
 2918 
 2919   The generated headers are now guarded, as is already the case for C++
 2920   parsers (lalr1.cc).  For instance, with --defines=foo.h:
 2921 
 2922     #ifndef YY_FOO_H
 2923     # define YY_FOO_H
 2924     ...
 2925     #endif /* !YY_FOO_H  */
 2926 
 2927 *** New declarations (yacc.c, glr.c)
 2928 
 2929   The generated header now declares yydebug and yyparse.  Both honor
 2930   --name-prefix=bar_, and yield
 2931 
 2932     int bar_parse (void);
 2933 
 2934   rather than
 2935 
 2936     #define yyparse bar_parse
 2937     int yyparse (void);
 2938 
 2939   in order to facilitate the inclusion of several parser headers inside a
 2940   single compilation unit.
 2941 
 2942 *** Exported symbols in C++
 2943 
 2944   The symbols YYTOKEN_TABLE and YYERROR_VERBOSE, which were defined in the
 2945   header, are removed, as they prevent the possibility of including several
 2946   generated headers from a single compilation unit.
 2947 
 2948 *** YYLSP_NEEDED
 2949 
 2950   For the same reasons, the undocumented and unused macro YYLSP_NEEDED is no
 2951   longer defined.
 2952 
 2953 ** New %define variable: api.prefix
 2954 
 2955   Now that the generated headers are more complete and properly protected
 2956   against multiple inclusions, constant names, such as YYSTYPE are a
 2957   problem.  While yyparse and others are properly renamed by %name-prefix,
 2958   YYSTYPE, YYDEBUG and others have never been affected by it.  Because it
 2959   would introduce backward compatibility issues in projects not expecting
 2960   YYSTYPE to be renamed, instead of changing the behavior of %name-prefix,
 2961   it is deprecated in favor of a new %define variable: api.prefix.
 2962 
 2963   The following examples compares both:
 2964 
 2965     %name-prefix "bar_"               | %define api.prefix "bar_"
 2966     %token <ival> FOO                   %token <ival> FOO
 2967     %union { int ival; }                %union { int ival; }
 2968     %%                                  %%
 2969     exp: 'a';                           exp: 'a';
 2970 
 2971   bison generates:
 2972 
 2973     #ifndef BAR_FOO_H                   #ifndef BAR_FOO_H
 2974     # define BAR_FOO_H                  # define BAR_FOO_H
 2975 
 2976     /* Enabling traces.  */             /* Enabling traces.  */
 2977     # ifndef YYDEBUG                  | # ifndef BAR_DEBUG
 2978                                       > #  if defined YYDEBUG
 2979                                       > #   if YYDEBUG
 2980                                       > #    define BAR_DEBUG 1
 2981                                       > #   else
 2982                                       > #    define BAR_DEBUG 0
 2983                                       > #   endif
 2984                                       > #  else
 2985     #  define YYDEBUG 0               | #   define BAR_DEBUG 0
 2986                                       > #  endif
 2987     # endif                           | # endif
 2988 
 2989     # if YYDEBUG                      | # if BAR_DEBUG
 2990     extern int bar_debug;               extern int bar_debug;
 2991     # endif                             # endif
 2992 
 2993     /* Tokens.  */                      /* Tokens.  */
 2994     # ifndef YYTOKENTYPE              | # ifndef BAR_TOKENTYPE
 2995     #  define YYTOKENTYPE             | #  define BAR_TOKENTYPE
 2996        enum yytokentype {             |    enum bar_tokentype {
 2997          FOO = 258                           FOO = 258
 2998        };                                  };
 2999     # endif                             # endif
 3000 
 3001     #if ! defined YYSTYPE \           | #if ! defined BAR_STYPE \
 3002      && ! defined YYSTYPE_IS_DECLARED |  && ! defined BAR_STYPE_IS_DECLARED
 3003     typedef union YYSTYPE             | typedef union BAR_STYPE
 3004     {                                   {
 3005      int ival;                           int ival;
 3006     } YYSTYPE;                        | } BAR_STYPE;
 3007     # define YYSTYPE_IS_DECLARED 1    | # define BAR_STYPE_IS_DECLARED 1
 3008     #endif                              #endif
 3009 
 3010     extern YYSTYPE bar_lval;          | extern BAR_STYPE bar_lval;
 3011 
 3012     int bar_parse (void);               int bar_parse (void);
 3013 
 3014     #endif /* !BAR_FOO_H  */            #endif /* !BAR_FOO_H  */
 3015 
 3016 
 3017 * Noteworthy changes in release 2.5.1 (2012-06-05) [stable]
 3018 
 3019 ** Future changes:
 3020 
 3021   The next major release will drop support for generating parsers in K&R C.
 3022 
 3023 ** yacc.c: YYBACKUP works as expected.
 3024 
 3025 ** glr.c improvements:
 3026 
 3027 *** Location support is eliminated when not requested:
 3028 
 3029   GLR parsers used to include location-related code even when locations were
 3030   not requested, and therefore not even usable.
 3031 
 3032 *** __attribute__ is preserved:
 3033 
 3034   __attribute__ is no longer disabled when __STRICT_ANSI__ is defined (i.e.,
 3035   when -std is passed to GCC).
 3036 
 3037 ** lalr1.java: several fixes:
 3038 
 3039   The Java parser no longer throws ArrayIndexOutOfBoundsException if the
 3040   first token leads to a syntax error.  Some minor clean ups.
 3041 
 3042 ** Changes for C++:
 3043 
 3044 *** C++11 compatibility:
 3045 
 3046   C and C++ parsers use "nullptr" instead of "0" when __cplusplus is 201103L
 3047   or higher.
 3048 
 3049 *** Header guards
 3050 
 3051   The header files such as "parser.hh", "location.hh", etc. used a constant
 3052   name for preprocessor guards, for instance:
 3053 
 3054     #ifndef BISON_LOCATION_HH
 3055     # define BISON_LOCATION_HH
 3056     ...
 3057     #endif // !BISON_LOCATION_HH
 3058 
 3059   The inclusion guard is now computed from "PREFIX/FILE-NAME", where lower
 3060   case characters are converted to upper case, and series of
 3061   non-alphanumerical characters are converted to an underscore.
 3062 
 3063   With "bison -o lang++/parser.cc", "location.hh" would now include:
 3064 
 3065     #ifndef YY_LANG_LOCATION_HH
 3066     # define YY_LANG_LOCATION_HH
 3067     ...
 3068     #endif // !YY_LANG_LOCATION_HH
 3069 
 3070 *** C++ locations:
 3071 
 3072   The position and location constructors (and their initialize methods)
 3073   accept new arguments for line and column.  Several issues in the
 3074   documentation were fixed.
 3075 
 3076 ** liby is no longer asking for "rpl_fprintf" on some platforms.
 3077 
 3078 ** Changes in the manual:
 3079 
 3080 *** %printer is documented
 3081 
 3082   The "%printer" directive, supported since at least Bison 1.50, is finally
 3083   documented.  The "mfcalc" example is extended to demonstrate it.
 3084 
 3085   For consistency with the C skeletons, the C++ parsers now also support
 3086   "yyoutput" (as an alias to "debug_stream ()").
 3087 
 3088 *** Several improvements have been made:
 3089 
 3090   The layout for grammar excerpts was changed to a more compact scheme.
 3091   Named references are motivated.  The description of the automaton
 3092   description file (*.output) is updated to the current format.  Incorrect
 3093   index entries were fixed.  Some other errors were fixed.
 3094 
 3095 ** Building bison:
 3096 
 3097 *** Conflicting prototypes with recent/modified Flex.
 3098 
 3099   Fixed build problems with the current, unreleased, version of Flex, and
 3100   some modified versions of 2.5.35, which have modified function prototypes.
 3101 
 3102 *** Warnings during the build procedure have been eliminated.
 3103 
 3104 *** Several portability problems in the test suite have been fixed:
 3105 
 3106   This includes warnings with some compilers, unexpected behavior of tools
 3107   such as diff, warning messages from the test suite itself, etc.
 3108 
 3109 *** The install-pdf target works properly:
 3110 
 3111   Running "make install-pdf" (or -dvi, -html, -info, and -ps) no longer
 3112   halts in the middle of its course.
 3113 
 3114 
 3115 * Noteworthy changes in release 2.5 (2011-05-14)
 3116 
 3117 ** Grammar symbol names can now contain non-initial dashes:
 3118 
 3119   Consistently with directives (such as %error-verbose) and with
 3120   %define variables (e.g. push-pull), grammar symbol names may contain
 3121   dashes in any position except the beginning.  This is a GNU
 3122   extension over POSIX Yacc.  Thus, use of this extension is reported
 3123   by -Wyacc and rejected in Yacc mode (--yacc).
 3124 
 3125 ** Named references:
 3126 
 3127   Historically, Yacc and Bison have supported positional references
 3128   ($n, $$) to allow access to symbol values from inside of semantic
 3129   actions code.
 3130 
 3131   Starting from this version, Bison can also accept named references.
 3132   When no ambiguity is possible, original symbol names may be used
 3133   as named references:
 3134 
 3135     if_stmt : "if" cond_expr "then" then_stmt ';'
 3136     { $if_stmt = mk_if_stmt($cond_expr, $then_stmt); }
 3137 
 3138   In the more common case, explicit names may be declared:
 3139 
 3140     stmt[res] : "if" expr[cond] "then" stmt[then] "else" stmt[else] ';'
 3141     { $res = mk_if_stmt($cond, $then, $else); }
 3142 
 3143   Location information is also accessible using @name syntax.  When
 3144   accessing symbol names containing dots or dashes, explicit bracketing
 3145   ($[sym.1]) must be used.
 3146 
 3147   These features are experimental in this version.  More user feedback
 3148   will help to stabilize them.
 3149   Contributed by Alex Rozenman.
 3150 
 3151 ** IELR(1) and canonical LR(1):
 3152 
 3153   IELR(1) is a minimal LR(1) parser table generation algorithm.  That
 3154   is, given any context-free grammar, IELR(1) generates parser tables
 3155   with the full language-recognition power of canonical LR(1) but with
 3156   nearly the same number of parser states as LALR(1).  This reduction
 3157   in parser states is often an order of magnitude.  More importantly,
 3158   because canonical LR(1)'s extra parser states may contain duplicate
 3159   conflicts in the case of non-LR(1) grammars, the number of conflicts
 3160   for IELR(1) is often an order of magnitude less as well.  This can
 3161   significantly reduce the complexity of developing of a grammar.
 3162 
 3163   Bison can now generate IELR(1) and canonical LR(1) parser tables in
 3164   place of its traditional LALR(1) parser tables, which remain the
 3165   default.  You can specify the type of parser tables in the grammar
 3166   file with these directives:
 3167 
 3168     %define lr.type lalr
 3169     %define lr.type ielr
 3170     %define lr.type canonical-lr
 3171 
 3172   The default-reduction optimization in the parser tables can also be
 3173   adjusted using "%define lr.default-reductions".  For details on both
 3174   of these features, see the new section "Tuning LR" in the Bison
 3175   manual.
 3176 
 3177   These features are experimental.  More user feedback will help to
 3178   stabilize them.
 3179 
 3180 ** LAC (Lookahead Correction) for syntax error handling
 3181 
 3182   Contributed by Joel E. Denny.
 3183 
 3184   Canonical LR, IELR, and LALR can suffer from a couple of problems
 3185   upon encountering a syntax error.  First, the parser might perform
 3186   additional parser stack reductions before discovering the syntax
 3187   error.  Such reductions can perform user semantic actions that are
 3188   unexpected because they are based on an invalid token, and they
 3189   cause error recovery to begin in a different syntactic context than
 3190   the one in which the invalid token was encountered.  Second, when
 3191   verbose error messages are enabled (with %error-verbose or the
 3192   obsolete "#define YYERROR_VERBOSE"), the expected token list in the
 3193   syntax error message can both contain invalid tokens and omit valid
 3194   tokens.
 3195 
 3196   The culprits for the above problems are %nonassoc, default
 3197   reductions in inconsistent states, and parser state merging.  Thus,
 3198   IELR and LALR suffer the most.  Canonical LR can suffer only if
 3199   %nonassoc is used or if default reductions are enabled for
 3200   inconsistent states.
 3201 
 3202   LAC is a new mechanism within the parsing algorithm that solves
 3203   these problems for canonical LR, IELR, and LALR without sacrificing
 3204   %nonassoc, default reductions, or state merging.  When LAC is in
 3205   use, canonical LR and IELR behave almost exactly the same for both
 3206   syntactically acceptable and syntactically unacceptable input.
 3207   While LALR still does not support the full language-recognition
 3208   power of canonical LR and IELR, LAC at least enables LALR's syntax
 3209   error handling to correctly reflect LALR's language-recognition
 3210   power.
 3211 
 3212   Currently, LAC is only supported for deterministic parsers in C.
 3213   You can enable LAC with the following directive:
 3214 
 3215     %define parse.lac full
 3216 
 3217   See the new section "LAC" in the Bison manual for additional
 3218   details including a few caveats.
 3219 
 3220   LAC is an experimental feature.  More user feedback will help to
 3221   stabilize it.
 3222 
 3223 ** %define improvements:
 3224 
 3225 *** Can now be invoked via the command line:
 3226 
 3227   Each of these command-line options
 3228 
 3229     -D NAME[=VALUE]
 3230     --define=NAME[=VALUE]
 3231 
 3232     -F NAME[=VALUE]
 3233     --force-define=NAME[=VALUE]
 3234 
 3235   is equivalent to this grammar file declaration
 3236 
 3237     %define NAME ["VALUE"]
 3238 
 3239   except that the manner in which Bison processes multiple definitions
 3240   for the same NAME differs.  Most importantly, -F and --force-define
 3241   quietly override %define, but -D and --define do not.  For further
 3242   details, see the section "Bison Options" in the Bison manual.
 3243 
 3244 *** Variables renamed:
 3245 
 3246   The following %define variables
 3247 
 3248     api.push_pull
 3249     lr.keep_unreachable_states
 3250 
 3251   have been renamed to
 3252 
 3253     api.push-pull
 3254     lr.keep-unreachable-states
 3255 
 3256   The old names are now deprecated but will be maintained indefinitely
 3257   for backward compatibility.
 3258 
 3259 *** Values no longer need to be quoted in the grammar file:
 3260 
 3261   If a %define value is an identifier, it no longer needs to be placed
 3262   within quotations marks.  For example,
 3263 
 3264     %define api.push-pull "push"
 3265 
 3266   can be rewritten as
 3267 
 3268     %define api.push-pull push
 3269 
 3270 *** Unrecognized variables are now errors not warnings.
 3271 
 3272 *** Multiple invocations for any variable is now an error not a warning.
 3273 
 3274 ** Unrecognized %code qualifiers are now errors not warnings.
 3275 
 3276 ** Character literals not of length one:
 3277 
 3278   Previously, Bison quietly converted all character literals to length
 3279   one.  For example, without warning, Bison interpreted the operators in
 3280   the following grammar to be the same token:
 3281 
 3282     exp: exp '++'
 3283        | exp '+' exp
 3284        ;
 3285 
 3286   Bison now warns when a character literal is not of length one.  In
 3287   some future release, Bison will start reporting an error instead.
 3288 
 3289 ** Destructor calls fixed for lookaheads altered in semantic actions:
 3290 
 3291   Previously for deterministic parsers in C, if a user semantic action
 3292   altered yychar, the parser in some cases used the old yychar value to
 3293   determine which destructor to call for the lookahead upon a syntax
 3294   error or upon parser return.  This bug has been fixed.
 3295 
 3296 ** C++ parsers use YYRHSLOC:
 3297 
 3298   Similarly to the C parsers, the C++ parsers now define the YYRHSLOC
 3299   macro and use it in the default YYLLOC_DEFAULT.  You are encouraged
 3300   to use it.  If, for instance, your location structure has "first"
 3301   and "last" members, instead of
 3302 
 3303     # define YYLLOC_DEFAULT(Current, Rhs, N)                             \
 3304       do                                                                 \
 3305         if (N)                                                           \
 3306           {                                                              \
 3307             (Current).first = (Rhs)[1].location.first;                   \
 3308             (Current).last  = (Rhs)[N].location.last;                    \
 3309           }                                                              \
 3310         else                                                             \
 3311           {                                                              \
 3312             (Current).first = (Current).last = (Rhs)[0].location.last;   \
 3313           }                                                              \
 3314       while (false)
 3315 
 3316   use:
 3317 
 3318     # define YYLLOC_DEFAULT(Current, Rhs, N)                             \
 3319       do                                                                 \
 3320         if (N)                                                           \
 3321           {                                                              \
 3322             (Current).first = YYRHSLOC (Rhs, 1).first;                   \
 3323             (Current).last  = YYRHSLOC (Rhs, N).last;                    \
 3324           }                                                              \
 3325         else                                                             \
 3326           {                                                              \
 3327             (Current).first = (Current).last = YYRHSLOC (Rhs, 0).last;   \
 3328           }                                                              \
 3329       while (false)
 3330 
 3331 ** YYLLOC_DEFAULT in C++:
 3332 
 3333   The default implementation of YYLLOC_DEFAULT used to be issued in
 3334   the header file.  It is now output in the implementation file, after
 3335   the user %code sections so that its #ifndef guard does not try to
 3336   override the user's YYLLOC_DEFAULT if provided.
 3337 
 3338 ** YYFAIL now produces warnings and Java parsers no longer implement it:
 3339 
 3340   YYFAIL has existed for many years as an undocumented feature of
 3341   deterministic parsers in C generated by Bison.  More recently, it was
 3342   a documented feature of Bison's experimental Java parsers.  As
 3343   promised in Bison 2.4.2's NEWS entry, any appearance of YYFAIL in a
 3344   semantic action now produces a deprecation warning, and Java parsers
 3345   no longer implement YYFAIL at all.  For further details, including a
 3346   discussion of how to suppress C preprocessor warnings about YYFAIL
 3347   being unused, see the Bison 2.4.2 NEWS entry.
 3348 
 3349 ** Temporary hack for adding a semicolon to the user action:
 3350 
 3351   Previously, Bison appended a semicolon to every user action for
 3352   reductions when the output language defaulted to C (specifically, when
 3353   neither %yacc, %language, %skeleton, or equivalent command-line
 3354   options were specified).  This allowed actions such as
 3355 
 3356     exp: exp "+" exp { $$ = $1 + $3 };
 3357 
 3358   instead of
 3359 
 3360     exp: exp "+" exp { $$ = $1 + $3; };
 3361 
 3362   As a first step in removing this misfeature, Bison now issues a
 3363   warning when it appends a semicolon.  Moreover, in cases where Bison
 3364   cannot easily determine whether a semicolon is needed (for example, an
 3365   action ending with a cpp directive or a braced compound initializer),
 3366   it no longer appends one.  Thus, the C compiler might now complain
 3367   about a missing semicolon where it did not before.  Future releases of
 3368   Bison will cease to append semicolons entirely.
 3369 
 3370 ** Verbose syntax error message fixes:
 3371 
 3372   When %error-verbose or the obsolete "#define YYERROR_VERBOSE" is
 3373   specified, syntax error messages produced by the generated parser
 3374   include the unexpected token as well as a list of expected tokens.
 3375   The effect of %nonassoc on these verbose messages has been corrected
 3376   in two ways, but a more complete fix requires LAC, described above:
 3377 
 3378 *** When %nonassoc is used, there can exist parser states that accept no
 3379     tokens, and so the parser does not always require a lookahead token
 3380     in order to detect a syntax error.  Because no unexpected token or
 3381     expected tokens can then be reported, the verbose syntax error
 3382     message described above is suppressed, and the parser instead
 3383     reports the simpler message, "syntax error".  Previously, this
 3384     suppression was sometimes erroneously triggered by %nonassoc when a
 3385     lookahead was actually required.  Now verbose messages are
 3386     suppressed only when all previous lookaheads have already been
 3387     shifted or discarded.
 3388 
 3389 *** Previously, the list of expected tokens erroneously included tokens
 3390     that would actually induce a syntax error because conflicts for them
 3391     were resolved with %nonassoc in the current parser state.  Such
 3392     tokens are now properly omitted from the list.
 3393 
 3394 *** Expected token lists are still often wrong due to state merging
 3395     (from LALR or IELR) and default reductions, which can both add
 3396     invalid tokens and subtract valid tokens.  Canonical LR almost
 3397     completely fixes this problem by eliminating state merging and
 3398     default reductions.  However, there is one minor problem left even
 3399     when using canonical LR and even after the fixes above.  That is,
 3400     if the resolution of a conflict with %nonassoc appears in a later
 3401     parser state than the one at which some syntax error is
 3402     discovered, the conflicted token is still erroneously included in
 3403     the expected token list.  Bison's new LAC implementation,
 3404     described above, eliminates this problem and the need for
 3405     canonical LR.  However, LAC is still experimental and is disabled
 3406     by default.
 3407 
 3408 ** Java skeleton fixes:
 3409 
 3410 *** A location handling bug has been fixed.
 3411 
 3412 *** The top element of each of the value stack and location stack is now
 3413     cleared when popped so that it can be garbage collected.
 3414 
 3415 *** Parser traces now print the top element of the stack.
 3416 
 3417 ** -W/--warnings fixes:
 3418 
 3419 *** Bison now properly recognizes the "no-" versions of categories:
 3420 
 3421   For example, given the following command line, Bison now enables all
 3422   warnings except warnings for incompatibilities with POSIX Yacc:
 3423 
 3424     bison -Wall,no-yacc gram.y
 3425 
 3426 *** Bison now treats S/R and R/R conflicts like other warnings:
 3427 
 3428   Previously, conflict reports were independent of Bison's normal
 3429   warning system.  Now, Bison recognizes the warning categories
 3430   "conflicts-sr" and "conflicts-rr".  This change has important
 3431   consequences for the -W and --warnings command-line options.  For
 3432   example:
 3433 
 3434     bison -Wno-conflicts-sr gram.y  # S/R conflicts not reported
 3435     bison -Wno-conflicts-rr gram.y  # R/R conflicts not reported
 3436     bison -Wnone            gram.y  # no conflicts are reported
 3437     bison -Werror           gram.y  # any conflict is an error
 3438 
 3439   However, as before, if the %expect or %expect-rr directive is
 3440   specified, an unexpected number of conflicts is an error, and an
 3441   expected number of conflicts is not reported, so -W and --warning
 3442   then have no effect on the conflict report.
 3443 
 3444 *** The "none" category no longer disables a preceding "error":
 3445 
 3446   For example, for the following command line, Bison now reports
 3447   errors instead of warnings for incompatibilities with POSIX Yacc:
 3448 
 3449     bison -Werror,none,yacc gram.y
 3450 
 3451 *** The "none" category now disables all Bison warnings:
 3452 
 3453   Previously, the "none" category disabled only Bison warnings for
 3454   which there existed a specific -W/--warning category.  However,
 3455   given the following command line, Bison is now guaranteed to
 3456   suppress all warnings:
 3457 
 3458     bison -Wnone gram.y
 3459 
 3460 ** Precedence directives can now assign token number 0:
 3461 
 3462   Since Bison 2.3b, which restored the ability of precedence
 3463   directives to assign token numbers, doing so for token number 0 has
 3464   produced an assertion failure.  For example:
 3465 
 3466     %left END 0
 3467 
 3468   This bug has been fixed.
 3469 
 3470 
 3471 * Noteworthy changes in release 2.4.3 (2010-08-05)
 3472 
 3473 ** Bison now obeys -Werror and --warnings=error for warnings about
 3474    grammar rules that are useless in the parser due to conflicts.
 3475 
 3476 ** Problems with spawning M4 on at least FreeBSD 8 and FreeBSD 9 have
 3477    been fixed.
 3478 
 3479 ** Failures in the test suite for GCC 4.5 have been fixed.
 3480 
 3481 ** Failures in the test suite for some versions of Sun Studio C++ have
 3482    been fixed.
 3483 
 3484 ** Contrary to Bison 2.4.2's NEWS entry, it has been decided that
 3485    warnings about undefined %prec identifiers will not be converted to
 3486    errors in Bison 2.5.  They will remain warnings, which should be
 3487    sufficient for POSIX while avoiding backward compatibility issues.
 3488 
 3489 ** Minor documentation fixes.
 3490 
 3491 
 3492 * Noteworthy changes in release 2.4.2 (2010-03-20)
 3493 
 3494 ** Some portability problems that resulted in failures and livelocks
 3495    in the test suite on some versions of at least Solaris, AIX, HP-UX,
 3496    RHEL4, and Tru64 have been addressed.  As a result, fatal Bison
 3497    errors should no longer cause M4 to report a broken pipe on the
 3498    affected platforms.
 3499 
 3500 ** "%prec IDENTIFIER" requires IDENTIFIER to be defined separately.
 3501 
 3502   POSIX specifies that an error be reported for any identifier that does
 3503   not appear on the LHS of a grammar rule and that is not defined by
 3504   %token, %left, %right, or %nonassoc.  Bison 2.3b and later lost this
 3505   error report for the case when an identifier appears only after a
 3506   %prec directive.  It is now restored.  However, for backward
 3507   compatibility with recent Bison releases, it is only a warning for
 3508   now.  In Bison 2.5 and later, it will return to being an error.
 3509   [Between the 2.4.2 and 2.4.3 releases, it was decided that this
 3510   warning will not be converted to an error in Bison 2.5.]
 3511 
 3512 ** Detection of GNU M4 1.4.6 or newer during configure is improved.
 3513 
 3514 ** Warnings from gcc's -Wundef option about undefined YYENABLE_NLS,
 3515    YYLTYPE_IS_TRIVIAL, and __STRICT_ANSI__ in C/C++ parsers are now
 3516    avoided.
 3517 
 3518 ** %code is now a permanent feature.
 3519 
 3520   A traditional Yacc prologue directive is written in the form:
 3521 
 3522     %{CODE%}
 3523 
 3524   To provide a more flexible alternative, Bison 2.3b introduced the
 3525   %code directive with the following forms for C/C++:
 3526 
 3527     %code          {CODE}
 3528     %code requires {CODE}
 3529     %code provides {CODE}
 3530     %code top      {CODE}
 3531 
 3532   These forms are now considered permanent features of Bison.  See the
 3533   %code entries in the section "Bison Declaration Summary" in the Bison
 3534   manual for a summary of their functionality.  See the section
 3535   "Prologue Alternatives" for a detailed discussion including the
 3536   advantages of %code over the traditional Yacc prologue directive.
 3537 
 3538   Bison's Java feature as a whole including its current usage of %code
 3539   is still considered experimental.
 3540 
 3541 ** YYFAIL is deprecated and will eventually be removed.
 3542 
 3543   YYFAIL has existed for many years as an undocumented feature of
 3544   deterministic parsers in C generated by Bison.  Previously, it was
 3545   documented for Bison's experimental Java parsers.  YYFAIL is no longer
 3546   documented for Java parsers and is formally deprecated in both cases.
 3547   Users are strongly encouraged to migrate to YYERROR, which is
 3548   specified by POSIX.
 3549 
 3550   Like YYERROR, you can invoke YYFAIL from a semantic action in order to
 3551   induce a syntax error.  The most obvious difference from YYERROR is
 3552   that YYFAIL will automatically invoke yyerror to report the syntax
 3553   error so that you don't have to.  However, there are several other
 3554   subtle differences between YYERROR and YYFAIL, and YYFAIL suffers from
 3555   inherent flaws when %error-verbose or "#define YYERROR_VERBOSE" is
 3556   used.  For a more detailed discussion, see:
 3557 
 3558     https://lists.gnu.org/r/bison-patches/2009-12/msg00024.html
 3559 
 3560   The upcoming Bison 2.5 will remove YYFAIL from Java parsers, but
 3561   deterministic parsers in C will continue to implement it.  However,
 3562   because YYFAIL is already flawed, it seems futile to try to make new
 3563   Bison features compatible with it.  Thus, during parser generation,
 3564   Bison 2.5 will produce a warning whenever it discovers YYFAIL in a
 3565   rule action.  In a later release, YYFAIL will be disabled for
 3566   %error-verbose and "#define YYERROR_VERBOSE".  Eventually, YYFAIL will
 3567   be removed altogether.
 3568 
 3569   There exists at least one case where Bison 2.5's YYFAIL warning will
 3570   be a false positive.  Some projects add phony uses of YYFAIL and other
 3571   Bison-defined macros for the sole purpose of suppressing C
 3572   preprocessor warnings (from GCC cpp's -Wunused-macros, for example).
 3573   To avoid Bison's future warning, such YYFAIL uses can be moved to the
 3574   epilogue (that is, after the second "%%") in the Bison input file.  In
 3575   this release (2.4.2), Bison already generates its own code to suppress
 3576   C preprocessor warnings for YYFAIL, so projects can remove their own
 3577   phony uses of YYFAIL if compatibility with Bison releases prior to
 3578   2.4.2 is not necessary.
 3579 
 3580 ** Internationalization.
 3581 
 3582   Fix a regression introduced in Bison 2.4: Under some circumstances,
 3583   message translations were not installed although supported by the
 3584   host system.
 3585 
 3586 
 3587 * Noteworthy changes in release 2.4.1 (2008-12-11)
 3588 
 3589 ** In the GLR defines file, unexpanded M4 macros in the yylval and yylloc
 3590    declarations have been fixed.
 3591 
 3592 ** Temporary hack for adding a semicolon to the user action.
 3593 
 3594   Bison used to prepend a trailing semicolon at the end of the user
 3595   action for reductions.  This allowed actions such as
 3596 
 3597     exp: exp "+" exp { $$ = $1 + $3 };
 3598 
 3599   instead of
 3600 
 3601     exp: exp "+" exp { $$ = $1 + $3; };
 3602 
 3603   Some grammars still depend on this "feature".  Bison 2.4.1 restores
 3604   the previous behavior in the case of C output (specifically, when
 3605   neither %language or %skeleton or equivalent command-line options
 3606   are used) to leave more time for grammars depending on the old
 3607   behavior to be adjusted.  Future releases of Bison will disable this
 3608   feature.
 3609 
 3610 ** A few minor improvements to the Bison manual.
 3611 
 3612 
 3613 * Noteworthy changes in release 2.4 (2008-11-02)
 3614 
 3615 ** %language is an experimental feature.
 3616 
 3617   We first introduced this feature in test release 2.3b as a cleaner
 3618   alternative to %skeleton.  Since then, we have discussed the possibility of
 3619   modifying its effect on Bison's output file names.  Thus, in this release,
 3620   we consider %language to be an experimental feature that will likely evolve
 3621   in future releases.
 3622 
 3623 ** Forward compatibility with GNU M4 has been improved.
 3624 
 3625 ** Several bugs in the C++ skeleton and the experimental Java skeleton have been
 3626   fixed.
 3627 
 3628 
 3629 * Noteworthy changes in release 2.3b (2008-05-27)
 3630 
 3631 ** The quotes around NAME that used to be required in the following directive
 3632   are now deprecated:
 3633 
 3634     %define NAME "VALUE"
 3635 
 3636 ** The directive "%pure-parser" is now deprecated in favor of:
 3637 
 3638     %define api.pure
 3639 
 3640   which has the same effect except that Bison is more careful to warn about
 3641   unreasonable usage in the latter case.
 3642 
 3643 ** Push Parsing
 3644 
 3645   Bison can now generate an LALR(1) parser in C with a push interface.  That
 3646   is, instead of invoking "yyparse", which pulls tokens from "yylex", you can
 3647   push one token at a time to the parser using "yypush_parse", which will
 3648   return to the caller after processing each token.  By default, the push
 3649   interface is disabled.  Either of the following directives will enable it:
 3650 
 3651     %define api.push_pull "push" // Just push; does not require yylex.
 3652     %define api.push_pull "both" // Push and pull; requires yylex.
 3653 
 3654   See the new section "A Push Parser" in the Bison manual for details.
 3655 
 3656   The current push parsing interface is experimental and may evolve.  More user
 3657   feedback will help to stabilize it.
 3658 
 3659 ** The -g and --graph options now output graphs in Graphviz DOT format,
 3660   not VCG format.  Like --graph, -g now also takes an optional FILE argument
 3661   and thus cannot be bundled with other short options.
 3662 
 3663 ** Java
 3664 
 3665   Bison can now generate an LALR(1) parser in Java.  The skeleton is
 3666   "data/lalr1.java".  Consider using the new %language directive instead of
 3667   %skeleton to select it.
 3668 
 3669   See the new section "Java Parsers" in the Bison manual for details.
 3670 
 3671   The current Java interface is experimental and may evolve.  More user
 3672   feedback will help to stabilize it.
 3673   Contributed by Paolo Bonzini.
 3674 
 3675 ** %language
 3676 
 3677   This new directive specifies the programming language of the generated
 3678   parser, which can be C (the default), C++, or Java.  Besides the skeleton
 3679   that Bison uses, the directive affects the names of the generated files if
 3680   the grammar file's name ends in ".y".
 3681 
 3682 ** XML Automaton Report
 3683 
 3684   Bison can now generate an XML report of the LALR(1) automaton using the new
 3685   "--xml" option.  The current XML schema is experimental and may evolve.  More
 3686   user feedback will help to stabilize it.
 3687   Contributed by Wojciech Polak.
 3688 
 3689 ** The grammar file may now specify the name of the parser header file using
 3690   %defines.  For example:
 3691 
 3692     %defines "parser.h"
 3693 
 3694 ** When reporting useless rules, useless nonterminals, and unused terminals,
 3695   Bison now employs the terms "useless in grammar" instead of "useless",
 3696   "useless in parser" instead of "never reduced", and "unused in grammar"
 3697   instead of "unused".
 3698 
 3699 ** Unreachable State Removal
 3700 
 3701   Previously, Bison sometimes generated parser tables containing unreachable
 3702   states.  A state can become unreachable during conflict resolution if Bison
 3703   disables a shift action leading to it from a predecessor state.  Bison now:
 3704 
 3705     1. Removes unreachable states.
 3706 
 3707     2. Does not report any conflicts that appeared in unreachable states.
 3708        WARNING: As a result, you may need to update %expect and %expect-rr
 3709        directives in existing grammar files.
 3710 
 3711     3. For any rule used only in such states, Bison now reports the rule as
 3712        "useless in parser due to conflicts".
 3713 
 3714   This feature can be disabled with the following directive:
 3715 
 3716     %define lr.keep_unreachable_states
 3717 
 3718   See the %define entry in the "Bison Declaration Summary" in the Bison manual
 3719   for further discussion.
 3720 
 3721 ** Lookahead Set Correction in the ".output" Report
 3722 
 3723   When instructed to generate a ".output" file including lookahead sets
 3724   (using "--report=lookahead", for example), Bison now prints each reduction's
 3725   lookahead set only next to the associated state's one item that (1) is
 3726   associated with the same rule as the reduction and (2) has its dot at the end
 3727   of its RHS.  Previously, Bison also erroneously printed the lookahead set
 3728   next to all of the state's other items associated with the same rule.  This
 3729   bug affected only the ".output" file and not the generated parser source
 3730   code.
 3731 
 3732 ** --report-file=FILE is a new option to override the default ".output" file
 3733   name.
 3734 
 3735 ** The "=" that used to be required in the following directives is now
 3736   deprecated:
 3737 
 3738     %file-prefix "parser"
 3739     %name-prefix "c_"
 3740     %output "parser.c"
 3741 
 3742 ** An Alternative to "%{...%}" -- "%code QUALIFIER {CODE}"
 3743 
 3744   Bison 2.3a provided a new set of directives as a more flexible alternative to
 3745   the traditional Yacc prologue blocks.  Those have now been consolidated into
 3746   a single %code directive with an optional qualifier field, which identifies
 3747   the purpose of the code and thus the location(s) where Bison should generate
 3748   it:
 3749 
 3750     1. "%code          {CODE}" replaces "%after-header  {CODE}"
 3751     2. "%code requires {CODE}" replaces "%start-header  {CODE}"
 3752     3. "%code provides {CODE}" replaces "%end-header    {CODE}"
 3753     4. "%code top      {CODE}" replaces "%before-header {CODE}"
 3754 
 3755   See the %code entries in section "Bison Declaration Summary" in the Bison
 3756   manual for a summary of the new functionality.  See the new section "Prologue
 3757   Alternatives" for a detailed discussion including the advantages of %code
 3758   over the traditional Yacc prologues.
 3759 
 3760   The prologue alternatives are experimental.  More user feedback will help to
 3761   determine whether they should become permanent features.
 3762 
 3763 ** Revised warning: unset or unused midrule values
 3764 
 3765   Since Bison 2.2, Bison has warned about midrule values that are set but not
 3766   used within any of the actions of the parent rule.  For example, Bison warns
 3767   about unused $2 in:
 3768 
 3769     exp: '1' { $$ = 1; } '+' exp { $$ = $1 + $4; };
 3770 
 3771   Now, Bison also warns about midrule values that are used but not set.  For
 3772   example, Bison warns about unset $$ in the midrule action in:
 3773 
 3774     exp: '1' { $1 = 1; } '+' exp { $$ = $2 + $4; };
 3775 
 3776   However, Bison now disables both of these warnings by default since they
 3777   sometimes prove to be false alarms in existing grammars employing the Yacc
 3778   constructs $0 or $-N (where N is some positive integer).
 3779 
 3780   To enable these warnings, specify the option "--warnings=midrule-values" or
 3781   "-W", which is a synonym for "--warnings=all".
 3782 
 3783 ** Default %destructor or %printer with "<*>" or "<>"
 3784 
 3785   Bison now recognizes two separate kinds of default %destructor's and
 3786   %printer's:
 3787 
 3788     1. Place "<*>" in a %destructor/%printer symbol list to define a default
 3789        %destructor/%printer for all grammar symbols for which you have formally
 3790        declared semantic type tags.
 3791 
 3792     2. Place "<>" in a %destructor/%printer symbol list to define a default
 3793        %destructor/%printer for all grammar symbols without declared semantic
 3794        type tags.
 3795 
 3796   Bison no longer supports the "%symbol-default" notation from Bison 2.3a.
 3797   "<*>" and "<>" combined achieve the same effect with one exception: Bison no
 3798   longer applies any %destructor to a midrule value if that midrule value is
 3799   not actually ever referenced using either $$ or $n in a semantic action.
 3800 
 3801   The default %destructor's and %printer's are experimental.  More user
 3802   feedback will help to determine whether they should become permanent
 3803   features.
 3804 
 3805   See the section "Freeing Discarded Symbols" in the Bison manual for further
 3806   details.
 3807 
 3808 ** %left, %right, and %nonassoc can now declare token numbers.  This is required
 3809   by POSIX.  However, see the end of section "Operator Precedence" in the Bison
 3810   manual for a caveat concerning the treatment of literal strings.
 3811 
 3812 ** The nonfunctional --no-parser, -n, and %no-parser options have been
 3813   completely removed from Bison.
 3814 
 3815 
 3816 * Noteworthy changes in release 2.3a (2006-09-13)
 3817 
 3818 ** Instead of %union, you can define and use your own union type
 3819   YYSTYPE if your grammar contains at least one <type> tag.
 3820   Your YYSTYPE need not be a macro; it can be a typedef.
 3821   This change is for compatibility with other Yacc implementations,
 3822   and is required by POSIX.
 3823 
 3824 ** Locations columns and lines start at 1.
 3825   In accordance with the GNU Coding Standards and Emacs.
 3826 
 3827 ** You may now declare per-type and default %destructor's and %printer's:
 3828 
 3829   For example:
 3830 
 3831     %union { char *string; }
 3832     %token <string> STRING1
 3833     %token <string> STRING2
 3834     %type  <string> string1
 3835     %type  <string> string2
 3836     %union { char character; }
 3837     %token <character> CHR
 3838     %type  <character> chr
 3839     %destructor { free ($$); } %symbol-default
 3840     %destructor { free ($$); printf ("%d", @$.first_line); } STRING1 string1
 3841     %destructor { } <character>
 3842 
 3843   guarantees that, when the parser discards any user-defined symbol that has a
 3844   semantic type tag other than "<character>", it passes its semantic value to
 3845   "free".  However, when the parser discards a "STRING1" or a "string1", it
 3846   also prints its line number to "stdout".  It performs only the second
 3847   "%destructor" in this case, so it invokes "free" only once.
 3848 
 3849   [Although we failed to mention this here in the 2.3a release, the default
 3850   %destructor's and %printer's were experimental, and they were rewritten in
 3851   future versions.]
 3852 
 3853 ** Except for LALR(1) parsers in C with POSIX Yacc emulation enabled (with "-y",
 3854   "--yacc", or "%yacc"), Bison no longer generates #define statements for
 3855   associating token numbers with token names.  Removing the #define statements
 3856   helps to sanitize the global namespace during preprocessing, but POSIX Yacc
 3857   requires them.  Bison still generates an enum for token names in all cases.
 3858 
 3859 ** Handling of traditional Yacc prologue blocks is now more consistent but
 3860   potentially incompatible with previous releases of Bison.
 3861 
 3862   As before, you declare prologue blocks in your grammar file with the
 3863   "%{ ... %}" syntax.  To generate the pre-prologue, Bison concatenates all
 3864   prologue blocks that you've declared before the first %union.  To generate
 3865   the post-prologue, Bison concatenates all prologue blocks that you've
 3866   declared after the first %union.
 3867 
 3868   Previous releases of Bison inserted the pre-prologue into both the header
 3869   file and the code file in all cases except for LALR(1) parsers in C.  In the
 3870   latter case, Bison inserted it only into the code file.  For parsers in C++,
 3871   the point of insertion was before any token definitions (which associate
 3872   token numbers with names).  For parsers in C, the point of insertion was
 3873   after the token definitions.
 3874 
 3875   Now, Bison never inserts the pre-prologue into the header file.  In the code
 3876   file, it always inserts it before the token definitions.
 3877 
 3878 ** Bison now provides a more flexible alternative to the traditional Yacc
 3879   prologue blocks: %before-header, %start-header, %end-header, and
 3880   %after-header.
 3881 
 3882   For example, the following declaration order in the grammar file reflects the
 3883   order in which Bison will output these code blocks.  However, you are free to
 3884   declare these code blocks in your grammar file in whatever order is most
 3885   convenient for you:
 3886 
 3887     %before-header {
 3888       /* Bison treats this block like a pre-prologue block: it inserts it into
 3889        * the code file before the contents of the header file.  It does *not*
 3890        * insert it into the header file.  This is a good place to put
 3891        * #include's that you want at the top of your code file.  A common
 3892        * example is '#include "system.h"'.  */
 3893     }
 3894     %start-header {
 3895       /* Bison inserts this block into both the header file and the code file.
 3896        * In both files, the point of insertion is before any Bison-generated
 3897        * token, semantic type, location type, and class definitions.  This is a
 3898        * good place to define %union dependencies, for example.  */
 3899     }
 3900     %union {
 3901       /* Unlike the traditional Yacc prologue blocks, the output order for the
 3902        * new %*-header blocks is not affected by their declaration position
 3903        * relative to any %union in the grammar file.  */
 3904     }
 3905     %end-header {
 3906       /* Bison inserts this block into both the header file and the code file.
 3907        * In both files, the point of insertion is after the Bison-generated
 3908        * definitions.  This is a good place to declare or define public
 3909        * functions or data structures that depend on the Bison-generated
 3910        * definitions.  */
 3911     }
 3912     %after-header {
 3913       /* Bison treats this block like a post-prologue block: it inserts it into
 3914        * the code file after the contents of the header file.  It does *not*
 3915        * insert it into the header file.  This is a good place to declare or
 3916        * define internal functions or data structures that depend on the
 3917        * Bison-generated definitions.  */
 3918     }
 3919 
 3920   If you have multiple occurrences of any one of the above declarations, Bison
 3921   will concatenate the contents in declaration order.
 3922 
 3923   [Although we failed to mention this here in the 2.3a release, the prologue
 3924   alternatives were experimental, and they were rewritten in future versions.]
 3925 
 3926 ** The option "--report=look-ahead" has been changed to "--report=lookahead".
 3927   The old spelling still works, but is not documented and may be removed
 3928   in a future release.
 3929 
 3930 
 3931 * Noteworthy changes in release 2.3 (2006-06-05)
 3932 
 3933 ** GLR grammars should now use "YYRECOVERING ()" instead of "YYRECOVERING",
 3934   for compatibility with LALR(1) grammars.
 3935 
 3936 ** It is now documented that any definition of YYSTYPE or YYLTYPE should
 3937   be to a type name that does not contain parentheses or brackets.
 3938 
 3939 
 3940 * Noteworthy changes in release 2.2 (2006-05-19)
 3941 
 3942 ** The distribution terms for all Bison-generated parsers now permit
 3943   using the parsers in nonfree programs.  Previously, this permission
 3944   was granted only for Bison-generated LALR(1) parsers in C.
 3945 
 3946 ** %name-prefix changes the namespace name in C++ outputs.
 3947 
 3948 ** The C++ parsers export their token_type.
 3949 
 3950 ** Bison now allows multiple %union declarations, and concatenates
 3951   their contents together.
 3952 
 3953 ** New warning: unused values
 3954   Right-hand side symbols whose values are not used are reported,
 3955   if the symbols have destructors.  For instance:
 3956 
 3957      exp: exp "?" exp ":" exp { $1 ? $1 : $3; }
 3958         | exp "+" exp
 3959         ;
 3960 
 3961   will trigger a warning about $$ and $5 in the first rule, and $3 in
 3962   the second ($1 is copied to $$ by the default rule).  This example
 3963   most likely contains three errors, and could be rewritten as:
 3964 
 3965      exp: exp "?" exp ":" exp
 3966             { $$ = $1 ? $3 : $5; free ($1 ? $5 : $3); free ($1); }
 3967         | exp "+" exp
 3968             { $$ = $1 ? $1 : $3; if ($1) free ($3); }
 3969         ;
 3970 
 3971   However, if the original actions were really intended, memory leaks
 3972   and all, the warnings can be suppressed by letting Bison believe the
 3973   values are used, e.g.:
 3974 
 3975      exp: exp "?" exp ":" exp { $1 ? $1 : $3; (void) ($$, $5); }
 3976         | exp "+" exp         { $$ = $1; (void) $3; }
 3977         ;
 3978 
 3979   If there are midrule actions, the warning is issued if no action
 3980   uses it.  The following triggers no warning: $1 and $3 are used.
 3981 
 3982      exp: exp { push ($1); } '+' exp { push ($3); sum (); };
 3983 
 3984   The warning is intended to help catching lost values and memory leaks.
 3985   If a value is ignored, its associated memory typically is not reclaimed.
 3986 
 3987 ** %destructor vs. YYABORT, YYACCEPT, and YYERROR.
 3988   Destructors are now called when user code invokes YYABORT, YYACCEPT,
 3989   and YYERROR, for all objects on the stack, other than objects
 3990   corresponding to the right-hand side of the current rule.
 3991 
 3992 ** %expect, %expect-rr
 3993   Incorrect numbers of expected conflicts are now actual errors,
 3994   instead of warnings.
 3995 
 3996 ** GLR, YACC parsers.
 3997   The %parse-params are available in the destructors (and the
 3998   experimental printers) as per the documentation.
 3999 
 4000 ** Bison now warns if it finds a stray "$" or "@" in an action.
 4001 
 4002 ** %require "VERSION"
 4003   This specifies that the grammar file depends on features implemented
 4004   in Bison version VERSION or higher.
 4005 
 4006 ** lalr1.cc: The token and value types are now class members.
 4007   The tokens were defined as free form enums and cpp macros.  YYSTYPE
 4008   was defined as a free form union.  They are now class members:
 4009   tokens are enumerations of the "yy::parser::token" struct, and the
 4010   semantic values have the "yy::parser::semantic_type" type.
 4011 
 4012   If you do not want or can update to this scheme, the directive
 4013   '%define "global_tokens_and_yystype" "1"' triggers the global
 4014   definition of tokens and YYSTYPE.  This change is suitable both
 4015   for previous releases of Bison, and this one.
 4016 
 4017   If you wish to update, then make sure older version of Bison will
 4018   fail using '%require "2.2"'.
 4019 
 4020 ** DJGPP support added.
 4021 
 4022 
 4023 * Noteworthy changes in release 2.1 (2005-09-16)
 4024 
 4025 ** The C++ lalr1.cc skeleton supports %lex-param.
 4026 
 4027 ** Bison-generated parsers now support the translation of diagnostics like
 4028   "syntax error" into languages other than English.  The default
 4029   language is still English.  For details, please see the new
 4030   Internationalization section of the Bison manual.  Software
 4031   distributors should also see the new PACKAGING file.  Thanks to
 4032   Bruno Haible for this new feature.
 4033 
 4034 ** Wording in the Bison-generated parsers has been changed slightly to
 4035   simplify translation.  In particular, the message "memory exhausted"
 4036   has replaced "parser stack overflow", as the old message was not
 4037   always accurate for modern Bison-generated parsers.
 4038 
 4039 ** Destructors are now called when the parser aborts, for all symbols left
 4040   behind on the stack.  Also, the start symbol is now destroyed after a
 4041   successful parse.  In both cases, the behavior was formerly inconsistent.
 4042 
 4043 ** When generating verbose diagnostics, Bison-generated parsers no longer
 4044   quote the literal strings associated with tokens.  For example, for
 4045   a syntax error associated with '%token NUM "number"' they might
 4046   print 'syntax error, unexpected number' instead of 'syntax error,
 4047   unexpected "number"'.
 4048 
 4049 
 4050 * Noteworthy changes in release 2.0 (2004-12-25)
 4051 
 4052 ** Possibly-incompatible changes
 4053 
 4054   - Bison-generated parsers no longer default to using the alloca function
 4055     (when available) to extend the parser stack, due to widespread
 4056     problems in unchecked stack-overflow detection.  You can "#define
 4057     YYSTACK_USE_ALLOCA 1" to require the use of alloca, but please read
 4058     the manual to determine safe values for YYMAXDEPTH in that case.
 4059 
 4060   - Error token location.
 4061     During error recovery, the location of the syntax error is updated
 4062     to cover the whole sequence covered by the error token: it includes
 4063     the shifted symbols thrown away during the first part of the error
 4064     recovery, and the lookahead rejected during the second part.
 4065 
 4066   - Semicolon changes:
 4067     . Stray semicolons are no longer allowed at the start of a grammar.
 4068     . Semicolons are now required after in-grammar declarations.
 4069 
 4070   - Unescaped newlines are no longer allowed in character constants or
 4071     string literals.  They were never portable, and GCC 3.4.0 has
 4072     dropped support for them.  Better diagnostics are now generated if
 4073     forget a closing quote.
 4074 
 4075   - NUL bytes are no longer allowed in Bison string literals, unfortunately.
 4076 
 4077 ** New features
 4078 
 4079   - GLR grammars now support locations.
 4080 
 4081   - New directive: %initial-action.
 4082     This directive allows the user to run arbitrary code (including
 4083     initializing @$) from yyparse before parsing starts.
 4084 
 4085   - A new directive "%expect-rr N" specifies the expected number of
 4086     reduce/reduce conflicts in GLR parsers.
 4087 
 4088   - %token numbers can now be hexadecimal integers, e.g., "%token FOO 0x12d".
 4089     This is a GNU extension.
 4090 
 4091   - The option "--report=lookahead" was changed to "--report=look-ahead".
 4092     [However, this was changed back after 2.3.]
 4093 
 4094   - Experimental %destructor support has been added to lalr1.cc.
 4095 
 4096   - New configure option --disable-yacc, to disable installation of the
 4097     yacc command and -ly library introduced in 1.875 for POSIX conformance.
 4098 
 4099 ** Bug fixes
 4100 
 4101   - For now, %expect-count violations are now just warnings, not errors.
 4102     This is for compatibility with Bison 1.75 and earlier (when there are
 4103     reduce/reduce conflicts) and with Bison 1.30 and earlier (when there
 4104     are too many or too few shift/reduce conflicts).  However, in future
 4105     versions of Bison we plan to improve the %expect machinery so that
 4106     these violations will become errors again.
 4107 
 4108   - Within Bison itself, numbers (e.g., goto numbers) are no longer
 4109     arbitrarily limited to 16-bit counts.
 4110 
 4111   - Semicolons are now allowed before "|" in grammar rules, as POSIX requires.
 4112 
 4113 
 4114 * Noteworthy changes in release 1.875 (2003-01-01)
 4115 
 4116 ** The documentation license has been upgraded to version 1.2
 4117   of the GNU Free Documentation License.
 4118 
 4119 ** syntax error processing
 4120 
 4121   - In Yacc-style parsers YYLLOC_DEFAULT is now used to compute error
 4122     locations too.  This fixes bugs in error-location computation.
 4123 
 4124   - %destructor
 4125     It is now possible to reclaim the memory associated to symbols
 4126     discarded during error recovery.  This feature is still experimental.
 4127 
 4128   - %error-verbose
 4129     This new directive is preferred over YYERROR_VERBOSE.
 4130 
 4131   - #defining yyerror to steal internal variables is discouraged.
 4132     It is not guaranteed to work forever.
 4133 
 4134 ** POSIX conformance
 4135 
 4136   - Semicolons are once again optional at the end of grammar rules.
 4137     This reverts to the behavior of Bison 1.33 and earlier, and improves
 4138     compatibility with Yacc.
 4139 
 4140   - "parse error" -> "syntax error"
 4141     Bison now uniformly uses the term "syntax error"; formerly, the code
 4142     and manual sometimes used the term "parse error" instead.  POSIX
 4143     requires "syntax error" in diagnostics, and it was thought better to
 4144     be consistent.
 4145 
 4146   - The documentation now emphasizes that yylex and yyerror must be
 4147     declared before use.  C99 requires this.
 4148 
 4149   - Bison now parses C99 lexical constructs like UCNs and
 4150     backslash-newline within C escape sequences, as POSIX 1003.1-2001 requires.
 4151 
 4152   - File names are properly escaped in C output.  E.g., foo\bar.y is
 4153     output as "foo\\bar.y".
 4154 
 4155   - Yacc command and library now available
 4156     The Bison distribution now installs a "yacc" command, as POSIX requires.
 4157     Also, Bison now installs a small library liby.a containing
 4158     implementations of Yacc-compatible yyerror and main functions.
 4159     This library is normally not useful, but POSIX requires it.
 4160 
 4161   - Type clashes now generate warnings, not errors.
 4162 
 4163   - If the user does not define YYSTYPE as a macro, Bison now declares it
 4164     using typedef instead of defining it as a macro.
 4165     For consistency, YYLTYPE is also declared instead of defined.
 4166 
 4167 ** Other compatibility issues
 4168 
 4169   - %union directives can now have a tag before the "{", e.g., the
 4170     directive "%union foo {...}" now generates the C code
 4171     "typedef union foo { ... } YYSTYPE;"; this is for Yacc compatibility.
 4172     The default union tag is "YYSTYPE", for compatibility with Solaris 9 Yacc.
 4173     For consistency, YYLTYPE's struct tag is now "YYLTYPE" not "yyltype".
 4174     This is for compatibility with both Yacc and Bison 1.35.
 4175 
 4176   - ";" is output before the terminating "}" of an action, for
 4177     compatibility with Bison 1.35.
 4178 
 4179   - Bison now uses a Yacc-style format for conflict reports, e.g.,
 4180     "conflicts: 2 shift/reduce, 1 reduce/reduce".
 4181 
 4182   - "yystype" and "yyltype" are now obsolescent macros instead of being
 4183     typedefs or tags; they are no longer documented and are planned to be
 4184     withdrawn in a future release.
 4185 
 4186 ** GLR parser notes
 4187 
 4188   - GLR and inline
 4189     Users of Bison have to decide how they handle the portability of the
 4190     C keyword "inline".
 4191 
 4192   - "parsing stack overflow..." -> "parser stack overflow"
 4193     GLR parsers now report "parser stack overflow" as per the Bison manual.
 4194 
 4195 ** %parse-param and %lex-param
 4196   The macros YYPARSE_PARAM and YYLEX_PARAM provide a means to pass
 4197   additional context to yyparse and yylex.  They suffer from several
 4198   shortcomings:
 4199 
 4200   - a single argument only can be added,
 4201   - their types are weak (void *),
 4202   - this context is not passed to ancillary functions such as yyerror,
 4203   - only yacc.c parsers support them.
 4204 
 4205   The new %parse-param/%lex-param directives provide a more precise control.
 4206   For instance:
 4207 
 4208     %parse-param {int *nastiness}
 4209     %lex-param   {int *nastiness}
 4210     %parse-param {int *randomness}
 4211 
 4212   results in the following signatures:
 4213 
 4214     int yylex   (int *nastiness);
 4215     int yyparse (int *nastiness, int *randomness);
 4216 
 4217   or, if both %pure-parser and %locations are used:
 4218 
 4219     int yylex   (YYSTYPE *lvalp, YYLTYPE *llocp, int *nastiness);
 4220     int yyparse (int *nastiness, int *randomness);
 4221 
 4222 ** Bison now warns if it detects conflicting outputs to the same file,
 4223   e.g., it generates a warning for "bison -d -o foo.h foo.y" since
 4224   that command outputs both code and header to foo.h.
 4225 
 4226 ** #line in output files
 4227   - --no-line works properly.
 4228 
 4229 ** Bison can no longer be built by a K&R C compiler; it requires C89 or
 4230   later to be built.  This change originally took place a few versions
 4231   ago, but nobody noticed until we recently asked someone to try
 4232   building Bison with a K&R C compiler.
 4233 
 4234 
 4235 * Noteworthy changes in release 1.75 (2002-10-14)
 4236 
 4237 ** Bison should now work on 64-bit hosts.
 4238 
 4239 ** Indonesian translation thanks to Tedi Heriyanto.
 4240 
 4241 ** GLR parsers
 4242   Fix spurious parse errors.
 4243 
 4244 ** Pure parsers
 4245   Some people redefine yyerror to steal yyparse' private variables.
 4246   Reenable this trick until an official feature replaces it.
 4247 
 4248 ** Type Clashes
 4249   In agreement with POSIX and with other Yaccs, leaving a default
 4250   action is valid when $$ is untyped, and $1 typed:
 4251 
 4252         untyped: ... typed;
 4253 
 4254   but the converse remains an error:
 4255 
 4256         typed: ... untyped;
 4257 
 4258 ** Values of midrule actions
 4259   The following code:
 4260 
 4261         foo: { ... } { $$ = $1; } ...
 4262 
 4263   was incorrectly rejected: $1 is defined in the second midrule
 4264   action, and is equal to the $$ of the first midrule action.
 4265 
 4266 
 4267 * Noteworthy changes in release 1.50 (2002-10-04)
 4268 
 4269 ** GLR parsing
 4270   The declaration
 4271      %glr-parser
 4272   causes Bison to produce a Generalized LR (GLR) parser, capable of handling
 4273   almost any context-free grammar, ambiguous or not.  The new declarations
 4274   %dprec and %merge on grammar rules allow parse-time resolution of
 4275   ambiguities.  Contributed by Paul Hilfinger.
 4276 
 4277   Unfortunately Bison 1.50 does not work properly on 64-bit hosts
 4278   like the Alpha, so please stick to 32-bit hosts for now.
 4279 
 4280 ** Output Directory
 4281   When not in Yacc compatibility mode, when the output file was not
 4282   specified, running "bison foo/bar.y" created "foo/bar.c".  It
 4283   now creates "bar.c".
 4284 
 4285 ** Undefined token
 4286   The undefined token was systematically mapped to 2 which prevented
 4287   the use of 2 by the user.  This is no longer the case.
 4288 
 4289 ** Unknown token numbers
 4290   If yylex returned an out of range value, yyparse could die.  This is
 4291   no longer the case.
 4292 
 4293 ** Error token
 4294   According to POSIX, the error token must be 256.
 4295   Bison extends this requirement by making it a preference: *if* the
 4296   user specified that one of her tokens is numbered 256, then error
 4297   will be mapped onto another number.
 4298 
 4299 ** Verbose error messages
 4300   They no longer report "..., expecting error or..." for states where
 4301   error recovery is possible.
 4302 
 4303 ** End token
 4304   Defaults to "$end" instead of "$".
 4305 
 4306 ** Error recovery now conforms to documentation and to POSIX
 4307   When a Bison-generated parser encounters a syntax error, it now pops
 4308   the stack until it finds a state that allows shifting the error
 4309   token.  Formerly, it popped the stack until it found a state that
 4310   allowed some non-error action other than a default reduction on the
 4311   error token.  The new behavior has long been the documented behavior,
 4312   and has long been required by POSIX.  For more details, please see
 4313   Paul Eggert, "Reductions during Bison error handling" (2002-05-20)
 4314   <https://lists.gnu.org/r/bug-bison/2002-05/msg00038.html>.
 4315 
 4316 ** Traces
 4317   Popped tokens and nonterminals are now reported.
 4318 
 4319 ** Larger grammars
 4320   Larger grammars are now supported (larger token numbers, larger grammar
 4321   size (= sum of the LHS and RHS lengths), larger LALR tables).
 4322   Formerly, many of these numbers ran afoul of 16-bit limits;
 4323   now these limits are 32 bits on most hosts.
 4324 
 4325 ** Explicit initial rule
 4326   Bison used to play hacks with the initial rule, which the user does
 4327   not write.  It is now explicit, and visible in the reports and
 4328   graphs as rule 0.
 4329 
 4330 ** Useless rules
 4331   Before, Bison reported the useless rules, but, although not used,
 4332   included them in the parsers.  They are now actually removed.
 4333 
 4334 ** Useless rules, useless nonterminals
 4335   They are now reported, as a warning, with their locations.
 4336 
 4337 ** Rules never reduced
 4338   Rules that can never be reduced because of conflicts are now
 4339   reported.
 4340 
 4341 ** Incorrect "Token not used"
 4342   On a grammar such as
 4343 
 4344     %token useless useful
 4345     %%
 4346     exp: '0' %prec useful;
 4347 
 4348   where a token was used to set the precedence of the last rule,
 4349   bison reported both "useful" and "useless" as useless tokens.
 4350 
 4351 ** Revert the C++ namespace changes introduced in 1.31
 4352   as they caused too many portability hassles.
 4353 
 4354 ** Default locations
 4355   By an accident of design, the default computation of @$ was
 4356   performed after another default computation was performed: @$ = @1.
 4357   The latter is now removed: YYLLOC_DEFAULT is fully responsible of
 4358   the computation of @$.
 4359 
 4360 ** Token end-of-file
 4361   The token end of file may be specified by the user, in which case,
 4362   the user symbol is used in the reports, the graphs, and the verbose
 4363   error messages instead of "$end", which remains being the default.
 4364   For instance
 4365     %token MYEOF 0
 4366   or
 4367     %token MYEOF 0 "end of file"
 4368 
 4369 ** Semantic parser
 4370   This old option, which has been broken for ages, is removed.
 4371 
 4372 ** New translations
 4373   Brazilian Portuguese, thanks to Alexandre Folle de Menezes.
 4374   Croatian, thanks to Denis Lackovic.
 4375 
 4376 ** Incorrect token definitions
 4377   When given
 4378     %token 'a' "A"
 4379   bison used to output
 4380     #define 'a' 65
 4381 
 4382 ** Token definitions as enums
 4383   Tokens are output both as the traditional #define's, and, provided
 4384   the compiler supports ANSI C or is a C++ compiler, as enums.
 4385   This lets debuggers display names instead of integers.
 4386 
 4387 ** Reports
 4388   In addition to --verbose, bison supports --report=THINGS, which
 4389   produces additional information:
 4390   - itemset
 4391     complete the core item sets with their closure
 4392   - lookahead [changed to "look-ahead" in 1.875e through 2.3, but changed back]
 4393     explicitly associate lookahead tokens to items
 4394   - solved
 4395     describe shift/reduce conflicts solving.
 4396     Bison used to systematically output this information on top of
 4397     the report.  Solved conflicts are now attached to their states.
 4398 
 4399 ** Type clashes
 4400   Previous versions don't complain when there is a type clash on
 4401   the default action if the rule has a midrule action, such as in:
 4402 
 4403     %type <foo> bar
 4404     %%
 4405     bar: '0' {} '0';
 4406 
 4407   This is fixed.
 4408 
 4409 ** GNU M4 is now required when using Bison.
 4410 
 4411 
 4412 * Noteworthy changes in release 1.35 (2002-03-25)
 4413 
 4414 ** C Skeleton
 4415   Some projects use Bison's C parser with C++ compilers, and define
 4416   YYSTYPE as a class.  The recent adjustment of C parsers for data
 4417   alignment and 64 bit architectures made this impossible.
 4418 
 4419   Because for the time being no real solution for C++ parser
 4420   generation exists, kludges were implemented in the parser to
 4421   maintain this use.  In the future, when Bison has C++ parsers, this
 4422   kludge will be disabled.
 4423 
 4424   This kludge also addresses some C++ problems when the stack was
 4425   extended.
 4426 
 4427 
 4428 * Noteworthy changes in release 1.34 (2002-03-12)
 4429 
 4430 ** File name clashes are detected
 4431   $ bison foo.y -d -o foo.x
 4432   fatal error: header and parser would both be named "foo.x"
 4433 
 4434 ** A missing ";" at the end of a rule triggers a warning
 4435   In accordance with POSIX, and in agreement with other
 4436   Yacc implementations, Bison will mandate this semicolon in the near
 4437   future.  This eases the implementation of a Bison parser of Bison
 4438   grammars by making this grammar LALR(1) instead of LR(2).  To
 4439   facilitate the transition, this release introduces a warning.
 4440 
 4441 ** Revert the C++ namespace changes introduced in 1.31, as they caused too
 4442   many portability hassles.
 4443 
 4444 ** DJGPP support added.
 4445 
 4446 ** Fix test suite portability problems.
 4447 
 4448 
 4449 * Noteworthy changes in release 1.33 (2002-02-07)
 4450 
 4451 ** Fix C++ issues
 4452   Groff could not be compiled for the definition of size_t was lacking
 4453   under some conditions.
 4454 
 4455 ** Catch invalid @n
 4456   As is done with $n.
 4457 
 4458 
 4459 * Noteworthy changes in release 1.32 (2002-01-23)
 4460 
 4461 ** Fix Yacc output file names
 4462 
 4463 ** Portability fixes
 4464 
 4465 ** Italian, Dutch translations
 4466 
 4467 
 4468 * Noteworthy changes in release 1.31 (2002-01-14)
 4469 
 4470 ** Many Bug Fixes
 4471 
 4472 ** GNU Gettext and %expect
 4473   GNU Gettext asserts 10 s/r conflicts, but there are 7.  Now that
 4474   Bison dies on incorrect %expectations, we fear there will be
 4475   too many bug reports for Gettext, so _for the time being_, %expect
 4476   does not trigger an error when the input file is named "plural.y".
 4477 
 4478 ** Use of alloca in parsers
 4479   If YYSTACK_USE_ALLOCA is defined to 0, then the parsers will use
 4480   malloc exclusively.  Since 1.29, but was not NEWS'ed.
 4481 
 4482   alloca is used only when compiled with GCC, to avoid portability
 4483   problems as on AIX.
 4484 
 4485 ** yyparse now returns 2 if memory is exhausted; formerly it dumped core.
 4486 
 4487 ** When the generated parser lacks debugging code, YYDEBUG is now 0
 4488   (as POSIX requires) instead of being undefined.
 4489 
 4490 ** User Actions
 4491   Bison has always permitted actions such as { $$ = $1 }: it adds the
 4492   ending semicolon.  Now if in Yacc compatibility mode, the semicolon
 4493   is no longer output: one has to write { $$ = $1; }.
 4494 
 4495 ** Better C++ compliance
 4496   The output parsers try to respect C++ namespaces.
 4497   [This turned out to be a failed experiment, and it was reverted later.]
 4498 
 4499 ** Reduced Grammars
 4500   Fixed bugs when reporting useless nonterminals.
 4501 
 4502 ** 64 bit hosts
 4503   The parsers work properly on 64 bit hosts.
 4504 
 4505 ** Error messages
 4506   Some calls to strerror resulted in scrambled or missing error messages.
 4507 
 4508 ** %expect
 4509   When the number of shift/reduce conflicts is correct, don't issue
 4510   any warning.
 4511 
 4512 ** The verbose report includes the rule line numbers.
 4513 
 4514 ** Rule line numbers are fixed in traces.
 4515 
 4516 ** Swedish translation
 4517 
 4518 ** Parse errors
 4519   Verbose parse error messages from the parsers are better looking.
 4520   Before: parse error: unexpected `'/'', expecting `"number"' or `'-'' or `'(''
 4521      Now: parse error: unexpected '/', expecting "number" or '-' or '('
 4522 
 4523 ** Fixed parser memory leaks.
 4524   When the generated parser was using malloc to extend its stacks, the
 4525   previous allocations were not freed.
 4526 
 4527 ** Fixed verbose output file.
 4528   Some newlines were missing.
 4529   Some conflicts in state descriptions were missing.
 4530 
 4531 ** Fixed conflict report.
 4532   Option -v was needed to get the result.
 4533 
 4534 ** %expect
 4535   Was not used.
 4536   Mismatches are errors, not warnings.
 4537 
 4538 ** Fixed incorrect processing of some invalid input.
 4539 
 4540 ** Fixed CPP guards: 9foo.h uses BISON_9FOO_H instead of 9FOO_H.
 4541 
 4542 ** Fixed some typos in the documentation.
 4543 
 4544 ** %token MY_EOF 0 is supported.
 4545   Before, MY_EOF was silently renumbered as 257.
 4546 
 4547 ** doc/refcard.tex is updated.
 4548 
 4549 ** %output, %file-prefix, %name-prefix.
 4550   New.
 4551 
 4552 ** --output
 4553   New, aliasing "--output-file".
 4554 
 4555 
 4556 * Noteworthy changes in release 1.30 (2001-10-26)
 4557 
 4558 ** "--defines" and "--graph" have now an optional argument which is the
 4559   output file name. "-d" and "-g" do not change; they do not take any
 4560   argument.
 4561 
 4562 ** "%source_extension" and "%header_extension" are removed, failed
 4563   experiment.
 4564 
 4565 ** Portability fixes.
 4566 
 4567 
 4568 * Noteworthy changes in release 1.29 (2001-09-07)
 4569 
 4570 ** The output file does not define const, as this caused problems when used
 4571   with common autoconfiguration schemes.  If you still use ancient compilers
 4572   that lack const, compile with the equivalent of the C compiler option
 4573   "-Dconst=".  Autoconf's AC_C_CONST macro provides one way to do this.
 4574 
 4575 ** Added "-g" and "--graph".
 4576 
 4577 ** The Bison manual is now distributed under the terms of the GNU FDL.
 4578 
 4579 ** The input and the output files has automatically a similar extension.
 4580 
 4581 ** Russian translation added.
 4582 
 4583 ** NLS support updated; should hopefully be less troublesome.
 4584 
 4585 ** Added the old Bison reference card.
 4586 
 4587 ** Added "--locations" and "%locations".
 4588 
 4589 ** Added "-S" and "--skeleton".
 4590 
 4591 ** "%raw", "-r", "--raw" is disabled.
 4592 
 4593 ** Special characters are escaped when output.  This solves the problems
 4594   of the #line lines with path names including backslashes.
 4595 
 4596 ** New directives.
 4597   "%yacc", "%fixed_output_files", "%defines", "%no_parser", "%verbose",
 4598   "%debug", "%source_extension" and "%header_extension".
 4599 
 4600 ** @$
 4601   Automatic location tracking.
 4602 
 4603 
 4604 * Noteworthy changes in release 1.28 (1999-07-06)
 4605 
 4606 ** Should compile better now with K&R compilers.
 4607 
 4608 ** Added NLS.
 4609 
 4610 ** Fixed a problem with escaping the double quote character.
 4611 
 4612 ** There is now a FAQ.
 4613 
 4614 
 4615 * Noteworthy changes in release 1.27
 4616 
 4617 ** The make rule which prevented bison.simple from being created on
 4618   some systems has been fixed.
 4619 
 4620 
 4621 * Noteworthy changes in release 1.26
 4622 
 4623 ** Bison now uses Automake.
 4624 
 4625 ** New mailing lists: <bug-bison@gnu.org> and <help-bison@gnu.org>.
 4626 
 4627 ** Token numbers now start at 257 as previously documented, not 258.
 4628 
 4629 ** Bison honors the TMPDIR environment variable.
 4630 
 4631 ** A couple of buffer overruns have been fixed.
 4632 
 4633 ** Problems when closing files should now be reported.
 4634 
 4635 ** Generated parsers should now work even on operating systems which do
 4636   not provide alloca().
 4637 
 4638 
 4639 * Noteworthy changes in release 1.25 (1995-10-16)
 4640 
 4641 ** Errors in the input grammar are not fatal; Bison keeps reading
 4642 the grammar file, and reports all the errors found in it.
 4643 
 4644 ** Tokens can now be specified as multiple-character strings: for
 4645 example, you could use "<=" for a token which looks like <=, instead
 4646 of choosing a name like LESSEQ.
 4647 
 4648 ** The %token_table declaration says to write a table of tokens (names
 4649 and numbers) into the parser file.  The yylex function can use this
 4650 table to recognize multiple-character string tokens, or for other
 4651 purposes.
 4652 
 4653 ** The %no_lines declaration says not to generate any #line preprocessor
 4654 directives in the parser file.
 4655 
 4656 ** The %raw declaration says to use internal Bison token numbers, not
 4657 Yacc-compatible token numbers, when token names are defined as macros.
 4658 
 4659 ** The --no-parser option produces the parser tables without including
 4660 the parser engine; a project can now use its own parser engine.
 4661 The actions go into a separate file called NAME.act, in the form of
 4662 a switch statement body.
 4663 
 4664 
 4665 * Noteworthy changes in release 1.23
 4666 
 4667 The user can define YYPARSE_PARAM as the name of an argument to be
 4668 passed into yyparse.  The argument should have type void *.  It should
 4669 actually point to an object.  Grammar actions can access the variable
 4670 by casting it to the proper pointer type.
 4671 
 4672 Line numbers in output file corrected.
 4673 
 4674 
 4675 * Noteworthy changes in release 1.22
 4676 
 4677 --help option added.
 4678 
 4679 
 4680 * Noteworthy changes in release 1.20
 4681 
 4682 Output file does not redefine const for C++.
 4683 
 4684 -----
 4685 
 4686 LocalWords:  yacc YYBACKUP glr GCC lalr ArrayIndexOutOfBoundsException nullptr
 4687 LocalWords:  cplusplus liby rpl fprintf mfcalc Wyacc stmt cond expr mk sym lr
 4688 LocalWords:  IELR ielr Lookahead YYERROR nonassoc LALR's api lookaheads yychar
 4689 LocalWords:  destructor lookahead YYRHSLOC YYLLOC Rhs ifndef YYFAIL cpp sr rr
 4690 LocalWords:  preprocessor initializer Wno Wnone Werror FreeBSD prec livelocks
 4691 LocalWords:  Solaris AIX UX RHEL Tru LHS gcc's Wundef YYENABLE NLS YYLTYPE VCG
 4692 LocalWords:  yyerror cpp's Wunused yylval yylloc prepend yyparse yylex yypush
 4693 LocalWords:  Graphviz xml nonterminals midrule destructor's YYSTYPE typedef ly
 4694 LocalWords:  CHR chr printf stdout namespace preprocessing enum pre include's
 4695 LocalWords:  YYRECOVERING nonfree destructors YYABORT YYACCEPT params enums de
 4696 LocalWords:  struct yystype DJGPP lex param Haible NUM alloca YYSTACK NUL goto
 4697 LocalWords:  YYMAXDEPTH Unescaped UCNs YYLTYPE's yyltype typedefs inline Yaccs
 4698 LocalWords:  Heriyanto Reenable dprec Hilfinger Eggert MYEOF Folle Menezes EOF
 4699 LocalWords:  Lackovic define's itemset Groff Gettext malloc NEWS'ed YYDEBUG YY
 4700 LocalWords:  namespaces strerror const autoconfiguration Dconst Autoconf's FDL
 4701 LocalWords:  Automake TMPDIR LESSEQ ylwrap endif yydebug YYTOKEN YYLSP ival hh
 4702 LocalWords:  extern YYTOKENTYPE TOKENTYPE yytokentype tokentype STYPE lval pdf
 4703 LocalWords:  lang yyoutput dvi html ps POSIX lvalp llocp Wother nterm arg init
 4704 LocalWords:  TOK calc yyo fval Wconflicts parsers yystackp yyval yynerrs
 4705 LocalWords:  Théophile Ranquet Santet fno fnone stype associativity Tolmer
 4706 LocalWords:  Wprecedence Rassoul Wempty Paolo Bonzini parser's Michiel loc
 4707 LocalWords:  redeclaration sval fcaret reentrant XSLT xsl Wmaybe yyvsp Tedi
 4708 LocalWords:  pragmas noreturn untyped Rozenman unexpanded Wojciech Polak
 4709 LocalWords:  Alexandre MERCHANTABILITY yytype emplace ptr automove lvalues
 4710 LocalWords:  nonterminal yy args Pragma dereference yyformat rhs docdir bw
 4711 LocalWords:  Redeclarations rpcalc Autoconf YFLAGS Makefiles PROG DECL num
 4712 LocalWords:  Heimbigner AST src ast Makefile srcdir MinGW xxlex XXSTYPE CVE
 4713 LocalWords:  XXLTYPE strictfp IDEs ffixit fdiagnostics parseable fixits
 4714 LocalWords:  Wdeprecated yytext Variadic variadic yyrhs yyphrs RCS README
 4715 LocalWords:  noexcept constexpr ispell american deprecations backend Teoh
 4716 LocalWords:  YYPRINT Mangold Bonzini's Wdangling exVal baz checkable gcc
 4717 LocalWords:  fsanitize Vogelsgesang lis redeclared stdint automata yytname
 4718 LocalWords:  yysymbol yytnamerr yyreport ctx ARGMAX yysyntax stderr LPAREN
 4719 LocalWords:  symrec yypcontext TOKENMAX yyexpected YYEMPTY yypstate YYEOF
 4720 LocalWords:  autocompletion bistromathic submessages Cayuela lexcalc hoc
 4721 LocalWords:  yytoken YYUNDEF YYerror basename Automake's UTF ifdef ffile
 4722 LocalWords:  gotos readline Imbimbo Wcounterexamples Wcex Nonunifying rcex
 4723 LocalWords:  Vais xsltproc YYNOMEM YYLOCATION signedness YYBISON MITRE's
 4724 LocalWords:  libreadline YYMALLOC YYFREE MSVC redefinitions POSIXLY
 4725 
 4726 Local Variables:
 4727 ispell-dictionary: "american"
 4728 mode: outline
 4729 fill-column: 76
 4730 End:
 4731 
 4732 Copyright (C) 1995-2015, 2018-2021 Free Software Foundation, Inc.
 4733 
 4734 This file is part of Bison, the GNU Parser Generator.
 4735 
 4736 Permission is granted to copy, distribute and/or modify this document
 4737 under the terms of the GNU Free Documentation License, Version 1.3 or
 4738 any later version published by the Free Software Foundation; with no
 4739 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
 4740 Texts.  A copy of the license is included in the "GNU Free
 4741 Documentation License" file as part of this distribution.