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