]> git.saurik.com Git - bison.git/blob - NEWS
Update.
[bison.git] / NEWS
1 Bison News
2 ----------
3
4 Changes in version 1.875c:
5
6 * New %default-prec declaration, to enable (the default) or disable
7 default rule precedences.
8
9 Changes in version 1.875b, 2003-06-17:
10
11 * GLR grammars now support locations.
12
13 * Semicolon changes:
14 - Semicolons are now allowed before "|" in grammar rules, as POSIX requires.
15 - Stray semicolons are no longer allowed at the start of a grammar.
16 - Semicolons are now required after in-grammar declarations.
17
18 Changes in version 1.875a, 2003-02-01:
19
20 * For now, %expect-count violations are now just warnings, not errors.
21 This is for compatibility with Bison 1.75 and earlier (when there are
22 reduce/reduce conflicts) and with Bison 1.30 and earlier (when there
23 are too many or too few shift/reduce conflicts). However, in future
24 versions of Bison we plan to improve the %expect machinery so that
25 these violations will become errors again.
26
27 * New configure option --disable-yacc, to disable installation of the
28 yacc command and -ly library introduced in 1.875 for POSIX conformance.
29 \f
30 Changes in version 1.875, 2003-01-01:
31
32 * The documentation license has been upgraded to version 1.2
33 of the GNU Free Documentation License.
34
35 * syntax error processing
36
37 - In Yacc-style parsers YYLLOC_DEFAULT is now used to compute error
38 locations too. This fixes bugs in error-location computation.
39
40 - %destructor
41 It is now possible to reclaim the memory associated to symbols
42 discarded during error recovery. This feature is still experimental.
43
44 - %error-verbose
45 This new directive is preferred over YYERROR_VERBOSE.
46
47 - #defining yyerror to steal internal variables is discouraged.
48 It is not guaranteed to work forever.
49
50 * POSIX conformance
51
52 - Semicolons are once again optional at the end of grammar rules.
53 This reverts to the behavior of Bison 1.33 and earlier, and improves
54 compatibility with Yacc.
55
56 - `parse error' -> `syntax error'
57 Bison now uniformly uses the term `syntax error'; formerly, the code
58 and manual sometimes used the term `parse error' instead. POSIX
59 requires `syntax error' in diagnostics, and it was thought better to
60 be consistent.
61
62 - The documentation now emphasizes that yylex and yyerror must be
63 declared before use. C99 requires this.
64
65 - Bison now parses C99 lexical constructs like UCNs and
66 backslash-newline within C escape sequences, as POSIX 1003.1-2001 requires.
67
68 - File names are properly escaped in C output. E.g., foo\bar.y is
69 output as "foo\\bar.y".
70
71 - Yacc command and library now available
72 The Bison distribution now installs a `yacc' command, as POSIX requires.
73 Also, Bison now installs a small library liby.a containing
74 implementations of Yacc-compatible yyerror and main functions.
75 This library is normally not useful, but POSIX requires it.
76
77 - Type clashes now generate warnings, not errors.
78
79 - If the user does not define YYSTYPE as a macro, Bison now declares it
80 using typedef instead of defining it as a macro.
81 For consistency, YYLTYPE is also declared instead of defined.
82
83 * Other compatibility issues
84
85 - %union directives can now have a tag before the `{', e.g., the
86 directive `%union foo {...}' now generates the C code
87 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
88 The default union tag is `YYSTYPE', for compatibility with Solaris 9 Yacc.
89 For consistency, YYLTYPE's struct tag is now `YYLTYPE' not `yyltype'.
90 This is for compatibility with both Yacc and Bison 1.35.
91
92 - `;' is output before the terminating `}' of an action, for
93 compatibility with Bison 1.35.
94
95 - Bison now uses a Yacc-style format for conflict reports, e.g.,
96 `conflicts: 2 shift/reduce, 1 reduce/reduce'.
97
98 - `yystype' and `yyltype' are now obsolescent macros instead of being
99 typedefs or tags; they are no longer documented and are planned to be
100 withdrawn in a future release.
101
102 * GLR parser notes
103
104 - GLR and inline
105 Users of Bison have to decide how they handle the portability of the
106 C keyword `inline'.
107
108 - `parsing stack overflow...' -> `parser stack overflow'
109 GLR parsers now report `parser stack overflow' as per the Bison manual.
110
111 * Bison now warns if it detects conflicting outputs to the same file,
112 e.g., it generates a warning for `bison -d -o foo.h foo.y' since
113 that command outputs both code and header to foo.h.
114
115 * #line in output files
116 - --no-line works properly.
117
118 * Bison can no longer be built by a K&R C compiler; it requires C89 or
119 later to be built. This change originally took place a few versions
120 ago, but nobody noticed until we recently asked someone to try
121 building Bison with a K&R C compiler.
122 \f
123 Changes in version 1.75, 2002-10-14:
124
125 * Bison should now work on 64-bit hosts.
126
127 * Indonesian translation thanks to Tedi Heriyanto.
128
129 * GLR parsers
130 Fix spurious parse errors.
131
132 * Pure parsers
133 Some people redefine yyerror to steal yyparse' private variables.
134 Reenable this trick until an official feature replaces it.
135
136 * Type Clashes
137 In agreement with POSIX and with other Yaccs, leaving a default
138 action is valid when $$ is untyped, and $1 typed:
139
140 untyped: ... typed;
141
142 but the converse remains an error:
143
144 typed: ... untyped;
145
146 * Values of mid-rule actions
147 The following code:
148
149 foo: { ... } { $$ = $1; } ...
150
151 was incorrectly rejected: $1 is defined in the second mid-rule
152 action, and is equal to the $$ of the first mid-rule action.
153 \f
154 Changes in version 1.50, 2002-10-04:
155
156 * GLR parsing
157 The declaration
158 %glr-parser
159 causes Bison to produce a Generalized LR (GLR) parser, capable of handling
160 almost any context-free grammar, ambiguous or not. The new declarations
161 %dprec and %merge on grammar rules allow parse-time resolution of
162 ambiguities. Contributed by Paul Hilfinger.
163
164 Unfortunately Bison 1.50 does not work properly on 64-bit hosts
165 like the Alpha, so please stick to 32-bit hosts for now.
166
167 * Output Directory
168 When not in Yacc compatibility mode, when the output file was not
169 specified, running `bison foo/bar.y' created `foo/bar.c'. It
170 now creates `bar.c'.
171
172 * Undefined token
173 The undefined token was systematically mapped to 2 which prevented
174 the use of 2 by the user. This is no longer the case.
175
176 * Unknown token numbers
177 If yylex returned an out of range value, yyparse could die. This is
178 no longer the case.
179
180 * Error token
181 According to POSIX, the error token must be 256.
182 Bison extends this requirement by making it a preference: *if* the
183 user specified that one of her tokens is numbered 256, then error
184 will be mapped onto another number.
185
186 * Verbose error messages
187 They no longer report `..., expecting error or...' for states where
188 error recovery is possible.
189
190 * End token
191 Defaults to `$end' instead of `$'.
192
193 * Error recovery now conforms to documentation and to POSIX
194 When a Bison-generated parser encounters a syntax error, it now pops
195 the stack until it finds a state that allows shifting the error
196 token. Formerly, it popped the stack until it found a state that
197 allowed some non-error action other than a default reduction on the
198 error token. The new behavior has long been the documented behavior,
199 and has long been required by POSIX. For more details, please see
200 <http://mail.gnu.org/pipermail/bug-bison/2002-May/001452.html>.
201
202 * Traces
203 Popped tokens and nonterminals are now reported.
204
205 * Larger grammars
206 Larger grammars are now supported (larger token numbers, larger grammar
207 size (= sum of the LHS and RHS lengths), larger LALR tables).
208 Formerly, many of these numbers ran afoul of 16-bit limits;
209 now these limits are 32 bits on most hosts.
210
211 * Explicit initial rule
212 Bison used to play hacks with the initial rule, which the user does
213 not write. It is now explicit, and visible in the reports and
214 graphs as rule 0.
215
216 * Useless rules
217 Before, Bison reported the useless rules, but, although not used,
218 included them in the parsers. They are now actually removed.
219
220 * Useless rules, useless nonterminals
221 They are now reported, as a warning, with their locations.
222
223 * Rules never reduced
224 Rules that can never be reduced because of conflicts are now
225 reported.
226
227 * Incorrect `Token not used'
228 On a grammar such as
229
230 %token useless useful
231 %%
232 exp: '0' %prec useful;
233
234 where a token was used to set the precedence of the last rule,
235 bison reported both `useful' and `useless' as useless tokens.
236
237 * Revert the C++ namespace changes introduced in 1.31
238 as they caused too many portability hassles.
239
240 * Default locations
241 By an accident of design, the default computation of @$ was
242 performed after another default computation was performed: @$ = @1.
243 The latter is now removed: YYLLOC_DEFAULT is fully responsible of
244 the computation of @$.
245
246 * Token end-of-file
247 The token end of file may be specified by the user, in which case,
248 the user symbol is used in the reports, the graphs, and the verbose
249 error messages instead of `$end', which remains being the default.
250 For instance
251 %token MYEOF 0
252 or
253 %token MYEOF 0 "end of file"
254
255 * Semantic parser
256 This old option, which has been broken for ages, is removed.
257
258 * New translations
259 Brazilian Portuguese, thanks to Alexandre Folle de Menezes.
260 Croatian, thanks to Denis Lackovic.
261
262 * Incorrect token definitions
263 When given `%token 'a' "A"', Bison used to output `#define 'a' 65'.
264
265 * Token definitions as enums
266 Tokens are output both as the traditional #define's, and, provided
267 the compiler supports ANSI C or is a C++ compiler, as enums.
268 This lets debuggers display names instead of integers.
269
270 * Reports
271 In addition to --verbose, bison supports --report=THINGS, which
272 produces additional information:
273 - itemset
274 complete the core item sets with their closure
275 - lookahead
276 explicitly associate lookaheads to items
277 - solved
278 describe shift/reduce conflicts solving.
279 Bison used to systematically output this information on top of
280 the report. Solved conflicts are now attached to their states.
281
282 * Type clashes
283 Previous versions don't complain when there is a type clash on
284 the default action if the rule has a mid-rule action, such as in:
285
286 %type <foo> bar
287 %%
288 bar: '0' {} '0';
289
290 This is fixed.
291
292 * GNU M4 is now required when using Bison.
293 \f
294 Changes in version 1.35, 2002-03-25:
295
296 * C Skeleton
297 Some projects use Bison's C parser with C++ compilers, and define
298 YYSTYPE as a class. The recent adjustment of C parsers for data
299 alignment and 64 bit architectures made this impossible.
300
301 Because for the time being no real solution for C++ parser
302 generation exists, kludges were implemented in the parser to
303 maintain this use. In the future, when Bison has C++ parsers, this
304 kludge will be disabled.
305
306 This kludge also addresses some C++ problems when the stack was
307 extended.
308 \f
309 Changes in version 1.34, 2002-03-12:
310
311 * File name clashes are detected
312 $ bison foo.y -d -o foo.x
313 fatal error: header and parser would both be named `foo.x'
314
315 * A missing `;' at the end of a rule triggers a warning
316 In accordance with POSIX, and in agreement with other
317 Yacc implementations, Bison will mandate this semicolon in the near
318 future. This eases the implementation of a Bison parser of Bison
319 grammars by making this grammar LALR(1) instead of LR(2). To
320 facilitate the transition, this release introduces a warning.
321
322 * Revert the C++ namespace changes introduced in 1.31, as they caused too
323 many portability hassles.
324
325 * DJGPP support added.
326
327 * Fix test suite portability problems.
328 \f
329 Changes in version 1.33, 2002-02-07:
330
331 * Fix C++ issues
332 Groff could not be compiled for the definition of size_t was lacking
333 under some conditions.
334
335 * Catch invalid @n
336 As is done with $n.
337 \f
338 Changes in version 1.32, 2002-01-23:
339
340 * Fix Yacc output file names
341
342 * Portability fixes
343
344 * Italian, Dutch translations
345 \f
346 Changes in version 1.31, 2002-01-14:
347
348 * Many Bug Fixes
349
350 * GNU Gettext and %expect
351 GNU Gettext asserts 10 s/r conflicts, but there are 7. Now that
352 Bison dies on incorrect %expectations, we fear there will be
353 too many bug reports for Gettext, so _for the time being_, %expect
354 does not trigger an error when the input file is named `plural.y'.
355
356 * Use of alloca in parsers
357 If YYSTACK_USE_ALLOCA is defined to 0, then the parsers will use
358 malloc exclusively. Since 1.29, but was not NEWS'ed.
359
360 alloca is used only when compiled with GCC, to avoid portability
361 problems as on AIX.
362
363 * When the generated parser lacks debugging code, YYDEBUG is now 0
364 (as POSIX requires) instead of being undefined.
365
366 * User Actions
367 Bison has always permitted actions such as { $$ = $1 }: it adds the
368 ending semicolon. Now if in Yacc compatibility mode, the semicolon
369 is no longer output: one has to write { $$ = $1; }.
370
371 * Better C++ compliance
372 The output parsers try to respect C++ namespaces.
373 [This turned out to be a failed experiment, and it was reverted later.]
374
375 * Reduced Grammars
376 Fixed bugs when reporting useless nonterminals.
377
378 * 64 bit hosts
379 The parsers work properly on 64 bit hosts.
380
381 * Error messages
382 Some calls to strerror resulted in scrambled or missing error messages.
383
384 * %expect
385 When the number of shift/reduce conflicts is correct, don't issue
386 any warning.
387
388 * The verbose report includes the rule line numbers.
389
390 * Rule line numbers are fixed in traces.
391
392 * Swedish translation
393
394 * Parse errors
395 Verbose parse error messages from the parsers are better looking.
396 Before: parse error: unexpected `'/'', expecting `"number"' or `'-'' or `'(''
397 Now: parse error: unexpected '/', expecting "number" or '-' or '('
398
399 * Fixed parser memory leaks.
400 When the generated parser was using malloc to extend its stacks, the
401 previous allocations were not freed.
402
403 * Fixed verbose output file.
404 Some newlines were missing.
405 Some conflicts in state descriptions were missing.
406
407 * Fixed conflict report.
408 Option -v was needed to get the result.
409
410 * %expect
411 Was not used.
412 Mismatches are errors, not warnings.
413
414 * Fixed incorrect processing of some invalid input.
415
416 * Fixed CPP guards: 9foo.h uses BISON_9FOO_H instead of 9FOO_H.
417
418 * Fixed some typos in the documentation.
419
420 * %token MY_EOF 0 is supported.
421 Before, MY_EOF was silently renumbered as 257.
422
423 * doc/refcard.tex is updated.
424
425 * %output, %file-prefix, %name-prefix.
426 New.
427
428 * --output
429 New, aliasing `--output-file'.
430 \f
431 Changes in version 1.30, 2001-10-26:
432
433 * `--defines' and `--graph' have now an optional argument which is the
434 output file name. `-d' and `-g' do not change; they do not take any
435 argument.
436
437 * `%source_extension' and `%header_extension' are removed, failed
438 experiment.
439
440 * Portability fixes.
441 \f
442 Changes in version 1.29, 2001-09-07:
443
444 * The output file does not define const, as this caused problems when used
445 with common autoconfiguration schemes. If you still use ancient compilers
446 that lack const, compile with the equivalent of the C compiler option
447 `-Dconst='. autoconf's AC_C_CONST macro provides one way to do this.
448
449 * Added `-g' and `--graph'.
450
451 * The Bison manual is now distributed under the terms of the GNU FDL.
452
453 * The input and the output files has automatically a similar extension.
454
455 * Russian translation added.
456
457 * NLS support updated; should hopefully be less troublesome.
458
459 * Added the old Bison reference card.
460
461 * Added `--locations' and `%locations'.
462
463 * Added `-S' and `--skeleton'.
464
465 * `%raw', `-r', `--raw' is disabled.
466
467 * Special characters are escaped when output. This solves the problems
468 of the #line lines with path names including backslashes.
469
470 * New directives.
471 `%yacc', `%fixed_output_files', `%defines', `%no_parser', `%verbose',
472 `%debug', `%source_extension' and `%header_extension'.
473
474 * @$
475 Automatic location tracking.
476 \f
477 Changes in version 1.28, 1999-07-06:
478
479 * Should compile better now with K&R compilers.
480
481 * Added NLS.
482
483 * Fixed a problem with escaping the double quote character.
484
485 * There is now a FAQ.
486 \f
487 Changes in version 1.27:
488
489 * The make rule which prevented bison.simple from being created on
490 some systems has been fixed.
491 \f
492 Changes in version 1.26:
493
494 * Bison now uses automake.
495
496 * New mailing lists: <bug-bison@gnu.org> and <help-bison@gnu.org>.
497
498 * Token numbers now start at 257 as previously documented, not 258.
499
500 * Bison honors the TMPDIR environment variable.
501
502 * A couple of buffer overruns have been fixed.
503
504 * Problems when closing files should now be reported.
505
506 * Generated parsers should now work even on operating systems which do
507 not provide alloca().
508 \f
509 Changes in version 1.25, 1995-10-16:
510
511 * Errors in the input grammar are not fatal; Bison keeps reading
512 the grammar file, and reports all the errors found in it.
513
514 * Tokens can now be specified as multiple-character strings: for
515 example, you could use "<=" for a token which looks like <=, instead
516 of chosing a name like LESSEQ.
517
518 * The %token_table declaration says to write a table of tokens (names
519 and numbers) into the parser file. The yylex function can use this
520 table to recognize multiple-character string tokens, or for other
521 purposes.
522
523 * The %no_lines declaration says not to generate any #line preprocessor
524 directives in the parser file.
525
526 * The %raw declaration says to use internal Bison token numbers, not
527 Yacc-compatible token numbers, when token names are defined as macros.
528
529 * The --no-parser option produces the parser tables without including
530 the parser engine; a project can now use its own parser engine.
531 The actions go into a separate file called NAME.act, in the form of
532 a switch statement body.
533 \f
534 Changes in version 1.23:
535
536 The user can define YYPARSE_PARAM as the name of an argument to be
537 passed into yyparse. The argument should have type void *. It should
538 actually point to an object. Grammar actions can access the variable
539 by casting it to the proper pointer type.
540
541 Line numbers in output file corrected.
542 \f
543 Changes in version 1.22:
544
545 --help option added.
546 \f
547 Changes in version 1.20:
548
549 Output file does not redefine const for C++.
550
551 Local Variables:
552 mode: outline
553 End:
554
555 -----
556
557 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
558 Free Software Foundation, Inc.
559
560 This file is part of Bison, the GNU Compiler Compiler.
561
562 Bison is free software; you can redistribute it and/or modify
563 it under the terms of the GNU General Public License as published by
564 the Free Software Foundation; either version 2, or (at your option)
565 any later version.
566
567 Bison is distributed in the hope that it will be useful,
568 but WITHOUT ANY WARRANTY; without even the implied warranty of
569 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
570 GNU General Public License for more details.
571
572 You should have received a copy of the GNU General Public License
573 along with autoconf; see the file COPYING. If not, write to
574 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
575 Boston, MA 02111-1307, USA.