]> git.saurik.com Git - bison.git/blame - NEWS
In the grammar file, the first column is 1 not 0 on the first line as
[bison.git] / NEWS
CommitLineData
6780ca7a
DM
1Bison News
2----------
3af4feb2 3
742e4900
JD
4Changes in version 2.3+:
5
b931235e
JD
6* Except for LALR(1) parsers in C with POSIX Yacc emulation enabled (with `-y',
7 `--yacc', or `%yacc'), Bison no longer generates #define statements for
8 associating token numbers with token names. Removing the #define statements
9 helps to sanitize the global namespace during preprocessing, but POSIX Yacc
10 requires them. Bison still generates an enum for token names in all cases.
11
34f98f46
JD
12* Handling of traditional Yacc prologue blocks is now more consistent but
13 potentially incompatible with previous releases of Bison.
9bc0dd67
JD
14
15 As before, you declare prologue blocks in your grammar file with the
16 `%{ ... %}' syntax. To generate the pre-prologue, Bison concatenates all
34f98f46
JD
17 prologue blocks that you've declared before the first %union. To generate
18 the post-prologue, Bison concatenates all prologue blocks that you've
19 declared after the first %union.
9bc0dd67 20
34f98f46 21 Previous releases of Bison inserted the pre-prologue into both the header
9bc0dd67
JD
22 file and the code file in all cases except for LALR(1) parsers in C. In the
23 latter case, Bison inserted it only into the code file. For parsers in C++,
24 the point of insertion was before any token definitions (which associate
25 token numbers with names). For parsers in C, the point of insertion was
26 after the token definitions.
27
28 Now, Bison never inserts the pre-prologue into the header file. In the code
29 file, it always inserts it before the token definitions.
30
34f98f46
JD
31* Bison now provides a more flexible alternative to the traditional Yacc
32 prologue blocks: %before-header, %start-header, %end-header, and
33 %after-header.
34
35 For example, the following declaration order in the grammar file reflects the
36 order in which Bison will output these code blocks. However, you are free to
37 declare these code blocks in your grammar file in whatever order is most
38 convenient for you:
39
40 %before-header {
41 /* Bison treats this block like a pre-prologue block: it inserts it into
42 * the code file before the contents of the header file. It does *not*
43 * insert it into the header file. This is a good place to put
44 * #include's that you want at the top of your code file. A common
45 * example is `#include "system.h"'. */
46 }
47 %start-header {
48 /* Bison inserts this block into both the header file and the code file.
49 * In both files, the point of insertion is before any Bison-generated
50 * token, semantic type, location type, and class definitions. This is a
51 * good place to define %union dependencies, for example. */
9bc0dd67
JD
52 }
53 %union {
34f98f46
JD
54 /* Unlike the traditional Yacc prologue blocks, the output order for the
55 * new %*-header blocks is not affected by their declaration position
56 * relative to any %union in the grammar file. */
9bc0dd67 57 }
34f98f46
JD
58 %end-header {
59 /* Bison inserts this block into both the header file and the code file.
60 * In both files, the point of insertion is after the Bison-generated
61 * definitions. This is a good place to declare or define public
62 * functions or data structures that depend on the Bison-generated
63 * definitions. */
9bc0dd67 64 }
34f98f46
JD
65 %after-header {
66 /* Bison treats this block like a post-prologue block: it inserts it into
67 * the code file after the contents of the header file. It does *not*
68 * insert it into the header file. This is a good place to declare or
69 * define internal functions or data structures that depend on the
70 * Bison-generated definitions. */
71 }
72
73 If you have multiple occurrences of any one of the above declarations, Bison
74 will concatenate the contents in declaration order.
9bc0dd67 75
742e4900 76* The option `--report=look-ahead' has been changed to `--report=lookahead'.
9e6e7ed2
PE
77 The old spelling still works, but is not documented and may be removed
78 in a future release.
742e4900 79
4ad3ed84
PE
80Changes in version 2.3, 2006-06-05:
81
82* GLR grammars should now use `YYRECOVERING ()' instead of `YYRECOVERING',
83 for compatibility with LALR(1) grammars.
84
85* It is now documented that any definition of YYSTYPE or YYLTYPE should
86 be to a type name that does not contain parentheses or brackets.
87
ab8d9dc5 88Changes in version 2.2, 2006-05-19:
193d7c70
PE
89
90* The distribution terms for all Bison-generated parsers now permit
91 using the parsers in nonfree programs. Previously, this permission
92 was granted only for Bison-generated LALR(1) parsers in C.
5f4236a0 93
aa08666d
AD
94* %name-prefix changes the namespace name in C++ outputs.
95
96* The C++ parsers export their token_type.
5f4236a0 97
d6ca7905
PE
98* Bison now allows multiple %union declarations, and concatenates
99 their contents together.
100
affac613 101* New warning: unused values
4d7bc38c
PE
102 Right-hand side symbols whose values are not used are reported,
103 if the symbols have destructors. For instance:
affac613 104
8f3596a6 105 exp: exp "?" exp ":" exp { $1 ? $1 : $3; }
721be13c
PE
106 | exp "+" exp
107 ;
affac613 108
8f3596a6
AD
109 will trigger a warning about $$ and $5 in the first rule, and $3 in
110 the second ($1 is copied to $$ by the default rule). This example
4e26c69e 111 most likely contains three errors, and could be rewritten as:
affac613 112
4e26c69e
PE
113 exp: exp "?" exp ":" exp
114 { $$ = $1 ? $3 : $5; free ($1 ? $5 : $3); free ($1); }
115 | exp "+" exp
116 { $$ = $1 ? $1 : $3; if ($1) free ($3); }
721be13c 117 ;
affac613 118
4e26c69e
PE
119 However, if the original actions were really intended, memory leaks
120 and all, the warnings can be suppressed by letting Bison believe the
121 values are used, e.g.:
721be13c 122
8f3596a6 123 exp: exp "?" exp ":" exp { $1 ? $1 : $3; (void) ($$, $5); }
721be13c
PE
124 | exp "+" exp { $$ = $1; (void) $3; }
125 ;
126
84866159
AD
127 If there are mid-rule actions, the warning is issued if no action
128 uses it. The following triggers no warning: $1 and $3 are used.
129
130 exp: exp { push ($1); } '+' exp { push ($3); sum (); };
131
721be13c
PE
132 The warning is intended to help catching lost values and memory leaks.
133 If a value is ignored, its associated memory typically is not reclaimed.
affac613 134
9d9b8b70
PE
135* %destructor vs. YYABORT, YYACCEPT, and YYERROR.
136 Destructors are now called when user code invokes YYABORT, YYACCEPT,
137 and YYERROR, for all objects on the stack, other than objects
138 corresponding to the right-hand side of the current rule.
a85284cf 139
035aa4a0
PE
140* %expect, %expect-rr
141 Incorrect numbers of expected conflicts are now actual errors,
142 instead of warnings.
143
4b367315 144* GLR, YACC parsers.
4e26c69e
PE
145 The %parse-params are available in the destructors (and the
146 experimental printers) as per the documentation.
4b367315 147
302c0aee 148* Bison now warns if it finds a stray `$' or `@' in an action.
ad6a9b97 149
b50d2359 150* %require "VERSION"
4e26c69e
PE
151 This specifies that the grammar file depends on features implemented
152 in Bison version VERSION or higher.
b50d2359 153
fb9712a9 154* lalr1.cc: The token and value types are now class members.
e14d0ab6
AD
155 The tokens were defined as free form enums and cpp macros. YYSTYPE
156 was defined as a free form union. They are now class members:
fb9712a9
AD
157 tokens are enumerations of the `yy::parser::token' struct, and the
158 semantic values have the `yy::parser::semantic_type' type.
159
160 If you do not want or can update to this scheme, the directive
161 `%define "global_tokens_and_yystype" "1"' triggers the global
b50d2359
AD
162 definition of tokens and YYSTYPE. This change is suitable both
163 for previous releases of Bison, and this one.
fb9712a9 164
b50d2359 165 If you wish to update, then make sure older version of Bison will
ab8d9dc5 166 fail using `%require "2.2"'.
fb9712a9 167
302c0aee 168* DJGPP support added.
193d7c70 169\f
1bd0deda 170Changes in version 2.1, 2005-09-16:
1ce59070 171
e14d0ab6
AD
172* The C++ lalr1.cc skeleton supports %lex-param.
173
a7db4add 174* Bison-generated parsers now support the translation of diagnostics like
baf785db
PE
175 "syntax error" into languages other than English. The default
176 language is still English. For details, please see the new
0410a6e0
PE
177 Internationalization section of the Bison manual. Software
178 distributors should also see the new PACKAGING file. Thanks to
179 Bruno Haible for this new feature.
1ce59070 180
1a059451
PE
181* Wording in the Bison-generated parsers has been changed slightly to
182 simplify translation. In particular, the message "memory exhausted"
183 has replaced "parser stack overflow", as the old message was not
184 always accurate for modern Bison-generated parsers.
185
258b75ca
PE
186* Destructors are now called when the parser aborts, for all symbols left
187 behind on the stack. Also, the start symbol is now destroyed after a
188 successful parse. In both cases, the behavior was formerly inconsistent.
189
a7db4add 190* When generating verbose diagnostics, Bison-generated parsers no longer
72f000b0
PE
191 quote the literal strings associated with tokens. For example, for
192 a syntax error associated with '%token NUM "number"' they might
193 print 'syntax error, unexpected number' instead of 'syntax error,
194 unexpected "number"'.
193d7c70 195\f
82de6b0d 196Changes in version 2.0, 2004-12-25:
efeed023 197
82de6b0d 198* Possibly-incompatible changes
d7e14fc0 199
82de6b0d
PE
200 - Bison-generated parsers no longer default to using the alloca function
201 (when available) to extend the parser stack, due to widespread
202 problems in unchecked stack-overflow detection. You can "#define
203 YYSTACK_USE_ALLOCA 1" to require the use of alloca, but please read
204 the manual to determine safe values for YYMAXDEPTH in that case.
8dd162d3 205
82de6b0d
PE
206 - Error token location.
207 During error recovery, the location of the syntax error is updated
208 to cover the whole sequence covered by the error token: it includes
209 the shifted symbols thrown away during the first part of the error
210 recovery, and the lookahead rejected during the second part.
18d192f0 211
82de6b0d
PE
212 - Semicolon changes:
213 . Stray semicolons are no longer allowed at the start of a grammar.
214 . Semicolons are now required after in-grammar declarations.
e342c3be 215
82de6b0d
PE
216 - Unescaped newlines are no longer allowed in character constants or
217 string literals. They were never portable, and GCC 3.4.0 has
218 dropped support for them. Better diagnostics are now generated if
219 forget a closing quote.
8dd162d3 220
82de6b0d 221 - NUL bytes are no longer allowed in Bison string literals, unfortunately.
f74b6f91 222
82de6b0d 223* New features
1452af69 224
82de6b0d 225 - GLR grammars now support locations.
4febdd96 226
82de6b0d
PE
227 - New directive: %initial-action.
228 This directive allows the user to run arbitrary code (including
229 initializing @$) from yyparse before parsing starts.
1452af69 230
82de6b0d
PE
231 - A new directive "%expect-rr N" specifies the expected number of
232 reduce/reduce conflicts in GLR parsers.
1452af69 233
82de6b0d
PE
234 - %token numbers can now be hexadecimal integers, e.g., `%token FOO 0x12d'.
235 This is a GNU extension.
4febdd96 236
82de6b0d 237 - The option `--report=lookahead' was changed to `--report=look-ahead'.
9e6e7ed2 238 [However, this was changed back after 2.3.]
1452af69 239
82de6b0d 240 - Experimental %destructor support has been added to lalr1.cc.
1452af69 241
82de6b0d
PE
242 - New configure option --disable-yacc, to disable installation of the
243 yacc command and -ly library introduced in 1.875 for POSIX conformance.
6040d338 244
82de6b0d 245* Bug fixes
d5a3fe37 246
82de6b0d
PE
247 - For now, %expect-count violations are now just warnings, not errors.
248 This is for compatibility with Bison 1.75 and earlier (when there are
249 reduce/reduce conflicts) and with Bison 1.30 and earlier (when there
250 are too many or too few shift/reduce conflicts). However, in future
251 versions of Bison we plan to improve the %expect machinery so that
252 these violations will become errors again.
3473d0f8 253
82de6b0d
PE
254 - Within Bison itself, numbers (e.g., goto numbers) are no longer
255 arbitrarily limited to 16-bit counts.
d600ee67 256
82de6b0d 257 - Semicolons are now allowed before "|" in grammar rules, as POSIX requires.
d600ee67 258\f
dc546b0f 259Changes in version 1.875, 2003-01-01:
963fcc17 260
dc546b0f
PE
261* The documentation license has been upgraded to version 1.2
262 of the GNU Free Documentation License.
75eb3bc4 263
dc546b0f 264* syntax error processing
75eb3bc4 265
dc546b0f
PE
266 - In Yacc-style parsers YYLLOC_DEFAULT is now used to compute error
267 locations too. This fixes bugs in error-location computation.
75eb3bc4 268
dc546b0f
PE
269 - %destructor
270 It is now possible to reclaim the memory associated to symbols
271 discarded during error recovery. This feature is still experimental.
20daca06 272
dc546b0f
PE
273 - %error-verbose
274 This new directive is preferred over YYERROR_VERBOSE.
74724a70 275
dc546b0f
PE
276 - #defining yyerror to steal internal variables is discouraged.
277 It is not guaranteed to work forever.
d1de5372 278
dc546b0f 279* POSIX conformance
d1de5372 280
dc546b0f
PE
281 - Semicolons are once again optional at the end of grammar rules.
282 This reverts to the behavior of Bison 1.33 and earlier, and improves
283 compatibility with Yacc.
74724a70 284
dc546b0f
PE
285 - `parse error' -> `syntax error'
286 Bison now uniformly uses the term `syntax error'; formerly, the code
287 and manual sometimes used the term `parse error' instead. POSIX
288 requires `syntax error' in diagnostics, and it was thought better to
289 be consistent.
74724a70 290
dc546b0f
PE
291 - The documentation now emphasizes that yylex and yyerror must be
292 declared before use. C99 requires this.
d1de5372 293
dc546b0f
PE
294 - Bison now parses C99 lexical constructs like UCNs and
295 backslash-newline within C escape sequences, as POSIX 1003.1-2001 requires.
d1de5372 296
dc546b0f
PE
297 - File names are properly escaped in C output. E.g., foo\bar.y is
298 output as "foo\\bar.y".
6780ca7a 299
dc546b0f
PE
300 - Yacc command and library now available
301 The Bison distribution now installs a `yacc' command, as POSIX requires.
302 Also, Bison now installs a small library liby.a containing
303 implementations of Yacc-compatible yyerror and main functions.
304 This library is normally not useful, but POSIX requires it.
6e649e65 305
dc546b0f 306 - Type clashes now generate warnings, not errors.
6e649e65 307
dc546b0f
PE
308 - If the user does not define YYSTYPE as a macro, Bison now declares it
309 using typedef instead of defining it as a macro.
310 For consistency, YYLTYPE is also declared instead of defined.
9501dc6e 311
dc546b0f 312* Other compatibility issues
886a425c 313
dc546b0f
PE
314 - %union directives can now have a tag before the `{', e.g., the
315 directive `%union foo {...}' now generates the C code
316 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
317 The default union tag is `YYSTYPE', for compatibility with Solaris 9 Yacc.
318 For consistency, YYLTYPE's struct tag is now `YYLTYPE' not `yyltype'.
319 This is for compatibility with both Yacc and Bison 1.35.
72f889cc 320
dc546b0f
PE
321 - `;' is output before the terminating `}' of an action, for
322 compatibility with Bison 1.35.
886a425c 323
dc546b0f
PE
324 - Bison now uses a Yacc-style format for conflict reports, e.g.,
325 `conflicts: 2 shift/reduce, 1 reduce/reduce'.
437c2d80 326
dc546b0f
PE
327 - `yystype' and `yyltype' are now obsolescent macros instead of being
328 typedefs or tags; they are no longer documented and are planned to be
329 withdrawn in a future release.
2a8d363a 330
dc546b0f 331* GLR parser notes
2a8d363a 332
dc546b0f
PE
333 - GLR and inline
334 Users of Bison have to decide how they handle the portability of the
335 C keyword `inline'.
959e5f51 336
dc546b0f
PE
337 - `parsing stack overflow...' -> `parser stack overflow'
338 GLR parsers now report `parser stack overflow' as per the Bison manual.
900c5db5 339
dc546b0f
PE
340* Bison now warns if it detects conflicting outputs to the same file,
341 e.g., it generates a warning for `bison -d -o foo.h foo.y' since
342 that command outputs both code and header to foo.h.
6e40b4eb 343
dc546b0f
PE
344* #line in output files
345 - --no-line works properly.
6e40b4eb
AD
346
347* Bison can no longer be built by a K&R C compiler; it requires C89 or
348 later to be built. This change originally took place a few versions
349 ago, but nobody noticed until we recently asked someone to try
350 building Bison with a K&R C compiler.
d600ee67 351\f
5c16c6b1 352Changes in version 1.75, 2002-10-14:
7933f2b5
PE
353
354* Bison should now work on 64-bit hosts.
355
b7195100 356* Indonesian translation thanks to Tedi Heriyanto.
7933f2b5 357
f50adbbd
AD
358* GLR parsers
359 Fix spurious parse errors.
360
361* Pure parsers
362 Some people redefine yyerror to steal yyparse' private variables.
363 Reenable this trick until an official feature replaces it.
364
d90c934c
AD
365* Type Clashes
366 In agreement with POSIX and with other Yaccs, leaving a default
367 action is valid when $$ is untyped, and $1 typed:
368
369 untyped: ... typed;
370
371 but the converse remains an error:
372
373 typed: ... untyped;
374
375* Values of mid-rule actions
376 The following code:
377
378 foo: { ... } { $$ = $1; } ...
379
380 was incorrectly rejected: $1 is defined in the second mid-rule
381 action, and is equal to the $$ of the first mid-rule action.
d600ee67 382\f
420f93c8 383Changes in version 1.50, 2002-10-04:
adc8c848 384
676385e2
PH
385* GLR parsing
386 The declaration
387 %glr-parser
388 causes Bison to produce a Generalized LR (GLR) parser, capable of handling
389 almost any context-free grammar, ambiguous or not. The new declarations
e8832397 390 %dprec and %merge on grammar rules allow parse-time resolution of
676385e2
PH
391 ambiguities. Contributed by Paul Hilfinger.
392
7933f2b5 393 Unfortunately Bison 1.50 does not work properly on 64-bit hosts
420f93c8
PE
394 like the Alpha, so please stick to 32-bit hosts for now.
395
8c165d89
AD
396* Output Directory
397 When not in Yacc compatibility mode, when the output file was not
e88dbdbf 398 specified, running `bison foo/bar.y' created `foo/bar.c'. It
8c165d89
AD
399 now creates `bar.c'.
400
007a50a4
AD
401* Undefined token
402 The undefined token was systematically mapped to 2 which prevented
e88dbdbf 403 the use of 2 by the user. This is no longer the case.
007a50a4 404
77714df2 405* Unknown token numbers
e88dbdbf 406 If yylex returned an out of range value, yyparse could die. This is
007a50a4
AD
407 no longer the case.
408
23c5a174 409* Error token
e88dbdbf 410 According to POSIX, the error token must be 256.
23c5a174
AD
411 Bison extends this requirement by making it a preference: *if* the
412 user specified that one of her tokens is numbered 256, then error
413 will be mapped onto another number.
414
217598da 415* Verbose error messages
e88dbdbf 416 They no longer report `..., expecting error or...' for states where
217598da
AD
417 error recovery is possible.
418
419* End token
420 Defaults to `$end' instead of `$'.
421
68cd8af3
PE
422* Error recovery now conforms to documentation and to POSIX
423 When a Bison-generated parser encounters a syntax error, it now pops
424 the stack until it finds a state that allows shifting the error
425 token. Formerly, it popped the stack until it found a state that
426 allowed some non-error action other than a default reduction on the
427 error token. The new behavior has long been the documented behavior,
428 and has long been required by POSIX. For more details, please see
337116ba
PE
429 Paul Eggert, "Reductions during Bison error handling" (2002-05-20)
430 <http://lists.gnu.org/archive/html/bug-bison/2002-05/msg00038.html>.
68cd8af3 431
5504898e
AD
432* Traces
433 Popped tokens and nonterminals are now reported.
434
a861a339
PE
435* Larger grammars
436 Larger grammars are now supported (larger token numbers, larger grammar
437 size (= sum of the LHS and RHS lengths), larger LALR tables).
438 Formerly, many of these numbers ran afoul of 16-bit limits;
439 now these limits are 32 bits on most hosts.
355e7c1c 440
77714df2 441* Explicit initial rule
643a5994
AD
442 Bison used to play hacks with the initial rule, which the user does
443 not write. It is now explicit, and visible in the reports and
444 graphs as rule 0.
23c5a174 445
77714df2 446* Useless rules
643a5994 447 Before, Bison reported the useless rules, but, although not used,
77714df2 448 included them in the parsers. They are now actually removed.
23c5a174 449
6b98e4b5
AD
450* Useless rules, useless nonterminals
451 They are now reported, as a warning, with their locations.
452
e8832397
AD
453* Rules never reduced
454 Rules that can never be reduced because of conflicts are now
455 reported.
456
77714df2 457* Incorrect `Token not used'
11652ab3
AD
458 On a grammar such as
459
460 %token useless useful
461 %%
462 exp: '0' %prec useful;
463
464 where a token was used to set the precedence of the last rule,
465 bison reported both `useful' and `useless' as useless tokens.
466
77714df2
AD
467* Revert the C++ namespace changes introduced in 1.31
468 as they caused too many portability hassles.
0179dd65 469
b2d52318
AD
470* Default locations
471 By an accident of design, the default computation of @$ was
472 performed after another default computation was performed: @$ = @1.
473 The latter is now removed: YYLLOC_DEFAULT is fully responsible of
474 the computation of @$.
adc8c848 475
b7c49edf
AD
476* Token end-of-file
477 The token end of file may be specified by the user, in which case,
478 the user symbol is used in the reports, the graphs, and the verbose
a861a339 479 error messages instead of `$end', which remains being the default.
b7c49edf 480 For instance
7bd6c77e 481 %token MYEOF 0
b7c49edf 482 or
7bd6c77e 483 %token MYEOF 0 "end of file"
fdbcd8e2
AD
484
485* Semantic parser
486 This old option, which has been broken for ages, is removed.
487
a861a339
PE
488* New translations
489 Brazilian Portuguese, thanks to Alexandre Folle de Menezes.
84614e13
AD
490 Croatian, thanks to Denis Lackovic.
491
77714df2 492* Incorrect token definitions
e88dbdbf 493 When given `%token 'a' "A"', Bison used to output `#define 'a' 65'.
b87f8b21 494
77714df2
AD
495* Token definitions as enums
496 Tokens are output both as the traditional #define's, and, provided
497 the compiler supports ANSI C or is a C++ compiler, as enums.
e88dbdbf 498 This lets debuggers display names instead of integers.
77714df2 499
ec3bc396
AD
500* Reports
501 In addition to --verbose, bison supports --report=THINGS, which
502 produces additional information:
b408954b
AD
503 - itemset
504 complete the core item sets with their closure
9e6e7ed2
PE
505 - lookahead [changed to `look-ahead' in 1.875e through 2.3, but changed back]
506 explicitly associate lookahead tokens to items
b408954b
AD
507 - solved
508 describe shift/reduce conflicts solving.
509 Bison used to systematically output this information on top of
510 the report. Solved conflicts are now attached to their states.
ec3bc396 511
9af3fbce
AD
512* Type clashes
513 Previous versions don't complain when there is a type clash on
514 the default action if the rule has a mid-rule action, such as in:
515
516 %type <foo> bar
517 %%
518 bar: '0' {} '0';
519
520 This is fixed.
a861a339
PE
521
522* GNU M4 is now required when using Bison.
f987e9d2 523\f
76551463
AD
524Changes in version 1.35, 2002-03-25:
525
526* C Skeleton
527 Some projects use Bison's C parser with C++ compilers, and define
528 YYSTYPE as a class. The recent adjustment of C parsers for data
529 alignment and 64 bit architectures made this impossible.
530
531 Because for the time being no real solution for C++ parser
532 generation exists, kludges were implemented in the parser to
533 maintain this use. In the future, when Bison has C++ parsers, this
534 kludge will be disabled.
535
536 This kludge also addresses some C++ problems when the stack was
537 extended.
76551463
AD
538\f
539Changes in version 1.34, 2002-03-12:
540
541* File name clashes are detected
542 $ bison foo.y -d -o foo.x
543 fatal error: header and parser would both be named `foo.x'
544
545* A missing `;' at the end of a rule triggers a warning
546 In accordance with POSIX, and in agreement with other
547 Yacc implementations, Bison will mandate this semicolon in the near
548 future. This eases the implementation of a Bison parser of Bison
549 grammars by making this grammar LALR(1) instead of LR(2). To
550 facilitate the transition, this release introduces a warning.
551
552* Revert the C++ namespace changes introduced in 1.31, as they caused too
553 many portability hassles.
554
555* DJGPP support added.
556
557* Fix test suite portability problems.
558\f
559Changes in version 1.33, 2002-02-07:
560
561* Fix C++ issues
562 Groff could not be compiled for the definition of size_t was lacking
563 under some conditions.
564
565* Catch invalid @n
566 As is done with $n.
567\f
568Changes in version 1.32, 2002-01-23:
569
570* Fix Yacc output file names
571
572* Portability fixes
573
574* Italian, Dutch translations
575\f
52d1aeee
MA
576Changes in version 1.31, 2002-01-14:
577
578* Many Bug Fixes
579
580* GNU Gettext and %expect
581 GNU Gettext asserts 10 s/r conflicts, but there are 7. Now that
582 Bison dies on incorrect %expectations, we fear there will be
583 too many bug reports for Gettext, so _for the time being_, %expect
584 does not trigger an error when the input file is named `plural.y'.
585
586* Use of alloca in parsers
587 If YYSTACK_USE_ALLOCA is defined to 0, then the parsers will use
588 malloc exclusively. Since 1.29, but was not NEWS'ed.
589
590 alloca is used only when compiled with GCC, to avoid portability
591 problems as on AIX.
592
b47dbebe
PE
593* yyparse now returns 2 if memory is exhausted; formerly it dumped core.
594
52d1aeee
MA
595* When the generated parser lacks debugging code, YYDEBUG is now 0
596 (as POSIX requires) instead of being undefined.
597
598* User Actions
599 Bison has always permitted actions such as { $$ = $1 }: it adds the
600 ending semicolon. Now if in Yacc compatibility mode, the semicolon
601 is no longer output: one has to write { $$ = $1; }.
602
603* Better C++ compliance
604 The output parsers try to respect C++ namespaces.
76551463 605 [This turned out to be a failed experiment, and it was reverted later.]
52d1aeee
MA
606
607* Reduced Grammars
608 Fixed bugs when reporting useless nonterminals.
609
610* 64 bit hosts
611 The parsers work properly on 64 bit hosts.
612
613* Error messages
614 Some calls to strerror resulted in scrambled or missing error messages.
615
616* %expect
617 When the number of shift/reduce conflicts is correct, don't issue
618 any warning.
619
620* The verbose report includes the rule line numbers.
621
622* Rule line numbers are fixed in traces.
623
624* Swedish translation
625
626* Parse errors
627 Verbose parse error messages from the parsers are better looking.
628 Before: parse error: unexpected `'/'', expecting `"number"' or `'-'' or `'(''
629 Now: parse error: unexpected '/', expecting "number" or '-' or '('
630
631* Fixed parser memory leaks.
632 When the generated parser was using malloc to extend its stacks, the
633 previous allocations were not freed.
634
635* Fixed verbose output file.
636 Some newlines were missing.
637 Some conflicts in state descriptions were missing.
638
639* Fixed conflict report.
640 Option -v was needed to get the result.
641
642* %expect
643 Was not used.
644 Mismatches are errors, not warnings.
645
646* Fixed incorrect processing of some invalid input.
647
648* Fixed CPP guards: 9foo.h uses BISON_9FOO_H instead of 9FOO_H.
649
650* Fixed some typos in the documentation.
651
652* %token MY_EOF 0 is supported.
653 Before, MY_EOF was silently renumbered as 257.
654
655* doc/refcard.tex is updated.
656
657* %output, %file-prefix, %name-prefix.
658 New.
659
660* --output
661 New, aliasing `--output-file'.
662\f
76551463 663Changes in version 1.30, 2001-10-26:
342b8b6e 664
fdac0091
PE
665* `--defines' and `--graph' have now an optional argument which is the
666 output file name. `-d' and `-g' do not change; they do not take any
342b8b6e
AD
667 argument.
668
669* `%source_extension' and `%header_extension' are removed, failed
670 experiment.
671
f987e9d2
AD
672* Portability fixes.
673\f
9f4503d6 674Changes in version 1.29, 2001-09-07:
342b8b6e
AD
675
676* The output file does not define const, as this caused problems when used
677 with common autoconfiguration schemes. If you still use ancient compilers
678 that lack const, compile with the equivalent of the C compiler option
679 `-Dconst='. autoconf's AC_C_CONST macro provides one way to do this.
680
681* Added `-g' and `--graph'.
f87a2205 682
f2b5126e
PB
683* The Bison manual is now distributed under the terms of the GNU FDL.
684
f1c63ced 685* The input and the output files has automatically a similar extension.
234a3be3 686
f87a2205
JT
687* Russian translation added.
688
689* NLS support updated; should hopefully be less troublesome.
690
691* Added the old Bison reference card.
c33638bb
AD
692
693* Added `--locations' and `%locations'.
6deb4447 694
cd5bd6ac
AD
695* Added `-S' and `--skeleton'.
696
62ab6972
AD
697* `%raw', `-r', `--raw' is disabled.
698
cd5bd6ac
AD
699* Special characters are escaped when output. This solves the problems
700 of the #line lines with path names including backslashes.
701
6deb4447 702* New directives.
4ecbf796
MA
703 `%yacc', `%fixed_output_files', `%defines', `%no_parser', `%verbose',
704 `%debug', `%source_extension' and `%header_extension'.
f987e9d2
AD
705
706* @$
707 Automatic location tracking.
f87a2205 708\f
9f4503d6 709Changes in version 1.28, 1999-07-06:
d2e00347
JT
710
711* Should compile better now with K&R compilers.
712
713* Added NLS.
714
715* Fixed a problem with escaping the double quote character.
716
717* There is now a FAQ.
718\f
5c31c3c2
JT
719Changes in version 1.27:
720
721* The make rule which prevented bison.simple from being created on
722 some systems has been fixed.
723\f
724Changes in version 1.26:
4be07551
JT
725
726* Bison now uses automake.
727
728* New mailing lists: <bug-bison@gnu.org> and <help-bison@gnu.org>.
729
730* Token numbers now start at 257 as previously documented, not 258.
731
732* Bison honors the TMPDIR environment variable.
733
734* A couple of buffer overruns have been fixed.
f51dbca1
JT
735
736* Problems when closing files should now be reported.
737
738* Generated parsers should now work even on operating systems which do
739 not provide alloca().
4be07551 740\f
9f4503d6 741Changes in version 1.25, 1995-10-16:
df8878c5
RS
742
743* Errors in the input grammar are not fatal; Bison keeps reading
744the grammar file, and reports all the errors found in it.
8c44d3ec 745
df8878c5
RS
746* Tokens can now be specified as multiple-character strings: for
747example, you could use "<=" for a token which looks like <=, instead
748of chosing a name like LESSEQ.
749
750* The %token_table declaration says to write a table of tokens (names
751and numbers) into the parser file. The yylex function can use this
752table to recognize multiple-character string tokens, or for other
753purposes.
754
755* The %no_lines declaration says not to generate any #line preprocessor
756directives in the parser file.
757
758* The %raw declaration says to use internal Bison token numbers, not
759Yacc-compatible token numbers, when token names are defined as macros.
760
761* The --no-parser option produces the parser tables without including
762the parser engine; a project can now use its own parser engine.
763The actions go into a separate file called NAME.act, in the form of
764a switch statement body.
765\f
6780ca7a
DM
766Changes in version 1.23:
767
4d019228
DM
768The user can define YYPARSE_PARAM as the name of an argument to be
769passed into yyparse. The argument should have type void *. It should
770actually point to an object. Grammar actions can access the variable
771by casting it to the proper pointer type.
6780ca7a 772
6780ca7a 773Line numbers in output file corrected.
6780ca7a
DM
774\f
775Changes in version 1.22:
776
777--help option added.
6780ca7a
DM
778\f
779Changes in version 1.20:
780
781Output file does not redefine const for C++.
9f4503d6
AD
782
783Local Variables:
784mode: outline
785End:
76551463
AD
786
787-----
788
d6ca7905
PE
789Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
7902004, 2005, 2006 Free Software Foundation, Inc.
76551463 791
75eb3bc4 792This file is part of Bison, the GNU Compiler Compiler.
76551463 793
75eb3bc4 794Bison is free software; you can redistribute it and/or modify
76551463
AD
795it under the terms of the GNU General Public License as published by
796the Free Software Foundation; either version 2, or (at your option)
797any later version.
798
75eb3bc4 799Bison is distributed in the hope that it will be useful,
76551463
AD
800but WITHOUT ANY WARRANTY; without even the implied warranty of
801MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
802GNU General Public License for more details.
803
804You should have received a copy of the GNU General Public License
805along with autoconf; see the file COPYING. If not, write to
0fb669f9
PE
806the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
807Boston, MA 02110-1301, USA.