Minor consistency fixes wrt. piyacc.git commit 6558f0b
[bootstrap_bison.git] / NEWS
1 GNU Bison NEWS
2
3 * Noteworthy changes in release 3.0.5 (2018-05-27) [stable]
4
5 ** Bug fixes
6
7 *** C++: Fix support of 'syntax_error'
8
9   One incorrect 'inline' resulted in linking errors about the constructor of
10   the syntax_error exception.
11
12 *** C++: Fix warnings
13
14   GCC 7.3 (with -O1 or -O2 but not -O0 or -O3) issued null-dereference
15   warnings about yyformat being possibly null.  It also warned about the
16   deprecated implicit definition of copy constructors when there's a
17   user-defined (copy) assignment operator.
18
19 *** Location of errors
20
21   In C++ parsers, out-of-bounds errors can happen when a rule with an empty
22   ride-hand side raises a syntax error.  The behavior of the default parser
23   (yacc.c) in such a condition was undefined.
24
25   Now all the parsers match the behavior of glr.c: @$ is used as the
26   location of the error.  This handles gracefully rules with and without
27   rhs.
28
29 *** Portability fixes in the test suite
30
31   On some platforms, some Java and/or C++ tests were failing.
32
33 * Noteworthy changes in release 3.0.4 (2015-01-23) [stable]
34
35 ** Bug fixes
36
37 *** C++ with Variants (lalr1.cc)
38
39   Fix a compiler warning when no %destructor use $$.
40
41 *** Test suites
42
43   Several portability issues in tests were fixed.
44
45 * Noteworthy changes in release 3.0.3 (2015-01-15) [stable]
46
47 ** Bug fixes
48
49 *** C++ with Variants (lalr1.cc)
50
51   Problems with %destructor and '%define parse.assert' have been fixed.
52
53 *** Named %union support (yacc.c, glr.c)
54
55   Bison 3.0 introduced a regression on named %union such as
56
57     %union foo { int ival; };
58
59   The possibility to use a name was introduced "for Yacc compatibility".
60   It is however not required by POSIX Yacc, and its usefulness is not clear.
61
62 *** %define api.value.type union with %defines (yacc.c, glr.c)
63
64   The C parsers were broken when %defines was used together with "%define
65   api.value.type union".
66
67 *** Redeclarations are reported in proper order
68
69   On
70
71     %token FOO "foo"
72     %printer {} "foo"
73     %printer {} FOO
74
75   bison used to report:
76
77     /tmp/foo.yy:2.10-11: error: %printer redeclaration for FOO
78      %printer {} "foo"
79               ^^
80     /tmp/foo.yy:3.10-11:     previous declaration
81      %printer {} FOO
82               ^^
83
84   Now, the "previous" declaration is always the first one.
85
86
87 ** Documentation
88
89   Bison now installs various files in its docdir (which defaults to
90   '/usr/local/share/doc/bison'), including the three fully blown examples
91   extracted from the documentation:
92
93    - rpcalc
94      Reverse Polish Calculator, a simple introductory example.
95    - mfcalc
96      Multi-function Calc, a calculator with memory and functions and located
97      error messages.
98    - calc++
99      a calculator in C++ using variant support and token constructors.
100
101 * Noteworthy changes in release 3.0.2 (2013-12-05) [stable]
102
103 ** Bug fixes
104
105 *** Generated source files when errors are reported
106
107   When warnings are issued and -Werror is set, bison would still generate
108   the source files (*.c, *.h...).  As a consequence, some runs of "make"
109   could fail the first time, but not the second (as the files were generated
110   anyway).
111
112   This is fixed: bison no longer generates this source files, but, of
113   course, still produces the various reports (*.output, *.xml, etc.).
114
115 *** %empty is used in reports
116
117   Empty right-hand sides are denoted by '%empty' in all the reports (text,
118   dot, XML and formats derived from it).
119
120 *** YYERROR and variants
121
122   When C++ variant support is enabled, an error triggered via YYERROR, but
123   not caught via error recovery, resulted in a double deletion.
124
125 * Noteworthy changes in release 3.0.1 (2013-11-12) [stable]
126
127 ** Bug fixes
128
129 *** Errors in caret diagnostics
130
131   On some platforms, some errors could result in endless diagnostics.
132
133 *** Fixes of the -Werror option
134
135   Options such as "-Werror -Wno-error=foo" were still turning "foo"
136   diagnostics into errors instead of warnings.  This is fixed.
137
138   Actually, for consistency with GCC, "-Wno-error=foo -Werror" now also
139   leaves "foo" diagnostics as warnings.  Similarly, with "-Werror=foo
140   -Wno-error", "foo" diagnostics are now errors.
141
142 *** GLR Predicates
143
144   As demonstrated in the documentation, one can now leave spaces between
145   "%?" and its "{".
146
147 *** Installation
148
149   The yacc.1 man page is no longer installed if --disable-yacc was
150   specified.
151
152 *** Fixes in the test suite
153
154   Bugs and portability issues.
155
156 * Noteworthy changes in release 3.0 (2013-07-25) [stable]
157
158 ** WARNING: Future backward-incompatibilities!
159
160   Like other GNU packages, Bison will start using some of the C99 features
161   for its own code, especially the definition of variables after statements.
162   The generated C parsers still aim at C90.
163
164 ** Backward incompatible changes
165
166 *** Obsolete features
167
168   Support for YYFAIL is removed (deprecated in Bison 2.4.2): use YYERROR.
169
170   Support for yystype and yyltype is removed (deprecated in Bison 1.875):
171   use YYSTYPE and YYLTYPE.
172
173   Support for YYLEX_PARAM and YYPARSE_PARAM is removed (deprecated in Bison
174   1.875): use %lex-param, %parse-param, or %param.
175
176   Missing semicolons at the end of actions are no longer added (as announced
177   in the release 2.5).
178
179 *** Use of YACC='bison -y'
180
181   TL;DR: With Autoconf <= 2.69, pass -Wno-yacc to (AM_)YFLAGS if you use
182   Bison extensions.
183
184   Traditional Yacc generates 'y.tab.c' whatever the name of the input file.
185   Therefore Makefiles written for Yacc expect 'y.tab.c' (and possibly
186   'y.tab.h' and 'y.outout') to be generated from 'foo.y'.
187
188   To this end, for ages, AC_PROG_YACC, Autoconf's macro to look for an
189   implementation of Yacc, was using Bison as 'bison -y'.  While it does
190   ensure compatible output file names, it also enables warnings for
191   incompatibilities with POSIX Yacc.  In other words, 'bison -y' triggers
192   warnings for Bison extensions.
193
194   Autoconf 2.70+ fixes this incompatibility by using YACC='bison -o y.tab.c'
195   (which also generates 'y.tab.h' and 'y.output' when needed).
196   Alternatively, disable Yacc warnings by passing '-Wno-yacc' to your Yacc
197   flags (YFLAGS, or AM_YFLAGS with Automake).
198
199 ** Bug fixes
200
201 *** The epilogue is no longer affected by internal #defines (glr.c)
202
203   The glr.c skeleton uses defines such as #define yylval (yystackp->yyval) in
204   generated code.  These weren't properly undefined before the inclusion of
205   the user epilogue, so functions such as the following were butchered by the
206   preprocessor expansion:
207
208     int yylex (YYSTYPE *yylval);
209
210   This is fixed: yylval, yynerrs, yychar, and yylloc are now valid
211   identifiers for user-provided variables.
212
213 *** stdio.h is no longer needed when locations are enabled (yacc.c)
214
215   Changes in Bison 2.7 introduced a dependency on FILE and fprintf when
216   locations are enabled.  This is fixed.
217
218 *** Warnings about useless %pure-parser/%define api.pure are restored
219
220 ** Diagnostics reported by Bison
221
222   Most of these features were contributed by Théophile Ranquet and Victor
223   Santet.
224
225 *** Carets
226
227   Version 2.7 introduced caret errors, for a prettier output.  These are now
228   activated by default.  The old format can still be used by invoking Bison
229   with -fno-caret (or -fnone).
230
231   Some error messages that reproduced excerpts of the grammar are now using
232   the caret information only.  For instance on:
233
234     %%
235     exp: 'a' | 'a';
236
237   Bison 2.7 reports:
238
239     in.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
240     in.y:2.12-14: warning: rule useless in parser due to conflicts: exp: 'a' [-Wother]
241
242   Now bison reports:
243
244     in.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
245     in.y:2.12-14: warning: rule useless in parser due to conflicts [-Wother]
246      exp: 'a' | 'a';
247                 ^^^
248
249   and "bison -fno-caret" reports:
250
251     in.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
252     in.y:2.12-14: warning: rule useless in parser due to conflicts [-Wother]
253
254 *** Enhancements of the -Werror option
255
256   The -Werror=CATEGORY option is now recognized, and will treat specified
257   warnings as errors. The warnings need not have been explicitly activated
258   using the -W option, this is similar to what GCC 4.7 does.
259
260   For example, given the following command line, Bison will treat both
261   warnings related to POSIX Yacc incompatibilities and S/R conflicts as
262   errors (and only those):
263
264     $ bison -Werror=yacc,error=conflicts-sr input.y
265
266   If no categories are specified, -Werror will make all active warnings into
267   errors. For example, the following line does the same the previous example:
268
269     $ bison -Werror -Wnone -Wyacc -Wconflicts-sr input.y
270
271   (By default -Wconflicts-sr,conflicts-rr,deprecated,other is enabled.)
272
273   Note that the categories in this -Werror option may not be prefixed with
274   "no-". However, -Wno-error[=CATEGORY] is valid.
275
276   Note that -y enables -Werror=yacc. Therefore it is now possible to require
277   Yacc-like behavior (e.g., always generate y.tab.c), but to report
278   incompatibilities as warnings: "-y -Wno-error=yacc".
279
280 *** The display of warnings is now richer
281
282   The option that controls a given warning is now displayed:
283
284     foo.y:4.6: warning: type clash on default action: <foo> != <bar> [-Wother]
285
286   In the case of warnings treated as errors, the prefix is changed from
287   "warning: " to "error: ", and the suffix is displayed, in a manner similar
288   to GCC, as [-Werror=CATEGORY].
289
290   For instance, where the previous version of Bison would report (and exit
291   with failure):
292
293     bison: warnings being treated as errors
294     input.y:1.1: warning: stray ',' treated as white space
295
296   it now reports:
297
298     input.y:1.1: error: stray ',' treated as white space [-Werror=other]
299
300 *** Deprecated constructs
301
302   The new 'deprecated' warning category flags obsolete constructs whose
303   support will be discontinued.  It is enabled by default.  These warnings
304   used to be reported as 'other' warnings.
305
306 *** Useless semantic types
307
308   Bison now warns about useless (uninhabited) semantic types.  Since
309   semantic types are not declared to Bison (they are defined in the opaque
310   %union structure), it is %printer/%destructor directives about useless
311   types that trigger the warning:
312
313     %token <type1> term
314     %type  <type2> nterm
315     %printer    {} <type1> <type3>
316     %destructor {} <type2> <type4>
317     %%
318     nterm: term { $$ = $1; };
319
320     3.28-34: warning: type <type3> is used, but is not associated to any symbol
321     4.28-34: warning: type <type4> is used, but is not associated to any symbol
322
323 *** Undefined but unused symbols
324
325   Bison used to raise an error for undefined symbols that are not used in
326   the grammar.  This is now only a warning.
327
328     %printer    {} symbol1
329     %destructor {} symbol2
330     %type <type>   symbol3
331     %%
332     exp: "a";
333
334 *** Useless destructors or printers
335
336   Bison now warns about useless destructors or printers.  In the following
337   example, the printer for <type1>, and the destructor for <type2> are
338   useless: all symbols of <type1> (token1) already have a printer, and all
339   symbols of type <type2> (token2) already have a destructor.
340
341     %token <type1> token1
342            <type2> token2
343            <type3> token3
344            <type4> token4
345     %printer    {} token1 <type1> <type3>
346     %destructor {} token2 <type2> <type4>
347
348 *** Conflicts
349
350   The warnings and error messages about shift/reduce and reduce/reduce
351   conflicts have been normalized.  For instance on the following foo.y file:
352
353     %glr-parser
354     %%
355     exp: exp '+' exp | '0' | '0';
356
357   compare the previous version of bison:
358
359     $ bison foo.y
360     foo.y: conflicts: 1 shift/reduce, 2 reduce/reduce
361     $ bison -Werror foo.y
362     bison: warnings being treated as errors
363     foo.y: conflicts: 1 shift/reduce, 2 reduce/reduce
364
365   with the new behavior:
366
367     $ bison foo.y
368     foo.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
369     foo.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr]
370     $ bison -Werror foo.y
371     foo.y: error: 1 shift/reduce conflict [-Werror=conflicts-sr]
372     foo.y: error: 2 reduce/reduce conflicts [-Werror=conflicts-rr]
373
374   When %expect or %expect-rr is used, such as with bar.y:
375
376     %expect 0
377     %glr-parser
378     %%
379     exp: exp '+' exp | '0' | '0';
380
381   Former behavior:
382
383     $ bison bar.y
384     bar.y: conflicts: 1 shift/reduce, 2 reduce/reduce
385     bar.y: expected 0 shift/reduce conflicts
386     bar.y: expected 0 reduce/reduce conflicts
387
388   New one:
389
390     $ bison bar.y
391     bar.y: error: shift/reduce conflicts: 1 found, 0 expected
392     bar.y: error: reduce/reduce conflicts: 2 found, 0 expected
393
394 ** Incompatibilities with POSIX Yacc
395
396   The 'yacc' category is no longer part of '-Wall', enable it explicitly
397   with '-Wyacc'.
398
399 ** Additional yylex/yyparse arguments
400
401   The new directive %param declares additional arguments to both yylex and
402   yyparse.  The %lex-param, %parse-param, and %param directives support one
403   or more arguments.  Instead of
404
405     %lex-param   {arg1_type *arg1}
406     %lex-param   {arg2_type *arg2}
407     %parse-param {arg1_type *arg1}
408     %parse-param {arg2_type *arg2}
409
410   one may now declare
411
412     %param {arg1_type *arg1} {arg2_type *arg2}
413
414 ** Types of values for %define variables
415
416   Bison used to make no difference between '%define foo bar' and '%define
417   foo "bar"'.  The former is now called a 'keyword value', and the latter a
418   'string value'.  A third kind was added: 'code values', such as '%define
419   foo {bar}'.
420
421   Keyword variables are used for fixed value sets, e.g.,
422
423     %define lr.type lalr
424
425   Code variables are used for value in the target language, e.g.,
426
427     %define api.value.type {struct semantic_type}
428
429   String variables are used remaining cases, e.g. file names.
430
431 ** Variable api.token.prefix
432
433   The variable api.token.prefix changes the way tokens are identified in
434   the generated files.  This is especially useful to avoid collisions
435   with identifiers in the target language.  For instance
436
437     %token FILE for ERROR
438     %define api.token.prefix {TOK_}
439     %%
440     start: FILE for ERROR;
441
442   will generate the definition of the symbols TOK_FILE, TOK_for, and
443   TOK_ERROR in the generated sources.  In particular, the scanner must
444   use these prefixed token names, although the grammar itself still
445   uses the short names (as in the sample rule given above).
446
447 ** Variable api.value.type
448
449   This new %define variable supersedes the #define macro YYSTYPE.  The use
450   of YYSTYPE is discouraged.  In particular, #defining YYSTYPE *and* either
451   using %union or %defining api.value.type results in undefined behavior.
452
453   Either define api.value.type, or use "%union":
454
455     %union
456     {
457       int ival;
458       char *sval;
459     }
460     %token <ival> INT "integer"
461     %token <sval> STRING "string"
462     %printer { fprintf (yyo, "%d", $$); } <ival>
463     %destructor { free ($$); } <sval>
464
465     /* In yylex().  */
466     yylval.ival = 42; return INT;
467     yylval.sval = "42"; return STRING;
468
469   The %define variable api.value.type supports both keyword and code values.
470
471   The keyword value 'union' means that the user provides genuine types, not
472   union member names such as "ival" and "sval" above (WARNING: will fail if
473   -y/--yacc/%yacc is enabled).
474
475     %define api.value.type union
476     %token <int> INT "integer"
477     %token <char *> STRING "string"
478     %printer { fprintf (yyo, "%d", $$); } <int>
479     %destructor { free ($$); } <char *>
480
481     /* In yylex().  */
482     yylval.INT = 42; return INT;
483     yylval.STRING = "42"; return STRING;
484
485   The keyword value variant is somewhat equivalent, but for C++ special
486   provision is made to allow classes to be used (more about this below).
487
488     %define api.value.type variant
489     %token <int> INT "integer"
490     %token <std::string> STRING "string"
491
492   Code values (in braces) denote user defined types.  This is where YYSTYPE
493   used to be used.
494
495     %code requires
496     {
497       struct my_value
498       {
499         enum
500         {
501           is_int, is_string
502         } kind;
503         union
504         {
505           int ival;
506           char *sval;
507         } u;
508       };
509     }
510     %define api.value.type {struct my_value}
511     %token <u.ival> INT "integer"
512     %token <u.sval> STRING "string"
513     %printer { fprintf (yyo, "%d", $$); } <u.ival>
514     %destructor { free ($$); } <u.sval>
515
516     /* In yylex().  */
517     yylval.u.ival = 42; return INT;
518     yylval.u.sval = "42"; return STRING;
519
520 ** Variable parse.error
521
522   This variable controls the verbosity of error messages.  The use of the
523   %error-verbose directive is deprecated in favor of "%define parse.error
524   verbose".
525
526 ** Renamed %define variables
527
528   The following variables have been renamed for consistency.  Backward
529   compatibility is ensured, but upgrading is recommended.
530
531     lr.default-reductions      -> lr.default-reduction
532     lr.keep-unreachable-states -> lr.keep-unreachable-state
533     namespace                  -> api.namespace
534     stype                      -> api.value.type
535
536 ** Semantic predicates
537
538   Contributed by Paul Hilfinger.
539
540   The new, experimental, semantic-predicate feature allows actions of the
541   form "%?{ BOOLEAN-EXPRESSION }", which cause syntax errors (as for
542   YYERROR) if the expression evaluates to 0, and are evaluated immediately
543   in GLR parsers, rather than being deferred.  The result is that they allow
544   the programmer to prune possible parses based on the values of run-time
545   expressions.
546
547 ** The directive %expect-rr is now an error in non GLR mode
548
549   It used to be an error only if used in non GLR mode, _and_ if there are
550   reduce/reduce conflicts.
551
552 ** Tokens are numbered in their order of appearance
553
554   Contributed by Valentin Tolmer.
555
556   With '%token A B', A had a number less than the one of B.  However,
557   precedence declarations used to generate a reversed order.  This is now
558   fixed, and introducing tokens with any of %token, %left, %right,
559   %precedence, or %nonassoc yields the same result.
560
561   When mixing declarations of tokens with a litteral character (e.g., 'a')
562   or with an identifier (e.g., B) in a precedence declaration, Bison
563   numbered the litteral characters first.  For example
564
565     %right A B 'c' 'd'
566
567   would lead to the tokens declared in this order: 'c' 'd' A B.  Again, the
568   input order is now preserved.
569
570   These changes were made so that one can remove useless precedence and
571   associativity declarations (i.e., map %nonassoc, %left or %right to
572   %precedence, or to %token) and get exactly the same output.
573
574 ** Useless precedence and associativity
575
576   Contributed by Valentin Tolmer.
577
578   When developing and maintaining a grammar, useless associativity and
579   precedence directives are common.  They can be a nuisance: new ambiguities
580   arising are sometimes masked because their conflicts are resolved due to
581   the extra precedence or associativity information.  Furthermore, it can
582   hinder the comprehension of a new grammar: one will wonder about the role
583   of a precedence, where in fact it is useless.  The following changes aim
584   at detecting and reporting these extra directives.
585
586 *** Precedence warning category
587
588   A new category of warning, -Wprecedence, was introduced. It flags the
589   useless precedence and associativity directives.
590
591 *** Useless associativity
592
593   Bison now warns about symbols with a declared associativity that is never
594   used to resolve conflicts.  In that case, using %precedence is sufficient;
595   the parsing tables will remain unchanged.  Solving these warnings may raise
596   useless precedence warnings, as the symbols no longer have associativity.
597   For example:
598
599     %left '+'
600     %left '*'
601     %%
602     exp:
603       "number"
604     | exp '+' "number"
605     | exp '*' exp
606     ;
607
608   will produce a
609
610     warning: useless associativity for '+', use %precedence [-Wprecedence]
611      %left '+'
612            ^^^
613
614 *** Useless precedence
615
616   Bison now warns about symbols with a declared precedence and no declared
617   associativity (i.e., declared with %precedence), and whose precedence is
618   never used.  In that case, the symbol can be safely declared with %token
619   instead, without modifying the parsing tables.  For example:
620
621     %precedence '='
622     %%
623     exp: "var" '=' "number";
624
625   will produce a
626
627     warning: useless precedence for '=' [-Wprecedence]
628      %precedence '='
629                  ^^^
630
631 *** Useless precedence and associativity
632
633   In case of both useless precedence and associativity, the issue is flagged
634   as follows:
635
636     %nonassoc '='
637     %%
638     exp: "var" '=' "number";
639
640   The warning is:
641
642     warning: useless precedence and associativity for '=' [-Wprecedence]
643      %nonassoc '='
644                ^^^
645
646 ** Empty rules
647
648   With help from Joel E. Denny and Gabriel Rassoul.
649
650   Empty rules (i.e., with an empty right-hand side) can now be explicitly
651   marked by the new %empty directive.  Using %empty on a non-empty rule is
652   an error.  The new -Wempty-rule warning reports empty rules without
653   %empty.  On the following grammar:
654
655     %%
656     s: a b c;
657     a: ;
658     b: %empty;
659     c: 'a' %empty;
660
661   bison reports:
662
663     3.4-5: warning: empty rule without %empty [-Wempty-rule]
664      a: {}
665         ^^
666     5.8-13: error: %empty on non-empty rule
667      c: 'a' %empty {};
668             ^^^^^^
669
670 ** Java skeleton improvements
671
672   The constants for token names were moved to the Lexer interface.  Also, it
673   is possible to add code to the parser's constructors using "%code init"
674   and "%define init_throws".
675   Contributed by Paolo Bonzini.
676
677   The Java skeleton now supports push parsing.
678   Contributed by Dennis Heimbigner.
679
680 ** C++ skeletons improvements
681
682 *** The parser header is no longer mandatory (lalr1.cc, glr.cc)
683
684   Using %defines is now optional.  Without it, the needed support classes
685   are defined in the generated parser, instead of additional files (such as
686   location.hh, position.hh and stack.hh).
687
688 *** Locations are no longer mandatory (lalr1.cc, glr.cc)
689
690   Both lalr1.cc and glr.cc no longer require %location.
691
692 *** syntax_error exception (lalr1.cc)
693
694   The C++ parser features a syntax_error exception, which can be
695   thrown from the scanner or from user rules to raise syntax errors.
696   This facilitates reporting errors caught in sub-functions (e.g.,
697   rejecting too large integral literals from a conversion function
698   used by the scanner, or rejecting invalid combinations from a
699   factory invoked by the user actions).
700
701 *** %define api.value.type variant
702
703   This is based on a submission from Michiel De Wilde.  With help
704   from Théophile Ranquet.
705
706   In this mode, complex C++ objects can be used as semantic values.  For
707   instance:
708
709     %token <::std::string> TEXT;
710     %token <int> NUMBER;
711     %token SEMICOLON ";"
712     %type <::std::string> item;
713     %type <::std::list<std::string>> list;
714     %%
715     result:
716       list  { std::cout << $1 << std::endl; }
717     ;
718
719     list:
720       %empty        { /* Generates an empty string list. */ }
721     | list item ";" { std::swap ($$, $1); $$.push_back ($2); }
722     ;
723
724     item:
725       TEXT    { std::swap ($$, $1); }
726     | NUMBER  { $$ = string_cast ($1); }
727     ;
728
729 *** %define api.token.constructor
730
731   When variants are enabled, Bison can generate functions to build the
732   tokens.  This guarantees that the token type (e.g., NUMBER) is consistent
733   with the semantic value (e.g., int):
734
735     parser::symbol_type yylex ()
736     {
737       parser::location_type loc = ...;
738       ...
739       return parser::make_TEXT ("Hello, world!", loc);
740       ...
741       return parser::make_NUMBER (42, loc);
742       ...
743       return parser::make_SEMICOLON (loc);
744       ...
745     }
746
747 *** C++ locations
748
749   There are operator- and operator-= for 'location'.  Negative line/column
750   increments can no longer underflow the resulting value.
751
752 * Noteworthy changes in release 2.7.1 (2013-04-15) [stable]
753
754 ** Bug fixes
755
756 *** Fix compiler attribute portability (yacc.c)
757
758   With locations enabled, __attribute__ was used unprotected.
759
760 *** Fix some compiler warnings (lalr1.cc)
761
762 * Noteworthy changes in release 2.7 (2012-12-12) [stable]
763
764 ** Bug fixes
765
766   Warnings about uninitialized yylloc in yyparse have been fixed.
767
768   Restored C90 compliance (yet no report was ever made).
769
770 ** Diagnostics are improved
771
772   Contributed by Théophile Ranquet.
773
774 *** Changes in the format of error messages
775
776   This used to be the format of many error reports:
777
778     input.y:2.7-12: %type redeclaration for exp
779     input.y:1.7-12: previous declaration
780
781   It is now:
782
783     input.y:2.7-12: error: %type redeclaration for exp
784     input.y:1.7-12:     previous declaration
785
786 *** New format for error reports: carets
787
788   Caret errors have been added to Bison:
789
790     input.y:2.7-12: error: %type redeclaration for exp
791      %type <sval> exp
792            ^^^^^^
793     input.y:1.7-12:     previous declaration
794      %type <ival> exp
795            ^^^^^^
796
797   or
798
799     input.y:3.20-23: error: ambiguous reference: '$exp'
800      exp: exp '+' exp { $exp = $1 + $3; };
801                         ^^^^
802     input.y:3.1-3:       refers to: $exp at $$
803      exp: exp '+' exp { $exp = $1 + $3; };
804      ^^^
805     input.y:3.6-8:       refers to: $exp at $1
806      exp: exp '+' exp { $exp = $1 + $3; };
807           ^^^
808     input.y:3.14-16:     refers to: $exp at $3
809      exp: exp '+' exp { $exp = $1 + $3; };
810                   ^^^
811
812   The default behavior for now is still not to display these unless
813   explicitly asked with -fcaret (or -fall). However, in a later release, it
814   will be made the default behavior (but may still be deactivated with
815   -fno-caret).
816
817 ** New value for %define variable: api.pure full
818
819   The %define variable api.pure requests a pure (reentrant) parser. However,
820   for historical reasons, using it in a location-tracking Yacc parser
821   resulted in a yyerror function that did not take a location as a
822   parameter. With this new value, the user may request a better pure parser,
823   where yyerror does take a location as a parameter (in location-tracking
824   parsers).
825
826   The use of "%define api.pure true" is deprecated in favor of this new
827   "%define api.pure full".
828
829 ** New %define variable: api.location.type (glr.cc, lalr1.cc, lalr1.java)
830
831   The %define variable api.location.type defines the name of the type to use
832   for locations.  When defined, Bison no longer generates the position.hh
833   and location.hh files, nor does the parser will include them: the user is
834   then responsible to define her type.
835
836   This can be used in programs with several parsers to factor their location
837   and position files: let one of them generate them, and the others just use
838   them.
839
840   This feature was actually introduced, but not documented, in Bison 2.5,
841   under the name "location_type" (which is maintained for backward
842   compatibility).
843
844   For consistency, lalr1.java's %define variables location_type and
845   position_type are deprecated in favor of api.location.type and
846   api.position.type.
847
848 ** Exception safety (lalr1.cc)
849
850   The parse function now catches exceptions, uses the %destructors to
851   release memory (the lookahead symbol and the symbols pushed on the stack)
852   before re-throwing the exception.
853
854   This feature is somewhat experimental.  User feedback would be
855   appreciated.
856
857 ** Graph improvements in DOT and XSLT
858
859   Contributed by Théophile Ranquet.
860
861   The graphical presentation of the states is more readable: their shape is
862   now rectangular, the state number is clearly displayed, and the items are
863   numbered and left-justified.
864
865   The reductions are now explicitly represented as transitions to other
866   diamond shaped nodes.
867
868   These changes are present in both --graph output and xml2dot.xsl XSLT
869   processing, with minor (documented) differences.
870
871 ** %language is no longer an experimental feature.
872
873   The introduction of this feature, in 2.4, was four years ago. The
874   --language option and the %language directive are no longer experimental.
875
876 ** Documentation
877
878   The sections about shift/reduce and reduce/reduce conflicts resolution
879   have been fixed and extended.
880
881   Although introduced more than four years ago, XML and Graphviz reports
882   were not properly documented.
883
884   The translation of mid-rule actions is now described.
885
886 * Noteworthy changes in release 2.6.5 (2012-11-07) [stable]
887
888   We consider compiler warnings about Bison generated parsers to be bugs.
889   Rather than working around them in your own project, please consider
890   reporting them to us.
891
892 ** Bug fixes
893
894   Warnings about uninitialized yylval and/or yylloc for push parsers with a
895   pure interface have been fixed for GCC 4.0 up to 4.8, and Clang 2.9 to
896   3.2.
897
898   Other issues in the test suite have been addressed.
899
900   Null characters are correctly displayed in error messages.
901
902   When possible, yylloc is correctly initialized before calling yylex.  It
903   is no longer necessary to initialize it in the %initial-action.
904
905 * Noteworthy changes in release 2.6.4 (2012-10-23) [stable]
906
907   Bison 2.6.3's --version was incorrect.  This release fixes this issue.
908
909 * Noteworthy changes in release 2.6.3 (2012-10-22) [stable]
910
911 ** Bug fixes
912
913   Bugs and portability issues in the test suite have been fixed.
914
915   Some errors in translations have been addressed, and --help now directs
916   users to the appropriate place to report them.
917
918   Stray Info files shipped by accident are removed.
919
920   Incorrect definitions of YY_, issued by yacc.c when no parser header is
921   generated, are removed.
922
923   All the generated headers are self-contained.
924
925 ** Header guards (yacc.c, glr.c, glr.cc)
926
927   In order to avoid collisions, the header guards are now
928   YY_<PREFIX>_<FILE>_INCLUDED, instead of merely <PREFIX>_<FILE>.
929   For instance the header generated from
930
931     %define api.prefix "calc"
932     %defines "lib/parse.h"
933
934   will use YY_CALC_LIB_PARSE_H_INCLUDED as guard.
935
936 ** Fix compiler warnings in the generated parser (yacc.c, glr.c)
937
938   The compilation of pure parsers (%define api.pure) can trigger GCC
939   warnings such as:
940
941     input.c: In function 'yyparse':
942     input.c:1503:12: warning: 'yylval' may be used uninitialized in this
943                               function [-Wmaybe-uninitialized]
944        *++yyvsp = yylval;
945                 ^
946
947   This is now fixed; pragmas to avoid these warnings are no longer needed.
948
949   Warnings from clang ("equality comparison with extraneous parentheses" and
950   "function declared 'noreturn' should not return") have also been
951   addressed.
952
953 * Noteworthy changes in release 2.6.2 (2012-08-03) [stable]
954
955 ** Bug fixes
956
957   Buffer overruns, complaints from Flex, and portability issues in the test
958   suite have been fixed.
959
960 ** Spaces in %lex- and %parse-param (lalr1.cc, glr.cc)
961
962   Trailing end-of-lines in %parse-param or %lex-param would result in
963   invalid C++.  This is fixed.
964
965 ** Spurious spaces and end-of-lines
966
967   The generated files no longer end (nor start) with empty lines.
968
969 * Noteworthy changes in release 2.6.1 (2012-07-30) [stable]
970
971  Bison no longer executes user-specified M4 code when processing a grammar.
972
973 ** Future Changes
974
975   In addition to the removal of the features announced in Bison 2.6, the
976   next major release will remove the "Temporary hack for adding a semicolon
977   to the user action", as announced in the release 2.5.  Instead of:
978
979     exp: exp "+" exp { $$ = $1 + $3 };
980
981   write:
982
983     exp: exp "+" exp { $$ = $1 + $3; };
984
985 ** Bug fixes
986
987 *** Type names are now properly escaped.
988
989 *** glr.cc: set_debug_level and debug_level work as expected.
990
991 *** Stray @ or $ in actions
992
993   While Bison used to warn about stray $ or @ in action rules, it did not
994   for other actions such as printers, destructors, or initial actions.  It
995   now does.
996
997 ** Type names in actions
998
999   For consistency with rule actions, it is now possible to qualify $$ by a
1000   type-name in destructors, printers, and initial actions.  For instance:
1001
1002     %printer { fprintf (yyo, "(%d, %f)", $<ival>$, $<fval>$); } <*> <>;
1003
1004   will display two values for each typed and untyped symbol (provided
1005   that YYSTYPE has both "ival" and "fval" fields).
1006
1007 * Noteworthy changes in release 2.6 (2012-07-19) [stable]
1008
1009 ** Future changes
1010
1011   The next major release of Bison will drop support for the following
1012   deprecated features.  Please report disagreements to bug-bison@gnu.org.
1013
1014 *** K&R C parsers
1015
1016   Support for generating parsers in K&R C will be removed.  Parsers
1017   generated for C support ISO C90, and are tested with ISO C99 and ISO C11
1018   compilers.
1019
1020 *** Features deprecated since Bison 1.875
1021
1022   The definitions of yystype and yyltype will be removed; use YYSTYPE and
1023   YYLTYPE.
1024
1025   YYPARSE_PARAM and YYLEX_PARAM, deprecated in favor of %parse-param and
1026   %lex-param, will no longer be supported.
1027
1028   Support for the preprocessor symbol YYERROR_VERBOSE will be removed, use
1029   %error-verbose.
1030
1031 *** The generated header will be included (yacc.c)
1032
1033   Instead of duplicating the content of the generated header (definition of
1034   YYSTYPE, yyparse declaration etc.), the generated parser will include it,
1035   as is already the case for GLR or C++ parsers.  This change is deferred
1036   because existing versions of ylwrap (e.g., Automake 1.12.1) do not support
1037   it.
1038
1039 ** Generated Parser Headers
1040
1041 *** Guards (yacc.c, glr.c, glr.cc)
1042
1043   The generated headers are now guarded, as is already the case for C++
1044   parsers (lalr1.cc).  For instance, with --defines=foo.h:
1045
1046     #ifndef YY_FOO_H
1047     # define YY_FOO_H
1048     ...
1049     #endif /* !YY_FOO_H  */
1050
1051 *** New declarations (yacc.c, glr.c)
1052
1053   The generated header now declares yydebug and yyparse.  Both honor
1054   --name-prefix=bar_, and yield
1055
1056     int bar_parse (void);
1057
1058   rather than
1059
1060     #define yyparse bar_parse
1061     int yyparse (void);
1062
1063   in order to facilitate the inclusion of several parser headers inside a
1064   single compilation unit.
1065
1066 *** Exported symbols in C++
1067
1068   The symbols YYTOKEN_TABLE and YYERROR_VERBOSE, which were defined in the
1069   header, are removed, as they prevent the possibility of including several
1070   generated headers from a single compilation unit.
1071
1072 *** YYLSP_NEEDED
1073
1074   For the same reasons, the undocumented and unused macro YYLSP_NEEDED is no
1075   longer defined.
1076
1077 ** New %define variable: api.prefix
1078
1079   Now that the generated headers are more complete and properly protected
1080   against multiple inclusions, constant names, such as YYSTYPE are a
1081   problem.  While yyparse and others are properly renamed by %name-prefix,
1082   YYSTYPE, YYDEBUG and others have never been affected by it.  Because it
1083   would introduce backward compatibility issues in projects not expecting
1084   YYSTYPE to be renamed, instead of changing the behavior of %name-prefix,
1085   it is deprecated in favor of a new %define variable: api.prefix.
1086
1087   The following examples compares both:
1088
1089     %name-prefix "bar_"               | %define api.prefix "bar_"
1090     %token <ival> FOO                   %token <ival> FOO
1091     %union { int ival; }                %union { int ival; }
1092     %%                                  %%
1093     exp: 'a';                           exp: 'a';
1094
1095   bison generates:
1096
1097     #ifndef BAR_FOO_H                   #ifndef BAR_FOO_H
1098     # define BAR_FOO_H                  # define BAR_FOO_H
1099
1100     /* Enabling traces.  */             /* Enabling traces.  */
1101     # ifndef YYDEBUG                  | # ifndef BAR_DEBUG
1102                                       > #  if defined YYDEBUG
1103                                       > #   if YYDEBUG
1104                                       > #    define BAR_DEBUG 1
1105                                       > #   else
1106                                       > #    define BAR_DEBUG 0
1107                                       > #   endif
1108                                       > #  else
1109     #  define YYDEBUG 0               | #   define BAR_DEBUG 0
1110                                       > #  endif
1111     # endif                           | # endif
1112
1113     # if YYDEBUG                      | # if BAR_DEBUG
1114     extern int bar_debug;               extern int bar_debug;
1115     # endif                             # endif
1116
1117     /* Tokens.  */                      /* Tokens.  */
1118     # ifndef YYTOKENTYPE              | # ifndef BAR_TOKENTYPE
1119     #  define YYTOKENTYPE             | #  define BAR_TOKENTYPE
1120        enum yytokentype {             |    enum bar_tokentype {
1121          FOO = 258                           FOO = 258
1122        };                                  };
1123     # endif                             # endif
1124
1125     #if ! defined YYSTYPE \           | #if ! defined BAR_STYPE \
1126      && ! defined YYSTYPE_IS_DECLARED |  && ! defined BAR_STYPE_IS_DECLARED
1127     typedef union YYSTYPE             | typedef union BAR_STYPE
1128     {                                   {
1129      int ival;                           int ival;
1130     } YYSTYPE;                        | } BAR_STYPE;
1131     # define YYSTYPE_IS_DECLARED 1    | # define BAR_STYPE_IS_DECLARED 1
1132     #endif                              #endif
1133
1134     extern YYSTYPE bar_lval;          | extern BAR_STYPE bar_lval;
1135
1136     int bar_parse (void);               int bar_parse (void);
1137
1138     #endif /* !BAR_FOO_H  */            #endif /* !BAR_FOO_H  */
1139
1140 * Noteworthy changes in release 2.5.1 (2012-06-05) [stable]
1141
1142 ** Future changes:
1143
1144   The next major release will drop support for generating parsers in K&R C.
1145
1146 ** yacc.c: YYBACKUP works as expected.
1147
1148 ** glr.c improvements:
1149
1150 *** Location support is eliminated when not requested:
1151
1152   GLR parsers used to include location-related code even when locations were
1153   not requested, and therefore not even usable.
1154
1155 *** __attribute__ is preserved:
1156
1157   __attribute__ is no longer disabled when __STRICT_ANSI__ is defined (i.e.,
1158   when -std is passed to GCC).
1159
1160 ** lalr1.java: several fixes:
1161
1162   The Java parser no longer throws ArrayIndexOutOfBoundsException if the
1163   first token leads to a syntax error.  Some minor clean ups.
1164
1165 ** Changes for C++:
1166
1167 *** C++11 compatibility:
1168
1169   C and C++ parsers use "nullptr" instead of "0" when __cplusplus is 201103L
1170   or higher.
1171
1172 *** Header guards
1173
1174   The header files such as "parser.hh", "location.hh", etc. used a constant
1175   name for preprocessor guards, for instance:
1176
1177     #ifndef BISON_LOCATION_HH
1178     # define BISON_LOCATION_HH
1179     ...
1180     #endif // !BISON_LOCATION_HH
1181
1182   The inclusion guard is now computed from "PREFIX/FILE-NAME", where lower
1183   case characters are converted to upper case, and series of
1184   non-alphanumerical characters are converted to an underscore.
1185
1186   With "bison -o lang++/parser.cc", "location.hh" would now include:
1187
1188     #ifndef YY_LANG_LOCATION_HH
1189     # define YY_LANG_LOCATION_HH
1190     ...
1191     #endif // !YY_LANG_LOCATION_HH
1192
1193 *** C++ locations:
1194
1195   The position and location constructors (and their initialize methods)
1196   accept new arguments for line and column.  Several issues in the
1197   documentation were fixed.
1198
1199 ** liby is no longer asking for "rpl_fprintf" on some platforms.
1200
1201 ** Changes in the manual:
1202
1203 *** %printer is documented
1204
1205   The "%printer" directive, supported since at least Bison 1.50, is finally
1206   documented.  The "mfcalc" example is extended to demonstrate it.
1207
1208   For consistency with the C skeletons, the C++ parsers now also support
1209   "yyoutput" (as an alias to "debug_stream ()").
1210
1211 *** Several improvements have been made:
1212
1213   The layout for grammar excerpts was changed to a more compact scheme.
1214   Named references are motivated.  The description of the automaton
1215   description file (*.output) is updated to the current format.  Incorrect
1216   index entries were fixed.  Some other errors were fixed.
1217
1218 ** Building bison:
1219
1220 *** Conflicting prototypes with recent/modified Flex.
1221
1222   Fixed build problems with the current, unreleased, version of Flex, and
1223   some modified versions of 2.5.35, which have modified function prototypes.
1224
1225 *** Warnings during the build procedure have been eliminated.
1226
1227 *** Several portability problems in the test suite have been fixed:
1228
1229   This includes warnings with some compilers, unexpected behavior of tools
1230   such as diff, warning messages from the test suite itself, etc.
1231
1232 *** The install-pdf target works properly:
1233
1234   Running "make install-pdf" (or -dvi, -html, -info, and -ps) no longer
1235   halts in the middle of its course.
1236
1237 * Changes in version 2.5 (2011-05-14):
1238
1239 ** Grammar symbol names can now contain non-initial dashes:
1240
1241   Consistently with directives (such as %error-verbose) and with
1242   %define variables (e.g. push-pull), grammar symbol names may contain
1243   dashes in any position except the beginning.  This is a GNU
1244   extension over POSIX Yacc.  Thus, use of this extension is reported
1245   by -Wyacc and rejected in Yacc mode (--yacc).
1246
1247 ** Named references:
1248
1249   Historically, Yacc and Bison have supported positional references
1250   ($n, $$) to allow access to symbol values from inside of semantic
1251   actions code.
1252
1253   Starting from this version, Bison can also accept named references.
1254   When no ambiguity is possible, original symbol names may be used
1255   as named references:
1256
1257     if_stmt : "if" cond_expr "then" then_stmt ';'
1258     { $if_stmt = mk_if_stmt($cond_expr, $then_stmt); }
1259
1260   In the more common case, explicit names may be declared:
1261
1262     stmt[res] : "if" expr[cond] "then" stmt[then] "else" stmt[else] ';'
1263     { $res = mk_if_stmt($cond, $then, $else); }
1264
1265   Location information is also accessible using @name syntax.  When
1266   accessing symbol names containing dots or dashes, explicit bracketing
1267   ($[sym.1]) must be used.
1268
1269   These features are experimental in this version.  More user feedback
1270   will help to stabilize them.
1271   Contributed by Alex Rozenman.
1272
1273 ** IELR(1) and canonical LR(1):
1274
1275   IELR(1) is a minimal LR(1) parser table generation algorithm.  That
1276   is, given any context-free grammar, IELR(1) generates parser tables
1277   with the full language-recognition power of canonical LR(1) but with
1278   nearly the same number of parser states as LALR(1).  This reduction
1279   in parser states is often an order of magnitude.  More importantly,
1280   because canonical LR(1)'s extra parser states may contain duplicate
1281   conflicts in the case of non-LR(1) grammars, the number of conflicts
1282   for IELR(1) is often an order of magnitude less as well.  This can
1283   significantly reduce the complexity of developing of a grammar.
1284
1285   Bison can now generate IELR(1) and canonical LR(1) parser tables in
1286   place of its traditional LALR(1) parser tables, which remain the
1287   default.  You can specify the type of parser tables in the grammar
1288   file with these directives:
1289
1290     %define lr.type lalr
1291     %define lr.type ielr
1292     %define lr.type canonical-lr
1293
1294   The default-reduction optimization in the parser tables can also be
1295   adjusted using "%define lr.default-reductions".  For details on both
1296   of these features, see the new section "Tuning LR" in the Bison
1297   manual.
1298
1299   These features are experimental.  More user feedback will help to
1300   stabilize them.
1301
1302 ** LAC (Lookahead Correction) for syntax error handling
1303
1304   Contributed by Joel E. Denny.
1305
1306   Canonical LR, IELR, and LALR can suffer from a couple of problems
1307   upon encountering a syntax error.  First, the parser might perform
1308   additional parser stack reductions before discovering the syntax
1309   error.  Such reductions can perform user semantic actions that are
1310   unexpected because they are based on an invalid token, and they
1311   cause error recovery to begin in a different syntactic context than
1312   the one in which the invalid token was encountered.  Second, when
1313   verbose error messages are enabled (with %error-verbose or the
1314   obsolete "#define YYERROR_VERBOSE"), the expected token list in the
1315   syntax error message can both contain invalid tokens and omit valid
1316   tokens.
1317
1318   The culprits for the above problems are %nonassoc, default
1319   reductions in inconsistent states, and parser state merging.  Thus,
1320   IELR and LALR suffer the most.  Canonical LR can suffer only if
1321   %nonassoc is used or if default reductions are enabled for
1322   inconsistent states.
1323
1324   LAC is a new mechanism within the parsing algorithm that solves
1325   these problems for canonical LR, IELR, and LALR without sacrificing
1326   %nonassoc, default reductions, or state merging.  When LAC is in
1327   use, canonical LR and IELR behave almost exactly the same for both
1328   syntactically acceptable and syntactically unacceptable input.
1329   While LALR still does not support the full language-recognition
1330   power of canonical LR and IELR, LAC at least enables LALR's syntax
1331   error handling to correctly reflect LALR's language-recognition
1332   power.
1333
1334   Currently, LAC is only supported for deterministic parsers in C.
1335   You can enable LAC with the following directive:
1336
1337     %define parse.lac full
1338
1339   See the new section "LAC" in the Bison manual for additional
1340   details including a few caveats.
1341
1342   LAC is an experimental feature.  More user feedback will help to
1343   stabilize it.
1344
1345 ** %define improvements:
1346
1347 *** Can now be invoked via the command line:
1348
1349   Each of these command-line options
1350
1351     -D NAME[=VALUE]
1352     --define=NAME[=VALUE]
1353
1354     -F NAME[=VALUE]
1355     --force-define=NAME[=VALUE]
1356
1357   is equivalent to this grammar file declaration
1358
1359     %define NAME ["VALUE"]
1360
1361   except that the manner in which Bison processes multiple definitions
1362   for the same NAME differs.  Most importantly, -F and --force-define
1363   quietly override %define, but -D and --define do not.  For further
1364   details, see the section "Bison Options" in the Bison manual.
1365
1366 *** Variables renamed:
1367
1368   The following %define variables
1369
1370     api.push_pull
1371     lr.keep_unreachable_states
1372
1373   have been renamed to
1374
1375     api.push-pull
1376     lr.keep-unreachable-states
1377
1378   The old names are now deprecated but will be maintained indefinitely
1379   for backward compatibility.
1380
1381 *** Values no longer need to be quoted in the grammar file:
1382
1383   If a %define value is an identifier, it no longer needs to be placed
1384   within quotations marks.  For example,
1385
1386     %define api.push-pull "push"
1387
1388   can be rewritten as
1389
1390     %define api.push-pull push
1391
1392 *** Unrecognized variables are now errors not warnings.
1393
1394 *** Multiple invocations for any variable is now an error not a warning.
1395
1396 ** Unrecognized %code qualifiers are now errors not warnings.
1397
1398 ** Character literals not of length one:
1399
1400   Previously, Bison quietly converted all character literals to length
1401   one.  For example, without warning, Bison interpreted the operators in
1402   the following grammar to be the same token:
1403
1404     exp: exp '++'
1405        | exp '+' exp
1406        ;
1407
1408   Bison now warns when a character literal is not of length one.  In
1409   some future release, Bison will start reporting an error instead.
1410
1411 ** Destructor calls fixed for lookaheads altered in semantic actions:
1412
1413   Previously for deterministic parsers in C, if a user semantic action
1414   altered yychar, the parser in some cases used the old yychar value to
1415   determine which destructor to call for the lookahead upon a syntax
1416   error or upon parser return.  This bug has been fixed.
1417
1418 ** C++ parsers use YYRHSLOC:
1419
1420   Similarly to the C parsers, the C++ parsers now define the YYRHSLOC
1421   macro and use it in the default YYLLOC_DEFAULT.  You are encouraged
1422   to use it.  If, for instance, your location structure has "first"
1423   and "last" members, instead of
1424
1425     # define YYLLOC_DEFAULT(Current, Rhs, N)                             \
1426       do                                                                 \
1427         if (N)                                                           \
1428           {                                                              \
1429             (Current).first = (Rhs)[1].location.first;                   \
1430             (Current).last  = (Rhs)[N].location.last;                    \
1431           }                                                              \
1432         else                                                             \
1433           {                                                              \
1434             (Current).first = (Current).last = (Rhs)[0].location.last;   \
1435           }                                                              \
1436       while (false)
1437
1438   use:
1439
1440     # define YYLLOC_DEFAULT(Current, Rhs, N)                             \
1441       do                                                                 \
1442         if (N)                                                           \
1443           {                                                              \
1444             (Current).first = YYRHSLOC (Rhs, 1).first;                   \
1445             (Current).last  = YYRHSLOC (Rhs, N).last;                    \
1446           }                                                              \
1447         else                                                             \
1448           {                                                              \
1449             (Current).first = (Current).last = YYRHSLOC (Rhs, 0).last;   \
1450           }                                                              \
1451       while (false)
1452
1453 ** YYLLOC_DEFAULT in C++:
1454
1455   The default implementation of YYLLOC_DEFAULT used to be issued in
1456   the header file.  It is now output in the implementation file, after
1457   the user %code sections so that its #ifndef guard does not try to
1458   override the user's YYLLOC_DEFAULT if provided.
1459
1460 ** YYFAIL now produces warnings and Java parsers no longer implement it:
1461
1462   YYFAIL has existed for many years as an undocumented feature of
1463   deterministic parsers in C generated by Bison.  More recently, it was
1464   a documented feature of Bison's experimental Java parsers.  As
1465   promised in Bison 2.4.2's NEWS entry, any appearance of YYFAIL in a
1466   semantic action now produces a deprecation warning, and Java parsers
1467   no longer implement YYFAIL at all.  For further details, including a
1468   discussion of how to suppress C preprocessor warnings about YYFAIL
1469   being unused, see the Bison 2.4.2 NEWS entry.
1470
1471 ** Temporary hack for adding a semicolon to the user action:
1472
1473   Previously, Bison appended a semicolon to every user action for
1474   reductions when the output language defaulted to C (specifically, when
1475   neither %yacc, %language, %skeleton, or equivalent command-line
1476   options were specified).  This allowed actions such as
1477
1478     exp: exp "+" exp { $$ = $1 + $3 };
1479
1480   instead of
1481
1482     exp: exp "+" exp { $$ = $1 + $3; };
1483
1484   As a first step in removing this misfeature, Bison now issues a
1485   warning when it appends a semicolon.  Moreover, in cases where Bison
1486   cannot easily determine whether a semicolon is needed (for example, an
1487   action ending with a cpp directive or a braced compound initializer),
1488   it no longer appends one.  Thus, the C compiler might now complain
1489   about a missing semicolon where it did not before.  Future releases of
1490   Bison will cease to append semicolons entirely.
1491
1492 ** Verbose syntax error message fixes:
1493
1494   When %error-verbose or the obsolete "#define YYERROR_VERBOSE" is
1495   specified, syntax error messages produced by the generated parser
1496   include the unexpected token as well as a list of expected tokens.
1497   The effect of %nonassoc on these verbose messages has been corrected
1498   in two ways, but a more complete fix requires LAC, described above:
1499
1500 *** When %nonassoc is used, there can exist parser states that accept no
1501     tokens, and so the parser does not always require a lookahead token
1502     in order to detect a syntax error.  Because no unexpected token or
1503     expected tokens can then be reported, the verbose syntax error
1504     message described above is suppressed, and the parser instead
1505     reports the simpler message, "syntax error".  Previously, this
1506     suppression was sometimes erroneously triggered by %nonassoc when a
1507     lookahead was actually required.  Now verbose messages are
1508     suppressed only when all previous lookaheads have already been
1509     shifted or discarded.
1510
1511 *** Previously, the list of expected tokens erroneously included tokens
1512     that would actually induce a syntax error because conflicts for them
1513     were resolved with %nonassoc in the current parser state.  Such
1514     tokens are now properly omitted from the list.
1515
1516 *** Expected token lists are still often wrong due to state merging
1517     (from LALR or IELR) and default reductions, which can both add
1518     invalid tokens and subtract valid tokens.  Canonical LR almost
1519     completely fixes this problem by eliminating state merging and
1520     default reductions.  However, there is one minor problem left even
1521     when using canonical LR and even after the fixes above.  That is,
1522     if the resolution of a conflict with %nonassoc appears in a later
1523     parser state than the one at which some syntax error is
1524     discovered, the conflicted token is still erroneously included in
1525     the expected token list.  Bison's new LAC implementation,
1526     described above, eliminates this problem and the need for
1527     canonical LR.  However, LAC is still experimental and is disabled
1528     by default.
1529
1530 ** Java skeleton fixes:
1531
1532 *** A location handling bug has been fixed.
1533
1534 *** The top element of each of the value stack and location stack is now
1535     cleared when popped so that it can be garbage collected.
1536
1537 *** Parser traces now print the top element of the stack.
1538
1539 ** -W/--warnings fixes:
1540
1541 *** Bison now properly recognizes the "no-" versions of categories:
1542
1543   For example, given the following command line, Bison now enables all
1544   warnings except warnings for incompatibilities with POSIX Yacc:
1545
1546     bison -Wall,no-yacc gram.y
1547
1548 *** Bison now treats S/R and R/R conflicts like other warnings:
1549
1550   Previously, conflict reports were independent of Bison's normal
1551   warning system.  Now, Bison recognizes the warning categories
1552   "conflicts-sr" and "conflicts-rr".  This change has important
1553   consequences for the -W and --warnings command-line options.  For
1554   example:
1555
1556     bison -Wno-conflicts-sr gram.y  # S/R conflicts not reported
1557     bison -Wno-conflicts-rr gram.y  # R/R conflicts not reported
1558     bison -Wnone            gram.y  # no conflicts are reported
1559     bison -Werror           gram.y  # any conflict is an error
1560
1561   However, as before, if the %expect or %expect-rr directive is
1562   specified, an unexpected number of conflicts is an error, and an
1563   expected number of conflicts is not reported, so -W and --warning
1564   then have no effect on the conflict report.
1565
1566 *** The "none" category no longer disables a preceding "error":
1567
1568   For example, for the following command line, Bison now reports
1569   errors instead of warnings for incompatibilities with POSIX Yacc:
1570
1571     bison -Werror,none,yacc gram.y
1572
1573 *** The "none" category now disables all Bison warnings:
1574
1575   Previously, the "none" category disabled only Bison warnings for
1576   which there existed a specific -W/--warning category.  However,
1577   given the following command line, Bison is now guaranteed to
1578   suppress all warnings:
1579
1580     bison -Wnone gram.y
1581
1582 ** Precedence directives can now assign token number 0:
1583
1584   Since Bison 2.3b, which restored the ability of precedence
1585   directives to assign token numbers, doing so for token number 0 has
1586   produced an assertion failure.  For example:
1587
1588     %left END 0
1589
1590   This bug has been fixed.
1591
1592 * Changes in version 2.4.3 (2010-08-05):
1593
1594 ** Bison now obeys -Werror and --warnings=error for warnings about
1595    grammar rules that are useless in the parser due to conflicts.
1596
1597 ** Problems with spawning M4 on at least FreeBSD 8 and FreeBSD 9 have
1598    been fixed.
1599
1600 ** Failures in the test suite for GCC 4.5 have been fixed.
1601
1602 ** Failures in the test suite for some versions of Sun Studio C++ have
1603    been fixed.
1604
1605 ** Contrary to Bison 2.4.2's NEWS entry, it has been decided that
1606    warnings about undefined %prec identifiers will not be converted to
1607    errors in Bison 2.5.  They will remain warnings, which should be
1608    sufficient for POSIX while avoiding backward compatibility issues.
1609
1610 ** Minor documentation fixes.
1611
1612 * Changes in version 2.4.2 (2010-03-20):
1613
1614 ** Some portability problems that resulted in failures and livelocks
1615    in the test suite on some versions of at least Solaris, AIX, HP-UX,
1616    RHEL4, and Tru64 have been addressed.  As a result, fatal Bison
1617    errors should no longer cause M4 to report a broken pipe on the
1618    affected platforms.
1619
1620 ** "%prec IDENTIFIER" requires IDENTIFIER to be defined separately.
1621
1622   POSIX specifies that an error be reported for any identifier that does
1623   not appear on the LHS of a grammar rule and that is not defined by
1624   %token, %left, %right, or %nonassoc.  Bison 2.3b and later lost this
1625   error report for the case when an identifier appears only after a
1626   %prec directive.  It is now restored.  However, for backward
1627   compatibility with recent Bison releases, it is only a warning for
1628   now.  In Bison 2.5 and later, it will return to being an error.
1629   [Between the 2.4.2 and 2.4.3 releases, it was decided that this
1630   warning will not be converted to an error in Bison 2.5.]
1631
1632 ** Detection of GNU M4 1.4.6 or newer during configure is improved.
1633
1634 ** Warnings from gcc's -Wundef option about undefined YYENABLE_NLS,
1635    YYLTYPE_IS_TRIVIAL, and __STRICT_ANSI__ in C/C++ parsers are now
1636    avoided.
1637
1638 ** %code is now a permanent feature.
1639
1640   A traditional Yacc prologue directive is written in the form:
1641
1642     %{CODE%}
1643
1644   To provide a more flexible alternative, Bison 2.3b introduced the
1645   %code directive with the following forms for C/C++:
1646
1647     %code          {CODE}
1648     %code requires {CODE}
1649     %code provides {CODE}
1650     %code top      {CODE}
1651
1652   These forms are now considered permanent features of Bison.  See the
1653   %code entries in the section "Bison Declaration Summary" in the Bison
1654   manual for a summary of their functionality.  See the section
1655   "Prologue Alternatives" for a detailed discussion including the
1656   advantages of %code over the traditional Yacc prologue directive.
1657
1658   Bison's Java feature as a whole including its current usage of %code
1659   is still considered experimental.
1660
1661 ** YYFAIL is deprecated and will eventually be removed.
1662
1663   YYFAIL has existed for many years as an undocumented feature of
1664   deterministic parsers in C generated by Bison.  Previously, it was
1665   documented for Bison's experimental Java parsers.  YYFAIL is no longer
1666   documented for Java parsers and is formally deprecated in both cases.
1667   Users are strongly encouraged to migrate to YYERROR, which is
1668   specified by POSIX.
1669
1670   Like YYERROR, you can invoke YYFAIL from a semantic action in order to
1671   induce a syntax error.  The most obvious difference from YYERROR is
1672   that YYFAIL will automatically invoke yyerror to report the syntax
1673   error so that you don't have to.  However, there are several other
1674   subtle differences between YYERROR and YYFAIL, and YYFAIL suffers from
1675   inherent flaws when %error-verbose or "#define YYERROR_VERBOSE" is
1676   used.  For a more detailed discussion, see:
1677
1678     http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html
1679
1680   The upcoming Bison 2.5 will remove YYFAIL from Java parsers, but
1681   deterministic parsers in C will continue to implement it.  However,
1682   because YYFAIL is already flawed, it seems futile to try to make new
1683   Bison features compatible with it.  Thus, during parser generation,
1684   Bison 2.5 will produce a warning whenever it discovers YYFAIL in a
1685   rule action.  In a later release, YYFAIL will be disabled for
1686   %error-verbose and "#define YYERROR_VERBOSE".  Eventually, YYFAIL will
1687   be removed altogether.
1688
1689   There exists at least one case where Bison 2.5's YYFAIL warning will
1690   be a false positive.  Some projects add phony uses of YYFAIL and other
1691   Bison-defined macros for the sole purpose of suppressing C
1692   preprocessor warnings (from GCC cpp's -Wunused-macros, for example).
1693   To avoid Bison's future warning, such YYFAIL uses can be moved to the
1694   epilogue (that is, after the second "%%") in the Bison input file.  In
1695   this release (2.4.2), Bison already generates its own code to suppress
1696   C preprocessor warnings for YYFAIL, so projects can remove their own
1697   phony uses of YYFAIL if compatibility with Bison releases prior to
1698   2.4.2 is not necessary.
1699
1700 ** Internationalization.
1701
1702   Fix a regression introduced in Bison 2.4: Under some circumstances,
1703   message translations were not installed although supported by the
1704   host system.
1705
1706 * Changes in version 2.4.1 (2008-12-11):
1707
1708 ** In the GLR defines file, unexpanded M4 macros in the yylval and yylloc
1709    declarations have been fixed.
1710
1711 ** Temporary hack for adding a semicolon to the user action.
1712
1713   Bison used to prepend a trailing semicolon at the end of the user
1714   action for reductions.  This allowed actions such as
1715
1716     exp: exp "+" exp { $$ = $1 + $3 };
1717
1718   instead of
1719
1720     exp: exp "+" exp { $$ = $1 + $3; };
1721
1722   Some grammars still depend on this "feature".  Bison 2.4.1 restores
1723   the previous behavior in the case of C output (specifically, when
1724   neither %language or %skeleton or equivalent command-line options
1725   are used) to leave more time for grammars depending on the old
1726   behavior to be adjusted.  Future releases of Bison will disable this
1727   feature.
1728
1729 ** A few minor improvements to the Bison manual.
1730
1731 * Changes in version 2.4 (2008-11-02):
1732
1733 ** %language is an experimental feature.
1734
1735   We first introduced this feature in test release 2.3b as a cleaner
1736   alternative to %skeleton.  Since then, we have discussed the possibility of
1737   modifying its effect on Bison's output file names.  Thus, in this release,
1738   we consider %language to be an experimental feature that will likely evolve
1739   in future releases.
1740
1741 ** Forward compatibility with GNU M4 has been improved.
1742
1743 ** Several bugs in the C++ skeleton and the experimental Java skeleton have been
1744   fixed.
1745
1746 * Changes in version 2.3b (2008-05-27):
1747
1748 ** The quotes around NAME that used to be required in the following directive
1749   are now deprecated:
1750
1751     %define NAME "VALUE"
1752
1753 ** The directive "%pure-parser" is now deprecated in favor of:
1754
1755     %define api.pure
1756
1757   which has the same effect except that Bison is more careful to warn about
1758   unreasonable usage in the latter case.
1759
1760 ** Push Parsing
1761
1762   Bison can now generate an LALR(1) parser in C with a push interface.  That
1763   is, instead of invoking "yyparse", which pulls tokens from "yylex", you can
1764   push one token at a time to the parser using "yypush_parse", which will
1765   return to the caller after processing each token.  By default, the push
1766   interface is disabled.  Either of the following directives will enable it:
1767
1768     %define api.push_pull "push" // Just push; does not require yylex.
1769     %define api.push_pull "both" // Push and pull; requires yylex.
1770
1771   See the new section "A Push Parser" in the Bison manual for details.
1772
1773   The current push parsing interface is experimental and may evolve.  More user
1774   feedback will help to stabilize it.
1775
1776 ** The -g and --graph options now output graphs in Graphviz DOT format,
1777   not VCG format.  Like --graph, -g now also takes an optional FILE argument
1778   and thus cannot be bundled with other short options.
1779
1780 ** Java
1781
1782   Bison can now generate an LALR(1) parser in Java.  The skeleton is
1783   "data/lalr1.java".  Consider using the new %language directive instead of
1784   %skeleton to select it.
1785
1786   See the new section "Java Parsers" in the Bison manual for details.
1787
1788   The current Java interface is experimental and may evolve.  More user
1789   feedback will help to stabilize it.
1790   Contributed by Paolo Bonzini.
1791
1792 ** %language
1793
1794   This new directive specifies the programming language of the generated
1795   parser, which can be C (the default), C++, or Java.  Besides the skeleton
1796   that Bison uses, the directive affects the names of the generated files if
1797   the grammar file's name ends in ".y".
1798
1799 ** XML Automaton Report
1800
1801   Bison can now generate an XML report of the LALR(1) automaton using the new
1802   "--xml" option.  The current XML schema is experimental and may evolve.  More
1803   user feedback will help to stabilize it.
1804   Contributed by Wojciech Polak.
1805
1806 ** The grammar file may now specify the name of the parser header file using
1807   %defines.  For example:
1808
1809     %defines "parser.h"
1810
1811 ** When reporting useless rules, useless nonterminals, and unused terminals,
1812   Bison now employs the terms "useless in grammar" instead of "useless",
1813   "useless in parser" instead of "never reduced", and "unused in grammar"
1814   instead of "unused".
1815
1816 ** Unreachable State Removal
1817
1818   Previously, Bison sometimes generated parser tables containing unreachable
1819   states.  A state can become unreachable during conflict resolution if Bison
1820   disables a shift action leading to it from a predecessor state.  Bison now:
1821
1822     1. Removes unreachable states.
1823
1824     2. Does not report any conflicts that appeared in unreachable states.
1825        WARNING: As a result, you may need to update %expect and %expect-rr
1826        directives in existing grammar files.
1827
1828     3. For any rule used only in such states, Bison now reports the rule as
1829        "useless in parser due to conflicts".
1830
1831   This feature can be disabled with the following directive:
1832
1833     %define lr.keep_unreachable_states
1834
1835   See the %define entry in the "Bison Declaration Summary" in the Bison manual
1836   for further discussion.
1837
1838 ** Lookahead Set Correction in the ".output" Report
1839
1840   When instructed to generate a ".output" file including lookahead sets
1841   (using "--report=lookahead", for example), Bison now prints each reduction's
1842   lookahead set only next to the associated state's one item that (1) is
1843   associated with the same rule as the reduction and (2) has its dot at the end
1844   of its RHS.  Previously, Bison also erroneously printed the lookahead set
1845   next to all of the state's other items associated with the same rule.  This
1846   bug affected only the ".output" file and not the generated parser source
1847   code.
1848
1849 ** --report-file=FILE is a new option to override the default ".output" file
1850   name.
1851
1852 ** The "=" that used to be required in the following directives is now
1853   deprecated:
1854
1855     %file-prefix "parser"
1856     %name-prefix "c_"
1857     %output "parser.c"
1858
1859 ** An Alternative to "%{...%}" -- "%code QUALIFIER {CODE}"
1860
1861   Bison 2.3a provided a new set of directives as a more flexible alternative to
1862   the traditional Yacc prologue blocks.  Those have now been consolidated into
1863   a single %code directive with an optional qualifier field, which identifies
1864   the purpose of the code and thus the location(s) where Bison should generate
1865   it:
1866
1867     1. "%code          {CODE}" replaces "%after-header  {CODE}"
1868     2. "%code requires {CODE}" replaces "%start-header  {CODE}"
1869     3. "%code provides {CODE}" replaces "%end-header    {CODE}"
1870     4. "%code top      {CODE}" replaces "%before-header {CODE}"
1871
1872   See the %code entries in section "Bison Declaration Summary" in the Bison
1873   manual for a summary of the new functionality.  See the new section "Prologue
1874   Alternatives" for a detailed discussion including the advantages of %code
1875   over the traditional Yacc prologues.
1876
1877   The prologue alternatives are experimental.  More user feedback will help to
1878   determine whether they should become permanent features.
1879
1880 ** Revised warning: unset or unused mid-rule values
1881
1882   Since Bison 2.2, Bison has warned about mid-rule values that are set but not
1883   used within any of the actions of the parent rule.  For example, Bison warns
1884   about unused $2 in:
1885
1886     exp: '1' { $$ = 1; } '+' exp { $$ = $1 + $4; };
1887
1888   Now, Bison also warns about mid-rule values that are used but not set.  For
1889   example, Bison warns about unset $$ in the mid-rule action in:
1890
1891     exp: '1' { $1 = 1; } '+' exp { $$ = $2 + $4; };
1892
1893   However, Bison now disables both of these warnings by default since they
1894   sometimes prove to be false alarms in existing grammars employing the Yacc
1895   constructs $0 or $-N (where N is some positive integer).
1896
1897   To enable these warnings, specify the option "--warnings=midrule-values" or
1898   "-W", which is a synonym for "--warnings=all".
1899
1900 ** Default %destructor or %printer with "<*>" or "<>"
1901
1902   Bison now recognizes two separate kinds of default %destructor's and
1903   %printer's:
1904
1905     1. Place "<*>" in a %destructor/%printer symbol list to define a default
1906        %destructor/%printer for all grammar symbols for which you have formally
1907        declared semantic type tags.
1908
1909     2. Place "<>" in a %destructor/%printer symbol list to define a default
1910        %destructor/%printer for all grammar symbols without declared semantic
1911        type tags.
1912
1913   Bison no longer supports the "%symbol-default" notation from Bison 2.3a.
1914   "<*>" and "<>" combined achieve the same effect with one exception: Bison no
1915   longer applies any %destructor to a mid-rule value if that mid-rule value is
1916   not actually ever referenced using either $$ or $n in a semantic action.
1917
1918   The default %destructor's and %printer's are experimental.  More user
1919   feedback will help to determine whether they should become permanent
1920   features.
1921
1922   See the section "Freeing Discarded Symbols" in the Bison manual for further
1923   details.
1924
1925 ** %left, %right, and %nonassoc can now declare token numbers.  This is required
1926   by POSIX.  However, see the end of section "Operator Precedence" in the Bison
1927   manual for a caveat concerning the treatment of literal strings.
1928
1929 ** The nonfunctional --no-parser, -n, and %no-parser options have been
1930   completely removed from Bison.
1931
1932 * Changes in version 2.3a, 2006-09-13:
1933
1934 ** Instead of %union, you can define and use your own union type
1935   YYSTYPE if your grammar contains at least one <type> tag.
1936   Your YYSTYPE need not be a macro; it can be a typedef.
1937   This change is for compatibility with other Yacc implementations,
1938   and is required by POSIX.
1939
1940 ** Locations columns and lines start at 1.
1941   In accordance with the GNU Coding Standards and Emacs.
1942
1943 ** You may now declare per-type and default %destructor's and %printer's:
1944
1945   For example:
1946
1947     %union { char *string; }
1948     %token <string> STRING1
1949     %token <string> STRING2
1950     %type  <string> string1
1951     %type  <string> string2
1952     %union { char character; }
1953     %token <character> CHR
1954     %type  <character> chr
1955     %destructor { free ($$); } %symbol-default
1956     %destructor { free ($$); printf ("%d", @$.first_line); } STRING1 string1
1957     %destructor { } <character>
1958
1959   guarantees that, when the parser discards any user-defined symbol that has a
1960   semantic type tag other than "<character>", it passes its semantic value to
1961   "free".  However, when the parser discards a "STRING1" or a "string1", it
1962   also prints its line number to "stdout".  It performs only the second
1963   "%destructor" in this case, so it invokes "free" only once.
1964
1965   [Although we failed to mention this here in the 2.3a release, the default
1966   %destructor's and %printer's were experimental, and they were rewritten in
1967   future versions.]
1968
1969 ** Except for LALR(1) parsers in C with POSIX Yacc emulation enabled (with "-y",
1970   "--yacc", or "%yacc"), Bison no longer generates #define statements for
1971   associating token numbers with token names.  Removing the #define statements
1972   helps to sanitize the global namespace during preprocessing, but POSIX Yacc
1973   requires them.  Bison still generates an enum for token names in all cases.
1974
1975 ** Handling of traditional Yacc prologue blocks is now more consistent but
1976   potentially incompatible with previous releases of Bison.
1977
1978   As before, you declare prologue blocks in your grammar file with the
1979   "%{ ... %}" syntax.  To generate the pre-prologue, Bison concatenates all
1980   prologue blocks that you've declared before the first %union.  To generate
1981   the post-prologue, Bison concatenates all prologue blocks that you've
1982   declared after the first %union.
1983
1984   Previous releases of Bison inserted the pre-prologue into both the header
1985   file and the code file in all cases except for LALR(1) parsers in C.  In the
1986   latter case, Bison inserted it only into the code file.  For parsers in C++,
1987   the point of insertion was before any token definitions (which associate
1988   token numbers with names).  For parsers in C, the point of insertion was
1989   after the token definitions.
1990
1991   Now, Bison never inserts the pre-prologue into the header file.  In the code
1992   file, it always inserts it before the token definitions.
1993
1994 ** Bison now provides a more flexible alternative to the traditional Yacc
1995   prologue blocks: %before-header, %start-header, %end-header, and
1996   %after-header.
1997
1998   For example, the following declaration order in the grammar file reflects the
1999   order in which Bison will output these code blocks.  However, you are free to
2000   declare these code blocks in your grammar file in whatever order is most
2001   convenient for you:
2002
2003     %before-header {
2004       /* Bison treats this block like a pre-prologue block: it inserts it into
2005        * the code file before the contents of the header file.  It does *not*
2006        * insert it into the header file.  This is a good place to put
2007        * #include's that you want at the top of your code file.  A common
2008        * example is '#include "system.h"'.  */
2009     }
2010     %start-header {
2011       /* Bison inserts this block into both the header file and the code file.
2012        * In both files, the point of insertion is before any Bison-generated
2013        * token, semantic type, location type, and class definitions.  This is a
2014        * good place to define %union dependencies, for example.  */
2015     }
2016     %union {
2017       /* Unlike the traditional Yacc prologue blocks, the output order for the
2018        * new %*-header blocks is not affected by their declaration position
2019        * relative to any %union in the grammar file.  */
2020     }
2021     %end-header {
2022       /* Bison inserts this block into both the header file and the code file.
2023        * In both files, the point of insertion is after the Bison-generated
2024        * definitions.  This is a good place to declare or define public
2025        * functions or data structures that depend on the Bison-generated
2026        * definitions.  */
2027     }
2028     %after-header {
2029       /* Bison treats this block like a post-prologue block: it inserts it into
2030        * the code file after the contents of the header file.  It does *not*
2031        * insert it into the header file.  This is a good place to declare or
2032        * define internal functions or data structures that depend on the
2033        * Bison-generated definitions.  */
2034     }
2035
2036   If you have multiple occurrences of any one of the above declarations, Bison
2037   will concatenate the contents in declaration order.
2038
2039   [Although we failed to mention this here in the 2.3a release, the prologue
2040   alternatives were experimental, and they were rewritten in future versions.]
2041
2042 ** The option "--report=look-ahead" has been changed to "--report=lookahead".
2043   The old spelling still works, but is not documented and may be removed
2044   in a future release.
2045
2046 * Changes in version 2.3, 2006-06-05:
2047
2048 ** GLR grammars should now use "YYRECOVERING ()" instead of "YYRECOVERING",
2049   for compatibility with LALR(1) grammars.
2050
2051 ** It is now documented that any definition of YYSTYPE or YYLTYPE should
2052   be to a type name that does not contain parentheses or brackets.
2053
2054 * Changes in version 2.2, 2006-05-19:
2055
2056 ** The distribution terms for all Bison-generated parsers now permit
2057   using the parsers in nonfree programs.  Previously, this permission
2058   was granted only for Bison-generated LALR(1) parsers in C.
2059
2060 ** %name-prefix changes the namespace name in C++ outputs.
2061
2062 ** The C++ parsers export their token_type.
2063
2064 ** Bison now allows multiple %union declarations, and concatenates
2065   their contents together.
2066
2067 ** New warning: unused values
2068   Right-hand side symbols whose values are not used are reported,
2069   if the symbols have destructors.  For instance:
2070
2071      exp: exp "?" exp ":" exp { $1 ? $1 : $3; }
2072         | exp "+" exp
2073         ;
2074
2075   will trigger a warning about $$ and $5 in the first rule, and $3 in
2076   the second ($1 is copied to $$ by the default rule).  This example
2077   most likely contains three errors, and could be rewritten as:
2078
2079      exp: exp "?" exp ":" exp
2080             { $$ = $1 ? $3 : $5; free ($1 ? $5 : $3); free ($1); }
2081         | exp "+" exp
2082             { $$ = $1 ? $1 : $3; if ($1) free ($3); }
2083         ;
2084
2085   However, if the original actions were really intended, memory leaks
2086   and all, the warnings can be suppressed by letting Bison believe the
2087   values are used, e.g.:
2088
2089      exp: exp "?" exp ":" exp { $1 ? $1 : $3; (void) ($$, $5); }
2090         | exp "+" exp         { $$ = $1; (void) $3; }
2091         ;
2092
2093   If there are mid-rule actions, the warning is issued if no action
2094   uses it.  The following triggers no warning: $1 and $3 are used.
2095
2096      exp: exp { push ($1); } '+' exp { push ($3); sum (); };
2097
2098   The warning is intended to help catching lost values and memory leaks.
2099   If a value is ignored, its associated memory typically is not reclaimed.
2100
2101 ** %destructor vs. YYABORT, YYACCEPT, and YYERROR.
2102   Destructors are now called when user code invokes YYABORT, YYACCEPT,
2103   and YYERROR, for all objects on the stack, other than objects
2104   corresponding to the right-hand side of the current rule.
2105
2106 ** %expect, %expect-rr
2107   Incorrect numbers of expected conflicts are now actual errors,
2108   instead of warnings.
2109
2110 ** GLR, YACC parsers.
2111   The %parse-params are available in the destructors (and the
2112   experimental printers) as per the documentation.
2113
2114 ** Bison now warns if it finds a stray "$" or "@" in an action.
2115
2116 ** %require "VERSION"
2117   This specifies that the grammar file depends on features implemented
2118   in Bison version VERSION or higher.
2119
2120 ** lalr1.cc: The token and value types are now class members.
2121   The tokens were defined as free form enums and cpp macros.  YYSTYPE
2122   was defined as a free form union.  They are now class members:
2123   tokens are enumerations of the "yy::parser::token" struct, and the
2124   semantic values have the "yy::parser::semantic_type" type.
2125
2126   If you do not want or can update to this scheme, the directive
2127   '%define "global_tokens_and_yystype" "1"' triggers the global
2128   definition of tokens and YYSTYPE.  This change is suitable both
2129   for previous releases of Bison, and this one.
2130
2131   If you wish to update, then make sure older version of Bison will
2132   fail using '%require "2.2"'.
2133
2134 ** DJGPP support added.
2135 \f
2136 * Changes in version 2.1, 2005-09-16:
2137
2138 ** The C++ lalr1.cc skeleton supports %lex-param.
2139
2140 ** Bison-generated parsers now support the translation of diagnostics like
2141   "syntax error" into languages other than English.  The default
2142   language is still English.  For details, please see the new
2143   Internationalization section of the Bison manual.  Software
2144   distributors should also see the new PACKAGING file.  Thanks to
2145   Bruno Haible for this new feature.
2146
2147 ** Wording in the Bison-generated parsers has been changed slightly to
2148   simplify translation.  In particular, the message "memory exhausted"
2149   has replaced "parser stack overflow", as the old message was not
2150   always accurate for modern Bison-generated parsers.
2151
2152 ** Destructors are now called when the parser aborts, for all symbols left
2153   behind on the stack.  Also, the start symbol is now destroyed after a
2154   successful parse.  In both cases, the behavior was formerly inconsistent.
2155
2156 ** When generating verbose diagnostics, Bison-generated parsers no longer
2157   quote the literal strings associated with tokens.  For example, for
2158   a syntax error associated with '%token NUM "number"' they might
2159   print 'syntax error, unexpected number' instead of 'syntax error,
2160   unexpected "number"'.
2161 \f
2162 * Changes in version 2.0, 2004-12-25:
2163
2164 ** Possibly-incompatible changes
2165
2166   - Bison-generated parsers no longer default to using the alloca function
2167     (when available) to extend the parser stack, due to widespread
2168     problems in unchecked stack-overflow detection.  You can "#define
2169     YYSTACK_USE_ALLOCA 1" to require the use of alloca, but please read
2170     the manual to determine safe values for YYMAXDEPTH in that case.
2171
2172   - Error token location.
2173     During error recovery, the location of the syntax error is updated
2174     to cover the whole sequence covered by the error token: it includes
2175     the shifted symbols thrown away during the first part of the error
2176     recovery, and the lookahead rejected during the second part.
2177
2178   - Semicolon changes:
2179     . Stray semicolons are no longer allowed at the start of a grammar.
2180     . Semicolons are now required after in-grammar declarations.
2181
2182   - Unescaped newlines are no longer allowed in character constants or
2183     string literals.  They were never portable, and GCC 3.4.0 has
2184     dropped support for them.  Better diagnostics are now generated if
2185     forget a closing quote.
2186
2187   - NUL bytes are no longer allowed in Bison string literals, unfortunately.
2188
2189 ** New features
2190
2191   - GLR grammars now support locations.
2192
2193   - New directive: %initial-action.
2194     This directive allows the user to run arbitrary code (including
2195     initializing @$) from yyparse before parsing starts.
2196
2197   - A new directive "%expect-rr N" specifies the expected number of
2198     reduce/reduce conflicts in GLR parsers.
2199
2200   - %token numbers can now be hexadecimal integers, e.g., "%token FOO 0x12d".
2201     This is a GNU extension.
2202
2203   - The option "--report=lookahead" was changed to "--report=look-ahead".
2204     [However, this was changed back after 2.3.]
2205
2206   - Experimental %destructor support has been added to lalr1.cc.
2207
2208   - New configure option --disable-yacc, to disable installation of the
2209     yacc command and -ly library introduced in 1.875 for POSIX conformance.
2210
2211 ** Bug fixes
2212
2213   - For now, %expect-count violations are now just warnings, not errors.
2214     This is for compatibility with Bison 1.75 and earlier (when there are
2215     reduce/reduce conflicts) and with Bison 1.30 and earlier (when there
2216     are too many or too few shift/reduce conflicts).  However, in future
2217     versions of Bison we plan to improve the %expect machinery so that
2218     these violations will become errors again.
2219
2220   - Within Bison itself, numbers (e.g., goto numbers) are no longer
2221     arbitrarily limited to 16-bit counts.
2222
2223   - Semicolons are now allowed before "|" in grammar rules, as POSIX requires.
2224 \f
2225 * Changes in version 1.875, 2003-01-01:
2226
2227 ** The documentation license has been upgraded to version 1.2
2228   of the GNU Free Documentation License.
2229
2230 ** syntax error processing
2231
2232   - In Yacc-style parsers YYLLOC_DEFAULT is now used to compute error
2233     locations too.  This fixes bugs in error-location computation.
2234
2235   - %destructor
2236     It is now possible to reclaim the memory associated to symbols
2237     discarded during error recovery.  This feature is still experimental.
2238
2239   - %error-verbose
2240     This new directive is preferred over YYERROR_VERBOSE.
2241
2242   - #defining yyerror to steal internal variables is discouraged.
2243     It is not guaranteed to work forever.
2244
2245 ** POSIX conformance
2246
2247   - Semicolons are once again optional at the end of grammar rules.
2248     This reverts to the behavior of Bison 1.33 and earlier, and improves
2249     compatibility with Yacc.
2250
2251   - "parse error" -> "syntax error"
2252     Bison now uniformly uses the term "syntax error"; formerly, the code
2253     and manual sometimes used the term "parse error" instead.  POSIX
2254     requires "syntax error" in diagnostics, and it was thought better to
2255     be consistent.
2256
2257   - The documentation now emphasizes that yylex and yyerror must be
2258     declared before use.  C99 requires this.
2259
2260   - Bison now parses C99 lexical constructs like UCNs and
2261     backslash-newline within C escape sequences, as POSIX 1003.1-2001 requires.
2262
2263   - File names are properly escaped in C output.  E.g., foo\bar.y is
2264     output as "foo\\bar.y".
2265
2266   - Yacc command and library now available
2267     The Bison distribution now installs a "yacc" command, as POSIX requires.
2268     Also, Bison now installs a small library liby.a containing
2269     implementations of Yacc-compatible yyerror and main functions.
2270     This library is normally not useful, but POSIX requires it.
2271
2272   - Type clashes now generate warnings, not errors.
2273
2274   - If the user does not define YYSTYPE as a macro, Bison now declares it
2275     using typedef instead of defining it as a macro.
2276     For consistency, YYLTYPE is also declared instead of defined.
2277
2278 ** Other compatibility issues
2279
2280   - %union directives can now have a tag before the "{", e.g., the
2281     directive "%union foo {...}" now generates the C code
2282     "typedef union foo { ... } YYSTYPE;"; this is for Yacc compatibility.
2283     The default union tag is "YYSTYPE", for compatibility with Solaris 9 Yacc.
2284     For consistency, YYLTYPE's struct tag is now "YYLTYPE" not "yyltype".
2285     This is for compatibility with both Yacc and Bison 1.35.
2286
2287   - ";" is output before the terminating "}" of an action, for
2288     compatibility with Bison 1.35.
2289
2290   - Bison now uses a Yacc-style format for conflict reports, e.g.,
2291     "conflicts: 2 shift/reduce, 1 reduce/reduce".
2292
2293   - "yystype" and "yyltype" are now obsolescent macros instead of being
2294     typedefs or tags; they are no longer documented and are planned to be
2295     withdrawn in a future release.
2296
2297 ** GLR parser notes
2298
2299   - GLR and inline
2300     Users of Bison have to decide how they handle the portability of the
2301     C keyword "inline".
2302
2303   - "parsing stack overflow..." -> "parser stack overflow"
2304     GLR parsers now report "parser stack overflow" as per the Bison manual.
2305
2306 ** %parse-param and %lex-param
2307   The macros YYPARSE_PARAM and YYLEX_PARAM provide a means to pass
2308   additional context to yyparse and yylex.  They suffer from several
2309   shortcomings:
2310
2311   - a single argument only can be added,
2312   - their types are weak (void *),
2313   - this context is not passed to ancillary functions such as yyerror,
2314   - only yacc.c parsers support them.
2315
2316   The new %parse-param/%lex-param directives provide a more precise control.
2317   For instance:
2318
2319     %parse-param {int *nastiness}
2320     %lex-param   {int *nastiness}
2321     %parse-param {int *randomness}
2322
2323   results in the following signatures:
2324
2325     int yylex   (int *nastiness);
2326     int yyparse (int *nastiness, int *randomness);
2327
2328   or, if both %pure-parser and %locations are used:
2329
2330     int yylex   (YYSTYPE *lvalp, YYLTYPE *llocp, int *nastiness);
2331     int yyparse (int *nastiness, int *randomness);
2332
2333 ** Bison now warns if it detects conflicting outputs to the same file,
2334   e.g., it generates a warning for "bison -d -o foo.h foo.y" since
2335   that command outputs both code and header to foo.h.
2336
2337 ** #line in output files
2338   - --no-line works properly.
2339
2340 ** Bison can no longer be built by a K&R C compiler; it requires C89 or
2341   later to be built.  This change originally took place a few versions
2342   ago, but nobody noticed until we recently asked someone to try
2343   building Bison with a K&R C compiler.
2344 \f
2345 * Changes in version 1.75, 2002-10-14:
2346
2347 ** Bison should now work on 64-bit hosts.
2348
2349 ** Indonesian translation thanks to Tedi Heriyanto.
2350
2351 ** GLR parsers
2352   Fix spurious parse errors.
2353
2354 ** Pure parsers
2355   Some people redefine yyerror to steal yyparse' private variables.
2356   Reenable this trick until an official feature replaces it.
2357
2358 ** Type Clashes
2359   In agreement with POSIX and with other Yaccs, leaving a default
2360   action is valid when $$ is untyped, and $1 typed:
2361
2362         untyped: ... typed;
2363
2364   but the converse remains an error:
2365
2366         typed: ... untyped;
2367
2368 ** Values of mid-rule actions
2369   The following code:
2370
2371         foo: { ... } { $$ = $1; } ...
2372
2373   was incorrectly rejected: $1 is defined in the second mid-rule
2374   action, and is equal to the $$ of the first mid-rule action.
2375 \f
2376 * Changes in version 1.50, 2002-10-04:
2377
2378 ** GLR parsing
2379   The declaration
2380      %glr-parser
2381   causes Bison to produce a Generalized LR (GLR) parser, capable of handling
2382   almost any context-free grammar, ambiguous or not.  The new declarations
2383   %dprec and %merge on grammar rules allow parse-time resolution of
2384   ambiguities.  Contributed by Paul Hilfinger.
2385
2386   Unfortunately Bison 1.50 does not work properly on 64-bit hosts
2387   like the Alpha, so please stick to 32-bit hosts for now.
2388
2389 ** Output Directory
2390   When not in Yacc compatibility mode, when the output file was not
2391   specified, running "bison foo/bar.y" created "foo/bar.c".  It
2392   now creates "bar.c".
2393
2394 ** Undefined token
2395   The undefined token was systematically mapped to 2 which prevented
2396   the use of 2 by the user.  This is no longer the case.
2397
2398 ** Unknown token numbers
2399   If yylex returned an out of range value, yyparse could die.  This is
2400   no longer the case.
2401
2402 ** Error token
2403   According to POSIX, the error token must be 256.
2404   Bison extends this requirement by making it a preference: *if* the
2405   user specified that one of her tokens is numbered 256, then error
2406   will be mapped onto another number.
2407
2408 ** Verbose error messages
2409   They no longer report "..., expecting error or..." for states where
2410   error recovery is possible.
2411
2412 ** End token
2413   Defaults to "$end" instead of "$".
2414
2415 ** Error recovery now conforms to documentation and to POSIX
2416   When a Bison-generated parser encounters a syntax error, it now pops
2417   the stack until it finds a state that allows shifting the error
2418   token.  Formerly, it popped the stack until it found a state that
2419   allowed some non-error action other than a default reduction on the
2420   error token.  The new behavior has long been the documented behavior,
2421   and has long been required by POSIX.  For more details, please see
2422   Paul Eggert, "Reductions during Bison error handling" (2002-05-20)
2423   <http://lists.gnu.org/archive/html/bug-bison/2002-05/msg00038.html>.
2424
2425 ** Traces
2426   Popped tokens and nonterminals are now reported.
2427
2428 ** Larger grammars
2429   Larger grammars are now supported (larger token numbers, larger grammar
2430   size (= sum of the LHS and RHS lengths), larger LALR tables).
2431   Formerly, many of these numbers ran afoul of 16-bit limits;
2432   now these limits are 32 bits on most hosts.
2433
2434 ** Explicit initial rule
2435   Bison used to play hacks with the initial rule, which the user does
2436   not write.  It is now explicit, and visible in the reports and
2437   graphs as rule 0.
2438
2439 ** Useless rules
2440   Before, Bison reported the useless rules, but, although not used,
2441   included them in the parsers.  They are now actually removed.
2442
2443 ** Useless rules, useless nonterminals
2444   They are now reported, as a warning, with their locations.
2445
2446 ** Rules never reduced
2447   Rules that can never be reduced because of conflicts are now
2448   reported.
2449
2450 ** Incorrect "Token not used"
2451   On a grammar such as
2452
2453     %token useless useful
2454     %%
2455     exp: '0' %prec useful;
2456
2457   where a token was used to set the precedence of the last rule,
2458   bison reported both "useful" and "useless" as useless tokens.
2459
2460 ** Revert the C++ namespace changes introduced in 1.31
2461   as they caused too many portability hassles.
2462
2463 ** Default locations
2464   By an accident of design, the default computation of @$ was
2465   performed after another default computation was performed: @$ = @1.
2466   The latter is now removed: YYLLOC_DEFAULT is fully responsible of
2467   the computation of @$.
2468
2469 ** Token end-of-file
2470   The token end of file may be specified by the user, in which case,
2471   the user symbol is used in the reports, the graphs, and the verbose
2472   error messages instead of "$end", which remains being the default.
2473   For instance
2474     %token MYEOF 0
2475   or
2476     %token MYEOF 0 "end of file"
2477
2478 ** Semantic parser
2479   This old option, which has been broken for ages, is removed.
2480
2481 ** New translations
2482   Brazilian Portuguese, thanks to Alexandre Folle de Menezes.
2483   Croatian, thanks to Denis Lackovic.
2484
2485 ** Incorrect token definitions
2486   When given
2487     %token 'a' "A"
2488   bison used to output
2489     #define 'a' 65
2490
2491 ** Token definitions as enums
2492   Tokens are output both as the traditional #define's, and, provided
2493   the compiler supports ANSI C or is a C++ compiler, as enums.
2494   This lets debuggers display names instead of integers.
2495
2496 ** Reports
2497   In addition to --verbose, bison supports --report=THINGS, which
2498   produces additional information:
2499   - itemset
2500     complete the core item sets with their closure
2501   - lookahead [changed to "look-ahead" in 1.875e through 2.3, but changed back]
2502     explicitly associate lookahead tokens to items
2503   - solved
2504     describe shift/reduce conflicts solving.
2505     Bison used to systematically output this information on top of
2506     the report.  Solved conflicts are now attached to their states.
2507
2508 ** Type clashes
2509   Previous versions don't complain when there is a type clash on
2510   the default action if the rule has a mid-rule action, such as in:
2511
2512     %type <foo> bar
2513     %%
2514     bar: '0' {} '0';
2515
2516   This is fixed.
2517
2518 ** GNU M4 is now required when using Bison.
2519 \f
2520 * Changes in version 1.35, 2002-03-25:
2521
2522 ** C Skeleton
2523   Some projects use Bison's C parser with C++ compilers, and define
2524   YYSTYPE as a class.  The recent adjustment of C parsers for data
2525   alignment and 64 bit architectures made this impossible.
2526
2527   Because for the time being no real solution for C++ parser
2528   generation exists, kludges were implemented in the parser to
2529   maintain this use.  In the future, when Bison has C++ parsers, this
2530   kludge will be disabled.
2531
2532   This kludge also addresses some C++ problems when the stack was
2533   extended.
2534 \f
2535 * Changes in version 1.34, 2002-03-12:
2536
2537 ** File name clashes are detected
2538   $ bison foo.y -d -o foo.x
2539   fatal error: header and parser would both be named "foo.x"
2540
2541 ** A missing ";" at the end of a rule triggers a warning
2542   In accordance with POSIX, and in agreement with other
2543   Yacc implementations, Bison will mandate this semicolon in the near
2544   future.  This eases the implementation of a Bison parser of Bison
2545   grammars by making this grammar LALR(1) instead of LR(2).  To
2546   facilitate the transition, this release introduces a warning.
2547
2548 ** Revert the C++ namespace changes introduced in 1.31, as they caused too
2549   many portability hassles.
2550
2551 ** DJGPP support added.
2552
2553 ** Fix test suite portability problems.
2554 \f
2555 * Changes in version 1.33, 2002-02-07:
2556
2557 ** Fix C++ issues
2558   Groff could not be compiled for the definition of size_t was lacking
2559   under some conditions.
2560
2561 ** Catch invalid @n
2562   As is done with $n.
2563 \f
2564 * Changes in version 1.32, 2002-01-23:
2565
2566 ** Fix Yacc output file names
2567
2568 ** Portability fixes
2569
2570 ** Italian, Dutch translations
2571 \f
2572 * Changes in version 1.31, 2002-01-14:
2573
2574 ** Many Bug Fixes
2575
2576 ** GNU Gettext and %expect
2577   GNU Gettext asserts 10 s/r conflicts, but there are 7.  Now that
2578   Bison dies on incorrect %expectations, we fear there will be
2579   too many bug reports for Gettext, so _for the time being_, %expect
2580   does not trigger an error when the input file is named "plural.y".
2581
2582 ** Use of alloca in parsers
2583   If YYSTACK_USE_ALLOCA is defined to 0, then the parsers will use
2584   malloc exclusively.  Since 1.29, but was not NEWS'ed.
2585
2586   alloca is used only when compiled with GCC, to avoid portability
2587   problems as on AIX.
2588
2589 ** yyparse now returns 2 if memory is exhausted; formerly it dumped core.
2590
2591 ** When the generated parser lacks debugging code, YYDEBUG is now 0
2592   (as POSIX requires) instead of being undefined.
2593
2594 ** User Actions
2595   Bison has always permitted actions such as { $$ = $1 }: it adds the
2596   ending semicolon.  Now if in Yacc compatibility mode, the semicolon
2597   is no longer output: one has to write { $$ = $1; }.
2598
2599 ** Better C++ compliance
2600   The output parsers try to respect C++ namespaces.
2601   [This turned out to be a failed experiment, and it was reverted later.]
2602
2603 ** Reduced Grammars
2604   Fixed bugs when reporting useless nonterminals.
2605
2606 ** 64 bit hosts
2607   The parsers work properly on 64 bit hosts.
2608
2609 ** Error messages
2610   Some calls to strerror resulted in scrambled or missing error messages.
2611
2612 ** %expect
2613   When the number of shift/reduce conflicts is correct, don't issue
2614   any warning.
2615
2616 ** The verbose report includes the rule line numbers.
2617
2618 ** Rule line numbers are fixed in traces.
2619
2620 ** Swedish translation
2621
2622 ** Parse errors
2623   Verbose parse error messages from the parsers are better looking.
2624   Before: parse error: unexpected `'/'', expecting `"number"' or `'-'' or `'(''
2625      Now: parse error: unexpected '/', expecting "number" or '-' or '('
2626
2627 ** Fixed parser memory leaks.
2628   When the generated parser was using malloc to extend its stacks, the
2629   previous allocations were not freed.
2630
2631 ** Fixed verbose output file.
2632   Some newlines were missing.
2633   Some conflicts in state descriptions were missing.
2634
2635 ** Fixed conflict report.
2636   Option -v was needed to get the result.
2637
2638 ** %expect
2639   Was not used.
2640   Mismatches are errors, not warnings.
2641
2642 ** Fixed incorrect processing of some invalid input.
2643
2644 ** Fixed CPP guards: 9foo.h uses BISON_9FOO_H instead of 9FOO_H.
2645
2646 ** Fixed some typos in the documentation.
2647
2648 ** %token MY_EOF 0 is supported.
2649   Before, MY_EOF was silently renumbered as 257.
2650
2651 ** doc/refcard.tex is updated.
2652
2653 ** %output, %file-prefix, %name-prefix.
2654   New.
2655
2656 ** --output
2657   New, aliasing "--output-file".
2658 \f
2659 * Changes in version 1.30, 2001-10-26:
2660
2661 ** "--defines" and "--graph" have now an optional argument which is the
2662   output file name. "-d" and "-g" do not change; they do not take any
2663   argument.
2664
2665 ** "%source_extension" and "%header_extension" are removed, failed
2666   experiment.
2667
2668 ** Portability fixes.
2669 \f
2670 * Changes in version 1.29, 2001-09-07:
2671
2672 ** The output file does not define const, as this caused problems when used
2673   with common autoconfiguration schemes.  If you still use ancient compilers
2674   that lack const, compile with the equivalent of the C compiler option
2675   "-Dconst=".  Autoconf's AC_C_CONST macro provides one way to do this.
2676
2677 ** Added "-g" and "--graph".
2678
2679 ** The Bison manual is now distributed under the terms of the GNU FDL.
2680
2681 ** The input and the output files has automatically a similar extension.
2682
2683 ** Russian translation added.
2684
2685 ** NLS support updated; should hopefully be less troublesome.
2686
2687 ** Added the old Bison reference card.
2688
2689 ** Added "--locations" and "%locations".
2690
2691 ** Added "-S" and "--skeleton".
2692
2693 ** "%raw", "-r", "--raw" is disabled.
2694
2695 ** Special characters are escaped when output.  This solves the problems
2696   of the #line lines with path names including backslashes.
2697
2698 ** New directives.
2699   "%yacc", "%fixed_output_files", "%defines", "%no_parser", "%verbose",
2700   "%debug", "%source_extension" and "%header_extension".
2701
2702 ** @$
2703   Automatic location tracking.
2704 \f
2705 * Changes in version 1.28, 1999-07-06:
2706
2707 ** Should compile better now with K&R compilers.
2708
2709 ** Added NLS.
2710
2711 ** Fixed a problem with escaping the double quote character.
2712
2713 ** There is now a FAQ.
2714 \f
2715 * Changes in version 1.27:
2716
2717 ** The make rule which prevented bison.simple from being created on
2718   some systems has been fixed.
2719 \f
2720 * Changes in version 1.26:
2721
2722 ** Bison now uses Automake.
2723
2724 ** New mailing lists: <bug-bison@gnu.org> and <help-bison@gnu.org>.
2725
2726 ** Token numbers now start at 257 as previously documented, not 258.
2727
2728 ** Bison honors the TMPDIR environment variable.
2729
2730 ** A couple of buffer overruns have been fixed.
2731
2732 ** Problems when closing files should now be reported.
2733
2734 ** Generated parsers should now work even on operating systems which do
2735   not provide alloca().
2736 \f
2737 * Changes in version 1.25, 1995-10-16:
2738
2739 ** Errors in the input grammar are not fatal; Bison keeps reading
2740 the grammar file, and reports all the errors found in it.
2741
2742 ** Tokens can now be specified as multiple-character strings: for
2743 example, you could use "<=" for a token which looks like <=, instead
2744 of choosing a name like LESSEQ.
2745
2746 ** The %token_table declaration says to write a table of tokens (names
2747 and numbers) into the parser file.  The yylex function can use this
2748 table to recognize multiple-character string tokens, or for other
2749 purposes.
2750
2751 ** The %no_lines declaration says not to generate any #line preprocessor
2752 directives in the parser file.
2753
2754 ** The %raw declaration says to use internal Bison token numbers, not
2755 Yacc-compatible token numbers, when token names are defined as macros.
2756
2757 ** The --no-parser option produces the parser tables without including
2758 the parser engine; a project can now use its own parser engine.
2759 The actions go into a separate file called NAME.act, in the form of
2760 a switch statement body.
2761 \f
2762 * Changes in version 1.23:
2763
2764 The user can define YYPARSE_PARAM as the name of an argument to be
2765 passed into yyparse.  The argument should have type void *.  It should
2766 actually point to an object.  Grammar actions can access the variable
2767 by casting it to the proper pointer type.
2768
2769 Line numbers in output file corrected.
2770 \f
2771 * Changes in version 1.22:
2772
2773 --help option added.
2774 \f
2775 * Changes in version 1.20:
2776
2777 Output file does not redefine const for C++.
2778
2779 -----
2780
2781 Copyright (C) 1995-2015, 2018 Free Software Foundation, Inc.
2782
2783 This file is part of Bison, the GNU Parser Generator.
2784
2785 This program is free software: you can redistribute it and/or modify
2786 it under the terms of the GNU General Public License as published by
2787 the Free Software Foundation, either version 3 of the License, or
2788 (at your option) any later version.
2789
2790 This program is distributed in the hope that it will be useful,
2791 but WITHOUT ANY WARRANTY; without even the implied warranty of
2792 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2793 GNU General Public License for more details.
2794
2795 You should have received a copy of the GNU General Public License
2796 along with this program.  If not, see <http://www.gnu.org/licenses/>.
2797
2798  LocalWords:  yacc YYBACKUP glr GCC lalr ArrayIndexOutOfBoundsException nullptr
2799  LocalWords:  cplusplus liby rpl fprintf mfcalc Wyacc stmt cond expr mk sym lr
2800  LocalWords:  IELR ielr Lookahead YYERROR nonassoc LALR's api lookaheads yychar
2801  LocalWords:  destructor lookahead YYRHSLOC YYLLOC Rhs ifndef YYFAIL cpp sr rr
2802  LocalWords:  preprocessor initializer Wno Wnone Werror FreeBSD prec livelocks
2803  LocalWords:  Solaris AIX UX RHEL Tru LHS gcc's Wundef YYENABLE NLS YYLTYPE VCG
2804  LocalWords:  yyerror cpp's Wunused yylval yylloc prepend yyparse yylex yypush
2805  LocalWords:  Graphviz xml nonterminals midrule destructor's YYSTYPE typedef ly
2806  LocalWords:  CHR chr printf stdout namespace preprocessing enum pre include's
2807  LocalWords:  YYRECOVERING nonfree destructors YYABORT YYACCEPT params enums de
2808  LocalWords:  struct yystype DJGPP lex param Haible NUM alloca YYSTACK NUL goto
2809  LocalWords:  YYMAXDEPTH Unescaped UCNs YYLTYPE's yyltype typedefs inline Yaccs
2810  LocalWords:  Heriyanto Reenable dprec Hilfinger Eggert MYEOF Folle Menezes EOF
2811  LocalWords:  Lackovic define's itemset Groff Gettext malloc NEWS'ed YYDEBUG YY
2812  LocalWords:  namespaces strerror const autoconfiguration Dconst Autoconf's FDL
2813  LocalWords:  Automake TMPDIR LESSEQ ylwrap endif yydebug YYTOKEN YYLSP ival hh
2814  LocalWords:  extern YYTOKENTYPE TOKENTYPE yytokentype tokentype STYPE lval pdf
2815  LocalWords:  lang yyoutput dvi html ps POSIX lvalp llocp Wother nterm arg init
2816  LocalWords:  TOK calc yyo fval Wconflicts parsers yystackp yyval yynerrs
2817  LocalWords:  Théophile Ranquet Santet fno fnone stype associativity Tolmer
2818  LocalWords:  Wprecedence Rassoul Wempty Paolo Bonzini parser's Michiel loc
2819  LocalWords:  redeclaration sval fcaret reentrant XSLT xsl Wmaybe yyvsp Tedi
2820  LocalWords:  pragmas noreturn untyped Rozenman unexpanded Wojciech Polak
2821  LocalWords:  Alexandre MERCHANTABILITY yytype
2822
2823 Local Variables:
2824 mode: outline
2825 fill-column: 76
2826 End: