]> git.saurik.com Git - bison.git/blob - ChangeLog
Fix ChangeLog.
[bison.git] / ChangeLog
1 2009-04-14 Akim Demaille <demaille@gostai.com>
2
3 variables: use `parse.assert' instead of `assert'.
4 * TODO (assert): Remove.
5 * data/bison.m4 (b4_assert_if): Replace with...
6 (b4_parse_assert_if): this.
7 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
8 * doc/bison.texinfo (Decl Summary): Document parse.assert.
9
10 2009-04-14 Akim Demaille <demaille@gostai.com>
11
12 variables: use `parse.trace' instead of `debug'.
13 * src/getargs.c (getargs): Map -t to %define trace.parse.
14 * src/scan-gram.l (%debug): Map to %define trace.parse.
15 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
16 names to `_' in macro names.
17 (b4_debug_if): Replace with...
18 (b4_parse_trace_if): this.
19 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
20 * data/yacc.c: Adjust.
21 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
22 Use @code to label the variable list.
23 Document the variable parse.trace.
24 (Tracing): Promote the parse.trace variable.
25 * TODO: %printer is not documented.
26
27 2009-04-14 Akim Demaille <demaille@gostai.com>
28
29 doc: minor fixes.
30 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
31 (Table of Symbols): Remove duplicate entry for %debug.
32
33 2009-04-10 Eric Blake <ebb9@byu.net>
34
35 submodules: update to latest
36 * submodules/autoconf: Use latest upstream Autoconf.
37
38 2009-04-06 Eric Blake <ebb9@byu.net>
39
40 Work around autoconf 2.63b bug in testsuite.
41 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
42 autoconf bug related to # in test.
43
44 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
45
46 * NEWS (2.5): New section. Describe new -D/--define feature.
47
48 2009-04-06 Akim Demaille <demaille@gostai.com>
49
50 Regen.
51 * src/parse-gram.h, src/parse-gram.c: Regen.
52
53 2009-04-06 Akim Demaille <demaille@gostai.com>
54
55 rename muscle_tab.* as muscle-tab.* for consistency.
56 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
57 * src/muscle-tab.h, src/muscle-tab.c: these.
58 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
59 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
60
61 2009-04-06 Akim Demaille <demaille@gostai.com>
62
63 Makefile: introduce $(BISON).
64 * src/local.mk (BISON): New.
65 (YACC): Use it.
66
67 2009-04-06 Akim Demaille <demaille@gostai.com>
68
69 parser: handle %locations as %define locations.
70 * src/getargs.h, src/getargs.c (locations_flag): Remove.
71 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
72 to set "locations" to true.
73 * src/output.c (prepare): Don't output "locations".
74 * src/scan-gram.l (%locations): Handle it as a %<flag>.
75 * src/parse-gram.y: It's no longer a token.
76 Don't handle it.
77 * data/bison.m4 (b4_locations_if): Define it with
78 b4_percent_define_if_define.
79 * data/c.m4, data/glr.cc: Adjust.
80
81 2009-04-06 Akim Demaille <demaille@gostai.com>
82
83 Regen.
84 * src/parse-gram.c: Regen.
85
86 2009-04-06 Akim Demaille <demaille@gostai.com>
87
88 muscle: factor the handling of obsolete of obsolete directives.
89 Suggested by Joel E. Denny.
90
91 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
92 New, extracted from...
93 * src/parse-gram.y (prologue_declaration: pure-parser): here.
94 Remove it.
95 (prologue_declaration: "%<flag>"): Use
96 muscle_percent_define_ensure.
97 (%error-verbose, %pure-parser): No longer tokens.
98 * src/scan-gram.l (pure-parser): Return as a %<flag>.
99
100 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
101
102 Fix options documentation.
103 * build-aux/cross-options.pl: As in --help output, write optional
104 arguments as [=ARG] not =[ARG].
105 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
106
107 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
108
109 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
110 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
111 requirements for a correct m4 are stricter.
112 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
113 * configure.ac: Update to use AC_PROG_GNU_M4.
114 Reported by Eric Blake.
115
116 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
117
118 Help with updating web manual.
119 * HACKING: Incorporate instructions from gnulib/doc/README.
120 * bootstrap.conf (gnulib_modules): Add gendocs.
121
122 2009-04-03 Akim Demaille <demaille@gostai.com>
123
124 Regen.
125 * src/parse-gram.h, src/parse-gram.c: Regen.
126
127 2009-04-03 Akim Demaille <demaille@gostai.com>
128
129 Factor %FLAG at scan level.
130 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
131 definitions and associated rules, replaced by....
132 (PERCENT_FLAG): this new token type, and rule.
133 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
134 Use it for %debug and %error-verbose.
135
136 2009-04-03 Akim Demaille <demaille@gostai.com>
137
138 Regen.
139 * src/parse-gram.h, src/parse-gram.c: Regen.
140
141 2009-04-03 Akim Demaille <demaille@gostai.com>
142
143 Treat %debug as %define debug.
144 * data/bison.m4 (b4_debug_if): New.
145 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
146 * data/lalr1.java: Use it instead of b4_debug_flag.
147 * src/getargs.h, src/getargs.c (debug_flag): Remove.
148 * src/output.c (prepare): Don't output it.
149 * src/parse-gram.y: Treat %debug as %define debug.
150
151 2009-04-03 Akim Demaille <demaille@gostai.com>
152
153 Treat %error-verbose as %define error_verbose.
154 This allows to pass -Derror_verbose on the command line. Better
155 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
156 ERROR_VERBOSE being defined as false or true.
157 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
158 on b4_percent_define_ifdef, for does not check the defined value,
159 but only whether the symbol is defined, rely on
160 b4_percent_define_flag_if, so that a value of "false" is processed
161 as a false.
162 If not defined, define the flag to "false".
163 (b4_error_verbose_if): New.
164 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
165 b4_error_verbose_flag.
166 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
167 * src/output.c (prepare): Don't output it.
168 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
169
170 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
171
172 Fix strange %define locations for default values.
173 Reported by Akim Demaille at
174 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
175 and discussed again starting at
176 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
177 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
178 because location information is bogus.
179 Use angle brackets to delimit fake file name because square brackets
180 look like underexpanded m4. Choose a better fake file name.
181 Use negative line numbers.
182 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
183 * src/location.c (location_print): If line for a boundary is negative,
184 only print that boundary's file name.
185 * src/location.h: Document that.
186 * tests/skeletons.at (%define Boolean variables: invalid skeleton
187 defaults): Update output.
188
189 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
190
191 Pacify ./configure --enable-gcc-warnings.
192 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
193 in lib won't compile with it.
194 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
195
196 2009-03-31 Akim Demaille <demaille@gostai.com>
197
198 bootstrap: --help to stdout.
199 * bootstrap (usage): Don't send --help to stderr.
200 Use a here doc instead of a long string.
201
202 2009-03-31 Akim Demaille <demaille@gostai.com>
203
204 bootstrap: README-hacking no longer exists
205 * bootstrap (checkout_only_file): Set to HACKING.
206
207 2009-03-26 Akim Demaille <demaille@gostai.com>
208
209 doc: merge HACKING and README-hacking.
210 Two files is confusing.
211 Reported by Alexandre Duret-Lutz.
212
213 * README-hacking: Merge into...
214 * HACKING (Working from the repository): here.
215
216 2009-03-26 Akim Demaille <demaille@gostai.com>
217
218 doc: update README-hacking.
219 * README-hacking: We now use git and git submodules.
220 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
221
222 2009-03-26 Akim Demaille <demaille@gostai.com>
223
224 lalr1.cc: avoid GCC 4.3 warnings.
225 GCC 4.3 now warns about "a || b && c" and asks for explicit
226 parentheses.
227 Reported by Alexandre Duret-Lutz.
228 * data/location.cc: Update copyright years.
229 (Position::operator==): Use parens to make precedence explicit.
230 Compare lines and columns first, as they are more likely to be
231 different, and they are faster to compare.
232
233 2009-03-26 Akim Demaille <demaille@gostai.com>
234
235 gnulib: update.
236 * gnulib: Update to latest.
237 * src/local.mk (AM_CFLAGS): Move to...
238 * Makefile.am: here.
239 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
240 AM_CFLAGS.
241
242 2009-03-02 Akim Demaille <demaille@gostai.com>
243
244 Comment changes.
245
246 2009-03-02 Akim Demaille <demaille@gostai.com>
247
248 Share b4_yytranslate_define.
249 * data/lalr1.cc (b4_yytranslate_define): Move to...
250 * data/c++.m4: here.
251
252 2009-03-02 Akim Demaille <demaille@gostai.com>
253
254 Use locations in the variant example.
255 Yes, this obfuscates the point of this example, variants only.
256 But glr.cc cannot work (yet?) without locations. This change
257 makes it easier to use this example with glr.cc.
258
259 * examples/variant.yy (assert): %define it.
260 (locations): Request them.
261 (yylex): Bind the location to the stage.
262
263 2009-03-02 Akim Demaille <demaille@gostai.com>
264
265 Dub make_TOKEN as a public type interface.
266 * data/c++.m4 (b4_symbol_constructor_declare)
267 (b4_symbol_constructor_define): New empty stubs.
268 (b4_public_types_declare, b4_public_types_define): Use them.
269 * data/lalr1.cc (b4_symbol_constructor_declare)
270 (b4_symbol_constructor_declare_)
271 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
272 Move to...
273 * data/variant.hh: here.
274 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
275 needed.
276 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
277 b4_symbol_constructor_declare, as it is now done by
278 b4_public_types_define and b4_public_types_declare.
279
280 2009-03-02 Akim Demaille <demaille@gostai.com>
281
282 Coding style changes.
283 * data/lalr1.cc (b4_symbol_constructor_declaration_)
284 (b4_symbol_constructor_declarations)
285 (b4_symbol_constructor_definition_)
286 (b4_symbol_constructor_definitions)
287 (b4_yytranslate_definition): Rename as...
288 (b4_symbol_constructor_declare_)
289 (b4_symbol_constructor_declare)
290 (b4_symbol_constructor_define_)
291 (b4_symbol_constructor_define)
292 (b4_yytranslate_define): these.
293 * data/variant.hh (b4_variant_definition): Rename as...
294 (b4_variant_define): this.
295
296 2009-03-02 Akim Demaille <demaille@gostai.com>
297
298 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
299 * data/bison.m4 (b4_percent_define_if_define): New.
300 * data/c++.m4 (b4_variant_if): Move to...
301 * data/bison.m4: Here, using b4_percent_define_if_define.
302 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
303 * data/bison.m4: Here, using b4_percent_define_if_define.
304
305 2009-03-02 Akim Demaille <demaille@gostai.com>
306
307 Dub symbol_type_base as a public type.
308 * data/c++.m4 (b4_public_types_declare): Now define
309 symbol_type_base and symbol_type.
310 (b4_public_types_define): New.
311 In both cases, the definitions are taken verbatim from lalr1.cc.
312 * data/lalr1.cc: Adjust.
313
314 2009-03-02 Akim Demaille <demaille@gostai.com>
315
316 b4_public_types_declare.
317 * data/c++.m4 (b4_public_types_declare): New.
318 * data/glr.cc, data/lalr1.cc: Use it.
319
320 2009-03-02 Akim Demaille <demaille@gostai.com>
321
322 b4_semantic_type_declare.
323 * data/c++.m4 (b4_semantic_type_declare): New.
324 Factors and generalizes what was in glr.cc and lalr1.cc.
325 * data/variant.hh (b4_semantic_type_declare): Redefine it for
326 variants.
327 * data/lalr1.cc, data/glr.cc: Use it.
328
329 2009-02-26 Akim Demaille <demaille@gostai.com>
330
331 Upgrade gnulib.
332 * gnulib: Upgrade from master.
333 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
334 Regen.
335
336 2009-02-25 Akim Demaille <demaille@gostai.com>
337
338 Remove useless arguments.
339 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
340 relevant.
341
342 2009-02-25 Akim Demaille <demaille@gostai.com>
343
344 Comment changes.
345 * data/lalr1.cc: here.
346
347 2009-02-25 Akim Demaille <demaille@gostai.com>
348
349 Fix glr.cc's debug level handling.
350 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
351 glr.c which is used.
352 (debug_level, set_debug_level): Adjust.
353
354 2009-02-25 Akim Demaille <demaille@gostai.com>
355
356 Copyright years.
357 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
358
359 2009-02-25 Akim Demaille <demaille@gostai.com>
360
361 Style changes.
362 * etc/bench.pl.in (generate_grammar_list): Consitently use
363 location_type, not yy::location.
364
365 2009-02-25 Akim Demaille <demaille@gostai.com>
366
367 Comment change.
368 * data/lalr1.cc: here.
369
370 2009-02-19 Akim Demaille <demaille@gostai.com>
371
372 Make yyparser::error public.
373 * data/lalr1.cc: here.
374 There is no good reason to keep it private (and it is convenient
375 to use it from the scanner for instance). It is already public in
376 glr.cc.
377
378 2009-02-19 Akim Demaille <demaille@gostai.com>
379
380 Comment changes.
381 * data/glr.cc: here.
382
383 2009-02-19 Akim Demaille <demaille@gostai.com>
384
385 Remove trailing blanks.
386 The epilogue has its own ending \n, no need to add another.
387
388 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
389 epilogue.
390 * data/glr.cc: dnl when extending the epilogue.
391 Remove stray "private:".
392
393 2009-02-19 Akim Demaille <demaille@gostai.com>
394
395 Use b4_c_modern.
396 * data/c.m4 (b4_c_function_decl): Here.
397
398 2009-02-19 Akim Demaille <demaille@gostai.com>
399
400 Comment changes.
401 * data/lalr1.cc: here.
402
403 2009-02-19 Akim Demaille <demaille@gostai.com>
404
405 Extract variant.hh
406 * data/variant.hh: New, extracted from...
407 * data/lalr1.cc: here.
408 Adjust.
409 * data/local.mk: Adjust.
410
411 2009-02-19 Akim Demaille <demaille@gostai.com>
412
413 Extract stack.hh from lalr1.cc.
414 * data/stack.hh: New.
415 * data/lalr1.cc: Extract from here.
416 * data/local.mk: Adjust.
417
418 2009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
419
420 Add reminder about uploading public key to keys.gnupg.net.
421 * HACKING (Release Procedure): Here.
422
423 2009-01-28 Akim Demaille <demaille@gostai.com>
424
425 * NEWS: Update information about 2.4.1 and 2.4.2.
426
427 2008-11-04 Akim Demaille <demaille@gostai.com>
428
429 Reformat NEWS.
430 * NEWS: Use more outline-mode markup.
431 Suggested by Jim Meyering.
432
433 2009-01-08 Akim Demaille <demaille@gostai.com>
434
435 Fix grep portability issues.
436 Grep on Solaris does not support -q.
437 Reported by Summum Bonum.
438
439 * NEWS: Add a stub for 2.4.2.
440 * THANKS: Add Summum Bonum.
441 * tests/atlocal.in (EGREP): New.
442 (CC, CXX, XSLTPROC): Make it possible to override them via
443 envvars.
444 * tests/java.at: Use $EGREP instead of egrep.
445 Use AT_CHECK's ignore instead of grep's -q.
446
447 2008-12-11 Akim Demaille <demaille@gostai.com>
448
449 Pass the token type to yysyntax_error.
450 * data/yacc.c (yysyntax_error): Take the transated token instead
451 of the raw number.
452 Adjust callers.
453 * TODO: Update.
454
455 2008-12-11 Akim Demaille <demaille@gostai.com>
456
457 Formatting changes.
458 * data/glr.c: Formatting changes.
459
460 2008-12-11 Akim Demaille <demaille@gostai.com>
461
462 Propagate i18n changes into glr.c.
463 * TODO: Update.
464 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
465 building the error message format dynamically.
466 * data/lalr1.java: Formatting changes.
467
468 2008-12-11 Akim Demaille <demaille@gostai.com>
469
470 Use testsuite -C.
471 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
472 Solves problems when top_srcdir is an absolute path.
473 Suggested by Eric Blake.
474 * configure.ac: Require Autoconf 2.62.
475
476 2008-12-11 Akim Demaille <demaille@gostai.com>
477
478 Simplify the i18n of the error messages.
479 * data/lalr1.cc: Comment changes.
480 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
481 lalr1.cc instead of building dynamically the format string.
482
483 2008-12-08 Akim Demaille <demaille@gostai.com>
484
485 Fix portability issue in the test suite.
486 * tests/local.at (AT_MATCHES_CHECK): New.
487 Based on Perl instead of Sed. Sed has too many portability
488 pitfalls, not ever Sed is GNU Sed.
489 * tests/actions.at (Fix user actions without a trailing semicolon):
490 Use it.
491
492 2008-12-08 Akim Demaille <demaille@gostai.com>
493
494 Update data/README.
495 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
496
497 2008-12-08 Akim Demaille <demaille@gostai.com>
498
499 Install autoconf as a submodule to get m4sugar.
500 * .gitmodules: Add submodules/autoconf.
501 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
502 submodules/autoconf.
503
504 2008-12-08 Akim Demaille <demaille@gostai.com>
505
506 Test token.prefix in all the skeletons.
507 * data/java.m4 (b4_token_enum): Use the token.prefix.
508 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
509 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
510 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
511 * tests/java.at: Comment changes.
512 (AT_CHECK_JAVA_MINIMAL): Define the END token.
513 (Java parser class and package names): Add token.prefix check.
514
515 2008-12-08 Akim Demaille <demaille@gostai.com>
516
517 Fix regeneration of atconfig.
518 * tests/local.mk (tests/atconfig): The rule was incorrect, but
519 remove it: now that there is no tests/Makefile.am, the top-level
520 Makefile properly updates atconfig when needed.
521
522 2008-12-07 Di-an Jan <dianj@freeshell.org>
523
524 Implement the FIXME that ends an user action with a semicolon
525 if it seems necessary.
526 * src/scan-code.l (flex rules section): Flag cpp directive from
527 any `#' to the first unescaped end-of-line. Semicolon is not
528 needed after `;', `{', '}', or cpp directives and is needed after
529 any other token (whitespaces and comments have no effect).
530 * tests/actions.at (Fix user actions without a trailing semicolon):
531 New test.
532 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
533 to make user actions complete statements.
534 Adjust column numbers in error messages.
535 * tests/regression.at (Fix user actions without a trailing semicolon):
536 Remove. Covered by new test.
537
538 2008-12-07 Akim Demaille <demaille@gostai.com>
539
540 Update gnulib.
541 * gnulib: Update from master.
542
543 2008-12-05 Eric Blake <ebb9@byu.net>
544
545 Avoid compiler warning.
546 * src/output.c (muscle_insert_item_number_table): Delete unused
547 function.
548
549 2008-12-02 Eric Blake <ebb9@byu.net>
550
551 Build testsuite with newer autoconf.
552 * tests/output.at (m4_expand): Don't override in newer autoconf,
553 where the underlying implementation changed.
554 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
555 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
556 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
557 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
558 since some of them contain unbalanced ')'.
559
560 2008-12-01 Akim Demaille <demaille@gostai.com>
561
562 Use b4_symbol for printers and destructors everywhere.
563 * data/bison.m4 (b4_symbol_action_location): New.
564 * data/c.m4 (b4_symbol_actions): Remove.
565 Adjust all callers to use by b4_symbol_foreach and the corresponding
566 b4_symbol_printer/destructor macro.
567 * data/glr.cc: Adjust.
568 * data/lalr1.java: Adjust the %destructor sanity check.
569 * src/output.c (symbol_code_props_output): Remove, we no longer
570 need the b4_symbol_printers/destructors tables.
571
572 2008-12-01 Akim Demaille <demaille@gostai.com>
573
574 Use b4_symbol_case_.
575 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
576 b4_symbol_case_.
577
578 2008-12-01 Akim Demaille <demaille@gostai.com>
579
580 Move b4_symbol based macro to bison.m4.
581 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
582 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
583 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
584 (b4_type_foreach): Move to...
585 * data/bison.m4: Here.
586 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
587 b4_symbol_value_template instead of b4_symbol_value.
588
589 2008-12-01 Akim Demaille <demaille@gostai.com>
590
591 b4_symbol/type_foreach.
592 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
593 Use them.
594
595 2008-12-01 Akim Demaille <demaille@gostai.com>
596
597 Use the symbol properties to output the printer/destructor for lalr1.cc.
598 Instead of defining complex list of tuples to define various
599 properties of the symbols, we now prefer to define symbols as
600 "structs" in m4: using the symbol key (its number), and the
601 property name, b4_symbol gives it value. Use this to handle
602 destructors and printers.
603
604 * src/output.c (CODE_PROP): New.
605 (prepare_symbol_definitions): Use it to define the printer and
606 destructor related attributes of the symbols.
607 * data/lalr1.cc (b4_symbol_actions): Rename as...
608 (b4_symbol_action): this.
609 Use b4_symbol instead of 6 arguments.
610 (b4_symbol_printer, b4_symbol_destructor): New.
611 Use them instead of b4_symbol_actions.
612
613 2008-12-01 Akim Demaille <demaille@gostai.com>
614
615 Avoid capturing variables too easily.
616 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
617 v__ and p__ instead of v and p.
618
619 2008-12-01 Akim Demaille <demaille@gostai.com>
620
621 Remove spurious empty line before syncline.
622 * data/bison.m4 (b4_syncline): Don't output an empty line before
623 the output.
624
625 2008-11-26 Akim Demaille <demaille@gostai.com>
626
627 Convert lib/Makefile.am into lib/local.mk.
628 The real problem is rather gnulib.mk, which itself is extracted
629 from a Makefile.am that gnulib expects to the "recursive". The
630 tool prefix-gnulib-mk converts such a gnulib.mk to be
631 non-recursive. Also, some AC_SUBST variables need to be adjusted.
632
633 * etc/prefix-gnulib-mk: New.
634 * bootstrap (slurp): Use it to convert further gnulib.mk.
635 No longer try to avoid re-creation of lib/gnulib.mk as the changes
636 are deeper.
637 * lib/Makefile.am: Rename as...
638 * lib/local.mk: this.
639 Adjust to be prefixed.
640 * Makefile.am, configure.ac: Adjust.
641 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
642
643 2008-11-26 Akim Demaille <demaille@gostai.com>
644
645 s/_FLAGS/FLAGS/.
646 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
647 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
648 Reported by Eric Blake.
649
650 2008-11-26 Akim Demaille <demaille@gostai.com>
651
652 Use b4_parser_tables_define in glr.cc.
653 * data/glr.c: Use b4_parser_tables_define instead of defining the
654 (deterministic integral) tables by hand.
655
656 2008-11-26 Akim Demaille <demaille@gostai.com>
657
658 Use b4_parser_tables_define in Java.
659 * data/java.m4 (b4_typed_parser_table): Rename as...
660 (b4_typed_parser_table_define): this, for consistency.
661 Accept a comment as $4.
662 Move $2 into yy*_.
663 (b4_integral_parser_table): Rename as...
664 (b4_integral_parser_table_define): this.
665 * data/lalr1.java: Adjust all uses.
666 Use b4_parser_tables_define instead of generation by hand.
667
668 2008-11-26 Akim Demaille <demaille@gostai.com>
669
670 Prepare the convergence bw C style and Java table generation.
671 * data/bison.m4 (b4_tables_map, b4_tables_declare)
672 (b4_tables_define): Rename as...
673 (b4_integral_parser_tables_map, b4_parser_tables_declare)
674 (b4_parser_tables_define): these.
675 * data/c.m4 (b4_table_define): Rename as...
676 (b4_integral_parser_table_define): this.
677 * data/lalr1.cc: Adjust.
678 (b4_table_define, b4_table_declare): Rename as...
679 (b4_integral_parser_table_define)
680 (b4_integral_parser_table_declare): these.
681 (yyrline_): Move the comment where it is actually used.
682 * data/yacc.c: Adjust.
683 (yyrline): Use b4_integral_parser_table_define.
684
685 2008-11-26 Akim Demaille <demaille@gostai.com>
686
687 Regen.
688 * src/parse-gram.h, src/parse-gram.c: Regen.
689
690 2008-11-26 Akim Demaille <demaille@gostai.com>
691
692 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
693 * data/lalr1.cc (b4_tables_map): Move to...
694 * data/bison.m4: here.
695 Update the comment for yytable during the flight.
696 (b4_tables_declare, b4_tables_define): New.
697 * data/lalr1.cc: Use them.
698 * data/c.m4 (b4_table_define): New.
699 * data/yacc.c: Use b4_tables_define instead of output the tables
700 by hand.
701 * tests/regression.at (Web2c Actions): Adjust the expected output,
702 the order of the tables changed.
703
704 2008-11-26 Akim Demaille <demaille@gostai.com>
705
706 Get rid of (yy)rhs and (yy)prhs.
707 These tables are no longer needed in the parsers, and they don't seem to
708 be useful. They are not documented either.
709
710 * src/output.c (prepare_rules): Get rid of rhs and prhs.
711 Adjust the computation of (yy)r2.
712
713 2008-11-26 Akim Demaille <demaille@gostai.com>
714
715 Rule length is unsigned.
716 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
717
718 2008-11-26 Akim Demaille <demaille@gostai.com>
719
720 Get rid of lalr1-split.cc.
721 It was no longer maintainer.
722
723 * data/lalr1-split.cc: Remove.
724 * etc/bench.pl.in (bench_fusion_parser): Remove.
725 Adjust.
726
727 2008-11-26 Akim Demaille <demaille@gostai.com>
728
729 Use yy* consistently.
730 * data/glr.c: Now that yyrhs no longer exists as a global
731 variable, rename local "rhs" variables into "yyrhs" for
732 consistency.
733
734 2008-11-25 Akim Demaille <demaille@gostai.com>
735
736 Get rid of yyrhs and yyprhs in glr.c.
737 * data/glr.c (yyrhs, yyprhs): Remove.
738 Instead, use the state stack and yystos.
739
740 2008-11-25 Akim Demaille <demaille@gostai.com>
741
742 Flag glr tests.
743 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
744 as an Autotest keyword.
745
746 2008-11-25 Akim Demaille <demaille@gostai.com>
747
748 Prefer TESTSUITE_FLAGS.
749 TESTSUITEFLAGS is barely readable.
750
751 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
752 for backward compatibility.
753 Use the former instead of the latter.
754
755 2008-11-25 Akim Demaille <demaille@gostai.com>
756
757 Get rid of yyrhs and yyprhs in larl1.java.
758 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
759 (yy_reduce_print): Rather, use yystos_ and the state stack.
760
761 2008-11-25 Akim Demaille <demaille@gostai.com>
762
763 Formatting changes.
764
765 2008-11-25 Akim Demaille <demaille@gostai.com>
766
767 Get rid of yyrhs and yyprhs in yacc.c.
768 They were used to get the symbol types, given a rule number, when
769 displaying the top of the stack before a reduction. But the
770 symbol type is available from the state stack. This has two be
771 benefits: two tables less in the parser (making it smaller), and a
772 more consistent use of the three stacks which will help to fuse
773 them.
774
775 * data/yacc.c (yyprhs, yyrhs): Remove.
776 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
777 (yy_reduce_print): Take yyssp as argument.
778 Use it, together with yystos, to get the symbol type.
779 * tests/regression.at (Web2c Report): Remove these tables from the
780 expected output.
781
782 2008-11-25 Akim Demaille <demaille@gostai.com>
783
784 b4_tables_map.
785 The point is to factor the generation of the tables across skeletons.
786 This is language dependant.
787
788 * data/c.m4 (b4_comment_): New.
789 Should be usable to define how to generate tables independently of
790 the language.
791 (b4_c_comment): New.
792 (b4_comment): Bounce to b4_c_comment.
793 Now support $2 = [PREFIX] for indentation.
794 * data/lalr1.cc (b4_table_declare): Don't output a comment if
795 there is no comment.
796 Indent it properly when there is one.
797 Output the ending semicolon.
798 (b4_table_define): Space changes.
799 Output the ending semicolon.
800 (b4_tables_map): New.
801 Use it twice instead of declaring and defining the (integral)
802 tables by hand.
803
804 2008-11-25 Akim Demaille <demaille@gostai.com>
805
806 b4_table_declare.
807 * data/lalr1.cc (b4_table_declare): New.
808 Use it to declare the tables defined with b4_table_define.
809 (b4_table_define): Declare a third arg to match b4_table_declare
810 signature.
811 Move all the comments around invocations of b4_table_define into
812 the invocations itselves.
813 Move things around to have the order for declarations and
814 definitions.
815
816 2008-11-25 Akim Demaille <demaille@gostai.com>
817
818 Formatting changes.
819 * data/lalr1.java: here.
820
821 2008-11-25 Akim Demaille <demaille@gostai.com>
822
823 b4_args is more general than only C++.
824 * data/lalr1.cc (b4_args, _b4_args): Move to...
825 * data/bison.m4: here.
826
827 2008-11-21 Di-an Jan <dianj@freeshell.org>
828
829 Implement no-XXX arguments for --warnings, --report, --trace.
830 * src/getargs.c (flags_argmatch): Handles no-XXX.
831 Fix typo in doxygen comment.
832
833 2008-11-21 Akim Demaille <demaille@gostai.com>
834
835 Display the changes in cross-options.texi.
836 * build-aux/cross-options.pl ($sep): New, to separate items.
837 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
838 changes.
839
840 2008-11-20 Di-an Jan <dianj@freeshell.org>
841
842 Improves options in the manual.
843 * doc/bison.texinfo (-g, -x): Add space before argument.
844 (Option Cross Key): Implement FIXME: listing directives also.
845 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
846 (Short Option): Special case -d. Put arguments inside @option.
847 (Bison Directive): Add column, automatically extracted from
848 src/scan-gram.l (actual name passed as the first argument)
849 with special case for %define.
850 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
851 to build-aux/cross-options.pl.
852 * src/getargs.c (usage): Document limitations of cross-options.pl.
853 * src/scan-gram.l: Likewise.
854
855 2008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
856
857 Fix unexpanded macros in GLR defines file.
858 Reported by Csaba Raduly at
859 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
860 * THANKS (Csaba Raduly): Add.
861 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
862 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
863 lexer in a separate module that includes the defines file.
864 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
865 source.
866 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
867 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
868 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
869 (AT_DATA_SOURCE_PROLOGUE): New.
870 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
871 (AT_DATA_SOURCE): New.
872 (AT_FULL_COMPILE): Extend to support an additional source file.
873
874 2008-11-18 Akim Demaille <demaille@gostai.com>
875
876 More TODO.
877 * TODO: More short term issues.
878
879 2008-11-18 Akim Demaille <demaille@gostai.com>
880
881 Regen.
882 * src/parse-gram.h, src/parse-gram.c: Regen.
883
884 2008-11-18 Akim Demaille <demaille@gostai.com>
885
886 Use b4_subtract where possible.
887 * data/lalr1.cc (b4_subtract): Move to...
888 * data/bison.m4: here.
889 * data/glr.c (b4_rhs_data): Use it.
890 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
891
892 2008-11-18 Akim Demaille <demaille@gostai.com>
893
894 Remove incorrect mode specification.
895 * data/glr.cc: Don't pretend it's C code.
896
897 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
898
899 Simplify last patch slightly.
900 * src/getargs.c (getargs): Here.
901
902 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
903
904 Fix last warning from --enable-gcc-warnings.
905 * src/getargs.c (getargs): Don't assign const address to non-const
906 pointer.
907
908 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
909
910 Don't let maintainer-*-check targets force a version update.
911 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
912 handled.
913
914 2008-11-17 Di-an Jan <dianj@freeshell.org>
915
916 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
917 Align menus. Adjust word wrapping. Use node names for menu names.
918 (Examples): Don't abbreviate node names.
919 (LocalWords): Remove abbreviations.
920 (Copying): Make description a sentence.
921 (Java Action Features): Remove period to match the rest of menu.
922
923 2008-11-17 Di-an Jan <dianj@freeshell.org>
924
925 Handles several --enable-gcc-warnings.
926 * src/getargs.c (command_line_location): Set parameters to void.
927 * src/output.c (symbol_type_name_cmp): Make static.
928 (symbols_by_type_name): Set parameters to void.
929 (symbol_definitions_output): Remove unused parameter. Rename as...
930 (prepare_symbol_definitions): this.
931 (muscles_output): Move symbol_definitions_output to...
932 (output): here as prepare_symbol_definitions.
933 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
934 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
935
936 2008-11-17 Di-an Jan <dianj@freeshell.org>
937
938 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
939 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
940
941 2008-11-16 Akim Demaille <demaille@gostai.com>
942
943 Add missing $(EXEEXT).
944 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
945 "src/bison$(EXEEXT)".
946 Reported by Di-an Jan.
947
948 2008-11-15 Akim Demaille <demaille@gostai.com>
949
950 * TODO: Update.
951
952 2008-11-15 Akim Demaille <demaille@gostai.com>
953
954 Formatting changes.
955 * tests/input.at: here.
956
957 2008-11-15 Akim Demaille <demaille@gostai.com>
958
959 Remove duplicate header inclusion.
960 * src/LR0.c: here.
961
962 2008-11-15 Akim Demaille <demaille@gostai.com>
963
964 * src/parse-gram.h, src/parse-gram.c: Regen.
965
966 2008-11-15 Akim Demaille <demaille@gostai.com>
967
968 Support parametric types.
969
970 There are two issues to handle: first scanning nested angle
971 bracket pairs to support types such as std::pair< std::string,
972 std::list<std::string> > >.
973
974 Another issue is to address idiosyncracies of C++: do not glue two
975 closing angle brackets together (otherwise it's operator>>), and
976 avoid sticking blindly a TYPE to the opening <, as it can result
977 in '<:' which is a digraph for '['.
978
979 * src/scan-gram.l (brace_level): Rename as...
980 (nesting): this.
981 (SC_TAG): New.
982 Implement support for complex tags.
983 (tag): Accept
984 , but not <.
985 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
986 (b4_symbol_variant): Leave space around types as parameters.
987 * examples/variant.yy: Use nested template types and leading ::.
988 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
989 Rename as...
990 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
991 * tests/c++.at: Test parametric types.
992
993 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
994
995 Test token.prefix.
996 This is not sufficient, but we test at least that the make_SYMBOL
997 interface is not affected by token.prefix. A more general test
998 will be implemented when the support of token.prefix is generalized
999 to more skeletons.
1000
1001 * tests/c++.at: One more variant test, using token.prefix.
1002
1003 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1004
1005 Test the make_TOKEN interface.
1006 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
1007 Factor the common code in yylex.
1008 Use it to test "%define lex_symbol".
1009
1010 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1011
1012 Formatting change.
1013
1014 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1015
1016 Simplify code for variants bench marks.
1017 * etc/bench.pl.in (&generate_grammar_list): Define and use
1018 location_type.
1019 Factor the common code in yylex.
1020
1021 2008-11-15 Akim Demaille <demaille@gostai.com>
1022
1023 Better error message.
1024 * bootstrap (find_tool): Fix the error message.
1025
1026 2008-11-15 Akim Demaille <demaille@gostai.com>
1027
1028 Update variant.yy to newest interface.
1029 * examples/variant.yy: Define lex_symbol.
1030 Adjust.
1031
1032 2008-11-15 Akim Demaille <demaille@gostai.com>
1033
1034 Don't use locations in variant.yy.
1035 * examples/variant.yy: Adjust to not using locations.
1036
1037 2008-11-15 Akim Demaille <demaille@gostai.com>
1038
1039 Comment changes.
1040 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
1041 comments for the license.
1042
1043 2008-11-15 Akim Demaille <demaille@gostai.com>
1044
1045 Remove tests/Makefile.am.
1046 * tests/Makefile.am: Rename as...
1047 * tests/local.mk: this.
1048 * Makefile.am, configure.ac: Adjust.
1049 * Makefile.am (DISTCLEANFILES): Define.
1050 (maintainer-check, maintainer-xml-check, maintainer-push-check):
1051 Remove, we no longer need to bounce to the real targets.
1052
1053 2008-11-15 Akim Demaille <demaille@gostai.com>
1054
1055 Comment changes.
1056
1057 2008-11-15 Akim Demaille <demaille@gostai.com>
1058
1059 djgpp/local.mk.
1060 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
1061 * djgpp/local.mk: this new file.
1062
1063 2008-11-15 Akim Demaille <demaille@gostai.com>
1064
1065 Remove doc/Makefile.am.
1066 * doc/Makefile.am: Rename as...
1067 * doc/local.mk: this.
1068 Adjust paths
1069 * Makefile.am, configure.ac: Adjust.
1070 * Makefile.am (MOSTLYCLEANFILES): New.
1071 * src/local.mk: Adjust.
1072
1073 2008-11-15 Akim Demaille <demaille@gostai.com>
1074
1075 Move sc_tight_scope into maint.mk.
1076 It does not work, and I don't know how it was supposed to work: it
1077 seems to be looking for sources in the build tree. I just moved
1078 it at a better place, fixing it is still required.
1079
1080 * src/local.mk (echo): Remove.
1081 (sc_tight_scope): Move to...
1082 * maint.mk: here.
1083
1084 2008-11-15 Akim Demaille <demaille@gostai.com>
1085
1086 Regen.
1087 * src/parse-gram.h, src/parse-gram.h: Regen.
1088
1089 2008-11-15 Akim Demaille <demaille@gostai.com>
1090
1091 Remove src/Makefile.am.
1092 * src/Makefile.am: Rename as...
1093 * src/local.mk: this.
1094 Prefix all the paths with src/.
1095 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
1096 (AM_CPPFLAGS): Find find in builddir/src.
1097 (YACC): Move the flags into...
1098 (AM_YFLAGS): here.
1099 * maint.mk (sc_tight_scope): Disable.
1100 It used to bounce to the version in src/Makefile.am which is now
1101 part of this very Makefile.
1102 * Makefile.am, configure.ac: Adjust.
1103 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
1104 include "..." to find files "here": we are no longer in src/, so
1105 qualify the includes with src/.
1106 * doc/Makefile.am (PREPATH): No longer include the top_builddir
1107 prefix.
1108 (.x.1): Adjust to be able to create src/foo from the top level
1109 Makefile, instead of going bounce to src/Makefile the creation of
1110 foo.
1111
1112 2008-11-15 Akim Demaille <demaille@gostai.com>
1113
1114 Remove useless variable.
1115 * doc/Makefile.am (srcsrcdir): Remove.
1116
1117 2008-11-15 Akim Demaille <demaille@gostai.com>
1118
1119 Remove data/Makefile.am.
1120 * data/Makefile.am: Rename as...
1121 * data/local.mk: this.
1122 Adjust paths.
1123 * Makefile.am, configure.ac: Adjust.
1124
1125 2008-11-15 Akim Demaille <demaille@gostai.com>
1126
1127 Remove etc/Makefile.am.
1128 * etc/Makefile.am: Rename as...
1129 * etc/local.mk: this.
1130 Adjust.
1131 * Makefile.am, configure.ac: Adjust.
1132
1133 2008-11-15 Akim Demaille <demaille@gostai.com>
1134
1135 Remove examples/local.mk.
1136 examples/calc++/Makefile.am might be interesting to keep as is, since
1137 it is an example in itself.
1138
1139 * examples/Makefile.am: Rename as...
1140 * examples/local.mk: this.
1141 Adjust.
1142 * Makefile.am, configure.ac: Adjust.
1143
1144 2008-11-15 Akim Demaille <demaille@gostai.com>
1145
1146 Remove build-aux/Makefile.am.
1147 Recursive Makefiles are really way too slow, let's get rid of some of
1148 them.
1149
1150 * build-aux/Makefile.am: Rename as...
1151 * build-aux/local.mk: this.
1152 Adjust paths.
1153 * Makefile.am, configure.ac: Adjust.
1154
1155 2008-11-15 Akim Demaille <demaille@gostai.com>
1156
1157 Provide convenience constructors for locations and positions.
1158 * data/location.cc (position::position): Accept file, line and
1159 column as arguments with default values.
1160 Always qualify initial line and column literals as unsigned.
1161 (location::location): Provide convenience constructors.
1162
1163 2008-11-15 Akim Demaille <demaille@gostai.com>
1164
1165 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
1166 token type.
1167 Using template buys us nothing, and makes it uselessly complex to
1168 construct a symbol. Besides, it could not be generalized to other
1169 languages, while make_FOO would work in C/Java etc.
1170
1171 * data/lalr1.cc (b4_symbol_): New.
1172 (b4_symbol): Use it.
1173 (b4_symbol_constructor_declaration_)
1174 (b4_symbol_constructor_definition_): Instead of generating
1175 specializations of an overloaded template function, just generate
1176 several functions whose names are forged from the token names
1177 without the token.prefix.
1178 (b4_symbol_constructor_declarations): Generate them for all the
1179 symbols, not just by class of symbol type, now that instead of
1180 specializing a function template by the token, we generate a
1181 function named after the token.
1182 (b4_symbol_constructor_specialization_)
1183 (b4_symbol_constructor_specializations): Remove.
1184 * etc/bench.pl.in: Adjust to this new API.
1185
1186 2008-11-13 Akim Demaille <demaille@gostai.com>
1187
1188 %define token.prefix.
1189 Provide a means to add a prefix to the name of the tokens as
1190 output in the generated files. Because of name clashes, it is
1191 good to have such a prefix such as TOK_ that protects from names
1192 such as EOF, FILE etc. But it clutters the grammar itself.
1193
1194 * data/bison.m4 (token.prefix): Empty by default.
1195 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
1196 * data/lalr1.cc (b4_symbol): Ditto.
1197
1198 2008-11-13 Akim Demaille <demaille@gostai.com>
1199
1200 Compute at M4 time some of the subtractions.
1201 * data/lalr1.cc (b4_subtract): New.
1202 (b4_rhs_data): Use it.
1203
1204 2008-11-13 Akim Demaille <demaille@gostai.com>
1205
1206 symbol::token.
1207 This allows the user to get the type of a token returned by yylex.
1208
1209 * data/lalr1.cc (symbol::token): New.
1210 (yytoknum_): Define when %define lex_symbol, independently of
1211 %debug.
1212 (yytoken_number_): Move into...
1213 (symbol::token): here, since that's the only use.
1214 The other one is YYPRINT which was not officially supported
1215 by lalr1.cc, and anyway it did not work since YYPRINT uses this
1216 array under a different name (yytoknum).
1217
1218 2008-11-13 Akim Demaille <demaille@gostai.com>
1219
1220 YYERRCODE.
1221 * TODO (YYERRCODE): Mention the case of $undef.
1222
1223 2008-11-13 Akim Demaille <demaille@gostai.com>
1224
1225 TODO: YYPRINT.
1226 * TODO (YYPRINT): New.
1227
1228 2008-11-13 Akim Demaille <demaille@gostai.com>
1229
1230 Comment changes.
1231 * data/lalr1.cc, data/yacc.c: Fix the description of the
1232 yytranslate and yytoknum tables.
1233
1234 2008-11-13 Akim Demaille <demaille@gostai.com>
1235
1236 Define make_symbol in the header.
1237 To reach good performances these functions should be inlined (yet
1238 this is to measure precisely). To this end they must be available
1239 to the caller.
1240
1241 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
1242 location_type with the class name.
1243 Since will now be output in the header, declare "inline".
1244 No longer use b4_symbol_constructor_specializations, but
1245 b4_symbol_constructor_definitions in the header.
1246 Don't call it in the *.cc file.
1247
1248 2008-11-13 Akim Demaille <demaille@gostai.com>
1249
1250 Define yytranslate in the header for lex_symbol.
1251 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
1252 into the header file when using %define lex_symbol.
1253 (yytranslate_): Declare inline.
1254
1255 2008-11-13 Akim Demaille <demaille@gostai.com>
1256
1257 Define the constructors of symbol_type in
1258 b4_symbol_constructor_definitions.
1259 The constructors are called by the make_symbol functions, which a
1260 forthcoming patch will move elsewhere. Hence the interest of
1261 putting them together.
1262
1263 The stack_symbol_type does not need to be moved, it is used only
1264 by the parser.
1265
1266 * data/lalr1.cc: Move symbol_type and symbol_base_type
1267 constructors into...
1268 (b4_symbol_constructor_definitions): here.
1269 Adjust.
1270
1271 2008-11-13 Akim Demaille <demaille@gostai.com>
1272
1273 Make it easier to move the definition of yytranslate_.
1274 Forthcoming changes will make it possible to use yytranslate_
1275 from outside the parser implementation file.
1276
1277 * data/lalr1.cc (b4_yytranslate_definition): New.
1278 Use it.
1279
1280 2008-11-13 Akim Demaille <demaille@gostai.com>
1281
1282 Remove useless class specification.
1283 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
1284 to refer to the class name to use a type defined by the class for
1285 arguments of member functions.
1286
1287 2008-11-13 Akim Demaille <demaille@gostai.com>
1288
1289 Finer input type for yytranslate.
1290 This patch is debatable: the tradition expects yylex to return an int
1291 which happens to correspond to token_number (which is an enum). This
1292 allows for instance to return characters (such as '*' etc.). But this
1293 goes against the stronger typing I am trying to have with the new
1294 lex interface which return a symbol_type. So in this case, feed
1295 yytranslate_ with a token_type.
1296
1297 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
1298 expect a token_type.
1299
1300 2008-11-13 Akim Demaille <demaille@gostai.com>
1301
1302 Honor lex-params in %define lex_symbol mode.
1303 * data/lalr1.cc: Use b4_lex_param.
1304
1305 2008-11-13 Akim Demaille <demaille@gostai.com>
1306
1307 Simplify names.
1308 * src/output.c (symbol_definitions_output): Rename symbol
1309 attributes type_name and has_type_name as type and has_type.
1310 * data/lalr1.cc: Adjust uses.
1311
1312 2008-11-13 Akim Demaille <demaille@gostai.com>
1313
1314 Use b4_type_names for the union type.
1315 The union used to compute the size of the variant used to iterate
1316 over the type of all the symbols, with a lot of redundancy. Now
1317 iterate over the lists of symbols having the same type-name.
1318
1319 * data/lalr1.cc (b4_char_sizeof_): New.
1320 (b4_char_sizeof): Use it.
1321 Adjust to be called with a list of numbers instead of a single
1322 number.
1323 Adjust its caller for new-line issues.
1324
1325 2008-11-13 Akim Demaille <demaille@gostai.com>
1326
1327 Define the "identifier" of a symbol.
1328 Symbols may have several string representations, for instance if
1329 they have an alias. What I call its "id" is a string that can be
1330 used as an identifier. May not exist.
1331
1332 Currently the symbols which have the "tag_is_id" flag set are
1333 those that don't have an alias. Look harder for the id.
1334
1335 * src/output.c (is_identifier): Move to...
1336 * src/symtab.c (is_identifier): here.
1337 * src/symtab.h, src/symtab.c (symbol_id_get): New.
1338 * src/output.c (symbol_definitions_output): Use it to define "id"
1339 and "has_id".
1340 Remove the definition of "tag_is_id".
1341 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
1342 "tag_is_id" were used to produce code.
1343 We still use "tag" for documentation.
1344
1345 2008-11-11 Akim Demaille <demaille@gostai.com>
1346
1347 Locations are no longer required by lalr1.cc.
1348 * data/lalr1.cc (_b4_args, b4_args): New.
1349 Adjust all uses of locations to make them optional.
1350 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
1351 (AT_CHECK_NAMESPACE): Check the use of locations.
1352 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
1353 without locations with lalr1.cc.
1354 Test these cases.
1355 * tests/output.at: Check lalr1.cc with and without location
1356 support.
1357 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
1358 Don't use locations.
1359
1360 2008-11-11 Akim Demaille <demaille@gostai.com>
1361
1362 AT_FULL_COMPILE.
1363 * tests/local.at (AT_FULL_COMPILE): New.
1364 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
1365
1366 2008-11-11 Akim Demaille <demaille@gostai.com>
1367
1368 Support parens in calc++.
1369 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
1370 * examples/calc++/test (run): Check the expected output.
1371 Adjust callers.
1372 Check parens too.
1373
1374 2008-11-11 Akim Demaille <demaille@gostai.com>
1375
1376 Simplify lalr1.cc since %defines is mandatory.
1377 * data/lalr1.cc: Remove useless calls to b4_defines_if.
1378
1379 2008-11-11 Akim Demaille <demaille@gostai.com>
1380
1381 TODO: yyfmt.
1382 * TODO (yysyntax_error): New item.
1383
1384 2008-11-11 Akim Demaille <demaille@gostai.com>
1385
1386 Prefer M4 to CPP.
1387 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
1388 YYERROR_VERBOSE.
1389
1390 2008-11-11 Akim Demaille <demaille@gostai.com>
1391
1392 Support i18n of the parse error messages.
1393 * TODO (lalr1.cc/I18n): Remove.
1394 * data/lalr1.cc (yysyntax_error_): Support the translation of the
1395 error messages, as done in yacc.c.
1396 Stay within the yy* pseudo namespace.
1397
1398 2008-11-11 Akim Demaille <demaille@gostai.com>
1399
1400 More TODO.
1401 * TODO (single stack, yysyntax_error): New.
1402
1403 2008-11-11 Akim Demaille <demaille@gostai.com>
1404
1405 Make it possible to return a symbol_type from yylex.
1406 * data/lalr1.cc (b4_lex_symbol_if): New.
1407 (parse): When lex_symbol is defined, expected yylex to return the
1408 complete lookahead.
1409 * etc/bench.pl.in (generate_grammar_list): Extend to support this
1410 yylex interface.
1411 (bench_variant_parser): Exercise it.
1412
1413 2008-11-11 Akim Demaille <demaille@gostai.com>
1414
1415 Remove useless bench case.
1416 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
1417 no longer used.
1418
1419 2008-11-11 Akim Demaille <demaille@gostai.com>
1420
1421 Improve display of directives.
1422 * etc/bench.pl.in (parse_term): Don't add useless eol.
1423
1424 2008-11-11 Akim Demaille <demaille@gostai.com>
1425
1426 Use string_cast in the bench.
1427 * etc/bench.pl.in (generate_grammar_list): Define and use
1428 string_cast.
1429
1430 2008-11-11 Akim Demaille <demaille@gostai.com>
1431
1432 Replace yychar with a Boolean.
1433 * data/lalr1.cc (parse::yychar): Replace by...
1434 (parse::yyempty): this.
1435
1436 2008-11-11 Akim Demaille <demaille@gostai.com>
1437
1438 Factor the tables.
1439 * TODO: New item.
1440
1441 2008-11-11 Akim Demaille <demaille@gostai.com>
1442
1443 Let yytranslate handle the eof case.
1444 * data/lalr1.cc (yytranslate_): Handle the EOF case.
1445 Adjust callers.
1446 No longer expect yychar to be equal to yyeof_, rather, test the
1447 lookahead's (translated) kind.
1448
1449 2008-11-11 Akim Demaille <demaille@gostai.com>
1450
1451 yychar cannot be empty in yyerrlab.
1452 * TODO (yychar == yyempty_): New.
1453 * data/lalr1.cc: Remove the handling of this case.
1454 This eases forthcoming changes related to yychar and yytranslate.
1455
1456 2008-11-11 Akim Demaille <demaille@gostai.com>
1457
1458 Bench: syntactic sugar for %define/#define.
1459 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
1460 (&bench_push_parser, bench_variant_parser): Use this feature.
1461 (&eat): New.
1462 Use it.
1463
1464 2008-11-11 Akim Demaille <demaille@gostai.com>
1465
1466 Less memory pressure on the "list" bench.
1467 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
1468 the values, to limit memory pressure.
1469
1470 2008-11-11 Akim Demaille <demaille@gostai.com>
1471
1472 Introduce make_symbol.
1473 make_symbol provides a means to construct a full symbol (kind,
1474 value, location) in a single shot. It is meant to be a Symbol
1475 constructor, parameterized by the symbol kind so that overloading
1476 would prevent incorrect kind/value pairs. Unfortunately
1477 parameterized constructors do not work well in C++ (unless the
1478 parameter also appears as an argument, which is not acceptable),
1479 hence the use of a function instead of a constructor.
1480
1481 * data/lalr1.cc (b4_symbol_constructor_declaration_)
1482 (b4_symbol_constructor_declarations)
1483 (b4_symbol_constructor_specialization_)
1484 (b4_symbol_constructor_specializations)
1485 (b4_symbol_constructor_definition_)
1486 (b4_symbol_constructor_definitions): New.
1487 Use them where appropriate to generate declaration, declaration of
1488 the specializations, and implementations of the templated
1489 overloaded function "make_symbol".
1490 (variant::variant): Always define a default ctor.
1491 Also provide a copy ctor.
1492 (symbol_base_type, symbol_type): New ctor overloads for value-less
1493 symbols.
1494 (symbol_type): Now public, so that functions such as yylex can use
1495 it.
1496
1497 2008-11-11 Akim Demaille <demaille@gostai.com>
1498
1499 Inform m4 whether a tag is a valid id.
1500 * src/output.c (is_identifier): New.
1501 (symbol_definitions_output): Use it to define tag_is_id.
1502 But maybe this should be done at m4 level?
1503
1504 2008-11-11 Akim Demaille <demaille@gostai.com>
1505
1506 Test 214 was failing: it greps with a pattern containing [ ]*
1507 which obviously meant to catch spaces and tabs, but contained only
1508 spaces. Tabulations in sources are a nuisance, so to simplify the
1509 matter, get rid of all the tabulations in the Java sources. The
1510 other skeletons will be treated equally later.
1511
1512 * data/java.m4, data/lalr1.java: Untabify.
1513 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
1514 tabulations are no longer generated.
1515
1516 2008-11-11 Paolo Bonzini <bonzini@gnu.org>
1517
1518 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
1519 * configure.ac: Adjust usage.
1520 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1521 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1522 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
1523
1524 2008-11-10 Di-an Jan <dianj@freeshell.org>
1525
1526 Workaround Java's ``code too large'' problem for parser tables
1527 in most cases, by using one function per initialization.
1528 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
1529 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
1530 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
1531 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
1532 (yytname_): Use b4_typed_parser_table.
1533 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
1534 ``code too large'' error.
1535
1536 2008-11-10 Di-an Jan <dianj@freeshell.org>
1537
1538 * NEWS: Document them.
1539
1540 General Java skeleton improvements.
1541 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
1542 using gcj < 4.3 in the testsuite, according to comments in
1543 gnulib/m4/javacomp.m4.
1544 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
1545 location_type, position_type): Remove extraneous brackets from
1546 b4_percent_define_default.
1547 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
1548 m4_define and m4_define_default.
1549 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
1550 which marks the end of user code with appropriate syncline, like all
1551 the other skeletons.
1552 (b4_user_post_prologue): Add. Don't silently drop.
1553 (yylex): Remove.
1554 (parse): Inline yylex.
1555 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
1556 (%{...%}): Fix typo of %code imports.
1557 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
1558
1559 Support annotations on parser class with %define annotations.
1560 * data/lalr1.java (annotations): Add to parser class modifier.
1561 * doc/bison.texinfo (Java Parser Interface): Document
1562 %define annotations.
1563 (Java Declarations Summary): Document %define annotations.
1564 * tests/java.at (Java parser class modifiers): Test annotations.
1565
1566 Do not generate code for %error-verbose unless requested.
1567 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
1568 Make private. Make conditional on %error-verbose.
1569 (getErrorVerbose, setErrorVerbose): New.
1570 (yytnamerr_): Make conditional on %error-verbose.
1571 (yysyntax_error): Make some code conditional on %error-verbose.
1572 * doc/bison.texinfo (Java Bison Interface): Remove the parts
1573 about %error-verbose having no effect.
1574 (getErrorVerbose, setErrorVerbose): Document.
1575
1576 Move constants for token names to Lexer interface.
1577 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
1578 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
1579 (parse): Qualify EOF to Lexer.EOF.
1580 * doc/bison.texinfo (Java Parser Interface): Move documentation of
1581 EOF and token names to Java Lexer Interface.
1582 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
1583
1584 Make yyerror public.
1585 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
1586 (yyerror): Change to public. Add Javadoc comments. Use longer
1587 parameter names. Make the body rather than the declarator
1588 conditional on %locations.
1589 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
1590
1591 Allow user to add code to the constructor with %code init.
1592 * data/java.m4 (b4_init_throws): New, for %define init_throws.
1593 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
1594 Add %code init to the front of the constructor body.
1595 * doc/bison.texinfo (YYParser.YYParser): Document %code init
1596 and %define init_throws.
1597 (Java Declarations Summary): Document %code init and
1598 %define init_throws.
1599 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
1600 (Java constructor init and init_throws): Add tests.
1601
1602 2008-11-10 Akim Demaille <demaille@gostai.com>
1603
1604 Update TODO.
1605 * TODO (-D): is implemented.
1606 (associativity): Same precedence must have the same associativity.
1607 For instance, how can a * b / c be parsed if * is %left and / is
1608 %right?
1609 (YYERRORCODE, YYFAIL, YYBACKUP): New.
1610
1611 2008-11-10 Akim Demaille <demaille@gostai.com>
1612
1613 Formatting changes.
1614
1615 2008-11-10 Akim Demaille <demaille@gostai.com>
1616
1617 More information about the symbols.
1618 * src/output.c (type_names_output): Document all the symbols,
1619 including those that don't have a type-name.
1620 (symbol_definitions_output): Define "is_token" and
1621 "has_type_name".
1622 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
1623 type-name, now that they are defined too in b4_type_names.
1624
1625 2008-11-10 Akim Demaille <demaille@gostai.com>
1626
1627 Regen.
1628
1629 2008-11-10 Akim Demaille <demaille@gostai.com>
1630
1631 Make parser::yytranslate static.
1632 Small speedup (1%) on the list grammar. And makes yytranslate_
1633 available in non member functions.
1634
1635 * data/lalr1.cc (yytranslate_): Does not need to be a instance
1636 function.
1637
1638 2008-11-10 Akim Demaille <demaille@gostai.com>
1639
1640 Avoid trailing spaces.
1641 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
1642 * data/lalr1.cc: Don't indent before rule and symbol actions, as
1643 they can be empty, and anyway this incorrectly indents the first
1644 action.
1645
1646 2008-11-10 Akim Demaille <demaille@gostai.com>
1647
1648 Comment changes.
1649
1650 2008-11-10 Akim Demaille <demaille@gostai.com>
1651
1652 Use "enum" for integral constants.
1653 This is just nicer to read, I observed no speedup.
1654
1655 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
1656 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
1657 (yyuser_token_number_max_, yyundef_token_): Move into...
1658 (yytranslate_): here.
1659
1660 2008-11-10 Akim Demaille <demaille@gostai.com>
1661
1662 Shortcuts in bench directives.
1663 * etc/bench.pl.in (parse_dirs): New.
1664 Use it.
1665 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
1666 Create the benches in "benches/".
1667
1668 2008-11-10 Akim Demaille <demaille@gostai.com>
1669
1670 Formatting changes.
1671 * data/lalr1.cc: here.
1672
1673 2008-11-10 Akim Demaille <demaille@gostai.com>
1674
1675 Adjust verbose message to using emacs.
1676 * etc/bench.pl.in: Inform compilation-mode when we change the
1677 directory.
1678 (generate_grammar_list): Recognize %define "variant" in addition
1679 to %define variant.
1680
1681 2008-11-10 Akim Demaille <demaille@gostai.com>
1682
1683 Classify symbols by type-name.
1684 * src/uniqstr.h (UNIQSTR_CMP): New.
1685 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
1686 (type_names_output): New.
1687 (muscles_output): Use it.
1688 * data/lalr1.cc (b4_symbol_action_): Remove.
1689 (b4_symbol_case_, b4_type_action_): New.
1690 Adjust uses of b4_symbol_action_ to use b4_type_action_.
1691
1692 2008-11-10 Akim Demaille <demaille@gostai.com>
1693
1694 Change the handling of the symbols in the skeletons.
1695 Before we were using tables which lines were the symbols and which
1696 columns were things like number, tag, type-name etc. It is was
1697 difficult to extend: each time a column was added, all the numbers had
1698 to be updated (you asked for colon $2, not for "tag"). Also, it was
1699 hard to filter these tables when only a subset of the symbols (say the
1700 tokens, or the nterms, or the tokens that have and external number
1701 *and* a type-name) was of interest.
1702
1703 Now instead of monolithic tables, we define one macro per cell. For
1704 instance "b4_symbol(0, tag)" is a macro name which contents is
1705 self-decriptive. The macro "b4_symbol" provides easier access to
1706 these cells.
1707
1708 * src/output.c (type_names_output): Remove.
1709 (symbol_numbers_output, symbol_definitions_output): New.
1710 (muscles_output): Call them.
1711 (prepare_symbols): Define b4_symbols_number.
1712
1713 2008-11-10 Akim Demaille <demaille@gostai.com>
1714
1715 --trace=muscles
1716 * src/getargs.h, src/getargs.c (trace_muscle): New.
1717 (trace_types, trace_args): Support it.
1718 * src/output.c (output_skeleton): Use it.
1719
1720 2008-11-10 Akim Demaille <demaille@gostai.com>
1721
1722 muscles_output.
1723 * src/output.c (muscles_output): New, extracted from...
1724 (output_skeleton): here.
1725 Adjust.
1726
1727 2008-11-10 Akim Demaille <demaille@gostai.com>
1728
1729 Formatting changes.
1730
1731 2008-11-10 Akim Demaille <demaille@gostai.com>
1732
1733 Update the variant example.
1734 * examples/variant.yy: Formatting changes.
1735 One stage build.
1736
1737 2008-11-10 Akim Demaille <demaille@gostai.com>
1738
1739 Support constructor with an argument.
1740 This improves the "list" bench by 2%.
1741
1742 * data/lalr1.cc (variant::build): Add an overloaded version with
1743 an argument.
1744 * tests/c++.at (AT_CHECK_VARIANT): Check it.
1745
1746 2008-11-10 Akim Demaille <demaille@gostai.com>
1747
1748 Test variants.
1749 * tests/c++.at (AT_CHECK_VARIANTS): New.
1750 Use it with and without %define assert.
1751
1752 2008-11-10 Akim Demaille <demaille@gostai.com>
1753
1754 Add %precedence support.
1755 Unfortunately it is not possible to reuse the %prec directive. This
1756 is because to please POSIX, we do not require to end the rules with a
1757 semicolon. As a result,
1758
1759 foo: bar %prec baz
1760
1761 is ambiguous: either a rule which precedence is that of baz, or a rule,
1762 and then a declaration of the precedence of the token baz.
1763
1764 * doc/bison.texinfo: Document %precedence.
1765 (Precedence Only): New.
1766 * src/assoc.h, src/assoc.c (precedence_assoc): New.
1767 * src/conflicts.c (resolve_sr_conflict): Support it.
1768 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
1769 Parse it.
1770 * tests/calc.at: Use %precedence for NEG.
1771 * tests/conflicts.at (%precedence does not suffice)
1772 (%precedence suffices): New tests.
1773
1774 2008-11-09 Akim Demaille <demaille@gostai.com>
1775
1776 Make benches in a sub dirs.
1777 * etc/bench.pl.in ($dir): New.
1778 Use it.
1779 Check the use of constructors with an argument.
1780 (bench_variant_parser): Fix.
1781
1782 2008-11-09 Akim Demaille <demaille@gostai.com>
1783
1784 fix eof condition
1785
1786 2008-11-09 Akim Demaille <demaille@gostai.com>
1787
1788 Fix --help.
1789
1790 2008-11-09 Akim Demaille <demaille@gostai.com>
1791
1792 Require the generation of parse-gram.output.
1793 * src/Makefile.am (YACC): Pass --report=all.
1794
1795 2008-11-09 Akim Demaille <demaille@gostai.com>
1796
1797 Formatting changes.
1798
1799 2008-11-09 Akim Demaille <demaille@gostai.com>
1800
1801 Update TODO.
1802 * TODO: Remove obsolete items.
1803 Update others.
1804
1805 2008-11-09 Akim Demaille <demaille@gostai.com>
1806
1807 Enhance bench.pl.
1808 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
1809 (@token, $grammar, $bench): New.
1810 (generate_grammar_variant): Rename as...
1811 (generate_grammar_list): this.
1812 (generate_grammar): Adjust.
1813 (bench_grammar): Rename as...
1814 (bench): this.
1815 Use it in the various bench-marking routines.
1816 (-b, -g): New options.
1817
1818 2008-11-09 Akim Demaille <demaille@gostai.com>
1819
1820 Use a static hierarchy for symbols in the C++ parser.
1821 * data/lalr1.cc (symbol_base_type, symbol_type)
1822 (stack_symbol_type): Make it a static hierarchy.
1823 Adjust dependencies.
1824
1825 2008-11-09 Akim Demaille <demaille@gostai.com>
1826
1827 bench.pl -d, --directive.
1828 * etc/bench.pl.in (@directive): New.
1829 (&bench_grammar): Use it.
1830 (&bench_list_grammar): New, to provide access to the "variant"
1831 grammar.
1832 Use it.
1833 (getopts): Support -d, --directive.
1834
1835 2008-11-09 Akim Demaille <demaille@gostai.com>
1836
1837 Use inline for small operations.
1838 * data/lalr1.cc (symbol_base_type, symbol_type)
1839 (stack_symbol_type): Declare constructor and other operations as
1840 inline.
1841 (yy_destroy_): Inline.
1842
1843 2008-11-09 Akim Demaille <demaille@gostai.com>
1844
1845 Introduce a hierarchy for symbols.
1846 * data/lalr1.cc (symbol_base_type, symbol_type): New.
1847 (data_type): Rename as...
1848 (stack_symbol_type): this.
1849 Derive from symbol_base_type.
1850 (yy_symbol_value_print_): Merge into...
1851 (yy_symbol_print_): this.
1852 Rename as...
1853 (yy_print_): this.
1854 (yydestruct_): Rename as...
1855 (yy_destroy_): this.
1856 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
1857 (parser::parse): yyla is now of symbol_type.
1858 Use its type member instead of yytoken.
1859
1860 2008-11-09 Akim Demaille <demaille@gostai.com>
1861
1862 Rename data_type and stack_symbol_type.
1863 * data/lalr1.cc (data_type): Rename as...
1864 (stack_symbol_type): this.
1865
1866 2008-11-09 Akim Demaille <demaille@gostai.com>
1867
1868 Handle semantic value and location together.
1869 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
1870 yydata.value and yydata.location.
1871 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
1872 (YY_SYMBOL_PRINT): Now take semantic value and location as a
1873 single arg.
1874 Adjust all callers.
1875 (yydestruct_): New overload for a stack symbol.
1876
1877 2008-11-09 Akim Demaille <demaille@gostai.com>
1878
1879 Push a complete symbol, not connected parts.
1880 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
1881 state, value and location.
1882 Adjust callers.
1883
1884 2008-11-09 Akim Demaille <demaille@gostai.com>
1885
1886 Agregate yylval and yylloc.
1887 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
1888 (parser::yyla): this.
1889
1890 2008-11-09 Akim Demaille <demaille@gostai.com>
1891
1892 Rely on the state stack to display reduction traces.
1893 To display rhs symbols before a reduction, we used information
1894 about the rule reduced, which required the tables yyrhs and
1895 yyprhs. Now use rely only on the state stack to get the same
1896 information.
1897
1898 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
1899 Use them.
1900 (parser::yyrhs_, parser::yyprhs_): Remove.
1901 (parser::yy_reduce_print_): Use the state stack.
1902
1903 2008-11-09 Akim Demaille <demaille@gostai.com>
1904
1905 Fuse yyval and yyloc into yylhs.
1906 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
1907 yylhs.
1908 (parse): Replace yyval and yyloc with yylhs.value and
1909 yylhs.location.
1910 After a user action, compute yylhs.state earlier.
1911 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
1912 fresh error_token.
1913
1914 2008-11-09 Di-an Jan <dianj@freeshell.org>
1915
1916 Remove unused variable.
1917 * src/output.c (type_names_output): Remove unused variable sep.
1918
1919 2008-11-09 Paolo Bonzini <bonzini@gnu.org>
1920
1921 Change tests/output.at quoting.
1922 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
1923 expanding arguments.
1924
1925 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1926
1927 Don't add a semicolon to actions for %skeleton or %language.
1928 It breaks Java test cases as reported by Akim Demaille.
1929 * src/scan-code.l: Implement.
1930
1931 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1932
1933 Clean up %skeleton and %language priority implementation.
1934 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
1935 remove static qualifier because others will soon need to see it.
1936 (language_prio): Likewise.
1937 (getargs): Use command_line_prio rather than 0.
1938 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
1939 enum fields.
1940 (skeleton_prio): Extern it.
1941 (language_prio): Extern it.
1942 * src/parse-gram.y: Use grammar_prio rather than 1.
1943
1944 2008-11-07 Akim Demaille <demaille@gostai.com>
1945
1946 Moving push traces into yypush_.
1947 * data/lalr1.cc (yypush_): Now takes a optional trace message.
1948 Adjust all uses.
1949
1950 2008-11-07 Akim Demaille <demaille@gostai.com>
1951
1952 The single-stack C++ parser is now the standard one.
1953 * data/lalr1.cc: Rename as...
1954 * data/lalr1-split.cc: this.
1955 * data/lalr1-fusion.cc: Rename as...
1956 * data/lalr1.cc: this.
1957 * etc/bench.pl.in: Adjust.
1958
1959 2008-11-07 Akim Demaille <demaille@gostai.com>
1960
1961 Avoid empty-if warnings.
1962 Reported by Quentin Hocquet.
1963
1964 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
1965 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
1966
1967 2008-11-07 Akim Demaille <demaille@gostai.com>
1968
1969 Pass command line location to skeleton_arg and language_argmatch.
1970 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
1971 The location argument is now mandatory.
1972 Adjust all dependencies.
1973 (getargs): Use command_line_location.
1974
1975 2008-11-07 Akim Demaille <demaille@gostai.com>
1976
1977 -D, --define.
1978 * src/getargs.c (usage): Document -D.
1979 Fix help string for --locations.
1980 (command_line_location): New.
1981 (short_options, long_options, getargs): Support -D, --define.
1982 (getargs): Move -d support at the right place.
1983 * doc/bison.texinfo (Bison Options): Update.
1984 * tests/input.at (%define, --define): New.
1985
1986 2008-11-07 Akim Demaille <demaille@gostai.com>
1987
1988 Initialize the muscle table before parsing the command line.
1989 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
1990 (getargs): Define file_name.
1991 * src/main.c (main): Initialize muscle_tab before calling
1992 getargs.
1993 * src/muscle_tab.c (muscle_init): No longer define file_name, as
1994 its value is not available yet.
1995
1996 2008-11-07 Akim Demaille <demaille@gostai.com>
1997
1998 Locations without columns for command line arguments.
1999 * src/location.c (location_print): Don't display negative columns.
2000 * src/location.h: Document this.
2001
2002 2008-11-07 Akim Demaille <demaille@gostai.com>
2003
2004 Fix --help.
2005 * src/getargs.c (usage): Fix help string for -W.
2006
2007 2008-11-07 Akim Demaille <demaille@gostai.com>
2008
2009 Handle more general types of option arguments.
2010 * build-aux/cross-options.pl: The argument ends at the first
2011 space, not the first non-symbol character.
2012 Use @var for each word appearing the argument description.
2013
2014 2008-11-07 Akim Demaille <demaille@gostai.com>
2015
2016 Destroy the variants that remain on the stack in case of error.
2017 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
2018 destructor.
2019 Display the value only if yymsg is nonnull.
2020 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
2021
2022 2008-11-07 Akim Demaille <demaille@gostai.com>
2023
2024 Add "%define assert" to variants.
2025 This is used to help the user catch cases where some value gets
2026 ovewritten by a new one. This should not happen, as this will
2027 probably leak.
2028
2029 Unfortunately this uncovered a bug in the C++ parser itself: the
2030 lookahead value was not destroyed between two calls to yylex. For
2031 instance if the previous lookahead was a std::string, and then an int,
2032 then the value of the std::string was correctly taken (i.e., the
2033 lookahead was now an empty string), but std::string structure itself
2034 was not reclaimed.
2035
2036 This is now done in variant::build(other&) (which is used to take the
2037 value of the lookahead): other is not only stolen from its value, it
2038 is also destroyed. This incurs a new performance penalty of a few
2039 percent, and union becomes faster again.
2040
2041 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
2042 (b4_variant_if): New.
2043 (variant::built): New.
2044 Use it whereever the status of the variant changes.
2045 * etc/bench.pl.in: Check the penalty of %define assert.
2046
2047 2008-11-07 Akim Demaille <demaille@gostai.com>
2048
2049 Use "%define variant" in bench.pl.
2050 * etc/bench.pl.in: No longer use the pseudo directive %variants,
2051 just use %define variants.
2052
2053 2008-11-07 Akim Demaille <demaille@gostai.com>
2054
2055 Regen.
2056 * src/parse-gram.h, src/parse-gram.c: Regen.
2057
2058 2008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
2059
2060 Fix user actions without a trailing semicolon.
2061 Reported by Sergei Steshenko at
2062 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
2063 * THANKS (Sergei Steshenko): Add.
2064 * src/scan-code.l (SC_RULE_ACTION): Fix it.
2065 * tests/regression.at (Fix user actions without a trailing semicolon):
2066 New test case.
2067
2068 2008-11-04 Akim Demaille <demaille@gostai.com>
2069
2070 Use b4_copyright_years.
2071 * data/yacc.c (b4_copyright_years): New.
2072 Fix its value according to the comments in the file.
2073 Use it and undefine it.
2074
2075 2008-11-04 Akim Demaille <demaille@gostai.com>
2076
2077 Formatting changes.
2078 * data/lalr1-fusion.cc, src/parse-gram.y: here.
2079
2080 2008-11-04 Akim Demaille <demaille@gostai.com>
2081
2082 Formatting changes.
2083 * data/lalr1-fusion.cc: here.
2084
2085 2008-11-04 Akim Demaille <demaille@gostai.com>
2086
2087 Use strict on bench.pl.
2088 * etc/bench.pl.in (&run, &generate_grammar): New.
2089 Rename the grammar generating functions for consistency.
2090 Change the interface so that the list of benches to run is passed
2091 as (optionless) arguments.
2092 (&compile): Use &run.
2093
2094 2008-11-04 Akim Demaille <demaille@gostai.com>
2095
2096 Remove spurious initial empty lines.
2097 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
2098 * data/yacc.c: End the @output lines with an @.
2099
2100 2008-11-04 Akim Demaille <demaille@gostai.com>
2101
2102 Improve the display of sizes.
2103 * etc/bench.p.in: Higher precision.
2104 Sort by decreasing size.
2105
2106 2008-11-04 Akim Demaille <demaille@gostai.com>
2107
2108 Don't memcpy C++ structures.
2109 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
2110 arguments.
2111 (variant::build): New overload for
2112 copy-construction-that-destroys.
2113 (variant::swap): New.
2114 (parser::yypush_): Use it in variant mode.
2115
2116 2008-11-04 Akim Demaille <demaille@gostai.com>
2117
2118 Better defaults for bench.pl.
2119 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
2120 default values.
2121 Adjust &verbose uses.
2122 (-q, --quiet): New.
2123
2124 2008-11-04 Akim Demaille <demaille@gostai.com>
2125
2126 Make variant.yy more complex.
2127 std::list cannot be copied via memcpy, they are more demanding than
2128 std::string. Use one std::list to strengthen the test.
2129
2130 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
2131 Adjust.
2132 Create a list of strings, instead of a single large string.
2133
2134 2008-11-04 Akim Demaille <demaille@gostai.com>
2135
2136 bench.pl --bench.
2137 * etc/bench.pl.in (--bench, $bench): New.
2138
2139 2008-11-04 Akim Demaille <demaille@gostai.com>
2140
2141 Sort methods.
2142 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
2143 Define it after as().
2144
2145 2008-11-04 Akim Demaille <demaille@gostai.com>
2146
2147 Useless parens.
2148 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
2149
2150 2008-11-04 Akim Demaille <demaille@gostai.com>
2151
2152 Issue missing synclines after user actions.
2153 * data/c.m4 (b4_case): Issue synclines on the output file.
2154
2155 2008-11-04 Akim Demaille <demaille@gostai.com>
2156
2157 Remove trailing empty line.
2158 * data/lalr1-fusion.cc: Don't add an empty line after the user's
2159 epilogue.
2160
2161 2008-11-04 Akim Demaille <demaille@gostai.com>
2162
2163 Fix output of copyright years.
2164 * data/bison.m4 (b4_copyright): Fix the indentation of the
2165 copyright year paragraph.
2166 Use b4_copyright_years when no years are given.
2167 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
2168 (b4_copyright_years): New.
2169 Use it.
2170
2171 2008-11-04 Akim Demaille <demaille@gostai.com>
2172
2173 Avoid the spurious initial empty line.
2174 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
2175 the end of @output request to suppress the empty line that
2176 results.
2177
2178 2008-11-04 Akim Demaille <demaille@gostai.com>
2179
2180 Remove parser::rhs_number_type.
2181 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
2182 (yyrhs_): Use b4_table_define.
2183
2184 2008-11-04 Akim Demaille <demaille@gostai.com>
2185
2186 Fix iteration type.
2187 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
2188
2189 2008-11-04 Akim Demaille <demaille@gostai.com>
2190
2191 Factor the declaration of the integer tables.
2192 * data/lalr1-fusion.cc (b4_table_define): New.
2193 Use it.
2194
2195 2008-11-03 Akim Demaille <demaille@gostai.com>
2196
2197 Fix indentation of tables in lalr1.cc
2198 * data/lalr1-fusion.cc: Fix the indentation.
2199
2200 2008-11-03 Akim Demaille <demaille@gostai.com>
2201
2202 Destroy the lhs symbols after reduction.
2203 * data/lalr1-fusion.cc (parse): After the user action, when in
2204 variant mode, destroy the lhs symbols.
2205
2206 2008-11-03 Akim Demaille <demaille@gostai.com>
2207
2208 Simplify yysyntax_error_ use.
2209 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
2210 type, but make it unnamed in the declaration when it is not used.
2211
2212 2008-11-03 Akim Demaille <demaille@gostai.com>
2213
2214 Let yy::variant::build return an lvalue.
2215 * data/lalr1-fusion.cc (variant::build): Return a reference to the
2216 object.
2217
2218 2008-11-03 Akim Demaille <demaille@gostai.com>
2219
2220 Define yy::variant only when needed.
2221 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
2222 used.
2223
2224 2008-11-03 Akim Demaille <demaille@gostai.com>
2225
2226 Bench the three-stack lalr1.cc.
2227 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
2228 one-stack one.
2229
2230 2008-11-03 Akim Demaille <demaille@gostai.com>
2231
2232 Fail on parse error in calc++.
2233 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
2234 status.
2235 * examples/calc++/test ($me, $number, $exit, run): New.
2236 Use them to propagate errors to the exit status.
2237
2238 2008-11-03 Akim Demaille <demaille@gostai.com>
2239
2240 Don't specify the skeleton twice in the example.
2241 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
2242 file does what is needed.
2243
2244 2008-11-03 Akim Demaille <demaille@gostai.com>
2245
2246 bench: Improve output.
2247 * etc/bench.pl.in (bench_grammar): Tune the printf format.
2248
2249 2008-11-03 Akim Demaille <demaille@gostai.com>
2250
2251 bench: check impact of %debug on variants.
2252 * etc/bench.pl.in (variant_grammar): Fix the computation of
2253 $variant.
2254 Generate a grammar file that can work with or without %debug.
2255 Do use the @directive.
2256 (bench_variant_parser): Check impact of %debug.
2257 (@directives): Rename all the occurrences to...
2258 (@directive): this, for consistency.
2259
2260 2008-11-03 Akim Demaille <demaille@gostai.com>
2261
2262 bench: report the size too.
2263 * etc/bench.pl.in ($iterations): Defaults to -3.
2264 (&bench_grammar): Require hireswallclock.
2265 Compute and display the size of the result.
2266 More comments.
2267
2268 2008-11-03 Akim Demaille <demaille@gostai.com>
2269
2270 bench: More use of the verbosity level.
2271 * etc/bench.pl.in ($verbose, &verbose): New.
2272 Use them.
2273 More POD documentation.
2274
2275 2008-11-03 Akim Demaille <demaille@gostai.com>
2276
2277 bench.pl: a command line interface
2278 * etc/bench.pl.in: More doc.
2279 Some fixes in the documentation.
2280 ($cflags, $iterations, &help, &getopt): New.
2281 Use them.
2282 (&variant_grammar): Let the number of stages be 10 times what is
2283 specified.
2284
2285 2008-11-03 Akim Demaille <demaille@gostai.com>
2286
2287 Bench the use of Boost.Variants.
2288 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
2289 New.
2290 (&compile): Be ready to compile C++ parsers.
2291 (&bench_push_parser): Move debug information to the outermost
2292 level.
2293 * THANKS: Add Michiel De Wilde.
2294
2295 2008-11-03 Akim Demaille <demaille@gostai.com>
2296
2297 bench.pl: Pass directives as a list instead of as a string.
2298 * etc/bench.pl.in (&directives): New.
2299 (&triangular_grammar, &calc_grammar): Use it to format the Bison
2300 directives.
2301 (&triangular_grammar): Do use the directives (were ignored).
2302 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
2303 directives.
2304
2305 2008-11-03 Akim Demaille <demaille@gostai.com>
2306
2307 Improve genericity of bench.pl.
2308 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
2309 argument.
2310 (&bench_push_parser): New.
2311 Call it.
2312
2313 2008-11-03 Akim Demaille <demaille@gostai.com>
2314
2315 Add documentation to bench.pl.
2316 * etc/bench.pl.in: Comment changes.
2317
2318 2008-11-03 Akim Demaille <demaille@gostai.com>
2319
2320 Fuse the three stacks into a single one.
2321
2322 In order to make it easy to perform benchmarks to ensure that
2323 there are no performance loss, lalr1.cc is forked into
2324 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
2325 lalr1.cc.
2326
2327 Meanwhile, to make sure that lalr1-fusion.cc is correctly
2328 exercized by the test suite, the user must install a symbolic link
2329 from lalr1.cc to it.
2330
2331 Instead of having three stacks (state, value, location), use a
2332 stack of triples. This considerably simplifies the code (and it
2333 will be easier not to require locations as currently does the C++
2334 parser), and also gives a 10% speedup according to
2335 etc/bench (probably mainly since memory allocation is done once
2336 instead of three times).
2337
2338 Another motivation is to make it easier to destruct properly
2339 semantic values: now that they are bound to their state (hence
2340 symbol type) it will be easier to call the appropriate destructor.
2341
2342 These changes should probably benefit the C parser too.
2343
2344 * data/lalr1.cc: Copy as...
2345 * data/lalr1-fusion.cc: this new file.
2346 (b4_rhs_value, b4_rhs_location): New definitions overriding those
2347 from c++.m4.
2348 (state_stack_type, semantic_stack_type, location_stack_type)
2349 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
2350 (data_type, stack_type, yystack_): New.
2351 (YYLLOC_DEFAULT, yypush_): Adjust.
2352 (yyerror_range): Now based on data_type, not location_type.
2353
2354 2008-11-03 Akim Demaille <demaille@gostai.com>
2355
2356 Push the state, value, and location at the same time.
2357 This is needed to prepare a forthcoming patch that fuses the three
2358 stacks into one.
2359
2360 * data/lalr1.cc (parser::yypush_): New.
2361 (parser::yynewstate): Change the semantics: instead of arriving to
2362 this label when value and location have been pushed, but yystate
2363 is to be pushed on the state stack, now the three of them must
2364 have been pushed before. yystate still must be the new state.
2365 This allows to use yypush_ everywhere instead of individual
2366 handling of the stacks.
2367
2368 2008-11-03 Akim Demaille <demaille@gostai.com>
2369
2370 Prefer references to pointers.
2371 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
2372 definition to use references instead of pointers.
2373 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
2374 Take the value and location as references.
2375 Adjust callers.
2376
2377 2008-11-03 Akim Demaille <demaille@gostai.com>
2378
2379 stack::size instead of stack::height.
2380 * data/lalr1.cc (stack::height): Rename as...
2381 (stack::size): this.
2382 Fix the output type.
2383 Comment changes.
2384
2385 2008-11-03 Akim Demaille <demaille@gostai.com>
2386
2387 Use variants to support objects as semantic values.
2388 This patch was inspired by work by Michiel De Wilde. But he used
2389 Boost variants which (i) requires Boost on the user side, (ii) is
2390 slow, and (iii) has useless overhead (the parser knows the type of
2391 the semantic value there is no reason to duplicate this
2392 information as Boost.Variants do).
2393
2394 This implementation reserves a buffer large enough to store the
2395 largest objects. yy::variant implements this buffer. It was
2396 implemented with Quentin Hocquet.
2397
2398 * src/output.c (type_names_output): New.
2399 (output_skeleton): Invoke it.
2400 * data/c++.m4 (b4_variant_if): New.
2401 (b4_symbol_value): If needed, provide a definition for variants.
2402 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
2403 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
2404 (b4_char_sizeof, yy::variant): New.
2405 (parser::parse): If variants are requested, define
2406 parser::union_type, parser::variant, change the definition of
2407 semantic_type, construct $$ before running the user action instead
2408 of performing a default $$ = $1.
2409 * examples/variant.yy: New.
2410 Based on an example by Michiel De Wilde.
2411
2412 2008-11-03 Akim Demaille <demaille@gostai.com>
2413
2414 Parameterize the extraction of semantic values.
2415 To make future changes easier, no longer rely on ".TYPE" being the
2416 way to get a semantic value.
2417
2418 * data/c.m4 (b4_symbol_value): New.
2419 Use it.
2420 * data/c++.m4, data/yacc.c: Use it.
2421 * data/glr.c: Use b4_symbol_value.
2422 (b4_rhs_data): New.
2423 Use it.
2424
2425 2008-11-03 Akim Demaille <demaille@gostai.com>
2426
2427 Prepare easier M4 changes.
2428 * data/lalr1.cc: Use escaped [] instead of literals to prepare
2429 future changes.
2430
2431 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2432
2433 Initiate further development.
2434 * NEWS: Create an empty section for new entries.
2435 * gnulib: Update submodule to HEAD.
2436
2437 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2438
2439 * NEWS: Version 2.4.
2440
2441 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2442
2443 Prepare for next release.
2444 * NEWS: Briefly mention changes since 2.3b.
2445 * README: Say GNU m4 1.4.6, which we've been requiring in release
2446 announcements already, not 1.4.3, which breaks the build.
2447
2448 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2449
2450 Say %language is experimental.
2451 We're thinking of extending it's effect on output file naming. See the
2452 thread at
2453 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
2454 * NEWS: Say it's experimental.
2455 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
2456 recommend it over %skeleton for now.
2457 (Bison Options): Likewise.
2458 (C++ Bison Interface): Use %skeleton not %language.
2459 (Calc++ Parser): Use %skeleton not %language.
2460 * src/getargs.c (usage): Say it's experimental.
2461
2462 2008-11-01 Di-an Jan <dianj@freeshell.org>
2463 Paolo Bonzini <bonzini@gnu.org>
2464
2465 Support all Java parser class modifiers.
2466 * data/java.m4 (b4_percent_define_get3): New.
2467 (b4_final_if, b4_strictfp_if): New.
2468 * data/lalr1.java (final, strictfp, extends, implements): Support.
2469 * doc/bison.texinfo (final, strictfp, extends, implements): Add
2470 documentation.
2471 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
2472 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
2473 (AT_CHECK_JAVA_GREP): New.
2474 (Java parser class modifiers): New test.
2475 (Java parser class extends and implements): New test.
2476
2477 Model exception propagation better with throws and lex_throws.
2478 * data/java.m4 (b4_list2): New.
2479 (throws): Change default.
2480 * data/lalr1.java (yyaction): Add throws.
2481 (parse): Add lex_throws in addition to throws.
2482 * doc/bison.texinfo (throws, lex_throws): Add documentation.
2483 * tests/java.at (Java throws specifications): New test.
2484
2485 Improve documentation for Java parsers.
2486 * doc/bison.texinfo (Java Parsers): Add subsections.
2487 Don't quote first argument of %define.
2488 (Java Bison Interface): Document output files. Move documentation
2489 of parser class and merge into Java Parser Interface. Document
2490 features that error out. Document directives with no effect.
2491 Move note about Javadoc higher.
2492 (Java Semantic Values): Explicitly mention stype.
2493 Document that generic types cannot be used.
2494 (Java Location Values): Use @deftypeivar. Document constructors.
2495 Correct return value for toString.
2496 (Java Parser Interface): List undocumented constants/fields.
2497 Move documentation of fields added by %parse-param closer to list
2498 of members. Document that token names are added as fields.
2499 Document constructors accurately. Remove error method.
2500 (Java Scanner Interface): Move note on %pure-parser to Java Bison
2501 Interface. Describe %code lexer and yylex accutately.
2502 Remove documentation that does not match the code.
2503 (Java Action Features): New.
2504 (Java Differences): Add reference. Add item on semantic values.
2505 Add note about @{ ... @}. Clarify %% epilogue placement.
2506 (Java Declarations Summary): New.
2507
2508 Fix Java skeleton.
2509 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
2510 (b4_remove_comma): Quote test argument.
2511 (b4_identification): Remove "bison" field.
2512 * tests/java.at (Java parser class and package names): New test.
2513 (Java %parse-param and %lex-param): New test.
2514 (Java stype, position_class and location_class): New test.
2515
2516 2008-10-31 Di-an Jan <dianj@freeshell.org>
2517
2518 * data/lalr1.jave: Update copyright years.
2519 (YYParser): Correct name of "generated from" file in Javadoc:
2520 use b4_file_name instead of @ofile@.
2521 (Location constructor): Correct Javadoc parameter name.
2522 (yylloc): Add missing opening m4 quote after b4_location_if.
2523 This removes a stray [ in the Javadoc of Lexer.getStartPos.
2524 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
2525 (YYParser constructor): Correct Javadoc parameter name.
2526
2527 2008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
2528
2529 Always put auxiliary code files in the same dir as other output files.
2530 * src/files.c (compute_file_name_parts): When the user specifies
2531 --output but not --file-prefix, extract the directory prefix from the
2532 file prefix not from the grammar file name. This affects the location
2533 of files like location.hh generated by the C++ skeleton. The includes
2534 in the other output files require this fix.
2535 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
2536 for expected output files.
2537 (Output files): Add a test for the above.
2538
2539 2008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
2540
2541 * gnulib: Update submodule to HEAD.
2542
2543 2008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2544
2545 Update copyright year.
2546 * src/files.c: Here.
2547
2548 2008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
2549
2550 Don't overwrite the input file.
2551 * src/files.c (output_file_name_check): Fatal error if using input file
2552 for output.
2553 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
2554 argument.
2555 (Conflicting output files): Add test.
2556
2557 2008-10-28 Akim Demaille <demaille@gostai.com>
2558
2559 Space changes.
2560 * data/lalr1.cc: Formatting changes.
2561
2562 2008-10-28 Akim Demaille <demaille@gostai.com>
2563
2564 Don't define debugging functions when !YYDEBUG.
2565 * data/lalr1.cc (debug_stream, set_debug_stream)
2566 (debug_level_type, debug_level, set_debug_level): Don't
2567 declare them when YYDEBUG is not defined.
2568 The implementation are already YYDEBUG-aware.
2569
2570 2008-10-28 Akim Demaille <demaille@gostai.com>
2571
2572 Prefer "continue" for empty loop bodies.
2573 * etc/bench.pl.in: Use "continue" instead of {}.
2574
2575 2008-10-28 Akim Demaille <demaille@gostai.com>
2576
2577 Space and comments changes.
2578 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
2579 * data/c.m4, data/lalr1.cc: Space changes.
2580
2581 2008-10-28 Akim Demaille <demaille@gostai.com>
2582
2583 Make gnulib a submodule.
2584 * gnulib: New.
2585 * .gitmodules (gnulib): New.
2586
2587 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
2588
2589 Fix yyerror_range for user-defined location type in C++. Reported by
2590 Georg Sauthoff at
2591 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
2592 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
2593 * THANKS (Georg Sauthoff): Add.
2594
2595 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
2596
2597 Update several administrative files mainly to facilitate releasing.
2598 * HACKING (Administrivia): Make the git-merge-changelog notes more
2599 helpful.
2600 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
2601 (Release Procedure): Update for git and add numerous details that were
2602 previously missing.
2603 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
2604 * maint.mk (announcement): Don't list bison as a bootstrap tool so
2605 that announcements don't claim we bootstrapped with whatever bison
2606 happened to be in PATH. Add flex as a bootstrap tool.
2607 * Makefile.maint: Remove, previously replaced by maint.mk.
2608 * Makefile.cfg: Remove, and migrate settings to...
2609 * cfg.mk: ... here for the sake of `make announcement'.
2610 * bootstrap.conf (gnulib_modules): Add announce-gen.
2611 * README: Say GNU Bison instead of just Bison. Suggested by Karl
2612 Berry.
2613
2614 2008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
2615
2616 Small but important bugfixes for the Java skeleton.
2617 * data/lalr1.java (yyerror): Change Location to b4_location_type.
2618 (yy_symbol_print): Call toString on yyvaluep.
2619
2620 2008-08-29 Akim Demaille <demaille@gostai.com>
2621
2622 Clarify UPDATED use.
2623 * doc/bison.texinfo: It refers to the last edition of this file,
2624 not to the release date of Bison.
2625 Reported by Joel E. Denny.
2626
2627 2008-08-29 Akim Demaille <demaille@gostai.com>
2628
2629 * README: Update FAQ pointer.
2630 Reported by Joel E. Denny.
2631
2632 2008-08-27 Eric Blake <ebb9@byu.net>
2633
2634 Resync m4sugar from autoconf.
2635 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
2636 (m4_init): Adjust to latest m4.git changes.
2637 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
2638 effects.
2639 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
2640 (_m4_list_cmp): Reduce side effects.
2641
2642 2008-08-27 Akim Demaille <demaille@gostai.com>
2643
2644 Check yyerrok in calc.at.
2645 * tests/calc.at (calc.y): Use yyerrok on "( error )".
2646 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
2647 expected.
2648
2649 2008-08-27 Akim Demaille <demaille@gostai.com>
2650
2651 Support yyerrok in lalr1.cc.
2652 YYBACKUP is still to import back into lalr1.cc.
2653 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
2654
2655 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
2656
2657 For maintainer-check*, don't recompile for a $(VERSION) update.
2658 * cfg.mk: New file.
2659 (_is-dist-target): Override the one in GNUmakefile.
2660 * Makefile.am (EXTRA_DIST): Add cfg.mk.
2661
2662 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
2663
2664 Update for recent change to gnulib.
2665 * src/parse-gram.y: Don't include strverscmp.h. It comes from
2666 string.h now.
2667
2668 2008-08-15 Eric Blake <ebb9@byu.net>
2669
2670 Remaining m4sugar merge from autoconf.
2671 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
2672 * data/m4sugar/foreach.m4: New file, copied from autoconf.
2673 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
2674 * src/output.c (output_skeleton): Tell m4 how to find it.
2675
2676 Partial m4sugar merge from autoconf: m4_map.
2677 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
2678 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
2679 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
2680 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
2681 for empty list.
2682 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
2683 Likewise.
2684 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
2685 declares it.
2686
2687 2008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
2688
2689 Keep .version and PACKAGE_VERSION in sync.
2690 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
2691 dependency, and add comments justifying this in more detail. Discussed
2692 starting at
2693 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
2694
2695 2008-08-06 Eric Blake <ebb9@byu.net>
2696
2697 Partial m4sugar merge from autoconf: m4_shiftn.
2698 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
2699 (m4_shift2, m4_shift3): New macros.
2700 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
2701 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
2702 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
2703 * data/java.m4 (b4_remove_comma): Likewise.
2704
2705 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
2706 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
2707 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
2708 (m4_init): Consolidate wrapped text into single m4_wrap.
2709 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
2710 in wrapped text.
2711
2712 2008-08-05 Eric Blake <ebb9@byu.net>
2713
2714 Partial m4sugar merge from autoconf: builtins, version.m4.
2715 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
2716 (m4_prepend): Remove, as it is unused and inherently quadratic,
2717 whereas m4_append is linear in newer m4.
2718 (m4_mkstemp): New builtin.
2719 (m4_symbols): Make rename conditional.
2720 (m4_version_prereq): Ensure fatal error if used in bison, which
2721 intentionally lacks version.m4.
2722
2723 Fix comments in m4sugar.
2724 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
2725
2726 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
2727
2728 Update for recent .gitignore fix in Gnulib.
2729 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
2730 anchored .gitignore entries.
2731
2732 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
2733
2734 Set gnu or gnits strictness.
2735 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
2736 development and gnits strictness for releases. Based on Eric Blake's
2737 suggestion at
2738 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
2739
2740 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
2741
2742 * NEWS: Clarify documentation of %language.
2743
2744 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
2745
2746 Support usage of git-merge-changelog.
2747 * .gitattributes: New.
2748 * HACKING: Document usage of git-merge-changelog.
2749 * bootstrap: Install git-merge-changelog entries in .git/config
2750 if appropriate.
2751
2752 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2753
2754 Remove remaining dependence on CVS Id keyword.
2755 * ChangeLog: For the sake of people still using CVS, don't use dollars
2756 when mentioning Id.
2757 * data/xslt/bison.xsl: Remove Id from header comments, where it was
2758 unusual anyway.
2759 * data/xslt/xml2dot.xsl: Likewise.
2760 * data/xslt/xml2text.xsl: Likewise.
2761 * data/xslt/xml2xhtml.xsl: Likewise.
2762 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
2763 * doc/Makefile.am (neutralize): Remove, no longer needed.
2764 (.x.1): Don't use neutralize.
2765 (edit): Don't substitute for ID.
2766 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
2767
2768 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2769
2770 Fix dependence on computed configure variables.
2771 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
2772 $(top_srcdir)/configure.ac so that changes to computed variables, such
2773 as PACKAGE_VERSION, are seen.
2774 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
2775
2776 2008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
2777
2778 Update copyright dates for recent changes.
2779 * Makefile.am: Here.
2780 * src/Makefile.am: Here.
2781 * src/reduce.c: Here.
2782 * tests/reduce.at: Here.
2783
2784 2008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
2785
2786 Use git-version-gen for version names between releases.
2787 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
2788 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
2789 * .prev-version: New.
2790 * .version.in: Remove.
2791 * ChangeLog: Remove the Id previously used for capturing the CVS
2792 revision.
2793 * GNUmakefile: Remove, now copied from Gnulib.
2794 * Makefile.am: Add code suggested by comments in
2795 build-aux/git-version-gen.
2796 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
2797 .prev-version, and .version.
2798 * NEWS (2.3b+): Rename to...
2799 (?.?): ... this because we're dropping the "+" version naming scheme,
2800 but, in general, we still can't be sure of our next release name.
2801 * bootstrap: Add a quick hack to remove from .gitignore the
2802 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
2803 entry. This should really be fixed in gnulib instead.
2804 * bootstrap.conf (gnulib_modules): Add gnumakefile.
2805 * configure.ac (AC_INIT): Set version name by invoking
2806 build-aux/git-version-gen.
2807 (AC_CONFIG_FILES): Remove .version, now generated by
2808 build-aux/git-version-gen.
2809 * maint.mk: New, copied from coreutils.
2810 * doc/.cvsignore (bison.1): Add.
2811 * doc/.gitignore (/bison.1): Add.
2812 * doc/bison.1: Remove, generated.
2813 * src/.cvsignore (revision.c): Remove.
2814 * src/.gitignore (/revision.c): Remove.
2815 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
2816 (BUILT_SOURCES): Remove revision.c.
2817 (revision.c): Remove.
2818 * src/getargs.c (version): Don't print revision after the VERSION.
2819 * src/revision.h: Remove.
2820
2821 2008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
2822
2823 Fix untranslatable composition of sentences. Reported by Goran
2824 Uddeborg at
2825 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
2826 * THANKS (Goran Uddeborg): Add.
2827 * src/reduce.c (reduce_print): Report the number of nonterminals and
2828 rules useless in the grammar in separate sentences.
2829 * tests/reduce.at (Useless Rules): Update output.
2830 (Reduced Automaton): Likewise.
2831 (Underivable Rules): Likewise.
2832 (Empty Language): Likewise.
2833
2834 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2835
2836 Fix some .gitignore and .cvsignore problems.
2837 * bootstrap (insert_sorted_if_absent): Replace all uses with...
2838 (insert_vc_ignore): ... this new function, which prepends `/' to all
2839 .gitignore entries before passing them to insert_sorted_if_absent.
2840 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
2841 .cvsignore files are maintained even though Bison developers run
2842 bootstrap while using Git.
2843 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
2844 unneeded by Bison.
2845 (gnulib): Add.
2846 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
2847 unneeded. Reported by Eric Blake.
2848 * lib/.gitignore (/*~): Add.
2849 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
2850 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
2851 Blake.
2852 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
2853
2854 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2855
2856 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
2857 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
2858 * bootstrap.conf (gnulib_modules): Add unsetenv.
2859 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
2860 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
2861 (/setenv.m4): Add.
2862 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
2863 the first argument because it may become position-dependent, and unset
2864 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
2865 Add comments explaining these issues in more detail.
2866
2867 2008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
2868
2869 Add .gitignore everywhere based on .cvsignore.
2870 * .gitignore: New.
2871 * build-aux/.gitignore: New.
2872 * data/.gitignore: New.
2873 * doc/.gitignore: New.
2874 * etc/.gitignore: New.
2875 * examples/.gitignore: New.
2876 * examples/calc++/.gitignore: New.
2877 * lib/.gitignore: New.
2878 * m4/.gitignore: New.
2879 * po/.gitignore: New.
2880 * runtime-po/.gitignore: New.
2881 * src/.gitignore: New.
2882 * tests/.gitignore: New.
2883
2884 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2885
2886 * NEWS (2.3b+): New section, empty for now.
2887 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
2888
2889 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2890
2891 * NEWS (2.3b): Update release date since there has been a delay in
2892 getting the announcements and tarballs out.
2893
2894 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
2895
2896 * NEWS: Version 2.3b.
2897 * configure.ac (AC_INIT): Likewise.
2898 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
2899
2900 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
2901
2902 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
2903 been doing it for years.
2904 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
2905 (Release Procedure): Add FIXME about make alpha being unmaintained.
2906
2907 2008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
2908
2909 * data/yacc.c: Reformat m4 a little for readability.
2910 * src/lalr.c (build_relations): Correct comment.
2911
2912 2008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2913
2914 DJGPP specific issue.
2915 * djgpp/config.sed: Fixes required to run configure scripts generated
2916 by autoconf 2.62.
2917
2918 2008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
2919
2920 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
2921 coordinator@translationproject.org.
2922
2923 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2924
2925 * THANKS: Add Eric Blake.
2926
2927 2008-04-23 Eric Blake <ebb9@byu.net>
2928
2929 Revert prior patch, by working around autoconf regression.
2930 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
2931 ("Output file name: ("): Uncomment test.
2932 ("Output file name: )"): Likewise.
2933 Based on an idea from Noah Misch.
2934
2935 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2936
2937 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
2938 2.61. Reported by Juan Manuel Guerrero at
2939 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
2940 * tests/output.at ("Output file name: ("): Comment out test case for
2941 now.
2942 ("Output file name: )"): Likewise.
2943
2944 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2945
2946 * GNUmakefile: Update git-version-gen invocation so make dist
2947 succeeds.
2948
2949 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2950
2951 Update to the current gnulib CVS repository, and fix trigraph handling
2952 in Bison.
2953 * bootstrap: Update gnulib CVS repository URL.
2954 (symlink_to_dir): Encapsulate the code that guarantees the destination
2955 directory exists into...
2956 (check_dst_dir): ... this new function, and...
2957 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
2958 fail when copying files into lib/uniwidth/.
2959 * src/output.c (prepare_symbols): When writing yytname muscles, where
2960 symbol names will be encoded in C-string literals, tell quotearg to
2961 escape trigraphs. This used to be the default in gnulib.
2962 * tests/regression.at (Token definitions): Because of the change in
2963 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
2964 escapes trigraphs in symbol names. Thus, yytname no longer has
2965 trigraphs unnecessarily doubly escaped. Update test case output.
2966 Extend test case to be sure Bison's own error messages will no longer
2967 have trigraphs in symbol names unnecessarily escaped once.
2968
2969 2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2970
2971 Fix make dist infinite loop reported by Juan Manuel Guerrero at
2972 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
2973 * .cvsignore: Add .version.
2974 * .version.in: New.
2975 * bootstrap.conf (gnulib_modules): Add git-version-gen.
2976 * configure.ac (AC_CONFIG_FILES): Add .version.
2977 * build-aux/.cvsignore: Add git-version-gen.
2978
2979 2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2980
2981 * NEWS (2.3a+): Mention that -g now takes an argument.
2982 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
2983 consistency. Update the -g and -x entries now that they take
2984 arguments. Use brackets to indicate optional arguments.
2985 * src/getargs.c (usage): Explain the relationship between arguments of
2986 long and short options more completely. Document --defines and -d
2987 separately since the former takes an argument but, for POSIX Yacc, the
2988 latter does not.
2989 (short_options): Let -W take an optional argument like --warnings.
2990 (getargs): Sort cases.
2991
2992 2008-02-28 Akim Demaille <demaille@gostai.com>
2993
2994 * doc/bison.texinfo: Fix a few typos.
2995
2996 2008-02-28 Akim Demaille <akim@epita.fr>
2997
2998 * doc/bison.texinfo (Bison Options): Document -W.
2999 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
3000
3001 2008-02-28 Akim Demaille <akim@epita.fr>
3002
3003 * src/getargs.c (short_options): Split and sort for readability.
3004 -g and -x take optional arguments, just like their long options.
3005 * build-aux/cross-options.pl: Use /x to make the regexp easier to
3006 understand.
3007 Fix the handling of $opt which resulted in all the argument to be
3008 considered as optional.
3009
3010 2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
3011
3012 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
3013 say its interface is experimental.
3014 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
3015 Java.
3016 (Bison Options): In the -L and --language entry, mention Java.
3017 (Java Bison Interface): Say the interface is experimental.
3018 * src/getargs.c (usage): Mention -L and --language.
3019
3020 * NEWS (2.3a+): Say the push parsing interface is experimental.
3021 * doc/bison.texinfo (Push Decl): Likewise.
3022 (Decl Summary): Likewise in the "%define api.push_pull" entry.
3023 (Push Parser Function): Likewise.
3024 (Pull Parser Function): Likewise.
3025 (Parser Create Function): Likewise.
3026 (Parser Delete Function): Likewise.
3027 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
3028 yypull_parse, and yypush_parse entries.
3029
3030 * NEWS (2.3a+): Mention XML support, and say the schema is
3031 experimental.
3032 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
3033 * src/getargs.c (usage): Say the XML schema is experimental.
3034
3035 * NEWS (2.3a+): Say option instead of flag.
3036
3037 2008-02-21 Wojciech Polak <polak@gnu.org>
3038
3039 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
3040 text.
3041
3042 2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
3043
3044 Fix impure push parser compile error reported by Bob Rossi at
3045 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
3046 * data/yacc.c: Clean up whitespace in the output a little.
3047 (yypstate_allocated): Define for impure push parsers regardless of
3048 whether the pull interface is also requested.
3049 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
3050 check impure push parsers without the pull interface.
3051
3052 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
3053 yyerror takes arguments specified by %parse-param while yypstate_new
3054 does not.
3055 * doc/bison.texinfo (Parser Create Function): Document that
3056 yypstate_new returns 0 for multiple impure parser instances.
3057 * tests/push.at (Push Parsing: Multiple impure instances): Update
3058 expected stderr output.
3059
3060 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3061
3062 * runtime-po/POTFILES.in (push.c): Remove.
3063
3064 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3065
3066 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
3067 * data/push.c: Rename to...
3068 * data/yacc.c: ... this, overwriting it.
3069 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
3070 `%push-pull-parser' -> `%define api.push_pull "both"'.
3071 Remove old yacc.c tests, and update push.c tests to yacc.c.
3072
3073 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3074
3075 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
3076 `"%code top" blocks' instead of `%code "top" blocks'.
3077 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
3078 Clean up whitespace in the output a little.
3079
3080 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3081
3082 Fix documentation problems reported by Tim Josling at
3083 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
3084 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
3085 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
3086 integers. Explain the effect of literal string aliases on error
3087 messages. Copy token 0 documentation from the C++ skeleton
3088 documentation.
3089
3090 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3091
3092 Accept a token number in a %left, %right, or %nonassoc for POSIX
3093 conformance. Reported by Tim Josling at
3094 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
3095 * NEWS (2.3a+): Mention.
3096 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
3097 and code numbers are treated by precedence declarations.
3098 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
3099 of symbols.1.
3100 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
3101 of symbol.
3102 (symbol.prec): New, just like symbol but allows INT.
3103 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
3104 longer holds.
3105 * tests/regression.at (Token number in precedence declaration): New
3106 test case.
3107
3108 2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3109
3110 DJGPP specific issues.
3111 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
3112 be changed. Copyright timestamp adjusted.
3113 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
3114 be changed. Copyright timestamp adjusted.
3115 * djgpp/config.site: Copyright timestamp adjusted.
3116 * djgpp/config_h.sed: Copyright timestamp adjusted.
3117 * djgpp/djunpack.bat: Copyright timestamp adjusted.
3118 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
3119 filename translation list.
3120 * djgpp/subpipe.c (init_subpipe): Check the environment variables
3121 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
3122 files shall be created. Before trying to use the temp dir where the
3123 environment variable points to check that the dir really exists. If
3124 not default to the cwd as temp dir. Copyright timestamp adjusted.
3125 * djgpp/subpipe.h: Copyright timestamp adjusted.
3126 * djgpp/testsuite.sed: Copyright timestamp adjusted.
3127
3128 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
3129
3130 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
3131
3132 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
3133
3134 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
3135 Problem reported by Claudio Saavedra in
3136 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
3137
3138 2008-01-05 Wojciech Polak <polak@gnu.org>
3139
3140 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
3141 document's title with the input grammar file name.
3142
3143 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
3144
3145 Automate regression testing of the XML/XSLT implementation. Discussed
3146 starting at
3147 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
3148 * configure.ac (XSLTPROC): New substitution.
3149 * Makefile.am (maintainer-xml-check): New phony target invoking...
3150 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
3151 invoking make maintainer-check with BISON_TEST_XML=1.
3152 * tests/atlocal.in (XSLTPROC): New.
3153 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
3154 not to report reachable memory when Bison is expected to have a
3155 non-zero exit status and (2) to compare XML/XSLT output with --graph
3156 and --report=all output for every working grammar when
3157 BISON_TEST_XML=1.
3158 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
3159 (AT_BISON_CHECK_XML): New.
3160 (AT_QUELL_VALGRIND): New.
3161 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
3162 (AT_CHECK): ... don't redefine this since this was the old way to
3163 quell Valgrind.
3164 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
3165 AT_BISON_CHECK invocations.
3166 * tests/c++.at: Likewise.
3167 * tests/calc.at: Likewise.
3168 * tests/conflicts.at: Likewise.
3169 * tests/cxx-type.at: Likewise.
3170 * tests/existing.at: Likewise.
3171 * tests/glr-regression.at: Likewise.
3172 * tests/headers.at: Likewise.
3173 * tests/input.at: Likewise.
3174 * tests/java.at: Likewise.
3175 * tests/output.at: Likewise.
3176 * tests/push.at: Likewise.
3177 * tests/reduce.at: Likewise.
3178 * tests/regression.at: Likewise.
3179 * tests/sets.at: Likewise.
3180 * tests/skeletons.at: Likewise.
3181 * tests/synclines.at: Likewise.
3182 * tests/torture.at: Likewise.
3183 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
3184 tends to hang xsltproc.
3185 (Big horizontal): Likewise.
3186
3187 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3188
3189 In XML output, remove redundant class attribute on symbol element.
3190 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
3191 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
3192 look up a symbol to determine whether it's a nonterminal or terminal.
3193 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
3194 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
3195
3196 Add prec/assoc information to XML output.
3197 * src/gram.c (grammar_rules_print_xml): For each rule that has a
3198 %prec, add a percent_prec attribute.
3199 * src/print-xml.c (print_grammar): For each terminal that has a
3200 precedence or associativity, add a prec or assoc attribute.
3201 (xml_indent): New.
3202 (xml_puts): Use xml_indent.
3203 (xml_printf): Use xml_indent.
3204 * src/print-xml.h (xml_indent): Prototype.
3205
3206 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
3207 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
3208
3209 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3210
3211 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
3212 (bison:ruleByNumber): ... this for clarity.
3213 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
3214 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
3215 (xsl:template match="reduction"): Update.
3216 (xsl:template match="item"): Update.
3217 (xsl:template match="reduction"): Update.
3218
3219 In the XML output, don't print the list of rules where symbols appear.
3220 Compute it in XSLT instead. Discussed at
3221 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
3222 * data/xslt/bison.xsl (bison:ruleByLhs): New.
3223 (bison:ruleByRhs): New.
3224 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
3225 bison:ruleByRhs.
3226 (xsl:template match="terminal/rule"): Remove.
3227 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3228 bison:ruleByRhs.
3229 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3230 Remove.
3231 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
3232 bison:ruleByRhs and mode="number-link" for rule template.
3233 (xsl:template match="terminal/rule"): Remove.
3234 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3235 bison:ruleByRhs and mode="number-link" for rule template.
3236 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3237 Rewrite as...
3238 (xsl:template match="rule" mode="number-link"): ... this.
3239 * src/print-xml.c (print_grammar): Don't print the list of rules.
3240
3241 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
3242
3243 Don't let --report affect XML output; always print all information.
3244 Discussed at
3245 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
3246 * src/conflicts.c (log_resolution): Implement.
3247 * src/print-xml.c (print_core): Implement.
3248 (print_state): Implement.
3249 (print_xml): Implement.
3250
3251 * NEWS (2.3a+): Fix quotes.
3252 * src/parse-gram.y (prologue_declaration): For consistency with -v,
3253 don't let %verbose clear the list specified by --report.
3254
3255 2007-11-26 Akim Demaille <akim@epita.fr>
3256
3257 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
3258
3259 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
3260
3261 In the XML output, list useless and unused symbols and rules with the
3262 useful ones and add a "usefulness" attribute. Discussed starting at
3263 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
3264 * src/gram.c (grammar_rules_partial_print_xml): Remove.
3265 (grammar_rules_print_xml): Print all rules instead of just those
3266 useful in the grammar, and add a "usefulness" attribute.
3267 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
3268 * src/print-xml.c (print_rules_useless_in_parser): Remove.
3269 (print_grammar): Print all nonterminals instead of just useful ones,
3270 and add a "usefulness" attribute to nonterminals and terminals.
3271 (print_xml): Don't print a separate "reductions" or
3272 "rules-useless-in-parser" element.
3273 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
3274 (reduce_xml): Remove.
3275 (reduce_token_unused_in_grammar): New.
3276 (reduce_nonterminal_useless_in_grammar): New.
3277 * src/reduce.h (reduce_xml): Remove prototype.
3278 (reduce_token_unused_in_grammar): Add prototype.
3279 (reduce_nonterminal_useless_in_grammar): Add prototype.
3280 * data/xslt/xml2text.xsl: Update for XML changes.
3281 * data/xslt/xml2xhtml.xsl: Update for XML changes.
3282 * tests/reduce.at (Useless Terminals): Update output.
3283 (Useless Rules): Update output.
3284 (Reduced Automaton): Update output.
3285
3286 Say "Terminals unused in grammar" instead of "Unused terminals".
3287 * NEWS (2.3a+): Update.
3288 * doc/bison.texinfo (Understanding): Update example output.
3289 * src/reduce.c (reduce_output): Implement.
3290 * data/xslt/xml2text.xsl: Implement.
3291 * data/xslt/xml2xhtml.xsl: Implement.
3292
3293 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
3294
3295 Accept --report-file=FILE to override the default `.output' filename.
3296 * NEWS (2.3a+): Mention.
3297 * doc/bison.texinfo (Bison Options): Add an entry.
3298 * src/files.c (compute_output_file_names): Don't override
3299 spec_verbose_file if already set.
3300 * src/getargs.c (usage): Document --report-file.
3301 (REPORT_FILE_OPTION): New anonymous enum member.
3302 (long_options): Add entry for it.
3303 (getargs): Add case for it setting spec_verbose_file.
3304
3305 * build-aux/cross-options.pl: Don't record a short option just because
3306 there's an arg.
3307 * doc/.cvsignore: Add yacc.1.
3308
3309 2007-11-14 Akim Demaille <akim@epita.fr>
3310
3311 * doc/yacc.1.in: New.
3312 * configure.ac, doc/Makefile.am: Adjust.
3313 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
3314 config.h symbol.
3315 Use AC_SUBST for assignments too.
3316 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
3317
3318 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
3319
3320 * src/gram.c: Remove comments that duplicate comments in gram.h.
3321
3322 When reporting useless rules and nonterminals, say "useless in grammar"
3323 instead of "useless", and say "useless in parser" instead of "never
3324 reduced". Discussed starting at
3325 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
3326 * NEWS (2.3a+): Mention this change.
3327 * data/xslt/xml2text.xsl: Update output text and expected input XML
3328 element names to match changes below.
3329 * data/xslt/xml2xhtml.xsl: Likewise.
3330 (xsl:template match="bison-xml-report"): Add missing entry in Table of
3331 Contents: "Rules useless in parser due to conflicts".
3332 * doc/bison.texinfo (Decl Summary): Reword a little.
3333 (Understanding): Update example output for changes below.
3334 * src/gram.c: (rule_useful_p): Rename to...
3335 (rule_useful_in_grammar_p): ... this.
3336 (rule_useless_p): Rename to...
3337 (rule_useless_in_grammar_p): ... this.
3338 (rule_never_reduced_p): Rename to...
3339 (rule_useless_in_parser_p): ... this.
3340 (grammar_rules_print): Update for renames.
3341 (grammar_rules_print_xml): Update for renames.
3342 (grammar_rules_never_reduced_report): Rename to...
3343 (grammar_rules_useless_report): ... this since it is used for either
3344 kind of useless rule.
3345 * src/gram.h: Reword comments and update function names in prototypes.
3346 * src/main.c (main): Say "rule useless in parser due to conflicts".
3347 * src/print-xml.c (print_rules_never_reduced): Rename to...
3348 (print_rules_useless_in_parser): ... this, and rename output XML
3349 element "rules-never-reduced" to "rules-useless-in-parser".
3350 (print_xml): Update for rename.
3351 * src/print.c (print_results): Say "Rules useless in parser due to
3352 conflicts".
3353 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
3354 (nonterminals_reduce): Say "nonterminal useless in grammar".
3355 (reduce_output): Say "Nonterminals useless in grammar".
3356 Say "Rules useless in grammar".
3357 (reduce_xml): Rename output XML element "useless" to
3358 "useless-in-grammar".
3359 (reduce_print): Don't report the count of grammatically useless rules
3360 as "rules never reduced" just because %yacc is specified.
3361 In the correct report of this count, say nonterminal(s) and rule(s)
3362 "useless in grammar".
3363 * tests/conflicts.at (S/R in initial): Update expected output.
3364 (Defaulted Conflicted Reduction): Likewise.
3365 (Unreachable States After Conflict Resolution): Likewise.
3366 * tests/existing.at (GNU pic Grammar): Likewise.
3367 * tests/reduce.at (Useless Nonterminals): Likewise.
3368 (Useless Rules): Likewise.
3369 (Reduced Automaton): Likewise.
3370 (Underivable Rules): Likewise.
3371 (Empty Language): Likewise.
3372
3373 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
3374
3375 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
3376 here document and before the EOF so that BSD's implementation of Bourne
3377 shell doesn't parse the delimiter as part of the here document.
3378 * doc/.cvsignore: Add cross-options.texi.
3379 * src/getargs.c (usage): Add a blank line after the warning categories.
3380
3381 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
3382
3383 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
3384
3385 2007-11-05 Akim Demaille <akim@epita.fr>
3386
3387 Remove Id: from bison.1.
3388 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
3389 (perl -0777 -pi -e 's/\.PP\nId): New.
3390 (.x.1): Use it to ignore the version control revision.
3391
3392 2007-11-05 Akim Demaille <demaille@gostai.com>
3393
3394 * build-aux/Makefile.am: Ship cross-options.pl.
3395 * doc/Makefile.am: Always refer to cross-options.texi with
3396 $(srcdir).
3397 (MAINTAINERCLEANFILES): Add it.
3398
3399 2007-11-04 Akim Demaille <demaille@gostai.com>
3400
3401 Generate the long/short option cross-table.
3402 * build-aux/cross-options.pl: New.
3403 * doc/Makefile.am (cross-options.texi): New.
3404 * doc/bison.texinfo: Use it.
3405
3406 2007-11-04 Akim Demaille <demaille@gostai.com>
3407
3408 Generate bison.1 using help2man.
3409 * doc/common.x, doc/bison.x: New.
3410 * doc/Makefile.am (bison.1, .x.1): New.
3411 The code is taken from autoconf-2.61/man/Makefile.am.
3412 * configure.ac: Look for help2man.
3413
3414 2007-11-04 Akim Demaille <demaille@gostai.com>
3415
3416 Complete --help.
3417 * src/getargs.c (usage): Document -W, make it clear that -d,
3418 -g and -x have optional arguments.
3419
3420 2007-11-04 Akim Demaille <demaille@gostai.com>
3421
3422 Find sha1sum when named gsha1sum.
3423 * bootstrap (find_tool): New.
3424 ($SHA1SUM): New.
3425
3426 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3427
3428 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
3429 at
3430 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
3431 * NEWS (2.3a+): Mention.
3432 * data/bison.m4 (b4_pure_if): Don't define it here.
3433 * data/c.m4 (b4_identification): Depend on individual skeletons to
3434 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
3435 values of the %define variables api.pure or api.push_pull. Define
3436 YYPURE, YYPUSH, and YYPULL accordingly.
3437 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
3438 glr.cc has already defined b4_pure_flag.
3439 * data/push.c: Define b4_pure_if based on `%define api.pure'.
3440 Remove YYPUSH and YYPULL since they're back in b4_identification again.
3441 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
3442 * doc/bison.texinfo (Pure Decl): Update.
3443 (Push Decl): Update.
3444 (Decl Summary): Add api.pure to %define entry.
3445 In %pure-parser entry, say it's deprecated and reference %define.
3446 (Pure Calling): Update.
3447 (Error Reporting): Update.
3448 (C++ Scanner Interface): Update.
3449 (How Can I Reset the Parser): Update.
3450 (Table of Symbols): In %pure-parser entry, say it's deprecated and
3451 reference %define.
3452 * src/getargs.c (pure_parser): Remove global variable.
3453 * src/getargs.h (pure_parser): Remove extern.
3454 * src/output.c (prepare): Don't define pure_flag muscle.
3455 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
3456 wrapper around `%define api.pure'.
3457 * tests/calc.at (Simple LALR Calculator): Update.
3458 (Simple GLR Calculator): Update.
3459 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
3460 Update.
3461 (GLR: Resolve ambiguity, pure, locations): Update.
3462 (GLR: Merge conflicting parses, pure, no locations): Update.
3463 (GLR: Merge conflicting parses, pure, locations): Update.
3464 * tests/glr-regression.at (Uninitialized location when reporting
3465 ambiguity): Update
3466 * tests/input.at (Unused %define api.pure): New test case.
3467 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
3468 AT_PURE_IF and AT_PURE_AND_LOC_IF.
3469 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
3470
3471 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3472
3473 %define push_pull -> %define api.push_pull. Discussed starting at
3474 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
3475 * data/push.c: Expect the new name.
3476 * data/yacc.c: Likewise.
3477 * doc/bison.texinfo (Push Decl): Update.
3478 (Decl Summary): Update %define entry.
3479 (Push Parser Function): Update.
3480 (Pull Parser Function): Update.
3481 (Parser Create Function): Update.
3482 (Parser Delete Function): Update.
3483 * tests/calc.at (Simple LALR Calculator): Update.
3484 * tests/input.at (%define enum variables): Update.
3485 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
3486 (Push Parsing: Multiple impure instances): Update.
3487 (Push Parsing: Unsupported Skeletons): Update.
3488 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
3489 (Exploding the Stack Size with Malloc): Update.
3490
3491 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
3492 other entries some.
3493
3494 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
3495
3496 For the XML output's terminal element, rename @number to @token-number,
3497 and add @symbol-number. In the nonterminal element, rename @number to
3498 @symbol-number. Discussed starting at
3499 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
3500 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
3501 renames.
3502 (xsl:template match="nonterminal"): Likewise.
3503 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
3504 (xsl:template match="nonterminal"): Likewise.
3505 * src/print-xml.c (print_grammar): Implement.
3506
3507 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3508
3509 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
3510 2007-10-11 change, the child elements here are items not rules.
3511 (xsl:template match="item"): New.
3512 (xsl:template match="rule"): Update for new reduced itemset.
3513 (xsl:template match="point"): Remove.
3514 (xsl:template match="empty"): For consistency with --graph, don't
3515 output "/* empty */".
3516 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
3517 line-wrap, don't pass a negative value as first-line-length since this
3518 won't work with the following changes.
3519 (xsl:template name="line-wrap"): Simplify slightly.
3520 (xsl:template name="ws-search"): Eliminate recursion.
3521 * src/print_graph.c (print_core): Don't print a reduction's lookahead
3522 set next to an item whose dot is not at the end of the RHS even if it
3523 happens to be associated with the same rule.
3524
3525 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
3526
3527 Add %define lr.keep_unreachable_states.
3528 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
3529 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
3530 * src/main.c (main): Implement it.
3531 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3532 Extend to test it, and fix a typo.
3533
3534 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
3535
3536 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
3537 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
3538 the example .output text.
3539 * tests/regression.at (Extra lookahead sets in report): Improve wording
3540 of comments.
3541
3542 2007-10-17 Wojciech Polak <polak@gnu.org>
3543
3544 * src/print-xml.c (print_grammar): Renamed
3545 <terminal> and <nonterminal> attributes:
3546 "type" to "number" and "symbol" to "name".
3547 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
3548 Use new attribute names.
3549 (xsl:template match="nonterminal"): Likewise.
3550 * data/xslt/xml2xhtml.xsl: Likewise.
3551
3552 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
3553
3554 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
3555 (Option Cross Key): Likewise.
3556
3557 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
3558 next to an item whose dot is not at the end of the RHS even if it
3559 happens to be associated with the same rule.
3560 * src/print.c (print_core): Likewise.
3561 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
3562 (Resolved SR Conflicts): Update output.
3563 * tests/regression.at (Extra lookahead sets in report): New test case.
3564
3565 2007-10-11 Wojciech Polak <polak@gnu.org>
3566
3567 * src/print-xml.c (print_core): Remove item set
3568 redundancy.
3569 * data/xslt/bison.xsl (bison:ruleNumber): New key.
3570 Improve processing time. Suggested by Joel E. Denny.
3571 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
3572 Write xsl:param "required" attribute as comment.
3573 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
3574 (xsl:template match="rule"): Support new reduced itemset.
3575 (xsl:template match="point"): Remove.
3576 * data/xslt/xml2xhtml.xsl: Likewise.
3577
3578 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
3579
3580 * src/getargs.c (version): Update copyright year.
3581
3582 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
3583
3584 Make xml2dot.xsl and --graph produce the same output.
3585 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
3586 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
3587 escaped later.
3588 (xsl:template name="output-node"): Use the new escape template instead
3589 of the string-replace template directly.
3590 (xsl:template name="output-edge"): Likewise.
3591 (xsl:template name="escape"): New, escapes backslashes and newlines in
3592 addition to quotation marks.
3593 * src/graphviz.c (start_graph, output_node, output_edge): Add
3594 whitespace to output for legibility.
3595
3596 Make xml2text.xsl and --report produce the same output, and remove the
3597 XML "conflicts" element since a conflict summary is easily extracted
3598 from the automaton.
3599 * data/xslt/bison.xsl: New.
3600 (xsl:template match="state" mode="bison:count-conflicts): New.
3601 * data/xslt/xml2text.xsl: Import bison.xsl.
3602 (xsl:template match="bison-xml-report"): Instead of styling the
3603 "conflicts" element, style the "automaton" element with mode
3604 "conflicts". Unlike the former, the latter lists S/R and R/R
3605 conflicts for a state on the same line.
3606 (xsl:template match="conflicts"): Remove.
3607 (xsl:template match="conflict"): Remove.
3608 (xsl:template match="terminal"): Line-wrap the list of rules in which
3609 the terminal is used.
3610 (xsl:template match="nonterminal"): Likewise for nonterminals.
3611 (xsl:template match="automaton" mode="conflicts"): New.
3612 (xsl:template match="state" mode="conflicts"): New.
3613 (xsl:template name="line-wrap"): New.
3614 (xsl:template name="ws-search"): New.
3615 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
3616 (xsl:template match="bison-xml-report"): Instead of styling the
3617 "conflicts" element, style the "automaton" element with mode
3618 "conflicts."
3619 (xsl:template match="conflicts"): Remove.
3620 (xsl:template match="conflict"): Remove.
3621 (xsl:template match="automaton" mode="conflicts"): New.
3622 (xsl:template match="state" mode="conflicts): New.
3623 * src/conflicts.c (conflicts_output_xml): Remove.
3624 * src/conflicts.h (conflicts_output_xml): Remove prototype.
3625 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
3626 * src/print.c (print_grammar): Consistently wrap at the 66th column so
3627 the corresponding XSLT is easier. Also, never wrap between a word and
3628 the comma that follows it.
3629
3630 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
3631
3632 Improve C++ namespace support. Discussed starting at
3633 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
3634 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
3635 b4_namespace_close): New macros that interpret the %define variable
3636 "namespace" so its value can contain "::" to indicate nested
3637 namespaces.
3638 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
3639 the above macros.
3640 * data/lalr1.cc (b4_namespace): Likewise.
3641 * data/location.cc (b4_namespace): Likewise.
3642 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
3643 inside a new table in the general %define entry. Document `%define
3644 namespace' there as well. Point the %name-prefix entry to it since it
3645 explains it more completely in the case of C++.
3646 (C++ Bison Interface): Mention `%define namespace' instead of
3647 %name-prefix.
3648 (Table of Symbols): Remove the `%define push_pull' entry. The %define
3649 entry suffices.
3650 * tests/c++.at (Relative namespace references): New test case.
3651 (Absolute namespace references): New test case.
3652 (Syntactically invalid namespace references): New test case.
3653 * tests/input.at (C++ namespace reference errors): New test case.
3654
3655 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
3656
3657 Add syncline support and location accessor to internal %define
3658 interfaces.
3659 * data/bison.m4 (b4_percent_define_get_loc): New.
3660 (b4_percent_define_get_syncline): New.
3661 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
3662 (b4_percent_define_default): Record defining location as line 1 rather
3663 than 0 for the sake of synchronizing #line's, and define
3664 b4_percent_define_syncline(VARIABLE).
3665 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
3666 * src/muscle_tab.c (muscle_syncline_grow): New.
3667 (muscle_code_grow): Use muscle_syncline_grow.
3668 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
3669 define b4_percent_define_syncline(VARIABLE).
3670 (muscle_percent_define_get_loc): New.
3671 (muscle_percent_define_get_syncline): New.
3672 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
3673 remove some unused variables.
3674 (muscle_percent_define_default): Record defining location as line 1
3675 rather than 0 for the sake of synchronizing #line's, and define
3676 b4_percent_define_syncline(VARIABLE).
3677 (muscle_percent_define_check_values): Use
3678 muscle_percent_define_get_loc.
3679 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
3680 (muscle_percent_define_get_syncline): Prototype.
3681 * tests/skeletons.at (%define Boolean variables: invalid skeleton
3682 defaults): Update output for location change.
3683 (Complaining during macro argument expansion): Extend to test
3684 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
3685
3686 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
3687
3688 Fix some error-reporting macro bugs.
3689 * data/bison.m4 (b4_cat): New.
3690 (b4_error, b4_error_at): Use b4_cat to send error directives directly
3691 to stdout so they don't become arguments to other macros. Update
3692 comments and add examples.
3693 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
3694 add examples.
3695 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
3696 after printing the error directive so that M4 doesn't report subsequent
3697 problems that are induced by this problem.
3698 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
3699 instead of just in them. Recognize @\n in both places. Both expand to
3700 the empty string. Needed by b4_cat.
3701 * tests/skeletons.at (Complaining during macro argument expansion):
3702 New test case.
3703 (Fatal errors make M4 exit immediately): New test case.
3704
3705 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
3706
3707 Implement --print-datadir.
3708 * src/getargs.c (usage): Mention.
3709 (PRINT_DATADIR_OPTION): New anonymous enum member.
3710 (long_options): Add entry for it.
3711 (getargs): Add case for it calling compute_pkgdatadir.
3712 * src/output.c (output_skeleton): Encapsulate data directory
3713 computation from here...
3714 (prepare): ... and from here...
3715 (compute_pkgdatadir): ... into this new function.
3716 * src/output.h (compute_pkgdatadir): Prototype.
3717
3718 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
3719
3720 * src/print-xml.c (escape_bufs): New static global variable
3721 replacing...
3722 (xml_escape_n): ... the static local variable buf here.
3723 (print_xml): Free memory for escape_bufs.
3724 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
3725
3726 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
3727
3728 Replace `%push-parser' and `%push-pull-parser' with
3729 `%define push_pull "push"' and `%define push_pull "both"'.
3730 `%define push_pull "pull"' is the default.
3731 * doc/bison.texinfo (Push Decl, Push Parser Function,
3732 Pull Parser Function, Parser Create Function, Parser Delete Function):
3733 Update declarations.
3734 (Decl Summary, Table of Symbols): Replace %push-parser and
3735 %push-pull-parser entries with a %define push_pull entry.
3736 * data/bison.m4 (b4_percent_define_check_values): New macro.
3737 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
3738 definitions...
3739 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
3740 definitions...
3741 * data/push.c: ... to here and compute them from the value of the
3742 %define variable push_pull.
3743 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
3744 parsing requests here...
3745 * data/yacc.c: ... hack this to switch to push.c any time
3746 b4_use_push_pull_flag or the %define variable push_pull is set. This
3747 will go away when we mv push.c yacc.c.
3748 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
3749 push parsing is not supported since unused %define variables are
3750 reported anyway.
3751 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
3752 * src/muscle_tab.h (muscle_percent_define_check_values): Update
3753 comments for consistency with b4_percent_define_check_values.
3754 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
3755 muscles.
3756 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
3757 Remove.
3758 (prologue_declaration): Remove %push-parser and %push-pull-parser
3759 rules.
3760 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
3761 * tests/calc.at: Update declarations.
3762 * tests/input.at (%define enum variables): New test case.
3763 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
3764 declaration.
3765 (Push Parsing: Multiple impure instances): Update declaration.
3766 (Push Parsing: Unsupported Skeletons): New test case.
3767 * tests/torture.at (Exploding the Stack Size with Alloca): Update
3768 declaration.
3769 (Exploding the Stack Size with Malloc): Update declaration.
3770
3771 2007-09-24 Wojciech Polak <polak@gnu.org>
3772
3773 Add XSLT transformations.
3774
3775 * data/xslt/xml2dot.xsl: Transform XML into DOT.
3776 * data/xslt/xml2text.xsl: Transform XML into plain text.
3777 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
3778 * data/Makefile.am (xsltdir): New variable.
3779 (dist_xslt_DATA): Add xslt/*.xsl files.
3780
3781 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
3782
3783 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
3784 Problem reported by Wojciech Polak.
3785 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
3786 (xml_printf): Undo change I made on 21 September; that is,
3787 indent 2 spaces, not 1.
3788
3789 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
3790
3791 Pacify ./configure --enable-gcc-warnings.
3792 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
3793 `char const *' instead of `char *'.
3794 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
3795 local variable `sep'.
3796
3797 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
3798
3799 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
3800 elsewhere.
3801 * src/print-xml.c: Prefer "const" after types; that's more consistent.
3802 (xml_printf): Indent just 1 space for level.
3803 (e_char, xlate_char): Remove.
3804 (xml_escape_string): Rewrite to avoid undefined behavior (used
3805 storage that was freed from the stack).
3806 (xml_escape_n): Don't bother checking for subscript error.
3807
3808 2007-09-21 Wojciech Polak <polak@gnu.org>
3809
3810 Add Bison XML Automaton Report.
3811
3812 Add support for an -x option to generate an XML report.
3813 It is not documented yet.
3814 * src/print-xml.c: New file.
3815 * src/print-xml.h: Likewise.
3816 * lib/timevar.def (TV_XML): New var.
3817 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
3818 * src/conflicts.c: Include print-xml.h.
3819 (solved_conflicts_xml_obstack): New var.
3820 (log_resolution, conflicts_solve, conflicts_free):
3821 Add support for XML report.
3822 (conflicts_output_val): New function.
3823 * src/conflicts.h (conflicts_output_val): New decl.
3824 * src/files.c (spec_xml_file): New var.
3825 (compute_output_file_names, output_file_names_free): Add XML support.
3826 * src/files.h (spec_xml_file): New decl.
3827 * src/getargs.c (xml_flag): New var.
3828 (usage, short_options, long_options, getargs): Add XML support.
3829 * src/getargs.h (xml_flag): New decl.
3830 * src/gram.c: Include print-xml.h.
3831 (rule_lhs_print_xml, rule_rhs_print_xml):
3832 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
3833 New functions.
3834 * src/gram.h: Declare external ones.
3835 * src/main.c: Include print-xml.h.
3836 (main): Add XML support.
3837 * src/reduce.c: Include print-xml.h.
3838 (reduce_xml): New function.
3839 * src/reduce.h: Declare it.
3840 * src/state.c: Include print-xml.h.
3841 (state_new): Add XML support.
3842 (state_rule_lookahead_tokens_print_xml): New function.
3843 * src/state.h: Declare it.
3844 (struct state): New member solved_conflicts_xml.
3845 * src/symtab.c (symbol_class_get_string): New function.
3846 * src/symtab.h: Declare it.
3847
3848 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
3849
3850 * GNUmakefile: Switch to coreutils's version.
3851 * bootstrap: Likewise.
3852 * Makefile.cfg: Adjust to new GNUmakefile.
3853 * README-hacking: Likewise.
3854
3855 Import from gnulib:
3856
3857 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
3858 Bruno Haible <bruno@clisp.org>
3859
3860 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
3861 and is a script that invokes bison. Tighten the code. Add comments.
3862
3863 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
3864
3865 Spell "boolean" as "Boolean". Reported by Akim Demaille.
3866 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
3867 * doc/bison.texinfo (Decl Summary): Fix.
3868 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
3869 * tests/input.at (Boolean %define variables): Update output.
3870 * tests/skeletons.at (%define boolean variables: invalid skeleton
3871 defaults): Rename to...
3872 (%define Boolean variables: invalid skeleton defaults): ... this and
3873 update output.
3874
3875 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
3876
3877 In impure push mode, don't allow more than one yypstate to be allocated
3878 since multiple impure parsers would corrupt yynerrs.
3879 * data/push.c (yypstate_allocated): New static global variable
3880 initialized to 0.
3881 (yypull_parse): If yypstate_new returns 0, don't report it as memory
3882 exhaustion if yypstate_allocated is 1, but still return 2.
3883 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
3884 already 1. Otherwise, set it to 1.
3885 (yypstate_delete): Set it to 0.
3886 * tests/push.at (Push Parsing: Multiple impure instances): New test
3887 case.
3888
3889 2007-08-17 Bob Rossi <bob@brasko.net>
3890
3891 * doc/bison.texinfo (Push Decl): Document the push parser.
3892 (Table of Symbols): Ditto.
3893 (Pure Decl): Ditto.
3894 (Decl Summary): Ditto.
3895 (Multiple Parsers, Push Parser Function, Pull Parser Function,
3896 Parser Create Function, Parser Delete Function):
3897 Add new push parser symbols.
3898 (Table of Symbols): Document push-parser, push-pull-parser,
3899 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
3900
3901 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
3902
3903 Update to GPLv3.
3904 * doc/gpl-3.0.texi: New file.
3905 * doc/gpl.texi: Remove.
3906 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
3907 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
3908 * README-hacking, TODO, bootstrap, bootstrap.conf:
3909 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
3910 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
3911 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
3912 * data/lalr1.cc, data/lalr1.java, data/location.cc:
3913 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
3914 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
3915 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
3916 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
3917 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
3918 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
3919 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
3920 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
3921 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
3922 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
3923 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
3924 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
3925 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
3926 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
3927 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
3928 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
3929 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
3930 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
3931 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
3932 * src/complain.c, src/complain.h, src/conflicts.c:
3933 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
3934 * src/files.h, src/flex-scanner.h, src/getargs.c:
3935 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
3936 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
3937 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
3938 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
3939 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
3940 * src/print.c, src/print.h, src/print_graph.c:
3941 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
3942 * src/reduce.h, src/relation.c, src/relation.h:
3943 * src/revision.h, src/scan-code.h, src/scan-code.l:
3944 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
3945 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
3946 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
3947 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
3948 * tests/Makefile.am, tests/actions.at, tests/c++.at:
3949 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
3950 * tests/existing.at, tests/glr-regression.at:
3951 * tests/headers.at, tests/input.at, tests/java.at:
3952 * tests/local.at, tests/output.at, tests/push.at:
3953 * tests/reduce.at, tests/regression.at, tests/sets.at:
3954 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
3955 * tests/torture.at:
3956 Update to GPLv3.
3957
3958 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
3959
3960 Get rid of broken %no-parser, -n, and --no-parser implementation and
3961 documentation.
3962 * TODO: Don't mention them.
3963 * doc/bison.1: Likewise.
3964 * doc/bison.texinfo (Decl Summary): Likewise.
3965 (Bison Options): Likewise.
3966 (Option Cross Key): Likewise.
3967 * src/getargs.c (no_parser_flag): Remove global variable.
3968 (usage): Don't print description of -n and --no-parser.
3969 (long_options): Remove --no-parser entry here.
3970 (getargs): Remove -n case in the switch here.
3971 * src/getargs.h (no_parser_flag): Remove extern.
3972 * tests/regression.at (Web2c Actions): Remove comment that mentions
3973 --no-parser.
3974
3975 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
3976
3977 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
3978 name user variables starting with `yy'. Just pass NULL instead of a
3979 dummy local &yylval to yypush_parse.
3980 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
3981 starting with `yy'.
3982
3983 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
3984
3985 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
3986 true since it's then always used regardless of whether yyoverflow is
3987 defined. Reported by Christian Burger at
3988 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
3989 * THANKS: Add Christian Burger.
3990
3991 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3992 node names: say "Decl Summary" not "Bison Declaration Summary".
3993
3994 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
3995
3996 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
3997 determine whether this function has already complained about an invalid
3998 value for a %define boolean variable, don't check whether Bison has
3999 ever examined the value. As written, the check was a tautology.
4000 Instead, record and check for this complaint using a separate muscle.
4001
4002 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4003
4004 Fix push parsing memory leak reported by Brandon Lucia at
4005 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
4006 * THANKS: Add Brandon Lucia.
4007 * data/push.c (yypstate_delete): Free the stack if it was reallocated
4008 but the parse never completed and thus freed it.
4009 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
4010 * tests/testsuite.at: Include push.at.
4011 * test/push.at: New.
4012 (Push Parsing: Memory Leak for Early Deletion): New test case.
4013
4014 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
4015
4016 Improve handling of multiple S/R conflicts in the same state and of S/R
4017 conflicts involving multiple reductions.
4018 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
4019 set for a state here or Bison will abort if it is reassigned on a
4020 later conflicted reduction in the same state.
4021 Similarly, don't finalize and assign the solved conflicts report here
4022 or it will be lost if it is reassigned on a later conflicted reduction
4023 in the same state.
4024 (set_conflicts): Instead, assign them both here after all S/R conflicts
4025 in the state have been fully examined.
4026 * src/print.c (shift_set): Rename to...
4027 (no_reduce_set): ... this.
4028 (print_reductions): Update for rename, and add %nonassoc error action
4029 tokens to no_reduce_set so that, when printing the first remaining
4030 reduction on an error action token, the reduction is enclosed in
4031 brackets.
4032 (print_results): Update for rename.
4033 * tests/conflicts.at (Solved conflicts report for multiple reductions
4034 in a state): New test case.
4035 (%nonassoc error actions for multiple reductions in a state): New test
4036 case.
4037
4038 * src/main.c (main): Don't depend on C99 features.
4039
4040 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4041
4042 * build-aux/.cvsignore: Add compile.
4043 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
4044 uniwidth.
4045
4046 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
4047
4048 * bootstrap (slurp): Create target directories that don't exist.
4049 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
4050
4051 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
4052
4053 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
4054 than item number.
4055 * closure.c (closure): Likewise.
4056 * state.h (reductions): Comment sorting of rules.
4057 (state): Comment sorting of items.
4058
4059 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
4060
4061 Fix C++ test cases after recent Gnulib changes. Discussed starting at
4062 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
4063 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
4064 definition in order to avoid Gnulib headers since we don't use config.h
4065 here.
4066 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
4067 rather than AT_DATA so that config.h is included.
4068
4069 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
4070
4071 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
4072 instead of fprintf. Guard these functions with #if YYDEBUG instead of
4073 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
4074 and so that YYFPRINTF is guaranteed to be defined here.
4075
4076 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4077
4078 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
4079 with...
4080 (muscle_percent_define_check_values): ... this more helpful function.
4081 Again, it's not used yet, but it will be.
4082 * src/muscle_tab.h: Likewise.
4083
4084 Improve some comments in parser table construction.
4085 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
4086 (generate_states): Don't mention ruleset, which is internal to closure.
4087 * src/closure.c (closure): Explain sorting of core and itemset, which
4088 is required for this function to behave correctly.
4089 * src/closure.h (closure): Mention sorting.
4090
4091 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
4092
4093 * src/lalr.c (state_lookahead_tokens_count): For code readability,
4094 move the check for disabled transitions to an aver since conflict
4095 resolution hasn't happened yet.
4096
4097 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
4098 labels a state as inconsistent just because it has error transitions.
4099 The original form of this check appeared in revision 1.1 of lalr.c,
4100 which was committed on 1991-12-21. Now (at least), changing the
4101 consistency label on such a state appears to have no useful effect in
4102 any of the places it is examined, which I enumerate below. The key
4103 point to understanding each item in this enumeration is that a state
4104 with an error transition is labelled consistent in the first place only
4105 if it has no rules, so the check cannot matter for states that have
4106 rules. (1) Labelling a state as inconsistent will cause set_conflicts
4107 to try to identify its conflicts, and a state must have *rules* to have
4108 conflicts. (2) Labelling a state as inconsistent will affect how
4109 action_row sets the default *rule* for the state. (3) Labelling a
4110 state as inconsistent will cause build_relations to add lookback edges
4111 to *rules* in that state.
4112 * src/state.h (struct state): Word the comment for member consistent
4113 more carefully.
4114
4115 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4116
4117 Don't depend on C99 features.
4118 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
4119 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
4120 * src/reader.c (check_and_convert_grammar): Fix for-loop.
4121 * src/state.c (state_mark_reachable_states): Fix for-loop.
4122 (state_remove_unreachable_states): Fix for-loop.
4123
4124 Don't widen struct state with member reachable just to temporarily
4125 record reachability. Instead, use a local bitset.
4126 * src/state.h (struct state): Remove member.
4127 * src/state.c (state_new): Don't initialize it.
4128 (state_mark_reachable_states): Rename to...
4129 (state_record_reachable_states): ... this, and use bitset.
4130 (state_remove_unreachable_states): Use bitset.
4131
4132 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
4133
4134 * src/Makefile.am (yacc): Quote target action commands properly so
4135 that the yacc script isn't corrupt. Reported by Hans Aberg at
4136 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
4137
4138 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
4139 the case of pure parsers. Reported by Frans Englich at
4140 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
4141 * THANKS: Add Frans Englich.
4142
4143 * NEWS (2.3a+): In the %code entry, reference section `Bison
4144 Declaration Summary' from the manual now since the %code summary has
4145 moved there.
4146 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
4147 in the rules section must be terminated by semicolons.
4148
4149 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
4150
4151 Extend the front-end API for %define variables to more completely
4152 mirror the back-end. This will be useful in the future.
4153 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
4154 Update comments to mention the new front-end counterparts of these
4155 macros.
4156 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
4157 for muscle_string_decode and muscle_location_decode.
4158 (muscle_string_decode): New static function.
4159 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
4160 (muscle_percent_define_get, muscle_percent_define_ifdef): New
4161 functions.
4162 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
4163 muscle_percent_define_get to mimic the b4_percent_define_flag_if
4164 implementation more closely.
4165 (muscle_percent_define_invalid_value): New function.
4166 * src/muscle_tab.h (muscle_percent_define_get,
4167 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
4168 Prototype.
4169
4170 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4171
4172 * NEWS (2.3a+): Mention yesterday's state-removal change.
4173 (2.3a): Remove the %language entry, which was added after 2.3a.
4174 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
4175 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
4176 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
4177 tests/existing.at: Update copyright date.
4178
4179 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4180
4181 If conflict resolution makes states unreachable, remove those states,
4182 report rules that are then unused, and don't report conflicts in those
4183 states.
4184 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
4185 New global function.
4186 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
4187 function.
4188 * src/main.c (main): After conflict resolution, remove the unreachable
4189 states and update all data structures that reference states by number.
4190 * src/state.c (state_new): Initialize each state's reachable member to
4191 false.
4192 (state_mark_reachable_states): New static function.
4193 (state_remove_unreachable_states): New global function.
4194 * src/state.h (struct state): Add member bool reachable.
4195 (state_remove_unreachable_states): Prototype.
4196 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4197 New test case.
4198 * tests/existing.at (GNU pic Grammar): Update test case output now that
4199 an unused rule is discovered.
4200
4201 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4202
4203 Minor code cleanup in parser table construction.
4204 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
4205 (new_itemsets, save_reductions): Update for rename to nitemset.
4206 * src/closure.c (nritemset): Rename to...
4207 (nitemset): ... this since the "r" appears to meaningless and isn't
4208 used in the comments.
4209 (closure): Update for rename.
4210 * src/closure.h (nritemset): Update extern to...
4211 (nitemset): ... this.
4212 * src/lalr.c (LA): Fix a typo in comments.
4213 * src/print.c (print_core): Update for rename to nitemset.
4214 * src/print_graph.c (print_graph): Likewise.
4215 * src/state.h: Fix some typos in header comments.
4216
4217 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
4218
4219 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
4220 still sticks to ASCII. Sorry!
4221
4222 * README-hacking: New file, taken mostly from coreutils, with changes
4223 for Bison. Contains much of the contents of:
4224 * README-cvs: Remove.
4225 * bootstrap: Sync from gnulib.
4226 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
4227 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
4228
4229 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
4230
4231 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
4232 Setzer.
4233 (Java Differences): Fix some typos.
4234 * THANKS: Add Sebastian Setzer.
4235
4236 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
4237
4238 * data/java.m4 (b4_single_class_if): Remove.
4239 (b4_abstract_if): Look at "%define abstract".
4240 (b4_lexer_if): New.
4241 (b4_union_name): Rename...
4242 (b4_yystype): ... to this. Map to "%define stype".
4243 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
4244 b4_maybe_throws): Fix quoting.
4245 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
4246 * data/lalr1.java (Lexer interface): Always define.
4247 (Lexer interface within parser class): Remove.
4248 (YYLexer class): New, used when "%code lexer" is present.
4249 (constructor): When "%code lexer" is used, pass %lex-param
4250 to the lexer constructor.
4251 (yylex, yyparse): Remove %lex-param from method invocations
4252 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
4253
4254 * doc/bison.texinfo (Java Bison Interface): Mention "%define
4255 abstract". Rename "%define union_name" to "%define stype".
4256 Rename method names according to previous patch.
4257 (Java Scanner Interface): Describe "%code lexer" instead of
4258 "%pure-parser" and "%define single_class".
4259 (Java Differences): Mention "%code lexer".
4260
4261 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
4262 Include scanner here, using macros from tests/local.at.
4263 (AT_DATA_CALC_Y): Remove final argument.
4264 (_AT_CHECK_JAVA_CALC): Likewise.
4265 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
4266 of %locations and %error-verbose.
4267 (main): Test with and without %lex-param.
4268 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
4269 (AT_BISON_OPTION_POPDEFS): Pop it.
4270
4271 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4272
4273 DJGPP spefic issue. Inhibit the use of disallowed characters for
4274 file name genertion on Win98, WinXP, etc. These are |<>":?*\
4275 and concern testsuite case 46.
4276 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
4277 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
4278 * djgpp/config.bat: Inhibit the use of disallowed characters.
4279
4280 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4281
4282 Miscellaneous %define and %code cleanup.
4283 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
4284 values are interpreted.
4285 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
4286 documentation a little more.
4287 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
4288 muscle_percent_define_insert, muscle_percent_code_grow): New
4289 functions/macros.
4290 * src/muscle_tab.h (muscle_percent_define_insert,
4291 muscle_percent_code_grow): Prototype.
4292 * src/parse-gram.y (prologue_declaration): Use
4293 muscle_percent_define_insert and muscle_percent_code_grow when parsing
4294 %define and %code directives.
4295
4296 Make it easy to share %define boolean variables between the front-end
4297 and back-end. Though not used yet, this will be useful in the future.
4298 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
4299 Bison uses of names rather than just skeleton uses of names.
4300 (b4_percent_define_get, b4_percent_define_ifdef): Rename
4301 b4_percent_define_skeleton_variables(VARIABLE) to
4302 b4_percent_define_bison_variables(VARIABLE).
4303 (b4_percent_code_get, b4_percent_code_ifdef): Rename
4304 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
4305 b4_percent_code_bison_qualifiers(QUALIFIER).
4306 (b4_check_user_names_wrap): Update for renames.
4307 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
4308 muscle_percent_define_default): New functions mimicking
4309 b4_percent_define_flag_if and b4_percent_define_default.
4310
4311 For %define variables, report locations for invalid values and
4312 redefinitions.
4313 * data/bison.m4 (b4_percent_define_flag_if): Read
4314 b4_percent_define_loc(VARIABLE) to report the location of an invalid
4315 value for VARIABLE.
4316 (b4_percent_define_default): Save a special location in
4317 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
4318 must later be reported as invalid.
4319 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
4320 functions.
4321 (muscle_percent_define_insert): Record the location of VARIABLE in
4322 muscle percent_define_loc(VARIABLE), and use it to report the previous
4323 location for a redefinition.
4324 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
4325 (muscle_percent_define_default): Update like b4_percent_define_default.
4326 (muscle_grow_user_name_list): Rename to...
4327 (muscle_user_name_list_grow): ... this for consistency and use
4328 muscle_location_grow.
4329 * src/muscle_tab.h (muscle_location_grow): Prototype.
4330 * tests/input.at (%define errors): Update expected output.
4331 * tests/skeletons.at (%define boolean variables: invalid skeleton
4332 defaults): New test case.
4333
4334 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
4335
4336 * src/print.c (lookahead_set, state_default_rule): Remove.
4337 (print_reductions): Replace state_default_rule invocation with
4338 equivalent use of yydefact, which was computed in token_actions in
4339 tables.c.
4340 (print_results): Don't allocate lookahead_set.
4341
4342 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
4343
4344 * data/lalr1.java: Prefix all private members with yy.
4345
4346 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
4347
4348 Use YYFPRINTF instead of fprintf where appropriate. Reported by
4349 Sebastien Fricker at
4350 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
4351 * THANKS: Add Sebastien Fricker.
4352 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
4353 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
4354 accept a variable number of arguments.
4355
4356 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
4357
4358 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
4359
4360 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4361
4362 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
4363 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
4364 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
4365
4366 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
4367
4368 Undo my 2007-02-07 change, switching back to the c-strcase module
4369 introduced in the 2007-02-03 change. Bruno Haible reported that
4370 the 2007-02-07 change would be dangerous in Turkish if we add a
4371 language whose name contains "i", since "i" is not lowercase "I"
4372 in Turkish.
4373 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
4374 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
4375 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
4376 * m4/.cvsignore: Remove strcase.m4.
4377 * src/getargs.c: Revert 2007-02-07 change, as follows.
4378 Include c-strcase.h.
4379 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
4380
4381 2007-02-11 Bruno Haible <bruno@clisp.org>
4382
4383 Enable the Java related testsuite tests when the only Java compiler
4384 found is a gcj < 4.3. Discussed at
4385 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
4386 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
4387
4388 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
4389
4390 * data/Makefile.am: Update copyright date.
4391 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
4392 yypstate_new returns NULL.
4393 (yypstate_new): Return NULL if malloc does.
4394 * src/reader.c (packgram): Move translation of rule actions from the
4395 beginning of packgram to...
4396 (check_and_convert_grammar): ... here right before packgram is invoked
4397 so it's easier to write more complete comments, and remove redundant
4398 code.
4399
4400 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
4401
4402 As in semantic actions, make @$ in %initial-action, %destructor, and
4403 %printer imply %locations.
4404 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
4405 scanning @$.
4406 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
4407 (@$ in %initial-action implies %locations,
4408 @$ in %destructor implies %locations,
4409 @$ in %printer implies %locations): ... these new test cases.
4410
4411 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
4412
4413 Undo most of the 2007-02-03 change, switching to the strcase module
4414 now that gnulib strcase has been fixed.
4415 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
4416 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
4417 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
4418 * m4/.cvsignore: Add strcase.m4.
4419 * src/getargs.c: Revert 2007-02-03 change, as follows.
4420 Don't include c-strcase.h.
4421 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
4422 strcasecmp has "unspecified behavior" outside the POSIX locale,
4423 but it works fine in practice if at least one argument is ASCII,
4424 as is the case in Bison.
4425
4426 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
4427
4428 * tests/java.at: Skip tests if only one of javac/java is present.
4429 Reported by Joel E. Denny.
4430 * tests/atlocal.in: Adjust copyright years.
4431
4432 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
4433
4434 * data/lalr1.java (Stack): Work around old verifiers that disallow
4435 access to the private fields of an inner class, from the outer class.
4436 We can make Stack's fields public because user code doesn't have access
4437 to the instance of Stack used by parse(). Reported by Paul Eggert.
4438
4439 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
4440
4441 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
4442 the right spot for these files?
4443 * bootstrap.conf (gnulib_modules): Add c-strcase.
4444 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
4445 c-strncasecmp.c.
4446 * src/getargs.c: Include c-strcase.h.
4447 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
4448 to avoid unspecified behavior.
4449
4450 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
4451
4452 * doc/bison.texinfo (Decl Summary): Correct typo.
4453
4454 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
4455
4456 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
4457 Complain if the value does not match empty, "true" or "false".
4458 * data/c++.m4: Adjust default definitions of %define variables.
4459 * data/java.m4: Adjust default definitions of %define variables.
4460 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
4461 to above behavior.
4462 * tests/input.at (Boolean %define variables): Test new behavior.
4463
4464 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
4465
4466 * NEWS: Mention java.
4467 * TODO: Remove things that are done.
4468 * bootstrap.conf: Add javacomp-script and javaexec-script.
4469 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
4470
4471 * data/Makefile.am: Add new files.
4472 * data/java-skel.m4: New.
4473 * data/java.m4: New.
4474 * data/lalr1.java: New.
4475
4476 * doc/bison.texinfo: Put "A Complete C++ Example" under
4477 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
4478 under Other Languages.
4479
4480 * src/getargs.c (valid_languages): Add Java.
4481 * src/getargs.h (struct bison_language): Update size of string fields.
4482
4483 * tests/Makefile.am: Add java.at.
4484 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
4485 * tests/java.at: New.
4486 * tests/testsuite.at: Include it.
4487
4488 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
4489
4490 Clean up.
4491 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
4492 at_directive_argv arguments so these no longer have to be global
4493 variables. Also, update the implementation for the following changes.
4494 (fail_for_at_directive_too_many_args,
4495 fail_for_at_directive_too_few_args): Add at_directive_name argument.
4496 (at_directive_name): Remove as at_directive_argv[0] will be used for
4497 this now.
4498 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
4499 for the directive name.
4500 (at_directive_argc, at_directive_argv): Make these local within
4501 skel_lex instead of global.
4502 (INITIAL): Update directive start action for above changes.
4503 (SC_AT_DIRECTIVE_ARG): Rename to...
4504 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
4505 (SC_AT_DIRECTIVE_SKIP_WS): Update.
4506 (scan_skel): Move yylex_destroy to...
4507 (skel_scanner_free): ... here.
4508 * tests/skeletons.at (installed skeleton file name): Rename to...
4509 (installed skeleton file names): ... this.
4510
4511 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
4512
4513 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
4514 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
4515 Summary" not "Directives".
4516 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
4517 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
4518 since the former is now the more complete one.
4519 (Prologue Alternatives): Likewise and do the same for %defines.
4520 (Table of Symbols): Add summary of %code, add summary of %define, and
4521 move full %code documentation to...
4522 (Decl Summary): ... here for consistency with other entries in these
4523 sections.
4524 Move %define entry in order to keep this list alphabetized.
4525 Reword %define entry a little to put less emphasis on the skeleton
4526 concept, which most users shouldn't have to think about.
4527
4528 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
4529
4530 Adjust to recent gnulib changes.
4531 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
4532 Add string.h, string_.h, unistd_.h, wchar_.h.
4533 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
4534 * src/system.h: Don't include <stpcpy.h>; this is now done by
4535 <string.h>.
4536
4537 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
4538
4539 Simplify implementation of unqualified %code, implement macros for
4540 uniform treatment of boolean %define flags. Document %define.
4541 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
4542 b4_percent_code_ifdef): New.
4543 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
4544 * data/c++.m4: Define default value for global_tokens_and_yystype.
4545 * data/glr.cc: Likewise.
4546 * data/location.cc: Use b4_percent_define_flag_if.
4547
4548 * doc/bison.texinfo (Decl Summary): Document %define.
4549
4550 * src/parse-gram.y (Unqualified %code): Change muscle name to
4551 b4_percent_code().
4552 (content.opt): Default to empty.
4553
4554 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
4555
4556 Implement support for relative and absolute skeleton file names.
4557 Discussed starting at
4558 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
4559 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
4560 (Bison Options): Document in --skeleton entry.
4561 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
4562 full_skeleton can't necessarily hold all of pkgdatadir.
4563 If the specified skeleton file name contains a `/', don't prepend
4564 pkgdatadir.
4565 * src/parse-gram.y (prologue_declaration): If the specified skeleton
4566 file name contains a `/', prepend the grammar file directory.
4567 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
4568 * skeletons.at: New file.
4569 (relative skeleton file names): New test case.
4570 (installed skeleton file names): New test case.
4571 * tests/testsuite.at: Include skeletons.at.
4572
4573 * bootstrap: Update copyright to 2007.
4574
4575 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
4576
4577 * bootstrap: Remove occurrences of .#bootmp from the files.
4578
4579 2007-01-17 Akim Demaille <akim@epita.fr>
4580
4581 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
4582 nonterminals.
4583 Use per-type %printer.
4584
4585 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
4586
4587 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
4588 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4589 djgpp/config.site, src/files.c, src/files.h, src/main.c,
4590 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
4591 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
4592 tests/glr-regression.at, tests/input.at, tests/local.at,
4593 tests/output.at, tests/torture.at: Update copyright to 2007.
4594
4595 2007-01-16 Akim Demaille <akim@epita.fr>
4596
4597 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
4598 error code.
4599 (Calc++ Scanner): Exit with failure if we can't open the input
4600 file.
4601 Accept "-" standing for stdin.
4602 (Calc++ Top Level): Print the result only if the parsing was
4603 successful.
4604
4605 2007-01-16 Akim Demaille <akim@epita.fr>
4606
4607 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
4608
4609 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
4610 and Joel E. Denny <jdenny@ces.clemson.edu>
4611
4612 Clean up %define and %code implementation in M4 some. Most
4613 importantly, rename all related macros to be in the b4_percent_define
4614 and b4_percent_code namespaces. Also, complete support for `.' in
4615 %define variable names and %code qualifiers.
4616 * data/bison.m4 (b4_check_user_names): Check for special
4617 "SKELETON-NAMESPACE(name)" macros instead of using two nested
4618 m4_foreach loops.
4619 (b4_get_percent_define, b4_get_percent_code): Rename to...
4620 (b4_percent_define_get, b4_percent_code_get): ... these.
4621 Extend documentation with examples.
4622 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
4623 b4_percent_define_skeleton_variables and
4624 b4_percent_code_skeleton_qualifiers.
4625 Expect any value for the %define variable `foo' to be stored in the
4626 macro named `b4_percent_define(foo)'; expect any %code blocks for the
4627 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
4628 expect any unqualified %code blocks to be stored in a macro named
4629 `b4_percent_code_unqualified'.
4630 Use m4_indir so that %define variable names and %code qualifiers can
4631 contain `.', which is allowed by the grammar parser.
4632 (b4_percent_define_default): New macro to set a default value for a
4633 %define variable.
4634 (m4_wrap): Update wrapped code, and fix some underquoting.
4635 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
4636 Expect grammar uses of %define variables and %code qualifiers to be
4637 defined in b4_percent_define_user_variables and
4638 b4_percent_code_user_qualifiers.
4639 * data/c++.m4: Use b4_percent_define_default rather than
4640 m4_define_default. Fix some underquoting. Skeleton usage of %define
4641 variable define_location_comparison now implies skeleton usage of
4642 %define variable filename_type.
4643 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4644 data/push.c, data/yacc.c: Update macro names.
4645 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
4646 muscle names.
4647
4648 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4649
4650 DJGPP specific issues.
4651
4652 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
4653 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
4654
4655 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4656
4657 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
4658 run parsers in all tests so that Valgrind is invoked during
4659 maintainer-check-valgrind.
4660 (Duplicate representation of merged trees): Free all semantic values.
4661 (Duplicated user destructor for lookahead): Likewise.
4662
4663 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4664
4665 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
4666 command-line prefix.
4667 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
4668 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
4669 miss Valgrind messages.
4670 (Exploding the Stack Size with Malloc): Likewise.
4671
4672 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4673
4674 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
4675 locals. Reported by Juan Manuel Guerrero at
4676 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
4677 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
4678 Fix some indentation also.
4679 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
4680 explaining this issue.
4681
4682 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
4683 and Joel E. Denny <jdenny@ces.clemson.edu>
4684
4685 Simplify union and prologue handling, and escape union and lex/parse
4686 params with digraphs.
4687 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
4688 values to the empty string since these are no longer guaranteed
4689 initialized by the front-end.
4690 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
4691 braces around b4_user_stype since this is no longer done by the
4692 front-end.
4693 * src/files.c, src/files.h (pre_prologue_obstack,
4694 post_prologue_obstack): Remove.
4695 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
4696 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
4697 with digraphs. This fixes lex params and parse params.
4698 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
4699 * src/output.c (prepare): Remove muscle insertion of the prologues.
4700 (output): Remove freeing of pre_prologue_obstack and
4701 post_prologue_obstack.
4702 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
4703 than prologue_augment for prologue parsing so you don't need prologue
4704 obstacks.
4705 (grammar_declaration): For %union RHS, use `braceless' instead of
4706 "{...}" so that braces are already stripped and code is escaped with
4707 digraphs.
4708 * src/reader.c (prologue_augment): Remove.
4709 (reader): Remove initialization of pre_prologue_obstack and
4710 post_prologue_obstack.
4711 * src/reader.h (prologue_augment): Remove.
4712
4713 * data/c.m4: Remove stray parenthesis.
4714
4715 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4716
4717 Remove quotes from variables names in %define directives and from
4718 qualifiers in %code directives, and restrict the characters that are
4719 allowed in them to M4-friendly ones. For %define, continue to support
4720 the quoted form as a deprecated feature. Discussed starting at
4721 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
4722 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
4723 %code.
4724 * doc/bison.texinfo (Prologue Alternatives): Update.
4725 (Decl Summary): In %defines entry, update mention of `%code requires'
4726 and `%code provides'.
4727 (C++ Location Values): Update %define uses.
4728 (Calc++ Parser Interface): Likewise.
4729 (Calc++ Parser): Likewise, and update `%code requires' uses.
4730 (Table of Symbols): Update %code documentation.
4731 * src/parse-gram.y (prologue_declaration): For %define variables, use
4732 `variable' instead of `STRING'.
4733 (grammar_declaration): For %code qualifiers, use `ID' instead of
4734 `STRING'.
4735 (variable): New nonterminal that takes an `ID' or a `STRING'.
4736 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
4737 and %define uses.
4738 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
4739 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
4740 (%define errors): Update %define uses.
4741
4742 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4743
4744 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
4745 instead of muscle_insert for %define values so that M4-special
4746 characters are replaced with digraphs.
4747 * tests/input.at (%define errors): Extend to check weird values.
4748
4749 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4750
4751 Instead of having skeletons declare all valid %define variables and
4752 %code qualifiers, provide macros that retrieve the associated values
4753 and build these lists automatically. Thus Bison will now warn when a
4754 variable or qualifier is not used by the skeleton in the current
4755 invocation regardless of whether it might sometimes be used by that
4756 skeleton in other invocations. Also, move all %define value macros to
4757 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
4758 form, which is replaced by %code.
4759 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
4760 (b4_check_user_names): ... this, and change the series of valid name
4761 arguments to a single list argument for names used in the skeleton
4762 similar to the existing list argument for names used in the grammar.
4763 Warn instead of complaining.
4764 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
4765 values and %code code, to format %code code properly, and to build
4766 lists of all %define variables and %code qualifiers used in the
4767 skeleton: b4_skeleton_percent_define_variables and
4768 b4_skeleton_percent_code_qualifiers.
4769 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
4770 Remove, and...
4771 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
4772 the skeleton names lists can finish building first. In place of
4773 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
4774 expect the lists b4_user_percent_define_variables and
4775 b4_user_percent_code_qualifiers.
4776 * data/c++.m4: Where setting default values for b4_parser_class_name,
4777 b4_location_type, b4_filename_type, b4_namespace, and
4778 b4_define_location_comparison, update their names to the
4779 b4_percent_define_ namespace.
4780 * data/glr.c: Don't use b4_check_percent_define_variables and
4781 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
4782 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
4783 (b4_parser_class_name, b4_namespace): Define these using
4784 b4_get_percent_define for parser_class_name and namespace.
4785 * data/location.cc: Use b4_get_percent_define.
4786 * data/push.c: Don't use b4_check_percent_define_variables and
4787 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
4788 * data/yacc.c: Likewise, and don't call m4_exit in
4789 b4_use_push_for_pull_if or m4_wrap code will never execute.
4790 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
4791 Rename to...
4792 (muscle_grow_user_name_list): ... this for consistency with the
4793 terminology used in bison.m4.
4794 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
4795 %define variable names, and rename muscle used_percent_define_variables
4796 to user_percent_define_variables.
4797 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
4798 user_percent_code_qualifiers.
4799 (content): Remove.
4800 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
4801 {CODE} form is no longer accepted.
4802 * tests/input.at (Reject bad %code qualifiers): Rename to...
4803 (Reject unused %code qualifiers): ... this, and update test output.
4804 (%define error): Update test output.
4805
4806 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
4807
4808 Check for unrecognized %define variables similar to checking for
4809 unrecognized %code qualifiers. Check for redefined %define variables.
4810 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
4811 generalizes...
4812 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
4813 (b4_check_percent_define_variables): New, also wraps it.
4814 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
4815 variables using b4_check_percent_define_variables.
4816 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
4817 all those exercised in the test suite and all those listed in the
4818 `Default values' section of c++.m4. Are there others?
4819 * data/push.c, data/yacc.c: Declare no valid %define variables.
4820 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
4821 similar to muscle_find, but it works even when the muscle stores a
4822 const value.
4823 (muscle_grow_used_name_list): New function for constructing the used
4824 name list muscles that b4_check_for_unrecognized_names requires.
4825 * src/parse-gram.y (prologue_declaration): Warn if a variable is
4826 %define'd more than once. Define the b4_used_percent_define_variables
4827 muscle with muscle_grow_used_name_list.
4828 (grammar_declaration): Abbreviate %code code with
4829 muscle_grow_used_name_list.
4830 * tests/input.at (%define errors): New.
4831
4832 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4833
4834 Provide warn_at, complain_at, and fatal_at function callbacks to the
4835 skeletons, and use this for %code qualifier complaints.
4836 * data/bison.m4 (b4_error_at): New, invoked by...
4837 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
4838 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
4839 @fatal_at(...@) directives.
4840 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
4841 qualifiers in b4_used_percent_code_qualifiers and to use
4842 b4_complain_at.
4843 * src/location.c, src/location.h (boundary_set_from_string): New global
4844 function.
4845 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
4846 function.
4847 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
4848 to b4_used_percent_code_qualifiers.
4849 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
4850 function.
4851 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
4852 (lineno): Rename to...
4853 (out_lineno): ... this so I don't misunderstand it again.
4854 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
4855 here; these newlines are in the input but not the output file.
4856 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
4857 (at_directive_perform): ... this new static function, and add handling
4858 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
4859 directives.
4860 * tests/input.at (Reject bad %code qualifiers): Update test output with
4861 locations and extend.
4862
4863 * tests/output.at (Output file name: [, Output file name: ]): Remove
4864 bogus comment about these tests failing.
4865
4866 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4867
4868 Clean up b4_check_percent_code_qualifiers a little.
4869 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
4870 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
4871 documentation and add examples.
4872 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
4873 qualifiers here.
4874
4875 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
4876
4877 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
4878 unreliable -- especially when they're hidden inside another macro.
4879 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
4880 data/c.m4: Remove m4_divert(-1).
4881 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4882 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
4883 m4_divert_push(0) and m4_divert_pop(0).
4884 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
4885 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
4886 pushed and popped by m4sugar, should be first on the stack.
4887
4888 Provide warn, complain, and fatal function callbacks to the skeletons.
4889 This provides more flexibility than m4_fatal, improves the error
4890 message format, and captures messages for translation. Discussed
4891 starting at
4892 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
4893 * data/bison.m4 (b4_error): New, invoked by...
4894 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
4895 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
4896 directives. Because these M4 macros might be called when the current
4897 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
4898 the previous removal of uses of m4_divert, which caused trouble.
4899 (b4_check_percent_code_qualifiers): Use b4_complain instead of
4900 m4_fatal to report unrecognized %code qualifiers.
4901 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
4902 push parser requests.
4903 * data/glr.c: Use b4_complain instead of m4_fatal to report
4904 non-deterministic push parser requests.
4905 Update @output usage to @output(...@) form.
4906 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
4907 report missing %defines. Update @output usage to @output(...@) form.
4908 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
4909 @output(...@) form.
4910 * src/main.c (main): Invoke skel_scanner_free.
4911 * src/scan-skel.h (skel_scanner_free): Prototype new function.
4912 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
4913 obstack_for_string from flex-scanner.h.
4914 (YY_DECL): Use to declare skel_lex static.
4915 (decode_at_digraphs): Remove; now handled in the new
4916 SC_AT_DIRECTIVE_ARG start condition.
4917 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
4918 functions.
4919 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
4920 at_directive_argv): New static globals.
4921 (INITIAL): Use fail_for_invalid_at.
4922 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
4923 recognize the start of a generalized `@directive(...@)' form and
4924 start...
4925 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
4926 directive args (using the new obstack_for_string), to decode the
4927 contained @ diagraphs, and to perform the directive. It recognizes
4928 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
4929 @output(...@).
4930 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
4931 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
4932 `@,'.
4933 (scan_skel): Initialize obstack_for_string on the first call.
4934 (skel_scanner_free): New function to free obstack_for_string.
4935 * tests/input.at (Reject bad %code qualifiers): Update test output.
4936
4937 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
4938
4939 Consolidate the 4 prologue alternative directives (%code, %requires,
4940 %provides, and %code-top) into a single %code directive with an
4941 optional qualifier field. Discussed at
4942 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
4943 * NEWS (2.3a+): Rewrite the existing entry for the prologue
4944 alternatives.
4945 * doc/bison.texinfo (Prologue Alternatives): Update.
4946 (Decl Summary): Update to %code "requires" and %code "provides".
4947 (Calc++ Parser): Update to %code "requires".
4948 (Table of Symbols): Remove entries for %requires, %provides, and
4949 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
4950 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
4951 are replaced by b4_percent_code_provides and b4_percent_code_requires,
4952 which are skeleton-specific.
4953 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
4954 declare what %code qualifiers it supports and to complain if any other
4955 qualifiers were used in the grammar.
4956 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
4957 and b4_user_code([b4_percent_code_provides]) in place of
4958 b4_user_requires and b4_user_provides.
4959 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
4960 Add b4_user_code([b4_percent_code_top]) and
4961 b4_user_code([b4_percent_code]).
4962 Invoke b4_check_percent_code_qualifiers.
4963 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
4964 PERCENT_REQUIRES): Remove.
4965 (grammar_declaration): Remove RHS's for %code-top, %provides, and
4966 %requires. Rewrite the %code RHS as the unqualified form defining the
4967 muscle b4_percent_code. Add another RHS for the qualified %code form,
4968 which defines muscles of the form b4_percent_code_QUALIFIER and the
4969 b4_used_percent_code_qualifiers muscle.
4970 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
4971 PERCENT_REQUIRES): Remove.
4972 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
4973 %code "requires" and %code "provides".
4974 * tests/input.at (Reject bad %code qualifiers): New.
4975
4976 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
4977
4978 Use the new code_props interface for destructors and printers.
4979 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
4980 printer_location members, and change the type of the destructor and
4981 printer members to code_props.
4982 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
4983 symbol_printer_get, semantic_type_destructor_set,
4984 semantic_type_printer_set, default_tagged_destructor_set,
4985 default_tagless_destructor_set, default_tagged_printer_set,
4986 default_tagless_printer_set): Use code_props in arguments and return
4987 types in place of char const * and location.
4988 (symbol_destructor_location_get, symbol_printer_location_get): Remove
4989 since the locations are now contained in the return of
4990 symbol_destructor_get and symbol_printer_get.
4991 * src/output.c (symbol_destructors_output, symbol_printers_output):
4992 Replace with...
4993 (symbol_code_props_output): ... this to eliminate duplicate code.
4994 (output_skeleton): Update to use symbol_code_props_output.
4995 * src/reader.c (symbol_should_be_used): Update use of
4996 symbol_destructor_get.
4997 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
4998 Update uses of the various _destructor_set and _printer_set functions.
4999 * src/symtab.c: (default_tagged_destructor_location,
5000 default_tagless_destructor_location, default_tagged_printer_location,
5001 default_tagless_printer_location): Remove since we...
5002 (default_tagged_destructor, default_tagless_destructor,
5003 default_tagged_printer, default_tagless_printer): ... change the type
5004 of these to code_props.
5005 (symbol_new, semantic_type_new, symbol_destructor_set,
5006 semantic_type_destructor_set, symbol_destructor_get,
5007 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
5008 symbol_check_alias_consistency, default_tagged_destructor_set,
5009 default_tagless_destructor_set, default_tagged_printer_set,
5010 default_tagless_printer_set): Update.
5011 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
5012 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
5013 code_props members.
5014 (symbol_print): Use SYMBOL_CODE_PRINT.
5015
5016 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
5017
5018 Use the new code_props interface for rule actions.
5019 * src/symlist.h (symbol_list): Replace action, action_location, and
5020 used members with a code_props action_props member.
5021 * src/reader.c (symbol_should_be_used, grammar_rule_check,
5022 grammar_midrule_action, grammar_current_rule_merge_set,
5023 grammar_current_rule_symbol_append, packgram): Update.
5024 * src/scan-code.h (translate_rule_action): Remove, no longer used.
5025 * src/scan-code.l (handle_action_dollar): Update.
5026 (translate_rule_action): Remove, no longer used.
5027 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
5028
5029 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5030
5031 Use the new code_props interface in parse-gram.y.
5032 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
5033 Update all uses of translate_* functions to use the new code_props
5034 interface and to use gram_scanner_last_string_free and
5035 code_scanner_last_string_free where possible.
5036 (grammar_declaration): symbol_list_destructor_set and
5037 symbol_list_printer_set now perform the translation, so don't do it
5038 here. Use gram_scanner_last_string_free where possible.
5039 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
5040 translate_code): Remove, no longer used.
5041 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
5042 symbol_list_printer_set): Perform code translation here rather than
5043 depending on the caller to do so.
5044
5045 * src/symlist.h (struct symbol_list): Correct some documentation typos.
5046 * src/scan-gram.h (gram_last_string): Remove declaration.
5047 * src/scan-gram.l (last_string): Declare it static.
5048
5049 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5050
5051 Encapsulate code properties and related functionality for the various
5052 destructors, printers, and actions into a code_props structure and
5053 interface. This patch merely implements code_props in scan-code.h and
5054 scan-code.l. Future patches will rewrite other modules to use it.
5055 Discussed starting at
5056 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
5057 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
5058 consistently initialize const structs that have an empty location
5059 field.
5060 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
5061 to ensure consistency.
5062 * src/scan-code.h (code_props): New structure.
5063 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
5064 function, macro, and const global variable for initializing a
5065 code_props with no code.
5066 (code_props_plain_init, code_props_symbol_action_init,
5067 code_props_rule_action_init, code_props_translate_code): The rest of
5068 the new code_props functional interface. Among other things, the init
5069 functions set the code_props kind field so that
5070 code_props_translate_code will know whether to behave like
5071 translate_symbol_action, translate_rule_action, or translate_code.
5072 These old translate functions must remain until all other modules are
5073 updated to use the new code_props interface.
5074 (code_scanner_last_string_free): New function similar to
5075 gram_scanner_last_string_free.
5076 (code_scanner_free): Add documentation.
5077 * src/scan-code.l: Implement the new interface.
5078 (code_lex): Make it static, add a code_props* argument, and remove the
5079 rule argument.
5080 (last_string): New static global similar to the one in scan-gram.l.
5081 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
5082 instead of rule.
5083 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
5084 code_props since Bison may one day use this information for destructors
5085 and printers.
5086 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
5087 (handle_action_dollar): Use symbol_list_n_get and set used flag
5088 directly since symbol_list_n_used_set is removed.
5089 (translate_action): Add a code_props* argument and remove the rule,
5090 action, and location arguments. Pass the code_props* on to code_lex.
5091 (translate_rule_action, translate_symbol_action, translate_code):
5092 Rewrite as wrappers around the new code_props interface.
5093 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
5094 it would eventually need to break the encapsulation of code_props.
5095
5096 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5097
5098 * etc/.cvsignore: New.
5099
5100 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5101
5102 Add maintainer-push-check to run maintainer-check using push parsing in
5103 place of pull parsing where available.
5104 * Makefile.am (maintainer-push-check): New.
5105 * data/bison.m4 (b4_use_push_for_pull_if): New.
5106 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
5107 appropriately based on their existing values.
5108 (yypush_parse): Don't print push-parser-specific diagnostics if push
5109 parsing is being used in place of pull parsing.
5110 * data/yacc.c: If push parsing should replace pull parsing, redirect to
5111 push.c.
5112 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
5113 variable, and insert b4_use_push_for_pull_flag into muscles.
5114 * tests/Makefile.am (maintainer-push-check): New.
5115
5116 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5117
5118 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
5119 (whether successful or failed) so that yypush_parse can be invoked
5120 again to start a new parse using the same yypstate.
5121 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
5122 check multiple yypull_parse invocations on the same yypstate. For pull
5123 mode, extend to check multiple yyparse invocations.
5124 (Exploding the Stack Size with Alloca): Extend to try with
5125 %push-pull-parser.
5126 (Exploding the Stack Size with Malloc): Likewise.
5127
5128 * tests/calc.at (Simple LALR Calculator): Don't specify
5129 %skeleton "push.c" since %push-pull-parser implies that now.
5130 * tests/headers.at (export YYLTYPE): Don't check for the push
5131 declarations. Otherwise, this test case can't be used to see if push
5132 mode can truly emulate pull mode.
5133 * tests/input.at (Torturing the Scanner): Likewise.
5134 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
5135 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
5136 AT_YACC_IF, which now includes the case of push mode since %skeleton
5137 need not be used for push mode. This will be more intuitive once
5138 push.c is renamed to yacc.c.
5139
5140 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5141
5142 For push mode, convert yyparse from a macro to a function, invoke yylex
5143 instead of passing a yylexp argument to yypull_parse, and don't
5144 generate yypull_parse or yyparse unless %push-pull-parser is declared.
5145 Discussed starting at
5146 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
5147 * data/bison.m4 (b4_pull_if): New.
5148 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
5149 * data/push.c: Improve M4 quoting a little.
5150 (b4_generate_macro_args, b4_parenthesize): Remove.
5151 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
5152 any time a pull parser is requested.
5153 Don't #define this as a wrapper around yypull_parse. Instead, when
5154 both push and pull are requested, make it a function that does that
5155 same thing.
5156 (yypull_parse): If there's a b4_prefix, #define this to
5157 b4_prefix[pull_parse] when both push and pull are requested.
5158 Don't define this as a function unless both push and pull are
5159 requested.
5160 Remove the yylexp argument and hard-code yylex invocation instead.
5161 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
5162 %push-parser.
5163 * src/getargs.c (pull_parser): New global initialized to true.
5164 * getargs.h (pull_parser): extern it.
5165 * src/output.c (prepare): Insert pull_flag muscle.
5166 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
5167 (prologue_declaration): Set both push_parser and pull_parser = true for
5168 %push-pull-parser. Set push_parser = true and pull_parser = false for
5169 %push-parser.
5170 * src/scan-gram.l: Don't accept %push_parser as an alternative to
5171 %push-parser since there's no backward-compatibility concern here.
5172 Scan %push-pull-parser.
5173 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
5174 instead of %push-parser.
5175 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
5176 prototype it in the module that calls yyparse.
5177 * tests/input.at (Torturing the Scanner): Likewise.
5178 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
5179
5180 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
5181
5182 Update etc/bench.pl. Optimize push mode a little (the yyn change
5183 deserves most of the credit).
5184 * Makefile.am (SUBDIRS): Add etc subdirectory.
5185 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
5186 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
5187 yytoken, yyval, and yyloc declarations to...
5188 (yyparse or yypush_parse): ... here to improve performance. For
5189 yypush_parse invocations after the first, be sure to assign yyn its old
5190 value again.
5191 (yypstate_new): Don't bother initializing the yyresult field since the
5192 initial value isn't used.
5193 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
5194 remove the #define that, in push mode, set it to yyps->NAME.
5195 * etc/Makefile.am: New.
5196 * etc/bench.pl: Remove and build it instead from...
5197 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
5198 "tests/bison" from the build directory by default rather than just
5199 invoking "bison" from $PATH.
5200 (calc_grammar): Update push parser code: don't declare yylval globally,
5201 don't define yyparse_wrapper, and don't #define yyparse.
5202 (bench_grammar): Update to check all working combinations of yacc.c,
5203 push.c, impure, pure, pull, and push.
5204
5205 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5206
5207 For push mode, add pull wrappers around yypush_parse.
5208 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
5209 (yypull_parse): New function wrapping yypush_parse.
5210 (yyparse): New #define wrapping yypull_parse.
5211 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
5212 is declared.
5213 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
5214 prototype yylex in the module that calls yyparse, and don't prototype
5215 yyparse there. Otherwise, the yyparse expansion won't compile.
5216 * tests/input.at (Torturing the Scanner): Likewise.
5217
5218 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5219
5220 Enable push parsers to operate in impure mode. Thus, %push-parser no
5221 longer implies %pure-parser. The point of this change is to move
5222 towards being able to test the push parser code by running the entire
5223 test suite as if %push-parser had been declared.
5224 * data/push.c (yypush_parse): For impure mode, remove the
5225 yypushed_char, yypushed_val, and yypushed_loc arguments.
5226 Instead, declare these as local variables initialized to the global
5227 yychar, yylval, and yylloc.
5228 For the first yypush_parse invocation only, restore the initial values
5229 of these global variables when it's time to read a token since they
5230 have been overwritten.
5231 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
5232 %push-parser.
5233 * tests/calc.at (Simple LALR(1) Calculator): Always declare
5234 %pure-parser along with %push-parser since this test case was designed
5235 for pure push parsers.
5236 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
5237 (AT_YACC_OR_PUSH_IF): New.
5238 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
5239 add a note that it's still wrong for some cases (as it has been for a
5240 while).
5241 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
5242 %push-parser no longer implies %pure-parser.
5243
5244 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5245
5246 Remove some unnecessary differences between the pull parser code and
5247 the push parser code. This patch enables yynerrs in push mode.
5248 * data/push.c: Reformat M4 a little.
5249 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
5250 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
5251 because push mode is on. Instead, if pure mode is on, move yynerrs
5252 to...
5253 (b4_declare_parser_state_variables): ... here.
5254 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
5255 to yyps->NAME so it can be used in yypush_parse.
5256 (yypush_parse): Don't omit uses of yynerrs in push mode.
5257
5258 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5259
5260 Fix bug such that the first pushed token's value and location are
5261 sometimes overwritten (sometimes by %initial-action) before being used.
5262 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
5263 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
5264 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
5265 more closely mimic the pull parser logic.
5266 Don't copy the pushed token to yychar, yylval, and yylloc until it's
5267 time to read a token, which is after any initialization of yylval and
5268 yylloc.
5269 (gottoken): Rename label to...
5270 (yyread_pushed_token): ... for clarity and to avoid infringing on the
5271 user namespace.
5272
5273 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5274
5275 Rearrange initialization of the parser state variables so that the
5276 skeleton doesn't have to have a copy for pull mode and another for push
5277 mode. This patch also fixes at least a bug such that yylloc was not
5278 initialized (with b4_location_initial_line and
5279 b4_location_initial_column) upon calling yypush_parse. However, that
5280 initialization now overwrites the first token's location;
5281 %initial-action assigning @$ already did the same thing, and both bugs
5282 will be fixed in a later patch.
5283 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
5284 (b4_declare_parser_state_variables): Remove initialization of yytoken,
5285 yyss, yyvs, yyls, and yystacksize.
5286 (yypstate_new): Remove initialization of some yypstate fields: yystate,
5287 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
5288 yylsp.
5289 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
5290 yyps->NAME so it can be used in yypush_parse.
5291 (yyparse or yypush_parse): For yypush_parse, don't print the
5292 "Starting parse" diagnostic for invocations after the first.
5293 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
5294 yypush_parse, only do it for the first invocation.
5295 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
5296 initialization to occur in yypush_parse but only on the first
5297 invocation.
5298
5299 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5300
5301 * data/push.c: Add CPP guards around push parser declarations in both
5302 the header and the code file.
5303 In the code file, move the push parser declarations to the same place
5304 they appear in the header file.
5305 Clean up the M4 some, especially the inconsistent underquoting in
5306 some b4_c_function_def and b4_c_function_decl uses.
5307
5308 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5309
5310 Encapsulate the push parser state variables into an M4 macro so the
5311 push skeleton doesn't have to list them again for pull mode's yyparse.
5312 For push mode, remove yypush_parse's local equivalents of these
5313 variables to eliminate unnecessary copying between the two sets at
5314 run-time. This patch also fixes at least a bug related to multiple
5315 %initial-action invocations in push mode.
5316 * data/push.c (b4_declare_parser_variables): Rename to...
5317 (b4_declare_scanner_communication_variables): ... this for clarity and
5318 update both uses.
5319 (b4_declare_yyparse_variables): Remove and move its contents to the one
5320 spot where it was invoked.
5321 (b4_declare_parser_state_variables): New macro containing the parser
5322 state variables required by push mode.
5323 (struct yypstate): Replace all fields but yynew with
5324 b4_declare_parser_state_variables.
5325 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
5326 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
5327 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
5328 (yyparse or yypush_parse): For yyparse in pull mode, replace local
5329 parser state variable declarations with
5330 b4_declare_parser_state_variables.
5331 Don't initialize parser state variables when calling yypush_parse since
5332 yypstate_new already does that.
5333 Invoke the user's initial action only upon the first yypush_parse
5334 invocation.
5335 Remove all code that copies between the local parser state variables
5336 and the yypstate.
5337
5338 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5339
5340 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
5341 prevent a name collision in a future patch where these names will
5342 sometimes be #define'd.
5343 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
5344 since it no longer has the same name as the existing argument.
5345 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
5346
5347 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
5348 and Joel E. Denny <jdenny@ces.clemson.edu>
5349
5350 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
5351 that the argument is case-insensitive, and there's no `=' here.
5352 For the %skeleton entry, mention that %language is better.
5353 (Bison Options): Likewise for --language and --skeleton. Move the
5354 --skeleton entry so that the `Tuning the parser' section is sorted
5355 alphabetically on long options.
5356 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
5357 %language directive in detail here; cross-reference the %language
5358 documentation instead.
5359 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
5360 `%require "2.3b"' so that the example is always up-to-date.
5361 (Table of Symbols): Add entries for %language and %skeleton.
5362 * examples/extexi (normalize): Instead of replacing every %require
5363 argument with the current Bison version, just substitute for
5364 `@value{VERSION}'. This guarantees that we're testing what actually
5365 appears in the documentation.
5366 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
5367 rather than `@VERSION@'.
5368
5369 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5370
5371 * NEWS: Reword the %language news a bit, and put it earlier.
5372
5373 * src/getargs.c (skeleton_arg): Last arg is now location const *.
5374 Rewrite to simplify the logic.
5375 (language_argmatch): Likewise.
5376 (program_name): We now own this var.
5377 * src/getargs.h (struct bison_language): Use char[] rather than
5378 const char *.
5379
5380 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
5381 Java is supported.
5382 * src/complain.c (program_name): Remove decl; no longer needed.
5383 * src/main.c (program_name): Remove; now belongs to getargs.
5384
5385 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
5386
5387 * NEWS: Document %language.
5388
5389 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
5390
5391 * data/c-skel.m4, data/c++-skel.m4: New files.
5392 * data/glr.c: Complain on push parsers.
5393
5394 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
5395 over %skeleton.
5396 (Decl Summary): Document %language and %skeleton.
5397 (Command line): Document -L.
5398
5399 * examples/extexi: Rewrite %require directive.
5400 * examples/calc++/Makefile.am: Pass VERSION to extexi.
5401
5402 * src/files.c (compute_exts_from_gc): Look in language structure
5403 for .y extension.
5404 (compute_file_name_parts): Check whether .tab should be added.
5405 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
5406 (language, skeleton_arg, language_argmatch): New.
5407 (long_options): Add --language.
5408 (getargs): Use skeleton_arg, add -L/--language.
5409 * src/getargs.h: Include location.h.
5410 (struct bison_language, language, skeleton_arg, language_argmatch): New.
5411 * src/output.c (prepare): Pick default skeleton from struct language.
5412 Don't dispatch C skeletons here.
5413 * src/parse-gram.y (PERCENT_LANGUAGE): New.
5414 (prologue_declaration): Add "%language" rule, use skeleton_arg.
5415 * src/scan-gram.l ("%language"): New rule.
5416
5417 * tests/calc.at: Test %skeleton and %language.
5418 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
5419 (AT_GLR_IF): Look for %skeleton "glr.cc".
5420 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
5421 (AT_YACC_IF): Reject %language.
5422
5423 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5424
5425 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
5426 since it wasn't used; only the typedef name 'semantic_type' is needed.
5427 Also, omit trailing white space.
5428
5429 * bootstrap: Sync from coreutils.
5430 (gnulib_extra_files): Add build-aux/announce.gen.
5431 (slurp): Adjust .gitignore files like .cvsignore files.
5432 * build-aux/announce-gen: Remove from CVS, since bootstrap
5433 now creates this.
5434
5435 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
5436
5437 Make %push-parser imply %pure-parser. This fixes several bugs; see
5438 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
5439 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
5440 pure_parser = true.
5441 * data/push.c: Don't bother testing b4_push_if when deciding whether
5442 to expand b4_declare_parser_variables globally.
5443 (yypush_parse): Likewise in here.
5444
5445 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
5446 (yy_reduce_print): Reformat M4 for readability.
5447
5448 2006-12-15 Bob Rossi <bob@brasko.net>
5449 and Joel Denny <jdenny@ces.clemson.edu>
5450
5451 * data/push.c (yypstate): Add typedef, and update all uses of
5452 struct yypstate to just yypstate.
5453 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
5454
5455 2006-12-14 Bob Rossi <bob@brasko.net>
5456
5457 * data/push.c (yypush_parse): Declare prototype regardless of
5458 %locations option.
5459
5460 2006-12-14 Bob Rossi <bob@brasko.net>
5461
5462 * data/push.c (yyparse): Remove the prototype and the #define when in
5463 push-parser mode.
5464
5465 2006-12-13 Bob Rossi <bob@brasko.net>
5466
5467 * data/push.c (yypstate_init): Rename to...
5468 (yypstate_new): ... this and use b4_c_function_def.
5469 (yypstate_delete): New.
5470 (yypush_parse): Change parameters yynval and yynlloc to be const.
5471 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
5472 yypstate_delete functions.
5473
5474 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
5475
5476 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
5477 strange test case titles. Reported by Bob Rossi.
5478
5479 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
5480
5481 * TODO: Add pointer to Sylvain Schmitz's work on static detection
5482 of potential ambiguities in GLR grammers.
5483
5484 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
5485
5486 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
5487 `bison ', use m4_index instead of m4_substr since chopping up a string
5488 containing M4-special characters causes problems here.
5489
5490 Fix a couple of bugs related to special characters in user-specified
5491 file names, and make it easier for skeletons to compute output file
5492 names with the same file name prefix as Bison-computed output file
5493 names.
5494 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
5495 b4_parser_file_name and b4_spec_defines_file instead of
5496 @output_parser_name@ and @output_header_name@, which are now redundant.
5497 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
5498 b4_parser_file_name, b4_spec_defines_file, and the new
5499 @basename(FILENAME@) instead of @output_parser_name@ and
5500 @output_header_name@, which inappropriately escaped the file names as
5501 C string literals.
5502 * src/files.c (all_but_ext): Remove static qualifier.
5503 (compute_output_file_names): Move `free (all_but_ext)' to...
5504 (output_file_names_free): ... here since all_but_ext is needed later.
5505 * src/files.h (all_but_ext): Extern.
5506 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
5507 exactly what MUSCLE_INSERT_STRING used to do.
5508 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
5509 characters are escaped properly.
5510 * src/output.c (prepare): Define muscle file_name_all_but_ext as
5511 all_but_ext.
5512 For pkgdatadir muscle, maintain previous functionality by using
5513 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
5514 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
5515 digraphs would never be expanded. Hopefully no one has M4-special
5516 characters in his Bison installation path.
5517 * src/scan-skel.l: Don't parse @output_header_name@ and
5518 @output_parser_name@ anymore since they're now redundant.
5519 In @output, use decode_at_digraphs.
5520 Parse a new @basename command that invokes last_component.
5521 (decode_at_digraphs): New.
5522 (BASE_QPUTS): Remove unused.
5523 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
5524 (Output file name): New tests.
5525
5526 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
5527
5528 Warn about output files that are generated by the skeletons and that
5529 conflict with other output files.
5530 * data/glr.c: Don't generate the header file here when glr.cc does.
5531 * src/files.c (file_names, file_names_count): New static globals.
5532 (compute_output_file_names): Invoke output_file_name_check for files
5533 not generated by the skeletons and remove existing checks.
5534 (output_file_name_check): New function that warns about conflicting
5535 output file names.
5536 (output_file_names_free): Free file_names.
5537 * src/files.h (output_file_name_check): Declare.
5538 * src/scan-skel.l: Invoke output_file_name_check for files generated by
5539 the skeletons.
5540 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
5541 (Conflicting output files): New tests.
5542
5543 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5544
5545 * doc/bison.texinfo: Fix a couple of typos.
5546
5547 2006-12-08 Bob Rossi <bob@brasko.net>
5548
5549 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
5550 Rename to...
5551 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
5552 update all uses.
5553 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
5554 (yypush_parse): Rename yypvars argument to yyps and remove redundant
5555 local pv.
5556 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
5557 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
5558
5559 2006-12-07 Bob Rossi <bob@brasko.net>
5560 and Joel Denny <jdenny@ces.clemson.edu>
5561
5562 * data/push.c (yypvarsinit): Change return type from void* to struct
5563 yypvars*. No longer cast to void* on return.
5564 (struct yypvars): Remove yylen since it need not be remembered between
5565 yypushparse invocations.
5566 (yypushparse): Don't copy between yylen and pv->yylen.
5567
5568 2006-12-05 Bob Rossi <bob@brasko.net>
5569
5570 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
5571 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
5572 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
5573 (struct yypvars): Remove b4_declare_parser_variables.
5574 (yypvarsinit): Remove init code for removed variables.
5575 (global scope): Do not declare b4_declare_parser_variables if
5576 push or pure mode.
5577 (yypushparse): Add b4_declare_parser_variables.
5578 Init new local variables, and remove init code for removed
5579 yypvars variables.
5580 (yyparse): Delete.
5581 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
5582 and yyparse for other modes.
5583 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
5584 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
5585 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
5586 (AT_PURE_LEX_IF): True if pure or push parser.
5587
5588 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
5589
5590 Document Yacc prologue alternatives and default %destructor's and
5591 %printer's as experimental. Don't mention Java yet. Discussed at
5592 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
5593 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
5594 (2.3a): Annotate this entry to say the old forms of these features were
5595 also experimental.
5596 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
5597 Table of Symbols): Say they're experimental. Comment out any mention
5598 of Java (we'll want this back eventually).
5599
5600 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
5601
5602 Support a file name argument to %defines. Deprecate `=' in
5603 %file-prefix, %name-prefix, and %output. Discussed at
5604 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
5605 * NEWS (2.3a+): Mention.
5606 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
5607 form of %defines, and remove `=' from entries for %file-prefix,
5608 %name-prefix, and %output.
5609 * src/parse-gram.y (prologue_declaration): Implement.
5610 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
5611 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
5612 all but one occurrence of %name-prefix.
5613 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
5614 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
5615 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
5616 occurrence of each of %file-prefix and %output. Add check for %defines
5617 with argument.
5618 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
5619 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
5620 Remove the `=' from %output.
5621
5622 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
5623
5624 Don't escape $ in test case titles since Autoconf 2.61 now does that
5625 correctly.
5626 * tests/actions.at (Default %printer and %destructor are not for error
5627 or $undefined): Here.
5628 (Default %printer and %destructor are not for $accept): Here.
5629 * tests/input.at (Invalid $n and @n): Here.
5630
5631 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
5632
5633 Rename <!> to <>. Discussed starting at
5634 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
5635 * NEWS (2.3a+): Update.
5636 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
5637 Update.
5638 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
5639 * src/scan-gram.l (INITIAL): Implement.
5640 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
5641 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
5642 comment.
5643 * tests/actions.at (Default tagless %printer and %destructor,
5644 Default tagged and per-type %printer and %destructor,
5645 Default %printer and %destructor are not for error or $undefined,
5646 Default %printer and %destructor are not for $accept,
5647 Default %printer and %destructor for mid-rule values): Update.
5648 * tests/input.at (Default %printer and %destructor redeclared,
5649 Unused values with default %destructor): Update.
5650
5651 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
5652
5653 Don't let %prec take a nonterminal.
5654 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
5655 token.
5656 * tests/input.at (%prec takes a token): New test checking that %prec
5657 won't take a nonterminal.
5658
5659 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5660
5661 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
5662 it was double-quoted.
5663 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
5664 grammar is maintained with Bison's highest standards.
5665 * src/getargs.c: Fix some typos in Doxygen comments.
5666
5667 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5668
5669 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
5670 later. Reported by Paul Eggert in
5671 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
5672 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
5673 * src/scan-code.l (translate_action): Don't bother invoking
5674 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
5675 (code_scanner_free): Instead of invoking
5676 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
5677 which frees more.
5678 * src/scan-gram.l (gram_scanner_free): Likewise.
5679 * src/scan-skel.l (scan_skel): Likewise.
5680
5681 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
5682
5683 * src/files.c (tr): Change return type to void.
5684 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
5685 has been called previously for the same key.
5686 (muscle_find): Return storage instead of value so that
5687 --enable-gcc-warnings doesn't produce warnings that the return discards
5688 const. aver that the value and storage are the same since storage
5689 could potentially be NULL when value is not.
5690 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
5691 same as 0.
5692
5693 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
5694
5695 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
5696 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
5697 us a slightly cleaner distribution, and also works.
5698 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
5699 gnulib changes.
5700
5701 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
5702 and Paul Eggert <eggert@cs.ucla.edu>
5703
5704 Don't let Bison leak memory except when it complains.
5705 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
5706 (spec_defines_file, dir_prefix): Now char *, not const char *,
5707 since they are freed.
5708 * src/files.c: Likewise.
5709 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
5710 Likewise.
5711 (tr): Now operates in-place. All uses changed.
5712 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
5713 values.
5714 (compute_file_name_parts, compute_output_file_names): Don't store
5715 read-only data in variables that will be freed.
5716 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
5717 src_extension, and header_extension.
5718 (output_file_names_free): New public function to free
5719 spec_verbose_file, spec_graph_file, spec_defines_file,
5720 parser_file_name, and dir_prefix.
5721 * src/getargs.c (getargs): Don't store read-only data in variables that
5722 will be freed.
5723 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
5724 (which previously existed but was unused), and quotearg_free.
5725 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
5726 * src/muscle_tab.c: Likewise.
5727 (muscle_entry): Make the value char const *,
5728 and add a new storage member that is char * and can be freed.
5729 (muscle_entry_free): New private function.
5730 (muscle_init): Use it instead of free.
5731 (muscle_insert, muscle_grow): Update and use new storage member.
5732 (muscle_code_grow): Free the string passed to muscle_grow
5733 since it's not needed anymore.
5734 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
5735 add a new `char *code' member.
5736 ("{...}"): Declare semantic type as code.
5737 * src/scan-code.h (translate_rule_action):
5738 (translate_symbol_action, translate_code, translate_action): Return
5739 `char const *' rather than `char *' since external code should not free
5740 these strings.
5741 * src/scan-code.l: Likewise.
5742 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
5743 which is "{...}" in the parser.
5744 * tests/Makefile.am (maintainer-check-valgrind): Set
5745 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
5746 Valgrind.
5747 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
5748 complain.
5749 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
5750 expecting a non-zero exit status sets --leak-check=summary and
5751 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
5752 this case, and we don't want to hear about it.
5753
5754 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
5755
5756 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
5757 instead of from the template, to simplify configuration a bit.
5758 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
5759 and m4/wint_t.m4, as they are needed with the latest gnulib.
5760
5761 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5762
5763 Disable unset/unused mid-rule value warnings by default, and recognize
5764 --warnings=midrule-values to enable them. Discussed starting at
5765 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
5766 * NEWS (2.3a+): Mention.
5767 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
5768 warnings): Add entry for midrule-values subargument.
5769 * src/reader.c (symbol_should_be_used): Don't return true just because
5770 the value is a set/used mid-rule value unless
5771 --warnings=midrule-values was specified.
5772 * tests/input.at (Unused values, Unused values before symbol
5773 declarations): Run tests with and without --warnings=midrule-values.
5774
5775 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
5776 than LIST_FREE directly.
5777
5778 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5779
5780 Finish implementing --warnings=error, which should not be implied by
5781 --warnings=all (or by its synonyms -W and --warnings without
5782 subarguments).
5783 * src/complain.c (set_warning_issued): New function to report that
5784 warnings are being treated as errors and to record an error if so.
5785 Invoke...
5786 (warn_at, warn): ... here.
5787 * src/getargs.c (warnings_args, warnings_types): Reorder so that
5788 "error - warnings are errors" does not appear above "all - all of the
5789 above".
5790 (getargs): For -W and --warnings without subarguments, don't let
5791 FLAGS_ARGMATCH set warnings_error in warnings_flag.
5792 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
5793
5794 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5795
5796 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
5797 empty subargument list. For example: `bison --warnings= parser.y'.
5798
5799 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5800
5801 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
5802 the parser header file so that gcc doesn't warn.
5803
5804 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5805
5806 Split the default %destructor/%printer into two kinds: <*> and <!>.
5807 Discussed starting at
5808 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
5809 * NEWS (2.3a+): Mention.
5810 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
5811 previous change today related to mid-rules.
5812 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
5813 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
5814 (TYPE_TAG_ANY): Add as <*>.
5815 (TYPE_TAG_NONE): Add as <!>.
5816 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
5817 for <*> and <!>.
5818 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
5819 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
5820 * src/symlist.c (symbol_list_default_new): Split into tagged and
5821 tagless versions.
5822 (symbol_list_destructor_set, symbol_list_printer_set): Split
5823 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
5824 SYMLIST_DEFAULT_TAGLESS.
5825 * src/symlist.h: Update symbol_list_default*_new prototypes.
5826 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
5827 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
5828 * src/symtab.c (default_destructor, default_destructor_location,
5829 default_printer, default_printer_location): Split each into tagged and
5830 tagless versions.
5831 (symbol_destructor_get, symbol_destructor_location_get,
5832 symbol_printer_get, symbol_printer_location_get): Implement tagged
5833 default and tagless default cases.
5834 (default_destructor_set, default_printer_set): Split each into tagged
5835 and tagless versions.
5836 * src/symtab.h: Update prototypes.
5837 * tests/actions.at (Default %printer and %destructor): Rename to...
5838 (Default tagless %printer and %destructor): ... this, and extend.
5839 (Per-type %printer and %destructor): Rename to...
5840 (Default tagged and per-type %printer and %destructor): ... this, and
5841 extend.
5842 (Default %printer and %destructor for user-defined end token): Extend.
5843 (Default %printer and %destructor are not for error or $undefined):
5844 Update.
5845 (Default %printer and %destructor are not for $accept): Update.
5846 (Default %printer and %destructor for mid-rule values): Extend.
5847 * tests/input.at (Default %printer and %destructor redeclared): Extend.
5848 (Unused values with default %destructor): Extend.
5849
5850 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5851
5852 Don't apply the default %destructor/%printer to an unreferenced midrule
5853 value. Mentioned at
5854 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
5855 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
5856 like $@n instead of just @n so that the default %destructor/%printer
5857 logic doesn't see them as user-defined symbols.
5858 (symbol_is_dummy): Check for both forms of the name.
5859 * src/reader.c (packgram): Remove the `$' from each midrule symbol
5860 name for which the midrule value is referenced in any action.
5861 * tests/actions.at (Default %printer and %destructor for mid-rule
5862 values): New test.
5863 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
5864 for change to dummy symbol names.
5865
5866 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
5867
5868 Warn about unset midrule $$ if the corresponding $n is used.
5869 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
5870 $n usage.
5871 (packgram): Before invoking grammar_rule_check on any rule, make sure
5872 all actions have already been scanned in order to set `used' flags.
5873 Otherwise, checking that a midrule's $$ is set will not always work
5874 properly because the midrule check must forward-reference the midrule's
5875 parent rule.
5876 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
5877 warning.
5878
5879 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
5880
5881 More improvements to the documentation of the prologue alternatives:
5882 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
5883 Bison manual.
5884 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
5885 some text to clarify the relative importance of the new directives and
5886 to show how these directives may be viewed as code labels.
5887
5888 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
5889
5890 Similar to the recently removed %before-header, add %code-top as the
5891 alternative to the pre-prologue. Mentioned at
5892 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
5893 Also, let the prologue alternatives appear in the grammar section.
5894 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
5895 (prologue_declaration): Move the existing prologue alternatives to...
5896 (grammar_declaration): ... here and add %code-top.
5897 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
5898
5899 Clean up and extend documentation for the prologue alternatives.
5900 * NEWS (2.3a+): Describe prologue alternatives.
5901 * doc/bison.texinfo (Prologue): Move discussion of prologue
5902 alternatives to...
5903 (Prologue Alternatives): ... this new section, and extend it to discuss
5904 all 4 directives in detail.
5905 (Table of Symbols): Clean up discussion of prologue alternatives and
5906 add %code-top.
5907
5908 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5909
5910 DJGPP specific issues.
5911
5912 * djgpp/config.bat: config.hin has been moved to lib. Adjust
5913 config.bat accordingly.
5914 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
5915 * djgpp/config.site: Likewise.
5916
5917 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
5918
5919 Replace %*-header with %provides, %requires, %code. See discussion at
5920 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
5921
5922 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
5923 (b4_user_start_header): Remove.
5924 * data/glr.c: Use new macros instead of b4_*start_header
5925 and b4_*end_header.
5926 * data/glr.cc: Likewise.
5927 * data/lalr1.cc: Likewise.
5928 * data/push.c: Likewise.
5929 * data/yacc.c: Likewise.
5930
5931 * doc/bison.texinfo: Remove %before-header, rename
5932 %{start,end,after}-header to %requires, %provides, %code.
5933
5934 * src/parse-gram.y: Likewise (also rename token names accordingly).
5935 * src/scan-gram.l: Likewise.
5936 * tests/actions.at: Likewise.
5937
5938 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
5939
5940 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
5941 Problem reported by Joel E. Denny.
5942
5943 2006-10-14 Jim Meyering <jim@meyering.net>
5944
5945 (Sync from coreutils.)
5946 Work also when the working directory (with e.g. coreutils sources)
5947 is version controlled with git, rather than CVS.
5948 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
5949 rather than CVS.
5950 In messages and comments, say e.g., "checked-out sources",
5951 rather than "CVS sources".
5952 (version_controlled_file): New function. Work for git as well as
5953 for CVS. Don't use grep's -q option.
5954 (slurp): Call it here, in place of CVS-specific code.
5955
5956 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
5957
5958 Fix testsuite for ./configure --enable-gcc-warnings:
5959 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
5960 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
5961 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
5962 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
5963 * test/regression.at (Diagnostic that expects two alternatives):
5964 Likewise.
5965
5966 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
5967
5968 * bootstrap.conf (gnulib_modules): Add config-h.
5969 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
5970 worry about HAVE_CONFIG_H.
5971 * lib/abitset.c: Likewise.
5972 * lib/bitset.c: Likewise.
5973 * lib/bitset_stats.c: Likewise.
5974 * lib/bitsetv-print.c: Likewise.
5975 * lib/bitsetv.c: Likewise.
5976 * lib/ebitset.c: Likewise.
5977 * lib/get-errno.c: Likewise.
5978 * lib/lbitset.c: Likewise.
5979 * lib/subpipe.c: Likewise.
5980 * lib/timevar.c: Likewise.
5981 * lib/vbitset.c: Likewise.
5982 * lib/bitset.c: Include "bitset.h" first, to test interface.
5983 * lib/bitset_stats.c: Include "bitset_stats.h" first.
5984 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
5985 * lib/bitsetv.c: Include "bitsetv.h" first.
5986 * lib/get-errno.c: Include "get-errno.h" first.
5987 * m4/.cvsignore: Add config-h.m4.
5988 * tests/actions.at (Default %printer and %destructor for ...):
5989 Adjust expected line numbers in output to reflect removal of #if
5990 HAVE_CONFIG_H lines.
5991 * tests/glr-regression.at (Missed %merge type warnings when ...):
5992 Likewise.
5993 * tests/regression.at (Braced code in declaration in rules section):
5994 Likewise.
5995 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
5996 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
5997 Include <config.h> unconditionally.
5998
5999 * bootstrap: Sync from coreutils, as follows:
6000
6001 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6002
6003 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
6004 variable was sometimes used without being initialized. This
6005 messed up the installation of the INSTALL file in some cases.
6006
6007 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6008
6009 * bootstrap (usage, main program, symlink_to_gnulib): Add option
6010 --copy. Inspired by a suggestion from Bruno Haible.
6011
6012 2006-10-03 Jim Meyering <jim@meyering.net>
6013
6014 * bootstrap: Undo last change to this file, since now gnulib-tool
6015 sticks with the automake default in generating dependencies.
6016
6017 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6018
6019 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
6020 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
6021
6022 * doc/bison.1: Add copyright notice.
6023
6024 * data/glr.c: Don't include <stdarg.h>; not used.
6025
6026 * NEWS: The -g and --graph options now output graphs in Graphviz
6027 DOT format, not VCG format.
6028 * doc/bison.1: Likewise.
6029 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
6030 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
6031 of this change in
6032 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
6033 * TODO: Remove Graphviz entry.
6034 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
6035 remove vcg.c, vcg.h, vcg_defaults.h.
6036 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
6037 * src/graphviz.c, src/graphviz.h: New files.
6038 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
6039 * src/files.h: Make comment more generic.
6040 * src/main.c (main): Likewise.
6041 * src/print_graph.h: Likewise.
6042 * src/getargs.c (usage): Make usage description more generic.
6043 * src/print_graph.c: Include graphviz.h rather than vcg.h.
6044 (static_graph, fgraph): Remove. All uses changed to pass
6045 arguments instead of sharing a static var.
6046 (print_core, print_actions, print_state, print_graph):
6047 Output graphviz format rather than VCG format.
6048 * tests/.cvsignore: Remove *.vcg; add *.dot.
6049 * tests/output.at: Expect *.dot files, not *.vcg files.
6050
6051 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
6052 accommodates the 2006-10-08 change.
6053
6054 2006-10-11 Bob Rossi <bob@brasko.net>
6055
6056 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
6057 (b4_yyssa, b4_yyerror_range): New macros.
6058 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
6059 (yypvarsinit): Remove init of removed fields.
6060 (yypushparse): Remove use of removed fields; use new macros instead.
6061
6062 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6063
6064 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
6065 in a push parser. Reindent slightly to match yacc.c better.
6066
6067 2006-10-11 Bob Rossi <bob@brasko.net>
6068
6069 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
6070 yymsg_alloc fields.
6071 (yypvarsinit, yypushparse): Remove init of removed fields.
6072 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
6073
6074 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6075
6076 * THANKS: Add Paolo Bonzini and Bob Rossi.
6077
6078 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
6079
6080 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
6081 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
6082 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
6083 b4_define_user_cde and uses): Remove.
6084 (b4_comment, b4_prefix, b4_sync_start): New.
6085 * data/bison.m4: New file, with most of the content removed from c.m4.
6086 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
6087 * src/output.c (output_skeleton): Pass bison.m4.
6088 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
6089 only if specified.
6090
6091 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
6092
6093 Fix test failure reported by Tom Lane in
6094 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
6095 and try to make such failures easier to catch in the future.
6096 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
6097 that's now the caller's responsibility.
6098 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
6099 Set yychar = YYEOF if it's negative.
6100 * tests/actions.at (yylex): Abort if asked to read past EOF.
6101 * tests/conflicts.at (yylex): Likewise.
6102 * tests/cxx-type.at (yylex): Likewise.
6103 * tests/glr-regression.at (yylex): Likewise.
6104 * tests/input.at (yylex): Likewise.
6105 * tests/regression.at (yylex): Likewise.
6106 * tests/torture.at (yylex): Likewise.
6107
6108 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
6109
6110 Fix problems with translating English-language diagnostics.
6111 * bootstrap: Fix bug introduced in recent bootstrap changes, with
6112 respect to bison-runtime pot generation. The YY_ stuff
6113 wasn't being captured.
6114 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
6115 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
6116 * runtime-po/POTFILES.in: Add data/push.c.
6117
6118 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
6119
6120 Merge bootstrap changes from coreutils.
6121
6122 2006-09-28 Jim Meyering <jim@meyering.net>
6123
6124 Automatically generated dependencies are important even
6125 when all of the sources in a directory come from gnulib.
6126 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
6127 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
6128
6129 2006-09-23 Jim Meyering <jim@meyering.net>
6130
6131 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
6132
6133 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6134
6135 * bootstrap: Add support for --force.
6136 (usage): New function. Describe usage less tersely.
6137 (CVS_only_file): New var.
6138
6139 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
6140
6141 * data/push.c (YYPUSH_MORE): Make it an enum instead.
6142 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
6143 Adjust white space and comments to match GNU style better.
6144
6145 2006-09-20 Bob Rossi <bob@brasko.net>
6146
6147 * data/push.c (yyresult_get): Remove function.
6148 (YYPUSH_MORE): Add #define.
6149 (yypushparse): Modify return value.
6150
6151 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6152
6153 * stamp-h.in: Remove; no longer needed.
6154 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
6155 Remove config.h, config.hin, intl (no longer created).
6156 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
6157 stamp-h1.
6158
6159 Sync bootstrap from coreutils, as follows:
6160
6161 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
6162
6163 * bootstrap (symlink_to_gnulib): New function.
6164 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
6165 to copies-of-gnulib.
6166 (cp_mark_as_generated, slurp, gnulib_files):
6167 Avoid making a copy if it's the same as the old version.
6168 (gnulib_files): Add support for this variable (used by Bison).
6169
6170 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6171
6172 * src/getargs.c (usage): Rework to use conventions similar to
6173 coreutils, to make translation a bit easier and the code a bit
6174 smaller. Problem reported by Tim Van Holder.
6175
6176 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
6177
6178 Use some of gnulib's new modules, taken from coreutils.
6179
6180 * bootstrap: Sync from coreutils, except add support for gnulib_files.
6181 * bootstrap.conf: New file.
6182 (gnulib_modules): Add configmake, inttypes, unistd.
6183 (XGETTEXT_OPTIONS): Add complain, complain_at,
6184 fatal, fatal_at, warn, warn_at, unexpected_end.
6185 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
6186 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
6187 (gl_EARLY): Add.
6188 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
6189 (gl_INIT): Add
6190 (GNULIB_AUTOCONF_SNIPPET): Remove.
6191 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
6192 the pickiest.
6193 * lib/.cvsignore: Add inttypes_.h.
6194 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
6195 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
6196 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
6197 no-longer-necessary initializations.
6198 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
6199 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
6200 use the unistd module.
6201 * src/system.h: Likewise.
6202 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
6203 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
6204 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
6205 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
6206 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
6207 * src/system.h: Include inttypes.h unconditionally, now that we
6208 use the inttypes module. Don't bother to include stdint.h, since
6209 inttypes.h now does that for us.
6210 (LOCALEDIR): Remove, now that we use the configmake module.
6211 * src/getargs.c: Include configmake.h.
6212 * src/main.c: Likewise.
6213 * src/output.c: Likewise.
6214 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
6215 not from $abs_top_builddir, since config.h moved.
6216
6217
6218 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
6219 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
6220
6221 * src/parse-gram.y (symbol_declaration): Don't put statements
6222 before declarations; it's not portable to C89.
6223 * src/scan-code.l (handle_action_at): Likewise.
6224
6225 * src/scan-code.l: Always initialize braces_level; the old code
6226 left it uninitialized and therefore had undefined behavior.
6227
6228 Don't attempt to redefine 'assert', since it runs afoul of
6229 systems where standard headers (mistakenly) include <assert.h>.
6230 Instead, define and use our own alternative, called 'aver'.
6231 * src/reader.c: Don't include assert.h, since we no longer
6232 use assert.
6233 * src/scan-code.l: Likewise.
6234 * src/system.h (assert): Remove, replacing with....
6235 (aver): New function, taking a bool arg. All uses changed.
6236 * src/tables.c (pack_vector): Ensure that aver arg is bool,
6237 not merely an integer.
6238
6239 2006-09-15 Bob Rossi <bob@brasko.net>
6240
6241 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
6242 * data/c.m4 (YYPUSH): New.
6243 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
6244 * src/getargs.c (push_parser): New var.
6245 * src/getargs.h (push_parser): New declaration.
6246 * src/output.c (prepare): Add macro insertion of `push_flag'.
6247 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
6248 (prologue_declaration): Parse %push-parser.
6249 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
6250 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
6251 list of removed lines from the traces observed.
6252 (AT_CHECK_CALC_LALR): Added push parser tests.
6253
6254 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
6255
6256 * NEWS: Version 2.3a.
6257 * configure.ac (AC_INIT): Likewise.
6258
6259 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
6260 "#define YYSTYPE int" that caused "make maintainer-check" to fail
6261 due to header ordering dependencies. I don't know why the #define
6262 was there.
6263
6264 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
6265 runtime cost when YYDEBUG is not defined, and so that some tests
6266 that used to fail now work. Problem and initial suggestion by
6267 Paolo Bonzini.
6268 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
6269 * data/glr.cc (b4_parser_class_name):
6270 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
6271 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
6272 (yydebug_) [YYDEBUG]: New member.
6273 (yycdebug_): Now defined only if YYDEBUG.
6274 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
6275 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
6276 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
6277 if YYYDEBUG.
6278 (debug_stream, set_debug_stream, debug_level, set_debug_level):
6279 Define only if YYDEBUG.
6280 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
6281 set_debug_level.
6282 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
6283 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
6284 AT_CHECK_CALC_GLR_CC that are working now.
6285
6286 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
6287
6288 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
6289 We don't need them in glr.cc, and glr.c defines them.
6290 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
6291 assumes that defining it to anything is the same as defining
6292 it to 1. Problem reported by Paolo Bonzini.
6293
6294 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
6295
6296 * data/c.m4 (b4_null, b4_case): Define.
6297 * src/output.c (prepare_symbols): Use b4_null.
6298 (user_actions_output): Use b4_case.
6299
6300 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
6301
6302 * data/glr.c (b4_shared_declarations): Put start-header first,
6303 before any #includes that we generate, so that feature-test
6304 macros work. Problem reported by Michael Deutschmann in
6305 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
6306 * data/lalr1.cc: Likewise.
6307 * doc/bison.texinfo (Prologue): Document that feature-test macros
6308 should be defined before any Bison declarations.
6309 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
6310 that depend on location.hh after, not before, Bison decls, since
6311 we now include location.hh after the first user prologue.
6312
6313 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
6314 Sander Brandenburg in
6315 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
6316 Also, fix minor white space and comment issues.
6317 (Prologue): Mention that it's better to define feature-test macros
6318 before Bison declarations. Problem reported by Michael Deutschmann.
6319
6320 * README-cvs: Fix typo: "&" should be "&&". Problem reported
6321 by Jim Meyering.
6322 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
6323 This adjusts to recent gnulib changes.
6324
6325 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
6326
6327 Finish implementation of per-type %destructor/%printer. Discussed
6328 starting at
6329 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
6330 and
6331 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
6332 * NEWS (2.3+): Add a description of this feature to the default
6333 %destructor/%printer description.
6334 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
6335 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
6336 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
6337 list node contains a semantic type.
6338 * src/symtab.c, src/symtab.h: Extend with a table that associates
6339 semantic types with their %destructor's and %printer's.
6340 (semantic_type_from_uniqstr, semantic_type_get,
6341 semantic_type_destructor_set, semantic_type_printer_set): New functions
6342 composing the public interface of that table.
6343 (symbol_destructor_get, symbol_destructor_location_get,
6344 symbol_printer_get, symbol_printer_location_get): If there's no
6345 per-symbol %destructor/%printer, look up the per-type before trying
6346 the default.
6347 * tests/actions.at (Per-type %printer and %destructor): New test case.
6348 * tests/input.at (Default %printer and %destructor redeclared):
6349 Extend to check that multiple occurrences of %symbol-default in a
6350 single %destructor/%printer declaration is an error.
6351 (Per-type %printer and %destructor redeclared, Unused values with
6352 per-type %destructor): New test cases.
6353
6354 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
6355
6356 Require default %destructor/%printer to be declared using
6357 %symbol-default instead of an empty symbol list, and start working on
6358 new per-type %destructor/%printer. Discussed at
6359 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
6360 * NEWS (2.3+): Add %symbol-default to example.
6361 * bison.texinfo (Freeing Discarded Symbols): Likewise.
6362 (Table of Symbols): Add entry for %symbol-default.
6363 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
6364 (generic_symlist, generic_symlist_item): New nonterminals for creating
6365 a list in which each item is a symbol, semantic type, or
6366 %symbol-default.
6367 (grammar_declaration): Use generic_symlist in %destructor and %printer
6368 declarations instead of symbols.1 or an empty list.
6369 (symbol_declaration, precedence_declaration, symbols.1): Update actions
6370 for changes to symbol_list.
6371 * src/reader.c: Update for changes to symbol_list.
6372 * src/scan-code.l: Likewise.
6373 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
6374 * src/symlist.c, src/symlist.h: Extend such that a list node may
6375 represent a semantic type or a %symbol-default in addition to just an
6376 ordinary symbol. Add switched functions for setting %destructor's and
6377 %printer's.
6378 * tests/actions.at, tests/input.at: Add %symbol-default to all default
6379 %destructor/%printer declarations.
6380
6381 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
6382
6383 Whether the default %destructor/%printer applies to a particular symbol
6384 isn't a question of whether the user *declares* that symbol (in %token,
6385 for example). It's a question of whether the user by any means
6386 *defines* the symbol at all (by simply using a char token, for
6387 example). $end is defined by Bison whereas any other token with token
6388 number 0 is defined by the user. The error token is always defined by
6389 Bison regardless of whether the user declares it with %token, but we
6390 may one day let the user define error as a nonterminal instead.
6391 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
6392 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
6393 the meaning of "user-defined".
6394 * tests/actions.at (Default %printer and %destructor for user-declared
6395 end token): Rename to...
6396 (Default %printer and %destructor for user-defined end token): ...
6397 this.
6398
6399 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
6400 computation of whether to apply the default, don't maintain a list of
6401 every Bison-defined symbol. Instead, just check for a first character
6402 of '$', which a user symbol cannot have, and check for the error token.
6403
6404 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
6405
6406 Don't apply the default %destructor or %printer to the error token,
6407 $undefined, or $accept. This change fits the general rule that the
6408 default %destructor and %printer are only for user-declared symbols,
6409 and it solves several difficulties that are described in the new test
6410 cases listed below.
6411 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
6412 * tests/actions.at (Default %printer and %destructor are not for error
6413 or $undefined, Default %printer and %destructor are not for $accept):
6414 New test cases.
6415
6416 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
6417
6418 Allow %start after the first rule.
6419 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
6420 when parsing the first rule.
6421 (check_and_convert_grammar): Search for it here after all grammar
6422 declarations have been parsed. Skip midrules, which have dummy LHS
6423 nonterminals.
6424 * src/symtab.c (symbol_is_dummy): New function.
6425 * src/symtab.h (symbol_is_dummy): Declare it.
6426 * tests/input.at (%start after first rule): New test.
6427
6428 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
6429
6430 Redo some of the previous commit: add back the ability to use
6431 non-aliased/undeclared string literals since it might be useful to
6432 those declaring %token-table.
6433 * src/reader.c (check_and_convert_grammar): Undo changes in previous
6434 commit: don't worry about complaints from symbols_pack.
6435 * src/symtab.c (symbol_new, symbol_class_set,
6436 symbol_check_alias_consistency): Undo changes in previous commit: count
6437 each string literal as a new symbol and token, assign it a symbol
6438 number, and don't complain about non-aliased string literals.
6439 (symbols_pack): Since symbol_make_alias still does not decrement symbol
6440 and token counts but does still set aliased tokens to the same number,
6441 symbol_pack_processor now leaves empty slots in the symbols array.
6442 Remove those slots.
6443 * tests/regression.at (Undeclared string literal): Remove test case
6444 added in previous commit since non-aliased string literals are allowed
6445 again.
6446 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
6447 remove unnecessary string literal declarations.
6448 * tests/sets.at (Firsts): Likewise.
6449
6450 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
6451
6452 Don't allow an undeclared string literal, but allow a string literal to
6453 be used before its declaration.
6454 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
6455 symbols_pack complained.
6456 * src/symtab.c (symbol_new): Don't count a string literal as a new
6457 symbol.
6458 (symbol_class_set): Don't count a string literal as a new token, and
6459 don't assign it a symbol number since symbol_make_alias does that.
6460 (symbol_make_alias): It's not necessary to decrement the symbol and
6461 token counts anymore. Don't assume that an alias declaration occurs
6462 before any uses of the identifier or string, and thus don't assert that
6463 one of them has the highest symbol number so far.
6464 (symbol_check_alias_consistency): Complain if there's a string literal
6465 that wasn't declared as an alias.
6466 (symbols_pack): Bail if symbol_check_alias_consistency failed since
6467 symbol_pack asserts that every token has been assigned a symbol number
6468 although undeclared string literals have not.
6469 * tests/regression.at (String alias declared after use, Undeclared
6470 string literal): New test cases.
6471 (Characters Escapes, Web2c Actions): Declare string literals as
6472 aliases.
6473 * tests/sets.at (Firsts): Likewise.
6474
6475 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
6476
6477 In the grammar scanner, STRING_FINISH unclosed constructs and return
6478 them to the parser in order to improve error messages.
6479 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
6480 SC_BRACED_CODE, SC_PROLOGUE): Implement.
6481 * tests/input.at (Unclosed constructs): New test case.
6482 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
6483 seen.
6484
6485 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
6486 unused global.
6487
6488 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
6489
6490 Handle string aliases for character tokens correctly.
6491 * src/symtab.c (symbol_user_token_number_set): If the token has an
6492 alias, check and set its alias's user token number instead of its own,
6493 which is set to indicate the alias. Previously, every occurrence of
6494 the character token in the grammar overwrote that alias indicator with
6495 the character code.
6496 * tests/input.at (String aliases for character tokens): New test.
6497
6498 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
6499
6500 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
6501
6502 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
6503
6504 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
6505 to prevent failures when building on older platforms.
6506 Check for autopoint failure.
6507 Set XGETTEXT_OPTIONS to values that check for C format strings,
6508 so that translators are warned about them (this also helps
6509 prevent core dumps).
6510
6511 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
6512 function, since it simplifies our code a bit.
6513
6514 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
6515 rather than -W, so we don't get bogus warnings about sign comparisons.
6516 Add -Wpointer-arith, since that warning is useful (it reports code
6517 that does not conform to C89 and that some compilers reject).
6518 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
6519 since it's no longer needed.
6520
6521 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
6522
6523 Clean up scanners a bit.
6524 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
6525 definitions so gcc won't warn when obstack_for_string is unused.
6526 * src/scan-code.l: config.h and system.h are already #include'd by
6527 scan-code-c.c, so get rid of them here.
6528 * src/scan-gram.l: Likewise.
6529 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
6530 definitions rather than duplicating the rest of it.
6531 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
6532
6533 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
6534
6535 Suppress signed/unsigned comparison warnings for yycheck.
6536 * data/c.m4 (b4_safest_int_type): New macro.
6537 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
6538 a signed int type, cast it to b4_safest_int_type first.
6539 * data/yacc.c: Likewise.
6540 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
6541 also overwritten.
6542
6543 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
6544
6545 * doc/bison.texinfo: Fix some typos.
6546
6547 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
6548
6549 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
6550 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
6551
6552 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
6553 the latest gnulib does this a different way.
6554 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
6555 translation was patched, so stop omitting it.
6556
6557 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
6558
6559 Enable declaration of default %printer/%destructor. Make the parser
6560 use these for all user-declared grammar symbols for which the user does
6561 not declare a specific %printer/%destructor. Thus, the parser uses it
6562 for token 0 if the user declares it but not if Bison generates it as
6563 $end. Discussed starting at
6564 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
6565 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
6566 and
6567 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
6568 * NEWS (2.3+): Mention.
6569 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
6570 declare a %destructor for a mid-rule's semantic value. It's just
6571 impossible to declare one specific to it.
6572 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
6573 code. Describe default %destructor form.
6574 * src/parse-gram.y (grammar_declaration): Parse default
6575 %printer/%destructor declarations.
6576 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
6577 and symbol_destructor_location_get rather than accessing the destructor
6578 and destructor_location members of struct symbol.
6579 (symbol_printers_output): Likewise but for %printer's.
6580 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
6581 again.
6582 * src/symtab.c (default_destructor, default_destructor_location,
6583 default_printer, default_printer_location): New static global
6584 variables to record the default %destructor and %printer.
6585 (symbol_destructor_get, symbol_destructor_location_get,
6586 symbol_printer_get, symbol_printer_location_get): New functions to
6587 compute the appropriate %destructor and %printer for a symbol.
6588 (default_destructor_set, default_printer_set): New functions to set the
6589 default %destructor and %printer.
6590 * src/symtab.h: Prototype all those new functions.
6591 * tests/actions.at (Default %printer and %destructor): New test to
6592 check that the right %printer and %destructor are called, that they're
6593 not called for $end, and that $$ and @$ work correctly.
6594 (Default %printer and %destructor for user-declared end token): New
6595 test to check that the default %printer and %destructor are called for
6596 a user-declared end token.
6597 * tests/input.at (Default %printer and %destructor redeclared, Unused
6598 values with default %destructor): New tests to check related grammar
6599 warnings and errors.
6600
6601 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
6602
6603 Clean up handling of %destructor for the end token (token 0).
6604 Discussed starting at
6605 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
6606 and
6607 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
6608
6609 Make the skeletons consistent in how they pop the end token and invoke
6610 its %destructor.
6611 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
6612 state, which has token number 0, since this would invoke the
6613 %destructor for the end token.
6614 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
6615 until after shifting the end token, or else it won't be popped.
6616 * data/yacc.c (yyparse): Likewise.
6617
6618 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
6619 it's the end token. Upon termination, destroy an unshifted lookahead
6620 even when it's the end token.
6621 * data/lalr1.cc (yy::parser::parse): Likewise.
6622 * data/yacc.c (yyparse): Likewise.
6623
6624 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
6625 value warnings for the end token when the user gives the end token a
6626 %destructor.
6627
6628 * tests/actions.at (Printers and Destructors): Test all the above.
6629
6630 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
6631
6632 Update to latest gnulib and gettext versions.
6633 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
6634 Add fopen-safer.
6635 (gnulib_files): Add m4/warning.m4. Don't worry about files
6636 overwritten by autopoint.
6637 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
6638 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
6639 rejects them.
6640 Don't use autoreconf; instead, invoke autopoint etc. by hand,
6641 so that we can remove the intl files at a better time.
6642 (intl_files_to_remove): Remove aclocal.m4, since it gets
6643 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
6644 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
6645 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
6646 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
6647 Remove datarootdir hack; no longer needed.
6648 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
6649 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
6650 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
6651 strdup.h.
6652 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
6653 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
6654
6655 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
6656
6657 * bootstrap: Adjust to today's change to gnulib-tool by invoking
6658 it with --assume-autoconf='latest-stable'.
6659
6660 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
6661
6662 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
6663 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
6664 YYSTYPE' and `{'.
6665 * src/muscle_tab.h (muscle_grow): Replace the header comments with
6666 those from muscle_tab.c since the old ones are misleading.
6667
6668 2006-07-13 Akim Demaille <akim@epita.fr>
6669
6670 Support %define "KEY" {VALUE}.
6671 * src/scan-code.h, src/scan-code.l (translate_action)
6672 (translate_rule_action, translate_symbol_action, translate_code):
6673 Return char *, not const char *.
6674 * src/parse-gram.y (declaration): Rename as...
6675 (prologue_declaration): this.
6676 (string_content): Remove this nonterminal, use STRING.
6677 (braceless, content, content.opt): New nonterminal.
6678 Use them.
6679 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
6680 as value.
6681 * src/scan-gram.l (getargs.h): Don't include it.
6682
6683 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
6684
6685 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
6686 rather than a for-loop that declares a local bool variable. This
6687 should work around a compatibility problem with a Cray x1e C++
6688 compiler reported by Hung Nguyen in
6689 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
6690 The for-loop was introduced in the 2004-11-17 change but I don't
6691 know why it was needed.
6692
6693 2006-07-12 Akim Demaille <akim@epita.fr>
6694
6695 * data/c.m4: Comment changes.
6696
6697 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
6698
6699 * src/complain.c (error_message, ERROR_MESSAGE): New.
6700 To factor...
6701 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
6702 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
6703
6704 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
6705
6706 * NEWS: Instead of %union, you can define and use your own union type
6707 YYSTYPE if your grammar contains at least one <type> tag.
6708 Your YYSTYPE need not be a macro; it can be a typedef.
6709 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
6710 (Union Decl, Decl Summary): Document this.
6711 * data/glr.c (YYSTYPE): Implement this.
6712 * data/glr.cc (YYSTYPE): Likewise.
6713 * data/lalr1.cc (YYSTYPE): Likewise.
6714 * data/yacc.c (YYSTYPE): Likewise.
6715 * src/output.c (prepare): Output tag_seen_flag.
6716 * src/parse-gram.y (declaration, grammar_declaration):
6717 Use 'union_seen' rather than 'typed' to determine whether
6718 %union has been seen, since grammars can now be typed without
6719 %union.
6720 (symbol_declaration, type.opt, symbol_def):
6721 Keep track of whether a tag has been seen.
6722 * src/reader.c (union_seen, tag_seen): New vars.
6723 (typed): remove.
6724 * src/reader.h (union_seen, tag_seen, typed): Likewise.
6725 * src/scan-code.l (untyped_var_seen): New variable.
6726 (handle_action_dollar): Adjust to above changes.
6727 (handle_action_dollar, handle_action_at):
6728 Improve overflow checking for outlandish numbers.
6729 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
6730 avoid new diagnostics generated by above changes.
6731 * tests/regression.at (YYSTYPE typedef): Add test to check
6732 for type tags without %union.
6733
6734 * src/symlist.c (symbol_list_length): Return int, not unsigned
6735 int, since callers expect int. This may need to get revisited
6736 once we have proper integer overflow checking.
6737
6738 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
6739 object is now static.
6740
6741 * src/getargs.c (flags_argmatch): Return void, not int,
6742 to pacify ./configure --enable-gcc-warnings.
6743
6744 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
6745 since last_string is already defined to FLEX_PREFIX (last_string).
6746
6747 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
6748
6749 Implement --warnings/-W.
6750 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
6751 replaced by...
6752 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
6753 Adjust callers.
6754 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
6755 (warnings_args, warnings_types): New.
6756 (getargs, short_options, long_options): Accept -W/--warnings.
6757 Sort the options by alphabetical order, upper case letter right
6758 before its lower case.
6759
6760 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
6761
6762 Change %merge result type clash warnings to errors. Discussed at
6763 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
6764 * src/reader.c (record_merge_function_type): Use complain_at.
6765 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6766 declared later): Update test case results.
6767
6768 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
6769
6770 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
6771 to be in alphabetical order.
6772 (trace_args): Spelling fixes.
6773
6774 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
6775
6776 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
6777 so they don't collide with user-defined macros.
6778 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
6779 this was never guaranteed, and now that we're using gnulib stdint,
6780 which defines int_fast16_t to long int, the problem is exposed.
6781
6782 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
6783
6784 * data/c.m4 (b4_basename): Simplify a bit, since we don't
6785 need the full POSIX semantics (and weren't implementing them
6786 anyway).
6787
6788 Adjust to Autoconf 2.60 and today's gnulib.
6789 * bootstrap (gnulib_modules): Add stdint.
6790 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
6791 no longer copies it.
6792 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
6793 since stdint needs the former and wcwidth (which is now required
6794 by mbswidth) needs the latter.
6795 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
6796 work around a compatibility glitch between gettext 0.14.6 and
6797 Autoconf 2.60.
6798 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
6799 Do not check for uintptr_t, since new stdint module does the right
6800 thing.
6801 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
6802 Add stdint.h, stdint_.h, wcwidth.h.
6803 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
6804 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
6805 stdint.m4, wchar_t.m4, wcwidth.m4.
6806 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
6807 usual order for ../lib/*.h files.
6808 (file_name_split): Use last_component, not base_name, to adjust
6809 to gnulib changes.
6810 * src/parse-gram.h: Include <strverscmp.h> in the usual order
6811 for ../lib/*.h files.
6812 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
6813 Define unconditionally, since we now assume the stdint module.
6814 * src/scan-skel.l: Include <dirname.h>.
6815 (BASE_QPUTS): Use last_component, not base_name.
6816 * src/system.h: Include <unlocked-io.h> in the usual order
6817 for ../lib/*.h files. Include <stdint.h> unconditionally,
6818 since we now use the stdint module.
6819 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
6820 HAVE_UINTPTR_T, since we now use the stdint module.
6821 (base_name): Remove decl, since files now include <dirname.h>
6822 to get the decl.
6823
6824 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
6825
6826 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
6827 New, default to 1.
6828 * data/yacc.c, data/glr.c, data/location.cc: Use them.
6829 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
6830 default.
6831 * tests/calc.at: Adjust.
6832
6833 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
6834
6835 * data/c.m4 (b4_basename): New.
6836 (b4_syncline): Also output the location of its invocation (from
6837 the skeleton).
6838 (b4_user_action, b4_define_user_action, b4_user_actions)
6839 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
6840 (b4_user_stype): New.
6841 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
6842
6843 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
6844
6845 In the grammar file, the first column is 1 not 0 on the first line as
6846 on every other line.
6847 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
6848 * tests/input.at (Torturing the Scanner): Update output.
6849
6850 * src/scan-gram.l (scanner_cursor): Declare it static.
6851
6852 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
6853
6854 In warnings, say "previous declaration" rather than "first
6855 declaration".
6856 * src/symtab.c (redeclaration): Do that here.
6857 * src/reader.c (record_merge_function_type): In the case of a result
6858 type clash, report the previous declaration rather than the very first
6859 one in the grammar file.
6860 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6861 declared later): Add a third declaration to check this behavior.
6862 * tests/input.at (Incompatible Aliases): Update output.
6863
6864 2006-06-27 Akim Demaille <akim@epita.fr>
6865
6866 * doc/Doxyfile.in: New.
6867 * doc/Makefile.am: Use it.
6868 * src/lalr.h, src/symtab.h: Initial doxygenation.
6869
6870 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6871
6872 Don't miss %merge result type warnings just because the LHS types are
6873 declared after the %merge. This continues the effort of the previous
6874 patch.
6875 * src/reader.c (get_merge_function): Don't set the merger type yet.
6876 (record_merge_function_type): New function for setting the merger type
6877 and checking for clashes.
6878 (grammar_current_rule_merge_set): Set the location of the %merge for
6879 the current rule.
6880 (packgram): Invoke record_merge_function_type for each rule now that
6881 all symbol type declarations have been parsed.
6882 * src/reader.h (merger_list.type_declaration_location): New member
6883 storing the location of the first %merge from which the type for this
6884 merging function was derived.
6885 * src/symlist.h (symbol_list.merger_declaration_location): New member
6886 storing the location of a rule's %merge, if any.
6887 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6888 declared later): New test to catch the error fixed by the above patch.
6889
6890 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6891
6892 Get action warnings (grammar_rule_check) right even when symbol
6893 declarations appear after the rules. Discussed at
6894 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
6895 and
6896 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
6897 Don't mistake the type of $$ in a midrule to be that of its parent
6898 rule's $$.
6899 * src/reader.c (grammar_current_rule_end): Don't invoke
6900 grammar_rule_check yet since not all symbol declarations may have been
6901 parsed yet.
6902 (grammar_midrule_action): Likewise.
6903 Don't record whether the midrule's $$ has been used yet since actions
6904 haven't been translated yet.
6905 Record the midrule's parent rule and its RHS index within the parent
6906 rule.
6907 (grammar_current_rule_action_append): Don't translate the action yet
6908 since not all symbol declarations may have been parsed yet and, thus,
6909 warnings about types for $$, $n, @$, and @n can't be reported yet.
6910 (packgram): Translate the action and invoke grammar_rule_check now that
6911 all symbol declarations have been parsed.
6912 * src/scan-code.l (handle_action_dollar): Now that this is invoked
6913 after parsing the entire grammar file, the symbol list here in the case
6914 of a midrule is actually the midrule's empty RHS, so reference its
6915 parent rule's RHS where necessary.
6916 On the other hand, now that you can already know it's a midrule, you
6917 aren't forced to think $$ has the same type as its parent rule's $$.
6918 (handle_action_at): In the case of a midrule, reference the parent rule
6919 where necessary.
6920 * src/symlist.c (symbol_list_new): Initialize new midrule-related
6921 members.
6922 (symbol_list_length): Now that this is invoked after all rules have
6923 been parsed, a NULL symbol (rather than a NULL symbol list node)
6924 terminates a rule. symbol_list_print already does this correctly.
6925 * src/symlist.h (symbol_list.midrule_parent_rule,
6926 symbol_list.midrule_parent_rhs_index): New members so that midrules can
6927 remember their relationships with their parents.
6928 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
6929 fixed by the above patch.
6930 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
6931 implementing...
6932 (Unused values): ... this old test case and...
6933 (Unused values before symbol declarations): ... this new test case.
6934 This one is the same as `Unused values' except that all symbol
6935 declarations appear after the rules in order to catch the rest of the
6936 errors fixed by the above patch.
6937
6938 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6939
6940 More cleanup.
6941 * src/reader.c (current_rule): Declare it static since it's no longer
6942 used outside this file.
6943 (grammar_current_rule_action_append): Remove redundant arguments from
6944 translate_rule_action invocation.
6945 * src/reader.h (current_rule): Remove this unused extern.
6946 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
6947 * src/scan-code.l (translate_rule_action): Likewise.
6948
6949 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
6950
6951 Clean up yesterday's patch.
6952 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
6953 to...
6954 * src/reader.c (grammar_current_rule_action_append): ... here for
6955 consistency with grammar_current_rule_symbol_append.
6956 * tests/regression.at (Braced code in declaration in rules section):
6957 Make yyerror and yylex static as usual.
6958
6959 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
6960
6961 Fix bug that mistakes braced code in a declaration in the rules section
6962 to be a rule action. Mentioned at
6963 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
6964 * src/scan-gram.l: Move midrule action detection from the start of the
6965 scanning of any braced code to...
6966 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
6967 action. For readability, use $2 and @2 rather than the equivalent
6968 global variables.
6969 * tests/regression.at (Braced code in declaration in rules section):
6970 New test to catch the error fixed by the above patch.
6971
6972 Work on code readability some.
6973 * src/scan-code.l (current_rule): Get rid of this misleading and
6974 redundant declaration: it's actually extern'ed in reader.h.
6975 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
6976 translate_action): Add a rule argument and use it instead of the global
6977 current_rule.
6978 (translate_rule_action): This already receives current_rule through an
6979 argument, so pass it on to translate_action instead of assigning
6980 current_rule to current_rule.
6981 (translate_symbol_action, translate_code): Pass rule = NULL to
6982 translate_action.
6983
6984 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
6985
6986 Rename %before-definitions to %start-header and %after-definitions to
6987 %end-header. Don't use these declarations to separate pre-prologue
6988 blocks from post-prologue blocks. Add new order-independent
6989 declarations %before-header and %after-header as alternatives to the
6990 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
6991 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
6992 * NEWS (2.3+): Update for these changes.
6993 * data/glr.c (b4_before_definitions): Update to...
6994 (b4_start_header): ... this.
6995 (b4_after_definitions): Update to...
6996 (b4_end_header): ... this.
6997 * data/glr.cc: Likewise.
6998 * data/lalr1.cc: Likewise.
6999 * data/yacc.c: Likewise.
7000 * doc/bison.texinfo (The prologue): Update names, and replace remaining
7001 prologue blocks with %*-header declarations.
7002 (Calc++ Parser): Likewise.
7003 (Decl Summary): Update names.
7004 (Table of Symbols): Update description.
7005 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
7006 (PERCENT_END_HEADER): ... this.
7007 (PERCENT_BEFORE_DEFINITIONS): Update to...
7008 (PERCENT_START_HEADER): ... this.
7009 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7010 (declaration): Update token names and m4 macro names.
7011 When parsing %end-header and %start-header, invoke translate_code
7012 before muscle_code_grow, and no longer set global booleans to remember
7013 whether these declarations have been seen.
7014 Parse new %after-header and %before-header.
7015 * src/reader.c (before_definitions, after_definitions): Remove.
7016 (prologue_augment): Accept a new bool argument to specify whether to
7017 augment the pre-prologue or post-prologue.
7018 * src/reader.h (before_definitions, after_definitions): Remove these
7019 extern's.
7020 (prologue_augment): Add new bool argument.
7021 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
7022 (PERCENT_END_HEADER): ... this.
7023 (PERCENT_BEFORE_DEFINITIONS): Update to...
7024 (PERCENT_START_HEADER): ... this.
7025 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7026 * tests/actions.at (Printers and Destructors): Update names.
7027
7028 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
7029
7030 Add comparison operators for C++ location classes. Discussed at
7031 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
7032 * data/c++.m4 (b4_define_location_comparison): New boolean %define
7033 declaration indicating whether filename_type has an operator==. If
7034 filename_type is `std::string', it defaults to `1', `0' otherwise.
7035 * data/location.cc: Iff b4_define_location_comparison is `1', add
7036 operator== and operator!= for class position and for class location.
7037
7038 Some minor fixes.
7039 * src/scan-action.l: Remove unused file.
7040 * src/symtab.c (symbol_printer_set): Use printer_location not
7041 destructor_location.
7042 * src/symtab.h (struct symbol): Replace incorrect source comment for
7043 printer members.
7044 * tests/input.at (Incompatible Aliases): Update output with correct
7045 printer location.
7046
7047 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
7048
7049 Don't put the pre-prologue in the header file. For the yacc.c code
7050 file and the glr.c header and code files, move the pre-prologue before
7051 the token definitions. Add new %before-definitions and
7052 %after-definitions to declare code that will go in both the header file
7053 and code file. Discussed at
7054 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
7055 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
7056 and
7057 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
7058 * NEWS (2.3+): Describe these changes.
7059 * data/glr.c (b4_pre_prologue): Move from within to before...
7060 (b4_shared_declarations): ... this.
7061 Add new b4_before_definitions before b4_token_enums.
7062 Add new b4_after_definitions at the end.
7063 * data/glr.cc (b4_pre_prologue): Replace with...
7064 (b4_before_definitions): ... this in the header file.
7065 (b4_after_definitions): New near the end of the header file.
7066 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
7067 code file right before including the header file.
7068 (b4_before_definitions): New in the previous position of
7069 b4_pre_prologue in the header file.
7070 (b4_after_definitions): New near the end of the header file.
7071 * data/yacc.c: Clean up some m4 quoting especially in the header file.
7072 (b4_token_enums_defines): In the code file, move to right before
7073 YYSTYPE for consistency with the header file.
7074 (b4_before_definitions): New right before b4_token_enums_defines in
7075 both the header and code file.
7076 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
7077 header and code file.
7078 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
7079 of prologues for %union dependencies.
7080 (Decl Summary): In %defines description, mention the effect of
7081 %before-definitions and %after-definitions on the header file.
7082 (Calc++ Parser): Forward declare driver in a %before-definitions rather
7083 than in the pre-prologue so that make check succeeds.
7084 (Table of Symbols): Add entries for %before-definitions and
7085 %after-definitions.
7086 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
7087 %before-definitions.
7088 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
7089 (declaration): Parse those declarations and append to
7090 b4_before_definitions and b4_after_definitions, respectively.
7091 * src/reader.c (before_definitions, after_definitions): New bools to
7092 track whether those declarations have been seen.
7093 (prologue_augment): Add to the post-prologue if %union,
7094 %before-definitions, or %after-definitions has been seen.
7095 * src/reader.h (before_definitions, after_definitions): New extern's.
7096 * src/scan-gram.l: Scan the new declarations.
7097 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
7098 prologue block in a %before-definitions or a %after-definitions based
7099 on whether the %union is declared.
7100 * tests/regression.at (Early token definitions with --yacc, Early token
7101 definitions without --yacc): Move tests for token definitions into the
7102 post-prologue since token names are no longer defined in the
7103 pre-prologue.
7104
7105 2006-06-20 Akim Demaille <akim@epita.fr>
7106
7107 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
7108 (symbol_get): Use it.
7109 * src/parse-gram.y: Use it.
7110
7111 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
7112
7113 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
7114 build succeeds when configured with --enable-gcc-warnings.
7115
7116 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
7117
7118 * src/parse-gram.y (char_name): New function.
7119 (CHAR, STRING, string_content): For %printer, properly escape.
7120 (ID): Prefer fputs to fprintf.
7121 (id): Reindent to be consistent with other rules.
7122 Properly quote char.
7123
7124 The Translation Project changed its way of publishing translations
7125 to maintainers. I haven't received any responses to my request
7126 for supporting the old way, or for documenting the new way. I
7127 have modified 'bootstrap' to use screen scraping
7128 (in this case, HTML scraping). This is unreliable and inelegant,
7129 but I don't see any better way. Yuck.
7130 * bootstrap (TP_URL, WGET_COMMAND): New vars.
7131 (get_translations): New function, which uses HTML scraping to
7132 deduce locations of latest translations.
7133 Use this function to grab both bison and bison-runtime .po files.
7134 Don't bother priming the pump for the runtime-po domain any more,
7135 as it's now translated better than bison is.
7136
7137 2006-06-19 Akim Demaille <akim@epita.fr>
7138
7139 * src/scan-gram.l: No longer "parse" things after `%union' until
7140 `{'. Rather, return a single "%union" token.
7141 No longer make symbols: return strings, and leave the conversion
7142 to symbols to the parser.
7143 (SC_PRE_CODE, token_type): Remove.
7144 * src/parse-gram.y (%union): New field `character'.
7145 Sort tokens.
7146 (CHAR): New token.
7147 (ID, ID_COLON): Now that the scanner no longer makes them
7148 identifiers, adjust all uses to invoke symbol_get.
7149 (id_colon): New, wraps the conversion from string to symbol.
7150 (%union): Accept a possible union_name.
7151 (symbol): Now can be a char.
7152 * data/c.m4 (b4_union_name): Leave a default value.
7153 * data/glr.c, data/yacc.c: Use it.
7154
7155 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
7156
7157 For associating token numbers with token names for "yacc.c", don't use
7158 #define statements unless `--yacc' is specified; always use enum
7159 yytokentype. Most important discussions start at:
7160 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
7161 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
7162 and
7163 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
7164 * NEWS (2.3+): Mention.
7165 * data/c.m4 (b4_yacc_if): New.
7166 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
7167 token #define's.
7168 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
7169 on token name definitions.
7170 * src/getargs.c (usage): Capitalize `Yacc' in English.
7171 * src/output.c (prepare): Define b4_yacc_flag.
7172 * tests/regression.at (Early token definitions): Test that tokens names
7173 are defined before the pre-prologue not just before the post-prologue.
7174 Remove this test case and copy to...
7175 (Early token definitions with --yacc): ... this to test #define's.
7176 (Early token definitions without --yacc): ... and this to test enums.
7177
7178 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
7179
7180 * NEWS: Reword the post-2.3 change to not be so optimistic about
7181 removing the old "look-ahead" spelling.
7182 Update previous look-ahead/lookahead change reports.
7183 * REFERENCES: look-ahead -> lookahead (since that's
7184 what he actually wrote).
7185 * doc/refcard.tex: look ahead -> lookahead,
7186 look-ahead -> lookahead
7187
7188 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
7189
7190 For consistency, use `lookahead' instead of `look-ahead' or
7191 `look_ahead'. Discussed starting at
7192 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
7193 and then at
7194 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
7195 * NEWS: For the next release, note the change to `--report'.
7196 * TODO, doc/bison.1: Update English.
7197 * doc/bison.texinfo: Update English.
7198 (Understanding Your Parser, Bison Options): Document as
7199 `--report=lookahead' rather than `--report=look-ahead'.
7200 * src/conflicts.c: Update English in comments.
7201 (lookahead_set): Rename from look_ahead_set.
7202 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
7203 (resolve_sr_conflict): Rename local look_ahead_tokens to
7204 lookahead_tokens, and update other uses.
7205 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
7206 count_rr_conflicts, conflicts_free): Update uses.
7207 * src/getargs.c (report_args): Move "lookahead" before alternate
7208 spellings.
7209 (report_types): Update uses.
7210 (usage): For `--report' usage description, state `lookahead' spelling
7211 rather than `look-ahead'.
7212 * src/getargs.h (report.report_lookahead_tokens): Rename from
7213 report_look_ahead_tokens.
7214 * src/lalr.c: Update English in comments.
7215 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
7216 (state_lookahead_tokens_count): Rename from
7217 state_look_ahead_tokens_count.
7218 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7219 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
7220 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7221 Update other uses.
7222 Update English in output.
7223 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
7224 * src/print.c: Update English in comments.
7225 (lookahead_set): Rename from look_ahead_set.
7226 (print_reduction): Rename argument lookahead_token from
7227 look_ahead_token.
7228 (print_core, state_default_rule, print_reductions, print_results):
7229 Update uses.
7230 * src/print_graph.c: Update English in comments.
7231 (print_core): Update uses.
7232 * src/state.c: Update English in comments.
7233 (reductions_new): Update uses.
7234 (state_rule_lookahead_tokens_print): Rename from
7235 state_rule_look_ahead_tokens_print, and update other uses.
7236 * src/state.h: Update English in comments.
7237 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
7238 (state_rule_lookahead_tokens_print): Rename from
7239 state_rule_look_ahead_tokens_print.
7240 * src/tables.c: Update English in comments.
7241 (conflict_row, action_row): Update uses.
7242 * tests/glr-regression.at
7243 (Incorrect lookahead during deterministic GLR,
7244 Incorrect lookahead during nondeterministic GLR): Rename
7245 print_look_ahead to print_lookahead.
7246 * tests/torture.at: Update English in comments.
7247 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
7248 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
7249 (Many lookahead tokens): Update uses.
7250 * data/glr.c: Update English in comments.
7251 * lalr1.cc: Likewise.
7252 * yacc.c: Likewise.
7253 * src/conflicts.h: Likewise.
7254 * src/lalr.h: Likewise.
7255 * src/main.c: Likewise.
7256 * src/output.c: Likewise.
7257 * src/parse-gram.c: Likewise.
7258 * src/tables.h: Likewise.
7259 * tests/calc.at: Likewise.
7260
7261 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
7262
7263 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
7264
7265 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
7266
7267 * TODO: Add request from Nelson H. F. Beebe to be able to install
7268 Bison without installing the yacc script.
7269
7270 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7271
7272 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
7273 and yytext if they're already #define'd.
7274 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
7275 * src/scan-code-c.c: ... here.
7276 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
7277 <config.h>.
7278
7279 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7280
7281 Get Bison to build again when configured with --enable-gcc-warnings.
7282 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
7283 missing #include's.
7284 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
7285 loc argument as it shadows a global.
7286 * src/scan-gram.l: Remove stray comma that prevents boundary_set
7287 invocation.
7288
7289 * src/.cvsignore: Add scan-code.c.
7290
7291 2006-06-07 Akim Demaille <akim@epita.fr>
7292
7293 * src/scan-gram.l: Move the "add a trailing ; to actions" code
7294 to...
7295 * src/scan-code.l: here.
7296 * tests/input.at (Torturing the Scanner): Fix another location
7297 error.
7298
7299 2006-06-07 Akim Demaille <akim@epita.fr>
7300
7301 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
7302
7303 2006-06-06 Akim Demaille <akim@epita.fr>
7304
7305 Extract the parsing of user actions from the grammar scanner.
7306 As a consequence, the relation between the grammar scanner and
7307 parser is much simpler. We can also split "composite tokens" back
7308 into simple tokens.
7309 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
7310 * src/scan-gram.l (add_column_width, adjust_location): Move to and
7311 rename as...
7312 * src/location.h, src/location.c (add_column_width)
7313 (location_compute): these.
7314 Fix the column count: the initial column is 0.
7315 (location_print): Be robust to ending column being 0.
7316 * src/location.h (boundary_set): New.
7317 * src/main.c: Adjust to scanner_free being renamed as
7318 gram_scanner_free.
7319 * src/output.c: Include scan-code.h.
7320 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
7321 Use boundary_set.
7322 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
7323 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
7324 which is now, again, a separate token.
7325 Adjust all dependencies.
7326 Whereever actions with $ and @ are used, use translate_code.
7327 (action): Remove this nonterminal which is now useless.
7328 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
7329 (grammar_current_rule_action_append): Use translate_code.
7330 (packgram): Bound check ruleno, itemno, and rule_length.
7331 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
7332 (last_string, last_braced_code_loc, max_left_semantic_context)
7333 (scanner_initialize, scanner_free, scanner_last_string_free)
7334 (gram_out, gram_lineno, YY_DECL_): Move to...
7335 * src/scan-gram.h: this new file.
7336 (YY_DECL): Rename as...
7337 (GRAM_DECL): this.
7338 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
7339 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
7340 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
7341 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
7342 Move these declarations, and...
7343 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
7344 these to...
7345 * src/flex-scanner.h: this new file.
7346 * src/scan-gram.l (rule_length, rule_length_overflow)
7347 (increment_rule_length): Remove.
7348 (last_braced_code_loc): Rename as...
7349 (gram_last_braced_code_loc): this.
7350 Adjust to the changes of the parser.
7351 Move all the handling of $ and @ into...
7352 * src/scan-code.l: here.
7353 * src/scan-gram.l (handle_dollar, handle_at): Remove.
7354 (handle_action_dollar, handle_action_at): Move to...
7355 * src/scan-code.l: here.
7356 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
7357 scan-code.h, scan-code-c.c, scan-gram.h.
7358 (EXTRA_bison_SOURCES): Add scan-code.l.
7359 (BUILT_SOURCES): Add scan-code.c.
7360 (yacc): Be robust to white spaces.
7361
7362 * tests/conflicts.at, tests/input.at, tests/reduce.at,
7363 * tests/regression.at: Adjust the column numbers.
7364 * tests/regression.at: Adjust the error message.
7365
7366 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
7367
7368 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
7369 Use Akim's wording from
7370 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
7371
7372 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
7373
7374 Between Bison releases, manually append `+' to the previous Bison
7375 release number, and use that as a signal to automatically print the
7376 ChangeLog's CVS Id keyword from --version. Discussed starting at
7377 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
7378 * ChangeLog: Add Id header.
7379 * configure.ac (AC_INIT): Append `+' to `2.3'.
7380 * src/.cvsignore: Add revision.c.
7381 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
7382 (BUILT_SOURCES): Add revision.c.
7383 (revision.c): New target rule. This file defines a new global variable
7384 named revision. It initializes it with either the Id from ChangeLog
7385 or, if VERSION doesn't contain `+', with the empty string.
7386 * src/getargs.c (version): Print the value of revision.
7387 * src/revision.h: Extern revision.
7388
7389 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
7390
7391 * NEWS: Version 2.3.
7392 * configure.ac (AC_INIT): Likewise.
7393
7394 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
7395
7396 * data/glr.c (YYRECOVERING): Define to be a function-like macro
7397 with no arguments, not as an object-like macro. This is for
7398 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
7399 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
7400 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
7401 Document this.
7402
7403 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
7404
7405 * src/getargs.c (usage): Back out yesterday's modification of the
7406 --help output so that we don't have to wait for translation before
7407 releasing 2.3.
7408
7409 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
7410
7411 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
7412 Problem reported by Akim Demaille.
7413
7414 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
7415
7416 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
7417
7418 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
7419
7420 * data/yacc.c (yy_reduce_print): Omit trailing white space in
7421 generated source code. Problem reported by Frans Englich in
7422 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
7423
7424 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
7425
7426 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
7427 shell, not within 'make', so that 'make' by an ordinary builder
7428 (using GNU make) does not worry about configuring gzip. This also
7429 works around a bug reported independently by Keith Thompson and by
7430 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
7431 stderr rather than stdout, messing up the build logs.
7432
7433 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
7434
7435 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
7436 to make sure that YYID will never be unused. This fixes a 'make
7437 maintainer-check' failure caused by the recent changes to the 'Trivial
7438 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
7439 not used.
7440 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
7441
7442 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
7443
7444 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
7445 state before an empty RHS is always resolved here. Only the location
7446 of that state is guaranteed to be resolved, and that's enough. This
7447 fixes the remaining bug reported by Derek M. Jones in
7448 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
7449 * tests/glr-regression.at (Uninitialized location when reporting
7450 ambiguity): Test the above case.
7451 Also, the embedded comments in this test case claim it checks the case
7452 of an empty RHS that has inherited the initial location. However, the
7453 corresponding LHS was already resolved, so yyresolveLocations didn't
7454 actually have reason to modify it. Fix this by forcing
7455 nondeterministic operation at the beginning of the parse.
7456
7457 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
7458
7459 * data/c.m4 (b4_yy_symbol_print_generate):
7460 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
7461 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
7462 of the bugs reported today by Derek M Jones in
7463 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
7464 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
7465 defined to be a type name without parens or brackets.
7466 (Location Type): Similarly for YYLTYPE.
7467 * tests/regression.at (Trivial grammars): Put in a test for this
7468 bug that will be caught by 'make maintainer-check' (though not,
7469 alas, by 'make check' unless your compiler is picky).
7470
7471 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
7472
7473 * NEWS: Version 2.2.
7474 * configure.ac (AC_INIT): Likewise.
7475
7476 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
7477
7478 * data/glr.c (yyreportTree): Make room in yystates for the state
7479 preceding the RHS. This fixes the segmentation fault reported by Derek
7480 M. Jones in
7481 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
7482 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
7483 to the user. Reported for yyreportTree by Derek M. Jones later in the
7484 same thread.
7485 * THANKS: Add Derek M. Jones.
7486 Update my email address.
7487 Fix typo in Steve Murphy's name.
7488
7489 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
7490
7491 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
7492 checking against YYLAST that caused the parser to miss a potential
7493 alternative in its diagnostic.
7494 Problem reported by Maria Jose Moron Fernandez in
7495 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
7496 * data/lalr1.cc (yysyntax_error_): Likewise.
7497 * data/yacc.c (yysyntax_error): Likewise.
7498 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
7499 tokens, in case we run into an older C compiler.
7500 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
7501 Use them to check for the off-by-one error fixed above.
7502
7503 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
7504 YYSIZE_T, not size_t.
7505 * tests/regression.at (Trivial grammars): New test, to catch
7506 the error fixed by the above patch.
7507
7508 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7509
7510 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
7511 scheme.
7512 Reported by Steve Murphy.
7513
7514 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7515
7516 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
7517 * data/glr.cc: b4_location_flag is now b4_locations_flag.
7518
7519 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7520
7521 Implement --trace=m4.
7522 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
7523 * src/output.c (output_skeleton): When set, pass -dV to m4.
7524
7525 Factor the handling of flags in m4.
7526 * src/output.c (prepare): Rename the muscle names debug, defines,
7527 error_verbose to debug_flag, defines_flag, error_verbose_flag.
7528 * data/c.m4: Adjust.
7529 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
7530 Use b4_define_flag_if to define other b4_FLAG_if macros.
7531 (b4_location_if): As a consequence, rename as...
7532 (b4_locations_if): this, for consistency.
7533 Adjust all the skeletons.
7534
7535 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7536
7537 * etc/bench.pm: Shorten bench names.
7538
7539 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7540
7541 * src/output.h, src/output.c (error_verbose): Move to...
7542 * src/getargs.h, src/getargs.c: here.
7543 Sort the flags.
7544 Adjust dependencies.
7545
7546 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
7547
7548 * data/c.m4 (b4_copyright): Put the special exception for Bison
7549 skeletons here, so we don't have to put it in each skeleton. All
7550 uses changed. Suggested by Akim Demaille. Also, wrap the
7551 copyright notice, in case it is longer than 80 columns. Replace
7552 comma by newline after title.
7553
7554 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
7555
7556 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
7557 incompatibility, not a bug. Mention that it wasn't fixed as of
7558 flex 2.5.33.
7559
7560 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
7561
7562 * examples/extexi: Enforce the precedence of concatenation over
7563 >>.
7564 Reported by Tommy Nordgren.
7565
7566 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
7567
7568 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
7569 with the member "token".
7570 Reported by Martin Nylin.
7571
7572 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
7573
7574 * data/glr.c: Switch to Bison 2.2 special-exception language in
7575 the copyright notice. Use more-regular format for titles and
7576 copyright notices.
7577 * data/glr.cc: Likewise.
7578 * data/location.cc: Likewise.
7579 * data/yacc.cc: Likewise.
7580 * doc/bison.texinfo (Conditions): Document this.
7581 * NEWS: likewise. Upgrade version to 2.2.
7582
7583 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
7584
7585 * data/glr.cc: Remove dead code.
7586
7587 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
7588
7589 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
7590 that variable and the line breaks the bootstrap. Problem reported
7591 by Juan M. Guerrero.
7592
7593 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
7594
7595 * doc/bison.texinfo (Multiple start-symbols): New.
7596
7597 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
7598
7599 * etc/README, etc/bench.pl: New.
7600
7601 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
7602
7603 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
7604 rule.
7605 Reported by Mickael Labau.
7606 * tests/input.at (Torturing the Scanner): Test it.
7607
7608 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
7609
7610 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
7611 Problem reported by Bob Rossi.
7612
7613 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
7614
7615 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
7616 and didn't really work.
7617 For the index, use @ifnotinfo, not @iftex.
7618 Minor cleanups of spacing and terminology.
7619
7620 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
7621
7622 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
7623 of AT_NAME_PREFIX when %name-prefix is not used.
7624
7625 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
7626
7627 Apply --prefix to C++ skeletons too: they change the namespace.
7628 The test suite already exercize these cases.
7629 * data/c++.m4 (b4_namespace): New.
7630 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
7631 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
7632 * data/yacc.c, data/glr.c: Remove a useless `[]'.
7633 * doc/bison.texinfo: Document it.
7634 (Option Cross Key): Use @multitable in all formats. It looks
7635 nicer, even in TeX outputs.
7636 (Rules): Use the same code whatever the output type is.
7637 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
7638 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
7639 * tests/calc.at: Use it, instead of hard coding `yy'.
7640
7641 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
7642
7643 * TODO: Remove dead items.
7644
7645 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
7646
7647 * doc/FAQ: Remove, merged into...
7648 * doc/bison.texinfo (FAQ): this.
7649 * doc/Makefile.am (EXTRA_DIST): Adjust.
7650
7651 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
7652
7653 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
7654 even if empty.
7655 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
7656 * doc/bison.texinfo (Calc++ Scanner): Use it.
7657
7658 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
7659
7660 Fix two nits reported by twlevo, plus one more that I discovered.
7661
7662 * src/assoc.h (assoc_to_string): Give a name to the arg, as
7663 this is the usual Bison style.
7664 * src/location.h (location_print): Likewise.
7665
7666 * src/reader.h (token_name): Likewise.
7667
7668 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
7669
7670 Fix some nits reported by twlevo.
7671 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
7672 and "POSIX". Use more-modern syntax for URLs. Mention C++
7673 and ask for Java. Don't hardwire OS version numbers. Add
7674 copyright notice.
7675 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
7676 * src/conflicts.c (solved_conflicts_obstack): Now static.
7677
7678 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
7679
7680 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
7681 page. Say "you can use it" not "you may use it" as on the web page;
7682 we're describing capabilities not granting permission.
7683
7684 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
7685
7686 * data/glr.c (yyresolveLocations): Rename local variables to avoid
7687 shadowing warnings. Use usual patter for iterating through RHS.
7688 * tests/glr-regression.at
7689 (Uninitialized location when reporting ambiguity):
7690 Modify yylex so that it uses its argument, rather than trying
7691 to rely on ARGSUSED (which doesn't work for gcc with warnings).
7692 const char -> char const.
7693
7694 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
7695 Don't use tabs inside commands; it messes up 'ps'.
7696 Problem reported by twlevo.
7697
7698 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
7699
7700 * tests/glr-regression.at (Uninitialized location when reporting
7701 ambiguity): New test case.
7702 * data/glr.c (yyresolveLocations): New function, which uses
7703 YYLLOC_DEFAULT.
7704 (yyresolveValue): Invoke yyresolveLocations before reporting an
7705 ambiguity.
7706 * doc/bison.texinfo (Default Action for Locations): Note
7707 YYLLOC_DEFAULT's usage for ambiguity locations.
7708 (GLR Semantic Actions): Cross-reference those notes.
7709
7710 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
7711
7712 * tests/glr-regression.at (Leaked semantic values when reporting
7713 ambiguity): Remove unnecessary union and type declarations.
7714 (Leaked lookahead after nondeterministic parse syntax error): New test
7715 case.
7716 * data/glr.c (yyparse): Check for zero stacks remaining before
7717 attempting to shift the lookahead so that you don't lose it.
7718
7719 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
7720
7721 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
7722 * tests/glr-regression.at (Leaked semantic values when reporting
7723 ambiguity): New test case.
7724 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
7725 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
7726 now unnecessary yystackp parameter.
7727 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
7728 destructors can be called.
7729
7730 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
7731 in existing testcases.
7732
7733 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
7734
7735 Don't leak semantic values for parent RHS when a user action cuts the
7736 parser, and clean up related code a bit.
7737 * tests/glr-regression.at (Leaked merged semantic value if user action
7738 cuts parse): Rename to...
7739 (Leaked semantic values if user action cuts parse): ... this. Add check
7740 for leaked parent RHS values.
7741 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
7742 between an unresolved state (non-empty chain of semantic options) and
7743 an incomplete one (signaled by an empty chain).
7744 (yyresolveStates): Document the interface. Move all manipulation of a
7745 successfully or unsuccessfully resolved yyGLRState to...
7746 (yyresolveValue): ... here so that yyresolveValue always leaves a
7747 yyGLRState with consistent data and thus is easier to understand.
7748 Remove the yyvalp and yylocp parameters since they are always just
7749 taken from the yys parameter. When reporting a discarded merged value
7750 in debugging output, note that it is incompletely merged. Document the
7751 interface.
7752 (yyresolveAction): If resolving any of the RHS states fails, destroy
7753 them all rather than leaking them. Thus, as long as user actions are
7754 written to clean up the RHS correctly, yyresolveAction always cleans up
7755 the RHS of a semantic option. Document the interface.
7756
7757 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
7758
7759 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
7760 led to a segmentation fault in GNU Pascal. Problem reported
7761 by Waldek Hebisch.
7762
7763 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
7764
7765 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
7766 mid-rule action inside a nonterminal symbol in order to declare a
7767 destructor for its semantic value.
7768
7769 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
7770
7771 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
7772 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
7773 __cplusplus && ! defined _STDLIB_H && !
7774 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
7775 defined free))]: Include <stdlib.h> rather than rolling our own
7776 declarations of malloc and free, to avoid problems with
7777 incompatible declarations (using 'throw') C++'s stdlib.h. This
7778 should fix Debian bug 340012
7779 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
7780 reported by Guillaume Melquiond.
7781
7782 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
7783
7784 * NEWS: Clarify symbols versus types in unused-value warnings.
7785
7786 * configure.ac (AC_INIT): Bump version number.
7787
7788 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
7789
7790 * NEWS: Version 2.1a.
7791 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
7792 since C99 requires this.
7793
7794 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
7795
7796 * m4/c-working.m4: New file.
7797 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
7798
7799 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
7800
7801 * Makefile.maint: Merge from coreutils.
7802
7803 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
7804
7805 More portability fixes for problems summarized by Nelson H. F. Beebe.
7806
7807 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
7808 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
7809 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
7810 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
7811 messes up because C++ code is compiled in 32-bit mode but linked
7812 in 64-bit mode.
7813
7814 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
7815
7816 More portability fixes for problems summarized by Nelson H. F. Beebe.
7817
7818 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
7819 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
7820
7821 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
7822 nodist_PROGRAMS, since we don't need to actually compile the
7823 example if we're just doing a plain 'make'. This avoids bothering
7824 the installer unnecessarily about problems due to weird C++
7825 compilers.
7826
7827 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
7828
7829 More portability fixes for problems summarized by Nelson H. F. Beebe.
7830
7831 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
7832 than #include "...", and compile with -I'.'. The old method was
7833 not portable, according to Posix and the C standard, and it does
7834 not work with Sun C 5.7, where previous #line directives affect
7835 the working directory used in later #include "..." directives.
7836
7837 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7838
7839 Various DJGGP specific issues in /djgpp
7840
7841 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
7842
7843 More portability fixes for problems summarized by Nelson H. F. Beebe.
7844
7845 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
7846 '#include <map>' works and that you can apply ++ to iterators.
7847
7848 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
7849
7850 Work around portability problems summarized by Nelson H. F. Beebe in
7851 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
7852
7853 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
7854 that '#include <string>' works.
7855
7856 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
7857 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
7858 "warning: sorry: semantics of inline function static data `const
7859 unsigned char translate_table[262]' are wrong (you'll wind up with
7860 multiple copies)".
7861
7862 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
7863 or, xor to not_, and_, or_, and xor_, respectively. This works
7864 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
7865 random system header somewhere that includes the equivalent of
7866 <iso646.h>.
7867
7868 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
7869 -E" works; it apparently doesn't work with PathScale EKO Compiler
7870 Suite Version 2.0.
7871
7872 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
7873
7874 During deterministic GLR operation, user actions should be able to
7875 influence the parse by changing yychar. To make this easier to fix and
7876 to make glr.c easier to evolve in general, don't maintain yytoken in
7877 parallel with yychar; just compute yytoken when needed.
7878 * tests/glr-regression.at (Incorrect lookahead during deterministic
7879 GLR): Check that setting yychar in a user action has the intended
7880 effect.
7881 * data/glr.c (yyGLRStack): Remove yytokenp member.
7882 (yyclearin): Don't set *yytokenp.
7883 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
7884 yychar rather than *yytokenp to determine the current lookahead.
7885 Compute yytoken locally when needed.
7886 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
7887 point to.
7888
7889 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
7890 after `--report' documentation.
7891
7892 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
7893
7894 * src/parse-gram.y (grammar_declaration): Location of printer
7895 symbol is @1, not list->location. Bug reported by twlevo.
7896 * tests/input.at (Incompatible Aliases): Adjust to above change.
7897
7898 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
7899
7900 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
7901 all the test at once. This makes the output easier to read in the
7902 normal case.
7903
7904 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
7905 got from <http://bro-ids.org/download.html>. The bug is that
7906 when two actions appeared in succession, the second one was
7907 scanned before the first one was added to the grammar rule
7908 as a midrule action. Bison then output the incorrect warning
7909 "parse.y:905.17-906.36: warning: unused value: $3".
7910 * src/parse-gram.y (BRACED_CODE, action): These are no longer
7911 associated with a value.
7912 (rhs): Don't invoke grammar_current_rule_action_append.
7913 (action): Invoke it here instead.
7914 * src/reader.c (grammar_midrule_action): Now extern.
7915 (grammar_current_rule_action_append): Don't invoke
7916 grammar_midrule_action; that is now the scanner's job.
7917 * src/reader.h (last_string, last_braced_code_loc):
7918 (grammar_midrule_action): New decls.
7919 * src/scan-gram.l (last_string): Now extern, sigh.
7920 (last_braced_code_loc): New extern variable.
7921 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
7922 rule already has an action.
7923 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
7924 * tests/input.at (AT_CHECK_UNUSED_VALUES):
7925 Add some tests to check that the above changes fixed the bug.
7926
7927 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
7928
7929 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
7930 All used changed. Check whether the symbol has a destructor,
7931 not whether it is typed.
7932 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
7933 that the values are still reported as unused. All line numbers
7934 adjusted.
7935
7936 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
7937
7938 Work around a bug in bro 0.8, which underparenthesizes its
7939 definition of YYLLOC_DEFAULT.
7940 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
7941 their arguments.
7942 * data/lalr1.cc: Likewise.
7943 * data/yacc.cc: Likewise.
7944
7945 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
7946
7947 Work around a bug in Pike 7.0, and give the Pike folks a
7948 better way to override the usual int widths.
7949 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
7950 user can override the types.
7951 (short): #undef, to work around a bug in Pike 7.0.
7952 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
7953 (union yyalloc.yyss): Use yytype_int16 rather than short.
7954 All uses changed.
7955 (yysigned_char): Remove.
7956 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
7957 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
7958 * tests/regression.at (Web2c Actions): Adjust to above changes.
7959
7960 * src/reader.c (check_and_convert_grammar): New function.
7961 (reader): Close the input file even if something went wrong during
7962 parsing. Minor file descriptor leak reported by twlevo.
7963
7964 * src/assoc.c (assoc_to_string): Use a default: abort (); case
7965 to pacify gcc -Wswitch-default.
7966 * src/scan-gram.l (adjust_location): Use a default: break; case
7967 to pacify gcc -Wswitch-default.
7968 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
7969 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
7970 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
7971 Move these decls to scan-skel.l, since they don't need to be
7972 visible elsewhere.
7973 * src/scan-skel.l: Accept the above decls.
7974 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
7975 is used.
7976
7977 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
7978
7979 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
7980 since we don't want to insist on a version number at the start
7981 of the changelog every time.
7982 * Makefile.maint: Sync from coreutils a bit better.
7983 (sc_trailing_blank): Renamed from sc_trailing_space.
7984 All uses changed.
7985 (sc_no_if_have_config_h, sc_require_config_h):
7986 (sc_prohibit_assert_without_use): New rules.
7987 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
7988 (sc_dd_max_sym_length): Fix leading spaces in rule.
7989 (sc_system_h_headers): Prefix with @.
7990 (sc_useless_cpp_parens, m4-check): Output line numbers.
7991 (changelog-check): Allow version only in head.
7992 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
7993 satisfy new Makefile.maint rule.
7994 * data/glr.c: Likewise.
7995 * data/glr.cc: Likewise.
7996 * data/lalr1.cc: Likewise.
7997 * data/yacc.c: Likewise.
7998 * lib/ebitsetv.c: Likewise.
7999 * lib/lbitset.c: Likewise.
8000 * lib/subpipe.c: Likewise.
8001 * lib/timevar.c: Likewise.
8002 * src/system.h: Likewise.
8003 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
8004 * djgpp/Makefile.maint: Add copyright notice.
8005 * djgpp/README.in: Likewise.
8006 * djgpp/config.bat: Likewise.
8007 * djgpp/config.site: Likewise.
8008 * djgpp/config_h.sed: Likewise.
8009 * djgpp/djunpack.bat: Likewise.
8010 * djgpp/config.sed: Fix copyright notice to match standard format.
8011 * djgpp/subpipe.h: Likewise.
8012 * lib/bitsetv-print.c: Likewise.
8013 * lib/bitsetv.c: Likewise.
8014 * lib/subpipe.h: Likewise.
8015 * lib/timevar.c: Likewise.
8016 * lib/timevar.h: Likewise.
8017 * djgpp/subpipe.c: Use standard recipe for config.h.
8018 * lib/abitset.c: Likewise.
8019 * lib/bitset.c: Likewise.
8020 * lib/bitset_stats.c: Likewise.
8021 * lib/bitsetv-print.c: Likewise.
8022 * lib/bitsetv.c: Likewise.
8023 * lib/ebitsetv.c: Likewise.
8024 * lib/get-errno.c: Likewise.
8025 * lib/lbitset.c: Likewise.
8026 * lib/subpipe.c: Likewise.
8027 * lib/timevar.c: Likewise.
8028 * lib/vbitset.c: Likewise.
8029 * tests/local.at: Likewise.
8030 * src/scan-gram.l: Don't include verify.h, since system.h does
8031 that for us.
8032 * .x-sc_require_config_h: New file.
8033 * .x-sc_unmarked_diagnostics: New file.
8034
8035 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
8036
8037 Be a bit more systematic about using 'abort'.
8038 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
8039 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
8040 Put 'default: abort ();' before some other case, to satisfy older
8041 pedantic compilers.
8042 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8043 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
8044 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
8045 * src/conflicts.c (resolve_sr_conflict): Likewise.
8046 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
8047 (get_decision_str, get_orientation_str, get_node_alignment_str):
8048 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
8049 (get_linestyle_str, get_arrowstyle_str): Likewise.
8050 * src/conflicts.c (resolve_sr_conflict):
8051 Use a default case rather than one for the one remaining enum
8052 value, to catch invalid enum values as well.
8053 * src/lalr.c (set_goto_map, map_goto):
8054 Prefer "assert (FOO);" to "if (!FOO) abort ();".
8055 * src/nullable.c (nullable_compute, token_definitions_output):
8056 Likewise.
8057 * src/reader.c (packgram, reader): Likewise.
8058 * src/state.c (transitions_to, state_new, state_reduction_find):
8059 Likewise.
8060 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
8061 (symbol_pack): Likewise.
8062 * src/tables.c (conflict_row, pack_vector): Likewise.
8063 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
8064 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
8065 * src/system.h: Don't include <assert.h>.
8066 (assert): New macro.
8067
8068 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
8069 (Destructor Decl, Parser Function, Pure Calling):
8070 Describe rules for braces inside C code more carefully.
8071
8072 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
8073
8074 Fix some porting glitches found by Nelson H. F. Beebe.
8075 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
8076 compilers that don't understand that abort () does not return.
8077 * src/state.c (transitions_to): Likewise.
8078 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8079 that '#include <cstdlib>' works.
8080 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
8081 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
8082 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
8083 for the benefit of some pre-C99 compilers.
8084
8085 * bootstrap: Undo changes to gnulib files that autoreconf made.
8086
8087 Minor fixups to get 'make maintainer-check' to work.
8088 * configure.ac: Don't use -Wnested-externs, as it's incompatible
8089 with the new verify.h implementation.
8090 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
8091 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
8092 * data/yacc.c (YYUSE): Likewise.
8093 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
8094 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
8095 * src/parse-gram.y (declaration): Don't pass a string constant
8096 to a function that expects char *, since GCC might complain
8097 about the constant value.
8098 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
8099 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
8100 before #defining them.
8101 * tests/glr-regression.at
8102 (Incorrectly initialized location for empty right-hand side in GLR):
8103 In yyerror, use the msg arg.
8104 (Corrupted semantic options if user action cuts parse):
8105 (Incorrect lookahead during deterministic GLR):
8106 (Incorrect lookahead during nondeterministic GLR):
8107 Don't name a local var 'index'; it shadows string.h's 'index'.
8108
8109 2006-01-19 Akim Demaille <akim@epita.fr>
8110
8111 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
8112 location, not just parts of it.
8113
8114 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
8115
8116 * NEWS: Document the fact that multiple %unions are now allowed.
8117 * doc/bison.texinfo (Union Decl): Likewise.
8118 * TODO: This feature is now implemented, so remove it from
8119 the wishlist.
8120
8121 * Makefile.maint: Merge with coreutils Makefile.maint.
8122 (CVS_LIST): Use build-aux version if available.
8123 (VERSION_REGEXP): New macro.
8124 (syntax-check-rules): Add sc_no_if_have_config_h,
8125 sc_prohibit_assert_without_use, sc_require_config_h,
8126 sc_useless_cpp_parens.
8127 (sc_obsolete_symbols): Check for O_NDELAY.
8128 (sc_dd_max_sym_length): Track coreutils.
8129 (sc_unmarked_diagnostics): Look in all files, not just *.c.
8130 (sc_useless_cpp_parens): New rule.
8131 (news-date-check): Look for version or today's date.
8132 (changelog-check): Don't require version number near head.
8133 (copyright-check): Use current year instead of hardwiring 2005.
8134 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
8135 (announcement): Add --gpg-key-ID.
8136
8137 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
8138 with "file system".
8139
8140 Avoid undefined behavior that addressed just before the start of an
8141 array. Problem reported by twlevo.
8142 * src/reader.c (packgram): Prepend a new sentinel before ritem.
8143 * src/lalr.c (build_relations): Rely on new sentinel.
8144 * src/gram.c (gram_free): Adjust to new sentinel.
8145
8146 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
8147
8148 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
8149 yylookaheadNeeds. All uses updated.
8150 (yysplitStack): Rename local yynewLookaheadStatuses to
8151 yynewLookaheadNeeds.
8152 * data/glr-regression.at (Incorrect lookahead during nondeterministic
8153 GLR): In comments, change `lookahead status' to `lookahead need'.
8154
8155 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8156
8157 * data/glr.c (yysplitStack): A little stylistic rewrite.
8158
8159 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8160
8161 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
8162
8163 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
8164
8165 * doc/bison.texinfo: Fix some typos.
8166 (GLR Semantic Actions): New subsection discussing special
8167 considerations because GLR semantic actions might be deferred.
8168 (Actions): Mention look-ahead usage of yylval.
8169 (Actions and Locations): Mention look-ahead usage of yylloc.
8170 (Special Features for Use in Actions): Add YYEOF entry and mention it
8171 in the yychar entry.
8172 In the yychar entry, remove mention of the local yychar case (pure
8173 parser) since this is irrelevant information when writing semantic
8174 actions and since it's already discussed in `Table of Symbols' where
8175 yychar is otherwise described as an external variable.
8176 In the yychar entry, don't call it the `current' look-ahead since it
8177 isn't when semantic actions are deferred.
8178 In the yychar and yyclearin entries, add note about deferred semantic
8179 actions.
8180 Add yylloc and yylval entries discussing look-ahead usage.
8181 (Look-Ahead Tokens): When discussing yychar, don't call it the
8182 `current' look-ahead, and do mention yylval and yylloc.
8183 (Error Recovery): Cross-reference `Action Features' when mentioning
8184 yyclearin.
8185 (Table of Symbols): In the yychar entry, don't call it the `current'
8186 look-ahead.
8187 In the yylloc and yylval entries, mention look-ahead usage.
8188
8189 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
8190
8191 * tests/glr-regression.at: Update copyright year to 2006.
8192
8193 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8194
8195 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
8196 use during nondeterministic operation to track which stacks have
8197 actually needed the current lookahead.
8198 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
8199 Allocate, deallocate, resize, and otherwise shuffle space for
8200 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
8201 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
8202 appropriately during nondeterministic operation.
8203 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
8204 members to store the current lookahead to be used by the deferred
8205 user action.
8206 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
8207 from which the RHS is taken. Set the lookahead members of the new
8208 yySemanticOption according to the lookahead status for stack yyk.
8209 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
8210 yyaddDeferredAction.
8211 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
8212 members of yySemanticOption before invoking yyuserAction, and then set
8213 them back to their current values afterward.
8214 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
8215 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
8216 * tests/glr-regression.at: Remove `.' from the ends of recent test case
8217 titles for consistency.
8218 (Leaked merged semantic value if user action cuts parse): In order to
8219 suppress lint warnings, use arguments in merge function, and assign
8220 char value < 128 in main.
8221 (Incorrect lookahead during deterministic GLR): New test case.
8222 (Incorrect lookahead during nondeterministic GLR): New test case.
8223
8224 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8225
8226 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
8227 !yyvaluep as signal that no semantic value is available to print.
8228 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
8229 to print a semantic value.
8230
8231 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8232
8233 * tests/glr-regression.at: For consistency with my newer test cases,
8234 don't thank myself.
8235
8236 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
8237
8238 * data/glr.c (yyresolveValue): When merging semantic options, if at
8239 least one user action succeeds but a later one cuts the parse, then
8240 destroy the semantic value before returning rather than leaking it.
8241 (yyresolveStates): If a user action cuts the parse and thus
8242 yyresolveValue fails, ignore the (unset) semantic value rather than
8243 corrupting the yyGLRState, and empty the semantic options list since
8244 the user actions should have called all necessary destructors.
8245 Simplify code with YYCHK.
8246 * tests/glr-regression.at (Corrupted semantic options if user action
8247 cuts parse): New test case.
8248 (Undesirable destructors if user action cuts parse): New test case.
8249 Before applying any of this patch, this test case never actually failed
8250 for me... but only because the corrupted semantic options usually
8251 masked this bug.
8252 (Leaked merged semantic value if user action cuts parse): New test
8253 case.
8254
8255 2006-01-05 Akim Demaille <akim@epita.fr>
8256
8257 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
8258
8259 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
8260
8261 * data/c.m4 (b4_c_modern): New macro, with a new provision for
8262 _MSC_VER. Problem reported by Cenzato Marco.
8263 (b4_c_function_def): Use it.
8264 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
8265 b4_c_modern.
8266 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
8267 than rolling our own.
8268
8269 2006-01-04 Akim Demaille <akim@epita.fr>
8270
8271 Also warn about non-used mid-rule values.
8272 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
8273 member.
8274 (symbol_list_new): Adjust.
8275 * src/reader.c (symbol_typed_p): New.
8276 (grammar_rule_check): Use it.
8277 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
8278 Check its rule.
8279 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
8280 Use it.
8281 * tests/actions.at (Exotic Dollars): Adjust.
8282
8283 2006-01-04 Akim Demaille <akim@epita.fr>
8284
8285 * src/reader.c (grammar_midrule_action): If $$ is set in a
8286 mid-rule, move the `used' bit to its lhs.
8287 * tests/input.at (Unused values): New.
8288 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
8289
8290 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
8291
8292 * doc/bison.texinfo (Bison Options): Say more accurately what
8293 --yacc does.
8294 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
8295 about declarations in the grammar when in Yacc mode, as POSIX does
8296 not require a diagnostic when the grammar uses extensions.
8297
8298 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
8299
8300 Warn about dubious constructions like "%token T T".
8301 Reported by twlevo.
8302 * src/symtab.h (struct symbol.declared): New member.
8303 * src/symtab.c (symbol_new): Initialize it to false.
8304 (symbol_class_set): New arg DECLARING, specifying whether
8305 this is a declaration that we want to warn about, if there
8306 is more than one of them. All uses changed.
8307
8308 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
8309 Allow multiple %union directives, whose contents concatenate.
8310 * src/parse-gram.y (grammar_declaration): Likewise.
8311 Use muscle_code_grow, so that we don't need stype_line any more.
8312 All uses changed.
8313
8314 * src/muscle_tab.c (muscle_grow): Fix comment.
8315
8316 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
8317 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
8318 Update copyright year to 2006.
8319
8320 2006-01-03 Akim Demaille <akim@epita.fr>
8321
8322 Have glr.cc pass (some of) the calc.at tests.
8323 * data/glr.cc (b4_parse_param_orig): New.
8324 (b4_parse_param): Improve its definition, and bound it more
8325 clearly in the skeleton.
8326 (b4_epilogue): Append, instead of prepending, in order to keep
8327 #line consistency.
8328 Simplify the generation of auxiliary functions: locations and
8329 purity are mandated.
8330 (b4_global_tokens_and_yystype): Honor it.
8331 * data/location.cc (c++.m4): Don't include it.
8332 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
8333 and AT_SKEL_CC_IF.
8334 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
8335 AT_LALR1_CC_IF.
8336 Be sure to initialize the first position's filename.
8337 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
8338 mandated anyway.
8339 (AT_CHECK_CALC_GLR_CC): New.
8340 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
8341
8342 2006-01-02 Akim Demaille <akim@epita.fr>
8343
8344 * src/output.c (output_skeleton): Don't hard wire the inclusion of
8345 c.m4.
8346 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
8347 * data/glr.cc: Do not include stack.hh.
8348
8349 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
8350
8351 * data/glr.c: Reformat whitespace with tabs.
8352 (b4_lpure_formals): Remove this unused m4 macro.
8353 * tests/cxx-type.at: Reformat whitespace with tabs.
8354 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
8355 since it's a member. Rename type to isNterm for clarity.
8356
8357 2005-12-29 Akim <akim@sulaco.local>
8358
8359 Let glr.cc catch up with symbol_value_print.
8360 * data/glr.cc (b4_yysymprint_generate): Replace by...
8361 (b4_yy_symbol_print_generate): this.
8362 (yy_symbol_print, yy_symbol_value_print): Declare them.
8363
8364 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
8365
8366 * src/location.h (boundary): Note that a line or column equal
8367 to INT_MAX indicates an overflow.
8368 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
8369 (rule_length_overflow, increment_rule_length, add_column_width):
8370 New functions.
8371 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
8372 (<SC_BRACED_CODE>"}"):
8373 Use increment_rule_length rather than incrementing it by hand.
8374 (adjust_location, handle_syncline): Diagnose overflow.
8375 (handle_action_dollar, handle_action_at):
8376 Fix bug with monstrosities like $-2147483648.
8377 Remove now-unnecessary checks.
8378 (scan_integer): Verify assumptions and remove now-unnecessary checks.
8379 (convert_ucn_to_byte): Verify assumptions.
8380 (handle_syncline): New arg LOC. All callers changed.
8381 Don't store through a value derived from char const * pointer.
8382
8383 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
8384 GCC warnings.
8385
8386 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
8387
8388 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
8389 Remove unnecessary forward static decls.
8390
8391 2005-12-27 Akim Demaille <akim@epita.fr>
8392
8393 * src/reader.c (grammar_current_rule_check): Also check that $$
8394 is used.
8395 Take the rule to check as argument, hence rename as...
8396 (grammar_rule_check): this.
8397 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
8398 Rename as...
8399 (grammar_rule_begin, grammar_rule_end): these, for consistency.
8400 (grammar_midrule_action, grammar_symbol_append): Now static.
8401 * tests/torture.at (input): Don't rely on the default action
8402 being always performed.
8403 * tests/calc.at: "Set" $$ even when the action is "cut" with
8404 YYERROR or other.
8405 * tests/actions.at (Exotic Dollars): Instead of using unused
8406 values, check that the warning is issued.
8407
8408 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
8409
8410 * NEWS: Improve wording for unused-value warnings.
8411
8412 2005-12-22 Akim Demaille <akim@epita.fr>
8413
8414 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
8415 (b4_yysymprint_generate): Rename as...
8416 (b4_yy_symbol_print_generate): this.
8417 Generate yy_symbol_print instead of yysymprint.
8418 Generate also yy_symbol_value_print, and use it.
8419
8420 2005-12-22 Akim Demaille <akim@epita.fr>
8421
8422 * NEWS: Warn about unused values.
8423 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
8424 a `used' member.
8425 (symbol_list_n_get, symbol_list_n_used_set): New.
8426 (symbol_list_n_type_name_get): Use symbol_list_n_get.
8427 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
8428 * src/reader.c (grammar_current_rule_check): Check that values are
8429 used.
8430 * src/symtab.c (symbol_print): Accept 0.
8431 * tests/existing.at: Remove the type information.
8432 Empty the actions.
8433 Remove useless actions (beware of mid-rule actions: perl -000
8434 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
8435 * tests/actions.at (Exotic Dollars): Use unused values.
8436 * tests/calc.at: Likewise.
8437 * tests/glr-regression.at (No users destructors if stack 0 deleted):
8438 Likewise.
8439
8440 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
8441 rule_useful_p.
8442
8443 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
8444
8445 Undo 2005-12-01 tentative license wording change. The wording is
8446 still being reviewed by the lawyers, and we don't want to wait for
8447 them before publishing a test release. For now, revert to the
8448 previous wording.
8449 * NEWS: Undo 2005-12-01 change.
8450 * data/glr.c: Revert to previous license wording.
8451 * data/glr.cc: Likewise.
8452 * data/lalr1.cc: Likewise.
8453 * data/location.cc: Likewise.
8454 * data/yacc.c: Likewise.
8455
8456 * NEWS: Reword %destructor vs YYABORT etc.
8457 * data/glr.c: Use American spacing, for consistency.
8458 * data/glr.cc: Likewise.
8459 * data/lalr1.cc: Likewise.
8460 * data/yacc.c: Likewise.
8461 * data/yacc.c: Reformat comments slightly.
8462 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
8463 for consistency. Fix some spelling errors and reword recently-included
8464 text slightly.
8465 * tests/cxx-type.at: Cast results of malloc, for C++.
8466
8467 2005-12-21 Joel E. Denny <address@hidden>
8468
8469 * tests/cxx-type.at: Construct a tree, count the parents of shared
8470 nodes, and free each node once and only once. Previously, the memory
8471 for semantic values was leaked instead.
8472
8473 2005-12-21 Joel E. Denny <address@hidden>
8474
8475 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
8476 (yylval, yylloc): If pure, #define to yystackp->yyval and
8477 yystackp->yyloc similar to yychar and yynerrs.
8478 (yyparse): If pure, remove local yylval and yylloc. Add local
8479 yystackp to accommodate pure definitions of yylval and yylloc.
8480 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
8481 yylvalp and yyllocp to &yylval and &yylloc.
8482 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
8483 namespace. Previously, nerrs and char were missing, but lval and lloc
8484 weren't necessary.
8485 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
8486 yylvalp and yyllocp parameters since, if pure, these are now always
8487 accessible through yystackp. If not pure, they are still accessible
8488 globally.
8489 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
8490 `if (YYID (N))' to pacify lint.
8491
8492 2005-12-21 Akim Demaille <akim@epita.fr>
8493
8494 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
8495 destroy the RHS symbols of a rule.
8496 * data/yacc.c (yylen): Initialize to 0.
8497 Keep its value to the number of items to possibly shift.
8498 In particular, a regular successful parse that ends on YYFINAL by
8499 a (internal) YYACCEPT must not have yylen != 0.
8500 (yyerrorlab, yyreturn): Pop the RHS.
8501 Reorder a bit to emphasize the `shifting' bits of code.
8502 (YYPOPSTACK): Now accept a number of items to pop.
8503 * data/lalr1.cc: Likewise.
8504 * data/glr.c: Formatting changes.
8505 Use goto instead of fall through.
8506 * doc/bison.texinfo (Destructor Decl): Complete.
8507
8508 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8509
8510 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
8511 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
8512 * djgpp/config.bat: Replace every occurence of the file name
8513 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
8514 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
8515 * djgpp/config.sed: Replace every occurence of the file name
8516 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
8517 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
8518 * djgpp/djunpack.bat: DJGPP specific file.
8519 * djgpp/fnchange.lst: DJGPP specific file.
8520 * djgpp/README.in: Add new information about how to unpack the bison
8521 source on MSDOS and other systems which have 8.3 file name restrictions
8522 using djunpack.bat and fnchange.lst.
8523
8524 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
8525
8526 * bootstrap (build_cvs_prefix): Remove; unused.
8527 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
8528 when getting gnulib.
8529
8530 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
8531
8532 * data/glr.c: Reorder typedef declarations for structs to match order
8533 of struct declarations.
8534 Rename yystack everywhere to yystackp except in yyparse where it's not
8535 a pointer.
8536 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
8537 consistency.
8538 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
8539 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
8540 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
8541 lint.
8542
8543 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
8544
8545 * tests/sets.at (Accept): Fix typos in regular expression used to
8546 sed out the final state number.
8547
8548 Work around portability problem on Solaris 10: flex-generated
8549 files include <stdio.h> before <config.h>, which messes up
8550 because the latter defines __EXTENSIONS__. Address the problem
8551 by creating two new little files that include <config.h> first,
8552 then include the flex-generated files. Rewrite everyone else
8553 to include <config.h> first, as well.
8554 * lib/timevar.c: Always include "config.h".
8555 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
8556 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
8557 (EXTRA_bison_SOURCES): New macro.
8558 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
8559 * src/system.h: Don't include config.h.
8560 * src/LR0.c: Include <config.h> first.
8561 * src/assoc.c: Likewise.
8562 * src/closure.c: Likewise.
8563 * src/complain.c: Likewise.
8564 * src/conflicts.c: Likewise.
8565 * src/derives.c: Likewise.
8566 * src/files.c: Likewise.
8567 * src/getargs.c: Likewise.
8568 * src/gram.c: Likewise.
8569 * src/lalr.c: Likewise.
8570 * src/location.c: Likewise.
8571 * src/main.c: Likewise.
8572 * src/muscle_tab.c: Likewise.
8573 * src/nullable.c: Likewise.
8574 * src/output.c: Likewise.
8575 * src/parse-gram.y: Likewise.
8576 * src/print.c: Likewise.
8577 * src/print_graph.c: Likewise.
8578 * src/reader.c: Likewise.
8579 * src/reduce.c: Likewise.
8580 * src/relation.c: Likewise.
8581 * src/state.c: Likewise.
8582 * src/symlist.c: Likewise.
8583 * src/symtab.c: Likewise.
8584 * src/tables.c: Likewise.
8585 * src/uniqstr.c: Likewise.
8586 * src/vcg.c: Likewise.
8587
8588 * src/parse-gram.y: Fix minor problems uncovered by lint.
8589 (current_lhs, current_lhs_location): Now static.
8590 (current_assoc): Remove unused variable.
8591
8592 Cleanups so that Bison-generated parsers have less lint.
8593 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
8594 Prepend /*ARGSUSED*/, for lint's sake.
8595 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
8596 definition if 'lint' is defined.
8597 (YYID): New macro (or function, if lint).
8598 All uses of /*CONSTCOND*/0 replaced by YYID(0).
8599 * data/yacc.c: Likewise.
8600 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
8601 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
8602 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
8603 is C++ only.
8604 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
8605 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
8606 Use YYID(0) rather than 0, for lint.
8607 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
8608 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
8609
8610 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
8611
8612 * tests/glr-regression.at
8613 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8614 Close memory leak reported by twlevo.
8615
8616 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
8617
8618 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
8619 all stacks.
8620 (yyparse): Iterate another stack in order to call user destructors.
8621 * tests/glr-regression.at (No users destructors if stack 0 deleted):
8622 New test case.
8623 (Duplicated user destructor for lookahead): This test now is expected
8624 to succeed.
8625
8626 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
8627
8628 * NEWS: Document the following change.
8629 * data/yacc.c: Say "parser skeleton" rather than "file", since
8630 it's no longer just a file.
8631 * data/glr.c: Grant a special exception for C GLR parsers, that
8632 reads like the already-existing exception for C LALR(1) parsers.
8633 * data/glr.cc: Likewise.
8634 * data/lalr1.cc: Likewise.
8635 * data/location.cc: Likewise.
8636 * data/yacc.c: Reword the "written by" statement to clarify that
8637 it was the parser skeleton, not the entire output file.
8638 * data/glr.c: Written by Paul Hilfinger.
8639 * data/glr.cc: Written by Akim Demaille.
8640 * data/lalr1.cc: Likewise.
8641
8642 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
8643
8644 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
8645 Fix typos in previous change that broke 'make check'.
8646 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
8647 supported in C.
8648 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
8649 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
8650 We can revert this once things settle down.
8651
8652 * src/conflicts.c (conflicts_print): Don't print file name twice
8653 when %expect fails because there were no conflicts.
8654 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
8655 change.
8656 * tests/conflicts.at (%expect not enough, %expect too much):
8657 (%expect with reduce conflicts): Adjust to new behavior.
8658
8659 2005-11-18 Akim Demaille <akim@epita.fr>
8660
8661 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
8662 errors.
8663 * NEWS: Document this.
8664 * doc/bison.texinfo (Expect Decl): Likewise.
8665
8666 2005-11-16 Akim Demaille <akim@epita.fr>
8667
8668 Generalize the display of semantic values and locations in traces.
8669 * data/glr.c (yy_reduce_print): Fix indices (again).
8670 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
8671 literal integers.
8672 * data/lalr1.cc (yyreduce_print): Rename as...
8673 (yy_reduce_print): this.
8674 Display values and locations.
8675 * data/yacc.c (yy_reduce_print): Likewise.
8676 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
8677 (yysymprint): Move higher to be visible from yy_reduce_print).
8678 (yyparse): Adjust.
8679 * tests/calc.at: Adjust the expected length of the traces.
8680
8681 2005-11-14 Akim Demaille <akim@epita.fr>
8682
8683 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
8684 from 1 to N, while values and location start at 0.
8685 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
8686
8687 2005-11-14 Akim Demaille <akim@epita.fr>
8688
8689 * data/glr.c (yy_reduce_print): Fix the $ number.
8690
8691 2005-11-14 Akim Demaille <akim@epita.fr>
8692
8693 "Use" parse parameters.
8694 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
8695 * data/glr.c, data/glr.cc: Use them.
8696 * data/glr.c (YYUSE): Have a C++ definition that supports
8697 non-pointer types.
8698
8699 2005-11-14 Akim Demaille <akim@epita.fr>
8700
8701 * data/glr.c (yyexpandGLRStack): Declare only if defined.
8702
8703 2005-11-14 Akim Demaille <akim@epita.fr>
8704
8705 * data/glr.cc: New.
8706 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
8707
8708 2005-11-12 Akim Demaille <akim@epita.fr>
8709
8710 Let position and location be PODs.
8711 * data/location.cc (position::initialize, location::initialize): New.
8712 (position::position, location::location): Define only if
8713 b4_location_constructors is defined.
8714 * data/lalr1.cc (b4_location_constructors): Define it for backward
8715 compatibility.
8716 * doc/bison.texinfo (Initial Action Decl): Use initialize.
8717
8718 2005-11-12 Akim Demaille <akim@epita.fr>
8719
8720 * data/lalr1.cc: Move the body of the ctor and dtor into the
8721 parser file (instead of the header).
8722 Wrap the implementations in a "namespace yy".
8723
8724 2005-11-12 Akim Demaille <akim@epita.fr>
8725
8726 Have glr.c include its header file when created.
8727 * data/glr.c (b4_shared_declarations): New.
8728 Output them verbatim in the parser if !%defines, otherwise
8729 output then in the header file, and include it instead.
8730
8731 2005-11-11 Akim Demaille <akim@epita.fr>
8732
8733 * data/glr.c: Comment changes.
8734
8735 2005-11-11 Akim Demaille <akim@epita.fr>
8736
8737 When yydebug, report semantic and location values for reductions.
8738 * data/glr.c (yy_reduce_print): Report the semantic values and the
8739 locations.
8740 (YY_REDUCE_PRINT): Adjust.
8741 (yyglrReduce): Use them.
8742 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
8743 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
8744 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
8745 traces.
8746
8747 2005-11-10 Akim Demaille <akim@epita.fr>
8748
8749 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
8750 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
8751 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
8752
8753 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
8754
8755 * m4/cxx.m4, examples/Makefile.am: Don't build
8756 examples/calc++ if no C++ compiler is available. (trivial change)
8757
8758 2005-11-09 Akim Demaille <akim@epita.fr>
8759
8760 * src/scan-skel.l: Use a couple of asserts.
8761
8762 2005-11-03 Akim Demaille <akim@epita.fr>
8763
8764 In some (weird) cases, the final state number is incorrect.
8765 Reported by Alexandre Duret-Lutz.
8766 * src/LR0.c (state_list_append): Remove the computation of
8767 final_state.
8768 (save_reductions): Do it here.
8769 (get_state): Alpha conversion.
8770 (generate_states): Use a for loop.
8771 * src/gram.h (item_number_is_rule_number)
8772 (item_number_is_symbol_number): New.
8773 * src/state.c: Use assert.
8774 * src/system.h: Include assert.h.
8775 * tests/sets.at (Accept): New.
8776
8777 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8778
8779 * data/glr.c (yyfill): Adjust comment.
8780 (yyresolveAction): Initialize default location properly
8781 for empty right-hand sides.
8782 (yydoAction): Ditto.
8783 Add comment explaining apparently dead code.
8784 * tests/glr-regression.at
8785 (Incorrectly initialized location for empty right-hand side in GLR):
8786 New test.
8787
8788 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
8789
8790 * bootstrap (cleanup_gnulib): New function. Use it to clean up
8791 gnulib when interrupted. This fixes some race conditions and
8792 works around some portability problems (one noted by Paul
8793 Hilfinger).
8794
8795 2005-10-22 Akim <akim@epita.fr>
8796
8797 * Makefile.cfg: Adjust to config -> build-aux.
8798 Reported by twledo.
8799
8800 2005-10-21 Akim Demaille <akim@epita.fr>
8801
8802 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
8803 the %parse-params.
8804 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
8805 * data/yacc.c (b4_Pure_if): Rename as...
8806 (b4_yacc_pure_if): this.
8807 (YY_SYMBOL_PRINT, yyparse): Adjust.
8808 * doc/bison.texinfo: Formatting changes.
8809
8810 2005-10-21 Akim Demaille <akim@epita.fr>
8811
8812 Finish the transition config -> build-aux.
8813 * configure.ac, Makefile.am: Use build-aux.
8814 * config/prev-version, config/announce-gen, config/Makefile.am:
8815 Move to...
8816 * build-aux/prev-version, build-aux/announce-gen,
8817 * build-aux/Makefile.am: here.
8818
8819 2005-10-14 Akim Demaille <akim@epita.fr>
8820
8821 * examples/calc++/test: Use set -x only when VERBOSE.
8822
8823 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
8824
8825 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
8826 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
8827
8828 2005-10-13 Akim Demaille <akim@epita.fr>
8829
8830 * src/scan-skel.l: Output the base name parts of the parser and
8831 header file names.
8832 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
8833 additional checks.
8834 Use this to exercise C++ outputs in subdirs.
8835 Reported by Oleg Smolsky.
8836
8837 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
8838
8839 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
8840 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
8841 Problem reported by John P. Hartmann.
8842 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
8843 already defined it.
8844
8845 2005-10-12 Akim Demaille <akim@epita.fr>
8846
8847 * src/parse-gram.y (version_check): Exit 63 to please missing
8848 (stands for "version mismatch).
8849 * tests/input.at, doc/bison.texinfo: Adjust.
8850
8851 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
8852
8853 Work around portability problems with Visual Age C compiler
8854 (xlc and xlC_r) reported by John P. Hartmann.
8855 * data/location.cc (initial_column, initial_line): Remove.
8856 All uses replaced by 0 and 1.
8857 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
8858 that xlc complains about.
8859 * src/scan-skel.l (skel_wrap): Likewise.
8860 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
8861 as __STDC__.
8862 * data/yacc.c (YYMODERN_C): New macro, which also looks at
8863 __STDC_VERSION__. Use it everywhere instead of looking at
8864 __STDC__ and __cplusplus.
8865
8866 2005-10-10 Akim Demaille <akim@epita.fr>
8867
8868 * examples/calc++/test: Be quiet unless VERBOSE.
8869
8870 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
8871
8872 * data/c.m4 (yydestruct, yysymprint):
8873 Use YYUSE instead of casting to void.
8874 * data/glr.c (YYUSE): New macro.
8875 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
8876 Use it instead of rolling our own.
8877 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
8878 (YYCHK1):
8879 Use /*CONSTCOND*/ to suppress lint warnings.
8880 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
8881 (YY_STACK_PRINT): Use 'false' not '0'.
8882 (YYUSE): New macro.
8883 (yysymprint_, yydestruct_): Use it instead of rolling our own.
8884 * data/yacc.c (YYUSE): New macro.
8885 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
8886 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
8887 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
8888
8889
8890 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
8891 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
8892
8893 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
8894
8895 Undo the parts of the unlocked-I/O change that substituted
8896 putc or puts for printf. This might hurt performance a bit,
8897 but some people prefer the printf style.
8898 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
8899 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
8900 All uses replaced by YYFPRINTF and YYDPRINTF.
8901 * data/yacc.c: Likewise.
8902 * lib/bitset.c (bitset_print): Likewise.
8903 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
8904 putc and puts.
8905 * lib/lbitset.c (debug_lbitset): Likewise.
8906 * src/closure.c (print_firsts, print_fderives): Likewise.
8907 * src/gram.c (grammar_dump): Likewise.
8908 * src/lalr.c (look_ahead_tokens_print): Likewise.
8909 * src/output.c (escaped_output): Likewise.
8910 (user_actions_output): Break apart two printfs.
8911 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
8912 * src/reduce.c (reduce_print): Likewise.
8913 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
8914 * src/system.h: Include unlocked-io.h rathe than stdio.h.
8915
8916 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
8917 Use assignments rather than casts-to-void to suppress
8918 unused-variable warnings. This pacifies 'lint'.
8919 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
8920 unused-variable warnings.
8921
8922 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8923
8924 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
8925
8926 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
8927
8928 Use unlocked I/O for a minor performance improvement on hosts like
8929 GNU/Linux and Solaris that support unlocked I/O. The basic idea
8930 is to use the gnlib unlocked-io module, and to prefer putc and
8931 puts to printf when either will work (since the latter doesn't
8932 come in an unlocked flavor).
8933 * bootstrap (gnulib_modules): Add unlocked-io.
8934 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
8935 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
8936 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
8937 and similarly for puts and putc and printf.
8938 * data/yacc.c: Likewise.
8939 * lib/bitset.c (bitset_print): Likewise.
8940 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
8941 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
8942 to printf.
8943 * lib/lbitset.c (debug_lbitset): Likewise.
8944 * src/closure.c (print_firsts, print_fderives): Likewise.
8945 * src/gram.c (grammar_dump): Likewise.
8946 * src/lalr.c (look_ahead_tokens_print): Likewise.
8947 * src/output.c (escaped_output): Likewise.
8948 (user_actions_output): Coalesce two printfs.
8949 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
8950 * src/reduce.c (reduce_print): Likewise.
8951 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
8952 * src/system.h: Include unlocked-io.h rather than stdio.h.
8953
8954 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
8955 this confuses xgettext.
8956
8957 2005-10-02 Akim Demaille <akim@epita.fr>
8958
8959 * bootstrap (gnulib_modules): Add strverscmp.
8960 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
8961 * m4/.cvsignore: Add strverscmp.m4.
8962 * src/parse-gram.y (%require): New token, new rule.
8963 (version_check): New.
8964 * src/scan-gram.l (%require): Adjust.
8965 * tests/input.at (AT_REQUIRE): New.
8966 Use it.
8967 * doc/bison.texinfo (Require Decl): New.
8968 (Calc++ Parser): Use %require.
8969
8970 2005-10-02 Akim Demaille <akim@epita.fr>
8971
8972 * data/location.cc: New.
8973
8974 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
8975 Akim Demaille <akim@epita.fr>
8976
8977 Make sure -odir/foo.cc creates dir/location.hh etc.
8978 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
8979 (spec_file_prefix, spec_verbose_file, spec_graph_file)
8980 (spec_defines_file): Now const.
8981 (dir_prefix): New.
8982 (short_base_name): Remove.
8983 * src/files.c: Adjust.
8984 (dirname.h): Include.
8985 (base_name): Don't prototype it.
8986 (finput): Remove, duplicates gram_in.
8987 (full_base_name, short_base_name): Replace by...
8988 (all_but_ext, all_but_tab_ext): these.
8989 (compute_base_names): Rename as...
8990 (compute_file_name_parts): this.
8991 Update to compute the new variables, including dir_prefix.
8992 Adjust dependencies.
8993 * src/output.c (prepare): Output them.
8994 * src/reader.c: Adjust to use gram_in, not finput.
8995 * src/scan-skel.l (@dir_prefix@): New.
8996
8997 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8998
8999 * lib/subpipe.c: New function end_of_output_subpipe() added
9000 to allow support for non-posix systems. This is a no-op function
9001 for posix systems.
9002
9003 * lib/subpipe.h: New function end_of_output_subpipe() added
9004 to allow support for non-posix systems. This is a no-op function
9005 for posix systems.
9006
9007 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
9008 handle the lack of pipe/fork functionality on non-posix systems.
9009
9010 * djgpp/Makefile.maint: DJGPP specific file.
9011
9012 * djgpp/README.in: DJGPP specific file.
9013
9014 * djgpp/config.bat: DJGPP specific configuration file.
9015
9016 * djgpp/config.sed: DJGPP specific configuration file.
9017
9018 * djgpp/config.site: DJGPP specific configuration file.
9019
9020 * djgpp/config_h.sed: DJGPP specific configuration file.
9021
9022 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
9023
9024 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
9025
9026 2005-10-02 Akim Demaille <akim@epita.fr>
9027
9028 * data/location.cc: New, extract from...
9029 * data/lalr1.cc: here.
9030 (location.hh): Include it after the user prologue, in case the
9031 filename type is defined by the user.
9032 Forward declation location and position before the pre-prologue.
9033 (yyresult_): Rename as...
9034 (yyresult): this, it's a local variable, not an attribute.
9035 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
9036
9037 2005-10-01 Akim Demaille <akim@epita.fr>
9038
9039 * examples/extexi: Restore the #line generation.
9040
9041 2005-09-30 Akim Demaille <akim@epita.fr>,
9042 Alexandre Duret-Lutz <adl@gnu.org>
9043
9044 Move the token type and YYSTYPE in the parser class.
9045 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
9046 (parser::token): New, from the moved free definition of tokens.
9047 (parser::semantic_value): Now a full definition instead of an
9048 indirection to YYSTYPE.
9049 (b4_post_prologue): No longer included in the header file, but
9050 in the implementation file.
9051 * doc/bison.texi (C+ Language Interface): Update.
9052 * src/parse-gram.y: Support unary %define.
9053 * tests/actions.at: Define global_tokens_and_yystype for backward
9054 compatibility until we update the tests.
9055 * tests/calc.at: Idem.
9056 (first_line, first_column, last_line, last_column): Define for lalr1.cc
9057 to simplify the code.
9058
9059 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
9060
9061 Port to SunOS 4.1.4, which lacks strtoul and strerror.
9062 Ah, the good old days! Problem reported by Peter Klein.
9063 * bootstrap (gnulib_modules): Add strerror, strtoul.
9064 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
9065 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
9066
9067 2005-09-29 Akim Demaille <akim@epita.fr>
9068
9069 * data/c.m4 (b4_error_verbose_if): New.
9070 * data/lalr1.cc: Use it.
9071 (YYERROR_VERBOSE_IF): Remove.
9072 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
9073 parser members, replaced by...
9074 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
9075 local variables.
9076 (yysyntax_error_): Takes the state number as argument.
9077 (yyreduce_print_): Use the argument yyrule, not the former
9078 attribute yyn_.
9079
9080 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
9081
9082 * bootstrap (gnulib_modules): Add verify.
9083 * lib/.cvsignore: Add verify.h.
9084 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
9085 * src/system.h (verify): Remove.
9086 Include verify.h instead.
9087 * src/tables.c (tables_generate): Use new API for 'verify'.
9088
9089 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
9090
9091 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
9092 local variables whose names begin with 'yy'.
9093 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
9094 Trivial changes from Joel E. Denny.
9095
9096 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
9097 it itself.
9098 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
9099 don't use alloca any more.
9100
9101 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
9102 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
9103 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
9104 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
9105 to match yacc.c, to test more hosts.
9106
9107 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
9108
9109 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
9110 doesn't affect behavior.
9111 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
9112 Solaris, AIX, MSC.
9113 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
9114 This works a bit better with glibc, if user code has already included
9115 stdlib.h.
9116 * doc/bison.texinfo (Bison Parser): Document that users can't
9117 arbitrarily use malloc and free for other purposes. Document
9118 that <alloca.h> and <malloc.h> might be included.
9119 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
9120 user must declare alloca.
9121
9122 * HACKING (release): Forwarn the Translation Project about
9123 stable releses.
9124
9125 2005-09-20 Akim Demaille <akim@epita.fr>
9126
9127 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
9128
9129 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
9130
9131 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
9132 (YYSTACK_ALLOC_MAXIMUM): Use it.
9133 (yysyntax_error): New function.
9134 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
9135 multiple syntax errors are reported, and alloca is being used.
9136 Instead, reallocate buffers twice as big each time, so that
9137 we waste at most half the allocated memory. Start with a small
9138 (128-byte) buffer that will suffice in most cases anyway.
9139 Use yysyntax_error to do most of the work.
9140
9141 * doc/bison.texinfo (Error Reporting, Table of Symbols):
9142 yynerrs is the number of errors reported, not the number of
9143 errors encountered.
9144
9145 * tests/glr-regression.at (Duplicated user destructor for lookahead):
9146 Mark it as expected to fail.
9147 Cast result of malloc; problem reported by twlevo@xs4all.nl.
9148 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
9149 Don't start user-code symbols with "yy", to avoid name space problems.
9150
9151 2005-09-19 Akim Demaille <akim@epita.fr>
9152
9153 Remove the traits, failed experiment.
9154 It never proved useful, and anyway because of the current
9155 definition, it was not possible to have several specialization of
9156 this traits, making it useless.
9157 * data/lalr1.cc (yy:traits): Remove.
9158 Inline its definitions in the parser class.
9159
9160 2005-09-19 Akim Demaille <akim@epita.fr>
9161
9162 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
9163 least Mac OSX with a /usr/local install of gettext.
9164
9165 2005-09-19 Akim Demaille <akim@epita.fr>
9166
9167 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
9168 and yytoken for similarity with the other skeletons.
9169
9170 2005-09-19 Akim Demaille <akim@epita.fr>
9171
9172 * NEWS, configure.ac: update version number to 2.1a.
9173
9174 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
9175
9176 * NEWS: Version 2.1.
9177
9178 * NEWS: Remove notice of yytname change, since it was never in an
9179 official release.
9180 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
9181 diagnostic.
9182 * src/output.c (prepare): Likewise.
9183 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
9184 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
9185 is not defined. This is an awful hack, but it's enough for now.
9186 All callers changed.
9187 * tests/glr-regression-at (make_value): Args are const pointers now,
9188 to avoid GCC warning.
9189 (Duplicated user destructor for lookahead): New test. Currently
9190 skipped. It fails on my host but I'm not sure it'll always fail.
9191
9192 2005-09-16 Akim Demaille <akim@epita.fr>
9193
9194 * src/symtab.h (struct symbol): Declare the printer and destructor
9195 as const, to avoid accidental calls to free.
9196 (symbol_destructor_set, symbol_printer_set): Adjust.
9197 * src/symtab.c: Adjust.
9198
9199 2005-09-16 Akim Demaille <akim@epita.fr>
9200
9201 * data/c.m4 (b4_token_enums): New.
9202 (b4_token_defines): Rename as...
9203 (b4_token_enums_defines): this.
9204 (b4_token_defines): New, output only the #defines.
9205 * data/yacc.c, data/glr.c: Adjust.
9206 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
9207 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
9208 as default values.
9209
9210 2005-09-16 Akim Demaille <akim@epita.fr>
9211
9212 * data/lalr1.cc (yylex_): Remove, inline its code.
9213 (yyreport_syntax_error_): Remove, replaced by...
9214 (yysyntax_error_): this which returns a string and leaves to the
9215 caller the call to the users' error function.
9216 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
9217 Move from members of the parser object...
9218 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
9219 to local variables of the parse function.
9220
9221 2005-09-16 Akim Demaille <akim@epita.fr>
9222
9223 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
9224 since it's in Bison's name space.
9225
9226 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
9227
9228 * data/glr.c (yyresolveValue): Add default case to pacify
9229 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
9230
9231 * NEWS: Document when yyparse started to return 2.
9232 * doc/bison.texinfo (Parser Function): Document when yyparse
9233 returns 2.
9234
9235 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
9236 (b4_filename_type): Renamed back from b4_file_name_type. All uses
9237 changed.
9238 (class position): file_name -> filename (reverting). All uses changed.
9239
9240 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
9241
9242 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
9243 do anything if $@ exists. This reverts part of the 2005-07-07
9244 patch.
9245
9246 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
9247
9248 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
9249 contains obsolete information and isn't worth distributing as a
9250 separate file anyway.
9251 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
9252 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
9253 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
9254 (yyparse): Abort if user code uses longjmp to throw an unexpected
9255 value.
9256
9257 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
9258
9259 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
9260 Suggested by twlevo@xs4all.nl.
9261
9262 * data/glr.c (YYCHK1): Do not assume YYE is in range.
9263 This avoids a diagnostic from gcc -Wswitch-enum.
9264 Problem reported by twlevo@xs4all.nl.
9265
9266 * doc/bison.texinfo: Don't use "filename", as per GNU coding
9267 standards. Use "file name" or "file" or "name", depending on
9268 the context.
9269 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
9270 not to hack/foo.tab.c.
9271 (Calc++ Top Level): 2nd arg of main is not const.
9272 * data/glr.c: b4_filename -> b4_file_name.
9273 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
9274 All uses changed.
9275 (class position): filename -> file_name. All uses changed.
9276 * data/yacc.c: b4_filename -> b4_file_name.
9277 * lib/bitset.h: filename -> file_name in local vars.
9278 * lib/bitset_stats.c: Likewise.
9279 * src/files.c: Likewise.
9280 * src/scan-skel.l ("@output ".*\n): Likewise.
9281 * src/files.c (file_name_split): Renamed from filename_split.
9282 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
9283
9284 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
9285
9286 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
9287 to accommodate latest gnulib.
9288
9289 * tests/glr-regression.at (Duplicate representation of merged trees):
9290 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
9291
9292 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
9293 needed.
9294
9295 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
9296
9297 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
9298 All uses changed. Invoke user destructor after an error during a
9299 split parse (trivial change from Joel E. Denny).
9300
9301 * tests/glr-regression.at
9302 (User destructor after an error during a split parse): New test case.
9303 Problem reported by Joel E. Denny in:
9304 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
9305
9306 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
9307
9308 * README-cvs: Give URLs for recommended tools.
9309 Mention Gzip version problem, and bootstrapping issues.
9310 Remove troubleshooting section, as it's somewhat obsolete.
9311
9312 * bootstrap (no_cache): New var, to accommodate different wget
9313 variants. Use it instead of '-C off'. Problem reported by
9314 twlevo@xs4all.nl.
9315
9316 * data/glr.c (yydestroyStackItem): New function.
9317 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
9318 debugging information. Problem reported by Joel E. Denny.
9319
9320 2005-08-25 Akim Demaille <akim@epita.fr>
9321
9322 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
9323
9324 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
9325
9326 * data/glr.c (yyrecoverSyntaxError, yyreturn):
9327 Don't invoke destructor on unresolved entries.
9328 * tests/glr-regression.at
9329 (User destructor for unresolved GLR semantic value): New test case.
9330 Problem reported by Joel E. Denny in:
9331 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
9332
9333 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
9334
9335 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
9336 Add strnlen.c.
9337 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
9338 lib-prefix.m4, po.m4.
9339
9340 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
9341 in yydestruct diagnostic, since it might not be an error.
9342 Problem reported by Joel Denny near end of
9343 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
9344 * data/lalr1.cc (yyerturn): Likewise.
9345 * data/yacc.c (yyreturn): Likewise.
9346 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
9347
9348 * src/files.c: Remove obsolete FIXME comment.
9349
9350 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
9351 with the other templates, and to fix bogus run-on messages such
9352 as the one reported at the end of
9353 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
9354 All callers changed to avoid the newline.
9355 (yyprocessOneStack): Output two lines rather than one, to accommodate
9356 the above change. This changes the debug output format slightly.
9357
9358 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
9359 reported by Joel E. Denny in
9360 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
9361 (trivial change).
9362 * tests/glr-regression.at (Duplicate representation of merged trees):
9363 New test, from Joel E. Denny in:
9364 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
9365 * THANKS: Add Joel E. Denny.
9366
9367 * configure.ac (AC_INIT): Bump to 2.0c.
9368
9369 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
9370
9371 * NEWS: Version 2.0b.
9372
9373 * Makefile.am (SUBDIRS): Put examples before tests, so that
9374 "make check" doesn't finish with "All 1 tests passed".
9375
9376 * tests/regression.at (Token definitions): Don't rely on
9377 AT_PARSER_CHECK for data that contains backslashes. It currently
9378 uses 'echo', and 'echo' isn't portable if its argument contains
9379 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
9380 that the byte '\0xff' is not printable in the C locale; it is,
9381 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
9382 not printable, so use '\0x81' to test.
9383
9384 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
9385 version of GCC, since the macro is used with non-GCC compilers.
9386
9387 Fix core dump reported by Pablo De Napoli in
9388 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
9389 * tests/regression.at (Invalid inputs with {}): New test.
9390 * src/parse-gram.y (token_name): Translate type before using
9391 it as an index.
9392
9393 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
9394 the user's name space. All uses changed to __attribute__
9395 ((__unused__)).
9396 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
9397 Add __attribute__ ((__noreturn__)).
9398
9399 * etc/clcommit: Remove. We weren't using it, and it failed
9400 "make maintainer-distcheck".
9401 * Makefile.maint: Merge from coreutils.
9402 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
9403 (syntax-check-rules): Change list of rules as described below.
9404 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
9405 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
9406 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
9407 (sc_trailing_space): New rules.
9408 (sc_xalloc_h_in_src): Remove.
9409 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
9410 (sc_space_tab, sc_error_exit_success, sc_changelog):
9411 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
9412 (makefile-check, po-check, author_mark_check):
9413 (makefile_path_separator_check, copyright-check):
9414 Use grep -n, to make it easier to find violations.
9415 Use CVS_LIST and CVS_LIST_EXCEPT.
9416 (header_regexp, h_re): Remove.
9417 (dd_c): New macro.
9418 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
9419 (my-distcheck): Use more-modern GCC flags.
9420 (signatures, %.asc): Remove.
9421 (rel-files, announcement): Remove signatures.
9422 Restore old updating code, even though we don't use it, so
9423 that we're the same as coreutils.
9424 (alpha, beta, major): Depend on news-date-check.
9425 Make the upload commands.
9426
9427 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
9428 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
9429 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
9430 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
9431 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
9432 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
9433 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
9434 * tests/sets.at: Likewise.
9435
9436 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
9437 we comment out the Autoconf version number.
9438 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
9439 it's error-prone and "make maintainer-distcheck" rejects it.
9440
9441 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
9442 Indent calls to "error" to pacify "make maintainer-distcheck",
9443 when the calls are not intended to be translated.
9444 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
9445
9446 * src/Makefile.am (DEFS): Use +=, to pacify
9447 "make maintainer-distcheck".
9448 (bison_SOURCES): Add scan-skel.h.
9449 (sc_tight_scope): New rule, from coreutils.
9450
9451 * src/files.c (src_extension, header_extension):
9452 Now static, not extern.
9453 * src/getargs.c (short_options): Likewise.
9454 * src/muscle_tab.c (muscle_table): Likewise.
9455 * src/parse-gram.y (current_class, current_type, current_prec):
9456 Likewise.
9457 * src/reader.c (grammar_end, previous_rule_end): Likewise.
9458 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
9459 * src/main.c (main): Cast bindtextdomain and textdomain calls to
9460 void, to avoid warning when NLS is disabled.
9461 * src/output.c: Include scan-skel.h.
9462 (scan_skel): Remove decl, since scan-skel.h does this.
9463 (output_skeleton):
9464 Indent calls to "error" to pacify "make maintainer-distcheck".
9465 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
9466 * src/reader.h (gram_end, gram_lineno): New decls to pacify
9467 "make maintainer-distcheck".
9468 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
9469 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
9470 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
9471 (skel_lex_destroy, scan_skel): Move these decls to...
9472 * src/scan-skel.h: New file.
9473 * src/uniqstr.c (uniqstr_assert):
9474 Indent calls to "error" to pacify "make maintainer-distcheck".
9475
9476 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
9477 not @VAR@.
9478
9479 * tests/torture.at: Revamp to avoid misuse of atoi that
9480 "make maintainer-distcheck" complained about.
9481
9482 * examples/extexi (message): Don't print a message more than once,
9483 and omit line-number decoration that makes Emacs compile think
9484 that informative messages are worth worrying about.
9485
9486 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
9487
9488 * configure.ac: Update version number.
9489
9490 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
9491 accidentally.
9492 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
9493 autogenerated by the maintainer.
9494 * examples/calc++/.cvsignore: Add *.yy.
9495
9496 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
9497 * lib/bitset_stats.c (bitset_stats_init): Likewise.
9498 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9499
9500 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
9501
9502 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
9503 from maintainer-distcheck about casting the argument of 'free'.
9504
9505 * NEWS: Mention recent yytname changes.
9506 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
9507
9508 * bootstrap: For translations that have not yet been upgraded to
9509 the new runtime-po domain, prime the pump by extracting the
9510 relevant strings from the obsolete translations. This code can be
9511 removed once the bison-runtime domain has been translated by each
9512 team.
9513
9514 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
9515 now that token names are already quoted.
9516
9517 Fix problem reported by Anthony Heading.
9518 * data/glr.c (YYTOKEN_TABLE): New macro.
9519 (yytname): Define if YYTOKEN_TABLE.
9520 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
9521 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
9522 (YYERROR_VERBOSE): Define the same way the other skeletons do.
9523 * src/output.c (prepare_symbols): Output token_table_flag.
9524
9525 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
9526
9527 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
9528 again if the first call fails.
9529
9530 * data/glr.c (yytnamerr): New function.
9531 (yyreportSyntaxError): Use it to dequote most string literals.
9532 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
9533 with other skeletons. All uses changed.
9534 (yytnameerr_): New function.
9535 (yyreport_syntax_error): Use it to dequote most string literals.
9536 * data/yacc.c (yytnamerr): New function.
9537 (yyerrlab): Use it to decode most string literals.
9538 * doc/bison.texinfo (Decl Summary, Calling Convention):
9539 Clarify quoting convention of yytname.
9540 * src/output.c (prepare_symbols): Quote all names. This undoes
9541 the 2005-04-17 change, which is now accomplished (mostly) via
9542 changes in the parsers as described above.
9543 * tests/regression.at (Token definitions, Web2c Actions):
9544 Undo most 2005-04-17 change here, too.
9545
9546 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
9547
9548 Fix more problems reported by twlevo@xs4all.nl.
9549 * tests/cxx-type.at: Don't pipe output of ./types through sed to
9550 remove trailing spaces. This loses the exit status of ./types,
9551 and isn't needed since ./types shouldn't be emitting trailing
9552 spaces.
9553 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
9554 as the stack isn't valid in that case.
9555
9556 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
9557 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
9558 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
9559 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
9560 is used.
9561 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
9562 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
9563 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
9564 Likewise.
9565
9566 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
9567 overly-picky compilers that reject 'char *foo = "bar";'.
9568
9569 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
9570 to FILE * parameter, not to stderr. This fixes a typo introduced
9571 in the 2005-07-12 change.
9572
9573 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
9574 warnings from GCC 4.
9575
9576 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
9577 (yyglrShiftDefer, yysplitStack):
9578 Remove unused parameters b4_pure_formals. All uses changed.
9579 (yyglrShift): Remove unused parameters b4_user_formals.
9580 All uses changed.
9581 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
9582
9583 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
9584
9585 Destructor cleanups and regularization among the three skeletons.
9586 * NEWS: Document the behavior changes.
9587 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
9588 stack before failing, as the cleanup code will do it for us now.
9589 * data/lalr1.cc (yyerrlab): Likewise.
9590 * data/glr.c (yyparse): Pop everything off the stack before
9591 freeing it, so that destructors get called properly.
9592 * data/lalr1.cc (yyreturn): Likewise.
9593 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
9594 This is more consistent.
9595 * doc/bison.texinfo (Destructor Decl): Mention more reasons
9596 why destructors might be called. 1.875 -> 2.1.
9597 (Destructor Decl, Decl Summary, Table of Symbols):
9598 Some English-language cleanups for %destructor.
9599 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9600 Add output line for destructor of start symbol.
9601 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
9602 because of that same extra output line.
9603
9604 * NEWS: Document minor wording changes in diagnostics of
9605 Bison-generated parsers.
9606 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
9607 Remove unused formals. All uses changed.
9608 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
9609 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
9610 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
9611 Rename yyoverflowab to yyexhaustedlab.
9612 When memory exhaustion occurs during syntax-error reporting,
9613 report it separately rather than in a single diagnostic; this
9614 eases translation.
9615 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
9616 (Memory Exhausted): Renamed from Parser Stack Overflow.
9617 Revamp wording slightly to prefer "memory exhaustion".
9618 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
9619
9620 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
9621
9622 Add i18n support to the GLR skeleton. Partially fix the C++
9623 skeleton; a C++ expert needs to finish this. Remove debugging
9624 msgids; there's little point to having them translated, since they
9625 can be understood only by someone who can read the
9626 (English-language) source code.
9627
9628 Generate runtime-po/bison-runtime.pot automatically, so that we
9629 don't have to worry about garbage getting in that file. We'll
9630 make sure after the next official release that old msgids don't
9631 get lost. See
9632 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
9633
9634 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
9635 Now auto-generated.
9636 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
9637 Fix typos in explanations of the runtime file.
9638 * bootstrap: Change gettext keyword from YYI18N to YY_.
9639 Use standard Makefile.in.in in runtime-po, since we'll arrange
9640 for backward-compatible bison-runtime.po files in a different way.
9641 * data/glr.c (YY_): New macro, from yacc.c.
9642 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
9643 Translate messages intended for users.
9644 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
9645 the wording in the other skeletons. We don't know that the memory
9646 is virtual.
9647 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
9648 Use same method that yacc.c uses.
9649 Don't translate debugging messages.
9650 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
9651 it doesn't work (yet), and requires C++ expertise to fix.
9652 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
9653 Move defn to a more logical place, to be consistent with other
9654 skeletons.
9655 Don't translate debugging messages.
9656 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
9657 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
9658 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
9659 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
9660
9661 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
9662 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
9663 void, not int.
9664 * tests/glr-regression.at (Badly Collapsed GLR States):
9665 Likewise.
9666 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9667 yylex should return 0 at EOF rather than aborting.
9668
9669 Improve tests for stack overflow in GLR parser.
9670 Problem reported by twlevo@xs4all.nl.
9671 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
9672 All uses removed.
9673 (yyStackOverflow): Just longjmp, but with value 2 so that caller
9674 can handle the problem.
9675 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
9676 (yyparse): New local variable yyresult to record the result.
9677 Use result of setjmp to set it, rather than storing itinto
9678 struct.
9679 (yyDone): Remove label.
9680 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
9681 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
9682 if YYABORT is used).
9683 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
9684 yyparse status; put status > 1 into diagnostic.
9685 Check that status==2 works.
9686 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
9687 Use exit status 3 for failure to open (which shouldn't happen).
9688
9689 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
9690
9691 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
9692 1 on syntax error; just let yyparse do its thing.
9693 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
9694 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
9695 (Exploding the Stack Size with Alloca):
9696 (Exploding the Stack Size with Malloc):
9697 Expect exit status 2, not 1, since the parser is supposed to blow
9698 its stack. Problem reported by twlevo@xs4all.nl.
9699
9700 * data/glr.c (yyparse): Don't assume that the initial calls
9701 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
9702 Print a stack-overflow message and fail instead.
9703 Initialize the line-number information before creating the stack,
9704 so that the stack-overflow message can report line zero safely.
9705
9706 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
9707
9708 Fix problems reported by twlevo@xs4all.nl.
9709 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
9710 (yyuserMerge): Provide a default case if b4_mergers is empty.
9711 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
9712 * tests/glr-regression.at
9713 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9714 Add casts to pacify C++ compilers.
9715 * tests/glr-regression.at (Improper merging of GLR delayed action
9716 sets): Declare yylex before using it.
9717 * tests/Makefile.am (maintainer-check-g++): Fix a stray
9718 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
9719 test for valgrind; valgrind is independent of g++.
9720 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
9721 for compatibility with POSIX 1003.1-2001 (if running coreutils).
9722 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
9723 Use a destructor, so that we can expand the stack. Change
9724 YYSTYPE to char * so that we can free it. Cast result of malloc.
9725
9726 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9727
9728 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
9729 a valgrind failure. Problem reported by twlevo@xs4all.nl.
9730
9731 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
9732
9733 * PACKAGING: New file, suggested by Bruno Haible and taken from
9734 similar wording in gettext's PACKAGING file.
9735 * NEWS: Mention PACKAGING.
9736 * Makefile.am (EXTRA_DIST): Add PACKAGING.
9737
9738 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
9739
9740 * NEWS: Document recent i18n improvements.
9741 * bootstrap: Get runtime translations into runtime-po.
9742 Create runtime-po files automatically, if possible.
9743 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
9744 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
9745 does not infringe on the user's name space.
9746 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
9747 * doc/bison.texinfo (Internationalization): Revamp the English
9748 and Texinfo syntax a bit, to try to make it clearer.
9749 (Bison Options, Option Cross Key): Mention --print-localedir.
9750 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
9751 YYENABLE_NLS. Quote a bit more.
9752 * runtime-po/.cvsignore: New file.
9753 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
9754 * runtime-po/Rules-quot: Remove; now created by bootstrap.
9755 * runtime-po/quot.sed: Likewise.
9756 * runtime-po/boldquot.sed: Likewise.
9757 * runtime-po/en@quot.header: Likewise.
9758 * runtime-po/en@boldquot.header: Likewise.
9759 * runtime-po/insert-header.sin: Likewise.
9760 * runtime-po/remove-potcdate.sin: Likewise.
9761 * runtime-po/Makevars: Likewise.
9762 * runtime-po/LINGUAS: Likewise.
9763 * runtime-po/de.po: Likewise; we will rely on the translation project
9764 to maintain this, so "bootstrap" should get it.
9765 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
9766 its value.
9767 * src/main.c (main): Bind the bison-runtime domain, too.
9768
9769 2005-07-12 Bruno Haible <bruno@clisp.org>
9770
9771 * data/yacc.c: Include <libintl.h> when NLS is enabled.
9772 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
9773 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
9774 * runtime-po: New directory.
9775 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
9776 $(DOMAIN).pot-update rule, so that old messages are never dropped.
9777 * runtime-po/Rules-quot: New file, copied from po/.
9778 * runtime-po/quot.sed: Likewise.
9779 * runtime-po/boldquot.sed: Likewise.
9780 * runtime-po/en@quot.header: Likewise.
9781 * runtime-po/en@boldquot.header: Likewise.
9782 * runtime-po/insert-header.sin: Likewise.
9783 * runtime-po/remove-potcdate.sin: Likewise.
9784 * runtime-po/Makevars: New file.
9785 * runtime-po/POTFILES.in: New file.
9786 * runtime-po/LINGUAS: New file.
9787 * runtime-po/bison-runtime.pot: New file.
9788 * runtime-po/de.po: New file.
9789 * m4/bison.m4: New file.
9790 * Makefile.am (SUBDIRS): Add runtime-po.
9791 (aclocaldir, aclocal_DATA): New variables.
9792 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
9793 Define aclocaldir.
9794 * src/getargs.c (usage): Document --print-localedir option.
9795 (PRINT_LOCALEDIR_OPTION): New enum item.
9796 (long_options): Add --print-localedir option.
9797 (getargs): Handle --print-localedir option.
9798 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
9799 (Internationalization): New section.
9800
9801 2005-07-12 Akim Demaille <akim@epita.fr>
9802
9803 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
9804 for consistency with the rest of the code.
9805 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
9806 Add separators.
9807
9808 2005-07-12 Akim Demaille <akim@epita.fr>
9809
9810 * src/parse-gram.y: Use %printer instead of YYPRINT.
9811
9812 2005-07-12 Akim Demaille <akim@epita.fr>
9813
9814 * src/symtab.h, src/symtab.c (symbol_print): New.
9815 * src/symlist.h, src/symlist.c (symbol_list_print): New.
9816 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
9817
9818 2005-07-12 Akim Demaille <akim@epita.fr>
9819
9820 * data/glr.c (b4_syncline): Fix (swap) the definitions of
9821 b4_at_dollar and b4_dollar_dollar.
9822
9823 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
9824
9825 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
9826 and Pennello's paper.
9827
9828 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
9829
9830 * data/yacc.c (yyparse): Undo previous patch. Instead,
9831 set yylsp[0] and yyvsp[0] only if the initial action
9832 sets yylloc and yylval, respectively.
9833
9834 * data/yacc.c (yyparse): In the initial action, set
9835 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
9836 This avoids the use of undefined variables if the initial
9837 action does not set yylloc and/or yylval.
9838
9839 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
9840
9841 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
9842 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
9843 Remove from CVS. These files are automatically generated.
9844 * examples/extexi: Clarify that this file is now part of Bison,
9845 not GNU M4, and that it works with any POSIX-compatible Awk.
9846 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
9847 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
9848 so that we also get calc++-parser.yy. Geneate it.
9849 Use $(AWK), not gawk, since any conforming Awk will do.
9850 Put comment before action, since older 'make' can't handle comment
9851 in action.
9852 $(BUILT_SOURCES): List all built sources, not just some of them.
9853 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
9854 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
9855 $($(calc_sources_generated)): Remove unnecessary test for existence
9856 of target. (This had a shell syntax error anyway; a stray "x".)
9857 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
9858 calc++-parser.yy.
9859 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
9860
9861 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
9862 implied by the other modules.
9863
9864 2005-07-06 Akim Demaille <akim@epita.fr>
9865
9866 Bind examples/calc++ to the package.
9867 * examples/calc++/Makefile: Remove, replaced by...
9868 * examples/calc++/Makefile.am: ... this new file.
9869 * examples/calc++/test: Remove input.
9870 * examples/calc++/compile: Remove.
9871 * examples/Makefile.am: New.
9872 * configure.ac, Makefile.am: Adjust.
9873 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
9874
9875 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
9876
9877 * data/glr.c (yyFail): Drastically simplify; since the format argument
9878 never had any % directives, we can simply pass it to yyerror.
9879 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
9880 be modified later, as that is the usual style in glr.c.
9881 Problems reported by Paul Hilfinger.
9882
9883 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
9884 and size overflow errors.
9885 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
9886 in case the user prolog sets feature-test macros like _GNU_SOURCE.
9887 (YYSIZEMAX): New macro.
9888 (yystpcpy): New function, taken from yacc.c.
9889 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
9890 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
9891 so that we don't have to maintain their signatures.
9892 (yyFail): Check for buffer overflow, by using vsnprintf rather
9893 than vsprintf. Allocate a bigger buffer if possible.
9894 Report an error if buffer allocation fails.
9895 (yyStackOverflow): New function.
9896 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
9897 the initialization was successful. It might fail if storage was
9898 exhausted.
9899 (yyexpandGLRStack): Add more checks for storage allocation failure.
9900 Use yyStackOverflow to report failures.
9901 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
9902 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
9903 Don't assume stack number fits in int.
9904 (yysplitStack): Check for storage allocation failure.
9905 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
9906 can print diagnostics on storage allocation failure. All callers
9907 changed.
9908 (yyresolveValue): Use yybool for boolean.
9909 (yyreportSyntaxError): Check for size-calculation overflow.
9910 This code is taken from yacc.c.
9911 (yyparse): Check for storage allocation errors when allocating
9912 the initial stack.
9913
9914 2005-07-05 Akim Demaille <akim@epita.fr>
9915
9916 Extract calc++ from the documentation.
9917 * doc/bison.texinfo (Calc++): Add the extraction marks.
9918 * examples/extexi: New, from the aborted GNU Programming 2E.
9919 Separate the different paragraph of a file with empty lines.
9920 * examples/Makefile: Use it to extract the whole calc++ example.
9921
9922 2005-06-24 Akim Demaille <akim@epita.fr>
9923
9924 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
9925 class typedefs.
9926
9927 2005-06-22 Akim Demaille <akim@epita.fr>
9928
9929 * doc/bison.texinfo (C++ Language Interface): First stab.
9930 (C++ Parsers): Remove.
9931
9932 2005-06-22 Akim Demaille <akim@epita.fr>
9933
9934 * data/lalr1.cc (yylex_): Honor %lex-param.
9935
9936 2005-06-22 Akim Demaille <akim@epita.fr>
9937
9938 Start a set of simple examples.
9939 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
9940 * examples/calc++/calc++-driver.hh,
9941 * examples/calc++/calc++-parser.yy,
9942 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
9943 * examples/calc++/compile, examples/calc++/test: New.
9944
9945 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
9946
9947 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
9948 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
9949 which stems from the 2005-05-27 patch.
9950
9951 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9952
9953 * data/glr.c: Modify treatment of unused parameters to permit use
9954 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
9955
9956 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
9957
9958 Fix infringement on user name space reported by Janos Zoltan Szabo.
9959 * data/yacc.c (yyparse): strlen -> yystrlen.
9960
9961 2005-05-30 Akim Demaille <akim@epita.fr>
9962
9963 * data/lalr1.cc (_): New.
9964 Translate the various messages.
9965
9966 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
9967
9968 Fix infringement on user name space reported by Bruno Haible.
9969 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
9970 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
9971 the user's name space.
9972 (alloca): Include <stdlib.h> to get it, if it's not built in.
9973 (YYMALLOC, YYFREE): Define only if needed.
9974 (malloc, free): Declare, but only if needed, as this infringes on
9975 the user name space.
9976
9977 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
9978
9979 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
9980 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
9981 with %d format.
9982 * lib/ebitset.c (min, max): Undef before defining.
9983 * lib/vbitset.c (min, max): Likewise.
9984 * lib/subpipe.c (create_subpipe): Save local variables in case
9985 vfork clobbers them.
9986
9987 2005-05-24 Bruno Haible <bruno@clisp.org>
9988
9989 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
9990 error message syntax used by gcc-4.0.
9991
9992 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
9993
9994 * README: Mention m4 1.4.3. Remove obsolete advice about
9995 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
9996
9997 * bootstrap: Remove workaround for problem I encountered with
9998 gettext 0.14.1; it seems to be fixed now.
9999
10000 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
10001
10002 * NEWS: Version 2.0a.
10003
10004 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
10005 the previous change.
10006
10007 Various maintainer cleanups.
10008 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
10009 conftest*, for benefit of CVS commands run at the same time as
10010 "configure". Add build-aux, since "bootstrap" now creates it and
10011 its subfiles.
10012 * Makefile.cfg (move_if_change): Remove.
10013 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
10014 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
10015 (po_repo, do-po-update, po-update, wget_files, get-targets):
10016 (config.guess-url_prefix, config.sub-url_prefix):
10017 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
10018 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
10019 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
10020 Remove.
10021 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
10022 this is now the recommended name.
10023 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
10024 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
10025 ylwrap. These files now go into build-aux.
10026 * config/move-if-change: Remove.
10027 * config/prev-version.txt: Bump from 1.75 to 2.0.
10028
10029 * bootstrap: Add stdio-safer, unistd-safer modules.
10030 Remove m4/glibc2.m4 (introduced by latest gnulib, but
10031 we don't need it).
10032 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
10033 fopen-safer.c, stdio-safer.h, unistd-safer.h.
10034 * lib/subpipe.c: Include "unistd-safer.h".
10035 (create_subpipe): Make sure all the newly-created
10036 file descriptors are > 2, so that diagnostics don't
10037 get sent down them (which might cause Bison to hang, in theory).
10038 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
10039 * src/files.c (xfopen): Use fopen_safer, not fopen.
10040
10041 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
10042 yesterday's yacc.c fix.
10043
10044 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
10045
10046 * data/glr.c, data/lalr1.cc: Update copyright date.
10047
10048 Fix a destructor bug reported by Wolfgang Spraul in
10049 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
10050 * data/yacc.c (yyabortlab): Don't call destructor, and
10051 don't set yychar to EMPTY.
10052 (yyoverflowlab): Don't call destructor.
10053 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
10054 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
10055 since we no longer output the message "discarding lookahead token
10056 end of input ()".
10057
10058 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10059
10060 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
10061 fix a small glitch in debugging output.
10062 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
10063 after YY_SYMBOL_PRINT where needed.
10064
10065 (struct yyGLRState): Add some comments.
10066 (struct yySemanticOption): Add some comments.
10067 (union yyGLRStackItem): Add comment.
10068
10069 (yymergeOptionSets): Correct this to properly perform the union,
10070 avoiding infinite reported by Michael Rosien.
10071 Update comment.
10072
10073 * tests/glr-regression.at: Add test for GLR merging error reported
10074 by M. Rosien.
10075
10076 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
10077
10078 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
10079 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
10080 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
10081 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
10082 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
10083 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
10084 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
10085 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
10086 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
10087 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
10088 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
10089 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
10090 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
10091 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
10092 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
10093 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
10094 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
10095 src/derives.h, src/files.c, src/files.h, src/getargs.c,
10096 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
10097 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
10098 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
10099 src/output.h, src/parse-gram.c, src/parse-gram.h,
10100 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
10101 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
10102 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
10103 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
10104 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
10105 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
10106 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
10107 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
10108 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
10109 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
10110 tests/reduce.at, tests/regression.at, tests/sets.at,
10111 tests/synclines.at, tests/testsuite.at, tests/torture.at:
10112 Update FSF postal mail address.
10113
10114 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
10115
10116 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
10117 Problem reported by Ralf Menzel.
10118
10119 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
10120
10121 * tests/actions.at: Test that stack overflow invokes destructors.
10122 From Marcus Holland-Moritz.
10123 * data/yacc.c (yyerrlab): Move the code that destroys the stack
10124 from here....
10125 (yyreturn): to here. That way, destructors are called properly
10126 even if the stack overflows, or the user calls YYACCEPT or
10127 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
10128 (yyoverflowlab): Destroy the lookahead.
10129
10130 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
10131
10132 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
10133
10134 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
10135
10136 * NEWS: Bison-generated C parsers no longer quote literal strings
10137 associated with tokens.
10138 * src/output.c (prepare_symbols): Don't escape strings,
10139 since users don't want to see C escapes.
10140 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
10141 in diagnostics.
10142 * tests/input.at (Torturing the Scanner): Likewise.
10143 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
10144
10145 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
10146
10147 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
10148 the data size is known to be too small and we can't increase it.
10149 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
10150
10151 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
10152
10153 * src/parse-gram.y: Include quotearg.h.
10154 (string_as_id): Quote $1 before using it as a key, since the
10155 lexer no longer quotes it for us.
10156 (string_content): Don't strip quotes, since lexer no longer
10157 quotes it for us.
10158 * src/scan-gram.l: Include quotearg.h.
10159 ("\""): Omit quote.
10160 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
10161 a key, since the rest of the lexer doesn't quote it.
10162 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
10163 * tests/regression.at (Token definitions): Check for backslashes
10164 in token strings.
10165
10166 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
10167 (YYSIZE_T): Define to unsigned long int when using an older compiler.
10168 (yyparse): Revamp code to generate long syntax error message, to
10169 make it easier to translate, and to avoid problems with arithmetic
10170 overflow. Change "virtual memory" to "memory" in diagnostic, since
10171 we don't know whether the memory is virtual.
10172
10173 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
10174
10175 * NEWS: Bison-generated C parsers now use the _ macro to
10176 translate strings.
10177 * data/yacc.c (_) [!defined _]: New macro.
10178 All English strings wrapped inside this macro.
10179 * doc/bison.texinfo (Bison Parser): Document _.
10180 * po/POTFILES.in: Include src/parse-gram.c, since it now
10181 includes translateable strings that parse-gram.y doesn't.
10182
10183 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
10184
10185 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
10186 reverting the 2004-10-11 change to this function.
10187 (symbol_check_alias_consistency): Don't call symbol_type_set
10188 if the type name is already correct.
10189 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
10190
10191 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
10192
10193 * tests/regression.at (Token definitions): Don't use a token named
10194 c, as that generates a "#define c ..." that runs afoul of buggy
10195 stdlib.h that uses the identifier c as a member of struct
10196 drand48_data. Problem reported by Horst Wente.
10197
10198 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
10199
10200 * bootstrap: Change translation URL from
10201 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
10202 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
10203 redirection glitches. Problem reported by twlevo@xs4all.nl.
10204
10205 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
10206
10207 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
10208 after operands; POSIX says this isn't portable for the c99 command.
10209
10210 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
10211
10212 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
10213 immediately if a data overrun has occurred; this may help us track
10214 down what may be a spurious failure on MacOS.
10215
10216 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
10217
10218 Respond to problems reported by twlevo@xs4all.nl.
10219
10220 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
10221
10222 * src/vcg.h: Comment fix.
10223 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
10224 (G_CMAX): Change to -1 instead of INT_MAX.
10225
10226 * data/yacc.c (yyparse): Omit spaces before #line.
10227
10228 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
10229
10230 * src/tables.c (state_number_to_vector_number): Put it inside an
10231 "#if 0", since it's not currently used. Problem reported by
10232 Roland McGrath.
10233
10234 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
10235
10236 * src/output.c (escaped_output): Renamed from
10237 escaped_file_name_output, since we now use it for symbol tags as
10238 well. All uses changed.
10239 (symbol_destructors_output, symbol_printers_output):
10240 Escape symbol tags too.
10241 Problem reported by Matyas Forstner in
10242 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
10243
10244 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
10245 not needed.
10246 * src/output.c (user_actions_output, token_definitions_output,
10247 symbol_destructors_output, symbol_printers_output): Likewise.
10248 * src/reader.c (prologue_augment): Likewise.
10249 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
10250
10251 * src/vcg.c (output_edge): Don't quote linestyle arg.
10252 Problem reported by twlevo@xs4all.nl.
10253
10254 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
10255
10256 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
10257 example, reported by Derek M Jones. Also, make the example even
10258 more outrageous, to better illustrate how bad the problem is.
10259
10260 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
10261
10262 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
10263 putsym. Typo reported by Sebastian Piping.
10264
10265 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
10266
10267 * doc/bison.texinfo (Language and Grammar): some -> same
10268 (Epilogue): int he -> in the
10269 Typos reported by Sebastian Piping via Justin Pence.
10270
10271 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
10272
10273 * tests/glr-regression.at (Improper handling of embedded actions
10274 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
10275 embedded actions and $-N in GLR parsers", work around an Autoconf bug
10276 with dollar signs in test names.
10277 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
10278 for a similar reason.
10279
10280 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
10281
10282 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
10283 wants to redefine G_VIEW.
10284
10285 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
10286
10287 * src/vcg.c (get_view_str): Remove case for normal_view.
10288 Problem reported by twlevo@xs4all.nl.
10289
10290 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
10291
10292 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
10293 Problem reported by twlevo@xs4all.nl.
10294
10295 * doc/bison.texinfo: Change @dircategory from "GNU programming
10296 tools" to "Software development". Requested by Richard Stallman
10297 via Karl Berry.
10298
10299 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
10300
10301 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
10302 Problem reported by twlevo@xs4all.nl.
10303
10304 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
10305
10306 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
10307 keyword; it's not needed with modern compilers, and it doesn't
10308 affect correctness with older compilers. Suggested by
10309 twlevo@xs4all.nl.
10310
10311 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
10312
10313 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
10314 gcc -Wswitch-default.
10315 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
10316 * data/yacc.c (yyparse): Likewise.
10317
10318 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
10319
10320 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
10321 already. Let config.h define any nonstandard values.
10322
10323 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
10324
10325 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
10326 for the benefit of slower hosts. Problem reported by
10327 Nelson H. F. Beebe.
10328
10329 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
10330
10331 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
10332 being defined and not used.
10333 * data/lalr1.cc (yyparse): Likewise.
10334 Use "if (false)" rather than "if (0)".
10335
10336 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
10337
10338 * TODO: Mention that we should allow NUL bytes in tokens.
10339
10340 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
10341
10342 * src/scan-skel.l (<<EOF>>): Don't close standard output.
10343 Problem reported by Hans Aberg.
10344
10345 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
10346
10347 * src/getargs.c (version): Happy new year; update overall
10348 program copyright date from 2004 to 2005.
10349
10350 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
10351 Problem reported by Hans Aberg.
10352 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
10353 (Output file names.): Add a test for the case when standard output
10354 is closed.
10355
10356 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
10357
10358 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
10359 to fix an oversight in the Bison 2.0 manual.
10360
10361 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
10362
10363 * NEWS: Version 2.0. Reformat the existing news items since
10364 1.875, so that related items are grouped together.
10365 * configure.ac (AC_INIT): Bump version to 2.0.
10366 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
10367
10368 * tests/torture.at (Exploding the Stack Size with Alloca): Set
10369 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
10370 otherwise, we're not testing alloca. Unfortunately there's no
10371 simple way to consult HAVE_ALLOCA here.
10372
10373 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
10374 for yymsg, too.
10375
10376 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
10377 hand. This avoids a warning about comparing int to size_t when
10378 GCC warnings are enabled.
10379
10380 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
10381
10382 * NEWS: Bison-generated parsers no longer default to using the
10383 alloca function (when available) to extend the parser stack, due
10384 to widespread problems in unchecked stack-overflow detection.
10385 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
10386 responsibility to set it to a positive value. This lets the user
10387 specify a value that is not a preprocessor constant.
10388 * data/yacc.c (YYMAXDEPTH): Likewise.
10389 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
10390 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
10391 to be a compile-time constant. However, explain the constraints on it.
10392 Also, explain the constraints on YYINITDEPTH.
10393 (Table of Symbols): Explain that alloca is no longer the default.
10394 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
10395 to 1.
10396
10397 * doc/bison.texinfo (Location Default Action): Mention that n must
10398 be zero when k is zero. Suggested by Frank Heckenbach.
10399
10400 2004-12-22 Akim Demaille <akim@epita.fr>
10401
10402 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
10403 (parser::state_type, parser::semantic_type, parser::location_type):
10404 Private, not public.
10405 (parser::parse): Return ints, not bool.
10406 Returning a bool introduces a problem: 0 corresponds to false, and
10407 it seems weird to return false on success. Returning true changes
10408 the conventions for yyparse.
10409 Alternatively we could return void and send an exception.
10410 There is no clear consensus (yet?).
10411 (state_stack, semantic_stack, location_stack): Rename as...
10412 (state_stack_type, semantic_stack_type, location_stack_type): these.
10413 Private, not public.
10414 * tests/c++.at: New.
10415 * tests/testsuite.at, tests/Makefile.am: Adjust.
10416
10417 2004-12-21 Akim Demaille <akim@epita.fr>
10418
10419 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
10420
10421 2004-12-21 Akim Demaille <akim@epita.fr>
10422
10423 Don't impose std::string for filenames.
10424
10425 * data/lalr1.cc (b4_filename_type): New.
10426 (position::filename): Use it.
10427 (parser.hh): Move the inclusion of stack.hh and location.hh below
10428 the user code, so that needed headers for the filename type can be
10429 included first.
10430 Forward declare them before the user code.
10431 * tests/Makefile.am (check-local, installcheck-local): Pass
10432 TESTSUITEFLAGS to the TESTSUITE.
10433
10434 2004-12-20 Akim Demaille <akim@epita.fr>
10435
10436 Use more STL like names: my_class instead of MyClass.
10437
10438 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
10439 (SemanticStack, SemanticType, StateStack, StateType)
10440 (TokenNumberType, Stack, Slice, Traits, Parser::location)
10441 (Parser::value): Rename as...
10442 (location_stack, location_type, rhs_number_type, semantic_stack)
10443 (semantic_type, state_stack, state_type, token_number_type, stack)
10444 (slice, traits, parser::yylloc, parser::yylval): these.
10445
10446 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
10447
10448 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
10449
10450 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
10451 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10452
10453 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
10454
10455 Remove uses of 'short int' and 'unsigned short int'. This raises
10456 some arbitrary limits. It uses more memory but nowadays that's
10457 not much of an issue.
10458
10459 This change does not affect the generated parsers; that's a different
10460 task, as some users will want to conserve memory there.
10461
10462 Ideally we should use size_t to represent all object counts, and
10463 something like ptrdiff_t to represent signed differences of object
10464 counts; but that will require more code-cleanup than I have the
10465 time to do right now.
10466
10467 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
10468 Use size_t, not int or short int, to count objects.
10469 * src/closure.c (nritemset, closure): Likewise.
10470 * src/closure.h (nritemset, closure): Likewise.
10471 * src/nullable.c (nullable_compute): Likewise.
10472 * src/print.c (print_core): Likewise.
10473 * src/print_graph.c (print_core): Likewise.
10474 * src/state.c (state_compare, state_hash): Likewise.
10475 * src/state.h (struct state): Likewise.
10476 * src/tables.c (default_goto, goto_actions): Likewise.
10477
10478 * src/gram.h (rule_number, rule): Use int, not short int.
10479 * src/output.c (prepare_rules): Likewise.
10480 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
10481 errs, reductions): Likewise.
10482 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
10483 Likewise.
10484 * src/tables.c (vector_number, tally, action_number,
10485 ACTION_NUMBER_MINIMUM): Likewise.
10486 * src/output.c (muscle_insert_short_int_table): Remove.
10487
10488 2004-12-17 Akim Demaille <akim@epita.fr>
10489
10490 * data/lalr1.cc: Extensive Doxygenation.
10491 (error_): Rename as...
10492 (error): this, since it is visible to the user.
10493 Adjust callers.
10494 (Parser::message): Now an automatic variable from...
10495 (Parser::yyreport_syntax_error_): here.
10496 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
10497 Parser::error.
10498 * tests/input.at: Escape $.
10499
10500 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
10501
10502 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
10503 Parenthesize rhs to avoid obscure problems with mistakes like
10504 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
10505 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
10506 b4_rhs_location): Likewise.
10507 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
10508 b4_rhs_location): Likewise.
10509
10510 2004-12-16 Akim Demaille <akim@epita.fr>
10511
10512 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
10513 yacc.c: be sure to stay within yycheck_.
10514 * tests/actions.at: Re-enable C++ tests.
10515
10516 2004-12-16 Akim Demaille <akim@epita.fr>
10517
10518 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
10519 real.
10520
10521 2004-12-16 Akim Demaille <akim@epita.fr>
10522
10523 Use #define to handle the %name-prefix.
10524
10525 * data/glr.c, data/yacc.c: Comment changes.
10526 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
10527 so that one can refer to yylex in the parser file, and have it
10528 renamed, as is the case with other skeletons.
10529
10530 2004-12-16 Akim Demaille <akim@epita.fr>
10531
10532 Move lalr1.cc internals into yy*.
10533
10534 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
10535 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
10536 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
10537 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
10538 (empty_, final_, terror_, errcode_, ntokens_)
10539 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
10540 (looka_, ilooka_, error_range_, nerrs_):
10541 Rename as...
10542 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
10543 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
10544 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
10545 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
10546 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
10547 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
10548 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
10549 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
10550 these.
10551
10552 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
10553
10554 Fix some problems reported by twlevo at xs4all.
10555 * src/symtab.c (symbol_new): Report an error if the input grammar
10556 contains too many symbols. This is better than calling abort() later.
10557 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
10558 (struct node, struct graph):
10559 Rename member expand to stretch. All uses changed.
10560 (struct graph): Remove member layoutalgorithm. All uses removed.
10561 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
10562 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
10563 All uses changed.
10564 (N_STRETCH): Rename from N_EXPAND. All uses changed.
10565
10566 2004-12-15 Akim Demaille <akim@epita.fr>
10567
10568 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
10569 Add more Doxygen comments.
10570 (symprint_, stack_print_, reduce_print_, destruct_, pop)
10571 (report_syntax_error_, translate_): Rename as...
10572 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
10573 (yypop_, yyreport_syntax_error_, yytranslate_): this.
10574
10575 2004-12-15 Akim Demaille <akim@epita.fr>
10576
10577 * data/lalr1.cc (lex_): Rename as...
10578 (yylex_): this.
10579 Move the trace here.
10580 Take the %name-prefix into account.
10581 Reported by Alexandre Duret-Lutz.
10582
10583 2004-12-15 Akim Demaille <akim@epita.fr>
10584
10585 Simplify the C++ parser constructor.
10586
10587 * data/lalr1.cc (debug_): Rename as...
10588 (yydebug_): so that the parser's internals are always in the yy*
10589 pseudo namespace.
10590 Adjust uses.
10591 (b4_parse_param_decl): Remove the leading comma as it is now only
10592 called as unique argument list.
10593 (Parser::Parser): Remove the constructor accepting a location and
10594 an initial debugging level.
10595 Remove from the other ctor the argument for the debugging level.
10596 (debug_level_type, debug_level, set_debug_level): New.
10597
10598 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
10599 constructor calls.
10600
10601 2004-12-15 Akim Demaille <akim@epita.fr>
10602
10603 Remove b4_root related material: failure experiment
10604 (which goal was to allow to derive from a class).
10605
10606 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
10607 definitions and uses.
10608
10609 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
10610
10611 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
10612 not 2, since it's not portable to subtract 1 from the start of an
10613 array. The new item 0 is never set or used. All uses changed.
10614
10615 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
10616 the default definition of YYLLOC_DEFAULT. Problem reported
10617 by Frank Heckenbach.
10618
10619 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
10620
10621 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
10622 the normal case and one for the error case. Just use the
10623 first one uniformly. Problem reported by Frank Heckenbach.
10624 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
10625 use exactly the same macro in both places.
10626 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
10627 so that the normal-case YYRHSLOC works for the error case too.
10628 All uses changed.
10629 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
10630 (YYLLOC_DEFAULT): Use the same macro as glr.c.
10631 * doc/bison.texinfo (Location Default Action): Don't claim that
10632 we have an array of locations. Use the same macro for both glr
10633 and lalr parsers. Mention YYRHSLOC. Mention what happens when
10634 the index is 0.
10635
10636 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
10637
10638 * HACKING: Update email addresses to send announcements to.
10639
10640 * configure.ac (AC_INIT): Bump version to 1.875f.
10641
10642 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
10643
10644 * NEWS: Version 1.875e.
10645 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
10646
10647 * src/scan-skel.l: Include "complain.h", for "fatal".
10648
10649 * src/relation.h (relation_print, relation_digraph):
10650 Relation sizes are of type relation_node, not size_t (this is
10651 merely a doc fix, since the two types are equivalent).
10652 (relation_transpose): Relation sizes are of type relation_node,
10653 not int.
10654 * src/relation.c: Likewise.
10655 (top, infinity): Now of type relation_node, not int.
10656 (traverse, relation_transpose): Use relation_node, not int.
10657
10658 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
10659 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
10660 (yyparse): Remove unused local introduced in 2004-10-25 patch.
10661
10662 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
10663 specifying whether the test should be skipped. Use it tp
10664 specify that the [%defines %skeleton "lalr1.cc"] tests currently
10665 fail on some hosts, and should be skipped.
10666
10667 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
10668
10669 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
10670 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
10671 unless otherwise specified below.
10672
10673 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
10674 to allocate kernel_base, kernel_items, kernel_size, since
10675 they needn't be initialized to 0.
10676 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
10677 * src/closure.c (new_closure): Likewise, for itemset.
10678 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
10679 * src/lalr.c (set_goto_map): Likewise, for temp_map.
10680 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
10681 (build_relations): Likewise for edge, states1, includes.
10682 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
10683 * src/reader.c (packgram): Likewise, for ritem, rules.
10684 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
10685 * src/relation.c (relation_digraph): Likewise for VERTICES.
10686 (relation_transpose): Likewise for new_R, end_R.
10687 * src/symtab.c (symbols_token_translations_init): Likewise for
10688 token_translations.
10689 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
10690 (token_actions): Likewise for yydefact, actrow, conflrow,
10691 conflict_list.
10692 (save_column): Likewise for froms[symno], tos[symno].
10693 (goto_actions): Likewise for state_count.
10694 (pack_table): Likewise for base, pos, check.
10695 (tables_generate): Likewise for width.
10696
10697 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
10698 for initial core. Just have a separate core, so we needn't worry
10699 about whether kernel_size and kernel_base are initialized.
10700
10701 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
10702 kernel_size, kernel_items): Remove unnecessary initialization.
10703 * src/conflicts.c (conflicts): Likewise.
10704 * src/derives.c (derives): Likewise.
10705 * src/muscle_tablc (muscle_insert): Likewise.
10706 * src/relation.c (relation_digraph): Likewise.
10707 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
10708 conflrow, conflict_table, conflict_list, table, check):
10709 Likewise.
10710
10711 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
10712 This is because all callers pass unsigned int.
10713 * src/closure.h (new_closure): Likewise.
10714
10715 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
10716 (build_relations): Initialize includes[i] in all cases.
10717 * src/reader.c (packgram): Always initialize rules[ruleno].prec
10718 and rules[ruleno].precsym. Initialize members in order.
10719 * src/relation.c (relation_transpose): Always initialize new_R[i]
10720 and end_R[i].
10721 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
10722
10723 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
10724 conflict_list[0] was always 0, but now it isn't initialized.
10725
10726 * src/table.c (table_grow): When conflict_table grew, the grown
10727 area wasn't cleared. Fix this.
10728
10729 * lib/.cvsignore: Add strdup.c, strdup.h.
10730 * m4/.cvsignore: Add strdup.m4.
10731
10732 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
10733
10734 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
10735 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
10736 GOTO_NUMBER_MAXIMUM, since we occasionally compute
10737 ngotos + 1 without checking for overflow.
10738 (build_relations): Use END_NODE, not -1, to denote end of edges.
10739 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
10740 build_relations): Use goto_number, not int, for goto numbers.
10741 * src/tables.c (save_column, default_goto): Likewise.
10742
10743 2004-11-23 Akim Demaille <akim@epita.fr>
10744
10745 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
10746 of #defining from yystype.
10747 Don't typedef yystype, C++ does not need it.
10748 This lets it possible to forward declare it as union.
10749
10750 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
10751
10752 * bootstrap (gnulib_modules): Add extensions.
10753 Problem reported by Jim Meyering.
10754
10755 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
10756
10757 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
10758 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
10759 src/system.h, src/tables.c: XFREE -> free, to accommodate
10760 recent change to gnulib xalloc.h.
10761 Problem reported by Jim Meyering.
10762
10763 2004-11-17 Akim Demaille <akim@epita.fr>
10764
10765 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
10766
10767 2004-11-17 Akim Demaille <akim@epita.fr>,
10768 Alexandre Duret-Lutz <adl@gnu.org>
10769
10770 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
10771 changes.
10772 (YYCDEBUG): Adjust.
10773 Use it instead of cdebug_.
10774 (Parser::debug_stream, Parser::set_debug_stream): New.
10775 (Parser::symprint_): Define cdebug_ for temporary backward
10776 compatibility.
10777 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
10778 debug_stream ().
10779
10780 2004-11-17 Akim Demaille <akim@epita.fr>
10781
10782 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
10783 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
10784 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
10785 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
10786
10787 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
10788
10789 * data/glr.c (yyloc_default): Remove; not used.
10790 Problem reported by Frank Heckenbach.
10791
10792 2004-10-25 Akim Demaille <akim@epita.fr>
10793
10794 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
10795 Introduce another definition to address simple location arrays.
10796 (yyGLRStack): New member: yyerror_range.
10797 (yyrecoverSyntaxError, yyparse): Update it.
10798 (yyrecoverSyntaxError): Use it when shifting the error token to
10799 have an accurate range, equivalent to the one computed by both
10800 yacc.c and lalr1.cc.
10801 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
10802 that column numbers start at column 0, as per GNU Coding
10803 Standards, the others tests, and the doc.
10804 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
10805 Adjust to the above change (first column is 0).
10806 And adjust the location of the "<error>", now covering the whole
10807 line.
10808
10809 2004-10-22 Akim Demaille <akim@epita.fr>
10810 and Paul Eggert <eggert@cs.ucla.edu>
10811
10812 Remove some arbitrary limits on goto numbers and relations.
10813 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
10814 initial values, since they're never used.
10815 (set_goto_map): ngotos is now unsigned, so test for overflow
10816 by seeing whether it wraps around to zero.
10817 * src/lalr.h (goto_number): Now size_t, not short int.
10818 (GOTO_NUMBER_MAXIMUM): Remove.
10819 * src/relation.c (relation_print, traverse, relation_transpose):
10820 Check for END_NODE rather than looking at sign.
10821 * src/relation.h (END_NODE): New macro.
10822 (relation_node): Now size_t, not short int.
10823
10824 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
10825
10826 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
10827 keyword, not an identifier. Problem reported by Baron Schwartz in
10828 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
10829
10830 2004-10-11 Akim Demaille <akim@epita.fr>
10831
10832 * src/symtab.c (symbol_check_alias_consistency): Also check
10833 type names, destructors, and printers.
10834 Reported by Alexandre Duret-Lutz.
10835 Recode the handling of associativity and precedence in terms
10836 of symbol_precedence_set.
10837 Accept no redeclaration at all, not even equal to the previous
10838 value.
10839 (redeclaration): New.
10840 Use it to factor redeclaration complaints.
10841 (symbol_make_alias): Don't set the type of the alias, let
10842 symbol_check_alias_consistency do it as for other features.
10843 * src/symtab.h (symbol): Add new member prec_location, and
10844 type_location.
10845 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
10846 * tests/input.at (Incompatible Aliases): New.
10847
10848 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
10849
10850 .cvsignore fixes to accommodate gnulib changes,
10851 and the practice of naming build directories "_build".
10852 * .cvsignore: Add "_*". Sort.
10853 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
10854 * m4/.cvsignore: Add "*_gl.m4".
10855
10856 2004-10-06 Akim Demaille <akim@epita.fr>
10857
10858 * src/parse-gram.y (add_param): Fix the truncation of trailing
10859 spaces.
10860
10861 2004-10-05 Akim Demaille <akim@epita.fr>
10862
10863 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
10864 whether the reducion was empty or not. This leaves room to
10865 improve the use of YYLLOC_DEFAULT in such a case.
10866 lalr1.cc is still experimental, so changing this is acceptable.
10867 And finally, there are probably not many users who changed the
10868 handling of locations in GLR, so changing is admissible too.
10869
10870 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
10871 empty reduction, set @$ to an empty location ending the previously
10872 stacked symbol.
10873 Adjust uses to make sure the code is triggered on empty
10874 reductions.
10875 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
10876 expected output: empty reductions have empty locations.
10877
10878 2004-09-29 Akim Demaille <akim@epita.fr>
10879
10880 * data/lalr1.cc: Move towards a more standard C++ coding style
10881 for templates: Class < T > -> Class<T>.
10882
10883 2004-09-29 Akim Demaille <akim@epita.fr>
10884
10885 * data/lalr1.cc: Reinstall the former ctor, for sake of
10886 compatibility, but warn it will be removed.
10887 Move towards a more standard C++ coding style (i.e., type *var ->
10888 type* var).
10889
10890 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
10891
10892 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
10893 since it's less likely to work if NULs are involved in the future.
10894
10895 2004-09-27 Akim Demaille <akim@epita.fr>
10896
10897 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
10898
10899 2004-09-27 Akim Demaille <akim@epita.fr>
10900
10901 * data/lalr1.cc (b4_parse_param_decl_1): New.
10902 (b4_parse_param_decl): Use it to have different names between attribute
10903 and argument names.
10904 (b4_cc_constructor_call): Likewise.
10905
10906 2004-09-24 Akim Demaille <akim@epita.fr>
10907
10908 * src/parse-gram.y (add_param): Strip the leading and trailing
10909 blanks from a formal argument declaration.
10910 (YY_LOCATION_PRINT): New.
10911
10912 2004-09-24 Akim Demaille <akim@epita.fr>
10913
10914 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
10915 after the location.
10916
10917 2004-09-24 Akim Demaille <akim@epita.fr>
10918
10919 * doc/bison.texinfo (Table of Symbols): Sort.
10920
10921 2004-09-21 Akim Demaille <akim@epita.fr>
10922
10923 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
10924 the useless parentheses.
10925 Suggested by Paul Eggert.
10926
10927 2004-09-20 Akim Demaille <akim@epita.fr>
10928
10929 Let the initial-action act on the look-ahead, and use it for the
10930 "initial push" (corresponding to an hypothetical beginning-of-file).
10931 And let lalr1.cc honor %initial-action.
10932
10933 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
10934 example.
10935 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
10936 (Parser::Parser): Remove the ctor that used to initialize it.
10937 (Parser::parse): Like in the other skeletons, issue the "starting
10938 parse" message before any action.
10939 Honor %initial-action.
10940 Initialize the stacks with the lookahead.
10941 * data/yacc.c: Let $$ and @$ in %initial-action designate the
10942 look-ahead.
10943 Push them in the stacks.
10944 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
10945
10946 2004-09-20 Akim Demaille <akim@epita.fr>
10947
10948 * doc/bison.texinfo (Initial Action Decl): New.
10949
10950 2004-09-20 Akim Demaille <akim@epita.fr>
10951
10952 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
10953 clearer criterion to define it.
10954 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
10955 When reducing on an empty RHS, use the latest stacked location as
10956 location.
10957 yylloc is not always available.
10958 * data/glr.c: Likewise.
10959 Also, honor initial-actions.
10960
10961 2004-09-20 Akim Demaille <akim@epita.fr>
10962
10963 * data/yacc.c (YY_LOCATION_PRINT): New.
10964 Define when we know YYLTYPE's structure, i.e., when the default
10965 YYLLOC_DEFAULT is used.
10966 * data/c.m4 (b4_yysymprint_generate): Use it.
10967 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
10968 value of the result.
10969 (error_start_): Replace with...
10970 (error_range_): this location array.
10971 This allows to replace code relying on the implementation of
10972 locations by portable code.
10973 * data/yacc.c (yylerrsp): Replace with...
10974 (yyerror_range): this.
10975 Every time a token is popped, update yyerror_range[0], to have an
10976 accurate location for the error token.
10977 * data/glr.c (YY_LOCATION_PRINT): New.
10978 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
10979 deference a pointer.
10980 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
10981 report the location in %printers.
10982
10983 * src/scan-skel.l: Instead of abort, report error messages to ease
10984 understanding skeleton scanning failures.
10985
10986 2004-09-16 Akim Demaille <akim@epita.fr>
10987
10988 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
10989 (iterator, const_iterator): these, to be more in the C++ spirit.
10990 Also, return reverse iterators so that when displaying the stack
10991 we display its bottom first.
10992 (Parser::stack_print_, Parser::reduce_print_): Match the messages
10993 from yacc.c.
10994 We should probably use vector here though.
10995
10996 2004-09-16 Akim Demaille <akim@epita.fr>
10997
10998 Have more complete shift traces.
10999
11000 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
11001 to report Shifts instead of ad hoc YYDPRINTF invocations,
11002 including for the error token.
11003 * data/lalr1.cc (symprint_): Output the location.
11004 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
11005 output the location within the %printer.
11006 Activate GLR tests, at least to make sure they compile properly.
11007 They still don't pass though.
11008 * tests/calc.at: Adjust expect verbose output, since now "Entering
11009 state..." is on a different line than the "Shifting" message.
11010
11011 2004-09-08 Akim Demaille <akim@epita.fr>
11012
11013 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
11014 Bison directive from the Bison file to the invocation of this
11015 macro, so that these directives are passed to
11016 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
11017 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
11018 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
11019 the extra Bison directives instead of the whole series.
11020 Change the grammar so that there are recoverable errors, and
11021 unrecoverable errors. Now we can have the parser give up before
11022 consuming the whole input. As a result we now can observe that
11023 the lookahead is freed when needed.
11024 Change the parser source to parse argv[1] instead of a hard coded
11025 string.
11026 Simplify yylex, and give a value and location to EOF.
11027 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
11028 passed directives already coded in the file.
11029 Add some tests to check the location of "error".
11030 For some tests, the C++ parser is correct, and not yacc.c.
11031 For other tests, they provide different, but unsatisfying, values,
11032 so keep the C++ value so that at least one parser is "correct"
11033 according to the test suite.
11034 (Actions after errors): Remove, this is subsumed by the
11035 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
11036
11037 2004-09-06 Akim Demaille <akim@epita.fr>
11038
11039 * data/lalr1.cc: Adjust the indentation of the labels.
11040 (Parser::pop): New.
11041 Use it.
11042
11043 2004-09-06 Akim Demaille <akim@epita.fr>
11044
11045 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
11046 argument, an informative message.
11047 Call YY_SYMBOL_PRINT.
11048 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
11049 * data/lalr1.cc (destruct_): Likewise.
11050 In addition, no longer depend on b4_yysymprint_generate and
11051 b4_yydestruct_generate to generate these functions, do it "by
11052 hand".
11053
11054 2004-09-03 Akim Demaille <akim@epita.fr>
11055
11056 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
11057 invoked, yydestruct the lookahead.
11058 * tests/calc.at (Calculator $1): Update the expected lengths of
11059 traces: there is an added line for the discarded lookahead.
11060 * doc/bison.texinfo (Destructor Decl): Some rewording.
11061 Define "discarded" symbols.
11062
11063 2004-09-02 Akim Demaille <akim@epita.fr>
11064
11065 * data/lalr1.cc (translate_, destruct_): No reason to be static.
11066
11067 2004-09-02 Akim Demaille <akim@epita.fr>
11068
11069 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
11070 (YYDSYMPRINTF): Rename as...
11071 (YY_SYMBOL_PRINT): this.
11072 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
11073 two.
11074 Use it instead of direct symprint_ calls.
11075 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
11076 one.
11077
11078 2004-09-02 Akim Demaille <akim@epita.fr>
11079
11080 * data/lalr1.cc (b4_yysymprint_generate): New.
11081 (symprint_): New member function, defined when YYDEBUG.
11082 Use it consistently instead of token/nterm debugging output by
11083 hand.
11084 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
11085 %printer calls to use cdebug_ when using lalr1.cc.
11086
11087 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
11088
11089 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
11090 with #ifdef YYDEBUG.
11091
11092 2004-08-26 Akim Demaille <akim@epita.fr>
11093
11094 * doc/bison.texinfo (Implementing Loops): Rename as...
11095 (Implementing Gotos/Loops): this.
11096
11097 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
11098
11099 Adjust to latest gnulib.
11100 * bootstrap (gnulib_modules): Add xalloc-die.
11101 Set LC_ALL=C so that file names sort consistently.
11102 Prefer the gnulib copies of gettext.m4, glibc21.m4,
11103 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
11104 uintmax_t.m4, ulonglong.m4.
11105 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
11106 po.m4 since we are now using _gl.m4 instead.
11107
11108 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
11109
11110 * src/scan-action.l: Remove. Scanning of semantic actions is
11111 handled in scan-gram.l.
11112
11113 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
11114
11115 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
11116
11117 * src/location.h (struct): The file member is a uniqstr.
11118 (equal_boundaries): Use UNIQSTR_EQ for comparison.
11119
11120 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
11121
11122 Fix bug with non-%union parsers that have printers or destructors,
11123 which led to a Bison core dump. Reported by Peter Fales in
11124 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
11125
11126 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
11127 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
11128 not to our own type.
11129 * src/output.c (symbol_destructors_output, symbol_printers_output):
11130 Don't assume %union.
11131 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
11132 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
11133 UNION-FLAG. All callers changed.
11134 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
11135 Use type char, not unsigned int, when declaring an array of char;
11136 this lets us remove a cast.
11137 (Printers and Destructors): Add non-%union test cases.
11138
11139 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11140
11141 * doc/bison.texinfo: Minor editorial changes, mostly to the new
11142 GLR writeups. E.g., avoid frenchspacing and the future tense,
11143 change "lookahead" to "look-ahead", and change "wrt" to "with
11144 respect to".
11145
11146 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11147
11148 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
11149 New sections, split off from the GLR Parsers section. Put the new
11150 Simple GLR Parser near the start of the GLR section, for clarity.
11151 Rewrite connective text.
11152
11153 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
11154
11155 * doc/bison.texinfo (Simple GLR Parsers): New section.
11156
11157 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11158
11159 * NEWS, TODO, doc/bison.texinfo:
11160 Use "look-ahead" instead of "lookahead", to be consistent.
11161 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
11162 while we're fixing "look-ahead".
11163 * src/conflicts.c (shift_set): Renamed from shiftset.
11164 (look_ahead_set): Renamed from lookaheadset.
11165 * src/print.c: Likewise.
11166 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
11167 name for "lookahead".
11168 (report_types, usage): Likewise.
11169 * src/getargs.h (report_look_ahead_tokens): Renamed from
11170 report_lookaheads.
11171 * src/lalr.c (compute_look_ahead_tokens): Renamed from
11172 compute_lookaheads.
11173 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
11174 (look_ahead_tokens_print): Renamed from lookaheads_print.
11175 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
11176 state_rule_lookaheads_print.
11177 * src/state.h: Likewise.
11178 (reductions.look_ahead_tokens): Renamed from lookaheads.
11179 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
11180 AT_DATA_LOOKAHEADS_GRAMMAR.
11181
11182 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
11183
11184 * README: Update location of patched M4 distribution.
11185
11186 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
11187
11188 Don't assume the C++ compiler takes the same arguments as the C compiler
11189 (trivial change).
11190 * configure.ac (O0CXXFLAGS): New var.
11191 * tests/atlocal.in (CXXFLAGS): Use it.
11192
11193 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
11194
11195 Fix some "make check" problems with C++ reported by
11196 Albert Chin-A-Young for Tru64 C++ in this thread:
11197 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
11198
11199 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
11200 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11201 Output to a .cc file for C++, not to a .c file.
11202 * tests/calc.at (AT_CHECK_CALC): Likewise.
11203 * tests/regression.at (AT_CHECK_DANCER): Likewise.
11204 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
11205
11206 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
11207
11208 * tests/calc.at, tests/actions.at: Workaround for SGI
11209 C++ compiler. (trivial change)
11210
11211 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
11212
11213 Spent a few hours checking out which prerequisite versions the
11214 current sources actually require. I went all the way back to
11215 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
11216 a seemingly endless set of combinations of versions more recent
11217 than that. The bottom line is that the current sources require
11218 fairly recent versions of the build tools, and it'll be some work
11219 to change this.
11220 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
11221 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
11222 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
11223 Add comments explaining why those particular versions are
11224 currently needed.
11225
11226 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
11227 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
11228 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
11229
11230 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
11231 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
11232
11233 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
11234
11235 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
11236 0.11.5. Suggested by Bruno Haible.
11237 * bootstrap: Remove gettext version checking.
11238
11239 * doc/bison.texinfo (Decl Summary): Also mention that %union
11240 can depend on prerequisite types. Problem reported by Tim
11241 Van Holder.
11242
11243 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
11244
11245 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
11246 * README-alpha: Don't tell people not to package this.
11247
11248 * bootstrap: Don't assume $(...) works; use `...` instead.
11249 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
11250 gettext better.
11251
11252 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
11253 put into the -d output file, and mention what to do if YYSTYPE is
11254 defined as a macro.
11255
11256 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
11257
11258 Undo change made earlier today: it caused autopoint to not bring
11259 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
11260 autopoint's.
11261
11262 * bootstrap: Check that gettext version matches what's in
11263 configure.ac. Warn users to ignore robots.txt ERROR 404.
11264 * bootstrap: Undo today's earlier change (logged below).
11265 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
11266
11267 The gettext version checking is causing more trouble than it's
11268 curing; remove it. Problem reported by Paul Hilfinger.
11269
11270 * bootstrap: Issue a warning that one can expect a message
11271 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
11272 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
11273
11274 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
11275
11276 Ensure that the C++ compiler used for testing actually works on a
11277 simple test program; if not, skip the C++-related tests. Problem
11278 reported by Vin Shelton in:
11279 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
11280
11281 * m4/cxx.m4: New file.
11282 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
11283 * tests/atlocal.in (BISON_CXX_WORKS): Add.
11284 * tests/local.at (AT_COMPILE_CXX): Use it.
11285
11286 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11287
11288 * data/glr.c (yylloc): Output this macro even if locations are not
11289 being generated, as the GLR parser needs it even in that case.
11290 Problem reported by Troy A. Johnson
11291 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
11292
11293 * configure.ac (AC_INIT): Update to 1.875e.
11294
11295 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11296
11297 * NEWS: Version 1.875d.
11298 * configure.ac (AC_INIT): Likewise.
11299 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
11300
11301 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
11302 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
11303 lalr1.cc runs afoul of the first, and the last two are no longer
11304 supported by GCC 3.4.0.
11305 * README: Mention GNU m4 1.4 or later; mention m4 patches.
11306 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
11307
11308 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
11309
11310 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
11311 unsigned int, for compatibility with latest gnulib hash module.
11312 * src/state.c (state_hash, state_hasher): Likewise.
11313 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
11314 * src/uniqstr.c (hash_uniqstr): Likewise.
11315
11316 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
11317
11318 * NEWS: Unescaped newlines are no longer allowed in char & strings.
11319
11320 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
11321 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
11322 character and string literals.
11323 (unexpected_end): New function.
11324 (unexpected_eof): Use it.
11325 (unexpected_newline): New function.
11326 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
11327 actions.
11328
11329 * NEWS: Document %expect-rr.
11330
11331 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
11332 Fix typo by replacing $1 with $option.
11333 Remove more 'intl'-related files.
11334 Don't DEFUN AM_INTL_SUBDIR twice.
11335
11336 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
11337 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
11338 strtoul.c.
11339 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
11340 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
11341 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
11342 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
11343 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
11344 * src/.cvsignore: Add *.output.
11345
11346 * src/parse-gram.y: Put copyright notice inside %{ %} so it
11347 gets copied to the output file.
11348
11349 2004-04-28 Paul Eggert <eggert@twinsun.com>
11350
11351 Get files from the gnulib and po repositories, instead of relying
11352 on them being in our CVS. Upgrade to latest versions of gnulib
11353 and Automake.
11354
11355 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
11356 * bootstrap: Bootstrap from gnulib and po repositories.
11357 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
11358 * README-cvs: Document these changes. Remove version numbers from
11359 mentions of build tools, since they change so often. Mention Flex.
11360
11361 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
11362 (gl_USE_SYSTEM_EXTENSIONS): Add.
11363 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
11364 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
11365 does this for us.
11366 (AC_ISC_POSIX): Remove; we no longer support this
11367 ancient OS, as it gets in the way of latest Autoconf & gnulib.
11368 (AC_HEADER_STDC): Remove: we now assume C89 or better.
11369 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
11370 Do not check for C89 headers, except for locale.h which is used
11371 by the Yacc library and must port to K&R hosts.
11372 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
11373 Do not check for C89 functions, except for setlocale which is
11374 used by the Yacc library.
11375 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
11376 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
11377 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
11378 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
11379 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
11380 AM_GNU_GETTEXT): Remove; now done by:
11381 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
11382 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
11383 for us.
11384
11385 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
11386 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
11387 Define to empty, as gnulib.mk will do the rest for us.
11388 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
11389 for us.
11390 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
11391 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
11392
11393 * src/files.c: Include gnulib's xstrndup.h.
11394
11395 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
11396 (REALLOC): Use xnrealloc, for likewise.
11397 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
11398 (strnlen, memrchr): Remove decls; functions no longer used.
11399 Include <stpcpy.h>.
11400
11401 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
11402 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
11403 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
11404 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
11405 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
11406 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
11407 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
11408 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
11409 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
11410 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
11411 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
11412 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11413 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
11414 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
11415 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
11416 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
11417 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
11418 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
11419 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
11420 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
11421 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
11422 Remove, as these files are now generated automatically
11423 by bootstrap or automake.
11424
11425 * po/ChangeLog: Remove: all but one entry was a duplicate
11426 of this file, and I moved that 2000-11-02 entry here.
11427
11428 * config/.cvsignore: Add Makefile, depcomp, install-sh.
11429 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
11430 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
11431 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
11432 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
11433 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
11434 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
11435 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
11436 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
11437 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
11438 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
11439 xstrndup.h.
11440 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
11441 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
11442 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
11443 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
11444 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
11445 * src/.cvsignore: Remove *_.c.
11446
11447
11448 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
11449 support it. (The latest stable gzip doesn't.)
11450
11451 2004-04-27 Paul Eggert <eggert@twinsun.com>
11452
11453 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
11454 case, as stos_ is now used by destructors due to the 2004-02-09
11455 change.
11456
11457 Remove more K&R C support.
11458 * lib/libiberty.y (PARAMS): Remove. All uses removed.
11459 * lib/subpipe.c (errno): Remove decl.
11460 Include <stdlib.h> unconditionally.
11461 (EXIT_FAILURE): Remove macro.
11462 * src/complain.c (vfprintf, strerror): Remove.
11463 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
11464 unconditionally.
11465 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
11466 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
11467 (strchr, strspn, memchr): Remove decls.
11468 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
11469 unconditionally. Do not declare perror.
11470 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
11471 unconditionally.
11472
11473 * src/complain.c (_): Remove useless defn, as system.h defines this.
11474
11475 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
11476 with latest obstack.h.
11477 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
11478 to procedure types, as obstack.h now does that for us.
11479 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
11480
11481 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
11482 so that this include file can stand alone.
11483 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
11484 does this now. Include subpipe.h first after config.h, to
11485 test whether it can stand alone.
11486
11487 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
11488 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
11489 unused declaration.
11490
11491 * tests/synclines.at (%union synch line): Put a dummy member in
11492 the union, because empty unions aren't allowed in C. Caught
11493 by GCC 3.4.0.
11494
11495 2004-04-13 Jim Meyering <jim@meyering.net>
11496
11497 * src/conflicts.c (conflicts_print): Correct format string typo:
11498 use `%%' to produce literal `%'. (trivial change)
11499
11500 2004-03-30 Paul Eggert <eggert@twinsun.com>
11501
11502 * src/getargs.c (version): Update copyright year to 2004.
11503
11504 * data/c.m4 (b4_int_type): Use 'short int' rather than
11505 'short', and similarly for 'long', 'unsigned', etc.
11506 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
11507 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
11508 yy_yypstack, yydumpstack): Likewise.
11509 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
11510 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
11511 Likewise.
11512 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
11513 yy_stack_print, yyparse): Likewise.
11514 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
11515 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
11516 * lib/bitset.c (bitset_print): Likewise.
11517 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
11518 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11519 * lib/bitsetv.c (bitsetv_dump): Likewise.
11520 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
11521 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
11522 Likewise.
11523 * src/LR0.c (allocate_itemsets): Likewise.
11524 * src/gram.h (rule_number, rule): Likewise.
11525 * src/lalr.h (goto_number): Likewise.
11526 * src/nullable.c (nullable_compute): Likewise.
11527 * src/output.c (prepare_rules): Likewise.
11528 * src/relation.c (relation_print, relation_digraph): Likewise.
11529 * src/relation.h (relation_node): Likewise.
11530 * src/state.h (state_number, transitions, errs, reductions,
11531 struct state): Likewise.
11532 * src/symtab.h (symbol_number, struct symbol): Likewise.
11533 * src/tables.c (vector_number, tally, action_number,
11534 default_goto, goto_actions): Likewise.
11535 * tests/existing.at (GNU Cim Grammar): Likewise.
11536 * tests/regression.at (Web2c Actions): Likewise.
11537
11538 * src/output.c (muscle_insert_short_int_table): Renamed from
11539 muscle_insert_short_table. All uses changed.
11540
11541 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11542
11543 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
11544 (declaration): Replace expected_conflicts with expected_sr_conflicts.
11545 Add %expect-rr rule.
11546
11547 * src/scan-gram.l: Recognize %expect-rr.
11548
11549 * src/conflicts.h (expected_sr_conflicts): Rename from
11550 expected_conflicts.
11551 (expected_rr_conflicts): Declare.
11552
11553 * src/conflicts.c (expected_sr_conflicts): Rename from
11554 expected_conflicts.
11555 (expected_rr_conflicts): Define.
11556 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
11557 for GLR parsers.
11558 Use expected_sr_conflicts in place of expected_conflicts.
11559 Warn if expected_rr_conflicts used in non-GLR parser.
11560
11561 * doc/bison.texinfo: Add documentation for %expect-rr.
11562
11563 2004-03-08 Paul Eggert <eggert@gnu.org>
11564
11565 Add support for hex token numbers. Suggested by Odd Arild Olsen in
11566 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
11567
11568 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
11569 in lalr1.cc.
11570 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
11571 * src/scan-gram.l (scan_integer): New function.
11572 ({int}): Use it.
11573 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
11574 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
11575 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
11576 Say "long int", not "long", for uniformity with GNU style.
11577
11578 2004-02-25 Paul Eggert <eggert@twinsun.com>
11579
11580 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
11581 compilers. This fixes a problem with Intel's C++ compiler being
11582 chatty, reported by Guido Trentalancia in
11583 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
11584
11585 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
11586
11587 Support %destructor and merge error locations in lalr1.cc.
11588
11589 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
11590 (Parser::stos_): Define unconditionally.
11591 (Parser::destruct_): New method. Generate its body with
11592 b4_yydestruct_generate.
11593 (Parser::error_start_): New attribute.
11594 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
11595 token which are discarded.
11596 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
11597 error_start_ when erroneous token are discarded.
11598 (Parser::parse) <yyerrlab1>: Compute the location of the error
11599 token so that it covers all the discarded tokens.
11600 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
11601 it can be called with `%skeleton "lalr1.cc"', and do that.
11602
11603 2004-02-02 Paul Eggert <eggert@twinsun.com>
11604
11605 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
11606 $(top_srcdir)/lib and ../lib. This fixes a bug reported
11607 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
11608 There's no need to mention top_builddir since Automake does that
11609 for us.
11610 (INCLUDES): Remove, as Automake says it's obsolescent.
11611 Contents migrated into AM_CPPFLAGS as described above.
11612 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
11613
11614 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11615
11616 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
11617 (yyreportSyntaxError): Handle case where lookahead token is
11618 YYEMPTY.
11619
11620 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11621
11622 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
11623 resulting parsers are compilable with C++.
11624
11625 2003-12-23 Paul Eggert <eggert@twinsun.com>
11626
11627 * config/depcomp, config/install-sh: Sync with Automake 1.8.
11628 * src/output.c (output_skeleton): Rename local var.
11629 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
11630 Bison tokens, as this runs afoul of the 2003-10-07 change that
11631 disallowed NUL bytes in character constants or string literals.
11632
11633 * tests/local.at: Require Autoconf 2.59's Autotest.
11634 * tests/testsuite.at: Don't include local.at, since we now assume
11635 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
11636 including it.
11637 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
11638 multiple inclusion warnings.
11639
11640 2003-12-02 Akim Demaille <akim@epita.fr>
11641
11642 * doc/bison.texinfo (How Can I Reset the Parser): More about start
11643 conditions.
11644 From Bruno Haible.
11645
11646 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
11647
11648 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
11649
11650 2003-10-07 Paul Eggert <eggert@twinsun.com>
11651
11652 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
11653 if testsuite doesn't exist.
11654
11655 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
11656 literals, unfortunately.
11657 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
11658 Complain about NUL bytes in character constants or string literals.
11659
11660 2003-10-05 Paul Eggert <eggert@twinsun.com>
11661
11662 * NEWS: Don't document %no-default-prec, as it's still
11663 too experimental.
11664 * doc/bison.texinfo: Document %no-default-prec only if
11665 the defaultprec flag is set. Normally it's not.
11666
11667 2003-10-04 Paul Eggert <eggert@twinsun.com>
11668
11669 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
11670 non-modifiable lvalue, instead of a modifiable one.
11671 * doc/bison.texinfo (Actions): Document that $$ can
11672 be assigned to. Do not claim that $$ and $N are
11673 array element references: user code should not rely on this.
11674
11675 2003-10-01 Paul Eggert <eggert@twinsun.com>
11676
11677 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
11678 (grammar_declaration): Use it.
11679 * src/scan-gram.l: New token %no-default-prec.
11680 * tests/conflicts.at: Revamp tests to use %no-default-prec.
11681 * NEWS, doc/bison.texinfo: Document the above.
11682
11683 2003-10-01 Akim Demaille <akim@epita.fr>
11684
11685 VCG no longer supports long_straight_phase.
11686
11687 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
11688 * src/print_graph.c (print_graph): Adjust.
11689
11690 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
11691 and Paul Eggert <eggert@twinsun.com>
11692
11693 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
11694 Table of Symbols): Document %default-prec.
11695 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
11696 (grammar_declaration): Set default_prec on %default-prec.
11697 * src/scan-gram.l (%default-prec): New token.
11698 * src/reader.h (default_prec): New flag.
11699 * src/reader.c: Likewise.
11700 (packgram): Handle it.
11701 * tests/conflicts.at (%default-prec without %prec,
11702 %default-prec with %prec, %default-prec 1): New tests.
11703
11704 2003-09-30 Paul Eggert <eggert@twinsun.com>
11705
11706 * tests/testsuite.at: Include local.at, not input.at, fixing
11707 a typo in the 2003-08-25 patch.
11708
11709 2003-08-27 Akim Demaille <akim@epita.fr>
11710
11711 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
11712 GCC warnings.
11713
11714 2003-08-26 Akim Demaille <akim@epita.fr>
11715
11716 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
11717 "<\#" to avoid magic from Gnus when posting parts of this script.
11718
11719 2003-08-26 Akim Demaille <akim@epita.fr>
11720
11721 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
11722 (Parser::parse): here.
11723 Adjust: nerrs and errstatus is now replaced by...
11724 (Parser::nerrs_, Parser::errstatus_): New.
11725
11726 2003-08-25 Akim Demaille <akim@epita.fr>
11727
11728 * config/announce-gen, Makefile.cfg: New.
11729 * Makefile.am: Adjust.
11730 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
11731 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
11732
11733 2003-08-25 Akim Demaille <akim@epita.fr>
11734
11735 When reducing initial empty rules, Bison parser read an initial
11736 location that is not defined. This results in garbage, and that
11737 affects Bison's own parser. Therefore we need (i) to extend Bison
11738 to support a means to initialize this location, and (ii) to use
11739 this CVS Bison to fix CVS Bison's parser.
11740
11741 * src/reader.h, reader.c (epilogue_augment): Remove, replace
11742 with...
11743 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
11744 * src/parse-gram.y: Adjust.
11745 (%initial-action): New.
11746 (%error-verbose): Since we require CVS Bison, there is no reason
11747 not to use it.
11748 * src/scan-gram.l: Adjust.
11749 * src/Makefile.am (YACC): New, to make sure we use our own parser.
11750 * data/yacc.c (yyparse): Use b4_initial_action.
11751
11752 2003-08-25 Akim Demaille <akim@epita.fr>
11753
11754 * doc/bison.texinfo: Don't promote stdout for error messages.
11755
11756 2003-08-25 Akim Demaille <akim@epita.fr>
11757
11758 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
11759 From Alexandre Duret-Lutz.
11760
11761 2003-08-25 Akim Demaille <akim@epita.fr>
11762
11763 Version 1.875c.
11764
11765 2003-08-25 Akim Demaille <akim@epita.fr>
11766
11767 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
11768 Use them.
11769
11770 2003-08-25 Akim Demaille <akim@epita.fr>
11771
11772 * data/lalr1.cc (Parser::reduce_print_): New.
11773 Use it.
11774
11775 2003-08-25 Akim Demaille <akim@epita.fr>
11776
11777 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
11778 error recovery loops. This patch is based on
11779 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
11780 Also, augment the similarity between lalr1.cc and yacc.c.
11781 Note: the locations of error recovery rules are not correct yet.
11782
11783 * data/lalr1.cc: Comment changes to augment the similarity between
11784 lalr1.cc and yacc.c.
11785 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
11786 (yyerrlab1): Remove, but where it used to be (now the bottom part of
11787 yyerrlab), when hitting EOF, pop the whole stack here instead of
11788 merely falling thru the default error handling mechanism.
11789 (yyerrorlab): New label, with the old contents of YYERROR,
11790 plus the following change: pop the stack of rhs corresponding
11791 to the production that invoked YYERROR. That is how Yacc
11792 behaves (required by POSIX).
11793 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
11794 fail.
11795
11796 2003-08-25 Akim Demaille <akim@epita.fr>
11797
11798 Tune local.at so that people can "autom4te -l autotest calc.at -o
11799 calc" for instance, to extract a sub test suite.
11800
11801 * tests/testsuite.at: Move the initialization, Autotest version
11802 requirement, and AT_TESTED invocation into...
11803 * tests/local.at: here.
11804 * tests/testsuite.at: Include it for compatibility with Autoconf
11805 2.57.
11806 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
11807 be ignore.
11808
11809 2003-08-04 Paul Eggert <eggert@twinsun.com>
11810
11811 Rework code slightly to avoid gcc -Wtraditional warnings.
11812 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
11813 The returned value is now stored in *YY0. All callers changed.
11814 * src/output.c (merge_output): Adjust to the above change.
11815
11816 2003-07-26 Paul Eggert <eggert@twinsun.com>
11817
11818 * data/glr.c (YYASSERT): New macro.
11819 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
11820 yyresolveStates, yyprocessOneStack):
11821 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
11822 Derived from a suggestion by Frank Heckenbach.
11823
11824 2003-07-25 Paul Eggert <eggert@twinsun.com>
11825
11826 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
11827 for portability to K&R C (after ansi2knr, presumably). See
11828 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
11829 by Frank Heckenbach, though I have omitted the structure-initialization
11830 part of his glr-knr.diff patch since I recall that the Portable
11831 C Compiler didn't require that change.
11832
11833 Let the user specify how to allocate and free memory.
11834 Derived from a suggestion by Frank Heckenbach in
11835 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
11836 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
11837 All uses of free, malloc, realloc changed to use these macros,
11838 and unnecessary casts removed.
11839 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
11840
11841 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
11842
11843 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
11844 use s.empty() rather than s == "" to test for empty string; see
11845 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
11846 (trivial change)
11847
11848 2003-06-25 Akim Demaille <akim@epita.fr>
11849
11850 * config/depcomp, config/install-sh: Update from masters.
11851
11852 2003-06-20 Paul Eggert <eggert@twinsun.com>
11853
11854 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
11855 and return properly parenthesized result.
11856 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
11857 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
11858 Remove unnecessary parentheses from uses.
11859 * doc/bison.texinfo (Location Default Action): Describe the
11860 conventions for parentheses.
11861
11862 2003-06-19 Paul Eggert <eggert@twinsun.com>
11863
11864 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
11865 yyreportTree): Do not assume that size_t is the same width as int,
11866 when printing sizes. Print sizes using an unsigned format.
11867 Problem reported by Frank Heckenbach in
11868 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
11869
11870 Port to Forte Developer 7 C compiler.
11871 * data/glr.c (struct YYLTYPE): If locations are not being used,
11872 declare a single dummy member, as empty structs do not conform
11873 to the C standard.
11874 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
11875 the Forte Developer 7 C compiler complains that end-of-loop
11876 code is not reached.
11877
11878 2003-06-17 Paul Eggert <eggert@twinsun.com>
11879
11880 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
11881 avoid warnings from picky compilers about redefinition of PARAMS.
11882
11883 2003-06-17 Paul Eggert <eggert@twinsun.com>
11884
11885 Version 1.875b.
11886
11887 * NEWS: Document 1.875b.
11888
11889 * lib/bbitset.h: Do not include config.h; that's the includer's job.
11890 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
11891 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
11892 Don't use 'index' in comments, as it's a builtin fn on some hosts.
11893 * lib/bitset_stats.c: Include gettext.h unconditionally, as
11894 per recent gettext manual's suggestion.
11895 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
11896 Use prototypes, not old-style definitions.
11897 * lib/lbitset.c (lbitset_unused_clear): Likewise.
11898 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
11899 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
11900 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
11901 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
11902 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
11903 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
11904 vbitset_or_and_cmp, vbitset_copy): Likewise.
11905
11906 * lib/libiberty.h: Do not include config.h; that's the includer's job.
11907 Do not include <stdlib.h>.
11908 (PARAMS): Define unconditionally for C89.
11909 (ATTRIBUTE_NORETURN): Remove.
11910 (ATTRIBUTE_UNUSED): Define unconditionally.
11911
11912 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
11913 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
11914 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
11915 * lib/vbitset.c, lib/vbitset.h: New files.
11916 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
11917 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
11918 from libbitset.
11919
11920 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
11921 `How Can I Reset @code{yyparse}', since texinfo does not allow
11922 arbitrary @ in node names.
11923
11924 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
11925 shouldn't be needed according to the gettext 0.12.1 documentation
11926 but which seem to be needed anyway: codeset.m4 glibc21.m4
11927 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
11928 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
11929 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
11930
11931 * lib/.cvsignore: Add stdbool.h.
11932 * m4/.cvsignore: Add nls.m4, po.m4.
11933
11934 Upgrade to CVS gnulib.
11935 * stdbool_.h: File renamed from stdbool.h.in.
11936 * configure.ac (AM_STDBOOL_H): Invoke this instead of
11937 AC_HEADER_STDBOOL.
11938 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
11939 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
11940 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
11941 (MOSTLYCLEANFILES): New var.
11942 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
11943 (stdbool.h): New rule.
11944 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
11945 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
11946 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
11947 m4/quote.m4: Upgrade to today's gnulib.
11948
11949 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
11950 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
11951 the tests right now.
11952 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
11953 yyerror are declared before use; C99 requires this.
11954
11955 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11956
11957 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
11958 first.
11959 (yyrecoverSyntaxError): Correct the logic for setting and testing
11960 yyerrState.
11961 Correct comment on handling EOF.
11962 Allow states with only a default reduction, rather than failing
11963 (I can't quite reconstruct why these were not allowed before).
11964
11965 Fixes to avoid problem that $-N rules in GLR parsers can cause
11966 buffer overruns, corrupting state.
11967
11968 * src/output.c (prepare_rules): Output max_left_semantic_context
11969 definition.
11970 * src/reader.h (max_left_semantic_context): New variable declaration.
11971 * src/scan-gram.l (max_left_semantic_context): Define.
11972 (handle_action_dollar): Update max_left_semantic_context.
11973 * data/glr.c (YYMAXLEFT): New definition.
11974 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
11975 (yyresolveAction): Ditto.
11976
11977 Fixes to problems with location handling in GLR parsers reported by
11978 Frank Heckenbach (2003/06/05).
11979
11980 * data/glr.c (YYLTYPE): Make trivial if locations not used.
11981 (YYRHSLOC): Add parentheses, and define only if locations used.
11982 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
11983 locations not used.
11984 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
11985 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
11986
11987 * tests/cxx-type.at: Exercise location information; update tests
11988 to differentiate output with and without locations.
11989 Remove forward declarations of yylex and yyerror---caused errors
11990 because default YYLTYPE not yet defined.
11991 Change semantic actions to compute strings, rather than printing
11992 them directly (to test proper passing of semantics values). Change
11993 output to prefix notation and update test data and expected results.
11994 (yylex): Track locations.
11995 (stmtMerge): Return value rather than printing, and include arguments
11996 in value.
11997
11998 2003-06-03 Paul Eggert <eggert@twinsun.com>
11999
12000 Avoid warnings generated by GCC 2.95.4 when Bison is
12001 configured with --enable-gcc-warnings.
12002 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
12003 yy::]b4_parser_class_name[::translate_,
12004 yy::Stack::operator[] (unsigned),
12005 yy::Stack::operator[] (unsigned) const,
12006 yy::Slice::operator[] (unsigned),
12007 yy::Slice::operator[] (unsigned) const):
12008 Rename local vars to avoid warnings.
12009 * tests/glr-regression.at (Improper handling of embedded actions
12010 and $-N in GLR parsers): Remove unused local variable from yylex.
12011 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
12012 (void) as arg when not pure, since we now assume C89 when building
12013 Bison. Pacify GCC by using parameter.
12014
12015 2003-06-02 Paul Eggert <eggert@twinsun.com>
12016
12017 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
12018 yy::Location::lines, yy::Location::columns): Rename arguments
12019 to avoid shadowing; this removes a warning generated by GCC 3.3.
12020
12021 2003-06-01 Paul Eggert <eggert@twinsun.com>
12022
12023 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
12024 to g++, as GCC 3.3 complains if you do it.
12025 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
12026 everything that WARNING_CFLAGS has, except omit warnings
12027 not suitable for C++.
12028 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
12029 * tests/atlocal.in (CXXFLAGS): New var.
12030 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
12031
12032 Fix a GLR parser bug I reported in February; see
12033 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
12034 The problem was that GLR parsers did not conform to the C standard,
12035 because actions like { $1 = $2 + $3; } expanded to expressions
12036 that invoked YYFILL in separate subexpressions, and YYFILL assigned
12037 to a local variable. The C standard says that expressions
12038 like (var = f ()) + (var = f ()) have undefined behavior.
12039 Another problem was that GCC sometimes issues warnings that
12040 yyfill and its parameters are unused.
12041
12042 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
12043 as possibly unused.
12044 (yyfill): New function.
12045 (YYFILL): Use it.
12046 (yyuserAction): Change type of yynormal to bool, so that it matches
12047 the new yyfill signature. Mark it as possibly unused.
12048
12049
12050 Follow up on a bug I reported in February, where a Bison-generated
12051 parser can loop. Provide a test case and a fix for yacc.c. I
12052 don't have a fix for lalr1.cc or for glr.c, unfortunately.
12053 The original bug report is in:
12054 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
12055
12056 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
12057 macro's size was becoming unwieldy.
12058 (yyerrlab): Do not discard an empty lookahead symbol, as this
12059 might destroy garbage.
12060 (yyerrorlab): New label, with the old contents of YYERROR,
12061 plus the following change: pop the stack of rhs corresponding
12062 to the production that invoked YYERROR. That is how Yacc
12063 behaves, and POSIX requires this behavior.
12064 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
12065 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
12066 Define 'alarm' to do nothing if unistd.h is not available.
12067 Add a new rule "exp: '-' error;" to test the above change to
12068 data/yacc.c. Use 'alarm' to abort any test taking longer than
12069 10 seconds, as it's probably looping.
12070 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
12071 Also, the new yacc.c generates two fewer diagnostics for an
12072 existing test.
12073
12074 2003-05-24 Paul Eggert <eggert@twinsun.com>
12075
12076 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
12077 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
12078 This fixes a problem reported by John Bowman when the Compaq/HP
12079 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
12080 -ansi -Wall -gall).
12081 * data/yacc.c (union yyalloc): Likewise.
12082 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
12083
12084 Switch from 'int' to 'bool' where that makes sense.
12085
12086 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
12087 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
12088 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
12089 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
12090 Return or accept bool, not int. All callers changed.
12091 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
12092 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
12093 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
12094 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
12095 bitset_or_and_cmp_): Likewise.
12096 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
12097 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
12098 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
12099 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
12100 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
12101 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
12102 bitset_stats_or_and_cmp): Likewise.
12103 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
12104 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
12105 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
12106 ebitset_xor_cmp): Likewise.
12107 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
12108 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
12109 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
12110 lbitset_xor_cmp): Likewise.
12111 * lib/bbitset.h: Include <stdbool.h>.
12112 (struct bitset_vtable): The following members now return bool, not
12113 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
12114 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
12115 or_and_cmp).
12116 * src/conflicts.c (count_rr_conflicts): Likewise.
12117 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
12118 All uses changed.
12119 * lib/ebitset.c (ebitset_obstack_init): Likewise.
12120 * lib/lbitset.c (lbitset_obstack_init): Likewise.
12121 * src/getargs.c (debug_flag, defines_flag, locations_flag,
12122 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12123 graph_flag): Likewise.
12124 * src/getargs.h (debug_flag, defines_flag, locations_flag,
12125 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12126 graph_flag): Likewise.
12127 * src/output.c (error_verbose): Likewise.
12128 * src/output.h (error_verbose): Likewise.
12129 * src/reader.c (start_flag, typed): Likewise.
12130 * src/reader.h (typed): Likewise.
12131 * src/getargs.c (LOCATIONS_OPTION): New constant.
12132 (long_options, getargs): Use it.
12133 * src/lalr.c (build_relations): Use bool, not int.
12134 * src/nullable.c (nullable_compute): Likewise.
12135 * src/print.c (print_reductions): Likewise.
12136 * src/tables.c (action_row, pack_vector): Likewise.
12137 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
12138 * src/output.c (prepare): Use it.
12139 * src/output.c (token_definitions_output,
12140 symbol_destructors_output, symbol_destructors_output): Use string,
12141 not boolean integer, to keep track of whether to output separator.
12142 * src/print_graph.c (print_core): Likewise.
12143 * src/state.c (state_rule_lookaheads_print): Likewise.
12144
12145 * config/install-sh: Sync from automake 1.7.5.
12146
12147 2003-05-14 Paul Eggert <eggert@twinsun.com>
12148
12149 * src/parse-gram.y (rules_or_grammar_declaration): Require a
12150 semicolon after a grammar declaration, in the interest of possible
12151 future changes to the Bison input language.
12152 Do not allow a stray semicolon at the start of the grammar.
12153 (rhses.1): Allow one or more semicolons after any rule, including
12154 just before "|" as required by POSIX.
12155 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
12156 grammar.
12157
12158 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
12159
12160 %parse-param support for lalr1.cc.
12161
12162 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
12163 b4_cc_constructor_calls, b4_cc_constructor_call,
12164 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
12165 definitions.
12166 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
12167 parse-param arguments.
12168 (yy::b4_parser_class_name): Declare instance variables to
12169 hold parse-param arguments.
12170 * tests/calc.at: s/value/semantic_value/ because value clashes
12171 with a member of yy::b4_parser_class_name. Adjust C++ code
12172 to handle %parse-param. Enable %parse-param test in C++.
12173
12174 2003-05-12 Paul Eggert <eggert@twinsun.com>
12175
12176 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
12177 English a bit. Fix fclose typo. Change "const char" to "char
12178 const", and use ANSI C rather than K&R for "main". Suggest
12179 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
12180 and suggest yy_switch_to_buffer.
12181
12182 2003-05-05 Paul Eggert <eggert@twinsun.com>
12183
12184 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
12185 C89. This avoids a diagnostic on compilers that define __STDC__
12186 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
12187 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
12188
12189 2003-05-03 Paul Eggert <eggert@twinsun.com>
12190
12191 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
12192 Do not overrun array bounds.
12193 This should fix a bug reported today by Olatunji Oluwabukunmi in
12194 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
12195
12196 2003-04-29 Akim Demaille <akim@epita.fr>
12197
12198 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
12199 * src/getargs.c, src/getargs.h: here, as bool, not int.
12200 (nondeterministic_parser): New.
12201 * src/parse-gram.y, src/scan-gram.l: Support
12202 %nondeterministic-parser.
12203 * src/output.c (prepare): Use nondeterministic_parser instead
12204 of glr_parser where appropriate.
12205 * src/tables.c (conflict_row, action_row, save_row)
12206 (token_actions, token_actions, pack_vector): Ditto.
12207
12208 2003-04-29 Akim Demaille <akim@epita.fr>
12209
12210 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
12211
12212 2003-04-29 Akim Demaille <akim@epita.fr>
12213
12214 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
12215 with %pure-parser and %locations to exercise the patch from Yakov
12216 Markovitch below.
12217
12218 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
12219
12220 * data/yacc.c: (b4_lex_param): Corrected for the case where
12221 %lex-param is provided and %pure-parser isn't.
12222
12223 2003-04-27 Paul Eggert <eggert@twinsun.com>
12224
12225 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
12226 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
12227 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
12228 if it is not defined.
12229 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
12230
12231 2003-04-26 Paul Eggert <eggert@twinsun.com>
12232
12233 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
12234 Declare to be of type suitable for the ninf value itself, not of
12235 type suitable for the corresponding table, since the latter might
12236 be unsigned but the ninf value might be negative. This fixes a
12237 bug reported by Alexandre Duret-Lutz in
12238 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
12239
12240 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
12241 invokes it. We shouldn't invoke it twice because it will attempt
12242 to put error.o in the archive twice. This fixes a glitch reported
12243 by Martin Mokrejs in
12244 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
12245
12246 2003-04-21 Paul Eggert <eggert@twinsun.com>
12247
12248 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
12249 to gnulib.
12250
12251 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
12252
12253 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
12254 Fix obvious typo that results in uncompilable GLR parsers
12255 when both %pure-parser and %locations are used. (trivial change)
12256
12257 2003-04-17 Paul Eggert <eggert@twinsun.com>
12258
12259 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
12260 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
12261 Do not insert the expected token via unput, as this runs afoul
12262 of a POSIX-compatibility bug in flex 2.5.31.
12263 All uses changed to BEGIN the parent state,
12264 since we no longer insert the expected token via unput.
12265 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
12266 that is no longer emitted after the above change.
12267
12268 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
12269 the first one. This change is from Paul Hilfinger, and it fixes
12270 regression reported by Werner Lemberg in
12271 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
12272
12273 (resolve_sr_conflict): Don't invoke state_errs_set
12274 unless one or more tokens have been explicitly made errors.
12275 Otherwise, the above change causes Bison to abort.
12276
12277 * tests/existing.at (GNU pic Grammar): New test case, taken from
12278 Lemberg's email.
12279
12280 2003-03-31 Akim Demaille <akim@epita.fr>
12281
12282 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
12283
12284 2003-03-31 Akim Demaille <akim@epita.fr>
12285
12286 * src/output.c (prepare_symbols): Avoid trailing spaces in the
12287 output.
12288
12289 2003-03-31 Akim Demaille <akim@epita.fr>
12290
12291 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
12292 From Paul Hilfinger.
12293
12294 2003-03-29 Akim Demaille <akim@epita.fr>
12295
12296 * m4/error.m4: Do not put under dynamic conditions some code which
12297 expansion is under static control.
12298
12299 2003-03-29 Akim Demaille <akim@epita.fr>
12300
12301 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
12302
12303 2003-03-29 Akim Demaille <akim@epita.fr>
12304
12305 * doc/bison.texinfo (Strings are Destroyed): New.
12306
12307 2003-03-13 Paul Eggert <eggert@twinsun.com>
12308
12309 * .cvsignore: Add configure.lineno.
12310 * src/.cvsignore: Add yacc.
12311 * tests/.cvsignore: Add testsuite.log.
12312 * doc/fdl.texi: Sync with latest FSF version.
12313
12314 2003-03-12 Paul Eggert <eggert@twinsun.com>
12315
12316 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
12317 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
12318 cursor, instead of leaving it undefined. This fixes a bug
12319 reported by Tim Van Holder in
12320 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
12321 * tests/input.at (Torturing the Scanner): Test the scanner on
12322 an empty input file, which was Tim Van Holder's test case.
12323
12324 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
12325 <sys/resource.h> can be included, include sys/time.h and
12326 sys/times.h first, if available. This works around the SunOS
12327 4.1.4 porting bug reported by Bruce Becker in
12328 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
12329
12330 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
12331 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
12332 AC_HEADER_SYS_WAIT.
12333
12334 Merge changes from gnulib. This was prompted because the CVS
12335 snapshot didn't build on Solaris 7 due to strnlen problems.
12336
12337 These changes need to be merged back into gnulib:
12338 * lib/hash.c: Include <stdbool.h> unconditionally.
12339 * m4/onceonly.m4 (m4_quote): New macro.
12340 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
12341 Quote AC_FOREACH variable-expansions properly.
12342 The 2003-01-03 obstack.h change also needs merging.
12343 {end of changes requiring merging}
12344
12345 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
12346 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
12347 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
12348 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
12349 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
12350 New files, imported from gnulib.
12351 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
12352 above.
12353
12354 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
12355 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
12356 gnulib sources.
12357
12358 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
12359 Add.
12360 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
12361 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
12362 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
12363 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
12364 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
12365 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
12366 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
12367 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
12368 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
12369 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
12370 (jm_PREREQ_ARGMATCH): Remove.
12371 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
12372 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
12373
12374 * src/system.h: Include <stdbool.h> unconditionally.
12375
12376 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
12377 assuming at least C89 in the bitset code for some time now.
12378
12379 2003-03-03 Akim Demaille <akim@epita.fr>
12380
12381 * ro.po: New.
12382
12383 2003-03-02 Akim Demaille <akim@epita.fr>
12384
12385 * doc/bison.texinfo (Table of Symbols): Reactivate the
12386 documentation for %lex-param, and %parse-param.
12387
12388 2003-03-02 Akim Demaille <akim@epita.fr>
12389
12390 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
12391 generate verbose error messages.
12392 Use the number of tokens as an upper bound in yytname, as it
12393 cannot be a non terminal.
12394
12395 2003-03-02 Akim Demaille <akim@epita.fr>
12396
12397 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
12398 message.
12399
12400 2003-03-02 Akim Demaille <akim@epita.fr>
12401
12402 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
12403 Use them to exercise yycheck overrun.
12404 Based on Andrew Suffield's grammar.
12405
12406 2003-03-02 Akim Demaille <akim@epita.fr>
12407
12408 Create tests/local.at for Bison generic testing macros.
12409
12410 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
12411 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
12412 This new file.
12413 * tests/calc.at (AT_CHECK_CALC): Adjust.
12414 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
12415 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
12416 * tests/local.at: here.
12417 (AT_COMPILE_CXX): Tags the tests using it as c++.
12418 Ignore the test if CXX is not functional.
12419
12420 2003-03-01 Paul Eggert <eggert@twinsun.com>
12421
12422 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
12423 not loc->end, since loc->end might contain garbage and this leads
12424 to undefined behavior on some platforms.
12425 (id_loc, token_start): Use (IF_LINTed) initial values that do not
12426 depend on *loc, so that the reader doesn't give the the false
12427 impression that *loc is initialized.
12428 (<INITIAL>"%%"): Do not bother setting code_start, since its value
12429 does not survive the return.
12430
12431 2003-03-01 Akim Demaille <akim@epita.fr>
12432
12433 * src/scan-gram.l (code_start): Always initialize it when entering
12434 into yylex, as SC_EPILOGUE is activated *before* the corresponding
12435 yylex invocation. An alternative would be making it static, but
12436 then it starts with the second %%'s beginning, instead of its end.
12437
12438 2003-02-28 Paul Eggert <eggert@twinsun.com>
12439
12440 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
12441 around a UnixWare 7.1.1 porting bug reported by John Hughes in
12442 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
12443
12444 2003-02-26 Paul Eggert <eggert@twinsun.com>
12445
12446 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
12447 Remove Sequent/Pyramid discussion (nobody uses them any more).
12448 Merge VMS and MS-DOS discussion; these ports may well be dead
12449 but let's keep mentioning them for now. Put <> around email
12450 addresses. Add copyright notice.
12451
12452 2003-02-24 Paul Eggert <eggert@twinsun.com>
12453
12454 * data/glr.c (yy_reduce_print): yylineno -> yylno,
12455 to avoid collision with flex use of yylineno.
12456 Problem reported by Bruce Lilly in
12457 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
12458 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
12459 * data/yacc.c (yy_reduce_print): Likewise.
12460
12461 * config/depcomp: Sync with Automake 1.7.3.
12462
12463 2003-02-21 Akim Demaille <akim@epita.fr>
12464
12465 * data/lalr1.cc: Use temporary variables instead of casts to
12466 change integer types.
12467 Suggested by Paul Eggert.
12468
12469 2003-02-21 Akim Demaille <akim@epita.fr>
12470
12471 * doc/bison.texinfo: Use "location" consistently to refer to @n,
12472 to avoid confusions with lalr1.cc's notion of Position.
12473 Suggested by Paul Eggert.
12474
12475 2003-02-20 Akim Demaille <akim@epita.fr>
12476
12477 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
12478 before initial_columns.
12479 (location.hh): Use consistent variable names when defining the
12480 operator<<.
12481 Use "last" so that we subtract from Positions, not from unsigned.
12482
12483 2003-02-20 Akim Demaille <akim@epita.fr>
12484
12485 * data/lalr1.cc (position.hh): New subfile, including the extended
12486 and Doxygen'ed documentation of class Position.
12487 (location.hh): Use it.
12488 Document a` la Doxygen.
12489 With the help of Benoit Perrot.
12490
12491 2003-02-20 Akim Demaille <akim@epita.fr>
12492
12493 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
12494 AT_YACC_IF.
12495 Redefine AT_YYERROR_SEES_LOC_IF using it.
12496 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
12497 not defined.
12498 Don't use the location in yy::Parser::error_ and
12499 yy::Parser::print_ when not %locations.
12500 Activate more lalr1.cc tests.
12501
12502 2003-02-19 Akim Demaille <akim@epita.fr>
12503
12504 * data/lalr1.cc: When displaying a line number, be sure to make it
12505 an int.
12506
12507 2003-02-19 Akim Demaille <akim@epita.fr>
12508
12509 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
12510 Remove, useless.
12511 (YYABORT, YYACCEPT, YYERROR): New.
12512 * tests/calc.at: Renable the lalr1.cc test.
12513
12514 2003-02-19 Akim Demaille <akim@epita.fr>
12515
12516 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
12517 error recovery, mixing with/without pops and discarding of the
12518 lookahead.
12519 Exercise YYERROR.
12520 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
12521
12522 2003-02-17 Paul Eggert <eggert@twinsun.com>
12523
12524 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
12525 * tests/testsuite.at (AT_COMPILE): Use them.
12526 This fixes the testsuite problem reported by Robert Lentz in
12527 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
12528
12529 2003-02-12 Paul Eggert <eggert@twinsun.com>
12530
12531 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
12532 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
12533 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
12534 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
12535 Check for malloc failure, for consistency with yacc.c.
12536 (yytname_size): Remove, for consistency with yacc.c.
12537
12538 The bug still remains in data/lalr1.cc, as I didn't have time
12539 to fix it there.
12540
12541 2003-02-06 Akim Demaille <akim@epita.fr>
12542
12543 * configure.ac (GXX): Rename as...
12544 (CXX): this, to keep the original Autoconf semantics.
12545 Require 2.57.
12546 * data/lalr1.cc: Fix b4_copyright invocations.
12547 If YYDEBUG is not defined, don't depend upon name_ being defined.
12548 (location.hh): Include string and iostream.
12549 (Position::filename): New member.
12550 (Position::Position ()): New.
12551 (operator<< (Position)): New.
12552 (operator- (Position, int)): New.
12553 (Location::first, Location::last): Rename as...
12554 (Location::begin, Location::end): these, to mock the conventional
12555 iterator names.
12556 (operator<< (Location)): New.
12557 * tests/atlocal.in (CXX): New.
12558 * tests/testsuite.at (AT_COMPILE_CXX): New.
12559 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
12560 locations in a more synthetic way.
12561 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
12562 lalr1.cc is used.
12563 Adjust the C locations to match those from Emacs: first column is
12564 column 0.
12565 Change all the expected results.
12566 Conform to the GCS: simplify the locations when applicable.
12567 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
12568 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
12569 these CPP macros with the m4 macros new defined by...
12570 (AT_CHECK_PUSHDEFS): this, i.e.:
12571 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
12572 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
12573 New macros.
12574 (AT_CHECK_POPDEFS): Undefine them.
12575 (AT_CHECK_CALC_LALR1_CC): New.
12576 Use it for the first lalr1.cc test.
12577
12578 2003-02-04 Akim Demaille <akim@epita.fr>
12579
12580 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
12581 Location as is defined.
12582
12583 2003-02-04 Akim Demaille <akim@epita.fr>
12584
12585 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
12586 name_ being defined.
12587
12588 2003-02-03 Paul Eggert <eggert@twinsun.com>
12589
12590 * src/gram.h (start_symbol): Remove unused decl.
12591
12592 Use more-consistent naming conventions for local vars.
12593
12594 * src/derives.c (derives_compute): Change type of local var from
12595 int to rule_number.
12596 * src/gram.c (grammar_rules_partial_print): Likewise.
12597 * src/print.c (print_core): Likewise.
12598 * src/reduce.c (reduce_grammar_tables): Likewise.
12599
12600 * src/gram.c (grammar_dump): Change name of item_number *
12601 local var from r to rp.
12602 * src/nullable.c (nullable_compute): Likewise.
12603
12604 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
12605
12606 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
12607 for symbol or symbol_number var.
12608 * src/reader.c (grammar_start_symbol_set): Likewise.
12609 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
12610 Likewise.
12611 * src/state.c (transitions_to): Likewise.
12612 * src/state.h: Likewise.
12613 * src/tables.c (symbol_number_to_vector_number): Likewise.
12614
12615 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
12616 char * var.
12617
12618 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
12619 var.
12620
12621 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
12622 var.
12623
12624 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
12625 Use str, not s, for char * var. Use ch, not c, for character var.
12626 Use size for size var.
12627
12628 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
12629 char * var.
12630 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
12631 uniqstr var.
12632 * src/uniqstr.h: Likewise.
12633
12634 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12635 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12636 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
12637 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
12638 param to have same name as that of enum, so that we don't use
12639 "s" to stand for a non-state.
12640
12641 2003-02-02 Akim Demaille <akim@epita.fr>
12642
12643 * src/scan-skel.l: Scan more than one inert character per yylex
12644 invocation.
12645
12646 2003-02-01 Paul Eggert <eggert@twinsun.com>
12647
12648 Version 1.875a.
12649
12650 * po/LINGUAS: Add ms.
12651
12652 2003-01-30 Akim Demaille <akim@epita.fr>
12653
12654 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
12655
12656 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12657
12658 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
12659 of $1.
12660
12661 Changes in response to error report by S. Eken: GLR mode does not
12662 handle negative $ indices or $ indices in embedded rules correctly.
12663 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
12664
12665 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
12666 (b4_rhs_location): Ditto.
12667 (yyfill): New function to copy from stack tree into array
12668 incrementally.
12669 (yyuserAction): Modify to allow incremental move of semantic values
12670 to rhs array when in GLR mode.
12671 Define YYFILL to use in user-defined actions to fill semantic array
12672 as needed.
12673 Remove dummy use of yystack, as there is now a guaranteed use.
12674 (yydoAction): Modify to allow incremental move of semantic values
12675 to rhs array when in GLR mode.
12676 (yyresolveAction): Ditto.
12677 (yyglrShiftDefer): Update comment.
12678 (yyresolveStates): Use X == NULL for pointers, not !X.
12679 (yyglrReduce): Ditto.
12680 (yydoAction): Ditto
12681
12682 * tests/glr-regr1.at: Rename to ...
12683 * tests/glr-regression.at: Add new regression test for the problems
12684 described above (adapted from S. Eken).
12685 Update copyright notice.
12686 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
12687 * tests/Makefile.am: Ditto.
12688
12689 2003-01-28 Paul Eggert <eggert@twinsun.com>
12690
12691 * data/lalr1.cc: Do not use @output_header_name@ unless
12692 b4_defines_flag is set. This fixes two bugs reported by
12693 Tim Van Holder in
12694 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
12695 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
12696
12697 2003-01-21 Paul Eggert <eggert@twinsun.com>
12698
12699 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
12700 we don't need to worry about yyerrlab1 being reported as an
12701 "unused label" by non-GCC C compilers. The downside is that if
12702 locations are used then a couple of statements are duplicated each
12703 time YYERROR is invoked, but the upside is that the warnings
12704 should vanish.
12705 (yyerrlab1): Move code to YERROR.
12706 (yyerrlab2): Remove. Change uses back to yyerrlab1.
12707 This reverts some of the 2002-12-27 change.
12708
12709 2003-01-17 Paul Eggert <eggert@twinsun.com>
12710
12711 * src/output.c (symbol_printers_output): Fix typo that led
12712 to core dump. Problem reported by Antonio Rus in
12713 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
12714
12715 2003-01-13 Akim Demaille <akim@epita.fr>,
12716 Quoc Peyrot <chojin@lrde.epita.fr>,
12717 Robert Anisko <anisko_r@lrde.epita.fr>
12718
12719 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
12720 when the stacks contain one element, as the loop would otherwise
12721 free the last state, and then use the top state (the one we just
12722 popped). This means that the initial elements will not be freed
12723 explicitly, as is the case in yacc.c; it is not a problem, as
12724 these elements have fake values.
12725
12726 2003-01-11 Paul Eggert <eggert@twinsun.com>
12727
12728 * NEWS: %expect-violations are now just warnings, reverting
12729 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
12730 bootstrapping problem reported by Matthias Klose; see
12731 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
12732 * src/conflicts.c (conflicts_print): Likewise.
12733 * tests/conflicts.at (%expect not enough, %expect too much,
12734 %expect with reduce conflicts): Likewise.
12735 * doc/bison.texinfo (Expect Decl): Document this. Also mention
12736 that the warning is enabled if the number of conflicts changes
12737 (not necessarily increases).
12738
12739 * src/getargs.c (version): Update copyright year.
12740
12741 2003-01-09 Akim Demaille <akim@epita.fr>
12742
12743 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
12744
12745 2003-01-08 Paul Eggert <eggert@twinsun.com>
12746
12747 * Makefile.maint (WGETFLAGS):
12748 New macro, containing "-C off" to disable proxy caches.
12749 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
12750 (rel-check): Use $(WGET) instead of wget.
12751
12752 2003-01-06 Paul Eggert <eggert@twinsun.com>
12753
12754 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
12755 the GLR paper of Scott, Johnstone and Hussain.
12756
12757 2003-01-04 Paul Eggert <eggert@twinsun.com>
12758
12759 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
12760 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
12761 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
12762 (EXTRA_LIBRARIES): New var, for liby.a.
12763 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
12764 (EXTRA_SCRIPTS): New var, for yacc.
12765
12766 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
12767 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
12768 Problem reported by Nelson H. F. Beebe.
12769
12770 2003-01-03 Paul Eggert <eggert@twinsun.com>
12771
12772 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
12773 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
12774 when compiling Bison 1.875's `bitset bset = obstack_alloc
12775 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
12776
12777 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
12778 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
12779 grow to a huge size with typical invocation.
12780
12781 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
12782 Use the pattern recommended by Autoconf 2.57, except also protect
12783 against double-definition.
12784 * src/system.h: Likewise.
12785 Portability issues reported by Nelson H. F. Beebe.
12786
12787 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
12788 All uses changed. Provide a definition in both C and C++.
12789 (yytrue, yyfalse): Define even if defined (__cplusplus).
12790
12791 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
12792 Reported by Nelson H. F. Beebe.
12793
12794 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
12795
12796 2003-01-02 Paul Eggert <eggert@twinsun.com>
12797
12798 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
12799 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
12800 Bug reported by Nelson H. F. Beebe.
12801
12802 2003-01-01 Paul Eggert <eggert@twinsun.com>
12803
12804 * Version 1.875.
12805
12806 2002-12-30 Paul Eggert <eggert@twinsun.com>
12807
12808 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
12809 Moved here from...
12810 (<INITIAL>","): Here. This causes stray "," to be treated
12811 more uniformly.
12812
12813 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
12814 last brace in braced code when not in Yacc mode, for compatibility
12815 with Bison 1.35. This resurrects the 2001-12-15 patch to
12816 src/reader.c.
12817
12818 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
12819 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
12820
12821 2002-12-28 Paul Eggert <eggert@twinsun.com>
12822
12823 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
12824 that of SYM's type. This fixes Debian bug 168069, reported by
12825 Thomas Olsson.
12826
12827 2002-12-28 Paul Eggert <eggert@twinsun.com>
12828
12829 Version 1.75f.
12830
12831 Switch back to the Yacc style of conflict reports, undoing some
12832 of the 2002-07-30 change.
12833 * doc/bison.texinfo (Understanding): Use Yacc style for
12834 conflict reports. Also, use new way of locating rules.
12835 * src/conflicts.c (conflict_report):
12836 Renamed from conflict_report_yacc, removing the old
12837 'conflict_report'. Translate the entire conflict report at once,
12838 so that we don't assume that "," has the same interpretation in
12839 all languages.
12840 (conflicts_output): Use Yacc-style conflict report for each state,
12841 instead of our more-complicated style.
12842 (conflicts_print): Use Yacc-style conflict report, except print
12843 the input file name when not emulating Yacc.
12844 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
12845 Conflicted Reduction, %expect not enough, %expect too much,
12846 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
12847 * tests/existing.at (GNU Cim Grammar): Likewise.
12848 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
12849
12850 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
12851 fatal): Don't invoke fflush; it's not needed and it might even be
12852 harmful for stdout, as stdout might not be open.
12853 * src/reduce.c (reduce_print): Likewise.
12854
12855 2002-12-27 Paul Eggert <eggert@twinsun.com>
12856
12857 Fix a bug where error locations were not being recorded correctly.
12858 This problem was originally reported by Paul Hilfinger in
12859 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
12860
12861 * data/yacc.c (yyparse): New local var yylerrsp, to record the
12862 top of the location stack's error locations.
12863 (yyerrlab): Set it. When discarding a token, push its location
12864 onto yylerrsp so that we don't lose track of the error's end.
12865 (yyerrlab1): Now is only the target of YYERROR, so that we can
12866 properly record the location of the action that failed. For GCC
12867 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
12868 GCC warning about yyerrlab1 being unused if YYERROR is unused.
12869 (yyerrlab2): New label, which yyerrlab now falls through to.
12870 Compute the error's location by applying YYLLOC_DEFAULT to
12871 the locations of all the symbols that went into the error.
12872 * doc/bison.texinfo (Location Default Action): Mention that
12873 YYLLOC_DEFAULT is also invoked for syntax errors.
12874 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12875 Error locations include the locations of all the tokens that were
12876 discarded, not just the last token.
12877
12878 2002-12-26 Paul Eggert <eggert@twinsun.com>
12879
12880 * src/files.c: Include quote.h.
12881 (compute_output_file_names): Warn if we detect conflicting
12882 outputs to the same file. This should catch the misunderstanding
12883 exemplified by Debian Bug 165349, reported by Bruce Stephens..
12884
12885 * src/conflicts.c (conflicts_print): If the user specifies
12886 "%expect N", report an error if there are any reduce/reduce
12887 conflicts. This is what the manual says should happen.
12888 This fixes Debian bug 130890, reported by Anthony DeRobertis.
12889 * tests/conflicts.at (%expect with reduce conflicts): New test.
12890
12891 Don't use m4_include on relative file names, as it doesn't work as
12892 desired if there happens to be a file with that name under ".".
12893
12894 * m4sugar/version.m4: Remove; it was included but it wasn't used.
12895 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
12896 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
12897 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
12898 * src/output.c (output_skeleton): Use full path names when
12899 specifying a file to include; don't rely on include path, as
12900 it's unreliable when the working file contains a file with
12901 that name.
12902
12903 2002-12-25 Paul Eggert <eggert@twinsun.com>
12904
12905 Remove obsolete references to bison.simple and bison.hairy.
12906 Problem mentioned by Aubin Mahe in
12907 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
12908 * data/glr.c: Comment fix.
12909 * doc/bison.1: Remove references. Also, mention "yacc".
12910
12911 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
12912 with -g option.
12913
12914 * src/parse-gram.y (declaration): Use enum "report_states" rather
12915 than its numeric value 1.
12916
12917 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
12918 opening a new one. This fixes Debian bug 165349, reported by
12919 Bruce Stephens.
12920
12921 2002-12-24 Paul Eggert <eggert@twinsun.com>
12922
12923 Version 1.75e.
12924
12925 * Makefile.maint (cvs-update): Don't assume that the shell
12926 supports $(...), as Solaris sh doesn't.
12927
12928 * src/parse-gram.y (lloc_default): Remove test for empty
12929 nonterminals at the end, since it didn't change the result.
12930
12931 2002-12-24 Paul Eggert <eggert@twinsun.com>
12932
12933 If the user does not define YYSTYPE as a macro, Bison now declares it
12934 using typedef instead of defining it as a macro. POSIX requires this.
12935 For consistency, YYLTYPE is also declared instead of defined.
12936
12937 %union directives can now have a tag before the `{', e.g., the
12938 directive `%union foo {...}' now generates the C code
12939 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
12940 The default union tag is `YYSTYPE', for compatibility with Solaris 9
12941 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
12942 instead of `yyltype'.
12943
12944 `yystype' and `yyltype' are now obsolescent macros instead of being
12945 typedefs or tags; they are no longer documented and will be
12946 withdrawn in a future release.
12947
12948 * data/glr.c (b4_location_type): Remove.
12949 (YYSTYPE): Renamed from yystype.
12950 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
12951 (struct YYLTYPE): Renamed from struct yyltype.
12952 (YYLTYPE): Renamed from yyltype.
12953 (yyltype, yystype): New (and obsolescent) macros,
12954 for backward compatibility.
12955 * data/yacc.c: Likewise.
12956
12957 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
12958 does not specify a union tag. This is for compatibility with
12959 Solaris 9 yacc.
12960
12961 * src/parse-gram.y (add_param): 2nd arg is now char * not char
12962 const *, since it is now modified by stripping surrounding { }.
12963 (current_braced_code): Remove.
12964 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
12965 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
12966 trailing " {...}". Now of type <chars>.
12967 (grammar_declaration): Adjust to bundled tokens.
12968 (code_content): Remove; stripping is now done by add_param.
12969 (print_token_value): Print contents of bundled tokens.
12970 (token_name): New function.
12971
12972 * src/reader.h (braced_code, current_braced_code): Remove.
12973 (token_name): New decl.
12974
12975 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
12976 token_type, not braced_code code_kind. All uses changed.
12977 (SC_PRE_CODE): New state, for scanning after a keyword that
12978 has (or usually has) an immediately-following braced code.
12979 (token_type): New local var, to keep track of which token type
12980 to return when scanning braced code.
12981 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
12982 <INITIAL>"%parse-param", <INITIAL>"%printer",
12983 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
12984 instead of returning a token type immediately.
12985 (<INITIAL>"{"): Set token type.
12986 (<SC_BRACED_CODE>"}"): Use it.
12987 (handle_action_dollar, handle_action_at): Now returns bool
12988 indicating success. Fail if ! current_rule; this prevents a core dump.
12989 (handle_symbol_code_dollar, handle_symbol_code_at):
12990 Remove; merge body into caller.
12991 (handle_dollar, handle_at): Complain in invalid contexts.
12992
12993 * NEWS, doc/bison.texinfo: Document the above.
12994 * NEWS: Fix years and program names in copyright notice.
12995
12996 2002-12-17 Paul Eggert <eggert@twinsun.com>
12997
12998 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
12999 Reporting, Table of Symbols): Omit mentions of %lex-param and
13000 %parse-param from the documentation for now.
13001
13002 2002-12-15 Paul Eggert <eggert@twinsun.com>
13003
13004 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
13005 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
13006 lookahead symbol, and which sets yychar in parser actions) and it
13007 disagreed with the Bison documentation. Bug
13008 reported by Andrew Walrond.
13009
13010 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
13011 as the caller now does that.
13012 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
13013 (YYEMPTY): Parenthesize right hand side, since others use it.
13014 (yyparse): Don't assume that our generated code is the only code
13015 that sets yychar.
13016
13017 2002-12-13 Paul Eggert <eggert@twinsun.com>
13018
13019 Version 1.75d.
13020
13021 POSIX requires a "yacc" command.
13022 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
13023 (MOSTLYCLEANFILES): Add yacc.
13024 (yacc): New rule.
13025 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
13026 as an alias for bison y.
13027
13028 * po/LINGUAS: Add da.
13029
13030 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
13031 problem with latest <getopt.h>.
13032 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
13033
13034 * doc/fdl.texi: Upgrade to 1.2.
13035 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
13036 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
13037 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
13038 gnulib.
13039 * config/install-sh: Sync with autotools.
13040
13041 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
13042 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
13043 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
13044 locations are requested.
13045 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
13046 locations are requested.
13047
13048 2002-12-12 Paul Eggert <eggert@twinsun.com>
13049
13050 Remove unportable casts and storage allocation tricks.
13051 While we're at it, remove almost all casts, since they
13052 usually aren't needed and are a sign of trouble.
13053
13054 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
13055
13056 * src/derives.c (derives_compute): Do not subtract NTOKENS from
13057 the pointer DSET returned by malloc; this isn't portable.
13058 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
13059 Similarly for DERIVES.
13060 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
13061 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
13062 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
13063
13064 * src/derives.c (derives_compute): Do not bother invoking
13065 int_of_rule_number, since rule numbers are integers.
13066
13067 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
13068 rather than XMALLOC (char, N).
13069
13070 * src/files.c (filename_split): Rewrite to avoid cast.
13071
13072 * src/gram.h (symbol_number_as_item_number,
13073 item_number_as_symbol_number, rule_number_as_item_number,
13074 item_number_as_rule_number):
13075 Now inline functions rather than macros, to avoid casts.
13076 * src/state.h (state_number_as_int): Likewise.
13077 * src/tables.c (state_number_to_vector_number,
13078 symbol_number_to_vector_number): Likewise.
13079
13080 * src/gram.h (int_of_rule_number): Remove; no longer used.
13081
13082 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
13083 since the resulting storage is always stored into.
13084
13085 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
13086 where it's needed.
13087
13088 * src/muscle_tab.c (muscle_m4_output):
13089 Now inline. Return bool, not int.
13090 * src/state.c (state_compare): Likewise.
13091 * src/symtab.c (symbol_check_defined,
13092 symbol_check_alias_consistency, symbol_pack, symbol_translation,
13093 hash_compare_symbol, hash_symbol):
13094 Likewise.
13095 * src/uniqstr.c (uniqstr_print): Likewise.
13096 * src/muscle_tab.c (muscle_m4_output_processor):
13097 New function, to avoid casts.
13098 * src/state.c (state_comparator, stage_hasher): Likewise.
13099 * src/symtab.c (symbol_check_defined_processor,
13100 symbol_check_alias_consistency_processor, symbol_pack_processor,
13101 symbol_translation_processor, hash_symbol_comparator,
13102 hash_symbol_hasher): Likewise.
13103 * src/uniqstr.c (uniqstr_print_processor): Likewise.
13104 * src/muscle_tab.c (muscles_m4_output):
13105 Use new functions instead of casting old functions unportably.
13106 * src/state.c (state_hash_new): Likewise.
13107 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
13108 symbols_token_translations_init):
13109 Likewise.
13110 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
13111
13112 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
13113 var instead of casting to long, to avoid casts.
13114 (prepare_states): Use MALLOC rather than alloca, so that we don't
13115 have to worry about alloca.
13116 * src/state.c (state_hash_lookup): Likewise.
13117
13118 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
13119 local var instead of casting to unsigned char, to avoid casts.
13120
13121 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
13122 STATE_ALLOC): Remove.
13123 (transitions_new, errs_new, reductions_new, state_new): Use malloc
13124 rather than calloc, and use offsetof to avoid allocating slightly
13125 too much storage.
13126 (state_new): Initialize all members.
13127
13128 * src/state.c (state_hash): Use unsigned accumulator, not signed.
13129
13130 * src/symtab.c (symbol_free): Remove; unused.
13131 (symbol_get): Remove cast in lhs of assignment.
13132 (symbols_do): Now static. Accept generic arguments, not
13133 hashing-related ones.
13134
13135 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
13136 (symbol_processor): Remove.
13137 (symbols_do): Remove decl; now static.
13138
13139 * src/system.h (alloca): Remove; decl no longer needed.
13140 (<stddef.h>): Include, for offsetof.
13141 (<inttypes.>, <stdint.h>): Include if available.
13142 (uintptr_t): New type, if system lacks it.
13143 (CALLOC, MALLOC, REALLOC): New macros.
13144 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
13145 new macros.
13146
13147 * src/tables.c (table_size): Now int, to pacify GCC.
13148 (table_grow, table_ninf_remap): Use signed table size.
13149 (save_row): Don't bother initializing locals when not needed.
13150 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
13151 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
13152
13153 * src/vcg.h: Correct misspellings.
13154
13155 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
13156
13157
13158 * src/getargs.c (getargs): Don't assume EOF == -1.
13159
13160 2002-12-09 Paul Eggert <eggert@twinsun.com>
13161
13162 Change identifier spellings to avoid collisions with names
13163 that are reserved by POSIX.
13164
13165 Don't use names ending in _t, since POSIX reserves them.
13166 For consistency, remove _e and _s endings -- they're weren't
13167 needed to remove ambiguity. All uses changed.
13168 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
13169 turn was just renamed from struniq_t.
13170 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
13171 which in turn was just renamed from struniq_processor_t.
13172 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
13173 in turn was renamed from hash_compare_struniq_t.
13174 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
13175 (state_list): Renamed from state_list_t.
13176 * src/assoc.h (assoc): Renamed from assoc_t.
13177 * src/conflicts.c (enum conflict_resolution): Renamed from
13178 enum conflict_resolution_e.
13179 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
13180 (rule_list): Renamed from rule_list_t.
13181 * src/getargs.h (enum trace): Renamed from enum trace_e.
13182 (enum report): Renamed from enum report_e.
13183 * src/gram.h (item_number): Renamed from item_number_t.
13184 (rule_number): Renamed from rule_number_t.
13185 (struct rule_s): Remove the "rule_s" part; not used.
13186 (rule): Renamed from rule_t.
13187 (rule_filter): Renamed from rule_filter_t.
13188 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
13189 (goto_list): Renamed from goto_list_t.
13190 * src/lalr.h (goto_number): Renamed from goto_number_t.
13191 * src/location.h (location): Renamed from location_t.
13192 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
13193 and moved here from:
13194 * src/muscle_tab.h (muscle_entry_t): here.
13195 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
13196 (rule_list): Renamed from rule_list_t.
13197 * src/print_graph.c (static_graph): Renamed from graph.
13198 * src/reader.h (braced_code): Renamed from braced_code_t.
13199 Remove brace_code_e tag.
13200 * src/relation.h (relation_node): Renamed from relation_node_t.
13201 (relation_nodes): Renamed from relation_nodes_t.
13202 (relation): Renamed from relation_t.
13203 * src/state.h (state_number): Renamed from state_number_t.
13204 (struct state): Renamed from struct state_s.
13205 (state): Renamed from state_t.
13206 (transitions): Renamed from transitions_t. Unused (and
13207 misspelled) transtion_s tag removed.
13208 (errs): Renamed from errs_t. Unused errs_s tag removed.
13209 (reductions): Renamed from reductions_t. Unused tag
13210 reductions_s removed.
13211 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
13212 (struct symbol_list): Renamed from struct symbol_list_s.
13213 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
13214 (struct symbol): Renamed from struct symbol_s.
13215 (symbol): Renamed from symbol_t.
13216 * src/tables.c (vector_number): Renamed from vector_number_t.
13217 (action_number): Renamed from action_t.
13218 * src/tables.h (base_number): Renamed from base_t.
13219 * src/vcg.h (enum color): Renamed from enum color_e.
13220 (enum textmode): Renamed from enum textmode_e.
13221 (enum shape): Renamed from enum shape_e.
13222 (struct colorentry): Renamed from struct colorentry_s.
13223 (struct classname): Renamed from struct classname_s.
13224 (struct infoname): Renamed from struct infoname_s.
13225 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
13226 (enum decision): Renamed from enum decision_e.
13227 (enum orientation): Renamed from enum orientation_e.
13228 (enum alignment): Renamed from enum alignment_e.
13229 (enum arrow_mode): Renamed from enum arrow_mode_e.
13230 (enum crossing_type): Renamed from enum crossing_type_e.
13231 (enum view): Renamed from enum view_e.
13232 (struct node): Renamed from struct node_s.
13233 (node): Renamed from node_t.
13234 (enum linestyle): Renamed from enum linestyle_e.
13235 (enum arrowstyle): Renamed from enum arrowstyle_e.
13236 (struct edge): Renamed from struct edge.
13237 (edge): Renamed from edge_t.
13238 (struct graph): Renamed from struct graph_s.
13239 (graph): Renamed from graph_t.
13240 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
13241 Rename value_t -> value.
13242 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
13243 value_t_as_yystype -> value_as_yystype.
13244
13245 Don't include <errno.h> in the mainstream code, since it
13246 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
13247 * lib/get-errno.c, lib/get-errno.h: New files.
13248 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
13249 get-errno.c.
13250 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
13251 * src/output.c (output_skeleton): Likewise.
13252 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
13253 instead of errno.
13254 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
13255 Likewise.
13256 (handle_action_dollar, handle_action_at): Likewise.
13257 * src/system.h: Do not include <errno.h>.
13258 (TAB_EXT): Renamed from EXT_TAB.
13259 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
13260
13261 Avoid str[a-z]*, since <string.h> reserves that name space.
13262 Change all instances of "struniq" in names to "uniqstr", and
13263 likewise for "STRUNIQ" and "UNIQSTR".
13264 * src/uniqstr.c: Renamed from src/struniq.c.
13265 * src/uniqstr.h: Renamed from src/struniq.h.
13266 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
13267 * src/files.c (strsuffix): Remove; unused.
13268 (concat2): Renamed from stringappend. Now static.
13269 * src/files.h (strsuffix, stringappend): Remove; unused.
13270 * src/parse-gram.y (<chars>): Renamed from <string>.
13271 (<uniqstr>): Renamed from <struniq>.
13272 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
13273 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
13274 (struct graph_s.expand): Renamed from struct graph_s.stretch.
13275 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
13276 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
13277 (N_EXPAND): Renamed from N_STRETCH.
13278
13279 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
13280 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
13281 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
13282 Remove; unused.
13283 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
13284 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
13285 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
13286 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
13287 (BASE_MAXIMUM): Renamed from BASE_MAX.
13288 (BASE_MINIMUM): Renamed from BASE_MIN.
13289 (ACTION_MAX): Remove; unused.
13290 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
13291 Unnecessary casts removed from above defines.
13292
13293
13294 Fix misspelling in names.
13295 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
13296 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
13297 G_NODE_ALIGNEMENT.
13298
13299
13300 * lib/timevar.c (timevar_report): Renamed from time_report,
13301 for consistency with other names.
13302 * lib/timevar.h (timevar_report): New decl.
13303 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
13304
13305
13306 Sort include-file uses.
13307
13308 Reorder all include files under src to be in the order "system.h".
13309 then the ../lib include files in angle brackets (alphabetized),
13310 then the . include files in double-quotes (alphabetized). Fix
13311 dependency breakages encountered in this process, as follows:
13312 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
13313 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
13314 * src/state.h: Include "symtab.h".
13315
13316 2002-12-08 Paul Eggert <eggert@twinsun.com>
13317
13318 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
13319 since this causes problems when __file__ contains character
13320 sequences like "@" that are treated specially by src/scan-skel.l.
13321 Instead, just use the file's basename. This fixes the bug
13322 reported by Martin Mokrejs in
13323 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
13324
13325 2002-12-06 Paul Eggert <eggert@twinsun.com>
13326
13327 Add support for rules that do not have trailing semicolons, as
13328 POSIX requires. Improve the quality of locations in Bison
13329 diagnostics.
13330
13331 * src/location.c: Include <quotearg.h>.
13332 (empty_location): Now const.
13333 (location_print): New function. Follow the recommendation of the
13334 GNU Coding Standards for locations that span file boundaries.
13335 * src/location.h: Do not include <quotearg.h>; no longer needed.
13336 (boundary): New type.
13337 (location_t): Use it. This allows locations to span file boundaries.
13338 All member uses changed: file -> start.file or end.file (as needed),
13339 first_line -> start.line, first_column -> start.column,
13340 last_line -> end.line, last_column -> end.column.
13341 (equal_boundaries): New function.
13342 (LOCATION_RESET, LOCATION_STEP): Remove.
13343 (LOCATION_PRINT): Remove. All callers changed to use location_print.
13344 (empty_location): Now const.
13345 (location_print): New decl.
13346 * src/parse-gram.y (lloc_default): New function, which handles
13347 empty locations more accurately.
13348 (YYLLOC_DEFAULT): Use it.
13349 (%token COLON): Remove.
13350 (%token ID_COLON): New token.
13351 (rules): Use it.
13352 (declarations, rules): Remove trailing semicolon.
13353 (declaration, rules_or_grammar_declaration):
13354 Allow empty (";") declaration.
13355 (symbol_def): Remove empty actions; no longer needed.
13356 (rules_or_grammar_declaration): Remove trailing semicolon.
13357 (semi_colon.opt): Remove.
13358 * src/reader.h: Include location.h.
13359 (scanner_cursor): New decl.
13360 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
13361 rolling our own.
13362 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
13363 of *loc.
13364 (STEP): Remove. No longer needed, now that adjust_location does
13365 the work. All uses removed.
13366 (scanner_cursor): New var.
13367 (adjust_location): Renamed from extend_location. It now sets
13368 *loc and adjusts the scanner cursor. All uses changed.
13369 Don't bother testing for CR.
13370 (handle_syncline): Remove location arg; now updates scanner cursor.
13371 All callers changed.
13372 (unexpected_end_of_file): Now accepts start boundary of token or
13373 comment, not location. All callers changed. Update scanner cursor,
13374 not the location.
13375 (SC_AFTER_IDENTIFIER): New state.
13376 (context_state): Renamed from c_context. All uses changed.
13377 (id_loc, code_start, token_start): New local vars.
13378 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
13379 processing of Yacc white space and equivalents here.
13380 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
13381 instead of returning ID immediately, since we need to search for
13382 a subsequent colon.
13383 (<INITIAL>"'", "\""): Save token_start.
13384 (<INITIAL>"%{", "{", "%%"): Save code_start.
13385 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
13386 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
13387 BEGIN context_state at end, not INITIAL.
13388 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
13389 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
13390 Return correct token start.
13391 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
13392 the start of a character, string or multiline comment is found.
13393 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
13394 Reduction): Adjust reported locations to match the more-precise
13395 results now expected.
13396 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
13397 * tests/reduce.at (Useless Rules, Reduced Automaton,
13398 Underivable Rules): Likewise.
13399 * tests/regression.at (Invalid inputs): No longer `expecting ";"
13400 or "|"' now that so many other tokens are allowed by the new grammar.
13401
13402 * src/complain.h (current_file): Remove duplicate decl;
13403 current_file is now owned by files.h.
13404 * src/complain.c, src/scan-gram.l: Include files.h.
13405
13406 2002-12-06 Paul Eggert <eggert@twinsun.com>
13407
13408 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
13409 promotes to int; it might be unsigned int.
13410 * data/yacc.c (yy_reduce_print): Likewise.
13411
13412 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
13413 be #defined in the prologue, not in the Bison declarations.
13414 This fixes Debian Bug 102878, reported by Shaul Karl.
13415
13416 2002-12-02 Paul Eggert <eggert@twinsun.com>
13417
13418 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
13419 * lib/strtoul.c: New file, from gnulib.
13420 This fixes a porting bug reported by Peter Klein in
13421 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
13422
13423 2002-11-30 Paul Eggert <eggert@twinsun.com>
13424
13425 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
13426 and put only a forward declaration in the prologue. This is for
13427 consistency with the other scanner helper functions.
13428
13429 Type clashes now generate warnings, not errors, since it
13430 appears that POSIX may allow some grammars with type clashes.
13431 * src/reader.c (grammar_current_rule_check): Warn about
13432 type clashes instead of complaining.
13433 * tests/input.at (Type Clashes): Expect warnings, not complaints.
13434
13435 Add Yacc library, since POSIX requires it.
13436 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
13437 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
13438 * lib/main.c, lib/yyerror.c: New files.
13439
13440 gram_error can be static; it need not be extern.
13441 * src/reader.h (gram_error): Remove decl.
13442 * src/parse-gram.y (gram_error): Now static. Add static decl.
13443 (print_token_value): Omit parameter names from forward decl,
13444 for consistency.
13445
13446 2002-11-29 Paul Eggert <eggert@twinsun.com>
13447
13448 * doc/bison.texinfo: Emphasize that yylex and yyerror must
13449 be declared before being used. E.g., one should typically
13450 declare them in the prologue. Use GNU coding style in examples.
13451 Put "const" consistently after the type it modifies. Mention
13452 that C99 supports "inline". Mention that yyerror traditionally
13453 returns "int".
13454
13455 %parse-param and %lex-param now take just one argument, the
13456 declaration; the argument name is deduced from the declaration.
13457
13458 * doc/bison.texinfo (Parser Function, Pure Calling, Error
13459 Reporting, Table of Symbols): Document this.
13460 * src/parse-gram.y (add_param): New function.
13461 (COMMA): Remove.
13462 (declaration): Implement new rule for %parse-param and %lex-param.
13463 * src/scan-gram.l: "," now elicits a warning, rather than being
13464 a token; this is more compatible with byacc.
13465 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
13466
13467 2002-11-27 Paul Eggert <eggert@twinsun.com>
13468
13469 Rename identifiers to avoid real and potential collisions.
13470
13471 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
13472 to avoid collision with lex macro described by Bruce Lilly in
13473 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
13474 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
13475 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
13476 * src/parse-gram.y (print_token_value): Renamed from yyprint.
13477 All uses changed.
13478 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
13479 The name "yycontrol" violates the name space rules, and this stuff
13480 wasn't being used anyway.
13481 (input): Remove action; this stuff wasn't being used.
13482 (gram_error): Rename local variable yylloc -> loc.
13483 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
13484 (YY_DECL): Don't use "yy" at start of local variables.
13485 All uses changed, e.g., yylloc -> loc.
13486 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
13487 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
13488 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
13489 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
13490
13491 * src/parse-gram.y (gram_error): loc is now const *.
13492 * src/reader.h (gram_error): Likewise.
13493
13494 2002-11-24 Paul Eggert <eggert@twinsun.com>
13495
13496 Version 1.75c.
13497
13498 * tests/actions.at (Actions after errors): Use an output format
13499 more similar to that of the Printers and Destructors test.
13500 Test the position of the ';' token too.
13501 (Printers and Destructors): Likewise.
13502 (Printers and Destructors: %glr-parser): Remove for now, to avoid
13503 unnecessarily alarming people when the test fails.
13504
13505 * data/yacc.c (yyerrlab1): Move this label down, so that the
13506 parser does not discard the lookahead token if the user code
13507 invokes YYERROR. This change is required for POSIX conformance.
13508
13509 * lib/error.c: Sync with gnulib.
13510
13511 2002-11-22 Paul Eggert <eggert@twinsun.com>
13512
13513 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
13514 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
13515 * lib/xmalloc.c: Likewise.
13516
13517 2002-11-20 Paul Eggert <eggert@twinsun.com>
13518
13519 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
13520
13521 2002-11-20 Paul Eggert <eggert@twinsun.com>
13522
13523 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
13524 should use `if (! x) abort ();' rather than `assert (x);', and
13525 anyway it's one less thing to worry about configuring.
13526
13527 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
13528 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
13529 and replace all instances of assert with abort.
13530 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
13531 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
13532
13533 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
13534 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
13535 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
13536 hash_find_entry, hash_rehash, hash_insert): Likewise.
13537 * src/conflicts.c (resolve_sr_conflict): Likewise.
13538 * src/lalr.c (set_goto_map, map_goto): Likewise.
13539 * src/nullable.c (nullable_compute): Likewise.
13540 * src/output.c (prepare_rules, token_definitions_output): Likewise.
13541 * src/reader.c (packgram, reader): Likewise.
13542 * src/state.c (state_new, state_free, state_transitions_set,
13543 state_reduction_find): Likewise.
13544 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
13545 symbol_pack): Likewise.
13546 * src/tables.c (conflict_row, pack_vector): Likewise.
13547 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
13548 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
13549 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
13550 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
13551
13552 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
13553 (ARGMATCH_CONSTRAINT): New macro.
13554 (ARGMATCH_ASSERT): Use it.
13555
13556 * src/system.h (verify): New macro.
13557 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
13558 rather than assert.
13559 * src/tables.c (tables_generate): Likewise.
13560
13561 * src/struniq.c (struniq_assert): Now returns void, and aborts
13562 if the assertion is false.
13563 (struniq_assert_p): Remove.
13564 * src/struniq.h: Likewise.
13565
13566 2002-11-18 Paul Eggert <eggert@twinsun.com>
13567
13568 * data/glr.c (yygetLRActions): Replace `yyindex' with
13569 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
13570 This fixes the regression with Sun ONE Studio 7 cc that I reported in
13571 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
13572
13573 2002-11-18 Akim Demaille <akim@epita.fr>
13574
13575 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
13576 space.
13577 From Tim Van Holder.
13578
13579 2002-11-17 Paul Eggert <eggert@twinsun.com>
13580
13581 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
13582 to "SyntaxError" for consistency with my 2002-11-15 change.
13583
13584 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
13585 not define to {}, since this breaks the common use of `YYDPRINTF
13586 ((...));' if a single statement is desired (e.g. before `else').
13587 Work around GCC warnings by surrounding corresponding calls with
13588 {} if needed.
13589 (yyhasResolvedValue): Remove unused function.
13590 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
13591 loop body.
13592 (yyreportSyntaxError): Renamed from yyreportParseError.
13593 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
13594 All uses changed.
13595 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
13596 extern when possible. Remove unused initializations.
13597
13598 2002-11-16 Akim Demaille <akim@epita.fr>
13599
13600 Augment the similarity between GLR and LALR traces.
13601
13602 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
13603 (YY_REDUCE_PRINT): New.
13604 (yyparse): Use them.
13605 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
13606 YYDPRINT here.
13607 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
13608 state reached after the reduction/recovery, since...
13609 (yyparse, yyprocessOneStack): Report the state we are entering in.
13610
13611 2002-11-16 Akim Demaille <akim@epita.fr>
13612
13613 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
13614 Add support for --trace=skeleton.
13615 * src/scan-skel.l: %option debug.
13616 Scan strings of non-@ or \n instead of character by character.
13617 (scan_skel): Handle trace_skeleton.
13618 (QPUTS): New.
13619 (@output_parser_name@, @output_header_name@): ``Restore'' their
13620 support (used to be M4 macros).
13621 * data/yacc.c: Quote larger chunks, a la glr.c.
13622 * data/lalr1.cc: Likewise.
13623 The header guards are no longer available, so use some other
13624 string than `YYLSP_NEEDED'.
13625
13626 2002-11-16 Akim Demaille <akim@epita.fr>
13627
13628 Make the ``Printers and Destructors'' test more verbose, taking
13629 `yacc.c''s behavior as (possibly wrong) reference.
13630
13631 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
13632 instead of fprint on stdout.
13633 Set and report the last_line of the symbols.
13634 Consistently display values and locations.
13635
13636 2002-11-16 Paul Eggert <eggert@twinsun.com>
13637
13638 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
13639
13640 2002-11-15 Paul Eggert <eggert@twinsun.com>
13641
13642 * tests/actions.at (Actions after errors): New test case.
13643
13644 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
13645 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
13646 tests/action.at, tests/calc.at, tests/conflicts.at,
13647 tests/cxx-type.at, tests/regression.at:
13648 "parse error" -> "syntax error" for POSIX compatibility.
13649 "parsing stack overflow..." -> "parser stack overflow" so
13650 that code matches Bison documentation.
13651
13652 2002-11-15 Akim Demaille <akim@epita.fr>
13653
13654 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
13655 take two BRACED_CODE, not two string_content.
13656 Free the scanner's obstack when we are done.
13657 (code_content): New.
13658 * tests/calc.at: Adjust.
13659 * doc/bison.texinfo: Adjust.
13660 Also, make sure to include the `,' for these declarations.
13661
13662 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
13663
13664 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
13665 definition; avoids potential autoreconf problems.
13666
13667 2002-11-15 Akim Demaille <akim@epita.fr>
13668
13669 Always check the value returned by yyparse.
13670
13671 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
13672 returned by yyparse.
13673 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
13674 Adjust calls.
13675 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
13676 returned by yyparse.
13677
13678 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13679
13680 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
13681 on input.at test.
13682
13683 2002-11-14 Paul Eggert <eggert@twinsun.com>
13684
13685 * src/output.c (output_skeleton): Call xfopen instead of
13686 duplicating xfopen's body.
13687
13688 Fix bugs reported by Nelson H. F. Beebe in
13689 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
13690
13691 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
13692 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
13693 Group compiler. Instead, use "$CC -E bar.c". Include the .h
13694 file twice in the grammar, as an extra check.
13695
13696 * tests/input.at (Torturing the Scanner): Surround the
13697 backslash-newline tests with "#if 0", to make it less likely that
13698 we'll run into compiler bugs. Bring back solitary \ inside
13699 comment, but add a closing comment to work around HP C bug. Don't
13700 test backslash-newline in C character constant.
13701
13702 2002-11-14 Akim Demaille <akim@epita.fr>
13703
13704 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
13705 status of the compiler.
13706 Calling `exit 1' is no longer needed.
13707 Reported by Nelson H. F. Beebe.
13708
13709 2002-11-14 Akim Demaille <akim@epita.fr>
13710
13711 * tests/atlocal.in (CPPFLAGS): We have config.h.
13712 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
13713 New.
13714 * tests/actions.at, tests/calc.at, tests/conflicts.at,
13715 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
13716 * tests/regression.at, tests/torture.at: Use them for all the
13717 grammars that are to be compiled.
13718 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
13719 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
13720 * doc/bison.texinfo (GLR Parsers): Document `inline'.
13721
13722 2002-11-14 Akim Demaille <akim@epita.fr>
13723
13724 * doc/bison.texinfo: Various formatting changes (alignments in
13725 samples, additional @group/@end group, GCS in samples.
13726 Use @deffn instead of simple @table to define the directives,
13727 macros, variables etc.
13728
13729 2002-11-13 Paul Eggert <eggert@twinsun.com>
13730
13731 Fix some bugs reported by Albert Chin-A-Young in
13732 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
13733
13734 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
13735 -o c"; the HP C compiler chatters during compilation.
13736 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
13737 * tests/headers.at (export YYLTYPE): Likewise.
13738
13739 * tests/input.at (Torturing the Scanner): Remove lines containing
13740 solitary backslashes, as they tickle a bug in the HP C compiler.
13741
13742 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
13743 comments, since they're not portable. Use GNU coding style.
13744
13745 2002-11-13 Akim Demaille <akim@epita.fr>
13746
13747 * data/yacc.c: Leave bigger chunks of quoted text.
13748 (YYDSYMPRINTF): New.
13749 Use it to report symbol activities.
13750 * data/glr.c (YYDSYMPRINTF): New.
13751 Use it.
13752
13753 2002-11-12 Paul Eggert <eggert@twinsun.com>
13754
13755 Version 1.75b.
13756
13757 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
13758 (yyglrReduce): Return yyok, not 0.
13759 This should avoid the enumerated-type warnings reported
13760 by Nelson H. F. Beebe in
13761 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
13762
13763 * lib/bbitset.h (BITSET_INLINE): Remove.
13764 * lib/bitset.h [! BITSET_INLINE]: Remove.
13765 (bitset_set, bitset_reset, bitset_test): Rename local vars
13766 to avoid shadowing warnings by GCC.
13767
13768 * data/glr.c (inline): Remove #define. It's the user's
13769 responsibility to #define it away, just like 'const'.
13770 This fixes one of the bugs reported by Nelson H. F. Beebe in
13771 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
13772
13773 * Makefile.maint (po-check): Scan .l and .y files instead of the
13774 .c and the .h files that they generate. This fixes the bug
13775 reported by Tim Van Holder in:
13776 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
13777 Look for N_ as well as for _. Try to avoid matching #define for
13778 N_ and _.
13779 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
13780 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
13781 * src/scan-gram.l: Revamp regular expressions so that " and '
13782 do not confuse xgettext.
13783
13784 * src/struniq.h (struniq_new): Do not declare the return type
13785 to be 'const'; this violates the C standard.
13786 * src/struniq.c (struniq_new): Likewise.
13787
13788 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
13789
13790 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
13791 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
13792 linker.
13793
13794 2002-11-12 Akim Demaille <akim@epita.fr>
13795
13796 * Makefile.maint: Sync with Autoconf:
13797 (local_updates): New.
13798
13799 2002-11-12 Akim Demaille <akim@epita.fr>
13800
13801 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
13802
13803 2002-11-12 Akim Demaille <akim@epita.fr>
13804
13805 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
13806 locations.
13807
13808 2002-11-12 Akim Demaille <akim@epita.fr>
13809
13810 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
13811 not yyvalue.
13812
13813 2002-11-12 Akim Demaille <akim@epita.fr>
13814
13815 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
13816 Use it to test the GLR parser.
13817
13818 2002-11-12 Akim Demaille <akim@epita.fr>
13819
13820 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
13821 defines it.
13822 * data/glr.c (yystos): New.
13823 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
13824 (YYDSYMPRINT): New.
13825 (yyval): Don't define it, it is handled via M4.
13826 (yyrecoverParseError): Free verbosely the discarded symbols.
13827 * data/yacc.c (yysymprint): Remove, rather...
13828 (b4_yysymprint_generate): invoke.
13829 * data/c.m4 (b4_yysymprint_generate): New.
13830 Accept pointers as arguments, as opposed to the version from
13831 yacc.c.
13832 (b4_yydestruct_generate): Likewise.
13833 * tests/cations.at (Printers and Destructors): Use Bison directives
13834 instead of CPP macros.
13835 Don't rely on internal details.
13836
13837 2002-11-12 Akim Demaille <akim@epita.fr>
13838
13839 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
13840 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
13841 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
13842 it against YYEMPTY and so forth), work on yytoken (i.e., set
13843 it to YYEMPTY etc.).
13844 (yydestruct): Replace with a b4_yydestruct_generate invocation.
13845 (b4_symbol_actions): Remove.
13846 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
13847 for 0, end-of-input.
13848
13849 2002-11-12 Akim Demaille <akim@epita.fr>
13850
13851 * doc/bison.texinfo (Destructor Decl): New.
13852
13853 2002-11-12 Akim Demaille <akim@epita.fr>
13854
13855 * src/tables.c (tables_generate): Use free for pointers that
13856 cannot be NULL, not XFREE.
13857 (pack_vector): Use assert, not fatal, for bound violations.
13858 * src/state.c (state_new): Likewise.
13859 * src/reader.c (reader): Likewise.
13860 * src/lalr.c (set_goto_map): Likewise.
13861 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
13862 the file name.
13863
13864 2002-11-12 Akim Demaille <akim@epita.fr>
13865
13866 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
13867 Restore.
13868 * src/scan-gram.l (last_string): Is global to the file, not to
13869 yylex.
13870 * src/parse-gram.y (input): Don't append the epilogue here,
13871 (epilogue.opt): do it here, and free the scanner's obstack.
13872 * src/reader.c (epilogue_set): Rename as...
13873 (epilogue_augment): this.
13874 * data/c.m4 (b4_epilogue): Defaults to empty.
13875
13876 2002-11-12 Akim Demaille <akim@epita.fr>
13877
13878 * src/getargs.c (long_options): Remove duplicates.
13879 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
13880 Remove.
13881 * doc/bison.rnh: Remove.
13882 * doc/bison.texinfo (VMS Invocation): Remove.
13883
13884 2002-11-12 Akim Demaille <akim@epita.fr>
13885
13886 * src/struniq.h, src/struniq.c (struniq_t): Is const.
13887 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
13888
13889 Use struniq for symbols.
13890
13891 * src/symtab.h (symbol_t): The tag member is a struniq.
13892 (symbol_type_set): Adjust.
13893 * src/symtab.c (symbol_new): Takes a struniq.
13894 (symbol_free): Don't free the tag member.
13895 (hash_compare_symbol_t, hash_symbol_t): Rename as...
13896 (hash_compare_symbol, hash_symbol): these.
13897 Use the fact that tags as struniqs.
13898 (symbol_get): Use struniq_new.
13899 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
13900 Returns a strniq.
13901 * src/reader.h (merger_list, grammar_currentmerge_set): The name
13902 and type members are struniqs.
13903 * src/reader.c (get_merge_function)
13904 (grammar_current_rule_merge_set): Adjust.
13905 (TYPE, current_type): Are struniq.
13906
13907 Use struniq for file names.
13908
13909 * src/files.h, src/files.c (infile): Split into...
13910 (grammar_file, current_file): these.
13911 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
13912 * src/reduce.c (reduce_print): Likewise.
13913 * src/getargs.c (getargs): Likewise.
13914 * src/complain.h, src/complain.c: Likewise.
13915 * src/main.c (main): Call struniqs_new early enough to use it for
13916 file names.
13917 Don't free the input file name.
13918
13919 2002-11-12 Akim Demaille <akim@epita.fr>
13920
13921 * src/symtab.c (symbol_free): Remove dead deactivated code:
13922 type_name are properly removed.
13923 Don't use XFREE to free items that cannot be NULL.
13924 * src/struniq.h, src/struniq.c: New.
13925 * src/main.c (main): Initialize/free struniqs.
13926 * src/parse-gram.y (%union): Add astruniq member.
13927 (yyprint): Adjust.
13928 * src/scan-gram.l (<{tag}>): Return a struniq.
13929 Free the obstack bit that used to store it.
13930 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
13931
13932 2002-11-11 Paul Eggert <eggert@twinsun.com>
13933
13934 Revamp to fix many (but not all) of the C- and M4-related quoting
13935 problems. Among other things, this fixes the Bison bug reported
13936 by Jan Hubicka when processing the Bash grammar; see:
13937 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
13938
13939 Use new @ escapes consistently. Represent brackets with @{ and @}
13940 rather than @<:@ and @:>@, since this works a bit better with dumb
13941 editors like vi. Represent @ with @@, since @ is now consistently
13942 an escape. Use @oline@ and @ofile@ rather than __oline__ and
13943 __ofile__, to avoid unexpected expansions. Similarly, use @output
13944 rather than #output.
13945
13946 * data/c.m4 (b4_copyright): Omit file name from comment, since
13947 the file name could contain "*/".
13948 (b4_synclines_flag): Don't quote the 2nd argument; it should already
13949 be quoted. All uses changed.
13950
13951 * data/glr.c: Use new @ escapes consistently.
13952 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
13953 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
13954 Remove, since they couldn't handle arbitrary characters in file
13955 names.
13956 * data/lalr1.cc: Likewise.
13957 * data/yacc.c: Likewise.
13958
13959 * src/files.c (output_infix): Remove; all uses removed.
13960 * src/files.h: Likewise.
13961
13962 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
13963 mishandled funny characters in file names, and anyway it isn't
13964 needed any more.
13965 * data/yacc.c: Likewise.
13966 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
13967
13968 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
13969 * data/yacc.c: Likewise.
13970
13971 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
13972 strings now.
13973 (muscle_init): Quote filename as a C string.
13974 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
13975 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
13976 * src/output.c (escaped_file_name_output): New function.
13977 (prepare_symbols): Quote tokens for M4.
13978 (prepare): Don't insert output_infix, output_prefix,
13979 output_parser_name, output_header_name; this is now down by scan-skel.
13980 Insert skeleton as a C string.
13981
13982 * src/output.c (user_actions_output, symbol_destructors_output,
13983 symbol_printers_output): Quote filenames for C and M4.
13984 * src/reader.c (prologue_augment, epilogue_set): Likewise.
13985
13986 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
13987 escapes other than \\ and \'; this simplifies the code.
13988 (<SC_STRING>): Likewise, for \\ and \".
13989 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
13990 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
13991 Use new escapes @{ and @} for [ and ].
13992
13993 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
13994 them with auto vars.
13995 Switch to new escape scheme, where @ is the escape character uniformly.
13996 Abort if a stray escape character is found. Avoid unbounded input
13997 buffer when parsing non-escaped text.
13998
13999 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
14000 __oline__, #output, $@, and @{ do not have unintended meanings.
14001
14002 2002-11-09 Paul Eggert <eggert@twinsun.com>
14003
14004 Fix the test failure due to GCC warnings described in
14005 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
14006 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
14007 evaluate to 0 if it's impossible for NINF to be in the respective
14008 table.
14009 (yygetLRActions, yyrecoverParseError): Use them.
14010
14011 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
14012 counted in the token inserted at end of file. Now takes
14013 location_t *, not location_t, so that the location can be
14014 adjusted. All uses changed.
14015
14016 * tests/regression.at (Invalid inputs): Adjust wording in
14017 diagnostic to match the new behavior.
14018
14019 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
14020 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
14021 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
14022 abort ();'. This reduces the runtime of the "Many lookaheads"
14023 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
14024 GCC 3.2.
14025
14026 2002-11-07 Paul Eggert <eggert@twinsun.com>
14027
14028 * src/parse-gram.y (CHARACTER): Remove unused token.
14029 All uses removed.
14030
14031 * src/scan-gram.l: Remove stack option. We no longer use the
14032 stack, since the stack was never deeper than 1; instead, use the
14033 new auto var c_context to record the stacked value.
14034
14035 Remove nounput option. At an unexpected end of file, we now unput
14036 the minimal input necessary to end cleanly; this simplifies the
14037 code.
14038
14039 Avoid unbounded token sizes where this is easy.
14040
14041 (unexpected_end_of_file): New function.
14042 Use it to systematize the error message on unexpected EOF.
14043 (last-string): Now auto, not static.
14044 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
14045 (scanner_last_string_free): Remove; not used.
14046 (percent_percent_count): Move decl to just before use.
14047 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
14048 not the (never otherwised-used) CHARACTER.
14049
14050 2002-11-07 Akim Demaille <akim@epita.fr>
14051
14052 Let yyerror always receive the msg as last argument, so that
14053 yyerror can be variadic.
14054
14055 * data/yacc.c (b4_yyerror_args): New.
14056 Use it when calling yyerror.
14057 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
14058 Use it when calling yyerror.
14059 * doc/bison.texinfo (Error Reporting): Adjust.
14060 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
14061 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
14062
14063 2002-11-06 Akim Demaille <akim@epita.fr>
14064
14065 #line should have quoted strings.
14066 Ideally, this should be done by m4_quotearg.
14067
14068 * src/scan-skel.l: Include quotearg.h.
14069 Quote __ofile__.
14070 * src/output.c (symbol_printers_output)
14071 (symbol_destructors_output): Quote the file name.
14072
14073 2002-11-06 Akim Demaille <akim@epita.fr>
14074
14075 * tests/regression.at (Invalid inputs): Adjust to the recent
14076 messages.
14077
14078 2002-11-06 Akim Demaille <akim@epita.fr>
14079
14080 Restore --no-lines.
14081 Reported by Jim Kent.
14082
14083 * data/c.m4 (b4_syncline): New.
14084 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
14085 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
14086 * src/output.c (user_actions_output): Likewise.
14087 (prepare): Define 'b4_synclines_flag'.
14088 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
14089
14090 2002-11-06 Akim Demaille <akim@epita.fr>
14091
14092 * src/main.c (main): Free `infile'.
14093 * src/scan-gram.l (handle_syncline): New.
14094 Recognize `#line'.
14095 * src/output.c (user_actions_output, symbol_destructors_output)
14096 (symbol_printers_output): Use the location's file name, not
14097 infile.
14098 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14099
14100 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14101
14102 * src/tables.c (matching_state): Don't allow states to match if
14103 either has GLR conflict entries.
14104
14105 2002-11-05 Paul Eggert <eggert@twinsun.com>
14106
14107 * src/scan-gram.l: Use more accurate diagnostics, e.g.
14108 "integer out of range" rather than "invalid value".
14109 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
14110 accordingly.
14111
14112 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
14113 Also, remove one static variable in the scanner.
14114
14115 * src/scan-gram.l (braces_level): Now auto, not static.
14116 Initialize to zero if the compiler is being picky.
14117 (INITIAL): Clear braces_level instead of incrementing it.
14118 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
14119 as POSIX 1003.1-2001 requires.
14120 * src/system.h (IF_LINT): New macro, taken from coreutils.
14121 * configure.ac: Define "lint" if --enable-gcc-warnings.
14122
14123 2002-11-05 Akim Demaille <akim@epita.fr>
14124
14125 * src/scan-gram.l: When it starts with `%', complain about the
14126 whole directive, not just that `invalid character: %'.
14127
14128 2002-11-04 Akim Demaille <akim@epita.fr>
14129
14130 * Makefile.maint: Update from Autoconf.
14131 (update, cvs-update, po-update, do-po-update): New.
14132
14133 2002-11-04 Akim Demaille <akim@epita.fr>
14134
14135 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
14136 and yyerror.
14137 Have yyerror `use' its arguments.
14138 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
14139 returns true when location & yacc & pure & parse-param.
14140 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
14141
14142 2002-11-04 Akim Demaille <akim@epita.fr>
14143
14144 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
14145 clashes.
14146 * src/scan-gram.l: Use [\'] instead of ['] to pacify
14147 font-lock-mode.
14148 Use complain_at.
14149 Use quote, not quote_n since LOCATION_PRINT no longer uses the
14150 slot 0.
14151
14152 2002-11-03 Paul Eggert <eggert@twinsun.com>
14153
14154 * src/reader.c (get_merge_function, grammar_current_rule_check):
14155 Use consistent diagnostics for reporting type name clashes.
14156 Quote the types with <>, for consistency with Yacc.
14157 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
14158
14159 2002-11-03 Akim Demaille <akim@epita.fr>
14160
14161 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
14162 New.
14163 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
14164 (b4_parse_param): Remove.
14165 Use b4_identification.
14166 Propagate b4_pure_args where needed to pass them to yyerror.
14167 * data/glr.m4 (b4_parse_param): Remove.
14168 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
14169 (b4_lpure_formals): New.
14170 Use b4_identification.
14171 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
14172 b4_user_formals and b4_user_args.
14173 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
14174 (yyreportAmbiguity): When using a pure parser, also need
14175 the location, and the parse-params.
14176 Adjust callers.
14177 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
14178 When using a pure parser, also need the parse-params.
14179 Adjust callers.
14180 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
14181 (%pure-parser + %parse-param) LALR and GLR parsers.
14182 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
14183 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
14184 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
14185 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
14186 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
14187 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
14188 * doc/bison.texinfo: Untabify the whole file.
14189 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
14190 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
14191 (Error Reporting): Adjust to these new directives.
14192 Document %error-verbose, deprecate YYERROR_VERBOSE.
14193
14194 2002-11-03 Akim Demaille <akim@epita.fr>
14195
14196 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
14197 AT_CHECK_CALC_GLR invocations to use % directives, instead of
14198 command line options.
14199 * tests/cxx-type.at: Formatting changes.
14200
14201 2002-11-03 Paul Eggert <eggert@twinsun.com>
14202
14203 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
14204 to count columns correctly, and to check for invalid inputs.
14205
14206 Use mbsnwidth to count columns correctly. Account for tabs, too.
14207 Include mbswidth.h.
14208 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
14209 (extend_location): New function.
14210 (YY_LINES): Remove.
14211
14212 Handle CRLF in C code rather than in Lex code.
14213 (YY_INPUT): New macro.
14214 (no_cr_read): New function.
14215
14216 Scan UCNs, even though we don't fully handle them yet.
14217 (convert_ucn_to_byte): New function.
14218
14219 Handle backslash-newline correctly in C code.
14220 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
14221 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
14222 all uses changed.
14223 (tag, splice): New EREs. Do not allow NUL or newline in tags.
14224 Use {splice} wherever C allows backslash-newline.
14225 YY_STEP after space, newline, vertical-tab.
14226 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
14227
14228 (letter, id): Don't assume ASCII; e.g., spell out a-z.
14229
14230 ({int}, handle_action_dollar, handle_action_at): Check for integer
14231 overflow.
14232
14233 (YY_STEP): Omit trailing semicolon, so that it's more like C.
14234
14235 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
14236 as well as \000. Check for UCHAR_MAX, not 255.
14237 Allow \x with an arbitrary positive number of digits, as in C.
14238 Check for overflow here.
14239 Allow \? and UCNs, for compatibility with C.
14240
14241 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
14242 with quote slot used by complain_at.
14243
14244 * tests/input.at: Add tests for backslash-newline, m4 quotes
14245 in symbols, long literals, and funny escapes in strings.
14246
14247 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
14248 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
14249 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
14250 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
14251 * m4/mbswidth.m4: New file, from GNU coreutils.
14252
14253 * doc/bison.texinfo (Grammar Outline): Document // comments.
14254 (Symbols): Document that trigraphs have no special meaning in Bison,
14255 nor is backslash-newline allowed.
14256 (Actions): Document that trigraphs have no special meaning.
14257
14258 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
14259 no longer used.
14260
14261 2002-11-02 Paul Eggert <eggert@twinsun.com>
14262
14263 * src/reader.c: Don't include quote.h; not needed.
14264 (get_merge_function): Reword warning to be consistent with
14265 type clash diagnostic in grammar_current_rule_check.
14266
14267 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
14268 bug in trigraph handling.
14269
14270 * src/output.c (prepare_symbols): When printing token names,
14271 escape "[" as "@<:@" and likewise for "]".
14272
14273 * src/system.h (errno): Remove declaration, as we are now
14274 assuming C89 or better, and C89 guarantees errno.
14275
14276 2002-10-30 Paul Eggert <eggert@twinsun.com>
14277
14278 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
14279 Check for close failures.
14280 * src/files.h (xfclose): Return void, not int, since it always
14281 returned zero.
14282 * src/files.c (xfclose): Likewise. Report I/O error if ferror
14283 indicates one.
14284 * src/output.c (output_skeleton): Use xfclose rather than fclose
14285 and ferror. xfclose now checks ferror.
14286
14287 * data/glr.c (YYLEFTMOST_STATE): Remove.
14288 (yyreportTree): Use a stack-based leftmost state. This avoids
14289 our continuing battles with bogus warnings about initializers.
14290
14291 2002-10-30 Akim Demaille <akim@epita.fr>
14292
14293 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
14294 #if.
14295
14296 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14297
14298 * tests/glr-regr1.at: New test for reported regressions.
14299 * tests/testsuite.at: Add glr-regr1.at test.
14300 * tests/Makefile.am: Add glr-regr1.at test.
14301
14302 2002-10-24 Paul Eggert <eggert@twinsun.com>
14303
14304 Version 1.75a.
14305
14306 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
14307 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
14308 we use malloc. Don't assume 'A' through 'Z' are contiguous.
14309 Don't assume strdup exists; POSIX says its an XSI extension.
14310 Check for buffer overflow on input.
14311
14312 2002-10-24 Akim Demaille <akim@epita.fr>
14313
14314 * src/output.c (output_skeleton): Don't disable M4sugar comments
14315 too soon: it results in comments being expanded.
14316 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
14317 first output.
14318
14319 2002-10-24 Akim Demaille <akim@epita.fr>
14320
14321 * data/yacc.c (m4_int_type): New.
14322 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
14323 char' as only yacc.c wants K&R portability.
14324 * data/glr.c (yysigned_char): Remove.
14325 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
14326 Reported by Quoc Peyrot.
14327
14328 2002-10-23 Paul Eggert <eggert@twinsun.com>
14329
14330 * src/main.c (main): With --trace=time, report times even if a
14331 non-fatal error occurs. Formerly, the times were reported in some
14332 such cases but not in others.
14333 * src/reader.c (reader): Just return if a complaint has been issued,
14334 instead of exiting, so that 'main' can report times.
14335
14336 2002-10-22 Akim Demaille <akim@epita.fr>
14337
14338 * src/system.h: Include sys/types.
14339 Reported by Bert Deknuydt.
14340
14341 2002-10-23 Paul Eggert <eggert@twinsun.com>
14342
14343 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
14344 Suggested by Art Haas.
14345
14346 2002-10-22 Paul Eggert <eggert@twinsun.com>
14347
14348 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
14349 decl; not needed any more.
14350 * src/main.c (main): Use return to exit, undoing yesterday's change.
14351 The last OS that we could find where this wouldn't work is
14352 SunOS 3.5, and that's too old to worry about now.
14353
14354 * data/glr.c (struct yyltype): Define members even when not
14355 doing locations. This is more consistent with yacc.c, and it
14356 works around the following bug reports:
14357 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
14358 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
14359
14360 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
14361 @acronym consistently. Standardize on "Yacc" instead of "YACC",
14362 "Algol" instead of "ALGOL". Give a bit more history about BNF.
14363
14364 2002-10-22 Akim Demaille <akim@epita.fr>
14365
14366 * data/README: New.
14367
14368 2002-10-21 Paul Eggert <eggert@twinsun.com>
14369
14370 Be consistent about 'bool'; the old code used an enum in one
14371 module and an int in another, and this violates the C standard.
14372 * m4/stdbool.m4: New file, from coreutils 4.5.3.
14373 * configure.ac (AC_HEADER_STDBOOL): Add.
14374 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
14375 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
14376 * src/symtab.c (hash_compare_symbol_t): Likewise.
14377 * src/system.h (bool, false, true): Use a definition consistent
14378 with ../lib/hash.c. All uses changed.
14379
14380 * src/complain.c (warning_issued): Renamed from warn_message_count,
14381 so that we needn't worry about integer overflow (!).
14382 Now of type bool. All uses changed.
14383 (complaint_issued): Renamed from complain_message_count; likewise.
14384
14385 * src/main.c (main): Use exit to exit with failure.
14386
14387 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
14388 rather than 1 and 0.
14389 * src/main.c (main): Likewise.
14390 * src/getargs.c (getargs): Likewise.
14391 * src/reader.c (reader): Likewise.
14392
14393 * src/getarg.c (getargs): Remove duplicate code for
14394 "Try `bison --help'".
14395
14396 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
14397 What was that "2" for?
14398
14399 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
14400 * src/getargs.c (usage): Likewise.
14401
14402 * src/getargs.c (getargs): When there are too few operands, report
14403 the last one. When there are too many, report the first extra
14404 one. This is how diffutils does it.
14405
14406 2002-10-20 Paul Eggert <eggert@twinsun.com>
14407
14408 Remove K&R vestiges.
14409 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
14410 * src/complain.c (VA_START): Remove. Assume prototypes.
14411 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
14412 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
14413 fatal): Assume prototypes.
14414 * src/complain.h: Assume prototypes.
14415 * src/system.h (PARAMS): Remove.
14416 Include <limits.h> unconditionally, since it's guaranteeed even
14417 for a freestanding C89 compiler.
14418 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
14419 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
14420
14421 2002-10-20 Akim Demaille <akim@epita.fr>
14422
14423 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
14424 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
14425 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
14426 (yyresolveStates, yyresolveAction, yyresolveStack)
14427 (yyprocessOneStack): Use them.
14428 (yy_reduce_print): New.
14429 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
14430
14431 2002-10-20 Akim Demaille <akim@epita.fr>
14432
14433 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
14434 arguments and output `void'.
14435 (b4_c_function): Rename as...
14436 (b4_c_function_def): this.
14437 (b4_c_function_decl, b4_c_ansi_function_def)
14438 (b4_c_ansi_function_decl): New.
14439 Change the interpretation of the arguments: before `int, foo', now
14440 `int foo, foo'.
14441 * data/yacc.c (yyparse): Prototype and define thanks to these.
14442 Adjust b4_c_function_def uses.
14443 * data/glr.c (yyparse): Likewise, but ANSI only.
14444
14445 2002-10-20 Akim Demaille <akim@epita.fr>
14446
14447 * src/output.c (prepare): Move the definition of `tokens_number',
14448 `nterms_number', `undef_token_number', `user_token_number_max'
14449 to...
14450 (prepare_tokens): Here.
14451 (prepare_tokens): Rename as...
14452 (prepare_symbols): this.
14453 (prepare): Move the definition of `rules_number' to...
14454 (prepare_rules): here.
14455 (prepare): Move the definition of `last', `final_state_number',
14456 `states_number' to...
14457 (prepare_states): here.
14458 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
14459
14460 2002-10-20 Akim Demaille <akim@epita.fr>
14461
14462 * src/tables.h, src/tables.c, src/output.c: Comment changes.
14463
14464 2002-10-20 Akim Demaille <akim@epita.fr>
14465
14466 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
14467 * data/c.m4: here.
14468
14469 2002-10-20 Akim Demaille <akim@epita.fr>
14470
14471 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
14472 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
14473 `pair'.
14474 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
14475 `name' to...
14476 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
14477 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
14478 These.
14479
14480 2002-10-19 Paul Eggert <eggert@twinsun.com>
14481
14482 Do not create a temporary file, as that involves security and
14483 cleanup headaches. Instead, use a pair of pipes.
14484 Derived from a suggestion by Florian Krohm.
14485 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
14486 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
14487 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
14488 (BISON_PREREQ_SUBPIPE): Add.
14489 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
14490 Add subpipe.h, subpipe.c.
14491 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
14492 * po/POTFILES.in: Add lib/subpipe.c.
14493 * src/output.c: Include "subpipe.h".
14494 (m4_invoke): Remove decl.
14495 (scan_skel): New decl.
14496 (output_skeleton): Use pipe rather than temporary file for m4 input.
14497 Check that m4sugar.m4 is readable, to avoid deadlock.
14498 Check for pipe I/O error.
14499 * src/scan-skel.l (readpipe): Remove decl.
14500 (scan_skel): New function, to be used in place of m4_invoke.
14501 Read from stream rather than file.
14502
14503 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
14504 float, as this generates a warning on Solaris 8 + GCC 3.2 with
14505 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
14506 this generates a more-accurate value anyway.
14507
14508 * lib/timevar.c (timervar_accumulate): Rename locals to
14509 avoid confusion with similarly-named more-global.
14510 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
14511
14512 * src/output.c (prepare): Use xstrdup to convert char const *
14513 to char *, to avoid GCC warning.
14514
14515 2002-10-19 Akim Demaille <akim@epita.fr>
14516
14517 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
14518 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
14519 Use them to have `calc.y' ready for %pure-parser.
14520 * data/yacc.c (YYLEX): Pass a yylex return type to
14521 b4_c_function_call.
14522
14523 2002-10-19 Akim Demaille <akim@epita.fr>
14524
14525 Prototype support of %lex-param and %parse-param.
14526
14527 * src/parse-gram.y: Add the definition of the %lex-param and
14528 %parse-param tokens, plus their rules.
14529 Drop the `_' version of %glr-parser.
14530 Add the "," token.
14531 * src/scan-gram.l (INITIAL): Scan them.
14532 * src/muscle_tab.c: Comment changes.
14533 (muscle_insert, muscle_find): Rename `pair' as `probe'.
14534 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
14535 (muscle_entry_s): The `value' member is no longer const.
14536 Adjust all dependencies.
14537 * src/muscle_tab.c (muscle_init): Adjust: use
14538 MUSCLE_INSERT_STRING.
14539 Initialize the obstack earlier.
14540 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
14541 (muscle_pair_list_grow): New.
14542 * data/c.m4 (b4_c_function_call, b4_c_args): New.
14543 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
14544 * tests/calc.at: Use %locations, not --locations.
14545 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
14546
14547 2002-10-19 Akim Demaille <akim@epita.fr>
14548
14549 * src/getargs.c (usage): Take status as argument and exit
14550 accordingly.
14551 Report the traditional `Try ... --help' message when status != 0.
14552 (usage, version): Don't take a FILE * as arg, it is pointless.
14553 (getargs): When there is an incorrect number of arguments, make it
14554 an error, and report it GNUlically thanks to `usage ()'.
14555
14556 2002-10-18 Paul Eggert <eggert@twinsun.com>
14557
14558 * data/glr.c (yyreportParseError): Don't assume that sprintf
14559 yields the length of the printed string, as this is not true
14560 on SunOS 4.1.4. Reported by Peter Klein.
14561
14562 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
14563 * tests/conflicts.at (%nonassoc and eof): Likewise.
14564 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
14565
14566 2002-10-17 Akim Demaille <akim@epita.fr>
14567
14568 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
14569 * src/getargs.c (trace_types, trace_args): Adjust.
14570 * src/reader.c (grammar_current_rule_prec_set)
14571 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
14572 Standardize error messages.
14573 And s/@prec/%prec/!
14574 (reader): Use trace_flag to enable scanner/parser debugging,
14575 instead of an adhoc scheme.
14576 * src/scan-gram.l: Remove trailing debugging code.
14577
14578 2002-10-16 Paul Eggert <eggert@twinsun.com>
14579
14580 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
14581 MUSCLE_TAB_H.
14582
14583 * NEWS: Officially drop support for building Bison with K&R C,
14584 since it didn't work anyway and it's not worth worrying about.
14585 * Makefile.maint (wget_files): Remove ansi2knr.c.
14586 (ansi2knr.c-url_prefix): Remove.
14587 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
14588 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14589 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14590
14591 2002-10-15 Paul Eggert <eggert@twinsun.com>
14592
14593 Stop using the "enum_" trick for K&R-style function definitions;
14594 it confused me, and I was the author! Instead, assume that people
14595 who want to use K&R C compilers (when using these modules in GCC,
14596 perhaps?) will run ansi2knr.
14597
14598 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
14599 All uses of "enum_" changed to "enum ".
14600 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
14601 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
14602
14603 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
14604 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
14605 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
14606 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
14607 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
14608 abitset_not, abitset_ones, abitset_or, abitset_or_and,
14609 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
14610 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
14611 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
14612 Use function prototypes; this removes the need for declaring
14613 static functions simply to provide their prototypes.
14614 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
14615 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
14616 bitset_count_, bitset_create, bitset_dump, bitset_first,
14617 bitset_free, bitset_init, bitset_last, bitset_next,
14618 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
14619 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
14620 bitset_print, bitset_release_memory, bitset_toggle_,
14621 bitset_type_choose, bitset_type_get, bitset_type_name_get,
14622 debug_bitset): Likewise.
14623 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
14624 * lib/bitset_stats.c (bitset_log_histogram_print,
14625 bitset_percent_histogram_print, bitset_stats_and,
14626 bitset_stats_and_cmp, bitset_stats_and_or,
14627 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
14628 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
14629 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
14630 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
14631 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
14632 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
14633 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
14634 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
14635 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
14636 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
14637 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
14638 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
14639 bitset_stats_zero): Likewise.
14640 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
14641 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
14642 bitsetv_dump, debug_bitsetv): Likewise.
14643 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
14644 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
14645 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
14646 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
14647 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
14648 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
14649 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
14650 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
14651 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
14652 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
14653 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
14654 Likewise.
14655 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
14656 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
14657 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
14658 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
14659 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
14660 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
14661 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
14662 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
14663 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
14664 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
14665 lbitset_xor_cmp, lbitset_zero): Likewise.
14666
14667 2002-10-14 Akim Demaille <akim@epita.fr>
14668
14669 Version 1.75.
14670
14671 2002-10-14 Akim Demaille <akim@epita.fr>
14672
14673 * tests/Makefile.am (maintainer-check-posix): New.
14674
14675 2002-10-14 Akim Demaille <akim@epita.fr>
14676
14677 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
14678 member.
14679
14680 2002-10-14 Akim Demaille <akim@epita.fr>
14681
14682 * src/tables.c (table_ninf_remap): base -> tab.
14683 Reported by Matt Rosing.
14684
14685 2002-10-14 Paul Eggert <eggert@twinsun.com>
14686
14687 * tests/action.at, tests/calc.at, tests/conflicts.at,
14688 tests/cxx-type.at, tests/headers.at, tests/input.at,
14689 tests/regression.at, tests/synclines.at, tests/torture.at:
14690 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
14691 so that the tests still work even if POSIXLY_CORRECT is set.
14692 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
14693
14694 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
14695 for portability to K&R hosts. Fix typo: signed char is guaranteed
14696 only to 127, not to 128.
14697 * data/glr.c (yysigned_char): New type.
14698 * data/yacc.c (yysigned_char): Likewise.
14699 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
14700
14701 2002-10-13 Paul Eggert <eggert@twinsun.com>
14702
14703 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
14704 true due to limited range of data type" warning from GCC.
14705
14706 * data/c.m4 (b4_token_defines): Protect against double-inclusion
14707 by wrapping enum yytokentype's definition inside #ifndef
14708 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
14709
14710 2002-10-13 Akim Demaille <akim@epita.fr>
14711
14712 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
14713 Un yy- yyrhs to avoid the name clash with the global YYRHS.
14714
14715 2002-10-13 Akim Demaille <akim@epita.fr>
14716
14717 * Makefile.maint: Update from Autoconf 2.54.
14718 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
14719
14720 2002-10-13 Akim Demaille <akim@epita.fr>
14721
14722 * src/print.c (print_state): Separate the list of solved conflicts
14723 from the other items.
14724 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
14725
14726 2002-10-13 Akim Demaille <akim@epita.fr>
14727
14728 Let nondeterministic skeletons be usable with deterministic
14729 tables.
14730
14731 With the patch, GAWK compiled by GCC without -O2 passes its test
14732 suite using a GLR parser driven by LALR tables. It fails with -O2
14733 because `struct stat' gives two different answers on my machine:
14734 88 (definition of an auto var) and later 96 (memset on this var).
14735 Hence the stack is badly corrumpted. The headers inclusion is to
14736 blame: if I move the awk.h inclusion before GLR's system header
14737 inclusion, the two struct stat have the same size.
14738
14739 * src/tables.c (pack_table): Always create conflict_table.
14740 (token_actions): Always create conflict_list.
14741 * data/glr.c (YYFLAG): Remove, unused.
14742
14743 2002-10-13 Akim Demaille <akim@epita.fr>
14744
14745 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
14746 (O0FLAGS): New.
14747 (VALGRIND, GXX): New.
14748 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
14749 * tests/bison.in: Run $PREBISON a pre-command.
14750 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
14751 (maintainer-check-g++): New.
14752 * Makefile.am (maintainer-check): New.
14753
14754 2002-10-13 Akim Demaille <akim@epita.fr>
14755
14756 * data/glr.c: Formatting changes.
14757 Tweak some trace messages to match yacc.c's.
14758
14759 2002-10-13 Akim Demaille <akim@epita.fr>
14760
14761 GLR parsers sometimes raise parse errors instead of performing the
14762 default reduction.
14763 Reported by Charles-Henry de Boysson.
14764
14765 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
14766 check the length of the traces when %glr.
14767 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
14768 GLR's traces.
14769 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
14770 Test GLR parsers.
14771 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
14772 (yyltype): Remove the yy prefix from the member names.
14773 (yytable): Complete its comment.
14774 (yygetLRActions): Map error action number from YYTABLE from
14775 YYTABLE_NINF to 0.
14776 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
14777 (which was a bug: it should have been YYTABEL_NINF, and yet it was
14778 not satisfying as we could compare an YYACTION computed from
14779 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
14780 only value for error actions.
14781 (yyreportParseError): In verbose parse error messages, don't issue
14782 `error' in the list of expected tokens.
14783 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
14784 next action to perform to match glr.c's decoding.
14785 (yytable): Complete its comment.
14786
14787 2002-10-13 Paul Eggert <eggert@twinsun.com>
14788
14789 Fix problem reported by Henrik Grubbstroem in
14790 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
14791 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
14792 because the Bison parser reads the second action before reducing
14793 the first one.
14794 * src/scan-gram.l (rule_length): New static var.
14795 Use it to keep track of the rule length in the scanner, since
14796 we can't expect the parser to be in lock-step sync with the scanner.
14797 (handle_action_dollar, handle_action_at): Use this var.
14798 * tests/actions.at (Exotic Dollars): Test for the problem.
14799
14800 2002-10-12 Paul Eggert <eggert@twinsun.com>
14801
14802 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
14803 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
14804 Include <sys/time.h> when checking for clock_t and struct tms.
14805 Use same include order as source.
14806 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
14807 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
14808
14809 * lib/timevar.c: Update copyright date and clarify comments.
14810 (get_time) [IN_GCC]: Keep the GCC version for reference.
14811
14812 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
14813 GCC version as of today, then merge Bison's changes.
14814 Change "GCC" to "Bison" in copyright notice. timevar.def's
14815 author is Akim, so change that too.
14816
14817 * src/reader.c (grammar_current_rule_check):
14818 Don't worry about the default action if $$ is untyped.
14819 Prevents bogus warnings reported by Jim Gifford in
14820 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
14821
14822 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
14823 * data/glr.c, data/lalr1.cc, data/yacc.c:
14824 Output token definitions before the first part of user declarations.
14825 Fixes compatibility problem reported by Jim Gifford for kbd in
14826 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14827
14828 2002-10-11 Paul Eggert <eggert@twinsun.com>
14829
14830 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
14831 (yyparse): here. This undoes some of the 2002-07-25 change.
14832 Compatibility problem reported by Ralf S. Engelschall with
14833 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
14834
14835 2002-10-11 Akim Demaille <akim@epita.fr>
14836
14837 * tests/regression.at Characters Escapes): New.
14838 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
14839 characters.
14840 Reported by Jan Nieuwenhuizen.
14841
14842 2002-10-11 Akim Demaille <akim@epita.fr>
14843
14844 * po/id.po: New.
14845
14846 2002-10-10 Paul Eggert <eggert@twinsun.com>
14847
14848 Portability fixes for bitsets; this also avoids several GCC
14849 warnings.
14850
14851 * lib/abitset.c: Include <stddef.h>, for offsetof.
14852 * lib/lbitset.c: Likewise.
14853
14854 * lib/abitset.c (abitset_bytes): Return a size that is aligned
14855 properly for vectors of objects. Do not assume that adding a
14856 header size to a multiple of a word size yields a value that is
14857 properly aligned for the whole union.
14858 * lib/bitsetv.c (bitsetv_alloc): Likewise.
14859
14860 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
14861 unique names for structures.
14862 * lib/ebitset.c (ebitset_bytes): Likewise.
14863 * lib/lbitset.c (lbitset_bytes): Likewise.
14864
14865 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
14866 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
14867 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
14868 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
14869 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
14870 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
14871 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
14872 to improve the type-checking that GCC can do.
14873 * lib/bitset.c (bitset_op4_cmp): Likewise.
14874 * lib/bitset_stats.c (bitset_stats_count,
14875 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
14876 bitset_stats_copy, bitset_stats_disjoint_p,
14877 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
14878 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
14879 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
14880 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
14881 bitset_stats_and_or_cmp, bitset_stats_andn_or,
14882 bitset_stats_andn_or_cmp, bitset_stats_or_and,
14883 bitset_stats_or_and_cmp): Likewise.
14884 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
14885 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
14886 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
14887 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
14888
14889 * lib/abitset.h: Include bitset.h, not bbitset.h.
14890 * lib/ebitset.h: Likewise.
14891 * lib/lbitset.h: Likewise.
14892
14893 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
14894 All instances of parameters of type enum bitset_opts are now of
14895 type enum_bitset_opts, to conform to the C Standard, and similarly
14896 for enum_bitset_type.
14897 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
14898 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
14899
14900 Do not use "struct bitset_struct" to mean different things in
14901 different modules. Not only is this confusing, it violates
14902 the C Standard, which requires that structure types in different
14903 modules must be compatible if one is to be passed to the other.
14904 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
14905 All instances of "struct bitset_struct *" replaced with "bitset".
14906 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
14907 (union bitset_union, struct abitset_struct, struct ebitset_struct,
14908 struct lbitset_struct, struct bitset_stats_struct): New types.
14909 All uses of struct bitset_struct changed to union bitset_union,
14910 etc.
14911 * lib/abitset.c (struct abitset_struct, abitset,
14912 struct bitset_struct): Remove.
14913 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
14914 struct bitset_struct): Remove.
14915 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
14916 bitset_struct): Remove.
14917 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
14918 Likewise.
14919
14920 Do not call a function of type T using a call that assumes the
14921 function is of a different type U. Standard C requires that a
14922 function must be called with a type that is compatible with its
14923 definition.
14924 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
14925 New decls.
14926 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
14927 New functions.
14928 * lib/ebitset.c (PFV): Remove.
14929 * lib/lbitset.c (PFV): Likewise.
14930 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
14931 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
14932 decls.
14933 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
14934 (ebitset_vtable): Use them.
14935 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
14936 lbitset_xor): New functions.
14937 (lbitset_vtable): Use them.
14938
14939 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
14940 Declare.
14941
14942 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
14943 GCC warning.
14944 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
14945 Use offsetof, for simplicity.
14946
14947 2002-10-06 Paul Eggert <eggert@twinsun.com>
14948
14949 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
14950 the same width as int. This reapplies a hunk of the 2002-08-12 patch
14951 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
14952 which was inadvertently undone by the 2002-09-30 patch.
14953 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
14954 the same width as int.
14955
14956 2002-10-04 Paul Eggert <eggert@twinsun.com>
14957
14958 Version 1.50.
14959
14960 * configure.ac (AC_INIT), NEWS: Increment version number.
14961
14962 * doc/bison.texinfo: Minor spelling, grammar, and white space
14963 fixes.
14964 (Symbols): Mention that any negative value returned from yylex
14965 signifies end-of-input. Warn about negative chars. Mention
14966 the portable Standard C character set.
14967
14968 The GNU coding standard says CFLAGS and YFLAGS are reserved
14969 for the installer to set.
14970 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
14971 * src/Makefile.am (AM_CFLAGS): Likewise.
14972 (AM_YFLAGS): Renamed from YFLAGS.
14973
14974 Fix some MAX and MIN problems.
14975 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
14976 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
14977 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
14978 * src/reader.c (reader): Use it.
14979
14980 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
14981 POSIX 1003.1-2001 has removed fgrep.
14982
14983 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
14984
14985 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
14986 interpreted as signed.
14987 * lib/ebitset.c (ebitset_list): Fix bug.
14988
14989 2002-10-01 Paul Eggert <eggert@twinsun.com>
14990
14991 More fixes for 64-bit hosts and large bitsets.
14992
14993 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
14994 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
14995 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
14996 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
14997 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
14998 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
14999 bitset_count_): Likewise.
15000 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
15001 bitset_first, bitset_last): Likewise.
15002 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
15003 bitset_stats_list_reverse, bitset_stats_size,
15004 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
15005 Likewise.
15006 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15007 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
15008 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
15009 bitsetv_reflexive_transitive_closure): Likewise.
15010 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
15011 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
15012 Likewise.
15013 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
15014 Likewise.
15015
15016 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
15017 Use size_t, not unsigned int, to count bytes.
15018 * lib/abitset.h (abitset_bytes): Likewise.
15019 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
15020 Likewise.
15021 * lib/bitset.h (bitset_bytes): Likewise.
15022 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
15023 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
15024 * lib/bitsetv.c (bitsetv_alloc): Likewise.
15025 * lib/ebitset.c (ebitset_bytes): Likewise.
15026 * lib/ebitset.h (ebitset_bytes): Likewise.
15027 * lib/lbitset.c (lbitset_bytes): Likewise.
15028 * lib/lbitset.h (lbitset_bytes): Likewise.
15029
15030 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
15031 abitset_subset_p, abitset_disjoint_p, abitset_and,
15032 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
15033 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
15034 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
15035 abitset_or_and, abitset_or_and_cmp):
15036 Use bitset_windex instead of unsigned int.
15037 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15038 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
15039 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
15040 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
15041 Likewise.
15042 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
15043
15044 * lib/bitset.c (bitset_print):
15045 Use proper printf formats for widths of integer types.
15046 * lib/bitset_stats.c (bitset_percent_histogram_print,
15047 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
15048 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15049 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15050 * lib/lbitset.c (lbitset_bytes): Likewise.
15051
15052 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
15053 BITSET_SIZE_MAX): New macros.
15054 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
15055 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
15056 to BITSET_WINDEX_MAX.
15057
15058 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
15059 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
15060 since we now return the bitset_bindex type (not int).
15061
15062 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
15063 when computing sizes.
15064 * lib/ebitset.c (ebitset_elts_grow): Likewise.
15065
15066 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
15067 and avoid cast to unsigned.
15068
15069 2002-09-30 Akim Demaille <akim@epita.fr>
15070
15071 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
15072 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
15073 Updates from Michael Hayes.
15074
15075 2002-09-30 Art Haas <ahaas@neosoft.com>
15076
15077 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
15078 invocations.
15079 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
15080 defined.
15081
15082 2002-09-27 Akim Demaille <akim@epita.fr>
15083
15084 Version 1.49c.
15085
15086 2002-09-27 Akim Demaille <akim@epita.fr>
15087
15088 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
15089 (Because of AC_LIBSOURCE).
15090
15091 2002-09-27 Akim Demaille <akim@epita.fr>
15092
15093 Playing with Autoscan.
15094
15095 * configure.ac: Remove the old LIBOBJ tweaks.
15096 (AC_REPLACE_FUNCS): Add strrchr and strtol.
15097 * lib/strrchr.c: New.
15098 * lib/strtol.c: New, from the Coreutils 4.5.1.
15099
15100 2002-09-27 Akim Demaille <akim@epita.fr>
15101
15102 Playing with Autoscan.
15103
15104 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
15105 * lib/Makefile.am (libbison_a_SOURCES): No longer include
15106 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
15107 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
15108 Coreutils 4.5.1.
15109
15110 2002-09-24 Akim Demaille <akim@epita.fr>
15111
15112 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
15113 (Frequently Asked Questions, Parser Stack Overflow): New.
15114
15115 2002-09-13 Akim Demaille <akim@epita.fr>
15116
15117 Playing with autoscan.
15118
15119 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
15120 * src/files.c (skeleton_find): Remove, unused.
15121 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
15122 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
15123
15124 2002-09-13 Akim Demaille <akim@epita.fr>
15125
15126 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
15127 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
15128
15129 2002-09-13 Akim Demaille <akim@epita.fr>
15130
15131 * configure.ac: Require 2.54.
15132 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
15133 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
15134 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
15135 Remove, provided by Autoconf macros.
15136
15137 2002-09-12 Akim Demaille <akim@epita.fr>
15138
15139 * m4/prereq.m4: Update, from Coreutils 4.5.1.
15140
15141 2002-09-12 Akim Demaille <akim@epita.fr>
15142
15143 * m4/prereq.m4: Update, from Fileutils 4.1.5.
15144 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
15145 Reported by Martin Mokrejs.
15146
15147 2002-09-10 Akim Demaille <akim@epita.fr>
15148
15149 * src/parse-gram.y: Associate a human readable string to each
15150 token type.
15151 * tests/regression.at (Invalid inputs): Adjust.
15152
15153 2002-09-10 Gary V. Vaughan <gary@gnu.org>
15154
15155 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
15156 with an Autoconf-2.5x style configure.ac.
15157
15158 2002-09-06 Paul Eggert <eggert@twinsun.com>
15159
15160 * doc/bison.texinfo (Conditions): Make explicit that the GPL
15161 exception applies only to yacc.c. This is a modification of a
15162 patch originally suggested by Akim Demaille.
15163
15164 2002-09-06 Akim Demaille <akim@epita.fr>
15165
15166 * data/c.m4 (b4_copyright): Move the GPL exception comment from
15167 here to...
15168 * data/yacc.c: here.
15169
15170 * data/lalr1.cc (struct yyltype): Don't define it, since we use
15171 LocationType.
15172 (b4_ltype): Default to yy::Location from location.hh.
15173
15174 2002-09-04 Jim Meyering <jim@meyering.net>
15175
15176 * data/yacc.c: Guard the declaration of yytoknum also with
15177 `#ifdef YYPRINT', so it is declared only when used.
15178
15179 2002-09-04 Akim Demaille <akim@epita.fr>
15180
15181 * configure.in: Rename as...
15182 * configure.ac: this.
15183 Bump to 1.49c.
15184
15185 2002-09-04 Akim Demaille <akim@epita.fr>
15186
15187 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
15188 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
15189 translate maintainer only messages.
15190
15191 2002-08-12 Paul Eggert <eggert@twinsun.com>
15192
15193 Version 1.49b.
15194
15195 * Makefile.am (SUBDIRS): Remove intl.
15196 (DISTCLEANFILES): Remove.
15197 * NEWS: Mention that GNU M4 is now required. Clarify what is
15198 meant by "larger grammars". Mention the pt_BR translation.
15199 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
15200 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
15201 Bump version from 0.11.2 to 0.11.5.
15202 (BISON_PREREQ_STAGE): Remove.
15203 (AM_GNU_GETTEXT): Use external gettext.
15204 (AC_OUTPUT): Remove intl/Makefile.
15205
15206 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
15207
15208 * data/glr.c: Include string.h, for strlen.
15209 (yyreportParseError): Use size_t for yysize.
15210 (yy_yypstack): No longer nested inside yypstates, as nested
15211 functions are not portable. Do not assume size_t is the
15212 same width as int.
15213 (yypstates): Do not assume that ptrdiff_t is the same width
15214 as int, and similarly for yyposn and YYINDEX.
15215
15216 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
15217
15218 * lib/Makefile.am (INCLUDES): Do not include from the intl
15219 directory, which has been removed.
15220 * src/Makefile.am (INCLUDES): Likewise.
15221
15222 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
15223 (bitsets_sources, additional_bitsets_sources, timevars_sources):
15224 New vars.
15225
15226 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
15227 * tests/Makefile.am (EXTRA_DIST): Likewise.
15228
15229 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
15230 Do not assume that bitset_windex is the same width as unsigned.
15231
15232 * lib/abitset.c (abitset_unused_clear): Do not assume that
15233 bitset_word is the same width as int.
15234 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
15235 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
15236 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
15237 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
15238 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
15239
15240 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
15241 portability to one's complement hosts!).
15242 * lib/ebitset.c (ebitset_op1): Likewise.
15243 * lib/lbitset.c (lbitset_op1): Likewise.
15244
15245 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
15246 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
15247 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
15248 Sync with fileutils.
15249 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
15250 lib/gettext.h: Sync with diffutils.
15251
15252 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
15253 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
15254
15255 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
15256 PROTOTYPES to check for prototypes, and "defined __STDC__" to
15257 check for void *.
15258
15259 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
15260 size_t; the old version tried to do this but casted improperly.
15261 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
15262 (bitset_test): Now returns int, not unsigned long.
15263
15264 * lib/bitset_stats.c: Include "gettext.h".
15265 (_): New macro.
15266 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
15267 name locals "index", as it generates unnecessary warnings on some
15268 hosts that have an "index" function.
15269
15270 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
15271 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
15272 they need translation.
15273 * src/LR0.c (state_list_append, new_itemsets, get_state,
15274 append_states, generate_states): Likewise.
15275 * src/assoc.c (assoc_to_string): Likewise.
15276 * src/closure.c (print_closure, set_firsts, closure): Likewise.
15277 * src/gram.c (grammar_dump): Likewise.
15278 * src/injections.c (injections_compute): Likewise.
15279 * src/lalr.c (lookaheads_print): Likewise.
15280 * src/relation.c (relation_transpose): Likewise.
15281 * src/scan-gram.l: Likewise.
15282 * src/tables.c (table_grow, pack_vector): Likewise.
15283
15284 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
15285 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
15286 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
15287 * m4/mbstate_t.m4: Sync with fileutils.
15288 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
15289
15290 * po/LINGUAS: Add pt_BR.
15291 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
15292 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
15293 lib/timevar.c.
15294 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
15295 manual recommends.
15296 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
15297
15298 * src/complain.c (strerror_r): Remove decl; not needed.
15299 (strerror): Use same pattern as ../lib/error.c.
15300
15301 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
15302
15303 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
15304
15305 * src/main.c (main): Cast result of bindtextdomain and textdomain
15306 to void, to avoid a GCC warning when --disable-nls is in effect.
15307
15308 * src/scan-gram.l: Use strings rather than escapes when possible,
15309 to minimize the number of warnings from xgettext.
15310 (handle_action_dollar, handle_action_at): Don't use isdigit,
15311 as it mishandles negative chars and it may not work as expected
15312 outside the C locale.
15313
15314 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
15315 this is a GCC extension and is not portable to other compilers.
15316
15317 * src/system.h (alloca): Use same pattern as ../lib/error.c.
15318 Do not include <ctype.h>; no longer needed.
15319 Do not include <malloc.h>; no longer needed (and generates
15320 warnings on OpenBSD 3.0).
15321
15322 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
15323 it's not portable.
15324
15325 * tests/regression.at: Do not use 'cc -c input.c -o input';
15326 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
15327
15328 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
15329 exit status as failure, not just exit status 1. Sun C exits
15330 with status 2 sometimes.
15331
15332 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
15333 Use it for the two large tests.
15334
15335 2002-08-02 Akim Demaille <akim@epita.fr>
15336
15337 * src/conflicts.c (conflicts_output): Don't output rules never
15338 reduced here, since anyway that computation doesn't work.
15339 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
15340 (rule_useless_p, rule_never_reduced_p): New.
15341 (grammar_rules_partial_print): Use a filter instead of a range.
15342 Display the title only if needed.
15343 (grammar_rules_print): Adjust.
15344 (grammar_rules_never_reduced_report): New.
15345 * src/tables.c (action_row): Move the computation of rules never
15346 reduced to...
15347 (token_actions): here.
15348 * src/main.c (main): Make the parser before making the report, so
15349 that rules never reduced are computed.
15350 Call grammar_rules_never_reduced_report.
15351 * src/print.c (print_results): Report rules never reduced.
15352 * tests/conflicts.at, tests/reduce.at: Adjust.
15353
15354 2002-08-01 Akim Demaille <akim@epita.fr>
15355
15356 Instead of attaching lookaheads and duplicating the rules being
15357 reduced by a state, attach the lookaheads to the reductions.
15358
15359 * src/state.h (state_t): Remove the `lookaheads',
15360 `lookaheads_rule' member.
15361 (reductions_t): Add a `lookaheads' member.
15362 Use a regular array for the `rules'.
15363 * src/state.c (reductions_new): Initialize the lookaheads member
15364 to 0.
15365 (state_rule_lookaheads_print): Adjust.
15366 * src/state.h, src/state.c (state_reductions_find): New.
15367 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
15368 (count_rr_conflicts): Adjust.
15369 * src/lalr.c (LArule): Remove.
15370 (add_lookback_edge): Adjust.
15371 (state_lookaheads_count): New.
15372 (states_lookaheads_initialize): Merge into...
15373 (initialize_LA): this.
15374 (lalr_free): Adjust.
15375 * src/main.c (main): Don't free nullable and derives too early: it
15376 is used by --verbose.
15377 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
15378
15379 2002-08-01 Akim Demaille <akim@epita.fr>
15380
15381 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
15382 `rule_number_t**'.
15383 (set_derives, free_derives): Rename as...
15384 (derives_compute, derives_free): this.
15385 Adjust all dependencies.
15386 * src/nullable.c (set_nullable, free_nullable): Rename as...
15387 (nullable_compute, nullable_free): these.
15388 (rule_list_t): Store rule_t *, not rule_number_t.
15389 * src/state.c (state_rule_lookaheads_print): Directly compare rule
15390 pointers, instead of their numbers.
15391 * src/main.c (main): Call nullable_free, and derives_free earlier,
15392 as they were lo longer used.
15393
15394 2002-08-01 Akim Demaille <akim@epita.fr>
15395
15396 * lib/timevar.c (get_time): Include children time.
15397 * src/lalr.h (LA, LArule): Don't export them: used with the
15398 state_t.
15399 * src/lalr.c (LA, LArule): Static.
15400 * src/lalr.h, src/lalr.c (lalr_free): New.
15401 * src/main.c (main): Call it.
15402 * src/tables.c (pack_vector): Check whether loc is >= to the
15403 table_size, not >.
15404 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
15405 (tables_generate): do it, since that's also it which allocates
15406 them.
15407 Don't free LA and LArule, main does.
15408
15409 2002-07-31 Akim Demaille <akim@epita.fr>
15410
15411 Separate parser tables computation and output.
15412
15413 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
15414 (conflict_list, conflict_list_cnt, table, check, table_ninf)
15415 (yydefgoto, yydefact, high): Move to...
15416 * src/tables.h, src/tables.c: here.
15417 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
15418 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
15419 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
15420 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
15421 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
15422 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
15423 (action_row, save_row, token_actions, save_column, default_goto)
15424 (goto_actions, sort_actions, matching_state, pack_vector)
15425 (table_ninf_remap, pack_table, prepare_actions): Move to...
15426 * src/tables.c: here.
15427 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
15428 * src/output.c (token_actions, output_base, output_conflicts)
15429 (output_check): Merge into...
15430 (prepare_actions): this.
15431 (actions_output): Rename as...
15432 (user_actions_output): this.
15433 * src/main.c (main): Call tables_generate and tables_free.
15434
15435 2002-07-31 Akim Demaille <akim@epita.fr>
15436
15437 Steal GCC's --time-report support.
15438
15439 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
15440 stolen/adjusted from GCC.
15441 * m4/stage.m4: Remove time related checks.
15442 * m4/timevar.m4: New.
15443 * configure.in: Adjust.
15444 * src/system.h: Adjust to using timevar.h.
15445 * src/getargs.h, src/getargs.c: Support trace_time for
15446 --trace=time.
15447 * src/main.c (stage): Remove.
15448 (main): Replace `stage' invocations with timevar calls.
15449 * src/output.c: Insert pertinent timevar calls.
15450
15451 2002-07-31 Akim Demaille <akim@epita.fr>
15452
15453 Let --trace have arguments.
15454
15455 * src/getargs.h (enum trace_e): New.
15456 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
15457 (long_options, short_options): --trace/-T takes an optional
15458 argument.
15459 Change all the uses of trace_flag to reflect the new flags.
15460 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
15461
15462 Strengthen `stage' portability.
15463
15464 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
15465 * configure.in: Use it.
15466 Don't check for malloc.h and sys/times.h.
15467 * src/system.h: Include them when appropriate.
15468 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
15469 times and struct tms are available.
15470
15471 2002-07-30 Akim Demaille <akim@epita.fr>
15472
15473 In verbose parse error message, don't report `error' as an
15474 expected token.
15475 * tests/actions.at (Printers and Destructors): Adjust.
15476 * tests/calc.at (Calculator $1): Adjust.
15477 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
15478 error message, do not report the parser accepts the error token in
15479 that state.
15480
15481 2002-07-30 Akim Demaille <akim@epita.fr>
15482
15483 Normalize conflict related messages.
15484
15485 * src/complain.h, src/complain.c (warn, complain): New.
15486 * src/conflicts.c (conflicts_print): Use them.
15487 (conflict_report_yacc): New, extracted from...
15488 (conflicts_print): here.
15489 * tests/conflicts.at, tests/existing.at: Adjust.
15490
15491 2002-07-30 Akim Demaille <akim@epita.fr>
15492
15493 Report rules which are never reduced by the parser: those hidden
15494 by conflicts.
15495
15496 * src/LR0.c (save_reductions): Don't make the final state too
15497 different: save its reduction (accept) instead of having a state
15498 without any action (no shift or goto, no reduce).
15499 Note: the final state is now a ``regular'' state, i.e., the
15500 parsers now contain `reduce 0' as default reduction.
15501 Nevertheless, since they decide to `accept' when yystate =
15502 final_state, they still will not reduce rule 0.
15503 * src/print.c (print_actions, print_reduction): Adjust.
15504 * src/output.c (action_row): Track reduced rules.
15505 (token_actions): Report rules never reduced.
15506 * tests/conflicts.at, tests/regression.at: Adjust.
15507
15508 2002-07-30 Akim Demaille <akim@epita.fr>
15509
15510 `stage' was accidently included in a previous patch.
15511 Initiate its autoconfiscation.
15512
15513 * configure.in: Look for malloc.h and sys/times.h.
15514 * src/main.c (stage): Adjust.
15515 Report only when trace_flag.
15516
15517 2002-07-29 Akim Demaille <akim@epita.fr>
15518
15519 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
15520 state_number_t.
15521 (errs_t): symbol_t*, not symbol_number_t.
15522 (reductions_t): rule_t*, not rule_number_t.
15523 (FOR_EACH_SHIFT): New.
15524 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
15525 * src/print.c, src/print_graph.c: Adjust.
15526
15527 2002-07-29 Akim Demaille <akim@epita.fr>
15528
15529 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
15530
15531 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
15532 (endtoken, accept): these.
15533 * src/reader.c (reader): Set endtoken's default tag to "$end".
15534 Set undeftoken's tag to "$undefined" instead of "$undefined.".
15535 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
15536 Adjust.
15537
15538 2002-07-29 Akim Demaille <akim@epita.fr>
15539
15540 * src/reduce.c (reduce_grammar): When the language is empty,
15541 complain about the start symbol, not the axiom.
15542 Use its location.
15543 * tests/reduce.at (Empty Language): New.
15544
15545 2002-07-26 Akim Demaille <akim@epita.fr>
15546
15547 * src/reader.h, src/reader.c (gram_error): ... can't get
15548 yycontrol without making too strong assumptions on the parser
15549 itself.
15550 * src/output.c (prepare_tokens): Use the real 0th value of
15551 token_translations instead of `0'.
15552 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
15553 visible here.
15554 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
15555 for the time being: %locations ought to provide it to yyerror.
15556
15557 2002-07-25 Akim Demaille <akim@epita.fr>
15558
15559 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
15560 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
15561 * tests/regression.at (Web2c Actions): Adjust.
15562
15563 2002-07-25 Akim Demaille <akim@epita.fr>
15564
15565 Stop storing rules from 1 to nrules + 1.
15566
15567 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
15568 * src/nullable.c, src/output.c, src/print.c, src/reader.c
15569 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
15570 Iterate from 0 to nrules.
15571 Use rule_number_as_item_number and item_number_as_rule_number.
15572 Adjust to `derive' now containing possibly 0.
15573 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
15574 Handle the `- 1' part in rule numbers from/to item numbers.
15575 * src/conflicts.c (log_resolution): Fix the message which reversed
15576 shift and reduce.
15577 * src/output.c (action_row): Initialize default_rule to -1.
15578 (token_actions): Adjust.
15579 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
15580 expected output.
15581 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
15582
15583 2002-07-25 Akim Demaille <akim@epita.fr>
15584
15585 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
15586 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
15587 (b4_c_knr_arg_decl): New.
15588 * data/yacc.c: Use it to define yysymprint, yydestruct, and
15589 yyreport_parse_error.
15590
15591 2002-07-25 Akim Demaille <akim@epita.fr>
15592
15593 * data/yacc.c (yyreport_parse_error): New, extracted from...
15594 (yyparse): here.
15595 (yydestruct, yysymprint): Move above yyparse.
15596 Be K&R compliant.
15597
15598 2002-07-25 Akim Demaille <akim@epita.fr>
15599
15600 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
15601 replace...
15602 (b4_sint_type, b4_uint_type): these.
15603 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
15604 * tests/regression.at (Web2c Actions): Adjust.
15605
15606 2002-07-25 Akim Demaille <akim@epita.fr>
15607
15608 * src/gram.h (TIEM_NUMBER_MAX): New.
15609 (item_number_of_rule_number, rule_number_of_item_number): Rename
15610 as...
15611 (rule_number_as_item_number, item_number_as_rule_number): these.
15612 Adjust dependencies.
15613 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
15614 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
15615 (symbol_number_to_vector_number): New.
15616 (order): Of vector_number_t* type.
15617 (base_t, BASE_MAX, BASE_MIN): New.
15618 (froms, tos, width, pos, check): Of base_t type.
15619 (action_number_t, ACTION_MIN, ACTION_MAX): New.
15620 (actrow): Of action_number_t type.
15621 (conflrow): Of unsigned int type.
15622 (table_ninf, base_ninf): New.
15623 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
15624 (muscle_insert_int_table, muscle_insert_base_table)
15625 (muscle_insert_rule_number_table): New.
15626 (prepare_tokens): Output `toknum' as int_table.
15627 (action_row): Returns a rule_number_t.
15628 Use ACTION_MIN, not SHRT_MIN.
15629 (token_actions): yydefact is rule_number_t*.
15630 (table_ninf_remap): New.
15631 (pack_table): Use it for `base' and `table'.
15632 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
15633 replaced with...
15634 (YYPACT_NINF, YYTABLE_NINF): these.
15635 (yypact, yytable): Compute their types instead of hard-coded
15636 `short'.
15637 * tests/regression.at (Web2c Actions): Adjust.
15638
15639 2002-07-19 Akim Demaille <akim@epita.fr>
15640
15641 * src/scan-gram.l (id): Can start with an underscore.
15642
15643 2002-07-16 Akim Demaille <akim@epita.fr>
15644
15645 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
15646 Adjust all former `associativity' dependencies.
15647 * src/symtab.c (symbol_new): Default associativity is `undef', not
15648 `right'.
15649 (symbol_check_alias_consistence): Adjust.
15650
15651 2002-07-09 Akim Demaille <akim@epita.fr>
15652
15653 * doc/bison.texinfo: Properly set the ``header'' part.
15654 Use @dircategory ``GNU programming tools'' as per Texinfo's
15655 documentation.
15656 Use @copying.
15657
15658 2002-07-09 Akim Demaille <akim@epita.fr>
15659
15660 * lib/quotearg.h: Protect against multiple inclusions.
15661 * src/location.h (location_t): Add a `file' member.
15662 (LOCATION_RESET, LOCATION_PRINT): Adjust.
15663 * src/complain.c (warn_at, complain_at, fatal_at): Drop
15664 `error_one_per_line' support.
15665
15666 2002-07-09 Akim Demaille <akim@epita.fr>
15667
15668 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
15669 * src/reader.c (lineno): Remove.
15670 Adjust all dependencies.
15671 (get_merge_function): Take a location and use complain_at.
15672 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
15673 * tests/regression.at (Invalid inputs, Mixing %token styles):
15674 Adjust.
15675
15676 2002-07-09 Akim Demaille <akim@epita.fr>
15677
15678 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
15679 recovery rule, and forbid extensions when --yacc.
15680 (gram_error): Use complain_at.
15681 * src/reader.c (reader): Exit if there were parse errors.
15682
15683 2002-07-09 Akim Demaille <akim@epita.fr>
15684
15685 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
15686 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
15687 Reported by R Blake <blakers@mac.com>.
15688
15689 2002-07-09 Akim Demaille <akim@epita.fr>
15690
15691 * data/yacc.c: Output the copyright notive in the header.
15692
15693 2002-07-03 Akim Demaille <akim@epita.fr>
15694
15695 * src/output.c (froms, tos): Are state_number_t.
15696 (save_column): sp, sp1, and sp2 are state_number_t.
15697 (prepare): Rename `final' as `final_state_number', `nnts' as
15698 `nterms_number', `nrules' as `rules_number', `nstates' as
15699 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
15700 unused.
15701 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
15702 * data/lalr1.cc (nsym_): Remove, unused.
15703
15704 2002-07-03 Akim Demaille <akim@epita.fr>
15705
15706 * src/lalr.h, src/lalr.c (goto_number_t): New.
15707 * src/lalr.c (goto_list_t): New.
15708 Propagate them.
15709 * src/nullable.c (rule_list_t): New.
15710 Propagate.
15711 * src/types.h: Remove.
15712
15713 2002-07-03 Akim Demaille <akim@epita.fr>
15714
15715 * src/closure.c (print_fderives): Use rule_rhs_print.
15716 * src/derives.c (print_derives): Use rule_rhs_print.
15717 (rule_list_t): New, replaces `shorts'.
15718 (set_derives): Add comments.
15719 * tests/sets.at (Nullable, Firsts): Adjust.
15720
15721 2002-07-03 Akim Demaille <akim@epita.fr>
15722
15723 * src/output.c (prepare_actions): Free `tally' and `width'.
15724 (prepare_actions): Allocate and free `order'.
15725 * src/symtab.c (symbols_free): Free `symbols'.
15726 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
15727 * src/output.c (m4_invoke): Move to...
15728 * src/scan-skel.l: here.
15729 (<<EOF>>): Close yyout, and free its name.
15730
15731 2002-07-03 Akim Demaille <akim@epita.fr>
15732
15733 Fix some memory leaks, and fix a bug: state 0 was examined twice.
15734
15735 * src/LR0.c (new_state): Merge into...
15736 (state_list_append): this.
15737 (new_states): Merge into...
15738 (generate_states): here.
15739 (set_states): Don't ensure a proper `errs' state member here, do it...
15740 * src/conflicts.c (conflicts_solve): here.
15741 * src/state.h, src/state.c: Comment changes.
15742 (state_t): Rename member `shifts' as `transitions'.
15743 Adjust all dependencies.
15744 (errs_new): For consistency, also take the values as argument.
15745 (errs_dup): Remove.
15746 (state_errs_set): New.
15747 (state_reductions_set, state_transitions_set): Assert that no
15748 previous value was assigned.
15749 (state_free): New.
15750 (states_free): Use it.
15751 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
15752 temporary storage: use `errs' and `nerrs' as elsewhere.
15753 (set_conflicts): Allocate and free this `errs'.
15754
15755 2002-07-02 Akim Demaille <akim@epita.fr>
15756
15757 * lib/libiberty.h: New.
15758 * lib: Update the bitset implementation from upstream.
15759 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
15760 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
15761 * src/main.c: Adjust bitset stats calls.
15762
15763 2002-07-01 Paul Eggert <eggert@twinsun.com>
15764
15765 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
15766 char, so that negative chars don't collide with $.
15767
15768 2002-06-30 Akim Demaille <akim@epita.fr>
15769
15770 Have the GLR tests be `warning' checked, and fix the warnings.
15771
15772 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
15773 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
15774 (yyremoveDeletes): `yyi' and `yyj' are size_t.
15775 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
15776 (yyaddDeferredAction): static.
15777 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
15778 (yyreportParseError): yyprefix is const.
15779 yytokenp is used only when verbose.
15780 (yy__GNUC__): Replace with __GNUC__.
15781 (yypdumpstack): yyi is size_t.
15782 (yypreference): Un-yy local variables and arguments, to avoid
15783 clashes with `yyr1'. Anyway, we are not in the user name space.
15784 (yytname_size): be an int, as is compared with ints.
15785 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
15786 Use them.
15787 * tests/cxx-gram.at: Use quotation to protect $1.
15788 Use AT_COMPILE to enable warnings hunts.
15789 Prototype yylex and yyerror.
15790 `Use' argc.
15791 Include `string.h', not `strings.h'.
15792 Produce and prototype stmtMerge only when used.
15793 yylex takes a location.
15794
15795 2002-06-30 Akim Demaille <akim@epita.fr>
15796
15797 We spend a lot of time in quotearg, in particular when --verbose.
15798
15799 * src/symtab.c (symbol_get): Store a quoted version of the key.
15800 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
15801 Adjust all callers.
15802
15803 2002-06-30 Akim Demaille <akim@epita.fr>
15804
15805 * src/state.h (reductions_t): Rename member `nreds' as num.
15806 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
15807 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
15808
15809 2002-06-30 Akim Demaille <akim@epita.fr>
15810
15811 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
15812 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
15813 (shifts_to): Rename as...
15814 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
15815 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
15816 (TRANSITION_IS_DISABLED, transitions_to): these.
15817
15818 2002-06-30 Akim Demaille <akim@epita.fr>
15819
15820 * src/print.c (print_shifts, print_gotos): Merge into...
15821 (print_transitions): this.
15822 (print_transitions, print_errs, print_reductions): Align the
15823 lookaheads columns.
15824 (print_core, print_transitions, print_errs, print_state,
15825 print_grammar): Output empty lines separator before, not after.
15826 (state_default_rule_compute): Rename as...
15827 (state_default_rule): this.
15828 * tests/conflicts.at (Defaulted Conflicted Reduction),
15829 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
15830 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
15831
15832 2002-06-30 Akim Demaille <akim@epita.fr>
15833
15834 Display items as we display rules.
15835
15836 * src/gram.h, src/gram.c (rule_lhs_print): New.
15837 * src/gram.c (grammar_rules_partial_print): Use it.
15838 * src/print.c (print_core): Likewise.
15839 * tests/conflicts.at (Defaulted Conflicted Reduction),
15840 (Unresolved SR Conflicts): Adjust.
15841 (Unresolved SR Conflicts): Adjust and rename as...
15842 (Resolved SR Conflicts): this, as was meant.
15843 * tests/regression.at (Web2c Report): Adjust.
15844
15845 2002-06-30 Akim Demaille <akim@epita.fr>
15846
15847 * src/print.c (state_default_rule_compute): New, extracted from...
15848 (print_reductions): here.
15849 Pessimize, but clarify the code.
15850 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
15851
15852 2002-06-30 Akim Demaille <akim@epita.fr>
15853
15854 * src/output.c (action_row): Let default_rule be always a rule
15855 number.
15856
15857 2002-06-30 Akim Demaille <akim@epita.fr>
15858
15859 * src/closure.c (print_firsts, print_fderives, closure):
15860 Use BITSET_EXECUTE.
15861 * src/lalr.c (lookaheads_print): Likewise.
15862 * src/state.c (state_rule_lookaheads_print): Likewise.
15863 * src/print_graph.c (print_core): Likewise.
15864 * src/print.c (print_reductions): Likewise.
15865 * src/output.c (action_row): Likewise.
15866 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
15867
15868 2002-06-30 Akim Demaille <akim@epita.fr>
15869
15870 * src/print_graph.c: Use report_flag.
15871
15872 2002-06-30 Akim Demaille <akim@epita.fr>
15873
15874 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
15875 to...
15876 * src/relation.h, src/relation.c (traverse, relation_digraph)
15877 (relation_print, relation_transpose): New.
15878
15879 2002-06-30 Akim Demaille <akim@epita.fr>
15880
15881 * src/state.h, src/state.c (shifts_to): New.
15882 * src/lalr.c (build_relations): Use it.
15883
15884 2002-06-30 Akim Demaille <akim@epita.fr>
15885
15886 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
15887 (item_number_of_rule_number, rule_number_of_item_number): New.
15888 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
15889 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
15890 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
15891 Propagate their use.
15892 Much remains to be done, in particular wrt `shorts' from types.h.
15893
15894 2002-06-30 Akim Demaille <akim@epita.fr>
15895
15896 * src/symtab.c (symbol_new): Initialize the `printer' member.
15897
15898 2002-06-30 Akim Demaille <akim@epita.fr>
15899
15900 * src/LR0.c (save_reductions): Remove, replaced by...
15901 * src/state.h, src/state.c (state_reductions_set): New.
15902 (reductions, errs): Rename as...
15903 (reductions_t, errs_t): these.
15904 Adjust all dependencies.
15905
15906 2002-06-30 Akim Demaille <akim@epita.fr>
15907
15908 * src/LR0.c (state_list_t, state_list_append): New.
15909 (first_state, last_state): Now symbol_list_t.
15910 (this_state): Remove.
15911 (new_itemsets, append_states, save_reductions): Take a state_t as
15912 argument.
15913 (set_states, generate_states): Adjust.
15914 (save_shifts): Remove, replaced by...
15915 * src/state.h, src/state.c (state_shifts_set): New.
15916 (shifts): Rename as...
15917 (shifts_t): this.
15918 Adjust all dependencies.
15919 * src/state.h (state_t): Remove the `next' member.
15920
15921 2002-06-30 Akim Demaille <akim@epita.fr>
15922
15923 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
15924 escaped in slot 0.
15925
15926 2002-06-30 Akim Demaille <akim@epita.fr>
15927
15928 Use hash.h for the state hash table.
15929
15930 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
15931 (allocate_storage): Use state_hash_new.
15932 (free_storage): Use state_hash_free.
15933 (new_state, get_state): Adjust.
15934 * src/lalr.h, src/lalr.c (states): Move to...
15935 * src/states.h (state_t): Remove the `link' member, no longer
15936 used.
15937 * src/states.h, src/states.c: here.
15938 (state_hash_new, state_hash_free, state_hash_lookup)
15939 (state_hash_insert, states_free): New.
15940 * src/states.c (state_table, state_compare, state_hash): New.
15941 * src/output.c (output_actions): Do not free states now, since we
15942 still need to know the final_state number in `prepare', called
15943 afterwards. Do it...
15944 * src/main.c (main): here: call states_free after `output'.
15945
15946 2002-06-30 Akim Demaille <akim@epita.fr>
15947
15948 * src/state.h, src/state.c (state_new): New, extracted from...
15949 * src/LR0.c (new_state): here.
15950 * src/state.h (STATE_ALLOC): Move to...
15951 * src/state.c: here.
15952 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
15953 * src/state.h, src/state.c: here.
15954
15955 2002-06-30 Akim Demaille <akim@epita.fr>
15956
15957 * src/reader.c (gensym): Rename as...
15958 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
15959 (getsym): Rename as...
15960 (symbol_get): this.
15961
15962 2002-06-30 Akim Demaille <akim@epita.fr>
15963
15964 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
15965 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
15966 * src/output.c, src/print.c, src/print_graph.c: Propagate.
15967 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
15968
15969 2002-06-30 Akim Demaille <akim@epita.fr>
15970
15971 Make the test suite pass with warnings checked.
15972
15973 * tests/actions.at (Printers and Destructors): Improve.
15974 Avoid unsigned vs. signed issues.
15975 * tests/calc.at: Don't exercise the scanner here, do it...
15976 * tests/input.at (Torturing the Scanner): here.
15977
15978 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15979
15980 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
15981 reorganize first lines parallel to yacc.c.
15982
15983 2002-06-28 Akim Demaille <akim@epita.fr>
15984
15985 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
15986 (b4_token_enum, b4_token_defines): New, factored from...
15987 * data/lalr1.cc, data/yacc.c, glr.c: here.
15988
15989 2002-06-28 Akim Demaille <akim@epita.fr>
15990
15991 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
15992 unused variables.
15993 * src/output.c (merger_output): static.
15994
15995 2002-06-28 Akim Demaille <akim@epita.fr>
15996
15997 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
15998 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
15999 pacify GCC.
16000 * src/output.c (save_row): Initialize all the variables to pacify GCC.
16001
16002 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16003
16004 Accumulated changelog for new GLR parsing features.
16005
16006 * src/conflicts.c (count_total_conflicts): Change name to
16007 conflicts_total_count.
16008 * src/conflicts.h: Ditto.
16009 * src/output.c (token_actions): Use the new name.
16010 (output_conflicts): Change conflp => conflict_list_heads, and
16011 confl => conflict_list for better readability.
16012 * data/glr.c: Use the new names.
16013 * NEWS: Add self to GLR announcement.
16014
16015 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
16016
16017 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
16018 Akim Demaille.
16019
16020 * data/bison.glr: Change name to glr.c
16021 * data/glr.c: Renamed from bison.glr.
16022 * data/Makefile.am: Add glr.c
16023
16024 * src/getargs.c:
16025
16026 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
16027 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
16028
16029 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16030
16031 * data/bison.glr: Be sure to restore the
16032 current #line when returning to the skeleton contents after having
16033 exposed the input file's #line.
16034
16035 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16036
16037 * data/bison.glr: Bring up to date with changes to bison.simple.
16038
16039 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16040
16041 * data/bison.glr: Correct definitions that use b4_prefix.
16042 Various reformatting.
16043 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
16044 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
16045 yytokenp argument; now part of stack.
16046 (yychar): Define to behave as documented.
16047 (yyclearin): Ditto.
16048
16049 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16050
16051 * src/reader.h: Add declaration for free_merger_functions.
16052
16053 * src/reader.c (merge_functions): New variable.
16054 (get_merge_function): New function.
16055 (free_merger_functions): New function.
16056 (readgram): Check for %prec that is not followed by a symbol.
16057 Handle %dprec and %merge declarations.
16058 (packgram): Initialize dprec and merger fields in rules array.
16059
16060 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
16061 conflict_list_cnt, conflict_list_free): New variables.
16062 (table_grow): Also grow conflict_table.
16063 (prepare_rules): Output dprec and merger tables.
16064 (conflict_row): New function.
16065 (action_row): Output conflict lists for GLR parser. Don't use
16066 default reduction in conflicted states for GLR parser so that there
16067 are spaces for the conflict lists.
16068 (save_row): Also save conflict information.
16069 (token_actions): Allocate conflict list.
16070 (merger_output): New function.
16071 (pack_vector): Pack conflict table, too.
16072 (output_conflicts): New function to output yyconflp and yyconfl.
16073 (output_check): Allocate conflict_tos.
16074 (output_actions): Output conflict tables, also.
16075 (output_skeleton): Output b4_mergers definition.
16076 (prepare): Output b4_max_rhs_length definition.
16077 Use 'bison.glr' as default skeleton for GLR parsers.
16078
16079 * src/gram.c (glr_parser): New flag.
16080 (grammar_free): Call free_merger_functions.
16081
16082 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
16083 all pairs of conflicting reductions, rather than just all tokens
16084 causing conflicts. Needed to size conflict tables.
16085 (conflicts_output): Modify call to count_rr_conflicts for new
16086 interface.
16087 (conflicts_print): Ditto.
16088 (count_total_conflicts): New function.
16089
16090 * src/reader.h (merger_list): New type.
16091 (merge_functions): New variable.
16092
16093 * src/lex.h (tok_dprec, tok_merge): New token types.
16094
16095 * src/gram.h (rule_s): Add dprec and merger fields.
16096 (glr_parser): New flag.
16097
16098 * src/conflicts.h (count_total_conflicts): New function.
16099
16100 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
16101
16102 * doc/bison.texinfo (Generalized LR Parsing): New section.
16103 (GLR Parsers): New section.
16104 (Language and Grammar): Mention GLR parsing.
16105 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
16106 Correct typo ("tge" -> "the").
16107
16108 * data/bison.glr: New skeleton for GLR parsing.
16109
16110 * tests/cxx-gram.at: New tests for GLR parsing.
16111
16112 * tests/testsuite.at: Include cxx-gram.at.
16113
16114 * tests/Makefile.am: Add cxx-gram.at.
16115
16116 * src/parse-gram.y:
16117
16118 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
16119
16120 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
16121
16122 2002-06-27 Akim Demaille <akim@epita.fr>
16123
16124 * src/options.h, src/options.c: Remove.
16125 * src/getargs.c (short_options, long_options): New.
16126
16127 2002-06-27 Akim Demaille <akim@epita.fr>
16128
16129 * data/bison.simple, data/bison.c++: Rename as...
16130 * data/yacc.c, data/lalr1.cc: these.
16131 * doc/bison.texinfo (Environment Variables): Remove.
16132
16133 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
16134
16135 * src/getargs.c (report_argmatch): Initialize strtok().
16136
16137 2002-06-20 Akim Demaille <akim@epita.fr>
16138
16139 * data/bison.simple (b4_symbol_actions): New, replaces...
16140 (b4_symbol_destructor, b4_symbol_printer): these.
16141 (yysymprint): Be sure to call YYPRINT only for tokens, and using
16142 user token numbers.
16143
16144 2002-06-20 Akim Demaille <akim@epita.fr>
16145
16146 * data/bison.simple (yydestructor): Rename as...
16147 (yydestruct): this.
16148
16149 2002-06-20 Akim Demaille <akim@epita.fr>
16150
16151 * src/symtab.h, src/symtab.c (symbol_type_set)
16152 (symbol_destructor_set, symbol_precedence_set): The location is
16153 the last argument.
16154 Adjust all callers.
16155
16156 2002-06-20 Akim Demaille <akim@epita.fr>
16157
16158 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
16159 internals.
16160 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
16161 Takes a location.
16162 * src/symtab.h, src/symtab.c (symbol_class_set)
16163 (symbol_user_token_number_set): Likewise.
16164 Adjust all callers.
16165 Promote complain_at.
16166 * tests/input.at (Type Clashes): Adjust.
16167
16168 2002-06-20 Akim Demaille <akim@epita.fr>
16169
16170 * data/bison.simple (YYLEX): Fix the declaration when
16171 %pure-parser.
16172
16173 2002-06-20 Akim Demaille <akim@epita.fr>
16174
16175 * data/bison.simple (yysymprint): Don't print the token number,
16176 just its name.
16177 * tests/actions.at (Destructors): Rename as...
16178 (Printers and Destructors): this.
16179 Also exercise %printer.
16180
16181 2002-06-20 Akim Demaille <akim@epita.fr>
16182
16183 * data/bison.simple (YYDSYMPRINT): New.
16184 Use it to remove many of the #if YYDEBUG/if (yydebug).
16185
16186 2002-06-20 Akim Demaille <akim@epita.fr>
16187
16188 * src/symtab.h, src/symtab.c (symbol_t): printer and
16189 printer_location are new members.
16190 (symbol_printer_set): New.
16191 * src/parse-gram.y (PERCENT_PRINTER): New token.
16192 Handle its associated rule.
16193 * src/scan-gram.l: Adjust.
16194 (handle_destructor_at, handle_destructor_dollar): Rename as...
16195 (handle_symbol_code_at, handle_symbol_code_dollar): these.
16196 * src/output.c (symbol_printers_output): New.
16197 (output_skeleton): Call it.
16198 * data/bison.simple (yysymprint): New. Cannot be named yyprint
16199 since there are already many grammar files with a user `yyprint'.
16200 Replace the calls to YYPRINT to calls to yysymprint.
16201 * tests/calc.at: Adjust.
16202 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
16203 taking advantage of parser very internal details (stack size!).
16204
16205 2002-06-20 Akim Demaille <akim@epita.fr>
16206
16207 * src/scan-gram.l: Complete the scanner with the missing patterns
16208 to pacify Flex.
16209 Use `quote' and `symbol_tag_get' where appropriate.
16210
16211 2002-06-19 Akim Demaille <akim@epita.fr>
16212
16213 * tests/actions.at (Destructors): Augment to test locations.
16214 * data/bison.simple (yydestructor): Pass it the current location
16215 if locations are enabled.
16216 Prototype only when __STDC__ or C++.
16217 Change the argument names to move into the yy name space: there is
16218 user code here.
16219
16220 2002-06-19 Akim Demaille <akim@epita.fr>
16221
16222 * data/bison.simple (b4_pure_if): New.
16223 Use it instead of #ifdef YYPURE.
16224
16225 2002-06-19 Akim Demaille <akim@epita.fr>
16226
16227 * data/bison.simple (b4_location_if): New.
16228 Use it instead of #ifdef YYLSP_NEEDED.
16229
16230 2002-06-19 Akim Demaille <akim@epita.fr>
16231
16232 Prepare @$ in %destructor, but currently don't bind it in the
16233 skeleton, as %location use is not cleaned up yet.
16234
16235 * src/scan-gram.l (handle_dollar, handle_destructor_at)
16236 (handle_action_at): New.
16237 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
16238 a braced_code_t and a location as additional arguments.
16239 (handle_destructor_dollar): Instead of requiring `b4_eval', just
16240 unquote one when outputting `b4_dollar_dollar'.
16241 Adjust callers.
16242 * data/bison.simple (b4_eval): Remove.
16243 (b4_symbol_destructor): Adjust.
16244 * tests/input.at (Invalid @n): Adjust.
16245
16246 2002-06-19 Zack Weinberg <zack@codesourcery.com>
16247
16248 * doc/bison.texinfo: Document ability to have multiple
16249 prologue sections.
16250
16251 2002-06-18 Akim Demaille <akim@epita.fr>
16252
16253 * src/files.c (compute_base_names): When computing the output file
16254 names from the input file name, strip the directory part.
16255
16256 2002-06-18 Akim Demaille <akim@epita.fr>
16257
16258 * data/bison.simple.new: Comment changes.
16259 Reported by Andreas Schwab.
16260
16261 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
16262
16263 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
16264 there are no `label `yyoverflowlab' defined but not used' warnings
16265 when yyoverflow is defined.
16266
16267 2002-06-18 Akim Demaille <akim@epita.fr>
16268
16269 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
16270 new member.
16271 (symbol_destructor_set): Adjust.
16272 * src/output.c (symbol_destructors_output): Output the destructor
16273 locations.
16274 Output the symbol name.
16275 * data/bison.simple (b4_symbol_destructor): Adjust.
16276
16277 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
16278 and Akim Demaille <akim@epita.fr>
16279
16280 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
16281 what's left on the stack when the error recovery hits EOF.
16282 * tests/actions.at (Destructors): Complete to exercise this case.
16283
16284 2002-06-17 Akim Demaille <akim@epita.fr>
16285
16286 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
16287 arguments is really empty, not only equal to `[]'.
16288 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
16289 member.
16290 (symbol_destructor_set): New.
16291 * src/output.c (symbol_destructors_output): New.
16292 * src/reader.h (brace_code_t, current_braced_code): New.
16293 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
16294 (handle_dollar): Rename as...
16295 (handle_action_dollar): this.
16296 (handle_destructor_dollar): New.
16297 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
16298 (grammar_declaration): Use it.
16299 * data/bison.simple (yystos): Is always defined.
16300 (yydestructor): New.
16301 * tests/actions.at (Destructors): New.
16302 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
16303
16304 2002-06-17 Akim Demaille <akim@epita.fr>
16305
16306 * src/symlist.h, src/symlist.c (symbol_list_length): New.
16307 * src/scan-gram.l (handle_dollar, handle_at): Compute the
16308 rule_length only when needed.
16309 * src/output.c (actions_output, token_definitions_output): Output
16310 the full M4 block.
16311 * src/symtab.c: Don't access directly to the symbol tag, use
16312 symbol_tag_get.
16313 * src/parse-gram.y: Use symbol_list_free.
16314
16315 2002-06-17 Akim Demaille <akim@epita.fr>
16316
16317 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
16318 (symbol_list_prepend, get_type_name): Move to...
16319 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
16320 (symbol_list_prepend, symbol_list_n_type_name_get): here.
16321 Adjust all callers.
16322 (symbol_list_free): New.
16323 * src/scan-gram.l (handle_dollar): Takes a location.
16324 * tests/input.at (Invalid $n): Adjust.
16325
16326 2002-06-17 Akim Demaille <akim@epita.fr>
16327
16328 * src/reader.h, src/reader.c (symbol_list_new): Export it.
16329 (symbol_list_prepend): New.
16330 * src/parse-gram.y (%union): `list' is a new member.
16331 (symbols.1): New, replaces...
16332 (terms_to_prec.1, nterms_to_type.1): these.
16333 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
16334 Take a location as additional argument.
16335 Adjust all callers.
16336
16337 2002-06-15 Akim Demaille <akim@epita.fr>
16338
16339 * src/parse-gram.y: Move %token in the declaration section so that
16340 we don't depend upon CVS Bison.
16341
16342 2002-06-15 Akim Demaille <akim@epita.fr>
16343
16344 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
16345 * src/print.c (print_core): Use it.
16346
16347 2002-06-15 Akim Demaille <akim@epita.fr>
16348
16349 * src/conflicts.c (log_resolution): Accept the rule involved in
16350 the sr conflicts instead of the lookahead number that points to
16351 that rule.
16352 (flush_reduce): Accept the current lookahead vector as argument,
16353 instead of the index in LA.
16354 (resolve_sr_conflict): Accept the current number of lookahead
16355 bitset to consider for the STATE, instead of the index in LA.
16356 (set_conflicts): Adjust.
16357 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
16358
16359 2002-06-15 Akim Demaille <akim@epita.fr>
16360
16361 * src/state.h (state_t): Replace the `lookaheadsp' member, a
16362 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
16363 Adjust all dependencies.
16364 * src/lalr.c (initialize_lookaheads): Split into...
16365 (states_lookaheads_count, states_lookaheads_initialize): these.
16366 (lalr): Adjust.
16367
16368 2002-06-15 Akim Demaille <akim@epita.fr>
16369
16370 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
16371 out of...
16372 (grammar_rules_print): here.
16373 * src/reduce.c (reduce_output): Use it.
16374 * tests/reduce.at (Useless Rules, Reduced Automaton)
16375 (Underivable Rules): Adjust.
16376
16377 2002-06-15 Akim Demaille <akim@epita.fr>
16378
16379 Copy BYacc's nice way to report the grammar.
16380
16381 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
16382 New.
16383 Don't print the rules' location, it is confusing and useless.
16384 (rule_print): Use grammar_rhs_print.
16385 * src/print.c (print_grammar): Use grammar_rules_print.
16386
16387 2002-06-15 Akim Demaille <akim@epita.fr>
16388
16389 Complete and rationalize `useless thing' warnings.
16390
16391 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
16392 (symbol_tag_print): New.
16393 Use them everywhere in place of accessing directly the tag member.
16394 * src/gram.h, src/gram.c (rule_print): New.
16395 Use it where a rule used to be printed `by hand'.
16396 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
16397 (reduce_grammar_tables): Report the useless rules.
16398 (reduce_print): Useless things are a warning, not an error.
16399 Report it as such.
16400 * tests/reduce.at (Useless Nonterminals, Useless Rules):
16401 (Reduced Automaton, Underivable Rules): Adjust.
16402 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
16403 * tests/conflicts.at (Unresolved SR Conflicts)
16404 (Solved SR Conflicts): Adjust.
16405
16406 2002-06-15 Akim Demaille <akim@epita.fr>
16407
16408 Let symbols have a location.
16409
16410 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
16411 (getsym): Adjust.
16412 Adjust all callers.
16413 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
16414 Use location_t, not int.
16415 * src/symtab.c (symbol_check_defined): Take advantage of the
16416 location.
16417 * tests/regression.at (Invalid inputs): Adjust.
16418
16419 2002-06-15 Akim Demaille <akim@epita.fr>
16420
16421 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
16422 (input): Don't try to initialize yylloc here, do it in the
16423 scanner.
16424 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
16425 * src/gram.h (rule_t): Change line and action_line into location
16426 and action_location, of location_t type.
16427 Adjust all dependencies.
16428 * src/location.h, src/location.c (empty_location): New.
16429 * src/reader.h, src/reader.c (grammar_start_symbol_set)
16430 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
16431 (grammar_current_rule_symbol_append)
16432 (grammar_current_rule_action_append): Expect a location as argument.
16433 * src/reader.c (grammar_midrule_action): Adjust to attach an
16434 action's location as dummy symbol location.
16435 * src/symtab.h, src/symtab.c (startsymbol_location): New.
16436 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
16437 the line numbers.
16438
16439 2002-06-14 Akim Demaille <akim@epita.fr>
16440
16441 Grammar declarations may be found in the grammar section.
16442
16443 * src/parse-gram.y (rules_or_grammar_declaration): New.
16444 (declarations): Each declaration may end with a semicolon, not
16445 just...
16446 (grammar_declaration): `"%union"'.
16447 (grammar): Branch to rules_or_grammar_declaration.
16448
16449 2002-06-14 Akim Demaille <akim@epita.fr>
16450
16451 * src/main.c (main): Invoke scanner_free.
16452
16453 2002-06-14 Akim Demaille <akim@epita.fr>
16454
16455 * src/output.c (m4_invoke): Extracted from...
16456 (output_skeleton): here.
16457 Free tempfile.
16458
16459 2002-06-14 Akim Demaille <akim@epita.fr>
16460
16461 * src/parse-gram.y (directives, directive, gram)
16462 (grammar_directives, precedence_directives, precedence_directive):
16463 Rename as...
16464 (declarations, declaration, grammar, grammar_declaration)
16465 (precedence_declaration, precedence_declarator): these.
16466 (symbol_declaration): New.
16467
16468 2002-06-14 Akim Demaille <akim@epita.fr>
16469
16470 * src/files.c (action_obstack): Remove, unused.
16471 (output_obstack): Remove it, and all its dependencies, as it is no
16472 longer needed.
16473 * src/reader.c (epilogue_set): Build the epilogue in the
16474 muscle_obstack.
16475 * src/output.h, src/output.c (muscle_obstack): Move to...
16476 * src/muscle_tab.h, src/muscle_tab.h: here.
16477 (muscle_init): Initialize muscle_obstack.
16478 (muscle_free): New.
16479 * src/main.c (main): Call it.
16480
16481 2002-06-14 Akim Demaille <akim@epita.fr>
16482
16483 * src/location.h: New, extracted from...
16484 * src/reader.h: here.
16485 * src/Makefile.am (noinst_HEADERS): Merge into
16486 (bison_SOURCES): this.
16487 Add location.h.
16488 * src/parse-gram.y: Use location_t instead of Bison's.
16489 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
16490 Use location_t instead of ints.
16491
16492 2002-06-14 Akim Demaille <akim@epita.fr>
16493
16494 * data/bison.simple, data/bison.c++: Be sure to restore the
16495 current #line when returning to the skeleton contents after having
16496 exposed the input file's #line.
16497
16498 2002-06-12 Akim Demaille <akim@epita.fr>
16499
16500 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
16501 eager.
16502 * tests/actions.at (Exotic Dollars): New.
16503
16504 2002-06-12 Akim Demaille <akim@epita.fr>
16505
16506 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
16507 ['"/] too eagerly.
16508 * tests/input.at (Torturing the Scanner): New.
16509
16510 2002-06-11 Akim Demaille <akim@epita.fr>
16511
16512 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
16513 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
16514 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
16515 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
16516 * src/reader.c (reader): Use it.
16517
16518 2002-06-11 Akim Demaille <akim@epita.fr>
16519
16520 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
16521 Adjust all callers.
16522 (scanner_last_string_free): New.
16523
16524 2002-06-11 Akim Demaille <akim@epita.fr>
16525
16526 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
16527 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
16528 (last_string, YY_OBS_FREE): New.
16529 Use them when returning an ID.
16530
16531 2002-06-11 Akim Demaille <akim@epita.fr>
16532
16533 Have Bison grammars parsed by a Bison grammar.
16534
16535 * src/reader.c, src/reader.h (prologue_augment): New.
16536 * src/reader.c (copy_definition): Remove.
16537
16538 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
16539 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
16540 (grammar_current_rule_prec_set, grammar_current_rule_check)
16541 (grammar_current_rule_symbol_append)
16542 (grammar_current_rule_action_append): Export.
16543 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
16544 (symbol_list_action_append): Remove.
16545 Hook the routines from reader.
16546 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
16547 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
16548
16549 * src/reader.c (read_declarations): Remove, unused.
16550
16551 * src/parse-gram.y: Handle the epilogue.
16552 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
16553 (grammar_start_symbol_set): this.
16554 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
16555 * src/reader.c (readgram): Remove, unused.
16556 (reader): Adjust to insert eoftoken and axiom where appropriate.
16557
16558 * src/reader.c (copy_dollar): Replace with...
16559 * src/scan-gram.h (handle_dollar): this.
16560 * src/parse-gram.y: Remove `%thong'.
16561
16562 * src/reader.c (copy_at): Replace with...
16563 * src/scan-gram.h (handle_at): this.
16564
16565 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
16566 New.
16567
16568 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
16569 time being.
16570
16571 * src/reader.h, src/reader.c (grammar_rule_end): New.
16572
16573 * src/parse.y (current_type, current_class): New.
16574 Implement `%nterm', `%token' support.
16575 Merge `%term' into `%token'.
16576 (string_as_id): New.
16577 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
16578 type name.
16579
16580 * src/parse-gram.y: Be sure to handle properly the beginning of
16581 rules.
16582
16583 * src/parse-gram.y: Handle %type.
16584 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
16585
16586 * src/parse-gram.y: More directives support.
16587 * src/options.c: No longer handle source directives.
16588
16589 * src/parse-gram.y: Fix %output.
16590
16591 * src/parse-gram.y: Handle %union.
16592 Use the prologue locations.
16593 * src/reader.c (parse_union_decl): Remove.
16594
16595 * src/reader.h, src/reader.c (epilogue_set): New.
16596 * src/parse-gram.y: Use it.
16597
16598 * data/bison.simple, data/bison.c++: b4_stype is now either not
16599 defined, then default to int, or to the contents of %union,
16600 without `union' itself.
16601 Adjust.
16602 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
16603
16604 * src/output.c (actions_output): Don't output braces, as they are
16605 already handled by the scanner.
16606
16607 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
16608 characters to themselves.
16609
16610 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
16611 that the epilogue has a proper #line.
16612
16613 * src/parse-gram.y: Handle precedence/associativity.
16614
16615 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
16616 a terminal.
16617 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
16618 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
16619 at all to define terminals that cannot be emitted.
16620
16621 * src/scan-gram.l: Escape M4 characters.
16622
16623 * src/scan-gram.l: Working properly with escapes in user
16624 strings/characters.
16625
16626 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
16627 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
16628 grammar.
16629 Use more modest sizes, as for the time being the parser does not
16630 release memory, and therefore the process swallows a huge amount
16631 of memory.
16632
16633 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
16634 stricter %token grammar.
16635
16636 * src/symtab.h (associativity): Add `undef_assoc'.
16637 (symbol_precedence_set): Do nothing when passed an undef_assoc.
16638 * src/symtab.c (symbol_check_alias_consistence): Adjust.
16639
16640 * tests/regression.at (Invalid %directive): Remove, as it is now
16641 meaningless.
16642 (Invalid inputs): Adjust to the new error messages.
16643 (Token definitions): The new grammar doesn't allow too many
16644 eccentricities.
16645
16646 * src/lex.h, src/lex.c: Remove.
16647 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
16648 (copy_character, copy_string2, copy_string, copy_identifier)
16649 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
16650 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
16651 (parse_action): Remove.
16652 * po/POTFILES.in: Adjust.
16653
16654 2002-06-11 Akim Demaille <akim@epita.fr>
16655
16656 * src/reader.c (parse_action): Don't store directly into the
16657 rule's action member: return the action as a string.
16658 Don't require `rule_length' as an argument: compute it.
16659 (grammar_current_rule_symbol_append)
16660 (grammar_current_rule_action_append): New, eved out from
16661 (readgram): here.
16662 Remove `action_flag', `rulelength', unused now.
16663
16664 2002-06-11 Akim Demaille <akim@epita.fr>
16665
16666 * src/reader.c (grammar_current_rule_prec_set).
16667 (grammar_current_rule_check): New, eved out from...
16668 (readgram): here.
16669 Remove `xaction', `first_rhs': useless.
16670 * tests/input.at (Type clashes): New.
16671 * tests/existing.at (GNU Cim Grammar): Adjust.
16672
16673 2002-06-11 Akim Demaille <akim@epita.fr>
16674
16675 * src/reader.c (grammar_midrule_action): New, Eved out from
16676 (readgram): here.
16677
16678 2002-06-11 Akim Demaille <akim@epita.fr>
16679
16680 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
16681 New.
16682 (readgram): Use them as replacement of inlined code, crule and
16683 crule1.
16684
16685 2002-06-11 Akim Demaille <akim@epita.fr>
16686
16687 * src/reader.c (grammar_end, grammar_symbol_append): New.
16688 (readgram): Use them.
16689 Make the use of `p' as local as possible.
16690
16691 2002-06-10 Akim Demaille <akim@epita.fr>
16692
16693 GCJ's parser requires the tokens to be defined before the prologue.
16694
16695 * data/bison.simple: Output the token definition before the user's
16696 prologue.
16697 * tests/regression.at (Braces parsing, Duplicate string)
16698 (Mixing %token styles): Check the output from bison.
16699 (Early token definitions): New.
16700
16701 2002-06-10 Akim Demaille <akim@epita.fr>
16702
16703 * src/symtab.c (symbol_user_token_number_set): Don't complain when
16704 assigning twice the same user number to a token, so that we can
16705 use it in...
16706 * src/lex.c (lex): here.
16707 Also use `symbol_class_set' instead of hand written code.
16708 * src/reader.c (parse_assoc_decl): Likewise.
16709
16710 2002-06-10 Akim Demaille <akim@epita.fr>
16711
16712 * src/symtab.c, src/symtab.c (symbol_class_set)
16713 (symbol_user_token_number_set): New.
16714 * src/reader.c (parse_token_decl): Use them.
16715 Use a switch instead of ifs.
16716 Use a single argument.
16717
16718 2002-06-10 Akim Demaille <akim@epita.fr>
16719
16720 Remove `%thong' support as it is undocumented, unused, duplicates
16721 `%token's job, and creates useless e-mail traffic with people who
16722 want to know what it is, why it is undocumented, unused, and
16723 duplicates `%token's job.
16724
16725 * src/reader.c (parse_thong_decl): Remove.
16726 * src/options.c (option_table): Remove "thong".
16727 * src/lex.h (tok_thong): Remove.
16728
16729 2002-06-10 Akim Demaille <akim@epita.fr>
16730
16731 * src/symtab.c, src/symtab.c (symbol_type_set)
16732 (symbol_precedence_set): New.
16733 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
16734 (value_components_used): Remove, unused.
16735
16736 2002-06-09 Akim Demaille <akim@epita.fr>
16737
16738 Move symbols handling code out of the reader.
16739
16740 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
16741 (axiom): Move to...
16742 * src/symtab.h, src/symtab.c: here.
16743
16744 * src/gram.c (start_symbol): Remove: use startsymbol->number.
16745 * src/reader.c (startval): Rename as...
16746 * src/symtab.h, src/symtab.c (startsymbol): this.
16747 * src/reader.c: Adjust.
16748
16749 * src/reader.c (symbol_check_defined, symbol_make_alias)
16750 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16751 (token_translations_init)
16752 Move to...
16753 * src/symtab.c: here.
16754 * src/reader.c (packsymbols): Move to...
16755 * src/symtab.h, src/symtab.c (symbols_pack): here.
16756 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
16757 argument.
16758
16759 2002-06-03 Akim Demaille <akim@epita.fr>
16760
16761 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
16762 then statements.
16763
16764 2002-06-03 Akim Demaille <akim@epita.fr>
16765
16766 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
16767 structs with non literals.
16768 * src/scan-skel.l: never-interactive.
16769 * src/conflicts.c (enum conflict_resolution_e): No trailing
16770 comma.
16771 * src/getargs.c (usage): Split long literal strings.
16772 Reported by Hans Aberg.
16773
16774 2002-05-28 Akim Demaille <akim@epita.fr>
16775
16776 * data/bison.c++: Use C++ ostreams.
16777 (cdebug_): New member.
16778
16779 2002-05-28 Akim Demaille <akim@epita.fr>
16780
16781 * src/output.c (output_skeleton): Be sure to allocate enough room
16782 for `/' _and_ for `\0' in full_skeleton.
16783
16784 2002-05-28 Akim Demaille <akim@epita.fr>
16785
16786 * data/bison.c++: Catch up with bison.simple:
16787 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16788 and Paul Eggert <eggert@twinsun.com>: `error' handing.
16789 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
16790 and popping traces.
16791
16792 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16793
16794 * src/output.c (output_skeleton): Put an explicit path in front of
16795 the skeleton file name, rather than relying on the -I directory,
16796 to partially alleviate effects of having a skeleton file lying around
16797 in the current directory.
16798
16799 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16800
16801 * src/conflicts.c (log_resolution): Correct typo:
16802 obstack_printf should be obstack_fgrow1.
16803
16804 2002-05-26 Akim Demaille <akim@epita.fr>
16805
16806 * src/state.h (state_t): `solved_conflicts' is a new member.
16807 * src/LR0.c (new_state): Set it to 0.
16808 * src/conflicts.h, src/conflicts.c (print_conflicts)
16809 (free_conflicts, solve_conflicts): Rename as...
16810 (conflicts_print, conflicts_free, conflicts_solve): these.
16811 Adjust callers.
16812 * src/conflicts.c (enum conflict_resolution_e)
16813 (solved_conflicts_obstack): New, used by...
16814 (log_resolution): this.
16815 Adjust to attach the conflict resolution to each state.
16816 Complete the description with the precedence/associativity
16817 information.
16818 (resolve_sr_conflict): Adjust.
16819 * src/print.c (print_state): Output its solved_conflicts.
16820 * tests/conflicts.at (Unresolved SR Conflicts)
16821 (Solved SR Conflicts): Exercise --report=all.
16822
16823 2002-05-26 Akim Demaille <akim@epita.fr>
16824
16825 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
16826 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16827 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
16828 (token_number_t, item_number_as_token_number)
16829 (token_number_as_item_number, muscle_insert_token_number_table):
16830 Rename as...
16831 (symbol_number_t, item_number_as_symbol_number)
16832 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
16833 these, since it is more appropriate.
16834
16835 2002-05-26 Akim Demaille <akim@epita.fr>
16836
16837 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
16838 `Error:' lines.
16839 * data/bison.simple (yystos) [YYDEBUG]: New.
16840 (yyparse) [YYDEBUG]: Display the symbols which are popped during
16841 error recovery.
16842 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
16843
16844 2002-05-25 Akim Demaille <akim@epita.fr>
16845
16846 * doc/bison.texinfo (Debugging): Split into...
16847 (Tracing): this new section, its former contents, and...
16848 (Understanding): this new section.
16849 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
16850 by...
16851 (report_flag): this.
16852 Adjust all dependencies.
16853 (report_args, report_types, report_argmatch): New.
16854 (usage, getargs): Report/support -r, --report.
16855 * src/options.h
16856 (struct option_table_struct): Rename as..,
16857 (struct option_table_s): this.
16858 Rename the `set_flag' member to `flag' to match with getopt_long's
16859 struct.
16860 * src/options.c (option_table): Split verbose into an entry for
16861 %verbose, and another for --verbose.
16862 Support --report/-r, so remove -r from the obsolete --raw.
16863 * src/print.c: Attach full item sets and lookaheads reports to
16864 report_flag instead of trace_flag.
16865 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
16866
16867 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16868 and Paul Eggert <eggert@twinsun.com>
16869
16870 * data/bison.simple (yyparse): Correct error handling to conform to
16871 POSIX and yacc. Specifically, after syntax error is discovered,
16872 do not reduce further before shifting the error token.
16873 Clean up the code a bit by removing the labels yyerrdefault,
16874 yyerrhandle, yyerrpop.
16875 * NEWS: Document the above.
16876
16877 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16878
16879 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
16880 type; it isn't always big enough, since it doesn't necessarily
16881 include non-terminals.
16882 (yytranslate): Expand definition of yy_token_number_type, so that
16883 the latter can be removed.
16884 (yy_token_number_type): Remove, only one use.
16885 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
16886 don't use TokenNumberType as element type.
16887
16888 * tests/regression.at: Modify expected output to agree with change
16889 to yyr1 and yytranslate.
16890
16891 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
16892
16893 * src/reader.c (parse_action): Use copy_character instead of
16894 obstack_1grow.
16895
16896 2002-05-13 Akim Demaille <akim@epita.fr>
16897
16898 * tests/regression.at (Token definitions): Prototype yylex and
16899 yyerror.
16900
16901 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16902
16903 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
16904 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
16905 32-bit arithmetic.
16906 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
16907
16908 2002-05-07 Akim Demaille <akim@epita.fr>
16909
16910 * tests/synclines.at: Be sure to prototype yylex and yyerror to
16911 avoid GCC warnings.
16912
16913 2002-05-07 Akim Demaille <akim@epita.fr>
16914
16915 Kill GCC warnings.
16916
16917 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
16918 over the RHS of each rule.
16919 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
16920 * src/state.h (state_t): Member `nitems' is unsigned short.
16921 * src/LR0.c (get_state): Adjust.
16922 * src/reader.c (packgram): Likewise.
16923 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
16924 `Type'.
16925 (muscle_insert_int_table): Remove, unused.
16926 (prepare_rules): Remove `max'.
16927
16928 2002-05-06 Akim Demaille <akim@epita.fr>
16929
16930 * src/closure.c (print_firsts): Display of the symbol tags.
16931 (bitmatrix_print): Move to...
16932 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
16933 here.
16934 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
16935
16936 2002-05-06 Akim Demaille <akim@epita.fr>
16937
16938 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
16939 hash_do_for_each.
16940
16941 2002-05-06 Akim Demaille <akim@epita.fr>
16942
16943 * src/LR0.c (new_state, get_state): Instead of using the global
16944 `kernel_size' and `kernel_base', have two new arguments:
16945 `core_size' and `core'.
16946 Adjust callers.
16947
16948 2002-05-06 Akim Demaille <akim@epita.fr>
16949
16950 * src/reader.c (packgram): No longer end `ritem' with a 0
16951 sentinel: it is not used.
16952
16953 2002-05-05 Akim Demaille <akim@epita.fr>
16954
16955 New experimental feature: display the lookaheads in the report and
16956 graph.
16957
16958 * src/print (print_core): When --trace-flag, display the rules
16959 lookaheads.
16960 * src/print_graph.c (print_core): Likewise.
16961 Swap the arguments.
16962 Adjust caller.
16963
16964 2002-05-05 Akim Demaille <akim@epita.fr>
16965
16966 * tests/torture.at (Many lookaheads): New test.
16967
16968 2002-05-05 Akim Demaille <akim@epita.fr>
16969
16970 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
16971 (GENERATE_MUSCLE_INSERT_TABLE): this.
16972 (output_int_table, output_unsigned_int_table, output_short_table)
16973 (output_token_number_table, output_item_number_table): Replace with...
16974 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
16975 (muscle_insert_short_table, muscle_insert_token_number_table)
16976 (muscle_insert_item_number_table): these.
16977 Adjust all callers.
16978 (prepare_tokens): Don't free `translations', since...
16979 * src/reader.h, src/reader.c (grammar_free): do it.
16980 Move to...
16981 * src/gram.h, src/gram.c (grammar_free): here.
16982 * data/bison.simple, data/bison.c++: b4_token_number_max is now
16983 b4_translate_max.
16984
16985 2002-05-05 Akim Demaille <akim@epita.fr>
16986
16987 * src/output.c (output_unsigned_int_table): New.
16988 (prepare_rules): `i' is unsigned.
16989 `prhs', `rline', `r2' are unsigned int.
16990 Rename muscle `rhs_number_max' as `rhs_max'.
16991 Output muscles `prhs_max', `rline_max', and `r2_max'.
16992 Free rline and r1.
16993 * data/bison.simple, data/bison.c++: Adjust to use these muscles
16994 to compute types instead of constant types.
16995 * tests/regression.at (Web2c Actions): Adjust.
16996
16997 2002-05-04 Akim Demaille <akim@epita.fr>
16998
16999 * src/symtab.h (SALIAS, SUNDEF): Rename as...
17000 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
17001 Adjust dependencies.
17002 * src/output.c (token_definitions_output): Be sure not to output a
17003 `#define 'a'' when fed with `%token 'a' "a"'.
17004 * tests/regression.at (Token definitions): New.
17005
17006 2002-05-03 Paul Eggert <eggert@twinsun.com>
17007
17008 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
17009 for K&R C.
17010
17011 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
17012
17013 * Makefile.am (SUBDIRS): Remove intl.
17014 (EXTRA_DIST): Add config/config.rpath.
17015
17016 2002-05-03 Akim Demaille <akim@epita.fr>
17017
17018 * data/bison.simple (m4_if): Don't output empty enums.
17019 And actually, output valid enum definitions :(.
17020
17021 2002-05-03 Akim Demaille <akim@epita.fr>
17022
17023 * configure.bat: Remove, completely obsolete.
17024 * Makefile.am (EXTRA_DIST): Adjust.
17025 Don't distribute config.rpath...
17026 * config/Makefile.am (EXTRA_DIST): Do it.
17027
17028 2002-05-03 Akim Demaille <akim@epita.fr>
17029
17030 * configure.in (GETTEXT_VERSION): New.
17031 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
17032
17033 2002-05-03 Akim Demaille <akim@epita.fr>
17034
17035 * data/bison.simple (b4_token_enum): New.
17036 (b4_token_defines): Use it to output tokens both as #define and
17037 enums.
17038 Suggested by Paul Eggert.
17039 * src/output.c (token_definitions_output): Don't output spurious
17040 white spaces.
17041
17042 2002-05-03 Akim Demaille <akim@epita.fr>
17043
17044 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
17045
17046 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
17047
17048 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
17049 Update the stack class, give a try to deque as the default container.
17050
17051 2002-05-02 Akim Demaille <akim@epita.fr>
17052
17053 * data/bison.simple (yyparse): Do not implement @$ = @1.
17054 (YYLLOC_DEFAULT): Adjust to do it.
17055 * doc/bison.texinfo (Location Default Action): Fix.
17056
17057 2002-05-02 Akim Demaille <akim@epita.fr>
17058
17059 * src/reader.c (parse_braces): Merge into...
17060 (parse_action): this.
17061
17062 2002-05-02 Akim Demaille <akim@epita.fr>
17063
17064 * configure.in (ALL_LINGUAS): Remove.
17065 * po/LINGUAS, hr.po: New.
17066
17067 2002-05-02 Akim Demaille <akim@epita.fr>
17068
17069 Remove the so called hairy (semantic) parsers.
17070
17071 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
17072 * src/gram.h, src/gram.c (semantic_parser): Remove.
17073 (rule_t): Remove the guard and guard_line members.
17074 * src/lex.h (token_t): remove tok_guard.
17075 * src/options.c (option_table): Remove %guard and %semantic_parser
17076 support.
17077 * src/output.c, src/output.h (guards_output): Remove.
17078 (prepare): Adjust.
17079 (token_definitions_output): Don't output the `T'
17080 tokens (???).
17081 (output_skeleton): Don't output the guards.
17082 * src/files.c, src/files.c (attrsfile): Remove.
17083 * src/reader.c (symbol_list): Remove the guard and guard_line
17084 members.
17085 Adjust dependencies.
17086 (parse_guard): Remove.
17087 * data/bison.hairy: Remove.
17088 * doc/bison.texinfo (Environment Variables): Remove occurrences of
17089 BISON_HAIRY.
17090
17091 2002-05-02 Akim Demaille <akim@epita.fr>
17092
17093 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
17094 (parse_guard): Rename the formal argument `stack_offset' as
17095 `rule_length', which is more readable.
17096 Adjust callers.
17097 (copy_at, copy_dollar): Instead of outputting the hard coded
17098 values of $$, $n and so forth, output invocation to b4_lhs_value,
17099 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
17100 Note: this patch partially drops `semantic-parser' support: it
17101 always does `rule_length - n', where semantic parsers ought to
17102 always use `-n'.
17103 * data/bison.simple, data/bison.c++ (b4_lhs_value)
17104 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
17105
17106 2002-05-02 Akim Demaille <akim@epita.fr>
17107
17108 * configure.in (AC_INIT): Bump to 1.49b.
17109 (AM_INIT_AUTOMAKE): Short invocation.
17110
17111 2002-05-02 Akim Demaille <akim@epita.fr>
17112
17113 Version 1.49a.
17114
17115 2002-05-01 Akim Demaille <akim@epita.fr>
17116
17117 * src/skeleton.h: Remove.
17118
17119 2002-05-01 Akim Demaille <akim@epita.fr>
17120
17121 * src/skeleton.h: Fix the #endif.
17122 Reported by Magnus Fromreide.
17123
17124 2002-04-26 Paul Eggert <eggert@twinsun.com>
17125
17126 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
17127 Define if we define YYSTYPE and YYLTYPE, respectively.
17128 (YYCOPY): Fix [] quoting problem in the non-GCC case.
17129
17130 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
17131
17132 * src/scan-skel.l: Postprocess quadrigraphs.
17133
17134 * src/reader.c (copy_character): New function, used to output
17135 single characters while replacing `[' and `]' with quadrigraphs, to
17136 avoid troubles with M4 quotes.
17137 (copy_comment): Output characters with copy_character.
17138 (read_additionnal_code): Likewise.
17139 (copy_string2): Likewise.
17140 (copy_definition): Likewise.
17141
17142 * tests/calc.at: Exercise M4 quoting.
17143
17144 2002-04-25 Akim Demaille <akim@epita.fr>
17145
17146 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
17147 between `!' and the command.
17148 Reported by Paul Eggert.
17149
17150 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
17151
17152 * tests/calc.at: Exercise prologue splitting.
17153
17154 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
17155 `b4_post_prologue' instead of `b4_prologue'.
17156
17157 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
17158 muscles.
17159 (output): Free pre_prologue_obstack and post_prologue_obstack.
17160 * src/files.h, src/files.c (attrs_obstack): Remove.
17161 (pre_prologue_obstack, post_prologue_obstack): New.
17162 * src/reader.c (copy_definition): Add a parameter to specify the
17163 obstack to fill, instead of using attrs_obstack unconditionally.
17164 (read_declarations): Pass pre_prologue_obstack to copy_definition if
17165 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
17166
17167 2002-04-23 Paul Eggert <eggert@twinsun.com>
17168
17169 * data/bison.simple: Remove unnecessary commentary and white
17170 space differences from 1_29-branch.
17171 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
17172
17173 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
17174 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
17175 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
17176 constructors or destructors.
17177
17178 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
17179
17180 2002-04-23 Akim Demaille <akim@epita.fr>
17181
17182 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
17183 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
17184 location with columns.
17185 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
17186 All reported by Paul Eggert.
17187
17188 2002-04-22 Akim Demaille <akim@epita.fr>
17189
17190 * src/reduce.c (dump_grammar): Move to...
17191 * src/gram.h, src/gram.c (grammar_dump): here.
17192 Be sure to separate long item numbers.
17193 Don't read the members of a rule's prec if its nil.
17194
17195 2002-04-22 Akim Demaille <akim@epita.fr>
17196
17197 * src/output.c (table_size, table_grow): New.
17198 (MAXTABLE): Remove, replace uses with table_size.
17199 (pack_vector): Instead of dying when the table is too big, grow it.
17200
17201 2002-04-22 Akim Demaille <akim@epita.fr>
17202
17203 * data/bison.simple (yyr1): Its type is that of a token number.
17204 * data/bison.c++ (r1_): Likewise.
17205 * tests/regression.at (Web2c Actions): Adjust.
17206
17207 2002-04-22 Akim Demaille <akim@epita.fr>
17208
17209 * src/reader.c (token_translations_init): 256 is now the default
17210 value for the error token, i.e., it will be assigned another
17211 number if the user assigned 256 to one of her tokens.
17212 (reader): Don't force 256 to error.
17213 * doc/bison.texinfo (Symbols): Adjust.
17214 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
17215 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
17216 etc. instead of 10, 20, 30 (which was used to `jump' over error
17217 (256) and undefined (2)).
17218
17219 2002-04-22 Akim Demaille <akim@epita.fr>
17220
17221 Propagate more token_number_t.
17222
17223 * src/gram.h (token_number_as_item_number)
17224 (item_number_as_token_number): New.
17225 * src/output.c (GENERATE_OUTPUT_TABLE): New.
17226 Use it to create output_item_number_table and
17227 output_token_number_table.
17228 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17229 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
17230 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
17231 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
17232
17233 2002-04-22 Akim Demaille <akim@epita.fr>
17234
17235 * src/output.h, src/output.c (get_lines_number): Remove.
17236
17237 2002-04-19 Akim Demaille <akim@epita.fr>
17238
17239 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
17240 as Lex/Flex'.
17241 (Debugging): More details about enabling the debugging features.
17242 (Table of Symbols): Describe $$, $n, @$, and @n.
17243 Suggested by Tim Josling.
17244
17245 2002-04-19 Akim Demaille <akim@epita.fr>
17246
17247 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
17248
17249 2002-04-10 Akim Demaille <akim@epita.fr>
17250
17251 * src/system.h: Rely on HAVE_LIMITS_H.
17252 Suggested by Paul Eggert.
17253
17254 2002-04-09 Akim Demaille <akim@epita.fr>
17255
17256 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
17257 full stderr, and strip it according to the bison options, instead
17258 of composing the error message from different bits.
17259 This makes it easier to check for several error messages.
17260 Adjust all the invocations.
17261 Add an invocation exercising the error token.
17262 Add an invocation demonstrating a stupid error message.
17263 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
17264 Adjust the tests.
17265 Error message are for stderr, not stdout.
17266
17267 2002-04-09 Akim Demaille <akim@epita.fr>
17268
17269 * src/gram.h, src/gram.c (error_token_number): Remove, use
17270 errtoken->number.
17271 * src/reader.c (reader): Don't specify the user token number (2)
17272 for $undefined, as it uselessly prevents using it.
17273 * src/gram.h (token_number_t): Move to...
17274 * src/symtab.h: here.
17275 (state_t.number): Is a token_number_t.
17276 * src/print.c, src/reader.c: Use undeftoken->number instead of
17277 hard coded 2.
17278 (Even though this 2 is not the same as above: the number of the
17279 undeftoken remains being 2, it is its user token number which
17280 might not be 2).
17281 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
17282 `user_token_number_max'.
17283 Output `undef_token_number'.
17284 * data/bison.simple, data/bison.c++: Use them.
17285 Be sure to map invalid yylex return values to
17286 `undef_token_number'. This saves us from gratuitous SEGV.
17287
17288 * tests/conflicts.at (Solved SR Conflicts)
17289 (Unresolved SR Conflicts): Adjust.
17290 * tests/regression.at (Web2c Actions): Adjust.
17291
17292 2002-04-08 Akim Demaille <akim@epita.fr>
17293
17294 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
17295 Adding #line.
17296 Remove the duplicate `typedefs'.
17297 (RhsNumberType): Fix the declaration and various other typos.
17298 Use __ofile__.
17299 * data/bison.simple: Use __ofile__.
17300 * src/scan-skel.l: Handle __ofile__.
17301
17302 2002-04-08 Akim Demaille <akim@epita.fr>
17303
17304 * src/gram.h (item_number_t): New, the type of item numbers in
17305 RITEM. Note that it must be able to code symbol numbers as
17306 positive number, and the negation of rule numbers as negative
17307 numbers.
17308 Adjust all dependencies (pretty many).
17309 * src/reduce.c (rule): Remove this `short *' pointer: use
17310 item_number_t.
17311 * src/system.h (MINSHORT, MAXSHORT): Remove.
17312 Include `limits.h'.
17313 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
17314 (shortcpy): Remove.
17315 (MAXTABLE): Move to...
17316 * src/output.c (MAXTABLE): here.
17317 (prepare_rules): Use output_int_table to output rhs.
17318 * data/bison.simple, data/bison.c++: Adjust.
17319 * tests/torture.at (Big triangle): Move the limit from 254 to
17320 500.
17321 * tests/regression.at (Web2c Actions): Ajust.
17322
17323 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
17324 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
17325 passes, but produces negative #line number, once fixed, GCC is
17326 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
17327 C), it passes.
17328 * src/state.h (state_h): Code input lines on ints, not shorts.
17329
17330 2002-04-08 Akim Demaille <akim@epita.fr>
17331
17332 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
17333 and then the grammar.
17334
17335 2002-04-08 Akim Demaille <akim@epita.fr>
17336
17337 * src/system.h: No longer using strndup.
17338
17339 2002-04-07 Akim Demaille <akim@epita.fr>
17340
17341 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
17342 * src/output.c (output_table_data): Return the longest number.
17343 (prepare_tokens): Output `token_number_max').
17344 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
17345 New.
17346 Use them to define yy_token_number_type/TokenNumberType.
17347 Use this type for yytranslate.
17348 * tests/torture.at (Big triangle): Push the limit from 124 to
17349 253.
17350 * tests/regression.at (Web2c Actions): Adjust.
17351
17352 2002-04-07 Akim Demaille <akim@epita.fr>
17353
17354 * tests/torture.at (Big triangle): New.
17355 (GNU AWK Grammar, GNU Cim Grammar): Move to...
17356 * tests/existing.at: here.
17357
17358 2002-04-07 Akim Demaille <akim@epita.fr>
17359
17360 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
17361 nritems.
17362 Adjust dependencies.
17363
17364 2002-04-07 Akim Demaille <akim@epita.fr>
17365
17366 * src/reader.c: Normalize increments to prefix form.
17367
17368 2002-04-07 Akim Demaille <akim@epita.fr>
17369
17370 * src/reader.c, symtab.c: Remove debugging code.
17371
17372 2002-04-07 Akim Demaille <akim@epita.fr>
17373
17374 Rename all the `bucket's as `symbol_t'.
17375
17376 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
17377 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
17378 * src/symtab.c, src/symtab.h (bucket): Rename as...
17379 (symbol_t): this.
17380 (symbol_list_new, bucket_check_defined, bucket_make_alias)
17381 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
17382 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
17383 (buckets_new, buckets_free, buckets_do): Rename as...
17384 (symbol_list_new, symbol_check_defined, symbol_make_alias)
17385 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17386 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
17387 (symbols_new, symbols_free, symbols_do): these.
17388
17389 2002-04-07 Akim Demaille <akim@epita.fr>
17390
17391 Use lib/hash for the symbol table.
17392
17393 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
17394 EOF.
17395 * src/lex.c (lex): Set the `number' member of new terminals.
17396 * src/reader.c (bucket_check_defined, bucket_make_alias)
17397 (bucket_check_alias_consistence, bucket_translation): New.
17398 (reader, grammar_free, readgram, token_translations_init)
17399 (packsymbols): Adjust.
17400 (reader): Number the predefined tokens.
17401 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
17402 for predefined tokens.
17403 * src/symtab.h (bucket): Remove all the hash table related
17404 members.
17405 * src/symtab.c (symtab): Replace by...
17406 (bucket_table): this.
17407 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
17408 (buckets_new, buckets_do): New.
17409
17410 2002-04-07 Akim Demaille <akim@epita.fr>
17411
17412 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
17413 (start_symbol, max_user_token_number, semantic_parser)
17414 (error_token_number): Initialize.
17415 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
17416 Initialize.
17417 (reader): Don't.
17418 (errtoken, eoftoken, undeftoken, axiom): Extern.
17419
17420 2002-04-07 Akim Demaille <akim@epita.fr>
17421
17422 * src/gram.h (rule_s): prec and precsym are now pointers
17423 to the bucket giving the priority/associativity.
17424 Member `associativity' removed: useless.
17425 * src/reduce.c, src/conflicts.c: Adjust.
17426
17427 2002-04-07 Akim Demaille <akim@epita.fr>
17428
17429 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
17430 Properly escape the symbols' TAG when outputting them.
17431
17432 2002-04-07 Akim Demaille <akim@epita.fr>
17433
17434 * src/lalr.h (LA): Is a bitsetv, not bitset*.
17435
17436 2002-04-07 Akim Demaille <akim@epita.fr>
17437
17438 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
17439 (LArule): this, which is an array to rule_t*.
17440 * src/print.c, src/conflicts.c: Adjust.
17441
17442 2002-04-07 Akim Demaille <akim@epita.fr>
17443
17444 * src/gram.h (rule_t): Rename `number' as `user_number'.
17445 `number' is a new member.
17446 Adjust dependencies.
17447 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
17448
17449 2002-04-07 Akim Demaille <akim@epita.fr>
17450
17451 As a result of the previous patch, it is no longer needed
17452 to reorder ritem itself.
17453
17454 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
17455
17456 2002-04-07 Akim Demaille <akim@epita.fr>
17457
17458 Be sure never to walk through RITEMS, but use only data related to
17459 the rules themselves. RITEMS should be banished.
17460
17461 * src/output.c (output_token_translations): Rename as...
17462 (prepare_tokens): this.
17463 In addition to `translate', prepare the muscles `tname' and
17464 `toknum', which were handled by...
17465 (output_rule_data): this.
17466 Remove, and move the remainder of its outputs into...
17467 (prepare_rules): this new routines, which also merges content from
17468 (output_gram): this.
17469 (prepare_rules): Be sure never to walk through RITEMS.
17470 (output_stos): Rename as...
17471 (prepare_stos): this.
17472 (output): Always invoke prepare_states, after all, just don't use it
17473 in the output if you don't need it.
17474
17475 2002-04-07 Akim Demaille <akim@epita.fr>
17476
17477 * src/LR0.c (new_state): Display `nstates' as the name of the
17478 newly created state.
17479 Adjust to initialize first_state and last_state if needed.
17480 Be sure to distinguish the initial from the final state.
17481 (new_states): Create the itemset of the initial state, and use
17482 new_state.
17483 * src/closure.c (closure): Now that the initial state has its
17484 items properly set, there is no need for a special case when
17485 creating `ruleset'.
17486
17487 As a result, now the rule 0, reducing to $axiom, is visible in the
17488 outputs. Adjust the test suite.
17489
17490 * tests/conflicts.at (Solved SR Conflicts)
17491 (Unresolved SR Conflicts): Adjust.
17492 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
17493 * tests/conflicts.at (S/R in initial): New.
17494
17495 2002-04-07 Akim Demaille <akim@epita.fr>
17496
17497 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
17498 the RHS of the rules.
17499 * src/output.c (output_gram): Likewise.
17500
17501 2002-04-07 Akim Demaille <akim@epita.fr>
17502
17503 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
17504 bucket.
17505 Adjust all dependencies.
17506 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
17507 `number' of the buckets too.
17508 * src/gram.h: Include `symtab.h'.
17509 (associativity): Move to...
17510 * src/symtab.h: here.
17511 No longer include `gram.h'.
17512
17513 2002-04-07 Akim Demaille <akim@epita.fr>
17514
17515 * src/gram.h, src/gram.c (rules_rhs_length): New.
17516 (ritem_longest_rhs): Use it.
17517 * src/gram.h (rule_t): `number' is a new member.
17518 * src/reader.c (packgram): Set it.
17519 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
17520 the end of `rules', and count them out of `nrules'.
17521 (reduce_output, dump_grammar): Adjust.
17522 * src/print.c (print_grammar): It is no longer needed to check for
17523 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
17524 * tests/reduce.at (Reduced Automaton): New test.
17525
17526 2002-04-07 Akim Demaille <akim@epita.fr>
17527
17528 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
17529 lacking `+ 1' to nrules, Bison reported as useless a token if it
17530 was used solely to set the precedence of the last rule...
17531
17532 2002-04-07 Akim Demaille <akim@epita.fr>
17533
17534 * data/bison.c++, data/bison.simple: Don't output the current file
17535 name in #line, to avoid useless diffs between two identical
17536 outputs under different names.
17537
17538 2002-04-07 Akim Demaille <akim@epita.fr>
17539
17540 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
17541 Normalize loops to using `< nrules + 1', not `<= nrules'.
17542
17543 2002-04-07 Akim Demaille <akim@epita.fr>
17544
17545 * TODO: Update.
17546
17547 2002-04-07 Akim Demaille <akim@epita.fr>
17548
17549 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
17550 bucket.value as bucket.number.
17551
17552 2002-04-07 Akim Demaille <akim@epita.fr>
17553
17554 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
17555 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
17556 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
17557 RHS, instead of being an index in RITEMS.
17558
17559 2002-04-04 Paul Eggert <eggert@twinsun.com>
17560
17561 * doc/bison.texinfo: Update copyright date.
17562 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
17563 (Symbols): Warn about running Bison in one character set,
17564 but compiling and/or running in an incompatible one.
17565 Warn about character code 256, too.
17566
17567 2002-04-03 Paul Eggert <eggert@twinsun.com>
17568
17569 * src/bison.data (YYSTACK_ALLOC): Depend on whether
17570 YYERROR_VERBOSE is nonzero, not whether it is defined.
17571
17572 Merge changes from bison-1_29-branch.
17573
17574 2002-03-20 Paul Eggert <eggert@twinsun.com>
17575
17576 Merge fixes from Debian bison_1.34-1.diff.
17577
17578 * configure.in (AC_PREREQ): 2.53.
17579
17580 2002-03-20 Akim Demaille <akim@epita.fr>
17581
17582 * src/conflicts.c (log_resolution): Argument `resolution' is const.
17583
17584 2002-03-19 Paul Eggert <eggert@twinsun.com>
17585
17586 * src/bison.simple (YYCOPY): New macro.
17587 (YYSTACK_RELOCATE): Use it.
17588 Remove Type arg; no longer needed. All callers changed.
17589 (yymemcpy): Remove; no longer needed.
17590
17591 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
17592 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
17593
17594 2002-03-19 Akim Demaille <akim@epita.fr>
17595
17596 Test and fix the #line outputs.
17597
17598 * tests/atlocal.at (GCC): New.
17599 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
17600 (Prologue synch line, %union synch line, Postprologue synch line)
17601 (Action synch line, Epilogue synch line): New tests.
17602 * src/reader.c (parse_union_decl): Define the muscle stype_line.
17603 * data/bison.simple, data/bison.c++: Use it.
17604
17605 2002-03-19 Akim Demaille <akim@epita.fr>
17606
17607 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
17608 (Solved SR Conflicts, %expect not enough, %expect right)
17609 (%expect too much): Move to...
17610 * tests/conflicts.at: this new file.
17611
17612 2002-03-19 Akim Demaille <akim@epita.fr>
17613
17614 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
17615 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
17616 that we can move to enums for instance.
17617 * src/output.c (token_definitions_output): Output a list of
17618 `token-name, token-number' instead of the #define.
17619 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
17620
17621 2002-03-14 Akim Demaille <akim@epita.fr>
17622
17623 Use Gettext 0.11.1.
17624
17625 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
17626
17627 * data/bison.c++: Make the user able to add members to the generated
17628 parser by subclassing.
17629
17630 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
17631
17632 * src/reader.c (read_additionnal_code): `c' should be an integer, not
17633 a character.
17634 Reported by Nicolas Tisserand and Nicolas Burrus.
17635
17636 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
17637
17638 * src/reader.c: Warn about lacking semi-colons, do not complain.
17639
17640 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
17641
17642 * data/bison.c++: Remove a debug line.
17643
17644 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
17645
17646 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
17647 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
17648 provide a default implementation.
17649
17650 2002-03-04 Akim Demaille <akim@epita.fr>
17651
17652 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
17653 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
17654 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
17655 * tests/semantic.at (Parsing Guards): Similarly.
17656 * src/reader.at (readgram): Complain if the last rule is not ended
17657 with a semi-colon.
17658
17659 2002-03-04 Akim Demaille <akim@epita.fr>
17660
17661 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
17662 * src/closure.c: here.
17663 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
17664 RTC.
17665 * src/warshall.h, src/warshall.c: Remove.
17666 * tests/sets.at (Broken Closure): Adjust.
17667
17668 2002-03-04 Akim Demaille <akim@epita.fr>
17669
17670 * src/output.c (output_skeleton): tempdir is const.
17671 bytes_read is unused.
17672
17673 2002-03-04 Akim Demaille <akim@epita.fr>
17674
17675 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
17676 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
17677 Update.
17678 From Michael Hayes.
17679
17680 2002-03-04 Akim Demaille <akim@epita.fr>
17681
17682 * src/closure.c (closure): `r' is unused.
17683
17684 2002-03-04 Akim Demaille <akim@epita.fr>
17685
17686 * tests/sets.at (Broken Closure): Add the ending `;'.
17687 * src/reader.at (readgram): Complain if a rule is not ended with a
17688 semi-colon.
17689
17690 2002-03-04 Akim Demaille <akim@epita.fr>
17691
17692 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
17693 (count_sr_conflicts): Use bitset_count.
17694 * src/reduce.c (inaccessable_symbols): Ditto.
17695 (bits_size): Remove.
17696 * src/warshall.h, src/warshall.c: Convert to bitsetv.
17697
17698 2002-03-04 Akim Demaille <akim@epita.fr>
17699
17700 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
17701 * src/reduce.c: Remove the `bitset_zero's following the
17702 `bitset_create's, as now it is performed by the latter.
17703
17704 2002-03-04 Akim Demaille <akim@epita.fr>
17705
17706 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
17707 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
17708 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
17709 latest sources from Michael.
17710
17711 2002-03-04 Akim Demaille <akim@epita.fr>
17712
17713 * src/output.c (output): Don't free the grammar.
17714 * src/reader.c (grammar_free): New.
17715 * src/main.c (main): Call it and don't free symtab here.
17716
17717 2002-03-04 Akim Demaille <akim@epita.fr>
17718
17719 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
17720 before returning.
17721 Reported by Benoit Perrot.
17722
17723 2002-03-04 Akim Demaille <akim@epita.fr>
17724
17725 Use bitset operations when possible, not loops over bits.
17726
17727 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
17728 bitset_or.
17729 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
17730 * src/reduce.c (useless_nonterminals): Formatting changes.
17731 * src/warshall.c (TC): Use bitset_or.
17732
17733 2002-03-04 Akim Demaille <akim@epita.fr>
17734
17735 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
17736 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
17737 Ditto.
17738
17739 2002-03-04 Akim Demaille <akim@epita.fr>
17740
17741 * src/lalr.c (F): Now a bitset*.
17742 Adjust all dependencies.
17743
17744 2002-03-04 Akim Demaille <akim@epita.fr>
17745
17746 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
17747 Adjust all dependencies.
17748
17749 2002-03-04 Akim Demaille <akim@epita.fr>
17750
17751 * src/L0.c, src/LR0.h (nstates): Be size_t.
17752 Adjust comparisons (signed vs unsigned).
17753 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
17754 bitset*.
17755 Adjust all dependencies.
17756
17757 2002-03-04 Akim Demaille <akim@epita.fr>
17758
17759 * src/closure.c (firsts): Now, also a bitset.
17760 Adjust all dependencies.
17761 (varsetsize): Remove, now unused.
17762 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
17763
17764 2002-03-04 Akim Demaille <akim@epita.fr>
17765
17766 * src/print.c: Convert to use bitset.h, not hand coded iterations
17767 over ints.
17768
17769 2002-03-04 Akim Demaille <akim@epita.fr>
17770
17771 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
17772
17773 2002-03-04 Akim Demaille <akim@epita.fr>
17774
17775 * src/closure.c (ruleset): Be a bitset.
17776 (rulesetsize): Remove.
17777
17778 2002-03-04 Akim Demaille <akim@epita.fr>
17779
17780 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
17781 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
17782 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
17783 * src/closure.c (fderives): Be an array of bitsets.
17784
17785 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
17786
17787 * data/bison.c++: Merge the two generated headers. Insert a copyright
17788 notice in each output file.
17789
17790 2002-02-28 Akim Demaille <akim@epita.fr>
17791
17792 * data/bison.c++: Copy the prologue of bison.simple to fetch
17793 useful M4 definitions, such as b4_header_guard.
17794
17795 2002-02-25 Akim Demaille <akim@epita.fr>
17796
17797 * src/getargs.c (version): Give the name of the authors, and use a
17798 translator friendly scheme for the bgr
17799 copyright notice.
17800
17801 2002-02-25 Akim Demaille <akim@epita.fr>
17802
17803 * src/output.c (header_output): Remove, now handled completely via
17804 M4.
17805
17806 2002-02-25 Akim Demaille <akim@epita.fr>
17807
17808 * m4/m4.m4: New, from CVS Autoconf.
17809 * configure.in: Invoke it.
17810 * src/output.c (output_skeleton): Use its result instead of the
17811 hard coded name.
17812
17813 2002-02-25 Akim Demaille <akim@epita.fr>
17814
17815 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
17816 Fileutils 4.1.5.
17817 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
17818 * src/output.c (output_skeleton): Use mkstemp to create a real
17819 temporary file.
17820 Move the filling of `skeleton' and its muscle to...
17821 (prepare): here.
17822 (output): Move the definition of the prologue muscle to...
17823 (prepare): here.
17824 * src/system.h (DEFAULT_TMPDIR): New.
17825
17826 2002-02-14 Paul Eggert <eggert@twinsun.com>
17827
17828 Remove the support for C++ namespace cleanliness; it was
17829 causing more problems than it was curing, since it didn't work
17830 properly on some nonstandard C++ compilers. This can wait
17831 for a proper C++ parser.
17832
17833 * NEWS: Document this.
17834 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
17835 of C++, as it's treated like C now.
17836 * src/bison.simple (YYSTD): Remove.
17837 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
17838 Treat C++ just like Standard C instead of trying to support
17839 namespace cleanliness.
17840
17841 2002-02-14 Akim Demaille <akim@epita.fr>
17842
17843 * tests/regression.at (else): Adjust to Andreas' change.
17844
17845 2002-02-14 Akim Demaille <akim@epita.fr>
17846
17847 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
17848
17849 2002-02-13 Andreas Schwab <schwab@suse.de>
17850
17851 * src/output.c (output_rule_data): Don't output NULL, it might
17852 not be defined yet.
17853
17854 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
17855
17856 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
17857 (Copyright notice): Update.
17858
17859 2002-02-11 Akim Demaille <akim@epita.fr>
17860
17861 * tests/regression.at (%nonassoc and eof): Don't include
17862 nonportable headers.
17863
17864 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
17865
17866 * data/bison.c++: Correct error recovery. Make the user able to
17867 initialize the starting location.
17868
17869 2002-02-07 Akim Demaille <akim@epita.fr>
17870
17871 * tests/input.at: New.
17872
17873 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17874
17875 * data/bison.c++: Replace some direct m4 expansions by constants. Be
17876 more consistent when naming methods and variables. Put preprocessor
17877 directives around tables only needed for debugging.
17878
17879 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17880
17881 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
17882 C++ parsers.
17883 (yy::b4_name::parse): Use print_.
17884
17885 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17886
17887 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
17888
17889 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17890
17891 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
17892 C++ parsers.
17893 (yy::b4_name::parse): Build verbose error messages, and use error_.
17894
17895 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
17896
17897 * data/bison.c++: Fix m4 quoting in comments.
17898
17899 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
17900
17901 * data/bison.c++: Adjust the parser code. Fix some muscles that were
17902 not expanded by m4.
17903
17904 2002-02-05 Akim Demaille <akim@epita.fr>
17905
17906 * data/bison.c++: Adjust to the M4 back end.
17907 More is certainly needed.
17908
17909 2002-02-05 Akim Demaille <akim@epita.fr>
17910
17911 Give a try to M4 as a back end.
17912
17913 * lib/readpipe.c: New, from wdiff.
17914 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
17915 BISON_HAIRY.
17916 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
17917 specific values. Now it is m4 that performs the lookup.
17918 * src/parse-skel.y: Remove.
17919 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
17920 * src/output.c (actions_output, guards_output)
17921 (token_definitions_output): No longer keeps track of the output
17922 line number, hence remove the second argument.
17923 (guards_output): Check against the guard member of a rule, not the
17924 action member.
17925 Adjust callers.
17926 (output_skeleton): Don't look for the skeleton location, let m4 do
17927 that.
17928 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
17929 file will be used.
17930 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
17931 (prepare): Given that for the time being changesyntax is not
17932 usable in M4, rename the muscles using `-' to `_'.
17933 Define `defines_flag', `output_parser_name' and `output_header_name'.
17934 * src/output.h (actions_output, guards_output)
17935 (token_definitions_output): Adjust prototypes.
17936 * src/scan-skel.l: Instead of scanning the skeletons, it now
17937 processes the output of m4: `__oline__' and `#output'.
17938 * data/bison.simple: Adjust to be used by M4(sugar).
17939 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
17940 to date.
17941 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
17942 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
17943 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
17944 shamelessly stolen from CVS Autoconf.
17945
17946 2002-02-05 Akim Demaille <akim@epita.fr>
17947
17948 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
17949 * configure.in: Check for the declarations of free and malloc.
17950 * src/muscle_tab.c: Adjust.
17951
17952 2002-02-05 Akim Demaille <akim@epita.fr>
17953
17954 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
17955 which have no values.
17956
17957 2002-02-05 Akim Demaille <akim@epita.fr>
17958
17959 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
17960 * data/: here.
17961
17962 2002-01-29 Paul Eggert <eggert@twinsun.com>
17963
17964 * src/bison.simple (YYSIZE_T): Do not define merely because
17965 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
17966 On some platforms, <alloca.h> does not declare YYSTD (size_t).
17967
17968 2002-01-27 Akim Demaille <akim@epita.fr>
17969
17970 Fix `%nonassoc and eof'.
17971
17972 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
17973 which were not properly copied! Replace
17974 memcpy (res->errs, src->errs, src->nerrs);
17975 with
17976 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
17977 !!!
17978 * tests/regression.at (%nonassoc and eof): Adjust to newest
17979 Autotest: `.' is not in the PATH.
17980
17981 2002-01-27 Akim Demaille <akim@epita.fr>
17982
17983 * tests/sets.at (AT_EXTRACT_SETS): New.
17984 (Nullable): Use it.
17985 (Firsts): New.
17986
17987 2002-01-26 Akim Demaille <akim@epita.fr>
17988
17989 * tests/actions.at, tests/calc.at, tests/headers.at,
17990 * tests/torture.at: Adjust to the newest Autotest which no longer
17991 forces `.' in the PATH.
17992
17993 2002-01-25 Akim Demaille <akim@epita.fr>
17994
17995 * tests/regression.at (%nonassoc and eof): New.
17996 Suggested by Robert Anisko.
17997
17998 2002-01-24 Akim Demaille <akim@epita.fr>
17999
18000 Bison dumps core when trying to complain about broken input files.
18001 Reported by Cris van Pelt.
18002
18003 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
18004 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
18005 into...
18006 (Invalid inputs): Strengthen: exercise parse_percent_token.
18007
18008 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
18009
18010 * src/Makefile.am: Add bison.c++.
18011 * src/bison.c++: New skeleton.
18012
18013 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
18014
18015 * po/it.po: New.
18016
18017 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
18018
18019 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
18020
18021 2002-01-20 Marc Autret <marc@gnu.org>
18022
18023 * src/files.c (compute_output_file_names): Fix
18024
18025 2002-01-20 Marc Autret <marc@gnu.org>
18026
18027 * tests/output.at: New test.
18028 * src/files.c (compute_base_names): Don't map extensions when
18029 the YACC flag is set, use defaults.
18030 Reported by Evgeny Stambulchik.
18031
18032 2002-01-20 Marc Autret <marc@gnu.org>
18033
18034 * src/system.h: Need to define __attribute__ away for non-GCC
18035 compilers as well (i.e., the vendor C compiler).
18036 Suggested by Albert Chin-A-Young.
18037
18038 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
18039
18040 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
18041 canonical definition.
18042 * src/system.h: Use the canonical definition for PARAMS (avoids
18043 a conflict with the macro from lib/hash.h).
18044
18045 2002-01-11 Akim Demaille <akim@epita.fr>
18046
18047 * configure.in: Use AC_FUNC_STRNLEN.
18048 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
18049
18050 2002-01-09 Akim Demaille <akim@epita.fr>
18051
18052 * src/files.c, src/files.h (output_infix): New.
18053 (tab_extension): Remove.
18054 (compute_base_names): Compute the former, drop the latter.
18055 * src/output.c (prepare): Insert the muscles `output-infix', and
18056 `output-suffix'.
18057 * src/parse-skel.y (string, string.1): New.
18058 (section.header): Use it.
18059 (section.yacc): Remove.
18060 (prefix): Remove too.
18061 * src/scan-skel.l: Adjust.
18062 * src/bison.simple, src/bison.hairy: Adjust.
18063
18064 2002-01-09 Akim Demaille <akim@epita.fr>
18065
18066 * configure.in (WERROR_CFLAGS): Compute it.
18067 * src/Makefile.am (CFLAGS): Pass it.
18068 * tests/atlocal.in (CFLAGS): Idem.
18069 * src/files.c: Fix a few warnings.
18070 (get_extension_index): Remove, unused.
18071
18072 2002-01-08 Akim Demaille <akim@epita.fr>
18073
18074 * src/getargs.c (AS_FILE_NAME): New.
18075 (getargs): Use it to convert DOSish file names.
18076 * src/files.c (base_name): Rename as full_base_name to avoid
18077 clashes with `base_name ()'.
18078 (filename_split): New.
18079 (compute_base_names): N-th rewrite, using filename_split.
18080
18081 2002-01-08 Akim Demaille <akim@epita.fr>
18082
18083 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
18084 New, stolen from the Fileutils 4.1.
18085 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18086 * configure.in: Check for the presence of memrchr, and of its
18087 prototype.
18088
18089 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
18090
18091 * lib/hash.h (__P): Added definition for this macro.
18092 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
18093 BUILT_SOURCES, to ensure they are generated first.
18094 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
18095 %error-verbose to allow bootstrapping with bison 1.30x.
18096
18097 2002-01-06 Akim Demaille <akim@epita.fr>
18098
18099 * src/reader.c (parse_braces): Don't fetch the next char, the
18100 convention is to fetch on entry.
18101 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
18102 'switch' without a following semicolon.
18103 * tests/regression.at (braces parsing): New.
18104
18105 2002-01-06 Akim Demaille <akim@epita.fr>
18106
18107 Bison is dead wrong in its RR conflict reports.
18108
18109 * tests/torture.at (GNU Cim Grammar): New.
18110 * src/conflicts.c (count_rr_conflicts): Fix.
18111
18112 2002-01-06 Akim Demaille <akim@epita.fr>
18113
18114 Creating package.m4 from configure.ac causes too many problems.
18115
18116 * tests/Makefile.am (package.m4): Create it by hand,
18117 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
18118
18119 2002-01-06 Akim Demaille <akim@epita.fr>
18120
18121 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
18122 skeleton.h.
18123
18124 2002-01-04 Paul Eggert <eggert@twinsun.com>
18125
18126 * doc/bison.texinfo (Debugging):
18127 Remove YYSTDERR; it's no longer defined or used.
18128 Also, s/cstdio.h/cstdio/.
18129
18130 2002-01-03 Akim Demaille <akim@epita.fr>
18131
18132 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
18133
18134 2002-01-03 Akim Demaille <akim@epita.fr>
18135
18136 * src/parse-skel.y (process_skeleton): Don't bind the parser's
18137 tracing code to --trace, wait for a better --trace option, with
18138 args.
18139
18140 2002-01-03 Akim Demaille <akim@epita.fr>
18141
18142 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
18143 The ISO C++ standard is extremely clear about it: stderr is
18144 considered a macro, not a regular symbol (see table 94 `Header
18145 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
18146 Therefore std:: does not apply to it. It still does with fprintf.
18147 Also, s/cstdio.h/cstdio/.
18148
18149 2002-01-03 Akim Demaille <akim@epita.fr>
18150
18151 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
18152 for non system headers.
18153
18154 2002-01-02 Akim Demaille <akim@epita.fr>
18155
18156 Equip the skeleton chain with location tracking, runtime trace,
18157 pure parser and scanner.
18158
18159 * src/parse-skel.y: Request a pure parser, locations, and prefix
18160 renaming.
18161 (%union): Having several members with the same type does not help
18162 type mismatches, simplify.
18163 (YYPRINT, yyprint): New.
18164 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
18165 (skel_error): this.
18166 Handle locations.
18167 * src/scan-skel.l: Adjust to these changes.
18168 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
18169 (LOCATION_PRINT, skel_control_t): New.
18170
18171 2001-12-30 Akim Demaille <akim@epita.fr>
18172
18173 * src/parse-skel.y: Get rid of the shift/reduce conflict:
18174 replace `gb' with BLANKS.
18175 * src/scan-skel.l: Adjust.
18176
18177 2001-12-30 Akim Demaille <akim@epita.fr>
18178
18179 * src/system.h: We don't need nor want bcopy.
18180 Throw away MS-DOS crap: we don't need getpid.
18181 * configure.in: We don't need strndup. It was even causing
18182 problems: because Flex includes the headers *before* us,
18183 _GNU_SOURCE is not defined by config.h, and therefore strndup was
18184 not visible.
18185 * lib/xstrndup.c: New.
18186 * src/scan-skel.l: Use it.
18187 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
18188 * src/parse-skel.y: Use %directives instead of #defines.
18189
18190 2001-12-30 Akim Demaille <akim@epita.fr>
18191
18192 * src/skeleton.h: New.
18193 * src/output.c (output_parser, output_master_parser): Remove, dead
18194 code.
18195 * src/output.h (get_lines_number, actions_output, guards_output)
18196 (token_definitions_output): Prototype them.
18197 * src/parse-skel.y: Add the license notice.
18198 Include output.h and skeleton.h.
18199 (process_skeleton): Returns void, and takes a single parameter.
18200 * src/scan-skel.l: Add the license notice.
18201 Include skeleton.h.
18202 Don't use %option yylineno: it seems that then Flex imagines
18203 REJECT has been used, and therefore it won't reallocate its
18204 buffers (which makes no other sense to me than a bug). It results
18205 in warnings for `unused: yy_flex_realloc'.
18206
18207 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
18208
18209 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18210 (MUSCLE_INSERT_PREFIX): ...to there.
18211 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18212 (MUSCLE_INSERT_PREFIX): Move from here...
18213
18214 * src/bison.hairy: Add a section directive. Put braces around muscle
18215 names. This parser skeleton is still broken, but Bison should not
18216 choke on a bad muscle 'syntax'.
18217 * src/bison.simple: Add a section directive. Put braces around muscle
18218 names.
18219
18220 * src/files.h (strsuffix, stringappend): Add declarations.
18221 (tab_extension): Add declaration.
18222 (short_base_name): Add declaration.
18223
18224 * src/files.c (strsuffix, stringappend): No longer static. These
18225 functions are used in the skeleton parser.
18226 (tab_extension): New.
18227 (compute_base_names): Use the computations done in this function
18228 to guess if the generated parsers should have '.tab' in their
18229 names.
18230 (short_base_name): No longer static.
18231
18232 * src/output.c (output_skeleton): New.
18233 (output): Disable call to output_master_parser, and give a try to
18234 a new skeleton handling system.
18235 (guards_output, actions_output): No longer static.
18236 (token_definitions_output, get_lines_number): No longer static.
18237
18238 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
18239
18240 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
18241 parse-skel.y.
18242
18243 * src/parse-skel.y: New file.
18244 * src/scan-skel.l: New file.
18245
18246 2001-12-29 Akim Demaille <akim@epita.fr>
18247
18248 %name-prefix is broken.
18249
18250 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
18251 Adjust all dependencies.
18252 * tests/headers.at (export YYLTYPE): Strengthen this test: use
18253 %name-prefix.
18254
18255 Renaming yylval but not yylloc is not consistent. Now we do.
18256
18257 * src/bison.simple: Prefix yylloc if used.
18258 * doc/bison.texinfo (Decl Summary): Document that.
18259
18260 2001-12-29 Akim Demaille <akim@epita.fr>
18261
18262 * doc/bison.texinfo: Promote `%long-directive' over
18263 `%long_directive'.
18264 Remove all references to fixed-output-files, yacc is enough.
18265
18266 2001-12-29 Akim Demaille <akim@epita.fr>
18267
18268 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
18269 user prologue. These are defaults.
18270 * tests/actions.at (Mid-rule actions): Make sure the user can
18271 define YYDEBUG and YYERROR_VERBOSE.
18272
18273 2001-12-29 Akim Demaille <akim@epita.fr>
18274
18275 * src/output.c (header_output): Don't forget to export YYLTYPE and
18276 yylloc.
18277 * tests/headers.at (export YYLTYPE): New, make sure it does.
18278 * tests/regression.at (%union and --defines, Invalid CPP headers):
18279 Move to...
18280 * tests/headers.at: here.
18281
18282 2001-12-29 Akim Demaille <akim@epita.fr>
18283
18284 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
18285
18286 2001-12-29 Akim Demaille <akim@epita.fr>
18287
18288 * tests/actions.at (Mid-rule actions): Output on a single line
18289 instead of several.
18290
18291 2001-12-29 Akim Demaille <akim@epita.fr>
18292
18293 * doc/bison.texinfo: Formatting changes.
18294
18295 2001-12-29 Akim Demaille <akim@epita.fr>
18296
18297 Don't store the token defs in a muscle, just be ready to output it
18298 on command. Now possible via `symbols'. Fixes a memory leak.
18299
18300 * src/output.c (token_definitions_output): New.
18301 (output_parser, header_output): Use it.
18302 * src/reader.c (symbols_save): Remove.
18303
18304 2001-12-29 Akim Demaille <akim@epita.fr>
18305
18306 * src/bison.simple: Do not provide a default for YYSTYPE and
18307 YYLTYPE before the user's prologue. Otherwise it's hardly... a
18308 default.
18309
18310 2001-12-29 Akim Demaille <akim@epita.fr>
18311
18312 Mid-rule actions are simply... ignored!
18313
18314 * src/reader.c (readgram): Be sure to attach mid-rule actions to
18315 the empty-rule associated to the dummy symbol, not to the host
18316 rule.
18317 * tests/actions.at (Mid-rule actions): New.
18318
18319 2001-12-29 Akim Demaille <akim@epita.fr>
18320
18321 Memory leak.
18322
18323 * src/reader.c (reader): Free grammar.
18324
18325 2001-12-29 Akim Demaille <akim@epita.fr>
18326
18327 Memory leak.
18328
18329 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
18330 since it allocates it for each state, although only one is needed.
18331 (allocate_storage): Do it here.
18332
18333 2001-12-29 Akim Demaille <akim@epita.fr>
18334
18335 * src/options.h, src/options.c (create_long_option_table): Rename
18336 as...
18337 (long_option_table_new): this, with a clearer prototype.
18338 (percent_table): Remove, unused,
18339 * src/getargs.c (getargs): Adjust.
18340
18341 2001-12-29 Akim Demaille <akim@epita.fr>
18342
18343 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
18344 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
18345 as states.
18346
18347 2001-12-29 Akim Demaille <akim@epita.fr>
18348
18349 * src/lalr.c (build_relations): Rename `states' as `states1'.
18350 Sorry, I don't understand exactly what it is, no better name...
18351
18352 2001-12-29 Akim Demaille <akim@epita.fr>
18353
18354 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
18355 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
18356 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
18357 as rules.
18358
18359 2001-12-29 Akim Demaille <akim@epita.fr>
18360
18361 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
18362 ago.
18363
18364 2001-12-29 Akim Demaille <akim@epita.fr>
18365
18366 * src/reader.c, src/reader.h (user_toknums): Remove.
18367 Adjust all users to use symbols[i]->user_token_number.
18368
18369 2001-12-29 Akim Demaille <akim@epita.fr>
18370
18371 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
18372 Adjust all users to use symbols[i]->prec or ->assoc.
18373
18374 2001-12-29 Akim Demaille <akim@epita.fr>
18375
18376 * src/reader.c, src/reader.h (tags): Remove.
18377 Adjust all users to use symbols[i]->tag.
18378
18379 2001-12-29 Akim Demaille <akim@epita.fr>
18380
18381 * src/gram.h, src/gram.c (symbols): New, similar to state_table
18382 and rule_table.
18383 * src/reader.c (packsymbols): Fill this table.
18384 Drop sprec.
18385 * src/conflicts.c (resolve_sr_conflict): Adjust.
18386 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
18387 single table.
18388 Use symbols[i]->tag instead of tags[i].
18389
18390 2001-12-29 Akim Demaille <akim@epita.fr>
18391
18392 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
18393 In addition, put a comment in there, to replace...
18394 * tests/regression.at (%union and C comments): Remove.
18395
18396 2001-12-29 Akim Demaille <akim@epita.fr>
18397
18398 * tests/regression.at (Web2c Actions): Blindly move the actual
18399 output as expected output. The contents *seem* right to me, but I
18400 can't pretend reading perfectly parser tables... Nonetheless, all
18401 the other tests pass correctly, the table look OK, even though the
18402 presence of `$axiom' is to be noted: AFAICS it is useless (but
18403 harmless).
18404
18405 2001-12-29 Akim Demaille <akim@epita.fr>
18406
18407 * src/reader.c (readgram): Don't add the rule 0 if there were no
18408 rules read. In other words, add it _after_ having performed
18409 grammar sanity checks.
18410 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
18411
18412 2001-12-29 Akim Demaille <akim@epita.fr>
18413
18414 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
18415 visible, and some states have now a different number.
18416
18417 2001-12-29 Akim Demaille <akim@epita.fr>
18418
18419 * src/reader.c (readgram): Bind the initial rule's lineno to that
18420 of the first rule.
18421 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
18422 (Solved SR Conflicts): Adjust rule 0's line number.
18423
18424 2001-12-29 Akim Demaille <akim@epita.fr>
18425
18426 Fix the `GAWK Grammar' failure.
18427
18428 * src/LR0.c (final_state): Initialize to -1 so that we do compute
18429 the reductions of the first state which was mistakenly confused
18430 with the final state because precisely final_state was initialized
18431 to 0.
18432 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
18433 now noticed by Bison.
18434 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
18435 have a reduction on $default.
18436
18437 2001-12-29 Akim Demaille <akim@epita.fr>
18438
18439 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
18440 rule line numbers.
18441 * src/closure.c (print_closure): Likewise.
18442 * src/derives.c (print_derives): Likewise.
18443 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
18444 now.
18445
18446 2001-12-29 Akim Demaille <akim@epita.fr>
18447
18448 * src/lalr.c (lookaheads_print): New.
18449 (lalr): Call it when --trace-flag.
18450 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
18451 are dumped.
18452
18453 2001-12-29 Akim Demaille <akim@epita.fr>
18454
18455 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
18456 when walking through ritem, even via rule->rhs.
18457 * src/reduce.c (dump_grammar, useful_production, reduce_output)
18458 (useful_production, useless_nonterminals): Likewise.
18459 (reduce_grammar_tables): Likewise, plus update nritems.
18460 * src/nullable.c (set_nullable): Likewise.
18461 * src/lalr.c (build_relations): Likewise.
18462 * tests/sets.at (Nullable): Adjust.
18463 Fortunately, now, the $axiom is no longer nullable.
18464
18465 2001-12-29 Akim Demaille <akim@epita.fr>
18466
18467 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
18468 the 0-sentinel.
18469 * src/gram.c (ritem_longest_rhs): Likewise.
18470 * src/reduce.c (nonterminals_reduce): Likewise.
18471 * src/print_graph.c (print_graph): Likewise.
18472 * src/output.c (output_rule_data): Likewise.
18473 * src/nullable.c (set_nullable): Likewise.
18474
18475 2001-12-29 Akim Demaille <akim@epita.fr>
18476
18477 * src/output.c: Comment changes.
18478
18479 2001-12-27 Paul Eggert <eggert@twinsun.com>
18480
18481 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
18482 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
18483 Sparc, as they were causing more porting problems than the
18484 (minor) performance improvement was worth.
18485
18486 Also, catch up with 1.31's YYSTD.
18487
18488 2001-12-27 Akim Demaille <akim@epita.fr>
18489
18490 * src/output.c (output_gram): Rely on nritems, not the
18491 0-sentinel. See below.
18492 Use -1 as separator, not 0.
18493 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
18494 Rely on -1 as separator in yyrhs, instead of 0.
18495 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
18496 twice `Now at end of input', therefore there are two lines less to
18497 expect.
18498
18499 2001-12-27 Akim Demaille <akim@epita.fr>
18500
18501 * tests/regression.at (Unresolved SR Conflicts):
18502 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
18503 below.
18504
18505 2001-12-27 Akim Demaille <akim@epita.fr>
18506
18507 * src/LR0.c (new_state): Recognize the final state by the fact it
18508 is reached by eoftoken.
18509 (insert_start_shifting_state, insert_eof_shifting_state)
18510 (insert_accepting_state, augment_automaton): Remove, since now
18511 these states are automatically computed from the initial state.
18512 (generate_states): Adjust.
18513 * src/print.c: When reporting a rule number to the user, substract
18514 1, so that the axiom rule is rule 0, and the first user rule is 1.
18515 * src/reduce.c: Likewise.
18516 * src/print_graph.c (print_core): For the time being, just as for
18517 the report, depend upon --trace-flags to dump the full set of
18518 items.
18519 * src/reader.c (readgram): Once the grammar read, insert the rule
18520 0: `$axiom: START-SYMBOL $'.
18521 * tests/set.at: Adjust: rule 0 is now displayed, and since the
18522 number of the states has changed (the final state is no longer
18523 necessarily the last), catch up.
18524
18525 2001-12-27 Akim Demaille <akim@epita.fr>
18526
18527 Try to make the use of the eoftoken valid. Given that its value
18528 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
18529 is used instead of > 0 where appropriate, (ii), depend upon nritems
18530 instead of the 0-sentinel.
18531
18532 * src/gram.h, src/gram.c (nritems): New.
18533 Expected to be duplication of nitems, but for the time being...
18534 * src/reader.c (packgram): Assert nritems and nitems are equal.
18535 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
18536 * src/closure.c (print_closure, print_fderives): Likewise.
18537 * src/gram.c (ritem_print): Likewise.
18538 * src/print.c (print_core, print_grammar): Likewise.
18539 * src/print_graph.c: Likewise.
18540
18541 2001-12-27 Akim Demaille <akim@epita.fr>
18542
18543 * src/main.c (main): If there are complains after grammar
18544 reductions, then output the report anyway if requested, then die.
18545 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
18546 * src/reader.c (eoftoken): New.
18547 (parse_token_decl): If the token being defined has value `0', it
18548 is the eoftoken.
18549 (packsymbols): No longer hack `tags' to insert `$' by hand.
18550 Be sure to preserve the value of the eoftoken.
18551 (reader): Make sure eoftoken is defined.
18552 Initialize nsyms to 0: now eoftoken is created just like the others.
18553 * src/print.c (print_grammar): Don't special case the eof token.
18554 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
18555 lie anyway, albeit pleasant.
18556 * tests/calc.at: Exercise error messages with eoftoken.
18557 Change the grammar so that empty input is invalid.
18558 Adjust expectations.
18559 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
18560
18561 2001-12-27 Akim Demaille <akim@epita.fr>
18562
18563 * configure.in: Check the protos of strchr ans strspn.
18564 Replace strchr if needed.
18565 * src/system.h: Provide the protos of strchr, strspn and memchr if
18566 missing.
18567 * lib/strchr.c: New.
18568 * src/reader.c (symbols_save): Use strchr.
18569
18570 2001-12-27 Akim Demaille <akim@epita.fr>
18571
18572 * src/print.c, src/print_graph.c (escape): New.
18573 Use it to quote the TAGS outputs.
18574 * src/print_graph.c (print_state): Now errors are in red, and
18575 reductions in green.
18576 Prefer high to wide: output the state number on a line of its own.
18577
18578 2001-12-27 Akim Demaille <akim@epita.fr>
18579
18580 * src/state.h, src/state.c (reductions_new): New.
18581 * src/LR0.c (set_state_table): Let all the states have a
18582 `reductions', even if reduced to 0.
18583 (save_reductions): Adjust.
18584 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
18585 * src/print.c (print_reductions, print_actions): Adjust.
18586 * src/output.c (action_row): Adjust.
18587
18588 2001-12-27 Akim Demaille <akim@epita.fr>
18589
18590 * src/state.h, src/state.c (errs_new, errs_dup): New.
18591 * src/LR0.c (set_state_table): Let all the states have an errs,
18592 even if reduced to 0.
18593 * src/print.c (print_errs, print_reductions): Adjust.
18594 * src/output.c (output_actions, action_row): Adjust.
18595 * src/conflicts.c (resolve_sr_conflict): Adjust.
18596
18597 2001-12-27 Akim Demaille <akim@epita.fr>
18598
18599 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
18600
18601 2001-12-27 Akim Demaille <akim@epita.fr>
18602
18603 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
18604 * src/print.c: here.
18605 (lookaheadset, shiftset): New, used as additional storage by
18606 print_reductions.
18607 (print_results): Adjust.
18608 (print_shifts, print_gotos, print_errs): New, extracted from...
18609 (print_actions): here.
18610 * src/print_graph.c (print_actions): Remove dead code.
18611
18612 2001-12-27 Akim Demaille <akim@epita.fr>
18613
18614 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
18615 `$n' and `@n'.
18616
18617 2001-12-27 Akim Demaille <akim@epita.fr>
18618
18619 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
18620 (build_relations): Adjust.
18621
18622 2001-12-27 Akim Demaille <akim@epita.fr>
18623
18624 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
18625 duplication.
18626
18627 2001-12-27 Akim Demaille <akim@epita.fr>
18628
18629 * src/reader.c (packgram): Catch nitems overflows.
18630
18631 2001-12-27 Akim Demaille <akim@epita.fr>
18632
18633 * src/files.c, src/files.h (guard_obstack): Remove.
18634 * src/output.c (output): Adjust.
18635 * src/reader.c (parse_braces): New, factoring...
18636 (copy_action, copy_guard): these two which are renamed as...
18637 (parse_action, parse_guard): these.
18638 As a voluntary consequence, using braces around guards is now
18639 mandatory.
18640
18641 2001-12-27 Akim Demaille <akim@epita.fr>
18642
18643 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
18644 * src/reader.c (symbol_list): `guard' and `guard_line' are new
18645 members.
18646 (symbol_list_new): Adjust.
18647 (copy_action): action_line is the first line, not the last.
18648 (copy_guard): Just as for actions, store the `action' only, not
18649 the switch/case/break flesh.
18650 Don't parse the user action that might follow the guard, let...
18651 (readgram): do it, i.e., now, there can be an action after a
18652 guard.
18653 In other words the guard is just explicitly optional.
18654 (packgram): Adjust.
18655 * src/output.c (guards_output): New.
18656 (output_parser): Call it when needed.
18657 (output): Also free the guard and attrs obstacks.
18658 * src/files.c, src/files.h (obstack_save): Remove.
18659 (output_files): Remove.
18660 As a result, if one needs the former `.act' file, using an
18661 appropriate skeleton which requires actions and guards is now
18662 required.
18663 * src/main.c (main): Adjust.
18664 * tests/semantic.at: New.
18665 * tests/regression.at: Use `input.y' as input file name.
18666 Avoid 8+3 problems by requiring input.c when the test needs the
18667 parser.
18668
18669 2001-12-27 Akim Demaille <akim@epita.fr>
18670
18671 * src/reader.c (symbol_list_new): Be sure to initialize all the
18672 fields.
18673
18674 2001-12-27 Akim Demaille <akim@epita.fr>
18675
18676 All the hacks using a final pseudo state are now useless.
18677
18678 * src/LR0.c (set_state_table): state_table holds exactly nstates.
18679 * src/lalr.c (nLA): New.
18680 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
18681 instead of lookaheadsp from the pseudo state (nstate + 1).
18682
18683 2001-12-27 Akim Demaille <akim@epita.fr>
18684
18685 * src/output.c (action_row, token_actions): Use a state_t instead
18686 of a integer, and nlookaheads instead of the following state's
18687 lookaheadsp.
18688
18689 2001-12-27 Akim Demaille <akim@epita.fr>
18690
18691 * src/conflicts.c (log_resolution, flush_shift)
18692 (resolve_sr_conflict, set_conflicts, solve_conflicts)
18693 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
18694 (conflicts_print, print_reductions): Use a state_t instead of an
18695 integer when referring to a state.
18696 As much as possible, depend upon nlookaheads, instead of the
18697 `lookaheadsp' member of the following state (since lookaheads of
18698 successive states are successive, the difference between state n + 1
18699 and n served as the number of lookaheads for state n).
18700 * src/lalr.c (add_lookback_edge): Likewise.
18701 * src/print.c (print_core, print_actions, print_state)
18702 (print_results): Likewise.
18703 * src/print_graph.c (print_core, print_actions, print_state)
18704 (print_graph): Likewise.
18705 * src/conflicts.h: Adjust.
18706
18707 2001-12-27 Akim Demaille <akim@epita.fr>
18708
18709 * src/bison.hairy: Formatting/comment changes.
18710 ANSIfy.
18711 Remove `register' indications.
18712 Add plenty of `static'.
18713
18714 2001-12-27 Akim Demaille <akim@epita.fr>
18715
18716 * src/output.c (prepare): Drop the muscle `ntbase' which
18717 duplicates ntokens.
18718 * src/bison.simple: Formatting/comment changes.
18719 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
18720 is an undocumented synonym.
18721
18722 2001-12-22 Akim Demaille <akim@epita.fr>
18723
18724 * src/output.c (output_table_data): Change the prototype to use
18725 `int' for array ranges: some invocations do pass an int, not a
18726 short.
18727 Reported by Wayne Green.
18728
18729 2001-12-22 Akim Demaille <akim@epita.fr>
18730
18731 Some actions of web2c.y are improperly triggered.
18732 Reported by Mike Castle.
18733
18734 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
18735 * tests/regression.at (Web2c): Rename as...
18736 (Web2c Report): this.
18737 (Web2c Actions): New.
18738
18739 2001-12-22 Akim Demaille <akim@epita.fr>
18740
18741 Reductions in web2c.y are improperly reported.
18742 Reported by Mike Castle.
18743
18744 * src/conflicts.c (print_reductions): Fix.
18745 * tests/regression.at (Web2c): New.
18746
18747 2001-12-18 Akim Demaille <akim@epita.fr>
18748
18749 Some host fail on `assert (!"foo")', which expands to
18750 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
18751 Reported by Nelson Beebee.
18752
18753 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
18754 `#define it_succeeded 0' and `assert (it_succeeded)'.
18755
18756 2001-12-17 Marc Autret <autret_m@epita.fr>
18757
18758 * src/bison.simple: Don't hard code the skeleton line and filename.
18759 * src/output.c (output_parser): Rename 'line' as 'output_line'.
18760 New line counter 'skeleton_line' (skeleton-line muscle).
18761
18762 2001-12-17 Paul Eggert <eggert@twinsun.com>
18763
18764 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
18765 YYDEBUG must be defined to a nonzero value.
18766
18767 * src/bison.simple (yytname): Do not assume that the user defines
18768 YYDEBUG to a properly parenthesized expression.
18769
18770 2001-12-17 Akim Demaille <akim@epita.fr>
18771
18772 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
18773 nlookaheads is a new member.
18774 Adjust all users.
18775 * src/lalr.h (nlookaheads): Remove this orphan declaration.
18776 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
18777 state.
18778
18779 2001-12-17 Akim Demaille <akim@epita.fr>
18780
18781 * src/files.h, src/files.c (open_files, close_files): Remove.
18782 * src/main.c (main): Don't open/close files, nor invoke lex_free,
18783 let...
18784 * src/reader.c (reader): Do it.
18785
18786 2001-12-17 Akim Demaille <akim@epita.fr>
18787
18788 * src/conflicts.c (print_reductions): Formatting changes.
18789
18790 2001-12-17 Akim Demaille <akim@epita.fr>
18791
18792 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
18793 (flush_reduce): New.
18794 (resolve_sr_conflict): Adjust.
18795
18796 2001-12-17 Akim Demaille <akim@epita.fr>
18797
18798 * src/output.c (output_obstack): Be static and rename as...
18799 (format_obstack): this, to avoid any confusion with files.c's
18800 output_obstack.
18801 * src/reader.h (muscle_obstack): Move to...
18802 * src/output.h: here, since it's defined in output.c.
18803
18804 2001-12-17 Akim Demaille <akim@epita.fr>
18805
18806 * src/output.c (action_row, save_column, default_goto)
18807 (sort_actions, matching_state, pack_vector): Better variable
18808 locality.
18809
18810 2001-12-17 Akim Demaille <akim@epita.fr>
18811
18812 * src/output.c: Various formatting changes.
18813
18814 2001-12-17 Akim Demaille <akim@epita.fr>
18815
18816 * src/files.c (output_files): Free the output_obstack.
18817 * src/main.c (main): Call print and print_graph conditionally.
18818 * src/print.c (print): Work unconditionally.
18819 * src/print_graph.c (print_graph): Work unconditionally.
18820 * src/conflicts.c (log_resolution): Output only if verbose_flag.
18821
18822 2001-12-16 Marc Autret <autret_m@epita.fr>
18823
18824 * src/output.c (actions_output): Fix. When we use %no-lines,
18825 there is one less line per action.
18826
18827 2001-12-16 Marc Autret <autret_m@epita.fr>
18828
18829 * src/bison.simple: Remove a useless #line directive.
18830 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
18831 * src/output.c (get_lines_number): New.
18832 (output_parser): Adjust, now takes care about the lines of a
18833 output muscles.
18834 Fix line numbering.
18835 (actions_output): Computes the number of lines taken by actions.
18836 (output_master_parser): Insert new skeleton which is the name of
18837 the output parser file name.
18838
18839 2001-12-15 Marc Autret <autret_m@epita.fr>
18840
18841 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
18842
18843 2001-12-15 Marc Autret <autret_m@epita.fr>
18844
18845 * src/output.c (output_gram): Keep track of the hairy one.
18846
18847 2001-12-15 Akim Demaille <akim@epita.fr>
18848
18849 Make `make distcheck' work.
18850
18851 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
18852 system.h which uses libgettext.h.
18853
18854 2001-12-15 Akim Demaille <akim@epita.fr>
18855
18856 * src/nullable.c (set_nullable): Useless rules must be skipped,
18857 otherwise, since we range over their symbols, we might look at a
18858 nonterminal which no longer ``exists'', i.e., it is not counted in
18859 `nvars', hence we overflow our arrays.
18860
18861 2001-12-15 Akim Demaille <akim@epita.fr>
18862
18863 The header can also be produced directly, without any obstack!
18864 Yahoo!
18865
18866 * src/files.c, src/files.h (defines_obstack): Remove.
18867 (compute_header_macro): Global.
18868 (defines_obstack_save): Remove.
18869 * src/reader.c (parse_union_decl): No longer output to
18870 defines_obstack: its content can be found in the `stype' muscle
18871 anyway.
18872 (output_token_translations): Merge into...
18873 (symbols_output): this.
18874 Rename as...
18875 (symbols_save): this.
18876 (reader): Adjust.
18877 * src/output.c (header_output): New.
18878 (output): Call it.
18879
18880 2001-12-15 Akim Demaille <akim@epita.fr>
18881
18882 * src/reader.c (parse_union_decl): Instead of handling two obstack
18883 simultaneously, use one to define the `stype' muscle, and use the
18884 value of the latter to fill defines_obstack.
18885 (copy_comment): Remove.
18886 (copy_comment2): Work for a single obstack.
18887 Rename as...
18888 (copy_comment): this.
18889
18890 2001-12-15 Akim Demaille <akim@epita.fr>
18891
18892 * src/lex.c, src/lex.h (xgetc): No longer static.
18893 * src/reader.c (parse_union_decl): Revamp.
18894
18895 2001-12-15 Akim Demaille <akim@epita.fr>
18896
18897 Still making progress in separating Bison into (i) input, (ii)
18898 process, (iii) output: now we can directly output the parser file
18899 without using table_obstack at all.
18900
18901 * src/files.c, src/files.h (table_obstack): Bye bye.
18902 (parser_file_name): New.
18903 * src/files.c (compute_output_file_names): Compute it.
18904 * src/output.c (actions_output, output_parser)
18905 (output_master_parser): To a file instead of an obstack.
18906
18907 2001-12-15 Akim Demaille <akim@epita.fr>
18908
18909 Attach actions to rules, instead of pre-outputting them to
18910 actions_obstack.
18911
18912 * src/gram.h (rule_t): action and action_line are new members.
18913 * src/reader.c (symbol_list): Likewise.
18914 (copy_action): Save the actions within the rule.
18915 (packgram): Save them in rule_table.
18916 * src/output.c (actions_output): New.
18917 (output_parser): Use it on `%%actions'.
18918 (output_rule_data): Don't free rule_table.
18919 (output): Do it.
18920 (prepare): Don't save the `action' muscle.
18921 * src/bison.simple: s/%%action/%%actions/.
18922
18923 2001-12-15 Akim Demaille <akim@epita.fr>
18924
18925 * src/reader.c (copy_action): When --yacc, don't append a `;'
18926 to the user action: let it fail if lacking.
18927 Suggested by Arnold Robbins and Tom Tromey.
18928
18929 2001-12-14 Akim Demaille <akim@epita.fr>
18930
18931 * src/lex.c (literalchar): Simply return the char you decoded, non
18932 longer mess around with obstacks and int pointers.
18933 Adjust all callers.
18934
18935 2001-12-14 Akim Demaille <akim@epita.fr>
18936
18937 * src/lex.c (literalchar): Don't escape the special characters,
18938 just decode them, and keep them as char (before, eol was output as
18939 the 2 char string `\n' etc.).
18940 * src/output.c (output_rule_data): Use quotearg to output the
18941 token strings.
18942
18943 2001-12-13 Paul Eggert <eggert@twinsun.com>
18944
18945 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
18946 Do not infringe on the global user namespace when using C++.
18947 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
18948 All uses of `fprintf' and `stderr' changed.
18949
18950 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
18951
18952 2001-12-13 Akim Demaille <akim@epita.fr>
18953
18954 The computation of nullable is broken: it doesn't handle empty
18955 RHS's properly.
18956
18957 * tests/torture.at (GNU AWK Grammar): New.
18958 * tests/sets.at (Nullable): New.
18959 * src/nullable.c (set_nullable): Instead of blindly looping over
18960 `ritems', loop over the rules, and then over their rhs's.
18961
18962 Work around Autotest bugs.
18963
18964 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
18965 frame, because Autotest understand lines starting with a `+' as
18966 traces from the shell. Then, they are not processed properly.
18967 Admittedly an Autotest bug, but we don't have time to wait for
18968 Autotest to catch up.
18969 * tests/regression.at (Broken Closure): Adjust to the new table
18970 frames.
18971 Move to...
18972 * tests/sets.at: here.
18973
18974 2001-12-13 Akim Demaille <akim@epita.fr>
18975
18976 * src/closure.c (closure): Use nrules instead of playing tricks
18977 with BITS_PER_WORD.
18978
18979 2001-12-13 Akim Demaille <akim@epita.fr>
18980
18981 * src/print.c (print_actions): Output the handling of `$' as the
18982 traces do: shifting the token EOF. Before EOF was treated as a
18983 nonterminal.
18984 * tests/regression.at: Adjust some tests.
18985 * src/print_graph.c (print_core): Complete the set of items via
18986 closure. The next-to-final and final states are still unsatisfying,
18987 but that's to be addressed elsewhere.
18988 No longer output the rule numbers, but do output the state number.
18989 A single loop for the shifts + gotos is enough, but picked a
18990 distinct color for each.
18991 (print_graph): Initialize and finalize closure.
18992
18993 2001-12-13 Akim Demaille <akim@epita.fr>
18994
18995 * src/reader.c (readgram): Remove dead code, an strip useless
18996 braces.
18997 (get_type): Remove, unused.
18998
18999 2001-12-12 Akim Demaille <akim@epita.fr>
19000
19001 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
19002 on that of lib/error.c.
19003
19004 2001-12-12 Akim Demaille <akim@epita.fr>
19005
19006 Some hosts don't like `/' in includes.
19007
19008 * src/system.h: Include libgettext.h without qualifying the path.
19009 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
19010 $(top_srcdir).
19011
19012 2001-12-11 Marc Autret <autret_m@epita.fr>
19013
19014 * src/output.c (output_parser): Remove useless muscle.
19015
19016 2001-12-11 Marc Autret <autret_m@epita.fr>
19017
19018 * src/bison.simple: Remove #line just before %%epilogue. It
19019 is now handled in ...
19020 * src/reader.c (read_additionnal_code): Add the output of a
19021 #line for the epilogue.
19022
19023 2001-12-10 Marc Autret <autret_m@epita.fr>
19024
19025 * src/reader.c (copy_definition): Re-use CPP-outed code which
19026 replace precedent remove.
19027 * src/bison.simple: Remove #line before %%prologue because
19028 %%input-line is wrong at this time.
19029
19030 2001-12-10 Marc Autret <autret_m@epita.fr>
19031
19032 * src/reader.c (symbols_output): Clean up.
19033 * src/output.c (output_gram, output): Clean up.
19034
19035 2001-12-10 Akim Demaille <akim@epita.fr>
19036
19037 * src/lalr.c (initialize_lookaheads): New. Extracted from...
19038 * src/LR0.c (set_state_table): here.
19039 * src/lalr.c (lalr): Call it.
19040
19041 2001-12-10 Akim Demaille <akim@epita.fr>
19042
19043 * src/state.h (shifts): Remove the `number' member: shifts are
19044 attached to state, hence no longer need to be labelled with a
19045 state number.
19046
19047 2001-12-10 Akim Demaille <akim@epita.fr>
19048
19049 Now that states have a complete set of members, the linked list of
19050 shifts is useless: just fill directly the state's shifts member.
19051
19052 * src/state.h (shifts): Remove the `next' member.
19053 * src/LR0.c (first_state, last_state): Remove.
19054 Adjust the callers.
19055 (augment_automaton): Don't look for the shifts that must be added
19056 a shift on EOF: it is those of the state we looked for! But now,
19057 since shifts are attached, it is no longer needed to looking
19058 merely by its id: its number.
19059
19060 2001-12-10 Akim Demaille <akim@epita.fr>
19061
19062 * src/LR0.c (augment_automaton): Better variable locality.
19063 Remove an impossible branch: if there is a state corresponding to
19064 the start symbol being shifted, then there is shift for the start
19065 symbol from the initial state.
19066
19067 2001-12-10 Akim Demaille <akim@epita.fr>
19068
19069 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
19070 only when appropriate: when insert_start_shifting_state' is not
19071 invoked.
19072 * tests/regression.at (Rule Line Numbers): Adjust.
19073
19074 2001-12-10 Akim Demaille <akim@epita.fr>
19075
19076 * src/LR0.c (augment_automaton): Now that all states have shifts,
19077 merge the two cases addition shifts to the initial state.
19078
19079 2001-12-10 Akim Demaille <akim@epita.fr>
19080
19081 * src/lalr.c (set_state_table): Move to...
19082 * src/LR0.c: here.
19083 * src/lalr.c (lalr): Don't call it...
19084 * src/LR0.c (generate_states): do it.
19085 * src/LR0.h (first_state): Remove, only the table is used.
19086
19087 2001-12-10 Akim Demaille <akim@epita.fr>
19088
19089 * src/LR0.h (first_shift, first_reduction): Remove.
19090 * src/lalr.c: Don't use first_shift: find shifts through the
19091 states.
19092
19093 2001-12-10 Akim Demaille <akim@epita.fr>
19094
19095 * src/LR0.c: Attach shifts to states as soon as they are
19096 computed.
19097 * src/lalr.c (set_state_table): Instead of assigning shifts to
19098 state, just assert that the mapping was properly done.
19099
19100 2001-12-10 Akim Demaille <akim@epita.fr>
19101
19102 * src/LR0.c (insert_start_shift): Rename as...
19103 (insert_start_shifting_state): this.
19104 (insert_eof_shifting_state, insert_accepting_state): New.
19105 (augment_automaton): Adjust.
19106 Better locality of the variables.
19107 When looking if the start_symbol is shifted from the initial
19108 state, using `while (... symbol != start_symbol ...)' sounds
19109 better than `while (... symbol < start_symbol ...)': If fail
19110 to see how the order between symbols could be relevant!
19111
19112 2001-12-10 Akim Demaille <akim@epita.fr>
19113
19114 * src/getargs.h: Don't declare `spec_name_prefix' and
19115 `spec_file_prefix', declared by src/files.h.
19116 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
19117 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
19118 * src/output.c (prepare): Adjust.
19119 * src/reader.c (symbols_output): Likewise.
19120 * src/vmsgetargs.c: Vaguely adjust, but who cares?
19121
19122 2001-12-10 Akim Demaille <akim@epita.fr>
19123
19124 * src/muscle_tab.c (muscle_init): NULL is a better default than
19125 `"0"'.
19126
19127 2001-12-10 Akim Demaille <akim@epita.fr>
19128
19129 * src/reader.c (reader): Calling symbols_output once is enough.
19130
19131 2001-12-10 Akim Demaille <akim@epita.fr>
19132
19133 Now that states have a complete set of members, the linked list of
19134 reductions is useless: just fill directly the state's reductions
19135 member.
19136
19137 * src/state.h (struct reductions): Remove member `number' and
19138 `next'.
19139 * src/LR0.c (first_reduction, last_reduction): Remove.
19140 (save_reductions): Don't link the new reductions, store them in
19141 this_state.
19142 * src/lalr.c (set_state_table): No need to attach reductions to
19143 states, it's already done.
19144 * src/output.c (output_actions): No longer free the shifts, then
19145 the reductions, then the states: free all the states and their
19146 members.
19147
19148 2001-12-10 Akim Demaille <akim@epita.fr>
19149
19150 * src/options.c (OPTN, DRTV, BOTH): New.
19151 (option_table): Use them.
19152
19153 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
19154 the job of system.h.
19155 * src/options.c: Don't include stdio.h and xalloc.h for the same
19156 reasons.
19157
19158 2001-12-10 Akim Demaille <akim@epita.fr>
19159
19160 * src/output.c (output, prepare): Make sure the values of the
19161 muscles `action' and `prologue' are 0-terminated.
19162
19163 2001-12-10 Akim Demaille <akim@epita.fr>
19164
19165 Clean up GCC warnings.
19166
19167 * src/reader.c (copy_action): `buf' is not used.
19168 (parse_skel_decl): Be static.
19169 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
19170 * src/options.h (create_long_option_table): Have a real prototype.
19171 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
19172 (hash_delete_at): Return const void *.
19173 Adjust casts to preserve the const.
19174
19175 2001-12-10 Akim Demaille <akim@epita.fr>
19176
19177 * configure.in: Require 2.52g.
19178 M4 is not needed, but AUTOM4TE is.
19179 * m4/m4.m4: Remove.
19180 * tests/Makefile.am: Adjust.
19181
19182 2001-12-10 Akim Demaille <akim@epita.fr>
19183
19184 One structure for states is enough, even though theoretically
19185 there are LR(0) states and LALR(1) states.
19186
19187 * src/lalr.h (state_t): Remove.
19188 (state_table): Be state_t **, not state_t *.
19189 * src/state.h (core, CORE_ALLOC): Rename as...
19190 (state_t, STATE_ALLOC): this.
19191 Add the LALR(1) members: shifts, reductions, errs.
19192 * src/LR0.c (state_table): Rename as...
19193 (state_hash): this, to avoid name clashes with the global
19194 `state_table'.
19195 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
19196 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
19197
19198 2001-12-10 Akim Demaille <akim@epita.fr>
19199
19200 Bison dumps core on bash.y.
19201 Reported by Pascal Bart.
19202
19203 * src/warshall.c (bitmatrix_print): New.
19204 (TC): Use it.
19205 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
19206 j must be the outer loop.
19207 * tests/regression.at (Broken Closure): New.
19208
19209 2001-12-05 Akim Demaille <akim@epita.fr>
19210
19211 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
19212 its argument.
19213 Reported by Peter Hamorsky.
19214
19215 2001-12-05 Akim Demaille <akim@epita.fr>
19216
19217 * src/conflicts.c (err_table): Remove.
19218 (resolve_sr_conflict): Adjust.
19219 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
19220 Rename as...
19221 (state_t.reductions, state_t.shifts): this.
19222
19223 2001-12-05 Akim Demaille <akim@epita.fr>
19224
19225 * src/reduce.c (reduce_grammar_tables): No longer disable the
19226 removal of useless rules via CPP but via `if (0)', so that the
19227 compiler still check the code is valid.
19228 For instance, it should have noticed `rline' no longer exists: use
19229 the `line' member of rule_t.
19230 * src/gram.c (dummy, rline): Remove, unused.
19231
19232 2001-12-05 Akim Demaille <akim@epita.fr>
19233
19234 * src/output.c (pack_vector): Use assert, not berror.
19235 * src/main.c (berror): Remove, unused.
19236
19237 2001-12-05 Akim Demaille <akim@epita.fr>
19238
19239 New experimental feature: if --verbose --trace output all the
19240 items of a state, not only its kernel.
19241
19242 * src/print.c (print_core): If `trace_flag', then invoke closure
19243 before outputting the items of the state (print_core is no longer
19244 a correct name them).
19245 (print_results): Invoke new_closure/free_closure if needed.
19246
19247 2001-12-05 Akim Demaille <akim@epita.fr>
19248
19249 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
19250 * src/closure.c, src/closure.h (itemsetsize): Rename as...
19251 (nitemset): for consistency with the rest of the project.
19252
19253 2001-12-05 Akim Demaille <akim@epita.fr>
19254
19255 * src/closure.c (print_closure): Improve.
19256 (closure): Use it for printing input and output.
19257
19258 2001-12-05 Akim Demaille <akim@epita.fr>
19259
19260 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
19261 indexed by nonterminals.
19262
19263 2001-12-05 Akim Demaille <akim@epita.fr>
19264
19265 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
19266 what it was!).
19267 * src/warshall.h: Remove accidental duplication of the content.
19268
19269 2001-12-05 Akim Demaille <akim@epita.fr>
19270
19271 * src/closure.c (set_fderives): De-obfuscate.
19272
19273 2001-12-05 Akim Demaille <akim@epita.fr>
19274
19275 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
19276
19277 2001-12-05 Akim Demaille <akim@epita.fr>
19278
19279 * src/closure.c (set_firsts): De-obfuscate.
19280
19281 2001-12-05 Akim Demaille <akim@epita.fr>
19282
19283 * src/output.c (action_row): De-obfuscate
19284 using the good o' techniques: arrays not pointers, variable
19285 locality, BITISSET, RESETBIT etc.
19286
19287 2001-12-05 Akim Demaille <akim@epita.fr>
19288
19289 Pessimize the code to simplify it: from now on, all the states
19290 have a valid SHIFTS, which NSHIFTS is possibly 0.
19291
19292 * src/LR0.c (shifts_new): Be global and move to..
19293 * src/state.c, src/state.h: here.
19294 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
19295 * src/print_graph: Adjust.
19296
19297 2001-12-05 Akim Demaille <akim@epita.fr>
19298
19299 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
19300 * src/conflicts.c: Use it.
19301 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
19302 incorrectly ``simplified''.
19303
19304 2001-12-05 Akim Demaille <akim@epita.fr>
19305
19306 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
19307 using the good o' techniques: arrays not pointers, variable
19308 locality, BITISSET, RESETBIT etc.
19309
19310 2001-12-05 Akim Demaille <akim@epita.fr>
19311
19312 * src/state.h (SHIFT_SYMBOL): New.
19313 * src/conflicts.c: Use it to deobfuscate.
19314
19315 2001-12-05 Akim Demaille <akim@epita.fr>
19316
19317 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
19318 (print_reductions): De-obfuscate using the good o' techniques:
19319 arrays not pointers, variable locality, BITISSET.
19320
19321 2001-12-05 Akim Demaille <akim@epita.fr>
19322
19323 * src/conflicts.c (print_reductions): Arrays, not pointers.
19324 Use BITISSET.
19325
19326 2001-12-05 Akim Demaille <akim@epita.fr>
19327
19328 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19329
19330 2001-12-05 Akim Demaille <akim@epita.fr>
19331
19332 * src/conflicts.c (print_reductions): Improve variable locality.
19333
19334 2001-12-05 Akim Demaille <akim@epita.fr>
19335
19336 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19337
19338 2001-12-05 Akim Demaille <akim@epita.fr>
19339
19340 * src/conflicts.c (print_reductions): Improve variable locality.
19341
19342 2001-12-05 Akim Demaille <akim@epita.fr>
19343
19344 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
19345 * src/lalr.c: Use them.
19346
19347 2001-12-05 Akim Demaille <akim@epita.fr>
19348
19349 * src/LR0.c (augment_automaton): Formatting changes.
19350 Better variable locality.
19351
19352 2001-12-05 Akim Demaille <akim@epita.fr>
19353
19354 * src/lalr.c (matrix_print): New.
19355 (transpose): Use it.
19356 Use arrays instead of pointers.
19357
19358 2001-12-05 Akim Demaille <akim@epita.fr>
19359
19360 * src/lalr.c (maxrhs): Move to...
19361 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
19362 * src/lalr.c (build_relations): Adjust.
19363
19364 2001-12-05 Akim Demaille <akim@epita.fr>
19365
19366 * src/lalr.c (transpose): Free the memory allocated to the
19367 argument, as it is replaced by the results by the unique caller.
19368 (build_relations): Merely invoke transpose: it handles the memory
19369 deallocation.
19370 Improve variable locality.
19371 Avoid variables used as mere abbreviations.
19372 (compute_lookaheads): Use arrays instead of pointers.
19373
19374 2001-12-05 Akim Demaille <akim@epita.fr>
19375
19376 * src/lalr.c (initialize_F): Improve variable locality.
19377 Avoid variables used as mere abbreviations.
19378
19379 2001-12-05 Akim Demaille <akim@epita.fr>
19380
19381 * src/derives.c (print_derives): Display the ruleno.
19382 * src/lalr.c (initialize_F, transpose): Better variable locality
19383 to improve readability.
19384 Avoid variables used as mere abbreviations.
19385
19386 2001-12-05 Akim Demaille <akim@epita.fr>
19387
19388 * src/lalr.c (traverse): Use arrays instead of pointers.
19389
19390 2001-12-05 Akim Demaille <akim@epita.fr>
19391
19392 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
19393 the handling of squeue.
19394 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
19395
19396 2001-12-05 Akim Demaille <akim@epita.fr>
19397
19398 Because useless nonterminals are now kept alive (instead of being
19399 `destroyed'), we now sometimes examine them, and store information
19400 related to them. Hence we need to know their number, and adjust
19401 memory allocations.
19402
19403 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
19404 static.
19405 * src/LR0.c (allocate_itemsets): The memory allocated to
19406 `symbol_count' was used for two different purpose: once to count
19407 the number of occurrences of each symbol, and later reassigned to
19408 `shift_symbol', containing the symbol that can be shifted from a
19409 given state.
19410 Deobfuscate, i.e., allocate, use and free `symbol_count' here
19411 only, and...
19412 (new_itemsets): Allocate `shift_symbol' here.
19413 (allocate_itemsets): symbol_count includes useless nonterminals.
19414 Make room for them.
19415 (free_storage): Use `free', not `XFREE', for pointers that cannot
19416 be null.
19417
19418 2001-12-05 Akim Demaille <akim@epita.fr>
19419
19420 * src/nullable.c (set_nullable): Deobfuscate the handling of
19421 ritem.
19422 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
19423
19424 2001-12-05 Akim Demaille <akim@epita.fr>
19425
19426 * src/gram.c, src/gram.h (ritem_print): New.
19427 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
19428 (This useless function was defined only to work around VMS linkers
19429 that can't handle compilation units with variables only).
19430 * src/reduce.c (dump_grammar): Use it to trace the construction of
19431 ritem.
19432
19433 2001-12-04 Paul Eggert <eggert@twinsun.com>
19434
19435 * src/bison.simple (union yyalloc): Change member names
19436 to be the same as the stack names.
19437 (yyparse): yyptr is now union yyalloc *, not char *.
19438 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
19439 and may generate better code on some machines.
19440 (yystpcpy): Use prototype if __STDC__ is defined, not just
19441 if __cplusplus is defined.
19442
19443 2001-11-30 Akim Demaille <akim@epita.fr>
19444
19445 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
19446 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
19447 Gettext doesn't compile cleanly, and dies with -Werror.
19448 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
19449 Include WARNING_CFLAGS here.
19450 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
19451 before being defined.
19452
19453 2001-11-27 Paul Eggert <eggert@twinsun.com>
19454
19455 * lib/quotearg.h (quotearg_n, quotearg_n_style):
19456 First arg is int, not unsigned.
19457 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
19458 (SIZE_MAX, UINT_MAX): New macros.
19459 (quotearg_n_options): Abort if N is negative.
19460 Avoid overflow check on hosts where size_t is 64 bits and int
19461 is 32 bits, as overflow is impossible there.
19462 Fix off-by-one typo that caused unnecessary reallocation.
19463
19464 2001-11-29 Paul Eggert <eggert@twinsun.com>
19465
19466 Name space cleanup in generated parser.
19467
19468 * doc/bison.texinfo (Bison Parser): Discuss system headers
19469 and their effect on the user name space.
19470
19471 * src/bison.simple:
19472 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
19473 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
19474 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
19475
19476 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
19477 on user names when possible.
19478
19479 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
19480 Simplify test for whather <alloca.h> exists.
19481
19482 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
19483
19484 (<stdio.h>): Include if YYDEBUG.
19485
19486 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
19487 ! defined (yyoverflow) && ! defined (yymemcpy).
19488
19489 (yymemcpy, yyparse): Rename local variables as needed so that
19490 they all begin with 'yy'.
19491
19492 (yystrlen, yystpcpy): New functions.
19493
19494 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
19495 All uses changed.
19496
19497 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
19498 instead of relying on string.h functions. Use YYSTACK_ALLOC
19499 and YYSTACK_FREE instead of malloc and free.
19500
19501 2001-11-30 Akim Demaille <akim@epita.fr>
19502
19503 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
19504 before their first uses.
19505 (YYBISON, YYPURE): Move to the top of the output.
19506
19507 2001-11-30 Akim Demaille <akim@epita.fr>
19508
19509 * tests/reduce.at (Useless Nonterminals): Fix.
19510
19511 2001-11-30 Akim Demaille <akim@epita.fr>
19512
19513 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
19514 if body instead of `;' to pacify GCC's warnings.
19515
19516 2001-11-30 Akim Demaille <akim@epita.fr>
19517
19518 Instead of mapping the LHS of unused rules to -1, keep the LHS
19519 valid, but flag the rules as invalid.
19520
19521 * src/gram.h (rule_t): `useful' is a new member.
19522 * src/print.c (print_grammar): Adjust.
19523 * src/derives.c (set_derives): Likewise.
19524 * src/reader.c (packgram, reduce_output): Likewise.
19525 * src/reduce.c (reduce_grammar_tables): Likewise.
19526 * tests/reduce.at (Underivable Rules, Useless Rules): New.
19527
19528 2001-11-30 Akim Demaille <akim@epita.fr>
19529
19530 * src/reduce.c (reduce_output): Formatting changes.
19531 * src/print.c (print_results, print_grammar): Likewise.
19532 * tests/regression.at (Rule Line Numbers)
19533 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
19534
19535 2001-11-30 Akim Demaille <akim@epita.fr>
19536
19537 * src/reduce.c (nonterminals_reduce): Instead of throwing away
19538 useless nonterminals, move them at the end of the symbol arrays.
19539 (reduce_output): Adjust.
19540 * tests/reduce.at (Useless Nonterminals): Adjust.
19541
19542 2001-11-30 Akim Demaille <akim@epita.fr>
19543
19544 * src/reduce.c: Various comment/formatting changes.
19545 (nonterminals_reduce): New, extracted from...
19546 (reduce_grammar_tables): here.
19547 (reduce_grammar): Call nonterminals_reduce.
19548
19549 2001-11-29 Paul Eggert <eggert@twinsun.com>
19550
19551 * src/bison.simple (YYSTACK_REALLOC): Remove.
19552 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
19553 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
19554 New macros.
19555 (union yyalloc): New type.
19556 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
19557 an arbitrary restriction on hosts where size_t is wider than int.
19558
19559 (yyparse): Don't dump core if alloca or malloc fails; instead, report
19560 a parser stack overflow. Allocate just one block of memory for all
19561 three stacks, instead of allocating three blocks; this typically is
19562 faster and reduces fragmentation.
19563
19564 Do not limit the number of items in the stack to a value that fits
19565 in 'int', as this is an arbitrary limit on hosts with 64-bit
19566 size_t and 32-bit int.
19567
19568 2001-11-29 Marc Autret <autret_m@epita.fr>
19569
19570 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
19571 of defining YYERROR_VERBOSE.
19572 [AT_DATA]: $4 is now out of C declarations in the prologue.
19573
19574 2001-11-28 Marc Autret <autret_m@epita.fr>
19575
19576 * src/reader.c (parse_dquoted_param): New.
19577 (parse_skel_decl): Use it.
19578 * src/lex.h: Add its prototype.
19579 * src/lex.c (literalchar): Become not static.
19580
19581 2001-11-28 Marc Autret <autret_m@epita.fr>
19582
19583 * src/output.h: And put its extern declaration here.
19584 * src/output.c (error_verbose): Define here.
19585 (prepare): Echo name modification.
19586 * src/getargs.h: Clean its extern declaration.
19587 * src/getargs.c (error_verbose_flag): Remove.
19588 (getargs): Remove case 'e'.
19589 * src/options.c (option_table): 'error-verbose' is now seen as simple
19590 percent option.
19591 Include output.h.
19592
19593 * src/reader.c (read_declarations): Remove case tok_include.
19594 (parse_include_decl): Remove.
19595 * src/lex.h (token_t): Remove tok_include.
19596 * src/options.c (option_table): 'include' is now a simple command line
19597 option.
19598
19599 2001-11-28 Marc Autret <autret_m@epita.fr>
19600
19601 * src/bison.simple: Adjust muscle names.
19602 * src/muscle_tab.c (muscle_init): Also rename the muscles.
19603 * src/output.c (prepare): s/_/-/ for the muscles names.
19604 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
19605
19606 2001-11-28 Marc Autret <autret_m@epita.fr>
19607
19608 * src/bison.simple: Fix debug.
19609 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
19610
19611 2001-11-28 Akim Demaille <akim@epita.fr>
19612
19613 * src/LR0.c (shifts_new): New.
19614 (save_shifts, insert_start_shift, augment_automaton): Use it.
19615
19616 2001-11-28 Akim Demaille <akim@epita.fr>
19617
19618 * src/closure.c (closure): `b' and `ruleno' denote the same value:
19619 keep ruleno only.
19620
19621 2001-11-28 Akim Demaille <akim@epita.fr>
19622
19623 * src/closure.c (closure): Instead of looping over word in array
19624 then bits in words, loop over bits in array.
19625
19626 2001-11-28 Akim Demaille <akim@epita.fr>
19627
19628 * src/closure.c (closure): No longer optimize the special case
19629 where all the bits of `ruleset[r]' are set to 0, to make the code
19630 clearer.
19631
19632 2001-11-28 Akim Demaille <akim@epita.fr>
19633
19634 * src/closure.c (closure): `r' and `c' are new variables, used to
19635 de-obfuscate accesses to RULESET and CORE.
19636
19637 2001-11-28 Akim Demaille <akim@epita.fr>
19638
19639 * src/reduce.c (reduce_print): Use ngettext.
19640 (dump_grammar): Improve the trace accuracy.
19641
19642 2001-11-28 Akim Demaille <akim@epita.fr>
19643
19644 * src/reduce.c (dump_grammar): Don't translate trace messages.
19645
19646 2001-11-28 Akim Demaille <akim@epita.fr>
19647
19648 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
19649 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
19650 as all tags are free'ed afterwards.
19651 From Enrico Scholz.
19652
19653 2001-11-27 Paul Eggert <eggert@twinsun.com>
19654
19655 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
19656 use alloca when we didn't want to, and vice versa.
19657
19658 2001-11-27 Marc Autret <autret_m@epita.fr>
19659
19660 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
19661 initialization.
19662 * src/output.c (prepare): Remove its update.
19663
19664 2001-11-27 Marc Autret <autret_m@epita.fr>
19665
19666 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
19667 Use %error-verbose.
19668
19669 2001-11-27 Marc Autret <autret_m@epita.fr>
19670
19671 * src/bison.simple: Remove YYERROR_VERBOSE using.
19672 Use %%error_verbose.
19673 (yyparse): Likewise.
19674 * src/output.c (prepare): Give its final value.
19675 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
19676 * src/getargs.h: Add its extern declaration.
19677 * src/getargs.c (error_verbose_flag): New int.
19678 (getargs): Update to catch new case.
19679 * src/options.c (option_table): 'error-verbose' is a new option.
19680 (shortopts): Update.
19681
19682 2001-11-27 Akim Demaille <akim@epita.fr>
19683
19684 * src/system.h: Use intl/libgettext.h.
19685 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
19686
19687 2001-11-27 Akim Demaille <akim@epita.fr>
19688
19689 * tests/torture.at (Exploding the Stack Size with Malloc):
19690 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
19691
19692 2001-11-27 Akim Demaille <akim@epita.fr>
19693
19694 * src/files.c: Include error.h.
19695 Reported by Hans Aberg.
19696
19697 2001-11-26 Marc Autret <autret_m@epita.fr>
19698
19699 * src/reader.c (parse_include_decl): New, not yet implemented.
19700 (read_declarations): Add case tok_include.
19701 * src/getargs.h (include): Add its extern definition.
19702 * src/getargs.c (include): New const char *.
19703 (getargs): Add case '-I'.
19704 * src/options.c (option_table): Add include as command line and
19705 percent option.
19706 * src/lex.h (token_t): Add tok_include.
19707
19708 2001-11-26 Akim Demaille <akim@epita.fr>
19709
19710 * src/reader.c (readgram): Make sure rules for mid-rule actions
19711 have a lineno equal to that of their host rule.
19712 Reported by Hans Aberg.
19713 * tests/regression.at (Rule Line Numbers): New.
19714
19715 2001-11-26 Akim Demaille <akim@epita.fr>
19716
19717 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
19718 size_ts.
19719
19720 2001-11-26 Akim Demaille <akim@epita.fr>
19721
19722 * src/complain.c, src/complain.h (error): Remove, provided by
19723 lib/error.[ch].
19724
19725 2001-11-26 Akim Demaille <akim@epita.fr>
19726
19727 * src/reader.c (read_declarations): Don't abort on tok_illegal,
19728 issue an error message.
19729 * tests/regression.at (Invalid %directive): New.
19730 Reported by Hans Aberg.
19731
19732 2001-11-26 Akim Demaille <akim@epita.fr>
19733
19734 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
19735 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
19736
19737 2001-11-26 Akim Demaille <akim@epita.fr>
19738
19739 * src/conflicts.c (conflicts_print): Don't complain at all when
19740 there are no reduce/reduce conflicts, and as many shift/reduce
19741 conflicts as expected.
19742 * tests/regression.at (%expect right): Adjust.
19743
19744 2001-11-23 Akim Demaille <akim@epita.fr>
19745
19746 * lib/alloca.c: Update, from fileutils.
19747
19748 2001-11-23 Akim Demaille <akim@epita.fr>
19749
19750 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
19751
19752 2001-11-23 Akim Demaille <akim@epita.fr>
19753
19754 * src/system.h: Include alloca.h.
19755 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
19756
19757 2001-11-23 Akim Demaille <akim@epita.fr>
19758
19759 * src/print_graph.c (print_actions): Remove `rule', unused.
19760 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
19761 pacify GCC's signed < unsigned warnings.
19762 * src/closure.c (itemsetsize): Likewise.
19763 * src/reader.c (symbol_list_new): Static.
19764
19765 2001-11-23 Akim Demaille <akim@epita.fr>
19766
19767 Attaching lineno to buckets is stupid, since only one copy of each
19768 symbol is kept, only the line of the first occurrence is kept too.
19769
19770 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
19771 * src/reader.c (rline_allocated): Remove, unused.
19772 (symbol_list): Have a `line' member.
19773 (symbol_list_new): New.
19774 (readgram): Use it.
19775 * src/print.c (print_grammar): Output the rule line numbers.
19776 * tests/regression.at (Solved SR Conflicts)
19777 (Unresolved SR Conflicts): Adjust.
19778 Reported by Hans Aberg.
19779
19780 2001-11-22 Marc Autret <autret_m@epita.fr>
19781
19782 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
19783
19784 2001-11-22 Marc Autret <autret_m@epita.fr>
19785
19786 * src/muscle_tab.c (muscle_init): Remove initialization of
19787 skeleton muscle.
19788 * src/output.c (output_master_parser): Do it here.
19789
19790 2001-11-20 Akim Demaille <akim@epita.fr>
19791
19792 * po/sv.po: New.
19793 * configure.in (ALL_LINGUAS): Adjust.
19794 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
19795 longer contains strings to translate.
19796
19797 2001-11-19 Akim Demaille <akim@epita.fr>
19798
19799 * src/conflicts.c (conflicts_print): Add a missing \n.
19800
19801 2001-11-19 Akim Demaille <akim@epita.fr>
19802
19803 * src/nullable.c (nullable_print): New.
19804 (set_nullable): Call it when tracing.
19805 Better locality of variables.
19806
19807 2001-11-19 Akim Demaille <akim@epita.fr>
19808
19809 * src/print.c (print_actions): Better locality of variables.
19810
19811 2001-11-19 Akim Demaille <akim@epita.fr>
19812
19813 * src/derives.c (print_derives): Fix and enrich.
19814 * src/closure.c (print_fderives): Likewise.
19815
19816 2001-11-19 Akim Demaille <akim@epita.fr>
19817
19818 * src/closure.c (itemsetend): Remove, replaced with...
19819 (itemsetsize): new.
19820
19821 2001-11-19 Akim Demaille <akim@epita.fr>
19822
19823 * src/LR0.c (kernel_end): Remove, replaced with...
19824 (kernel_size): new.
19825
19826 2001-11-19 Akim Demaille <akim@epita.fr>
19827
19828 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
19829 to clarify.
19830
19831 2001-11-19 Akim Demaille <akim@epita.fr>
19832
19833 * src/closure.c (closure): Use arrays instead of pointers to clarify.
19834
19835 2001-11-19 Akim Demaille <akim@epita.fr>
19836
19837 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
19838 trace messages.
19839 * src/LR0.c: Likewise.
19840 (allocate_itemsets): Use arrays instead of pointers to clarify.
19841
19842 2001-11-19 Akim Demaille <akim@epita.fr>
19843
19844 * src/getargs.c (statistics_flag): Replace with...
19845 (trace_flag): New.
19846 (longopts): Accept --trace instead of --statistics.
19847 * src/getargs.h, src/options.c: Adjust.
19848 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
19849 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
19850
19851 2001-11-19 Akim Demaille <akim@epita.fr>
19852
19853 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
19854 pointers to clarify the code.
19855 (save_reductions, save_shifts): Factor common parts of alternatives.
19856
19857 2001-11-19 Akim Demaille <akim@epita.fr>
19858
19859 * src/LR0.c (new_state, get_state): Complete TRACE code.
19860 * src/closure.c: Include `reader.h' to get `tags', needed by the
19861 trace code.
19862 Rename the conditional DEBUG as TRACE.
19863 Output consistently TRACEs to stderr, not stdout.
19864 * src/derives.c: Likewise.
19865 * src/reduce.c: (inaccessable_symbols): Using if is better style
19866 than goto.
19867 Use `#if TRACE' instead of `#if 0' for tracing code.
19868
19869 2001-11-19 Akim Demaille <akim@epita.fr>
19870
19871 * src/system.h (LIST_FREE, shortcpy): New.
19872 * src/LR0.c: Use them.
19873 * src/output.c (free_itemsets, free_reductions, free_shifts):
19874 Remove, replaced by LIST_FREE.
19875
19876 2001-11-19 Akim Demaille <akim@epita.fr>
19877
19878 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
19879 (REDUCTIONS_ALLOC): New.
19880 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
19881 allocation.
19882
19883 2001-11-19 Akim Demaille <akim@epita.fr>
19884
19885 * src/LR0.c (new_state): Complete trace code.
19886 * src/nullable.c (set_nullable): Don't translate traces.
19887
19888 2001-11-19 Akim Demaille <akim@epita.fr>
19889
19890 * src/print_graph.c (print_core): Better locality of variables.
19891 * src/print.c (print_core): Likewise.
19892
19893 2001-11-19 Akim Demaille <akim@epita.fr>
19894
19895 * src/vcg.c: You do the output, so you are responsible of the
19896 handling of VCG syntax, in particular: use quotearg.
19897 * src/print_graph.c: Don't.
19898 (print_actions): Don't output the actions as part of the nodes,
19899 since that's the job of the edges.
19900 (print_state): Don't output by hand: fill the node description,
19901 and ask for its output.
19902
19903 2001-11-19 Akim Demaille <akim@epita.fr>
19904
19905 * src/bison.simple (yyparse): When verbosely reporting an error,
19906 no longer put additional quotes around token names.
19907 * tests/calc.at: Adjust.
19908
19909 2001-11-19 Akim Demaille <akim@epita.fr>
19910
19911 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
19912 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
19913 * src/output.c: Adjust.
19914
19915 2001-11-19 Akim Demaille <akim@epita.fr>
19916
19917 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
19918 (rule_t): this.
19919 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
19920
19921 2001-11-19 Akim Demaille <akim@epita.fr>
19922
19923 * src/gram.h (rule_t): New.
19924 (rule_table): New.
19925 (rrhs, rlhs): Remove, part of state_t.
19926 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
19927 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
19928 * src/reader.c, src/reduce.c: Adjust.
19929
19930 2001-11-19 Akim Demaille <akim@epita.fr>
19931
19932 * src/reader.c (symbols_output): New, extracted from...
19933 (packsymbols): Here.
19934 (reader): Call it.
19935
19936 2001-11-19 Akim Demaille <akim@epita.fr>
19937
19938 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
19939 (maxrhs): this new function.
19940
19941 2001-11-19 Akim Demaille <akim@epita.fr>
19942
19943 * src/lalr.c (F): New macro to access the variable F.
19944 Adjust.
19945
19946 2001-11-19 Akim Demaille <akim@epita.fr>
19947
19948 * src/lalr.h (LA): New macro to access the variable LA.
19949 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19950 * src/lalr.c: Adjust.
19951
19952 2001-11-19 Akim Demaille <akim@epita.fr>
19953
19954 * src/lalr.c (initialize_LA): Only initialize LA. Let...
19955 (set_state_table): handle the `lookaheads' members.
19956
19957 2001-11-19 Akim Demaille <akim@epita.fr>
19958
19959 * src/lalr.h (lookaheads): Removed array, whose contents is now
19960 a member of...
19961 (state_t): this structure.
19962 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19963 Adjust.
19964
19965 2001-11-19 Akim Demaille <akim@epita.fr>
19966
19967 * src/lalr.h (consistent): Removed array, whose contents is now
19968 a member of...
19969 (state_t): this structure.
19970 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19971 Adjust.
19972
19973 2001-11-19 Akim Demaille <akim@epita.fr>
19974
19975 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
19976 contents are now members of...
19977 (state_t): this structure.
19978 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19979 Adjust.
19980
19981 2001-11-19 Akim Demaille <akim@epita.fr>
19982
19983 * src/lalr.h (state_t): New.
19984 (state_table): Be a state_t * instead of a core **.
19985 (accessing_symbol): Remove, part of state_t.
19986 * src/lalr.c: Adjust.
19987 (set_accessing_symbol): Merge into...
19988 (set_state_table): this.
19989 * src/print_graph.c, src/conflicts.c: Adjust.
19990
19991 2001-11-14 Akim Demaille <akim@epita.fr>
19992
19993 * tests/calc.at, tests/output.at, tests/regression.at,
19994 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
19995 now the tests are run in private dirs, therefore AC_CLEANUP and
19996 family can be simplified to 0-ary.
19997 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
19998 use abs. path to find config.h.
19999 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
20000 stderr, there can be way too much random noise.
20001 Instead pass -Werror to GCC and rely on the exit status.
20002 Reported by Wolfram Wagner.
20003
20004 2001-11-14 Akim Demaille <akim@epita.fr>
20005
20006 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
20007 defined only if yyoverflow is defined, to avoid `warning: unused
20008 variable `yyvs1''.
20009 Reported by The Test Suite.
20010
20011 2001-11-14 Akim Demaille <akim@epita.fr>
20012
20013 * src/print.c: Include reduce.h.
20014 Reported by Hans Aberg.
20015
20016 2001-11-14 Akim Demaille <akim@epita.fr>
20017
20018 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
20019 Revert a previous patch: these are really const.
20020 * src/conflicts.c (conflict_report): Additional useless pair of
20021 braces to pacify GCC's warnings for `if () if () {} else {}'.
20022 * src/lex.c (parse_percent_token): Replace equal_offset with
20023 arg_offset.
20024 arg is const.
20025 Be sure to strdup `arg' when used, since there is no reason for
20026 token_buffer not to change.
20027
20028 2001-11-14 Akim Demaille <akim@epita.fr>
20029
20030 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
20031 definition.
20032 * src/main.c (main): Use them.
20033 Suggested by Hans Aberg.
20034
20035 2001-11-12 Akim Demaille <akim@epita.fr>
20036
20037 * src/system.h (ngettext): Now that we use ngettext, be sure to
20038 provide a default definition when NLS are not used.
20039
20040 2001-11-12 Akim Demaille <akim@epita.fr>
20041
20042 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
20043 Use @kbd to denote user input.
20044 (Language and Grammar): ANSIfy the example.
20045 Adjust its layout for info/notinfo.
20046 (Location Tracking Calc): Output error messages to stderr.
20047 Output locations in a more GNUtically correct way.
20048 Fix a couple of Englishos.
20049 Adjust @group/@end group pairs.
20050
20051 2001-11-12 Akim Demaille <akim@epita.fr>
20052
20053 %expect was not functioning at all.
20054
20055 * src/conflicts.c (expected_conflicts): Set to -1.
20056 (conflict_report): Use ngettext.
20057 (conflicts_print): Check %expect and make its violation an error.
20058 * doc/bison.texinfo (Expect Decl): Adjust.
20059 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
20060 * tests/regression.at (%expect not enough, %expect right)
20061 (%expect too much): New.
20062
20063 2001-11-12 Akim Demaille <akim@epita.fr>
20064
20065 * tests/regression.at (Conflicts): Rename as...
20066 (Unresolved SR Conflicts): this.
20067 (Solved SR Conflicts): New.
20068
20069 2001-11-12 Akim Demaille <akim@epita.fr>
20070
20071 * src/reduce.c (print_results): Rename as...
20072 (reduce_output): This.
20073 Output to OUT, passed as argument, instead of output_obstack.
20074 (dump_grammar): Likewise.
20075 (reduce_free): New.
20076 Also free V1.
20077 (reduce_grammar): No longer call reduce_output, since...
20078 * src/print.c (print_results): do it.
20079 * src/main.c (main): Call reduce_free;
20080
20081 2001-11-12 Akim Demaille <akim@epita.fr>
20082
20083 * src/conflicts.c (print_reductions): Accept OUT as argument.
20084 Output to it, not to output_obstack.
20085 * src/print.c (print_actions): Adjust.
20086
20087 2001-11-12 Akim Demaille <akim@epita.fr>
20088
20089 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
20090 the result instead of using...
20091 (src_total, rrc_total, src_count, rrc_count): Remove.
20092 (any_conflicts): Remove.
20093 (print_conflicts): Split into...
20094 (conflicts_print, conflicts_output): New.
20095 * src/conflicts.h: Adjust.
20096 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
20097 * src/print.c (print_grammar): Issue `\n' between two rules.
20098 * tests/regression.at (Conflicts): New.
20099 Reported by Tom Lane.
20100
20101 2001-11-12 Akim Demaille <akim@epita.fr>
20102
20103 * tests/regression.at (Invalid input): Remove, duplicate with
20104 ``Invalid input: 1''.
20105
20106 2001-11-12 Akim Demaille <akim@epita.fr>
20107
20108 * tests/torture.at (AT_DATA_STACK_TORTURE)
20109 (Exploding the Stack Size with Alloca)
20110 (Exploding the Stack Size with Malloc): New.
20111
20112 2001-11-12 Akim Demaille <akim@epita.fr>
20113
20114 * src/bison.simple (YYSTACK_REALLOC): New.
20115 (yyparse) [!yyoverflow]: Use it and free the old stack.
20116 Reported by Per Allansson.
20117
20118 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
20119
20120 * src/bison.simple: Define type yystype instead of YYSTYPE, and
20121 define CPP macro, which substitute YYSTYPE by yystype.
20122 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
20123 with yyltype/YYLTYPE. This allows inclusion of the generated
20124 header within the parser if the compiler, such as GGC, accepts
20125 multiple equivalent #defines.
20126 From Akim.
20127
20128 2001-11-05 Akim Demaille <akim@epita.fr>
20129
20130 * src/reader.c (symbols_output): New, extracted from...
20131 (packsymbols): here.
20132 (reader): Adjust.
20133
20134 2001-11-05 Akim Demaille <akim@epita.fr>
20135
20136 * src/lex.c (parse_percent_token): s/quotearg/quote/.
20137
20138 2001-11-05 Akim Demaille <akim@epita.fr>
20139
20140 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
20141 pattern.
20142
20143 2001-11-05 Akim Demaille <akim@epita.fr>
20144
20145 * src/options.h (struct option_table_struct): set_flags is void*.
20146 * src/options.c (longopts): Support `--output' and `%output'.
20147 (usage): Adjust.
20148 * src/lex.h (tok_setopt): Remove, replaced with...
20149 (tok_intopt, tok_stropt): these new guys.
20150 * src/lex.c (getopt.h): Not needed.
20151 (token_buffer, unlexed_token_buffer): Not const.
20152 (percent_table): Promote `-' over `_' in directive names.
20153 Active `%name-prefix', `file-prefix', and `output'.
20154 (parse_percent_token): Accept possible arguments to directives.
20155 Promote `-' over `_' in directive names.
20156
20157 2001-11-04 Akim Demaille <akim@epita.fr>
20158
20159 * doc/bison.texinfo (Decl Summary): Split the list into
20160 `directives for grammars' and `directives for bison'.
20161 Sort'em.
20162 Add description of `%name-prefix', `file-prefix', and `output'.
20163 Promote `-' over `_' in directive names.
20164 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
20165 Simplify the description of `--name-prefix'.
20166 Promote `-' over `_' in directive names.
20167 Promote `--output' over `--output-file'.
20168 Fix the description of `--defines'.
20169 * tests/output.at: Exercise %file-prefix and %output.
20170
20171 2001-11-02 Akim Demaille <akim@epita.fr>
20172
20173 * doc/refcard.tex: Update.
20174
20175 2001-11-02 Akim Demaille <akim@epita.fr>
20176
20177 * src/symtab.h (SUNDEF): New.
20178 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
20179 stand for `uninitialized', instead of 0.
20180 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
20181 * src/lex.c (lex): Adjust.
20182
20183 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
20184 Number it 0.
20185 Let yylex return it instead of a plain 0.
20186 Reported by Dick Streefland.
20187
20188 2001-11-02 Akim Demaille <akim@epita.fr>
20189
20190 * tests/regression.at (Mixing %token styles): New test.
20191
20192 2001-11-02 Akim Demaille <akim@epita.fr>
20193
20194 * src/reader.c (parse_thong_decl): Formatting changes.
20195 (token_translations_init): New, extracted from...
20196 (packsymbols): Here.
20197 Adjust.
20198
20199 2001-11-01 Akim Demaille <akim@epita.fr>
20200
20201 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
20202 Check that `9foo.y' produces correct cpp guards.
20203 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
20204 guards.
20205 Reported by Wwp.
20206
20207 2001-11-01 Akim Demaille <akim@epita.fr>
20208
20209 * tests/regression.at (Invalid input: 2): New.
20210 * src/lex.c (unlexed_token_buffer): New.
20211 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
20212 too.
20213 Reported by Wwp.
20214
20215 2001-11-01 Akim Demaille <akim@epita.fr>
20216
20217 * tests/calc.at: Catch up with 1.30.
20218 * configure.in: Bump to 1.49a.
20219 Adjust to newer Autotest.
20220
20221 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
20222
20223 * src/conflicts.c: Move global variables rrc_total and src_total ...
20224 (print_conflicts): here.
20225 * src/output.c (output): Free global variable user_toknums.
20226 * src/lex.c (token_obstack): Become static.
20227
20228 2001-10-18 Akim Demaille <akim@epita.fr>
20229
20230 * tests/atlocal.in (GCC): Add.
20231 * tests/calc.at: s/m4_match/m4_bmatch/.
20232 s/m4_patsubst/m4_bpatsubst/.
20233 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
20234 * configure.in: AC_SUBST(GCC).
20235
20236 2001-10-14 Marc Autret <autret_m@epita.fr>
20237
20238 * src/options.c (create_long_option_table): Fix.
20239
20240 2001-10-10 Akim Demaille <akim@epita.fr>
20241
20242 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
20243
20244 2001-10-04 Akim Demaille <akim@epita.fr>
20245
20246 * src/reader.c (parse_union_decl): Push the caracters in
20247 union_obstack, not attrs_obstack.
20248
20249 2001-10-04 Akim Demaille <akim@epita.fr>
20250
20251 Merge in the branch 1.29.
20252
20253 * src/reader.c (packsymbols): Use a temporary obstack for
20254 `%%tokendef', since output_stack is already used elsewhere.
20255
20256 2001-10-02 Akim Demaille <akim@epita.fr>
20257
20258 Bump 1.29d.
20259
20260 2001-10-02 Akim Demaille <akim@epita.fr>
20261
20262 Version 1.29c.
20263
20264 2001-10-02 Akim Demaille <akim@epita.fr>
20265
20266 * tests/regression.at (Invalid CPP headers): New.
20267 From Alexander Belopolsky.
20268 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
20269
20270 2001-10-02 Akim Demaille <akim@epita.fr>
20271
20272 * tests/regression.at (Invalid input): New.
20273 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
20274 Reported by Shura.
20275
20276 2001-10-02 Akim Demaille <akim@epita.fr>
20277
20278 * tests/calc.at: Now that --debug works, the tests must be adjusted.
20279
20280 2001-10-02 Akim Demaille <akim@epita.fr>
20281
20282 * src/output.c (output_parser): Assert `skeleton'.
20283 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
20284 systems.
20285 From Shura.
20286
20287 2001-10-01 Marc Autret <autret_m@epita.fr>
20288
20289 * src/lex.h: Echo modifications.
20290 * src/lex.c (unlex): Parameter is now token_t.
20291 From Hans Aberg.
20292
20293 2001-10-01 Marc Autret <autret_m@epita.fr>
20294
20295 * src/main.c: Include lex.h.
20296 From Hans Aberg.
20297
20298 2001-09-29 Akim Demaille <akim@epita.fr>
20299
20300 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
20301
20302 2001-09-28 Akim Demaille <akim@epita.fr>
20303
20304 * tests/testsuite.at: Update to newer Autotest.
20305 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
20306
20307 2001-09-27 Akim Demaille <akim@epita.fr>
20308
20309 Position independent wrapper.
20310
20311 * tests/bison: Remove.
20312 * tests/bison.in: New.
20313 * configure.in: Adjust.
20314
20315 2001-09-27 Paul Eggert <eggert@twinsun.com>
20316
20317 Port quotearg fixes from tar 1.13.24.
20318
20319 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
20320 tm to be declared.
20321 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
20322 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
20323
20324 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
20325 * m4/mbrtowc.m4: New file.
20326 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
20327 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
20328
20329 2001-09-27 Akim Demaille <akim@epita.fr>
20330
20331 Bump to 1.29c.
20332
20333 2001-09-27 Akim Demaille <akim@epita.fr>
20334
20335 Version 1.29b.
20336
20337 2001-09-25 Akim Demaille <akim@epita.fr>
20338
20339 * src/system.h: Include `xalloc.h'.
20340 Remove it from the C files.
20341 * src/files.c (output_files): Free the obstacks.
20342 * src/lex.c (init_lex): Rename as...
20343 (lex_init): this.
20344 (lex_free): New.
20345 * src/main.c (main): Use it.
20346
20347 2001-09-24 Marc Autret <autret_m@epita.fr>
20348
20349 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
20350 to output informations in fout (FILE*).
20351 (open_graph, close_graph): Likewise.
20352 (output_graph, output_edge, output_node): Likewise.
20353 * src/vcg.h: Update function prototypes.
20354 * src/print_graph.c (print_graph): Open output graph file.
20355 (print_actions): Adjust.
20356 * src/files.h: Remove extern declaration.
20357 * src/files.c: Remove graph_obstack declaration.
20358 (open_files): Remove graph_obstack initialization.
20359 (output_files): Remove graph_obstack saving.
20360
20361 2001-09-24 Marc Autret <autret_m@epita.fr>
20362
20363 * src/files.c (compute_output_file_names): Fix.
20364
20365 2001-09-24 Marc Autret <autret_m@epita.fr>,
20366 Akim Demaille <akim@epita.fr>
20367
20368 * src/reader.c (reader): Remove call to free_symtab ().
20369 * src/main.c (main): Call it here.
20370 Include symtab.h.
20371 * src/conflicts.c (initialize_conflicts): Rename as...
20372 (solve_conflicts): this.
20373 * src/print.c (print_core, print_actions, print_state)
20374 (print_grammar): Dump to a file instead a `output_obstack'.
20375 (print_results): Dump `output_obstack', and then proceed with the
20376 FILE *.
20377 * src/files.c (compute_output_file_names, close_files): New.
20378 (output_files): Adjust.
20379 * src/main.c (main): Adjust.
20380
20381 2001-09-23 Marc Autret <autret_m@epita.fr>
20382
20383 * src/files.c (compute_header_macro): Computes header macro name
20384 from spec_defines_file when given.
20385
20386 2001-09-23 Marc Autret <autret_m@epita.fr>
20387
20388 * src/files.c (output_files): Add default extensions.
20389
20390 2001-09-22 Akim Demaille <akim@epita.fr>
20391
20392 * src/conflicts.c (finalize_conflicts): Rename as...
20393 (free_conflicts): this.
20394
20395 2001-09-22 Akim Demaille <akim@epita.fr>
20396
20397 * src/gram.c (gram_free): Rename back as...
20398 (dummy): this.
20399 (output_token_translations): Free `token_translations'.
20400 * src/symtab.c (free_symtab): Free the tag field.
20401
20402 2001-09-22 Akim Demaille <akim@epita.fr>
20403
20404 Remove `translations' as it is always set to true.
20405
20406 * src/gram.h: Adjust.
20407 * src/reader.c (packsymbols, parse_token_decl): Adjust
20408 * src/print.c (print_grammar): Adjust.
20409 * src/output.c (output_token_translations): Adjust.
20410 * src/lex.c (lex): Adjust.
20411 * src/gram.c: Be sure the set pointers to NULL.
20412 (dummy): Rename as...
20413 (gram_free): this.
20414
20415 2001-09-22 Akim Demaille <akim@epita.fr>
20416
20417 * configure.in: Invoke AM_LIB_DMALLOC.
20418 * src/system.h: Use dmalloc.
20419 * src/LR0.c: Be sure to have pointers initialized to NULL.
20420 (allocate_itemsets): Allocate kernel_items only if needed.
20421
20422 2001-09-22 Akim Demaille <akim@epita.fr>
20423
20424 * configure.in: Bump to 1.29b.
20425 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
20426 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
20427 need xmalloc.c in calc.y.
20428 From Pascal Bart.
20429
20430 2001-09-21 Akim Demaille <akim@epita.fr>
20431
20432 Version 1.29a.
20433 * Makefile.maint, config/config.guess, config/config.sub,
20434 * config/missing: Update from masters.
20435 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
20436 upon package.m4.
20437 * configure.in (ALL_LINGUAS): Add `tr'.
20438
20439 2001-09-21 Akim Demaille <akim@epita.fr>
20440
20441 * tests/Makefile.am (package.m4): Move to...
20442 ($(srcdir)/$(TESTSUITE)): here.
20443
20444 2001-09-20 Akim Demaille <akim@epita.fr>
20445
20446 * src/complain.c: No longer try to be standalone: use system.h.
20447 Don't assume __STDC__ is defined to 1. Just test if it is defined.
20448 * src/complain.h: Likewise.
20449 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
20450 Remove the unused variable `n'.
20451 From Albert Chin-A-Young.
20452
20453 2001-09-18 Marc Autret <autret_m@epita.fr>
20454
20455 * doc/bison.1: Update.
20456 * doc/bison.texinfo (Bison Options): Update --defines and --graph
20457 descriptions.
20458 (Option Cross Key): Update.
20459 Add --graph.
20460
20461 2001-09-18 Marc Autret <autret_m@epita.fr>
20462
20463 * tests/regression.at: New test (comment in %union).
20464
20465 2001-09-18 Marc Autret <autret_m@epita.fr>
20466
20467 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
20468 do that.
20469 Reported by Keith Browne.
20470
20471 2001-09-18 Marc Autret <autret_m@epita.fr>
20472
20473 * tests/output.at: Add tests for --defines and --graph.
20474
20475 2001-09-18 Marc Autret <autret_m@epita.fr>
20476
20477 * tests/output.at: Removes tests of %{header,src}_extension features.
20478
20479 2001-09-18 Akim Demaille <akim@epita.fr>
20480
20481 * tests/Makefile.am (package.m4): New.
20482 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
20483 (_AT_CHECK_CALC_ERROR): Likewise.
20484 Factor the `, ' part of verbose error messages.
20485
20486 2001-09-18 Marc Autret <autret_m@epita.fr>
20487
20488 * src/getargs.c (longopts): Declare --defines and --graph as options
20489 with optional arguments.
20490 * src/files.h: Add extern declarations.
20491 * src/files.c (spec_graph_file, spec_defines_file): New.
20492 (output_files): Update.
20493 Remove CPP-outed code.
20494
20495 2001-09-18 Marc Autret <autret_m@epita.fr>
20496
20497 Turn off %{source,header}_extension feature.
20498
20499 * src/files.c (compute_exts_from_gf): Update.
20500 (compute_exts_from_src): Update.
20501 (output_files): CPP-out useless code.
20502 * src/files.h: Remove {header,source}_extension extern declarations.
20503 * src/reader.c (parse_dquoted_param): CPP-out.
20504 (parse_header_extension_decl): Remove.
20505 (parse_source_extension_decl): Remove.
20506 (read_declarations): Remove cases tok_{hdrext,srcext}.
20507 * src/lex.c (percent_table): Remove {header,source}_extension entries.
20508 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
20509
20510 2001-09-10 Akim Demaille <akim@epita.fr>
20511
20512 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
20513 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
20514 (AT_CHECK_OUTPUT): this.
20515 Merely check ls' exit status, its output is useless.
20516
20517 2001-09-10 Akim Demaille <akim@epita.fr>
20518
20519 * tests/calc.at: Use m4_match.
20520 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
20521
20522 2001-09-10 Marc Autret <autret_m@epita.fr>,
20523 Akim Demaille <akim@epita.fr>
20524
20525 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
20526 enum color_e.
20527 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
20528 to `normal'.
20529 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
20530 * src/lex.h: Adjust prototype.
20531 (token_t): Add `tok_undef'.
20532 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
20533 (parse_percent_token): Now returns token_t.
20534 Add default statement in switch.
20535 (lex): Separate `c' as an input variable, from the token_t result
20536 part.
20537 (unlexed): Is a token_t.
20538
20539 2001-09-10 Akim Demaille <akim@epita.fr>
20540
20541 * configure.in: Bump to 1.29a.
20542
20543 2001-09-07 Akim Demaille <akim@epita.fr>
20544
20545 Version 1.29.
20546
20547 2001-08-30 Akim Demaille <akim@epita.fr>
20548
20549 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
20550 * m4/atconfig.m4: Remove.
20551 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
20552 * tests/bison: New.
20553 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
20554 m4_if, m4_patsubst, and m4_regexp.
20555 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
20556 `input' file instead of echo.
20557
20558 2001-08-29 Akim Demaille <akim@epita.fr>
20559
20560 Bump to 1.28e.
20561
20562 2001-08-29 Akim Demaille <akim@epita.fr>
20563
20564 Version 1.28d.
20565
20566 2001-08-29 Paul Eggert <eggert@twinsun.com>
20567
20568 * src/bison.simple (yyparse): Don't take the address of an
20569 item before the start of an array, as that doesn't conform to
20570 the C Standard.
20571
20572 2001-08-29 Robert Anisko <anisko_r@epita.fr>
20573
20574 * doc/bison.texinfo (Location Tracking Calc): New node.
20575
20576 2001-08-29 Paul Eggert <eggert@twinsun.com>
20577
20578 * src/output.c (output): Do not define const, as this now
20579 causes more problems than it cures.
20580
20581 2001-08-29 Akim Demaille <akim@epita.fr>
20582
20583 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
20584 the nodes.
20585 Be sure to tag the `detailmenu'.
20586
20587 2001-08-29 Akim Demaille <akim@epita.fr>
20588
20589 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
20590 download in a tmp dir.
20591
20592 2001-08-28 Marc Autret <autret_m@epita.fr>
20593
20594 * config/depcomp: New file.
20595
20596 2001-08-28 Marc Autret <autret_m@epita.fr>
20597
20598 * doc/bison.1 (mandoc): Adjust.
20599 From Juan Manuel Guerrero.
20600
20601 2001-08-28 Marc Autret <autret_m@epita.fr>
20602
20603 * src/print_graph.c (print_state): Fix.
20604
20605 2001-08-27 Marc Autret <autret_m@epita.fr>
20606
20607 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
20608 char * members.
20609 Echo modifications to the functions prototypes.
20610 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
20611
20612 2001-08-27 Marc Autret <autret_m@epita.fr>
20613
20614 * src/vcg.c: Include `xalloc.h'.
20615 (add_colorentry): New.
20616 (add_classname): New.
20617 (add_infoname): New.
20618 * src/vcg.h: Add new prototypes.
20619
20620 2001-08-27 Akim Demaille <akim@epita.fr>
20621
20622 * Makefile.maint: Sync. again with CVS Autoconf.
20623
20624 2001-08-27 Akim Demaille <akim@epita.fr>
20625
20626 * Makefile.maint: Formatting changes.
20627 (po-update, cvs-update, update): New targets.
20628 (AMTAR): Remove.
20629
20630 2001-08-27 Akim Demaille <akim@epita.fr>
20631
20632 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
20633 * Makefile.maint: Sync. with CVS Autoconf.
20634
20635 2001-08-27 Marc Autret <autret_m@epita.fr>
20636
20637 * src/vcg.h (struct infoname_s): New.
20638 (struct colorentry_s): New.
20639 (graph_s): New fields {vertical,horizontal}_order in structure.
20640 Add `infoname' field.
20641 Add `colorentry' field;
20642 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
20643 (G_HORIZONTAL_ORDER): New.
20644 (G_INFONAME): New.
20645 (G_COLORENTRY): New.
20646 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
20647 Add output of `infoname'.
20648 Add output of `colorentry'.
20649
20650 2001-08-27 Marc Autret <autret_m@epita.fr>
20651
20652 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
20653 This one shadowed a global parameter.
20654
20655 2001-08-24 Marc Autret <autret_m@epita.fr>
20656
20657 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
20658 instead of `unsigned'.
20659 (print_state): Do not call obstack_object_size () in obstack_grow ()
20660 to avoid macro variables shadowing.
20661
20662 2001-08-23 Marc Autret <autret_m@epita.fr>
20663
20664 * src/lex.c (percent_table): Typo: s/naem/name/.
20665 Add graph option.
20666 Normalize new options declarations.
20667
20668 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
20669
20670 * tests/suite.at: Exercise %header_extension and %source_extension.
20671
20672 2001-08-16 Marc Autret <autret_m@epita.fr>
20673
20674 * src/reader.c (parse_dquoted_param): New.
20675 (parse_header_extension_decl): Use it.
20676 (parse_source_extension_decl): Likewise.
20677
20678 2001-08-16 Marc Autret <autret_m@epita.fr>
20679
20680 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
20681 (get_xxxx_str): Use assert () instead of complain ().
20682 Remove return invokations in default cases.
20683 (get_decision_str): Modify default behaviour. Remove second argument.
20684 Echo modifications on calls.
20685 (output_graph): Fix.
20686
20687 2001-08-16 Marc Autret <autret_m@epita.fr>
20688
20689 * src/getargs.c (usage): Update with ``-g, --graph''.
20690
20691 2001-08-16 Marc Autret <autret_m@epita.fr>
20692
20693 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
20694 (Option Cross Key): Likewise.
20695 * doc/bison.1: Update.
20696
20697 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
20698
20699 * src/output.c (output_master_parser): Don't finish action_obstack.
20700 (output_parser): Don't care about the muscle action, here.
20701 (prepare): Copy the action_obstack in the action muscle.
20702 (output): Free action_obstack.
20703
20704 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
20705
20706 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
20707 will contain `%union' declaration.
20708 (parse_union_decl): Delete #line directive output.
20709 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
20710 informations about %union.
20711 (parse_union_decl): Copy the union_obstack in the muscle stype.
20712 * src/bison.simple: Add new #line directive.
20713 Add typdef %%stype YYSTYPE.
20714
20715 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
20716
20717 * src/bison.simple: Add new `#line' directive.
20718
20719 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
20720
20721 * src/bison.simple: New `#line' directive.
20722 * src/output.c (output_parser): Support new dynamic muscle input_line.
20723
20724 2001-09-22 Marc Autret <autret_m@epita.fr>
20725
20726 * src/output.c (output_master_parser): New.
20727 (output_parser): Be more re-entrant.
20728
20729 2001-09-21 Marc Autret <autret_m@epita.fr>
20730
20731 * src/reader.c (copy_definition, parse_union_decl): Update and use
20732 `linef' muscle.
20733 (copy_action): Likewise.
20734 Use obstack_1grow ().
20735 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
20736
20737 2001-09-21 Marc Autret <autret_m@epita.fr>
20738
20739 * src/options.c (option_table): Adjust.
20740 * src/lex.c (parse_percent_token): Fix.
20741
20742 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
20743
20744 * src/options.c (symtab.h): Include it, need by lex.h.
20745
20746 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
20747
20748 * src/lex.c (parse_percent_token): Change type of variable `tx', which
20749 is now an option_table_struct*.
20750 (option_strcmp): New function option_strcmp.
20751 (parse_percent_token): Call option_strcmp.
20752 * src/getargs.c (xalloc.h, options.h): Include it.
20753 (getargs): Call create_long_option_table.
20754 (getargs): Free longopts at the end of the function.
20755 (shortopts): Move in options.c.
20756 * src/options.c (create_long_option_table): New function. Convert
20757 information from option_table to option structure.
20758 * src/reader.c (options.h): Include it.
20759
20760 * src/Makefile.am: Adjust.
20761 * src/options.c (option_table): Create from longopts and percent_table.
20762 * src/getargs.c (longopts): Delete.
20763 * src/lex.c (struct percent_table_struct): Delete.
20764 (percent_table): Delete.
20765 (options.h): Include it.
20766 * src/options.c: Create.
20767 * src/options.h: Create.
20768 Declare enum opt_access_e.
20769 Define struct option_table_struct.
20770
20771 2001-09-20 Marc Autret <autret_m@epita.fr>
20772
20773 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
20774 sections of Bison.
20775
20776 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
20777
20778 * src/bison.simple: s/%%filename/%%skeleton.
20779 * src/muscle_tab.c (getargs.h): Include it.
20780 (muscle_init): Insert new muscle skeleton.
20781
20782 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
20783
20784 * src/output.c (output_parser): Delete unused variable actions_dumped.
20785
20786 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
20787
20788 * src/output.c (output): Delete call to reader_output_yylsp.
20789 * src/reader.c (reader): Likewise.
20790 * src/reader.h: Delete declaration of reader_output_yylsp.
20791
20792 2001-09-02 Marc Autret <autret_m@epita.fr>
20793
20794 * src/reader.c: Include muscle_tab.h.
20795 (parse_union_decl): Update.
20796 (parse_macro_decl): Rename parse_muscle_decl.
20797 Update to use renamed functions and variable.
20798 (read_declarations, copy_action, read_additionnal_code, : Updated
20799 with correct variables and functions names.
20800 (packsymbols, reader): Likewise.
20801
20802 * src/reader.h (muscle_obstack): Extern declaration update.
20803
20804 * src/output.c: Include muscle_tab.h
20805 In all functions using macro_insert, change by using muscle_insert ().
20806 (macro_obstack): Rename muscle_obstack.
20807 Echo modifications in the whole file.
20808 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
20809 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
20810 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
20811
20812 * src/muscle_tab.h: Update double inclusion macros.
20813 (macro_entry_s): Rename muscle_entry_s.
20814 Update prototypes.
20815
20816 * src/muscle_tab.c: Include muscle_tab.h.
20817 Rename macro_tabble to muscle_table.
20818 (mhash1, mhash2, mcmp): Use muscle_entry.
20819 (macro_init): Rename muscle_init. Update.
20820 (macro_insert): Rename muscle_insert. Update.
20821 (macro_find): Rename muscle_find. Update.
20822
20823 * src/main.c: Include muscle_tab.h.
20824 (main): Call muscle_init ().
20825 * src/Makefile.am (bison_SOURCES): Echo modifications.
20826
20827 2001-09-02 Marc Autret <autret_m@epita.fr>
20828
20829 Now the files macro_tab.[ch] are named muscle_tab.[ch].
20830
20831 * src/muscle_tab.c, src/muscle_tab.h: Add files.
20832
20833 2001-09-02 Marc Autret <autret_m@epita.fr>
20834
20835 * src/macrotab.c, src/macrotab.h: Remove.
20836
20837 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
20838
20839 * src/reader.c (copy_guard): Use muscle to specify the `#line'
20840 filename.
20841
20842 2001-09-01 Marc Autret <autret_m@epita.fr>
20843
20844 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
20845 to an explicit value to activate the feature. We do it here.
20846
20847 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20848
20849 * src/output.c (prepare): Delete the `filename' muscule insertion.
20850 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
20851 (parse_union_decl): Likewise.
20852 * src/macrotab.c (macro_init): Initialize filename by infile.
20853
20854 2001-08-31 Marc Autret <autret_m@epita.fr>
20855
20856 * src/bison.simple (YYLSP_NEEDED): New definition.
20857 * src/output.c (prepare): Add macro insertion of `locations_flag'
20858
20859 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20860
20861 * src/output.c (prepare): Delete insertion of previous muscles,
20862 and insert the `prefix' muscles.
20863 * src/macrotab.c (macro_init): Likewise.
20864 (macro_init): Initialization prefix directive by `yy'.
20865 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
20866 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
20867 yylval, yydebug, yyerror, yynerrs and yyparse.
20868 New directive `#define' to substitute yydebug, ... with option
20869 name_prefix.
20870
20871 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20872
20873 * src/main.c (main): Standardize.
20874 * src/output.c (output_table_data, output_parser): Likewise.
20875 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
20876
20877 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
20878
20879 * src/reader.c (read_additionnal_code): Rename %%user_code to
20880 %%epilogue.
20881 * src/output.c (output): Rename %%declarations to %%prologue.
20882 * src/bison.simple: Echo modifications.
20883
20884 2001-08-31 Marc Autret <autret_m@epita.fr>
20885
20886 * src/reader.c (readgram): CleanUp.
20887 (output_token_defines): Likewise.
20888 (packsymbols): Likewise.
20889 (reader): Likewise.
20890 * src/output.c (output): CPP-out useless code.
20891
20892 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20893
20894 * src/reader.c (reader): Delete obsolete call to function
20895 output_trailers and output_headers.
20896 * src/output.h: Remove obsolete functions prototypes of output_headers
20897 and output_trailers.
20898
20899 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
20900
20901 * src/main.c: Include macrotab.h.
20902 * src/macrotab.h (macro_entry_s): Constify fields.
20903 Adjust functions prototypes.
20904 * src/macrotab.c (macro_insert): Constify key and value.
20905 (macro_find): Constify key.
20906 (macro_insert): Include 'xalloc.h'
20907 (macro_insert): Use XMALLOC.
20908 (macro_find): Constify return value.
20909 * src/output.c (output_table_data): Rename table to table_data.
20910 (output_parser): Constify macro_key, macro_value.
20911
20912 2001-08-30 Marc Autret <autret_m@epita.fr>
20913
20914 * src/reader.c (parse_skel_decl): New.
20915 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
20916 * src/lex.h (token_t): New token `tok_skel'.
20917 * src/lex.c (percent_table): Add skeleton option entry.
20918 Standardize.
20919
20920 2001-08-29 Marc Autret <autret_m@epita.fr>
20921
20922 * src/bison.simple: Add %%user_code directive at the end.
20923 * src/reader.c (read_additionnal_code): New.
20924 (reader): Use it.
20925 * src/output.c (output_program): Remove.
20926 (output): Update.
20927
20928 2001-08-28 Marc Autret <autret_m@epita.fr>
20929
20930 * src/output.c (output_actions): Clean up.
20931 (output_gram): CPP-out useless code.
20932 * src/reader.c (reader): Clean up, CPP-out useless code.
20933
20934 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
20935
20936 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
20937 directive.
20938 * src/bison.simple: Add `%%definitions'.
20939
20940 2001-08-28 Marc Autret <autret_m@epita.fr>
20941
20942 * config/depcomp: New file.
20943
20944 2001-08-27 Paul Eggert <eggert@twinsun.com>
20945
20946 * src/bison.simple (yyparse): Don't take the address of an
20947 item before the start of an array, as that doesn't conform to
20948 the C Standard.
20949
20950 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
20951
20952 * src/output.c (output): Remove the initialization of the macro
20953 obstack. It was done too late here.
20954
20955 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
20956 completely wrong.
20957 (reader): Initialize the macro obstack here, since we need it to grow
20958 '%define' directives.
20959
20960 * src/reader.h: Declare the macro obstack as extern.
20961
20962 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
20963
20964 * src/output.c (output_parser): Fix. Store single '%' characters in
20965 the output obstack instead of throwing them away.
20966
20967 2001-08-27 Akim Demaille <akim@epita.fr>
20968
20969 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
20970
20971 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20972
20973 * lib/Makefile.am: Adjust.
20974
20975 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20976
20977 * src/bison.simple: Update and add '%%' directives.
20978
20979 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20980
20981 * src/reader.c (reader): Remove calls to 'output_headers' and
20982 'output_trailers'. Remove some C output.
20983 (readgram): Disable a piece of code that was writing a default
20984 definition for 'YYSTYPE'.
20985 (reader_output_yylsp): Remove.
20986 (packsymbols): Output token defintions to a macro.
20987 (copy_definition): Disable C output.
20988
20989 * src/reader.c (parse_macro_decl): New function used to parse macro
20990 declarations.
20991 (copy_string2): Put the body of copy_string into this new function.
20992 Add a parameter to let the caller choose whether he wants to copy the
20993 string delimiters or not.
20994 (copy_string): Be a simple call to copy_string2 with the last argument
20995 bound to true.
20996 (read_declarations): Add case for macro definition.
20997 (copy_identifier): New.
20998 (parse_macro_decl): Read macro identifiers using copy_identifier
20999 rather than lex.
21000
21001 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21002
21003 * src/output.c (prepare): Add prefixed names.
21004 (output_parser): Output semantic actions.
21005 (output_parser): Fix bug on '%%line' directives.
21006
21007 * src/output.c (output_headers): Remove. The C code printed by this
21008 function should now be in the skeletons.
21009 (output_trailers): Remove.
21010 (output): Disable call to 'reader_output_yylsp'.
21011 (output_rule_data): Do not output tables to the table obstack.
21012
21013 * src/output.c: Remove some C dedicated output.
21014 Improve the use of macro and output obstacks.
21015 (output_defines): Remove.
21016
21017 * src/output.c (output_token_translations): Associate 'translate'
21018 table with a macro. No output to the table obstack.
21019 (output_gram): Same for 'rhs' and 'prhs'.
21020 (output_stos): Same for 'stos'.
21021 (output_rule_data): Same for 'r1' and 'r2'.
21022 (token_actions): Same for 'defact'.
21023 (goto_actions): Same for 'defgoto'.
21024 (output_base): Same for 'pact' and 'pgoto'.
21025 (output_table): Same for 'table'.
21026 (output_check): Same for 'check'.
21027
21028 * src/output.c (output_table_data): New function.
21029 (output_short_table): Remove.
21030 (output_short_or_char_table): Remove.
21031
21032 * src/output.c (output_parser): Replace most of the skeleton copy code
21033 with something new. Skeletons are now processed character by character
21034 rather than line by line, and Bison looks for '%%' macros. This is the
21035 first step in making Bison's output process (a lot) more flexible.
21036 (output_parser): Use the macro table.
21037
21038 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21039
21040 * src/main.c (main): Initialize the macro table.
21041
21042 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21043
21044 * src/lex.c (percent_table): Add tok_define.
21045 * src/lex.h: Add tok_define.
21046
21047 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21048
21049 * src/macrotab.c: New file.
21050 * src/macrotab.h: New file.
21051 * src/Makefile.am: Update.
21052
21053 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21054
21055 * lib/hash.c: New file.
21056 * lib/hash.h: New file.
21057 * lib/Makefile.am: Update.
21058
21059 2001-08-15 Akim Demaille <akim@epita.fr>
21060
21061 Version 1.28c.
21062
21063 2001-08-15 Marc Autret <autret_m@epita.fr>
21064
21065 * src/reader.c (readgram): Indent output macro YYSTYPE.
21066 (packsymbols): Likewise.
21067 (output_token_defines): Likewise.
21068 * src/files.c: Standardize.
21069 (compute_header_macro): New.
21070 (defines_obstack_save): New. Use compute_header_macro.
21071 (output_files): Update. Use defines_obstack_save.
21072
21073 2001-08-15 Akim Demaille <akim@epita.fr>
21074
21075 * doc/bison.texinfo (Table of Symbols): Document
21076 YYSTACK_USE_ALLOCA.
21077
21078 2001-08-15 Akim Demaille <akim@epita.fr>
21079
21080 * missing: Update from CVS Automake.
21081 * config/config.guess, config/config.sub, config/texinfo.tex:
21082 Update from gnu.org.
21083
21084 2001-08-15 Akim Demaille <akim@epita.fr>
21085
21086 * Makefile.maint: Sync with CVS Autoconf.
21087
21088 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
21089
21090 * doc/bison.texinfo: Include GNU Free Documentation License from
21091 `fdl.texi'.
21092 * doc/fdl.texi: Add to package.
21093
21094 2001-08-14 Marc Autret <autret_m@epita.fr>
21095
21096 Turn on %{source,header}_extension features.
21097
21098 * src/lex.c (percent_table): Un-CPP out header_extension and
21099 source_extension.
21100 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
21101 (compute_exts_from_src): Remove conditions. It restores priorities
21102 between options.
21103
21104 2001-08-14 Marc Autret <autret_m@epita.fr>
21105
21106 * src/files.c (compute_base_names): Add extensions computing when
21107 `--file-prefix' used.
21108 Standardize function calls.
21109
21110 2001-08-13 Marc Autret <autret_m@epita.fr>
21111
21112 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
21113 defining it (defined but null disables alloca).
21114
21115 2001-08-13 Marc Autret <autret_m@epita.fr>
21116
21117 * src/bison.simple (_yy_memcpy): CPP reformat.
21118
21119 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
21120
21121 * tests/atconfig.in (CPPFLAGS): Fix.
21122
21123 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
21124
21125 * doc/bison.texinfo: Include GNU General Public License from
21126 `gpl.texi'.
21127 * doc/gpl.texi: Add to package.
21128
21129 2001-08-10 Marc Autret <autret_m@epita.fr>
21130
21131 * src/print_graph.h: Fix.
21132 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
21133
21134 2001-08-10 Akim Demaille <akim@epita.fr>
21135
21136 * src/system.h: Provide default declarations for stpcpy, strndup,
21137 and strnlen.
21138
21139 2001-08-10 Robert Anisko <anisko_r@epita.fr>
21140
21141 * doc/bison.texinfo (Locations): Update @$ stuff.
21142
21143 2001-08-09 Robert Anisko <anisko_r@epita.fr>
21144
21145 * src/bison.simple (YYLLOC_DEFAULT): Update.
21146 (yyparse): Adjust.
21147
21148 2001-08-08 Marc Autret <autret_m@epita.fr>
21149
21150 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
21151 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
21152 Reported by Fabrice Bauzac.
21153
21154 2001-08-08 Marc Autret <autret_m@epita.fr>
21155
21156 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
21157 * src/vcg.c (output_node): Fix.
21158 * src/vcg.h: Cleanup.
21159 * src/print_graph.c: Add comments.
21160 (node_output_size): New global variable. Simplify the formatting of
21161 the VCG graph output.
21162 (print_actions): Unused code is now used. It notifies the final state
21163 and no action states in the VCG graph. It also give the reduce actions.
21164 The `shift and goto' edges are red and the `go to state' edges are
21165 blue.
21166 Get the current node name and node_obstack by argument.
21167 (node_obstack): New variable.
21168 (print_state): Manage node_obstack.
21169 (print_core): Use node_obstack given by argument.
21170 A node is not only computed here but in print_actions also.
21171 (print_graph): CPP out useless code instead of commenting it.
21172
21173 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
21174
21175 * tests/atconfig.in (CPPFLAGS): Fix.
21176
21177 2001-08-07 Akim Demaille <akim@epita.fr>
21178
21179 * src/print_graph.c (quote): New.
21180 (print_core): Use it.
21181
21182 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
21183
21184 * src/vcg.c (complain.h): Include it.
21185 Unepitaize `return' invocations.
21186 [NDEBUG] (main): Remove.
21187 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
21188 * src/files.c (open_files): Initialize graph_obstack.
21189 * src/print_graph.c (print_actions): CPP out useless code.
21190 (print_core): Don't output the last `\n' in labels.
21191 Use `quote'.
21192 * src/files.c (output_files): Output the VCG file.
21193 * src/main.c (main): Invoke print_graph ();
21194
21195 2001-08-06 Marc Autret <autret_m@epita.fr>
21196
21197 Automaton VCG graph output.
21198 Using option ``-g'' or long option ``--graph'', you can generate
21199 a gram_filename.vcg file containing a VCG description of the LALR (1)
21200 automaton of your grammar.
21201
21202 * src/main.c: Call to print_graph() function.
21203 * src/getargs.h: Update.
21204 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
21205 (graph_flag): New flag.
21206 (longopts): Update.
21207 (getargs): Add case `g'.
21208 * src/files.c (graph_obstack): New obstack struct.
21209 (open_files): Initialize new obstack.
21210 (output_files): Saves graph_obstack if required.
21211 * src/files.h (graph_obstack): New extern declaration.
21212 * src/Makefile.am: Add new source files.
21213
21214 2001-08-06 Marc Autret <autret_m@epita.fr>
21215
21216 * src/print_graph.c, src/print_graph.h (graph): New.
21217 * src/vcg.h: New file.
21218 * src/vcg.c: New file, VCG graph handling.
21219
21220 2001-08-06 Marc Autret <autret_m@epita.fr>
21221
21222 Add of %source_extension and %header_extension which specify
21223 the source or/and the header output file extension.
21224
21225 * src/files.c (compute_base_names): Remove initialisation of
21226 src_extension and header_extension.
21227 (compute_exts_from_gf): Update.
21228 (compute_exts_from_src): Update.
21229 (output_files): Update.
21230 * src/reader.c (parse_header_extension_decl): New.
21231 (parse_source_extension_decl): New.
21232 (read_declarations): New case statements for the new tokens.
21233 * src/lex.c (percent_table): Add entries for %source_extension
21234 and %header_extension.
21235 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
21236
21237 2001-08-06 Marc Autret <autret_m@epita.fr>
21238
21239 * configure.in: Bump to 1.28c.
21240 * doc/bison.texinfo: Texinfo thingies.
21241
21242 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
21243
21244 * tests/atconfig.in (CPPFLAGS): Add.
21245 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
21246
21247 2001-08-03 Akim Demaille <akim@epita.fr>
21248
21249 Version 1.28b.
21250
21251 2001-08-03 Akim Demaille <akim@epita.fr>
21252
21253 * tests/Makefile.am (check-local): Ship testsuite.
21254 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
21255 Include `string.h'.
21256
21257 2001-08-03 Akim Demaille <akim@epita.fr>
21258
21259 * configure.in: Try using -Wformat when compiling.
21260
21261 2001-08-03 Akim Demaille <akim@epita.fr>
21262
21263 * configure.in: Bump to 1.28b.
21264
21265 2001-08-03 Akim Demaille <akim@epita.fr>
21266
21267 * src/complain.c: Adjust strerror_r portability issues.
21268
21269 2001-08-03 Akim Demaille <akim@epita.fr>
21270
21271 Version 1.28a.
21272
21273 2001-08-03 Akim Demaille <akim@epita.fr>
21274
21275 * src/getargs.c, src/getarg.h (skeleton)): Constify.
21276 * src/lex.c (literalchar): Avoid name clashes on `buf'.
21277 * src/getargs.c: Include complain.h.
21278 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
21279 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
21280
21281 2001-08-03 Akim Demaille <akim@epita.fr>
21282
21283 * src/reader.c (readgram): Display hidden chars in error messages.
21284
21285 2001-08-03 Akim Demaille <akim@epita.fr>
21286
21287 Update to gettext 0.10.39.
21288
21289 2001-08-03 Akim Demaille <akim@epita.fr>
21290
21291 * lib/strspn.c: New.
21292
21293 2001-08-01 Marc Autret <autret_m@epita.fr>
21294
21295 * doc/bison.texinfo: Update.
21296 * doc/bison.1 (mandoc): Update.
21297 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
21298 * src/files.c: Support output files extensions computing.
21299 (src_extension): New static variable.
21300 (header_extension): New static variable.
21301 (tr): New function.
21302 (get_extension_index): New function, gets the index of an extension
21303 filename in a string.
21304 (compute_exts_from_gf): New function, computes extensions from the
21305 grammar file extension.
21306 (compute_exts_from_src): New functions, computes extensions from the
21307 C source file extension, file given by ``-o'' option.
21308 (compute_base_names): Update.
21309 (output_files): Update.
21310
21311 2001-08-01 Robert Anisko <anisko_r@epita.fr>
21312
21313 * doc/bison.texi: Document @$.
21314 (Locations): New section.
21315
21316 2001-07-18 Akim Demaille <akim@epita.fr>
21317
21318 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
21319 * config/prev-version.txt, config/move-if-change: New.
21320 * Makefile.am: Adjust.
21321
21322 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
21323
21324 * src/bison.simple (yyparse): Suppress warning `comparaison
21325 between signed and unsigned'.
21326
21327 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
21328
21329 * src/getargs.h (raw_flag): Remove.
21330 * src/getargs.c: Die on `-r'/`--raw'.
21331 * src/lex.c (parse_percent_token): Die on `%raw'.
21332 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
21333 * tests/calc.at: Suppress test with option `--raw'.
21334
21335 2001-07-14 Akim Demaille <akim@epita.fr>
21336
21337 * config/: New.
21338 * configure.in: Require Autoconf 2.50.
21339 Update to gettext 0.10.38.
21340
21341 2001-03-16 Akim Demaille <akim@epita.fr>
21342
21343 * doc/bison.texinfo: ANSIfy the examples.
21344
21345 2001-03-16 Akim Demaille <akim@epita.fr>
21346
21347 * getargs.c (skeleton): New variable.
21348 (longopts): --skeleton is a new option.
21349 (shortopts, getargs): -S is a new option.
21350 * getargs.h: Declare skeleton.
21351 * output.c (output_parser): Use it.
21352
21353 2001-03-16 Akim Demaille <akim@epita.fr>
21354
21355 * m4/strerror_r.m4: New.
21356 * m4/error.m4: Run AC_FUNC_STRERROR_R.
21357 * lib/error.h, lib/error.c: Update.
21358
21359 2001-03-16 Akim Demaille <akim@epita.fr>
21360
21361 * src/getargs.c (longopts): Clean up.
21362
21363 2001-02-21 Akim Demaille <akim@epita.fr>
21364
21365 * src/reader.c (gensym): `gensym_count' is your own.
21366 Use a static buf to create the symbol name, as token_buffer is no
21367 longer a buffer.
21368
21369 2001-02-08 Akim Demaille <akim@epita.fr>
21370
21371 * src/conflicts.c (conflict_report): Be sure not to append to res
21372 between two calls, which could happen if both first sprintf were
21373 skipped, but not the first cp += strlen.
21374
21375 2001-02-08 Akim Demaille <akim@epita.fr>
21376
21377 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
21378 New, from fileutils 4.0.37.
21379 * configure.in: Require Autoconf 2.49c. I took some time before
21380 making this decision. This is the only way out for portability
21381 issues in Bison, it would mean way too much duplicate effort to
21382 import in Bison features implemented in 2.49c since 2.13.
21383 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
21384
21385 2001-02-02 Akim Demaille <akim@epita.fr>
21386
21387 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
21388 * lib/xalloc.h, lib/xmalloc.c: Update.
21389
21390 2001-01-19 Akim Demaille <akim@epita.fr>
21391
21392 Get rid of the ad hoc handling of token_buffer in the scanner: use
21393 the obstacks.
21394
21395 * src/lex.c (token_obstack): New.
21396 (init_lex): Initialize it. No longer call...
21397 (grow_token_buffer): this. Remove it.
21398 Adjust all the places which used it to use the obstack.
21399
21400 2001-01-19 Akim Demaille <akim@epita.fr>
21401
21402 * src/lex.h: Rename all the tokens:
21403 s/\bENDFILE\b/tok_eof/g;
21404 s/\bIDENTIFIER\b/tok_identifier/g;
21405 etc.
21406 Let them be enums, not #define, to ease debugging.
21407 Adjust all the code.
21408
21409 2001-01-18 Akim Demaille <akim@epita.fr>
21410
21411 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
21412 * src/lex.c (maxtoken, grow_token_buffer): Static.
21413
21414 2001-01-18 Akim Demaille <akim@epita.fr>
21415
21416 Since we now use obstacks, more % directives can be enabled.
21417
21418 * src/lex.c (percent_table): Also accept `%yacc',
21419 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
21420 `%debug'.
21421 Handle the actions for `%semantic_parser' and `%pure_parser' here,
21422 instead of returning a token.
21423 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
21424 * src/reader.c (read_declarations): Adjust.
21425 * src/files.c (open_files): Don't call `compute_base_names', don't
21426 compute `attrsfile' since they depend upon data which might be
21427 *in* the input file now.
21428 (output_files): Do it here.
21429 * src/output.c (output_headers): Document the fact that this patch
21430 introduces a guaranteed SEGV for semantic parsers.
21431 * doc/bison.texinfo: Document them.
21432 * tests/suite.at: Exercise these %options.
21433
21434 2000-12-20 Akim Demaille <akim@epita.fr>
21435
21436 Also handle the output file (--verbose) with obstacks.
21437
21438 * files.c (foutput): Remove.
21439 (output_obstack): New.
21440 Adjust all dependencies.
21441 * src/conflicts.c: Return a string.
21442 * src/system.h (obstack_grow_string): Rename as...
21443 (obstack_sgrow): this. Be ready to work with non literals.
21444 (obstack_fgrow4): New.
21445
21446 2000-12-20 Akim Demaille <akim@epita.fr>
21447
21448 * src/files.c (open_files): Fix the computation of short_base_name
21449 in the case of `-o foo.tab.c'.
21450
21451 2000-12-20 Akim Demaille <akim@epita.fr>
21452
21453 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
21454 (copy_dollar): Now that everything uses obstacks, get rid of the
21455 FILE * parameters.
21456
21457 2000-12-20 Akim Demaille <akim@epita.fr>
21458
21459 * src/files.c (open_files): Actually the `.output' file is based
21460 on the short_base_name, not base_name.
21461 * tests/suite.at (Checking output file names): Adjust.
21462
21463 2000-12-20 Akim Demaille <akim@epita.fr>
21464
21465 * src/bison.s1: Remove, we now use directly...
21466 * src/bison.simple: this.
21467 * src/Makefile.am: Use pkgdata instead of data.
21468
21469 2000-12-20 Akim Demaille <akim@epita.fr>
21470
21471 * src/files.c (guard_obstack): New.
21472 (open_files): Initialize it.
21473 (output_files): Dump it...
21474 * src/files.h: Export it.
21475 * src/reader.c (copy_guard): Use it.
21476
21477 2000-12-19 Akim Demaille <akim@epita.fr>
21478
21479 * src/files.c (outfile, defsfile, actfile): Removed as global
21480 vars.
21481 (open_files): Don't compute them.
21482 (output_files): Adjust.
21483 (base_name, short_base_name): Be global.
21484 Adjust dependencies.
21485
21486 2000-12-19 Akim Demaille <akim@epita.fr>
21487
21488 * src/files.c (strsuffix): New.
21489 (stringappend): Be just like strcat but allocate.
21490 (base_names): Eve out from open_files.
21491 Try to simplify the rather hairy computation of base_name and
21492 short_base_name.
21493 (open_files): Use it.
21494 * tests/suite.at (Checking output file names): New test.
21495
21496 2000-12-19 Akim Demaille <akim@epita.fr>
21497
21498 * src/system.h (obstack_grow_literal_string): Rename as...
21499 (obstack_grow_string): this.
21500 * src/output.c (output_parser): Recognize `%% actions' instead of
21501 `$'.
21502 * src/bison.s1: s/$/%% actions/.
21503 * src/bison.hairy: Likewise.
21504
21505 2000-12-19 Akim Demaille <akim@epita.fr>
21506
21507 * src/output.c (output_parser): Compute the `#line' lines when
21508 there are.
21509 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
21510 Suggested by Hans Aberg.
21511
21512 2000-12-19 Akim Demaille <akim@epita.fr>
21513
21514 Let the handling of the skeleton files be local to the procedures
21515 that use it.
21516
21517 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
21518 longer static.
21519 (fparser, open_extra_files): Remove.
21520 (open_files, output_files): Don't take care of fparser.
21521 * src/files.h: Adjust.
21522 * src/output.c (output_parser): Open and close the file to the
21523 skeleton.
21524 * src/reader.c (read_declarations): When %semantic_parser, open
21525 fguard.
21526
21527 2000-12-19 Akim Demaille <akim@epita.fr>
21528
21529 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
21530 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
21531
21532 2000-12-19 Akim Demaille <akim@epita.fr>
21533
21534 * src/files.c (open_files): Yipee! We no longer need all the code
21535 looking for `/tmp' since we have no tmp file.
21536
21537 2000-12-19 Akim Demaille <akim@epita.fr>
21538
21539 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
21540 New macros.
21541 * src/files.c (open_files): Less dependency on MSDOS etc.
21542
21543 2000-12-14 Akim Demaille <akim@epita.fr>
21544
21545 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
21546 Provide a default definition.
21547 Use it when executing the default @ action.
21548 * src/reader.c (reader_output_yylsp): No longer include
21549 `timestamp' and `text' in the default YYLTYPE.
21550
21551 2000-12-12 Akim Demaille <akim@epita.fr>
21552
21553 * src/reader.c (copy_definition, parse_union_decl, copy_action)
21554 (copy_guard): Quote the file names.
21555 Reported by Laurent Mascherpa.
21556
21557 2000-12-12 Akim Demaille <akim@epita.fr>
21558
21559 * src/output.c (output_headers, output_program, output): Be sure
21560 to escape special characters when outputting filenames.
21561 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
21562 (output_headers): Don't depend on them, Use ACTSTR.
21563
21564 2000-11-17 Akim Demaille <akim@epita.fr>
21565
21566 * lib/obstack.h: Formatting changes.
21567 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
21568 prevents type checking.
21569 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
21570 cast the value to (void *): assigning a `foo *' to a `void *'
21571 variable is valid.
21572 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
21573 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
21574 append characters.
21575
21576 2000-11-17 Akim Demaille <akim@epita.fr>
21577
21578 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
21579 as...
21580 (suite.m4, regression.m4, calc.m4): these.
21581 * tests/atgeneral.m4: Update from CVS Autoconf.
21582
21583 2000-11-17 Akim Demaille <akim@epita.fr>
21584
21585 * tests/regression.m4 (%union and --defines): New test,
21586 demonstrating a current bug in the obstack implementation.
21587
21588 2000-11-17 Akim Demaille <akim@epita.fr>
21589
21590 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
21591 macros.
21592 Use them to declare the variables which are global or local to
21593 `yyparse'.
21594
21595 2000-11-17 Akim Demaille <akim@epita.fr>
21596
21597 * acconfig.h: Remove, no longer used.
21598
21599 2000-11-07 Akim Demaille <akim@epita.fr>
21600
21601 * src: s/Copyright (C)/Copyright/g.
21602
21603 2000-11-07 Akim Demaille <akim@epita.fr>
21604
21605 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
21606 defining.
21607 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
21608
21609 2000-11-07 Akim Demaille <akim@epita.fr>
21610
21611 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
21612 Merge in a single CPP if/else.
21613
21614 2000-11-07 Akim Demaille <akim@epita.fr>
21615
21616 * src/output.c (output): Remove useless variables.
21617 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
21618 argument `data' for consistency with the prototypes.
21619 Qualify it `const'.
21620 (obstack_copy, obstack_copy0): Rename the second argument as
21621 `address' for consistency. Qualify it `const'.
21622 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
21623 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
21624 `const' their input argument (`data' or `address').
21625 Adjust the corresponding macros to include `const' in casts.
21626
21627 2000-11-03 Akim Demaille <akim@epita.fr>
21628
21629 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
21630 s/PFILE1/BISON_HAIRY/.
21631 Adjust dependencies.
21632
21633 2000-11-03 Akim Demaille <akim@epita.fr>
21634
21635 For some reason, this was not applied.
21636
21637 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
21638 `unlink': it's no longer used.
21639
21640 2000-11-03 Akim Demaille <akim@epita.fr>
21641
21642 * src/files.c (skeleton_find): New function, eved out of...
21643 (open_files, open_extra_files): here.
21644
21645 2000-11-03 Akim Demaille <akim@epita.fr>
21646
21647 Don't use `atexit'.
21648
21649 * src/files.c (obstack_save): New function.
21650 (done): Rename as...
21651 (output_files): this.
21652 Use `obstack_save'.
21653 * src/main.c (main): Don't use `atexit' to register `done', since
21654 it no longer has to remove tmp files, just call `output_files'
21655 when there are no errors.
21656
21657 2000-11-02 Akim Demaille <akim@epita.fr>
21658
21659 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
21660 `unlink': it's no longer used.
21661 * src/files.h: Formatting changes.
21662
21663 2000-11-02 Akim Demaille <akim@epita.fr>
21664
21665 Remove the last uses of mktemp and unlink/delete.
21666
21667 * src/files.c (fdefines, ftable): Removed.
21668 (defines_ostack, table_obstack): New.
21669 Adjust dependencies of the former into uses of the latter.
21670 * src/output.c (output_short_or_char_table, output_short_table):
21671 Convert to using obstacks.
21672 * src/reader.c (copy_comment2): Accept one FILE * and two
21673 obstacks.
21674 (output_token_defines, reader_output_yylsp): Use obstacks.
21675 * src/system.h (obstack_fgrow3): New.
21676 * po/POTFILES.in: Adjust.
21677
21678 2000-11-01 Akim Demaille <akim@epita.fr>
21679
21680 Change each use of `fattrs' into a use of `attrs_obstack'.
21681
21682 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
21683 * src/files.c (fattrs): Remove.
21684 (attrs_obstack): New.
21685 Adjust all dependencies.
21686 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
21687
21688 2000-11-01 Akim Demaille <akim@epita.fr>
21689
21690 Introduce obstacks.
21691 Change each use of `faction' into a use of `action_obstack'.
21692
21693 * lib/obstack.h, lib/obstack.c: New files.
21694 * src/files.c (faction): Remove.
21695 (action_obstack): New.
21696 Adjust all dependencies.
21697
21698 2000-10-20 Akim Demaille <akim@epita.fr>
21699
21700 * lib/quote.h (PARAMS): New macro. Use it.
21701
21702 2000-10-16 Akim Demaille <akim@epita.fr>
21703
21704 * src/output.c (output_short_or_char_table): New function.
21705 (output_short_table, output_token_translations): Use it.
21706 (goto_actions): Use output_short_table.
21707
21708 2000-10-16 Akim Demaille <akim@epita.fr>
21709
21710 * src/symtab.c (bucket_new): New function.
21711 (getsym): Use it.
21712
21713 * src/output.c (output_short_table): New argument to display the
21714 comment associated with the table.
21715 Adjust dependencies.
21716 (output_gram): Use it.
21717 (output_rule_data): Nicer output layout for YYTNAME.
21718
21719 2000-10-16 Akim Demaille <akim@epita.fr>
21720
21721 * src/lex.c (read_typename): New function.
21722 (lex): Use it.
21723 * src/reader.c (copy_dollar): Likewise.
21724
21725 2000-10-16 Akim Demaille <akim@epita.fr>
21726
21727 * src/reader.c (copy_comment2): Expect the input stream to be on
21728 the `/' which is suspected to open a comment, instead of being
21729 called after `//' or `/*' was read.
21730 (copy_comment, copy_definition, parse_union_decl, copy_action)
21731 (copy_guard): Adjust.
21732
21733 2000-10-16 Akim Demaille <akim@epita.fr>
21734
21735 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
21736 `read_signed_integer'.
21737
21738 2000-10-16 Akim Demaille <akim@epita.fr>
21739
21740 * src/reader.c (copy_dollar): New function.
21741 (copy_guard, copy_action): Use it.
21742
21743 2000-10-16 Akim Demaille <akim@epita.fr>
21744
21745 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
21746 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
21747 New files, from Fileutils 4.0.27.
21748 * src/main.c (printable_version): Remove.
21749 * src/lex.c, src/reader.c: Use `quote'.
21750
21751 2000-10-04 Akim Demaille <akim@epita.fr>
21752
21753 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
21754
21755 2000-10-04 Akim Demaille <akim@epita.fr>
21756
21757 * doc/bison.texinfo: Various typos spotted by Neil Booth.
21758
21759 2000-10-04 Akim Demaille <akim@epita.fr>
21760
21761 When a literal string is used to define two different tokens,
21762 `bison -v' segfaults.
21763 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
21764
21765 * tests/regression.m4: New file.
21766 Include the core of the sample provided by Piotr Gackiewicz.
21767 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
21768 properly.
21769
21770 2000-10-04 Akim Demaille <akim@epita.fr>
21771
21772 * src/reader.c (parse_expect_decl): Keep `count' within the size
21773 of `buffer'.
21774 From Neil Booth.
21775
21776 2000-10-02 Paul Eggert <eggert@twinsun.com>
21777
21778 * bison.s1 (yyparse): Assign the default value
21779 unconditionally, to avoid a GCC warning and make the parser a
21780 tad smaller.
21781
21782 2000-10-02 Akim Demaille <akim@epita.fr>
21783
21784 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
21785 options.
21786
21787 2000-10-02 Akim Demaille <akim@epita.fr>
21788
21789 * src/derives.c, src/print.c, src/reduce.c: To ease the
21790 translation, move some `\n' out of the translated strings.
21791
21792 2000-10-02 Akim Demaille <akim@epita.fr>
21793
21794 The location tracking mechanism is precious for parse error
21795 messages. Nevertheless, it is enabled only when `@n' is used in
21796 the grammar, which is a different issue (you can use it in error
21797 message, but not in the grammar per se). Therefore, there should
21798 be another means to enable it.
21799
21800 * src/getargs.c (getargs): Support `--locations'.
21801 (usage): Report it.
21802 * src/getargs.h (locationsflag): Export it.
21803 * src/lex.c (percent_table): Support `%locations'.
21804 * src/reader.c (yylsp_needed): Remove this variable, now replaced
21805 with `locationsflag'.
21806 * doc/bison.texinfo: Document `--locations' and `%locations'.
21807 Sort the options.
21808 * tests/calc.m4: Test it.
21809
21810 For regularity of the names, replace each
21811 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
21812 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
21813 In addition replace each `flag' with `_flag'.
21814
21815 2000-10-02 Akim Demaille <akim@epita.fr>
21816
21817 Also test parse error messages, including with YYERROR_VERBOSE.
21818
21819 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
21820 associative).
21821 Use it to check the computations.
21822 Use it to check `nonassoc' is honored.
21823 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
21824 `--yyerror-verbose'.
21825 (_AT_CHECK_CALC): Adjust to this option.
21826 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
21827
21828 2000-10-02 Akim Demaille <akim@epita.fr>
21829
21830 Test also `--verbose', `--defines' and `--name-prefix'. Testing
21831 the latter demonstrates a flaw in the handling of non debugging
21832 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
21833 was used in order to simplify:
21834
21835 #if YYDEBUG
21836 if (yydebug)
21837 {
21838 ...
21839 }
21840 #endif
21841
21842 into
21843
21844 if (yydebug)
21845 {
21846 ...
21847 }
21848
21849 unfortunately this leads to a CPP conflict when
21850 `--name-prefix=foo' is used since it produces `#define yydebug
21851 foodebug'.
21852
21853 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
21854 (YYDPRINTF): New macro.
21855 Spread its use.
21856 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
21857 the bison options.
21858 Also test `--verbose', `--defines' and `--name-prefix'.
21859
21860 2000-10-02 Akim Demaille <akim@epita.fr>
21861
21862 Improve the readability of the produced parsers.
21863
21864 * src/bison.s1: Formatting changes.
21865 Improve the comment related to the `$' mark.
21866 (yydefault): Don't fall through to `yyresume': `goto' there.
21867 * src/output.c (output_parser): When the `$' is met, skip the end
21868 of its line.
21869 New variable, `number_of_dollar_signs', to check there's exactly
21870 one `$' in the parser skeleton.
21871
21872 2000-10-02 Akim Demaille <akim@epita.fr>
21873
21874 * lib/xstrdup.c: New file, from the fileutils.
21875 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
21876 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
21877 instead of strlen + xmalloc + strcpy.
21878 * src/symtab.c (copys): Remove, use xstrdup instead.
21879
21880 2000-10-02 Akim Demaille <akim@epita.fr>
21881
21882 * src/gram.h (associativity): New enum type which replaces the
21883 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
21884 `right_assoc', `left_assoc' and `non_assoc'.
21885 Adjust all dependencies.
21886 * src/reader.c: Formatting changes.
21887 (LTYPESTR): Don't define it, use it as a literal in
21888 `reader_output_yylsp'.
21889 * src/symtab.h (symbol_class): New enum type which replaces the
21890 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
21891 `sunknown', `stoken and `snterm'.
21892
21893 2000-10-02 Akim Demaille <akim@epita.fr>
21894
21895 * src/getargs.c (fixed_outfiles): Rename as...
21896 (yaccflag): for consistency and accuracy.
21897 Adjust dependencies.
21898
21899 2000-10-02 Akim Demaille <akim@epita.fr>
21900
21901 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
21902 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
21903 difficult and introduced a lot of core dump. It turns out that
21904 Bison used an implementation of `xmalloc' based on `calloc', and
21905 at various places it does depend upon the initialization to 0. I
21906 have not tried to isolate the pertinent places, and all the former
21907 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
21908 someone should address this issue.
21909
21910 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
21911 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
21912 files.
21913 Adjust dependencies.
21914 * src/warshall.h: New file.
21915 Propagate.
21916
21917 2000-10-02 Akim Demaille <akim@epita.fr>
21918
21919 Various anti-`extern in *.c' changes.
21920
21921 * src/system.h: Include `assert.h'.
21922
21923 2000-10-02 Akim Demaille <akim@epita.fr>
21924
21925 * src/state.h (nstates, final_state, first_state, first_shift)
21926 (first_reduction): Move their exportation from here...
21927 * src/LR0.h: to here.
21928 Adjust dependencies.
21929 * src/getargs.c (statisticsflag): New variable.
21930 Add support for `--statistics'.
21931 Adjust dependencies.
21932
21933 Remove a lot of now useless `extern' statements in most files.
21934
21935 2000-10-02 Akim Demaille <akim@epita.fr>
21936
21937 * src/LR0.h: New file.
21938 Propagate its use.
21939
21940 2000-10-02 Akim Demaille <akim@epita.fr>
21941
21942 * src/print.h: New file.
21943 Propagate its use.
21944 * src/print.c: Formatting and ordering changes.
21945 (verbose, terse): Replace with...
21946 (print_results): this new function.
21947 Adjust dependencies.
21948
21949 2000-10-02 Akim Demaille <akim@epita.fr>
21950
21951 * src/conflicts.c (conflict_report): New function.
21952 (conflict_log, verbose_conflict_log): Replace with...
21953 (print_conflicts): this function.
21954 Adjust dependencies.
21955 * src/conflicts.h: New file.
21956 Propagate its inclusion.
21957
21958 2000-10-02 Akim Demaille <akim@epita.fr>
21959
21960 * src/nullable.h: New file.
21961 Propagate its inclusion.
21962 * src/nullable.c: Formatting changes.
21963
21964 2000-10-02 Akim Demaille <akim@epita.fr>
21965
21966 * src/reduce.h: New file.
21967 Propagate its inclusion.
21968 * src/reduce.c: Topological sort and other formatting changes.
21969 (bool, TRUE, FALSE): Move their definition to...
21970 * src/system.h: here.
21971
21972 2000-10-02 Akim Demaille <akim@epita.fr>
21973
21974 * src/files.c: Formatting changes.
21975 (tryopen, tryclose, openfiles): Rename as...
21976 (xfopen, xfclose, open_files): this.
21977 (stringappend): static.
21978 * src/files.h: Complete the list of exported symbols.
21979 Propagate its use.
21980
21981 2000-10-02 Akim Demaille <akim@epita.fr>
21982
21983 * src/reader.h: New file.
21984 Propagate its use instead of tedious list of `extern' and
21985 prototypes.
21986 * src/reader.c: Formatting changes, topological sort,
21987 s/register//.
21988
21989 2000-10-02 Akim Demaille <akim@epita.fr>
21990
21991 * src/lex.h: Prototype `lex.c' exported functions.
21992 * src/reader.c: Adjust.
21993 * src/lex.c: Formatting changes.
21994 (safegetc): Rename as...
21995 (xgetc): this.
21996
21997 2000-10-02 Akim Demaille <akim@epita.fr>
21998
21999 * src/lalr.h: New file.
22000 Propagate its inclusion instead of prototypes and `extern'.
22001 * src/lalr.c: Formatting changes, topological sorting etc.
22002
22003 2000-10-02 Akim Demaille <akim@epita.fr>
22004
22005 * src/output.c (token_actions): Introduce a temporary array,
22006 YYDEFACT, that makes it possible for this function to use
22007 output_short_table.
22008
22009 2000-10-02 Akim Demaille <akim@epita.fr>
22010
22011 `user_toknums' is output as a `short[]' in `output.c', while it is
22012 defined as a `int[]' in `reader.c'. For consistency with the
22013 other output tables, `user_toknums' is now defined as a table of
22014 shorts.
22015
22016 * src/reader.c (user_toknums): Be a short table instead of an int
22017 table.
22018 Adjust dependencies.
22019
22020 Factor the short table outputs.
22021
22022 * src/output.c (output_short_table): New function.
22023 * src/output.c (output_gram, output_stos, output_rule_data)
22024 (output_base, output_table, output_check): Use it.
22025
22026 2000-10-02 Akim Demaille <akim@epita.fr>
22027
22028 * src/output.c (output): Topological sort of the functions, in
22029 order to get rid of the `static' prototypes.
22030 No longer use `register'.
22031 * src/output.h: New file.
22032 Propagate its inclusion in files explicitly prototyping functions
22033 from output.c.
22034
22035 2000-09-21 Akim Demaille <akim@epita.fr>
22036
22037 * src/atgeneral.m4: Update from Autoconf.
22038
22039 2000-09-21 Akim Demaille <akim@epita.fr>
22040
22041 * src/closure.h: New file.
22042 * src/closure.c: Formatting changes, topological sort over the
22043 functions, use of closure.h.
22044 (initialize_closure, finalize_closure): Rename as...
22045 (new_closure, free_closure): these. Adjust dependencies.
22046 * src/LR0.c: Formatting changes, topological sort, use of
22047 cloture.h.
22048 (initialize_states): Rename as...
22049 (new_states): this.
22050 * src/Makefile.am (noinst_HEADERS): Adjust.
22051
22052 2000-09-20 Akim Demaille <akim@epita.fr>
22053
22054 * src/acconfig.h: Don't protect config.h against multiple
22055 inclusion.
22056 Don't define PARAMS.
22057 * src/system.h: Define PARAMS.
22058 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
22059 purpose of config.h. system.h must not try to fix wrong
22060 definitions in config.h.
22061
22062 2000-09-20 Akim Demaille <akim@epita.fr>
22063
22064 * src/derives.h: New file.
22065 * src/main.c, src/derives.h: Use it.
22066 Formatting changes.
22067 * src/Makefile.am (noinst_HEADERS): Adjust.
22068
22069 2000-09-20 Akim Demaille <akim@epita.fr>
22070
22071 * tests/atgeneral.m4: Update from Autoconf.
22072 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
22073 (AT_CHECK_CALC): New macros.
22074 Use these macros to test bison with options `', `--raw',
22075 `--debug', `--yacc', `--yacc --debug'.
22076
22077 2000-09-19 Akim Demaille <akim@epita.fr>
22078
22079 * src/output.c: Formatting changes.
22080 * src/machine.h: Remove, leaving its contents in...
22081 * src/system.h: here.
22082 Include stdio.h.
22083 Adjust all dependencies on stdio.h and machine.h.
22084 * src/getargs.h: New file.
22085 Let all `extern' declarations about getargs.c be replaced with
22086 inclusion of `getargs.h'.
22087 * src/Makefile.am (noinst_HEADERS): Adjust.
22088
22089 * tests/calc.m4 (yyin): Be initialized in main, not on the global
22090 scope.
22091 (yyerror): Returns void, not int.
22092 * doc/bison.texinfo: Formatting changes.
22093
22094 2000-09-19 Akim Demaille <akim@epita.fr>
22095
22096 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
22097 portable.
22098
22099 2000-09-18 Akim Demaille <akim@epita.fr>
22100
22101 * configure.in: Append WARNING_CFLAGS to CFLAGS.
22102 * src/Makefile.am (INCLUDES): Don't.
22103 Be ready to fetch headers in lib/.
22104
22105 2000-09-18 Akim Demaille <akim@epita.fr>
22106
22107 * doc/bison.texinfo: Update the copyright.
22108 ANSIfy and GNUify the examples.
22109 Remove the old menu.
22110
22111 2000-09-18 Akim Demaille <akim@epita.fr>
22112
22113 First set of tests: use the `calc' example from the documentation.
22114
22115 * src/bison.s1 (yyparse): Condition the code using `yytname' which
22116 is defined only when YYDEBUG is.
22117 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
22118 * src/files.c (tryopen, tryclose): Formatting changes.
22119 Move to the top and be static.
22120 * src/reader.c (read_signed_integer): Likewise.
22121 * tests/calc.m4: New file.
22122 * Makefile.am, suite.m4: Adjust.
22123 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
22124
22125 2000-09-18 Akim Demaille <akim@epita.fr>
22126
22127 Add support for an Autotest test suite for Bison.
22128
22129 * m4/m4.m4, m4/atconfig.m4: New files.
22130 * m4/Makefile.am (EXTRA_DIST): Adjust.
22131 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
22132 files.
22133 * src/getargs.c: Display a more standard --version message.
22134 * src/reader.c (reader): Formatting changes.
22135 No longer depend upon VERSION_STRING.
22136 * configure.in: No longer use `dnl'.
22137 Set up the test suite and the new directory `tests/.
22138 (VERSION_STRING): Remove.
22139
22140 2000-04-14 Akim Demaille <akim@epita.fr>
22141
22142 * src/reader.c (copy_comment2): New function, same as former
22143 `copy_comment', but outputs into two FILE *.
22144 (copy_comment): Use it.
22145 (parse_union_decl): Use it.
22146 (get_type, parse_start_decl): Use the same `invalid' message.
22147 (parse_start_decl, parse_union_decl): Use the same `multiple'
22148 message.
22149 (parse_union_decl, copy_guard, copy_action): Use the same
22150 `unmatched' message.
22151 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
22152
22153 2000-03-31 Akim Demaille <akim@epita.fr>
22154
22155 * src/files.c (tryopen, tryclose): Move to the top.
22156 Be static.
22157
22158 2000-03-31 Akim Demaille <akim@epita.fr>
22159
22160 * src/main.c (main): Don't call `done', exit does it.
22161
22162 2000-03-31 Akim Demaille <akim@epita.fr>
22163
22164 * allocate.c: s/return (foo)/return foo/.
22165 * lalr.c: Likewise.
22166 * LR0.c: Likewise.
22167 * output.c: Likewise.
22168 * reader.c: Likewise.
22169 * symtab.c: Likewise.
22170 * vmsgetargs.c: Likewise.
22171
22172 2000-03-31 Akim Demaille <akim@epita.fr>
22173
22174 Clean up the error reporting functions.
22175
22176 * src/report.c: New file.
22177 * src/report.h: Likewise.
22178 * src/Makefile.am: Adjust.
22179 * m4/error.m4: New file.
22180 * m4/Makefile.am: Adjust.
22181 * configure.in (jm_PREREQ_ERROR): Call it.
22182 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
22183 Remove.
22184 (fatal, fatals): Remove. All callers use complain.c::fatal.
22185 (warn, warni, warns, warnss, warnss): Remove. All callers use
22186 complain.c::complain.
22187 (toomany): Remove, use fatal instead.
22188 * src/files.c (done): No argument, use complain_message_count.
22189 * src/main.c (main): Register `done' to `atexit'.
22190
22191 * src/getargs.c (usage): More `fputs', less `fprintf'.
22192
22193 2000-03-28 Akim Demaille <akim@epita.fr>
22194
22195 * lib/: New directory.
22196 * Makefile.am (SUBDIRS): Adjust.
22197 * configure.in: Adjust.
22198 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
22199 useless.
22200 * src/alloca.c: Moved to lib/.
22201 * src/getopt.c: Likewise.
22202 * src/getopt1.c: Likewise.
22203 * src/getopt.h: Likewise.
22204 * src/ansi2knr.c: Likewise.
22205 * src/ansi2knr.1: Likewise.
22206 * src/Makefile.am: Adjust.
22207 * lib/Makefile.am: New file.
22208
22209 2000-03-28 Akim Demaille <akim@epita.fr>
22210
22211 * src/getargs.c (usage): Refresh the help message.
22212
22213 2000-03-17 Akim Demaille <akim@epita.fr>
22214
22215 * src/getopt1.c: Updated from textutils 2.0e
22216 * src/getopt.c: Likewise.
22217 * src/getopt.h: Likewise.
22218
22219 2000-03-17 Akim Demaille <akim@epita.fr>
22220
22221 * src/Makefile.am (bison.simple): Fix the awk program: quote only
22222 the file name, not the whole `#line LINE FILE'.
22223
22224 2000-03-17 Akim Demaille <akim@epita.fr>
22225
22226 On syntax errors, report the token on which we choked.
22227
22228 * src/bison.s1 (yyparse): In the label yyerrlab, when
22229 YYERROR_VERBOSE, add yychar in msg.
22230
22231 2000-03-17 Akim Demaille <akim@epita.fr>
22232
22233 * src/reader.c (copy_at): New function.
22234 (copy_guard): Use it.
22235 (copy_action): Use it.
22236
22237 2000-03-17 Akim Demaille <akim@epita.fr>
22238
22239 Be kind to translators, save some useless translations.
22240
22241 * src/main.c (banner): New function.
22242 (fatal_banner): Use it.
22243 (warn_banner): Use it.
22244
22245 2000-03-17 Akim Demaille <akim@epita.fr>
22246
22247 * src/reader.c (copy_definition): Use copy_string and
22248 copy_comment. Removed now unused `match', `ended',
22249 `cplus_comment'.
22250 (copy_comment, copy_string): Moved, to be visible from
22251 copy_definition.
22252
22253 2000-03-17 Akim Demaille <akim@epita.fr>
22254
22255 * src/reader.c (copy_string): Declare `static inline'. No
22256 problems with inline, since it is checked by configure.
22257 (copy_comment): Likewise.
22258
22259 2000-03-17 Akim Demaille <akim@epita.fr>
22260
22261 * src/reader.c (packsymbols): Formatting changes.
22262
22263 2000-03-17 Akim Demaille <akim@epita.fr>
22264
22265 * src/reader.c (copy_comment): New function, factored out from:
22266 (copy_action): Use it. Removed now unused `match', `ended',
22267 `cplus_comment'.
22268 (copy_guard): Likewise.
22269
22270 2000-03-17 Akim Demaille <akim@epita.fr>
22271
22272 * src/reader.c (copy_string): New function, factored out from:
22273 (copy_action): Use it.
22274 (copy_guard): Likewise.
22275
22276 2000-03-17 Akim Demaille <akim@epita.fr>
22277
22278 Change the handling of @s so that they behave exactly like $s.
22279 There is now a pseudo variable @$ (readble and writable), location
22280 of the lhs of the rule (by default ranging from the location of
22281 the first symbol of the rhs, to the location of the last symbol,
22282 or, if the rhs is empty, YYLLOC).
22283
22284 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
22285 yyval.
22286 (yyparse): When providing a default semantic action, provide a
22287 default location action.
22288 (after the $): No longer change `*YYLSP', just stack YYLOC the
22289 same way you stack YYVAL.
22290 * src/reader.c (read_declarations): Use warns.
22291 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
22292 (copy_action, case '@'): Likewise.
22293 Use a standard error message, to save useless work from
22294 translators.
22295
22296 2000-03-17 Akim Demaille <akim@epita.fr>
22297
22298 * src/bison.s1: Formatting and cosmetics changes.
22299 * src/reader.c: Likewise.
22300 Update the Copyright notice.
22301
22302 2000-03-17 Akim Demaille <akim@epita.fr>
22303
22304 * src/bison.s1 (#line): All set to `#line' only, since the
22305 Makefile now handles them.
22306
22307 2000-03-16 Akim Demaille <akim@epita.fr>
22308
22309 * src/output.c (output_rule_data): Output the documentation of
22310 some of the tables.
22311 (Copyright notice): Update.
22312 Formatting changes.
22313
22314 2000-03-16 Akim Demaille <akim@epita.fr>
22315
22316 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
22317 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
22318 One `#if YYDEBUG' remains, since it uses variables which are
22319 defined only if `YYDEBUG != 0'.
22320
22321 2000-03-16 Akim Demaille <akim@epita.fr>
22322
22323 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
22324 and related variables so that the similarities are highlighted.
22325
22326 2000-03-16 Akim Demaille <akim@epita.fr>
22327
22328 * src/bison.s1: Properly indent CPP directives.
22329
22330 2000-03-16 Akim Demaille <akim@epita.fr>
22331
22332 * src/bison.s1: Properly indent the `alloca' CPP section.
22333
22334 2000-03-16 Akim Demaille <akim@epita.fr>
22335
22336 Do not hard code values of directories in `configure.in'.
22337 Update the `configure' tool chain.
22338
22339 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
22340 src/makefile.am.
22341 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
22342 (AC_OUTPUT): Add m4/Makefile.
22343 Bump to bison 1.28a, 1.29 has never been released.
22344 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
22345 handled via src/Makefile.am.
22346 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
22347 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
22348 autoheader.
22349 * Makefile.am (SUBDIRS): Add m4.
22350 (ACLOCAL_AM_FLAGS): New variable.
22351 (AUTOMAKE_OPTIONS): Add check-news.
22352 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
22353 the proper line number and file name.
22354 (DEFS): Propagate the location of bison library files and of the
22355 locale files.
22356 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
22357 builddir.
22358 * acinclude.m4: Remove, replaced by the directory m4.
22359 * m4/Makefile.am (EXTRA_DIST): New variable.
22360 * m4/gettext.m4: New file, from the fileutils.
22361 * m4/lcmessage.m4: Likewise
22362 * m4/progtest.m4: Likewise.
22363 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
22364
22365 2000-03-10 Akim Demaille <akim@epita.fr>
22366
22367 * src/closure.c:
22368 Formatting changes of various comments.
22369 Respect the GNU coding standards at various places.
22370 Don't use `_()' when no translation is needed.
22371
22372 1999-12-13 Jesse Thilo <jthilo@gnu.org>
22373
22374 * src/files.c:
22375 OS/2 honors TMPDIR environment variable.
22376
22377 1999-12-13 Jesse Thilo <jthilo@gnu.org>
22378
22379 * doc/bison.texinfo: Tweaked spelling and grammar.
22380 Updated ISBN.
22381 Removed reference to price of printed copy.
22382 Mention BISON_SIMPLE and BISON_HAIRY.
22383
22384 1999-12-13 Jesse Thilo <jthilo@gnu.org>
22385
22386 * configure.in, NEWS:
22387 Bison 1.29 released.
22388
22389 1999-10-27 Jesse Thilo <jthilo@gnu.org>
22390
22391 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
22392 Added reference card.
22393
22394 1999-07-26 Jesse Thilo <jthilo@gnu.org>
22395
22396 * po/ru.po: Added Russian translation.
22397
22398 1999-07-26 Jesse Thilo <jthilo@gnu.org>
22399
22400 * configure.in: Added Russian translation.
22401
22402 1999-07-06 Jesse Thilo <jthilo@gnu.org>
22403
22404 * configure.in, NEWS, README:
22405 Released version 1.28.
22406
22407 1999-06-14 Jesse Thilo <jthilo@gnu.org>
22408
22409 * src/system.h:
22410 Squashed redefinition warning on some systems.
22411
22412 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
22413 Have configure build version string instead of relying on ANSI string
22414 concatentation.
22415
22416 1999-06-14 Jesse Thilo <jthilo@gnu.org>
22417
22418 * po/POTFILES.in: Got rid of version.c.
22419
22420 1999-06-14 Jesse Thilo <jthilo@gnu.org>
22421
22422 * acconfig.h, configure.in:
22423 Have configure build version string instead of relying on ANSI string
22424 concatentation.
22425
22426 1999-06-08 Jesse Thilo <jthilo@gnu.org>
22427
22428 * doc/bison.1:
22429 Dropped mention of `+' for long-named options.
22430
22431 1999-05-30 Jesse Thilo <jthilo@gnu.org>
22432
22433 * src/files.c: Added <unistd.h> for unlink().
22434
22435 * src/Makefile.am, src/system.h:
22436 I18n fixes.
22437
22438 1999-05-30 Jesse Thilo <jthilo@gnu.org>
22439
22440 * README: Added a FAQ list.
22441
22442 * configure.in, acconfig.h:
22443 I18n fixes.
22444
22445 1999-05-30 Jesse Thilo <jthilo@gnu.org>
22446
22447 * doc/FAQ, doc/Makefile.am:
22448 Added a FAQ list.
22449
22450 1999-05-19 Jesse Thilo <jthilo@gnu.org>
22451
22452 * src/alloc.h, src/symtab.h, src/version.c:
22453 Protected inclusion of "config.h" with HAVE_CONFIG_H.
22454
22455 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22456
22457 * src/.cvsignore, src/Makefile.am:
22458 Reorganized: sources in `src', documentation in `doc'.
22459
22460 * src/lex.c (literalchar):
22461 fixed the code for escaping double quotes (thanks
22462 Jonathan Czisny.)
22463
22464 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22465
22466 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
22467 Adjusted paths to reflect directory reorganization.
22468
22469 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22470
22471 * doc/.cvsignore, doc/Makefile.am:
22472 Reorganized: sources in `src', documentation in `doc'.
22473
22474 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22475
22476 * configure.in:
22477 Updated AC_INIT file to reflect directory reorganization.
22478
22479 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
22480 Reorganized: sources in `src', documentation in `doc'.
22481
22482 1999-04-13 Jesse Thilo <jthilo@gnu.org>
22483
22484 * src/allocate.c:
22485 Don't declare calloc() and realloc() if not necessary.
22486
22487 1999-04-13 Jesse Thilo <jthilo@gnu.org>
22488
22489 * configure.in, acconfig.h, acinclude.m4:
22490 Don't declare calloc() and realloc() if not necessary.
22491
22492 1999-03-23 Jesse Thilo <jthilo@gnu.org>
22493
22494 * po/.cvsignore: Added i18n support.
22495
22496 1999-03-23 Jesse Thilo <jthilo@gnu.org>
22497
22498 * acconfig.h, configure.in, Makefile.am:
22499 Added i18n support.
22500
22501 1999-03-22 Jesse Thilo <jthilo@gnu.org>
22502
22503 * src/bison.s1: Fixed #line numbers.
22504
22505 1999-03-15 Jesse Thilo <jthilo@gnu.org>
22506
22507 * po/es.po, po/fr.po, po/nl.po, po/de.po:
22508 Added PO files from Translation Project.
22509
22510 1999-03-03 Jesse Thilo <jthilo@gnu.org>
22511
22512 * Makefile.am:
22513 Added support for non-ANSI compilers (ansi2knr).
22514
22515 1999-02-16 Jesse Thilo <jthilo@gnu.org>
22516
22517 * configure.in: Bumped version number to 1.27.
22518
22519 * Makefile.am:
22520 Added `bison.simple' to list of files removed by `make distclean'.
22521
22522 1999-02-12 Jesse Thilo <jthilo@gnu.org>
22523
22524 * src/files.c, src/files.h:
22525 Defined locations of parser files in config.h instead of Makefile.
22526
22527 1999-02-12 Jesse Thilo <jthilo@gnu.org>
22528
22529 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
22530 Defined locations of parser files in config.h instead of Makefile.
22531
22532 1999-02-09 Jesse Thilo <jthilo@gnu.org>
22533
22534 * Makefile.am:
22535 Removed inappropriate use of $< macro.
22536
22537 1999-02-05 Jesse Thilo <jthilo@gnu.org>
22538
22539 * po/Makefile.in.in, po/POTFILES.in:
22540 Add `po' directory skeleton.
22541
22542 1999-01-27 Jesse Thilo <jthilo@gnu.org>
22543
22544 * README: Document help-bison list.
22545
22546 * configure.in: Add check for mkstemp().
22547
22548 1999-01-20 Jesse Thilo <jthilo@gnu.org>
22549
22550 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
22551 Hush a few compiler warnings.
22552
22553 * src/files.c:
22554 Add tryclose(), which verifies that fclose was successful.
22555 Hush a couple of compiler warnings.
22556
22557 1999-01-20 Jesse Thilo <jthilo@gnu.org>
22558
22559 * Makefile.am, OChangeLog:
22560 ChangeLog is now automatically generated. Include the old version as
22561 OChangeLog.
22562
22563 1999-01-14 Jesse Thilo <jthilo@gnu.org>
22564
22565 * src/gram.h, src/lalr.c, src/lex.c, src/lex.h, src/machine.h, src/main.c, src/nullable.c, src/output.c, src/print.c, src/reader.c, src/reduce.c, src/state.h, src/symtab.c, src/symtab.h, src/types.h, src/vmsgetargs.c, src/warshall.c, src/allocate.c, src/alloc.h, src/bison.s1, src/closure.c, src/conflicts.c, src/derives.c, src/files.c, src/files.h, src/getargs.c, src/gram.c, src/LR0.c:
22566 Update FSF address.
22567
22568 1999-01-14 Jesse Thilo <jthilo@gnu.org>
22569
22570 * doc/bison.texinfo: Fix formatting glitch.
22571
22572 * doc/bison.texinfo: Update FSF address.
22573
22574 1999-01-14 Jesse Thilo <jthilo@gnu.org>
22575
22576 * acconfig.h: Update FSF address.
22577
22578 1999-01-08 Jesse Thilo <jthilo@gnu.org>
22579
22580 * src/system.h:
22581 Don't define PACKAGE here, since config.h defines it.
22582
22583 1998-12-30 Jesse Thilo <jthilo@gnu.org>
22584
22585 * src/reader.c: Update copyright date.
22586
22587 * src/main.c:
22588 Ditch sprintf to statically-sized buffers in fatal/warn functions in
22589 favor of output directly to stderr (avoids buffer overruns).
22590
22591 * src/reader.c: Some checks for premature EOF.
22592
22593 * src/allocate.c, src/alloc.h, src/closure.c, src/conflicts.c, src/derives.c, src/getargs.c, src/gram.c, src/lalr.c, src/lex.c, src/LR0.c, src/main.c, src/nullable.c, src/output.c, src/print.c, src/reduce.c, src/symtab.c, src/symtab.h, src/warshall.c:
22594 Use prototypes if the compiler understands them.
22595
22596 * src/files.c: Honor TMPDIR on Unix hosts.
22597 Use prototypes if the compiler understands them.
22598
22599 * src/reader.c:
22600 Fix a couple of buffer overrun bugs.
22601 Use prototypes if the compiler understands them.
22602
22603 * src/system.h: Include unistd.h and ctype.h.
22604 Use #ifdef instead of #if for NLS symbols.
22605
22606 1998-12-30 Jesse Thilo <jthilo@gnu.org>
22607
22608 * doc/bison.texinfo:
22609 Delete comment "consider using @set for edition number, etc..." since
22610 we now are doing so.
22611
22612 1998-12-30 Jesse Thilo <jthilo@gnu.org>
22613
22614 * configure.in:
22615 Use prototypes if the compiler understands them.
22616
22617 * NEWS: Document 1.26 highlights.
22618
22619 * Makefile.am: Require Automake 1.3 or later.
22620
22621 * acconfig.h:
22622 Use prototypes if the compiler understands them.
22623
22624 1998-12-29 Jesse Thilo <jthilo@gnu.org>
22625
22626 * src/version.c:
22627 Use VERSION symbol from automake for version number.
22628
22629 1998-12-29 Jesse Thilo <jthilo@gnu.org>
22630
22631 * acconfig.h, configure.in, version.cin:
22632 Use VERSION symbol from automake for version number.
22633
22634 1998-11-28 Jesse Thilo <jthilo@gnu.org>
22635
22636 * Makefile.am:
22637 Distribute original version of simple parser (bison.s1), not built
22638 version (bison.simple).
22639
22640 1998-11-28 Jesse Thilo <jthilo@gnu.org>
22641
22642 * doc/bison.texinfo: Add info dir entry.
22643
22644 * doc/bison.texinfo:
22645 Let automake put version number into documentation.
22646
22647 1998-11-26 Jesse Thilo <jthilo@gnu.org>
22648
22649 * src/bison.cld, src/build.com, src/vmshlp.mar:
22650 Add non-RCS files from /gd/gnu/bison.
22651
22652 1998-11-26 Jesse Thilo <jthilo@gnu.org>
22653
22654 * doc/bison.1:
22655 Document the BISON_HAIRY and BISON_SIMPLE variables.
22656
22657 1998-11-25 Jesse Thilo <jthilo@gnu.org>
22658
22659 * src/version.c: Build version.c automatically.
22660
22661 * src/reader.c:
22662 Fix token numbering (used to start at 258, not 257).
22663
22664 * src/system.h: Include config.h.
22665
22666 * src/getargs.c: Update bug report address.
22667
22668 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
22669 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
22670
22671 1998-11-25 Jesse Thilo <jthilo@gnu.org>
22672
22673 * Makefile.am:
22674 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
22675
22676 * configure.in, version.cin:
22677 Build version.c automatically.
22678
22679 * AUTHORS: Add AUTHORS file.
22680
22681 * README: Update bug report address.
22682
22683 * bison.simple:
22684 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
22685
22686 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
22687 Add automake stuff.
22688
22689 1998-11-25 Jesse Thilo <jthilo@gnu.org>
22690
22691 * doc/bison.texinfo: Clean up some formatting.
22692
22693 1998-05-05 Richard Stallman <rms@gnu.org>
22694
22695 * doc/bison.texinfo:
22696 Explain better why to make a pure parser.
22697
22698 1998-01-05 Richard Stallman <rms@gnu.org>
22699
22700 * src/files.c (openfiles):
22701 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
22702 find a temporary directory, if possible. Do not unlink files while
22703 they are open.
22704
22705 1997-08-25 Richard Stallman <rms@gnu.org>
22706
22707 * src/reader.c (stack_offset;):
22708 Change some warni to warns.
22709
22710 * src/lex.c (literalchar): Use warns, not warni.
22711
22712 1997-06-28 Richard Stallman <rms@gnu.org>
22713
22714 * src/bison.s1: Add a Bison version comment.
22715
22716 * src/main.c (fatal, warn, berror):
22717 Use program_name.
22718
22719 1997-06-28 Richard Stallman <rms@gnu.org>
22720
22721 * Makefile.in (bison_version): New variable.
22722 (dist): Use that variable.
22723 (bison.s1): Substitute the Bison version into bison.simple.
22724
22725 * bison.simple: Add a Bison version comment.
22726
22727 1997-06-18 Richard Stallman <rms@gnu.org>
22728
22729 * src/main.c (fatal, warn, berror):
22730 Make error messages standard.
22731 (toomany): Improve error message text.
22732
22733 * src/LR0.c, src/closure.c, src/conflicts.c, src/derives.c, src/files.c, src/lalr.c, src/lex.c, src/nullable.c, src/output.c, src/print.c, src/reader.c, src/reduce.c, src/symtab.c:
22734 new.h renamed to alloc.h.
22735
22736 1997-06-18 Richard Stallman <rms@gnu.org>
22737
22738 * Makefile.in: new.h renamed to alloc.h.
22739
22740 1997-05-24 Richard Stallman <rms@gnu.org>
22741
22742 * src/lex.c (literalchar):
22743 Fix the code for escaping \, " and '.
22744
22745 (lex): Avoid trouble when there are many chars
22746 to discard in a char literal with just several chars in it.
22747
22748 1997-05-17 Richard Stallman <rms@gnu.org>
22749
22750 * src/bison.s1:
22751 Use malloc, if using alloca is troublesome.
22752 (YYSTACK_USE_ALLOCA): New flag macro.
22753 Define it for some systems and compilers.
22754 (YYSTACK_ALLOC): New macro.
22755 (yyparse): Use YYSTACK_ALLOC to allocate stack.
22756 If it was malloc'd, free it.
22757
22758 1997-05-17 Richard Stallman <rms@gnu.org>
22759
22760 * bison.simple:
22761 Use malloc, if using alloca is troublesome.
22762 (YYSTACK_USE_ALLOCA): New flag macro.
22763 Define it for some systems and compilers.
22764 (YYSTACK_ALLOC): New macro.
22765 (yyparse): Use YYSTACK_ALLOC to allocate stack.
22766 If it was malloc'd, free it.
22767
22768 1997-04-23 Richard Stallman <rms@gnu.org>
22769
22770 * src/bison.s1:
22771 (alloca) [__hpux]: Always define as __builtin_alloca.
22772
22773 1997-04-23 Richard Stallman <rms@gnu.org>
22774
22775 * bison.simple:
22776 (alloca) [__hpux]: Always define as __builtin_alloca.
22777
22778 1997-04-22 Richard Stallman <rms@gnu.org>
22779
22780 * src/bison.s1:
22781 [__hpux]: Include alloca.h (right for HPUX 10)
22782 instead of declaring alloca (right for HPUX 9).
22783
22784 * src/bison.s1 (__yy_memcpy):
22785 Declare arg `count' as unsigned int.
22786 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
22787
22788 1997-04-22 Richard Stallman <rms@gnu.org>
22789
22790 * bison.simple:
22791 [__hpux]: Include alloca.h (right for HPUX 10)
22792 instead of declaring alloca (right for HPUX 9).
22793
22794 * bison.simple (__yy_memcpy):
22795 Declare arg `count' as unsigned int.
22796 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
22797
22798 1997-01-03 Richard Stallman <rms@gnu.org>
22799
22800 * src/allocate.c: [__STDC__ or _MSC_VER]:
22801 Declare calloc and realloc to return void *.
22802
22803 1997-01-02 Richard Stallman <rms@gnu.org>
22804
22805 * src/system.h:
22806 [_MSC_VER]: Include stdlib.h and process.h.
22807 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
22808
22809 * src/main.c (main): Return FAILURE as a value.
22810 (printable_version): Declare arg as int, not char.
22811
22812 1997-01-02 Richard Stallman <rms@gnu.org>
22813
22814 * Makefile.in (dist):
22815 Explicitly check for symlinks, and copy them.
22816
22817 1996-12-19 Richard Stallman <rms@gnu.org>
22818
22819 * src/files.c:
22820 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
22821
22822 1996-12-18 Paul Eggert <eggert@gnu.org>
22823
22824 * src/bison.s1 (yyparse):
22825 If __GNUC__ and YYPARSE_PARAM are both defined,
22826 declare yyparse to have a void * argument.
22827
22828 1996-12-18 Paul Eggert <eggert@gnu.org>
22829
22830 * bison.simple (yyparse):
22831 If __GNUC__ and YYPARSE_PARAM are both defined,
22832 declare yyparse to have a void * argument.
22833
22834 1996-12-17 Richard Stallman <rms@gnu.org>
22835
22836 * src/reduce.c (nbits): Add some casts.
22837
22838 1996-08-12 Richard Stallman <rms@gnu.org>
22839
22840 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
22841
22842 1996-08-12 Richard Stallman <rms@gnu.org>
22843
22844 * bison.simple: Test _MSDOS as well as _MSDOS_.
22845
22846 1996-07-31 Richard Stallman <rms@gnu.org>
22847
22848 * src/bison.s1:
22849 [__sun && __i386]: Include alloca.h.
22850
22851 1996-07-31 Richard Stallman <rms@gnu.org>
22852
22853 * bison.simple:
22854 [__sun && __i386]: Include alloca.h.
22855
22856 1996-07-30 Richard Stallman <rms@gnu.org>
22857
22858 * src/bison.s1: Comment change.
22859
22860 * src/bison.s1: Test _MSDOS_, not MSDOS.
22861
22862 1996-07-30 Richard Stallman <rms@gnu.org>
22863
22864 * bison.simple: Comment change.
22865
22866 * bison.simple: Test _MSDOS_, not MSDOS.
22867
22868 1996-06-01 Richard Stallman <rms@gnu.org>
22869
22870 * src/reduce.c, src/reader.c, src/print.c, src/output.c, src/nullable.c, src/lex.c, src/lalr.c, src/getargs.c, src/derives.c, src/conflicts.c, src/closure.c, src/allocate.c:
22871 Insert `_' macro around many string constants.
22872
22873 * src/main.c:
22874 Insert `_' macro around many string constants.
22875
22876 (main): Call setlocale, bindtextdomain and textdomain.
22877
22878 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
22879 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
22880 [ENABLE_NLS]: Include libintl.h.
22881 [ENABLE_NLS] (gettext): Define.
22882 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
22883 (N_, PACKAGE, LOCALEDIR): New macros.
22884
22885 1996-06-01 Richard Stallman <rms@gnu.org>
22886
22887 * POTFILES.in: New file.
22888
22889 * Makefile.in (allocate.o):
22890 Define target explicitly.
22891
22892 * Makefile.in (CFLAGS): Set to @CFLAGS@.
22893 (LDFLAGS): Set to @LDFLAGS@.
22894 (configure): Run autoconf only if preceding `cd' succeeds.
22895 (bison.s1): Redirect output to temporary file then move the
22896 temporary to the target, rather than redirecting directly to bison.s1.
22897 (clean): Remove config.status and config.log.
22898 (distclean): Don't remove config.status here.
22899
22900 1996-05-12 Richard Stallman <rms@gnu.org>
22901
22902 * src/bison.s1:
22903 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
22904
22905 1996-05-12 Richard Stallman <rms@gnu.org>
22906
22907 * bison.simple:
22908 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
22909
22910 1996-05-11 Richard Stallman <rms@gnu.org>
22911
22912 * src/bison.s1 (__yy_memcpy):
22913 Really reorder the args, as was supposedly done on Feb 14 1995.
22914 (yyparse): Calls changed accordingly.
22915
22916 1996-05-11 Richard Stallman <rms@gnu.org>
22917
22918 * Makefile.in (dist): Don't use $(srcdir).
22919
22920 * bison.simple (__yy_memcpy):
22921 Really reorder the args, as was supposedly done on Feb 14 1995.
22922 (yyparse): Calls changed accordingly.
22923
22924 1996-01-27 Richard Stallman <rms@gnu.org>
22925
22926 * src/output.c (output_rule_data):
22927 Test YYERROR_VERBOSE in the conditional
22928 around the definition of ttyname.
22929
22930 1995-12-29 Richard Stallman <rms@gnu.org>
22931
22932 * src/bison.s1:
22933 Fix line numbers in #line commands.
22934
22935 1995-12-29 Richard Stallman <rms@gnu.org>
22936
22937 * bison.simple:
22938 Fix line numbers in #line commands.
22939
22940 1995-12-27 Richard Stallman <rms@gnu.org>
22941
22942 * src/bison.s1 (YYPARSE_PARAM_DECL):
22943 In C++, make it always null.
22944 (YYPARSE_PARAM_ARG): New macro.
22945 (yyparse): Use YYPARSE_PARAM_ARG.
22946
22947 1995-12-27 Richard Stallman <rms@gnu.org>
22948
22949 * bison.simple (YYPARSE_PARAM_DECL):
22950 In C++, make it always null.
22951 (YYPARSE_PARAM_ARG): New macro.
22952 (yyparse): Use YYPARSE_PARAM_ARG.
22953
22954 1995-11-29 Richard Stallman <rms@gnu.org>
22955
22956 * doc/bison.texinfo:
22957 Describe literal string tokens, %raw, %no_lines, %token_table.
22958
22959 1995-11-29 Daniel Hagerty <hag@gnu.org>
22960
22961 * doc/bison.texinfo: Fixed update date
22962
22963 1995-10-16 Richard Stallman <rms@gnu.org>
22964
22965 * src/version.c: Version 1.25.
22966
22967 1995-10-16 Richard Stallman <rms@gnu.org>
22968
22969 * NEWS: *** empty log message ***
22970
22971 1995-10-16 Richard Stallman <rms@gnu.org>
22972
22973 * doc/bison.1, doc/bison.rnh:
22974 Add new options.
22975
22976 1995-10-15 Richard Stallman <rms@gnu.org>
22977
22978 * src/vmsgetargs.c, src/getargs.c:
22979 Added -n, -k, and -raw switches.
22980 (noparserflag, toknumflag, rawtoknumflag): New variables.
22981
22982 * src/symtab.h (SALIAS):
22983 New #define for adding aliases to %token.
22984 (struct bucket): Added `alias' field.
22985
22986 * src/reduce.c (reduce_grammar):
22987 Revise error message.
22988 (print_notices): Remove final `.' from error message.
22989
22990 * src/reader.c (reader_output_yylsp):
22991 New function.
22992 (readgram): Use `#if 0' around code that accepted %command
22993 inside grammar rules: The documentation doesn't allow it,
22994 and it will fail since the %command processors scan for the next %.
22995 (parse_token_decl): Extended the %token
22996 declaration to allow a multi-character symbol as an alias.
22997 (parse_thong_decl): New function.
22998 (read_declarations): Added %thong declarations.
22999 (read_declarations): Handle NOOP to deal with allowing
23000 % declarations as another means to specify the flags.
23001 (readgram): Allow %prec prior to semantics embedded in a rule.
23002 (skip_to_char, read_declarations, copy_definition)
23003 (parse_token_decl, parse_start_decl, parse_type_decl)
23004 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
23005 (get_type_name, copy_guard, copy_action, readgram)
23006 (get_type, packsymbols): Revised most error messages.
23007 Changed `fatal' to `warnxxx' to avoid aborting for error.
23008 Revised and use multiple warnxxx functions to avoid using VARARGS1.
23009 (read_declarations): Improve the error message for
23010 an invalid character. Do not abort.
23011 (read_declarations, copy_guard, copy_action): Use
23012 printable_version to avoid unprintable characters in printed output.
23013 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
23014 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
23015 Allow the type of a non-terminal can be given
23016 more than once, as long as all specifications give the same type.
23017
23018 * src/output.c:
23019 (output_headers, output_trailers, output, output_gram)
23020 (output_rule_data): Implement noparserflag variable.
23021 Implement toknumflag variable.
23022 (output): Call reader_output_yylsp to output LTYPESTR.
23023
23024 * src/main.c (main):
23025 If reader sees an error, don't process the grammar.
23026 (fatals): Updated to not use VARARGS1.
23027 (printable_version, int_to_string, warn, warni, warns, warnss)
23028 (warnsss): New error reporting functions. Avoid abort for error.
23029
23030 * src/lex.h:
23031 Added THONG and NOOP for alias processing.
23032 Added SETOPT for the new code that allows setting options with %flags.
23033
23034 * src/lex.c:
23035 Include getopt.h. Add some extern decls.
23036 (safegetc): New function to deal with EOF gracefully.
23037 (literalchar); new function to deal with reading \ escapes.
23038 (lex): Use literalchar.
23039 (lex): Implemented "..." tokens.
23040 (literalchar, lex, parse_percent_token): Made tokenbuffer
23041 always contain the token. This includes growing the token
23042 buffer while reading an integer.
23043 (parse_percent_token): Replaced if-else statement with percent_table.
23044 (parse_percent_token): Added % declarations as another
23045 way to specify the flags -n, -l, and -r. Also added hooks for
23046 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
23047 major changes to files.c.
23048 (lex) Retain in the incoming stream a character following
23049 an incorrect '/'.
23050 (skip_white_space, lex): Revised most error messages
23051 and changed fatal to warn to avoid aborting.
23052 (percent_table): Added %thong declarations.
23053
23054 * src/gram.h: Comment changes.
23055
23056 * src/files.c (openfiles, open_extra_files, done):
23057 Add faction flag
23058 and actfile file. Handle noparserflag. Both for -n switch.
23059
23060 * src/conflicts.c (resolve_sr_conflict):
23061 Remove use of alloca.
23062
23063 1995-06-01 Jim Meyering <meyering@gnu.org>
23064
23065 * doc/bison.texinfo: *** empty log message ***
23066
23067 1995-05-06 Richard Stallman <rms@gnu.org>
23068
23069 * src/bison.s1: Comment change.
23070
23071 1995-05-06 Richard Stallman <rms@gnu.org>
23072
23073 * bison.simple: Comment change.
23074
23075 1995-05-03 Richard Stallman <rms@gnu.org>
23076
23077 * src/version.c: Version now 1.24.
23078
23079 * src/bison.s1: Change distribution terms.
23080
23081 * src/version.c: Version now 1.23.
23082
23083 1995-05-03 Richard Stallman <rms@gnu.org>
23084
23085 * doc/bison.texinfo:
23086 Rewrite "Conditions for Using Bison".
23087 Update version to 1.24.
23088
23089 1995-05-03 Richard Stallman <rms@gnu.org>
23090
23091 * bison.simple: Change distribution terms.
23092
23093 1995-02-23 Richard Stallman <rms@gnu.org>
23094
23095 * src/files.c: Test __VMS_POSIX as well as VMS.
23096
23097 1995-02-14 Jim Meyering <meyering@gnu.org>
23098
23099 * src/bison.s1 (__yy_memcpy):
23100 Renamed from __yy_bcopy to avoid
23101 confusion. Reverse FROM and TO arguments to be consistent with
23102 those of memcpy.
23103
23104 1995-02-14 Jim Meyering <meyering@gnu.org>
23105
23106 * bison.simple (__yy_memcpy):
23107 Renamed from __yy_bcopy to avoid
23108 confusion. Reverse FROM and TO arguments to be consistent with
23109 those of memcpy.
23110
23111 1994-11-10 David J. MacKenzie <djm@gnu.org>
23112
23113 * NEWS: reformat
23114
23115 * NEWS: New file.
23116
23117 * Makefile.in (DISTFILES): Include NEWS.
23118
23119 * Makefile.in (DISTFILES):
23120 Include install-sh, not install.sh.
23121
23122 * configure.in: Update to Autoconf v2 macro names.
23123
23124 1994-10-05 David J. MacKenzie <djm@gnu.org>
23125
23126 * Makefile.in: fix typo
23127
23128 * Makefile.in (prefix, exec_prefix):
23129 Let configure set them.
23130
23131 1994-09-28 David J. MacKenzie <djm@gnu.org>
23132
23133 * Makefile.in: Set datadir to $(prefix)/share.
23134
23135 1994-09-15 Richard Stallman <rms@gnu.org>
23136
23137 * src/bison.s1:
23138 Update copyright notice and GPL version.
23139
23140 1994-09-15 Richard Stallman <rms@gnu.org>
23141
23142 * bison.simple:
23143 Update copyright notice and GPL version.
23144
23145 1994-07-12 Richard Stallman <rms@gnu.org>
23146
23147 * src/reduce.c, src/reader.c:
23148 entered into RCS
23149
23150 1994-05-05 David J. MacKenzie <djm@gnu.org>
23151
23152 * Makefile.in: entered into RCS
23153
23154 1994-03-26 Richard Stallman <rms@gnu.org>
23155
23156 * src/bison.s1: entered into RCS
23157
23158 1994-03-26 Richard Stallman <rms@gnu.org>
23159
23160 * bison.simple: entered into RCS
23161
23162 1994-03-25 Richard Stallman <rms@gnu.org>
23163
23164 * src/main.c: entered into RCS
23165
23166 1994-03-24 Richard Stallman <rms@gnu.org>
23167
23168 * src/conflicts.c: entered into RCS
23169
23170 1994-01-02 Richard Stallman <rms@gnu.org>
23171
23172 * Makefile.in: *** empty log message ***
23173
23174 1993-11-21 Richard Stallman <rms@gnu.org>
23175
23176 * src/bison.s1: *** empty log message ***
23177
23178 1993-11-21 Richard Stallman <rms@gnu.org>
23179
23180 * doc/bison.texinfo: entered into RCS
23181
23182 * doc/bison.texinfo: *** empty log message ***
23183
23184 1993-11-21 Richard Stallman <rms@gnu.org>
23185
23186 * bison.simple: *** empty log message ***
23187
23188 1993-10-25 David J. MacKenzie <djm@gnu.org>
23189
23190 * doc/bison.texinfo: *** empty log message ***
23191
23192 1993-10-19 Richard Stallman <rms@gnu.org>
23193
23194 * src/bison.s1: *** empty log message ***
23195
23196 1993-10-19 Richard Stallman <rms@gnu.org>
23197
23198 * bison.simple: *** empty log message ***
23199
23200 1993-10-14 Richard Stallman <rms@gnu.org>
23201
23202 * src/bison.s1: *** empty log message ***
23203
23204 1993-10-14 Richard Stallman <rms@gnu.org>
23205
23206 * bison.simple: *** empty log message ***
23207
23208 1993-09-14 David J. MacKenzie <djm@gnu.org>
23209
23210 * doc/bison.texinfo: *** empty log message ***
23211
23212 1993-09-13 Noah Friedman <friedman@gnu.org>
23213
23214 * Makefile.in: *** empty log message ***
23215
23216 1993-09-10 Richard Stallman <rms@gnu.org>
23217
23218 * src/conflicts.c: *** empty log message ***
23219
23220 * src/system.h: entered into RCS
23221
23222 1993-09-10 Richard Stallman <rms@gnu.org>
23223
23224 * doc/bison.1: entered into RCS
23225
23226 1993-09-06 Noah Friedman <friedman@gnu.org>
23227
23228 * src/version.c: entered into RCS
23229
23230 1993-09-06 Noah Friedman <friedman@gnu.org>
23231
23232 * Makefile.in: *** empty log message ***
23233
23234 1993-07-30 David J. MacKenzie <djm@gnu.org>
23235
23236 * Makefile.in: *** empty log message ***
23237
23238 1993-07-24 Richard Stallman <rms@gnu.org>
23239
23240 * src/bison.s1: *** empty log message ***
23241
23242 1993-07-24 Richard Stallman <rms@gnu.org>
23243
23244 * bison.simple: *** empty log message ***
23245
23246 1993-07-08 David J. MacKenzie <djm@gnu.org>
23247
23248 * Makefile.in: *** empty log message ***
23249
23250 1993-07-04 Richard Stallman <rms@gnu.org>
23251
23252 * src/bison.s1: *** empty log message ***
23253
23254 1993-07-04 Richard Stallman <rms@gnu.org>
23255
23256 * bison.simple: *** empty log message ***
23257
23258 1993-06-26 David J. MacKenzie <djm@gnu.org>
23259
23260 * src/getargs.c: entered into RCS
23261
23262 1993-06-26 David J. MacKenzie <djm@gnu.org>
23263
23264 * doc/bison.texinfo: *** empty log message ***
23265
23266 * doc/bison.1: New file.
23267
23268 1993-06-25 Richard Stallman <rms@gnu.org>
23269
23270 * src/getargs.c: New file.
23271
23272 1993-06-16 Richard Stallman <rms@gnu.org>
23273
23274 * src/bison.s1: *** empty log message ***
23275
23276 1993-06-16 Richard Stallman <rms@gnu.org>
23277
23278 * bison.simple: *** empty log message ***
23279
23280 1993-06-03 Richard Stallman <rms@gnu.org>
23281
23282 * src/bison.s1: New file.
23283
23284 1993-06-03 Richard Stallman <rms@gnu.org>
23285
23286 * doc/bison.texinfo: *** empty log message ***
23287
23288 1993-06-03 Richard Stallman <rms@gnu.org>
23289
23290 * bison.simple: New file.
23291
23292 1993-05-19 Richard Stallman <rms@gnu.org>
23293
23294 * doc/bison.texinfo: New file.
23295
23296 1993-05-07 Noah Friedman <friedman@gnu.org>
23297
23298 * Makefile.in: *** empty log message ***
23299
23300 1993-04-28 Noah Friedman <friedman@gnu.org>
23301
23302 * src/reader.c: *** empty log message ***
23303
23304 1993-04-23 Noah Friedman <friedman@gnu.org>
23305
23306 * src/alloc.h: entered into RCS
23307
23308 1993-04-20 David J. MacKenzie <djm@gnu.org>
23309
23310 * src/version.c: *** empty log message ***
23311
23312 * src/files.c, src/allocate.c:
23313 entered into RCS
23314
23315 * src/reader.c: *** empty log message ***
23316
23317 * src/lex.c: entered into RCS
23318
23319 * src/conflicts.c: New file.
23320
23321 * src/symtab.c: entered into RCS
23322
23323 * src/alloc.h: New file.
23324
23325 * src/LR0.c: entered into RCS
23326
23327 1993-04-18 Noah Friedman <friedman@gnu.org>
23328
23329 * src/reader.c: New file.
23330
23331 * src/version.c: *** empty log message ***
23332
23333 1993-04-18 Noah Friedman <friedman@gnu.org>
23334
23335 * Makefile.in: *** empty log message ***
23336
23337 1993-04-17 Noah Friedman <friedman@gnu.org>
23338
23339 * Makefile.in: *** empty log message ***
23340
23341 1993-04-15 Richard Stallman <rms@gnu.org>
23342
23343 * src/main.c, src/files.c:
23344 New file.
23345
23346 1993-04-15 Noah Friedman <friedman@gnu.org>
23347
23348 * configure.in: entered into RCS
23349
23350 * configure.in: *** empty log message ***
23351
23352 * configure.in: New file.
23353
23354 1993-04-14 Richard Stallman <rms@gnu.org>
23355
23356 * Makefile.in: New file.
23357
23358 1993-04-13 Richard Stallman <rms@gnu.org>
23359
23360 * src/version.c: New file.
23361
23362 1993-03-25 Richard Stallman <rms@gnu.org>
23363
23364 * src/output.c: entered into RCS
23365
23366 1992-09-25 Richard Stallman <rms@gnu.org>
23367
23368 * configure.bat: entered into RCS
23369
23370 1992-06-22 Richard Stallman <rms@gnu.org>
23371
23372 * src/vmsgetargs.c: entered into RCS
23373
23374 1992-06-22 Richard Stallman <rms@gnu.org>
23375
23376 * doc/bison.rnh: entered into RCS
23377
23378 1992-04-20 David J. MacKenzie <djm@gnu.org>
23379
23380 * README: entered into RCS
23381
23382 1992-01-22 Richard Stallman <rms@gnu.org>
23383
23384 * src/machine.h: entered into RCS
23385
23386 1991-12-21 Richard Stallman <rms@gnu.org>
23387
23388 * src/lalr.c, src/closure.c:
23389 entered into RCS
23390
23391 1991-12-20 Richard Stallman <rms@gnu.org>
23392
23393 * src/state.h: entered into RCS
23394
23395 1991-12-18 Richard Stallman <rms@gnu.org>
23396
23397 * src/print.c, src/nullable.c, src/derives.c:
23398 entered into RCS
23399
23400 1991-11-03 David J. MacKenzie <djm@gnu.org>
23401
23402 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
23403 entered into RCS
23404
23405 1988-09-09 Richard Stallman <rms@gnu.org>
23406
23407 * src/bison.hairy: entered into RCS
23408
23409 1987-12-16 Richard Stallman <rms@gnu.org>
23410
23411 * REFERENCES: entered into RCS
23412
23413
23414 -----
23415
23416 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
23417 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
23418 2008, 2009 Free Software Foundation, Inc.
23419
23420 Copying and distribution of this file, with or without
23421 modification, are permitted provided the copyright notice and this
23422 notice are preserved.