]> git.saurik.com Git - bison.git/blob - NEWS
* src/state.h, src/state.c (state_new): New, extracted from...
[bison.git] / NEWS
1 Bison News
2 ----------
3
4 Changes in version 1.49b:
5
6 * GLR parsing
7 The declaration
8 %glr-parser
9 causes Bison to produce a Generalized LR (GLR) parser, capable of handling
10 almost any context-free grammar, ambiguous or not. The new declarations
11 %dprec and %merge on grammar rules allow parse-time resolution of
12 ambiguities. Contributed by Paul Hilfinger.
13
14 * Output Directory
15 When not in Yacc compatibility mode, when the output file was not
16 specified, runnning `bison foo/bar.y' created `foo/bar.c'. It
17 now creates `bar.c'.
18
19 * Undefined token
20 The undefined token was systematically mapped to 2 which prevented
21 the use of 2 from the user. This is no longer the case.
22
23 * Unknown token numbers
24 If yylex returned a code out of range, yyparse could die. This is
25 no longer the case.
26
27 * Error token
28 According to POSIX, the error token should be numbered as 256.
29 Bison extends this requirement by making it a preference: *if* the
30 user specified that one of her tokens is numbered 256, then error
31 will be mapped onto another number.
32
33 * Error recovery now conforms to documentation and to POSIX
34 When a Bison-generated parser encounters a syntax error, it now pops
35 the stack until it finds a state that allows shifting the error
36 token. Formerly, it popped the stack until it found a state that
37 allowed some non-error action other than a default reduction on the
38 error token. The new behavior has long been the documented behavior,
39 and has long been required by POSIX. For more details, please see
40 <http://mail.gnu.org/pipermail/bug-bison/2002-May/001452.html>.
41
42 * Traces
43 Popped tokens and nonterminals are now reported.
44
45 * Large grammars
46 Large grammars are now supported (large token numbers, large grammar
47 size (= sum of the LHS and RHS lengths), large LALR tables).
48
49 * Explicit initial rule
50 Bison used to play hacks with the initial rule, which the user does
51 not write. It is now explicit, and visible in the reports and
52 graphs as rule 0.
53
54 * Useless rules
55 Before, Bison reported the useless rules, but, although not used,
56 included them in the parsers. They are now actually removed.
57
58 * Useless rules, useless nonterminals
59 They are now reported, as a warning, with their locations.
60
61 * Incorrect `Token not used'
62 On a grammar such as
63
64 %token useless useful
65 %%
66 exp: '0' %prec useful;
67
68 where a token was used to set the precedence of the last rule,
69 bison reported both `useful' and `useless' as useless tokens.
70
71 * Revert the C++ namespace changes introduced in 1.31
72 as they caused too many portability hassles.
73
74 * Default locations
75 By an accident of design, the default computation of @$ was
76 performed after another default computation was performed: @$ = @1.
77 The latter is now removed: YYLLOC_DEFAULT is fully responsible of
78 the computation of @$.
79
80 * Token end-of-file
81 The token end of file may be specified by the user, in which case,
82 the user symbol is used in the reports, the graphs, and the verbose
83 error messages instead of `$', which remains being the defaults.
84 For instance
85 %token YYEOF 0
86 or
87 %token YYEOF 0 "end of file"
88
89 * Semantic parser
90 This old option, which has been broken for ages, is removed.
91
92 * New translation
93 Croatian, thanks to Denis Lackovic.
94
95 * Incorrect token definitions
96 When fed with `%token 'a' "A"', Bison used to output `#define 'a' 65'.
97
98 * Token definitions as enums
99 Tokens are output both as the traditional #define's, and, provided
100 the compiler supports ANSI C or is a C++ compiler, as enums.
101 This helps debuggers producing symbols instead of values.
102
103 * Reports
104 In addition to --verbose, bison supports --report=THINGS, which
105 produces additional information:
106 - itemset
107 complete the core item sets with their closure
108 - lookahead
109 explicitly associate lookaheads to items
110 - solved
111 describe shift/reduce conflicts solving.
112 Bison used to systematically output this information on top of
113 the report. Solved conflicts are now attached to their states.
114
115 * Type clashes
116 Previous versions don't complain when there is a type clash on
117 the default action if the rule has a mid-rule action, such as in:
118
119 %type <foo> bar
120 %%
121 bar: '0' {} '0';
122
123 This is fixed.
124 \f
125 Changes in version 1.35, 2002-03-25:
126
127 * C Skeleton
128 Some projects use Bison's C parser with C++ compilers, and define
129 YYSTYPE as a class. The recent adjustment of C parsers for data
130 alignment and 64 bit architectures made this impossible.
131
132 Because for the time being no real solution for C++ parser
133 generation exists, kludges were implemented in the parser to
134 maintain this use. In the future, when Bison has C++ parsers, this
135 kludge will be disabled.
136
137 This kludge also addresses some C++ problems when the stack was
138 extended.
139
140 \f
141 Changes in version 1.34, 2002-03-12:
142
143 * File name clashes are detected
144 $ bison foo.y -d -o foo.x
145 fatal error: header and parser would both be named `foo.x'
146
147 * A missing `;' at the end of a rule triggers a warning
148 In accordance with POSIX, and in agreement with other
149 Yacc implementations, Bison will mandate this semicolon in the near
150 future. This eases the implementation of a Bison parser of Bison
151 grammars by making this grammar LALR(1) instead of LR(2). To
152 facilitate the transition, this release introduces a warning.
153
154 * Revert the C++ namespace changes introduced in 1.31, as they caused too
155 many portability hassles.
156
157 * DJGPP support added.
158
159 * Fix test suite portability problems.
160 \f
161 Changes in version 1.33, 2002-02-07:
162
163 * Fix C++ issues
164 Groff could not be compiled for the definition of size_t was lacking
165 under some conditions.
166
167 * Catch invalid @n
168 As is done with $n.
169 \f
170 Changes in version 1.32, 2002-01-23:
171
172 * Fix Yacc output file names
173
174 * Portability fixes
175
176 * Italian, Dutch translations
177 \f
178 Changes in version 1.31, 2002-01-14:
179
180 * Many Bug Fixes
181
182 * GNU Gettext and %expect
183 GNU Gettext asserts 10 s/r conflicts, but there are 7. Now that
184 Bison dies on incorrect %expectations, we fear there will be
185 too many bug reports for Gettext, so _for the time being_, %expect
186 does not trigger an error when the input file is named `plural.y'.
187
188 * Use of alloca in parsers
189 If YYSTACK_USE_ALLOCA is defined to 0, then the parsers will use
190 malloc exclusively. Since 1.29, but was not NEWS'ed.
191
192 alloca is used only when compiled with GCC, to avoid portability
193 problems as on AIX.
194
195 * When the generated parser lacks debugging code, YYDEBUG is now 0
196 (as POSIX requires) instead of being undefined.
197
198 * User Actions
199 Bison has always permitted actions such as { $$ = $1 }: it adds the
200 ending semicolon. Now if in Yacc compatibility mode, the semicolon
201 is no longer output: one has to write { $$ = $1; }.
202
203 * Better C++ compliance
204 The output parsers try to respect C++ namespaces.
205 [This turned out to be a failed experiment, and it was reverted later.]
206
207 * Reduced Grammars
208 Fixed bugs when reporting useless nonterminals.
209
210 * 64 bit hosts
211 The parsers work properly on 64 bit hosts.
212
213 * Error messages
214 Some calls to strerror resulted in scrambled or missing error messages.
215
216 * %expect
217 When the number of shift/reduce conflicts is correct, don't issue
218 any warning.
219
220 * The verbose report includes the rule line numbers.
221
222 * Rule line numbers are fixed in traces.
223
224 * Swedish translation
225
226 * Parse errors
227 Verbose parse error messages from the parsers are better looking.
228 Before: parse error: unexpected `'/'', expecting `"number"' or `'-'' or `'(''
229 Now: parse error: unexpected '/', expecting "number" or '-' or '('
230
231 * Fixed parser memory leaks.
232 When the generated parser was using malloc to extend its stacks, the
233 previous allocations were not freed.
234
235 * Fixed verbose output file.
236 Some newlines were missing.
237 Some conflicts in state descriptions were missing.
238
239 * Fixed conflict report.
240 Option -v was needed to get the result.
241
242 * %expect
243 Was not used.
244 Mismatches are errors, not warnings.
245
246 * Fixed incorrect processing of some invalid input.
247
248 * Fixed CPP guards: 9foo.h uses BISON_9FOO_H instead of 9FOO_H.
249
250 * Fixed some typos in the documentation.
251
252 * %token MY_EOF 0 is supported.
253 Before, MY_EOF was silently renumbered as 257.
254
255 * doc/refcard.tex is updated.
256
257 * %output, %file-prefix, %name-prefix.
258 New.
259
260 * --output
261 New, aliasing `--output-file'.
262 \f
263 Changes in version 1.30, 2001-10-26:
264
265 * `--defines' and `--graph' have now an optionnal argument which is the
266 output file name. `-d' and `-g' do not change, they do not take any
267 argument.
268
269 * `%source_extension' and `%header_extension' are removed, failed
270 experiment.
271
272 * Portability fixes.
273 \f
274 Changes in version 1.29, 2001-09-07:
275
276 * The output file does not define const, as this caused problems when used
277 with common autoconfiguration schemes. If you still use ancient compilers
278 that lack const, compile with the equivalent of the C compiler option
279 `-Dconst='. autoconf's AC_C_CONST macro provides one way to do this.
280
281 * Added `-g' and `--graph'.
282
283 * The Bison manual is now distributed under the terms of the GNU FDL.
284
285 * The input and the output files has automatically a similar extension.
286
287 * Russian translation added.
288
289 * NLS support updated; should hopefully be less troublesome.
290
291 * Added the old Bison reference card.
292
293 * Added `--locations' and `%locations'.
294
295 * Added `-S' and `--skeleton'.
296
297 * `%raw', `-r', `--raw' is disabled.
298
299 * Special characters are escaped when output. This solves the problems
300 of the #line lines with path names including backslashes.
301
302 * New directives.
303 `%yacc', `%fixed_output_files', `%defines', `%no_parser', `%verbose',
304 `%debug', `%source_extension' and `%header_extension'.
305
306 * @$
307 Automatic location tracking.
308 \f
309 Changes in version 1.28, 1999-07-06:
310
311 * Should compile better now with K&R compilers.
312
313 * Added NLS.
314
315 * Fixed a problem with escaping the double quote character.
316
317 * There is now a FAQ.
318 \f
319 Changes in version 1.27:
320
321 * The make rule which prevented bison.simple from being created on
322 some systems has been fixed.
323 \f
324 Changes in version 1.26:
325
326 * Bison now uses automake.
327
328 * New mailing lists: <bug-bison@gnu.org> and <help-bison@gnu.org>.
329
330 * Token numbers now start at 257 as previously documented, not 258.
331
332 * Bison honors the TMPDIR environment variable.
333
334 * A couple of buffer overruns have been fixed.
335
336 * Problems when closing files should now be reported.
337
338 * Generated parsers should now work even on operating systems which do
339 not provide alloca().
340 \f
341 Changes in version 1.25, 1995-10-16:
342
343 * Errors in the input grammar are not fatal; Bison keeps reading
344 the grammar file, and reports all the errors found in it.
345
346 * Tokens can now be specified as multiple-character strings: for
347 example, you could use "<=" for a token which looks like <=, instead
348 of chosing a name like LESSEQ.
349
350 * The %token_table declaration says to write a table of tokens (names
351 and numbers) into the parser file. The yylex function can use this
352 table to recognize multiple-character string tokens, or for other
353 purposes.
354
355 * The %no_lines declaration says not to generate any #line preprocessor
356 directives in the parser file.
357
358 * The %raw declaration says to use internal Bison token numbers, not
359 Yacc-compatible token numbers, when token names are defined as macros.
360
361 * The --no-parser option produces the parser tables without including
362 the parser engine; a project can now use its own parser engine.
363 The actions go into a separate file called NAME.act, in the form of
364 a switch statement body.
365 \f
366 Changes in version 1.23:
367
368 The user can define YYPARSE_PARAM as the name of an argument to be
369 passed into yyparse. The argument should have type void *. It should
370 actually point to an object. Grammar actions can access the variable
371 by casting it to the proper pointer type.
372
373 Line numbers in output file corrected.
374 \f
375 Changes in version 1.22:
376
377 --help option added.
378 \f
379 Changes in version 1.20:
380
381 Output file does not redefine const for C++.
382
383 Local Variables:
384 mode: outline
385 End:
386
387 -----
388
389 Copyright (C) 2001, 2002 Free Software Foundation, Inc.
390
391 This file is part of GNU Autoconf.
392
393 GNU Autoconf is free software; you can redistribute it and/or modify
394 it under the terms of the GNU General Public License as published by
395 the Free Software Foundation; either version 2, or (at your option)
396 any later version.
397
398 GNU Autoconf is distributed in the hope that it will be useful,
399 but WITHOUT ANY WARRANTY; without even the implied warranty of
400 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
401 GNU General Public License for more details.
402
403 You should have received a copy of the GNU General Public License
404 along with autoconf; see the file COPYING. If not, write to
405 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
406 Boston, MA 02111-1307, USA.