1 2009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
3 Pacify make maintainer-check-posix.
4 * tests/input.at (%define, --define): Move bison command-line
5 options before grammar file name.
7 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
9 Document semicolon warnings.
12 2008-12-08 Akim Demaille <demaille@gostai.com>
14 Fix portability issue in the test suite.
15 * tests/local.at (AT_MATCHES_CHECK): New.
16 Based on Perl instead of Sed. Sed has too many portability
17 pitfalls, not ever Sed is GNU Sed.
18 * tests/actions.at (Fix user actions without a trailing semicolon):
21 2008-12-07 Di-an Jan <dianj@freeshell.org>
23 Implement the FIXME that ends an user action with a semicolon
24 if it seems necessary.
25 * src/scan-code.l (flex rules section): Flag cpp directive from
26 any `#' to the first unescaped end-of-line. Semicolon is not
27 needed after `;', `{', '}', or cpp directives and is needed after
28 any other token (whitespaces and comments have no effect).
29 * tests/actions.at (Fix user actions without a trailing semicolon):
31 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
32 to make user actions complete statements.
33 Adjust column numbers in error messages.
34 * tests/regression.at (Fix user actions without a trailing semicolon):
35 Remove. Covered by new test.
37 2009-04-14 Akim Demaille <demaille@gostai.com>
40 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
41 (Table of Symbols): Remove duplicate entry for %debug.
43 2009-04-10 Eric Blake <ebb9@byu.net>
45 submodules: update to latest
46 * submodules/autoconf: Use latest upstream Autoconf.
48 2009-04-06 Eric Blake <ebb9@byu.net>
50 Work around autoconf 2.63b bug in testsuite.
51 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
52 autoconf bug related to # in test.
54 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
56 * NEWS (2.5): Describe new -D/--define feature.
58 2008-11-10 Akim Demaille <demaille@gostai.com>
61 * src/getargs.h, src/getargs.c (trace_muscle): New.
62 (trace_types, trace_args): Support it.
63 * src/output.c (output_skeleton): Use it.
65 2008-11-10 Akim Demaille <demaille@gostai.com>
68 * src/output.c (muscles_output): New, extracted from...
69 (output_skeleton): here.
72 2008-11-21 Akim Demaille <demaille@gostai.com>
74 Display the changes in cross-options.texi.
75 * build-aux/cross-options.pl ($sep): New, to separate items.
76 * doc/Makefile.am ($(srcdir)/cross-options.texi): Use diff to display
79 2008-11-20 Di-an Jan <dianj@freeshell.org>
81 Improves options in the manual.
82 * doc/bison.texinfo (-g, -x): Add space before argument.
83 (Option Cross Key): Implement FIXME: listing directives also.
84 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
85 (Short Option): Special case -d. Put arguments inside @option.
86 (Bison Directive): Add column, automatically extracted from
87 src/scan-gram.l (actual name passed as the first argument)
88 with special case for %define.
89 * doc/Makefile.am (doc/cross-options.texi): Pass src/scan-gram.l
90 to build-aux/cross-options.pl.
91 * src/getargs.c (usage): Document limitations of cross-options.pl.
92 * src/scan-gram.l: Likewise.
94 2009-02-25 Akim Demaille <demaille@gostai.com>
97 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
99 2008-12-08 Akim Demaille <demaille@gostai.com>
101 Install autoconf as a submodule to get m4sugar.
102 * .gitmodules: Add submodules/autoconf.
103 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
106 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
108 Simplify last patch slightly.
109 * src/getargs.c (getargs): Here.
111 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
113 Fix last warning from --enable-gcc-warnings.
114 * src/getargs.c (getargs): Don't assign const address to non-const
117 2008-11-17 Di-an Jan <dianj@freeshell.org>
119 Handle --enable-gcc-warnings.
120 * src/getargs.c (command_line_location): Set parameters to void.
122 2008-11-11 Akim Demaille <demaille@gostai.com>
125 * tests/actions.at, tests/regression.at: Use it.
127 2008-11-07 Akim Demaille <demaille@gostai.com>
129 Pass command line location to skeleton_arg and language_argmatch.
130 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
131 The location argument is now mandatory.
132 Adjust all dependencies.
133 (getargs): Use command_line_location.
135 2008-11-07 Akim Demaille <demaille@gostai.com>
138 * src/getargs.c (usage): Document -D.
139 Fix help string for --locations.
140 (command_line_location): New.
141 (short_options, long_options, getargs): Support -D, --define.
142 (getargs): Move -d support at the right place.
143 * doc/bison.texinfo (Bison Options): Update.
144 * tests/input.at (%define, --define): New.
146 2008-11-07 Akim Demaille <demaille@gostai.com>
148 Initialize the muscle table before parsing the command line.
149 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
150 (getargs): Define file_name.
151 * src/main.c (main): Initialize muscle_tab before calling
153 * src/muscle_tab.c (muscle_init): No longer define file_name, as
154 its value is not available yet.
156 2008-11-09 Akim Demaille <demaille@gostai.com>
158 Require the generation of parse-gram.output.
159 * src/Makefile.am (YACC): Pass --report=all.
161 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
163 * NEWS (2.5): New stub.
165 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
167 Fix options documentation.
168 * build-aux/cross-options.pl: As in --help output, write optional
169 arguments as [=ARG] not =[ARG].
170 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
172 2008-11-07 Akim Demaille <demaille@gostai.com>
175 * src/getargs.c (usage): Fix help string for -W.
177 2008-11-07 Akim Demaille <demaille@gostai.com>
179 Handle more general types of option arguments.
180 * build-aux/cross-options.pl: The argument ends at the first
181 space, not the first non-symbol character.
182 Use @var for each word appearing the argument description.
184 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
186 Remove spurious initial empty lines.
187 * data/location.cc: End the @output lines with an @.
189 2008-11-04 Akim Demaille <demaille@gostai.com>
191 Remove spurious initial empty lines.
192 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
193 * data/yacc.c: End the @output lines with an @.
195 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
197 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
198 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
199 requirements for a correct m4 are stricter.
200 * m4/m4.m4: Replace with Autoconf 2.63's m4/m4.m4.
201 * configure.ac: Update to use AC_PROG_GNU_M4.
202 Reported by Eric Blake.
204 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
206 Help with updating web manual.
207 * HACKING: Incorporate instructions from gnulib/doc/README.
208 * bootstrap.conf (gnulib_modules): Add gendocs.
210 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
212 Fix strange %define locations for default values.
213 Reported by Akim Demaille at
214 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
215 and discussed again starting at
216 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
217 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
218 because location information is bogus.
219 Use angle brackets to delimit fake file name because square brackets
220 look like underexpanded m4. Choose a better fake file name.
221 Use negative line numbers.
222 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
223 * src/location.c (location_print): If line for a boundary is negative,
224 only print that boundary's file name.
225 * src/location.h: Document that.
226 * tests/skeletons.at (%define Boolean variables: invalid skeleton
227 defaults): Update output.
229 2008-11-07 Akim Demaille <demaille@gostai.com>
231 Locations without columns for command line arguments.
232 * src/location.c (location_print): Don't display negative columns.
233 * src/location.h: Document this.
235 2009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
237 Add reminder about uploading public key to keys.gnupg.net.
238 * HACKING (Release Procedure): Here.
240 2009-03-31 Akim Demaille <demaille@gostai.com>
242 bootstrap: --help to stdout.
243 * bootstrap (usage): Don't send --help to stderr.
244 Use a here doc instead of a long string.
246 2009-03-31 Akim Demaille <demaille@gostai.com>
248 bootstrap: README-hacking no longer exists
249 * bootstrap (checkout_only_file): Set to HACKING.
251 2009-03-26 Akim Demaille <demaille@gostai.com>
253 doc: merge HACKING and README-hacking.
254 Two files is confusing.
255 Reported by Alexandre Duret-Lutz.
257 * README-hacking: Merge into...
258 * HACKING (Working from the repository): here.
260 2009-03-26 Akim Demaille <demaille@gostai.com>
262 doc: update README-hacking.
263 * README-hacking: We now use git and git submodules.
264 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
266 2009-03-26 Akim Demaille <demaille@gostai.com>
268 lalr1.cc: avoid GCC 4.3 warnings.
269 GCC 4.3 now warns about "a || b && c" and asks for explicit
271 Reported by Alexandre Duret-Lutz.
272 * data/location.cc: Update copyright years.
273 (Position::operator==): Use parens to make precedence explicit.
274 Compare lines and columns first, as they are more likely to be
275 different, and they are faster to compare.
277 2009-03-26 Akim Demaille <demaille@gostai.com>
280 * gnulib: Update to latest.
281 * lib/Makefile.am (AM_CPPFLAGS): It is now defined by gnulib, so
284 2009-01-08 Akim Demaille <demaille@gostai.com>
286 Fix grep portability issues.
287 Grep on Solaris does not support -q.
288 Reported by Summum Bonum.
290 * NEWS: Add a stub for 2.4.2.
291 * THANKS: Add Summum Bonum.
292 * tests/atlocal.in (EGREP): New.
293 (CC, CXX, XSLTPROC): Make it possible to override them via
295 * tests/java.at: Use $EGREP instead of egrep.
296 Use AT_CHECK's ignore instead of grep's -q.
298 2008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
301 * NEWS: Set version and date.
302 * lib/Makefile.am: Update copyright year.
303 * tests/atlocal.in: Update copyright year.
305 2008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
307 Semicolon feature removal is not about future language support.
308 * NEWS: The semicolon feature is no longer active for newer languages,
309 so don't claim that it causes trouble for them.
311 2008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
313 * gnulib: Update submodule to HEAD.
315 2008-12-09 Akim Demaille <demaille@gostai.com>
318 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
320 2008-12-05 Eric Blake <ebb9@byu.net>
322 Build testsuite with newer autoconf.
323 * tests/output.at (m4_expand): Don't override in newer autoconf,
324 where the underlying implementation changed.
325 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
326 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
327 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
328 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
329 since some of them contain unbalanced ')'.
331 2008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
333 * NEWS: Clarify a little.
335 2008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
337 * NEWS: Update for recent changes.
339 2008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
341 Fix unexpanded macros in GLR defines file.
342 Reported by Csaba Raduly at
343 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
344 * THANKS (Csaba Raduly): Add.
345 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
346 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
347 lexer in a separate module that includes the defines file.
348 (AT_CHECK_CALC): Use AT_FULL_COMPILE and request compilation of lexer
350 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
351 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
352 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
353 (AT_DATA_SOURCE_PROLOGUE): New.
354 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
355 (AT_DATA_SOURCE): New.
356 (AT_FULL_COMPILE): New, copied from master branch and extended to
357 support an additional source file.
359 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
361 Don't let maintainer-*-check targets force a version update.
362 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
365 2008-11-17 Di-an Jan <dianj@freeshell.org>
367 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
368 Align menus. Adjust word wrapping. Use node names for menu names.
369 (Examples): Don't abbreviate node names.
370 (LocalWords): Remove abbreviations.
371 (Copying): Make description a sentence.
372 (Java Action Features): Remove period to match the rest of menu.
374 2008-11-11 Paolo Bonzini <bonzini@gnu.org>
376 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
377 * configure.ac: Adjust usage.
378 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
379 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
380 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
382 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
384 Don't add a semicolon to actions for %skeleton or %language.
385 It breaks Java test cases as reported by Akim Demaille.
386 * src/scan-code.l: Implement.
388 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
390 Clean up %skeleton and %language priority implementation.
391 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
392 remove static qualifier because others will soon need to see it.
393 (language_prio): Likewise.
394 (getargs): Use command_line_prio rather than 0.
395 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
397 (skeleton_prio): Extern it.
398 (language_prio): Extern it.
399 * src/parse-gram.y: Use grammar_prio rather than 1.
401 2008-11-04 Akim Demaille <demaille@gostai.com>
403 * NEWS: Mention the trailing semicolon in action.
405 2008-11-04 Akim Demaille <demaille@gostai.com>
408 * NEWS: Use more outline-mode markup.
409 Suggested by Jim Meyering.
411 2008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
413 Fix user actions without a trailing semicolon.
414 Reported by Sergei Steshenko at
415 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
416 * THANKS (Sergei Steshenko): Add.
417 * src/scan-code.l (SC_RULE_ACTION): Fix it.
418 * tests/regression.at (Fix user actions without a trailing semicolon):
421 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
423 Initiate further development.
424 * NEWS: Create an empty section for new entries.
425 * gnulib: Update submodule to HEAD.
427 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
431 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
433 Prepare for next release.
434 * NEWS: Briefly mention changes since 2.3b.
435 * README: Say GNU m4 1.4.6, which we've been requiring in release
436 announcements already, not 1.4.3, which breaks the build.
438 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
440 Say %language is experimental.
441 We're thinking of extending it's effect on output file naming. See the
443 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
444 * NEWS: Say it's experimental.
445 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
446 recommend it over %skeleton for now.
447 (Bison Options): Likewise.
448 (C++ Bison Interface): Use %skeleton not %language.
449 (Calc++ Parser): Use %skeleton not %language.
450 * src/getargs.c (usage): Say it's experimental.
452 2008-11-01 Di-an Jan <dianj@freeshell.org>
453 Paolo Bonzini <bonzini@gnu.org>
455 Support all Java parser class modifiers.
456 * data/java.m4 (b4_percent_define_get3): New.
457 (b4_final_if, b4_strictfp_if): New.
458 * data/lalr1.java (final, strictfp, extends, implements): Support.
459 * doc/bison.texinfo (final, strictfp, extends, implements): Add
461 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
462 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
463 (AT_CHECK_JAVA_GREP): New.
464 (Java parser class modifiers): New test.
465 (Java parser class extends and implements): New test.
467 Model exception propagation better with throws and lex_throws.
468 * data/java.m4 (b4_list2): New.
469 (throws): Change default.
470 * data/lalr1.java (yyaction): Add throws.
471 (parse): Add lex_throws in addition to throws.
472 * doc/bison.texinfo (throws, lex_throws): Add documentation.
473 * tests/java.at (Java throws specifications): New test.
475 Improve documentation for Java parsers.
476 * doc/bison.texinfo (Java Parsers): Add subsections.
477 Don't quote first argument of %define.
478 (Java Bison Interface): Document output files. Move documentation
479 of parser class and merge into Java Parser Interface. Document
480 features that error out. Document directives with no effect.
481 Move note about Javadoc higher.
482 (Java Semantic Values): Explicitly mention stype.
483 Document that generic types cannot be used.
484 (Java Location Values): Use @deftypeivar. Document constructors.
485 Correct return value for toString.
486 (Java Parser Interface): List undocumented constants/fields.
487 Move documentation of fields added by %parse-param closer to list
488 of members. Document that token names are added as fields.
489 Document constructors accurately. Remove error method.
490 (Java Scanner Interface): Move note on %pure-parser to Java Bison
491 Interface. Describe %code lexer and yylex accutately.
492 Remove documentation that does not match the code.
493 (Java Action Features): New.
494 (Java Differences): Add reference. Add item on semantic values.
495 Add note about @{ ... @}. Clarify %% epilogue placement.
496 (Java Declarations Summary): New.
499 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
500 (b4_remove_comma): Quote test argument.
501 (b4_identification): Remove "bison" field.
502 * tests/java.at (Java parser class and package names): New test.
503 (Java %parse-param and %lex-param): New test.
504 (Java stype, position_class and location_class): New test.
506 2008-10-31 Di-an Jan <dianj@freeshell.org>
508 * data/lalr1.jave: Update copyright years.
509 (YYParser): Correct name of "generated from" file in Javadoc:
510 use b4_file_name instead of @ofile@.
511 (Location constructor): Correct Javadoc parameter name.
512 (yylloc): Add missing opening m4 quote after b4_location_if.
513 This removes a stray [ in the Javadoc of Lexer.getStartPos.
514 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
515 (YYParser constructor): Correct Javadoc parameter name.
517 2008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
519 Always put auxiliary code files in the same dir as other output files.
520 * src/files.c (compute_file_name_parts): When the user specifies
521 --output but not --file-prefix, extract the directory prefix from the
522 file prefix not from the grammar file name. This affects the location
523 of files like location.hh generated by the C++ skeleton. The includes
524 in the other output files require this fix.
525 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
526 for expected output files.
527 (Output files): Add a test for the above.
529 2008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
531 * gnulib: Update submodule to HEAD.
533 2008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
535 Update copyright year.
538 2008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
540 Don't overwrite the input file.
541 * src/files.c (output_file_name_check): Fatal error if using input file
543 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
545 (Conflicting output files): Add test.
547 2008-10-28 Akim Demaille <demaille@gostai.com>
550 * data/lalr1.cc: Formatting changes.
552 2008-10-28 Akim Demaille <demaille@gostai.com>
554 Don't define debugging functions when !YYDEBUG.
555 * data/lalr1.cc (debug_stream, set_debug_stream)
556 (debug_level_type, debug_level, set_debug_level): Don't
557 declare them when YYDEBUG is not defined.
558 The implementation are already YYDEBUG-aware.
560 2008-10-28 Akim Demaille <demaille@gostai.com>
562 Prefer "continue" for empty loop bodies.
563 * etc/bench.pl.in: Use "continue" instead of {}.
565 2008-10-28 Akim Demaille <demaille@gostai.com>
567 Space and comments changes.
568 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
569 * data/c.m4, data/lalr1.cc: Space changes.
571 2008-10-28 Akim Demaille <demaille@gostai.com>
573 Make gnulib a submodule.
575 * .gitmodules (gnulib): New.
577 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
579 Fix yyerror_range for user-defined location type in C++. Reported by
581 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
582 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
583 * THANKS (Georg Sauthoff): Add.
585 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
587 Update several administrative files mainly to facilitate releasing.
588 * HACKING (Administrivia): Make the git-merge-changelog notes more
590 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
591 (Release Procedure): Update for git and add numerous details that were
593 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
594 * maint.mk (announcement): Don't list bison as a bootstrap tool so
595 that announcements don't claim we bootstrapped with whatever bison
596 happened to be in PATH. Add flex as a bootstrap tool.
597 * Makefile.maint: Remove, previously replaced by maint.mk.
598 * Makefile.cfg: Remove, and migrate settings to...
599 * cfg.mk: ... here for the sake of `make announcement'.
600 * bootstrap.conf (gnulib_modules): Add announce-gen.
601 * README: Say GNU Bison instead of just Bison. Suggested by Karl
604 2008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
606 Small but important bugfixes for the Java skeleton.
607 * data/lalr1.java (yyerror): Change Location to b4_location_type.
608 (yy_symbol_print): Call toString on yyvaluep.
610 2008-08-29 Akim Demaille <demaille@gostai.com>
613 * doc/bison.texinfo: It refers to the last edition of this file,
614 not to the release date of Bison.
615 Reported by Joel E. Denny.
617 2008-08-29 Akim Demaille <demaille@gostai.com>
619 * README: Update FAQ pointer.
620 Reported by Joel E. Denny.
622 2008-08-27 Eric Blake <ebb9@byu.net>
624 Resync m4sugar from autoconf.
625 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
626 (m4_init): Adjust to latest m4.git changes.
627 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
629 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
630 (_m4_list_cmp): Reduce side effects.
632 2008-08-27 Akim Demaille <demaille@gostai.com>
634 Check yyerrok in calc.at.
635 * tests/calc.at (calc.y): Use yyerrok on "( error )".
636 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
639 2008-08-27 Akim Demaille <demaille@gostai.com>
641 Support yyerrok in lalr1.cc.
642 YYBACKUP is still to import back into lalr1.cc.
643 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
645 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
647 For maintainer-check*, don't recompile for a $(VERSION) update.
649 (_is-dist-target): Override the one in GNUmakefile.
650 * Makefile.am (EXTRA_DIST): Add cfg.mk.
652 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
654 Update for recent change to gnulib.
655 * src/parse-gram.y: Don't include strverscmp.h. It comes from
658 2008-08-15 Eric Blake <ebb9@byu.net>
660 Remaining m4sugar merge from autoconf.
661 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
662 * data/m4sugar/foreach.m4: New file, copied from autoconf.
663 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
664 * src/output.c (output_skeleton): Tell m4 how to find it.
666 Partial m4sugar merge from autoconf: m4_map.
667 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
668 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
669 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
670 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
672 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
674 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
677 2008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
679 Keep .version and PACKAGE_VERSION in sync.
680 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
681 dependency, and add comments justifying this in more detail. Discussed
683 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
685 2008-08-06 Eric Blake <ebb9@byu.net>
687 Partial m4sugar merge from autoconf: m4_shiftn.
688 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
689 (m4_shift2, m4_shift3): New macros.
690 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
691 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
692 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
693 * data/java.m4 (b4_remove_comma): Likewise.
695 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
696 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
697 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
698 (m4_init): Consolidate wrapped text into single m4_wrap.
699 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
702 2008-08-05 Eric Blake <ebb9@byu.net>
704 Partial m4sugar merge from autoconf: builtins, version.m4.
705 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
706 (m4_prepend): Remove, as it is unused and inherently quadratic,
707 whereas m4_append is linear in newer m4.
708 (m4_mkstemp): New builtin.
709 (m4_symbols): Make rename conditional.
710 (m4_version_prereq): Ensure fatal error if used in bison, which
711 intentionally lacks version.m4.
713 Fix comments in m4sugar.
714 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
716 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
718 Update for recent .gitignore fix in Gnulib.
719 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
720 anchored .gitignore entries.
722 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
724 Set gnu or gnits strictness.
725 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
726 development and gnits strictness for releases. Based on Eric Blake's
728 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
730 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
732 * NEWS: Clarify documentation of %language.
734 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
736 Support usage of git-merge-changelog.
737 * .gitattributes: New.
738 * HACKING: Document usage of git-merge-changelog.
739 * bootstrap: Install git-merge-changelog entries in .git/config
742 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
744 Remove remaining dependence on CVS Id keyword.
745 * ChangeLog: For the sake of people still using CVS, don't use dollars
747 * data/xslt/bison.xsl: Remove Id from header comments, where it was
749 * data/xslt/xml2dot.xsl: Likewise.
750 * data/xslt/xml2text.xsl: Likewise.
751 * data/xslt/xml2xhtml.xsl: Likewise.
752 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
753 * doc/Makefile.am (neutralize): Remove, no longer needed.
754 (.x.1): Don't use neutralize.
755 (edit): Don't substitute for ID.
756 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
758 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
760 Fix dependence on computed configure variables.
761 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
762 $(top_srcdir)/configure.ac so that changes to computed variables, such
763 as PACKAGE_VERSION, are seen.
764 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
766 2008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
768 Update copyright dates for recent changes.
770 * src/Makefile.am: Here.
771 * src/reduce.c: Here.
772 * tests/reduce.at: Here.
774 2008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
776 Use git-version-gen for version names between releases.
777 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
778 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
779 * .prev-version: New.
780 * .version.in: Remove.
781 * ChangeLog: Remove the Id previously used for capturing the CVS
783 * GNUmakefile: Remove, now copied from Gnulib.
784 * Makefile.am: Add code suggested by comments in
785 build-aux/git-version-gen.
786 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
787 .prev-version, and .version.
788 * NEWS (2.3b+): Rename to...
789 (?.?): ... this because we're dropping the "+" version naming scheme,
790 but, in general, we still can't be sure of our next release name.
791 * bootstrap: Add a quick hack to remove from .gitignore the
792 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
793 entry. This should really be fixed in gnulib instead.
794 * bootstrap.conf (gnulib_modules): Add gnumakefile.
795 * configure.ac (AC_INIT): Set version name by invoking
796 build-aux/git-version-gen.
797 (AC_CONFIG_FILES): Remove .version, now generated by
798 build-aux/git-version-gen.
799 * maint.mk: New, copied from coreutils.
800 * doc/.cvsignore (bison.1): Add.
801 * doc/.gitignore (/bison.1): Add.
802 * doc/bison.1: Remove, generated.
803 * src/.cvsignore (revision.c): Remove.
804 * src/.gitignore (/revision.c): Remove.
805 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
806 (BUILT_SOURCES): Remove revision.c.
807 (revision.c): Remove.
808 * src/getargs.c (version): Don't print revision after the VERSION.
809 * src/revision.h: Remove.
811 2008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
813 Fix untranslatable composition of sentences. Reported by Goran
815 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
816 * THANKS (Goran Uddeborg): Add.
817 * src/reduce.c (reduce_print): Report the number of nonterminals and
818 rules useless in the grammar in separate sentences.
819 * tests/reduce.at (Useless Rules): Update output.
820 (Reduced Automaton): Likewise.
821 (Underivable Rules): Likewise.
822 (Empty Language): Likewise.
824 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
826 Fix some .gitignore and .cvsignore problems.
827 * bootstrap (insert_sorted_if_absent): Replace all uses with...
828 (insert_vc_ignore): ... this new function, which prepends `/' to all
829 .gitignore entries before passing them to insert_sorted_if_absent.
830 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
831 .cvsignore files are maintained even though Bison developers run
832 bootstrap while using Git.
833 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
836 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
837 unneeded. Reported by Eric Blake.
838 * lib/.gitignore (/*~): Add.
839 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
840 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
842 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
844 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
846 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
847 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
848 * bootstrap.conf (gnulib_modules): Add unsetenv.
849 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
850 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
852 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
853 the first argument because it may become position-dependent, and unset
854 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
855 Add comments explaining these issues in more detail.
857 2008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
859 Add .gitignore everywhere based on .cvsignore.
861 * build-aux/.gitignore: New.
862 * data/.gitignore: New.
863 * doc/.gitignore: New.
864 * etc/.gitignore: New.
865 * examples/.gitignore: New.
866 * examples/calc++/.gitignore: New.
867 * lib/.gitignore: New.
868 * m4/.gitignore: New.
869 * po/.gitignore: New.
870 * runtime-po/.gitignore: New.
871 * src/.gitignore: New.
872 * tests/.gitignore: New.
874 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
876 * NEWS (2.3b+): New section, empty for now.
877 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
879 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
881 * NEWS (2.3b): Update release date since there has been a delay in
882 getting the announcements and tarballs out.
884 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
886 * NEWS: Version 2.3b.
887 * configure.ac (AC_INIT): Likewise.
888 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
890 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
892 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
893 been doing it for years.
894 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
895 (Release Procedure): Add FIXME about make alpha being unmaintained.
897 2008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
899 * data/yacc.c: Reformat m4 a little for readability.
900 * src/lalr.c (build_relations): Correct comment.
902 2008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
904 DJGPP specific issue.
905 * djgpp/config.sed: Fixes required to run configure scripts generated
908 2008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
910 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
911 coordinator@translationproject.org.
913 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
915 * THANKS: Add Eric Blake.
917 2008-04-23 Eric Blake <ebb9@byu.net>
919 Revert prior patch, by working around autoconf regression.
920 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
921 ("Output file name: ("): Uncomment test.
922 ("Output file name: )"): Likewise.
923 Based on an idea from Noah Misch.
925 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
927 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
928 2.61. Reported by Juan Manuel Guerrero at
929 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
930 * tests/output.at ("Output file name: ("): Comment out test case for
932 ("Output file name: )"): Likewise.
934 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
936 * GNUmakefile: Update git-version-gen invocation so make dist
939 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
941 Update to the current gnulib CVS repository, and fix trigraph handling
943 * bootstrap: Update gnulib CVS repository URL.
944 (symlink_to_dir): Encapsulate the code that guarantees the destination
945 directory exists into...
946 (check_dst_dir): ... this new function, and...
947 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
948 fail when copying files into lib/uniwidth/.
949 * src/output.c (prepare_symbols): When writing yytname muscles, where
950 symbol names will be encoded in C-string literals, tell quotearg to
951 escape trigraphs. This used to be the default in gnulib.
952 * tests/regression.at (Token definitions): Because of the change in
953 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
954 escapes trigraphs in symbol names. Thus, yytname no longer has
955 trigraphs unnecessarily doubly escaped. Update test case output.
956 Extend test case to be sure Bison's own error messages will no longer
957 have trigraphs in symbol names unnecessarily escaped once.
959 2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
961 Fix make dist infinite loop reported by Juan Manuel Guerrero at
962 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
963 * .cvsignore: Add .version.
965 * bootstrap.conf (gnulib_modules): Add git-version-gen.
966 * configure.ac (AC_CONFIG_FILES): Add .version.
967 * build-aux/.cvsignore: Add git-version-gen.
969 2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
971 * NEWS (2.3a+): Mention that -g now takes an argument.
972 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
973 consistency. Update the -g and -x entries now that they take
974 arguments. Use brackets to indicate optional arguments.
975 * src/getargs.c (usage): Explain the relationship between arguments of
976 long and short options more completely. Document --defines and -d
977 separately since the former takes an argument but, for POSIX Yacc, the
979 (short_options): Let -W take an optional argument like --warnings.
980 (getargs): Sort cases.
982 2008-02-28 Akim Demaille <demaille@gostai.com>
984 * doc/bison.texinfo: Fix a few typos.
986 2008-02-28 Akim Demaille <akim@epita.fr>
988 * doc/bison.texinfo (Bison Options): Document -W.
989 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
991 2008-02-28 Akim Demaille <akim@epita.fr>
993 * src/getargs.c (short_options): Split and sort for readability.
994 -g and -x take optional arguments, just like their long options.
995 * build-aux/cross-options.pl: Use /x to make the regexp easier to
997 Fix the handling of $opt which resulted in all the argument to be
998 considered as optional.
1000 2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
1002 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
1003 say its interface is experimental.
1004 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
1006 (Bison Options): In the -L and --language entry, mention Java.
1007 (Java Bison Interface): Say the interface is experimental.
1008 * src/getargs.c (usage): Mention -L and --language.
1010 * NEWS (2.3a+): Say the push parsing interface is experimental.
1011 * doc/bison.texinfo (Push Decl): Likewise.
1012 (Decl Summary): Likewise in the "%define api.push_pull" entry.
1013 (Push Parser Function): Likewise.
1014 (Pull Parser Function): Likewise.
1015 (Parser Create Function): Likewise.
1016 (Parser Delete Function): Likewise.
1017 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
1018 yypull_parse, and yypush_parse entries.
1020 * NEWS (2.3a+): Mention XML support, and say the schema is
1022 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
1023 * src/getargs.c (usage): Say the XML schema is experimental.
1025 * NEWS (2.3a+): Say option instead of flag.
1027 2008-02-21 Wojciech Polak <polak@gnu.org>
1029 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
1032 2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
1034 Fix impure push parser compile error reported by Bob Rossi at
1035 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
1036 * data/yacc.c: Clean up whitespace in the output a little.
1037 (yypstate_allocated): Define for impure push parsers regardless of
1038 whether the pull interface is also requested.
1039 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
1040 check impure push parsers without the pull interface.
1042 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
1043 yyerror takes arguments specified by %parse-param while yypstate_new
1045 * doc/bison.texinfo (Parser Create Function): Document that
1046 yypstate_new returns 0 for multiple impure parser instances.
1047 * tests/push.at (Push Parsing: Multiple impure instances): Update
1048 expected stderr output.
1050 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
1052 * runtime-po/POTFILES.in (push.c): Remove.
1054 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1056 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
1057 * data/push.c: Rename to...
1058 * data/yacc.c: ... this, overwriting it.
1059 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
1060 `%push-pull-parser' -> `%define api.push_pull "both"'.
1061 Remove old yacc.c tests, and update push.c tests to yacc.c.
1063 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1065 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
1066 `"%code top" blocks' instead of `%code "top" blocks'.
1067 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
1068 Clean up whitespace in the output a little.
1070 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1072 Fix documentation problems reported by Tim Josling at
1073 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
1074 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
1075 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
1076 integers. Explain the effect of literal string aliases on error
1077 messages. Copy token 0 documentation from the C++ skeleton
1080 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1082 Accept a token number in a %left, %right, or %nonassoc for POSIX
1083 conformance. Reported by Tim Josling at
1084 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
1085 * NEWS (2.3a+): Mention.
1086 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
1087 and code numbers are treated by precedence declarations.
1088 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
1090 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
1092 (symbol.prec): New, just like symbol but allows INT.
1093 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
1095 * tests/regression.at (Token number in precedence declaration): New
1098 2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1100 DJGPP specific issues.
1101 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
1102 be changed. Copyright timestamp adjusted.
1103 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
1104 be changed. Copyright timestamp adjusted.
1105 * djgpp/config.site: Copyright timestamp adjusted.
1106 * djgpp/config_h.sed: Copyright timestamp adjusted.
1107 * djgpp/djunpack.bat: Copyright timestamp adjusted.
1108 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
1109 filename translation list.
1110 * djgpp/subpipe.c (init_subpipe): Check the environment variables
1111 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
1112 files shall be created. Before trying to use the temp dir where the
1113 environment variable points to check that the dir really exists. If
1114 not default to the cwd as temp dir. Copyright timestamp adjusted.
1115 * djgpp/subpipe.h: Copyright timestamp adjusted.
1116 * djgpp/testsuite.sed: Copyright timestamp adjusted.
1118 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
1120 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
1122 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
1124 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
1125 Problem reported by Claudio Saavedra in
1126 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
1128 2008-01-05 Wojciech Polak <polak@gnu.org>
1130 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
1131 document's title with the input grammar file name.
1133 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
1135 Automate regression testing of the XML/XSLT implementation. Discussed
1137 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
1138 * configure.ac (XSLTPROC): New substitution.
1139 * Makefile.am (maintainer-xml-check): New phony target invoking...
1140 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
1141 invoking make maintainer-check with BISON_TEST_XML=1.
1142 * tests/atlocal.in (XSLTPROC): New.
1143 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
1144 not to report reachable memory when Bison is expected to have a
1145 non-zero exit status and (2) to compare XML/XSLT output with --graph
1146 and --report=all output for every working grammar when
1148 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
1149 (AT_BISON_CHECK_XML): New.
1150 (AT_QUELL_VALGRIND): New.
1151 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
1152 (AT_CHECK): ... don't redefine this since this was the old way to
1154 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
1155 AT_BISON_CHECK invocations.
1156 * tests/c++.at: Likewise.
1157 * tests/calc.at: Likewise.
1158 * tests/conflicts.at: Likewise.
1159 * tests/cxx-type.at: Likewise.
1160 * tests/existing.at: Likewise.
1161 * tests/glr-regression.at: Likewise.
1162 * tests/headers.at: Likewise.
1163 * tests/input.at: Likewise.
1164 * tests/java.at: Likewise.
1165 * tests/output.at: Likewise.
1166 * tests/push.at: Likewise.
1167 * tests/reduce.at: Likewise.
1168 * tests/regression.at: Likewise.
1169 * tests/sets.at: Likewise.
1170 * tests/skeletons.at: Likewise.
1171 * tests/synclines.at: Likewise.
1172 * tests/torture.at: Likewise.
1173 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
1174 tends to hang xsltproc.
1175 (Big horizontal): Likewise.
1177 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
1179 In XML output, remove redundant class attribute on symbol element.
1180 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
1181 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
1182 look up a symbol to determine whether it's a nonterminal or terminal.
1183 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
1184 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
1186 Add prec/assoc information to XML output.
1187 * src/gram.c (grammar_rules_print_xml): For each rule that has a
1188 %prec, add a percent_prec attribute.
1189 * src/print-xml.c (print_grammar): For each terminal that has a
1190 precedence or associativity, add a prec or assoc attribute.
1192 (xml_puts): Use xml_indent.
1193 (xml_printf): Use xml_indent.
1194 * src/print-xml.h (xml_indent): Prototype.
1196 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
1197 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
1199 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
1201 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
1202 (bison:ruleByNumber): ... this for clarity.
1203 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
1204 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
1205 (xsl:template match="reduction"): Update.
1206 (xsl:template match="item"): Update.
1207 (xsl:template match="reduction"): Update.
1209 In the XML output, don't print the list of rules where symbols appear.
1210 Compute it in XSLT instead. Discussed at
1211 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
1212 * data/xslt/bison.xsl (bison:ruleByLhs): New.
1213 (bison:ruleByRhs): New.
1214 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
1216 (xsl:template match="terminal/rule"): Remove.
1217 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
1219 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
1221 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
1222 bison:ruleByRhs and mode="number-link" for rule template.
1223 (xsl:template match="terminal/rule"): Remove.
1224 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
1225 bison:ruleByRhs and mode="number-link" for rule template.
1226 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
1228 (xsl:template match="rule" mode="number-link"): ... this.
1229 * src/print-xml.c (print_grammar): Don't print the list of rules.
1231 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
1233 Don't let --report affect XML output; always print all information.
1235 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
1236 * src/conflicts.c (log_resolution): Implement.
1237 * src/print-xml.c (print_core): Implement.
1238 (print_state): Implement.
1239 (print_xml): Implement.
1241 * NEWS (2.3a+): Fix quotes.
1242 * src/parse-gram.y (prologue_declaration): For consistency with -v,
1243 don't let %verbose clear the list specified by --report.
1245 2007-11-26 Akim Demaille <akim@epita.fr>
1247 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
1249 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
1251 In the XML output, list useless and unused symbols and rules with the
1252 useful ones and add a "usefulness" attribute. Discussed starting at
1253 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
1254 * src/gram.c (grammar_rules_partial_print_xml): Remove.
1255 (grammar_rules_print_xml): Print all rules instead of just those
1256 useful in the grammar, and add a "usefulness" attribute.
1257 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
1258 * src/print-xml.c (print_rules_useless_in_parser): Remove.
1259 (print_grammar): Print all nonterminals instead of just useful ones,
1260 and add a "usefulness" attribute to nonterminals and terminals.
1261 (print_xml): Don't print a separate "reductions" or
1262 "rules-useless-in-parser" element.
1263 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
1264 (reduce_xml): Remove.
1265 (reduce_token_unused_in_grammar): New.
1266 (reduce_nonterminal_useless_in_grammar): New.
1267 * src/reduce.h (reduce_xml): Remove prototype.
1268 (reduce_token_unused_in_grammar): Add prototype.
1269 (reduce_nonterminal_useless_in_grammar): Add prototype.
1270 * data/xslt/xml2text.xsl: Update for XML changes.
1271 * data/xslt/xml2xhtml.xsl: Update for XML changes.
1272 * tests/reduce.at (Useless Terminals): Update output.
1273 (Useless Rules): Update output.
1274 (Reduced Automaton): Update output.
1276 Say "Terminals unused in grammar" instead of "Unused terminals".
1277 * NEWS (2.3a+): Update.
1278 * doc/bison.texinfo (Understanding): Update example output.
1279 * src/reduce.c (reduce_output): Implement.
1280 * data/xslt/xml2text.xsl: Implement.
1281 * data/xslt/xml2xhtml.xsl: Implement.
1283 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
1285 Accept --report-file=FILE to override the default `.output' filename.
1286 * NEWS (2.3a+): Mention.
1287 * doc/bison.texinfo (Bison Options): Add an entry.
1288 * src/files.c (compute_output_file_names): Don't override
1289 spec_verbose_file if already set.
1290 * src/getargs.c (usage): Document --report-file.
1291 (REPORT_FILE_OPTION): New anonymous enum member.
1292 (long_options): Add entry for it.
1293 (getargs): Add case for it setting spec_verbose_file.
1295 * build-aux/cross-options.pl: Don't record a short option just because
1297 * doc/.cvsignore: Add yacc.1.
1299 2007-11-14 Akim Demaille <akim@epita.fr>
1301 * doc/yacc.1.in: New.
1302 * configure.ac, doc/Makefile.am: Adjust.
1303 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
1305 Use AC_SUBST for assignments too.
1306 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
1308 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
1310 * src/gram.c: Remove comments that duplicate comments in gram.h.
1312 When reporting useless rules and nonterminals, say "useless in grammar"
1313 instead of "useless", and say "useless in parser" instead of "never
1314 reduced". Discussed starting at
1315 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
1316 * NEWS (2.3a+): Mention this change.
1317 * data/xslt/xml2text.xsl: Update output text and expected input XML
1318 element names to match changes below.
1319 * data/xslt/xml2xhtml.xsl: Likewise.
1320 (xsl:template match="bison-xml-report"): Add missing entry in Table of
1321 Contents: "Rules useless in parser due to conflicts".
1322 * doc/bison.texinfo (Decl Summary): Reword a little.
1323 (Understanding): Update example output for changes below.
1324 * src/gram.c: (rule_useful_p): Rename to...
1325 (rule_useful_in_grammar_p): ... this.
1326 (rule_useless_p): Rename to...
1327 (rule_useless_in_grammar_p): ... this.
1328 (rule_never_reduced_p): Rename to...
1329 (rule_useless_in_parser_p): ... this.
1330 (grammar_rules_print): Update for renames.
1331 (grammar_rules_print_xml): Update for renames.
1332 (grammar_rules_never_reduced_report): Rename to...
1333 (grammar_rules_useless_report): ... this since it is used for either
1334 kind of useless rule.
1335 * src/gram.h: Reword comments and update function names in prototypes.
1336 * src/main.c (main): Say "rule useless in parser due to conflicts".
1337 * src/print-xml.c (print_rules_never_reduced): Rename to...
1338 (print_rules_useless_in_parser): ... this, and rename output XML
1339 element "rules-never-reduced" to "rules-useless-in-parser".
1340 (print_xml): Update for rename.
1341 * src/print.c (print_results): Say "Rules useless in parser due to
1343 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
1344 (nonterminals_reduce): Say "nonterminal useless in grammar".
1345 (reduce_output): Say "Nonterminals useless in grammar".
1346 Say "Rules useless in grammar".
1347 (reduce_xml): Rename output XML element "useless" to
1348 "useless-in-grammar".
1349 (reduce_print): Don't report the count of grammatically useless rules
1350 as "rules never reduced" just because %yacc is specified.
1351 In the correct report of this count, say nonterminal(s) and rule(s)
1352 "useless in grammar".
1353 * tests/conflicts.at (S/R in initial): Update expected output.
1354 (Defaulted Conflicted Reduction): Likewise.
1355 (Unreachable States After Conflict Resolution): Likewise.
1356 * tests/existing.at (GNU pic Grammar): Likewise.
1357 * tests/reduce.at (Useless Nonterminals): Likewise.
1358 (Useless Rules): Likewise.
1359 (Reduced Automaton): Likewise.
1360 (Underivable Rules): Likewise.
1361 (Empty Language): Likewise.
1363 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
1365 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
1366 here document and before the EOF so that BSD's implementation of Bourne
1367 shell doesn't parse the delimiter as part of the here document.
1368 * doc/.cvsignore: Add cross-options.texi.
1369 * src/getargs.c (usage): Add a blank line after the warning categories.
1371 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
1373 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
1375 2007-11-05 Akim Demaille <akim@epita.fr>
1377 Remove Id: from bison.1.
1378 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
1379 (perl -0777 -pi -e 's/\.PP\nId): New.
1380 (.x.1): Use it to ignore the version control revision.
1382 2007-11-05 Akim Demaille <demaille@gostai.com>
1384 * build-aux/Makefile.am: Ship cross-options.pl.
1385 * doc/Makefile.am: Always refer to cross-options.texi with
1387 (MAINTAINERCLEANFILES): Add it.
1389 2007-11-04 Akim Demaille <demaille@gostai.com>
1391 Generate the long/short option cross-table.
1392 * build-aux/cross-options.pl: New.
1393 * doc/Makefile.am (cross-options.texi): New.
1394 * doc/bison.texinfo: Use it.
1396 2007-11-04 Akim Demaille <demaille@gostai.com>
1398 Generate bison.1 using help2man.
1399 * doc/common.x, doc/bison.x: New.
1400 * doc/Makefile.am (bison.1, .x.1): New.
1401 The code is taken from autoconf-2.61/man/Makefile.am.
1402 * configure.ac: Look for help2man.
1404 2007-11-04 Akim Demaille <demaille@gostai.com>
1407 * src/getargs.c (usage): Document -W, make it clear that -d,
1408 -g and -x have optional arguments.
1410 2007-11-04 Akim Demaille <demaille@gostai.com>
1412 Find sha1sum when named gsha1sum.
1413 * bootstrap (find_tool): New.
1416 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1418 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
1420 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
1421 * NEWS (2.3a+): Mention.
1422 * data/bison.m4 (b4_pure_if): Don't define it here.
1423 * data/c.m4 (b4_identification): Depend on individual skeletons to
1424 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
1425 values of the %define variables api.pure or api.push_pull. Define
1426 YYPURE, YYPUSH, and YYPULL accordingly.
1427 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
1428 glr.cc has already defined b4_pure_flag.
1429 * data/push.c: Define b4_pure_if based on `%define api.pure'.
1430 Remove YYPUSH and YYPULL since they're back in b4_identification again.
1431 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
1432 * doc/bison.texinfo (Pure Decl): Update.
1433 (Push Decl): Update.
1434 (Decl Summary): Add api.pure to %define entry.
1435 In %pure-parser entry, say it's deprecated and reference %define.
1436 (Pure Calling): Update.
1437 (Error Reporting): Update.
1438 (C++ Scanner Interface): Update.
1439 (How Can I Reset the Parser): Update.
1440 (Table of Symbols): In %pure-parser entry, say it's deprecated and
1442 * src/getargs.c (pure_parser): Remove global variable.
1443 * src/getargs.h (pure_parser): Remove extern.
1444 * src/output.c (prepare): Don't define pure_flag muscle.
1445 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
1446 wrapper around `%define api.pure'.
1447 * tests/calc.at (Simple LALR Calculator): Update.
1448 (Simple GLR Calculator): Update.
1449 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
1451 (GLR: Resolve ambiguity, pure, locations): Update.
1452 (GLR: Merge conflicting parses, pure, no locations): Update.
1453 (GLR: Merge conflicting parses, pure, locations): Update.
1454 * tests/glr-regression.at (Uninitialized location when reporting
1456 * tests/input.at (Unused %define api.pure): New test case.
1457 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
1458 AT_PURE_IF and AT_PURE_AND_LOC_IF.
1459 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
1461 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1463 %define push_pull -> %define api.push_pull. Discussed starting at
1464 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
1465 * data/push.c: Expect the new name.
1466 * data/yacc.c: Likewise.
1467 * doc/bison.texinfo (Push Decl): Update.
1468 (Decl Summary): Update %define entry.
1469 (Push Parser Function): Update.
1470 (Pull Parser Function): Update.
1471 (Parser Create Function): Update.
1472 (Parser Delete Function): Update.
1473 * tests/calc.at (Simple LALR Calculator): Update.
1474 * tests/input.at (%define enum variables): Update.
1475 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
1476 (Push Parsing: Multiple impure instances): Update.
1477 (Push Parsing: Unsupported Skeletons): Update.
1478 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
1479 (Exploding the Stack Size with Malloc): Update.
1481 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
1484 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
1486 For the XML output's terminal element, rename @number to @token-number,
1487 and add @symbol-number. In the nonterminal element, rename @number to
1488 @symbol-number. Discussed starting at
1489 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
1490 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
1492 (xsl:template match="nonterminal"): Likewise.
1493 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
1494 (xsl:template match="nonterminal"): Likewise.
1495 * src/print-xml.c (print_grammar): Implement.
1497 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
1499 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
1500 2007-10-11 change, the child elements here are items not rules.
1501 (xsl:template match="item"): New.
1502 (xsl:template match="rule"): Update for new reduced itemset.
1503 (xsl:template match="point"): Remove.
1504 (xsl:template match="empty"): For consistency with --graph, don't
1505 output "/* empty */".
1506 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
1507 line-wrap, don't pass a negative value as first-line-length since this
1508 won't work with the following changes.
1509 (xsl:template name="line-wrap"): Simplify slightly.
1510 (xsl:template name="ws-search"): Eliminate recursion.
1511 * src/print_graph.c (print_core): Don't print a reduction's lookahead
1512 set next to an item whose dot is not at the end of the RHS even if it
1513 happens to be associated with the same rule.
1515 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
1517 Add %define lr.keep_unreachable_states.
1518 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
1519 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
1520 * src/main.c (main): Implement it.
1521 * tests/conflicts.at (Unreachable States After Conflict Resolution):
1522 Extend to test it, and fix a typo.
1524 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
1526 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
1527 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
1528 the example .output text.
1529 * tests/regression.at (Extra lookahead sets in report): Improve wording
1532 2007-10-17 Wojciech Polak <polak@gnu.org>
1534 * src/print-xml.c (print_grammar): Renamed
1535 <terminal> and <nonterminal> attributes:
1536 "type" to "number" and "symbol" to "name".
1537 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
1538 Use new attribute names.
1539 (xsl:template match="nonterminal"): Likewise.
1540 * data/xslt/xml2xhtml.xsl: Likewise.
1542 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
1544 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
1545 (Option Cross Key): Likewise.
1547 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
1548 next to an item whose dot is not at the end of the RHS even if it
1549 happens to be associated with the same rule.
1550 * src/print.c (print_core): Likewise.
1551 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
1552 (Resolved SR Conflicts): Update output.
1553 * tests/regression.at (Extra lookahead sets in report): New test case.
1555 2007-10-11 Wojciech Polak <polak@gnu.org>
1557 * src/print-xml.c (print_core): Remove item set
1559 * data/xslt/bison.xsl (bison:ruleNumber): New key.
1560 Improve processing time. Suggested by Joel E. Denny.
1561 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
1562 Write xsl:param "required" attribute as comment.
1563 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
1564 (xsl:template match="rule"): Support new reduced itemset.
1565 (xsl:template match="point"): Remove.
1566 * data/xslt/xml2xhtml.xsl: Likewise.
1568 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
1570 * src/getargs.c (version): Update copyright year.
1572 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
1574 Make xml2dot.xsl and --graph produce the same output.
1575 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a ` '
1576 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
1578 (xsl:template name="output-node"): Use the new escape template instead
1579 of the string-replace template directly.
1580 (xsl:template name="output-edge"): Likewise.
1581 (xsl:template name="escape"): New, escapes backslashes and newlines in
1582 addition to quotation marks.
1583 * src/graphviz.c (start_graph, output_node, output_edge): Add
1584 whitespace to output for legibility.
1586 Make xml2text.xsl and --report produce the same output, and remove the
1587 XML "conflicts" element since a conflict summary is easily extracted
1589 * data/xslt/bison.xsl: New.
1590 (xsl:template match="state" mode="bison:count-conflicts): New.
1591 * data/xslt/xml2text.xsl: Import bison.xsl.
1592 (xsl:template match="bison-xml-report"): Instead of styling the
1593 "conflicts" element, style the "automaton" element with mode
1594 "conflicts". Unlike the former, the latter lists S/R and R/R
1595 conflicts for a state on the same line.
1596 (xsl:template match="conflicts"): Remove.
1597 (xsl:template match="conflict"): Remove.
1598 (xsl:template match="terminal"): Line-wrap the list of rules in which
1599 the terminal is used.
1600 (xsl:template match="nonterminal"): Likewise for nonterminals.
1601 (xsl:template match="automaton" mode="conflicts"): New.
1602 (xsl:template match="state" mode="conflicts"): New.
1603 (xsl:template name="line-wrap"): New.
1604 (xsl:template name="ws-search"): New.
1605 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
1606 (xsl:template match="bison-xml-report"): Instead of styling the
1607 "conflicts" element, style the "automaton" element with mode
1609 (xsl:template match="conflicts"): Remove.
1610 (xsl:template match="conflict"): Remove.
1611 (xsl:template match="automaton" mode="conflicts"): New.
1612 (xsl:template match="state" mode="conflicts): New.
1613 * src/conflicts.c (conflicts_output_xml): Remove.
1614 * src/conflicts.h (conflicts_output_xml): Remove prototype.
1615 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
1616 * src/print.c (print_grammar): Consistently wrap at the 66th column so
1617 the corresponding XSLT is easier. Also, never wrap between a word and
1618 the comma that follows it.
1620 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
1622 Improve C++ namespace support. Discussed starting at
1623 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
1624 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
1625 b4_namespace_close): New macros that interpret the %define variable
1626 "namespace" so its value can contain "::" to indicate nested
1628 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
1630 * data/lalr1.cc (b4_namespace): Likewise.
1631 * data/location.cc (b4_namespace): Likewise.
1632 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
1633 inside a new table in the general %define entry. Document `%define
1634 namespace' there as well. Point the %name-prefix entry to it since it
1635 explains it more completely in the case of C++.
1636 (C++ Bison Interface): Mention `%define namespace' instead of
1638 (Table of Symbols): Remove the `%define push_pull' entry. The %define
1640 * tests/c++.at (Relative namespace references): New test case.
1641 (Absolute namespace references): New test case.
1642 (Syntactically invalid namespace references): New test case.
1643 * tests/input.at (C++ namespace reference errors): New test case.
1645 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
1647 Add syncline support and location accessor to internal %define
1649 * data/bison.m4 (b4_percent_define_get_loc): New.
1650 (b4_percent_define_get_syncline): New.
1651 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
1652 (b4_percent_define_default): Record defining location as line 1 rather
1653 than 0 for the sake of synchronizing #line's, and define
1654 b4_percent_define_syncline(VARIABLE).
1655 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
1656 * src/muscle_tab.c (muscle_syncline_grow): New.
1657 (muscle_code_grow): Use muscle_syncline_grow.
1658 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
1659 define b4_percent_define_syncline(VARIABLE).
1660 (muscle_percent_define_get_loc): New.
1661 (muscle_percent_define_get_syncline): New.
1662 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
1663 remove some unused variables.
1664 (muscle_percent_define_default): Record defining location as line 1
1665 rather than 0 for the sake of synchronizing #line's, and define
1666 b4_percent_define_syncline(VARIABLE).
1667 (muscle_percent_define_check_values): Use
1668 muscle_percent_define_get_loc.
1669 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
1670 (muscle_percent_define_get_syncline): Prototype.
1671 * tests/skeletons.at (%define Boolean variables: invalid skeleton
1672 defaults): Update output for location change.
1673 (Complaining during macro argument expansion): Extend to test
1674 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
1676 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
1678 Fix some error-reporting macro bugs.
1679 * data/bison.m4 (b4_cat): New.
1680 (b4_error, b4_error_at): Use b4_cat to send error directives directly
1681 to stdout so they don't become arguments to other macros. Update
1682 comments and add examples.
1683 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
1685 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
1686 after printing the error directive so that M4 doesn't report subsequent
1687 problems that are induced by this problem.
1688 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
1689 instead of just in them. Recognize @\n in both places. Both expand to
1690 the empty string. Needed by b4_cat.
1691 * tests/skeletons.at (Complaining during macro argument expansion):
1693 (Fatal errors make M4 exit immediately): New test case.
1695 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
1697 Implement --print-datadir.
1698 * src/getargs.c (usage): Mention.
1699 (PRINT_DATADIR_OPTION): New anonymous enum member.
1700 (long_options): Add entry for it.
1701 (getargs): Add case for it calling compute_pkgdatadir.
1702 * src/output.c (output_skeleton): Encapsulate data directory
1703 computation from here...
1704 (prepare): ... and from here...
1705 (compute_pkgdatadir): ... into this new function.
1706 * src/output.h (compute_pkgdatadir): Prototype.
1708 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
1710 * src/print-xml.c (escape_bufs): New static global variable
1712 (xml_escape_n): ... the static local variable buf here.
1713 (print_xml): Free memory for escape_bufs.
1714 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
1716 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
1718 Replace `%push-parser' and `%push-pull-parser' with
1719 `%define push_pull "push"' and `%define push_pull "both"'.
1720 `%define push_pull "pull"' is the default.
1721 * doc/bison.texinfo (Push Decl, Push Parser Function,
1722 Pull Parser Function, Parser Create Function, Parser Delete Function):
1723 Update declarations.
1724 (Decl Summary, Table of Symbols): Replace %push-parser and
1725 %push-pull-parser entries with a %define push_pull entry.
1726 * data/bison.m4 (b4_percent_define_check_values): New macro.
1727 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
1729 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
1731 * data/push.c: ... to here and compute them from the value of the
1732 %define variable push_pull.
1733 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
1734 parsing requests here...
1735 * data/yacc.c: ... hack this to switch to push.c any time
1736 b4_use_push_pull_flag or the %define variable push_pull is set. This
1737 will go away when we mv push.c yacc.c.
1738 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
1739 push parsing is not supported since unused %define variables are
1741 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
1742 * src/muscle_tab.h (muscle_percent_define_check_values): Update
1743 comments for consistency with b4_percent_define_check_values.
1744 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
1746 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
1748 (prologue_declaration): Remove %push-parser and %push-pull-parser
1750 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
1751 * tests/calc.at: Update declarations.
1752 * tests/input.at (%define enum variables): New test case.
1753 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
1755 (Push Parsing: Multiple impure instances): Update declaration.
1756 (Push Parsing: Unsupported Skeletons): New test case.
1757 * tests/torture.at (Exploding the Stack Size with Alloca): Update
1759 (Exploding the Stack Size with Malloc): Update declaration.
1761 2007-09-24 Wojciech Polak <polak@gnu.org>
1763 Add XSLT transformations.
1765 * data/xslt/xml2dot.xsl: Transform XML into DOT.
1766 * data/xslt/xml2text.xsl: Transform XML into plain text.
1767 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
1768 * data/Makefile.am (xsltdir): New variable.
1769 (dist_xslt_DATA): Add xslt/*.xsl files.
1771 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
1773 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
1774 Problem reported by Wojciech Polak.
1775 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
1776 (xml_printf): Undo change I made on 21 September; that is,
1777 indent 2 spaces, not 1.
1779 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
1781 Pacify ./configure --enable-gcc-warnings.
1782 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
1783 `char const *' instead of `char *'.
1784 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
1785 local variable `sep'.
1787 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
1789 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
1791 * src/print-xml.c: Prefer "const" after types; that's more consistent.
1792 (xml_printf): Indent just 1 space for level.
1793 (e_char, xlate_char): Remove.
1794 (xml_escape_string): Rewrite to avoid undefined behavior (used
1795 storage that was freed from the stack).
1796 (xml_escape_n): Don't bother checking for subscript error.
1798 2007-09-21 Wojciech Polak <polak@gnu.org>
1800 Add Bison XML Automaton Report.
1802 Add support for an -x option to generate an XML report.
1803 It is not documented yet.
1804 * src/print-xml.c: New file.
1805 * src/print-xml.h: Likewise.
1806 * lib/timevar.def (TV_XML): New var.
1807 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
1808 * src/conflicts.c: Include print-xml.h.
1809 (solved_conflicts_xml_obstack): New var.
1810 (log_resolution, conflicts_solve, conflicts_free):
1811 Add support for XML report.
1812 (conflicts_output_val): New function.
1813 * src/conflicts.h (conflicts_output_val): New decl.
1814 * src/files.c (spec_xml_file): New var.
1815 (compute_output_file_names, output_file_names_free): Add XML support.
1816 * src/files.h (spec_xml_file): New decl.
1817 * src/getargs.c (xml_flag): New var.
1818 (usage, short_options, long_options, getargs): Add XML support.
1819 * src/getargs.h (xml_flag): New decl.
1820 * src/gram.c: Include print-xml.h.
1821 (rule_lhs_print_xml, rule_rhs_print_xml):
1822 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
1824 * src/gram.h: Declare external ones.
1825 * src/main.c: Include print-xml.h.
1826 (main): Add XML support.
1827 * src/reduce.c: Include print-xml.h.
1828 (reduce_xml): New function.
1829 * src/reduce.h: Declare it.
1830 * src/state.c: Include print-xml.h.
1831 (state_new): Add XML support.
1832 (state_rule_lookahead_tokens_print_xml): New function.
1833 * src/state.h: Declare it.
1834 (struct state): New member solved_conflicts_xml.
1835 * src/symtab.c (symbol_class_get_string): New function.
1836 * src/symtab.h: Declare it.
1838 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
1840 * GNUmakefile: Switch to coreutils's version.
1841 * bootstrap: Likewise.
1842 * Makefile.cfg: Adjust to new GNUmakefile.
1843 * README-hacking: Likewise.
1847 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
1848 Bruno Haible <bruno@clisp.org>
1850 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
1851 and is a script that invokes bison. Tighten the code. Add comments.
1853 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
1855 Spell "boolean" as "Boolean". Reported by Akim Demaille.
1856 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
1857 * doc/bison.texinfo (Decl Summary): Fix.
1858 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
1859 * tests/input.at (Boolean %define variables): Update output.
1860 * tests/skeletons.at (%define boolean variables: invalid skeleton
1861 defaults): Rename to...
1862 (%define Boolean variables: invalid skeleton defaults): ... this and
1865 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
1867 In impure push mode, don't allow more than one yypstate to be allocated
1868 since multiple impure parsers would corrupt yynerrs.
1869 * data/push.c (yypstate_allocated): New static global variable
1871 (yypull_parse): If yypstate_new returns 0, don't report it as memory
1872 exhaustion if yypstate_allocated is 1, but still return 2.
1873 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
1874 already 1. Otherwise, set it to 1.
1875 (yypstate_delete): Set it to 0.
1876 * tests/push.at (Push Parsing: Multiple impure instances): New test
1879 2007-08-17 Bob Rossi <bob@brasko.net>
1881 * doc/bison.texinfo (Push Decl): Document the push parser.
1882 (Table of Symbols): Ditto.
1884 (Decl Summary): Ditto.
1885 (Multiple Parsers, Push Parser Function, Pull Parser Function,
1886 Parser Create Function, Parser Delete Function):
1887 Add new push parser symbols.
1888 (Table of Symbols): Document push-parser, push-pull-parser,
1889 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
1891 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
1894 * doc/gpl-3.0.texi: New file.
1895 * doc/gpl.texi: Remove.
1896 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
1897 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
1898 * README-hacking, TODO, bootstrap, bootstrap.conf:
1899 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
1900 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
1901 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
1902 * data/lalr1.cc, data/lalr1.java, data/location.cc:
1903 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
1904 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
1905 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
1906 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
1907 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
1908 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
1909 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
1910 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
1911 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
1912 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
1913 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
1914 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
1915 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
1916 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
1917 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
1918 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
1919 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
1920 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
1921 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
1922 * src/complain.c, src/complain.h, src/conflicts.c:
1923 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
1924 * src/files.h, src/flex-scanner.h, src/getargs.c:
1925 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
1926 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
1927 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
1928 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
1929 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
1930 * src/print.c, src/print.h, src/print_graph.c:
1931 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
1932 * src/reduce.h, src/relation.c, src/relation.h:
1933 * src/revision.h, src/scan-code.h, src/scan-code.l:
1934 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
1935 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
1936 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
1937 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
1938 * tests/Makefile.am, tests/actions.at, tests/c++.at:
1939 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
1940 * tests/existing.at, tests/glr-regression.at:
1941 * tests/headers.at, tests/input.at, tests/java.at:
1942 * tests/local.at, tests/output.at, tests/push.at:
1943 * tests/reduce.at, tests/regression.at, tests/sets.at:
1944 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
1948 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
1950 Get rid of broken %no-parser, -n, and --no-parser implementation and
1952 * TODO: Don't mention them.
1953 * doc/bison.1: Likewise.
1954 * doc/bison.texinfo (Decl Summary): Likewise.
1955 (Bison Options): Likewise.
1956 (Option Cross Key): Likewise.
1957 * src/getargs.c (no_parser_flag): Remove global variable.
1958 (usage): Don't print description of -n and --no-parser.
1959 (long_options): Remove --no-parser entry here.
1960 (getargs): Remove -n case in the switch here.
1961 * src/getargs.h (no_parser_flag): Remove extern.
1962 * tests/regression.at (Web2c Actions): Remove comment that mentions
1965 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
1967 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
1968 name user variables starting with `yy'. Just pass NULL instead of a
1969 dummy local &yylval to yypush_parse.
1970 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
1973 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
1975 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
1976 true since it's then always used regardless of whether yyoverflow is
1977 defined. Reported by Christian Burger at
1978 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
1979 * THANKS: Add Christian Burger.
1981 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
1982 node names: say "Decl Summary" not "Bison Declaration Summary".
1984 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
1986 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
1987 determine whether this function has already complained about an invalid
1988 value for a %define boolean variable, don't check whether Bison has
1989 ever examined the value. As written, the check was a tautology.
1990 Instead, record and check for this complaint using a separate muscle.
1992 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1994 Fix push parsing memory leak reported by Brandon Lucia at
1995 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
1996 * THANKS: Add Brandon Lucia.
1997 * data/push.c (yypstate_delete): Free the stack if it was reallocated
1998 but the parse never completed and thus freed it.
1999 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
2000 * tests/testsuite.at: Include push.at.
2001 * test/push.at: New.
2002 (Push Parsing: Memory Leak for Early Deletion): New test case.
2004 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
2006 Improve handling of multiple S/R conflicts in the same state and of S/R
2007 conflicts involving multiple reductions.
2008 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
2009 set for a state here or Bison will abort if it is reassigned on a
2010 later conflicted reduction in the same state.
2011 Similarly, don't finalize and assign the solved conflicts report here
2012 or it will be lost if it is reassigned on a later conflicted reduction
2014 (set_conflicts): Instead, assign them both here after all S/R conflicts
2015 in the state have been fully examined.
2016 * src/print.c (shift_set): Rename to...
2017 (no_reduce_set): ... this.
2018 (print_reductions): Update for rename, and add %nonassoc error action
2019 tokens to no_reduce_set so that, when printing the first remaining
2020 reduction on an error action token, the reduction is enclosed in
2022 (print_results): Update for rename.
2023 * tests/conflicts.at (Solved conflicts report for multiple reductions
2024 in a state): New test case.
2025 (%nonassoc error actions for multiple reductions in a state): New test
2028 * src/main.c (main): Don't depend on C99 features.
2030 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
2032 * build-aux/.cvsignore: Add compile.
2033 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
2036 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
2038 * bootstrap (slurp): Create target directories that don't exist.
2039 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
2041 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
2043 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
2045 * closure.c (closure): Likewise.
2046 * state.h (reductions): Comment sorting of rules.
2047 (state): Comment sorting of items.
2049 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
2051 Fix C++ test cases after recent Gnulib changes. Discussed starting at
2052 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
2053 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
2054 definition in order to avoid Gnulib headers since we don't use config.h
2056 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
2057 rather than AT_DATA so that config.h is included.
2059 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
2061 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
2062 instead of fprintf. Guard these functions with #if YYDEBUG instead of
2063 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
2064 and so that YYFPRINTF is guaranteed to be defined here.
2066 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
2068 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
2070 (muscle_percent_define_check_values): ... this more helpful function.
2071 Again, it's not used yet, but it will be.
2072 * src/muscle_tab.h: Likewise.
2074 Improve some comments in parser table construction.
2075 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
2076 (generate_states): Don't mention ruleset, which is internal to closure.
2077 * src/closure.c (closure): Explain sorting of core and itemset, which
2078 is required for this function to behave correctly.
2079 * src/closure.h (closure): Mention sorting.
2081 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
2083 * src/lalr.c (state_lookahead_tokens_count): For code readability,
2084 move the check for disabled transitions to an aver since conflict
2085 resolution hasn't happened yet.
2087 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
2088 labels a state as inconsistent just because it has error transitions.
2089 The original form of this check appeared in revision 1.1 of lalr.c,
2090 which was committed on 1991-12-21. Now (at least), changing the
2091 consistency label on such a state appears to have no useful effect in
2092 any of the places it is examined, which I enumerate below. The key
2093 point to understanding each item in this enumeration is that a state
2094 with an error transition is labelled consistent in the first place only
2095 if it has no rules, so the check cannot matter for states that have
2096 rules. (1) Labelling a state as inconsistent will cause set_conflicts
2097 to try to identify its conflicts, and a state must have *rules* to have
2098 conflicts. (2) Labelling a state as inconsistent will affect how
2099 action_row sets the default *rule* for the state. (3) Labelling a
2100 state as inconsistent will cause build_relations to add lookback edges
2101 to *rules* in that state.
2102 * src/state.h (struct state): Word the comment for member consistent
2105 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2107 Don't depend on C99 features.
2108 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
2109 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
2110 * src/reader.c (check_and_convert_grammar): Fix for-loop.
2111 * src/state.c (state_mark_reachable_states): Fix for-loop.
2112 (state_remove_unreachable_states): Fix for-loop.
2114 Don't widen struct state with member reachable just to temporarily
2115 record reachability. Instead, use a local bitset.
2116 * src/state.h (struct state): Remove member.
2117 * src/state.c (state_new): Don't initialize it.
2118 (state_mark_reachable_states): Rename to...
2119 (state_record_reachable_states): ... this, and use bitset.
2120 (state_remove_unreachable_states): Use bitset.
2122 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
2124 * src/Makefile.am (yacc): Quote target action commands properly so
2125 that the yacc script isn't corrupt. Reported by Hans Aberg at
2126 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
2128 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
2129 the case of pure parsers. Reported by Frans Englich at
2130 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
2131 * THANKS: Add Frans Englich.
2133 * NEWS (2.3a+): In the %code entry, reference section `Bison
2134 Declaration Summary' from the manual now since the %code summary has
2136 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
2137 in the rules section must be terminated by semicolons.
2139 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
2141 Extend the front-end API for %define variables to more completely
2142 mirror the back-end. This will be useful in the future.
2143 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
2144 Update comments to mention the new front-end counterparts of these
2146 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
2147 for muscle_string_decode and muscle_location_decode.
2148 (muscle_string_decode): New static function.
2149 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
2150 (muscle_percent_define_get, muscle_percent_define_ifdef): New
2152 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
2153 muscle_percent_define_get to mimic the b4_percent_define_flag_if
2154 implementation more closely.
2155 (muscle_percent_define_invalid_value): New function.
2156 * src/muscle_tab.h (muscle_percent_define_get,
2157 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
2160 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
2162 * NEWS (2.3a+): Mention yesterday's state-removal change.
2163 (2.3a): Remove the %language entry, which was added after 2.3a.
2164 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
2165 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
2166 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
2167 tests/existing.at: Update copyright date.
2169 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2171 If conflict resolution makes states unreachable, remove those states,
2172 report rules that are then unused, and don't report conflicts in those
2174 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
2175 New global function.
2176 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
2178 * src/main.c (main): After conflict resolution, remove the unreachable
2179 states and update all data structures that reference states by number.
2180 * src/state.c (state_new): Initialize each state's reachable member to
2182 (state_mark_reachable_states): New static function.
2183 (state_remove_unreachable_states): New global function.
2184 * src/state.h (struct state): Add member bool reachable.
2185 (state_remove_unreachable_states): Prototype.
2186 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2188 * tests/existing.at (GNU pic Grammar): Update test case output now that
2189 an unused rule is discovered.
2191 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2193 Minor code cleanup in parser table construction.
2194 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
2195 (new_itemsets, save_reductions): Update for rename to nitemset.
2196 * src/closure.c (nritemset): Rename to...
2197 (nitemset): ... this since the "r" appears to meaningless and isn't
2198 used in the comments.
2199 (closure): Update for rename.
2200 * src/closure.h (nritemset): Update extern to...
2201 (nitemset): ... this.
2202 * src/lalr.c (LA): Fix a typo in comments.
2203 * src/print.c (print_core): Update for rename to nitemset.
2204 * src/print_graph.c (print_graph): Likewise.
2205 * src/state.h: Fix some typos in header comments.
2207 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
2209 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
2210 still sticks to ASCII. Sorry!
2212 * README-hacking: New file, taken mostly from coreutils, with changes
2213 for Bison. Contains much of the contents of:
2214 * README-cvs: Remove.
2215 * bootstrap: Sync from gnulib.
2216 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
2217 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
2219 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
2221 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
2223 (Java Differences): Fix some typos.
2224 * THANKS: Add Sebastian Setzer.
2226 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
2228 * data/java.m4 (b4_single_class_if): Remove.
2229 (b4_abstract_if): Look at "%define abstract".
2231 (b4_union_name): Rename...
2232 (b4_yystype): ... to this. Map to "%define stype".
2233 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
2234 b4_maybe_throws): Fix quoting.
2235 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
2236 * data/lalr1.java (Lexer interface): Always define.
2237 (Lexer interface within parser class): Remove.
2238 (YYLexer class): New, used when "%code lexer" is present.
2239 (constructor): When "%code lexer" is used, pass %lex-param
2240 to the lexer constructor.
2241 (yylex, yyparse): Remove %lex-param from method invocations
2242 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
2244 * doc/bison.texinfo (Java Bison Interface): Mention "%define
2245 abstract". Rename "%define union_name" to "%define stype".
2246 Rename method names according to previous patch.
2247 (Java Scanner Interface): Describe "%code lexer" instead of
2248 "%pure-parser" and "%define single_class".
2249 (Java Differences): Mention "%code lexer".
2251 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
2252 Include scanner here, using macros from tests/local.at.
2253 (AT_DATA_CALC_Y): Remove final argument.
2254 (_AT_CHECK_JAVA_CALC): Likewise.
2255 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
2256 of %locations and %error-verbose.
2257 (main): Test with and without %lex-param.
2258 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
2259 (AT_BISON_OPTION_POPDEFS): Pop it.
2261 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2263 DJGPP spefic issue. Inhibit the use of disallowed characters for
2264 file name genertion on Win98, WinXP, etc. These are |<>":?*\
2265 and concern testsuite case 46.
2266 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
2267 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
2268 * djgpp/config.bat: Inhibit the use of disallowed characters.
2270 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2272 Miscellaneous %define and %code cleanup.
2273 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
2274 values are interpreted.
2275 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
2276 documentation a little more.
2277 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
2278 muscle_percent_define_insert, muscle_percent_code_grow): New
2280 * src/muscle_tab.h (muscle_percent_define_insert,
2281 muscle_percent_code_grow): Prototype.
2282 * src/parse-gram.y (prologue_declaration): Use
2283 muscle_percent_define_insert and muscle_percent_code_grow when parsing
2284 %define and %code directives.
2286 Make it easy to share %define boolean variables between the front-end
2287 and back-end. Though not used yet, this will be useful in the future.
2288 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
2289 Bison uses of names rather than just skeleton uses of names.
2290 (b4_percent_define_get, b4_percent_define_ifdef): Rename
2291 b4_percent_define_skeleton_variables(VARIABLE) to
2292 b4_percent_define_bison_variables(VARIABLE).
2293 (b4_percent_code_get, b4_percent_code_ifdef): Rename
2294 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
2295 b4_percent_code_bison_qualifiers(QUALIFIER).
2296 (b4_check_user_names_wrap): Update for renames.
2297 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
2298 muscle_percent_define_default): New functions mimicking
2299 b4_percent_define_flag_if and b4_percent_define_default.
2301 For %define variables, report locations for invalid values and
2303 * data/bison.m4 (b4_percent_define_flag_if): Read
2304 b4_percent_define_loc(VARIABLE) to report the location of an invalid
2306 (b4_percent_define_default): Save a special location in
2307 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
2308 must later be reported as invalid.
2309 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
2311 (muscle_percent_define_insert): Record the location of VARIABLE in
2312 muscle percent_define_loc(VARIABLE), and use it to report the previous
2313 location for a redefinition.
2314 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
2315 (muscle_percent_define_default): Update like b4_percent_define_default.
2316 (muscle_grow_user_name_list): Rename to...
2317 (muscle_user_name_list_grow): ... this for consistency and use
2318 muscle_location_grow.
2319 * src/muscle_tab.h (muscle_location_grow): Prototype.
2320 * tests/input.at (%define errors): Update expected output.
2321 * tests/skeletons.at (%define boolean variables: invalid skeleton
2322 defaults): New test case.
2324 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
2326 * src/print.c (lookahead_set, state_default_rule): Remove.
2327 (print_reductions): Replace state_default_rule invocation with
2328 equivalent use of yydefact, which was computed in token_actions in
2330 (print_results): Don't allocate lookahead_set.
2332 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
2334 * data/lalr1.java: Prefix all private members with yy.
2336 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
2338 Use YYFPRINTF instead of fprintf where appropriate. Reported by
2339 Sebastien Fricker at
2340 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
2341 * THANKS: Add Sebastien Fricker.
2342 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
2343 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
2344 accept a variable number of arguments.
2346 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
2348 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
2350 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2352 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
2353 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
2354 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
2356 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
2358 Undo my 2007-02-07 change, switching back to the c-strcase module
2359 introduced in the 2007-02-03 change. Bruno Haible reported that
2360 the 2007-02-07 change would be dangerous in Turkish if we add a
2361 language whose name contains "i", since "i" is not lowercase "I"
2363 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
2364 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
2365 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
2366 * m4/.cvsignore: Remove strcase.m4.
2367 * src/getargs.c: Revert 2007-02-07 change, as follows.
2368 Include c-strcase.h.
2369 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
2371 2007-02-11 Bruno Haible <bruno@clisp.org>
2373 Enable the Java related testsuite tests when the only Java compiler
2374 found is a gcj < 4.3. Discussed at
2375 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
2376 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
2378 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
2380 * data/Makefile.am: Update copyright date.
2381 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
2382 yypstate_new returns NULL.
2383 (yypstate_new): Return NULL if malloc does.
2384 * src/reader.c (packgram): Move translation of rule actions from the
2385 beginning of packgram to...
2386 (check_and_convert_grammar): ... here right before packgram is invoked
2387 so it's easier to write more complete comments, and remove redundant
2390 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
2392 As in semantic actions, make @$ in %initial-action, %destructor, and
2393 %printer imply %locations.
2394 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
2396 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
2397 (@$ in %initial-action implies %locations,
2398 @$ in %destructor implies %locations,
2399 @$ in %printer implies %locations): ... these new test cases.
2401 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
2403 Undo most of the 2007-02-03 change, switching to the strcase module
2404 now that gnulib strcase has been fixed.
2405 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
2406 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
2407 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
2408 * m4/.cvsignore: Add strcase.m4.
2409 * src/getargs.c: Revert 2007-02-03 change, as follows.
2410 Don't include c-strcase.h.
2411 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
2412 strcasecmp has "unspecified behavior" outside the POSIX locale,
2413 but it works fine in practice if at least one argument is ASCII,
2414 as is the case in Bison.
2416 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
2418 * tests/java.at: Skip tests if only one of javac/java is present.
2419 Reported by Joel E. Denny.
2420 * tests/atlocal.in: Adjust copyright years.
2422 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
2424 * data/lalr1.java (Stack): Work around old verifiers that disallow
2425 access to the private fields of an inner class, from the outer class.
2426 We can make Stack's fields public because user code doesn't have access
2427 to the instance of Stack used by parse(). Reported by Paul Eggert.
2429 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
2431 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
2432 the right spot for these files?
2433 * bootstrap.conf (gnulib_modules): Add c-strcase.
2434 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
2436 * src/getargs.c: Include c-strcase.h.
2437 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
2438 to avoid unspecified behavior.
2440 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
2442 * doc/bison.texinfo (Decl Summary): Correct typo.
2444 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
2446 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
2447 Complain if the value does not match empty, "true" or "false".
2448 * data/c++.m4: Adjust default definitions of %define variables.
2449 * data/java.m4: Adjust default definitions of %define variables.
2450 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
2452 * tests/input.at (Boolean %define variables): Test new behavior.
2454 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
2456 * NEWS: Mention java.
2457 * TODO: Remove things that are done.
2458 * bootstrap.conf: Add javacomp-script and javaexec-script.
2459 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
2461 * data/Makefile.am: Add new files.
2462 * data/java-skel.m4: New.
2463 * data/java.m4: New.
2464 * data/lalr1.java: New.
2466 * doc/bison.texinfo: Put "A Complete C++ Example" under
2467 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
2468 under Other Languages.
2470 * src/getargs.c (valid_languages): Add Java.
2471 * src/getargs.h (struct bison_language): Update size of string fields.
2473 * tests/Makefile.am: Add java.at.
2474 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
2475 * tests/java.at: New.
2476 * tests/testsuite.at: Include it.
2478 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
2481 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
2482 at_directive_argv arguments so these no longer have to be global
2483 variables. Also, update the implementation for the following changes.
2484 (fail_for_at_directive_too_many_args,
2485 fail_for_at_directive_too_few_args): Add at_directive_name argument.
2486 (at_directive_name): Remove as at_directive_argv[0] will be used for
2488 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
2489 for the directive name.
2490 (at_directive_argc, at_directive_argv): Make these local within
2491 skel_lex instead of global.
2492 (INITIAL): Update directive start action for above changes.
2493 (SC_AT_DIRECTIVE_ARG): Rename to...
2494 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
2495 (SC_AT_DIRECTIVE_SKIP_WS): Update.
2496 (scan_skel): Move yylex_destroy to...
2497 (skel_scanner_free): ... here.
2498 * tests/skeletons.at (installed skeleton file name): Rename to...
2499 (installed skeleton file names): ... this.
2501 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
2503 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
2504 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
2505 Summary" not "Directives".
2506 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
2507 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
2508 since the former is now the more complete one.
2509 (Prologue Alternatives): Likewise and do the same for %defines.
2510 (Table of Symbols): Add summary of %code, add summary of %define, and
2511 move full %code documentation to...
2512 (Decl Summary): ... here for consistency with other entries in these
2514 Move %define entry in order to keep this list alphabetized.
2515 Reword %define entry a little to put less emphasis on the skeleton
2516 concept, which most users shouldn't have to think about.
2518 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
2520 Adjust to recent gnulib changes.
2521 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
2522 Add string.h, string_.h, unistd_.h, wchar_.h.
2523 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
2524 * src/system.h: Don't include <stpcpy.h>; this is now done by
2527 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
2529 Simplify implementation of unqualified %code, implement macros for
2530 uniform treatment of boolean %define flags. Document %define.
2531 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
2532 b4_percent_code_ifdef): New.
2533 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
2534 * data/c++.m4: Define default value for global_tokens_and_yystype.
2535 * data/glr.cc: Likewise.
2536 * data/location.cc: Use b4_percent_define_flag_if.
2538 * doc/bison.texinfo (Decl Summary): Document %define.
2540 * src/parse-gram.y (Unqualified %code): Change muscle name to
2542 (content.opt): Default to empty.
2544 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
2546 Implement support for relative and absolute skeleton file names.
2547 Discussed starting at
2548 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
2549 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
2550 (Bison Options): Document in --skeleton entry.
2551 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
2552 full_skeleton can't necessarily hold all of pkgdatadir.
2553 If the specified skeleton file name contains a `/', don't prepend
2555 * src/parse-gram.y (prologue_declaration): If the specified skeleton
2556 file name contains a `/', prepend the grammar file directory.
2557 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
2558 * skeletons.at: New file.
2559 (relative skeleton file names): New test case.
2560 (installed skeleton file names): New test case.
2561 * tests/testsuite.at: Include skeletons.at.
2563 * bootstrap: Update copyright to 2007.
2565 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
2567 * bootstrap: Remove occurrences of .#bootmp from the files.
2569 2007-01-17 Akim Demaille <akim@epita.fr>
2571 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
2573 Use per-type %printer.
2575 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
2577 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
2578 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
2579 djgpp/config.site, src/files.c, src/files.h, src/main.c,
2580 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
2581 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
2582 tests/glr-regression.at, tests/input.at, tests/local.at,
2583 tests/output.at, tests/torture.at: Update copyright to 2007.
2585 2007-01-16 Akim Demaille <akim@epita.fr>
2587 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
2589 (Calc++ Scanner): Exit with failure if we can't open the input
2591 Accept "-" standing for stdin.
2592 (Calc++ Top Level): Print the result only if the parsing was
2595 2007-01-16 Akim Demaille <akim@epita.fr>
2597 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
2599 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
2600 and Joel E. Denny <jdenny@ces.clemson.edu>
2602 Clean up %define and %code implementation in M4 some. Most
2603 importantly, rename all related macros to be in the b4_percent_define
2604 and b4_percent_code namespaces. Also, complete support for `.' in
2605 %define variable names and %code qualifiers.
2606 * data/bison.m4 (b4_check_user_names): Check for special
2607 "SKELETON-NAMESPACE(name)" macros instead of using two nested
2609 (b4_get_percent_define, b4_get_percent_code): Rename to...
2610 (b4_percent_define_get, b4_percent_code_get): ... these.
2611 Extend documentation with examples.
2612 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
2613 b4_percent_define_skeleton_variables and
2614 b4_percent_code_skeleton_qualifiers.
2615 Expect any value for the %define variable `foo' to be stored in the
2616 macro named `b4_percent_define(foo)'; expect any %code blocks for the
2617 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
2618 expect any unqualified %code blocks to be stored in a macro named
2619 `b4_percent_code_unqualified'.
2620 Use m4_indir so that %define variable names and %code qualifiers can
2621 contain `.', which is allowed by the grammar parser.
2622 (b4_percent_define_default): New macro to set a default value for a
2624 (m4_wrap): Update wrapped code, and fix some underquoting.
2625 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
2626 Expect grammar uses of %define variables and %code qualifiers to be
2627 defined in b4_percent_define_user_variables and
2628 b4_percent_code_user_qualifiers.
2629 * data/c++.m4: Use b4_percent_define_default rather than
2630 m4_define_default. Fix some underquoting. Skeleton usage of %define
2631 variable define_location_comparison now implies skeleton usage of
2632 %define variable filename_type.
2633 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
2634 data/push.c, data/yacc.c: Update macro names.
2635 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
2638 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2640 DJGPP specific issues.
2642 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
2643 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
2645 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
2647 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
2648 run parsers in all tests so that Valgrind is invoked during
2649 maintainer-check-valgrind.
2650 (Duplicate representation of merged trees): Free all semantic values.
2651 (Duplicated user destructor for lookahead): Likewise.
2653 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
2655 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
2656 command-line prefix.
2657 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
2658 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
2659 miss Valgrind messages.
2660 (Exploding the Stack Size with Malloc): Likewise.
2662 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
2664 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
2665 locals. Reported by Juan Manuel Guerrero at
2666 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
2667 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
2668 Fix some indentation also.
2669 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
2670 explaining this issue.
2672 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
2673 and Joel E. Denny <jdenny@ces.clemson.edu>
2675 Simplify union and prologue handling, and escape union and lex/parse
2676 params with digraphs.
2677 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
2678 values to the empty string since these are no longer guaranteed
2679 initialized by the front-end.
2680 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
2681 braces around b4_user_stype since this is no longer done by the
2683 * src/files.c, src/files.h (pre_prologue_obstack,
2684 post_prologue_obstack): Remove.
2685 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
2686 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
2687 with digraphs. This fixes lex params and parse params.
2688 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
2689 * src/output.c (prepare): Remove muscle insertion of the prologues.
2690 (output): Remove freeing of pre_prologue_obstack and
2691 post_prologue_obstack.
2692 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
2693 than prologue_augment for prologue parsing so you don't need prologue
2695 (grammar_declaration): For %union RHS, use `braceless' instead of
2696 "{...}" so that braces are already stripped and code is escaped with
2698 * src/reader.c (prologue_augment): Remove.
2699 (reader): Remove initialization of pre_prologue_obstack and
2700 post_prologue_obstack.
2701 * src/reader.h (prologue_augment): Remove.
2703 * data/c.m4: Remove stray parenthesis.
2705 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2707 Remove quotes from variables names in %define directives and from
2708 qualifiers in %code directives, and restrict the characters that are
2709 allowed in them to M4-friendly ones. For %define, continue to support
2710 the quoted form as a deprecated feature. Discussed starting at
2711 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
2712 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
2714 * doc/bison.texinfo (Prologue Alternatives): Update.
2715 (Decl Summary): In %defines entry, update mention of `%code requires'
2716 and `%code provides'.
2717 (C++ Location Values): Update %define uses.
2718 (Calc++ Parser Interface): Likewise.
2719 (Calc++ Parser): Likewise, and update `%code requires' uses.
2720 (Table of Symbols): Update %code documentation.
2721 * src/parse-gram.y (prologue_declaration): For %define variables, use
2722 `variable' instead of `STRING'.
2723 (grammar_declaration): For %code qualifiers, use `ID' instead of
2725 (variable): New nonterminal that takes an `ID' or a `STRING'.
2726 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
2728 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
2729 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
2730 (%define errors): Update %define uses.
2732 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2734 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
2735 instead of muscle_insert for %define values so that M4-special
2736 characters are replaced with digraphs.
2737 * tests/input.at (%define errors): Extend to check weird values.
2739 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2741 Instead of having skeletons declare all valid %define variables and
2742 %code qualifiers, provide macros that retrieve the associated values
2743 and build these lists automatically. Thus Bison will now warn when a
2744 variable or qualifier is not used by the skeleton in the current
2745 invocation regardless of whether it might sometimes be used by that
2746 skeleton in other invocations. Also, move all %define value macros to
2747 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
2748 form, which is replaced by %code.
2749 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
2750 (b4_check_user_names): ... this, and change the series of valid name
2751 arguments to a single list argument for names used in the skeleton
2752 similar to the existing list argument for names used in the grammar.
2753 Warn instead of complaining.
2754 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
2755 values and %code code, to format %code code properly, and to build
2756 lists of all %define variables and %code qualifiers used in the
2757 skeleton: b4_skeleton_percent_define_variables and
2758 b4_skeleton_percent_code_qualifiers.
2759 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
2761 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
2762 the skeleton names lists can finish building first. In place of
2763 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
2764 expect the lists b4_user_percent_define_variables and
2765 b4_user_percent_code_qualifiers.
2766 * data/c++.m4: Where setting default values for b4_parser_class_name,
2767 b4_location_type, b4_filename_type, b4_namespace, and
2768 b4_define_location_comparison, update their names to the
2769 b4_percent_define_ namespace.
2770 * data/glr.c: Don't use b4_check_percent_define_variables and
2771 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
2772 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
2773 (b4_parser_class_name, b4_namespace): Define these using
2774 b4_get_percent_define for parser_class_name and namespace.
2775 * data/location.cc: Use b4_get_percent_define.
2776 * data/push.c: Don't use b4_check_percent_define_variables and
2777 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
2778 * data/yacc.c: Likewise, and don't call m4_exit in
2779 b4_use_push_for_pull_if or m4_wrap code will never execute.
2780 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
2782 (muscle_grow_user_name_list): ... this for consistency with the
2783 terminology used in bison.m4.
2784 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
2785 %define variable names, and rename muscle used_percent_define_variables
2786 to user_percent_define_variables.
2787 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
2788 user_percent_code_qualifiers.
2790 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
2791 {CODE} form is no longer accepted.
2792 * tests/input.at (Reject bad %code qualifiers): Rename to...
2793 (Reject unused %code qualifiers): ... this, and update test output.
2794 (%define error): Update test output.
2796 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
2798 Check for unrecognized %define variables similar to checking for
2799 unrecognized %code qualifiers. Check for redefined %define variables.
2800 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
2802 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
2803 (b4_check_percent_define_variables): New, also wraps it.
2804 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
2805 variables using b4_check_percent_define_variables.
2806 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
2807 all those exercised in the test suite and all those listed in the
2808 `Default values' section of c++.m4. Are there others?
2809 * data/push.c, data/yacc.c: Declare no valid %define variables.
2810 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
2811 similar to muscle_find, but it works even when the muscle stores a
2813 (muscle_grow_used_name_list): New function for constructing the used
2814 name list muscles that b4_check_for_unrecognized_names requires.
2815 * src/parse-gram.y (prologue_declaration): Warn if a variable is
2816 %define'd more than once. Define the b4_used_percent_define_variables
2817 muscle with muscle_grow_used_name_list.
2818 (grammar_declaration): Abbreviate %code code with
2819 muscle_grow_used_name_list.
2820 * tests/input.at (%define errors): New.
2822 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2824 Provide warn_at, complain_at, and fatal_at function callbacks to the
2825 skeletons, and use this for %code qualifier complaints.
2826 * data/bison.m4 (b4_error_at): New, invoked by...
2827 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
2828 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
2829 @fatal_at(...@) directives.
2830 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
2831 qualifiers in b4_used_percent_code_qualifiers and to use
2833 * src/location.c, src/location.h (boundary_set_from_string): New global
2835 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
2837 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
2838 to b4_used_percent_code_qualifiers.
2839 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
2841 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
2842 (lineno): Rename to...
2843 (out_lineno): ... this so I don't misunderstand it again.
2844 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
2845 here; these newlines are in the input but not the output file.
2846 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
2847 (at_directive_perform): ... this new static function, and add handling
2848 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
2850 * tests/input.at (Reject bad %code qualifiers): Update test output with
2851 locations and extend.
2853 * tests/output.at (Output file name: [, Output file name: ]): Remove
2854 bogus comment about these tests failing.
2856 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2858 Clean up b4_check_percent_code_qualifiers a little.
2859 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
2860 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
2861 documentation and add examples.
2862 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
2865 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
2867 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
2868 unreliable -- especially when they're hidden inside another macro.
2869 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
2870 data/c.m4: Remove m4_divert(-1).
2871 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
2872 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
2873 m4_divert_push(0) and m4_divert_pop(0).
2874 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
2875 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
2876 pushed and popped by m4sugar, should be first on the stack.
2878 Provide warn, complain, and fatal function callbacks to the skeletons.
2879 This provides more flexibility than m4_fatal, improves the error
2880 message format, and captures messages for translation. Discussed
2882 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
2883 * data/bison.m4 (b4_error): New, invoked by...
2884 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
2885 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
2886 directives. Because these M4 macros might be called when the current
2887 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
2888 the previous removal of uses of m4_divert, which caused trouble.
2889 (b4_check_percent_code_qualifiers): Use b4_complain instead of
2890 m4_fatal to report unrecognized %code qualifiers.
2891 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
2892 push parser requests.
2893 * data/glr.c: Use b4_complain instead of m4_fatal to report
2894 non-deterministic push parser requests.
2895 Update @output usage to @output(...@) form.
2896 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
2897 report missing %defines. Update @output usage to @output(...@) form.
2898 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
2900 * src/main.c (main): Invoke skel_scanner_free.
2901 * src/scan-skel.h (skel_scanner_free): Prototype new function.
2902 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
2903 obstack_for_string from flex-scanner.h.
2904 (YY_DECL): Use to declare skel_lex static.
2905 (decode_at_digraphs): Remove; now handled in the new
2906 SC_AT_DIRECTIVE_ARG start condition.
2907 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
2909 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
2910 at_directive_argv): New static globals.
2911 (INITIAL): Use fail_for_invalid_at.
2912 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
2913 recognize the start of a generalized `@directive(...@)' form and
2915 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
2916 directive args (using the new obstack_for_string), to decode the
2917 contained @ diagraphs, and to perform the directive. It recognizes
2918 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
2920 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
2921 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
2923 (scan_skel): Initialize obstack_for_string on the first call.
2924 (skel_scanner_free): New function to free obstack_for_string.
2925 * tests/input.at (Reject bad %code qualifiers): Update test output.
2927 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
2929 Consolidate the 4 prologue alternative directives (%code, %requires,
2930 %provides, and %code-top) into a single %code directive with an
2931 optional qualifier field. Discussed at
2932 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
2933 * NEWS (2.3a+): Rewrite the existing entry for the prologue
2935 * doc/bison.texinfo (Prologue Alternatives): Update.
2936 (Decl Summary): Update to %code "requires" and %code "provides".
2937 (Calc++ Parser): Update to %code "requires".
2938 (Table of Symbols): Remove entries for %requires, %provides, and
2939 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
2940 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
2941 are replaced by b4_percent_code_provides and b4_percent_code_requires,
2942 which are skeleton-specific.
2943 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
2944 declare what %code qualifiers it supports and to complain if any other
2945 qualifiers were used in the grammar.
2946 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
2947 and b4_user_code([b4_percent_code_provides]) in place of
2948 b4_user_requires and b4_user_provides.
2949 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
2950 Add b4_user_code([b4_percent_code_top]) and
2951 b4_user_code([b4_percent_code]).
2952 Invoke b4_check_percent_code_qualifiers.
2953 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
2954 PERCENT_REQUIRES): Remove.
2955 (grammar_declaration): Remove RHS's for %code-top, %provides, and
2956 %requires. Rewrite the %code RHS as the unqualified form defining the
2957 muscle b4_percent_code. Add another RHS for the qualified %code form,
2958 which defines muscles of the form b4_percent_code_QUALIFIER and the
2959 b4_used_percent_code_qualifiers muscle.
2960 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
2961 PERCENT_REQUIRES): Remove.
2962 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
2963 %code "requires" and %code "provides".
2964 * tests/input.at (Reject bad %code qualifiers): New.
2966 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
2968 Use the new code_props interface for destructors and printers.
2969 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
2970 printer_location members, and change the type of the destructor and
2971 printer members to code_props.
2972 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
2973 symbol_printer_get, semantic_type_destructor_set,
2974 semantic_type_printer_set, default_tagged_destructor_set,
2975 default_tagless_destructor_set, default_tagged_printer_set,
2976 default_tagless_printer_set): Use code_props in arguments and return
2977 types in place of char const * and location.
2978 (symbol_destructor_location_get, symbol_printer_location_get): Remove
2979 since the locations are now contained in the return of
2980 symbol_destructor_get and symbol_printer_get.
2981 * src/output.c (symbol_destructors_output, symbol_printers_output):
2983 (symbol_code_props_output): ... this to eliminate duplicate code.
2984 (output_skeleton): Update to use symbol_code_props_output.
2985 * src/reader.c (symbol_should_be_used): Update use of
2986 symbol_destructor_get.
2987 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
2988 Update uses of the various _destructor_set and _printer_set functions.
2989 * src/symtab.c: (default_tagged_destructor_location,
2990 default_tagless_destructor_location, default_tagged_printer_location,
2991 default_tagless_printer_location): Remove since we...
2992 (default_tagged_destructor, default_tagless_destructor,
2993 default_tagged_printer, default_tagless_printer): ... change the type
2994 of these to code_props.
2995 (symbol_new, semantic_type_new, symbol_destructor_set,
2996 semantic_type_destructor_set, symbol_destructor_get,
2997 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
2998 symbol_check_alias_consistency, default_tagged_destructor_set,
2999 default_tagless_destructor_set, default_tagged_printer_set,
3000 default_tagless_printer_set): Update.
3001 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
3002 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
3004 (symbol_print): Use SYMBOL_CODE_PRINT.
3006 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3008 Use the new code_props interface for rule actions.
3009 * src/symlist.h (symbol_list): Replace action, action_location, and
3010 used members with a code_props action_props member.
3011 * src/reader.c (symbol_should_be_used, grammar_rule_check,
3012 grammar_midrule_action, grammar_current_rule_merge_set,
3013 grammar_current_rule_symbol_append, packgram): Update.
3014 * src/scan-code.h (translate_rule_action): Remove, no longer used.
3015 * src/scan-code.l (handle_action_dollar): Update.
3016 (translate_rule_action): Remove, no longer used.
3017 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
3019 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3021 Use the new code_props interface in parse-gram.y.
3022 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
3023 Update all uses of translate_* functions to use the new code_props
3024 interface and to use gram_scanner_last_string_free and
3025 code_scanner_last_string_free where possible.
3026 (grammar_declaration): symbol_list_destructor_set and
3027 symbol_list_printer_set now perform the translation, so don't do it
3028 here. Use gram_scanner_last_string_free where possible.
3029 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
3030 translate_code): Remove, no longer used.
3031 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
3032 symbol_list_printer_set): Perform code translation here rather than
3033 depending on the caller to do so.
3035 * src/symlist.h (struct symbol_list): Correct some documentation typos.
3036 * src/scan-gram.h (gram_last_string): Remove declaration.
3037 * src/scan-gram.l (last_string): Declare it static.
3039 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3041 Encapsulate code properties and related functionality for the various
3042 destructors, printers, and actions into a code_props structure and
3043 interface. This patch merely implements code_props in scan-code.h and
3044 scan-code.l. Future patches will rewrite other modules to use it.
3045 Discussed starting at
3046 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
3047 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
3048 consistently initialize const structs that have an empty location
3050 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
3051 to ensure consistency.
3052 * src/scan-code.h (code_props): New structure.
3053 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
3054 function, macro, and const global variable for initializing a
3055 code_props with no code.
3056 (code_props_plain_init, code_props_symbol_action_init,
3057 code_props_rule_action_init, code_props_translate_code): The rest of
3058 the new code_props functional interface. Among other things, the init
3059 functions set the code_props kind field so that
3060 code_props_translate_code will know whether to behave like
3061 translate_symbol_action, translate_rule_action, or translate_code.
3062 These old translate functions must remain until all other modules are
3063 updated to use the new code_props interface.
3064 (code_scanner_last_string_free): New function similar to
3065 gram_scanner_last_string_free.
3066 (code_scanner_free): Add documentation.
3067 * src/scan-code.l: Implement the new interface.
3068 (code_lex): Make it static, add a code_props* argument, and remove the
3070 (last_string): New static global similar to the one in scan-gram.l.
3071 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
3073 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
3074 code_props since Bison may one day use this information for destructors
3076 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
3077 (handle_action_dollar): Use symbol_list_n_get and set used flag
3078 directly since symbol_list_n_used_set is removed.
3079 (translate_action): Add a code_props* argument and remove the rule,
3080 action, and location arguments. Pass the code_props* on to code_lex.
3081 (translate_rule_action, translate_symbol_action, translate_code):
3082 Rewrite as wrappers around the new code_props interface.
3083 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
3084 it would eventually need to break the encapsulation of code_props.
3086 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3088 * etc/.cvsignore: New.
3090 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3092 Add maintainer-push-check to run maintainer-check using push parsing in
3093 place of pull parsing where available.
3094 * Makefile.am (maintainer-push-check): New.
3095 * data/bison.m4 (b4_use_push_for_pull_if): New.
3096 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
3097 appropriately based on their existing values.
3098 (yypush_parse): Don't print push-parser-specific diagnostics if push
3099 parsing is being used in place of pull parsing.
3100 * data/yacc.c: If push parsing should replace pull parsing, redirect to
3102 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
3103 variable, and insert b4_use_push_for_pull_flag into muscles.
3104 * tests/Makefile.am (maintainer-push-check): New.
3106 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
3108 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
3109 (whether successful or failed) so that yypush_parse can be invoked
3110 again to start a new parse using the same yypstate.
3111 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
3112 check multiple yypull_parse invocations on the same yypstate. For pull
3113 mode, extend to check multiple yyparse invocations.
3114 (Exploding the Stack Size with Alloca): Extend to try with
3116 (Exploding the Stack Size with Malloc): Likewise.
3118 * tests/calc.at (Simple LALR Calculator): Don't specify
3119 %skeleton "push.c" since %push-pull-parser implies that now.
3120 * tests/headers.at (export YYLTYPE): Don't check for the push
3121 declarations. Otherwise, this test case can't be used to see if push
3122 mode can truly emulate pull mode.
3123 * tests/input.at (Torturing the Scanner): Likewise.
3124 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
3125 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
3126 AT_YACC_IF, which now includes the case of push mode since %skeleton
3127 need not be used for push mode. This will be more intuitive once
3128 push.c is renamed to yacc.c.
3130 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
3132 For push mode, convert yyparse from a macro to a function, invoke yylex
3133 instead of passing a yylexp argument to yypull_parse, and don't
3134 generate yypull_parse or yyparse unless %push-pull-parser is declared.
3135 Discussed starting at
3136 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
3137 * data/bison.m4 (b4_pull_if): New.
3138 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
3139 * data/push.c: Improve M4 quoting a little.
3140 (b4_generate_macro_args, b4_parenthesize): Remove.
3141 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
3142 any time a pull parser is requested.
3143 Don't #define this as a wrapper around yypull_parse. Instead, when
3144 both push and pull are requested, make it a function that does that
3146 (yypull_parse): If there's a b4_prefix, #define this to
3147 b4_prefix[pull_parse] when both push and pull are requested.
3148 Don't define this as a function unless both push and pull are
3150 Remove the yylexp argument and hard-code yylex invocation instead.
3151 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
3153 * src/getargs.c (pull_parser): New global initialized to true.
3154 * getargs.h (pull_parser): extern it.
3155 * src/output.c (prepare): Insert pull_flag muscle.
3156 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
3157 (prologue_declaration): Set both push_parser and pull_parser = true for
3158 %push-pull-parser. Set push_parser = true and pull_parser = false for
3160 * src/scan-gram.l: Don't accept %push_parser as an alternative to
3161 %push-parser since there's no backward-compatibility concern here.
3162 Scan %push-pull-parser.
3163 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
3164 instead of %push-parser.
3165 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
3166 prototype it in the module that calls yyparse.
3167 * tests/input.at (Torturing the Scanner): Likewise.
3168 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
3170 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
3172 Update etc/bench.pl. Optimize push mode a little (the yyn change
3173 deserves most of the credit).
3174 * Makefile.am (SUBDIRS): Add etc subdirectory.
3175 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
3176 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
3177 yytoken, yyval, and yyloc declarations to...
3178 (yyparse or yypush_parse): ... here to improve performance. For
3179 yypush_parse invocations after the first, be sure to assign yyn its old
3181 (yypstate_new): Don't bother initializing the yyresult field since the
3182 initial value isn't used.
3183 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
3184 remove the #define that, in push mode, set it to yyps->NAME.
3185 * etc/Makefile.am: New.
3186 * etc/bench.pl: Remove and build it instead from...
3187 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
3188 "tests/bison" from the build directory by default rather than just
3189 invoking "bison" from $PATH.
3190 (calc_grammar): Update push parser code: don't declare yylval globally,
3191 don't define yyparse_wrapper, and don't #define yyparse.
3192 (bench_grammar): Update to check all working combinations of yacc.c,
3193 push.c, impure, pure, pull, and push.
3195 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
3197 For push mode, add pull wrappers around yypush_parse.
3198 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
3199 (yypull_parse): New function wrapping yypush_parse.
3200 (yyparse): New #define wrapping yypull_parse.
3201 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
3203 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
3204 prototype yylex in the module that calls yyparse, and don't prototype
3205 yyparse there. Otherwise, the yyparse expansion won't compile.
3206 * tests/input.at (Torturing the Scanner): Likewise.
3208 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
3210 Enable push parsers to operate in impure mode. Thus, %push-parser no
3211 longer implies %pure-parser. The point of this change is to move
3212 towards being able to test the push parser code by running the entire
3213 test suite as if %push-parser had been declared.
3214 * data/push.c (yypush_parse): For impure mode, remove the
3215 yypushed_char, yypushed_val, and yypushed_loc arguments.
3216 Instead, declare these as local variables initialized to the global
3217 yychar, yylval, and yylloc.
3218 For the first yypush_parse invocation only, restore the initial values
3219 of these global variables when it's time to read a token since they
3220 have been overwritten.
3221 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
3223 * tests/calc.at (Simple LALR(1) Calculator): Always declare
3224 %pure-parser along with %push-parser since this test case was designed
3225 for pure push parsers.
3226 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
3227 (AT_YACC_OR_PUSH_IF): New.
3228 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
3229 add a note that it's still wrong for some cases (as it has been for a
3231 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
3232 %push-parser no longer implies %pure-parser.
3234 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
3236 Remove some unnecessary differences between the pull parser code and
3237 the push parser code. This patch enables yynerrs in push mode.
3238 * data/push.c: Reformat M4 a little.
3239 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
3240 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
3241 because push mode is on. Instead, if pure mode is on, move yynerrs
3243 (b4_declare_parser_state_variables): ... here.
3244 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
3245 to yyps->NAME so it can be used in yypush_parse.
3246 (yypush_parse): Don't omit uses of yynerrs in push mode.
3248 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
3250 Fix bug such that the first pushed token's value and location are
3251 sometimes overwritten (sometimes by %initial-action) before being used.
3252 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
3253 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
3254 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
3255 more closely mimic the pull parser logic.
3256 Don't copy the pushed token to yychar, yylval, and yylloc until it's
3257 time to read a token, which is after any initialization of yylval and
3259 (gottoken): Rename label to...
3260 (yyread_pushed_token): ... for clarity and to avoid infringing on the
3263 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
3265 Rearrange initialization of the parser state variables so that the
3266 skeleton doesn't have to have a copy for pull mode and another for push
3267 mode. This patch also fixes at least a bug such that yylloc was not
3268 initialized (with b4_location_initial_line and
3269 b4_location_initial_column) upon calling yypush_parse. However, that
3270 initialization now overwrites the first token's location;
3271 %initial-action assigning @$ already did the same thing, and both bugs
3272 will be fixed in a later patch.
3273 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
3274 (b4_declare_parser_state_variables): Remove initialization of yytoken,
3275 yyss, yyvs, yyls, and yystacksize.
3276 (yypstate_new): Remove initialization of some yypstate fields: yystate,
3277 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
3279 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
3280 yyps->NAME so it can be used in yypush_parse.
3281 (yyparse or yypush_parse): For yypush_parse, don't print the
3282 "Starting parse" diagnostic for invocations after the first.
3283 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
3284 yypush_parse, only do it for the first invocation.
3285 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
3286 initialization to occur in yypush_parse but only on the first
3289 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
3291 * data/push.c: Add CPP guards around push parser declarations in both
3292 the header and the code file.
3293 In the code file, move the push parser declarations to the same place
3294 they appear in the header file.
3295 Clean up the M4 some, especially the inconsistent underquoting in
3296 some b4_c_function_def and b4_c_function_decl uses.
3298 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
3300 Encapsulate the push parser state variables into an M4 macro so the
3301 push skeleton doesn't have to list them again for pull mode's yyparse.
3302 For push mode, remove yypush_parse's local equivalents of these
3303 variables to eliminate unnecessary copying between the two sets at
3304 run-time. This patch also fixes at least a bug related to multiple
3305 %initial-action invocations in push mode.
3306 * data/push.c (b4_declare_parser_variables): Rename to...
3307 (b4_declare_scanner_communication_variables): ... this for clarity and
3309 (b4_declare_yyparse_variables): Remove and move its contents to the one
3310 spot where it was invoked.
3311 (b4_declare_parser_state_variables): New macro containing the parser
3312 state variables required by push mode.
3313 (struct yypstate): Replace all fields but yynew with
3314 b4_declare_parser_state_variables.
3315 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
3316 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
3317 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
3318 (yyparse or yypush_parse): For yyparse in pull mode, replace local
3319 parser state variable declarations with
3320 b4_declare_parser_state_variables.
3321 Don't initialize parser state variables when calling yypush_parse since
3322 yypstate_new already does that.
3323 Invoke the user's initial action only upon the first yypush_parse
3325 Remove all code that copies between the local parser state variables
3328 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
3330 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
3331 prevent a name collision in a future patch where these names will
3332 sometimes be #define'd.
3333 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
3334 since it no longer has the same name as the existing argument.
3335 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
3337 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
3338 and Joel E. Denny <jdenny@ces.clemson.edu>
3340 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
3341 that the argument is case-insensitive, and there's no `=' here.
3342 For the %skeleton entry, mention that %language is better.
3343 (Bison Options): Likewise for --language and --skeleton. Move the
3344 --skeleton entry so that the `Tuning the parser' section is sorted
3345 alphabetically on long options.
3346 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
3347 %language directive in detail here; cross-reference the %language
3348 documentation instead.
3349 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
3350 `%require "2.3b"' so that the example is always up-to-date.
3351 (Table of Symbols): Add entries for %language and %skeleton.
3352 * examples/extexi (normalize): Instead of replacing every %require
3353 argument with the current Bison version, just substitute for
3354 `@value{VERSION}'. This guarantees that we're testing what actually
3355 appears in the documentation.
3356 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
3357 rather than `@VERSION@'.
3359 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
3361 * NEWS: Reword the %language news a bit, and put it earlier.
3363 * src/getargs.c (skeleton_arg): Last arg is now location const *.
3364 Rewrite to simplify the logic.
3365 (language_argmatch): Likewise.
3366 (program_name): We now own this var.
3367 * src/getargs.h (struct bison_language): Use char[] rather than
3370 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
3372 * src/complain.c (program_name): Remove decl; no longer needed.
3373 * src/main.c (program_name): Remove; now belongs to getargs.
3375 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
3377 * NEWS: Document %language.
3379 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
3381 * data/c-skel.m4, data/c++-skel.m4: New files.
3382 * data/glr.c: Complain on push parsers.
3384 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
3386 (Decl Summary): Document %language and %skeleton.
3387 (Command line): Document -L.
3389 * examples/extexi: Rewrite %require directive.
3390 * examples/calc++/Makefile.am: Pass VERSION to extexi.
3392 * src/files.c (compute_exts_from_gc): Look in language structure
3394 (compute_file_name_parts): Check whether .tab should be added.
3395 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
3396 (language, skeleton_arg, language_argmatch): New.
3397 (long_options): Add --language.
3398 (getargs): Use skeleton_arg, add -L/--language.
3399 * src/getargs.h: Include location.h.
3400 (struct bison_language, language, skeleton_arg, language_argmatch): New.
3401 * src/output.c (prepare): Pick default skeleton from struct language.
3402 Don't dispatch C skeletons here.
3403 * src/parse-gram.y (PERCENT_LANGUAGE): New.
3404 (prologue_declaration): Add "%language" rule, use skeleton_arg.
3405 * src/scan-gram.l ("%language"): New rule.
3407 * tests/calc.at: Test %skeleton and %language.
3408 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
3409 (AT_GLR_IF): Look for %skeleton "glr.cc".
3410 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
3411 (AT_YACC_IF): Reject %language.
3413 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
3415 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
3416 since it wasn't used; only the typedef name 'semantic_type' is needed.
3417 Also, omit trailing white space.
3419 * bootstrap: Sync from coreutils.
3420 (gnulib_extra_files): Add build-aux/announce.gen.
3421 (slurp): Adjust .gitignore files like .cvsignore files.
3422 * build-aux/announce-gen: Remove from CVS, since bootstrap
3425 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
3427 Make %push-parser imply %pure-parser. This fixes several bugs; see
3428 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
3429 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
3431 * data/push.c: Don't bother testing b4_push_if when deciding whether
3432 to expand b4_declare_parser_variables globally.
3433 (yypush_parse): Likewise in here.
3435 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
3436 (yy_reduce_print): Reformat M4 for readability.
3438 2006-12-15 Bob Rossi <bob@brasko.net>
3439 and Joel Denny <jdenny@ces.clemson.edu>
3441 * data/push.c (yypstate): Add typedef, and update all uses of
3442 struct yypstate to just yypstate.
3443 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
3445 2006-12-14 Bob Rossi <bob@brasko.net>
3447 * data/push.c (yypush_parse): Declare prototype regardless of
3450 2006-12-14 Bob Rossi <bob@brasko.net>
3452 * data/push.c (yyparse): Remove the prototype and the #define when in
3455 2006-12-13 Bob Rossi <bob@brasko.net>
3457 * data/push.c (yypstate_init): Rename to...
3458 (yypstate_new): ... this and use b4_c_function_def.
3459 (yypstate_delete): New.
3460 (yypush_parse): Change parameters yynval and yynlloc to be const.
3461 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
3462 yypstate_delete functions.
3464 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
3466 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
3467 strange test case titles. Reported by Bob Rossi.
3469 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
3471 * TODO: Add pointer to Sylvain Schmitz's work on static detection
3472 of potential ambiguities in GLR grammers.
3474 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
3476 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
3477 `bison ', use m4_index instead of m4_substr since chopping up a string
3478 containing M4-special characters causes problems here.
3480 Fix a couple of bugs related to special characters in user-specified
3481 file names, and make it easier for skeletons to compute output file
3482 names with the same file name prefix as Bison-computed output file
3484 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
3485 b4_parser_file_name and b4_spec_defines_file instead of
3486 @output_parser_name@ and @output_header_name@, which are now redundant.
3487 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
3488 b4_parser_file_name, b4_spec_defines_file, and the new
3489 @basename(FILENAME@) instead of @output_parser_name@ and
3490 @output_header_name@, which inappropriately escaped the file names as
3492 * src/files.c (all_but_ext): Remove static qualifier.
3493 (compute_output_file_names): Move `free (all_but_ext)' to...
3494 (output_file_names_free): ... here since all_but_ext is needed later.
3495 * src/files.h (all_but_ext): Extern.
3496 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
3497 exactly what MUSCLE_INSERT_STRING used to do.
3498 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
3499 characters are escaped properly.
3500 * src/output.c (prepare): Define muscle file_name_all_but_ext as
3502 For pkgdatadir muscle, maintain previous functionality by using
3503 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
3504 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
3505 digraphs would never be expanded. Hopefully no one has M4-special
3506 characters in his Bison installation path.
3507 * src/scan-skel.l: Don't parse @output_header_name@ and
3508 @output_parser_name@ anymore since they're now redundant.
3509 In @output, use decode_at_digraphs.
3510 Parse a new @basename command that invokes last_component.
3511 (decode_at_digraphs): New.
3512 (BASE_QPUTS): Remove unused.
3513 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
3514 (Output file name): New tests.
3516 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
3518 Warn about output files that are generated by the skeletons and that
3519 conflict with other output files.
3520 * data/glr.c: Don't generate the header file here when glr.cc does.
3521 * src/files.c (file_names, file_names_count): New static globals.
3522 (compute_output_file_names): Invoke output_file_name_check for files
3523 not generated by the skeletons and remove existing checks.
3524 (output_file_name_check): New function that warns about conflicting
3526 (output_file_names_free): Free file_names.
3527 * src/files.h (output_file_name_check): Declare.
3528 * src/scan-skel.l: Invoke output_file_name_check for files generated by
3530 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
3531 (Conflicting output files): New tests.
3533 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3535 * doc/bison.texinfo: Fix a couple of typos.
3537 2006-12-08 Bob Rossi <bob@brasko.net>
3539 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
3541 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
3543 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
3544 (yypush_parse): Rename yypvars argument to yyps and remove redundant
3546 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
3547 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
3549 2006-12-07 Bob Rossi <bob@brasko.net>
3550 and Joel Denny <jdenny@ces.clemson.edu>
3552 * data/push.c (yypvarsinit): Change return type from void* to struct
3553 yypvars*. No longer cast to void* on return.
3554 (struct yypvars): Remove yylen since it need not be remembered between
3555 yypushparse invocations.
3556 (yypushparse): Don't copy between yylen and pv->yylen.
3558 2006-12-05 Bob Rossi <bob@brasko.net>
3560 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
3561 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
3562 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
3563 (struct yypvars): Remove b4_declare_parser_variables.
3564 (yypvarsinit): Remove init code for removed variables.
3565 (global scope): Do not declare b4_declare_parser_variables if
3567 (yypushparse): Add b4_declare_parser_variables.
3568 Init new local variables, and remove init code for removed
3571 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
3572 and yyparse for other modes.
3573 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
3574 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
3575 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
3576 (AT_PURE_LEX_IF): True if pure or push parser.
3578 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
3580 Document Yacc prologue alternatives and default %destructor's and
3581 %printer's as experimental. Don't mention Java yet. Discussed at
3582 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
3583 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
3584 (2.3a): Annotate this entry to say the old forms of these features were
3586 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
3587 Table of Symbols): Say they're experimental. Comment out any mention
3588 of Java (we'll want this back eventually).
3590 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
3592 Support a file name argument to %defines. Deprecate `=' in
3593 %file-prefix, %name-prefix, and %output. Discussed at
3594 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
3595 * NEWS (2.3a+): Mention.
3596 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
3597 form of %defines, and remove `=' from entries for %file-prefix,
3598 %name-prefix, and %output.
3599 * src/parse-gram.y (prologue_declaration): Implement.
3600 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
3601 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
3602 all but one occurrence of %name-prefix.
3603 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
3604 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
3605 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
3606 occurrence of each of %file-prefix and %output. Add check for %defines
3608 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
3609 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
3610 Remove the `=' from %output.
3612 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
3614 Don't escape $ in test case titles since Autoconf 2.61 now does that
3616 * tests/actions.at (Default %printer and %destructor are not for error
3617 or $undefined): Here.
3618 (Default %printer and %destructor are not for $accept): Here.
3619 * tests/input.at (Invalid $n and @n): Here.
3621 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
3623 Rename <!> to <>. Discussed starting at
3624 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
3625 * NEWS (2.3a+): Update.
3626 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3628 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
3629 * src/scan-gram.l (INITIAL): Implement.
3630 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
3631 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
3633 * tests/actions.at (Default tagless %printer and %destructor,
3634 Default tagged and per-type %printer and %destructor,
3635 Default %printer and %destructor are not for error or $undefined,
3636 Default %printer and %destructor are not for $accept,
3637 Default %printer and %destructor for mid-rule values): Update.
3638 * tests/input.at (Default %printer and %destructor redeclared,
3639 Unused values with default %destructor): Update.
3641 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3643 Don't let %prec take a nonterminal.
3644 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
3646 * tests/input.at (%prec takes a token): New test checking that %prec
3647 won't take a nonterminal.
3649 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
3651 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
3652 it was double-quoted.
3653 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
3654 grammar is maintained with Bison's highest standards.
3655 * src/getargs.c: Fix some typos in Doxygen comments.
3657 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
3659 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
3660 later. Reported by Paul Eggert in
3661 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
3662 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
3663 * src/scan-code.l (translate_action): Don't bother invoking
3664 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
3665 (code_scanner_free): Instead of invoking
3666 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
3668 * src/scan-gram.l (gram_scanner_free): Likewise.
3669 * src/scan-skel.l (scan_skel): Likewise.
3671 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
3673 * src/files.c (tr): Change return type to void.
3674 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
3675 has been called previously for the same key.
3676 (muscle_find): Return storage instead of value so that
3677 --enable-gcc-warnings doesn't produce warnings that the return discards
3678 const. aver that the value and storage are the same since storage
3679 could potentially be NULL when value is not.
3680 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
3683 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
3685 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
3686 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
3687 us a slightly cleaner distribution, and also works.
3688 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
3691 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
3692 and Paul Eggert <eggert@cs.ucla.edu>
3694 Don't let Bison leak memory except when it complains.
3695 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
3696 (spec_defines_file, dir_prefix): Now char *, not const char *,
3697 since they are freed.
3698 * src/files.c: Likewise.
3699 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
3701 (tr): Now operates in-place. All uses changed.
3702 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
3704 (compute_file_name_parts, compute_output_file_names): Don't store
3705 read-only data in variables that will be freed.
3706 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
3707 src_extension, and header_extension.
3708 (output_file_names_free): New public function to free
3709 spec_verbose_file, spec_graph_file, spec_defines_file,
3710 parser_file_name, and dir_prefix.
3711 * src/getargs.c (getargs): Don't store read-only data in variables that
3713 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
3714 (which previously existed but was unused), and quotearg_free.
3715 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
3716 * src/muscle_tab.c: Likewise.
3717 (muscle_entry): Make the value char const *,
3718 and add a new storage member that is char * and can be freed.
3719 (muscle_entry_free): New private function.
3720 (muscle_init): Use it instead of free.
3721 (muscle_insert, muscle_grow): Update and use new storage member.
3722 (muscle_code_grow): Free the string passed to muscle_grow
3723 since it's not needed anymore.
3724 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
3725 add a new `char *code' member.
3726 ("{...}"): Declare semantic type as code.
3727 * src/scan-code.h (translate_rule_action):
3728 (translate_symbol_action, translate_code, translate_action): Return
3729 `char const *' rather than `char *' since external code should not free
3731 * src/scan-code.l: Likewise.
3732 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
3733 which is "{...}" in the parser.
3734 * tests/Makefile.am (maintainer-check-valgrind): Set
3735 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
3737 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
3739 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
3740 expecting a non-zero exit status sets --leak-check=summary and
3741 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
3742 this case, and we don't want to hear about it.
3744 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
3746 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
3747 instead of from the template, to simplify configuration a bit.
3748 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
3749 and m4/wint_t.m4, as they are needed with the latest gnulib.
3751 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
3753 Disable unset/unused mid-rule value warnings by default, and recognize
3754 --warnings=midrule-values to enable them. Discussed starting at
3755 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
3756 * NEWS (2.3a+): Mention.
3757 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
3758 warnings): Add entry for midrule-values subargument.
3759 * src/reader.c (symbol_should_be_used): Don't return true just because
3760 the value is a set/used mid-rule value unless
3761 --warnings=midrule-values was specified.
3762 * tests/input.at (Unused values, Unused values before symbol
3763 declarations): Run tests with and without --warnings=midrule-values.
3765 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
3766 than LIST_FREE directly.
3768 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
3770 Finish implementing --warnings=error, which should not be implied by
3771 --warnings=all (or by its synonyms -W and --warnings without
3773 * src/complain.c (set_warning_issued): New function to report that
3774 warnings are being treated as errors and to record an error if so.
3776 (warn_at, warn): ... here.
3777 * src/getargs.c (warnings_args, warnings_types): Reorder so that
3778 "error - warnings are errors" does not appear above "all - all of the
3780 (getargs): For -W and --warnings without subarguments, don't let
3781 FLAGS_ARGMATCH set warnings_error in warnings_flag.
3782 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
3784 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
3786 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
3787 empty subargument list. For example: `bison --warnings= parser.y'.
3789 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3791 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
3792 the parser header file so that gcc doesn't warn.
3794 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3796 Split the default %destructor/%printer into two kinds: <*> and <!>.
3797 Discussed starting at
3798 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
3799 * NEWS (2.3a+): Mention.
3800 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
3801 previous change today related to mid-rules.
3802 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3803 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
3804 (TYPE_TAG_ANY): Add as <*>.
3805 (TYPE_TAG_NONE): Add as <!>.
3806 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
3808 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
3809 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
3810 * src/symlist.c (symbol_list_default_new): Split into tagged and
3812 (symbol_list_destructor_set, symbol_list_printer_set): Split
3813 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
3814 SYMLIST_DEFAULT_TAGLESS.
3815 * src/symlist.h: Update symbol_list_default*_new prototypes.
3816 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
3817 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
3818 * src/symtab.c (default_destructor, default_destructor_location,
3819 default_printer, default_printer_location): Split each into tagged and
3821 (symbol_destructor_get, symbol_destructor_location_get,
3822 symbol_printer_get, symbol_printer_location_get): Implement tagged
3823 default and tagless default cases.
3824 (default_destructor_set, default_printer_set): Split each into tagged
3825 and tagless versions.
3826 * src/symtab.h: Update prototypes.
3827 * tests/actions.at (Default %printer and %destructor): Rename to...
3828 (Default tagless %printer and %destructor): ... this, and extend.
3829 (Per-type %printer and %destructor): Rename to...
3830 (Default tagged and per-type %printer and %destructor): ... this, and
3832 (Default %printer and %destructor for user-defined end token): Extend.
3833 (Default %printer and %destructor are not for error or $undefined):
3835 (Default %printer and %destructor are not for $accept): Update.
3836 (Default %printer and %destructor for mid-rule values): Extend.
3837 * tests/input.at (Default %printer and %destructor redeclared): Extend.
3838 (Unused values with default %destructor): Extend.
3840 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3842 Don't apply the default %destructor/%printer to an unreferenced midrule
3844 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
3845 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
3846 like $@n instead of just @n so that the default %destructor/%printer
3847 logic doesn't see them as user-defined symbols.
3848 (symbol_is_dummy): Check for both forms of the name.
3849 * src/reader.c (packgram): Remove the `$' from each midrule symbol
3850 name for which the midrule value is referenced in any action.
3851 * tests/actions.at (Default %printer and %destructor for mid-rule
3853 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
3854 for change to dummy symbol names.
3856 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
3858 Warn about unset midrule $$ if the corresponding $n is used.
3859 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
3861 (packgram): Before invoking grammar_rule_check on any rule, make sure
3862 all actions have already been scanned in order to set `used' flags.
3863 Otherwise, checking that a midrule's $$ is set will not always work
3864 properly because the midrule check must forward-reference the midrule's
3866 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
3869 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
3871 More improvements to the documentation of the prologue alternatives:
3872 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
3874 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
3875 some text to clarify the relative importance of the new directives and
3876 to show how these directives may be viewed as code labels.
3878 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
3880 Similar to the recently removed %before-header, add %code-top as the
3881 alternative to the pre-prologue. Mentioned at
3882 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
3883 Also, let the prologue alternatives appear in the grammar section.
3884 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
3885 (prologue_declaration): Move the existing prologue alternatives to...
3886 (grammar_declaration): ... here and add %code-top.
3887 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
3889 Clean up and extend documentation for the prologue alternatives.
3890 * NEWS (2.3a+): Describe prologue alternatives.
3891 * doc/bison.texinfo (Prologue): Move discussion of prologue
3893 (Prologue Alternatives): ... this new section, and extend it to discuss
3894 all 4 directives in detail.
3895 (Table of Symbols): Clean up discussion of prologue alternatives and
3898 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3900 DJGPP specific issues.
3902 * djgpp/config.bat: config.hin has been moved to lib. Adjust
3903 config.bat accordingly.
3904 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
3905 * djgpp/config.site: Likewise.
3907 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
3909 Replace %*-header with %provides, %requires, %code. See discussion at
3910 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
3912 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
3913 (b4_user_start_header): Remove.
3914 * data/glr.c: Use new macros instead of b4_*start_header
3916 * data/glr.cc: Likewise.
3917 * data/lalr1.cc: Likewise.
3918 * data/push.c: Likewise.
3919 * data/yacc.c: Likewise.
3921 * doc/bison.texinfo: Remove %before-header, rename
3922 %{start,end,after}-header to %requires, %provides, %code.
3924 * src/parse-gram.y: Likewise (also rename token names accordingly).
3925 * src/scan-gram.l: Likewise.
3926 * tests/actions.at: Likewise.
3928 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
3930 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
3931 Problem reported by Joel E. Denny.
3933 2006-10-14 Jim Meyering <jim@meyering.net>
3935 (Sync from coreutils.)
3936 Work also when the working directory (with e.g. coreutils sources)
3937 is version controlled with git, rather than CVS.
3938 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
3940 In messages and comments, say e.g., "checked-out sources",
3941 rather than "CVS sources".
3942 (version_controlled_file): New function. Work for git as well as
3943 for CVS. Don't use grep's -q option.
3944 (slurp): Call it here, in place of CVS-specific code.
3946 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
3948 Fix testsuite for ./configure --enable-gcc-warnings:
3949 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
3950 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
3951 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
3952 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
3953 * test/regression.at (Diagnostic that expects two alternatives):
3956 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
3958 * bootstrap.conf (gnulib_modules): Add config-h.
3959 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
3960 worry about HAVE_CONFIG_H.
3961 * lib/abitset.c: Likewise.
3962 * lib/bitset.c: Likewise.
3963 * lib/bitset_stats.c: Likewise.
3964 * lib/bitsetv-print.c: Likewise.
3965 * lib/bitsetv.c: Likewise.
3966 * lib/ebitset.c: Likewise.
3967 * lib/get-errno.c: Likewise.
3968 * lib/lbitset.c: Likewise.
3969 * lib/subpipe.c: Likewise.
3970 * lib/timevar.c: Likewise.
3971 * lib/vbitset.c: Likewise.
3972 * lib/bitset.c: Include "bitset.h" first, to test interface.
3973 * lib/bitset_stats.c: Include "bitset_stats.h" first.
3974 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
3975 * lib/bitsetv.c: Include "bitsetv.h" first.
3976 * lib/get-errno.c: Include "get-errno.h" first.
3977 * m4/.cvsignore: Add config-h.m4.
3978 * tests/actions.at (Default %printer and %destructor for ...):
3979 Adjust expected line numbers in output to reflect removal of #if
3980 HAVE_CONFIG_H lines.
3981 * tests/glr-regression.at (Missed %merge type warnings when ...):
3983 * tests/regression.at (Braced code in declaration in rules section):
3985 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
3986 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
3987 Include <config.h> unconditionally.
3989 * bootstrap: Sync from coreutils, as follows:
3991 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
3993 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
3994 variable was sometimes used without being initialized. This
3995 messed up the installation of the INSTALL file in some cases.
3997 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
3999 * bootstrap (usage, main program, symlink_to_gnulib): Add option
4000 --copy. Inspired by a suggestion from Bruno Haible.
4002 2006-10-03 Jim Meyering <jim@meyering.net>
4004 * bootstrap: Undo last change to this file, since now gnulib-tool
4005 sticks with the automake default in generating dependencies.
4007 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4009 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
4010 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
4012 * doc/bison.1: Add copyright notice.
4014 * data/glr.c: Don't include <stdarg.h>; not used.
4016 * NEWS: The -g and --graph options now output graphs in Graphviz
4017 DOT format, not VCG format.
4018 * doc/bison.1: Likewise.
4019 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
4020 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
4022 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
4023 * TODO: Remove Graphviz entry.
4024 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
4025 remove vcg.c, vcg.h, vcg_defaults.h.
4026 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
4027 * src/graphviz.c, src/graphviz.h: New files.
4028 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
4029 * src/files.h: Make comment more generic.
4030 * src/main.c (main): Likewise.
4031 * src/print_graph.h: Likewise.
4032 * src/getargs.c (usage): Make usage description more generic.
4033 * src/print_graph.c: Include graphviz.h rather than vcg.h.
4034 (static_graph, fgraph): Remove. All uses changed to pass
4035 arguments instead of sharing a static var.
4036 (print_core, print_actions, print_state, print_graph):
4037 Output graphviz format rather than VCG format.
4038 * tests/.cvsignore: Remove *.vcg; add *.dot.
4039 * tests/output.at: Expect *.dot files, not *.vcg files.
4041 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
4042 accommodates the 2006-10-08 change.
4044 2006-10-11 Bob Rossi <bob@brasko.net>
4046 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
4047 (b4_yyssa, b4_yyerror_range): New macros.
4048 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
4049 (yypvarsinit): Remove init of removed fields.
4050 (yypushparse): Remove use of removed fields; use new macros instead.
4052 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4054 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
4055 in a push parser. Reindent slightly to match yacc.c better.
4057 2006-10-11 Bob Rossi <bob@brasko.net>
4059 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
4061 (yypvarsinit, yypushparse): Remove init of removed fields.
4062 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
4064 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4066 * THANKS: Add Paolo Bonzini and Bob Rossi.
4068 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
4070 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
4071 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
4072 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
4073 b4_define_user_cde and uses): Remove.
4074 (b4_comment, b4_prefix, b4_sync_start): New.
4075 * data/bison.m4: New file, with most of the content removed from c.m4.
4076 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
4077 * src/output.c (output_skeleton): Pass bison.m4.
4078 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
4081 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
4083 Fix test failure reported by Tom Lane in
4084 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
4085 and try to make such failures easier to catch in the future.
4086 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
4087 that's now the caller's responsibility.
4088 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
4089 Set yychar = YYEOF if it's negative.
4090 * tests/actions.at (yylex): Abort if asked to read past EOF.
4091 * tests/conflicts.at (yylex): Likewise.
4092 * tests/cxx-type.at (yylex): Likewise.
4093 * tests/glr-regression.at (yylex): Likewise.
4094 * tests/input.at (yylex): Likewise.
4095 * tests/regression.at (yylex): Likewise.
4096 * tests/torture.at (yylex): Likewise.
4098 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
4100 Fix problems with translating English-language diagnostics.
4101 * bootstrap: Fix bug introduced in recent bootstrap changes, with
4102 respect to bison-runtime pot generation. The YY_ stuff
4103 wasn't being captured.
4104 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
4105 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
4106 * runtime-po/POTFILES.in: Add data/push.c.
4108 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
4110 Merge bootstrap changes from coreutils.
4112 2006-09-28 Jim Meyering <jim@meyering.net>
4114 Automatically generated dependencies are important even
4115 when all of the sources in a directory come from gnulib.
4116 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
4117 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
4119 2006-09-23 Jim Meyering <jim@meyering.net>
4121 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
4123 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4125 * bootstrap: Add support for --force.
4126 (usage): New function. Describe usage less tersely.
4127 (CVS_only_file): New var.
4129 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
4131 * data/push.c (YYPUSH_MORE): Make it an enum instead.
4132 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
4133 Adjust white space and comments to match GNU style better.
4135 2006-09-20 Bob Rossi <bob@brasko.net>
4137 * data/push.c (yyresult_get): Remove function.
4138 (YYPUSH_MORE): Add #define.
4139 (yypushparse): Modify return value.
4141 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4143 * stamp-h.in: Remove; no longer needed.
4144 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
4145 Remove config.h, config.hin, intl (no longer created).
4146 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
4149 Sync bootstrap from coreutils, as follows:
4151 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
4153 * bootstrap (symlink_to_gnulib): New function.
4154 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
4155 to copies-of-gnulib.
4156 (cp_mark_as_generated, slurp, gnulib_files):
4157 Avoid making a copy if it's the same as the old version.
4158 (gnulib_files): Add support for this variable (used by Bison).
4160 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4162 * src/getargs.c (usage): Rework to use conventions similar to
4163 coreutils, to make translation a bit easier and the code a bit
4164 smaller. Problem reported by Tim Van Holder.
4166 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
4168 Use some of gnulib's new modules, taken from coreutils.
4170 * bootstrap: Sync from coreutils, except add support for gnulib_files.
4171 * bootstrap.conf: New file.
4172 (gnulib_modules): Add configmake, inttypes, unistd.
4173 (XGETTEXT_OPTIONS): Add complain, complain_at,
4174 fatal, fatal_at, warn, warn_at, unexpected_end.
4175 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
4176 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
4178 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
4180 (GNULIB_AUTOCONF_SNIPPET): Remove.
4181 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
4183 * lib/.cvsignore: Add inttypes_.h.
4184 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
4185 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
4186 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
4187 no-longer-necessary initializations.
4188 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
4189 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
4190 use the unistd module.
4191 * src/system.h: Likewise.
4192 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
4193 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
4194 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
4195 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
4196 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
4197 * src/system.h: Include inttypes.h unconditionally, now that we
4198 use the inttypes module. Don't bother to include stdint.h, since
4199 inttypes.h now does that for us.
4200 (LOCALEDIR): Remove, now that we use the configmake module.
4201 * src/getargs.c: Include configmake.h.
4202 * src/main.c: Likewise.
4203 * src/output.c: Likewise.
4204 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
4205 not from $abs_top_builddir, since config.h moved.
4208 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
4209 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
4211 * src/parse-gram.y (symbol_declaration): Don't put statements
4212 before declarations; it's not portable to C89.
4213 * src/scan-code.l (handle_action_at): Likewise.
4215 * src/scan-code.l: Always initialize braces_level; the old code
4216 left it uninitialized and therefore had undefined behavior.
4218 Don't attempt to redefine 'assert', since it runs afoul of
4219 systems where standard headers (mistakenly) include <assert.h>.
4220 Instead, define and use our own alternative, called 'aver'.
4221 * src/reader.c: Don't include assert.h, since we no longer
4223 * src/scan-code.l: Likewise.
4224 * src/system.h (assert): Remove, replacing with....
4225 (aver): New function, taking a bool arg. All uses changed.
4226 * src/tables.c (pack_vector): Ensure that aver arg is bool,
4227 not merely an integer.
4229 2006-09-15 Bob Rossi <bob@brasko.net>
4231 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
4232 * data/c.m4 (YYPUSH): New.
4233 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
4234 * src/getargs.c (push_parser): New var.
4235 * src/getargs.h (push_parser): New declaration.
4236 * src/output.c (prepare): Add macro insertion of `push_flag'.
4237 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
4238 (prologue_declaration): Parse %push-parser.
4239 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
4240 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
4241 list of removed lines from the traces observed.
4242 (AT_CHECK_CALC_LALR): Added push parser tests.
4244 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
4246 * NEWS: Version 2.3a.
4247 * configure.ac (AC_INIT): Likewise.
4249 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
4250 "#define YYSTYPE int" that caused "make maintainer-check" to fail
4251 due to header ordering dependencies. I don't know why the #define
4254 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
4255 runtime cost when YYDEBUG is not defined, and so that some tests
4256 that used to fail now work. Problem and initial suggestion by
4258 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
4259 * data/glr.cc (b4_parser_class_name):
4260 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
4261 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
4262 (yydebug_) [YYDEBUG]: New member.
4263 (yycdebug_): Now defined only if YYDEBUG.
4264 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
4265 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
4266 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
4268 (debug_stream, set_debug_stream, debug_level, set_debug_level):
4269 Define only if YYDEBUG.
4270 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
4272 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
4273 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
4274 AT_CHECK_CALC_GLR_CC that are working now.
4276 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
4278 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
4279 We don't need them in glr.cc, and glr.c defines them.
4280 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
4281 assumes that defining it to anything is the same as defining
4282 it to 1. Problem reported by Paolo Bonzini.
4284 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
4286 * data/c.m4 (b4_null, b4_case): Define.
4287 * src/output.c (prepare_symbols): Use b4_null.
4288 (user_actions_output): Use b4_case.
4290 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
4292 * data/glr.c (b4_shared_declarations): Put start-header first,
4293 before any #includes that we generate, so that feature-test
4294 macros work. Problem reported by Michael Deutschmann in
4295 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
4296 * data/lalr1.cc: Likewise.
4297 * doc/bison.texinfo (Prologue): Document that feature-test macros
4298 should be defined before any Bison declarations.
4299 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
4300 that depend on location.hh after, not before, Bison decls, since
4301 we now include location.hh after the first user prologue.
4303 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
4304 Sander Brandenburg in
4305 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
4306 Also, fix minor white space and comment issues.
4307 (Prologue): Mention that it's better to define feature-test macros
4308 before Bison declarations. Problem reported by Michael Deutschmann.
4310 * README-cvs: Fix typo: "&" should be "&&". Problem reported
4312 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
4313 This adjusts to recent gnulib changes.
4315 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
4317 Finish implementation of per-type %destructor/%printer. Discussed
4319 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
4321 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
4322 * NEWS (2.3+): Add a description of this feature to the default
4323 %destructor/%printer description.
4324 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
4325 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
4326 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
4327 list node contains a semantic type.
4328 * src/symtab.c, src/symtab.h: Extend with a table that associates
4329 semantic types with their %destructor's and %printer's.
4330 (semantic_type_from_uniqstr, semantic_type_get,
4331 semantic_type_destructor_set, semantic_type_printer_set): New functions
4332 composing the public interface of that table.
4333 (symbol_destructor_get, symbol_destructor_location_get,
4334 symbol_printer_get, symbol_printer_location_get): If there's no
4335 per-symbol %destructor/%printer, look up the per-type before trying
4337 * tests/actions.at (Per-type %printer and %destructor): New test case.
4338 * tests/input.at (Default %printer and %destructor redeclared):
4339 Extend to check that multiple occurrences of %symbol-default in a
4340 single %destructor/%printer declaration is an error.
4341 (Per-type %printer and %destructor redeclared, Unused values with
4342 per-type %destructor): New test cases.
4344 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
4346 Require default %destructor/%printer to be declared using
4347 %symbol-default instead of an empty symbol list, and start working on
4348 new per-type %destructor/%printer. Discussed at
4349 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
4350 * NEWS (2.3+): Add %symbol-default to example.
4351 * bison.texinfo (Freeing Discarded Symbols): Likewise.
4352 (Table of Symbols): Add entry for %symbol-default.
4353 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
4354 (generic_symlist, generic_symlist_item): New nonterminals for creating
4355 a list in which each item is a symbol, semantic type, or
4357 (grammar_declaration): Use generic_symlist in %destructor and %printer
4358 declarations instead of symbols.1 or an empty list.
4359 (symbol_declaration, precedence_declaration, symbols.1): Update actions
4360 for changes to symbol_list.
4361 * src/reader.c: Update for changes to symbol_list.
4362 * src/scan-code.l: Likewise.
4363 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
4364 * src/symlist.c, src/symlist.h: Extend such that a list node may
4365 represent a semantic type or a %symbol-default in addition to just an
4366 ordinary symbol. Add switched functions for setting %destructor's and
4368 * tests/actions.at, tests/input.at: Add %symbol-default to all default
4369 %destructor/%printer declarations.
4371 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
4373 Whether the default %destructor/%printer applies to a particular symbol
4374 isn't a question of whether the user *declares* that symbol (in %token,
4375 for example). It's a question of whether the user by any means
4376 *defines* the symbol at all (by simply using a char token, for
4377 example). $end is defined by Bison whereas any other token with token
4378 number 0 is defined by the user. The error token is always defined by
4379 Bison regardless of whether the user declares it with %token, but we
4380 may one day let the user define error as a nonterminal instead.
4381 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
4382 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
4383 the meaning of "user-defined".
4384 * tests/actions.at (Default %printer and %destructor for user-declared
4385 end token): Rename to...
4386 (Default %printer and %destructor for user-defined end token): ...
4389 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
4390 computation of whether to apply the default, don't maintain a list of
4391 every Bison-defined symbol. Instead, just check for a first character
4392 of '$', which a user symbol cannot have, and check for the error token.
4394 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
4396 Don't apply the default %destructor or %printer to the error token,
4397 $undefined, or $accept. This change fits the general rule that the
4398 default %destructor and %printer are only for user-declared symbols,
4399 and it solves several difficulties that are described in the new test
4401 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
4402 * tests/actions.at (Default %printer and %destructor are not for error
4403 or $undefined, Default %printer and %destructor are not for $accept):
4406 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
4408 Allow %start after the first rule.
4409 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
4410 when parsing the first rule.
4411 (check_and_convert_grammar): Search for it here after all grammar
4412 declarations have been parsed. Skip midrules, which have dummy LHS
4414 * src/symtab.c (symbol_is_dummy): New function.
4415 * src/symtab.h (symbol_is_dummy): Declare it.
4416 * tests/input.at (%start after first rule): New test.
4418 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
4420 Redo some of the previous commit: add back the ability to use
4421 non-aliased/undeclared string literals since it might be useful to
4422 those declaring %token-table.
4423 * src/reader.c (check_and_convert_grammar): Undo changes in previous
4424 commit: don't worry about complaints from symbols_pack.
4425 * src/symtab.c (symbol_new, symbol_class_set,
4426 symbol_check_alias_consistency): Undo changes in previous commit: count
4427 each string literal as a new symbol and token, assign it a symbol
4428 number, and don't complain about non-aliased string literals.
4429 (symbols_pack): Since symbol_make_alias still does not decrement symbol
4430 and token counts but does still set aliased tokens to the same number,
4431 symbol_pack_processor now leaves empty slots in the symbols array.
4433 * tests/regression.at (Undeclared string literal): Remove test case
4434 added in previous commit since non-aliased string literals are allowed
4436 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
4437 remove unnecessary string literal declarations.
4438 * tests/sets.at (Firsts): Likewise.
4440 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
4442 Don't allow an undeclared string literal, but allow a string literal to
4443 be used before its declaration.
4444 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
4445 symbols_pack complained.
4446 * src/symtab.c (symbol_new): Don't count a string literal as a new
4448 (symbol_class_set): Don't count a string literal as a new token, and
4449 don't assign it a symbol number since symbol_make_alias does that.
4450 (symbol_make_alias): It's not necessary to decrement the symbol and
4451 token counts anymore. Don't assume that an alias declaration occurs
4452 before any uses of the identifier or string, and thus don't assert that
4453 one of them has the highest symbol number so far.
4454 (symbol_check_alias_consistency): Complain if there's a string literal
4455 that wasn't declared as an alias.
4456 (symbols_pack): Bail if symbol_check_alias_consistency failed since
4457 symbol_pack asserts that every token has been assigned a symbol number
4458 although undeclared string literals have not.
4459 * tests/regression.at (String alias declared after use, Undeclared
4460 string literal): New test cases.
4461 (Characters Escapes, Web2c Actions): Declare string literals as
4463 * tests/sets.at (Firsts): Likewise.
4465 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
4467 In the grammar scanner, STRING_FINISH unclosed constructs and return
4468 them to the parser in order to improve error messages.
4469 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
4470 SC_BRACED_CODE, SC_PROLOGUE): Implement.
4471 * tests/input.at (Unclosed constructs): New test case.
4472 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
4475 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
4478 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
4480 Handle string aliases for character tokens correctly.
4481 * src/symtab.c (symbol_user_token_number_set): If the token has an
4482 alias, check and set its alias's user token number instead of its own,
4483 which is set to indicate the alias. Previously, every occurrence of
4484 the character token in the grammar overwrote that alias indicator with
4486 * tests/input.at (String aliases for character tokens): New test.
4488 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
4490 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
4492 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
4494 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
4495 to prevent failures when building on older platforms.
4496 Check for autopoint failure.
4497 Set XGETTEXT_OPTIONS to values that check for C format strings,
4498 so that translators are warned about them (this also helps
4499 prevent core dumps).
4501 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
4502 function, since it simplifies our code a bit.
4504 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
4505 rather than -W, so we don't get bogus warnings about sign comparisons.
4506 Add -Wpointer-arith, since that warning is useful (it reports code
4507 that does not conform to C89 and that some compilers reject).
4508 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
4509 since it's no longer needed.
4511 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
4513 Clean up scanners a bit.
4514 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
4515 definitions so gcc won't warn when obstack_for_string is unused.
4516 * src/scan-code.l: config.h and system.h are already #include'd by
4517 scan-code-c.c, so get rid of them here.
4518 * src/scan-gram.l: Likewise.
4519 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
4520 definitions rather than duplicating the rest of it.
4521 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
4523 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
4525 Suppress signed/unsigned comparison warnings for yycheck.
4526 * data/c.m4 (b4_safest_int_type): New macro.
4527 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
4528 a signed int type, cast it to b4_safest_int_type first.
4529 * data/yacc.c: Likewise.
4530 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
4533 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
4535 * doc/bison.texinfo: Fix some typos.
4537 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
4539 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
4540 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
4542 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
4543 the latest gnulib does this a different way.
4544 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
4545 translation was patched, so stop omitting it.
4547 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
4549 Enable declaration of default %printer/%destructor. Make the parser
4550 use these for all user-declared grammar symbols for which the user does
4551 not declare a specific %printer/%destructor. Thus, the parser uses it
4552 for token 0 if the user declares it but not if Bison generates it as
4553 $end. Discussed starting at
4554 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
4555 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
4557 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
4558 * NEWS (2.3+): Mention.
4559 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
4560 declare a %destructor for a mid-rule's semantic value. It's just
4561 impossible to declare one specific to it.
4562 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
4563 code. Describe default %destructor form.
4564 * src/parse-gram.y (grammar_declaration): Parse default
4565 %printer/%destructor declarations.
4566 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
4567 and symbol_destructor_location_get rather than accessing the destructor
4568 and destructor_location members of struct symbol.
4569 (symbol_printers_output): Likewise but for %printer's.
4570 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
4572 * src/symtab.c (default_destructor, default_destructor_location,
4573 default_printer, default_printer_location): New static global
4574 variables to record the default %destructor and %printer.
4575 (symbol_destructor_get, symbol_destructor_location_get,
4576 symbol_printer_get, symbol_printer_location_get): New functions to
4577 compute the appropriate %destructor and %printer for a symbol.
4578 (default_destructor_set, default_printer_set): New functions to set the
4579 default %destructor and %printer.
4580 * src/symtab.h: Prototype all those new functions.
4581 * tests/actions.at (Default %printer and %destructor): New test to
4582 check that the right %printer and %destructor are called, that they're
4583 not called for $end, and that $$ and @$ work correctly.
4584 (Default %printer and %destructor for user-declared end token): New
4585 test to check that the default %printer and %destructor are called for
4586 a user-declared end token.
4587 * tests/input.at (Default %printer and %destructor redeclared, Unused
4588 values with default %destructor): New tests to check related grammar
4589 warnings and errors.
4591 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
4593 Clean up handling of %destructor for the end token (token 0).
4594 Discussed starting at
4595 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
4597 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
4599 Make the skeletons consistent in how they pop the end token and invoke
4601 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
4602 state, which has token number 0, since this would invoke the
4603 %destructor for the end token.
4604 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
4605 until after shifting the end token, or else it won't be popped.
4606 * data/yacc.c (yyparse): Likewise.
4608 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
4609 it's the end token. Upon termination, destroy an unshifted lookahead
4610 even when it's the end token.
4611 * data/lalr1.cc (yy::parser::parse): Likewise.
4612 * data/yacc.c (yyparse): Likewise.
4614 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
4615 value warnings for the end token when the user gives the end token a
4618 * tests/actions.at (Printers and Destructors): Test all the above.
4620 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
4622 Update to latest gnulib and gettext versions.
4623 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
4625 (gnulib_files): Add m4/warning.m4. Don't worry about files
4626 overwritten by autopoint.
4627 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
4628 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
4630 Don't use autoreconf; instead, invoke autopoint etc. by hand,
4631 so that we can remove the intl files at a better time.
4632 (intl_files_to_remove): Remove aclocal.m4, since it gets
4633 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
4634 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
4635 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
4636 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
4637 Remove datarootdir hack; no longer needed.
4638 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
4639 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
4640 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
4642 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
4643 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
4645 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
4647 * bootstrap: Adjust to today's change to gnulib-tool by invoking
4648 it with --assume-autoconf='latest-stable'.
4650 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
4652 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
4653 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
4655 * src/muscle_tab.h (muscle_grow): Replace the header comments with
4656 those from muscle_tab.c since the old ones are misleading.
4658 2006-07-13 Akim Demaille <akim@epita.fr>
4660 Support %define "KEY" {VALUE}.
4661 * src/scan-code.h, src/scan-code.l (translate_action)
4662 (translate_rule_action, translate_symbol_action, translate_code):
4663 Return char *, not const char *.
4664 * src/parse-gram.y (declaration): Rename as...
4665 (prologue_declaration): this.
4666 (string_content): Remove this nonterminal, use STRING.
4667 (braceless, content, content.opt): New nonterminal.
4669 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
4671 * src/scan-gram.l (getargs.h): Don't include it.
4673 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
4675 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
4676 rather than a for-loop that declares a local bool variable. This
4677 should work around a compatibility problem with a Cray x1e C++
4678 compiler reported by Hung Nguyen in
4679 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
4680 The for-loop was introduced in the 2004-11-17 change but I don't
4681 know why it was needed.
4683 2006-07-12 Akim Demaille <akim@epita.fr>
4685 * data/c.m4: Comment changes.
4687 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
4689 * src/complain.c (error_message, ERROR_MESSAGE): New.
4691 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
4692 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
4694 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
4696 * NEWS: Instead of %union, you can define and use your own union type
4697 YYSTYPE if your grammar contains at least one <type> tag.
4698 Your YYSTYPE need not be a macro; it can be a typedef.
4699 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
4700 (Union Decl, Decl Summary): Document this.
4701 * data/glr.c (YYSTYPE): Implement this.
4702 * data/glr.cc (YYSTYPE): Likewise.
4703 * data/lalr1.cc (YYSTYPE): Likewise.
4704 * data/yacc.c (YYSTYPE): Likewise.
4705 * src/output.c (prepare): Output tag_seen_flag.
4706 * src/parse-gram.y (declaration, grammar_declaration):
4707 Use 'union_seen' rather than 'typed' to determine whether
4708 %union has been seen, since grammars can now be typed without
4710 (symbol_declaration, type.opt, symbol_def):
4711 Keep track of whether a tag has been seen.
4712 * src/reader.c (union_seen, tag_seen): New vars.
4714 * src/reader.h (union_seen, tag_seen, typed): Likewise.
4715 * src/scan-code.l (untyped_var_seen): New variable.
4716 (handle_action_dollar): Adjust to above changes.
4717 (handle_action_dollar, handle_action_at):
4718 Improve overflow checking for outlandish numbers.
4719 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
4720 avoid new diagnostics generated by above changes.
4721 * tests/regression.at (YYSTYPE typedef): Add test to check
4722 for type tags without %union.
4724 * src/symlist.c (symbol_list_length): Return int, not unsigned
4725 int, since callers expect int. This may need to get revisited
4726 once we have proper integer overflow checking.
4728 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
4729 object is now static.
4731 * src/getargs.c (flags_argmatch): Return void, not int,
4732 to pacify ./configure --enable-gcc-warnings.
4734 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
4735 since last_string is already defined to FLEX_PREFIX (last_string).
4737 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
4739 Implement --warnings/-W.
4740 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
4742 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
4744 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
4745 (warnings_args, warnings_types): New.
4746 (getargs, short_options, long_options): Accept -W/--warnings.
4747 Sort the options by alphabetical order, upper case letter right
4748 before its lower case.
4750 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
4752 Change %merge result type clash warnings to errors. Discussed at
4753 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
4754 * src/reader.c (record_merge_function_type): Use complain_at.
4755 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
4756 declared later): Update test case results.
4758 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
4760 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
4761 to be in alphabetical order.
4762 (trace_args): Spelling fixes.
4764 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
4766 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
4767 so they don't collide with user-defined macros.
4768 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
4769 this was never guaranteed, and now that we're using gnulib stdint,
4770 which defines int_fast16_t to long int, the problem is exposed.
4772 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
4774 * data/c.m4 (b4_basename): Simplify a bit, since we don't
4775 need the full POSIX semantics (and weren't implementing them
4778 Adjust to Autoconf 2.60 and today's gnulib.
4779 * bootstrap (gnulib_modules): Add stdint.
4780 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
4781 no longer copies it.
4782 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
4783 since stdint needs the former and wcwidth (which is now required
4784 by mbswidth) needs the latter.
4785 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
4786 work around a compatibility glitch between gettext 0.14.6 and
4788 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
4789 Do not check for uintptr_t, since new stdint module does the right
4791 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
4792 Add stdint.h, stdint_.h, wcwidth.h.
4793 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
4794 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
4795 stdint.m4, wchar_t.m4, wcwidth.m4.
4796 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
4797 usual order for ../lib/*.h files.
4798 (file_name_split): Use last_component, not base_name, to adjust
4800 * src/parse-gram.h: Include <strverscmp.h> in the usual order
4801 for ../lib/*.h files.
4802 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
4803 Define unconditionally, since we now assume the stdint module.
4804 * src/scan-skel.l: Include <dirname.h>.
4805 (BASE_QPUTS): Use last_component, not base_name.
4806 * src/system.h: Include <unlocked-io.h> in the usual order
4807 for ../lib/*.h files. Include <stdint.h> unconditionally,
4808 since we now use the stdint module.
4809 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
4810 HAVE_UINTPTR_T, since we now use the stdint module.
4811 (base_name): Remove decl, since files now include <dirname.h>
4814 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
4816 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
4818 * data/yacc.c, data/glr.c, data/location.cc: Use them.
4819 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
4821 * tests/calc.at: Adjust.
4823 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
4825 * data/c.m4 (b4_basename): New.
4826 (b4_syncline): Also output the location of its invocation (from
4828 (b4_user_action, b4_define_user_action, b4_user_actions)
4829 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
4830 (b4_user_stype): New.
4831 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
4833 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
4835 In the grammar file, the first column is 1 not 0 on the first line as
4836 on every other line.
4837 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
4838 * tests/input.at (Torturing the Scanner): Update output.
4840 * src/scan-gram.l (scanner_cursor): Declare it static.
4842 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
4844 In warnings, say "previous declaration" rather than "first
4846 * src/symtab.c (redeclaration): Do that here.
4847 * src/reader.c (record_merge_function_type): In the case of a result
4848 type clash, report the previous declaration rather than the very first
4849 one in the grammar file.
4850 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
4851 declared later): Add a third declaration to check this behavior.
4852 * tests/input.at (Incompatible Aliases): Update output.
4854 2006-06-27 Akim Demaille <akim@epita.fr>
4856 * doc/Doxyfile.in: New.
4857 * doc/Makefile.am: Use it.
4858 * src/lalr.h, src/symtab.h: Initial doxygenation.
4860 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
4862 Don't miss %merge result type warnings just because the LHS types are
4863 declared after the %merge. This continues the effort of the previous
4865 * src/reader.c (get_merge_function): Don't set the merger type yet.
4866 (record_merge_function_type): New function for setting the merger type
4867 and checking for clashes.
4868 (grammar_current_rule_merge_set): Set the location of the %merge for
4870 (packgram): Invoke record_merge_function_type for each rule now that
4871 all symbol type declarations have been parsed.
4872 * src/reader.h (merger_list.type_declaration_location): New member
4873 storing the location of the first %merge from which the type for this
4874 merging function was derived.
4875 * src/symlist.h (symbol_list.merger_declaration_location): New member
4876 storing the location of a rule's %merge, if any.
4877 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
4878 declared later): New test to catch the error fixed by the above patch.
4880 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
4882 Get action warnings (grammar_rule_check) right even when symbol
4883 declarations appear after the rules. Discussed at
4884 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
4886 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
4887 Don't mistake the type of $$ in a midrule to be that of its parent
4889 * src/reader.c (grammar_current_rule_end): Don't invoke
4890 grammar_rule_check yet since not all symbol declarations may have been
4892 (grammar_midrule_action): Likewise.
4893 Don't record whether the midrule's $$ has been used yet since actions
4894 haven't been translated yet.
4895 Record the midrule's parent rule and its RHS index within the parent
4897 (grammar_current_rule_action_append): Don't translate the action yet
4898 since not all symbol declarations may have been parsed yet and, thus,
4899 warnings about types for $$, $n, @$, and @n can't be reported yet.
4900 (packgram): Translate the action and invoke grammar_rule_check now that
4901 all symbol declarations have been parsed.
4902 * src/scan-code.l (handle_action_dollar): Now that this is invoked
4903 after parsing the entire grammar file, the symbol list here in the case
4904 of a midrule is actually the midrule's empty RHS, so reference its
4905 parent rule's RHS where necessary.
4906 On the other hand, now that you can already know it's a midrule, you
4907 aren't forced to think $$ has the same type as its parent rule's $$.
4908 (handle_action_at): In the case of a midrule, reference the parent rule
4910 * src/symlist.c (symbol_list_new): Initialize new midrule-related
4912 (symbol_list_length): Now that this is invoked after all rules have
4913 been parsed, a NULL symbol (rather than a NULL symbol list node)
4914 terminates a rule. symbol_list_print already does this correctly.
4915 * src/symlist.h (symbol_list.midrule_parent_rule,
4916 symbol_list.midrule_parent_rhs_index): New members so that midrules can
4917 remember their relationships with their parents.
4918 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
4919 fixed by the above patch.
4920 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
4922 (Unused values): ... this old test case and...
4923 (Unused values before symbol declarations): ... this new test case.
4924 This one is the same as `Unused values' except that all symbol
4925 declarations appear after the rules in order to catch the rest of the
4926 errors fixed by the above patch.
4928 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
4931 * src/reader.c (current_rule): Declare it static since it's no longer
4932 used outside this file.
4933 (grammar_current_rule_action_append): Remove redundant arguments from
4934 translate_rule_action invocation.
4935 * src/reader.h (current_rule): Remove this unused extern.
4936 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
4937 * src/scan-code.l (translate_rule_action): Likewise.
4939 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
4941 Clean up yesterday's patch.
4942 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
4944 * src/reader.c (grammar_current_rule_action_append): ... here for
4945 consistency with grammar_current_rule_symbol_append.
4946 * tests/regression.at (Braced code in declaration in rules section):
4947 Make yyerror and yylex static as usual.
4949 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
4951 Fix bug that mistakes braced code in a declaration in the rules section
4952 to be a rule action. Mentioned at
4953 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
4954 * src/scan-gram.l: Move midrule action detection from the start of the
4955 scanning of any braced code to...
4956 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
4957 action. For readability, use $2 and @2 rather than the equivalent
4959 * tests/regression.at (Braced code in declaration in rules section):
4960 New test to catch the error fixed by the above patch.
4962 Work on code readability some.
4963 * src/scan-code.l (current_rule): Get rid of this misleading and
4964 redundant declaration: it's actually extern'ed in reader.h.
4965 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
4966 translate_action): Add a rule argument and use it instead of the global
4968 (translate_rule_action): This already receives current_rule through an
4969 argument, so pass it on to translate_action instead of assigning
4970 current_rule to current_rule.
4971 (translate_symbol_action, translate_code): Pass rule = NULL to
4974 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
4976 Rename %before-definitions to %start-header and %after-definitions to
4977 %end-header. Don't use these declarations to separate pre-prologue
4978 blocks from post-prologue blocks. Add new order-independent
4979 declarations %before-header and %after-header as alternatives to the
4980 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
4981 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
4982 * NEWS (2.3+): Update for these changes.
4983 * data/glr.c (b4_before_definitions): Update to...
4984 (b4_start_header): ... this.
4985 (b4_after_definitions): Update to...
4986 (b4_end_header): ... this.
4987 * data/glr.cc: Likewise.
4988 * data/lalr1.cc: Likewise.
4989 * data/yacc.c: Likewise.
4990 * doc/bison.texinfo (The prologue): Update names, and replace remaining
4991 prologue blocks with %*-header declarations.
4992 (Calc++ Parser): Likewise.
4993 (Decl Summary): Update names.
4994 (Table of Symbols): Update description.
4995 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
4996 (PERCENT_END_HEADER): ... this.
4997 (PERCENT_BEFORE_DEFINITIONS): Update to...
4998 (PERCENT_START_HEADER): ... this.
4999 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5000 (declaration): Update token names and m4 macro names.
5001 When parsing %end-header and %start-header, invoke translate_code
5002 before muscle_code_grow, and no longer set global booleans to remember
5003 whether these declarations have been seen.
5004 Parse new %after-header and %before-header.
5005 * src/reader.c (before_definitions, after_definitions): Remove.
5006 (prologue_augment): Accept a new bool argument to specify whether to
5007 augment the pre-prologue or post-prologue.
5008 * src/reader.h (before_definitions, after_definitions): Remove these
5010 (prologue_augment): Add new bool argument.
5011 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
5012 (PERCENT_END_HEADER): ... this.
5013 (PERCENT_BEFORE_DEFINITIONS): Update to...
5014 (PERCENT_START_HEADER): ... this.
5015 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5016 * tests/actions.at (Printers and Destructors): Update names.
5018 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
5020 Add comparison operators for C++ location classes. Discussed at
5021 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
5022 * data/c++.m4 (b4_define_location_comparison): New boolean %define
5023 declaration indicating whether filename_type has an operator==. If
5024 filename_type is `std::string', it defaults to `1', `0' otherwise.
5025 * data/location.cc: Iff b4_define_location_comparison is `1', add
5026 operator== and operator!= for class position and for class location.
5029 * src/scan-action.l: Remove unused file.
5030 * src/symtab.c (symbol_printer_set): Use printer_location not
5031 destructor_location.
5032 * src/symtab.h (struct symbol): Replace incorrect source comment for
5034 * tests/input.at (Incompatible Aliases): Update output with correct
5037 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
5039 Don't put the pre-prologue in the header file. For the yacc.c code
5040 file and the glr.c header and code files, move the pre-prologue before
5041 the token definitions. Add new %before-definitions and
5042 %after-definitions to declare code that will go in both the header file
5043 and code file. Discussed at
5044 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
5045 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
5047 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
5048 * NEWS (2.3+): Describe these changes.
5049 * data/glr.c (b4_pre_prologue): Move from within to before...
5050 (b4_shared_declarations): ... this.
5051 Add new b4_before_definitions before b4_token_enums.
5052 Add new b4_after_definitions at the end.
5053 * data/glr.cc (b4_pre_prologue): Replace with...
5054 (b4_before_definitions): ... this in the header file.
5055 (b4_after_definitions): New near the end of the header file.
5056 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
5057 code file right before including the header file.
5058 (b4_before_definitions): New in the previous position of
5059 b4_pre_prologue in the header file.
5060 (b4_after_definitions): New near the end of the header file.
5061 * data/yacc.c: Clean up some m4 quoting especially in the header file.
5062 (b4_token_enums_defines): In the code file, move to right before
5063 YYSTYPE for consistency with the header file.
5064 (b4_before_definitions): New right before b4_token_enums_defines in
5065 both the header and code file.
5066 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
5067 header and code file.
5068 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
5069 of prologues for %union dependencies.
5070 (Decl Summary): In %defines description, mention the effect of
5071 %before-definitions and %after-definitions on the header file.
5072 (Calc++ Parser): Forward declare driver in a %before-definitions rather
5073 than in the pre-prologue so that make check succeeds.
5074 (Table of Symbols): Add entries for %before-definitions and
5076 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
5077 %before-definitions.
5078 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
5079 (declaration): Parse those declarations and append to
5080 b4_before_definitions and b4_after_definitions, respectively.
5081 * src/reader.c (before_definitions, after_definitions): New bools to
5082 track whether those declarations have been seen.
5083 (prologue_augment): Add to the post-prologue if %union,
5084 %before-definitions, or %after-definitions has been seen.
5085 * src/reader.h (before_definitions, after_definitions): New extern's.
5086 * src/scan-gram.l: Scan the new declarations.
5087 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
5088 prologue block in a %before-definitions or a %after-definitions based
5089 on whether the %union is declared.
5090 * tests/regression.at (Early token definitions with --yacc, Early token
5091 definitions without --yacc): Move tests for token definitions into the
5092 post-prologue since token names are no longer defined in the
5095 2006-06-20 Akim Demaille <akim@epita.fr>
5097 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
5098 (symbol_get): Use it.
5099 * src/parse-gram.y: Use it.
5101 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
5103 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
5104 build succeeds when configured with --enable-gcc-warnings.
5106 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
5108 * src/parse-gram.y (char_name): New function.
5109 (CHAR, STRING, string_content): For %printer, properly escape.
5110 (ID): Prefer fputs to fprintf.
5111 (id): Reindent to be consistent with other rules.
5112 Properly quote char.
5114 The Translation Project changed its way of publishing translations
5115 to maintainers. I haven't received any responses to my request
5116 for supporting the old way, or for documenting the new way. I
5117 have modified 'bootstrap' to use screen scraping
5118 (in this case, HTML scraping). This is unreliable and inelegant,
5119 but I don't see any better way. Yuck.
5120 * bootstrap (TP_URL, WGET_COMMAND): New vars.
5121 (get_translations): New function, which uses HTML scraping to
5122 deduce locations of latest translations.
5123 Use this function to grab both bison and bison-runtime .po files.
5124 Don't bother priming the pump for the runtime-po domain any more,
5125 as it's now translated better than bison is.
5127 2006-06-19 Akim Demaille <akim@epita.fr>
5129 * src/scan-gram.l: No longer "parse" things after `%union' until
5130 `{'. Rather, return a single "%union" token.
5131 No longer make symbols: return strings, and leave the conversion
5132 to symbols to the parser.
5133 (SC_PRE_CODE, token_type): Remove.
5134 * src/parse-gram.y (%union): New field `character'.
5137 (ID, ID_COLON): Now that the scanner no longer makes them
5138 identifiers, adjust all uses to invoke symbol_get.
5139 (id_colon): New, wraps the conversion from string to symbol.
5140 (%union): Accept a possible union_name.
5141 (symbol): Now can be a char.
5142 * data/c.m4 (b4_union_name): Leave a default value.
5143 * data/glr.c, data/yacc.c: Use it.
5145 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
5147 For associating token numbers with token names for "yacc.c", don't use
5148 #define statements unless `--yacc' is specified; always use enum
5149 yytokentype. Most important discussions start at:
5150 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
5151 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
5153 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
5154 * NEWS (2.3+): Mention.
5155 * data/c.m4 (b4_yacc_if): New.
5156 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
5158 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
5159 on token name definitions.
5160 * src/getargs.c (usage): Capitalize `Yacc' in English.
5161 * src/output.c (prepare): Define b4_yacc_flag.
5162 * tests/regression.at (Early token definitions): Test that tokens names
5163 are defined before the pre-prologue not just before the post-prologue.
5164 Remove this test case and copy to...
5165 (Early token definitions with --yacc): ... this to test #define's.
5166 (Early token definitions without --yacc): ... and this to test enums.
5168 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
5170 * NEWS: Reword the post-2.3 change to not be so optimistic about
5171 removing the old "look-ahead" spelling.
5172 Update previous look-ahead/lookahead change reports.
5173 * REFERENCES: look-ahead -> lookahead (since that's
5174 what he actually wrote).
5175 * doc/refcard.tex: look ahead -> lookahead,
5176 look-ahead -> lookahead
5178 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
5180 For consistency, use `lookahead' instead of `look-ahead' or
5181 `look_ahead'. Discussed starting at
5182 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
5184 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
5185 * NEWS: For the next release, note the change to `--report'.
5186 * TODO, doc/bison.1: Update English.
5187 * doc/bison.texinfo: Update English.
5188 (Understanding Your Parser, Bison Options): Document as
5189 `--report=lookahead' rather than `--report=look-ahead'.
5190 * src/conflicts.c: Update English in comments.
5191 (lookahead_set): Rename from look_ahead_set.
5192 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
5193 (resolve_sr_conflict): Rename local look_ahead_tokens to
5194 lookahead_tokens, and update other uses.
5195 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
5196 count_rr_conflicts, conflicts_free): Update uses.
5197 * src/getargs.c (report_args): Move "lookahead" before alternate
5199 (report_types): Update uses.
5200 (usage): For `--report' usage description, state `lookahead' spelling
5201 rather than `look-ahead'.
5202 * src/getargs.h (report.report_lookahead_tokens): Rename from
5203 report_look_ahead_tokens.
5204 * src/lalr.c: Update English in comments.
5205 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
5206 (state_lookahead_tokens_count): Rename from
5207 state_look_ahead_tokens_count.
5208 Rename local n_look_ahead_tokens to n_lookahead_tokens.
5209 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
5210 Rename local n_look_ahead_tokens to n_lookahead_tokens.
5212 Update English in output.
5213 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
5214 * src/print.c: Update English in comments.
5215 (lookahead_set): Rename from look_ahead_set.
5216 (print_reduction): Rename argument lookahead_token from
5218 (print_core, state_default_rule, print_reductions, print_results):
5220 * src/print_graph.c: Update English in comments.
5221 (print_core): Update uses.
5222 * src/state.c: Update English in comments.
5223 (reductions_new): Update uses.
5224 (state_rule_lookahead_tokens_print): Rename from
5225 state_rule_look_ahead_tokens_print, and update other uses.
5226 * src/state.h: Update English in comments.
5227 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
5228 (state_rule_lookahead_tokens_print): Rename from
5229 state_rule_look_ahead_tokens_print.
5230 * src/tables.c: Update English in comments.
5231 (conflict_row, action_row): Update uses.
5232 * tests/glr-regression.at
5233 (Incorrect lookahead during deterministic GLR,
5234 Incorrect lookahead during nondeterministic GLR): Rename
5235 print_look_ahead to print_lookahead.
5236 * tests/torture.at: Update English in comments.
5237 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
5238 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
5239 (Many lookahead tokens): Update uses.
5240 * data/glr.c: Update English in comments.
5241 * lalr1.cc: Likewise.
5243 * src/conflicts.h: Likewise.
5244 * src/lalr.h: Likewise.
5245 * src/main.c: Likewise.
5246 * src/output.c: Likewise.
5247 * src/parse-gram.c: Likewise.
5248 * src/tables.h: Likewise.
5249 * tests/calc.at: Likewise.
5251 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
5253 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
5255 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
5257 * TODO: Add request from Nelson H. F. Beebe to be able to install
5258 Bison without installing the yacc script.
5260 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
5262 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
5263 and yytext if they're already #define'd.
5264 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
5265 * src/scan-code-c.c: ... here.
5266 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
5269 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
5271 Get Bison to build again when configured with --enable-gcc-warnings.
5272 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
5274 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
5275 loc argument as it shadows a global.
5276 * src/scan-gram.l: Remove stray comma that prevents boundary_set
5279 * src/.cvsignore: Add scan-code.c.
5281 2006-06-07 Akim Demaille <akim@epita.fr>
5283 * src/scan-gram.l: Move the "add a trailing ; to actions" code
5285 * src/scan-code.l: here.
5286 * tests/input.at (Torturing the Scanner): Fix another location
5289 2006-06-07 Akim Demaille <akim@epita.fr>
5291 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
5293 2006-06-06 Akim Demaille <akim@epita.fr>
5295 Extract the parsing of user actions from the grammar scanner.
5296 As a consequence, the relation between the grammar scanner and
5297 parser is much simpler. We can also split "composite tokens" back
5299 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
5300 * src/scan-gram.l (add_column_width, adjust_location): Move to and
5302 * src/location.h, src/location.c (add_column_width)
5303 (location_compute): these.
5304 Fix the column count: the initial column is 0.
5305 (location_print): Be robust to ending column being 0.
5306 * src/location.h (boundary_set): New.
5307 * src/main.c: Adjust to scanner_free being renamed as
5309 * src/output.c: Include scan-code.h.
5310 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
5312 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
5313 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
5314 which is now, again, a separate token.
5315 Adjust all dependencies.
5316 Whereever actions with $ and @ are used, use translate_code.
5317 (action): Remove this nonterminal which is now useless.
5318 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
5319 (grammar_current_rule_action_append): Use translate_code.
5320 (packgram): Bound check ruleno, itemno, and rule_length.
5321 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
5322 (last_string, last_braced_code_loc, max_left_semantic_context)
5323 (scanner_initialize, scanner_free, scanner_last_string_free)
5324 (gram_out, gram_lineno, YY_DECL_): Move to...
5325 * src/scan-gram.h: this new file.
5326 (YY_DECL): Rename as...
5328 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
5329 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
5330 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
5331 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
5332 Move these declarations, and...
5333 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
5335 * src/flex-scanner.h: this new file.
5336 * src/scan-gram.l (rule_length, rule_length_overflow)
5337 (increment_rule_length): Remove.
5338 (last_braced_code_loc): Rename as...
5339 (gram_last_braced_code_loc): this.
5340 Adjust to the changes of the parser.
5341 Move all the handling of $ and @ into...
5342 * src/scan-code.l: here.
5343 * src/scan-gram.l (handle_dollar, handle_at): Remove.
5344 (handle_action_dollar, handle_action_at): Move to...
5345 * src/scan-code.l: here.
5346 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
5347 scan-code.h, scan-code-c.c, scan-gram.h.
5348 (EXTRA_bison_SOURCES): Add scan-code.l.
5349 (BUILT_SOURCES): Add scan-code.c.
5350 (yacc): Be robust to white spaces.
5352 * tests/conflicts.at, tests/input.at, tests/reduce.at,
5353 * tests/regression.at: Adjust the column numbers.
5354 * tests/regression.at: Adjust the error message.
5356 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
5358 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
5359 Use Akim's wording from
5360 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
5362 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
5364 Between Bison releases, manually append `+' to the previous Bison
5365 release number, and use that as a signal to automatically print the
5366 ChangeLog's CVS Id keyword from --version. Discussed starting at
5367 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
5368 * ChangeLog: Add Id header.
5369 * configure.ac (AC_INIT): Append `+' to `2.3'.
5370 * src/.cvsignore: Add revision.c.
5371 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
5372 (BUILT_SOURCES): Add revision.c.
5373 (revision.c): New target rule. This file defines a new global variable
5374 named revision. It initializes it with either the Id from ChangeLog
5375 or, if VERSION doesn't contain `+', with the empty string.
5376 * src/getargs.c (version): Print the value of revision.
5377 * src/revision.h: Extern revision.
5379 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
5381 * NEWS: Version 2.3.
5382 * configure.ac (AC_INIT): Likewise.
5384 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
5386 * data/glr.c (YYRECOVERING): Define to be a function-like macro
5387 with no arguments, not as an object-like macro. This is for
5388 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
5389 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
5390 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
5393 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
5395 * src/getargs.c (usage): Back out yesterday's modification of the
5396 --help output so that we don't have to wait for translation before
5399 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
5401 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
5402 Problem reported by Akim Demaille.
5404 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
5406 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
5408 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
5410 * data/yacc.c (yy_reduce_print): Omit trailing white space in
5411 generated source code. Problem reported by Frans Englich in
5412 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
5414 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
5416 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
5417 shell, not within 'make', so that 'make' by an ordinary builder
5418 (using GNU make) does not worry about configuring gzip. This also
5419 works around a bug reported independently by Keith Thompson and by
5420 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
5421 stderr rather than stdout, messing up the build logs.
5423 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
5425 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
5426 to make sure that YYID will never be unused. This fixes a 'make
5427 maintainer-check' failure caused by the recent changes to the 'Trivial
5428 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
5430 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
5432 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
5434 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
5435 state before an empty RHS is always resolved here. Only the location
5436 of that state is guaranteed to be resolved, and that's enough. This
5437 fixes the remaining bug reported by Derek M. Jones in
5438 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
5439 * tests/glr-regression.at (Uninitialized location when reporting
5440 ambiguity): Test the above case.
5441 Also, the embedded comments in this test case claim it checks the case
5442 of an empty RHS that has inherited the initial location. However, the
5443 corresponding LHS was already resolved, so yyresolveLocations didn't
5444 actually have reason to modify it. Fix this by forcing
5445 nondeterministic operation at the beginning of the parse.
5447 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
5449 * data/c.m4 (b4_yy_symbol_print_generate):
5450 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
5451 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
5452 of the bugs reported today by Derek M Jones in
5453 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
5454 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
5455 defined to be a type name without parens or brackets.
5456 (Location Type): Similarly for YYLTYPE.
5457 * tests/regression.at (Trivial grammars): Put in a test for this
5458 bug that will be caught by 'make maintainer-check' (though not,
5459 alas, by 'make check' unless your compiler is picky).
5461 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
5463 * NEWS: Version 2.2.
5464 * configure.ac (AC_INIT): Likewise.
5466 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
5468 * data/glr.c (yyreportTree): Make room in yystates for the state
5469 preceding the RHS. This fixes the segmentation fault reported by Derek
5471 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
5472 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
5473 to the user. Reported for yyreportTree by Derek M. Jones later in the
5475 * THANKS: Add Derek M. Jones.
5476 Update my email address.
5477 Fix typo in Steve Murphy's name.
5479 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
5481 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
5482 checking against YYLAST that caused the parser to miss a potential
5483 alternative in its diagnostic.
5484 Problem reported by Maria Jose Moron Fernandez in
5485 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
5486 * data/lalr1.cc (yysyntax_error_): Likewise.
5487 * data/yacc.c (yysyntax_error): Likewise.
5488 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
5489 tokens, in case we run into an older C compiler.
5490 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
5491 Use them to check for the off-by-one error fixed above.
5493 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
5494 YYSIZE_T, not size_t.
5495 * tests/regression.at (Trivial grammars): New test, to catch
5496 the error fixed by the above patch.
5498 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
5500 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
5502 Reported by Steve Murphy.
5504 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
5506 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
5507 * data/glr.cc: b4_location_flag is now b4_locations_flag.
5509 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
5511 Implement --trace=m4.
5512 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
5513 * src/output.c (output_skeleton): When set, pass -dV to m4.
5515 Factor the handling of flags in m4.
5516 * src/output.c (prepare): Rename the muscle names debug, defines,
5517 error_verbose to debug_flag, defines_flag, error_verbose_flag.
5518 * data/c.m4: Adjust.
5519 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
5520 Use b4_define_flag_if to define other b4_FLAG_if macros.
5521 (b4_location_if): As a consequence, rename as...
5522 (b4_locations_if): this, for consistency.
5523 Adjust all the skeletons.
5525 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
5527 * etc/bench.pm: Shorten bench names.
5529 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
5531 * src/output.h, src/output.c (error_verbose): Move to...
5532 * src/getargs.h, src/getargs.c: here.
5534 Adjust dependencies.
5536 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
5538 * data/c.m4 (b4_copyright): Put the special exception for Bison
5539 skeletons here, so we don't have to put it in each skeleton. All
5540 uses changed. Suggested by Akim Demaille. Also, wrap the
5541 copyright notice, in case it is longer than 80 columns. Replace
5542 comma by newline after title.
5544 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
5546 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
5547 incompatibility, not a bug. Mention that it wasn't fixed as of
5550 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
5552 * examples/extexi: Enforce the precedence of concatenation over
5554 Reported by Tommy Nordgren.
5556 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
5558 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
5559 with the member "token".
5560 Reported by Martin Nylin.
5562 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
5564 * data/glr.c: Switch to Bison 2.2 special-exception language in
5565 the copyright notice. Use more-regular format for titles and
5567 * data/glr.cc: Likewise.
5568 * data/location.cc: Likewise.
5569 * data/yacc.cc: Likewise.
5570 * doc/bison.texinfo (Conditions): Document this.
5571 * NEWS: likewise. Upgrade version to 2.2.
5573 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
5575 * data/glr.cc: Remove dead code.
5577 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
5579 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
5580 that variable and the line breaks the bootstrap. Problem reported
5581 by Juan M. Guerrero.
5583 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
5585 * doc/bison.texinfo (Multiple start-symbols): New.
5587 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
5589 * etc/README, etc/bench.pl: New.
5591 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
5593 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
5595 Reported by Mickael Labau.
5596 * tests/input.at (Torturing the Scanner): Test it.
5598 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
5600 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
5601 Problem reported by Bob Rossi.
5603 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
5605 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
5606 and didn't really work.
5607 For the index, use @ifnotinfo, not @iftex.
5608 Minor cleanups of spacing and terminology.
5610 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
5612 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
5613 of AT_NAME_PREFIX when %name-prefix is not used.
5615 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
5617 Apply --prefix to C++ skeletons too: they change the namespace.
5618 The test suite already exercize these cases.
5619 * data/c++.m4 (b4_namespace): New.
5620 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
5621 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
5622 * data/yacc.c, data/glr.c: Remove a useless `[]'.
5623 * doc/bison.texinfo: Document it.
5624 (Option Cross Key): Use @multitable in all formats. It looks
5625 nicer, even in TeX outputs.
5626 (Rules): Use the same code whatever the output type is.
5627 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
5628 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
5629 * tests/calc.at: Use it, instead of hard coding `yy'.
5631 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
5633 * TODO: Remove dead items.
5635 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
5637 * doc/FAQ: Remove, merged into...
5638 * doc/bison.texinfo (FAQ): this.
5639 * doc/Makefile.am (EXTRA_DIST): Adjust.
5641 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
5643 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
5645 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
5646 * doc/bison.texinfo (Calc++ Scanner): Use it.
5648 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
5650 Fix two nits reported by twlevo, plus one more that I discovered.
5652 * src/assoc.h (assoc_to_string): Give a name to the arg, as
5653 this is the usual Bison style.
5654 * src/location.h (location_print): Likewise.
5656 * src/reader.h (token_name): Likewise.
5658 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
5660 Fix some nits reported by twlevo.
5661 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
5662 and "POSIX". Use more-modern syntax for URLs. Mention C++
5663 and ask for Java. Don't hardwire OS version numbers. Add
5665 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
5666 * src/conflicts.c (solved_conflicts_obstack): Now static.
5668 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
5670 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
5671 page. Say "you can use it" not "you may use it" as on the web page;
5672 we're describing capabilities not granting permission.
5674 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
5676 * data/glr.c (yyresolveLocations): Rename local variables to avoid
5677 shadowing warnings. Use usual patter for iterating through RHS.
5678 * tests/glr-regression.at
5679 (Uninitialized location when reporting ambiguity):
5680 Modify yylex so that it uses its argument, rather than trying
5681 to rely on ARGSUSED (which doesn't work for gcc with warnings).
5682 const char -> char const.
5684 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
5685 Don't use tabs inside commands; it messes up 'ps'.
5686 Problem reported by twlevo.
5688 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
5690 * tests/glr-regression.at (Uninitialized location when reporting
5691 ambiguity): New test case.
5692 * data/glr.c (yyresolveLocations): New function, which uses
5694 (yyresolveValue): Invoke yyresolveLocations before reporting an
5696 * doc/bison.texinfo (Default Action for Locations): Note
5697 YYLLOC_DEFAULT's usage for ambiguity locations.
5698 (GLR Semantic Actions): Cross-reference those notes.
5700 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
5702 * tests/glr-regression.at (Leaked semantic values when reporting
5703 ambiguity): Remove unnecessary union and type declarations.
5704 (Leaked lookahead after nondeterministic parse syntax error): New test
5706 * data/glr.c (yyparse): Check for zero stacks remaining before
5707 attempting to shift the lookahead so that you don't lose it.
5709 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
5711 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
5712 * tests/glr-regression.at (Leaked semantic values when reporting
5713 ambiguity): New test case.
5714 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
5715 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
5716 now unnecessary yystackp parameter.
5717 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
5718 destructors can be called.
5720 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
5721 in existing testcases.
5723 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
5725 Don't leak semantic values for parent RHS when a user action cuts the
5726 parser, and clean up related code a bit.
5727 * tests/glr-regression.at (Leaked merged semantic value if user action
5728 cuts parse): Rename to...
5729 (Leaked semantic values if user action cuts parse): ... this. Add check
5730 for leaked parent RHS values.
5731 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
5732 between an unresolved state (non-empty chain of semantic options) and
5733 an incomplete one (signaled by an empty chain).
5734 (yyresolveStates): Document the interface. Move all manipulation of a
5735 successfully or unsuccessfully resolved yyGLRState to...
5736 (yyresolveValue): ... here so that yyresolveValue always leaves a
5737 yyGLRState with consistent data and thus is easier to understand.
5738 Remove the yyvalp and yylocp parameters since they are always just
5739 taken from the yys parameter. When reporting a discarded merged value
5740 in debugging output, note that it is incompletely merged. Document the
5742 (yyresolveAction): If resolving any of the RHS states fails, destroy
5743 them all rather than leaking them. Thus, as long as user actions are
5744 written to clean up the RHS correctly, yyresolveAction always cleans up
5745 the RHS of a semantic option. Document the interface.
5747 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
5749 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
5750 led to a segmentation fault in GNU Pascal. Problem reported
5753 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
5755 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
5756 mid-rule action inside a nonterminal symbol in order to declare a
5757 destructor for its semantic value.
5759 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
5761 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
5762 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
5763 __cplusplus && ! defined _STDLIB_H && !
5764 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
5765 defined free))]: Include <stdlib.h> rather than rolling our own
5766 declarations of malloc and free, to avoid problems with
5767 incompatible declarations (using 'throw') C++'s stdlib.h. This
5768 should fix Debian bug 340012
5769 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
5770 reported by Guillaume Melquiond.
5772 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
5774 * NEWS: Clarify symbols versus types in unused-value warnings.
5776 * configure.ac (AC_INIT): Bump version number.
5778 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
5780 * NEWS: Version 2.1a.
5781 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
5782 since C99 requires this.
5784 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
5786 * m4/c-working.m4: New file.
5787 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
5789 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
5791 * Makefile.maint: Merge from coreutils.
5793 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
5795 More portability fixes for problems summarized by Nelson H. F. Beebe.
5797 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
5798 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
5799 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
5800 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
5801 messes up because C++ code is compiled in 32-bit mode but linked
5804 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
5806 More portability fixes for problems summarized by Nelson H. F. Beebe.
5808 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
5809 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
5811 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
5812 nodist_PROGRAMS, since we don't need to actually compile the
5813 example if we're just doing a plain 'make'. This avoids bothering
5814 the installer unnecessarily about problems due to weird C++
5817 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
5819 More portability fixes for problems summarized by Nelson H. F. Beebe.
5821 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
5822 than #include "...", and compile with -I'.'. The old method was
5823 not portable, according to Posix and the C standard, and it does
5824 not work with Sun C 5.7, where previous #line directives affect
5825 the working directory used in later #include "..." directives.
5827 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5829 Various DJGGP specific issues in /djgpp
5831 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
5833 More portability fixes for problems summarized by Nelson H. F. Beebe.
5835 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
5836 '#include <map>' works and that you can apply ++ to iterators.
5838 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
5840 Work around portability problems summarized by Nelson H. F. Beebe in
5841 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
5843 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
5844 that '#include <string>' works.
5846 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
5847 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
5848 "warning: sorry: semantics of inline function static data `const
5849 unsigned char translate_table[262]' are wrong (you'll wind up with
5852 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
5853 or, xor to not_, and_, or_, and xor_, respectively. This works
5854 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
5855 random system header somewhere that includes the equivalent of
5858 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
5859 -E" works; it apparently doesn't work with PathScale EKO Compiler
5862 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
5864 During deterministic GLR operation, user actions should be able to
5865 influence the parse by changing yychar. To make this easier to fix and
5866 to make glr.c easier to evolve in general, don't maintain yytoken in
5867 parallel with yychar; just compute yytoken when needed.
5868 * tests/glr-regression.at (Incorrect lookahead during deterministic
5869 GLR): Check that setting yychar in a user action has the intended
5871 * data/glr.c (yyGLRStack): Remove yytokenp member.
5872 (yyclearin): Don't set *yytokenp.
5873 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
5874 yychar rather than *yytokenp to determine the current lookahead.
5875 Compute yytoken locally when needed.
5876 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
5879 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
5880 after `--report' documentation.
5882 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
5884 * src/parse-gram.y (grammar_declaration): Location of printer
5885 symbol is @1, not list->location. Bug reported by twlevo.
5886 * tests/input.at (Incompatible Aliases): Adjust to above change.
5888 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
5890 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
5891 all the test at once. This makes the output easier to read in the
5894 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
5895 got from <http://bro-ids.org/download.html>. The bug is that
5896 when two actions appeared in succession, the second one was
5897 scanned before the first one was added to the grammar rule
5898 as a midrule action. Bison then output the incorrect warning
5899 "parse.y:905.17-906.36: warning: unused value: $3".
5900 * src/parse-gram.y (BRACED_CODE, action): These are no longer
5901 associated with a value.
5902 (rhs): Don't invoke grammar_current_rule_action_append.
5903 (action): Invoke it here instead.
5904 * src/reader.c (grammar_midrule_action): Now extern.
5905 (grammar_current_rule_action_append): Don't invoke
5906 grammar_midrule_action; that is now the scanner's job.
5907 * src/reader.h (last_string, last_braced_code_loc):
5908 (grammar_midrule_action): New decls.
5909 * src/scan-gram.l (last_string): Now extern, sigh.
5910 (last_braced_code_loc): New extern variable.
5911 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
5912 rule already has an action.
5913 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
5914 * tests/input.at (AT_CHECK_UNUSED_VALUES):
5915 Add some tests to check that the above changes fixed the bug.
5917 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
5919 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
5920 All used changed. Check whether the symbol has a destructor,
5921 not whether it is typed.
5922 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
5923 that the values are still reported as unused. All line numbers
5926 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
5928 Work around a bug in bro 0.8, which underparenthesizes its
5929 definition of YYLLOC_DEFAULT.
5930 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
5932 * data/lalr1.cc: Likewise.
5933 * data/yacc.cc: Likewise.
5935 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
5937 Work around a bug in Pike 7.0, and give the Pike folks a
5938 better way to override the usual int widths.
5939 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
5940 user can override the types.
5941 (short): #undef, to work around a bug in Pike 7.0.
5942 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
5943 (union yyalloc.yyss): Use yytype_int16 rather than short.
5945 (yysigned_char): Remove.
5946 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
5947 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
5948 * tests/regression.at (Web2c Actions): Adjust to above changes.
5950 * src/reader.c (check_and_convert_grammar): New function.
5951 (reader): Close the input file even if something went wrong during
5952 parsing. Minor file descriptor leak reported by twlevo.
5954 * src/assoc.c (assoc_to_string): Use a default: abort (); case
5955 to pacify gcc -Wswitch-default.
5956 * src/scan-gram.l (adjust_location): Use a default: break; case
5957 to pacify gcc -Wswitch-default.
5958 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
5959 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
5960 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
5961 Move these decls to scan-skel.l, since they don't need to be
5963 * src/scan-skel.l: Accept the above decls.
5964 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
5967 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
5969 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
5970 since we don't want to insist on a version number at the start
5971 of the changelog every time.
5972 * Makefile.maint: Sync from coreutils a bit better.
5973 (sc_trailing_blank): Renamed from sc_trailing_space.
5975 (sc_no_if_have_config_h, sc_require_config_h):
5976 (sc_prohibit_assert_without_use): New rules.
5977 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
5978 (sc_dd_max_sym_length): Fix leading spaces in rule.
5979 (sc_system_h_headers): Prefix with @.
5980 (sc_useless_cpp_parens, m4-check): Output line numbers.
5981 (changelog-check): Allow version only in head.
5982 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
5983 satisfy new Makefile.maint rule.
5984 * data/glr.c: Likewise.
5985 * data/glr.cc: Likewise.
5986 * data/lalr1.cc: Likewise.
5987 * data/yacc.c: Likewise.
5988 * lib/ebitsetv.c: Likewise.
5989 * lib/lbitset.c: Likewise.
5990 * lib/subpipe.c: Likewise.
5991 * lib/timevar.c: Likewise.
5992 * src/system.h: Likewise.
5993 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
5994 * djgpp/Makefile.maint: Add copyright notice.
5995 * djgpp/README.in: Likewise.
5996 * djgpp/config.bat: Likewise.
5997 * djgpp/config.site: Likewise.
5998 * djgpp/config_h.sed: Likewise.
5999 * djgpp/djunpack.bat: Likewise.
6000 * djgpp/config.sed: Fix copyright notice to match standard format.
6001 * djgpp/subpipe.h: Likewise.
6002 * lib/bitsetv-print.c: Likewise.
6003 * lib/bitsetv.c: Likewise.
6004 * lib/subpipe.h: Likewise.
6005 * lib/timevar.c: Likewise.
6006 * lib/timevar.h: Likewise.
6007 * djgpp/subpipe.c: Use standard recipe for config.h.
6008 * lib/abitset.c: Likewise.
6009 * lib/bitset.c: Likewise.
6010 * lib/bitset_stats.c: Likewise.
6011 * lib/bitsetv-print.c: Likewise.
6012 * lib/bitsetv.c: Likewise.
6013 * lib/ebitsetv.c: Likewise.
6014 * lib/get-errno.c: Likewise.
6015 * lib/lbitset.c: Likewise.
6016 * lib/subpipe.c: Likewise.
6017 * lib/timevar.c: Likewise.
6018 * lib/vbitset.c: Likewise.
6019 * tests/local.at: Likewise.
6020 * src/scan-gram.l: Don't include verify.h, since system.h does
6022 * .x-sc_require_config_h: New file.
6023 * .x-sc_unmarked_diagnostics: New file.
6025 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
6027 Be a bit more systematic about using 'abort'.
6028 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
6029 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
6030 Put 'default: abort ();' before some other case, to satisfy older
6032 * lib/bitset_stats.c (bitset_stats_init): Likewise.
6033 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
6034 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
6035 * src/conflicts.c (resolve_sr_conflict): Likewise.
6036 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
6037 (get_decision_str, get_orientation_str, get_node_alignment_str):
6038 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
6039 (get_linestyle_str, get_arrowstyle_str): Likewise.
6040 * src/conflicts.c (resolve_sr_conflict):
6041 Use a default case rather than one for the one remaining enum
6042 value, to catch invalid enum values as well.
6043 * src/lalr.c (set_goto_map, map_goto):
6044 Prefer "assert (FOO);" to "if (!FOO) abort ();".
6045 * src/nullable.c (nullable_compute, token_definitions_output):
6047 * src/reader.c (packgram, reader): Likewise.
6048 * src/state.c (transitions_to, state_new, state_reduction_find):
6050 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
6051 (symbol_pack): Likewise.
6052 * src/tables.c (conflict_row, pack_vector): Likewise.
6053 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
6054 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
6055 * src/system.h: Don't include <assert.h>.
6056 (assert): New macro.
6058 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
6059 (Destructor Decl, Parser Function, Pure Calling):
6060 Describe rules for braces inside C code more carefully.
6062 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
6064 Fix some porting glitches found by Nelson H. F. Beebe.
6065 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
6066 compilers that don't understand that abort () does not return.
6067 * src/state.c (transitions_to): Likewise.
6068 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6069 that '#include <cstdlib>' works.
6070 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
6071 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
6072 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
6073 for the benefit of some pre-C99 compilers.
6075 * bootstrap: Undo changes to gnulib files that autoreconf made.
6077 Minor fixups to get 'make maintainer-check' to work.
6078 * configure.ac: Don't use -Wnested-externs, as it's incompatible
6079 with the new verify.h implementation.
6080 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
6081 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
6082 * data/yacc.c (YYUSE): Likewise.
6083 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
6084 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
6085 * src/parse-gram.y (declaration): Don't pass a string constant
6086 to a function that expects char *, since GCC might complain
6087 about the constant value.
6088 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
6089 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
6090 before #defining them.
6091 * tests/glr-regression.at
6092 (Incorrectly initialized location for empty right-hand side in GLR):
6093 In yyerror, use the msg arg.
6094 (Corrupted semantic options if user action cuts parse):
6095 (Incorrect lookahead during deterministic GLR):
6096 (Incorrect lookahead during nondeterministic GLR):
6097 Don't name a local var 'index'; it shadows string.h's 'index'.
6099 2006-01-19 Akim Demaille <akim@epita.fr>
6101 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
6102 location, not just parts of it.
6104 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
6106 * NEWS: Document the fact that multiple %unions are now allowed.
6107 * doc/bison.texinfo (Union Decl): Likewise.
6108 * TODO: This feature is now implemented, so remove it from
6111 * Makefile.maint: Merge with coreutils Makefile.maint.
6112 (CVS_LIST): Use build-aux version if available.
6113 (VERSION_REGEXP): New macro.
6114 (syntax-check-rules): Add sc_no_if_have_config_h,
6115 sc_prohibit_assert_without_use, sc_require_config_h,
6116 sc_useless_cpp_parens.
6117 (sc_obsolete_symbols): Check for O_NDELAY.
6118 (sc_dd_max_sym_length): Track coreutils.
6119 (sc_unmarked_diagnostics): Look in all files, not just *.c.
6120 (sc_useless_cpp_parens): New rule.
6121 (news-date-check): Look for version or today's date.
6122 (changelog-check): Don't require version number near head.
6123 (copyright-check): Use current year instead of hardwiring 2005.
6124 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
6125 (announcement): Add --gpg-key-ID.
6127 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
6130 Avoid undefined behavior that addressed just before the start of an
6131 array. Problem reported by twlevo.
6132 * src/reader.c (packgram): Prepend a new sentinel before ritem.
6133 * src/lalr.c (build_relations): Rely on new sentinel.
6134 * src/gram.c (gram_free): Adjust to new sentinel.
6136 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
6138 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
6139 yylookaheadNeeds. All uses updated.
6140 (yysplitStack): Rename local yynewLookaheadStatuses to
6141 yynewLookaheadNeeds.
6142 * data/glr-regression.at (Incorrect lookahead during nondeterministic
6143 GLR): In comments, change `lookahead status' to `lookahead need'.
6145 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6147 * data/glr.c (yysplitStack): A little stylistic rewrite.
6149 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6151 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
6153 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
6155 * doc/bison.texinfo: Fix some typos.
6156 (GLR Semantic Actions): New subsection discussing special
6157 considerations because GLR semantic actions might be deferred.
6158 (Actions): Mention look-ahead usage of yylval.
6159 (Actions and Locations): Mention look-ahead usage of yylloc.
6160 (Special Features for Use in Actions): Add YYEOF entry and mention it
6161 in the yychar entry.
6162 In the yychar entry, remove mention of the local yychar case (pure
6163 parser) since this is irrelevant information when writing semantic
6164 actions and since it's already discussed in `Table of Symbols' where
6165 yychar is otherwise described as an external variable.
6166 In the yychar entry, don't call it the `current' look-ahead since it
6167 isn't when semantic actions are deferred.
6168 In the yychar and yyclearin entries, add note about deferred semantic
6170 Add yylloc and yylval entries discussing look-ahead usage.
6171 (Look-Ahead Tokens): When discussing yychar, don't call it the
6172 `current' look-ahead, and do mention yylval and yylloc.
6173 (Error Recovery): Cross-reference `Action Features' when mentioning
6175 (Table of Symbols): In the yychar entry, don't call it the `current'
6177 In the yylloc and yylval entries, mention look-ahead usage.
6179 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6181 * tests/glr-regression.at: Update copyright year to 2006.
6183 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6185 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
6186 use during nondeterministic operation to track which stacks have
6187 actually needed the current lookahead.
6188 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
6189 Allocate, deallocate, resize, and otherwise shuffle space for
6190 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
6191 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
6192 appropriately during nondeterministic operation.
6193 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
6194 members to store the current lookahead to be used by the deferred
6196 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
6197 from which the RHS is taken. Set the lookahead members of the new
6198 yySemanticOption according to the lookahead status for stack yyk.
6199 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
6200 yyaddDeferredAction.
6201 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
6202 members of yySemanticOption before invoking yyuserAction, and then set
6203 them back to their current values afterward.
6204 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
6205 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
6206 * tests/glr-regression.at: Remove `.' from the ends of recent test case
6207 titles for consistency.
6208 (Leaked merged semantic value if user action cuts parse): In order to
6209 suppress lint warnings, use arguments in merge function, and assign
6210 char value < 128 in main.
6211 (Incorrect lookahead during deterministic GLR): New test case.
6212 (Incorrect lookahead during nondeterministic GLR): New test case.
6214 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6216 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
6217 !yyvaluep as signal that no semantic value is available to print.
6218 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
6219 to print a semantic value.
6221 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6223 * tests/glr-regression.at: For consistency with my newer test cases,
6226 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
6228 * data/glr.c (yyresolveValue): When merging semantic options, if at
6229 least one user action succeeds but a later one cuts the parse, then
6230 destroy the semantic value before returning rather than leaking it.
6231 (yyresolveStates): If a user action cuts the parse and thus
6232 yyresolveValue fails, ignore the (unset) semantic value rather than
6233 corrupting the yyGLRState, and empty the semantic options list since
6234 the user actions should have called all necessary destructors.
6235 Simplify code with YYCHK.
6236 * tests/glr-regression.at (Corrupted semantic options if user action
6237 cuts parse): New test case.
6238 (Undesirable destructors if user action cuts parse): New test case.
6239 Before applying any of this patch, this test case never actually failed
6240 for me... but only because the corrupted semantic options usually
6242 (Leaked merged semantic value if user action cuts parse): New test
6245 2006-01-05 Akim Demaille <akim@epita.fr>
6247 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
6249 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
6251 * data/c.m4 (b4_c_modern): New macro, with a new provision for
6252 _MSC_VER. Problem reported by Cenzato Marco.
6253 (b4_c_function_def): Use it.
6254 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
6256 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
6257 than rolling our own.
6259 2006-01-04 Akim Demaille <akim@epita.fr>
6261 Also warn about non-used mid-rule values.
6262 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
6264 (symbol_list_new): Adjust.
6265 * src/reader.c (symbol_typed_p): New.
6266 (grammar_rule_check): Use it.
6267 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
6269 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
6271 * tests/actions.at (Exotic Dollars): Adjust.
6273 2006-01-04 Akim Demaille <akim@epita.fr>
6275 * src/reader.c (grammar_midrule_action): If $$ is set in a
6276 mid-rule, move the `used' bit to its lhs.
6277 * tests/input.at (Unused values): New.
6278 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
6280 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
6282 * doc/bison.texinfo (Bison Options): Say more accurately what
6284 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
6285 about declarations in the grammar when in Yacc mode, as POSIX does
6286 not require a diagnostic when the grammar uses extensions.
6288 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
6290 Warn about dubious constructions like "%token T T".
6292 * src/symtab.h (struct symbol.declared): New member.
6293 * src/symtab.c (symbol_new): Initialize it to false.
6294 (symbol_class_set): New arg DECLARING, specifying whether
6295 this is a declaration that we want to warn about, if there
6296 is more than one of them. All uses changed.
6298 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
6299 Allow multiple %union directives, whose contents concatenate.
6300 * src/parse-gram.y (grammar_declaration): Likewise.
6301 Use muscle_code_grow, so that we don't need stype_line any more.
6304 * src/muscle_tab.c (muscle_grow): Fix comment.
6306 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
6307 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
6308 Update copyright year to 2006.
6310 2006-01-03 Akim Demaille <akim@epita.fr>
6312 Have glr.cc pass (some of) the calc.at tests.
6313 * data/glr.cc (b4_parse_param_orig): New.
6314 (b4_parse_param): Improve its definition, and bound it more
6315 clearly in the skeleton.
6316 (b4_epilogue): Append, instead of prepending, in order to keep
6318 Simplify the generation of auxiliary functions: locations and
6319 purity are mandated.
6320 (b4_global_tokens_and_yystype): Honor it.
6321 * data/location.cc (c++.m4): Don't include it.
6322 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
6324 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
6326 Be sure to initialize the first position's filename.
6327 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
6329 (AT_CHECK_CALC_GLR_CC): New.
6330 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
6332 2006-01-02 Akim Demaille <akim@epita.fr>
6334 * src/output.c (output_skeleton): Don't hard wire the inclusion of
6336 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
6337 * data/glr.cc: Do not include stack.hh.
6339 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6341 * data/glr.c: Reformat whitespace with tabs.
6342 (b4_lpure_formals): Remove this unused m4 macro.
6343 * tests/cxx-type.at: Reformat whitespace with tabs.
6344 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
6345 since it's a member. Rename type to isNterm for clarity.
6347 2005-12-29 Akim <akim@sulaco.local>
6349 Let glr.cc catch up with symbol_value_print.
6350 * data/glr.cc (b4_yysymprint_generate): Replace by...
6351 (b4_yy_symbol_print_generate): this.
6352 (yy_symbol_print, yy_symbol_value_print): Declare them.
6354 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
6356 * src/location.h (boundary): Note that a line or column equal
6357 to INT_MAX indicates an overflow.
6358 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
6359 (rule_length_overflow, increment_rule_length, add_column_width):
6361 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
6362 (<SC_BRACED_CODE>"}"):
6363 Use increment_rule_length rather than incrementing it by hand.
6364 (adjust_location, handle_syncline): Diagnose overflow.
6365 (handle_action_dollar, handle_action_at):
6366 Fix bug with monstrosities like $-2147483648.
6367 Remove now-unnecessary checks.
6368 (scan_integer): Verify assumptions and remove now-unnecessary checks.
6369 (convert_ucn_to_byte): Verify assumptions.
6370 (handle_syncline): New arg LOC. All callers changed.
6371 Don't store through a value derived from char const * pointer.
6373 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
6376 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
6378 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
6379 Remove unnecessary forward static decls.
6381 2005-12-27 Akim Demaille <akim@epita.fr>
6383 * src/reader.c (grammar_current_rule_check): Also check that $$
6385 Take the rule to check as argument, hence rename as...
6386 (grammar_rule_check): this.
6387 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
6389 (grammar_rule_begin, grammar_rule_end): these, for consistency.
6390 (grammar_midrule_action, grammar_symbol_append): Now static.
6391 * tests/torture.at (input): Don't rely on the default action
6392 being always performed.
6393 * tests/calc.at: "Set" $$ even when the action is "cut" with
6395 * tests/actions.at (Exotic Dollars): Instead of using unused
6396 values, check that the warning is issued.
6398 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
6400 * NEWS: Improve wording for unused-value warnings.
6402 2005-12-22 Akim Demaille <akim@epita.fr>
6404 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
6405 (b4_yysymprint_generate): Rename as...
6406 (b4_yy_symbol_print_generate): this.
6407 Generate yy_symbol_print instead of yysymprint.
6408 Generate also yy_symbol_value_print, and use it.
6410 2005-12-22 Akim Demaille <akim@epita.fr>
6412 * NEWS: Warn about unused values.
6413 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
6415 (symbol_list_n_get, symbol_list_n_used_set): New.
6416 (symbol_list_n_type_name_get): Use symbol_list_n_get.
6417 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
6418 * src/reader.c (grammar_current_rule_check): Check that values are
6420 * src/symtab.c (symbol_print): Accept 0.
6421 * tests/existing.at: Remove the type information.
6423 Remove useless actions (beware of mid-rule actions: perl -000
6424 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
6425 * tests/actions.at (Exotic Dollars): Use unused values.
6426 * tests/calc.at: Likewise.
6427 * tests/glr-regression.at (No users destructors if stack 0 deleted):
6430 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
6433 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
6435 Undo 2005-12-01 tentative license wording change. The wording is
6436 still being reviewed by the lawyers, and we don't want to wait for
6437 them before publishing a test release. For now, revert to the
6439 * NEWS: Undo 2005-12-01 change.
6440 * data/glr.c: Revert to previous license wording.
6441 * data/glr.cc: Likewise.
6442 * data/lalr1.cc: Likewise.
6443 * data/location.cc: Likewise.
6444 * data/yacc.c: Likewise.
6446 * NEWS: Reword %destructor vs YYABORT etc.
6447 * data/glr.c: Use American spacing, for consistency.
6448 * data/glr.cc: Likewise.
6449 * data/lalr1.cc: Likewise.
6450 * data/yacc.c: Likewise.
6451 * data/yacc.c: Reformat comments slightly.
6452 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
6453 for consistency. Fix some spelling errors and reword recently-included
6455 * tests/cxx-type.at: Cast results of malloc, for C++.
6457 2005-12-21 Joel E. Denny <address@hidden>
6459 * tests/cxx-type.at: Construct a tree, count the parents of shared
6460 nodes, and free each node once and only once. Previously, the memory
6461 for semantic values was leaked instead.
6463 2005-12-21 Joel E. Denny <address@hidden>
6465 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
6466 (yylval, yylloc): If pure, #define to yystackp->yyval and
6467 yystackp->yyloc similar to yychar and yynerrs.
6468 (yyparse): If pure, remove local yylval and yylloc. Add local
6469 yystackp to accommodate pure definitions of yylval and yylloc.
6470 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
6471 yylvalp and yyllocp to &yylval and &yylloc.
6472 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
6473 namespace. Previously, nerrs and char were missing, but lval and lloc
6475 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
6476 yylvalp and yyllocp parameters since, if pure, these are now always
6477 accessible through yystackp. If not pure, they are still accessible
6479 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
6480 `if (YYID (N))' to pacify lint.
6482 2005-12-21 Akim Demaille <akim@epita.fr>
6484 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
6485 destroy the RHS symbols of a rule.
6486 * data/yacc.c (yylen): Initialize to 0.
6487 Keep its value to the number of items to possibly shift.
6488 In particular, a regular successful parse that ends on YYFINAL by
6489 a (internal) YYACCEPT must not have yylen != 0.
6490 (yyerrorlab, yyreturn): Pop the RHS.
6491 Reorder a bit to emphasize the `shifting' bits of code.
6492 (YYPOPSTACK): Now accept a number of items to pop.
6493 * data/lalr1.cc: Likewise.
6494 * data/glr.c: Formatting changes.
6495 Use goto instead of fall through.
6496 * doc/bison.texinfo (Destructor Decl): Complete.
6498 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6500 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
6501 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
6502 * djgpp/config.bat: Replace every occurence of the file name
6503 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
6504 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
6505 * djgpp/config.sed: Replace every occurence of the file name
6506 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
6507 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
6508 * djgpp/djunpack.bat: DJGPP specific file.
6509 * djgpp/fnchange.lst: DJGPP specific file.
6510 * djgpp/README.in: Add new information about how to unpack the bison
6511 source on MSDOS and other systems which have 8.3 file name restrictions
6512 using djunpack.bat and fnchange.lst.
6514 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
6516 * bootstrap (build_cvs_prefix): Remove; unused.
6517 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
6518 when getting gnulib.
6520 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
6522 * data/glr.c: Reorder typedef declarations for structs to match order
6523 of struct declarations.
6524 Rename yystack everywhere to yystackp except in yyparse where it's not
6526 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
6528 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
6529 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
6530 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
6533 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
6535 * tests/sets.at (Accept): Fix typos in regular expression used to
6536 sed out the final state number.
6538 Work around portability problem on Solaris 10: flex-generated
6539 files include <stdio.h> before <config.h>, which messes up
6540 because the latter defines __EXTENSIONS__. Address the problem
6541 by creating two new little files that include <config.h> first,
6542 then include the flex-generated files. Rewrite everyone else
6543 to include <config.h> first, as well.
6544 * lib/timevar.c: Always include "config.h".
6545 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
6546 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
6547 (EXTRA_bison_SOURCES): New macro.
6548 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
6549 * src/system.h: Don't include config.h.
6550 * src/LR0.c: Include <config.h> first.
6551 * src/assoc.c: Likewise.
6552 * src/closure.c: Likewise.
6553 * src/complain.c: Likewise.
6554 * src/conflicts.c: Likewise.
6555 * src/derives.c: Likewise.
6556 * src/files.c: Likewise.
6557 * src/getargs.c: Likewise.
6558 * src/gram.c: Likewise.
6559 * src/lalr.c: Likewise.
6560 * src/location.c: Likewise.
6561 * src/main.c: Likewise.
6562 * src/muscle_tab.c: Likewise.
6563 * src/nullable.c: Likewise.
6564 * src/output.c: Likewise.
6565 * src/parse-gram.y: Likewise.
6566 * src/print.c: Likewise.
6567 * src/print_graph.c: Likewise.
6568 * src/reader.c: Likewise.
6569 * src/reduce.c: Likewise.
6570 * src/relation.c: Likewise.
6571 * src/state.c: Likewise.
6572 * src/symlist.c: Likewise.
6573 * src/symtab.c: Likewise.
6574 * src/tables.c: Likewise.
6575 * src/uniqstr.c: Likewise.
6576 * src/vcg.c: Likewise.
6578 * src/parse-gram.y: Fix minor problems uncovered by lint.
6579 (current_lhs, current_lhs_location): Now static.
6580 (current_assoc): Remove unused variable.
6582 Cleanups so that Bison-generated parsers have less lint.
6583 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
6584 Prepend /*ARGSUSED*/, for lint's sake.
6585 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
6586 definition if 'lint' is defined.
6587 (YYID): New macro (or function, if lint).
6588 All uses of /*CONSTCOND*/0 replaced by YYID(0).
6589 * data/yacc.c: Likewise.
6590 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
6591 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
6592 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
6594 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
6595 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
6596 Use YYID(0) rather than 0, for lint.
6597 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
6598 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
6600 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
6602 * tests/glr-regression.at
6603 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6604 Close memory leak reported by twlevo.
6606 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
6608 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
6610 (yyparse): Iterate another stack in order to call user destructors.
6611 * tests/glr-regression.at (No users destructors if stack 0 deleted):
6613 (Duplicated user destructor for lookahead): This test now is expected
6616 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
6618 * NEWS: Document the following change.
6619 * data/yacc.c: Say "parser skeleton" rather than "file", since
6620 it's no longer just a file.
6621 * data/glr.c: Grant a special exception for C GLR parsers, that
6622 reads like the already-existing exception for C LALR(1) parsers.
6623 * data/glr.cc: Likewise.
6624 * data/lalr1.cc: Likewise.
6625 * data/location.cc: Likewise.
6626 * data/yacc.c: Reword the "written by" statement to clarify that
6627 it was the parser skeleton, not the entire output file.
6628 * data/glr.c: Written by Paul Hilfinger.
6629 * data/glr.cc: Written by Akim Demaille.
6630 * data/lalr1.cc: Likewise.
6632 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
6634 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
6635 Fix typos in previous change that broke 'make check'.
6636 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
6638 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
6639 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
6640 We can revert this once things settle down.
6642 * src/conflicts.c (conflicts_print): Don't print file name twice
6643 when %expect fails because there were no conflicts.
6644 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
6646 * tests/conflicts.at (%expect not enough, %expect too much):
6647 (%expect with reduce conflicts): Adjust to new behavior.
6649 2005-11-18 Akim Demaille <akim@epita.fr>
6651 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
6653 * NEWS: Document this.
6654 * doc/bison.texinfo (Expect Decl): Likewise.
6656 2005-11-16 Akim Demaille <akim@epita.fr>
6658 Generalize the display of semantic values and locations in traces.
6659 * data/glr.c (yy_reduce_print): Fix indices (again).
6660 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
6662 * data/lalr1.cc (yyreduce_print): Rename as...
6663 (yy_reduce_print): this.
6664 Display values and locations.
6665 * data/yacc.c (yy_reduce_print): Likewise.
6666 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
6667 (yysymprint): Move higher to be visible from yy_reduce_print).
6669 * tests/calc.at: Adjust the expected length of the traces.
6671 2005-11-14 Akim Demaille <akim@epita.fr>
6673 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
6674 from 1 to N, while values and location start at 0.
6675 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
6677 2005-11-14 Akim Demaille <akim@epita.fr>
6679 * data/glr.c (yy_reduce_print): Fix the $ number.
6681 2005-11-14 Akim Demaille <akim@epita.fr>
6683 "Use" parse parameters.
6684 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
6685 * data/glr.c, data/glr.cc: Use them.
6686 * data/glr.c (YYUSE): Have a C++ definition that supports
6689 2005-11-14 Akim Demaille <akim@epita.fr>
6691 * data/glr.c (yyexpandGLRStack): Declare only if defined.
6693 2005-11-14 Akim Demaille <akim@epita.fr>
6696 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
6698 2005-11-12 Akim Demaille <akim@epita.fr>
6700 Let position and location be PODs.
6701 * data/location.cc (position::initialize, location::initialize): New.
6702 (position::position, location::location): Define only if
6703 b4_location_constructors is defined.
6704 * data/lalr1.cc (b4_location_constructors): Define it for backward
6706 * doc/bison.texinfo (Initial Action Decl): Use initialize.
6708 2005-11-12 Akim Demaille <akim@epita.fr>
6710 * data/lalr1.cc: Move the body of the ctor and dtor into the
6711 parser file (instead of the header).
6712 Wrap the implementations in a "namespace yy".
6714 2005-11-12 Akim Demaille <akim@epita.fr>
6716 Have glr.c include its header file when created.
6717 * data/glr.c (b4_shared_declarations): New.
6718 Output them verbatim in the parser if !%defines, otherwise
6719 output then in the header file, and include it instead.
6721 2005-11-11 Akim Demaille <akim@epita.fr>
6723 * data/glr.c: Comment changes.
6725 2005-11-11 Akim Demaille <akim@epita.fr>
6727 When yydebug, report semantic and location values for reductions.
6728 * data/glr.c (yy_reduce_print): Report the semantic values and the
6730 (YY_REDUCE_PRINT): Adjust.
6731 (yyglrReduce): Use them.
6732 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
6733 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
6734 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
6737 2005-11-10 Akim Demaille <akim@epita.fr>
6739 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
6740 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
6741 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
6743 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
6745 * m4/cxx.m4, examples/Makefile.am: Don't build
6746 examples/calc++ if no C++ compiler is available. (trivial change)
6748 2005-11-09 Akim Demaille <akim@epita.fr>
6750 * src/scan-skel.l: Use a couple of asserts.
6752 2005-11-03 Akim Demaille <akim@epita.fr>
6754 In some (weird) cases, the final state number is incorrect.
6755 Reported by Alexandre Duret-Lutz.
6756 * src/LR0.c (state_list_append): Remove the computation of
6758 (save_reductions): Do it here.
6759 (get_state): Alpha conversion.
6760 (generate_states): Use a for loop.
6761 * src/gram.h (item_number_is_rule_number)
6762 (item_number_is_symbol_number): New.
6763 * src/state.c: Use assert.
6764 * src/system.h: Include assert.h.
6765 * tests/sets.at (Accept): New.
6767 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6769 * data/glr.c (yyfill): Adjust comment.
6770 (yyresolveAction): Initialize default location properly
6771 for empty right-hand sides.
6772 (yydoAction): Ditto.
6773 Add comment explaining apparently dead code.
6774 * tests/glr-regression.at
6775 (Incorrectly initialized location for empty right-hand side in GLR):
6778 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
6780 * bootstrap (cleanup_gnulib): New function. Use it to clean up
6781 gnulib when interrupted. This fixes some race conditions and
6782 works around some portability problems (one noted by Paul
6785 2005-10-22 Akim <akim@epita.fr>
6787 * Makefile.cfg: Adjust to config -> build-aux.
6790 2005-10-21 Akim Demaille <akim@epita.fr>
6792 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
6794 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
6795 * data/yacc.c (b4_Pure_if): Rename as...
6796 (b4_yacc_pure_if): this.
6797 (YY_SYMBOL_PRINT, yyparse): Adjust.
6798 * doc/bison.texinfo: Formatting changes.
6800 2005-10-21 Akim Demaille <akim@epita.fr>
6802 Finish the transition config -> build-aux.
6803 * configure.ac, Makefile.am: Use build-aux.
6804 * config/prev-version, config/announce-gen, config/Makefile.am:
6806 * build-aux/prev-version, build-aux/announce-gen,
6807 * build-aux/Makefile.am: here.
6809 2005-10-14 Akim Demaille <akim@epita.fr>
6811 * examples/calc++/test: Use set -x only when VERBOSE.
6813 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
6815 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
6816 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
6818 2005-10-13 Akim Demaille <akim@epita.fr>
6820 * src/scan-skel.l: Output the base name parts of the parser and
6822 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
6824 Use this to exercise C++ outputs in subdirs.
6825 Reported by Oleg Smolsky.
6827 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
6829 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
6830 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
6831 Problem reported by John P. Hartmann.
6832 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
6835 2005-10-12 Akim Demaille <akim@epita.fr>
6837 * src/parse-gram.y (version_check): Exit 63 to please missing
6838 (stands for "version mismatch).
6839 * tests/input.at, doc/bison.texinfo: Adjust.
6841 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
6843 Work around portability problems with Visual Age C compiler
6844 (xlc and xlC_r) reported by John P. Hartmann.
6845 * data/location.cc (initial_column, initial_line): Remove.
6846 All uses replaced by 0 and 1.
6847 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
6848 that xlc complains about.
6849 * src/scan-skel.l (skel_wrap): Likewise.
6850 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
6852 * data/yacc.c (YYMODERN_C): New macro, which also looks at
6853 __STDC_VERSION__. Use it everywhere instead of looking at
6854 __STDC__ and __cplusplus.
6856 2005-10-10 Akim Demaille <akim@epita.fr>
6858 * examples/calc++/test: Be quiet unless VERBOSE.
6860 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
6862 * data/c.m4 (yydestruct, yysymprint):
6863 Use YYUSE instead of casting to void.
6864 * data/glr.c (YYUSE): New macro.
6865 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
6866 Use it instead of rolling our own.
6867 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
6869 Use /*CONSTCOND*/ to suppress lint warnings.
6870 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
6871 (YY_STACK_PRINT): Use 'false' not '0'.
6873 (yysymprint_, yydestruct_): Use it instead of rolling our own.
6874 * data/yacc.c (YYUSE): New macro.
6875 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
6876 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
6877 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
6880 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
6881 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
6883 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
6885 Undo the parts of the unlocked-I/O change that substituted
6886 putc or puts for printf. This might hurt performance a bit,
6887 but some people prefer the printf style.
6888 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
6889 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
6890 All uses replaced by YYFPRINTF and YYDPRINTF.
6891 * data/yacc.c: Likewise.
6892 * lib/bitset.c (bitset_print): Likewise.
6893 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
6895 * lib/lbitset.c (debug_lbitset): Likewise.
6896 * src/closure.c (print_firsts, print_fderives): Likewise.
6897 * src/gram.c (grammar_dump): Likewise.
6898 * src/lalr.c (look_ahead_tokens_print): Likewise.
6899 * src/output.c (escaped_output): Likewise.
6900 (user_actions_output): Break apart two printfs.
6901 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
6902 * src/reduce.c (reduce_print): Likewise.
6903 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
6904 * src/system.h: Include unlocked-io.h rathe than stdio.h.
6906 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
6907 Use assignments rather than casts-to-void to suppress
6908 unused-variable warnings. This pacifies 'lint'.
6909 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
6910 unused-variable warnings.
6912 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6914 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
6916 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
6918 Use unlocked I/O for a minor performance improvement on hosts like
6919 GNU/Linux and Solaris that support unlocked I/O. The basic idea
6920 is to use the gnlib unlocked-io module, and to prefer putc and
6921 puts to printf when either will work (since the latter doesn't
6922 come in an unlocked flavor).
6923 * bootstrap (gnulib_modules): Add unlocked-io.
6924 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
6925 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
6926 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
6927 and similarly for puts and putc and printf.
6928 * data/yacc.c: Likewise.
6929 * lib/bitset.c (bitset_print): Likewise.
6930 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
6931 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
6933 * lib/lbitset.c (debug_lbitset): Likewise.
6934 * src/closure.c (print_firsts, print_fderives): Likewise.
6935 * src/gram.c (grammar_dump): Likewise.
6936 * src/lalr.c (look_ahead_tokens_print): Likewise.
6937 * src/output.c (escaped_output): Likewise.
6938 (user_actions_output): Coalesce two printfs.
6939 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
6940 * src/reduce.c (reduce_print): Likewise.
6941 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
6942 * src/system.h: Include unlocked-io.h rather than stdio.h.
6944 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
6945 this confuses xgettext.
6947 2005-10-02 Akim Demaille <akim@epita.fr>
6949 * bootstrap (gnulib_modules): Add strverscmp.
6950 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
6951 * m4/.cvsignore: Add strverscmp.m4.
6952 * src/parse-gram.y (%require): New token, new rule.
6953 (version_check): New.
6954 * src/scan-gram.l (%require): Adjust.
6955 * tests/input.at (AT_REQUIRE): New.
6957 * doc/bison.texinfo (Require Decl): New.
6958 (Calc++ Parser): Use %require.
6960 2005-10-02 Akim Demaille <akim@epita.fr>
6962 * data/location.cc: New.
6964 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
6965 Akim Demaille <akim@epita.fr>
6967 Make sure -odir/foo.cc creates dir/location.hh etc.
6968 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
6969 (spec_file_prefix, spec_verbose_file, spec_graph_file)
6970 (spec_defines_file): Now const.
6972 (short_base_name): Remove.
6973 * src/files.c: Adjust.
6974 (dirname.h): Include.
6975 (base_name): Don't prototype it.
6976 (finput): Remove, duplicates gram_in.
6977 (full_base_name, short_base_name): Replace by...
6978 (all_but_ext, all_but_tab_ext): these.
6979 (compute_base_names): Rename as...
6980 (compute_file_name_parts): this.
6981 Update to compute the new variables, including dir_prefix.
6982 Adjust dependencies.
6983 * src/output.c (prepare): Output them.
6984 * src/reader.c: Adjust to use gram_in, not finput.
6985 * src/scan-skel.l (@dir_prefix@): New.
6987 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6989 * lib/subpipe.c: New function end_of_output_subpipe() added
6990 to allow support for non-posix systems. This is a no-op function
6993 * lib/subpipe.h: New function end_of_output_subpipe() added
6994 to allow support for non-posix systems. This is a no-op function
6997 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
6998 handle the lack of pipe/fork functionality on non-posix systems.
7000 * djgpp/Makefile.maint: DJGPP specific file.
7002 * djgpp/README.in: DJGPP specific file.
7004 * djgpp/config.bat: DJGPP specific configuration file.
7006 * djgpp/config.sed: DJGPP specific configuration file.
7008 * djgpp/config.site: DJGPP specific configuration file.
7010 * djgpp/config_h.sed: DJGPP specific configuration file.
7012 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
7014 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
7016 2005-10-02 Akim Demaille <akim@epita.fr>
7018 * data/location.cc: New, extract from...
7019 * data/lalr1.cc: here.
7020 (location.hh): Include it after the user prologue, in case the
7021 filename type is defined by the user.
7022 Forward declation location and position before the pre-prologue.
7023 (yyresult_): Rename as...
7024 (yyresult): this, it's a local variable, not an attribute.
7025 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
7027 2005-10-01 Akim Demaille <akim@epita.fr>
7029 * examples/extexi: Restore the #line generation.
7031 2005-09-30 Akim Demaille <akim@epita.fr>,
7032 Alexandre Duret-Lutz <adl@gnu.org>
7034 Move the token type and YYSTYPE in the parser class.
7035 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
7036 (parser::token): New, from the moved free definition of tokens.
7037 (parser::semantic_value): Now a full definition instead of an
7038 indirection to YYSTYPE.
7039 (b4_post_prologue): No longer included in the header file, but
7040 in the implementation file.
7041 * doc/bison.texi (C+ Language Interface): Update.
7042 * src/parse-gram.y: Support unary %define.
7043 * tests/actions.at: Define global_tokens_and_yystype for backward
7044 compatibility until we update the tests.
7045 * tests/calc.at: Idem.
7046 (first_line, first_column, last_line, last_column): Define for lalr1.cc
7047 to simplify the code.
7049 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
7051 Port to SunOS 4.1.4, which lacks strtoul and strerror.
7052 Ah, the good old days! Problem reported by Peter Klein.
7053 * bootstrap (gnulib_modules): Add strerror, strtoul.
7054 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
7055 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
7057 2005-09-29 Akim Demaille <akim@epita.fr>
7059 * data/c.m4 (b4_error_verbose_if): New.
7060 * data/lalr1.cc: Use it.
7061 (YYERROR_VERBOSE_IF): Remove.
7062 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
7063 parser members, replaced by...
7064 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
7066 (yysyntax_error_): Takes the state number as argument.
7067 (yyreduce_print_): Use the argument yyrule, not the former
7070 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
7072 * bootstrap (gnulib_modules): Add verify.
7073 * lib/.cvsignore: Add verify.h.
7074 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
7075 * src/system.h (verify): Remove.
7076 Include verify.h instead.
7077 * src/tables.c (tables_generate): Use new API for 'verify'.
7079 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
7081 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
7082 local variables whose names begin with 'yy'.
7083 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
7084 Trivial changes from Joel E. Denny.
7086 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
7088 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
7089 don't use alloca any more.
7091 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
7092 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
7093 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
7094 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
7095 to match yacc.c, to test more hosts.
7097 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
7099 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
7100 doesn't affect behavior.
7101 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
7103 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
7104 This works a bit better with glibc, if user code has already included
7106 * doc/bison.texinfo (Bison Parser): Document that users can't
7107 arbitrarily use malloc and free for other purposes. Document
7108 that <alloca.h> and <malloc.h> might be included.
7109 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
7110 user must declare alloca.
7112 * HACKING (release): Forwarn the Translation Project about
7115 2005-09-20 Akim Demaille <akim@epita.fr>
7117 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
7119 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
7121 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
7122 (YYSTACK_ALLOC_MAXIMUM): Use it.
7123 (yysyntax_error): New function.
7124 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
7125 multiple syntax errors are reported, and alloca is being used.
7126 Instead, reallocate buffers twice as big each time, so that
7127 we waste at most half the allocated memory. Start with a small
7128 (128-byte) buffer that will suffice in most cases anyway.
7129 Use yysyntax_error to do most of the work.
7131 * doc/bison.texinfo (Error Reporting, Table of Symbols):
7132 yynerrs is the number of errors reported, not the number of
7135 * tests/glr-regression.at (Duplicated user destructor for lookahead):
7136 Mark it as expected to fail.
7137 Cast result of malloc; problem reported by twlevo@xs4all.nl.
7138 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
7139 Don't start user-code symbols with "yy", to avoid name space problems.
7141 2005-09-19 Akim Demaille <akim@epita.fr>
7143 Remove the traits, failed experiment.
7144 It never proved useful, and anyway because of the current
7145 definition, it was not possible to have several specialization of
7146 this traits, making it useless.
7147 * data/lalr1.cc (yy:traits): Remove.
7148 Inline its definitions in the parser class.
7150 2005-09-19 Akim Demaille <akim@epita.fr>
7152 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
7153 least Mac OSX with a /usr/local install of gettext.
7155 2005-09-19 Akim Demaille <akim@epita.fr>
7157 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
7158 and yytoken for similarity with the other skeletons.
7160 2005-09-19 Akim Demaille <akim@epita.fr>
7162 * NEWS, configure.ac: update version number to 2.1a.
7164 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
7166 * NEWS: Version 2.1.
7168 * NEWS: Remove notice of yytname change, since it was never in an
7170 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
7172 * src/output.c (prepare): Likewise.
7173 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
7174 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
7175 is not defined. This is an awful hack, but it's enough for now.
7176 All callers changed.
7177 * tests/glr-regression-at (make_value): Args are const pointers now,
7178 to avoid GCC warning.
7179 (Duplicated user destructor for lookahead): New test. Currently
7180 skipped. It fails on my host but I'm not sure it'll always fail.
7182 2005-09-16 Akim Demaille <akim@epita.fr>
7184 * src/symtab.h (struct symbol): Declare the printer and destructor
7185 as const, to avoid accidental calls to free.
7186 (symbol_destructor_set, symbol_printer_set): Adjust.
7187 * src/symtab.c: Adjust.
7189 2005-09-16 Akim Demaille <akim@epita.fr>
7191 * data/c.m4 (b4_token_enums): New.
7192 (b4_token_defines): Rename as...
7193 (b4_token_enums_defines): this.
7194 (b4_token_defines): New, output only the #defines.
7195 * data/yacc.c, data/glr.c: Adjust.
7196 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
7197 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
7200 2005-09-16 Akim Demaille <akim@epita.fr>
7202 * data/lalr1.cc (yylex_): Remove, inline its code.
7203 (yyreport_syntax_error_): Remove, replaced by...
7204 (yysyntax_error_): this which returns a string and leaves to the
7205 caller the call to the users' error function.
7206 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
7207 Move from members of the parser object...
7208 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
7209 to local variables of the parse function.
7211 2005-09-16 Akim Demaille <akim@epita.fr>
7213 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
7214 since it's in Bison's name space.
7216 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
7218 * data/glr.c (yyresolveValue): Add default case to pacify
7219 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
7221 * NEWS: Document when yyparse started to return 2.
7222 * doc/bison.texinfo (Parser Function): Document when yyparse
7225 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
7226 (b4_filename_type): Renamed back from b4_file_name_type. All uses
7228 (class position): file_name -> filename (reverting). All uses changed.
7230 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
7232 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
7233 do anything if $@ exists. This reverts part of the 2005-07-07
7236 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
7238 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
7239 contains obsolete information and isn't worth distributing as a
7240 separate file anyway.
7241 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
7242 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
7243 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
7244 (yyparse): Abort if user code uses longjmp to throw an unexpected
7247 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
7249 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
7250 Suggested by twlevo@xs4all.nl.
7252 * data/glr.c (YYCHK1): Do not assume YYE is in range.
7253 This avoids a diagnostic from gcc -Wswitch-enum.
7254 Problem reported by twlevo@xs4all.nl.
7256 * doc/bison.texinfo: Don't use "filename", as per GNU coding
7257 standards. Use "file name" or "file" or "name", depending on
7259 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
7260 not to hack/foo.tab.c.
7261 (Calc++ Top Level): 2nd arg of main is not const.
7262 * data/glr.c: b4_filename -> b4_file_name.
7263 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
7265 (class position): filename -> file_name. All uses changed.
7266 * data/yacc.c: b4_filename -> b4_file_name.
7267 * lib/bitset.h: filename -> file_name in local vars.
7268 * lib/bitset_stats.c: Likewise.
7269 * src/files.c: Likewise.
7270 * src/scan-skel.l ("@output ".*\n): Likewise.
7271 * src/files.c (file_name_split): Renamed from filename_split.
7272 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
7274 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
7276 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
7277 to accommodate latest gnulib.
7279 * tests/glr-regression.at (Duplicate representation of merged trees):
7280 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
7282 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
7285 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
7287 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
7288 All uses changed. Invoke user destructor after an error during a
7289 split parse (trivial change from Joel E. Denny).
7291 * tests/glr-regression.at
7292 (User destructor after an error during a split parse): New test case.
7293 Problem reported by Joel E. Denny in:
7294 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
7296 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
7298 * README-cvs: Give URLs for recommended tools.
7299 Mention Gzip version problem, and bootstrapping issues.
7300 Remove troubleshooting section, as it's somewhat obsolete.
7302 * bootstrap (no_cache): New var, to accommodate different wget
7303 variants. Use it instead of '-C off'. Problem reported by
7306 * data/glr.c (yydestroyStackItem): New function.
7307 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
7308 debugging information. Problem reported by Joel E. Denny.
7310 2005-08-25 Akim Demaille <akim@epita.fr>
7312 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
7314 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
7316 * data/glr.c (yyrecoverSyntaxError, yyreturn):
7317 Don't invoke destructor on unresolved entries.
7318 * tests/glr-regression.at
7319 (User destructor for unresolved GLR semantic value): New test case.
7320 Problem reported by Joel E. Denny in:
7321 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
7323 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
7325 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
7327 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
7328 lib-prefix.m4, po.m4.
7330 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
7331 in yydestruct diagnostic, since it might not be an error.
7332 Problem reported by Joel Denny near end of
7333 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
7334 * data/lalr1.cc (yyerturn): Likewise.
7335 * data/yacc.c (yyreturn): Likewise.
7336 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
7338 * src/files.c: Remove obsolete FIXME comment.
7340 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
7341 with the other templates, and to fix bogus run-on messages such
7342 as the one reported at the end of
7343 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
7344 All callers changed to avoid the newline.
7345 (yyprocessOneStack): Output two lines rather than one, to accommodate
7346 the above change. This changes the debug output format slightly.
7348 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
7349 reported by Joel E. Denny in
7350 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
7352 * tests/glr-regression.at (Duplicate representation of merged trees):
7353 New test, from Joel E. Denny in:
7354 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
7355 * THANKS: Add Joel E. Denny.
7357 * configure.ac (AC_INIT): Bump to 2.0c.
7359 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
7361 * NEWS: Version 2.0b.
7363 * Makefile.am (SUBDIRS): Put examples before tests, so that
7364 "make check" doesn't finish with "All 1 tests passed".
7366 * tests/regression.at (Token definitions): Don't rely on
7367 AT_PARSER_CHECK for data that contains backslashes. It currently
7368 uses 'echo', and 'echo' isn't portable if its argument contains
7369 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
7370 that the byte '\0xff' is not printable in the C locale; it is,
7371 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
7372 not printable, so use '\0x81' to test.
7374 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
7375 version of GCC, since the macro is used with non-GCC compilers.
7377 Fix core dump reported by Pablo De Napoli in
7378 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
7379 * tests/regression.at (Invalid inputs with {}): New test.
7380 * src/parse-gram.y (token_name): Translate type before using
7383 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
7384 the user's name space. All uses changed to __attribute__
7386 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
7387 Add __attribute__ ((__noreturn__)).
7389 * etc/clcommit: Remove. We weren't using it, and it failed
7390 "make maintainer-distcheck".
7391 * Makefile.maint: Merge from coreutils.
7392 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
7393 (syntax-check-rules): Change list of rules as described below.
7394 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
7395 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
7396 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
7397 (sc_trailing_space): New rules.
7398 (sc_xalloc_h_in_src): Remove.
7399 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
7400 (sc_space_tab, sc_error_exit_success, sc_changelog):
7401 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
7402 (makefile-check, po-check, author_mark_check):
7403 (makefile_path_separator_check, copyright-check):
7404 Use grep -n, to make it easier to find violations.
7405 Use CVS_LIST and CVS_LIST_EXCEPT.
7406 (header_regexp, h_re): Remove.
7408 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
7409 (my-distcheck): Use more-modern GCC flags.
7410 (signatures, %.asc): Remove.
7411 (rel-files, announcement): Remove signatures.
7412 Restore old updating code, even though we don't use it, so
7413 that we're the same as coreutils.
7414 (alpha, beta, major): Depend on news-date-check.
7415 Make the upload commands.
7417 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
7418 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
7419 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
7420 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
7421 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
7422 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
7423 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
7424 * tests/sets.at: Likewise.
7426 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
7427 we comment out the Autoconf version number.
7428 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
7429 it's error-prone and "make maintainer-distcheck" rejects it.
7431 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
7432 Indent calls to "error" to pacify "make maintainer-distcheck",
7433 when the calls are not intended to be translated.
7434 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
7436 * src/Makefile.am (DEFS): Use +=, to pacify
7437 "make maintainer-distcheck".
7438 (bison_SOURCES): Add scan-skel.h.
7439 (sc_tight_scope): New rule, from coreutils.
7441 * src/files.c (src_extension, header_extension):
7442 Now static, not extern.
7443 * src/getargs.c (short_options): Likewise.
7444 * src/muscle_tab.c (muscle_table): Likewise.
7445 * src/parse-gram.y (current_class, current_type, current_prec):
7447 * src/reader.c (grammar_end, previous_rule_end): Likewise.
7448 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
7449 * src/main.c (main): Cast bindtextdomain and textdomain calls to
7450 void, to avoid warning when NLS is disabled.
7451 * src/output.c: Include scan-skel.h.
7452 (scan_skel): Remove decl, since scan-skel.h does this.
7454 Indent calls to "error" to pacify "make maintainer-distcheck".
7455 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
7456 * src/reader.h (gram_end, gram_lineno): New decls to pacify
7457 "make maintainer-distcheck".
7458 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
7459 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
7460 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
7461 (skel_lex_destroy, scan_skel): Move these decls to...
7462 * src/scan-skel.h: New file.
7463 * src/uniqstr.c (uniqstr_assert):
7464 Indent calls to "error" to pacify "make maintainer-distcheck".
7466 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
7469 * tests/torture.at: Revamp to avoid misuse of atoi that
7470 "make maintainer-distcheck" complained about.
7472 * examples/extexi (message): Don't print a message more than once,
7473 and omit line-number decoration that makes Emacs compile think
7474 that informative messages are worth worrying about.
7476 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
7478 * configure.ac: Update version number.
7480 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
7482 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
7483 autogenerated by the maintainer.
7484 * examples/calc++/.cvsignore: Add *.yy.
7486 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
7487 * lib/bitset_stats.c (bitset_stats_init): Likewise.
7488 * lib/bitsetv.c (bitsetv_alloc): Likewise.
7490 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
7492 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
7493 from maintainer-distcheck about casting the argument of 'free'.
7495 * NEWS: Mention recent yytname changes.
7496 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
7498 * bootstrap: For translations that have not yet been upgraded to
7499 the new runtime-po domain, prime the pump by extracting the
7500 relevant strings from the obsolete translations. This code can be
7501 removed once the bison-runtime domain has been translated by each
7504 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
7505 now that token names are already quoted.
7507 Fix problem reported by Anthony Heading.
7508 * data/glr.c (YYTOKEN_TABLE): New macro.
7509 (yytname): Define if YYTOKEN_TABLE.
7510 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
7511 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
7512 (YYERROR_VERBOSE): Define the same way the other skeletons do.
7513 * src/output.c (prepare_symbols): Output token_table_flag.
7515 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
7517 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
7518 again if the first call fails.
7520 * data/glr.c (yytnamerr): New function.
7521 (yyreportSyntaxError): Use it to dequote most string literals.
7522 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
7523 with other skeletons. All uses changed.
7524 (yytnameerr_): New function.
7525 (yyreport_syntax_error): Use it to dequote most string literals.
7526 * data/yacc.c (yytnamerr): New function.
7527 (yyerrlab): Use it to decode most string literals.
7528 * doc/bison.texinfo (Decl Summary, Calling Convention):
7529 Clarify quoting convention of yytname.
7530 * src/output.c (prepare_symbols): Quote all names. This undoes
7531 the 2005-04-17 change, which is now accomplished (mostly) via
7532 changes in the parsers as described above.
7533 * tests/regression.at (Token definitions, Web2c Actions):
7534 Undo most 2005-04-17 change here, too.
7536 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
7538 Fix more problems reported by twlevo@xs4all.nl.
7539 * tests/cxx-type.at: Don't pipe output of ./types through sed to
7540 remove trailing spaces. This loses the exit status of ./types,
7541 and isn't needed since ./types shouldn't be emitting trailing
7543 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
7544 as the stack isn't valid in that case.
7546 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
7547 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
7548 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
7549 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
7551 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
7552 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
7553 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
7556 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
7557 overly-picky compilers that reject 'char *foo = "bar";'.
7559 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
7560 to FILE * parameter, not to stderr. This fixes a typo introduced
7561 in the 2005-07-12 change.
7563 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
7564 warnings from GCC 4.
7566 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
7567 (yyglrShiftDefer, yysplitStack):
7568 Remove unused parameters b4_pure_formals. All uses changed.
7569 (yyglrShift): Remove unused parameters b4_user_formals.
7571 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
7573 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
7575 Destructor cleanups and regularization among the three skeletons.
7576 * NEWS: Document the behavior changes.
7577 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
7578 stack before failing, as the cleanup code will do it for us now.
7579 * data/lalr1.cc (yyerrlab): Likewise.
7580 * data/glr.c (yyparse): Pop everything off the stack before
7581 freeing it, so that destructors get called properly.
7582 * data/lalr1.cc (yyreturn): Likewise.
7583 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
7584 This is more consistent.
7585 * doc/bison.texinfo (Destructor Decl): Mention more reasons
7586 why destructors might be called. 1.875 -> 2.1.
7587 (Destructor Decl, Decl Summary, Table of Symbols):
7588 Some English-language cleanups for %destructor.
7589 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7590 Add output line for destructor of start symbol.
7591 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
7592 because of that same extra output line.
7594 * NEWS: Document minor wording changes in diagnostics of
7595 Bison-generated parsers.
7596 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
7597 Remove unused formals. All uses changed.
7598 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
7599 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
7600 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
7601 Rename yyoverflowab to yyexhaustedlab.
7602 When memory exhaustion occurs during syntax-error reporting,
7603 report it separately rather than in a single diagnostic; this
7605 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
7606 (Memory Exhausted): Renamed from Parser Stack Overflow.
7607 Revamp wording slightly to prefer "memory exhaustion".
7608 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
7610 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
7612 Add i18n support to the GLR skeleton. Partially fix the C++
7613 skeleton; a C++ expert needs to finish this. Remove debugging
7614 msgids; there's little point to having them translated, since they
7615 can be understood only by someone who can read the
7616 (English-language) source code.
7618 Generate runtime-po/bison-runtime.pot automatically, so that we
7619 don't have to worry about garbage getting in that file. We'll
7620 make sure after the next official release that old msgids don't
7622 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
7624 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
7626 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
7627 Fix typos in explanations of the runtime file.
7628 * bootstrap: Change gettext keyword from YYI18N to YY_.
7629 Use standard Makefile.in.in in runtime-po, since we'll arrange
7630 for backward-compatible bison-runtime.po files in a different way.
7631 * data/glr.c (YY_): New macro, from yacc.c.
7632 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
7633 Translate messages intended for users.
7634 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
7635 the wording in the other skeletons. We don't know that the memory
7637 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
7638 Use same method that yacc.c uses.
7639 Don't translate debugging messages.
7640 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
7641 it doesn't work (yet), and requires C++ expertise to fix.
7642 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
7643 Move defn to a more logical place, to be consistent with other
7645 Don't translate debugging messages.
7646 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
7647 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
7648 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
7649 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
7651 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
7652 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
7654 * tests/glr-regression.at (Badly Collapsed GLR States):
7656 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
7657 yylex should return 0 at EOF rather than aborting.
7659 Improve tests for stack overflow in GLR parser.
7660 Problem reported by twlevo@xs4all.nl.
7661 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
7663 (yyStackOverflow): Just longjmp, but with value 2 so that caller
7664 can handle the problem.
7665 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
7666 (yyparse): New local variable yyresult to record the result.
7667 Use result of setjmp to set it, rather than storing itinto
7669 (yyDone): Remove label.
7670 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
7671 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
7672 if YYABORT is used).
7673 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
7674 yyparse status; put status > 1 into diagnostic.
7675 Check that status==2 works.
7676 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
7677 Use exit status 3 for failure to open (which shouldn't happen).
7679 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
7681 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
7682 1 on syntax error; just let yyparse do its thing.
7683 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
7684 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
7685 (Exploding the Stack Size with Alloca):
7686 (Exploding the Stack Size with Malloc):
7687 Expect exit status 2, not 1, since the parser is supposed to blow
7688 its stack. Problem reported by twlevo@xs4all.nl.
7690 * data/glr.c (yyparse): Don't assume that the initial calls
7691 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
7692 Print a stack-overflow message and fail instead.
7693 Initialize the line-number information before creating the stack,
7694 so that the stack-overflow message can report line zero safely.
7696 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
7698 Fix problems reported by twlevo@xs4all.nl.
7699 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
7700 (yyuserMerge): Provide a default case if b4_mergers is empty.
7701 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
7702 * tests/glr-regression.at
7703 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
7704 Add casts to pacify C++ compilers.
7705 * tests/glr-regression.at (Improper merging of GLR delayed action
7706 sets): Declare yylex before using it.
7707 * tests/Makefile.am (maintainer-check-g++): Fix a stray
7708 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
7709 test for valgrind; valgrind is independent of g++.
7710 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
7711 for compatibility with POSIX 1003.1-2001 (if running coreutils).
7712 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
7713 Use a destructor, so that we can expand the stack. Change
7714 YYSTYPE to char * so that we can free it. Cast result of malloc.
7716 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7718 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
7719 a valgrind failure. Problem reported by twlevo@xs4all.nl.
7721 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
7723 * PACKAGING: New file, suggested by Bruno Haible and taken from
7724 similar wording in gettext's PACKAGING file.
7725 * NEWS: Mention PACKAGING.
7726 * Makefile.am (EXTRA_DIST): Add PACKAGING.
7728 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
7730 * NEWS: Document recent i18n improvements.
7731 * bootstrap: Get runtime translations into runtime-po.
7732 Create runtime-po files automatically, if possible.
7733 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
7734 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
7735 does not infringe on the user's name space.
7736 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
7737 * doc/bison.texinfo (Internationalization): Revamp the English
7738 and Texinfo syntax a bit, to try to make it clearer.
7739 (Bison Options, Option Cross Key): Mention --print-localedir.
7740 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
7741 YYENABLE_NLS. Quote a bit more.
7742 * runtime-po/.cvsignore: New file.
7743 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
7744 * runtime-po/Rules-quot: Remove; now created by bootstrap.
7745 * runtime-po/quot.sed: Likewise.
7746 * runtime-po/boldquot.sed: Likewise.
7747 * runtime-po/en@quot.header: Likewise.
7748 * runtime-po/en@boldquot.header: Likewise.
7749 * runtime-po/insert-header.sin: Likewise.
7750 * runtime-po/remove-potcdate.sin: Likewise.
7751 * runtime-po/Makevars: Likewise.
7752 * runtime-po/LINGUAS: Likewise.
7753 * runtime-po/de.po: Likewise; we will rely on the translation project
7754 to maintain this, so "bootstrap" should get it.
7755 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
7757 * src/main.c (main): Bind the bison-runtime domain, too.
7759 2005-07-12 Bruno Haible <bruno@clisp.org>
7761 * data/yacc.c: Include <libintl.h> when NLS is enabled.
7762 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
7763 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
7764 * runtime-po: New directory.
7765 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
7766 $(DOMAIN).pot-update rule, so that old messages are never dropped.
7767 * runtime-po/Rules-quot: New file, copied from po/.
7768 * runtime-po/quot.sed: Likewise.
7769 * runtime-po/boldquot.sed: Likewise.
7770 * runtime-po/en@quot.header: Likewise.
7771 * runtime-po/en@boldquot.header: Likewise.
7772 * runtime-po/insert-header.sin: Likewise.
7773 * runtime-po/remove-potcdate.sin: Likewise.
7774 * runtime-po/Makevars: New file.
7775 * runtime-po/POTFILES.in: New file.
7776 * runtime-po/LINGUAS: New file.
7777 * runtime-po/bison-runtime.pot: New file.
7778 * runtime-po/de.po: New file.
7779 * m4/bison.m4: New file.
7780 * Makefile.am (SUBDIRS): Add runtime-po.
7781 (aclocaldir, aclocal_DATA): New variables.
7782 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
7784 * src/getargs.c (usage): Document --print-localedir option.
7785 (PRINT_LOCALEDIR_OPTION): New enum item.
7786 (long_options): Add --print-localedir option.
7787 (getargs): Handle --print-localedir option.
7788 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
7789 (Internationalization): New section.
7791 2005-07-12 Akim Demaille <akim@epita.fr>
7793 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
7794 for consistency with the rest of the code.
7795 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
7798 2005-07-12 Akim Demaille <akim@epita.fr>
7800 * src/parse-gram.y: Use %printer instead of YYPRINT.
7802 2005-07-12 Akim Demaille <akim@epita.fr>
7804 * src/symtab.h, src/symtab.c (symbol_print): New.
7805 * src/symlist.h, src/symlist.c (symbol_list_print): New.
7806 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
7808 2005-07-12 Akim Demaille <akim@epita.fr>
7810 * data/glr.c (b4_syncline): Fix (swap) the definitions of
7811 b4_at_dollar and b4_dollar_dollar.
7813 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
7815 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
7816 and Pennello's paper.
7818 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
7820 * data/yacc.c (yyparse): Undo previous patch. Instead,
7821 set yylsp[0] and yyvsp[0] only if the initial action
7822 sets yylloc and yylval, respectively.
7824 * data/yacc.c (yyparse): In the initial action, set
7825 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
7826 This avoids the use of undefined variables if the initial
7827 action does not set yylloc and/or yylval.
7829 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
7831 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
7832 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
7833 Remove from CVS. These files are automatically generated.
7834 * examples/extexi: Clarify that this file is now part of Bison,
7835 not GNU M4, and that it works with any POSIX-compatible Awk.
7836 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
7837 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
7838 so that we also get calc++-parser.yy. Geneate it.
7839 Use $(AWK), not gawk, since any conforming Awk will do.
7840 Put comment before action, since older 'make' can't handle comment
7842 $(BUILT_SOURCES): List all built sources, not just some of them.
7843 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
7844 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
7845 $($(calc_sources_generated)): Remove unnecessary test for existence
7846 of target. (This had a shell syntax error anyway; a stray "x".)
7847 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
7849 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
7851 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
7852 implied by the other modules.
7854 2005-07-06 Akim Demaille <akim@epita.fr>
7856 Bind examples/calc++ to the package.
7857 * examples/calc++/Makefile: Remove, replaced by...
7858 * examples/calc++/Makefile.am: ... this new file.
7859 * examples/calc++/test: Remove input.
7860 * examples/calc++/compile: Remove.
7861 * examples/Makefile.am: New.
7862 * configure.ac, Makefile.am: Adjust.
7863 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
7865 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
7867 * data/glr.c (yyFail): Drastically simplify; since the format argument
7868 never had any % directives, we can simply pass it to yyerror.
7869 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
7870 be modified later, as that is the usual style in glr.c.
7871 Problems reported by Paul Hilfinger.
7873 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
7874 and size overflow errors.
7875 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
7876 in case the user prolog sets feature-test macros like _GNU_SOURCE.
7877 (YYSIZEMAX): New macro.
7878 (yystpcpy): New function, taken from yacc.c.
7879 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
7880 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
7881 so that we don't have to maintain their signatures.
7882 (yyFail): Check for buffer overflow, by using vsnprintf rather
7883 than vsprintf. Allocate a bigger buffer if possible.
7884 Report an error if buffer allocation fails.
7885 (yyStackOverflow): New function.
7886 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
7887 the initialization was successful. It might fail if storage was
7889 (yyexpandGLRStack): Add more checks for storage allocation failure.
7890 Use yyStackOverflow to report failures.
7891 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
7892 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
7893 Don't assume stack number fits in int.
7894 (yysplitStack): Check for storage allocation failure.
7895 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
7896 can print diagnostics on storage allocation failure. All callers
7898 (yyresolveValue): Use yybool for boolean.
7899 (yyreportSyntaxError): Check for size-calculation overflow.
7900 This code is taken from yacc.c.
7901 (yyparse): Check for storage allocation errors when allocating
7904 2005-07-05 Akim Demaille <akim@epita.fr>
7906 Extract calc++ from the documentation.
7907 * doc/bison.texinfo (Calc++): Add the extraction marks.
7908 * examples/extexi: New, from the aborted GNU Programming 2E.
7909 Separate the different paragraph of a file with empty lines.
7910 * examples/Makefile: Use it to extract the whole calc++ example.
7912 2005-06-24 Akim Demaille <akim@epita.fr>
7914 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
7917 2005-06-22 Akim Demaille <akim@epita.fr>
7919 * doc/bison.texinfo (C++ Language Interface): First stab.
7920 (C++ Parsers): Remove.
7922 2005-06-22 Akim Demaille <akim@epita.fr>
7924 * data/lalr1.cc (yylex_): Honor %lex-param.
7926 2005-06-22 Akim Demaille <akim@epita.fr>
7928 Start a set of simple examples.
7929 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
7930 * examples/calc++/calc++-driver.hh,
7931 * examples/calc++/calc++-parser.yy,
7932 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
7933 * examples/calc++/compile, examples/calc++/test: New.
7935 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
7937 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
7938 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
7939 which stems from the 2005-05-27 patch.
7941 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7943 * data/glr.c: Modify treatment of unused parameters to permit use
7944 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
7946 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
7948 Fix infringement on user name space reported by Janos Zoltan Szabo.
7949 * data/yacc.c (yyparse): strlen -> yystrlen.
7951 2005-05-30 Akim Demaille <akim@epita.fr>
7953 * data/lalr1.cc (_): New.
7954 Translate the various messages.
7956 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
7958 Fix infringement on user name space reported by Bruno Haible.
7959 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
7960 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
7961 the user's name space.
7962 (alloca): Include <stdlib.h> to get it, if it's not built in.
7963 (YYMALLOC, YYFREE): Define only if needed.
7964 (malloc, free): Declare, but only if needed, as this infringes on
7965 the user name space.
7967 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
7969 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
7970 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
7972 * lib/ebitset.c (min, max): Undef before defining.
7973 * lib/vbitset.c (min, max): Likewise.
7974 * lib/subpipe.c (create_subpipe): Save local variables in case
7975 vfork clobbers them.
7977 2005-05-24 Bruno Haible <bruno@clisp.org>
7979 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
7980 error message syntax used by gcc-4.0.
7982 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
7984 * README: Mention m4 1.4.3. Remove obsolete advice about
7985 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
7987 * bootstrap: Remove workaround for problem I encountered with
7988 gettext 0.14.1; it seems to be fixed now.
7990 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
7992 * NEWS: Version 2.0a.
7994 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
7995 the previous change.
7997 Various maintainer cleanups.
7998 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
7999 conftest*, for benefit of CVS commands run at the same time as
8000 "configure". Add build-aux, since "bootstrap" now creates it and
8002 * Makefile.cfg (move_if_change): Remove.
8003 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
8004 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
8005 (po_repo, do-po-update, po-update, wget_files, get-targets):
8006 (config.guess-url_prefix, config.sub-url_prefix):
8007 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
8008 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
8009 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
8011 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
8012 this is now the recommended name.
8013 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
8014 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
8015 ylwrap. These files now go into build-aux.
8016 * config/move-if-change: Remove.
8017 * config/prev-version.txt: Bump from 1.75 to 2.0.
8019 * bootstrap: Add stdio-safer, unistd-safer modules.
8020 Remove m4/glibc2.m4 (introduced by latest gnulib, but
8022 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
8023 fopen-safer.c, stdio-safer.h, unistd-safer.h.
8024 * lib/subpipe.c: Include "unistd-safer.h".
8025 (create_subpipe): Make sure all the newly-created
8026 file descriptors are > 2, so that diagnostics don't
8027 get sent down them (which might cause Bison to hang, in theory).
8028 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
8029 * src/files.c (xfopen): Use fopen_safer, not fopen.
8031 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
8032 yesterday's yacc.c fix.
8034 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
8036 * data/glr.c, data/lalr1.cc: Update copyright date.
8038 Fix a destructor bug reported by Wolfgang Spraul in
8039 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
8040 * data/yacc.c (yyabortlab): Don't call destructor, and
8041 don't set yychar to EMPTY.
8042 (yyoverflowlab): Don't call destructor.
8043 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
8044 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
8045 since we no longer output the message "discarding lookahead token
8048 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8050 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
8051 fix a small glitch in debugging output.
8052 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
8053 after YY_SYMBOL_PRINT where needed.
8055 (struct yyGLRState): Add some comments.
8056 (struct yySemanticOption): Add some comments.
8057 (union yyGLRStackItem): Add comment.
8059 (yymergeOptionSets): Correct this to properly perform the union,
8060 avoiding infinite reported by Michael Rosien.
8063 * tests/glr-regression.at: Add test for GLR merging error reported
8066 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
8068 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
8069 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
8070 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
8071 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
8072 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
8073 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
8074 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
8075 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
8076 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
8077 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
8078 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
8079 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
8080 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
8081 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
8082 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
8083 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
8084 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
8085 src/derives.h, src/files.c, src/files.h, src/getargs.c,
8086 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
8087 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
8088 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
8089 src/output.h, src/parse-gram.c, src/parse-gram.h,
8090 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
8091 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
8092 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
8093 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
8094 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
8095 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
8096 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
8097 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
8098 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
8099 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
8100 tests/reduce.at, tests/regression.at, tests/sets.at,
8101 tests/synclines.at, tests/testsuite.at, tests/torture.at:
8102 Update FSF postal mail address.
8104 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
8106 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
8107 Problem reported by Ralf Menzel.
8109 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
8111 * tests/actions.at: Test that stack overflow invokes destructors.
8112 From Marcus Holland-Moritz.
8113 * data/yacc.c (yyerrlab): Move the code that destroys the stack
8115 (yyreturn): to here. That way, destructors are called properly
8116 even if the stack overflows, or the user calls YYACCEPT or
8117 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
8118 (yyoverflowlab): Destroy the lookahead.
8120 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
8122 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
8124 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
8126 * NEWS: Bison-generated C parsers no longer quote literal strings
8127 associated with tokens.
8128 * src/output.c (prepare_symbols): Don't escape strings,
8129 since users don't want to see C escapes.
8130 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
8132 * tests/input.at (Torturing the Scanner): Likewise.
8133 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
8135 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
8137 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
8138 the data size is known to be too small and we can't increase it.
8139 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
8141 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
8143 * src/parse-gram.y: Include quotearg.h.
8144 (string_as_id): Quote $1 before using it as a key, since the
8145 lexer no longer quotes it for us.
8146 (string_content): Don't strip quotes, since lexer no longer
8148 * src/scan-gram.l: Include quotearg.h.
8150 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
8151 a key, since the rest of the lexer doesn't quote it.
8152 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
8153 * tests/regression.at (Token definitions): Check for backslashes
8156 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
8157 (YYSIZE_T): Define to unsigned long int when using an older compiler.
8158 (yyparse): Revamp code to generate long syntax error message, to
8159 make it easier to translate, and to avoid problems with arithmetic
8160 overflow. Change "virtual memory" to "memory" in diagnostic, since
8161 we don't know whether the memory is virtual.
8163 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
8165 * NEWS: Bison-generated C parsers now use the _ macro to
8167 * data/yacc.c (_) [!defined _]: New macro.
8168 All English strings wrapped inside this macro.
8169 * doc/bison.texinfo (Bison Parser): Document _.
8170 * po/POTFILES.in: Include src/parse-gram.c, since it now
8171 includes translateable strings that parse-gram.y doesn't.
8173 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
8175 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
8176 reverting the 2004-10-11 change to this function.
8177 (symbol_check_alias_consistency): Don't call symbol_type_set
8178 if the type name is already correct.
8179 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
8181 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
8183 * tests/regression.at (Token definitions): Don't use a token named
8184 c, as that generates a "#define c ..." that runs afoul of buggy
8185 stdlib.h that uses the identifier c as a member of struct
8186 drand48_data. Problem reported by Horst Wente.
8188 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
8190 * bootstrap: Change translation URL from
8191 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
8192 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
8193 redirection glitches. Problem reported by twlevo@xs4all.nl.
8195 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
8197 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
8198 after operands; POSIX says this isn't portable for the c99 command.
8200 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
8202 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
8203 immediately if a data overrun has occurred; this may help us track
8204 down what may be a spurious failure on MacOS.
8206 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
8208 Respond to problems reported by twlevo@xs4all.nl.
8210 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
8212 * src/vcg.h: Comment fix.
8213 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
8214 (G_CMAX): Change to -1 instead of INT_MAX.
8216 * data/yacc.c (yyparse): Omit spaces before #line.
8218 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
8220 * src/tables.c (state_number_to_vector_number): Put it inside an
8221 "#if 0", since it's not currently used. Problem reported by
8224 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
8226 * src/output.c (escaped_output): Renamed from
8227 escaped_file_name_output, since we now use it for symbol tags as
8228 well. All uses changed.
8229 (symbol_destructors_output, symbol_printers_output):
8230 Escape symbol tags too.
8231 Problem reported by Matyas Forstner in
8232 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
8234 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
8236 * src/output.c (user_actions_output, token_definitions_output,
8237 symbol_destructors_output, symbol_printers_output): Likewise.
8238 * src/reader.c (prologue_augment): Likewise.
8239 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
8241 * src/vcg.c (output_edge): Don't quote linestyle arg.
8242 Problem reported by twlevo@xs4all.nl.
8244 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
8246 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
8247 example, reported by Derek M Jones. Also, make the example even
8248 more outrageous, to better illustrate how bad the problem is.
8250 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
8252 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
8253 putsym. Typo reported by Sebastian Piping.
8255 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
8257 * doc/bison.texinfo (Language and Grammar): some -> same
8258 (Epilogue): int he -> in the
8259 Typos reported by Sebastian Piping via Justin Pence.
8261 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
8263 * tests/glr-regression.at (Improper handling of embedded actions
8264 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
8265 embedded actions and $-N in GLR parsers", work around an Autoconf bug
8266 with dollar signs in test names.
8267 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
8268 for a similar reason.
8270 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
8272 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
8273 wants to redefine G_VIEW.
8275 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
8277 * src/vcg.c (get_view_str): Remove case for normal_view.
8278 Problem reported by twlevo@xs4all.nl.
8280 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
8282 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
8283 Problem reported by twlevo@xs4all.nl.
8285 * doc/bison.texinfo: Change @dircategory from "GNU programming
8286 tools" to "Software development". Requested by Richard Stallman
8289 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
8291 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
8292 Problem reported by twlevo@xs4all.nl.
8294 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
8296 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
8297 keyword; it's not needed with modern compilers, and it doesn't
8298 affect correctness with older compilers. Suggested by
8301 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
8303 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
8304 gcc -Wswitch-default.
8305 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
8306 * data/yacc.c (yyparse): Likewise.
8308 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
8310 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
8311 already. Let config.h define any nonstandard values.
8313 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
8315 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
8316 for the benefit of slower hosts. Problem reported by
8319 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
8321 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
8322 being defined and not used.
8323 * data/lalr1.cc (yyparse): Likewise.
8324 Use "if (false)" rather than "if (0)".
8326 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
8328 * TODO: Mention that we should allow NUL bytes in tokens.
8330 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
8332 * src/scan-skel.l (<<EOF>>): Don't close standard output.
8333 Problem reported by Hans Aberg.
8335 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
8337 * src/getargs.c (version): Happy new year; update overall
8338 program copyright date from 2004 to 2005.
8340 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
8341 Problem reported by Hans Aberg.
8342 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
8343 (Output file names.): Add a test for the case when standard output
8346 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
8348 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
8349 to fix an oversight in the Bison 2.0 manual.
8351 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
8353 * NEWS: Version 2.0. Reformat the existing news items since
8354 1.875, so that related items are grouped together.
8355 * configure.ac (AC_INIT): Bump version to 2.0.
8356 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
8358 * tests/torture.at (Exploding the Stack Size with Alloca): Set
8359 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
8360 otherwise, we're not testing alloca. Unfortunately there's no
8361 simple way to consult HAVE_ALLOCA here.
8363 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
8366 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
8367 hand. This avoids a warning about comparing int to size_t when
8368 GCC warnings are enabled.
8370 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
8372 * NEWS: Bison-generated parsers no longer default to using the
8373 alloca function (when available) to extend the parser stack, due
8374 to widespread problems in unchecked stack-overflow detection.
8375 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
8376 responsibility to set it to a positive value. This lets the user
8377 specify a value that is not a preprocessor constant.
8378 * data/yacc.c (YYMAXDEPTH): Likewise.
8379 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
8380 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
8381 to be a compile-time constant. However, explain the constraints on it.
8382 Also, explain the constraints on YYINITDEPTH.
8383 (Table of Symbols): Explain that alloca is no longer the default.
8384 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
8387 * doc/bison.texinfo (Location Default Action): Mention that n must
8388 be zero when k is zero. Suggested by Frank Heckenbach.
8390 2004-12-22 Akim Demaille <akim@epita.fr>
8392 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
8393 (parser::state_type, parser::semantic_type, parser::location_type):
8394 Private, not public.
8395 (parser::parse): Return ints, not bool.
8396 Returning a bool introduces a problem: 0 corresponds to false, and
8397 it seems weird to return false on success. Returning true changes
8398 the conventions for yyparse.
8399 Alternatively we could return void and send an exception.
8400 There is no clear consensus (yet?).
8401 (state_stack, semantic_stack, location_stack): Rename as...
8402 (state_stack_type, semantic_stack_type, location_stack_type): these.
8403 Private, not public.
8404 * tests/c++.at: New.
8405 * tests/testsuite.at, tests/Makefile.am: Adjust.
8407 2004-12-21 Akim Demaille <akim@epita.fr>
8409 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
8411 2004-12-21 Akim Demaille <akim@epita.fr>
8413 Don't impose std::string for filenames.
8415 * data/lalr1.cc (b4_filename_type): New.
8416 (position::filename): Use it.
8417 (parser.hh): Move the inclusion of stack.hh and location.hh below
8418 the user code, so that needed headers for the filename type can be
8420 Forward declare them before the user code.
8421 * tests/Makefile.am (check-local, installcheck-local): Pass
8422 TESTSUITEFLAGS to the TESTSUITE.
8424 2004-12-20 Akim Demaille <akim@epita.fr>
8426 Use more STL like names: my_class instead of MyClass.
8428 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
8429 (SemanticStack, SemanticType, StateStack, StateType)
8430 (TokenNumberType, Stack, Slice, Traits, Parser::location)
8431 (Parser::value): Rename as...
8432 (location_stack, location_type, rhs_number_type, semantic_stack)
8433 (semantic_type, state_stack, state_type, token_number_type, stack)
8434 (slice, traits, parser::yylloc, parser::yylval): these.
8436 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
8438 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
8440 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
8441 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
8443 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
8445 Remove uses of 'short int' and 'unsigned short int'. This raises
8446 some arbitrary limits. It uses more memory but nowadays that's
8447 not much of an issue.
8449 This change does not affect the generated parsers; that's a different
8450 task, as some users will want to conserve memory there.
8452 Ideally we should use size_t to represent all object counts, and
8453 something like ptrdiff_t to represent signed differences of object
8454 counts; but that will require more code-cleanup than I have the
8455 time to do right now.
8457 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
8458 Use size_t, not int or short int, to count objects.
8459 * src/closure.c (nritemset, closure): Likewise.
8460 * src/closure.h (nritemset, closure): Likewise.
8461 * src/nullable.c (nullable_compute): Likewise.
8462 * src/print.c (print_core): Likewise.
8463 * src/print_graph.c (print_core): Likewise.
8464 * src/state.c (state_compare, state_hash): Likewise.
8465 * src/state.h (struct state): Likewise.
8466 * src/tables.c (default_goto, goto_actions): Likewise.
8468 * src/gram.h (rule_number, rule): Use int, not short int.
8469 * src/output.c (prepare_rules): Likewise.
8470 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
8471 errs, reductions): Likewise.
8472 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
8474 * src/tables.c (vector_number, tally, action_number,
8475 ACTION_NUMBER_MINIMUM): Likewise.
8476 * src/output.c (muscle_insert_short_int_table): Remove.
8478 2004-12-17 Akim Demaille <akim@epita.fr>
8480 * data/lalr1.cc: Extensive Doxygenation.
8481 (error_): Rename as...
8482 (error): this, since it is visible to the user.
8484 (Parser::message): Now an automatic variable from...
8485 (Parser::yyreport_syntax_error_): here.
8486 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
8488 * tests/input.at: Escape $.
8490 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
8492 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
8493 Parenthesize rhs to avoid obscure problems with mistakes like
8494 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
8495 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
8496 b4_rhs_location): Likewise.
8497 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
8498 b4_rhs_location): Likewise.
8500 2004-12-16 Akim Demaille <akim@epita.fr>
8502 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
8503 yacc.c: be sure to stay within yycheck_.
8504 * tests/actions.at: Re-enable C++ tests.
8506 2004-12-16 Akim Demaille <akim@epita.fr>
8508 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
8511 2004-12-16 Akim Demaille <akim@epita.fr>
8513 Use #define to handle the %name-prefix.
8515 * data/glr.c, data/yacc.c: Comment changes.
8516 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
8517 so that one can refer to yylex in the parser file, and have it
8518 renamed, as is the case with other skeletons.
8520 2004-12-16 Akim Demaille <akim@epita.fr>
8522 Move lalr1.cc internals into yy*.
8524 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
8525 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
8526 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
8527 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
8528 (empty_, final_, terror_, errcode_, ntokens_)
8529 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
8530 (looka_, ilooka_, error_range_, nerrs_):
8532 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
8533 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
8534 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
8535 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
8536 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
8537 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
8538 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
8539 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
8542 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
8544 Fix some problems reported by twlevo at xs4all.
8545 * src/symtab.c (symbol_new): Report an error if the input grammar
8546 contains too many symbols. This is better than calling abort() later.
8547 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
8548 (struct node, struct graph):
8549 Rename member expand to stretch. All uses changed.
8550 (struct graph): Remove member layoutalgorithm. All uses removed.
8551 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
8552 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
8554 (N_STRETCH): Rename from N_EXPAND. All uses changed.
8556 2004-12-15 Akim Demaille <akim@epita.fr>
8558 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
8559 Add more Doxygen comments.
8560 (symprint_, stack_print_, reduce_print_, destruct_, pop)
8561 (report_syntax_error_, translate_): Rename as...
8562 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
8563 (yypop_, yyreport_syntax_error_, yytranslate_): this.
8565 2004-12-15 Akim Demaille <akim@epita.fr>
8567 * data/lalr1.cc (lex_): Rename as...
8569 Move the trace here.
8570 Take the %name-prefix into account.
8571 Reported by Alexandre Duret-Lutz.
8573 2004-12-15 Akim Demaille <akim@epita.fr>
8575 Simplify the C++ parser constructor.
8577 * data/lalr1.cc (debug_): Rename as...
8578 (yydebug_): so that the parser's internals are always in the yy*
8581 (b4_parse_param_decl): Remove the leading comma as it is now only
8582 called as unique argument list.
8583 (Parser::Parser): Remove the constructor accepting a location and
8584 an initial debugging level.
8585 Remove from the other ctor the argument for the debugging level.
8586 (debug_level_type, debug_level, set_debug_level): New.
8588 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
8591 2004-12-15 Akim Demaille <akim@epita.fr>
8593 Remove b4_root related material: failure experiment
8594 (which goal was to allow to derive from a class).
8596 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
8597 definitions and uses.
8599 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
8601 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
8602 not 2, since it's not portable to subtract 1 from the start of an
8603 array. The new item 0 is never set or used. All uses changed.
8605 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
8606 the default definition of YYLLOC_DEFAULT. Problem reported
8607 by Frank Heckenbach.
8609 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
8611 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
8612 the normal case and one for the error case. Just use the
8613 first one uniformly. Problem reported by Frank Heckenbach.
8614 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
8615 use exactly the same macro in both places.
8616 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
8617 so that the normal-case YYRHSLOC works for the error case too.
8619 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
8620 (YYLLOC_DEFAULT): Use the same macro as glr.c.
8621 * doc/bison.texinfo (Location Default Action): Don't claim that
8622 we have an array of locations. Use the same macro for both glr
8623 and lalr parsers. Mention YYRHSLOC. Mention what happens when
8626 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
8628 * HACKING: Update email addresses to send announcements to.
8630 * configure.ac (AC_INIT): Bump version to 1.875f.
8632 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
8634 * NEWS: Version 1.875e.
8635 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
8637 * src/scan-skel.l: Include "complain.h", for "fatal".
8639 * src/relation.h (relation_print, relation_digraph):
8640 Relation sizes are of type relation_node, not size_t (this is
8641 merely a doc fix, since the two types are equivalent).
8642 (relation_transpose): Relation sizes are of type relation_node,
8644 * src/relation.c: Likewise.
8645 (top, infinity): Now of type relation_node, not int.
8646 (traverse, relation_transpose): Use relation_node, not int.
8648 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
8649 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
8650 (yyparse): Remove unused local introduced in 2004-10-25 patch.
8652 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
8653 specifying whether the test should be skipped. Use it tp
8654 specify that the [%defines %skeleton "lalr1.cc"] tests currently
8655 fail on some hosts, and should be skipped.
8657 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
8659 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
8660 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
8661 unless otherwise specified below.
8663 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
8664 to allocate kernel_base, kernel_items, kernel_size, since
8665 they needn't be initialized to 0.
8666 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
8667 * src/closure.c (new_closure): Likewise, for itemset.
8668 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
8669 * src/lalr.c (set_goto_map): Likewise, for temp_map.
8670 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
8671 (build_relations): Likewise for edge, states1, includes.
8672 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
8673 * src/reader.c (packgram): Likewise, for ritem, rules.
8674 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
8675 * src/relation.c (relation_digraph): Likewise for VERTICES.
8676 (relation_transpose): Likewise for new_R, end_R.
8677 * src/symtab.c (symbols_token_translations_init): Likewise for
8679 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
8680 (token_actions): Likewise for yydefact, actrow, conflrow,
8682 (save_column): Likewise for froms[symno], tos[symno].
8683 (goto_actions): Likewise for state_count.
8684 (pack_table): Likewise for base, pos, check.
8685 (tables_generate): Likewise for width.
8687 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
8688 for initial core. Just have a separate core, so we needn't worry
8689 about whether kernel_size and kernel_base are initialized.
8691 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
8692 kernel_size, kernel_items): Remove unnecessary initialization.
8693 * src/conflicts.c (conflicts): Likewise.
8694 * src/derives.c (derives): Likewise.
8695 * src/muscle_tablc (muscle_insert): Likewise.
8696 * src/relation.c (relation_digraph): Likewise.
8697 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
8698 conflrow, conflict_table, conflict_list, table, check):
8701 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
8702 This is because all callers pass unsigned int.
8703 * src/closure.h (new_closure): Likewise.
8705 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
8706 (build_relations): Initialize includes[i] in all cases.
8707 * src/reader.c (packgram): Always initialize rules[ruleno].prec
8708 and rules[ruleno].precsym. Initialize members in order.
8709 * src/relation.c (relation_transpose): Always initialize new_R[i]
8711 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
8713 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
8714 conflict_list[0] was always 0, but now it isn't initialized.
8716 * src/table.c (table_grow): When conflict_table grew, the grown
8717 area wasn't cleared. Fix this.
8719 * lib/.cvsignore: Add strdup.c, strdup.h.
8720 * m4/.cvsignore: Add strdup.m4.
8722 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
8724 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
8725 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
8726 GOTO_NUMBER_MAXIMUM, since we occasionally compute
8727 ngotos + 1 without checking for overflow.
8728 (build_relations): Use END_NODE, not -1, to denote end of edges.
8729 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
8730 build_relations): Use goto_number, not int, for goto numbers.
8731 * src/tables.c (save_column, default_goto): Likewise.
8733 2004-11-23 Akim Demaille <akim@epita.fr>
8735 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
8736 of #defining from yystype.
8737 Don't typedef yystype, C++ does not need it.
8738 This lets it possible to forward declare it as union.
8740 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
8742 * bootstrap (gnulib_modules): Add extensions.
8743 Problem reported by Jim Meyering.
8745 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
8747 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
8748 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
8749 src/system.h, src/tables.c: XFREE -> free, to accommodate
8750 recent change to gnulib xalloc.h.
8751 Problem reported by Jim Meyering.
8753 2004-11-17 Akim Demaille <akim@epita.fr>
8755 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
8757 2004-11-17 Akim Demaille <akim@epita.fr>,
8758 Alexandre Duret-Lutz <adl@gnu.org>
8760 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
8763 Use it instead of cdebug_.
8764 (Parser::debug_stream, Parser::set_debug_stream): New.
8765 (Parser::symprint_): Define cdebug_ for temporary backward
8767 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
8770 2004-11-17 Akim Demaille <akim@epita.fr>
8772 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
8773 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
8774 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
8775 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
8777 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
8779 * data/glr.c (yyloc_default): Remove; not used.
8780 Problem reported by Frank Heckenbach.
8782 2004-10-25 Akim Demaille <akim@epita.fr>
8784 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
8785 Introduce another definition to address simple location arrays.
8786 (yyGLRStack): New member: yyerror_range.
8787 (yyrecoverSyntaxError, yyparse): Update it.
8788 (yyrecoverSyntaxError): Use it when shifting the error token to
8789 have an accurate range, equivalent to the one computed by both
8790 yacc.c and lalr1.cc.
8791 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
8792 that column numbers start at column 0, as per GNU Coding
8793 Standards, the others tests, and the doc.
8794 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
8795 Adjust to the above change (first column is 0).
8796 And adjust the location of the "<error>", now covering the whole
8799 2004-10-22 Akim Demaille <akim@epita.fr>
8800 and Paul Eggert <eggert@cs.ucla.edu>
8802 Remove some arbitrary limits on goto numbers and relations.
8803 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
8804 initial values, since they're never used.
8805 (set_goto_map): ngotos is now unsigned, so test for overflow
8806 by seeing whether it wraps around to zero.
8807 * src/lalr.h (goto_number): Now size_t, not short int.
8808 (GOTO_NUMBER_MAXIMUM): Remove.
8809 * src/relation.c (relation_print, traverse, relation_transpose):
8810 Check for END_NODE rather than looking at sign.
8811 * src/relation.h (END_NODE): New macro.
8812 (relation_node): Now size_t, not short int.
8814 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
8816 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
8817 keyword, not an identifier. Problem reported by Baron Schwartz in
8818 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
8820 2004-10-11 Akim Demaille <akim@epita.fr>
8822 * src/symtab.c (symbol_check_alias_consistency): Also check
8823 type names, destructors, and printers.
8824 Reported by Alexandre Duret-Lutz.
8825 Recode the handling of associativity and precedence in terms
8826 of symbol_precedence_set.
8827 Accept no redeclaration at all, not even equal to the previous
8829 (redeclaration): New.
8830 Use it to factor redeclaration complaints.
8831 (symbol_make_alias): Don't set the type of the alias, let
8832 symbol_check_alias_consistency do it as for other features.
8833 * src/symtab.h (symbol): Add new member prec_location, and
8835 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
8836 * tests/input.at (Incompatible Aliases): New.
8838 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
8840 .cvsignore fixes to accommodate gnulib changes,
8841 and the practice of naming build directories "_build".
8842 * .cvsignore: Add "_*". Sort.
8843 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
8844 * m4/.cvsignore: Add "*_gl.m4".
8846 2004-10-06 Akim Demaille <akim@epita.fr>
8848 * src/parse-gram.y (add_param): Fix the truncation of trailing
8851 2004-10-05 Akim Demaille <akim@epita.fr>
8853 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
8854 whether the reducion was empty or not. This leaves room to
8855 improve the use of YYLLOC_DEFAULT in such a case.
8856 lalr1.cc is still experimental, so changing this is acceptable.
8857 And finally, there are probably not many users who changed the
8858 handling of locations in GLR, so changing is admissible too.
8860 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
8861 empty reduction, set @$ to an empty location ending the previously
8863 Adjust uses to make sure the code is triggered on empty
8865 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
8866 expected output: empty reductions have empty locations.
8868 2004-09-29 Akim Demaille <akim@epita.fr>
8870 * data/lalr1.cc: Move towards a more standard C++ coding style
8871 for templates: Class < T > -> Class<T>.
8873 2004-09-29 Akim Demaille <akim@epita.fr>
8875 * data/lalr1.cc: Reinstall the former ctor, for sake of
8876 compatibility, but warn it will be removed.
8877 Move towards a more standard C++ coding style (i.e., type *var ->
8880 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
8882 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
8883 since it's less likely to work if NULs are involved in the future.
8885 2004-09-27 Akim Demaille <akim@epita.fr>
8887 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
8889 2004-09-27 Akim Demaille <akim@epita.fr>
8891 * data/lalr1.cc (b4_parse_param_decl_1): New.
8892 (b4_parse_param_decl): Use it to have different names between attribute
8894 (b4_cc_constructor_call): Likewise.
8896 2004-09-24 Akim Demaille <akim@epita.fr>
8898 * src/parse-gram.y (add_param): Strip the leading and trailing
8899 blanks from a formal argument declaration.
8900 (YY_LOCATION_PRINT): New.
8902 2004-09-24 Akim Demaille <akim@epita.fr>
8904 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
8907 2004-09-24 Akim Demaille <akim@epita.fr>
8909 * doc/bison.texinfo (Table of Symbols): Sort.
8911 2004-09-21 Akim Demaille <akim@epita.fr>
8913 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
8914 the useless parentheses.
8915 Suggested by Paul Eggert.
8917 2004-09-20 Akim Demaille <akim@epita.fr>
8919 Let the initial-action act on the look-ahead, and use it for the
8920 "initial push" (corresponding to an hypothetical beginning-of-file).
8921 And let lalr1.cc honor %initial-action.
8923 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
8925 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
8926 (Parser::Parser): Remove the ctor that used to initialize it.
8927 (Parser::parse): Like in the other skeletons, issue the "starting
8928 parse" message before any action.
8929 Honor %initial-action.
8930 Initialize the stacks with the lookahead.
8931 * data/yacc.c: Let $$ and @$ in %initial-action designate the
8933 Push them in the stacks.
8934 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
8936 2004-09-20 Akim Demaille <akim@epita.fr>
8938 * doc/bison.texinfo (Initial Action Decl): New.
8940 2004-09-20 Akim Demaille <akim@epita.fr>
8942 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
8943 clearer criterion to define it.
8944 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
8945 When reducing on an empty RHS, use the latest stacked location as
8947 yylloc is not always available.
8948 * data/glr.c: Likewise.
8949 Also, honor initial-actions.
8951 2004-09-20 Akim Demaille <akim@epita.fr>
8953 * data/yacc.c (YY_LOCATION_PRINT): New.
8954 Define when we know YYLTYPE's structure, i.e., when the default
8955 YYLLOC_DEFAULT is used.
8956 * data/c.m4 (b4_yysymprint_generate): Use it.
8957 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
8958 value of the result.
8959 (error_start_): Replace with...
8960 (error_range_): this location array.
8961 This allows to replace code relying on the implementation of
8962 locations by portable code.
8963 * data/yacc.c (yylerrsp): Replace with...
8964 (yyerror_range): this.
8965 Every time a token is popped, update yyerror_range[0], to have an
8966 accurate location for the error token.
8967 * data/glr.c (YY_LOCATION_PRINT): New.
8968 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
8969 deference a pointer.
8970 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
8971 report the location in %printers.
8973 * src/scan-skel.l: Instead of abort, report error messages to ease
8974 understanding skeleton scanning failures.
8976 2004-09-16 Akim Demaille <akim@epita.fr>
8978 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
8979 (iterator, const_iterator): these, to be more in the C++ spirit.
8980 Also, return reverse iterators so that when displaying the stack
8981 we display its bottom first.
8982 (Parser::stack_print_, Parser::reduce_print_): Match the messages
8984 We should probably use vector here though.
8986 2004-09-16 Akim Demaille <akim@epita.fr>
8988 Have more complete shift traces.
8990 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
8991 to report Shifts instead of ad hoc YYDPRINTF invocations,
8992 including for the error token.
8993 * data/lalr1.cc (symprint_): Output the location.
8994 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
8995 output the location within the %printer.
8996 Activate GLR tests, at least to make sure they compile properly.
8997 They still don't pass though.
8998 * tests/calc.at: Adjust expect verbose output, since now "Entering
8999 state..." is on a different line than the "Shifting" message.
9001 2004-09-08 Akim Demaille <akim@epita.fr>
9003 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
9004 Bison directive from the Bison file to the invocation of this
9005 macro, so that these directives are passed to
9006 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
9007 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
9008 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
9009 the extra Bison directives instead of the whole series.
9010 Change the grammar so that there are recoverable errors, and
9011 unrecoverable errors. Now we can have the parser give up before
9012 consuming the whole input. As a result we now can observe that
9013 the lookahead is freed when needed.
9014 Change the parser source to parse argv[1] instead of a hard coded
9016 Simplify yylex, and give a value and location to EOF.
9017 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
9018 passed directives already coded in the file.
9019 Add some tests to check the location of "error".
9020 For some tests, the C++ parser is correct, and not yacc.c.
9021 For other tests, they provide different, but unsatisfying, values,
9022 so keep the C++ value so that at least one parser is "correct"
9023 according to the test suite.
9024 (Actions after errors): Remove, this is subsumed by the
9025 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
9027 2004-09-06 Akim Demaille <akim@epita.fr>
9029 * data/lalr1.cc: Adjust the indentation of the labels.
9033 2004-09-06 Akim Demaille <akim@epita.fr>
9035 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
9036 argument, an informative message.
9037 Call YY_SYMBOL_PRINT.
9038 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
9039 * data/lalr1.cc (destruct_): Likewise.
9040 In addition, no longer depend on b4_yysymprint_generate and
9041 b4_yydestruct_generate to generate these functions, do it "by
9044 2004-09-03 Akim Demaille <akim@epita.fr>
9046 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
9047 invoked, yydestruct the lookahead.
9048 * tests/calc.at (Calculator $1): Update the expected lengths of
9049 traces: there is an added line for the discarded lookahead.
9050 * doc/bison.texinfo (Destructor Decl): Some rewording.
9051 Define "discarded" symbols.
9053 2004-09-02 Akim Demaille <akim@epita.fr>
9055 * data/lalr1.cc (translate_, destruct_): No reason to be static.
9057 2004-09-02 Akim Demaille <akim@epita.fr>
9059 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
9060 (YYDSYMPRINTF): Rename as...
9061 (YY_SYMBOL_PRINT): this.
9062 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
9064 Use it instead of direct symprint_ calls.
9065 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
9068 2004-09-02 Akim Demaille <akim@epita.fr>
9070 * data/lalr1.cc (b4_yysymprint_generate): New.
9071 (symprint_): New member function, defined when YYDEBUG.
9072 Use it consistently instead of token/nterm debugging output by
9074 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
9075 %printer calls to use cdebug_ when using lalr1.cc.
9077 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
9079 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
9080 with #ifdef YYDEBUG.
9082 2004-08-26 Akim Demaille <akim@epita.fr>
9084 * doc/bison.texinfo (Implementing Loops): Rename as...
9085 (Implementing Gotos/Loops): this.
9087 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
9089 Adjust to latest gnulib.
9090 * bootstrap (gnulib_modules): Add xalloc-die.
9091 Set LC_ALL=C so that file names sort consistently.
9092 Prefer the gnulib copies of gettext.m4, glibc21.m4,
9093 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
9094 uintmax_t.m4, ulonglong.m4.
9095 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
9096 po.m4 since we are now using _gl.m4 instead.
9098 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
9100 * src/scan-action.l: Remove. Scanning of semantic actions is
9101 handled in scan-gram.l.
9103 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
9105 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
9107 * src/location.h (struct): The file member is a uniqstr.
9108 (equal_boundaries): Use UNIQSTR_EQ for comparison.
9110 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
9112 Fix bug with non-%union parsers that have printers or destructors,
9113 which led to a Bison core dump. Reported by Peter Fales in
9114 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
9116 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
9117 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
9118 not to our own type.
9119 * src/output.c (symbol_destructors_output, symbol_printers_output):
9120 Don't assume %union.
9121 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
9122 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
9123 UNION-FLAG. All callers changed.
9124 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
9125 Use type char, not unsigned int, when declaring an array of char;
9126 this lets us remove a cast.
9127 (Printers and Destructors): Add non-%union test cases.
9129 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
9131 * doc/bison.texinfo: Minor editorial changes, mostly to the new
9132 GLR writeups. E.g., avoid frenchspacing and the future tense,
9133 change "lookahead" to "look-ahead", and change "wrt" to "with
9136 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9138 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
9139 New sections, split off from the GLR Parsers section. Put the new
9140 Simple GLR Parser near the start of the GLR section, for clarity.
9141 Rewrite connective text.
9143 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
9145 * doc/bison.texinfo (Simple GLR Parsers): New section.
9147 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
9149 * NEWS, TODO, doc/bison.texinfo:
9150 Use "look-ahead" instead of "lookahead", to be consistent.
9151 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
9152 while we're fixing "look-ahead".
9153 * src/conflicts.c (shift_set): Renamed from shiftset.
9154 (look_ahead_set): Renamed from lookaheadset.
9155 * src/print.c: Likewise.
9156 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
9157 name for "lookahead".
9158 (report_types, usage): Likewise.
9159 * src/getargs.h (report_look_ahead_tokens): Renamed from
9161 * src/lalr.c (compute_look_ahead_tokens): Renamed from
9163 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
9164 (look_ahead_tokens_print): Renamed from lookaheads_print.
9165 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
9166 state_rule_lookaheads_print.
9167 * src/state.h: Likewise.
9168 (reductions.look_ahead_tokens): Renamed from lookaheads.
9169 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
9170 AT_DATA_LOOKAHEADS_GRAMMAR.
9172 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
9174 * README: Update location of patched M4 distribution.
9176 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
9178 Don't assume the C++ compiler takes the same arguments as the C compiler
9180 * configure.ac (O0CXXFLAGS): New var.
9181 * tests/atlocal.in (CXXFLAGS): Use it.
9183 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
9185 Fix some "make check" problems with C++ reported by
9186 Albert Chin-A-Young for Tru64 C++ in this thread:
9187 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
9189 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
9190 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9191 Output to a .cc file for C++, not to a .c file.
9192 * tests/calc.at (AT_CHECK_CALC): Likewise.
9193 * tests/regression.at (AT_CHECK_DANCER): Likewise.
9194 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
9196 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
9198 * tests/calc.at, tests/actions.at: Workaround for SGI
9199 C++ compiler. (trivial change)
9201 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
9203 Spent a few hours checking out which prerequisite versions the
9204 current sources actually require. I went all the way back to
9205 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
9206 a seemingly endless set of combinations of versions more recent
9207 than that. The bottom line is that the current sources require
9208 fairly recent versions of the build tools, and it'll be some work
9210 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
9211 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
9212 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
9213 Add comments explaining why those particular versions are
9216 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
9217 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
9218 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
9220 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
9221 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
9223 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
9225 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
9226 0.11.5. Suggested by Bruno Haible.
9227 * bootstrap: Remove gettext version checking.
9229 * doc/bison.texinfo (Decl Summary): Also mention that %union
9230 can depend on prerequisite types. Problem reported by Tim
9233 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
9235 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
9236 * README-alpha: Don't tell people not to package this.
9238 * bootstrap: Don't assume $(...) works; use `...` instead.
9239 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
9242 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
9243 put into the -d output file, and mention what to do if YYSTYPE is
9246 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
9248 Undo change made earlier today: it caused autopoint to not bring
9249 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
9252 * bootstrap: Check that gettext version matches what's in
9253 configure.ac. Warn users to ignore robots.txt ERROR 404.
9254 * bootstrap: Undo today's earlier change (logged below).
9255 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
9257 The gettext version checking is causing more trouble than it's
9258 curing; remove it. Problem reported by Paul Hilfinger.
9260 * bootstrap: Issue a warning that one can expect a message
9261 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
9262 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
9264 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
9266 Ensure that the C++ compiler used for testing actually works on a
9267 simple test program; if not, skip the C++-related tests. Problem
9268 reported by Vin Shelton in:
9269 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
9271 * m4/cxx.m4: New file.
9272 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
9273 * tests/atlocal.in (BISON_CXX_WORKS): Add.
9274 * tests/local.at (AT_COMPILE_CXX): Use it.
9276 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
9278 * data/glr.c (yylloc): Output this macro even if locations are not
9279 being generated, as the GLR parser needs it even in that case.
9280 Problem reported by Troy A. Johnson
9281 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
9283 * configure.ac (AC_INIT): Update to 1.875e.
9285 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
9287 * NEWS: Version 1.875d.
9288 * configure.ac (AC_INIT): Likewise.
9289 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
9291 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
9292 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
9293 lalr1.cc runs afoul of the first, and the last two are no longer
9294 supported by GCC 3.4.0.
9295 * README: Mention GNU m4 1.4 or later; mention m4 patches.
9296 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
9298 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
9300 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
9301 unsigned int, for compatibility with latest gnulib hash module.
9302 * src/state.c (state_hash, state_hasher): Likewise.
9303 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
9304 * src/uniqstr.c (hash_uniqstr): Likewise.
9306 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
9308 * NEWS: Unescaped newlines are no longer allowed in char & strings.
9310 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
9311 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
9312 character and string literals.
9313 (unexpected_end): New function.
9314 (unexpected_eof): Use it.
9315 (unexpected_newline): New function.
9316 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
9319 * NEWS: Document %expect-rr.
9321 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
9322 Fix typo by replacing $1 with $option.
9323 Remove more 'intl'-related files.
9324 Don't DEFUN AM_INTL_SUBDIR twice.
9326 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
9327 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
9329 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
9330 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
9331 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
9332 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
9333 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
9334 * src/.cvsignore: Add *.output.
9336 * src/parse-gram.y: Put copyright notice inside %{ %} so it
9337 gets copied to the output file.
9339 2004-04-28 Paul Eggert <eggert@twinsun.com>
9341 Get files from the gnulib and po repositories, instead of relying
9342 on them being in our CVS. Upgrade to latest versions of gnulib
9345 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
9346 * bootstrap: Bootstrap from gnulib and po repositories.
9347 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
9348 * README-cvs: Document these changes. Remove version numbers from
9349 mentions of build tools, since they change so often. Mention Flex.
9351 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
9352 (gl_USE_SYSTEM_EXTENSIONS): Add.
9353 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
9354 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
9356 (AC_ISC_POSIX): Remove; we no longer support this
9357 ancient OS, as it gets in the way of latest Autoconf & gnulib.
9358 (AC_HEADER_STDC): Remove: we now assume C89 or better.
9359 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
9360 Do not check for C89 headers, except for locale.h which is used
9361 by the Yacc library and must port to K&R hosts.
9362 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
9363 Do not check for C89 functions, except for setlocale which is
9364 used by the Yacc library.
9365 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
9366 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
9367 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
9368 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
9369 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
9370 AM_GNU_GETTEXT): Remove; now done by:
9371 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
9372 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
9375 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
9376 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
9377 Define to empty, as gnulib.mk will do the rest for us.
9378 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
9380 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
9381 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
9383 * src/files.c: Include gnulib's xstrndup.h.
9385 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
9386 (REALLOC): Use xnrealloc, for likewise.
9387 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
9388 (strnlen, memrchr): Remove decls; functions no longer used.
9391 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
9392 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
9393 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
9394 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
9395 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
9396 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
9397 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
9398 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
9399 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
9400 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
9401 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
9402 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
9403 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
9404 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
9405 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
9406 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
9407 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
9408 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
9409 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
9410 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
9411 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
9412 Remove, as these files are now generated automatically
9413 by bootstrap or automake.
9415 * po/ChangeLog: Remove: all but one entry was a duplicate
9416 of this file, and I moved that 2000-11-02 entry here.
9418 * config/.cvsignore: Add Makefile, depcomp, install-sh.
9419 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
9420 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
9421 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
9422 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
9423 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
9424 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
9425 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
9426 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
9427 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
9428 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
9430 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
9431 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
9432 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
9433 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
9434 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
9435 * src/.cvsignore: Remove *_.c.
9438 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
9439 support it. (The latest stable gzip doesn't.)
9441 2004-04-27 Paul Eggert <eggert@twinsun.com>
9443 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
9444 case, as stos_ is now used by destructors due to the 2004-02-09
9447 Remove more K&R C support.
9448 * lib/libiberty.y (PARAMS): Remove. All uses removed.
9449 * lib/subpipe.c (errno): Remove decl.
9450 Include <stdlib.h> unconditionally.
9451 (EXIT_FAILURE): Remove macro.
9452 * src/complain.c (vfprintf, strerror): Remove.
9453 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
9455 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
9456 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
9457 (strchr, strspn, memchr): Remove decls.
9458 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
9459 unconditionally. Do not declare perror.
9460 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
9463 * src/complain.c (_): Remove useless defn, as system.h defines this.
9465 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
9466 with latest obstack.h.
9467 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
9468 to procedure types, as obstack.h now does that for us.
9469 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
9471 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
9472 so that this include file can stand alone.
9473 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
9474 does this now. Include subpipe.h first after config.h, to
9475 test whether it can stand alone.
9477 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
9478 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
9481 * tests/synclines.at (%union synch line): Put a dummy member in
9482 the union, because empty unions aren't allowed in C. Caught
9485 2004-04-13 Jim Meyering <jim@meyering.net>
9487 * src/conflicts.c (conflicts_print): Correct format string typo:
9488 use `%%' to produce literal `%'. (trivial change)
9490 2004-03-30 Paul Eggert <eggert@twinsun.com>
9492 * src/getargs.c (version): Update copyright year to 2004.
9494 * data/c.m4 (b4_int_type): Use 'short int' rather than
9495 'short', and similarly for 'long', 'unsigned', etc.
9496 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
9497 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
9498 yy_yypstack, yydumpstack): Likewise.
9499 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
9500 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
9502 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
9503 yy_stack_print, yyparse): Likewise.
9504 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
9505 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
9506 * lib/bitset.c (bitset_print): Likewise.
9507 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
9508 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9509 * lib/bitsetv.c (bitsetv_dump): Likewise.
9510 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
9511 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
9513 * src/LR0.c (allocate_itemsets): Likewise.
9514 * src/gram.h (rule_number, rule): Likewise.
9515 * src/lalr.h (goto_number): Likewise.
9516 * src/nullable.c (nullable_compute): Likewise.
9517 * src/output.c (prepare_rules): Likewise.
9518 * src/relation.c (relation_print, relation_digraph): Likewise.
9519 * src/relation.h (relation_node): Likewise.
9520 * src/state.h (state_number, transitions, errs, reductions,
9521 struct state): Likewise.
9522 * src/symtab.h (symbol_number, struct symbol): Likewise.
9523 * src/tables.c (vector_number, tally, action_number,
9524 default_goto, goto_actions): Likewise.
9525 * tests/existing.at (GNU Cim Grammar): Likewise.
9526 * tests/regression.at (Web2c Actions): Likewise.
9528 * src/output.c (muscle_insert_short_int_table): Renamed from
9529 muscle_insert_short_table. All uses changed.
9531 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9533 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
9534 (declaration): Replace expected_conflicts with expected_sr_conflicts.
9535 Add %expect-rr rule.
9537 * src/scan-gram.l: Recognize %expect-rr.
9539 * src/conflicts.h (expected_sr_conflicts): Rename from
9541 (expected_rr_conflicts): Declare.
9543 * src/conflicts.c (expected_sr_conflicts): Rename from
9545 (expected_rr_conflicts): Define.
9546 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
9548 Use expected_sr_conflicts in place of expected_conflicts.
9549 Warn if expected_rr_conflicts used in non-GLR parser.
9551 * doc/bison.texinfo: Add documentation for %expect-rr.
9553 2004-03-08 Paul Eggert <eggert@gnu.org>
9555 Add support for hex token numbers. Suggested by Odd Arild Olsen in
9556 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
9558 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
9560 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
9561 * src/scan-gram.l (scan_integer): New function.
9563 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
9564 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
9565 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
9566 Say "long int", not "long", for uniformity with GNU style.
9568 2004-02-25 Paul Eggert <eggert@twinsun.com>
9570 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
9571 compilers. This fixes a problem with Intel's C++ compiler being
9572 chatty, reported by Guido Trentalancia in
9573 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
9575 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
9577 Support %destructor and merge error locations in lalr1.cc.
9579 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
9580 (Parser::stos_): Define unconditionally.
9581 (Parser::destruct_): New method. Generate its body with
9582 b4_yydestruct_generate.
9583 (Parser::error_start_): New attribute.
9584 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
9585 token which are discarded.
9586 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
9587 error_start_ when erroneous token are discarded.
9588 (Parser::parse) <yyerrlab1>: Compute the location of the error
9589 token so that it covers all the discarded tokens.
9590 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
9591 it can be called with `%skeleton "lalr1.cc"', and do that.
9593 2004-02-02 Paul Eggert <eggert@twinsun.com>
9595 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
9596 $(top_srcdir)/lib and ../lib. This fixes a bug reported
9597 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
9598 There's no need to mention top_builddir since Automake does that
9600 (INCLUDES): Remove, as Automake says it's obsolescent.
9601 Contents migrated into AM_CPPFLAGS as described above.
9602 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
9604 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9606 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
9607 (yyreportSyntaxError): Handle case where lookahead token is
9610 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9612 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
9613 resulting parsers are compilable with C++.
9615 2003-12-23 Paul Eggert <eggert@twinsun.com>
9617 * config/depcomp, config/install-sh: Sync with Automake 1.8.
9618 * src/output.c (output_skeleton): Rename local var.
9619 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
9620 Bison tokens, as this runs afoul of the 2003-10-07 change that
9621 disallowed NUL bytes in character constants or string literals.
9623 * tests/local.at: Require Autoconf 2.59's Autotest.
9624 * tests/testsuite.at: Don't include local.at, since we now assume
9625 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
9627 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
9628 multiple inclusion warnings.
9630 2003-12-02 Akim Demaille <akim@epita.fr>
9632 * doc/bison.texinfo (How Can I Reset the Parser): More about start
9636 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
9638 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
9640 2003-10-07 Paul Eggert <eggert@twinsun.com>
9642 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
9643 if testsuite doesn't exist.
9645 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
9646 literals, unfortunately.
9647 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
9648 Complain about NUL bytes in character constants or string literals.
9650 2003-10-05 Paul Eggert <eggert@twinsun.com>
9652 * NEWS: Don't document %no-default-prec, as it's still
9654 * doc/bison.texinfo: Document %no-default-prec only if
9655 the defaultprec flag is set. Normally it's not.
9657 2003-10-04 Paul Eggert <eggert@twinsun.com>
9659 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
9660 non-modifiable lvalue, instead of a modifiable one.
9661 * doc/bison.texinfo (Actions): Document that $$ can
9662 be assigned to. Do not claim that $$ and $N are
9663 array element references: user code should not rely on this.
9665 2003-10-01 Paul Eggert <eggert@twinsun.com>
9667 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
9668 (grammar_declaration): Use it.
9669 * src/scan-gram.l: New token %no-default-prec.
9670 * tests/conflicts.at: Revamp tests to use %no-default-prec.
9671 * NEWS, doc/bison.texinfo: Document the above.
9673 2003-10-01 Akim Demaille <akim@epita.fr>
9675 VCG no longer supports long_straight_phase.
9677 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
9678 * src/print_graph.c (print_graph): Adjust.
9680 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
9681 and Paul Eggert <eggert@twinsun.com>
9683 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
9684 Table of Symbols): Document %default-prec.
9685 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
9686 (grammar_declaration): Set default_prec on %default-prec.
9687 * src/scan-gram.l (%default-prec): New token.
9688 * src/reader.h (default_prec): New flag.
9689 * src/reader.c: Likewise.
9690 (packgram): Handle it.
9691 * tests/conflicts.at (%default-prec without %prec,
9692 %default-prec with %prec, %default-prec 1): New tests.
9694 2003-09-30 Paul Eggert <eggert@twinsun.com>
9696 * tests/testsuite.at: Include local.at, not input.at, fixing
9697 a typo in the 2003-08-25 patch.
9699 2003-08-27 Akim Demaille <akim@epita.fr>
9701 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
9704 2003-08-26 Akim Demaille <akim@epita.fr>
9706 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
9707 "<\#" to avoid magic from Gnus when posting parts of this script.
9709 2003-08-26 Akim Demaille <akim@epita.fr>
9711 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
9712 (Parser::parse): here.
9713 Adjust: nerrs and errstatus is now replaced by...
9714 (Parser::nerrs_, Parser::errstatus_): New.
9716 2003-08-25 Akim Demaille <akim@epita.fr>
9718 * config/announce-gen, Makefile.cfg: New.
9719 * Makefile.am: Adjust.
9720 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
9721 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
9723 2003-08-25 Akim Demaille <akim@epita.fr>
9725 When reducing initial empty rules, Bison parser read an initial
9726 location that is not defined. This results in garbage, and that
9727 affects Bison's own parser. Therefore we need (i) to extend Bison
9728 to support a means to initialize this location, and (ii) to use
9729 this CVS Bison to fix CVS Bison's parser.
9731 * src/reader.h, reader.c (epilogue_augment): Remove, replace
9733 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
9734 * src/parse-gram.y: Adjust.
9735 (%initial-action): New.
9736 (%error-verbose): Since we require CVS Bison, there is no reason
9738 * src/scan-gram.l: Adjust.
9739 * src/Makefile.am (YACC): New, to make sure we use our own parser.
9740 * data/yacc.c (yyparse): Use b4_initial_action.
9742 2003-08-25 Akim Demaille <akim@epita.fr>
9744 * doc/bison.texinfo: Don't promote stdout for error messages.
9746 2003-08-25 Akim Demaille <akim@epita.fr>
9748 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
9749 From Alexandre Duret-Lutz.
9751 2003-08-25 Akim Demaille <akim@epita.fr>
9755 2003-08-25 Akim Demaille <akim@epita.fr>
9757 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
9760 2003-08-25 Akim Demaille <akim@epita.fr>
9762 * data/lalr1.cc (Parser::reduce_print_): New.
9765 2003-08-25 Akim Demaille <akim@epita.fr>
9767 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
9768 error recovery loops. This patch is based on
9769 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
9770 Also, augment the similarity between lalr1.cc and yacc.c.
9771 Note: the locations of error recovery rules are not correct yet.
9773 * data/lalr1.cc: Comment changes to augment the similarity between
9774 lalr1.cc and yacc.c.
9775 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
9776 (yyerrlab1): Remove, but where it used to be (now the bottom part of
9777 yyerrlab), when hitting EOF, pop the whole stack here instead of
9778 merely falling thru the default error handling mechanism.
9779 (yyerrorlab): New label, with the old contents of YYERROR,
9780 plus the following change: pop the stack of rhs corresponding
9781 to the production that invoked YYERROR. That is how Yacc
9782 behaves (required by POSIX).
9783 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
9786 2003-08-25 Akim Demaille <akim@epita.fr>
9788 Tune local.at so that people can "autom4te -l autotest calc.at -o
9789 calc" for instance, to extract a sub test suite.
9791 * tests/testsuite.at: Move the initialization, Autotest version
9792 requirement, and AT_TESTED invocation into...
9793 * tests/local.at: here.
9794 * tests/testsuite.at: Include it for compatibility with Autoconf
9796 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
9799 2003-08-04 Paul Eggert <eggert@twinsun.com>
9801 Rework code slightly to avoid gcc -Wtraditional warnings.
9802 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
9803 The returned value is now stored in *YY0. All callers changed.
9804 * src/output.c (merge_output): Adjust to the above change.
9806 2003-07-26 Paul Eggert <eggert@twinsun.com>
9808 * data/glr.c (YYASSERT): New macro.
9809 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
9810 yyresolveStates, yyprocessOneStack):
9811 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
9812 Derived from a suggestion by Frank Heckenbach.
9814 2003-07-25 Paul Eggert <eggert@twinsun.com>
9816 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
9817 for portability to K&R C (after ansi2knr, presumably). See
9818 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
9819 by Frank Heckenbach, though I have omitted the structure-initialization
9820 part of his glr-knr.diff patch since I recall that the Portable
9821 C Compiler didn't require that change.
9823 Let the user specify how to allocate and free memory.
9824 Derived from a suggestion by Frank Heckenbach in
9825 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
9826 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
9827 All uses of free, malloc, realloc changed to use these macros,
9828 and unnecessary casts removed.
9829 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
9831 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
9833 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
9834 use s.empty() rather than s == "" to test for empty string; see
9835 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
9838 2003-06-25 Akim Demaille <akim@epita.fr>
9840 * config/depcomp, config/install-sh: Update from masters.
9842 2003-06-20 Paul Eggert <eggert@twinsun.com>
9844 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
9845 and return properly parenthesized result.
9846 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
9847 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
9848 Remove unnecessary parentheses from uses.
9849 * doc/bison.texinfo (Location Default Action): Describe the
9850 conventions for parentheses.
9852 2003-06-19 Paul Eggert <eggert@twinsun.com>
9854 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
9855 yyreportTree): Do not assume that size_t is the same width as int,
9856 when printing sizes. Print sizes using an unsigned format.
9857 Problem reported by Frank Heckenbach in
9858 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
9860 Port to Forte Developer 7 C compiler.
9861 * data/glr.c (struct YYLTYPE): If locations are not being used,
9862 declare a single dummy member, as empty structs do not conform
9864 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
9865 the Forte Developer 7 C compiler complains that end-of-loop
9866 code is not reached.
9868 2003-06-17 Paul Eggert <eggert@twinsun.com>
9870 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
9871 avoid warnings from picky compilers about redefinition of PARAMS.
9873 2003-06-17 Paul Eggert <eggert@twinsun.com>
9877 * NEWS: Document 1.875b.
9879 * lib/bbitset.h: Do not include config.h; that's the includer's job.
9880 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
9881 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
9882 Don't use 'index' in comments, as it's a builtin fn on some hosts.
9883 * lib/bitset_stats.c: Include gettext.h unconditionally, as
9884 per recent gettext manual's suggestion.
9885 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
9886 Use prototypes, not old-style definitions.
9887 * lib/lbitset.c (lbitset_unused_clear): Likewise.
9888 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
9889 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
9890 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
9891 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
9892 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
9893 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
9894 vbitset_or_and_cmp, vbitset_copy): Likewise.
9896 * lib/libiberty.h: Do not include config.h; that's the includer's job.
9897 Do not include <stdlib.h>.
9898 (PARAMS): Define unconditionally for C89.
9899 (ATTRIBUTE_NORETURN): Remove.
9900 (ATTRIBUTE_UNUSED): Define unconditionally.
9902 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
9903 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
9904 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
9905 * lib/vbitset.c, lib/vbitset.h: New files.
9906 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
9907 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
9910 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
9911 `How Can I Reset @code{yyparse}', since texinfo does not allow
9912 arbitrary @ in node names.
9914 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
9915 shouldn't be needed according to the gettext 0.12.1 documentation
9916 but which seem to be needed anyway: codeset.m4 glibc21.m4
9917 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
9918 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
9919 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
9921 * lib/.cvsignore: Add stdbool.h.
9922 * m4/.cvsignore: Add nls.m4, po.m4.
9924 Upgrade to CVS gnulib.
9925 * stdbool_.h: File renamed from stdbool.h.in.
9926 * configure.ac (AM_STDBOOL_H): Invoke this instead of
9928 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
9929 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
9930 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
9931 (MOSTLYCLEANFILES): New var.
9932 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
9933 (stdbool.h): New rule.
9934 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
9935 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
9936 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
9937 m4/quote.m4: Upgrade to today's gnulib.
9939 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
9940 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
9941 the tests right now.
9942 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
9943 yyerror are declared before use; C99 requires this.
9945 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9947 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
9949 (yyrecoverSyntaxError): Correct the logic for setting and testing
9951 Correct comment on handling EOF.
9952 Allow states with only a default reduction, rather than failing
9953 (I can't quite reconstruct why these were not allowed before).
9955 Fixes to avoid problem that $-N rules in GLR parsers can cause
9956 buffer overruns, corrupting state.
9958 * src/output.c (prepare_rules): Output max_left_semantic_context
9960 * src/reader.h (max_left_semantic_context): New variable declaration.
9961 * src/scan-gram.l (max_left_semantic_context): Define.
9962 (handle_action_dollar): Update max_left_semantic_context.
9963 * data/glr.c (YYMAXLEFT): New definition.
9964 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
9965 (yyresolveAction): Ditto.
9967 Fixes to problems with location handling in GLR parsers reported by
9968 Frank Heckenbach (2003/06/05).
9970 * data/glr.c (YYLTYPE): Make trivial if locations not used.
9971 (YYRHSLOC): Add parentheses, and define only if locations used.
9972 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
9974 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
9975 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
9977 * tests/cxx-type.at: Exercise location information; update tests
9978 to differentiate output with and without locations.
9979 Remove forward declarations of yylex and yyerror---caused errors
9980 because default YYLTYPE not yet defined.
9981 Change semantic actions to compute strings, rather than printing
9982 them directly (to test proper passing of semantics values). Change
9983 output to prefix notation and update test data and expected results.
9984 (yylex): Track locations.
9985 (stmtMerge): Return value rather than printing, and include arguments
9988 2003-06-03 Paul Eggert <eggert@twinsun.com>
9990 Avoid warnings generated by GCC 2.95.4 when Bison is
9991 configured with --enable-gcc-warnings.
9992 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
9993 yy::]b4_parser_class_name[::translate_,
9994 yy::Stack::operator[] (unsigned),
9995 yy::Stack::operator[] (unsigned) const,
9996 yy::Slice::operator[] (unsigned),
9997 yy::Slice::operator[] (unsigned) const):
9998 Rename local vars to avoid warnings.
9999 * tests/glr-regression.at (Improper handling of embedded actions
10000 and $-N in GLR parsers): Remove unused local variable from yylex.
10001 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
10002 (void) as arg when not pure, since we now assume C89 when building
10003 Bison. Pacify GCC by using parameter.
10005 2003-06-02 Paul Eggert <eggert@twinsun.com>
10007 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
10008 yy::Location::lines, yy::Location::columns): Rename arguments
10009 to avoid shadowing; this removes a warning generated by GCC 3.3.
10011 2003-06-01 Paul Eggert <eggert@twinsun.com>
10013 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
10014 to g++, as GCC 3.3 complains if you do it.
10015 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
10016 everything that WARNING_CFLAGS has, except omit warnings
10017 not suitable for C++.
10018 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
10019 * tests/atlocal.in (CXXFLAGS): New var.
10020 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
10022 Fix a GLR parser bug I reported in February; see
10023 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
10024 The problem was that GLR parsers did not conform to the C standard,
10025 because actions like { $1 = $2 + $3; } expanded to expressions
10026 that invoked YYFILL in separate subexpressions, and YYFILL assigned
10027 to a local variable. The C standard says that expressions
10028 like (var = f ()) + (var = f ()) have undefined behavior.
10029 Another problem was that GCC sometimes issues warnings that
10030 yyfill and its parameters are unused.
10032 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
10033 as possibly unused.
10034 (yyfill): New function.
10036 (yyuserAction): Change type of yynormal to bool, so that it matches
10037 the new yyfill signature. Mark it as possibly unused.
10040 Follow up on a bug I reported in February, where a Bison-generated
10041 parser can loop. Provide a test case and a fix for yacc.c. I
10042 don't have a fix for lalr1.cc or for glr.c, unfortunately.
10043 The original bug report is in:
10044 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
10046 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
10047 macro's size was becoming unwieldy.
10048 (yyerrlab): Do not discard an empty lookahead symbol, as this
10049 might destroy garbage.
10050 (yyerrorlab): New label, with the old contents of YYERROR,
10051 plus the following change: pop the stack of rhs corresponding
10052 to the production that invoked YYERROR. That is how Yacc
10053 behaves, and POSIX requires this behavior.
10054 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
10055 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
10056 Define 'alarm' to do nothing if unistd.h is not available.
10057 Add a new rule "exp: '-' error;" to test the above change to
10058 data/yacc.c. Use 'alarm' to abort any test taking longer than
10059 10 seconds, as it's probably looping.
10060 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
10061 Also, the new yacc.c generates two fewer diagnostics for an
10064 2003-05-24 Paul Eggert <eggert@twinsun.com>
10066 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
10067 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
10068 This fixes a problem reported by John Bowman when the Compaq/HP
10069 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
10070 -ansi -Wall -gall).
10071 * data/yacc.c (union yyalloc): Likewise.
10072 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
10074 Switch from 'int' to 'bool' where that makes sense.
10076 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
10077 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
10078 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
10079 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
10080 Return or accept bool, not int. All callers changed.
10081 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
10082 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
10083 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
10084 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
10085 bitset_or_and_cmp_): Likewise.
10086 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
10087 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
10088 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
10089 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
10090 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
10091 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
10092 bitset_stats_or_and_cmp): Likewise.
10093 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
10094 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
10095 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
10096 ebitset_xor_cmp): Likewise.
10097 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
10098 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
10099 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
10100 lbitset_xor_cmp): Likewise.
10101 * lib/bbitset.h: Include <stdbool.h>.
10102 (struct bitset_vtable): The following members now return bool, not
10103 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
10104 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
10106 * src/conflicts.c (count_rr_conflicts): Likewise.
10107 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
10109 * lib/ebitset.c (ebitset_obstack_init): Likewise.
10110 * lib/lbitset.c (lbitset_obstack_init): Likewise.
10111 * src/getargs.c (debug_flag, defines_flag, locations_flag,
10112 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10113 graph_flag): Likewise.
10114 * src/getargs.h (debug_flag, defines_flag, locations_flag,
10115 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10116 graph_flag): Likewise.
10117 * src/output.c (error_verbose): Likewise.
10118 * src/output.h (error_verbose): Likewise.
10119 * src/reader.c (start_flag, typed): Likewise.
10120 * src/reader.h (typed): Likewise.
10121 * src/getargs.c (LOCATIONS_OPTION): New constant.
10122 (long_options, getargs): Use it.
10123 * src/lalr.c (build_relations): Use bool, not int.
10124 * src/nullable.c (nullable_compute): Likewise.
10125 * src/print.c (print_reductions): Likewise.
10126 * src/tables.c (action_row, pack_vector): Likewise.
10127 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
10128 * src/output.c (prepare): Use it.
10129 * src/output.c (token_definitions_output,
10130 symbol_destructors_output, symbol_destructors_output): Use string,
10131 not boolean integer, to keep track of whether to output separator.
10132 * src/print_graph.c (print_core): Likewise.
10133 * src/state.c (state_rule_lookaheads_print): Likewise.
10135 * config/install-sh: Sync from automake 1.7.5.
10137 2003-05-14 Paul Eggert <eggert@twinsun.com>
10139 * src/parse-gram.y (rules_or_grammar_declaration): Require a
10140 semicolon after a grammar declaration, in the interest of possible
10141 future changes to the Bison input language.
10142 Do not allow a stray semicolon at the start of the grammar.
10143 (rhses.1): Allow one or more semicolons after any rule, including
10144 just before "|" as required by POSIX.
10145 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
10148 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
10150 %parse-param support for lalr1.cc.
10152 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
10153 b4_cc_constructor_calls, b4_cc_constructor_call,
10154 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
10156 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
10157 parse-param arguments.
10158 (yy::b4_parser_class_name): Declare instance variables to
10159 hold parse-param arguments.
10160 * tests/calc.at: s/value/semantic_value/ because value clashes
10161 with a member of yy::b4_parser_class_name. Adjust C++ code
10162 to handle %parse-param. Enable %parse-param test in C++.
10164 2003-05-12 Paul Eggert <eggert@twinsun.com>
10166 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
10167 English a bit. Fix fclose typo. Change "const char" to "char
10168 const", and use ANSI C rather than K&R for "main". Suggest
10169 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
10170 and suggest yy_switch_to_buffer.
10172 2003-05-05 Paul Eggert <eggert@twinsun.com>
10174 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
10175 C89. This avoids a diagnostic on compilers that define __STDC__
10176 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
10177 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
10179 2003-05-03 Paul Eggert <eggert@twinsun.com>
10181 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
10182 Do not overrun array bounds.
10183 This should fix a bug reported today by Olatunji Oluwabukunmi in
10184 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
10186 2003-04-29 Akim Demaille <akim@epita.fr>
10188 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
10189 * src/getargs.c, src/getargs.h: here, as bool, not int.
10190 (nondeterministic_parser): New.
10191 * src/parse-gram.y, src/scan-gram.l: Support
10192 %nondeterministic-parser.
10193 * src/output.c (prepare): Use nondeterministic_parser instead
10194 of glr_parser where appropriate.
10195 * src/tables.c (conflict_row, action_row, save_row)
10196 (token_actions, token_actions, pack_vector): Ditto.
10198 2003-04-29 Akim Demaille <akim@epita.fr>
10200 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
10202 2003-04-29 Akim Demaille <akim@epita.fr>
10204 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
10205 with %pure-parser and %locations to exercise the patch from Yakov
10208 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
10210 * data/yacc.c: (b4_lex_param): Corrected for the case where
10211 %lex-param is provided and %pure-parser isn't.
10213 2003-04-27 Paul Eggert <eggert@twinsun.com>
10215 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
10216 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
10217 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
10218 if it is not defined.
10219 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
10221 2003-04-26 Paul Eggert <eggert@twinsun.com>
10223 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
10224 Declare to be of type suitable for the ninf value itself, not of
10225 type suitable for the corresponding table, since the latter might
10226 be unsigned but the ninf value might be negative. This fixes a
10227 bug reported by Alexandre Duret-Lutz in
10228 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
10230 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
10231 invokes it. We shouldn't invoke it twice because it will attempt
10232 to put error.o in the archive twice. This fixes a glitch reported
10233 by Martin Mokrejs in
10234 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
10236 2003-04-21 Paul Eggert <eggert@twinsun.com>
10238 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
10241 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
10243 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
10244 Fix obvious typo that results in uncompilable GLR parsers
10245 when both %pure-parser and %locations are used. (trivial change)
10247 2003-04-17 Paul Eggert <eggert@twinsun.com>
10249 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
10250 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
10251 Do not insert the expected token via unput, as this runs afoul
10252 of a POSIX-compatibility bug in flex 2.5.31.
10253 All uses changed to BEGIN the parent state,
10254 since we no longer insert the expected token via unput.
10255 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
10256 that is no longer emitted after the above change.
10258 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
10259 the first one. This change is from Paul Hilfinger, and it fixes
10260 regression reported by Werner Lemberg in
10261 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
10263 (resolve_sr_conflict): Don't invoke state_errs_set
10264 unless one or more tokens have been explicitly made errors.
10265 Otherwise, the above change causes Bison to abort.
10267 * tests/existing.at (GNU pic Grammar): New test case, taken from
10270 2003-03-31 Akim Demaille <akim@epita.fr>
10272 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
10274 2003-03-31 Akim Demaille <akim@epita.fr>
10276 * src/output.c (prepare_symbols): Avoid trailing spaces in the
10279 2003-03-31 Akim Demaille <akim@epita.fr>
10281 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
10282 From Paul Hilfinger.
10284 2003-03-29 Akim Demaille <akim@epita.fr>
10286 * m4/error.m4: Do not put under dynamic conditions some code which
10287 expansion is under static control.
10289 2003-03-29 Akim Demaille <akim@epita.fr>
10291 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
10293 2003-03-29 Akim Demaille <akim@epita.fr>
10295 * doc/bison.texinfo (Strings are Destroyed): New.
10297 2003-03-13 Paul Eggert <eggert@twinsun.com>
10299 * .cvsignore: Add configure.lineno.
10300 * src/.cvsignore: Add yacc.
10301 * tests/.cvsignore: Add testsuite.log.
10302 * doc/fdl.texi: Sync with latest FSF version.
10304 2003-03-12 Paul Eggert <eggert@twinsun.com>
10306 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
10307 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
10308 cursor, instead of leaving it undefined. This fixes a bug
10309 reported by Tim Van Holder in
10310 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
10311 * tests/input.at (Torturing the Scanner): Test the scanner on
10312 an empty input file, which was Tim Van Holder's test case.
10314 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
10315 <sys/resource.h> can be included, include sys/time.h and
10316 sys/times.h first, if available. This works around the SunOS
10317 4.1.4 porting bug reported by Bruce Becker in
10318 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
10320 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
10321 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
10322 AC_HEADER_SYS_WAIT.
10324 Merge changes from gnulib. This was prompted because the CVS
10325 snapshot didn't build on Solaris 7 due to strnlen problems.
10327 These changes need to be merged back into gnulib:
10328 * lib/hash.c: Include <stdbool.h> unconditionally.
10329 * m4/onceonly.m4 (m4_quote): New macro.
10330 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
10331 Quote AC_FOREACH variable-expansions properly.
10332 The 2003-01-03 obstack.h change also needs merging.
10333 {end of changes requiring merging}
10335 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
10336 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
10337 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
10338 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
10339 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
10340 New files, imported from gnulib.
10341 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
10344 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
10345 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
10348 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
10350 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
10351 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
10352 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
10353 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
10354 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
10355 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
10356 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
10357 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
10358 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
10359 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
10360 (jm_PREREQ_ARGMATCH): Remove.
10361 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
10362 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
10364 * src/system.h: Include <stdbool.h> unconditionally.
10366 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
10367 assuming at least C89 in the bitset code for some time now.
10369 2003-03-03 Akim Demaille <akim@epita.fr>
10373 2003-03-02 Akim Demaille <akim@epita.fr>
10375 * doc/bison.texinfo (Table of Symbols): Reactivate the
10376 documentation for %lex-param, and %parse-param.
10378 2003-03-02 Akim Demaille <akim@epita.fr>
10380 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
10381 generate verbose error messages.
10382 Use the number of tokens as an upper bound in yytname, as it
10383 cannot be a non terminal.
10385 2003-03-02 Akim Demaille <akim@epita.fr>
10387 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
10390 2003-03-02 Akim Demaille <akim@epita.fr>
10392 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
10393 Use them to exercise yycheck overrun.
10394 Based on Andrew Suffield's grammar.
10396 2003-03-02 Akim Demaille <akim@epita.fr>
10398 Create tests/local.at for Bison generic testing macros.
10400 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
10401 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
10403 * tests/calc.at (AT_CHECK_CALC): Adjust.
10404 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
10405 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
10406 * tests/local.at: here.
10407 (AT_COMPILE_CXX): Tags the tests using it as c++.
10408 Ignore the test if CXX is not functional.
10410 2003-03-01 Paul Eggert <eggert@twinsun.com>
10412 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
10413 not loc->end, since loc->end might contain garbage and this leads
10414 to undefined behavior on some platforms.
10415 (id_loc, token_start): Use (IF_LINTed) initial values that do not
10416 depend on *loc, so that the reader doesn't give the the false
10417 impression that *loc is initialized.
10418 (<INITIAL>"%%"): Do not bother setting code_start, since its value
10419 does not survive the return.
10421 2003-03-01 Akim Demaille <akim@epita.fr>
10423 * src/scan-gram.l (code_start): Always initialize it when entering
10424 into yylex, as SC_EPILOGUE is activated *before* the corresponding
10425 yylex invocation. An alternative would be making it static, but
10426 then it starts with the second %%'s beginning, instead of its end.
10428 2003-02-28 Paul Eggert <eggert@twinsun.com>
10430 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
10431 around a UnixWare 7.1.1 porting bug reported by John Hughes in
10432 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
10434 2003-02-26 Paul Eggert <eggert@twinsun.com>
10436 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
10437 Remove Sequent/Pyramid discussion (nobody uses them any more).
10438 Merge VMS and MS-DOS discussion; these ports may well be dead
10439 but let's keep mentioning them for now. Put <> around email
10440 addresses. Add copyright notice.
10442 2003-02-24 Paul Eggert <eggert@twinsun.com>
10444 * data/glr.c (yy_reduce_print): yylineno -> yylno,
10445 to avoid collision with flex use of yylineno.
10446 Problem reported by Bruce Lilly in
10447 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
10448 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
10449 * data/yacc.c (yy_reduce_print): Likewise.
10451 * config/depcomp: Sync with Automake 1.7.3.
10453 2003-02-21 Akim Demaille <akim@epita.fr>
10455 * data/lalr1.cc: Use temporary variables instead of casts to
10456 change integer types.
10457 Suggested by Paul Eggert.
10459 2003-02-21 Akim Demaille <akim@epita.fr>
10461 * doc/bison.texinfo: Use "location" consistently to refer to @n,
10462 to avoid confusions with lalr1.cc's notion of Position.
10463 Suggested by Paul Eggert.
10465 2003-02-20 Akim Demaille <akim@epita.fr>
10467 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
10468 before initial_columns.
10469 (location.hh): Use consistent variable names when defining the
10471 Use "last" so that we subtract from Positions, not from unsigned.
10473 2003-02-20 Akim Demaille <akim@epita.fr>
10475 * data/lalr1.cc (position.hh): New subfile, including the extended
10476 and Doxygen'ed documentation of class Position.
10477 (location.hh): Use it.
10478 Document a` la Doxygen.
10479 With the help of Benoit Perrot.
10481 2003-02-20 Akim Demaille <akim@epita.fr>
10483 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
10485 Redefine AT_YYERROR_SEES_LOC_IF using it.
10486 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
10488 Don't use the location in yy::Parser::error_ and
10489 yy::Parser::print_ when not %locations.
10490 Activate more lalr1.cc tests.
10492 2003-02-19 Akim Demaille <akim@epita.fr>
10494 * data/lalr1.cc: When displaying a line number, be sure to make it
10497 2003-02-19 Akim Demaille <akim@epita.fr>
10499 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
10501 (YYABORT, YYACCEPT, YYERROR): New.
10502 * tests/calc.at: Renable the lalr1.cc test.
10504 2003-02-19 Akim Demaille <akim@epita.fr>
10506 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
10507 error recovery, mixing with/without pops and discarding of the
10510 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
10512 2003-02-17 Paul Eggert <eggert@twinsun.com>
10514 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
10515 * tests/testsuite.at (AT_COMPILE): Use them.
10516 This fixes the testsuite problem reported by Robert Lentz in
10517 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
10519 2003-02-12 Paul Eggert <eggert@twinsun.com>
10521 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
10522 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
10523 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
10524 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
10525 Check for malloc failure, for consistency with yacc.c.
10526 (yytname_size): Remove, for consistency with yacc.c.
10528 The bug still remains in data/lalr1.cc, as I didn't have time
10531 2003-02-06 Akim Demaille <akim@epita.fr>
10533 * configure.ac (GXX): Rename as...
10534 (CXX): this, to keep the original Autoconf semantics.
10536 * data/lalr1.cc: Fix b4_copyright invocations.
10537 If YYDEBUG is not defined, don't depend upon name_ being defined.
10538 (location.hh): Include string and iostream.
10539 (Position::filename): New member.
10540 (Position::Position ()): New.
10541 (operator<< (Position)): New.
10542 (operator- (Position, int)): New.
10543 (Location::first, Location::last): Rename as...
10544 (Location::begin, Location::end): these, to mock the conventional
10546 (operator<< (Location)): New.
10547 * tests/atlocal.in (CXX): New.
10548 * tests/testsuite.at (AT_COMPILE_CXX): New.
10549 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
10550 locations in a more synthetic way.
10551 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
10553 Adjust the C locations to match those from Emacs: first column is
10555 Change all the expected results.
10556 Conform to the GCS: simplify the locations when applicable.
10557 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
10558 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
10559 these CPP macros with the m4 macros new defined by...
10560 (AT_CHECK_PUSHDEFS): this, i.e.:
10561 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
10562 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
10564 (AT_CHECK_POPDEFS): Undefine them.
10565 (AT_CHECK_CALC_LALR1_CC): New.
10566 Use it for the first lalr1.cc test.
10568 2003-02-04 Akim Demaille <akim@epita.fr>
10570 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
10571 Location as is defined.
10573 2003-02-04 Akim Demaille <akim@epita.fr>
10575 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
10576 name_ being defined.
10578 2003-02-03 Paul Eggert <eggert@twinsun.com>
10580 * src/gram.h (start_symbol): Remove unused decl.
10582 Use more-consistent naming conventions for local vars.
10584 * src/derives.c (derives_compute): Change type of local var from
10585 int to rule_number.
10586 * src/gram.c (grammar_rules_partial_print): Likewise.
10587 * src/print.c (print_core): Likewise.
10588 * src/reduce.c (reduce_grammar_tables): Likewise.
10590 * src/gram.c (grammar_dump): Change name of item_number *
10591 local var from r to rp.
10592 * src/nullable.c (nullable_compute): Likewise.
10594 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
10596 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
10597 for symbol or symbol_number var.
10598 * src/reader.c (grammar_start_symbol_set): Likewise.
10599 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
10601 * src/state.c (transitions_to): Likewise.
10602 * src/state.h: Likewise.
10603 * src/tables.c (symbol_number_to_vector_number): Likewise.
10605 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
10608 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
10611 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
10614 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
10615 Use str, not s, for char * var. Use ch, not c, for character var.
10616 Use size for size var.
10618 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
10620 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
10622 * src/uniqstr.h: Likewise.
10624 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
10625 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
10626 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
10627 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
10628 param to have same name as that of enum, so that we don't use
10629 "s" to stand for a non-state.
10631 2003-02-02 Akim Demaille <akim@epita.fr>
10633 * src/scan-skel.l: Scan more than one inert character per yylex
10636 2003-02-01 Paul Eggert <eggert@twinsun.com>
10640 * po/LINGUAS: Add ms.
10642 2003-01-30 Akim Demaille <akim@epita.fr>
10644 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
10646 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10648 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
10651 Changes in response to error report by S. Eken: GLR mode does not
10652 handle negative $ indices or $ indices in embedded rules correctly.
10653 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
10655 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
10656 (b4_rhs_location): Ditto.
10657 (yyfill): New function to copy from stack tree into array
10659 (yyuserAction): Modify to allow incremental move of semantic values
10660 to rhs array when in GLR mode.
10661 Define YYFILL to use in user-defined actions to fill semantic array
10663 Remove dummy use of yystack, as there is now a guaranteed use.
10664 (yydoAction): Modify to allow incremental move of semantic values
10665 to rhs array when in GLR mode.
10666 (yyresolveAction): Ditto.
10667 (yyglrShiftDefer): Update comment.
10668 (yyresolveStates): Use X == NULL for pointers, not !X.
10669 (yyglrReduce): Ditto.
10670 (yydoAction): Ditto
10672 * tests/glr-regr1.at: Rename to ...
10673 * tests/glr-regression.at: Add new regression test for the problems
10674 described above (adapted from S. Eken).
10675 Update copyright notice.
10676 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
10677 * tests/Makefile.am: Ditto.
10679 2003-01-28 Paul Eggert <eggert@twinsun.com>
10681 * data/lalr1.cc: Do not use @output_header_name@ unless
10682 b4_defines_flag is set. This fixes two bugs reported by
10684 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
10685 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
10687 2003-01-21 Paul Eggert <eggert@twinsun.com>
10689 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
10690 we don't need to worry about yyerrlab1 being reported as an
10691 "unused label" by non-GCC C compilers. The downside is that if
10692 locations are used then a couple of statements are duplicated each
10693 time YYERROR is invoked, but the upside is that the warnings
10695 (yyerrlab1): Move code to YERROR.
10696 (yyerrlab2): Remove. Change uses back to yyerrlab1.
10697 This reverts some of the 2002-12-27 change.
10699 2003-01-17 Paul Eggert <eggert@twinsun.com>
10701 * src/output.c (symbol_printers_output): Fix typo that led
10702 to core dump. Problem reported by Antonio Rus in
10703 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
10705 2003-01-13 Akim Demaille <akim@epita.fr>,
10706 Quoc Peyrot <chojin@lrde.epita.fr>,
10707 Robert Anisko <anisko_r@lrde.epita.fr>
10709 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
10710 when the stacks contain one element, as the loop would otherwise
10711 free the last state, and then use the top state (the one we just
10712 popped). This means that the initial elements will not be freed
10713 explicitly, as is the case in yacc.c; it is not a problem, as
10714 these elements have fake values.
10716 2003-01-11 Paul Eggert <eggert@twinsun.com>
10718 * NEWS: %expect-violations are now just warnings, reverting
10719 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
10720 bootstrapping problem reported by Matthias Klose; see
10721 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
10722 * src/conflicts.c (conflicts_print): Likewise.
10723 * tests/conflicts.at (%expect not enough, %expect too much,
10724 %expect with reduce conflicts): Likewise.
10725 * doc/bison.texinfo (Expect Decl): Document this. Also mention
10726 that the warning is enabled if the number of conflicts changes
10727 (not necessarily increases).
10729 * src/getargs.c (version): Update copyright year.
10731 2003-01-09 Akim Demaille <akim@epita.fr>
10733 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
10735 2003-01-08 Paul Eggert <eggert@twinsun.com>
10737 * Makefile.maint (WGETFLAGS):
10738 New macro, containing "-C off" to disable proxy caches.
10739 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
10740 (rel-check): Use $(WGET) instead of wget.
10742 2003-01-06 Paul Eggert <eggert@twinsun.com>
10744 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
10745 the GLR paper of Scott, Johnstone and Hussain.
10747 2003-01-04 Paul Eggert <eggert@twinsun.com>
10749 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
10750 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
10751 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
10752 (EXTRA_LIBRARIES): New var, for liby.a.
10753 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
10754 (EXTRA_SCRIPTS): New var, for yacc.
10756 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
10757 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
10758 Problem reported by Nelson H. F. Beebe.
10760 2003-01-03 Paul Eggert <eggert@twinsun.com>
10762 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
10763 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
10764 when compiling Bison 1.875's `bitset bset = obstack_alloc
10765 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
10767 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
10768 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
10769 grow to a huge size with typical invocation.
10771 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
10772 Use the pattern recommended by Autoconf 2.57, except also protect
10773 against double-definition.
10774 * src/system.h: Likewise.
10775 Portability issues reported by Nelson H. F. Beebe.
10777 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
10778 All uses changed. Provide a definition in both C and C++.
10779 (yytrue, yyfalse): Define even if defined (__cplusplus).
10781 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
10782 Reported by Nelson H. F. Beebe.
10784 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
10786 2003-01-02 Paul Eggert <eggert@twinsun.com>
10788 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
10789 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
10790 Bug reported by Nelson H. F. Beebe.
10792 2003-01-01 Paul Eggert <eggert@twinsun.com>
10796 2002-12-30 Paul Eggert <eggert@twinsun.com>
10798 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
10800 (<INITIAL>","): Here. This causes stray "," to be treated
10803 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
10804 last brace in braced code when not in Yacc mode, for compatibility
10805 with Bison 1.35. This resurrects the 2001-12-15 patch to
10808 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
10809 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
10811 2002-12-28 Paul Eggert <eggert@twinsun.com>
10813 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
10814 that of SYM's type. This fixes Debian bug 168069, reported by
10817 2002-12-28 Paul Eggert <eggert@twinsun.com>
10821 Switch back to the Yacc style of conflict reports, undoing some
10822 of the 2002-07-30 change.
10823 * doc/bison.texinfo (Understanding): Use Yacc style for
10824 conflict reports. Also, use new way of locating rules.
10825 * src/conflicts.c (conflict_report):
10826 Renamed from conflict_report_yacc, removing the old
10827 'conflict_report'. Translate the entire conflict report at once,
10828 so that we don't assume that "," has the same interpretation in
10830 (conflicts_output): Use Yacc-style conflict report for each state,
10831 instead of our more-complicated style.
10832 (conflicts_print): Use Yacc-style conflict report, except print
10833 the input file name when not emulating Yacc.
10834 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
10835 Conflicted Reduction, %expect not enough, %expect too much,
10836 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
10837 * tests/existing.at (GNU Cim Grammar): Likewise.
10838 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
10840 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
10841 fatal): Don't invoke fflush; it's not needed and it might even be
10842 harmful for stdout, as stdout might not be open.
10843 * src/reduce.c (reduce_print): Likewise.
10845 2002-12-27 Paul Eggert <eggert@twinsun.com>
10847 Fix a bug where error locations were not being recorded correctly.
10848 This problem was originally reported by Paul Hilfinger in
10849 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
10851 * data/yacc.c (yyparse): New local var yylerrsp, to record the
10852 top of the location stack's error locations.
10853 (yyerrlab): Set it. When discarding a token, push its location
10854 onto yylerrsp so that we don't lose track of the error's end.
10855 (yyerrlab1): Now is only the target of YYERROR, so that we can
10856 properly record the location of the action that failed. For GCC
10857 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
10858 GCC warning about yyerrlab1 being unused if YYERROR is unused.
10859 (yyerrlab2): New label, which yyerrlab now falls through to.
10860 Compute the error's location by applying YYLLOC_DEFAULT to
10861 the locations of all the symbols that went into the error.
10862 * doc/bison.texinfo (Location Default Action): Mention that
10863 YYLLOC_DEFAULT is also invoked for syntax errors.
10864 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10865 Error locations include the locations of all the tokens that were
10866 discarded, not just the last token.
10868 2002-12-26 Paul Eggert <eggert@twinsun.com>
10870 * src/files.c: Include quote.h.
10871 (compute_output_file_names): Warn if we detect conflicting
10872 outputs to the same file. This should catch the misunderstanding
10873 exemplified by Debian Bug 165349, reported by Bruce Stephens..
10875 * src/conflicts.c (conflicts_print): If the user specifies
10876 "%expect N", report an error if there are any reduce/reduce
10877 conflicts. This is what the manual says should happen.
10878 This fixes Debian bug 130890, reported by Anthony DeRobertis.
10879 * tests/conflicts.at (%expect with reduce conflicts): New test.
10881 Don't use m4_include on relative file names, as it doesn't work as
10882 desired if there happens to be a file with that name under ".".
10884 * m4sugar/version.m4: Remove; it was included but it wasn't used.
10885 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
10886 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
10887 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
10888 * src/output.c (output_skeleton): Use full path names when
10889 specifying a file to include; don't rely on include path, as
10890 it's unreliable when the working file contains a file with
10893 2002-12-25 Paul Eggert <eggert@twinsun.com>
10895 Remove obsolete references to bison.simple and bison.hairy.
10896 Problem mentioned by Aubin Mahe in
10897 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
10898 * data/glr.c: Comment fix.
10899 * doc/bison.1: Remove references. Also, mention "yacc".
10901 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
10904 * src/parse-gram.y (declaration): Use enum "report_states" rather
10905 than its numeric value 1.
10907 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
10908 opening a new one. This fixes Debian bug 165349, reported by
10911 2002-12-24 Paul Eggert <eggert@twinsun.com>
10915 * Makefile.maint (cvs-update): Don't assume that the shell
10916 supports $(...), as Solaris sh doesn't.
10918 * src/parse-gram.y (lloc_default): Remove test for empty
10919 nonterminals at the end, since it didn't change the result.
10921 2002-12-24 Paul Eggert <eggert@twinsun.com>
10923 If the user does not define YYSTYPE as a macro, Bison now declares it
10924 using typedef instead of defining it as a macro. POSIX requires this.
10925 For consistency, YYLTYPE is also declared instead of defined.
10927 %union directives can now have a tag before the `{', e.g., the
10928 directive `%union foo {...}' now generates the C code
10929 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
10930 The default union tag is `YYSTYPE', for compatibility with Solaris 9
10931 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
10932 instead of `yyltype'.
10934 `yystype' and `yyltype' are now obsolescent macros instead of being
10935 typedefs or tags; they are no longer documented and will be
10936 withdrawn in a future release.
10938 * data/glr.c (b4_location_type): Remove.
10939 (YYSTYPE): Renamed from yystype.
10940 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
10941 (struct YYLTYPE): Renamed from struct yyltype.
10942 (YYLTYPE): Renamed from yyltype.
10943 (yyltype, yystype): New (and obsolescent) macros,
10944 for backward compatibility.
10945 * data/yacc.c: Likewise.
10947 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
10948 does not specify a union tag. This is for compatibility with
10951 * src/parse-gram.y (add_param): 2nd arg is now char * not char
10952 const *, since it is now modified by stripping surrounding { }.
10953 (current_braced_code): Remove.
10954 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
10955 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
10956 trailing " {...}". Now of type <chars>.
10957 (grammar_declaration): Adjust to bundled tokens.
10958 (code_content): Remove; stripping is now done by add_param.
10959 (print_token_value): Print contents of bundled tokens.
10960 (token_name): New function.
10962 * src/reader.h (braced_code, current_braced_code): Remove.
10963 (token_name): New decl.
10965 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
10966 token_type, not braced_code code_kind. All uses changed.
10967 (SC_PRE_CODE): New state, for scanning after a keyword that
10968 has (or usually has) an immediately-following braced code.
10969 (token_type): New local var, to keep track of which token type
10970 to return when scanning braced code.
10971 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
10972 <INITIAL>"%parse-param", <INITIAL>"%printer",
10973 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
10974 instead of returning a token type immediately.
10975 (<INITIAL>"{"): Set token type.
10976 (<SC_BRACED_CODE>"}"): Use it.
10977 (handle_action_dollar, handle_action_at): Now returns bool
10978 indicating success. Fail if ! current_rule; this prevents a core dump.
10979 (handle_symbol_code_dollar, handle_symbol_code_at):
10980 Remove; merge body into caller.
10981 (handle_dollar, handle_at): Complain in invalid contexts.
10983 * NEWS, doc/bison.texinfo: Document the above.
10984 * NEWS: Fix years and program names in copyright notice.
10986 2002-12-17 Paul Eggert <eggert@twinsun.com>
10988 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
10989 Reporting, Table of Symbols): Omit mentions of %lex-param and
10990 %parse-param from the documentation for now.
10992 2002-12-15 Paul Eggert <eggert@twinsun.com>
10994 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
10995 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
10996 lookahead symbol, and which sets yychar in parser actions) and it
10997 disagreed with the Bison documentation. Bug
10998 reported by Andrew Walrond.
11000 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
11001 as the caller now does that.
11002 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
11003 (YYEMPTY): Parenthesize right hand side, since others use it.
11004 (yyparse): Don't assume that our generated code is the only code
11007 2002-12-13 Paul Eggert <eggert@twinsun.com>
11011 POSIX requires a "yacc" command.
11012 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
11013 (MOSTLYCLEANFILES): Add yacc.
11015 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
11016 as an alias for bison y.
11018 * po/LINGUAS: Add da.
11020 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
11021 problem with latest <getopt.h>.
11022 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
11024 * doc/fdl.texi: Upgrade to 1.2.
11025 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
11026 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
11027 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
11029 * config/install-sh: Sync with autotools.
11031 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
11032 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
11033 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
11034 locations are requested.
11035 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
11036 locations are requested.
11038 2002-12-12 Paul Eggert <eggert@twinsun.com>
11040 Remove unportable casts and storage allocation tricks.
11041 While we're at it, remove almost all casts, since they
11042 usually aren't needed and are a sign of trouble.
11044 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
11046 * src/derives.c (derives_compute): Do not subtract NTOKENS from
11047 the pointer DSET returned by malloc; this isn't portable.
11048 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
11049 Similarly for DERIVES.
11050 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
11051 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
11052 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
11054 * src/derives.c (derives_compute): Do not bother invoking
11055 int_of_rule_number, since rule numbers are integers.
11057 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
11058 rather than XMALLOC (char, N).
11060 * src/files.c (filename_split): Rewrite to avoid cast.
11062 * src/gram.h (symbol_number_as_item_number,
11063 item_number_as_symbol_number, rule_number_as_item_number,
11064 item_number_as_rule_number):
11065 Now inline functions rather than macros, to avoid casts.
11066 * src/state.h (state_number_as_int): Likewise.
11067 * src/tables.c (state_number_to_vector_number,
11068 symbol_number_to_vector_number): Likewise.
11070 * src/gram.h (int_of_rule_number): Remove; no longer used.
11072 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
11073 since the resulting storage is always stored into.
11075 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
11078 * src/muscle_tab.c (muscle_m4_output):
11079 Now inline. Return bool, not int.
11080 * src/state.c (state_compare): Likewise.
11081 * src/symtab.c (symbol_check_defined,
11082 symbol_check_alias_consistency, symbol_pack, symbol_translation,
11083 hash_compare_symbol, hash_symbol):
11085 * src/uniqstr.c (uniqstr_print): Likewise.
11086 * src/muscle_tab.c (muscle_m4_output_processor):
11087 New function, to avoid casts.
11088 * src/state.c (state_comparator, stage_hasher): Likewise.
11089 * src/symtab.c (symbol_check_defined_processor,
11090 symbol_check_alias_consistency_processor, symbol_pack_processor,
11091 symbol_translation_processor, hash_symbol_comparator,
11092 hash_symbol_hasher): Likewise.
11093 * src/uniqstr.c (uniqstr_print_processor): Likewise.
11094 * src/muscle_tab.c (muscles_m4_output):
11095 Use new functions instead of casting old functions unportably.
11096 * src/state.c (state_hash_new): Likewise.
11097 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
11098 symbols_token_translations_init):
11100 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
11102 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
11103 var instead of casting to long, to avoid casts.
11104 (prepare_states): Use MALLOC rather than alloca, so that we don't
11105 have to worry about alloca.
11106 * src/state.c (state_hash_lookup): Likewise.
11108 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
11109 local var instead of casting to unsigned char, to avoid casts.
11111 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
11112 STATE_ALLOC): Remove.
11113 (transitions_new, errs_new, reductions_new, state_new): Use malloc
11114 rather than calloc, and use offsetof to avoid allocating slightly
11116 (state_new): Initialize all members.
11118 * src/state.c (state_hash): Use unsigned accumulator, not signed.
11120 * src/symtab.c (symbol_free): Remove; unused.
11121 (symbol_get): Remove cast in lhs of assignment.
11122 (symbols_do): Now static. Accept generic arguments, not
11123 hashing-related ones.
11125 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
11126 (symbol_processor): Remove.
11127 (symbols_do): Remove decl; now static.
11129 * src/system.h (alloca): Remove; decl no longer needed.
11130 (<stddef.h>): Include, for offsetof.
11131 (<inttypes.>, <stdint.h>): Include if available.
11132 (uintptr_t): New type, if system lacks it.
11133 (CALLOC, MALLOC, REALLOC): New macros.
11134 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
11137 * src/tables.c (table_size): Now int, to pacify GCC.
11138 (table_grow, table_ninf_remap): Use signed table size.
11139 (save_row): Don't bother initializing locals when not needed.
11140 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
11141 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
11143 * src/vcg.h: Correct misspellings.
11145 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
11148 * src/getargs.c (getargs): Don't assume EOF == -1.
11150 2002-12-09 Paul Eggert <eggert@twinsun.com>
11152 Change identifier spellings to avoid collisions with names
11153 that are reserved by POSIX.
11155 Don't use names ending in _t, since POSIX reserves them.
11156 For consistency, remove _e and _s endings -- they're weren't
11157 needed to remove ambiguity. All uses changed.
11158 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
11159 turn was just renamed from struniq_t.
11160 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
11161 which in turn was just renamed from struniq_processor_t.
11162 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
11163 in turn was renamed from hash_compare_struniq_t.
11164 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
11165 (state_list): Renamed from state_list_t.
11166 * src/assoc.h (assoc): Renamed from assoc_t.
11167 * src/conflicts.c (enum conflict_resolution): Renamed from
11168 enum conflict_resolution_e.
11169 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
11170 (rule_list): Renamed from rule_list_t.
11171 * src/getargs.h (enum trace): Renamed from enum trace_e.
11172 (enum report): Renamed from enum report_e.
11173 * src/gram.h (item_number): Renamed from item_number_t.
11174 (rule_number): Renamed from rule_number_t.
11175 (struct rule_s): Remove the "rule_s" part; not used.
11176 (rule): Renamed from rule_t.
11177 (rule_filter): Renamed from rule_filter_t.
11178 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
11179 (goto_list): Renamed from goto_list_t.
11180 * src/lalr.h (goto_number): Renamed from goto_number_t.
11181 * src/location.h (location): Renamed from location_t.
11182 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
11183 and moved here from:
11184 * src/muscle_tab.h (muscle_entry_t): here.
11185 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
11186 (rule_list): Renamed from rule_list_t.
11187 * src/print_graph.c (static_graph): Renamed from graph.
11188 * src/reader.h (braced_code): Renamed from braced_code_t.
11189 Remove brace_code_e tag.
11190 * src/relation.h (relation_node): Renamed from relation_node_t.
11191 (relation_nodes): Renamed from relation_nodes_t.
11192 (relation): Renamed from relation_t.
11193 * src/state.h (state_number): Renamed from state_number_t.
11194 (struct state): Renamed from struct state_s.
11195 (state): Renamed from state_t.
11196 (transitions): Renamed from transitions_t. Unused (and
11197 misspelled) transtion_s tag removed.
11198 (errs): Renamed from errs_t. Unused errs_s tag removed.
11199 (reductions): Renamed from reductions_t. Unused tag
11200 reductions_s removed.
11201 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
11202 (struct symbol_list): Renamed from struct symbol_list_s.
11203 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
11204 (struct symbol): Renamed from struct symbol_s.
11205 (symbol): Renamed from symbol_t.
11206 * src/tables.c (vector_number): Renamed from vector_number_t.
11207 (action_number): Renamed from action_t.
11208 * src/tables.h (base_number): Renamed from base_t.
11209 * src/vcg.h (enum color): Renamed from enum color_e.
11210 (enum textmode): Renamed from enum textmode_e.
11211 (enum shape): Renamed from enum shape_e.
11212 (struct colorentry): Renamed from struct colorentry_s.
11213 (struct classname): Renamed from struct classname_s.
11214 (struct infoname): Renamed from struct infoname_s.
11215 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
11216 (enum decision): Renamed from enum decision_e.
11217 (enum orientation): Renamed from enum orientation_e.
11218 (enum alignment): Renamed from enum alignment_e.
11219 (enum arrow_mode): Renamed from enum arrow_mode_e.
11220 (enum crossing_type): Renamed from enum crossing_type_e.
11221 (enum view): Renamed from enum view_e.
11222 (struct node): Renamed from struct node_s.
11223 (node): Renamed from node_t.
11224 (enum linestyle): Renamed from enum linestyle_e.
11225 (enum arrowstyle): Renamed from enum arrowstyle_e.
11226 (struct edge): Renamed from struct edge.
11227 (edge): Renamed from edge_t.
11228 (struct graph): Renamed from struct graph_s.
11229 (graph): Renamed from graph_t.
11230 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
11231 Rename value_t -> value.
11232 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
11233 value_t_as_yystype -> value_as_yystype.
11235 Don't include <errno.h> in the mainstream code, since it
11236 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
11237 * lib/get-errno.c, lib/get-errno.h: New files.
11238 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
11240 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
11241 * src/output.c (output_skeleton): Likewise.
11242 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
11244 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
11246 (handle_action_dollar, handle_action_at): Likewise.
11247 * src/system.h: Do not include <errno.h>.
11248 (TAB_EXT): Renamed from EXT_TAB.
11249 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
11251 Avoid str[a-z]*, since <string.h> reserves that name space.
11252 Change all instances of "struniq" in names to "uniqstr", and
11253 likewise for "STRUNIQ" and "UNIQSTR".
11254 * src/uniqstr.c: Renamed from src/struniq.c.
11255 * src/uniqstr.h: Renamed from src/struniq.h.
11256 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
11257 * src/files.c (strsuffix): Remove; unused.
11258 (concat2): Renamed from stringappend. Now static.
11259 * src/files.h (strsuffix, stringappend): Remove; unused.
11260 * src/parse-gram.y (<chars>): Renamed from <string>.
11261 (<uniqstr>): Renamed from <struniq>.
11262 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
11263 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
11264 (struct graph_s.expand): Renamed from struct graph_s.stretch.
11265 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
11266 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
11267 (N_EXPAND): Renamed from N_STRETCH.
11269 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
11270 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
11271 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
11273 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
11274 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
11275 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
11276 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
11277 (BASE_MAXIMUM): Renamed from BASE_MAX.
11278 (BASE_MINIMUM): Renamed from BASE_MIN.
11279 (ACTION_MAX): Remove; unused.
11280 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
11281 Unnecessary casts removed from above defines.
11284 Fix misspelling in names.
11285 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
11286 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
11290 * lib/timevar.c (timevar_report): Renamed from time_report,
11291 for consistency with other names.
11292 * lib/timevar.h (timevar_report): New decl.
11293 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
11296 Sort include-file uses.
11298 Reorder all include files under src to be in the order "system.h".
11299 then the ../lib include files in angle brackets (alphabetized),
11300 then the . include files in double-quotes (alphabetized). Fix
11301 dependency breakages encountered in this process, as follows:
11302 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
11303 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
11304 * src/state.h: Include "symtab.h".
11306 2002-12-08 Paul Eggert <eggert@twinsun.com>
11308 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
11309 since this causes problems when __file__ contains character
11310 sequences like "@" that are treated specially by src/scan-skel.l.
11311 Instead, just use the file's basename. This fixes the bug
11312 reported by Martin Mokrejs in
11313 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
11315 2002-12-06 Paul Eggert <eggert@twinsun.com>
11317 Add support for rules that do not have trailing semicolons, as
11318 POSIX requires. Improve the quality of locations in Bison
11321 * src/location.c: Include <quotearg.h>.
11322 (empty_location): Now const.
11323 (location_print): New function. Follow the recommendation of the
11324 GNU Coding Standards for locations that span file boundaries.
11325 * src/location.h: Do not include <quotearg.h>; no longer needed.
11326 (boundary): New type.
11327 (location_t): Use it. This allows locations to span file boundaries.
11328 All member uses changed: file -> start.file or end.file (as needed),
11329 first_line -> start.line, first_column -> start.column,
11330 last_line -> end.line, last_column -> end.column.
11331 (equal_boundaries): New function.
11332 (LOCATION_RESET, LOCATION_STEP): Remove.
11333 (LOCATION_PRINT): Remove. All callers changed to use location_print.
11334 (empty_location): Now const.
11335 (location_print): New decl.
11336 * src/parse-gram.y (lloc_default): New function, which handles
11337 empty locations more accurately.
11338 (YYLLOC_DEFAULT): Use it.
11339 (%token COLON): Remove.
11340 (%token ID_COLON): New token.
11342 (declarations, rules): Remove trailing semicolon.
11343 (declaration, rules_or_grammar_declaration):
11344 Allow empty (";") declaration.
11345 (symbol_def): Remove empty actions; no longer needed.
11346 (rules_or_grammar_declaration): Remove trailing semicolon.
11347 (semi_colon.opt): Remove.
11348 * src/reader.h: Include location.h.
11349 (scanner_cursor): New decl.
11350 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
11352 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
11354 (STEP): Remove. No longer needed, now that adjust_location does
11355 the work. All uses removed.
11356 (scanner_cursor): New var.
11357 (adjust_location): Renamed from extend_location. It now sets
11358 *loc and adjusts the scanner cursor. All uses changed.
11359 Don't bother testing for CR.
11360 (handle_syncline): Remove location arg; now updates scanner cursor.
11361 All callers changed.
11362 (unexpected_end_of_file): Now accepts start boundary of token or
11363 comment, not location. All callers changed. Update scanner cursor,
11365 (SC_AFTER_IDENTIFIER): New state.
11366 (context_state): Renamed from c_context. All uses changed.
11367 (id_loc, code_start, token_start): New local vars.
11368 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
11369 processing of Yacc white space and equivalents here.
11370 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
11371 instead of returning ID immediately, since we need to search for
11372 a subsequent colon.
11373 (<INITIAL>"'", "\""): Save token_start.
11374 (<INITIAL>"%{", "{", "%%"): Save code_start.
11375 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
11376 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
11377 BEGIN context_state at end, not INITIAL.
11378 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
11379 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
11380 Return correct token start.
11381 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
11382 the start of a character, string or multiline comment is found.
11383 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
11384 Reduction): Adjust reported locations to match the more-precise
11385 results now expected.
11386 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
11387 * tests/reduce.at (Useless Rules, Reduced Automaton,
11388 Underivable Rules): Likewise.
11389 * tests/regression.at (Invalid inputs): No longer `expecting ";"
11390 or "|"' now that so many other tokens are allowed by the new grammar.
11392 * src/complain.h (current_file): Remove duplicate decl;
11393 current_file is now owned by files.h.
11394 * src/complain.c, src/scan-gram.l: Include files.h.
11396 2002-12-06 Paul Eggert <eggert@twinsun.com>
11398 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
11399 promotes to int; it might be unsigned int.
11400 * data/yacc.c (yy_reduce_print): Likewise.
11402 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
11403 be #defined in the prologue, not in the Bison declarations.
11404 This fixes Debian Bug 102878, reported by Shaul Karl.
11406 2002-12-02 Paul Eggert <eggert@twinsun.com>
11408 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
11409 * lib/strtoul.c: New file, from gnulib.
11410 This fixes a porting bug reported by Peter Klein in
11411 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
11413 2002-11-30 Paul Eggert <eggert@twinsun.com>
11415 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
11416 and put only a forward declaration in the prologue. This is for
11417 consistency with the other scanner helper functions.
11419 Type clashes now generate warnings, not errors, since it
11420 appears that POSIX may allow some grammars with type clashes.
11421 * src/reader.c (grammar_current_rule_check): Warn about
11422 type clashes instead of complaining.
11423 * tests/input.at (Type Clashes): Expect warnings, not complaints.
11425 Add Yacc library, since POSIX requires it.
11426 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
11427 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
11428 * lib/main.c, lib/yyerror.c: New files.
11430 gram_error can be static; it need not be extern.
11431 * src/reader.h (gram_error): Remove decl.
11432 * src/parse-gram.y (gram_error): Now static. Add static decl.
11433 (print_token_value): Omit parameter names from forward decl,
11436 2002-11-29 Paul Eggert <eggert@twinsun.com>
11438 * doc/bison.texinfo: Emphasize that yylex and yyerror must
11439 be declared before being used. E.g., one should typically
11440 declare them in the prologue. Use GNU coding style in examples.
11441 Put "const" consistently after the type it modifies. Mention
11442 that C99 supports "inline". Mention that yyerror traditionally
11445 %parse-param and %lex-param now take just one argument, the
11446 declaration; the argument name is deduced from the declaration.
11448 * doc/bison.texinfo (Parser Function, Pure Calling, Error
11449 Reporting, Table of Symbols): Document this.
11450 * src/parse-gram.y (add_param): New function.
11452 (declaration): Implement new rule for %parse-param and %lex-param.
11453 * src/scan-gram.l: "," now elicits a warning, rather than being
11454 a token; this is more compatible with byacc.
11455 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
11457 2002-11-27 Paul Eggert <eggert@twinsun.com>
11459 Rename identifiers to avoid real and potential collisions.
11461 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
11462 to avoid collision with lex macro described by Bruce Lilly in
11463 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
11464 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
11465 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
11466 * src/parse-gram.y (print_token_value): Renamed from yyprint.
11468 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
11469 The name "yycontrol" violates the name space rules, and this stuff
11470 wasn't being used anyway.
11471 (input): Remove action; this stuff wasn't being used.
11472 (gram_error): Rename local variable yylloc -> loc.
11473 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
11474 (YY_DECL): Don't use "yy" at start of local variables.
11475 All uses changed, e.g., yylloc -> loc.
11476 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
11477 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
11478 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
11479 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
11481 * src/parse-gram.y (gram_error): loc is now const *.
11482 * src/reader.h (gram_error): Likewise.
11484 2002-11-24 Paul Eggert <eggert@twinsun.com>
11488 * tests/actions.at (Actions after errors): Use an output format
11489 more similar to that of the Printers and Destructors test.
11490 Test the position of the ';' token too.
11491 (Printers and Destructors): Likewise.
11492 (Printers and Destructors: %glr-parser): Remove for now, to avoid
11493 unnecessarily alarming people when the test fails.
11495 * data/yacc.c (yyerrlab1): Move this label down, so that the
11496 parser does not discard the lookahead token if the user code
11497 invokes YYERROR. This change is required for POSIX conformance.
11499 * lib/error.c: Sync with gnulib.
11501 2002-11-22 Paul Eggert <eggert@twinsun.com>
11503 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
11504 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
11505 * lib/xmalloc.c: Likewise.
11507 2002-11-20 Paul Eggert <eggert@twinsun.com>
11509 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
11511 2002-11-20 Paul Eggert <eggert@twinsun.com>
11513 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
11514 should use `if (! x) abort ();' rather than `assert (x);', and
11515 anyway it's one less thing to worry about configuring.
11517 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
11518 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
11519 and replace all instances of assert with abort.
11520 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
11521 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
11523 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
11524 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
11525 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
11526 hash_find_entry, hash_rehash, hash_insert): Likewise.
11527 * src/conflicts.c (resolve_sr_conflict): Likewise.
11528 * src/lalr.c (set_goto_map, map_goto): Likewise.
11529 * src/nullable.c (nullable_compute): Likewise.
11530 * src/output.c (prepare_rules, token_definitions_output): Likewise.
11531 * src/reader.c (packgram, reader): Likewise.
11532 * src/state.c (state_new, state_free, state_transitions_set,
11533 state_reduction_find): Likewise.
11534 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
11535 symbol_pack): Likewise.
11536 * src/tables.c (conflict_row, pack_vector): Likewise.
11537 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
11538 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
11539 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
11540 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
11542 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
11543 (ARGMATCH_CONSTRAINT): New macro.
11544 (ARGMATCH_ASSERT): Use it.
11546 * src/system.h (verify): New macro.
11547 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
11548 rather than assert.
11549 * src/tables.c (tables_generate): Likewise.
11551 * src/struniq.c (struniq_assert): Now returns void, and aborts
11552 if the assertion is false.
11553 (struniq_assert_p): Remove.
11554 * src/struniq.h: Likewise.
11556 2002-11-18 Paul Eggert <eggert@twinsun.com>
11558 * data/glr.c (yygetLRActions): Replace `yyindex' with
11559 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
11560 This fixes the regression with Sun ONE Studio 7 cc that I reported in
11561 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
11563 2002-11-18 Akim Demaille <akim@epita.fr>
11565 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
11567 From Tim Van Holder.
11569 2002-11-17 Paul Eggert <eggert@twinsun.com>
11571 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
11572 to "SyntaxError" for consistency with my 2002-11-15 change.
11574 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
11575 not define to {}, since this breaks the common use of `YYDPRINTF
11576 ((...));' if a single statement is desired (e.g. before `else').
11577 Work around GCC warnings by surrounding corresponding calls with
11579 (yyhasResolvedValue): Remove unused function.
11580 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
11582 (yyreportSyntaxError): Renamed from yyreportParseError.
11583 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
11585 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
11586 extern when possible. Remove unused initializations.
11588 2002-11-16 Akim Demaille <akim@epita.fr>
11590 Augment the similarity between GLR and LALR traces.
11592 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
11593 (YY_REDUCE_PRINT): New.
11594 (yyparse): Use them.
11595 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
11597 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
11598 state reached after the reduction/recovery, since...
11599 (yyparse, yyprocessOneStack): Report the state we are entering in.
11601 2002-11-16 Akim Demaille <akim@epita.fr>
11603 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
11604 Add support for --trace=skeleton.
11605 * src/scan-skel.l: %option debug.
11606 Scan strings of non-@ or \n instead of character by character.
11607 (scan_skel): Handle trace_skeleton.
11609 (@output_parser_name@, @output_header_name@): ``Restore'' their
11610 support (used to be M4 macros).
11611 * data/yacc.c: Quote larger chunks, a la glr.c.
11612 * data/lalr1.cc: Likewise.
11613 The header guards are no longer available, so use some other
11614 string than `YYLSP_NEEDED'.
11616 2002-11-16 Akim Demaille <akim@epita.fr>
11618 Make the ``Printers and Destructors'' test more verbose, taking
11619 `yacc.c''s behavior as (possibly wrong) reference.
11621 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
11622 instead of fprint on stdout.
11623 Set and report the last_line of the symbols.
11624 Consistently display values and locations.
11626 2002-11-16 Paul Eggert <eggert@twinsun.com>
11628 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
11630 2002-11-15 Paul Eggert <eggert@twinsun.com>
11632 * tests/actions.at (Actions after errors): New test case.
11634 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
11635 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
11636 tests/action.at, tests/calc.at, tests/conflicts.at,
11637 tests/cxx-type.at, tests/regression.at:
11638 "parse error" -> "syntax error" for POSIX compatibility.
11639 "parsing stack overflow..." -> "parser stack overflow" so
11640 that code matches Bison documentation.
11642 2002-11-15 Akim Demaille <akim@epita.fr>
11644 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
11645 take two BRACED_CODE, not two string_content.
11646 Free the scanner's obstack when we are done.
11647 (code_content): New.
11648 * tests/calc.at: Adjust.
11649 * doc/bison.texinfo: Adjust.
11650 Also, make sure to include the `,' for these declarations.
11652 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
11654 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
11655 definition; avoids potential autoreconf problems.
11657 2002-11-15 Akim Demaille <akim@epita.fr>
11659 Always check the value returned by yyparse.
11661 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
11662 returned by yyparse.
11663 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
11665 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
11666 returned by yyparse.
11668 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11670 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
11673 2002-11-14 Paul Eggert <eggert@twinsun.com>
11675 * src/output.c (output_skeleton): Call xfopen instead of
11676 duplicating xfopen's body.
11678 Fix bugs reported by Nelson H. F. Beebe in
11679 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
11681 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
11682 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
11683 Group compiler. Instead, use "$CC -E bar.c". Include the .h
11684 file twice in the grammar, as an extra check.
11686 * tests/input.at (Torturing the Scanner): Surround the
11687 backslash-newline tests with "#if 0", to make it less likely that
11688 we'll run into compiler bugs. Bring back solitary \ inside
11689 comment, but add a closing comment to work around HP C bug. Don't
11690 test backslash-newline in C character constant.
11692 2002-11-14 Akim Demaille <akim@epita.fr>
11694 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
11695 status of the compiler.
11696 Calling `exit 1' is no longer needed.
11697 Reported by Nelson H. F. Beebe.
11699 2002-11-14 Akim Demaille <akim@epita.fr>
11701 * tests/atlocal.in (CPPFLAGS): We have config.h.
11702 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
11704 * tests/actions.at, tests/calc.at, tests/conflicts.at,
11705 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
11706 * tests/regression.at, tests/torture.at: Use them for all the
11707 grammars that are to be compiled.
11708 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
11709 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
11710 * doc/bison.texinfo (GLR Parsers): Document `inline'.
11712 2002-11-14 Akim Demaille <akim@epita.fr>
11714 * doc/bison.texinfo: Various formatting changes (alignments in
11715 samples, additional @group/@end group, GCS in samples.
11716 Use @deffn instead of simple @table to define the directives,
11717 macros, variables etc.
11719 2002-11-13 Paul Eggert <eggert@twinsun.com>
11721 Fix some bugs reported by Albert Chin-A-Young in
11722 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
11724 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
11725 -o c"; the HP C compiler chatters during compilation.
11726 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
11727 * tests/headers.at (export YYLTYPE): Likewise.
11729 * tests/input.at (Torturing the Scanner): Remove lines containing
11730 solitary backslashes, as they tickle a bug in the HP C compiler.
11732 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
11733 comments, since they're not portable. Use GNU coding style.
11735 2002-11-13 Akim Demaille <akim@epita.fr>
11737 * data/yacc.c: Leave bigger chunks of quoted text.
11738 (YYDSYMPRINTF): New.
11739 Use it to report symbol activities.
11740 * data/glr.c (YYDSYMPRINTF): New.
11743 2002-11-12 Paul Eggert <eggert@twinsun.com>
11747 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
11748 (yyglrReduce): Return yyok, not 0.
11749 This should avoid the enumerated-type warnings reported
11750 by Nelson H. F. Beebe in
11751 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
11753 * lib/bbitset.h (BITSET_INLINE): Remove.
11754 * lib/bitset.h [! BITSET_INLINE]: Remove.
11755 (bitset_set, bitset_reset, bitset_test): Rename local vars
11756 to avoid shadowing warnings by GCC.
11758 * data/glr.c (inline): Remove #define. It's the user's
11759 responsibility to #define it away, just like 'const'.
11760 This fixes one of the bugs reported by Nelson H. F. Beebe in
11761 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
11763 * Makefile.maint (po-check): Scan .l and .y files instead of the
11764 .c and the .h files that they generate. This fixes the bug
11765 reported by Tim Van Holder in:
11766 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
11767 Look for N_ as well as for _. Try to avoid matching #define for
11769 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
11770 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
11771 * src/scan-gram.l: Revamp regular expressions so that " and '
11772 do not confuse xgettext.
11774 * src/struniq.h (struniq_new): Do not declare the return type
11775 to be 'const'; this violates the C standard.
11776 * src/struniq.c (struniq_new): Likewise.
11778 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
11780 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
11781 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
11784 2002-11-12 Akim Demaille <akim@epita.fr>
11786 * Makefile.maint: Sync with Autoconf:
11787 (local_updates): New.
11789 2002-11-12 Akim Demaille <akim@epita.fr>
11791 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
11793 2002-11-12 Akim Demaille <akim@epita.fr>
11795 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
11798 2002-11-12 Akim Demaille <akim@epita.fr>
11800 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
11803 2002-11-12 Akim Demaille <akim@epita.fr>
11805 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
11806 Use it to test the GLR parser.
11808 2002-11-12 Akim Demaille <akim@epita.fr>
11810 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
11812 * data/glr.c (yystos): New.
11813 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
11814 (YYDSYMPRINT): New.
11815 (yyval): Don't define it, it is handled via M4.
11816 (yyrecoverParseError): Free verbosely the discarded symbols.
11817 * data/yacc.c (yysymprint): Remove, rather...
11818 (b4_yysymprint_generate): invoke.
11819 * data/c.m4 (b4_yysymprint_generate): New.
11820 Accept pointers as arguments, as opposed to the version from
11822 (b4_yydestruct_generate): Likewise.
11823 * tests/cations.at (Printers and Destructors): Use Bison directives
11824 instead of CPP macros.
11825 Don't rely on internal details.
11827 2002-11-12 Akim Demaille <akim@epita.fr>
11829 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
11830 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
11831 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
11832 it against YYEMPTY and so forth), work on yytoken (i.e., set
11833 it to YYEMPTY etc.).
11834 (yydestruct): Replace with a b4_yydestruct_generate invocation.
11835 (b4_symbol_actions): Remove.
11836 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
11837 for 0, end-of-input.
11839 2002-11-12 Akim Demaille <akim@epita.fr>
11841 * doc/bison.texinfo (Destructor Decl): New.
11843 2002-11-12 Akim Demaille <akim@epita.fr>
11845 * src/tables.c (tables_generate): Use free for pointers that
11846 cannot be NULL, not XFREE.
11847 (pack_vector): Use assert, not fatal, for bound violations.
11848 * src/state.c (state_new): Likewise.
11849 * src/reader.c (reader): Likewise.
11850 * src/lalr.c (set_goto_map): Likewise.
11851 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
11854 2002-11-12 Akim Demaille <akim@epita.fr>
11856 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
11858 * src/scan-gram.l (last_string): Is global to the file, not to
11860 * src/parse-gram.y (input): Don't append the epilogue here,
11861 (epilogue.opt): do it here, and free the scanner's obstack.
11862 * src/reader.c (epilogue_set): Rename as...
11863 (epilogue_augment): this.
11864 * data/c.m4 (b4_epilogue): Defaults to empty.
11866 2002-11-12 Akim Demaille <akim@epita.fr>
11868 * src/getargs.c (long_options): Remove duplicates.
11869 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
11871 * doc/bison.rnh: Remove.
11872 * doc/bison.texinfo (VMS Invocation): Remove.
11874 2002-11-12 Akim Demaille <akim@epita.fr>
11876 * src/struniq.h, src/struniq.c (struniq_t): Is const.
11877 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
11879 Use struniq for symbols.
11881 * src/symtab.h (symbol_t): The tag member is a struniq.
11882 (symbol_type_set): Adjust.
11883 * src/symtab.c (symbol_new): Takes a struniq.
11884 (symbol_free): Don't free the tag member.
11885 (hash_compare_symbol_t, hash_symbol_t): Rename as...
11886 (hash_compare_symbol, hash_symbol): these.
11887 Use the fact that tags as struniqs.
11888 (symbol_get): Use struniq_new.
11889 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
11891 * src/reader.h (merger_list, grammar_currentmerge_set): The name
11892 and type members are struniqs.
11893 * src/reader.c (get_merge_function)
11894 (grammar_current_rule_merge_set): Adjust.
11895 (TYPE, current_type): Are struniq.
11897 Use struniq for file names.
11899 * src/files.h, src/files.c (infile): Split into...
11900 (grammar_file, current_file): these.
11901 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
11902 * src/reduce.c (reduce_print): Likewise.
11903 * src/getargs.c (getargs): Likewise.
11904 * src/complain.h, src/complain.c: Likewise.
11905 * src/main.c (main): Call struniqs_new early enough to use it for
11907 Don't free the input file name.
11909 2002-11-12 Akim Demaille <akim@epita.fr>
11911 * src/symtab.c (symbol_free): Remove dead deactivated code:
11912 type_name are properly removed.
11913 Don't use XFREE to free items that cannot be NULL.
11914 * src/struniq.h, src/struniq.c: New.
11915 * src/main.c (main): Initialize/free struniqs.
11916 * src/parse-gram.y (%union): Add astruniq member.
11918 * src/scan-gram.l (<{tag}>): Return a struniq.
11919 Free the obstack bit that used to store it.
11920 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
11922 2002-11-11 Paul Eggert <eggert@twinsun.com>
11924 Revamp to fix many (but not all) of the C- and M4-related quoting
11925 problems. Among other things, this fixes the Bison bug reported
11926 by Jan Hubicka when processing the Bash grammar; see:
11927 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
11929 Use new @ escapes consistently. Represent brackets with @{ and @}
11930 rather than @<:@ and @:>@, since this works a bit better with dumb
11931 editors like vi. Represent @ with @@, since @ is now consistently
11932 an escape. Use @oline@ and @ofile@ rather than __oline__ and
11933 __ofile__, to avoid unexpected expansions. Similarly, use @output
11934 rather than #output.
11936 * data/c.m4 (b4_copyright): Omit file name from comment, since
11937 the file name could contain "*/".
11938 (b4_synclines_flag): Don't quote the 2nd argument; it should already
11939 be quoted. All uses changed.
11941 * data/glr.c: Use new @ escapes consistently.
11942 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
11943 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
11944 Remove, since they couldn't handle arbitrary characters in file
11946 * data/lalr1.cc: Likewise.
11947 * data/yacc.c: Likewise.
11949 * src/files.c (output_infix): Remove; all uses removed.
11950 * src/files.h: Likewise.
11952 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
11953 mishandled funny characters in file names, and anyway it isn't
11955 * data/yacc.c: Likewise.
11956 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
11958 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
11959 * data/yacc.c: Likewise.
11961 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
11963 (muscle_init): Quote filename as a C string.
11964 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
11965 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
11966 * src/output.c (escaped_file_name_output): New function.
11967 (prepare_symbols): Quote tokens for M4.
11968 (prepare): Don't insert output_infix, output_prefix,
11969 output_parser_name, output_header_name; this is now down by scan-skel.
11970 Insert skeleton as a C string.
11972 * src/output.c (user_actions_output, symbol_destructors_output,
11973 symbol_printers_output): Quote filenames for C and M4.
11974 * src/reader.c (prologue_augment, epilogue_set): Likewise.
11976 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
11977 escapes other than \\ and \'; this simplifies the code.
11978 (<SC_STRING>): Likewise, for \\ and \".
11979 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
11980 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
11981 Use new escapes @{ and @} for [ and ].
11983 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
11984 them with auto vars.
11985 Switch to new escape scheme, where @ is the escape character uniformly.
11986 Abort if a stray escape character is found. Avoid unbounded input
11987 buffer when parsing non-escaped text.
11989 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
11990 __oline__, #output, $@, and @{ do not have unintended meanings.
11992 2002-11-09 Paul Eggert <eggert@twinsun.com>
11994 Fix the test failure due to GCC warnings described in
11995 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
11996 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
11997 evaluate to 0 if it's impossible for NINF to be in the respective
11999 (yygetLRActions, yyrecoverParseError): Use them.
12001 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
12002 counted in the token inserted at end of file. Now takes
12003 location_t *, not location_t, so that the location can be
12004 adjusted. All uses changed.
12006 * tests/regression.at (Invalid inputs): Adjust wording in
12007 diagnostic to match the new behavior.
12009 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
12010 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
12011 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
12012 abort ();'. This reduces the runtime of the "Many lookaheads"
12013 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
12016 2002-11-07 Paul Eggert <eggert@twinsun.com>
12018 * src/parse-gram.y (CHARACTER): Remove unused token.
12021 * src/scan-gram.l: Remove stack option. We no longer use the
12022 stack, since the stack was never deeper than 1; instead, use the
12023 new auto var c_context to record the stacked value.
12025 Remove nounput option. At an unexpected end of file, we now unput
12026 the minimal input necessary to end cleanly; this simplifies the
12029 Avoid unbounded token sizes where this is easy.
12031 (unexpected_end_of_file): New function.
12032 Use it to systematize the error message on unexpected EOF.
12033 (last-string): Now auto, not static.
12034 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
12035 (scanner_last_string_free): Remove; not used.
12036 (percent_percent_count): Move decl to just before use.
12037 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
12038 not the (never otherwised-used) CHARACTER.
12040 2002-11-07 Akim Demaille <akim@epita.fr>
12042 Let yyerror always receive the msg as last argument, so that
12043 yyerror can be variadic.
12045 * data/yacc.c (b4_yyerror_args): New.
12046 Use it when calling yyerror.
12047 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
12048 Use it when calling yyerror.
12049 * doc/bison.texinfo (Error Reporting): Adjust.
12050 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
12051 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
12053 2002-11-06 Akim Demaille <akim@epita.fr>
12055 #line should have quoted strings.
12056 Ideally, this should be done by m4_quotearg.
12058 * src/scan-skel.l: Include quotearg.h.
12060 * src/output.c (symbol_printers_output)
12061 (symbol_destructors_output): Quote the file name.
12063 2002-11-06 Akim Demaille <akim@epita.fr>
12065 * tests/regression.at (Invalid inputs): Adjust to the recent
12068 2002-11-06 Akim Demaille <akim@epita.fr>
12070 Restore --no-lines.
12071 Reported by Jim Kent.
12073 * data/c.m4 (b4_syncline): New.
12074 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
12075 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
12076 * src/output.c (user_actions_output): Likewise.
12077 (prepare): Define 'b4_synclines_flag'.
12078 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
12080 2002-11-06 Akim Demaille <akim@epita.fr>
12082 * src/main.c (main): Free `infile'.
12083 * src/scan-gram.l (handle_syncline): New.
12085 * src/output.c (user_actions_output, symbol_destructors_output)
12086 (symbol_printers_output): Use the location's file name, not
12088 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12090 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12092 * src/tables.c (matching_state): Don't allow states to match if
12093 either has GLR conflict entries.
12095 2002-11-05 Paul Eggert <eggert@twinsun.com>
12097 * src/scan-gram.l: Use more accurate diagnostics, e.g.
12098 "integer out of range" rather than "invalid value".
12099 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
12102 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
12103 Also, remove one static variable in the scanner.
12105 * src/scan-gram.l (braces_level): Now auto, not static.
12106 Initialize to zero if the compiler is being picky.
12107 (INITIAL): Clear braces_level instead of incrementing it.
12108 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
12109 as POSIX 1003.1-2001 requires.
12110 * src/system.h (IF_LINT): New macro, taken from coreutils.
12111 * configure.ac: Define "lint" if --enable-gcc-warnings.
12113 2002-11-05 Akim Demaille <akim@epita.fr>
12115 * src/scan-gram.l: When it starts with `%', complain about the
12116 whole directive, not just that `invalid character: %'.
12118 2002-11-04 Akim Demaille <akim@epita.fr>
12120 * Makefile.maint: Update from Autoconf.
12121 (update, cvs-update, po-update, do-po-update): New.
12123 2002-11-04 Akim Demaille <akim@epita.fr>
12125 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
12127 Have yyerror `use' its arguments.
12128 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
12129 returns true when location & yacc & pure & parse-param.
12130 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
12132 2002-11-04 Akim Demaille <akim@epita.fr>
12134 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
12136 * src/scan-gram.l: Use [\'] instead of ['] to pacify
12139 Use quote, not quote_n since LOCATION_PRINT no longer uses the
12142 2002-11-03 Paul Eggert <eggert@twinsun.com>
12144 * src/reader.c (get_merge_function, grammar_current_rule_check):
12145 Use consistent diagnostics for reporting type name clashes.
12146 Quote the types with <>, for consistency with Yacc.
12147 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
12149 2002-11-03 Akim Demaille <akim@epita.fr>
12151 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
12153 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
12154 (b4_parse_param): Remove.
12155 Use b4_identification.
12156 Propagate b4_pure_args where needed to pass them to yyerror.
12157 * data/glr.m4 (b4_parse_param): Remove.
12158 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
12159 (b4_lpure_formals): New.
12160 Use b4_identification.
12161 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
12162 b4_user_formals and b4_user_args.
12163 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
12164 (yyreportAmbiguity): When using a pure parser, also need
12165 the location, and the parse-params.
12167 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
12168 When using a pure parser, also need the parse-params.
12170 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
12171 (%pure-parser + %parse-param) LALR and GLR parsers.
12172 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
12173 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
12174 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
12175 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
12176 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
12177 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
12178 * doc/bison.texinfo: Untabify the whole file.
12179 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
12180 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
12181 (Error Reporting): Adjust to these new directives.
12182 Document %error-verbose, deprecate YYERROR_VERBOSE.
12184 2002-11-03 Akim Demaille <akim@epita.fr>
12186 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
12187 AT_CHECK_CALC_GLR invocations to use % directives, instead of
12188 command line options.
12189 * tests/cxx-type.at: Formatting changes.
12191 2002-11-03 Paul Eggert <eggert@twinsun.com>
12193 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
12194 to count columns correctly, and to check for invalid inputs.
12196 Use mbsnwidth to count columns correctly. Account for tabs, too.
12197 Include mbswidth.h.
12198 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
12199 (extend_location): New function.
12200 (YY_LINES): Remove.
12202 Handle CRLF in C code rather than in Lex code.
12203 (YY_INPUT): New macro.
12204 (no_cr_read): New function.
12206 Scan UCNs, even though we don't fully handle them yet.
12207 (convert_ucn_to_byte): New function.
12209 Handle backslash-newline correctly in C code.
12210 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
12211 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
12213 (tag, splice): New EREs. Do not allow NUL or newline in tags.
12214 Use {splice} wherever C allows backslash-newline.
12215 YY_STEP after space, newline, vertical-tab.
12216 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
12218 (letter, id): Don't assume ASCII; e.g., spell out a-z.
12220 ({int}, handle_action_dollar, handle_action_at): Check for integer
12223 (YY_STEP): Omit trailing semicolon, so that it's more like C.
12225 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
12226 as well as \000. Check for UCHAR_MAX, not 255.
12227 Allow \x with an arbitrary positive number of digits, as in C.
12228 Check for overflow here.
12229 Allow \? and UCNs, for compatibility with C.
12231 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
12232 with quote slot used by complain_at.
12234 * tests/input.at: Add tests for backslash-newline, m4 quotes
12235 in symbols, long literals, and funny escapes in strings.
12237 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
12238 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
12239 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
12240 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
12241 * m4/mbswidth.m4: New file, from GNU coreutils.
12243 * doc/bison.texinfo (Grammar Outline): Document // comments.
12244 (Symbols): Document that trigraphs have no special meaning in Bison,
12245 nor is backslash-newline allowed.
12246 (Actions): Document that trigraphs have no special meaning.
12248 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
12251 2002-11-02 Paul Eggert <eggert@twinsun.com>
12253 * src/reader.c: Don't include quote.h; not needed.
12254 (get_merge_function): Reword warning to be consistent with
12255 type clash diagnostic in grammar_current_rule_check.
12257 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
12258 bug in trigraph handling.
12260 * src/output.c (prepare_symbols): When printing token names,
12261 escape "[" as "@<:@" and likewise for "]".
12263 * src/system.h (errno): Remove declaration, as we are now
12264 assuming C89 or better, and C89 guarantees errno.
12266 2002-10-30 Paul Eggert <eggert@twinsun.com>
12268 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
12269 Check for close failures.
12270 * src/files.h (xfclose): Return void, not int, since it always
12272 * src/files.c (xfclose): Likewise. Report I/O error if ferror
12274 * src/output.c (output_skeleton): Use xfclose rather than fclose
12275 and ferror. xfclose now checks ferror.
12277 * data/glr.c (YYLEFTMOST_STATE): Remove.
12278 (yyreportTree): Use a stack-based leftmost state. This avoids
12279 our continuing battles with bogus warnings about initializers.
12281 2002-10-30 Akim Demaille <akim@epita.fr>
12283 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
12286 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12288 * tests/glr-regr1.at: New test for reported regressions.
12289 * tests/testsuite.at: Add glr-regr1.at test.
12290 * tests/Makefile.am: Add glr-regr1.at test.
12292 2002-10-24 Paul Eggert <eggert@twinsun.com>
12296 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
12297 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
12298 we use malloc. Don't assume 'A' through 'Z' are contiguous.
12299 Don't assume strdup exists; POSIX says its an XSI extension.
12300 Check for buffer overflow on input.
12302 2002-10-24 Akim Demaille <akim@epita.fr>
12304 * src/output.c (output_skeleton): Don't disable M4sugar comments
12305 too soon: it results in comments being expanded.
12306 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
12309 2002-10-24 Akim Demaille <akim@epita.fr>
12311 * data/yacc.c (m4_int_type): New.
12312 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
12313 char' as only yacc.c wants K&R portability.
12314 * data/glr.c (yysigned_char): Remove.
12315 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
12316 Reported by Quoc Peyrot.
12318 2002-10-23 Paul Eggert <eggert@twinsun.com>
12320 * src/main.c (main): With --trace=time, report times even if a
12321 non-fatal error occurs. Formerly, the times were reported in some
12322 such cases but not in others.
12323 * src/reader.c (reader): Just return if a complaint has been issued,
12324 instead of exiting, so that 'main' can report times.
12326 2002-10-22 Akim Demaille <akim@epita.fr>
12328 * src/system.h: Include sys/types.
12329 Reported by Bert Deknuydt.
12331 2002-10-23 Paul Eggert <eggert@twinsun.com>
12333 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
12334 Suggested by Art Haas.
12336 2002-10-22 Paul Eggert <eggert@twinsun.com>
12338 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
12339 decl; not needed any more.
12340 * src/main.c (main): Use return to exit, undoing yesterday's change.
12341 The last OS that we could find where this wouldn't work is
12342 SunOS 3.5, and that's too old to worry about now.
12344 * data/glr.c (struct yyltype): Define members even when not
12345 doing locations. This is more consistent with yacc.c, and it
12346 works around the following bug reports:
12347 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
12348 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
12350 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
12351 @acronym consistently. Standardize on "Yacc" instead of "YACC",
12352 "Algol" instead of "ALGOL". Give a bit more history about BNF.
12354 2002-10-22 Akim Demaille <akim@epita.fr>
12356 * data/README: New.
12358 2002-10-21 Paul Eggert <eggert@twinsun.com>
12360 Be consistent about 'bool'; the old code used an enum in one
12361 module and an int in another, and this violates the C standard.
12362 * m4/stdbool.m4: New file, from coreutils 4.5.3.
12363 * configure.ac (AC_HEADER_STDBOOL): Add.
12364 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
12365 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
12366 * src/symtab.c (hash_compare_symbol_t): Likewise.
12367 * src/system.h (bool, false, true): Use a definition consistent
12368 with ../lib/hash.c. All uses changed.
12370 * src/complain.c (warning_issued): Renamed from warn_message_count,
12371 so that we needn't worry about integer overflow (!).
12372 Now of type bool. All uses changed.
12373 (complaint_issued): Renamed from complain_message_count; likewise.
12375 * src/main.c (main): Use exit to exit with failure.
12377 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
12378 rather than 1 and 0.
12379 * src/main.c (main): Likewise.
12380 * src/getargs.c (getargs): Likewise.
12381 * src/reader.c (reader): Likewise.
12383 * src/getarg.c (getargs): Remove duplicate code for
12384 "Try `bison --help'".
12386 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
12387 What was that "2" for?
12389 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
12390 * src/getargs.c (usage): Likewise.
12392 * src/getargs.c (getargs): When there are too few operands, report
12393 the last one. When there are too many, report the first extra
12394 one. This is how diffutils does it.
12396 2002-10-20 Paul Eggert <eggert@twinsun.com>
12398 Remove K&R vestiges.
12399 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
12400 * src/complain.c (VA_START): Remove. Assume prototypes.
12401 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
12402 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
12403 fatal): Assume prototypes.
12404 * src/complain.h: Assume prototypes.
12405 * src/system.h (PARAMS): Remove.
12406 Include <limits.h> unconditionally, since it's guaranteeed even
12407 for a freestanding C89 compiler.
12408 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
12409 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
12411 2002-10-20 Akim Demaille <akim@epita.fr>
12413 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
12414 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
12415 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
12416 (yyresolveStates, yyresolveAction, yyresolveStack)
12417 (yyprocessOneStack): Use them.
12418 (yy_reduce_print): New.
12419 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
12421 2002-10-20 Akim Demaille <akim@epita.fr>
12423 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
12424 arguments and output `void'.
12425 (b4_c_function): Rename as...
12426 (b4_c_function_def): this.
12427 (b4_c_function_decl, b4_c_ansi_function_def)
12428 (b4_c_ansi_function_decl): New.
12429 Change the interpretation of the arguments: before `int, foo', now
12431 * data/yacc.c (yyparse): Prototype and define thanks to these.
12432 Adjust b4_c_function_def uses.
12433 * data/glr.c (yyparse): Likewise, but ANSI only.
12435 2002-10-20 Akim Demaille <akim@epita.fr>
12437 * src/output.c (prepare): Move the definition of `tokens_number',
12438 `nterms_number', `undef_token_number', `user_token_number_max'
12440 (prepare_tokens): Here.
12441 (prepare_tokens): Rename as...
12442 (prepare_symbols): this.
12443 (prepare): Move the definition of `rules_number' to...
12444 (prepare_rules): here.
12445 (prepare): Move the definition of `last', `final_state_number',
12446 `states_number' to...
12447 (prepare_states): here.
12448 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
12450 2002-10-20 Akim Demaille <akim@epita.fr>
12452 * src/tables.h, src/tables.c, src/output.c: Comment changes.
12454 2002-10-20 Akim Demaille <akim@epita.fr>
12456 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
12459 2002-10-20 Akim Demaille <akim@epita.fr>
12461 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
12462 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
12464 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
12466 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
12467 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
12470 2002-10-19 Paul Eggert <eggert@twinsun.com>
12472 Do not create a temporary file, as that involves security and
12473 cleanup headaches. Instead, use a pair of pipes.
12474 Derived from a suggestion by Florian Krohm.
12475 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
12476 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
12477 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
12478 (BISON_PREREQ_SUBPIPE): Add.
12479 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
12480 Add subpipe.h, subpipe.c.
12481 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
12482 * po/POTFILES.in: Add lib/subpipe.c.
12483 * src/output.c: Include "subpipe.h".
12484 (m4_invoke): Remove decl.
12485 (scan_skel): New decl.
12486 (output_skeleton): Use pipe rather than temporary file for m4 input.
12487 Check that m4sugar.m4 is readable, to avoid deadlock.
12488 Check for pipe I/O error.
12489 * src/scan-skel.l (readpipe): Remove decl.
12490 (scan_skel): New function, to be used in place of m4_invoke.
12491 Read from stream rather than file.
12493 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
12494 float, as this generates a warning on Solaris 8 + GCC 3.2 with
12495 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
12496 this generates a more-accurate value anyway.
12498 * lib/timevar.c (timervar_accumulate): Rename locals to
12499 avoid confusion with similarly-named more-global.
12500 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
12502 * src/output.c (prepare): Use xstrdup to convert char const *
12503 to char *, to avoid GCC warning.
12505 2002-10-19 Akim Demaille <akim@epita.fr>
12507 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
12508 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
12509 Use them to have `calc.y' ready for %pure-parser.
12510 * data/yacc.c (YYLEX): Pass a yylex return type to
12511 b4_c_function_call.
12513 2002-10-19 Akim Demaille <akim@epita.fr>
12515 Prototype support of %lex-param and %parse-param.
12517 * src/parse-gram.y: Add the definition of the %lex-param and
12518 %parse-param tokens, plus their rules.
12519 Drop the `_' version of %glr-parser.
12521 * src/scan-gram.l (INITIAL): Scan them.
12522 * src/muscle_tab.c: Comment changes.
12523 (muscle_insert, muscle_find): Rename `pair' as `probe'.
12524 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
12525 (muscle_entry_s): The `value' member is no longer const.
12526 Adjust all dependencies.
12527 * src/muscle_tab.c (muscle_init): Adjust: use
12528 MUSCLE_INSERT_STRING.
12529 Initialize the obstack earlier.
12530 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
12531 (muscle_pair_list_grow): New.
12532 * data/c.m4 (b4_c_function_call, b4_c_args): New.
12533 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
12534 * tests/calc.at: Use %locations, not --locations.
12535 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
12537 2002-10-19 Akim Demaille <akim@epita.fr>
12539 * src/getargs.c (usage): Take status as argument and exit
12541 Report the traditional `Try ... --help' message when status != 0.
12542 (usage, version): Don't take a FILE * as arg, it is pointless.
12543 (getargs): When there is an incorrect number of arguments, make it
12544 an error, and report it GNUlically thanks to `usage ()'.
12546 2002-10-18 Paul Eggert <eggert@twinsun.com>
12548 * data/glr.c (yyreportParseError): Don't assume that sprintf
12549 yields the length of the printed string, as this is not true
12550 on SunOS 4.1.4. Reported by Peter Klein.
12552 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
12553 * tests/conflicts.at (%nonassoc and eof): Likewise.
12554 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
12556 2002-10-17 Akim Demaille <akim@epita.fr>
12558 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
12559 * src/getargs.c (trace_types, trace_args): Adjust.
12560 * src/reader.c (grammar_current_rule_prec_set)
12561 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
12562 Standardize error messages.
12563 And s/@prec/%prec/!
12564 (reader): Use trace_flag to enable scanner/parser debugging,
12565 instead of an adhoc scheme.
12566 * src/scan-gram.l: Remove trailing debugging code.
12568 2002-10-16 Paul Eggert <eggert@twinsun.com>
12570 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
12573 * NEWS: Officially drop support for building Bison with K&R C,
12574 since it didn't work anyway and it's not worth worrying about.
12575 * Makefile.maint (wget_files): Remove ansi2knr.c.
12576 (ansi2knr.c-url_prefix): Remove.
12577 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
12578 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
12579 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
12581 2002-10-15 Paul Eggert <eggert@twinsun.com>
12583 Stop using the "enum_" trick for K&R-style function definitions;
12584 it confused me, and I was the author! Instead, assume that people
12585 who want to use K&R C compilers (when using these modules in GCC,
12586 perhaps?) will run ansi2knr.
12588 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
12589 All uses of "enum_" changed to "enum ".
12590 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
12591 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
12593 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
12594 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
12595 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
12596 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
12597 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
12598 abitset_not, abitset_ones, abitset_or, abitset_or_and,
12599 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
12600 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
12601 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
12602 Use function prototypes; this removes the need for declaring
12603 static functions simply to provide their prototypes.
12604 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
12605 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
12606 bitset_count_, bitset_create, bitset_dump, bitset_first,
12607 bitset_free, bitset_init, bitset_last, bitset_next,
12608 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
12609 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
12610 bitset_print, bitset_release_memory, bitset_toggle_,
12611 bitset_type_choose, bitset_type_get, bitset_type_name_get,
12612 debug_bitset): Likewise.
12613 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
12614 * lib/bitset_stats.c (bitset_log_histogram_print,
12615 bitset_percent_histogram_print, bitset_stats_and,
12616 bitset_stats_and_cmp, bitset_stats_and_or,
12617 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
12618 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
12619 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
12620 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
12621 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
12622 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
12623 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
12624 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
12625 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
12626 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
12627 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
12628 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
12629 bitset_stats_zero): Likewise.
12630 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
12631 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
12632 bitsetv_dump, debug_bitsetv): Likewise.
12633 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
12634 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
12635 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
12636 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
12637 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
12638 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
12639 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
12640 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
12641 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
12642 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
12643 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
12645 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
12646 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
12647 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
12648 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
12649 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
12650 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
12651 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
12652 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
12653 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
12654 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
12655 lbitset_xor_cmp, lbitset_zero): Likewise.
12657 2002-10-14 Akim Demaille <akim@epita.fr>
12661 2002-10-14 Akim Demaille <akim@epita.fr>
12663 * tests/Makefile.am (maintainer-check-posix): New.
12665 2002-10-14 Akim Demaille <akim@epita.fr>
12667 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
12670 2002-10-14 Akim Demaille <akim@epita.fr>
12672 * src/tables.c (table_ninf_remap): base -> tab.
12673 Reported by Matt Rosing.
12675 2002-10-14 Paul Eggert <eggert@twinsun.com>
12677 * tests/action.at, tests/calc.at, tests/conflicts.at,
12678 tests/cxx-type.at, tests/headers.at, tests/input.at,
12679 tests/regression.at, tests/synclines.at, tests/torture.at:
12680 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
12681 so that the tests still work even if POSIXLY_CORRECT is set.
12682 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
12684 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
12685 for portability to K&R hosts. Fix typo: signed char is guaranteed
12686 only to 127, not to 128.
12687 * data/glr.c (yysigned_char): New type.
12688 * data/yacc.c (yysigned_char): Likewise.
12689 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
12691 2002-10-13 Paul Eggert <eggert@twinsun.com>
12693 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
12694 true due to limited range of data type" warning from GCC.
12696 * data/c.m4 (b4_token_defines): Protect against double-inclusion
12697 by wrapping enum yytokentype's definition inside #ifndef
12698 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
12700 2002-10-13 Akim Demaille <akim@epita.fr>
12702 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
12703 Un yy- yyrhs to avoid the name clash with the global YYRHS.
12705 2002-10-13 Akim Demaille <akim@epita.fr>
12707 * Makefile.maint: Update from Autoconf 2.54.
12708 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
12710 2002-10-13 Akim Demaille <akim@epita.fr>
12712 * src/print.c (print_state): Separate the list of solved conflicts
12713 from the other items.
12714 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
12716 2002-10-13 Akim Demaille <akim@epita.fr>
12718 Let nondeterministic skeletons be usable with deterministic
12721 With the patch, GAWK compiled by GCC without -O2 passes its test
12722 suite using a GLR parser driven by LALR tables. It fails with -O2
12723 because `struct stat' gives two different answers on my machine:
12724 88 (definition of an auto var) and later 96 (memset on this var).
12725 Hence the stack is badly corrumpted. The headers inclusion is to
12726 blame: if I move the awk.h inclusion before GLR's system header
12727 inclusion, the two struct stat have the same size.
12729 * src/tables.c (pack_table): Always create conflict_table.
12730 (token_actions): Always create conflict_list.
12731 * data/glr.c (YYFLAG): Remove, unused.
12733 2002-10-13 Akim Demaille <akim@epita.fr>
12735 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
12737 (VALGRIND, GXX): New.
12738 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
12739 * tests/bison.in: Run $PREBISON a pre-command.
12740 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
12741 (maintainer-check-g++): New.
12742 * Makefile.am (maintainer-check): New.
12744 2002-10-13 Akim Demaille <akim@epita.fr>
12746 * data/glr.c: Formatting changes.
12747 Tweak some trace messages to match yacc.c's.
12749 2002-10-13 Akim Demaille <akim@epita.fr>
12751 GLR parsers sometimes raise parse errors instead of performing the
12753 Reported by Charles-Henry de Boysson.
12755 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
12756 check the length of the traces when %glr.
12757 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
12759 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
12761 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
12762 (yyltype): Remove the yy prefix from the member names.
12763 (yytable): Complete its comment.
12764 (yygetLRActions): Map error action number from YYTABLE from
12766 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
12767 (which was a bug: it should have been YYTABEL_NINF, and yet it was
12768 not satisfying as we could compare an YYACTION computed from
12769 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
12770 only value for error actions.
12771 (yyreportParseError): In verbose parse error messages, don't issue
12772 `error' in the list of expected tokens.
12773 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
12774 next action to perform to match glr.c's decoding.
12775 (yytable): Complete its comment.
12777 2002-10-13 Paul Eggert <eggert@twinsun.com>
12779 Fix problem reported by Henrik Grubbstroem in
12780 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
12781 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
12782 because the Bison parser reads the second action before reducing
12784 * src/scan-gram.l (rule_length): New static var.
12785 Use it to keep track of the rule length in the scanner, since
12786 we can't expect the parser to be in lock-step sync with the scanner.
12787 (handle_action_dollar, handle_action_at): Use this var.
12788 * tests/actions.at (Exotic Dollars): Test for the problem.
12790 2002-10-12 Paul Eggert <eggert@twinsun.com>
12792 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
12793 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
12794 Include <sys/time.h> when checking for clock_t and struct tms.
12795 Use same include order as source.
12796 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
12797 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
12799 * lib/timevar.c: Update copyright date and clarify comments.
12800 (get_time) [IN_GCC]: Keep the GCC version for reference.
12802 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
12803 GCC version as of today, then merge Bison's changes.
12804 Change "GCC" to "Bison" in copyright notice. timevar.def's
12805 author is Akim, so change that too.
12807 * src/reader.c (grammar_current_rule_check):
12808 Don't worry about the default action if $$ is untyped.
12809 Prevents bogus warnings reported by Jim Gifford in
12810 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
12812 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
12813 * data/glr.c, data/lalr1.cc, data/yacc.c:
12814 Output token definitions before the first part of user declarations.
12815 Fixes compatibility problem reported by Jim Gifford for kbd in
12816 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
12818 2002-10-11 Paul Eggert <eggert@twinsun.com>
12820 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
12821 (yyparse): here. This undoes some of the 2002-07-25 change.
12822 Compatibility problem reported by Ralf S. Engelschall with
12823 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
12825 2002-10-11 Akim Demaille <akim@epita.fr>
12827 * tests/regression.at Characters Escapes): New.
12828 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
12830 Reported by Jan Nieuwenhuizen.
12832 2002-10-11 Akim Demaille <akim@epita.fr>
12836 2002-10-10 Paul Eggert <eggert@twinsun.com>
12838 Portability fixes for bitsets; this also avoids several GCC
12841 * lib/abitset.c: Include <stddef.h>, for offsetof.
12842 * lib/lbitset.c: Likewise.
12844 * lib/abitset.c (abitset_bytes): Return a size that is aligned
12845 properly for vectors of objects. Do not assume that adding a
12846 header size to a multiple of a word size yields a value that is
12847 properly aligned for the whole union.
12848 * lib/bitsetv.c (bitsetv_alloc): Likewise.
12850 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
12851 unique names for structures.
12852 * lib/ebitset.c (ebitset_bytes): Likewise.
12853 * lib/lbitset.c (lbitset_bytes): Likewise.
12855 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
12856 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
12857 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
12858 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
12859 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
12860 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
12861 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
12862 to improve the type-checking that GCC can do.
12863 * lib/bitset.c (bitset_op4_cmp): Likewise.
12864 * lib/bitset_stats.c (bitset_stats_count,
12865 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
12866 bitset_stats_copy, bitset_stats_disjoint_p,
12867 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
12868 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
12869 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
12870 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
12871 bitset_stats_and_or_cmp, bitset_stats_andn_or,
12872 bitset_stats_andn_or_cmp, bitset_stats_or_and,
12873 bitset_stats_or_and_cmp): Likewise.
12874 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
12875 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
12876 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
12877 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
12879 * lib/abitset.h: Include bitset.h, not bbitset.h.
12880 * lib/ebitset.h: Likewise.
12881 * lib/lbitset.h: Likewise.
12883 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
12884 All instances of parameters of type enum bitset_opts are now of
12885 type enum_bitset_opts, to conform to the C Standard, and similarly
12886 for enum_bitset_type.
12887 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
12888 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
12890 Do not use "struct bitset_struct" to mean different things in
12891 different modules. Not only is this confusing, it violates
12892 the C Standard, which requires that structure types in different
12893 modules must be compatible if one is to be passed to the other.
12894 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
12895 All instances of "struct bitset_struct *" replaced with "bitset".
12896 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
12897 (union bitset_union, struct abitset_struct, struct ebitset_struct,
12898 struct lbitset_struct, struct bitset_stats_struct): New types.
12899 All uses of struct bitset_struct changed to union bitset_union,
12901 * lib/abitset.c (struct abitset_struct, abitset,
12902 struct bitset_struct): Remove.
12903 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
12904 struct bitset_struct): Remove.
12905 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
12906 bitset_struct): Remove.
12907 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
12910 Do not call a function of type T using a call that assumes the
12911 function is of a different type U. Standard C requires that a
12912 function must be called with a type that is compatible with its
12914 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
12916 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
12918 * lib/ebitset.c (PFV): Remove.
12919 * lib/lbitset.c (PFV): Likewise.
12920 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
12921 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
12923 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
12924 (ebitset_vtable): Use them.
12925 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
12926 lbitset_xor): New functions.
12927 (lbitset_vtable): Use them.
12929 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
12932 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
12934 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
12935 Use offsetof, for simplicity.
12937 2002-10-06 Paul Eggert <eggert@twinsun.com>
12939 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
12940 the same width as int. This reapplies a hunk of the 2002-08-12 patch
12941 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
12942 which was inadvertently undone by the 2002-09-30 patch.
12943 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
12944 the same width as int.
12946 2002-10-04 Paul Eggert <eggert@twinsun.com>
12950 * configure.ac (AC_INIT), NEWS: Increment version number.
12952 * doc/bison.texinfo: Minor spelling, grammar, and white space
12954 (Symbols): Mention that any negative value returned from yylex
12955 signifies end-of-input. Warn about negative chars. Mention
12956 the portable Standard C character set.
12958 The GNU coding standard says CFLAGS and YFLAGS are reserved
12959 for the installer to set.
12960 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
12961 * src/Makefile.am (AM_CFLAGS): Likewise.
12962 (AM_YFLAGS): Renamed from YFLAGS.
12964 Fix some MAX and MIN problems.
12965 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
12966 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
12967 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
12968 * src/reader.c (reader): Use it.
12970 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
12971 POSIX 1003.1-2001 has removed fgrep.
12973 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
12975 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
12976 interpreted as signed.
12977 * lib/ebitset.c (ebitset_list): Fix bug.
12979 2002-10-01 Paul Eggert <eggert@twinsun.com>
12981 More fixes for 64-bit hosts and large bitsets.
12983 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
12984 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
12985 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
12986 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
12987 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
12988 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
12989 bitset_count_): Likewise.
12990 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
12991 bitset_first, bitset_last): Likewise.
12992 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
12993 bitset_stats_list_reverse, bitset_stats_size,
12994 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
12996 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12997 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
12998 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
12999 bitsetv_reflexive_transitive_closure): Likewise.
13000 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
13001 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
13003 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
13006 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
13007 Use size_t, not unsigned int, to count bytes.
13008 * lib/abitset.h (abitset_bytes): Likewise.
13009 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
13011 * lib/bitset.h (bitset_bytes): Likewise.
13012 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
13013 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
13014 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13015 * lib/ebitset.c (ebitset_bytes): Likewise.
13016 * lib/ebitset.h (ebitset_bytes): Likewise.
13017 * lib/lbitset.c (lbitset_bytes): Likewise.
13018 * lib/lbitset.h (lbitset_bytes): Likewise.
13020 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
13021 abitset_subset_p, abitset_disjoint_p, abitset_and,
13022 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
13023 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
13024 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
13025 abitset_or_and, abitset_or_and_cmp):
13026 Use bitset_windex instead of unsigned int.
13027 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13028 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
13029 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
13030 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
13032 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
13034 * lib/bitset.c (bitset_print):
13035 Use proper printf formats for widths of integer types.
13036 * lib/bitset_stats.c (bitset_percent_histogram_print,
13037 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
13038 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13039 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13040 * lib/lbitset.c (lbitset_bytes): Likewise.
13042 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
13043 BITSET_SIZE_MAX): New macros.
13044 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
13045 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
13046 to BITSET_WINDEX_MAX.
13048 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
13049 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
13050 since we now return the bitset_bindex type (not int).
13052 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
13053 when computing sizes.
13054 * lib/ebitset.c (ebitset_elts_grow): Likewise.
13056 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
13057 and avoid cast to unsigned.
13059 2002-09-30 Akim Demaille <akim@epita.fr>
13061 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
13062 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
13063 Updates from Michael Hayes.
13065 2002-09-30 Art Haas <ahaas@neosoft.com>
13067 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
13069 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
13072 2002-09-27 Akim Demaille <akim@epita.fr>
13076 2002-09-27 Akim Demaille <akim@epita.fr>
13078 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
13079 (Because of AC_LIBSOURCE).
13081 2002-09-27 Akim Demaille <akim@epita.fr>
13083 Playing with Autoscan.
13085 * configure.ac: Remove the old LIBOBJ tweaks.
13086 (AC_REPLACE_FUNCS): Add strrchr and strtol.
13087 * lib/strrchr.c: New.
13088 * lib/strtol.c: New, from the Coreutils 4.5.1.
13090 2002-09-27 Akim Demaille <akim@epita.fr>
13092 Playing with Autoscan.
13094 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
13095 * lib/Makefile.am (libbison_a_SOURCES): No longer include
13096 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
13097 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
13100 2002-09-24 Akim Demaille <akim@epita.fr>
13102 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
13103 (Frequently Asked Questions, Parser Stack Overflow): New.
13105 2002-09-13 Akim Demaille <akim@epita.fr>
13107 Playing with autoscan.
13109 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
13110 * src/files.c (skeleton_find): Remove, unused.
13111 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
13112 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
13114 2002-09-13 Akim Demaille <akim@epita.fr>
13116 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
13117 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
13119 2002-09-13 Akim Demaille <akim@epita.fr>
13121 * configure.ac: Require 2.54.
13122 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
13123 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
13124 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
13125 Remove, provided by Autoconf macros.
13127 2002-09-12 Akim Demaille <akim@epita.fr>
13129 * m4/prereq.m4: Update, from Coreutils 4.5.1.
13131 2002-09-12 Akim Demaille <akim@epita.fr>
13133 * m4/prereq.m4: Update, from Fileutils 4.1.5.
13134 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
13135 Reported by Martin Mokrejs.
13137 2002-09-10 Akim Demaille <akim@epita.fr>
13139 * src/parse-gram.y: Associate a human readable string to each
13141 * tests/regression.at (Invalid inputs): Adjust.
13143 2002-09-10 Gary V. Vaughan <gary@gnu.org>
13145 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
13146 with an Autoconf-2.5x style configure.ac.
13148 2002-09-06 Paul Eggert <eggert@twinsun.com>
13150 * doc/bison.texinfo (Conditions): Make explicit that the GPL
13151 exception applies only to yacc.c. This is a modification of a
13152 patch originally suggested by Akim Demaille.
13154 2002-09-06 Akim Demaille <akim@epita.fr>
13156 * data/c.m4 (b4_copyright): Move the GPL exception comment from
13158 * data/yacc.c: here.
13160 * data/lalr1.cc (struct yyltype): Don't define it, since we use
13162 (b4_ltype): Default to yy::Location from location.hh.
13164 2002-09-04 Jim Meyering <jim@meyering.net>
13166 * data/yacc.c: Guard the declaration of yytoknum also with
13167 `#ifdef YYPRINT', so it is declared only when used.
13169 2002-09-04 Akim Demaille <akim@epita.fr>
13171 * configure.in: Rename as...
13172 * configure.ac: this.
13175 2002-09-04 Akim Demaille <akim@epita.fr>
13177 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
13178 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
13179 translate maintainer only messages.
13181 2002-08-12 Paul Eggert <eggert@twinsun.com>
13185 * Makefile.am (SUBDIRS): Remove intl.
13186 (DISTCLEANFILES): Remove.
13187 * NEWS: Mention that GNU M4 is now required. Clarify what is
13188 meant by "larger grammars". Mention the pt_BR translation.
13189 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
13190 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
13191 Bump version from 0.11.2 to 0.11.5.
13192 (BISON_PREREQ_STAGE): Remove.
13193 (AM_GNU_GETTEXT): Use external gettext.
13194 (AC_OUTPUT): Remove intl/Makefile.
13196 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
13198 * data/glr.c: Include string.h, for strlen.
13199 (yyreportParseError): Use size_t for yysize.
13200 (yy_yypstack): No longer nested inside yypstates, as nested
13201 functions are not portable. Do not assume size_t is the
13203 (yypstates): Do not assume that ptrdiff_t is the same width
13204 as int, and similarly for yyposn and YYINDEX.
13206 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
13208 * lib/Makefile.am (INCLUDES): Do not include from the intl
13209 directory, which has been removed.
13210 * src/Makefile.am (INCLUDES): Likewise.
13212 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
13213 (bitsets_sources, additional_bitsets_sources, timevars_sources):
13216 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
13217 * tests/Makefile.am (EXTRA_DIST): Likewise.
13219 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
13220 Do not assume that bitset_windex is the same width as unsigned.
13222 * lib/abitset.c (abitset_unused_clear): Do not assume that
13223 bitset_word is the same width as int.
13224 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
13225 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
13226 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
13227 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
13228 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
13230 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
13231 portability to one's complement hosts!).
13232 * lib/ebitset.c (ebitset_op1): Likewise.
13233 * lib/lbitset.c (lbitset_op1): Likewise.
13235 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
13236 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
13237 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
13238 Sync with fileutils.
13239 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
13240 lib/gettext.h: Sync with diffutils.
13242 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
13243 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
13245 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
13246 PROTOTYPES to check for prototypes, and "defined __STDC__" to
13249 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
13250 size_t; the old version tried to do this but casted improperly.
13251 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
13252 (bitset_test): Now returns int, not unsigned long.
13254 * lib/bitset_stats.c: Include "gettext.h".
13256 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
13257 name locals "index", as it generates unnecessary warnings on some
13258 hosts that have an "index" function.
13260 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
13261 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
13262 they need translation.
13263 * src/LR0.c (state_list_append, new_itemsets, get_state,
13264 append_states, generate_states): Likewise.
13265 * src/assoc.c (assoc_to_string): Likewise.
13266 * src/closure.c (print_closure, set_firsts, closure): Likewise.
13267 * src/gram.c (grammar_dump): Likewise.
13268 * src/injections.c (injections_compute): Likewise.
13269 * src/lalr.c (lookaheads_print): Likewise.
13270 * src/relation.c (relation_transpose): Likewise.
13271 * src/scan-gram.l: Likewise.
13272 * src/tables.c (table_grow, pack_vector): Likewise.
13274 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
13275 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
13276 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
13277 * m4/mbstate_t.m4: Sync with fileutils.
13278 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
13280 * po/LINGUAS: Add pt_BR.
13281 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
13282 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
13284 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
13286 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
13288 * src/complain.c (strerror_r): Remove decl; not needed.
13289 (strerror): Use same pattern as ../lib/error.c.
13291 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
13293 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
13295 * src/main.c (main): Cast result of bindtextdomain and textdomain
13296 to void, to avoid a GCC warning when --disable-nls is in effect.
13298 * src/scan-gram.l: Use strings rather than escapes when possible,
13299 to minimize the number of warnings from xgettext.
13300 (handle_action_dollar, handle_action_at): Don't use isdigit,
13301 as it mishandles negative chars and it may not work as expected
13302 outside the C locale.
13304 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
13305 this is a GCC extension and is not portable to other compilers.
13307 * src/system.h (alloca): Use same pattern as ../lib/error.c.
13308 Do not include <ctype.h>; no longer needed.
13309 Do not include <malloc.h>; no longer needed (and generates
13310 warnings on OpenBSD 3.0).
13312 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
13315 * tests/regression.at: Do not use 'cc -c input.c -o input';
13316 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
13318 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
13319 exit status as failure, not just exit status 1. Sun C exits
13320 with status 2 sometimes.
13322 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
13323 Use it for the two large tests.
13325 2002-08-02 Akim Demaille <akim@epita.fr>
13327 * src/conflicts.c (conflicts_output): Don't output rules never
13328 reduced here, since anyway that computation doesn't work.
13329 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
13330 (rule_useless_p, rule_never_reduced_p): New.
13331 (grammar_rules_partial_print): Use a filter instead of a range.
13332 Display the title only if needed.
13333 (grammar_rules_print): Adjust.
13334 (grammar_rules_never_reduced_report): New.
13335 * src/tables.c (action_row): Move the computation of rules never
13337 (token_actions): here.
13338 * src/main.c (main): Make the parser before making the report, so
13339 that rules never reduced are computed.
13340 Call grammar_rules_never_reduced_report.
13341 * src/print.c (print_results): Report rules never reduced.
13342 * tests/conflicts.at, tests/reduce.at: Adjust.
13344 2002-08-01 Akim Demaille <akim@epita.fr>
13346 Instead of attaching lookaheads and duplicating the rules being
13347 reduced by a state, attach the lookaheads to the reductions.
13349 * src/state.h (state_t): Remove the `lookaheads',
13350 `lookaheads_rule' member.
13351 (reductions_t): Add a `lookaheads' member.
13352 Use a regular array for the `rules'.
13353 * src/state.c (reductions_new): Initialize the lookaheads member
13355 (state_rule_lookaheads_print): Adjust.
13356 * src/state.h, src/state.c (state_reductions_find): New.
13357 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
13358 (count_rr_conflicts): Adjust.
13359 * src/lalr.c (LArule): Remove.
13360 (add_lookback_edge): Adjust.
13361 (state_lookaheads_count): New.
13362 (states_lookaheads_initialize): Merge into...
13363 (initialize_LA): this.
13364 (lalr_free): Adjust.
13365 * src/main.c (main): Don't free nullable and derives too early: it
13366 is used by --verbose.
13367 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
13369 2002-08-01 Akim Demaille <akim@epita.fr>
13371 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
13373 (set_derives, free_derives): Rename as...
13374 (derives_compute, derives_free): this.
13375 Adjust all dependencies.
13376 * src/nullable.c (set_nullable, free_nullable): Rename as...
13377 (nullable_compute, nullable_free): these.
13378 (rule_list_t): Store rule_t *, not rule_number_t.
13379 * src/state.c (state_rule_lookaheads_print): Directly compare rule
13380 pointers, instead of their numbers.
13381 * src/main.c (main): Call nullable_free, and derives_free earlier,
13382 as they were lo longer used.
13384 2002-08-01 Akim Demaille <akim@epita.fr>
13386 * lib/timevar.c (get_time): Include children time.
13387 * src/lalr.h (LA, LArule): Don't export them: used with the
13389 * src/lalr.c (LA, LArule): Static.
13390 * src/lalr.h, src/lalr.c (lalr_free): New.
13391 * src/main.c (main): Call it.
13392 * src/tables.c (pack_vector): Check whether loc is >= to the
13394 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
13395 (tables_generate): do it, since that's also it which allocates
13397 Don't free LA and LArule, main does.
13399 2002-07-31 Akim Demaille <akim@epita.fr>
13401 Separate parser tables computation and output.
13403 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
13404 (conflict_list, conflict_list_cnt, table, check, table_ninf)
13405 (yydefgoto, yydefact, high): Move to...
13406 * src/tables.h, src/tables.c: here.
13407 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
13408 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
13409 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
13410 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
13411 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
13412 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
13413 (action_row, save_row, token_actions, save_column, default_goto)
13414 (goto_actions, sort_actions, matching_state, pack_vector)
13415 (table_ninf_remap, pack_table, prepare_actions): Move to...
13416 * src/tables.c: here.
13417 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
13418 * src/output.c (token_actions, output_base, output_conflicts)
13419 (output_check): Merge into...
13420 (prepare_actions): this.
13421 (actions_output): Rename as...
13422 (user_actions_output): this.
13423 * src/main.c (main): Call tables_generate and tables_free.
13425 2002-07-31 Akim Demaille <akim@epita.fr>
13427 Steal GCC's --time-report support.
13429 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
13430 stolen/adjusted from GCC.
13431 * m4/stage.m4: Remove time related checks.
13432 * m4/timevar.m4: New.
13433 * configure.in: Adjust.
13434 * src/system.h: Adjust to using timevar.h.
13435 * src/getargs.h, src/getargs.c: Support trace_time for
13437 * src/main.c (stage): Remove.
13438 (main): Replace `stage' invocations with timevar calls.
13439 * src/output.c: Insert pertinent timevar calls.
13441 2002-07-31 Akim Demaille <akim@epita.fr>
13443 Let --trace have arguments.
13445 * src/getargs.h (enum trace_e): New.
13446 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
13447 (long_options, short_options): --trace/-T takes an optional
13449 Change all the uses of trace_flag to reflect the new flags.
13450 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
13452 Strengthen `stage' portability.
13454 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
13455 * configure.in: Use it.
13456 Don't check for malloc.h and sys/times.h.
13457 * src/system.h: Include them when appropriate.
13458 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
13459 times and struct tms are available.
13461 2002-07-30 Akim Demaille <akim@epita.fr>
13463 In verbose parse error message, don't report `error' as an
13465 * tests/actions.at (Printers and Destructors): Adjust.
13466 * tests/calc.at (Calculator $1): Adjust.
13467 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
13468 error message, do not report the parser accepts the error token in
13471 2002-07-30 Akim Demaille <akim@epita.fr>
13473 Normalize conflict related messages.
13475 * src/complain.h, src/complain.c (warn, complain): New.
13476 * src/conflicts.c (conflicts_print): Use them.
13477 (conflict_report_yacc): New, extracted from...
13478 (conflicts_print): here.
13479 * tests/conflicts.at, tests/existing.at: Adjust.
13481 2002-07-30 Akim Demaille <akim@epita.fr>
13483 Report rules which are never reduced by the parser: those hidden
13486 * src/LR0.c (save_reductions): Don't make the final state too
13487 different: save its reduction (accept) instead of having a state
13488 without any action (no shift or goto, no reduce).
13489 Note: the final state is now a ``regular'' state, i.e., the
13490 parsers now contain `reduce 0' as default reduction.
13491 Nevertheless, since they decide to `accept' when yystate =
13492 final_state, they still will not reduce rule 0.
13493 * src/print.c (print_actions, print_reduction): Adjust.
13494 * src/output.c (action_row): Track reduced rules.
13495 (token_actions): Report rules never reduced.
13496 * tests/conflicts.at, tests/regression.at: Adjust.
13498 2002-07-30 Akim Demaille <akim@epita.fr>
13500 `stage' was accidently included in a previous patch.
13501 Initiate its autoconfiscation.
13503 * configure.in: Look for malloc.h and sys/times.h.
13504 * src/main.c (stage): Adjust.
13505 Report only when trace_flag.
13507 2002-07-29 Akim Demaille <akim@epita.fr>
13509 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
13511 (errs_t): symbol_t*, not symbol_number_t.
13512 (reductions_t): rule_t*, not rule_number_t.
13513 (FOR_EACH_SHIFT): New.
13514 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
13515 * src/print.c, src/print_graph.c: Adjust.
13517 2002-07-29 Akim Demaille <akim@epita.fr>
13519 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
13521 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
13522 (endtoken, accept): these.
13523 * src/reader.c (reader): Set endtoken's default tag to "$end".
13524 Set undeftoken's tag to "$undefined" instead of "$undefined.".
13525 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
13528 2002-07-29 Akim Demaille <akim@epita.fr>
13530 * src/reduce.c (reduce_grammar): When the language is empty,
13531 complain about the start symbol, not the axiom.
13533 * tests/reduce.at (Empty Language): New.
13535 2002-07-26 Akim Demaille <akim@epita.fr>
13537 * src/reader.h, src/reader.c (gram_error): ... can't get
13538 yycontrol without making too strong assumptions on the parser
13540 * src/output.c (prepare_tokens): Use the real 0th value of
13541 token_translations instead of `0'.
13542 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
13544 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
13545 for the time being: %locations ought to provide it to yyerror.
13547 2002-07-25 Akim Demaille <akim@epita.fr>
13549 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
13550 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
13551 * tests/regression.at (Web2c Actions): Adjust.
13553 2002-07-25 Akim Demaille <akim@epita.fr>
13555 Stop storing rules from 1 to nrules + 1.
13557 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
13558 * src/nullable.c, src/output.c, src/print.c, src/reader.c
13559 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
13560 Iterate from 0 to nrules.
13561 Use rule_number_as_item_number and item_number_as_rule_number.
13562 Adjust to `derive' now containing possibly 0.
13563 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
13564 Handle the `- 1' part in rule numbers from/to item numbers.
13565 * src/conflicts.c (log_resolution): Fix the message which reversed
13567 * src/output.c (action_row): Initialize default_rule to -1.
13568 (token_actions): Adjust.
13569 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
13571 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
13573 2002-07-25 Akim Demaille <akim@epita.fr>
13575 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
13576 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
13577 (b4_c_knr_arg_decl): New.
13578 * data/yacc.c: Use it to define yysymprint, yydestruct, and
13579 yyreport_parse_error.
13581 2002-07-25 Akim Demaille <akim@epita.fr>
13583 * data/yacc.c (yyreport_parse_error): New, extracted from...
13585 (yydestruct, yysymprint): Move above yyparse.
13588 2002-07-25 Akim Demaille <akim@epita.fr>
13590 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
13592 (b4_sint_type, b4_uint_type): these.
13593 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
13594 * tests/regression.at (Web2c Actions): Adjust.
13596 2002-07-25 Akim Demaille <akim@epita.fr>
13598 * src/gram.h (TIEM_NUMBER_MAX): New.
13599 (item_number_of_rule_number, rule_number_of_item_number): Rename
13601 (rule_number_as_item_number, item_number_as_rule_number): these.
13602 Adjust dependencies.
13603 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
13604 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
13605 (symbol_number_to_vector_number): New.
13606 (order): Of vector_number_t* type.
13607 (base_t, BASE_MAX, BASE_MIN): New.
13608 (froms, tos, width, pos, check): Of base_t type.
13609 (action_number_t, ACTION_MIN, ACTION_MAX): New.
13610 (actrow): Of action_number_t type.
13611 (conflrow): Of unsigned int type.
13612 (table_ninf, base_ninf): New.
13613 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
13614 (muscle_insert_int_table, muscle_insert_base_table)
13615 (muscle_insert_rule_number_table): New.
13616 (prepare_tokens): Output `toknum' as int_table.
13617 (action_row): Returns a rule_number_t.
13618 Use ACTION_MIN, not SHRT_MIN.
13619 (token_actions): yydefact is rule_number_t*.
13620 (table_ninf_remap): New.
13621 (pack_table): Use it for `base' and `table'.
13622 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
13624 (YYPACT_NINF, YYTABLE_NINF): these.
13625 (yypact, yytable): Compute their types instead of hard-coded
13627 * tests/regression.at (Web2c Actions): Adjust.
13629 2002-07-19 Akim Demaille <akim@epita.fr>
13631 * src/scan-gram.l (id): Can start with an underscore.
13633 2002-07-16 Akim Demaille <akim@epita.fr>
13635 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
13636 Adjust all former `associativity' dependencies.
13637 * src/symtab.c (symbol_new): Default associativity is `undef', not
13639 (symbol_check_alias_consistence): Adjust.
13641 2002-07-09 Akim Demaille <akim@epita.fr>
13643 * doc/bison.texinfo: Properly set the ``header'' part.
13644 Use @dircategory ``GNU programming tools'' as per Texinfo's
13648 2002-07-09 Akim Demaille <akim@epita.fr>
13650 * lib/quotearg.h: Protect against multiple inclusions.
13651 * src/location.h (location_t): Add a `file' member.
13652 (LOCATION_RESET, LOCATION_PRINT): Adjust.
13653 * src/complain.c (warn_at, complain_at, fatal_at): Drop
13654 `error_one_per_line' support.
13656 2002-07-09 Akim Demaille <akim@epita.fr>
13658 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
13659 * src/reader.c (lineno): Remove.
13660 Adjust all dependencies.
13661 (get_merge_function): Take a location and use complain_at.
13662 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
13663 * tests/regression.at (Invalid inputs, Mixing %token styles):
13666 2002-07-09 Akim Demaille <akim@epita.fr>
13668 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
13669 recovery rule, and forbid extensions when --yacc.
13670 (gram_error): Use complain_at.
13671 * src/reader.c (reader): Exit if there were parse errors.
13673 2002-07-09 Akim Demaille <akim@epita.fr>
13675 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
13676 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
13677 Reported by R Blake <blakers@mac.com>.
13679 2002-07-09 Akim Demaille <akim@epita.fr>
13681 * data/yacc.c: Output the copyright notive in the header.
13683 2002-07-03 Akim Demaille <akim@epita.fr>
13685 * src/output.c (froms, tos): Are state_number_t.
13686 (save_column): sp, sp1, and sp2 are state_number_t.
13687 (prepare): Rename `final' as `final_state_number', `nnts' as
13688 `nterms_number', `nrules' as `rules_number', `nstates' as
13689 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
13691 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
13692 * data/lalr1.cc (nsym_): Remove, unused.
13694 2002-07-03 Akim Demaille <akim@epita.fr>
13696 * src/lalr.h, src/lalr.c (goto_number_t): New.
13697 * src/lalr.c (goto_list_t): New.
13699 * src/nullable.c (rule_list_t): New.
13701 * src/types.h: Remove.
13703 2002-07-03 Akim Demaille <akim@epita.fr>
13705 * src/closure.c (print_fderives): Use rule_rhs_print.
13706 * src/derives.c (print_derives): Use rule_rhs_print.
13707 (rule_list_t): New, replaces `shorts'.
13708 (set_derives): Add comments.
13709 * tests/sets.at (Nullable, Firsts): Adjust.
13711 2002-07-03 Akim Demaille <akim@epita.fr>
13713 * src/output.c (prepare_actions): Free `tally' and `width'.
13714 (prepare_actions): Allocate and free `order'.
13715 * src/symtab.c (symbols_free): Free `symbols'.
13716 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
13717 * src/output.c (m4_invoke): Move to...
13718 * src/scan-skel.l: here.
13719 (<<EOF>>): Close yyout, and free its name.
13721 2002-07-03 Akim Demaille <akim@epita.fr>
13723 Fix some memory leaks, and fix a bug: state 0 was examined twice.
13725 * src/LR0.c (new_state): Merge into...
13726 (state_list_append): this.
13727 (new_states): Merge into...
13728 (generate_states): here.
13729 (set_states): Don't ensure a proper `errs' state member here, do it...
13730 * src/conflicts.c (conflicts_solve): here.
13731 * src/state.h, src/state.c: Comment changes.
13732 (state_t): Rename member `shifts' as `transitions'.
13733 Adjust all dependencies.
13734 (errs_new): For consistency, also take the values as argument.
13735 (errs_dup): Remove.
13736 (state_errs_set): New.
13737 (state_reductions_set, state_transitions_set): Assert that no
13738 previous value was assigned.
13740 (states_free): Use it.
13741 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
13742 temporary storage: use `errs' and `nerrs' as elsewhere.
13743 (set_conflicts): Allocate and free this `errs'.
13745 2002-07-02 Akim Demaille <akim@epita.fr>
13747 * lib/libiberty.h: New.
13748 * lib: Update the bitset implementation from upstream.
13749 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
13750 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
13751 * src/main.c: Adjust bitset stats calls.
13753 2002-07-01 Paul Eggert <eggert@twinsun.com>
13755 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
13756 char, so that negative chars don't collide with $.
13758 2002-06-30 Akim Demaille <akim@epita.fr>
13760 Have the GLR tests be `warning' checked, and fix the warnings.
13762 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
13763 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
13764 (yyremoveDeletes): `yyi' and `yyj' are size_t.
13765 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
13766 (yyaddDeferredAction): static.
13767 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
13768 (yyreportParseError): yyprefix is const.
13769 yytokenp is used only when verbose.
13770 (yy__GNUC__): Replace with __GNUC__.
13771 (yypdumpstack): yyi is size_t.
13772 (yypreference): Un-yy local variables and arguments, to avoid
13773 clashes with `yyr1'. Anyway, we are not in the user name space.
13774 (yytname_size): be an int, as is compared with ints.
13775 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
13777 * tests/cxx-gram.at: Use quotation to protect $1.
13778 Use AT_COMPILE to enable warnings hunts.
13779 Prototype yylex and yyerror.
13781 Include `string.h', not `strings.h'.
13782 Produce and prototype stmtMerge only when used.
13783 yylex takes a location.
13785 2002-06-30 Akim Demaille <akim@epita.fr>
13787 We spend a lot of time in quotearg, in particular when --verbose.
13789 * src/symtab.c (symbol_get): Store a quoted version of the key.
13790 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
13791 Adjust all callers.
13793 2002-06-30 Akim Demaille <akim@epita.fr>
13795 * src/state.h (reductions_t): Rename member `nreds' as num.
13796 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
13797 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
13799 2002-06-30 Akim Demaille <akim@epita.fr>
13801 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
13802 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
13803 (shifts_to): Rename as...
13804 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
13805 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
13806 (TRANSITION_IS_DISABLED, transitions_to): these.
13808 2002-06-30 Akim Demaille <akim@epita.fr>
13810 * src/print.c (print_shifts, print_gotos): Merge into...
13811 (print_transitions): this.
13812 (print_transitions, print_errs, print_reductions): Align the
13813 lookaheads columns.
13814 (print_core, print_transitions, print_errs, print_state,
13815 print_grammar): Output empty lines separator before, not after.
13816 (state_default_rule_compute): Rename as...
13817 (state_default_rule): this.
13818 * tests/conflicts.at (Defaulted Conflicted Reduction),
13819 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
13820 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
13822 2002-06-30 Akim Demaille <akim@epita.fr>
13824 Display items as we display rules.
13826 * src/gram.h, src/gram.c (rule_lhs_print): New.
13827 * src/gram.c (grammar_rules_partial_print): Use it.
13828 * src/print.c (print_core): Likewise.
13829 * tests/conflicts.at (Defaulted Conflicted Reduction),
13830 (Unresolved SR Conflicts): Adjust.
13831 (Unresolved SR Conflicts): Adjust and rename as...
13832 (Resolved SR Conflicts): this, as was meant.
13833 * tests/regression.at (Web2c Report): Adjust.
13835 2002-06-30 Akim Demaille <akim@epita.fr>
13837 * src/print.c (state_default_rule_compute): New, extracted from...
13838 (print_reductions): here.
13839 Pessimize, but clarify the code.
13840 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
13842 2002-06-30 Akim Demaille <akim@epita.fr>
13844 * src/output.c (action_row): Let default_rule be always a rule
13847 2002-06-30 Akim Demaille <akim@epita.fr>
13849 * src/closure.c (print_firsts, print_fderives, closure):
13850 Use BITSET_EXECUTE.
13851 * src/lalr.c (lookaheads_print): Likewise.
13852 * src/state.c (state_rule_lookaheads_print): Likewise.
13853 * src/print_graph.c (print_core): Likewise.
13854 * src/print.c (print_reductions): Likewise.
13855 * src/output.c (action_row): Likewise.
13856 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
13858 2002-06-30 Akim Demaille <akim@epita.fr>
13860 * src/print_graph.c: Use report_flag.
13862 2002-06-30 Akim Demaille <akim@epita.fr>
13864 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
13866 * src/relation.h, src/relation.c (traverse, relation_digraph)
13867 (relation_print, relation_transpose): New.
13869 2002-06-30 Akim Demaille <akim@epita.fr>
13871 * src/state.h, src/state.c (shifts_to): New.
13872 * src/lalr.c (build_relations): Use it.
13874 2002-06-30 Akim Demaille <akim@epita.fr>
13876 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
13877 (item_number_of_rule_number, rule_number_of_item_number): New.
13878 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
13879 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
13880 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
13881 Propagate their use.
13882 Much remains to be done, in particular wrt `shorts' from types.h.
13884 2002-06-30 Akim Demaille <akim@epita.fr>
13886 * src/symtab.c (symbol_new): Initialize the `printer' member.
13888 2002-06-30 Akim Demaille <akim@epita.fr>
13890 * src/LR0.c (save_reductions): Remove, replaced by...
13891 * src/state.h, src/state.c (state_reductions_set): New.
13892 (reductions, errs): Rename as...
13893 (reductions_t, errs_t): these.
13894 Adjust all dependencies.
13896 2002-06-30 Akim Demaille <akim@epita.fr>
13898 * src/LR0.c (state_list_t, state_list_append): New.
13899 (first_state, last_state): Now symbol_list_t.
13900 (this_state): Remove.
13901 (new_itemsets, append_states, save_reductions): Take a state_t as
13903 (set_states, generate_states): Adjust.
13904 (save_shifts): Remove, replaced by...
13905 * src/state.h, src/state.c (state_shifts_set): New.
13906 (shifts): Rename as...
13908 Adjust all dependencies.
13909 * src/state.h (state_t): Remove the `next' member.
13911 2002-06-30 Akim Demaille <akim@epita.fr>
13913 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
13916 2002-06-30 Akim Demaille <akim@epita.fr>
13918 Use hash.h for the state hash table.
13920 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
13921 (allocate_storage): Use state_hash_new.
13922 (free_storage): Use state_hash_free.
13923 (new_state, get_state): Adjust.
13924 * src/lalr.h, src/lalr.c (states): Move to...
13925 * src/states.h (state_t): Remove the `link' member, no longer
13927 * src/states.h, src/states.c: here.
13928 (state_hash_new, state_hash_free, state_hash_lookup)
13929 (state_hash_insert, states_free): New.
13930 * src/states.c (state_table, state_compare, state_hash): New.
13931 * src/output.c (output_actions): Do not free states now, since we
13932 still need to know the final_state number in `prepare', called
13933 afterwards. Do it...
13934 * src/main.c (main): here: call states_free after `output'.
13936 2002-06-30 Akim Demaille <akim@epita.fr>
13938 * src/state.h, src/state.c (state_new): New, extracted from...
13939 * src/LR0.c (new_state): here.
13940 * src/state.h (STATE_ALLOC): Move to...
13941 * src/state.c: here.
13942 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
13943 * src/state.h, src/state.c: here.
13945 2002-06-30 Akim Demaille <akim@epita.fr>
13947 * src/reader.c (gensym): Rename as...
13948 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
13949 (getsym): Rename as...
13950 (symbol_get): this.
13952 2002-06-30 Akim Demaille <akim@epita.fr>
13954 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
13955 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
13956 * src/output.c, src/print.c, src/print_graph.c: Propagate.
13957 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
13959 2002-06-30 Akim Demaille <akim@epita.fr>
13961 Make the test suite pass with warnings checked.
13963 * tests/actions.at (Printers and Destructors): Improve.
13964 Avoid unsigned vs. signed issues.
13965 * tests/calc.at: Don't exercise the scanner here, do it...
13966 * tests/input.at (Torturing the Scanner): here.
13968 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13970 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
13971 reorganize first lines parallel to yacc.c.
13973 2002-06-28 Akim Demaille <akim@epita.fr>
13975 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
13976 (b4_token_enum, b4_token_defines): New, factored from...
13977 * data/lalr1.cc, data/yacc.c, glr.c: here.
13979 2002-06-28 Akim Demaille <akim@epita.fr>
13981 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
13983 * src/output.c (merger_output): static.
13985 2002-06-28 Akim Demaille <akim@epita.fr>
13987 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
13988 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
13990 * src/output.c (save_row): Initialize all the variables to pacify GCC.
13992 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13994 Accumulated changelog for new GLR parsing features.
13996 * src/conflicts.c (count_total_conflicts): Change name to
13997 conflicts_total_count.
13998 * src/conflicts.h: Ditto.
13999 * src/output.c (token_actions): Use the new name.
14000 (output_conflicts): Change conflp => conflict_list_heads, and
14001 confl => conflict_list for better readability.
14002 * data/glr.c: Use the new names.
14003 * NEWS: Add self to GLR announcement.
14005 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
14007 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
14010 * data/bison.glr: Change name to glr.c
14011 * data/glr.c: Renamed from bison.glr.
14012 * data/Makefile.am: Add glr.c
14016 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
14017 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
14019 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14021 * data/bison.glr: Be sure to restore the
14022 current #line when returning to the skeleton contents after having
14023 exposed the input file's #line.
14025 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14027 * data/bison.glr: Bring up to date with changes to bison.simple.
14029 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14031 * data/bison.glr: Correct definitions that use b4_prefix.
14032 Various reformatting.
14033 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
14034 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
14035 yytokenp argument; now part of stack.
14036 (yychar): Define to behave as documented.
14037 (yyclearin): Ditto.
14039 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14041 * src/reader.h: Add declaration for free_merger_functions.
14043 * src/reader.c (merge_functions): New variable.
14044 (get_merge_function): New function.
14045 (free_merger_functions): New function.
14046 (readgram): Check for %prec that is not followed by a symbol.
14047 Handle %dprec and %merge declarations.
14048 (packgram): Initialize dprec and merger fields in rules array.
14050 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
14051 conflict_list_cnt, conflict_list_free): New variables.
14052 (table_grow): Also grow conflict_table.
14053 (prepare_rules): Output dprec and merger tables.
14054 (conflict_row): New function.
14055 (action_row): Output conflict lists for GLR parser. Don't use
14056 default reduction in conflicted states for GLR parser so that there
14057 are spaces for the conflict lists.
14058 (save_row): Also save conflict information.
14059 (token_actions): Allocate conflict list.
14060 (merger_output): New function.
14061 (pack_vector): Pack conflict table, too.
14062 (output_conflicts): New function to output yyconflp and yyconfl.
14063 (output_check): Allocate conflict_tos.
14064 (output_actions): Output conflict tables, also.
14065 (output_skeleton): Output b4_mergers definition.
14066 (prepare): Output b4_max_rhs_length definition.
14067 Use 'bison.glr' as default skeleton for GLR parsers.
14069 * src/gram.c (glr_parser): New flag.
14070 (grammar_free): Call free_merger_functions.
14072 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
14073 all pairs of conflicting reductions, rather than just all tokens
14074 causing conflicts. Needed to size conflict tables.
14075 (conflicts_output): Modify call to count_rr_conflicts for new
14077 (conflicts_print): Ditto.
14078 (count_total_conflicts): New function.
14080 * src/reader.h (merger_list): New type.
14081 (merge_functions): New variable.
14083 * src/lex.h (tok_dprec, tok_merge): New token types.
14085 * src/gram.h (rule_s): Add dprec and merger fields.
14086 (glr_parser): New flag.
14088 * src/conflicts.h (count_total_conflicts): New function.
14090 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
14092 * doc/bison.texinfo (Generalized LR Parsing): New section.
14093 (GLR Parsers): New section.
14094 (Language and Grammar): Mention GLR parsing.
14095 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
14096 Correct typo ("tge" -> "the").
14098 * data/bison.glr: New skeleton for GLR parsing.
14100 * tests/cxx-gram.at: New tests for GLR parsing.
14102 * tests/testsuite.at: Include cxx-gram.at.
14104 * tests/Makefile.am: Add cxx-gram.at.
14106 * src/parse-gram.y:
14108 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
14110 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
14112 2002-06-27 Akim Demaille <akim@epita.fr>
14114 * src/options.h, src/options.c: Remove.
14115 * src/getargs.c (short_options, long_options): New.
14117 2002-06-27 Akim Demaille <akim@epita.fr>
14119 * data/bison.simple, data/bison.c++: Rename as...
14120 * data/yacc.c, data/lalr1.cc: these.
14121 * doc/bison.texinfo (Environment Variables): Remove.
14123 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
14125 * src/getargs.c (report_argmatch): Initialize strtok().
14127 2002-06-20 Akim Demaille <akim@epita.fr>
14129 * data/bison.simple (b4_symbol_actions): New, replaces...
14130 (b4_symbol_destructor, b4_symbol_printer): these.
14131 (yysymprint): Be sure to call YYPRINT only for tokens, and using
14132 user token numbers.
14134 2002-06-20 Akim Demaille <akim@epita.fr>
14136 * data/bison.simple (yydestructor): Rename as...
14137 (yydestruct): this.
14139 2002-06-20 Akim Demaille <akim@epita.fr>
14141 * src/symtab.h, src/symtab.c (symbol_type_set)
14142 (symbol_destructor_set, symbol_precedence_set): The location is
14144 Adjust all callers.
14146 2002-06-20 Akim Demaille <akim@epita.fr>
14148 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
14150 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
14152 * src/symtab.h, src/symtab.c (symbol_class_set)
14153 (symbol_user_token_number_set): Likewise.
14154 Adjust all callers.
14155 Promote complain_at.
14156 * tests/input.at (Type Clashes): Adjust.
14158 2002-06-20 Akim Demaille <akim@epita.fr>
14160 * data/bison.simple (YYLEX): Fix the declaration when
14163 2002-06-20 Akim Demaille <akim@epita.fr>
14165 * data/bison.simple (yysymprint): Don't print the token number,
14167 * tests/actions.at (Destructors): Rename as...
14168 (Printers and Destructors): this.
14169 Also exercise %printer.
14171 2002-06-20 Akim Demaille <akim@epita.fr>
14173 * data/bison.simple (YYDSYMPRINT): New.
14174 Use it to remove many of the #if YYDEBUG/if (yydebug).
14176 2002-06-20 Akim Demaille <akim@epita.fr>
14178 * src/symtab.h, src/symtab.c (symbol_t): printer and
14179 printer_location are new members.
14180 (symbol_printer_set): New.
14181 * src/parse-gram.y (PERCENT_PRINTER): New token.
14182 Handle its associated rule.
14183 * src/scan-gram.l: Adjust.
14184 (handle_destructor_at, handle_destructor_dollar): Rename as...
14185 (handle_symbol_code_at, handle_symbol_code_dollar): these.
14186 * src/output.c (symbol_printers_output): New.
14187 (output_skeleton): Call it.
14188 * data/bison.simple (yysymprint): New. Cannot be named yyprint
14189 since there are already many grammar files with a user `yyprint'.
14190 Replace the calls to YYPRINT to calls to yysymprint.
14191 * tests/calc.at: Adjust.
14192 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
14193 taking advantage of parser very internal details (stack size!).
14195 2002-06-20 Akim Demaille <akim@epita.fr>
14197 * src/scan-gram.l: Complete the scanner with the missing patterns
14199 Use `quote' and `symbol_tag_get' where appropriate.
14201 2002-06-19 Akim Demaille <akim@epita.fr>
14203 * tests/actions.at (Destructors): Augment to test locations.
14204 * data/bison.simple (yydestructor): Pass it the current location
14205 if locations are enabled.
14206 Prototype only when __STDC__ or C++.
14207 Change the argument names to move into the yy name space: there is
14210 2002-06-19 Akim Demaille <akim@epita.fr>
14212 * data/bison.simple (b4_pure_if): New.
14213 Use it instead of #ifdef YYPURE.
14215 2002-06-19 Akim Demaille <akim@epita.fr>
14217 * data/bison.simple (b4_location_if): New.
14218 Use it instead of #ifdef YYLSP_NEEDED.
14220 2002-06-19 Akim Demaille <akim@epita.fr>
14222 Prepare @$ in %destructor, but currently don't bind it in the
14223 skeleton, as %location use is not cleaned up yet.
14225 * src/scan-gram.l (handle_dollar, handle_destructor_at)
14226 (handle_action_at): New.
14227 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
14228 a braced_code_t and a location as additional arguments.
14229 (handle_destructor_dollar): Instead of requiring `b4_eval', just
14230 unquote one when outputting `b4_dollar_dollar'.
14232 * data/bison.simple (b4_eval): Remove.
14233 (b4_symbol_destructor): Adjust.
14234 * tests/input.at (Invalid @n): Adjust.
14236 2002-06-19 Zack Weinberg <zack@codesourcery.com>
14238 * doc/bison.texinfo: Document ability to have multiple
14241 2002-06-18 Akim Demaille <akim@epita.fr>
14243 * src/files.c (compute_base_names): When computing the output file
14244 names from the input file name, strip the directory part.
14246 2002-06-18 Akim Demaille <akim@epita.fr>
14248 * data/bison.simple.new: Comment changes.
14249 Reported by Andreas Schwab.
14251 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
14253 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
14254 there are no `label `yyoverflowlab' defined but not used' warnings
14255 when yyoverflow is defined.
14257 2002-06-18 Akim Demaille <akim@epita.fr>
14259 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
14261 (symbol_destructor_set): Adjust.
14262 * src/output.c (symbol_destructors_output): Output the destructor
14264 Output the symbol name.
14265 * data/bison.simple (b4_symbol_destructor): Adjust.
14267 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
14268 and Akim Demaille <akim@epita.fr>
14270 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
14271 what's left on the stack when the error recovery hits EOF.
14272 * tests/actions.at (Destructors): Complete to exercise this case.
14274 2002-06-17 Akim Demaille <akim@epita.fr>
14276 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
14277 arguments is really empty, not only equal to `[]'.
14278 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
14280 (symbol_destructor_set): New.
14281 * src/output.c (symbol_destructors_output): New.
14282 * src/reader.h (brace_code_t, current_braced_code): New.
14283 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
14284 (handle_dollar): Rename as...
14285 (handle_action_dollar): this.
14286 (handle_destructor_dollar): New.
14287 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
14288 (grammar_declaration): Use it.
14289 * data/bison.simple (yystos): Is always defined.
14290 (yydestructor): New.
14291 * tests/actions.at (Destructors): New.
14292 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
14294 2002-06-17 Akim Demaille <akim@epita.fr>
14296 * src/symlist.h, src/symlist.c (symbol_list_length): New.
14297 * src/scan-gram.l (handle_dollar, handle_at): Compute the
14298 rule_length only when needed.
14299 * src/output.c (actions_output, token_definitions_output): Output
14301 * src/symtab.c: Don't access directly to the symbol tag, use
14303 * src/parse-gram.y: Use symbol_list_free.
14305 2002-06-17 Akim Demaille <akim@epita.fr>
14307 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
14308 (symbol_list_prepend, get_type_name): Move to...
14309 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
14310 (symbol_list_prepend, symbol_list_n_type_name_get): here.
14311 Adjust all callers.
14312 (symbol_list_free): New.
14313 * src/scan-gram.l (handle_dollar): Takes a location.
14314 * tests/input.at (Invalid $n): Adjust.
14316 2002-06-17 Akim Demaille <akim@epita.fr>
14318 * src/reader.h, src/reader.c (symbol_list_new): Export it.
14319 (symbol_list_prepend): New.
14320 * src/parse-gram.y (%union): `list' is a new member.
14321 (symbols.1): New, replaces...
14322 (terms_to_prec.1, nterms_to_type.1): these.
14323 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
14324 Take a location as additional argument.
14325 Adjust all callers.
14327 2002-06-15 Akim Demaille <akim@epita.fr>
14329 * src/parse-gram.y: Move %token in the declaration section so that
14330 we don't depend upon CVS Bison.
14332 2002-06-15 Akim Demaille <akim@epita.fr>
14334 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
14335 * src/print.c (print_core): Use it.
14337 2002-06-15 Akim Demaille <akim@epita.fr>
14339 * src/conflicts.c (log_resolution): Accept the rule involved in
14340 the sr conflicts instead of the lookahead number that points to
14342 (flush_reduce): Accept the current lookahead vector as argument,
14343 instead of the index in LA.
14344 (resolve_sr_conflict): Accept the current number of lookahead
14345 bitset to consider for the STATE, instead of the index in LA.
14346 (set_conflicts): Adjust.
14347 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
14349 2002-06-15 Akim Demaille <akim@epita.fr>
14351 * src/state.h (state_t): Replace the `lookaheadsp' member, a
14352 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
14353 Adjust all dependencies.
14354 * src/lalr.c (initialize_lookaheads): Split into...
14355 (states_lookaheads_count, states_lookaheads_initialize): these.
14358 2002-06-15 Akim Demaille <akim@epita.fr>
14360 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
14362 (grammar_rules_print): here.
14363 * src/reduce.c (reduce_output): Use it.
14364 * tests/reduce.at (Useless Rules, Reduced Automaton)
14365 (Underivable Rules): Adjust.
14367 2002-06-15 Akim Demaille <akim@epita.fr>
14369 Copy BYacc's nice way to report the grammar.
14371 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
14373 Don't print the rules' location, it is confusing and useless.
14374 (rule_print): Use grammar_rhs_print.
14375 * src/print.c (print_grammar): Use grammar_rules_print.
14377 2002-06-15 Akim Demaille <akim@epita.fr>
14379 Complete and rationalize `useless thing' warnings.
14381 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
14382 (symbol_tag_print): New.
14383 Use them everywhere in place of accessing directly the tag member.
14384 * src/gram.h, src/gram.c (rule_print): New.
14385 Use it where a rule used to be printed `by hand'.
14386 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
14387 (reduce_grammar_tables): Report the useless rules.
14388 (reduce_print): Useless things are a warning, not an error.
14390 * tests/reduce.at (Useless Nonterminals, Useless Rules):
14391 (Reduced Automaton, Underivable Rules): Adjust.
14392 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
14393 * tests/conflicts.at (Unresolved SR Conflicts)
14394 (Solved SR Conflicts): Adjust.
14396 2002-06-15 Akim Demaille <akim@epita.fr>
14398 Let symbols have a location.
14400 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
14402 Adjust all callers.
14403 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
14404 Use location_t, not int.
14405 * src/symtab.c (symbol_check_defined): Take advantage of the
14407 * tests/regression.at (Invalid inputs): Adjust.
14409 2002-06-15 Akim Demaille <akim@epita.fr>
14411 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
14412 (input): Don't try to initialize yylloc here, do it in the
14414 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
14415 * src/gram.h (rule_t): Change line and action_line into location
14416 and action_location, of location_t type.
14417 Adjust all dependencies.
14418 * src/location.h, src/location.c (empty_location): New.
14419 * src/reader.h, src/reader.c (grammar_start_symbol_set)
14420 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
14421 (grammar_current_rule_symbol_append)
14422 (grammar_current_rule_action_append): Expect a location as argument.
14423 * src/reader.c (grammar_midrule_action): Adjust to attach an
14424 action's location as dummy symbol location.
14425 * src/symtab.h, src/symtab.c (startsymbol_location): New.
14426 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
14429 2002-06-14 Akim Demaille <akim@epita.fr>
14431 Grammar declarations may be found in the grammar section.
14433 * src/parse-gram.y (rules_or_grammar_declaration): New.
14434 (declarations): Each declaration may end with a semicolon, not
14436 (grammar_declaration): `"%union"'.
14437 (grammar): Branch to rules_or_grammar_declaration.
14439 2002-06-14 Akim Demaille <akim@epita.fr>
14441 * src/main.c (main): Invoke scanner_free.
14443 2002-06-14 Akim Demaille <akim@epita.fr>
14445 * src/output.c (m4_invoke): Extracted from...
14446 (output_skeleton): here.
14449 2002-06-14 Akim Demaille <akim@epita.fr>
14451 * src/parse-gram.y (directives, directive, gram)
14452 (grammar_directives, precedence_directives, precedence_directive):
14454 (declarations, declaration, grammar, grammar_declaration)
14455 (precedence_declaration, precedence_declarator): these.
14456 (symbol_declaration): New.
14458 2002-06-14 Akim Demaille <akim@epita.fr>
14460 * src/files.c (action_obstack): Remove, unused.
14461 (output_obstack): Remove it, and all its dependencies, as it is no
14463 * src/reader.c (epilogue_set): Build the epilogue in the
14465 * src/output.h, src/output.c (muscle_obstack): Move to...
14466 * src/muscle_tab.h, src/muscle_tab.h: here.
14467 (muscle_init): Initialize muscle_obstack.
14468 (muscle_free): New.
14469 * src/main.c (main): Call it.
14471 2002-06-14 Akim Demaille <akim@epita.fr>
14473 * src/location.h: New, extracted from...
14474 * src/reader.h: here.
14475 * src/Makefile.am (noinst_HEADERS): Merge into
14476 (bison_SOURCES): this.
14478 * src/parse-gram.y: Use location_t instead of Bison's.
14479 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
14480 Use location_t instead of ints.
14482 2002-06-14 Akim Demaille <akim@epita.fr>
14484 * data/bison.simple, data/bison.c++: Be sure to restore the
14485 current #line when returning to the skeleton contents after having
14486 exposed the input file's #line.
14488 2002-06-12 Akim Demaille <akim@epita.fr>
14490 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
14492 * tests/actions.at (Exotic Dollars): New.
14494 2002-06-12 Akim Demaille <akim@epita.fr>
14496 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
14498 * tests/input.at (Torturing the Scanner): New.
14500 2002-06-11 Akim Demaille <akim@epita.fr>
14502 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
14503 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
14504 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
14505 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
14506 * src/reader.c (reader): Use it.
14508 2002-06-11 Akim Demaille <akim@epita.fr>
14510 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
14511 Adjust all callers.
14512 (scanner_last_string_free): New.
14514 2002-06-11 Akim Demaille <akim@epita.fr>
14516 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
14517 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
14518 (last_string, YY_OBS_FREE): New.
14519 Use them when returning an ID.
14521 2002-06-11 Akim Demaille <akim@epita.fr>
14523 Have Bison grammars parsed by a Bison grammar.
14525 * src/reader.c, src/reader.h (prologue_augment): New.
14526 * src/reader.c (copy_definition): Remove.
14528 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
14529 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
14530 (grammar_current_rule_prec_set, grammar_current_rule_check)
14531 (grammar_current_rule_symbol_append)
14532 (grammar_current_rule_action_append): Export.
14533 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
14534 (symbol_list_action_append): Remove.
14535 Hook the routines from reader.
14536 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
14537 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
14539 * src/reader.c (read_declarations): Remove, unused.
14541 * src/parse-gram.y: Handle the epilogue.
14542 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
14543 (grammar_start_symbol_set): this.
14544 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
14545 * src/reader.c (readgram): Remove, unused.
14546 (reader): Adjust to insert eoftoken and axiom where appropriate.
14548 * src/reader.c (copy_dollar): Replace with...
14549 * src/scan-gram.h (handle_dollar): this.
14550 * src/parse-gram.y: Remove `%thong'.
14552 * src/reader.c (copy_at): Replace with...
14553 * src/scan-gram.h (handle_at): this.
14555 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
14558 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
14561 * src/reader.h, src/reader.c (grammar_rule_end): New.
14563 * src/parse.y (current_type, current_class): New.
14564 Implement `%nterm', `%token' support.
14565 Merge `%term' into `%token'.
14566 (string_as_id): New.
14567 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
14570 * src/parse-gram.y: Be sure to handle properly the beginning of
14573 * src/parse-gram.y: Handle %type.
14574 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
14576 * src/parse-gram.y: More directives support.
14577 * src/options.c: No longer handle source directives.
14579 * src/parse-gram.y: Fix %output.
14581 * src/parse-gram.y: Handle %union.
14582 Use the prologue locations.
14583 * src/reader.c (parse_union_decl): Remove.
14585 * src/reader.h, src/reader.c (epilogue_set): New.
14586 * src/parse-gram.y: Use it.
14588 * data/bison.simple, data/bison.c++: b4_stype is now either not
14589 defined, then default to int, or to the contents of %union,
14590 without `union' itself.
14592 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
14594 * src/output.c (actions_output): Don't output braces, as they are
14595 already handled by the scanner.
14597 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
14598 characters to themselves.
14600 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
14601 that the epilogue has a proper #line.
14603 * src/parse-gram.y: Handle precedence/associativity.
14605 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
14607 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
14608 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
14609 at all to define terminals that cannot be emitted.
14611 * src/scan-gram.l: Escape M4 characters.
14613 * src/scan-gram.l: Working properly with escapes in user
14614 strings/characters.
14616 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
14617 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
14619 Use more modest sizes, as for the time being the parser does not
14620 release memory, and therefore the process swallows a huge amount
14623 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
14624 stricter %token grammar.
14626 * src/symtab.h (associativity): Add `undef_assoc'.
14627 (symbol_precedence_set): Do nothing when passed an undef_assoc.
14628 * src/symtab.c (symbol_check_alias_consistence): Adjust.
14630 * tests/regression.at (Invalid %directive): Remove, as it is now
14632 (Invalid inputs): Adjust to the new error messages.
14633 (Token definitions): The new grammar doesn't allow too many
14636 * src/lex.h, src/lex.c: Remove.
14637 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
14638 (copy_character, copy_string2, copy_string, copy_identifier)
14639 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
14640 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
14641 (parse_action): Remove.
14642 * po/POTFILES.in: Adjust.
14644 2002-06-11 Akim Demaille <akim@epita.fr>
14646 * src/reader.c (parse_action): Don't store directly into the
14647 rule's action member: return the action as a string.
14648 Don't require `rule_length' as an argument: compute it.
14649 (grammar_current_rule_symbol_append)
14650 (grammar_current_rule_action_append): New, eved out from
14652 Remove `action_flag', `rulelength', unused now.
14654 2002-06-11 Akim Demaille <akim@epita.fr>
14656 * src/reader.c (grammar_current_rule_prec_set).
14657 (grammar_current_rule_check): New, eved out from...
14659 Remove `xaction', `first_rhs': useless.
14660 * tests/input.at (Type clashes): New.
14661 * tests/existing.at (GNU Cim Grammar): Adjust.
14663 2002-06-11 Akim Demaille <akim@epita.fr>
14665 * src/reader.c (grammar_midrule_action): New, Eved out from
14668 2002-06-11 Akim Demaille <akim@epita.fr>
14670 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
14672 (readgram): Use them as replacement of inlined code, crule and
14675 2002-06-11 Akim Demaille <akim@epita.fr>
14677 * src/reader.c (grammar_end, grammar_symbol_append): New.
14678 (readgram): Use them.
14679 Make the use of `p' as local as possible.
14681 2002-06-10 Akim Demaille <akim@epita.fr>
14683 GCJ's parser requires the tokens to be defined before the prologue.
14685 * data/bison.simple: Output the token definition before the user's
14687 * tests/regression.at (Braces parsing, Duplicate string)
14688 (Mixing %token styles): Check the output from bison.
14689 (Early token definitions): New.
14691 2002-06-10 Akim Demaille <akim@epita.fr>
14693 * src/symtab.c (symbol_user_token_number_set): Don't complain when
14694 assigning twice the same user number to a token, so that we can
14696 * src/lex.c (lex): here.
14697 Also use `symbol_class_set' instead of hand written code.
14698 * src/reader.c (parse_assoc_decl): Likewise.
14700 2002-06-10 Akim Demaille <akim@epita.fr>
14702 * src/symtab.c, src/symtab.c (symbol_class_set)
14703 (symbol_user_token_number_set): New.
14704 * src/reader.c (parse_token_decl): Use them.
14705 Use a switch instead of ifs.
14706 Use a single argument.
14708 2002-06-10 Akim Demaille <akim@epita.fr>
14710 Remove `%thong' support as it is undocumented, unused, duplicates
14711 `%token's job, and creates useless e-mail traffic with people who
14712 want to know what it is, why it is undocumented, unused, and
14713 duplicates `%token's job.
14715 * src/reader.c (parse_thong_decl): Remove.
14716 * src/options.c (option_table): Remove "thong".
14717 * src/lex.h (tok_thong): Remove.
14719 2002-06-10 Akim Demaille <akim@epita.fr>
14721 * src/symtab.c, src/symtab.c (symbol_type_set)
14722 (symbol_precedence_set): New.
14723 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
14724 (value_components_used): Remove, unused.
14726 2002-06-09 Akim Demaille <akim@epita.fr>
14728 Move symbols handling code out of the reader.
14730 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
14731 (axiom): Move to...
14732 * src/symtab.h, src/symtab.c: here.
14734 * src/gram.c (start_symbol): Remove: use startsymbol->number.
14735 * src/reader.c (startval): Rename as...
14736 * src/symtab.h, src/symtab.c (startsymbol): this.
14737 * src/reader.c: Adjust.
14739 * src/reader.c (symbol_check_defined, symbol_make_alias)
14740 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
14741 (token_translations_init)
14743 * src/symtab.c: here.
14744 * src/reader.c (packsymbols): Move to...
14745 * src/symtab.h, src/symtab.c (symbols_pack): here.
14746 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
14749 2002-06-03 Akim Demaille <akim@epita.fr>
14751 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
14754 2002-06-03 Akim Demaille <akim@epita.fr>
14756 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
14757 structs with non literals.
14758 * src/scan-skel.l: never-interactive.
14759 * src/conflicts.c (enum conflict_resolution_e): No trailing
14761 * src/getargs.c (usage): Split long literal strings.
14762 Reported by Hans Aberg.
14764 2002-05-28 Akim Demaille <akim@epita.fr>
14766 * data/bison.c++: Use C++ ostreams.
14767 (cdebug_): New member.
14769 2002-05-28 Akim Demaille <akim@epita.fr>
14771 * src/output.c (output_skeleton): Be sure to allocate enough room
14772 for `/' _and_ for `\0' in full_skeleton.
14774 2002-05-28 Akim Demaille <akim@epita.fr>
14776 * data/bison.c++: Catch up with bison.simple:
14777 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14778 and Paul Eggert <eggert@twinsun.com>: `error' handing.
14779 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
14780 and popping traces.
14782 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14784 * src/output.c (output_skeleton): Put an explicit path in front of
14785 the skeleton file name, rather than relying on the -I directory,
14786 to partially alleviate effects of having a skeleton file lying around
14787 in the current directory.
14789 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14791 * src/conflicts.c (log_resolution): Correct typo:
14792 obstack_printf should be obstack_fgrow1.
14794 2002-05-26 Akim Demaille <akim@epita.fr>
14796 * src/state.h (state_t): `solved_conflicts' is a new member.
14797 * src/LR0.c (new_state): Set it to 0.
14798 * src/conflicts.h, src/conflicts.c (print_conflicts)
14799 (free_conflicts, solve_conflicts): Rename as...
14800 (conflicts_print, conflicts_free, conflicts_solve): these.
14802 * src/conflicts.c (enum conflict_resolution_e)
14803 (solved_conflicts_obstack): New, used by...
14804 (log_resolution): this.
14805 Adjust to attach the conflict resolution to each state.
14806 Complete the description with the precedence/associativity
14808 (resolve_sr_conflict): Adjust.
14809 * src/print.c (print_state): Output its solved_conflicts.
14810 * tests/conflicts.at (Unresolved SR Conflicts)
14811 (Solved SR Conflicts): Exercise --report=all.
14813 2002-05-26 Akim Demaille <akim@epita.fr>
14815 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
14816 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
14817 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
14818 (token_number_t, item_number_as_token_number)
14819 (token_number_as_item_number, muscle_insert_token_number_table):
14821 (symbol_number_t, item_number_as_symbol_number)
14822 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
14823 these, since it is more appropriate.
14825 2002-05-26 Akim Demaille <akim@epita.fr>
14827 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
14829 * data/bison.simple (yystos) [YYDEBUG]: New.
14830 (yyparse) [YYDEBUG]: Display the symbols which are popped during
14832 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
14834 2002-05-25 Akim Demaille <akim@epita.fr>
14836 * doc/bison.texinfo (Debugging): Split into...
14837 (Tracing): this new section, its former contents, and...
14838 (Understanding): this new section.
14839 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
14841 (report_flag): this.
14842 Adjust all dependencies.
14843 (report_args, report_types, report_argmatch): New.
14844 (usage, getargs): Report/support -r, --report.
14846 (struct option_table_struct): Rename as..,
14847 (struct option_table_s): this.
14848 Rename the `set_flag' member to `flag' to match with getopt_long's
14850 * src/options.c (option_table): Split verbose into an entry for
14851 %verbose, and another for --verbose.
14852 Support --report/-r, so remove -r from the obsolete --raw.
14853 * src/print.c: Attach full item sets and lookaheads reports to
14854 report_flag instead of trace_flag.
14855 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
14857 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14858 and Paul Eggert <eggert@twinsun.com>
14860 * data/bison.simple (yyparse): Correct error handling to conform to
14861 POSIX and yacc. Specifically, after syntax error is discovered,
14862 do not reduce further before shifting the error token.
14863 Clean up the code a bit by removing the labels yyerrdefault,
14864 yyerrhandle, yyerrpop.
14865 * NEWS: Document the above.
14867 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14869 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
14870 type; it isn't always big enough, since it doesn't necessarily
14871 include non-terminals.
14872 (yytranslate): Expand definition of yy_token_number_type, so that
14873 the latter can be removed.
14874 (yy_token_number_type): Remove, only one use.
14875 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
14876 don't use TokenNumberType as element type.
14878 * tests/regression.at: Modify expected output to agree with change
14879 to yyr1 and yytranslate.
14881 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
14883 * src/reader.c (parse_action): Use copy_character instead of
14886 2002-05-13 Akim Demaille <akim@epita.fr>
14888 * tests/regression.at (Token definitions): Prototype yylex and
14891 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14893 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
14894 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
14896 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
14898 2002-05-07 Akim Demaille <akim@epita.fr>
14900 * tests/synclines.at: Be sure to prototype yylex and yyerror to
14901 avoid GCC warnings.
14903 2002-05-07 Akim Demaille <akim@epita.fr>
14907 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
14908 over the RHS of each rule.
14909 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
14910 * src/state.h (state_t): Member `nitems' is unsigned short.
14911 * src/LR0.c (get_state): Adjust.
14912 * src/reader.c (packgram): Likewise.
14913 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
14915 (muscle_insert_int_table): Remove, unused.
14916 (prepare_rules): Remove `max'.
14918 2002-05-06 Akim Demaille <akim@epita.fr>
14920 * src/closure.c (print_firsts): Display of the symbol tags.
14921 (bitmatrix_print): Move to...
14922 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
14924 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
14926 2002-05-06 Akim Demaille <akim@epita.fr>
14928 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
14931 2002-05-06 Akim Demaille <akim@epita.fr>
14933 * src/LR0.c (new_state, get_state): Instead of using the global
14934 `kernel_size' and `kernel_base', have two new arguments:
14935 `core_size' and `core'.
14938 2002-05-06 Akim Demaille <akim@epita.fr>
14940 * src/reader.c (packgram): No longer end `ritem' with a 0
14941 sentinel: it is not used.
14943 2002-05-05 Akim Demaille <akim@epita.fr>
14945 New experimental feature: display the lookaheads in the report and
14948 * src/print (print_core): When --trace-flag, display the rules
14950 * src/print_graph.c (print_core): Likewise.
14951 Swap the arguments.
14954 2002-05-05 Akim Demaille <akim@epita.fr>
14956 * tests/torture.at (Many lookaheads): New test.
14958 2002-05-05 Akim Demaille <akim@epita.fr>
14960 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
14961 (GENERATE_MUSCLE_INSERT_TABLE): this.
14962 (output_int_table, output_unsigned_int_table, output_short_table)
14963 (output_token_number_table, output_item_number_table): Replace with...
14964 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
14965 (muscle_insert_short_table, muscle_insert_token_number_table)
14966 (muscle_insert_item_number_table): these.
14967 Adjust all callers.
14968 (prepare_tokens): Don't free `translations', since...
14969 * src/reader.h, src/reader.c (grammar_free): do it.
14971 * src/gram.h, src/gram.c (grammar_free): here.
14972 * data/bison.simple, data/bison.c++: b4_token_number_max is now
14975 2002-05-05 Akim Demaille <akim@epita.fr>
14977 * src/output.c (output_unsigned_int_table): New.
14978 (prepare_rules): `i' is unsigned.
14979 `prhs', `rline', `r2' are unsigned int.
14980 Rename muscle `rhs_number_max' as `rhs_max'.
14981 Output muscles `prhs_max', `rline_max', and `r2_max'.
14983 * data/bison.simple, data/bison.c++: Adjust to use these muscles
14984 to compute types instead of constant types.
14985 * tests/regression.at (Web2c Actions): Adjust.
14987 2002-05-04 Akim Demaille <akim@epita.fr>
14989 * src/symtab.h (SALIAS, SUNDEF): Rename as...
14990 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
14991 Adjust dependencies.
14992 * src/output.c (token_definitions_output): Be sure not to output a
14993 `#define 'a'' when fed with `%token 'a' "a"'.
14994 * tests/regression.at (Token definitions): New.
14996 2002-05-03 Paul Eggert <eggert@twinsun.com>
14998 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
15001 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
15003 * Makefile.am (SUBDIRS): Remove intl.
15004 (EXTRA_DIST): Add config/config.rpath.
15006 2002-05-03 Akim Demaille <akim@epita.fr>
15008 * data/bison.simple (m4_if): Don't output empty enums.
15009 And actually, output valid enum definitions :(.
15011 2002-05-03 Akim Demaille <akim@epita.fr>
15013 * configure.bat: Remove, completely obsolete.
15014 * Makefile.am (EXTRA_DIST): Adjust.
15015 Don't distribute config.rpath...
15016 * config/Makefile.am (EXTRA_DIST): Do it.
15018 2002-05-03 Akim Demaille <akim@epita.fr>
15020 * configure.in (GETTEXT_VERSION): New.
15021 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
15023 2002-05-03 Akim Demaille <akim@epita.fr>
15025 * data/bison.simple (b4_token_enum): New.
15026 (b4_token_defines): Use it to output tokens both as #define and
15028 Suggested by Paul Eggert.
15029 * src/output.c (token_definitions_output): Don't output spurious
15032 2002-05-03 Akim Demaille <akim@epita.fr>
15034 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
15036 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
15038 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
15039 Update the stack class, give a try to deque as the default container.
15041 2002-05-02 Akim Demaille <akim@epita.fr>
15043 * data/bison.simple (yyparse): Do not implement @$ = @1.
15044 (YYLLOC_DEFAULT): Adjust to do it.
15045 * doc/bison.texinfo (Location Default Action): Fix.
15047 2002-05-02 Akim Demaille <akim@epita.fr>
15049 * src/reader.c (parse_braces): Merge into...
15050 (parse_action): this.
15052 2002-05-02 Akim Demaille <akim@epita.fr>
15054 * configure.in (ALL_LINGUAS): Remove.
15055 * po/LINGUAS, hr.po: New.
15057 2002-05-02 Akim Demaille <akim@epita.fr>
15059 Remove the so called hairy (semantic) parsers.
15061 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
15062 * src/gram.h, src/gram.c (semantic_parser): Remove.
15063 (rule_t): Remove the guard and guard_line members.
15064 * src/lex.h (token_t): remove tok_guard.
15065 * src/options.c (option_table): Remove %guard and %semantic_parser
15067 * src/output.c, src/output.h (guards_output): Remove.
15069 (token_definitions_output): Don't output the `T'
15071 (output_skeleton): Don't output the guards.
15072 * src/files.c, src/files.c (attrsfile): Remove.
15073 * src/reader.c (symbol_list): Remove the guard and guard_line
15075 Adjust dependencies.
15076 (parse_guard): Remove.
15077 * data/bison.hairy: Remove.
15078 * doc/bison.texinfo (Environment Variables): Remove occurrences of
15081 2002-05-02 Akim Demaille <akim@epita.fr>
15083 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
15084 (parse_guard): Rename the formal argument `stack_offset' as
15085 `rule_length', which is more readable.
15087 (copy_at, copy_dollar): Instead of outputting the hard coded
15088 values of $$, $n and so forth, output invocation to b4_lhs_value,
15089 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
15090 Note: this patch partially drops `semantic-parser' support: it
15091 always does `rule_length - n', where semantic parsers ought to
15093 * data/bison.simple, data/bison.c++ (b4_lhs_value)
15094 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
15096 2002-05-02 Akim Demaille <akim@epita.fr>
15098 * configure.in (AC_INIT): Bump to 1.49b.
15099 (AM_INIT_AUTOMAKE): Short invocation.
15101 2002-05-02 Akim Demaille <akim@epita.fr>
15105 2002-05-01 Akim Demaille <akim@epita.fr>
15107 * src/skeleton.h: Remove.
15109 2002-05-01 Akim Demaille <akim@epita.fr>
15111 * src/skeleton.h: Fix the #endif.
15112 Reported by Magnus Fromreide.
15114 2002-04-26 Paul Eggert <eggert@twinsun.com>
15116 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
15117 Define if we define YYSTYPE and YYLTYPE, respectively.
15118 (YYCOPY): Fix [] quoting problem in the non-GCC case.
15120 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
15122 * src/scan-skel.l: Postprocess quadrigraphs.
15124 * src/reader.c (copy_character): New function, used to output
15125 single characters while replacing `[' and `]' with quadrigraphs, to
15126 avoid troubles with M4 quotes.
15127 (copy_comment): Output characters with copy_character.
15128 (read_additionnal_code): Likewise.
15129 (copy_string2): Likewise.
15130 (copy_definition): Likewise.
15132 * tests/calc.at: Exercise M4 quoting.
15134 2002-04-25 Akim Demaille <akim@epita.fr>
15136 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
15137 between `!' and the command.
15138 Reported by Paul Eggert.
15140 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
15142 * tests/calc.at: Exercise prologue splitting.
15144 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
15145 `b4_post_prologue' instead of `b4_prologue'.
15147 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
15149 (output): Free pre_prologue_obstack and post_prologue_obstack.
15150 * src/files.h, src/files.c (attrs_obstack): Remove.
15151 (pre_prologue_obstack, post_prologue_obstack): New.
15152 * src/reader.c (copy_definition): Add a parameter to specify the
15153 obstack to fill, instead of using attrs_obstack unconditionally.
15154 (read_declarations): Pass pre_prologue_obstack to copy_definition if
15155 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
15157 2002-04-23 Paul Eggert <eggert@twinsun.com>
15159 * data/bison.simple: Remove unnecessary commentary and white
15160 space differences from 1_29-branch.
15161 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
15163 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
15164 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
15165 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
15166 constructors or destructors.
15168 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
15170 2002-04-23 Akim Demaille <akim@epita.fr>
15172 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
15173 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
15174 location with columns.
15175 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
15176 All reported by Paul Eggert.
15178 2002-04-22 Akim Demaille <akim@epita.fr>
15180 * src/reduce.c (dump_grammar): Move to...
15181 * src/gram.h, src/gram.c (grammar_dump): here.
15182 Be sure to separate long item numbers.
15183 Don't read the members of a rule's prec if its nil.
15185 2002-04-22 Akim Demaille <akim@epita.fr>
15187 * src/output.c (table_size, table_grow): New.
15188 (MAXTABLE): Remove, replace uses with table_size.
15189 (pack_vector): Instead of dying when the table is too big, grow it.
15191 2002-04-22 Akim Demaille <akim@epita.fr>
15193 * data/bison.simple (yyr1): Its type is that of a token number.
15194 * data/bison.c++ (r1_): Likewise.
15195 * tests/regression.at (Web2c Actions): Adjust.
15197 2002-04-22 Akim Demaille <akim@epita.fr>
15199 * src/reader.c (token_translations_init): 256 is now the default
15200 value for the error token, i.e., it will be assigned another
15201 number if the user assigned 256 to one of her tokens.
15202 (reader): Don't force 256 to error.
15203 * doc/bison.texinfo (Symbols): Adjust.
15204 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
15205 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
15206 etc. instead of 10, 20, 30 (which was used to `jump' over error
15207 (256) and undefined (2)).
15209 2002-04-22 Akim Demaille <akim@epita.fr>
15211 Propagate more token_number_t.
15213 * src/gram.h (token_number_as_item_number)
15214 (item_number_as_token_number): New.
15215 * src/output.c (GENERATE_OUTPUT_TABLE): New.
15216 Use it to create output_item_number_table and
15217 output_token_number_table.
15218 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15219 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
15220 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
15221 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
15223 2002-04-22 Akim Demaille <akim@epita.fr>
15225 * src/output.h, src/output.c (get_lines_number): Remove.
15227 2002-04-19 Akim Demaille <akim@epita.fr>
15229 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
15231 (Debugging): More details about enabling the debugging features.
15232 (Table of Symbols): Describe $$, $n, @$, and @n.
15233 Suggested by Tim Josling.
15235 2002-04-19 Akim Demaille <akim@epita.fr>
15237 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
15239 2002-04-10 Akim Demaille <akim@epita.fr>
15241 * src/system.h: Rely on HAVE_LIMITS_H.
15242 Suggested by Paul Eggert.
15244 2002-04-09 Akim Demaille <akim@epita.fr>
15246 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
15247 full stderr, and strip it according to the bison options, instead
15248 of composing the error message from different bits.
15249 This makes it easier to check for several error messages.
15250 Adjust all the invocations.
15251 Add an invocation exercising the error token.
15252 Add an invocation demonstrating a stupid error message.
15253 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
15255 Error message are for stderr, not stdout.
15257 2002-04-09 Akim Demaille <akim@epita.fr>
15259 * src/gram.h, src/gram.c (error_token_number): Remove, use
15261 * src/reader.c (reader): Don't specify the user token number (2)
15262 for $undefined, as it uselessly prevents using it.
15263 * src/gram.h (token_number_t): Move to...
15264 * src/symtab.h: here.
15265 (state_t.number): Is a token_number_t.
15266 * src/print.c, src/reader.c: Use undeftoken->number instead of
15268 (Even though this 2 is not the same as above: the number of the
15269 undeftoken remains being 2, it is its user token number which
15271 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
15272 `user_token_number_max'.
15273 Output `undef_token_number'.
15274 * data/bison.simple, data/bison.c++: Use them.
15275 Be sure to map invalid yylex return values to
15276 `undef_token_number'. This saves us from gratuitous SEGV.
15278 * tests/conflicts.at (Solved SR Conflicts)
15279 (Unresolved SR Conflicts): Adjust.
15280 * tests/regression.at (Web2c Actions): Adjust.
15282 2002-04-08 Akim Demaille <akim@epita.fr>
15284 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
15286 Remove the duplicate `typedefs'.
15287 (RhsNumberType): Fix the declaration and various other typos.
15289 * data/bison.simple: Use __ofile__.
15290 * src/scan-skel.l: Handle __ofile__.
15292 2002-04-08 Akim Demaille <akim@epita.fr>
15294 * src/gram.h (item_number_t): New, the type of item numbers in
15295 RITEM. Note that it must be able to code symbol numbers as
15296 positive number, and the negation of rule numbers as negative
15298 Adjust all dependencies (pretty many).
15299 * src/reduce.c (rule): Remove this `short *' pointer: use
15301 * src/system.h (MINSHORT, MAXSHORT): Remove.
15302 Include `limits.h'.
15303 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
15304 (shortcpy): Remove.
15305 (MAXTABLE): Move to...
15306 * src/output.c (MAXTABLE): here.
15307 (prepare_rules): Use output_int_table to output rhs.
15308 * data/bison.simple, data/bison.c++: Adjust.
15309 * tests/torture.at (Big triangle): Move the limit from 254 to
15311 * tests/regression.at (Web2c Actions): Ajust.
15313 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
15314 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
15315 passes, but produces negative #line number, once fixed, GCC is
15316 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
15318 * src/state.h (state_h): Code input lines on ints, not shorts.
15320 2002-04-08 Akim Demaille <akim@epita.fr>
15322 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
15323 and then the grammar.
15325 2002-04-08 Akim Demaille <akim@epita.fr>
15327 * src/system.h: No longer using strndup.
15329 2002-04-07 Akim Demaille <akim@epita.fr>
15331 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
15332 * src/output.c (output_table_data): Return the longest number.
15333 (prepare_tokens): Output `token_number_max').
15334 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
15336 Use them to define yy_token_number_type/TokenNumberType.
15337 Use this type for yytranslate.
15338 * tests/torture.at (Big triangle): Push the limit from 124 to
15340 * tests/regression.at (Web2c Actions): Adjust.
15342 2002-04-07 Akim Demaille <akim@epita.fr>
15344 * tests/torture.at (Big triangle): New.
15345 (GNU AWK Grammar, GNU Cim Grammar): Move to...
15346 * tests/existing.at: here.
15348 2002-04-07 Akim Demaille <akim@epita.fr>
15350 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
15352 Adjust dependencies.
15354 2002-04-07 Akim Demaille <akim@epita.fr>
15356 * src/reader.c: Normalize increments to prefix form.
15358 2002-04-07 Akim Demaille <akim@epita.fr>
15360 * src/reader.c, symtab.c: Remove debugging code.
15362 2002-04-07 Akim Demaille <akim@epita.fr>
15364 Rename all the `bucket's as `symbol_t'.
15366 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
15367 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
15368 * src/symtab.c, src/symtab.h (bucket): Rename as...
15370 (symbol_list_new, bucket_check_defined, bucket_make_alias)
15371 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
15372 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
15373 (buckets_new, buckets_free, buckets_do): Rename as...
15374 (symbol_list_new, symbol_check_defined, symbol_make_alias)
15375 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
15376 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
15377 (symbols_new, symbols_free, symbols_do): these.
15379 2002-04-07 Akim Demaille <akim@epita.fr>
15381 Use lib/hash for the symbol table.
15383 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
15385 * src/lex.c (lex): Set the `number' member of new terminals.
15386 * src/reader.c (bucket_check_defined, bucket_make_alias)
15387 (bucket_check_alias_consistence, bucket_translation): New.
15388 (reader, grammar_free, readgram, token_translations_init)
15389 (packsymbols): Adjust.
15390 (reader): Number the predefined tokens.
15391 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
15392 for predefined tokens.
15393 * src/symtab.h (bucket): Remove all the hash table related
15395 * src/symtab.c (symtab): Replace by...
15396 (bucket_table): this.
15397 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
15398 (buckets_new, buckets_do): New.
15400 2002-04-07 Akim Demaille <akim@epita.fr>
15402 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
15403 (start_symbol, max_user_token_number, semantic_parser)
15404 (error_token_number): Initialize.
15405 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
15408 (errtoken, eoftoken, undeftoken, axiom): Extern.
15410 2002-04-07 Akim Demaille <akim@epita.fr>
15412 * src/gram.h (rule_s): prec and precsym are now pointers
15413 to the bucket giving the priority/associativity.
15414 Member `associativity' removed: useless.
15415 * src/reduce.c, src/conflicts.c: Adjust.
15417 2002-04-07 Akim Demaille <akim@epita.fr>
15419 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
15420 Properly escape the symbols' TAG when outputting them.
15422 2002-04-07 Akim Demaille <akim@epita.fr>
15424 * src/lalr.h (LA): Is a bitsetv, not bitset*.
15426 2002-04-07 Akim Demaille <akim@epita.fr>
15428 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
15429 (LArule): this, which is an array to rule_t*.
15430 * src/print.c, src/conflicts.c: Adjust.
15432 2002-04-07 Akim Demaille <akim@epita.fr>
15434 * src/gram.h (rule_t): Rename `number' as `user_number'.
15435 `number' is a new member.
15436 Adjust dependencies.
15437 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
15439 2002-04-07 Akim Demaille <akim@epita.fr>
15441 As a result of the previous patch, it is no longer needed
15442 to reorder ritem itself.
15444 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
15446 2002-04-07 Akim Demaille <akim@epita.fr>
15448 Be sure never to walk through RITEMS, but use only data related to
15449 the rules themselves. RITEMS should be banished.
15451 * src/output.c (output_token_translations): Rename as...
15452 (prepare_tokens): this.
15453 In addition to `translate', prepare the muscles `tname' and
15454 `toknum', which were handled by...
15455 (output_rule_data): this.
15456 Remove, and move the remainder of its outputs into...
15457 (prepare_rules): this new routines, which also merges content from
15458 (output_gram): this.
15459 (prepare_rules): Be sure never to walk through RITEMS.
15460 (output_stos): Rename as...
15461 (prepare_stos): this.
15462 (output): Always invoke prepare_states, after all, just don't use it
15463 in the output if you don't need it.
15465 2002-04-07 Akim Demaille <akim@epita.fr>
15467 * src/LR0.c (new_state): Display `nstates' as the name of the
15468 newly created state.
15469 Adjust to initialize first_state and last_state if needed.
15470 Be sure to distinguish the initial from the final state.
15471 (new_states): Create the itemset of the initial state, and use
15473 * src/closure.c (closure): Now that the initial state has its
15474 items properly set, there is no need for a special case when
15475 creating `ruleset'.
15477 As a result, now the rule 0, reducing to $axiom, is visible in the
15478 outputs. Adjust the test suite.
15480 * tests/conflicts.at (Solved SR Conflicts)
15481 (Unresolved SR Conflicts): Adjust.
15482 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
15483 * tests/conflicts.at (S/R in initial): New.
15485 2002-04-07 Akim Demaille <akim@epita.fr>
15487 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
15488 the RHS of the rules.
15489 * src/output.c (output_gram): Likewise.
15491 2002-04-07 Akim Demaille <akim@epita.fr>
15493 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
15495 Adjust all dependencies.
15496 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
15497 `number' of the buckets too.
15498 * src/gram.h: Include `symtab.h'.
15499 (associativity): Move to...
15500 * src/symtab.h: here.
15501 No longer include `gram.h'.
15503 2002-04-07 Akim Demaille <akim@epita.fr>
15505 * src/gram.h, src/gram.c (rules_rhs_length): New.
15506 (ritem_longest_rhs): Use it.
15507 * src/gram.h (rule_t): `number' is a new member.
15508 * src/reader.c (packgram): Set it.
15509 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
15510 the end of `rules', and count them out of `nrules'.
15511 (reduce_output, dump_grammar): Adjust.
15512 * src/print.c (print_grammar): It is no longer needed to check for
15513 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
15514 * tests/reduce.at (Reduced Automaton): New test.
15516 2002-04-07 Akim Demaille <akim@epita.fr>
15518 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
15519 lacking `+ 1' to nrules, Bison reported as useless a token if it
15520 was used solely to set the precedence of the last rule...
15522 2002-04-07 Akim Demaille <akim@epita.fr>
15524 * data/bison.c++, data/bison.simple: Don't output the current file
15525 name in #line, to avoid useless diffs between two identical
15526 outputs under different names.
15528 2002-04-07 Akim Demaille <akim@epita.fr>
15530 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
15531 Normalize loops to using `< nrules + 1', not `<= nrules'.
15533 2002-04-07 Akim Demaille <akim@epita.fr>
15537 2002-04-07 Akim Demaille <akim@epita.fr>
15539 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
15540 bucket.value as bucket.number.
15542 2002-04-07 Akim Demaille <akim@epita.fr>
15544 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
15545 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
15546 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
15547 RHS, instead of being an index in RITEMS.
15549 2002-04-04 Paul Eggert <eggert@twinsun.com>
15551 * doc/bison.texinfo: Update copyright date.
15552 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
15553 (Symbols): Warn about running Bison in one character set,
15554 but compiling and/or running in an incompatible one.
15555 Warn about character code 256, too.
15557 2002-04-03 Paul Eggert <eggert@twinsun.com>
15559 * src/bison.data (YYSTACK_ALLOC): Depend on whether
15560 YYERROR_VERBOSE is nonzero, not whether it is defined.
15562 Merge changes from bison-1_29-branch.
15564 2002-03-20 Paul Eggert <eggert@twinsun.com>
15566 Merge fixes from Debian bison_1.34-1.diff.
15568 * configure.in (AC_PREREQ): 2.53.
15570 2002-03-20 Akim Demaille <akim@epita.fr>
15572 * src/conflicts.c (log_resolution): Argument `resolution' is const.
15574 2002-03-19 Paul Eggert <eggert@twinsun.com>
15576 * src/bison.simple (YYCOPY): New macro.
15577 (YYSTACK_RELOCATE): Use it.
15578 Remove Type arg; no longer needed. All callers changed.
15579 (yymemcpy): Remove; no longer needed.
15581 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
15582 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15584 2002-03-19 Akim Demaille <akim@epita.fr>
15586 Test and fix the #line outputs.
15588 * tests/atlocal.at (GCC): New.
15589 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
15590 (Prologue synch line, %union synch line, Postprologue synch line)
15591 (Action synch line, Epilogue synch line): New tests.
15592 * src/reader.c (parse_union_decl): Define the muscle stype_line.
15593 * data/bison.simple, data/bison.c++: Use it.
15595 2002-03-19 Akim Demaille <akim@epita.fr>
15597 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
15598 (Solved SR Conflicts, %expect not enough, %expect right)
15599 (%expect too much): Move to...
15600 * tests/conflicts.at: this new file.
15602 2002-03-19 Akim Demaille <akim@epita.fr>
15604 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
15605 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
15606 that we can move to enums for instance.
15607 * src/output.c (token_definitions_output): Output a list of
15608 `token-name, token-number' instead of the #define.
15609 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
15611 2002-03-14 Akim Demaille <akim@epita.fr>
15613 Use Gettext 0.11.1.
15615 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
15617 * data/bison.c++: Make the user able to add members to the generated
15618 parser by subclassing.
15620 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
15622 * src/reader.c (read_additionnal_code): `c' should be an integer, not
15624 Reported by Nicolas Tisserand and Nicolas Burrus.
15626 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
15628 * src/reader.c: Warn about lacking semi-colons, do not complain.
15630 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
15632 * data/bison.c++: Remove a debug line.
15634 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
15636 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
15637 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
15638 provide a default implementation.
15640 2002-03-04 Akim Demaille <akim@epita.fr>
15642 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
15643 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
15644 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
15645 * tests/semantic.at (Parsing Guards): Similarly.
15646 * src/reader.at (readgram): Complain if the last rule is not ended
15649 2002-03-04 Akim Demaille <akim@epita.fr>
15651 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
15652 * src/closure.c: here.
15653 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
15655 * src/warshall.h, src/warshall.c: Remove.
15656 * tests/sets.at (Broken Closure): Adjust.
15658 2002-03-04 Akim Demaille <akim@epita.fr>
15660 * src/output.c (output_skeleton): tempdir is const.
15661 bytes_read is unused.
15663 2002-03-04 Akim Demaille <akim@epita.fr>
15665 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
15666 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
15668 From Michael Hayes.
15670 2002-03-04 Akim Demaille <akim@epita.fr>
15672 * src/closure.c (closure): `r' is unused.
15674 2002-03-04 Akim Demaille <akim@epita.fr>
15676 * tests/sets.at (Broken Closure): Add the ending `;'.
15677 * src/reader.at (readgram): Complain if a rule is not ended with a
15680 2002-03-04 Akim Demaille <akim@epita.fr>
15682 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
15683 (count_sr_conflicts): Use bitset_count.
15684 * src/reduce.c (inaccessable_symbols): Ditto.
15685 (bits_size): Remove.
15686 * src/warshall.h, src/warshall.c: Convert to bitsetv.
15688 2002-03-04 Akim Demaille <akim@epita.fr>
15690 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
15691 * src/reduce.c: Remove the `bitset_zero's following the
15692 `bitset_create's, as now it is performed by the latter.
15694 2002-03-04 Akim Demaille <akim@epita.fr>
15696 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
15697 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
15698 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
15699 latest sources from Michael.
15701 2002-03-04 Akim Demaille <akim@epita.fr>
15703 * src/output.c (output): Don't free the grammar.
15704 * src/reader.c (grammar_free): New.
15705 * src/main.c (main): Call it and don't free symtab here.
15707 2002-03-04 Akim Demaille <akim@epita.fr>
15709 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
15711 Reported by Benoit Perrot.
15713 2002-03-04 Akim Demaille <akim@epita.fr>
15715 Use bitset operations when possible, not loops over bits.
15717 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
15719 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
15720 * src/reduce.c (useless_nonterminals): Formatting changes.
15721 * src/warshall.c (TC): Use bitset_or.
15723 2002-03-04 Akim Demaille <akim@epita.fr>
15725 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
15726 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
15729 2002-03-04 Akim Demaille <akim@epita.fr>
15731 * src/lalr.c (F): Now a bitset*.
15732 Adjust all dependencies.
15734 2002-03-04 Akim Demaille <akim@epita.fr>
15736 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
15737 Adjust all dependencies.
15739 2002-03-04 Akim Demaille <akim@epita.fr>
15741 * src/L0.c, src/LR0.h (nstates): Be size_t.
15742 Adjust comparisons (signed vs unsigned).
15743 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
15745 Adjust all dependencies.
15747 2002-03-04 Akim Demaille <akim@epita.fr>
15749 * src/closure.c (firsts): Now, also a bitset.
15750 Adjust all dependencies.
15751 (varsetsize): Remove, now unused.
15752 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
15754 2002-03-04 Akim Demaille <akim@epita.fr>
15756 * src/print.c: Convert to use bitset.h, not hand coded iterations
15759 2002-03-04 Akim Demaille <akim@epita.fr>
15761 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
15763 2002-03-04 Akim Demaille <akim@epita.fr>
15765 * src/closure.c (ruleset): Be a bitset.
15766 (rulesetsize): Remove.
15768 2002-03-04 Akim Demaille <akim@epita.fr>
15770 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
15771 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
15772 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
15773 * src/closure.c (fderives): Be an array of bitsets.
15775 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
15777 * data/bison.c++: Merge the two generated headers. Insert a copyright
15778 notice in each output file.
15780 2002-02-28 Akim Demaille <akim@epita.fr>
15782 * data/bison.c++: Copy the prologue of bison.simple to fetch
15783 useful M4 definitions, such as b4_header_guard.
15785 2002-02-25 Akim Demaille <akim@epita.fr>
15787 * src/getargs.c (version): Give the name of the authors, and use a
15788 translator friendly scheme for the bgr
15791 2002-02-25 Akim Demaille <akim@epita.fr>
15793 * src/output.c (header_output): Remove, now handled completely via
15796 2002-02-25 Akim Demaille <akim@epita.fr>
15798 * m4/m4.m4: New, from CVS Autoconf.
15799 * configure.in: Invoke it.
15800 * src/output.c (output_skeleton): Use its result instead of the
15803 2002-02-25 Akim Demaille <akim@epita.fr>
15805 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
15807 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
15808 * src/output.c (output_skeleton): Use mkstemp to create a real
15810 Move the filling of `skeleton' and its muscle to...
15812 (output): Move the definition of the prologue muscle to...
15814 * src/system.h (DEFAULT_TMPDIR): New.
15816 2002-02-14 Paul Eggert <eggert@twinsun.com>
15818 Remove the support for C++ namespace cleanliness; it was
15819 causing more problems than it was curing, since it didn't work
15820 properly on some nonstandard C++ compilers. This can wait
15821 for a proper C++ parser.
15823 * NEWS: Document this.
15824 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
15825 of C++, as it's treated like C now.
15826 * src/bison.simple (YYSTD): Remove.
15827 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
15828 Treat C++ just like Standard C instead of trying to support
15829 namespace cleanliness.
15831 2002-02-14 Akim Demaille <akim@epita.fr>
15833 * tests/regression.at (else): Adjust to Andreas' change.
15835 2002-02-14 Akim Demaille <akim@epita.fr>
15837 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
15839 2002-02-13 Andreas Schwab <schwab@suse.de>
15841 * src/output.c (output_rule_data): Don't output NULL, it might
15842 not be defined yet.
15844 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
15846 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
15847 (Copyright notice): Update.
15849 2002-02-11 Akim Demaille <akim@epita.fr>
15851 * tests/regression.at (%nonassoc and eof): Don't include
15852 nonportable headers.
15854 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
15856 * data/bison.c++: Correct error recovery. Make the user able to
15857 initialize the starting location.
15859 2002-02-07 Akim Demaille <akim@epita.fr>
15861 * tests/input.at: New.
15863 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
15865 * data/bison.c++: Replace some direct m4 expansions by constants. Be
15866 more consistent when naming methods and variables. Put preprocessor
15867 directives around tables only needed for debugging.
15869 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
15871 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
15873 (yy::b4_name::parse): Use print_.
15875 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
15877 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
15879 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
15881 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
15883 (yy::b4_name::parse): Build verbose error messages, and use error_.
15885 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
15887 * data/bison.c++: Fix m4 quoting in comments.
15889 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
15891 * data/bison.c++: Adjust the parser code. Fix some muscles that were
15892 not expanded by m4.
15894 2002-02-05 Akim Demaille <akim@epita.fr>
15896 * data/bison.c++: Adjust to the M4 back end.
15897 More is certainly needed.
15899 2002-02-05 Akim Demaille <akim@epita.fr>
15901 Give a try to M4 as a back end.
15903 * lib/readpipe.c: New, from wdiff.
15904 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
15906 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
15907 specific values. Now it is m4 that performs the lookup.
15908 * src/parse-skel.y: Remove.
15909 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
15910 * src/output.c (actions_output, guards_output)
15911 (token_definitions_output): No longer keeps track of the output
15912 line number, hence remove the second argument.
15913 (guards_output): Check against the guard member of a rule, not the
15916 (output_skeleton): Don't look for the skeleton location, let m4 do
15918 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
15920 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
15921 (prepare): Given that for the time being changesyntax is not
15922 usable in M4, rename the muscles using `-' to `_'.
15923 Define `defines_flag', `output_parser_name' and `output_header_name'.
15924 * src/output.h (actions_output, guards_output)
15925 (token_definitions_output): Adjust prototypes.
15926 * src/scan-skel.l: Instead of scanning the skeletons, it now
15927 processes the output of m4: `__oline__' and `#output'.
15928 * data/bison.simple: Adjust to be used by M4(sugar).
15929 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
15931 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
15932 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
15933 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
15934 shamelessly stolen from CVS Autoconf.
15936 2002-02-05 Akim Demaille <akim@epita.fr>
15938 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
15939 * configure.in: Check for the declarations of free and malloc.
15940 * src/muscle_tab.c: Adjust.
15942 2002-02-05 Akim Demaille <akim@epita.fr>
15944 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
15945 which have no values.
15947 2002-02-05 Akim Demaille <akim@epita.fr>
15949 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
15952 2002-01-29 Paul Eggert <eggert@twinsun.com>
15954 * src/bison.simple (YYSIZE_T): Do not define merely because
15955 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
15956 On some platforms, <alloca.h> does not declare YYSTD (size_t).
15958 2002-01-27 Akim Demaille <akim@epita.fr>
15960 Fix `%nonassoc and eof'.
15962 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
15963 which were not properly copied! Replace
15964 memcpy (res->errs, src->errs, src->nerrs);
15966 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
15968 * tests/regression.at (%nonassoc and eof): Adjust to newest
15969 Autotest: `.' is not in the PATH.
15971 2002-01-27 Akim Demaille <akim@epita.fr>
15973 * tests/sets.at (AT_EXTRACT_SETS): New.
15974 (Nullable): Use it.
15977 2002-01-26 Akim Demaille <akim@epita.fr>
15979 * tests/actions.at, tests/calc.at, tests/headers.at,
15980 * tests/torture.at: Adjust to the newest Autotest which no longer
15981 forces `.' in the PATH.
15983 2002-01-25 Akim Demaille <akim@epita.fr>
15985 * tests/regression.at (%nonassoc and eof): New.
15986 Suggested by Robert Anisko.
15988 2002-01-24 Akim Demaille <akim@epita.fr>
15990 Bison dumps core when trying to complain about broken input files.
15991 Reported by Cris van Pelt.
15993 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
15994 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
15996 (Invalid inputs): Strengthen: exercise parse_percent_token.
15998 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
16000 * src/Makefile.am: Add bison.c++.
16001 * src/bison.c++: New skeleton.
16003 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
16007 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
16009 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
16011 2002-01-20 Marc Autret <marc@gnu.org>
16013 * src/files.c (compute_output_file_names): Fix
16015 2002-01-20 Marc Autret <marc@gnu.org>
16017 * tests/output.at: New test.
16018 * src/files.c (compute_base_names): Don't map extensions when
16019 the YACC flag is set, use defaults.
16020 Reported by Evgeny Stambulchik.
16022 2002-01-20 Marc Autret <marc@gnu.org>
16024 * src/system.h: Need to define __attribute__ away for non-GCC
16025 compilers as well (i.e., the vendor C compiler).
16026 Suggested by Albert Chin-A-Young.
16028 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
16030 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
16031 canonical definition.
16032 * src/system.h: Use the canonical definition for PARAMS (avoids
16033 a conflict with the macro from lib/hash.h).
16035 2002-01-11 Akim Demaille <akim@epita.fr>
16037 * configure.in: Use AC_FUNC_STRNLEN.
16038 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
16040 2002-01-09 Akim Demaille <akim@epita.fr>
16042 * src/files.c, src/files.h (output_infix): New.
16043 (tab_extension): Remove.
16044 (compute_base_names): Compute the former, drop the latter.
16045 * src/output.c (prepare): Insert the muscles `output-infix', and
16047 * src/parse-skel.y (string, string.1): New.
16048 (section.header): Use it.
16049 (section.yacc): Remove.
16050 (prefix): Remove too.
16051 * src/scan-skel.l: Adjust.
16052 * src/bison.simple, src/bison.hairy: Adjust.
16054 2002-01-09 Akim Demaille <akim@epita.fr>
16056 * configure.in (WERROR_CFLAGS): Compute it.
16057 * src/Makefile.am (CFLAGS): Pass it.
16058 * tests/atlocal.in (CFLAGS): Idem.
16059 * src/files.c: Fix a few warnings.
16060 (get_extension_index): Remove, unused.
16062 2002-01-08 Akim Demaille <akim@epita.fr>
16064 * src/getargs.c (AS_FILE_NAME): New.
16065 (getargs): Use it to convert DOSish file names.
16066 * src/files.c (base_name): Rename as full_base_name to avoid
16067 clashes with `base_name ()'.
16068 (filename_split): New.
16069 (compute_base_names): N-th rewrite, using filename_split.
16071 2002-01-08 Akim Demaille <akim@epita.fr>
16073 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
16074 New, stolen from the Fileutils 4.1.
16075 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16076 * configure.in: Check for the presence of memrchr, and of its
16079 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
16081 * lib/hash.h (__P): Added definition for this macro.
16082 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
16083 BUILT_SOURCES, to ensure they are generated first.
16084 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
16085 %error-verbose to allow bootstrapping with bison 1.30x.
16087 2002-01-06 Akim Demaille <akim@epita.fr>
16089 * src/reader.c (parse_braces): Don't fetch the next char, the
16090 convention is to fetch on entry.
16091 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
16092 'switch' without a following semicolon.
16093 * tests/regression.at (braces parsing): New.
16095 2002-01-06 Akim Demaille <akim@epita.fr>
16097 Bison is dead wrong in its RR conflict reports.
16099 * tests/torture.at (GNU Cim Grammar): New.
16100 * src/conflicts.c (count_rr_conflicts): Fix.
16102 2002-01-06 Akim Demaille <akim@epita.fr>
16104 Creating package.m4 from configure.ac causes too many problems.
16106 * tests/Makefile.am (package.m4): Create it by hand,
16107 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
16109 2002-01-06 Akim Demaille <akim@epita.fr>
16111 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
16114 2002-01-04 Paul Eggert <eggert@twinsun.com>
16116 * doc/bison.texinfo (Debugging):
16117 Remove YYSTDERR; it's no longer defined or used.
16118 Also, s/cstdio.h/cstdio/.
16120 2002-01-03 Akim Demaille <akim@epita.fr>
16122 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
16124 2002-01-03 Akim Demaille <akim@epita.fr>
16126 * src/parse-skel.y (process_skeleton): Don't bind the parser's
16127 tracing code to --trace, wait for a better --trace option, with
16130 2002-01-03 Akim Demaille <akim@epita.fr>
16132 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
16133 The ISO C++ standard is extremely clear about it: stderr is
16134 considered a macro, not a regular symbol (see table 94 `Header
16135 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
16136 Therefore std:: does not apply to it. It still does with fprintf.
16137 Also, s/cstdio.h/cstdio/.
16139 2002-01-03 Akim Demaille <akim@epita.fr>
16141 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
16142 for non system headers.
16144 2002-01-02 Akim Demaille <akim@epita.fr>
16146 Equip the skeleton chain with location tracking, runtime trace,
16147 pure parser and scanner.
16149 * src/parse-skel.y: Request a pure parser, locations, and prefix
16151 (%union): Having several members with the same type does not help
16152 type mismatches, simplify.
16153 (YYPRINT, yyprint): New.
16154 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
16155 (skel_error): this.
16157 * src/scan-skel.l: Adjust to these changes.
16158 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
16159 (LOCATION_PRINT, skel_control_t): New.
16161 2001-12-30 Akim Demaille <akim@epita.fr>
16163 * src/parse-skel.y: Get rid of the shift/reduce conflict:
16164 replace `gb' with BLANKS.
16165 * src/scan-skel.l: Adjust.
16167 2001-12-30 Akim Demaille <akim@epita.fr>
16169 * src/system.h: We don't need nor want bcopy.
16170 Throw away MS-DOS crap: we don't need getpid.
16171 * configure.in: We don't need strndup. It was even causing
16172 problems: because Flex includes the headers *before* us,
16173 _GNU_SOURCE is not defined by config.h, and therefore strndup was
16175 * lib/xstrndup.c: New.
16176 * src/scan-skel.l: Use it.
16177 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
16178 * src/parse-skel.y: Use %directives instead of #defines.
16180 2001-12-30 Akim Demaille <akim@epita.fr>
16182 * src/skeleton.h: New.
16183 * src/output.c (output_parser, output_master_parser): Remove, dead
16185 * src/output.h (get_lines_number, actions_output, guards_output)
16186 (token_definitions_output): Prototype them.
16187 * src/parse-skel.y: Add the license notice.
16188 Include output.h and skeleton.h.
16189 (process_skeleton): Returns void, and takes a single parameter.
16190 * src/scan-skel.l: Add the license notice.
16191 Include skeleton.h.
16192 Don't use %option yylineno: it seems that then Flex imagines
16193 REJECT has been used, and therefore it won't reallocate its
16194 buffers (which makes no other sense to me than a bug). It results
16195 in warnings for `unused: yy_flex_realloc'.
16197 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
16199 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
16200 (MUSCLE_INSERT_PREFIX): ...to there.
16201 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
16202 (MUSCLE_INSERT_PREFIX): Move from here...
16204 * src/bison.hairy: Add a section directive. Put braces around muscle
16205 names. This parser skeleton is still broken, but Bison should not
16206 choke on a bad muscle 'syntax'.
16207 * src/bison.simple: Add a section directive. Put braces around muscle
16210 * src/files.h (strsuffix, stringappend): Add declarations.
16211 (tab_extension): Add declaration.
16212 (short_base_name): Add declaration.
16214 * src/files.c (strsuffix, stringappend): No longer static. These
16215 functions are used in the skeleton parser.
16216 (tab_extension): New.
16217 (compute_base_names): Use the computations done in this function
16218 to guess if the generated parsers should have '.tab' in their
16220 (short_base_name): No longer static.
16222 * src/output.c (output_skeleton): New.
16223 (output): Disable call to output_master_parser, and give a try to
16224 a new skeleton handling system.
16225 (guards_output, actions_output): No longer static.
16226 (token_definitions_output, get_lines_number): No longer static.
16228 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
16230 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
16233 * src/parse-skel.y: New file.
16234 * src/scan-skel.l: New file.
16236 2001-12-29 Akim Demaille <akim@epita.fr>
16238 %name-prefix is broken.
16240 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
16241 Adjust all dependencies.
16242 * tests/headers.at (export YYLTYPE): Strengthen this test: use
16245 Renaming yylval but not yylloc is not consistent. Now we do.
16247 * src/bison.simple: Prefix yylloc if used.
16248 * doc/bison.texinfo (Decl Summary): Document that.
16250 2001-12-29 Akim Demaille <akim@epita.fr>
16252 * doc/bison.texinfo: Promote `%long-directive' over
16254 Remove all references to fixed-output-files, yacc is enough.
16256 2001-12-29 Akim Demaille <akim@epita.fr>
16258 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
16259 user prologue. These are defaults.
16260 * tests/actions.at (Mid-rule actions): Make sure the user can
16261 define YYDEBUG and YYERROR_VERBOSE.
16263 2001-12-29 Akim Demaille <akim@epita.fr>
16265 * src/output.c (header_output): Don't forget to export YYLTYPE and
16267 * tests/headers.at (export YYLTYPE): New, make sure it does.
16268 * tests/regression.at (%union and --defines, Invalid CPP headers):
16270 * tests/headers.at: here.
16272 2001-12-29 Akim Demaille <akim@epita.fr>
16274 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
16276 2001-12-29 Akim Demaille <akim@epita.fr>
16278 * tests/actions.at (Mid-rule actions): Output on a single line
16279 instead of several.
16281 2001-12-29 Akim Demaille <akim@epita.fr>
16283 * doc/bison.texinfo: Formatting changes.
16285 2001-12-29 Akim Demaille <akim@epita.fr>
16287 Don't store the token defs in a muscle, just be ready to output it
16288 on command. Now possible via `symbols'. Fixes a memory leak.
16290 * src/output.c (token_definitions_output): New.
16291 (output_parser, header_output): Use it.
16292 * src/reader.c (symbols_save): Remove.
16294 2001-12-29 Akim Demaille <akim@epita.fr>
16296 * src/bison.simple: Do not provide a default for YYSTYPE and
16297 YYLTYPE before the user's prologue. Otherwise it's hardly... a
16300 2001-12-29 Akim Demaille <akim@epita.fr>
16302 Mid-rule actions are simply... ignored!
16304 * src/reader.c (readgram): Be sure to attach mid-rule actions to
16305 the empty-rule associated to the dummy symbol, not to the host
16307 * tests/actions.at (Mid-rule actions): New.
16309 2001-12-29 Akim Demaille <akim@epita.fr>
16313 * src/reader.c (reader): Free grammar.
16315 2001-12-29 Akim Demaille <akim@epita.fr>
16319 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
16320 since it allocates it for each state, although only one is needed.
16321 (allocate_storage): Do it here.
16323 2001-12-29 Akim Demaille <akim@epita.fr>
16325 * src/options.h, src/options.c (create_long_option_table): Rename
16327 (long_option_table_new): this, with a clearer prototype.
16328 (percent_table): Remove, unused,
16329 * src/getargs.c (getargs): Adjust.
16331 2001-12-29 Akim Demaille <akim@epita.fr>
16333 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
16334 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
16337 2001-12-29 Akim Demaille <akim@epita.fr>
16339 * src/lalr.c (build_relations): Rename `states' as `states1'.
16340 Sorry, I don't understand exactly what it is, no better name...
16342 2001-12-29 Akim Demaille <akim@epita.fr>
16344 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
16345 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
16346 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
16349 2001-12-29 Akim Demaille <akim@epita.fr>
16351 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
16354 2001-12-29 Akim Demaille <akim@epita.fr>
16356 * src/reader.c, src/reader.h (user_toknums): Remove.
16357 Adjust all users to use symbols[i]->user_token_number.
16359 2001-12-29 Akim Demaille <akim@epita.fr>
16361 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
16362 Adjust all users to use symbols[i]->prec or ->assoc.
16364 2001-12-29 Akim Demaille <akim@epita.fr>
16366 * src/reader.c, src/reader.h (tags): Remove.
16367 Adjust all users to use symbols[i]->tag.
16369 2001-12-29 Akim Demaille <akim@epita.fr>
16371 * src/gram.h, src/gram.c (symbols): New, similar to state_table
16373 * src/reader.c (packsymbols): Fill this table.
16375 * src/conflicts.c (resolve_sr_conflict): Adjust.
16376 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
16378 Use symbols[i]->tag instead of tags[i].
16380 2001-12-29 Akim Demaille <akim@epita.fr>
16382 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
16383 In addition, put a comment in there, to replace...
16384 * tests/regression.at (%union and C comments): Remove.
16386 2001-12-29 Akim Demaille <akim@epita.fr>
16388 * tests/regression.at (Web2c Actions): Blindly move the actual
16389 output as expected output. The contents *seem* right to me, but I
16390 can't pretend reading perfectly parser tables... Nonetheless, all
16391 the other tests pass correctly, the table look OK, even though the
16392 presence of `$axiom' is to be noted: AFAICS it is useless (but
16395 2001-12-29 Akim Demaille <akim@epita.fr>
16397 * src/reader.c (readgram): Don't add the rule 0 if there were no
16398 rules read. In other words, add it _after_ having performed
16399 grammar sanity checks.
16400 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
16402 2001-12-29 Akim Demaille <akim@epita.fr>
16404 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
16405 visible, and some states have now a different number.
16407 2001-12-29 Akim Demaille <akim@epita.fr>
16409 * src/reader.c (readgram): Bind the initial rule's lineno to that
16411 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
16412 (Solved SR Conflicts): Adjust rule 0's line number.
16414 2001-12-29 Akim Demaille <akim@epita.fr>
16416 Fix the `GAWK Grammar' failure.
16418 * src/LR0.c (final_state): Initialize to -1 so that we do compute
16419 the reductions of the first state which was mistakenly confused
16420 with the final state because precisely final_state was initialized
16422 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
16423 now noticed by Bison.
16424 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
16425 have a reduction on $default.
16427 2001-12-29 Akim Demaille <akim@epita.fr>
16429 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
16431 * src/closure.c (print_closure): Likewise.
16432 * src/derives.c (print_derives): Likewise.
16433 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
16436 2001-12-29 Akim Demaille <akim@epita.fr>
16438 * src/lalr.c (lookaheads_print): New.
16439 (lalr): Call it when --trace-flag.
16440 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
16443 2001-12-29 Akim Demaille <akim@epita.fr>
16445 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
16446 when walking through ritem, even via rule->rhs.
16447 * src/reduce.c (dump_grammar, useful_production, reduce_output)
16448 (useful_production, useless_nonterminals): Likewise.
16449 (reduce_grammar_tables): Likewise, plus update nritems.
16450 * src/nullable.c (set_nullable): Likewise.
16451 * src/lalr.c (build_relations): Likewise.
16452 * tests/sets.at (Nullable): Adjust.
16453 Fortunately, now, the $axiom is no longer nullable.
16455 2001-12-29 Akim Demaille <akim@epita.fr>
16457 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
16459 * src/gram.c (ritem_longest_rhs): Likewise.
16460 * src/reduce.c (nonterminals_reduce): Likewise.
16461 * src/print_graph.c (print_graph): Likewise.
16462 * src/output.c (output_rule_data): Likewise.
16463 * src/nullable.c (set_nullable): Likewise.
16465 2001-12-29 Akim Demaille <akim@epita.fr>
16467 * src/output.c: Comment changes.
16469 2001-12-27 Paul Eggert <eggert@twinsun.com>
16471 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
16472 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
16473 Sparc, as they were causing more porting problems than the
16474 (minor) performance improvement was worth.
16476 Also, catch up with 1.31's YYSTD.
16478 2001-12-27 Akim Demaille <akim@epita.fr>
16480 * src/output.c (output_gram): Rely on nritems, not the
16481 0-sentinel. See below.
16482 Use -1 as separator, not 0.
16483 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
16484 Rely on -1 as separator in yyrhs, instead of 0.
16485 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
16486 twice `Now at end of input', therefore there are two lines less to
16489 2001-12-27 Akim Demaille <akim@epita.fr>
16491 * tests/regression.at (Unresolved SR Conflicts):
16492 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
16495 2001-12-27 Akim Demaille <akim@epita.fr>
16497 * src/LR0.c (new_state): Recognize the final state by the fact it
16498 is reached by eoftoken.
16499 (insert_start_shifting_state, insert_eof_shifting_state)
16500 (insert_accepting_state, augment_automaton): Remove, since now
16501 these states are automatically computed from the initial state.
16502 (generate_states): Adjust.
16503 * src/print.c: When reporting a rule number to the user, substract
16504 1, so that the axiom rule is rule 0, and the first user rule is 1.
16505 * src/reduce.c: Likewise.
16506 * src/print_graph.c (print_core): For the time being, just as for
16507 the report, depend upon --trace-flags to dump the full set of
16509 * src/reader.c (readgram): Once the grammar read, insert the rule
16510 0: `$axiom: START-SYMBOL $'.
16511 * tests/set.at: Adjust: rule 0 is now displayed, and since the
16512 number of the states has changed (the final state is no longer
16513 necessarily the last), catch up.
16515 2001-12-27 Akim Demaille <akim@epita.fr>
16517 Try to make the use of the eoftoken valid. Given that its value
16518 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
16519 is used instead of > 0 where appropriate, (ii), depend upon nritems
16520 instead of the 0-sentinel.
16522 * src/gram.h, src/gram.c (nritems): New.
16523 Expected to be duplication of nitems, but for the time being...
16524 * src/reader.c (packgram): Assert nritems and nitems are equal.
16525 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
16526 * src/closure.c (print_closure, print_fderives): Likewise.
16527 * src/gram.c (ritem_print): Likewise.
16528 * src/print.c (print_core, print_grammar): Likewise.
16529 * src/print_graph.c: Likewise.
16531 2001-12-27 Akim Demaille <akim@epita.fr>
16533 * src/main.c (main): If there are complains after grammar
16534 reductions, then output the report anyway if requested, then die.
16535 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
16536 * src/reader.c (eoftoken): New.
16537 (parse_token_decl): If the token being defined has value `0', it
16539 (packsymbols): No longer hack `tags' to insert `$' by hand.
16540 Be sure to preserve the value of the eoftoken.
16541 (reader): Make sure eoftoken is defined.
16542 Initialize nsyms to 0: now eoftoken is created just like the others.
16543 * src/print.c (print_grammar): Don't special case the eof token.
16544 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
16545 lie anyway, albeit pleasant.
16546 * tests/calc.at: Exercise error messages with eoftoken.
16547 Change the grammar so that empty input is invalid.
16548 Adjust expectations.
16549 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
16551 2001-12-27 Akim Demaille <akim@epita.fr>
16553 * configure.in: Check the protos of strchr ans strspn.
16554 Replace strchr if needed.
16555 * src/system.h: Provide the protos of strchr, strspn and memchr if
16557 * lib/strchr.c: New.
16558 * src/reader.c (symbols_save): Use strchr.
16560 2001-12-27 Akim Demaille <akim@epita.fr>
16562 * src/print.c, src/print_graph.c (escape): New.
16563 Use it to quote the TAGS outputs.
16564 * src/print_graph.c (print_state): Now errors are in red, and
16565 reductions in green.
16566 Prefer high to wide: output the state number on a line of its own.
16568 2001-12-27 Akim Demaille <akim@epita.fr>
16570 * src/state.h, src/state.c (reductions_new): New.
16571 * src/LR0.c (set_state_table): Let all the states have a
16572 `reductions', even if reduced to 0.
16573 (save_reductions): Adjust.
16574 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
16575 * src/print.c (print_reductions, print_actions): Adjust.
16576 * src/output.c (action_row): Adjust.
16578 2001-12-27 Akim Demaille <akim@epita.fr>
16580 * src/state.h, src/state.c (errs_new, errs_dup): New.
16581 * src/LR0.c (set_state_table): Let all the states have an errs,
16582 even if reduced to 0.
16583 * src/print.c (print_errs, print_reductions): Adjust.
16584 * src/output.c (output_actions, action_row): Adjust.
16585 * src/conflicts.c (resolve_sr_conflict): Adjust.
16587 2001-12-27 Akim Demaille <akim@epita.fr>
16589 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
16591 2001-12-27 Akim Demaille <akim@epita.fr>
16593 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
16594 * src/print.c: here.
16595 (lookaheadset, shiftset): New, used as additional storage by
16597 (print_results): Adjust.
16598 (print_shifts, print_gotos, print_errs): New, extracted from...
16599 (print_actions): here.
16600 * src/print_graph.c (print_actions): Remove dead code.
16602 2001-12-27 Akim Demaille <akim@epita.fr>
16604 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
16607 2001-12-27 Akim Demaille <akim@epita.fr>
16609 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
16610 (build_relations): Adjust.
16612 2001-12-27 Akim Demaille <akim@epita.fr>
16614 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
16617 2001-12-27 Akim Demaille <akim@epita.fr>
16619 * src/reader.c (packgram): Catch nitems overflows.
16621 2001-12-27 Akim Demaille <akim@epita.fr>
16623 * src/files.c, src/files.h (guard_obstack): Remove.
16624 * src/output.c (output): Adjust.
16625 * src/reader.c (parse_braces): New, factoring...
16626 (copy_action, copy_guard): these two which are renamed as...
16627 (parse_action, parse_guard): these.
16628 As a voluntary consequence, using braces around guards is now
16631 2001-12-27 Akim Demaille <akim@epita.fr>
16633 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
16634 * src/reader.c (symbol_list): `guard' and `guard_line' are new
16636 (symbol_list_new): Adjust.
16637 (copy_action): action_line is the first line, not the last.
16638 (copy_guard): Just as for actions, store the `action' only, not
16639 the switch/case/break flesh.
16640 Don't parse the user action that might follow the guard, let...
16641 (readgram): do it, i.e., now, there can be an action after a
16643 In other words the guard is just explicitly optional.
16644 (packgram): Adjust.
16645 * src/output.c (guards_output): New.
16646 (output_parser): Call it when needed.
16647 (output): Also free the guard and attrs obstacks.
16648 * src/files.c, src/files.h (obstack_save): Remove.
16649 (output_files): Remove.
16650 As a result, if one needs the former `.act' file, using an
16651 appropriate skeleton which requires actions and guards is now
16653 * src/main.c (main): Adjust.
16654 * tests/semantic.at: New.
16655 * tests/regression.at: Use `input.y' as input file name.
16656 Avoid 8+3 problems by requiring input.c when the test needs the
16659 2001-12-27 Akim Demaille <akim@epita.fr>
16661 * src/reader.c (symbol_list_new): Be sure to initialize all the
16664 2001-12-27 Akim Demaille <akim@epita.fr>
16666 All the hacks using a final pseudo state are now useless.
16668 * src/LR0.c (set_state_table): state_table holds exactly nstates.
16669 * src/lalr.c (nLA): New.
16670 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
16671 instead of lookaheadsp from the pseudo state (nstate + 1).
16673 2001-12-27 Akim Demaille <akim@epita.fr>
16675 * src/output.c (action_row, token_actions): Use a state_t instead
16676 of a integer, and nlookaheads instead of the following state's
16679 2001-12-27 Akim Demaille <akim@epita.fr>
16681 * src/conflicts.c (log_resolution, flush_shift)
16682 (resolve_sr_conflict, set_conflicts, solve_conflicts)
16683 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
16684 (conflicts_print, print_reductions): Use a state_t instead of an
16685 integer when referring to a state.
16686 As much as possible, depend upon nlookaheads, instead of the
16687 `lookaheadsp' member of the following state (since lookaheads of
16688 successive states are successive, the difference between state n + 1
16689 and n served as the number of lookaheads for state n).
16690 * src/lalr.c (add_lookback_edge): Likewise.
16691 * src/print.c (print_core, print_actions, print_state)
16692 (print_results): Likewise.
16693 * src/print_graph.c (print_core, print_actions, print_state)
16694 (print_graph): Likewise.
16695 * src/conflicts.h: Adjust.
16697 2001-12-27 Akim Demaille <akim@epita.fr>
16699 * src/bison.hairy: Formatting/comment changes.
16701 Remove `register' indications.
16702 Add plenty of `static'.
16704 2001-12-27 Akim Demaille <akim@epita.fr>
16706 * src/output.c (prepare): Drop the muscle `ntbase' which
16707 duplicates ntokens.
16708 * src/bison.simple: Formatting/comment changes.
16709 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
16710 is an undocumented synonym.
16712 2001-12-22 Akim Demaille <akim@epita.fr>
16714 * src/output.c (output_table_data): Change the prototype to use
16715 `int' for array ranges: some invocations do pass an int, not a
16717 Reported by Wayne Green.
16719 2001-12-22 Akim Demaille <akim@epita.fr>
16721 Some actions of web2c.y are improperly triggered.
16722 Reported by Mike Castle.
16724 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
16725 * tests/regression.at (Web2c): Rename as...
16726 (Web2c Report): this.
16727 (Web2c Actions): New.
16729 2001-12-22 Akim Demaille <akim@epita.fr>
16731 Reductions in web2c.y are improperly reported.
16732 Reported by Mike Castle.
16734 * src/conflicts.c (print_reductions): Fix.
16735 * tests/regression.at (Web2c): New.
16737 2001-12-18 Akim Demaille <akim@epita.fr>
16739 Some host fail on `assert (!"foo")', which expands to
16740 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
16741 Reported by Nelson Beebee.
16743 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
16744 `#define it_succeeded 0' and `assert (it_succeeded)'.
16746 2001-12-17 Marc Autret <autret_m@epita.fr>
16748 * src/bison.simple: Don't hard code the skeleton line and filename.
16749 * src/output.c (output_parser): Rename 'line' as 'output_line'.
16750 New line counter 'skeleton_line' (skeleton-line muscle).
16752 2001-12-17 Paul Eggert <eggert@twinsun.com>
16754 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
16755 YYDEBUG must be defined to a nonzero value.
16757 * src/bison.simple (yytname): Do not assume that the user defines
16758 YYDEBUG to a properly parenthesized expression.
16760 2001-12-17 Akim Demaille <akim@epita.fr>
16762 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
16763 nlookaheads is a new member.
16765 * src/lalr.h (nlookaheads): Remove this orphan declaration.
16766 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
16769 2001-12-17 Akim Demaille <akim@epita.fr>
16771 * src/files.h, src/files.c (open_files, close_files): Remove.
16772 * src/main.c (main): Don't open/close files, nor invoke lex_free,
16774 * src/reader.c (reader): Do it.
16776 2001-12-17 Akim Demaille <akim@epita.fr>
16778 * src/conflicts.c (print_reductions): Formatting changes.
16780 2001-12-17 Akim Demaille <akim@epita.fr>
16782 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
16783 (flush_reduce): New.
16784 (resolve_sr_conflict): Adjust.
16786 2001-12-17 Akim Demaille <akim@epita.fr>
16788 * src/output.c (output_obstack): Be static and rename as...
16789 (format_obstack): this, to avoid any confusion with files.c's
16791 * src/reader.h (muscle_obstack): Move to...
16792 * src/output.h: here, since it's defined in output.c.
16794 2001-12-17 Akim Demaille <akim@epita.fr>
16796 * src/output.c (action_row, save_column, default_goto)
16797 (sort_actions, matching_state, pack_vector): Better variable
16800 2001-12-17 Akim Demaille <akim@epita.fr>
16802 * src/output.c: Various formatting changes.
16804 2001-12-17 Akim Demaille <akim@epita.fr>
16806 * src/files.c (output_files): Free the output_obstack.
16807 * src/main.c (main): Call print and print_graph conditionally.
16808 * src/print.c (print): Work unconditionally.
16809 * src/print_graph.c (print_graph): Work unconditionally.
16810 * src/conflicts.c (log_resolution): Output only if verbose_flag.
16812 2001-12-16 Marc Autret <autret_m@epita.fr>
16814 * src/output.c (actions_output): Fix. When we use %no-lines,
16815 there is one less line per action.
16817 2001-12-16 Marc Autret <autret_m@epita.fr>
16819 * src/bison.simple: Remove a useless #line directive.
16820 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
16821 * src/output.c (get_lines_number): New.
16822 (output_parser): Adjust, now takes care about the lines of a
16824 Fix line numbering.
16825 (actions_output): Computes the number of lines taken by actions.
16826 (output_master_parser): Insert new skeleton which is the name of
16827 the output parser file name.
16829 2001-12-15 Marc Autret <autret_m@epita.fr>
16831 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
16833 2001-12-15 Marc Autret <autret_m@epita.fr>
16835 * src/output.c (output_gram): Keep track of the hairy one.
16837 2001-12-15 Akim Demaille <akim@epita.fr>
16839 Make `make distcheck' work.
16841 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
16842 system.h which uses libgettext.h.
16844 2001-12-15 Akim Demaille <akim@epita.fr>
16846 * src/nullable.c (set_nullable): Useless rules must be skipped,
16847 otherwise, since we range over their symbols, we might look at a
16848 nonterminal which no longer ``exists'', i.e., it is not counted in
16849 `nvars', hence we overflow our arrays.
16851 2001-12-15 Akim Demaille <akim@epita.fr>
16853 The header can also be produced directly, without any obstack!
16856 * src/files.c, src/files.h (defines_obstack): Remove.
16857 (compute_header_macro): Global.
16858 (defines_obstack_save): Remove.
16859 * src/reader.c (parse_union_decl): No longer output to
16860 defines_obstack: its content can be found in the `stype' muscle
16862 (output_token_translations): Merge into...
16863 (symbols_output): this.
16865 (symbols_save): this.
16867 * src/output.c (header_output): New.
16870 2001-12-15 Akim Demaille <akim@epita.fr>
16872 * src/reader.c (parse_union_decl): Instead of handling two obstack
16873 simultaneously, use one to define the `stype' muscle, and use the
16874 value of the latter to fill defines_obstack.
16875 (copy_comment): Remove.
16876 (copy_comment2): Work for a single obstack.
16878 (copy_comment): this.
16880 2001-12-15 Akim Demaille <akim@epita.fr>
16882 * src/lex.c, src/lex.h (xgetc): No longer static.
16883 * src/reader.c (parse_union_decl): Revamp.
16885 2001-12-15 Akim Demaille <akim@epita.fr>
16887 Still making progress in separating Bison into (i) input, (ii)
16888 process, (iii) output: now we can directly output the parser file
16889 without using table_obstack at all.
16891 * src/files.c, src/files.h (table_obstack): Bye bye.
16892 (parser_file_name): New.
16893 * src/files.c (compute_output_file_names): Compute it.
16894 * src/output.c (actions_output, output_parser)
16895 (output_master_parser): To a file instead of an obstack.
16897 2001-12-15 Akim Demaille <akim@epita.fr>
16899 Attach actions to rules, instead of pre-outputting them to
16902 * src/gram.h (rule_t): action and action_line are new members.
16903 * src/reader.c (symbol_list): Likewise.
16904 (copy_action): Save the actions within the rule.
16905 (packgram): Save them in rule_table.
16906 * src/output.c (actions_output): New.
16907 (output_parser): Use it on `%%actions'.
16908 (output_rule_data): Don't free rule_table.
16910 (prepare): Don't save the `action' muscle.
16911 * src/bison.simple: s/%%action/%%actions/.
16913 2001-12-15 Akim Demaille <akim@epita.fr>
16915 * src/reader.c (copy_action): When --yacc, don't append a `;'
16916 to the user action: let it fail if lacking.
16917 Suggested by Arnold Robbins and Tom Tromey.
16919 2001-12-14 Akim Demaille <akim@epita.fr>
16921 * src/lex.c (literalchar): Simply return the char you decoded, non
16922 longer mess around with obstacks and int pointers.
16923 Adjust all callers.
16925 2001-12-14 Akim Demaille <akim@epita.fr>
16927 * src/lex.c (literalchar): Don't escape the special characters,
16928 just decode them, and keep them as char (before, eol was output as
16929 the 2 char string `\n' etc.).
16930 * src/output.c (output_rule_data): Use quotearg to output the
16933 2001-12-13 Paul Eggert <eggert@twinsun.com>
16935 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
16936 Do not infringe on the global user namespace when using C++.
16937 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
16938 All uses of `fprintf' and `stderr' changed.
16940 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
16942 2001-12-13 Akim Demaille <akim@epita.fr>
16944 The computation of nullable is broken: it doesn't handle empty
16947 * tests/torture.at (GNU AWK Grammar): New.
16948 * tests/sets.at (Nullable): New.
16949 * src/nullable.c (set_nullable): Instead of blindly looping over
16950 `ritems', loop over the rules, and then over their rhs's.
16952 Work around Autotest bugs.
16954 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
16955 frame, because Autotest understand lines starting with a `+' as
16956 traces from the shell. Then, they are not processed properly.
16957 Admittedly an Autotest bug, but we don't have time to wait for
16958 Autotest to catch up.
16959 * tests/regression.at (Broken Closure): Adjust to the new table
16962 * tests/sets.at: here.
16964 2001-12-13 Akim Demaille <akim@epita.fr>
16966 * src/closure.c (closure): Use nrules instead of playing tricks
16967 with BITS_PER_WORD.
16969 2001-12-13 Akim Demaille <akim@epita.fr>
16971 * src/print.c (print_actions): Output the handling of `$' as the
16972 traces do: shifting the token EOF. Before EOF was treated as a
16974 * tests/regression.at: Adjust some tests.
16975 * src/print_graph.c (print_core): Complete the set of items via
16976 closure. The next-to-final and final states are still unsatisfying,
16977 but that's to be addressed elsewhere.
16978 No longer output the rule numbers, but do output the state number.
16979 A single loop for the shifts + gotos is enough, but picked a
16980 distinct color for each.
16981 (print_graph): Initialize and finalize closure.
16983 2001-12-13 Akim Demaille <akim@epita.fr>
16985 * src/reader.c (readgram): Remove dead code, an strip useless
16987 (get_type): Remove, unused.
16989 2001-12-12 Akim Demaille <akim@epita.fr>
16991 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
16992 on that of lib/error.c.
16994 2001-12-12 Akim Demaille <akim@epita.fr>
16996 Some hosts don't like `/' in includes.
16998 * src/system.h: Include libgettext.h without qualifying the path.
16999 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
17002 2001-12-11 Marc Autret <autret_m@epita.fr>
17004 * src/output.c (output_parser): Remove useless muscle.
17006 2001-12-11 Marc Autret <autret_m@epita.fr>
17008 * src/bison.simple: Remove #line just before %%epilogue. It
17009 is now handled in ...
17010 * src/reader.c (read_additionnal_code): Add the output of a
17011 #line for the epilogue.
17013 2001-12-10 Marc Autret <autret_m@epita.fr>
17015 * src/reader.c (copy_definition): Re-use CPP-outed code which
17016 replace precedent remove.
17017 * src/bison.simple: Remove #line before %%prologue because
17018 %%input-line is wrong at this time.
17020 2001-12-10 Marc Autret <autret_m@epita.fr>
17022 * src/reader.c (symbols_output): Clean up.
17023 * src/output.c (output_gram, output): Clean up.
17025 2001-12-10 Akim Demaille <akim@epita.fr>
17027 * src/lalr.c (initialize_lookaheads): New. Extracted from...
17028 * src/LR0.c (set_state_table): here.
17029 * src/lalr.c (lalr): Call it.
17031 2001-12-10 Akim Demaille <akim@epita.fr>
17033 * src/state.h (shifts): Remove the `number' member: shifts are
17034 attached to state, hence no longer need to be labelled with a
17037 2001-12-10 Akim Demaille <akim@epita.fr>
17039 Now that states have a complete set of members, the linked list of
17040 shifts is useless: just fill directly the state's shifts member.
17042 * src/state.h (shifts): Remove the `next' member.
17043 * src/LR0.c (first_state, last_state): Remove.
17044 Adjust the callers.
17045 (augment_automaton): Don't look for the shifts that must be added
17046 a shift on EOF: it is those of the state we looked for! But now,
17047 since shifts are attached, it is no longer needed to looking
17048 merely by its id: its number.
17050 2001-12-10 Akim Demaille <akim@epita.fr>
17052 * src/LR0.c (augment_automaton): Better variable locality.
17053 Remove an impossible branch: if there is a state corresponding to
17054 the start symbol being shifted, then there is shift for the start
17055 symbol from the initial state.
17057 2001-12-10 Akim Demaille <akim@epita.fr>
17059 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
17060 only when appropriate: when insert_start_shifting_state' is not
17062 * tests/regression.at (Rule Line Numbers): Adjust.
17064 2001-12-10 Akim Demaille <akim@epita.fr>
17066 * src/LR0.c (augment_automaton): Now that all states have shifts,
17067 merge the two cases addition shifts to the initial state.
17069 2001-12-10 Akim Demaille <akim@epita.fr>
17071 * src/lalr.c (set_state_table): Move to...
17073 * src/lalr.c (lalr): Don't call it...
17074 * src/LR0.c (generate_states): do it.
17075 * src/LR0.h (first_state): Remove, only the table is used.
17077 2001-12-10 Akim Demaille <akim@epita.fr>
17079 * src/LR0.h (first_shift, first_reduction): Remove.
17080 * src/lalr.c: Don't use first_shift: find shifts through the
17083 2001-12-10 Akim Demaille <akim@epita.fr>
17085 * src/LR0.c: Attach shifts to states as soon as they are
17087 * src/lalr.c (set_state_table): Instead of assigning shifts to
17088 state, just assert that the mapping was properly done.
17090 2001-12-10 Akim Demaille <akim@epita.fr>
17092 * src/LR0.c (insert_start_shift): Rename as...
17093 (insert_start_shifting_state): this.
17094 (insert_eof_shifting_state, insert_accepting_state): New.
17095 (augment_automaton): Adjust.
17096 Better locality of the variables.
17097 When looking if the start_symbol is shifted from the initial
17098 state, using `while (... symbol != start_symbol ...)' sounds
17099 better than `while (... symbol < start_symbol ...)': If fail
17100 to see how the order between symbols could be relevant!
17102 2001-12-10 Akim Demaille <akim@epita.fr>
17104 * src/getargs.h: Don't declare `spec_name_prefix' and
17105 `spec_file_prefix', declared by src/files.h.
17106 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
17107 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
17108 * src/output.c (prepare): Adjust.
17109 * src/reader.c (symbols_output): Likewise.
17110 * src/vmsgetargs.c: Vaguely adjust, but who cares?
17112 2001-12-10 Akim Demaille <akim@epita.fr>
17114 * src/muscle_tab.c (muscle_init): NULL is a better default than
17117 2001-12-10 Akim Demaille <akim@epita.fr>
17119 * src/reader.c (reader): Calling symbols_output once is enough.
17121 2001-12-10 Akim Demaille <akim@epita.fr>
17123 Now that states have a complete set of members, the linked list of
17124 reductions is useless: just fill directly the state's reductions
17127 * src/state.h (struct reductions): Remove member `number' and
17129 * src/LR0.c (first_reduction, last_reduction): Remove.
17130 (save_reductions): Don't link the new reductions, store them in
17132 * src/lalr.c (set_state_table): No need to attach reductions to
17133 states, it's already done.
17134 * src/output.c (output_actions): No longer free the shifts, then
17135 the reductions, then the states: free all the states and their
17138 2001-12-10 Akim Demaille <akim@epita.fr>
17140 * src/options.c (OPTN, DRTV, BOTH): New.
17141 (option_table): Use them.
17143 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
17144 the job of system.h.
17145 * src/options.c: Don't include stdio.h and xalloc.h for the same
17148 2001-12-10 Akim Demaille <akim@epita.fr>
17150 * src/output.c (output, prepare): Make sure the values of the
17151 muscles `action' and `prologue' are 0-terminated.
17153 2001-12-10 Akim Demaille <akim@epita.fr>
17155 Clean up GCC warnings.
17157 * src/reader.c (copy_action): `buf' is not used.
17158 (parse_skel_decl): Be static.
17159 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
17160 * src/options.h (create_long_option_table): Have a real prototype.
17161 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
17162 (hash_delete_at): Return const void *.
17163 Adjust casts to preserve the const.
17165 2001-12-10 Akim Demaille <akim@epita.fr>
17167 * configure.in: Require 2.52g.
17168 M4 is not needed, but AUTOM4TE is.
17169 * m4/m4.m4: Remove.
17170 * tests/Makefile.am: Adjust.
17172 2001-12-10 Akim Demaille <akim@epita.fr>
17174 One structure for states is enough, even though theoretically
17175 there are LR(0) states and LALR(1) states.
17177 * src/lalr.h (state_t): Remove.
17178 (state_table): Be state_t **, not state_t *.
17179 * src/state.h (core, CORE_ALLOC): Rename as...
17180 (state_t, STATE_ALLOC): this.
17181 Add the LALR(1) members: shifts, reductions, errs.
17182 * src/LR0.c (state_table): Rename as...
17183 (state_hash): this, to avoid name clashes with the global
17185 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
17186 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
17188 2001-12-10 Akim Demaille <akim@epita.fr>
17190 Bison dumps core on bash.y.
17191 Reported by Pascal Bart.
17193 * src/warshall.c (bitmatrix_print): New.
17195 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
17196 j must be the outer loop.
17197 * tests/regression.at (Broken Closure): New.
17199 2001-12-05 Akim Demaille <akim@epita.fr>
17201 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
17203 Reported by Peter Hamorsky.
17205 2001-12-05 Akim Demaille <akim@epita.fr>
17207 * src/conflicts.c (err_table): Remove.
17208 (resolve_sr_conflict): Adjust.
17209 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
17211 (state_t.reductions, state_t.shifts): this.
17213 2001-12-05 Akim Demaille <akim@epita.fr>
17215 * src/reduce.c (reduce_grammar_tables): No longer disable the
17216 removal of useless rules via CPP but via `if (0)', so that the
17217 compiler still check the code is valid.
17218 For instance, it should have noticed `rline' no longer exists: use
17219 the `line' member of rule_t.
17220 * src/gram.c (dummy, rline): Remove, unused.
17222 2001-12-05 Akim Demaille <akim@epita.fr>
17224 * src/output.c (pack_vector): Use assert, not berror.
17225 * src/main.c (berror): Remove, unused.
17227 2001-12-05 Akim Demaille <akim@epita.fr>
17229 New experimental feature: if --verbose --trace output all the
17230 items of a state, not only its kernel.
17232 * src/print.c (print_core): If `trace_flag', then invoke closure
17233 before outputting the items of the state (print_core is no longer
17234 a correct name them).
17235 (print_results): Invoke new_closure/free_closure if needed.
17237 2001-12-05 Akim Demaille <akim@epita.fr>
17239 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
17240 * src/closure.c, src/closure.h (itemsetsize): Rename as...
17241 (nitemset): for consistency with the rest of the project.
17243 2001-12-05 Akim Demaille <akim@epita.fr>
17245 * src/closure.c (print_closure): Improve.
17246 (closure): Use it for printing input and output.
17248 2001-12-05 Akim Demaille <akim@epita.fr>
17250 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
17251 indexed by nonterminals.
17253 2001-12-05 Akim Demaille <akim@epita.fr>
17255 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
17257 * src/warshall.h: Remove accidental duplication of the content.
17259 2001-12-05 Akim Demaille <akim@epita.fr>
17261 * src/closure.c (set_fderives): De-obfuscate.
17263 2001-12-05 Akim Demaille <akim@epita.fr>
17265 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
17267 2001-12-05 Akim Demaille <akim@epita.fr>
17269 * src/closure.c (set_firsts): De-obfuscate.
17271 2001-12-05 Akim Demaille <akim@epita.fr>
17273 * src/output.c (action_row): De-obfuscate
17274 using the good o' techniques: arrays not pointers, variable
17275 locality, BITISSET, RESETBIT etc.
17277 2001-12-05 Akim Demaille <akim@epita.fr>
17279 Pessimize the code to simplify it: from now on, all the states
17280 have a valid SHIFTS, which NSHIFTS is possibly 0.
17282 * src/LR0.c (shifts_new): Be global and move to..
17283 * src/state.c, src/state.h: here.
17284 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
17285 * src/print_graph: Adjust.
17287 2001-12-05 Akim Demaille <akim@epita.fr>
17289 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
17290 * src/conflicts.c: Use it.
17291 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
17292 incorrectly ``simplified''.
17294 2001-12-05 Akim Demaille <akim@epita.fr>
17296 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
17297 using the good o' techniques: arrays not pointers, variable
17298 locality, BITISSET, RESETBIT etc.
17300 2001-12-05 Akim Demaille <akim@epita.fr>
17302 * src/state.h (SHIFT_SYMBOL): New.
17303 * src/conflicts.c: Use it to deobfuscate.
17305 2001-12-05 Akim Demaille <akim@epita.fr>
17307 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
17308 (print_reductions): De-obfuscate using the good o' techniques:
17309 arrays not pointers, variable locality, BITISSET.
17311 2001-12-05 Akim Demaille <akim@epita.fr>
17313 * src/conflicts.c (print_reductions): Arrays, not pointers.
17316 2001-12-05 Akim Demaille <akim@epita.fr>
17318 * src/conflicts.c (print_reductions): Pessimize, but clarify.
17320 2001-12-05 Akim Demaille <akim@epita.fr>
17322 * src/conflicts.c (print_reductions): Improve variable locality.
17324 2001-12-05 Akim Demaille <akim@epita.fr>
17326 * src/conflicts.c (print_reductions): Pessimize, but clarify.
17328 2001-12-05 Akim Demaille <akim@epita.fr>
17330 * src/conflicts.c (print_reductions): Improve variable locality.
17332 2001-12-05 Akim Demaille <akim@epita.fr>
17334 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
17335 * src/lalr.c: Use them.
17337 2001-12-05 Akim Demaille <akim@epita.fr>
17339 * src/LR0.c (augment_automaton): Formatting changes.
17340 Better variable locality.
17342 2001-12-05 Akim Demaille <akim@epita.fr>
17344 * src/lalr.c (matrix_print): New.
17345 (transpose): Use it.
17346 Use arrays instead of pointers.
17348 2001-12-05 Akim Demaille <akim@epita.fr>
17350 * src/lalr.c (maxrhs): Move to...
17351 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
17352 * src/lalr.c (build_relations): Adjust.
17354 2001-12-05 Akim Demaille <akim@epita.fr>
17356 * src/lalr.c (transpose): Free the memory allocated to the
17357 argument, as it is replaced by the results by the unique caller.
17358 (build_relations): Merely invoke transpose: it handles the memory
17360 Improve variable locality.
17361 Avoid variables used as mere abbreviations.
17362 (compute_lookaheads): Use arrays instead of pointers.
17364 2001-12-05 Akim Demaille <akim@epita.fr>
17366 * src/lalr.c (initialize_F): Improve variable locality.
17367 Avoid variables used as mere abbreviations.
17369 2001-12-05 Akim Demaille <akim@epita.fr>
17371 * src/derives.c (print_derives): Display the ruleno.
17372 * src/lalr.c (initialize_F, transpose): Better variable locality
17373 to improve readability.
17374 Avoid variables used as mere abbreviations.
17376 2001-12-05 Akim Demaille <akim@epita.fr>
17378 * src/lalr.c (traverse): Use arrays instead of pointers.
17380 2001-12-05 Akim Demaille <akim@epita.fr>
17382 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
17383 the handling of squeue.
17384 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
17386 2001-12-05 Akim Demaille <akim@epita.fr>
17388 Because useless nonterminals are now kept alive (instead of being
17389 `destroyed'), we now sometimes examine them, and store information
17390 related to them. Hence we need to know their number, and adjust
17391 memory allocations.
17393 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
17395 * src/LR0.c (allocate_itemsets): The memory allocated to
17396 `symbol_count' was used for two different purpose: once to count
17397 the number of occurrences of each symbol, and later reassigned to
17398 `shift_symbol', containing the symbol that can be shifted from a
17400 Deobfuscate, i.e., allocate, use and free `symbol_count' here
17402 (new_itemsets): Allocate `shift_symbol' here.
17403 (allocate_itemsets): symbol_count includes useless nonterminals.
17404 Make room for them.
17405 (free_storage): Use `free', not `XFREE', for pointers that cannot
17408 2001-12-05 Akim Demaille <akim@epita.fr>
17410 * src/nullable.c (set_nullable): Deobfuscate the handling of
17412 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
17414 2001-12-05 Akim Demaille <akim@epita.fr>
17416 * src/gram.c, src/gram.h (ritem_print): New.
17417 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
17418 (This useless function was defined only to work around VMS linkers
17419 that can't handle compilation units with variables only).
17420 * src/reduce.c (dump_grammar): Use it to trace the construction of
17423 2001-12-04 Paul Eggert <eggert@twinsun.com>
17425 * src/bison.simple (union yyalloc): Change member names
17426 to be the same as the stack names.
17427 (yyparse): yyptr is now union yyalloc *, not char *.
17428 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
17429 and may generate better code on some machines.
17430 (yystpcpy): Use prototype if __STDC__ is defined, not just
17431 if __cplusplus is defined.
17433 2001-11-30 Akim Demaille <akim@epita.fr>
17435 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
17436 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
17437 Gettext doesn't compile cleanly, and dies with -Werror.
17438 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
17439 Include WARNING_CFLAGS here.
17440 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
17441 before being defined.
17443 2001-11-27 Paul Eggert <eggert@twinsun.com>
17445 * lib/quotearg.h (quotearg_n, quotearg_n_style):
17446 First arg is int, not unsigned.
17447 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
17448 (SIZE_MAX, UINT_MAX): New macros.
17449 (quotearg_n_options): Abort if N is negative.
17450 Avoid overflow check on hosts where size_t is 64 bits and int
17451 is 32 bits, as overflow is impossible there.
17452 Fix off-by-one typo that caused unnecessary reallocation.
17454 2001-11-29 Paul Eggert <eggert@twinsun.com>
17456 Name space cleanup in generated parser.
17458 * doc/bison.texinfo (Bison Parser): Discuss system headers
17459 and their effect on the user name space.
17461 * src/bison.simple:
17462 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
17463 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
17464 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
17466 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
17467 on user names when possible.
17469 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
17470 Simplify test for whather <alloca.h> exists.
17472 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
17474 (<stdio.h>): Include if YYDEBUG.
17476 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
17477 ! defined (yyoverflow) && ! defined (yymemcpy).
17479 (yymemcpy, yyparse): Rename local variables as needed so that
17480 they all begin with 'yy'.
17482 (yystrlen, yystpcpy): New functions.
17484 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
17487 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
17488 instead of relying on string.h functions. Use YYSTACK_ALLOC
17489 and YYSTACK_FREE instead of malloc and free.
17491 2001-11-30 Akim Demaille <akim@epita.fr>
17493 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
17494 before their first uses.
17495 (YYBISON, YYPURE): Move to the top of the output.
17497 2001-11-30 Akim Demaille <akim@epita.fr>
17499 * tests/reduce.at (Useless Nonterminals): Fix.
17501 2001-11-30 Akim Demaille <akim@epita.fr>
17503 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
17504 if body instead of `;' to pacify GCC's warnings.
17506 2001-11-30 Akim Demaille <akim@epita.fr>
17508 Instead of mapping the LHS of unused rules to -1, keep the LHS
17509 valid, but flag the rules as invalid.
17511 * src/gram.h (rule_t): `useful' is a new member.
17512 * src/print.c (print_grammar): Adjust.
17513 * src/derives.c (set_derives): Likewise.
17514 * src/reader.c (packgram, reduce_output): Likewise.
17515 * src/reduce.c (reduce_grammar_tables): Likewise.
17516 * tests/reduce.at (Underivable Rules, Useless Rules): New.
17518 2001-11-30 Akim Demaille <akim@epita.fr>
17520 * src/reduce.c (reduce_output): Formatting changes.
17521 * src/print.c (print_results, print_grammar): Likewise.
17522 * tests/regression.at (Rule Line Numbers)
17523 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
17525 2001-11-30 Akim Demaille <akim@epita.fr>
17527 * src/reduce.c (nonterminals_reduce): Instead of throwing away
17528 useless nonterminals, move them at the end of the symbol arrays.
17529 (reduce_output): Adjust.
17530 * tests/reduce.at (Useless Nonterminals): Adjust.
17532 2001-11-30 Akim Demaille <akim@epita.fr>
17534 * src/reduce.c: Various comment/formatting changes.
17535 (nonterminals_reduce): New, extracted from...
17536 (reduce_grammar_tables): here.
17537 (reduce_grammar): Call nonterminals_reduce.
17539 2001-11-29 Paul Eggert <eggert@twinsun.com>
17541 * src/bison.simple (YYSTACK_REALLOC): Remove.
17542 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
17543 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
17545 (union yyalloc): New type.
17546 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
17547 an arbitrary restriction on hosts where size_t is wider than int.
17549 (yyparse): Don't dump core if alloca or malloc fails; instead, report
17550 a parser stack overflow. Allocate just one block of memory for all
17551 three stacks, instead of allocating three blocks; this typically is
17552 faster and reduces fragmentation.
17554 Do not limit the number of items in the stack to a value that fits
17555 in 'int', as this is an arbitrary limit on hosts with 64-bit
17556 size_t and 32-bit int.
17558 2001-11-29 Marc Autret <autret_m@epita.fr>
17560 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
17561 of defining YYERROR_VERBOSE.
17562 [AT_DATA]: $4 is now out of C declarations in the prologue.
17564 2001-11-28 Marc Autret <autret_m@epita.fr>
17566 * src/reader.c (parse_dquoted_param): New.
17567 (parse_skel_decl): Use it.
17568 * src/lex.h: Add its prototype.
17569 * src/lex.c (literalchar): Become not static.
17571 2001-11-28 Marc Autret <autret_m@epita.fr>
17573 * src/output.h: And put its extern declaration here.
17574 * src/output.c (error_verbose): Define here.
17575 (prepare): Echo name modification.
17576 * src/getargs.h: Clean its extern declaration.
17577 * src/getargs.c (error_verbose_flag): Remove.
17578 (getargs): Remove case 'e'.
17579 * src/options.c (option_table): 'error-verbose' is now seen as simple
17583 * src/reader.c (read_declarations): Remove case tok_include.
17584 (parse_include_decl): Remove.
17585 * src/lex.h (token_t): Remove tok_include.
17586 * src/options.c (option_table): 'include' is now a simple command line
17589 2001-11-28 Marc Autret <autret_m@epita.fr>
17591 * src/bison.simple: Adjust muscle names.
17592 * src/muscle_tab.c (muscle_init): Also rename the muscles.
17593 * src/output.c (prepare): s/_/-/ for the muscles names.
17594 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
17596 2001-11-28 Marc Autret <autret_m@epita.fr>
17598 * src/bison.simple: Fix debug.
17599 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
17601 2001-11-28 Akim Demaille <akim@epita.fr>
17603 * src/LR0.c (shifts_new): New.
17604 (save_shifts, insert_start_shift, augment_automaton): Use it.
17606 2001-11-28 Akim Demaille <akim@epita.fr>
17608 * src/closure.c (closure): `b' and `ruleno' denote the same value:
17611 2001-11-28 Akim Demaille <akim@epita.fr>
17613 * src/closure.c (closure): Instead of looping over word in array
17614 then bits in words, loop over bits in array.
17616 2001-11-28 Akim Demaille <akim@epita.fr>
17618 * src/closure.c (closure): No longer optimize the special case
17619 where all the bits of `ruleset[r]' are set to 0, to make the code
17622 2001-11-28 Akim Demaille <akim@epita.fr>
17624 * src/closure.c (closure): `r' and `c' are new variables, used to
17625 de-obfuscate accesses to RULESET and CORE.
17627 2001-11-28 Akim Demaille <akim@epita.fr>
17629 * src/reduce.c (reduce_print): Use ngettext.
17630 (dump_grammar): Improve the trace accuracy.
17632 2001-11-28 Akim Demaille <akim@epita.fr>
17634 * src/reduce.c (dump_grammar): Don't translate trace messages.
17636 2001-11-28 Akim Demaille <akim@epita.fr>
17638 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
17639 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
17640 as all tags are free'ed afterwards.
17641 From Enrico Scholz.
17643 2001-11-27 Paul Eggert <eggert@twinsun.com>
17645 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
17646 use alloca when we didn't want to, and vice versa.
17648 2001-11-27 Marc Autret <autret_m@epita.fr>
17650 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
17652 * src/output.c (prepare): Remove its update.
17654 2001-11-27 Marc Autret <autret_m@epita.fr>
17656 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
17657 Use %error-verbose.
17659 2001-11-27 Marc Autret <autret_m@epita.fr>
17661 * src/bison.simple: Remove YYERROR_VERBOSE using.
17662 Use %%error_verbose.
17663 (yyparse): Likewise.
17664 * src/output.c (prepare): Give its final value.
17665 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
17666 * src/getargs.h: Add its extern declaration.
17667 * src/getargs.c (error_verbose_flag): New int.
17668 (getargs): Update to catch new case.
17669 * src/options.c (option_table): 'error-verbose' is a new option.
17670 (shortopts): Update.
17672 2001-11-27 Akim Demaille <akim@epita.fr>
17674 * src/system.h: Use intl/libgettext.h.
17675 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
17677 2001-11-27 Akim Demaille <akim@epita.fr>
17679 * tests/torture.at (Exploding the Stack Size with Malloc):
17680 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
17682 2001-11-27 Akim Demaille <akim@epita.fr>
17684 * src/files.c: Include error.h.
17685 Reported by Hans Aberg.
17687 2001-11-26 Marc Autret <autret_m@epita.fr>
17689 * src/reader.c (parse_include_decl): New, not yet implemented.
17690 (read_declarations): Add case tok_include.
17691 * src/getargs.h (include): Add its extern definition.
17692 * src/getargs.c (include): New const char *.
17693 (getargs): Add case '-I'.
17694 * src/options.c (option_table): Add include as command line and
17696 * src/lex.h (token_t): Add tok_include.
17698 2001-11-26 Akim Demaille <akim@epita.fr>
17700 * src/reader.c (readgram): Make sure rules for mid-rule actions
17701 have a lineno equal to that of their host rule.
17702 Reported by Hans Aberg.
17703 * tests/regression.at (Rule Line Numbers): New.
17705 2001-11-26 Akim Demaille <akim@epita.fr>
17707 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
17710 2001-11-26 Akim Demaille <akim@epita.fr>
17712 * src/complain.c, src/complain.h (error): Remove, provided by
17715 2001-11-26 Akim Demaille <akim@epita.fr>
17717 * src/reader.c (read_declarations): Don't abort on tok_illegal,
17718 issue an error message.
17719 * tests/regression.at (Invalid %directive): New.
17720 Reported by Hans Aberg.
17722 2001-11-26 Akim Demaille <akim@epita.fr>
17724 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
17725 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
17727 2001-11-26 Akim Demaille <akim@epita.fr>
17729 * src/conflicts.c (conflicts_print): Don't complain at all when
17730 there are no reduce/reduce conflicts, and as many shift/reduce
17731 conflicts as expected.
17732 * tests/regression.at (%expect right): Adjust.
17734 2001-11-23 Akim Demaille <akim@epita.fr>
17736 * lib/alloca.c: Update, from fileutils.
17738 2001-11-23 Akim Demaille <akim@epita.fr>
17740 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
17742 2001-11-23 Akim Demaille <akim@epita.fr>
17744 * src/system.h: Include alloca.h.
17745 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
17747 2001-11-23 Akim Demaille <akim@epita.fr>
17749 * src/print_graph.c (print_actions): Remove `rule', unused.
17750 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
17751 pacify GCC's signed < unsigned warnings.
17752 * src/closure.c (itemsetsize): Likewise.
17753 * src/reader.c (symbol_list_new): Static.
17755 2001-11-23 Akim Demaille <akim@epita.fr>
17757 Attaching lineno to buckets is stupid, since only one copy of each
17758 symbol is kept, only the line of the first occurrence is kept too.
17760 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
17761 * src/reader.c (rline_allocated): Remove, unused.
17762 (symbol_list): Have a `line' member.
17763 (symbol_list_new): New.
17764 (readgram): Use it.
17765 * src/print.c (print_grammar): Output the rule line numbers.
17766 * tests/regression.at (Solved SR Conflicts)
17767 (Unresolved SR Conflicts): Adjust.
17768 Reported by Hans Aberg.
17770 2001-11-22 Marc Autret <autret_m@epita.fr>
17772 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
17774 2001-11-22 Marc Autret <autret_m@epita.fr>
17776 * src/muscle_tab.c (muscle_init): Remove initialization of
17778 * src/output.c (output_master_parser): Do it here.
17780 2001-11-20 Akim Demaille <akim@epita.fr>
17783 * configure.in (ALL_LINGUAS): Adjust.
17784 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
17785 longer contains strings to translate.
17787 2001-11-19 Akim Demaille <akim@epita.fr>
17789 * src/conflicts.c (conflicts_print): Add a missing \n.
17791 2001-11-19 Akim Demaille <akim@epita.fr>
17793 * src/nullable.c (nullable_print): New.
17794 (set_nullable): Call it when tracing.
17795 Better locality of variables.
17797 2001-11-19 Akim Demaille <akim@epita.fr>
17799 * src/print.c (print_actions): Better locality of variables.
17801 2001-11-19 Akim Demaille <akim@epita.fr>
17803 * src/derives.c (print_derives): Fix and enrich.
17804 * src/closure.c (print_fderives): Likewise.
17806 2001-11-19 Akim Demaille <akim@epita.fr>
17808 * src/closure.c (itemsetend): Remove, replaced with...
17809 (itemsetsize): new.
17811 2001-11-19 Akim Demaille <akim@epita.fr>
17813 * src/LR0.c (kernel_end): Remove, replaced with...
17814 (kernel_size): new.
17816 2001-11-19 Akim Demaille <akim@epita.fr>
17818 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
17821 2001-11-19 Akim Demaille <akim@epita.fr>
17823 * src/closure.c (closure): Use arrays instead of pointers to clarify.
17825 2001-11-19 Akim Demaille <akim@epita.fr>
17827 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
17829 * src/LR0.c: Likewise.
17830 (allocate_itemsets): Use arrays instead of pointers to clarify.
17832 2001-11-19 Akim Demaille <akim@epita.fr>
17834 * src/getargs.c (statistics_flag): Replace with...
17836 (longopts): Accept --trace instead of --statistics.
17837 * src/getargs.h, src/options.c: Adjust.
17838 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
17839 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
17841 2001-11-19 Akim Demaille <akim@epita.fr>
17843 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
17844 pointers to clarify the code.
17845 (save_reductions, save_shifts): Factor common parts of alternatives.
17847 2001-11-19 Akim Demaille <akim@epita.fr>
17849 * src/LR0.c (new_state, get_state): Complete TRACE code.
17850 * src/closure.c: Include `reader.h' to get `tags', needed by the
17852 Rename the conditional DEBUG as TRACE.
17853 Output consistently TRACEs to stderr, not stdout.
17854 * src/derives.c: Likewise.
17855 * src/reduce.c: (inaccessable_symbols): Using if is better style
17857 Use `#if TRACE' instead of `#if 0' for tracing code.
17859 2001-11-19 Akim Demaille <akim@epita.fr>
17861 * src/system.h (LIST_FREE, shortcpy): New.
17862 * src/LR0.c: Use them.
17863 * src/output.c (free_itemsets, free_reductions, free_shifts):
17864 Remove, replaced by LIST_FREE.
17866 2001-11-19 Akim Demaille <akim@epita.fr>
17868 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
17869 (REDUCTIONS_ALLOC): New.
17870 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
17873 2001-11-19 Akim Demaille <akim@epita.fr>
17875 * src/LR0.c (new_state): Complete trace code.
17876 * src/nullable.c (set_nullable): Don't translate traces.
17878 2001-11-19 Akim Demaille <akim@epita.fr>
17880 * src/print_graph.c (print_core): Better locality of variables.
17881 * src/print.c (print_core): Likewise.
17883 2001-11-19 Akim Demaille <akim@epita.fr>
17885 * src/vcg.c: You do the output, so you are responsible of the
17886 handling of VCG syntax, in particular: use quotearg.
17887 * src/print_graph.c: Don't.
17888 (print_actions): Don't output the actions as part of the nodes,
17889 since that's the job of the edges.
17890 (print_state): Don't output by hand: fill the node description,
17891 and ask for its output.
17893 2001-11-19 Akim Demaille <akim@epita.fr>
17895 * src/bison.simple (yyparse): When verbosely reporting an error,
17896 no longer put additional quotes around token names.
17897 * tests/calc.at: Adjust.
17899 2001-11-19 Akim Demaille <akim@epita.fr>
17901 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
17902 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
17903 * src/output.c: Adjust.
17905 2001-11-19 Akim Demaille <akim@epita.fr>
17907 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
17909 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
17911 2001-11-19 Akim Demaille <akim@epita.fr>
17913 * src/gram.h (rule_t): New.
17915 (rrhs, rlhs): Remove, part of state_t.
17916 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
17917 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
17918 * src/reader.c, src/reduce.c: Adjust.
17920 2001-11-19 Akim Demaille <akim@epita.fr>
17922 * src/reader.c (symbols_output): New, extracted from...
17923 (packsymbols): Here.
17926 2001-11-19 Akim Demaille <akim@epita.fr>
17928 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
17929 (maxrhs): this new function.
17931 2001-11-19 Akim Demaille <akim@epita.fr>
17933 * src/lalr.c (F): New macro to access the variable F.
17936 2001-11-19 Akim Demaille <akim@epita.fr>
17938 * src/lalr.h (LA): New macro to access the variable LA.
17939 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17940 * src/lalr.c: Adjust.
17942 2001-11-19 Akim Demaille <akim@epita.fr>
17944 * src/lalr.c (initialize_LA): Only initialize LA. Let...
17945 (set_state_table): handle the `lookaheads' members.
17947 2001-11-19 Akim Demaille <akim@epita.fr>
17949 * src/lalr.h (lookaheads): Removed array, whose contents is now
17951 (state_t): this structure.
17952 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17955 2001-11-19 Akim Demaille <akim@epita.fr>
17957 * src/lalr.h (consistent): Removed array, whose contents is now
17959 (state_t): this structure.
17960 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17963 2001-11-19 Akim Demaille <akim@epita.fr>
17965 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
17966 contents are now members of...
17967 (state_t): this structure.
17968 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17971 2001-11-19 Akim Demaille <akim@epita.fr>
17973 * src/lalr.h (state_t): New.
17974 (state_table): Be a state_t * instead of a core **.
17975 (accessing_symbol): Remove, part of state_t.
17976 * src/lalr.c: Adjust.
17977 (set_accessing_symbol): Merge into...
17978 (set_state_table): this.
17979 * src/print_graph.c, src/conflicts.c: Adjust.
17981 2001-11-14 Akim Demaille <akim@epita.fr>
17983 * tests/calc.at, tests/output.at, tests/regression.at,
17984 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
17985 now the tests are run in private dirs, therefore AC_CLEANUP and
17986 family can be simplified to 0-ary.
17987 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
17988 use abs. path to find config.h.
17989 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
17990 stderr, there can be way too much random noise.
17991 Instead pass -Werror to GCC and rely on the exit status.
17992 Reported by Wolfram Wagner.
17994 2001-11-14 Akim Demaille <akim@epita.fr>
17996 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
17997 defined only if yyoverflow is defined, to avoid `warning: unused
17999 Reported by The Test Suite.
18001 2001-11-14 Akim Demaille <akim@epita.fr>
18003 * src/print.c: Include reduce.h.
18004 Reported by Hans Aberg.
18006 2001-11-14 Akim Demaille <akim@epita.fr>
18008 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
18009 Revert a previous patch: these are really const.
18010 * src/conflicts.c (conflict_report): Additional useless pair of
18011 braces to pacify GCC's warnings for `if () if () {} else {}'.
18012 * src/lex.c (parse_percent_token): Replace equal_offset with
18015 Be sure to strdup `arg' when used, since there is no reason for
18016 token_buffer not to change.
18018 2001-11-14 Akim Demaille <akim@epita.fr>
18020 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
18022 * src/main.c (main): Use them.
18023 Suggested by Hans Aberg.
18025 2001-11-12 Akim Demaille <akim@epita.fr>
18027 * src/system.h (ngettext): Now that we use ngettext, be sure to
18028 provide a default definition when NLS are not used.
18030 2001-11-12 Akim Demaille <akim@epita.fr>
18032 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
18033 Use @kbd to denote user input.
18034 (Language and Grammar): ANSIfy the example.
18035 Adjust its layout for info/notinfo.
18036 (Location Tracking Calc): Output error messages to stderr.
18037 Output locations in a more GNUtically correct way.
18038 Fix a couple of Englishos.
18039 Adjust @group/@end group pairs.
18041 2001-11-12 Akim Demaille <akim@epita.fr>
18043 %expect was not functioning at all.
18045 * src/conflicts.c (expected_conflicts): Set to -1.
18046 (conflict_report): Use ngettext.
18047 (conflicts_print): Check %expect and make its violation an error.
18048 * doc/bison.texinfo (Expect Decl): Adjust.
18049 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
18050 * tests/regression.at (%expect not enough, %expect right)
18051 (%expect too much): New.
18053 2001-11-12 Akim Demaille <akim@epita.fr>
18055 * tests/regression.at (Conflicts): Rename as...
18056 (Unresolved SR Conflicts): this.
18057 (Solved SR Conflicts): New.
18059 2001-11-12 Akim Demaille <akim@epita.fr>
18061 * src/reduce.c (print_results): Rename as...
18062 (reduce_output): This.
18063 Output to OUT, passed as argument, instead of output_obstack.
18064 (dump_grammar): Likewise.
18065 (reduce_free): New.
18067 (reduce_grammar): No longer call reduce_output, since...
18068 * src/print.c (print_results): do it.
18069 * src/main.c (main): Call reduce_free;
18071 2001-11-12 Akim Demaille <akim@epita.fr>
18073 * src/conflicts.c (print_reductions): Accept OUT as argument.
18074 Output to it, not to output_obstack.
18075 * src/print.c (print_actions): Adjust.
18077 2001-11-12 Akim Demaille <akim@epita.fr>
18079 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
18080 the result instead of using...
18081 (src_total, rrc_total, src_count, rrc_count): Remove.
18082 (any_conflicts): Remove.
18083 (print_conflicts): Split into...
18084 (conflicts_print, conflicts_output): New.
18085 * src/conflicts.h: Adjust.
18086 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
18087 * src/print.c (print_grammar): Issue `\n' between two rules.
18088 * tests/regression.at (Conflicts): New.
18089 Reported by Tom Lane.
18091 2001-11-12 Akim Demaille <akim@epita.fr>
18093 * tests/regression.at (Invalid input): Remove, duplicate with
18094 ``Invalid input: 1''.
18096 2001-11-12 Akim Demaille <akim@epita.fr>
18098 * tests/torture.at (AT_DATA_STACK_TORTURE)
18099 (Exploding the Stack Size with Alloca)
18100 (Exploding the Stack Size with Malloc): New.
18102 2001-11-12 Akim Demaille <akim@epita.fr>
18104 * src/bison.simple (YYSTACK_REALLOC): New.
18105 (yyparse) [!yyoverflow]: Use it and free the old stack.
18106 Reported by Per Allansson.
18108 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
18110 * src/bison.simple: Define type yystype instead of YYSTYPE, and
18111 define CPP macro, which substitute YYSTYPE by yystype.
18112 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
18113 with yyltype/YYLTYPE. This allows inclusion of the generated
18114 header within the parser if the compiler, such as GGC, accepts
18115 multiple equivalent #defines.
18118 2001-11-05 Akim Demaille <akim@epita.fr>
18120 * src/reader.c (symbols_output): New, extracted from...
18121 (packsymbols): here.
18124 2001-11-05 Akim Demaille <akim@epita.fr>
18126 * src/lex.c (parse_percent_token): s/quotearg/quote/.
18128 2001-11-05 Akim Demaille <akim@epita.fr>
18130 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
18133 2001-11-05 Akim Demaille <akim@epita.fr>
18135 * src/options.h (struct option_table_struct): set_flags is void*.
18136 * src/options.c (longopts): Support `--output' and `%output'.
18138 * src/lex.h (tok_setopt): Remove, replaced with...
18139 (tok_intopt, tok_stropt): these new guys.
18140 * src/lex.c (getopt.h): Not needed.
18141 (token_buffer, unlexed_token_buffer): Not const.
18142 (percent_table): Promote `-' over `_' in directive names.
18143 Active `%name-prefix', `file-prefix', and `output'.
18144 (parse_percent_token): Accept possible arguments to directives.
18145 Promote `-' over `_' in directive names.
18147 2001-11-04 Akim Demaille <akim@epita.fr>
18149 * doc/bison.texinfo (Decl Summary): Split the list into
18150 `directives for grammars' and `directives for bison'.
18152 Add description of `%name-prefix', `file-prefix', and `output'.
18153 Promote `-' over `_' in directive names.
18154 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
18155 Simplify the description of `--name-prefix'.
18156 Promote `-' over `_' in directive names.
18157 Promote `--output' over `--output-file'.
18158 Fix the description of `--defines'.
18159 * tests/output.at: Exercise %file-prefix and %output.
18161 2001-11-02 Akim Demaille <akim@epita.fr>
18163 * doc/refcard.tex: Update.
18165 2001-11-02 Akim Demaille <akim@epita.fr>
18167 * src/symtab.h (SUNDEF): New.
18168 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
18169 stand for `uninitialized', instead of 0.
18170 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
18171 * src/lex.c (lex): Adjust.
18173 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
18175 Let yylex return it instead of a plain 0.
18176 Reported by Dick Streefland.
18178 2001-11-02 Akim Demaille <akim@epita.fr>
18180 * tests/regression.at (Mixing %token styles): New test.
18182 2001-11-02 Akim Demaille <akim@epita.fr>
18184 * src/reader.c (parse_thong_decl): Formatting changes.
18185 (token_translations_init): New, extracted from...
18186 (packsymbols): Here.
18189 2001-11-01 Akim Demaille <akim@epita.fr>
18191 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
18192 Check that `9foo.y' produces correct cpp guards.
18193 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
18197 2001-11-01 Akim Demaille <akim@epita.fr>
18199 * tests/regression.at (Invalid input: 2): New.
18200 * src/lex.c (unlexed_token_buffer): New.
18201 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
18205 2001-11-01 Akim Demaille <akim@epita.fr>
18207 * tests/calc.at: Catch up with 1.30.
18208 * configure.in: Bump to 1.49a.
18209 Adjust to newer Autotest.
18211 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
18213 * src/conflicts.c: Move global variables rrc_total and src_total ...
18214 (print_conflicts): here.
18215 * src/output.c (output): Free global variable user_toknums.
18216 * src/lex.c (token_obstack): Become static.
18218 2001-10-18 Akim Demaille <akim@epita.fr>
18220 * tests/atlocal.in (GCC): Add.
18221 * tests/calc.at: s/m4_match/m4_bmatch/.
18222 s/m4_patsubst/m4_bpatsubst/.
18223 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
18224 * configure.in: AC_SUBST(GCC).
18226 2001-10-14 Marc Autret <autret_m@epita.fr>
18228 * src/options.c (create_long_option_table): Fix.
18230 2001-10-10 Akim Demaille <akim@epita.fr>
18232 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
18234 2001-10-04 Akim Demaille <akim@epita.fr>
18236 * src/reader.c (parse_union_decl): Push the caracters in
18237 union_obstack, not attrs_obstack.
18239 2001-10-04 Akim Demaille <akim@epita.fr>
18241 Merge in the branch 1.29.
18243 * src/reader.c (packsymbols): Use a temporary obstack for
18244 `%%tokendef', since output_stack is already used elsewhere.
18246 2001-10-02 Akim Demaille <akim@epita.fr>
18250 2001-10-02 Akim Demaille <akim@epita.fr>
18254 2001-10-02 Akim Demaille <akim@epita.fr>
18256 * tests/regression.at (Invalid CPP headers): New.
18257 From Alexander Belopolsky.
18258 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
18260 2001-10-02 Akim Demaille <akim@epita.fr>
18262 * tests/regression.at (Invalid input): New.
18263 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
18266 2001-10-02 Akim Demaille <akim@epita.fr>
18268 * tests/calc.at: Now that --debug works, the tests must be adjusted.
18270 2001-10-02 Akim Demaille <akim@epita.fr>
18272 * src/output.c (output_parser): Assert `skeleton'.
18273 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
18277 2001-10-01 Marc Autret <autret_m@epita.fr>
18279 * src/lex.h: Echo modifications.
18280 * src/lex.c (unlex): Parameter is now token_t.
18283 2001-10-01 Marc Autret <autret_m@epita.fr>
18285 * src/main.c: Include lex.h.
18288 2001-09-29 Akim Demaille <akim@epita.fr>
18290 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
18292 2001-09-28 Akim Demaille <akim@epita.fr>
18294 * tests/testsuite.at: Update to newer Autotest.
18295 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
18297 2001-09-27 Akim Demaille <akim@epita.fr>
18299 Position independent wrapper.
18301 * tests/bison: Remove.
18302 * tests/bison.in: New.
18303 * configure.in: Adjust.
18305 2001-09-27 Paul Eggert <eggert@twinsun.com>
18307 Port quotearg fixes from tar 1.13.24.
18309 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
18311 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
18312 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
18314 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
18315 * m4/mbrtowc.m4: New file.
18316 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
18317 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
18319 2001-09-27 Akim Demaille <akim@epita.fr>
18323 2001-09-27 Akim Demaille <akim@epita.fr>
18327 2001-09-25 Akim Demaille <akim@epita.fr>
18329 * src/system.h: Include `xalloc.h'.
18330 Remove it from the C files.
18331 * src/files.c (output_files): Free the obstacks.
18332 * src/lex.c (init_lex): Rename as...
18335 * src/main.c (main): Use it.
18337 2001-09-24 Marc Autret <autret_m@epita.fr>
18339 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
18340 to output informations in fout (FILE*).
18341 (open_graph, close_graph): Likewise.
18342 (output_graph, output_edge, output_node): Likewise.
18343 * src/vcg.h: Update function prototypes.
18344 * src/print_graph.c (print_graph): Open output graph file.
18345 (print_actions): Adjust.
18346 * src/files.h: Remove extern declaration.
18347 * src/files.c: Remove graph_obstack declaration.
18348 (open_files): Remove graph_obstack initialization.
18349 (output_files): Remove graph_obstack saving.
18351 2001-09-24 Marc Autret <autret_m@epita.fr>
18353 * src/files.c (compute_output_file_names): Fix.
18355 2001-09-24 Marc Autret <autret_m@epita.fr>,
18356 Akim Demaille <akim@epita.fr>
18358 * src/reader.c (reader): Remove call to free_symtab ().
18359 * src/main.c (main): Call it here.
18361 * src/conflicts.c (initialize_conflicts): Rename as...
18362 (solve_conflicts): this.
18363 * src/print.c (print_core, print_actions, print_state)
18364 (print_grammar): Dump to a file instead a `output_obstack'.
18365 (print_results): Dump `output_obstack', and then proceed with the
18367 * src/files.c (compute_output_file_names, close_files): New.
18368 (output_files): Adjust.
18369 * src/main.c (main): Adjust.
18371 2001-09-23 Marc Autret <autret_m@epita.fr>
18373 * src/files.c (compute_header_macro): Computes header macro name
18374 from spec_defines_file when given.
18376 2001-09-23 Marc Autret <autret_m@epita.fr>
18378 * src/files.c (output_files): Add default extensions.
18380 2001-09-22 Akim Demaille <akim@epita.fr>
18382 * src/conflicts.c (finalize_conflicts): Rename as...
18383 (free_conflicts): this.
18385 2001-09-22 Akim Demaille <akim@epita.fr>
18387 * src/gram.c (gram_free): Rename back as...
18389 (output_token_translations): Free `token_translations'.
18390 * src/symtab.c (free_symtab): Free the tag field.
18392 2001-09-22 Akim Demaille <akim@epita.fr>
18394 Remove `translations' as it is always set to true.
18396 * src/gram.h: Adjust.
18397 * src/reader.c (packsymbols, parse_token_decl): Adjust
18398 * src/print.c (print_grammar): Adjust.
18399 * src/output.c (output_token_translations): Adjust.
18400 * src/lex.c (lex): Adjust.
18401 * src/gram.c: Be sure the set pointers to NULL.
18402 (dummy): Rename as...
18405 2001-09-22 Akim Demaille <akim@epita.fr>
18407 * configure.in: Invoke AM_LIB_DMALLOC.
18408 * src/system.h: Use dmalloc.
18409 * src/LR0.c: Be sure to have pointers initialized to NULL.
18410 (allocate_itemsets): Allocate kernel_items only if needed.
18412 2001-09-22 Akim Demaille <akim@epita.fr>
18414 * configure.in: Bump to 1.29b.
18415 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
18416 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
18417 need xmalloc.c in calc.y.
18420 2001-09-21 Akim Demaille <akim@epita.fr>
18423 * Makefile.maint, config/config.guess, config/config.sub,
18424 * config/missing: Update from masters.
18425 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
18427 * configure.in (ALL_LINGUAS): Add `tr'.
18429 2001-09-21 Akim Demaille <akim@epita.fr>
18431 * tests/Makefile.am (package.m4): Move to...
18432 ($(srcdir)/$(TESTSUITE)): here.
18434 2001-09-20 Akim Demaille <akim@epita.fr>
18436 * src/complain.c: No longer try to be standalone: use system.h.
18437 Don't assume __STDC__ is defined to 1. Just test if it is defined.
18438 * src/complain.h: Likewise.
18439 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
18440 Remove the unused variable `n'.
18441 From Albert Chin-A-Young.
18443 2001-09-18 Marc Autret <autret_m@epita.fr>
18445 * doc/bison.1: Update.
18446 * doc/bison.texinfo (Bison Options): Update --defines and --graph
18448 (Option Cross Key): Update.
18451 2001-09-18 Marc Autret <autret_m@epita.fr>
18453 * tests/regression.at: New test (comment in %union).
18455 2001-09-18 Marc Autret <autret_m@epita.fr>
18457 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
18459 Reported by Keith Browne.
18461 2001-09-18 Marc Autret <autret_m@epita.fr>
18463 * tests/output.at: Add tests for --defines and --graph.
18465 2001-09-18 Marc Autret <autret_m@epita.fr>
18467 * tests/output.at: Removes tests of %{header,src}_extension features.
18469 2001-09-18 Akim Demaille <akim@epita.fr>
18471 * tests/Makefile.am (package.m4): New.
18472 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
18473 (_AT_CHECK_CALC_ERROR): Likewise.
18474 Factor the `, ' part of verbose error messages.
18476 2001-09-18 Marc Autret <autret_m@epita.fr>
18478 * src/getargs.c (longopts): Declare --defines and --graph as options
18479 with optional arguments.
18480 * src/files.h: Add extern declarations.
18481 * src/files.c (spec_graph_file, spec_defines_file): New.
18482 (output_files): Update.
18483 Remove CPP-outed code.
18485 2001-09-18 Marc Autret <autret_m@epita.fr>
18487 Turn off %{source,header}_extension feature.
18489 * src/files.c (compute_exts_from_gf): Update.
18490 (compute_exts_from_src): Update.
18491 (output_files): CPP-out useless code.
18492 * src/files.h: Remove {header,source}_extension extern declarations.
18493 * src/reader.c (parse_dquoted_param): CPP-out.
18494 (parse_header_extension_decl): Remove.
18495 (parse_source_extension_decl): Remove.
18496 (read_declarations): Remove cases tok_{hdrext,srcext}.
18497 * src/lex.c (percent_table): Remove {header,source}_extension entries.
18498 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
18500 2001-09-10 Akim Demaille <akim@epita.fr>
18502 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
18503 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
18504 (AT_CHECK_OUTPUT): this.
18505 Merely check ls' exit status, its output is useless.
18507 2001-09-10 Akim Demaille <akim@epita.fr>
18509 * tests/calc.at: Use m4_match.
18510 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
18512 2001-09-10 Marc Autret <autret_m@epita.fr>,
18513 Akim Demaille <akim@epita.fr>
18515 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
18517 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
18519 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
18520 * src/lex.h: Adjust prototype.
18521 (token_t): Add `tok_undef'.
18522 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
18523 (parse_percent_token): Now returns token_t.
18524 Add default statement in switch.
18525 (lex): Separate `c' as an input variable, from the token_t result
18527 (unlexed): Is a token_t.
18529 2001-09-10 Akim Demaille <akim@epita.fr>
18531 * configure.in: Bump to 1.29a.
18533 2001-09-07 Akim Demaille <akim@epita.fr>
18537 2001-08-30 Akim Demaille <akim@epita.fr>
18539 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
18540 * m4/atconfig.m4: Remove.
18541 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
18542 * tests/bison: New.
18543 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
18544 m4_if, m4_patsubst, and m4_regexp.
18545 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
18546 `input' file instead of echo.
18548 2001-08-29 Akim Demaille <akim@epita.fr>
18552 2001-08-29 Akim Demaille <akim@epita.fr>
18556 2001-08-29 Paul Eggert <eggert@twinsun.com>
18558 * src/bison.simple (yyparse): Don't take the address of an
18559 item before the start of an array, as that doesn't conform to
18562 2001-08-29 Robert Anisko <anisko_r@epita.fr>
18564 * doc/bison.texinfo (Location Tracking Calc): New node.
18566 2001-08-29 Paul Eggert <eggert@twinsun.com>
18568 * src/output.c (output): Do not define const, as this now
18569 causes more problems than it cures.
18571 2001-08-29 Akim Demaille <akim@epita.fr>
18573 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
18575 Be sure to tag the `detailmenu'.
18577 2001-08-29 Akim Demaille <akim@epita.fr>
18579 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
18580 download in a tmp dir.
18582 2001-08-28 Marc Autret <autret_m@epita.fr>
18584 * config/depcomp: New file.
18586 2001-08-28 Marc Autret <autret_m@epita.fr>
18588 * doc/bison.1 (mandoc): Adjust.
18589 From Juan Manuel Guerrero.
18591 2001-08-28 Marc Autret <autret_m@epita.fr>
18593 * src/print_graph.c (print_state): Fix.
18595 2001-08-27 Marc Autret <autret_m@epita.fr>
18597 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
18599 Echo modifications to the functions prototypes.
18600 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
18602 2001-08-27 Marc Autret <autret_m@epita.fr>
18604 * src/vcg.c: Include `xalloc.h'.
18605 (add_colorentry): New.
18606 (add_classname): New.
18607 (add_infoname): New.
18608 * src/vcg.h: Add new prototypes.
18610 2001-08-27 Akim Demaille <akim@epita.fr>
18612 * Makefile.maint: Sync. again with CVS Autoconf.
18614 2001-08-27 Akim Demaille <akim@epita.fr>
18616 * Makefile.maint: Formatting changes.
18617 (po-update, cvs-update, update): New targets.
18620 2001-08-27 Akim Demaille <akim@epita.fr>
18622 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
18623 * Makefile.maint: Sync. with CVS Autoconf.
18625 2001-08-27 Marc Autret <autret_m@epita.fr>
18627 * src/vcg.h (struct infoname_s): New.
18628 (struct colorentry_s): New.
18629 (graph_s): New fields {vertical,horizontal}_order in structure.
18630 Add `infoname' field.
18631 Add `colorentry' field;
18632 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
18633 (G_HORIZONTAL_ORDER): New.
18635 (G_COLORENTRY): New.
18636 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
18637 Add output of `infoname'.
18638 Add output of `colorentry'.
18640 2001-08-27 Marc Autret <autret_m@epita.fr>
18642 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
18643 This one shadowed a global parameter.
18645 2001-08-24 Marc Autret <autret_m@epita.fr>
18647 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
18648 instead of `unsigned'.
18649 (print_state): Do not call obstack_object_size () in obstack_grow ()
18650 to avoid macro variables shadowing.
18652 2001-08-23 Marc Autret <autret_m@epita.fr>
18654 * src/lex.c (percent_table): Typo: s/naem/name/.
18656 Normalize new options declarations.
18658 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
18660 * tests/suite.at: Exercise %header_extension and %source_extension.
18662 2001-08-16 Marc Autret <autret_m@epita.fr>
18664 * src/reader.c (parse_dquoted_param): New.
18665 (parse_header_extension_decl): Use it.
18666 (parse_source_extension_decl): Likewise.
18668 2001-08-16 Marc Autret <autret_m@epita.fr>
18670 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
18671 (get_xxxx_str): Use assert () instead of complain ().
18672 Remove return invokations in default cases.
18673 (get_decision_str): Modify default behaviour. Remove second argument.
18674 Echo modifications on calls.
18675 (output_graph): Fix.
18677 2001-08-16 Marc Autret <autret_m@epita.fr>
18679 * src/getargs.c (usage): Update with ``-g, --graph''.
18681 2001-08-16 Marc Autret <autret_m@epita.fr>
18683 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
18684 (Option Cross Key): Likewise.
18685 * doc/bison.1: Update.
18687 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
18689 * src/output.c (output_master_parser): Don't finish action_obstack.
18690 (output_parser): Don't care about the muscle action, here.
18691 (prepare): Copy the action_obstack in the action muscle.
18692 (output): Free action_obstack.
18694 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
18696 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
18697 will contain `%union' declaration.
18698 (parse_union_decl): Delete #line directive output.
18699 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
18700 informations about %union.
18701 (parse_union_decl): Copy the union_obstack in the muscle stype.
18702 * src/bison.simple: Add new #line directive.
18703 Add typdef %%stype YYSTYPE.
18705 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
18707 * src/bison.simple: Add new `#line' directive.
18709 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
18711 * src/bison.simple: New `#line' directive.
18712 * src/output.c (output_parser): Support new dynamic muscle input_line.
18714 2001-09-22 Marc Autret <autret_m@epita.fr>
18716 * src/output.c (output_master_parser): New.
18717 (output_parser): Be more re-entrant.
18719 2001-09-21 Marc Autret <autret_m@epita.fr>
18721 * src/reader.c (copy_definition, parse_union_decl): Update and use
18723 (copy_action): Likewise.
18724 Use obstack_1grow ().
18725 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
18727 2001-09-21 Marc Autret <autret_m@epita.fr>
18729 * src/options.c (option_table): Adjust.
18730 * src/lex.c (parse_percent_token): Fix.
18732 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
18734 * src/options.c (symtab.h): Include it, need by lex.h.
18736 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
18738 * src/lex.c (parse_percent_token): Change type of variable `tx', which
18739 is now an option_table_struct*.
18740 (option_strcmp): New function option_strcmp.
18741 (parse_percent_token): Call option_strcmp.
18742 * src/getargs.c (xalloc.h, options.h): Include it.
18743 (getargs): Call create_long_option_table.
18744 (getargs): Free longopts at the end of the function.
18745 (shortopts): Move in options.c.
18746 * src/options.c (create_long_option_table): New function. Convert
18747 information from option_table to option structure.
18748 * src/reader.c (options.h): Include it.
18750 * src/Makefile.am: Adjust.
18751 * src/options.c (option_table): Create from longopts and percent_table.
18752 * src/getargs.c (longopts): Delete.
18753 * src/lex.c (struct percent_table_struct): Delete.
18754 (percent_table): Delete.
18755 (options.h): Include it.
18756 * src/options.c: Create.
18757 * src/options.h: Create.
18758 Declare enum opt_access_e.
18759 Define struct option_table_struct.
18761 2001-09-20 Marc Autret <autret_m@epita.fr>
18763 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
18766 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
18768 * src/bison.simple: s/%%filename/%%skeleton.
18769 * src/muscle_tab.c (getargs.h): Include it.
18770 (muscle_init): Insert new muscle skeleton.
18772 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
18774 * src/output.c (output_parser): Delete unused variable actions_dumped.
18776 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
18778 * src/output.c (output): Delete call to reader_output_yylsp.
18779 * src/reader.c (reader): Likewise.
18780 * src/reader.h: Delete declaration of reader_output_yylsp.
18782 2001-09-02 Marc Autret <autret_m@epita.fr>
18784 * src/reader.c: Include muscle_tab.h.
18785 (parse_union_decl): Update.
18786 (parse_macro_decl): Rename parse_muscle_decl.
18787 Update to use renamed functions and variable.
18788 (read_declarations, copy_action, read_additionnal_code, : Updated
18789 with correct variables and functions names.
18790 (packsymbols, reader): Likewise.
18792 * src/reader.h (muscle_obstack): Extern declaration update.
18794 * src/output.c: Include muscle_tab.h
18795 In all functions using macro_insert, change by using muscle_insert ().
18796 (macro_obstack): Rename muscle_obstack.
18797 Echo modifications in the whole file.
18798 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
18799 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
18800 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
18802 * src/muscle_tab.h: Update double inclusion macros.
18803 (macro_entry_s): Rename muscle_entry_s.
18806 * src/muscle_tab.c: Include muscle_tab.h.
18807 Rename macro_tabble to muscle_table.
18808 (mhash1, mhash2, mcmp): Use muscle_entry.
18809 (macro_init): Rename muscle_init. Update.
18810 (macro_insert): Rename muscle_insert. Update.
18811 (macro_find): Rename muscle_find. Update.
18813 * src/main.c: Include muscle_tab.h.
18814 (main): Call muscle_init ().
18815 * src/Makefile.am (bison_SOURCES): Echo modifications.
18817 2001-09-02 Marc Autret <autret_m@epita.fr>
18819 Now the files macro_tab.[ch] are named muscle_tab.[ch].
18821 * src/muscle_tab.c, src/muscle_tab.h: Add files.
18823 2001-09-02 Marc Autret <autret_m@epita.fr>
18825 * src/macrotab.c, src/macrotab.h: Remove.
18827 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
18829 * src/reader.c (copy_guard): Use muscle to specify the `#line'
18832 2001-09-01 Marc Autret <autret_m@epita.fr>
18834 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
18835 to an explicit value to activate the feature. We do it here.
18837 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
18839 * src/output.c (prepare): Delete the `filename' muscule insertion.
18840 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
18841 (parse_union_decl): Likewise.
18842 * src/macrotab.c (macro_init): Initialize filename by infile.
18844 2001-08-31 Marc Autret <autret_m@epita.fr>
18846 * src/bison.simple (YYLSP_NEEDED): New definition.
18847 * src/output.c (prepare): Add macro insertion of `locations_flag'
18849 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
18851 * src/output.c (prepare): Delete insertion of previous muscles,
18852 and insert the `prefix' muscles.
18853 * src/macrotab.c (macro_init): Likewise.
18854 (macro_init): Initialization prefix directive by `yy'.
18855 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
18856 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
18857 yylval, yydebug, yyerror, yynerrs and yyparse.
18858 New directive `#define' to substitute yydebug, ... with option
18861 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
18863 * src/main.c (main): Standardize.
18864 * src/output.c (output_table_data, output_parser): Likewise.
18865 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
18867 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
18869 * src/reader.c (read_additionnal_code): Rename %%user_code to
18871 * src/output.c (output): Rename %%declarations to %%prologue.
18872 * src/bison.simple: Echo modifications.
18874 2001-08-31 Marc Autret <autret_m@epita.fr>
18876 * src/reader.c (readgram): CleanUp.
18877 (output_token_defines): Likewise.
18878 (packsymbols): Likewise.
18879 (reader): Likewise.
18880 * src/output.c (output): CPP-out useless code.
18882 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
18884 * src/reader.c (reader): Delete obsolete call to function
18885 output_trailers and output_headers.
18886 * src/output.h: Remove obsolete functions prototypes of output_headers
18887 and output_trailers.
18889 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
18891 * src/main.c: Include macrotab.h.
18892 * src/macrotab.h (macro_entry_s): Constify fields.
18893 Adjust functions prototypes.
18894 * src/macrotab.c (macro_insert): Constify key and value.
18895 (macro_find): Constify key.
18896 (macro_insert): Include 'xalloc.h'
18897 (macro_insert): Use XMALLOC.
18898 (macro_find): Constify return value.
18899 * src/output.c (output_table_data): Rename table to table_data.
18900 (output_parser): Constify macro_key, macro_value.
18902 2001-08-30 Marc Autret <autret_m@epita.fr>
18904 * src/reader.c (parse_skel_decl): New.
18905 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
18906 * src/lex.h (token_t): New token `tok_skel'.
18907 * src/lex.c (percent_table): Add skeleton option entry.
18910 2001-08-29 Marc Autret <autret_m@epita.fr>
18912 * src/bison.simple: Add %%user_code directive at the end.
18913 * src/reader.c (read_additionnal_code): New.
18915 * src/output.c (output_program): Remove.
18918 2001-08-28 Marc Autret <autret_m@epita.fr>
18920 * src/output.c (output_actions): Clean up.
18921 (output_gram): CPP-out useless code.
18922 * src/reader.c (reader): Clean up, CPP-out useless code.
18924 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
18926 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
18928 * src/bison.simple: Add `%%definitions'.
18930 2001-08-28 Marc Autret <autret_m@epita.fr>
18932 * config/depcomp: New file.
18934 2001-08-27 Paul Eggert <eggert@twinsun.com>
18936 * src/bison.simple (yyparse): Don't take the address of an
18937 item before the start of an array, as that doesn't conform to
18940 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
18942 * src/output.c (output): Remove the initialization of the macro
18943 obstack. It was done too late here.
18945 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
18947 (reader): Initialize the macro obstack here, since we need it to grow
18948 '%define' directives.
18950 * src/reader.h: Declare the macro obstack as extern.
18952 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
18954 * src/output.c (output_parser): Fix. Store single '%' characters in
18955 the output obstack instead of throwing them away.
18957 2001-08-27 Akim Demaille <akim@epita.fr>
18959 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
18961 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18963 * lib/Makefile.am: Adjust.
18965 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18967 * src/bison.simple: Update and add '%%' directives.
18969 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18971 * src/reader.c (reader): Remove calls to 'output_headers' and
18972 'output_trailers'. Remove some C output.
18973 (readgram): Disable a piece of code that was writing a default
18974 definition for 'YYSTYPE'.
18975 (reader_output_yylsp): Remove.
18976 (packsymbols): Output token defintions to a macro.
18977 (copy_definition): Disable C output.
18979 * src/reader.c (parse_macro_decl): New function used to parse macro
18981 (copy_string2): Put the body of copy_string into this new function.
18982 Add a parameter to let the caller choose whether he wants to copy the
18983 string delimiters or not.
18984 (copy_string): Be a simple call to copy_string2 with the last argument
18986 (read_declarations): Add case for macro definition.
18987 (copy_identifier): New.
18988 (parse_macro_decl): Read macro identifiers using copy_identifier
18991 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18993 * src/output.c (prepare): Add prefixed names.
18994 (output_parser): Output semantic actions.
18995 (output_parser): Fix bug on '%%line' directives.
18997 * src/output.c (output_headers): Remove. The C code printed by this
18998 function should now be in the skeletons.
18999 (output_trailers): Remove.
19000 (output): Disable call to 'reader_output_yylsp'.
19001 (output_rule_data): Do not output tables to the table obstack.
19003 * src/output.c: Remove some C dedicated output.
19004 Improve the use of macro and output obstacks.
19005 (output_defines): Remove.
19007 * src/output.c (output_token_translations): Associate 'translate'
19008 table with a macro. No output to the table obstack.
19009 (output_gram): Same for 'rhs' and 'prhs'.
19010 (output_stos): Same for 'stos'.
19011 (output_rule_data): Same for 'r1' and 'r2'.
19012 (token_actions): Same for 'defact'.
19013 (goto_actions): Same for 'defgoto'.
19014 (output_base): Same for 'pact' and 'pgoto'.
19015 (output_table): Same for 'table'.
19016 (output_check): Same for 'check'.
19018 * src/output.c (output_table_data): New function.
19019 (output_short_table): Remove.
19020 (output_short_or_char_table): Remove.
19022 * src/output.c (output_parser): Replace most of the skeleton copy code
19023 with something new. Skeletons are now processed character by character
19024 rather than line by line, and Bison looks for '%%' macros. This is the
19025 first step in making Bison's output process (a lot) more flexible.
19026 (output_parser): Use the macro table.
19028 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19030 * src/main.c (main): Initialize the macro table.
19032 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19034 * src/lex.c (percent_table): Add tok_define.
19035 * src/lex.h: Add tok_define.
19037 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19039 * src/macrotab.c: New file.
19040 * src/macrotab.h: New file.
19041 * src/Makefile.am: Update.
19043 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19045 * lib/hash.c: New file.
19046 * lib/hash.h: New file.
19047 * lib/Makefile.am: Update.
19049 2001-08-15 Akim Demaille <akim@epita.fr>
19053 2001-08-15 Marc Autret <autret_m@epita.fr>
19055 * src/reader.c (readgram): Indent output macro YYSTYPE.
19056 (packsymbols): Likewise.
19057 (output_token_defines): Likewise.
19058 * src/files.c: Standardize.
19059 (compute_header_macro): New.
19060 (defines_obstack_save): New. Use compute_header_macro.
19061 (output_files): Update. Use defines_obstack_save.
19063 2001-08-15 Akim Demaille <akim@epita.fr>
19065 * doc/bison.texinfo (Table of Symbols): Document
19066 YYSTACK_USE_ALLOCA.
19068 2001-08-15 Akim Demaille <akim@epita.fr>
19070 * missing: Update from CVS Automake.
19071 * config/config.guess, config/config.sub, config/texinfo.tex:
19072 Update from gnu.org.
19074 2001-08-15 Akim Demaille <akim@epita.fr>
19076 * Makefile.maint: Sync with CVS Autoconf.
19078 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
19080 * doc/bison.texinfo: Include GNU Free Documentation License from
19082 * doc/fdl.texi: Add to package.
19084 2001-08-14 Marc Autret <autret_m@epita.fr>
19086 Turn on %{source,header}_extension features.
19088 * src/lex.c (percent_table): Un-CPP out header_extension and
19090 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
19091 (compute_exts_from_src): Remove conditions. It restores priorities
19094 2001-08-14 Marc Autret <autret_m@epita.fr>
19096 * src/files.c (compute_base_names): Add extensions computing when
19097 `--file-prefix' used.
19098 Standardize function calls.
19100 2001-08-13 Marc Autret <autret_m@epita.fr>
19102 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
19103 defining it (defined but null disables alloca).
19105 2001-08-13 Marc Autret <autret_m@epita.fr>
19107 * src/bison.simple (_yy_memcpy): CPP reformat.
19109 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
19111 * tests/atconfig.in (CPPFLAGS): Fix.
19113 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
19115 * doc/bison.texinfo: Include GNU General Public License from
19117 * doc/gpl.texi: Add to package.
19119 2001-08-10 Marc Autret <autret_m@epita.fr>
19121 * src/print_graph.h: Fix.
19122 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
19124 2001-08-10 Akim Demaille <akim@epita.fr>
19126 * src/system.h: Provide default declarations for stpcpy, strndup,
19129 2001-08-10 Robert Anisko <anisko_r@epita.fr>
19131 * doc/bison.texinfo (Locations): Update @$ stuff.
19133 2001-08-09 Robert Anisko <anisko_r@epita.fr>
19135 * src/bison.simple (YYLLOC_DEFAULT): Update.
19138 2001-08-08 Marc Autret <autret_m@epita.fr>
19140 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
19141 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
19142 Reported by Fabrice Bauzac.
19144 2001-08-08 Marc Autret <autret_m@epita.fr>
19146 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
19147 * src/vcg.c (output_node): Fix.
19148 * src/vcg.h: Cleanup.
19149 * src/print_graph.c: Add comments.
19150 (node_output_size): New global variable. Simplify the formatting of
19151 the VCG graph output.
19152 (print_actions): Unused code is now used. It notifies the final state
19153 and no action states in the VCG graph. It also give the reduce actions.
19154 The `shift and goto' edges are red and the `go to state' edges are
19156 Get the current node name and node_obstack by argument.
19157 (node_obstack): New variable.
19158 (print_state): Manage node_obstack.
19159 (print_core): Use node_obstack given by argument.
19160 A node is not only computed here but in print_actions also.
19161 (print_graph): CPP out useless code instead of commenting it.
19163 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
19165 * tests/atconfig.in (CPPFLAGS): Fix.
19167 2001-08-07 Akim Demaille <akim@epita.fr>
19169 * src/print_graph.c (quote): New.
19170 (print_core): Use it.
19172 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
19174 * src/vcg.c (complain.h): Include it.
19175 Unepitaize `return' invocations.
19176 [NDEBUG] (main): Remove.
19177 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
19178 * src/files.c (open_files): Initialize graph_obstack.
19179 * src/print_graph.c (print_actions): CPP out useless code.
19180 (print_core): Don't output the last `\n' in labels.
19182 * src/files.c (output_files): Output the VCG file.
19183 * src/main.c (main): Invoke print_graph ();
19185 2001-08-06 Marc Autret <autret_m@epita.fr>
19187 Automaton VCG graph output.
19188 Using option ``-g'' or long option ``--graph'', you can generate
19189 a gram_filename.vcg file containing a VCG description of the LALR (1)
19190 automaton of your grammar.
19192 * src/main.c: Call to print_graph() function.
19193 * src/getargs.h: Update.
19194 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
19195 (graph_flag): New flag.
19196 (longopts): Update.
19197 (getargs): Add case `g'.
19198 * src/files.c (graph_obstack): New obstack struct.
19199 (open_files): Initialize new obstack.
19200 (output_files): Saves graph_obstack if required.
19201 * src/files.h (graph_obstack): New extern declaration.
19202 * src/Makefile.am: Add new source files.
19204 2001-08-06 Marc Autret <autret_m@epita.fr>
19206 * src/print_graph.c, src/print_graph.h (graph): New.
19207 * src/vcg.h: New file.
19208 * src/vcg.c: New file, VCG graph handling.
19210 2001-08-06 Marc Autret <autret_m@epita.fr>
19212 Add of %source_extension and %header_extension which specify
19213 the source or/and the header output file extension.
19215 * src/files.c (compute_base_names): Remove initialisation of
19216 src_extension and header_extension.
19217 (compute_exts_from_gf): Update.
19218 (compute_exts_from_src): Update.
19219 (output_files): Update.
19220 * src/reader.c (parse_header_extension_decl): New.
19221 (parse_source_extension_decl): New.
19222 (read_declarations): New case statements for the new tokens.
19223 * src/lex.c (percent_table): Add entries for %source_extension
19224 and %header_extension.
19225 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
19227 2001-08-06 Marc Autret <autret_m@epita.fr>
19229 * configure.in: Bump to 1.28c.
19230 * doc/bison.texinfo: Texinfo thingies.
19232 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
19234 * tests/atconfig.in (CPPFLAGS): Add.
19235 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
19237 2001-08-03 Akim Demaille <akim@epita.fr>
19241 2001-08-03 Akim Demaille <akim@epita.fr>
19243 * tests/Makefile.am (check-local): Ship testsuite.
19244 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
19245 Include `string.h'.
19247 2001-08-03 Akim Demaille <akim@epita.fr>
19249 * configure.in: Try using -Wformat when compiling.
19251 2001-08-03 Akim Demaille <akim@epita.fr>
19253 * configure.in: Bump to 1.28b.
19255 2001-08-03 Akim Demaille <akim@epita.fr>
19257 * src/complain.c: Adjust strerror_r portability issues.
19259 2001-08-03 Akim Demaille <akim@epita.fr>
19263 2001-08-03 Akim Demaille <akim@epita.fr>
19265 * src/getargs.c, src/getarg.h (skeleton)): Constify.
19266 * src/lex.c (literalchar): Avoid name clashes on `buf'.
19267 * src/getargs.c: Include complain.h.
19268 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
19269 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
19271 2001-08-03 Akim Demaille <akim@epita.fr>
19273 * src/reader.c (readgram): Display hidden chars in error messages.
19275 2001-08-03 Akim Demaille <akim@epita.fr>
19277 Update to gettext 0.10.39.
19279 2001-08-03 Akim Demaille <akim@epita.fr>
19281 * lib/strspn.c: New.
19283 2001-08-01 Marc Autret <autret_m@epita.fr>
19285 * doc/bison.texinfo: Update.
19286 * doc/bison.1 (mandoc): Update.
19287 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
19288 * src/files.c: Support output files extensions computing.
19289 (src_extension): New static variable.
19290 (header_extension): New static variable.
19291 (tr): New function.
19292 (get_extension_index): New function, gets the index of an extension
19293 filename in a string.
19294 (compute_exts_from_gf): New function, computes extensions from the
19295 grammar file extension.
19296 (compute_exts_from_src): New functions, computes extensions from the
19297 C source file extension, file given by ``-o'' option.
19298 (compute_base_names): Update.
19299 (output_files): Update.
19301 2001-08-01 Robert Anisko <anisko_r@epita.fr>
19303 * doc/bison.texi: Document @$.
19304 (Locations): New section.
19306 2001-07-18 Akim Demaille <akim@epita.fr>
19308 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
19309 * config/prev-version.txt, config/move-if-change: New.
19310 * Makefile.am: Adjust.
19312 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
19314 * src/bison.simple (yyparse): Suppress warning `comparaison
19315 between signed and unsigned'.
19317 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
19319 * src/getargs.h (raw_flag): Remove.
19320 * src/getargs.c: Die on `-r'/`--raw'.
19321 * src/lex.c (parse_percent_token): Die on `%raw'.
19322 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
19323 * tests/calc.at: Suppress test with option `--raw'.
19325 2001-07-14 Akim Demaille <akim@epita.fr>
19328 * configure.in: Require Autoconf 2.50.
19329 Update to gettext 0.10.38.
19331 2001-03-16 Akim Demaille <akim@epita.fr>
19333 * doc/bison.texinfo: ANSIfy the examples.
19335 2001-03-16 Akim Demaille <akim@epita.fr>
19337 * getargs.c (skeleton): New variable.
19338 (longopts): --skeleton is a new option.
19339 (shortopts, getargs): -S is a new option.
19340 * getargs.h: Declare skeleton.
19341 * output.c (output_parser): Use it.
19343 2001-03-16 Akim Demaille <akim@epita.fr>
19345 * m4/strerror_r.m4: New.
19346 * m4/error.m4: Run AC_FUNC_STRERROR_R.
19347 * lib/error.h, lib/error.c: Update.
19349 2001-03-16 Akim Demaille <akim@epita.fr>
19351 * src/getargs.c (longopts): Clean up.
19353 2001-02-21 Akim Demaille <akim@epita.fr>
19355 * src/reader.c (gensym): `gensym_count' is your own.
19356 Use a static buf to create the symbol name, as token_buffer is no
19359 2001-02-08 Akim Demaille <akim@epita.fr>
19361 * src/conflicts.c (conflict_report): Be sure not to append to res
19362 between two calls, which could happen if both first sprintf were
19363 skipped, but not the first cp += strlen.
19365 2001-02-08 Akim Demaille <akim@epita.fr>
19367 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
19368 New, from fileutils 4.0.37.
19369 * configure.in: Require Autoconf 2.49c. I took some time before
19370 making this decision. This is the only way out for portability
19371 issues in Bison, it would mean way too much duplicate effort to
19372 import in Bison features implemented in 2.49c since 2.13.
19373 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
19375 2001-02-02 Akim Demaille <akim@epita.fr>
19377 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
19378 * lib/xalloc.h, lib/xmalloc.c: Update.
19380 2001-01-19 Akim Demaille <akim@epita.fr>
19382 Get rid of the ad hoc handling of token_buffer in the scanner: use
19385 * src/lex.c (token_obstack): New.
19386 (init_lex): Initialize it. No longer call...
19387 (grow_token_buffer): this. Remove it.
19388 Adjust all the places which used it to use the obstack.
19390 2001-01-19 Akim Demaille <akim@epita.fr>
19392 * src/lex.h: Rename all the tokens:
19393 s/\bENDFILE\b/tok_eof/g;
19394 s/\bIDENTIFIER\b/tok_identifier/g;
19396 Let them be enums, not #define, to ease debugging.
19397 Adjust all the code.
19399 2001-01-18 Akim Demaille <akim@epita.fr>
19401 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
19402 * src/lex.c (maxtoken, grow_token_buffer): Static.
19404 2001-01-18 Akim Demaille <akim@epita.fr>
19406 Since we now use obstacks, more % directives can be enabled.
19408 * src/lex.c (percent_table): Also accept `%yacc',
19409 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
19411 Handle the actions for `%semantic_parser' and `%pure_parser' here,
19412 instead of returning a token.
19413 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
19414 * src/reader.c (read_declarations): Adjust.
19415 * src/files.c (open_files): Don't call `compute_base_names', don't
19416 compute `attrsfile' since they depend upon data which might be
19417 *in* the input file now.
19418 (output_files): Do it here.
19419 * src/output.c (output_headers): Document the fact that this patch
19420 introduces a guaranteed SEGV for semantic parsers.
19421 * doc/bison.texinfo: Document them.
19422 * tests/suite.at: Exercise these %options.
19424 2000-12-20 Akim Demaille <akim@epita.fr>
19426 Also handle the output file (--verbose) with obstacks.
19428 * files.c (foutput): Remove.
19429 (output_obstack): New.
19430 Adjust all dependencies.
19431 * src/conflicts.c: Return a string.
19432 * src/system.h (obstack_grow_string): Rename as...
19433 (obstack_sgrow): this. Be ready to work with non literals.
19434 (obstack_fgrow4): New.
19436 2000-12-20 Akim Demaille <akim@epita.fr>
19438 * src/files.c (open_files): Fix the computation of short_base_name
19439 in the case of `-o foo.tab.c'.
19441 2000-12-20 Akim Demaille <akim@epita.fr>
19443 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
19444 (copy_dollar): Now that everything uses obstacks, get rid of the
19447 2000-12-20 Akim Demaille <akim@epita.fr>
19449 * src/files.c (open_files): Actually the `.output' file is based
19450 on the short_base_name, not base_name.
19451 * tests/suite.at (Checking output file names): Adjust.
19453 2000-12-20 Akim Demaille <akim@epita.fr>
19455 * src/bison.s1: Remove, we now use directly...
19456 * src/bison.simple: this.
19457 * src/Makefile.am: Use pkgdata instead of data.
19459 2000-12-20 Akim Demaille <akim@epita.fr>
19461 * src/files.c (guard_obstack): New.
19462 (open_files): Initialize it.
19463 (output_files): Dump it...
19464 * src/files.h: Export it.
19465 * src/reader.c (copy_guard): Use it.
19467 2000-12-19 Akim Demaille <akim@epita.fr>
19469 * src/files.c (outfile, defsfile, actfile): Removed as global
19471 (open_files): Don't compute them.
19472 (output_files): Adjust.
19473 (base_name, short_base_name): Be global.
19474 Adjust dependencies.
19476 2000-12-19 Akim Demaille <akim@epita.fr>
19478 * src/files.c (strsuffix): New.
19479 (stringappend): Be just like strcat but allocate.
19480 (base_names): Eve out from open_files.
19481 Try to simplify the rather hairy computation of base_name and
19483 (open_files): Use it.
19484 * tests/suite.at (Checking output file names): New test.
19486 2000-12-19 Akim Demaille <akim@epita.fr>
19488 * src/system.h (obstack_grow_literal_string): Rename as...
19489 (obstack_grow_string): this.
19490 * src/output.c (output_parser): Recognize `%% actions' instead of
19492 * src/bison.s1: s/$/%% actions/.
19493 * src/bison.hairy: Likewise.
19495 2000-12-19 Akim Demaille <akim@epita.fr>
19497 * src/output.c (output_parser): Compute the `#line' lines when
19499 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
19500 Suggested by Hans Aberg.
19502 2000-12-19 Akim Demaille <akim@epita.fr>
19504 Let the handling of the skeleton files be local to the procedures
19507 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
19509 (fparser, open_extra_files): Remove.
19510 (open_files, output_files): Don't take care of fparser.
19511 * src/files.h: Adjust.
19512 * src/output.c (output_parser): Open and close the file to the
19514 * src/reader.c (read_declarations): When %semantic_parser, open
19517 2000-12-19 Akim Demaille <akim@epita.fr>
19519 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
19520 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
19522 2000-12-19 Akim Demaille <akim@epita.fr>
19524 * src/files.c (open_files): Yipee! We no longer need all the code
19525 looking for `/tmp' since we have no tmp file.
19527 2000-12-19 Akim Demaille <akim@epita.fr>
19529 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
19531 * src/files.c (open_files): Less dependency on MSDOS etc.
19533 2000-12-14 Akim Demaille <akim@epita.fr>
19535 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
19536 Provide a default definition.
19537 Use it when executing the default @ action.
19538 * src/reader.c (reader_output_yylsp): No longer include
19539 `timestamp' and `text' in the default YYLTYPE.
19541 2000-12-12 Akim Demaille <akim@epita.fr>
19543 * src/reader.c (copy_definition, parse_union_decl, copy_action)
19544 (copy_guard): Quote the file names.
19545 Reported by Laurent Mascherpa.
19547 2000-12-12 Akim Demaille <akim@epita.fr>
19549 * src/output.c (output_headers, output_program, output): Be sure
19550 to escape special characters when outputting filenames.
19551 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
19552 (output_headers): Don't depend on them, Use ACTSTR.
19554 2000-11-17 Akim Demaille <akim@epita.fr>
19556 * lib/obstack.h: Formatting changes.
19557 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
19558 prevents type checking.
19559 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
19560 cast the value to (void *): assigning a `foo *' to a `void *'
19562 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
19563 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
19566 2000-11-17 Akim Demaille <akim@epita.fr>
19568 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
19570 (suite.m4, regression.m4, calc.m4): these.
19571 * tests/atgeneral.m4: Update from CVS Autoconf.
19573 2000-11-17 Akim Demaille <akim@epita.fr>
19575 * tests/regression.m4 (%union and --defines): New test,
19576 demonstrating a current bug in the obstack implementation.
19578 2000-11-17 Akim Demaille <akim@epita.fr>
19580 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
19582 Use them to declare the variables which are global or local to
19585 2000-11-17 Akim Demaille <akim@epita.fr>
19587 * acconfig.h: Remove, no longer used.
19589 2000-11-07 Akim Demaille <akim@epita.fr>
19591 * src: s/Copyright (C)/Copyright/g.
19593 2000-11-07 Akim Demaille <akim@epita.fr>
19595 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
19597 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
19599 2000-11-07 Akim Demaille <akim@epita.fr>
19601 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
19602 Merge in a single CPP if/else.
19604 2000-11-07 Akim Demaille <akim@epita.fr>
19606 * src/output.c (output): Remove useless variables.
19607 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
19608 argument `data' for consistency with the prototypes.
19609 Qualify it `const'.
19610 (obstack_copy, obstack_copy0): Rename the second argument as
19611 `address' for consistency. Qualify it `const'.
19612 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
19613 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
19614 `const' their input argument (`data' or `address').
19615 Adjust the corresponding macros to include `const' in casts.
19617 2000-11-03 Akim Demaille <akim@epita.fr>
19619 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
19620 s/PFILE1/BISON_HAIRY/.
19621 Adjust dependencies.
19623 2000-11-03 Akim Demaille <akim@epita.fr>
19625 For some reason, this was not applied.
19627 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
19628 `unlink': it's no longer used.
19630 2000-11-03 Akim Demaille <akim@epita.fr>
19632 * src/files.c (skeleton_find): New function, eved out of...
19633 (open_files, open_extra_files): here.
19635 2000-11-03 Akim Demaille <akim@epita.fr>
19637 Don't use `atexit'.
19639 * src/files.c (obstack_save): New function.
19640 (done): Rename as...
19641 (output_files): this.
19642 Use `obstack_save'.
19643 * src/main.c (main): Don't use `atexit' to register `done', since
19644 it no longer has to remove tmp files, just call `output_files'
19645 when there are no errors.
19647 2000-11-02 Akim Demaille <akim@epita.fr>
19649 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
19650 `unlink': it's no longer used.
19651 * src/files.h: Formatting changes.
19653 2000-11-02 Akim Demaille <akim@epita.fr>
19655 Remove the last uses of mktemp and unlink/delete.
19657 * src/files.c (fdefines, ftable): Removed.
19658 (defines_ostack, table_obstack): New.
19659 Adjust dependencies of the former into uses of the latter.
19660 * src/output.c (output_short_or_char_table, output_short_table):
19661 Convert to using obstacks.
19662 * src/reader.c (copy_comment2): Accept one FILE * and two
19664 (output_token_defines, reader_output_yylsp): Use obstacks.
19665 * src/system.h (obstack_fgrow3): New.
19666 * po/POTFILES.in: Adjust.
19668 2000-11-01 Akim Demaille <akim@epita.fr>
19670 Change each use of `fattrs' into a use of `attrs_obstack'.
19672 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
19673 * src/files.c (fattrs): Remove.
19674 (attrs_obstack): New.
19675 Adjust all dependencies.
19676 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
19678 2000-11-01 Akim Demaille <akim@epita.fr>
19680 Introduce obstacks.
19681 Change each use of `faction' into a use of `action_obstack'.
19683 * lib/obstack.h, lib/obstack.c: New files.
19684 * src/files.c (faction): Remove.
19685 (action_obstack): New.
19686 Adjust all dependencies.
19688 2000-10-20 Akim Demaille <akim@epita.fr>
19690 * lib/quote.h (PARAMS): New macro. Use it.
19692 2000-10-16 Akim Demaille <akim@epita.fr>
19694 * src/output.c (output_short_or_char_table): New function.
19695 (output_short_table, output_token_translations): Use it.
19696 (goto_actions): Use output_short_table.
19698 2000-10-16 Akim Demaille <akim@epita.fr>
19700 * src/symtab.c (bucket_new): New function.
19703 * src/output.c (output_short_table): New argument to display the
19704 comment associated with the table.
19705 Adjust dependencies.
19706 (output_gram): Use it.
19707 (output_rule_data): Nicer output layout for YYTNAME.
19709 2000-10-16 Akim Demaille <akim@epita.fr>
19711 * src/lex.c (read_typename): New function.
19713 * src/reader.c (copy_dollar): Likewise.
19715 2000-10-16 Akim Demaille <akim@epita.fr>
19717 * src/reader.c (copy_comment2): Expect the input stream to be on
19718 the `/' which is suspected to open a comment, instead of being
19719 called after `//' or `/*' was read.
19720 (copy_comment, copy_definition, parse_union_decl, copy_action)
19721 (copy_guard): Adjust.
19723 2000-10-16 Akim Demaille <akim@epita.fr>
19725 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
19726 `read_signed_integer'.
19728 2000-10-16 Akim Demaille <akim@epita.fr>
19730 * src/reader.c (copy_dollar): New function.
19731 (copy_guard, copy_action): Use it.
19733 2000-10-16 Akim Demaille <akim@epita.fr>
19735 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
19736 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
19737 New files, from Fileutils 4.0.27.
19738 * src/main.c (printable_version): Remove.
19739 * src/lex.c, src/reader.c: Use `quote'.
19741 2000-10-04 Akim Demaille <akim@epita.fr>
19743 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
19745 2000-10-04 Akim Demaille <akim@epita.fr>
19747 * doc/bison.texinfo: Various typos spotted by Neil Booth.
19749 2000-10-04 Akim Demaille <akim@epita.fr>
19751 When a literal string is used to define two different tokens,
19752 `bison -v' segfaults.
19753 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
19755 * tests/regression.m4: New file.
19756 Include the core of the sample provided by Piotr Gackiewicz.
19757 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
19760 2000-10-04 Akim Demaille <akim@epita.fr>
19762 * src/reader.c (parse_expect_decl): Keep `count' within the size
19766 2000-10-02 Paul Eggert <eggert@twinsun.com>
19768 * bison.s1 (yyparse): Assign the default value
19769 unconditionally, to avoid a GCC warning and make the parser a
19772 2000-10-02 Akim Demaille <akim@epita.fr>
19774 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
19777 2000-10-02 Akim Demaille <akim@epita.fr>
19779 * src/derives.c, src/print.c, src/reduce.c: To ease the
19780 translation, move some `\n' out of the translated strings.
19782 2000-10-02 Akim Demaille <akim@epita.fr>
19784 The location tracking mechanism is precious for parse error
19785 messages. Nevertheless, it is enabled only when `@n' is used in
19786 the grammar, which is a different issue (you can use it in error
19787 message, but not in the grammar per se). Therefore, there should
19788 be another means to enable it.
19790 * src/getargs.c (getargs): Support `--locations'.
19791 (usage): Report it.
19792 * src/getargs.h (locationsflag): Export it.
19793 * src/lex.c (percent_table): Support `%locations'.
19794 * src/reader.c (yylsp_needed): Remove this variable, now replaced
19795 with `locationsflag'.
19796 * doc/bison.texinfo: Document `--locations' and `%locations'.
19798 * tests/calc.m4: Test it.
19800 For regularity of the names, replace each
19801 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
19802 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
19803 In addition replace each `flag' with `_flag'.
19805 2000-10-02 Akim Demaille <akim@epita.fr>
19807 Also test parse error messages, including with YYERROR_VERBOSE.
19809 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
19811 Use it to check the computations.
19812 Use it to check `nonassoc' is honored.
19813 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
19814 `--yyerror-verbose'.
19815 (_AT_CHECK_CALC): Adjust to this option.
19816 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
19818 2000-10-02 Akim Demaille <akim@epita.fr>
19820 Test also `--verbose', `--defines' and `--name-prefix'. Testing
19821 the latter demonstrates a flaw in the handling of non debugging
19822 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
19823 was used in order to simplify:
19839 unfortunately this leads to a CPP conflict when
19840 `--name-prefix=foo' is used since it produces `#define yydebug
19843 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
19844 (YYDPRINTF): New macro.
19846 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
19848 Also test `--verbose', `--defines' and `--name-prefix'.
19850 2000-10-02 Akim Demaille <akim@epita.fr>
19852 Improve the readability of the produced parsers.
19854 * src/bison.s1: Formatting changes.
19855 Improve the comment related to the `$' mark.
19856 (yydefault): Don't fall through to `yyresume': `goto' there.
19857 * src/output.c (output_parser): When the `$' is met, skip the end
19859 New variable, `number_of_dollar_signs', to check there's exactly
19860 one `$' in the parser skeleton.
19862 2000-10-02 Akim Demaille <akim@epita.fr>
19864 * lib/xstrdup.c: New file, from the fileutils.
19865 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
19866 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
19867 instead of strlen + xmalloc + strcpy.
19868 * src/symtab.c (copys): Remove, use xstrdup instead.
19870 2000-10-02 Akim Demaille <akim@epita.fr>
19872 * src/gram.h (associativity): New enum type which replaces the
19873 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
19874 `right_assoc', `left_assoc' and `non_assoc'.
19875 Adjust all dependencies.
19876 * src/reader.c: Formatting changes.
19877 (LTYPESTR): Don't define it, use it as a literal in
19878 `reader_output_yylsp'.
19879 * src/symtab.h (symbol_class): New enum type which replaces the
19880 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
19881 `sunknown', `stoken and `snterm'.
19883 2000-10-02 Akim Demaille <akim@epita.fr>
19885 * src/getargs.c (fixed_outfiles): Rename as...
19886 (yaccflag): for consistency and accuracy.
19887 Adjust dependencies.
19889 2000-10-02 Akim Demaille <akim@epita.fr>
19891 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
19892 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
19893 difficult and introduced a lot of core dump. It turns out that
19894 Bison used an implementation of `xmalloc' based on `calloc', and
19895 at various places it does depend upon the initialization to 0. I
19896 have not tried to isolate the pertinent places, and all the former
19897 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
19898 someone should address this issue.
19900 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
19901 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
19903 Adjust dependencies.
19904 * src/warshall.h: New file.
19907 2000-10-02 Akim Demaille <akim@epita.fr>
19909 Various anti-`extern in *.c' changes.
19911 * src/system.h: Include `assert.h'.
19913 2000-10-02 Akim Demaille <akim@epita.fr>
19915 * src/state.h (nstates, final_state, first_state, first_shift)
19916 (first_reduction): Move their exportation from here...
19917 * src/LR0.h: to here.
19918 Adjust dependencies.
19919 * src/getargs.c (statisticsflag): New variable.
19920 Add support for `--statistics'.
19921 Adjust dependencies.
19923 Remove a lot of now useless `extern' statements in most files.
19925 2000-10-02 Akim Demaille <akim@epita.fr>
19927 * src/LR0.h: New file.
19930 2000-10-02 Akim Demaille <akim@epita.fr>
19932 * src/print.h: New file.
19934 * src/print.c: Formatting and ordering changes.
19935 (verbose, terse): Replace with...
19936 (print_results): this new function.
19937 Adjust dependencies.
19939 2000-10-02 Akim Demaille <akim@epita.fr>
19941 * src/conflicts.c (conflict_report): New function.
19942 (conflict_log, verbose_conflict_log): Replace with...
19943 (print_conflicts): this function.
19944 Adjust dependencies.
19945 * src/conflicts.h: New file.
19946 Propagate its inclusion.
19948 2000-10-02 Akim Demaille <akim@epita.fr>
19950 * src/nullable.h: New file.
19951 Propagate its inclusion.
19952 * src/nullable.c: Formatting changes.
19954 2000-10-02 Akim Demaille <akim@epita.fr>
19956 * src/reduce.h: New file.
19957 Propagate its inclusion.
19958 * src/reduce.c: Topological sort and other formatting changes.
19959 (bool, TRUE, FALSE): Move their definition to...
19960 * src/system.h: here.
19962 2000-10-02 Akim Demaille <akim@epita.fr>
19964 * src/files.c: Formatting changes.
19965 (tryopen, tryclose, openfiles): Rename as...
19966 (xfopen, xfclose, open_files): this.
19967 (stringappend): static.
19968 * src/files.h: Complete the list of exported symbols.
19971 2000-10-02 Akim Demaille <akim@epita.fr>
19973 * src/reader.h: New file.
19974 Propagate its use instead of tedious list of `extern' and
19976 * src/reader.c: Formatting changes, topological sort,
19979 2000-10-02 Akim Demaille <akim@epita.fr>
19981 * src/lex.h: Prototype `lex.c' exported functions.
19982 * src/reader.c: Adjust.
19983 * src/lex.c: Formatting changes.
19984 (safegetc): Rename as...
19987 2000-10-02 Akim Demaille <akim@epita.fr>
19989 * src/lalr.h: New file.
19990 Propagate its inclusion instead of prototypes and `extern'.
19991 * src/lalr.c: Formatting changes, topological sorting etc.
19993 2000-10-02 Akim Demaille <akim@epita.fr>
19995 * src/output.c (token_actions): Introduce a temporary array,
19996 YYDEFACT, that makes it possible for this function to use
19997 output_short_table.
19999 2000-10-02 Akim Demaille <akim@epita.fr>
20001 `user_toknums' is output as a `short[]' in `output.c', while it is
20002 defined as a `int[]' in `reader.c'. For consistency with the
20003 other output tables, `user_toknums' is now defined as a table of
20006 * src/reader.c (user_toknums): Be a short table instead of an int
20008 Adjust dependencies.
20010 Factor the short table outputs.
20012 * src/output.c (output_short_table): New function.
20013 * src/output.c (output_gram, output_stos, output_rule_data)
20014 (output_base, output_table, output_check): Use it.
20016 2000-10-02 Akim Demaille <akim@epita.fr>
20018 * src/output.c (output): Topological sort of the functions, in
20019 order to get rid of the `static' prototypes.
20020 No longer use `register'.
20021 * src/output.h: New file.
20022 Propagate its inclusion in files explicitly prototyping functions
20025 2000-09-21 Akim Demaille <akim@epita.fr>
20027 * src/atgeneral.m4: Update from Autoconf.
20029 2000-09-21 Akim Demaille <akim@epita.fr>
20031 * src/closure.h: New file.
20032 * src/closure.c: Formatting changes, topological sort over the
20033 functions, use of closure.h.
20034 (initialize_closure, finalize_closure): Rename as...
20035 (new_closure, free_closure): these. Adjust dependencies.
20036 * src/LR0.c: Formatting changes, topological sort, use of
20038 (initialize_states): Rename as...
20039 (new_states): this.
20040 * src/Makefile.am (noinst_HEADERS): Adjust.
20042 2000-09-20 Akim Demaille <akim@epita.fr>
20044 * src/acconfig.h: Don't protect config.h against multiple
20046 Don't define PARAMS.
20047 * src/system.h: Define PARAMS.
20048 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
20049 purpose of config.h. system.h must not try to fix wrong
20050 definitions in config.h.
20052 2000-09-20 Akim Demaille <akim@epita.fr>
20054 * src/derives.h: New file.
20055 * src/main.c, src/derives.h: Use it.
20056 Formatting changes.
20057 * src/Makefile.am (noinst_HEADERS): Adjust.
20059 2000-09-20 Akim Demaille <akim@epita.fr>
20061 * tests/atgeneral.m4: Update from Autoconf.
20062 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
20063 (AT_CHECK_CALC): New macros.
20064 Use these macros to test bison with options `', `--raw',
20065 `--debug', `--yacc', `--yacc --debug'.
20067 2000-09-19 Akim Demaille <akim@epita.fr>
20069 * src/output.c: Formatting changes.
20070 * src/machine.h: Remove, leaving its contents in...
20071 * src/system.h: here.
20073 Adjust all dependencies on stdio.h and machine.h.
20074 * src/getargs.h: New file.
20075 Let all `extern' declarations about getargs.c be replaced with
20076 inclusion of `getargs.h'.
20077 * src/Makefile.am (noinst_HEADERS): Adjust.
20079 * tests/calc.m4 (yyin): Be initialized in main, not on the global
20081 (yyerror): Returns void, not int.
20082 * doc/bison.texinfo: Formatting changes.
20084 2000-09-19 Akim Demaille <akim@epita.fr>
20086 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
20089 2000-09-18 Akim Demaille <akim@epita.fr>
20091 * configure.in: Append WARNING_CFLAGS to CFLAGS.
20092 * src/Makefile.am (INCLUDES): Don't.
20093 Be ready to fetch headers in lib/.
20095 2000-09-18 Akim Demaille <akim@epita.fr>
20097 * doc/bison.texinfo: Update the copyright.
20098 ANSIfy and GNUify the examples.
20099 Remove the old menu.
20101 2000-09-18 Akim Demaille <akim@epita.fr>
20103 First set of tests: use the `calc' example from the documentation.
20105 * src/bison.s1 (yyparse): Condition the code using `yytname' which
20106 is defined only when YYDEBUG is.
20107 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
20108 * src/files.c (tryopen, tryclose): Formatting changes.
20109 Move to the top and be static.
20110 * src/reader.c (read_signed_integer): Likewise.
20111 * tests/calc.m4: New file.
20112 * Makefile.am, suite.m4: Adjust.
20113 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
20115 2000-09-18 Akim Demaille <akim@epita.fr>
20117 Add support for an Autotest test suite for Bison.
20119 * m4/m4.m4, m4/atconfig.m4: New files.
20120 * m4/Makefile.am (EXTRA_DIST): Adjust.
20121 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
20123 * src/getargs.c: Display a more standard --version message.
20124 * src/reader.c (reader): Formatting changes.
20125 No longer depend upon VERSION_STRING.
20126 * configure.in: No longer use `dnl'.
20127 Set up the test suite and the new directory `tests/.
20128 (VERSION_STRING): Remove.
20130 2000-04-14 Akim Demaille <akim@epita.fr>
20132 * src/reader.c (copy_comment2): New function, same as former
20133 `copy_comment', but outputs into two FILE *.
20134 (copy_comment): Use it.
20135 (parse_union_decl): Use it.
20136 (get_type, parse_start_decl): Use the same `invalid' message.
20137 (parse_start_decl, parse_union_decl): Use the same `multiple'
20139 (parse_union_decl, copy_guard, copy_action): Use the same
20140 `unmatched' message.
20141 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
20143 2000-03-31 Akim Demaille <akim@epita.fr>
20145 * src/files.c (tryopen, tryclose): Move to the top.
20148 2000-03-31 Akim Demaille <akim@epita.fr>
20150 * src/main.c (main): Don't call `done', exit does it.
20152 2000-03-31 Akim Demaille <akim@epita.fr>
20154 * allocate.c: s/return (foo)/return foo/.
20155 * lalr.c: Likewise.
20157 * output.c: Likewise.
20158 * reader.c: Likewise.
20159 * symtab.c: Likewise.
20160 * vmsgetargs.c: Likewise.
20162 2000-03-31 Akim Demaille <akim@epita.fr>
20164 Clean up the error reporting functions.
20166 * src/report.c: New file.
20167 * src/report.h: Likewise.
20168 * src/Makefile.am: Adjust.
20169 * m4/error.m4: New file.
20170 * m4/Makefile.am: Adjust.
20171 * configure.in (jm_PREREQ_ERROR): Call it.
20172 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
20174 (fatal, fatals): Remove. All callers use complain.c::fatal.
20175 (warn, warni, warns, warnss, warnss): Remove. All callers use
20176 complain.c::complain.
20177 (toomany): Remove, use fatal instead.
20178 * src/files.c (done): No argument, use complain_message_count.
20179 * src/main.c (main): Register `done' to `atexit'.
20181 * src/getargs.c (usage): More `fputs', less `fprintf'.
20183 2000-03-28 Akim Demaille <akim@epita.fr>
20185 * lib/: New directory.
20186 * Makefile.am (SUBDIRS): Adjust.
20187 * configure.in: Adjust.
20188 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
20190 * src/alloca.c: Moved to lib/.
20191 * src/getopt.c: Likewise.
20192 * src/getopt1.c: Likewise.
20193 * src/getopt.h: Likewise.
20194 * src/ansi2knr.c: Likewise.
20195 * src/ansi2knr.1: Likewise.
20196 * src/Makefile.am: Adjust.
20197 * lib/Makefile.am: New file.
20199 2000-03-28 Akim Demaille <akim@epita.fr>
20201 * src/getargs.c (usage): Refresh the help message.
20203 2000-03-17 Akim Demaille <akim@epita.fr>
20205 * src/getopt1.c: Updated from textutils 2.0e
20206 * src/getopt.c: Likewise.
20207 * src/getopt.h: Likewise.
20209 2000-03-17 Akim Demaille <akim@epita.fr>
20211 * src/Makefile.am (bison.simple): Fix the awk program: quote only
20212 the file name, not the whole `#line LINE FILE'.
20214 2000-03-17 Akim Demaille <akim@epita.fr>
20216 On syntax errors, report the token on which we choked.
20218 * src/bison.s1 (yyparse): In the label yyerrlab, when
20219 YYERROR_VERBOSE, add yychar in msg.
20221 2000-03-17 Akim Demaille <akim@epita.fr>
20223 * src/reader.c (copy_at): New function.
20224 (copy_guard): Use it.
20225 (copy_action): Use it.
20227 2000-03-17 Akim Demaille <akim@epita.fr>
20229 Be kind to translators, save some useless translations.
20231 * src/main.c (banner): New function.
20232 (fatal_banner): Use it.
20233 (warn_banner): Use it.
20235 2000-03-17 Akim Demaille <akim@epita.fr>
20237 * src/reader.c (copy_definition): Use copy_string and
20238 copy_comment. Removed now unused `match', `ended',
20240 (copy_comment, copy_string): Moved, to be visible from
20243 2000-03-17 Akim Demaille <akim@epita.fr>
20245 * src/reader.c (copy_string): Declare `static inline'. No
20246 problems with inline, since it is checked by configure.
20247 (copy_comment): Likewise.
20249 2000-03-17 Akim Demaille <akim@epita.fr>
20251 * src/reader.c (packsymbols): Formatting changes.
20253 2000-03-17 Akim Demaille <akim@epita.fr>
20255 * src/reader.c (copy_comment): New function, factored out from:
20256 (copy_action): Use it. Removed now unused `match', `ended',
20258 (copy_guard): Likewise.
20260 2000-03-17 Akim Demaille <akim@epita.fr>
20262 * src/reader.c (copy_string): New function, factored out from:
20263 (copy_action): Use it.
20264 (copy_guard): Likewise.
20266 2000-03-17 Akim Demaille <akim@epita.fr>
20268 Change the handling of @s so that they behave exactly like $s.
20269 There is now a pseudo variable @$ (readble and writable), location
20270 of the lhs of the rule (by default ranging from the location of
20271 the first symbol of the rhs, to the location of the last symbol,
20272 or, if the rhs is empty, YYLLOC).
20274 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
20276 (yyparse): When providing a default semantic action, provide a
20277 default location action.
20278 (after the $): No longer change `*YYLSP', just stack YYLOC the
20279 same way you stack YYVAL.
20280 * src/reader.c (read_declarations): Use warns.
20281 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
20282 (copy_action, case '@'): Likewise.
20283 Use a standard error message, to save useless work from
20286 2000-03-17 Akim Demaille <akim@epita.fr>
20288 * src/bison.s1: Formatting and cosmetics changes.
20289 * src/reader.c: Likewise.
20290 Update the Copyright notice.
20292 2000-03-17 Akim Demaille <akim@epita.fr>
20294 * src/bison.s1 (#line): All set to `#line' only, since the
20295 Makefile now handles them.
20297 2000-03-16 Akim Demaille <akim@epita.fr>
20299 * src/output.c (output_rule_data): Output the documentation of
20300 some of the tables.
20301 (Copyright notice): Update.
20302 Formatting changes.
20304 2000-03-16 Akim Demaille <akim@epita.fr>
20306 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
20307 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
20308 One `#if YYDEBUG' remains, since it uses variables which are
20309 defined only if `YYDEBUG != 0'.
20311 2000-03-16 Akim Demaille <akim@epita.fr>
20313 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
20314 and related variables so that the similarities are highlighted.
20316 2000-03-16 Akim Demaille <akim@epita.fr>
20318 * src/bison.s1: Properly indent CPP directives.
20320 2000-03-16 Akim Demaille <akim@epita.fr>
20322 * src/bison.s1: Properly indent the `alloca' CPP section.
20324 2000-03-16 Akim Demaille <akim@epita.fr>
20326 Do not hard code values of directories in `configure.in'.
20327 Update the `configure' tool chain.
20329 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
20331 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
20332 (AC_OUTPUT): Add m4/Makefile.
20333 Bump to bison 1.28a, 1.29 has never been released.
20334 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
20335 handled via src/Makefile.am.
20336 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
20337 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
20339 * Makefile.am (SUBDIRS): Add m4.
20340 (ACLOCAL_AM_FLAGS): New variable.
20341 (AUTOMAKE_OPTIONS): Add check-news.
20342 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
20343 the proper line number and file name.
20344 (DEFS): Propagate the location of bison library files and of the
20346 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
20348 * acinclude.m4: Remove, replaced by the directory m4.
20349 * m4/Makefile.am (EXTRA_DIST): New variable.
20350 * m4/gettext.m4: New file, from the fileutils.
20351 * m4/lcmessage.m4: Likewise
20352 * m4/progtest.m4: Likewise.
20353 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
20355 2000-03-10 Akim Demaille <akim@epita.fr>
20358 Formatting changes of various comments.
20359 Respect the GNU coding standards at various places.
20360 Don't use `_()' when no translation is needed.
20362 1999-12-13 Jesse Thilo <jthilo@gnu.org>
20365 OS/2 honors TMPDIR environment variable.
20367 1999-12-13 Jesse Thilo <jthilo@gnu.org>
20369 * doc/bison.texinfo: Tweaked spelling and grammar.
20371 Removed reference to price of printed copy.
20372 Mention BISON_SIMPLE and BISON_HAIRY.
20374 1999-12-13 Jesse Thilo <jthilo@gnu.org>
20376 * configure.in, NEWS:
20377 Bison 1.29 released.
20379 1999-10-27 Jesse Thilo <jthilo@gnu.org>
20381 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
20382 Added reference card.
20384 1999-07-26 Jesse Thilo <jthilo@gnu.org>
20386 * po/ru.po: Added Russian translation.
20388 1999-07-26 Jesse Thilo <jthilo@gnu.org>
20390 * configure.in: Added Russian translation.
20392 1999-07-06 Jesse Thilo <jthilo@gnu.org>
20394 * configure.in, NEWS, README:
20395 Released version 1.28.
20397 1999-06-14 Jesse Thilo <jthilo@gnu.org>
20400 Squashed redefinition warning on some systems.
20402 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
20403 Have configure build version string instead of relying on ANSI string
20406 1999-06-14 Jesse Thilo <jthilo@gnu.org>
20408 * po/POTFILES.in: Got rid of version.c.
20410 1999-06-14 Jesse Thilo <jthilo@gnu.org>
20412 * acconfig.h, configure.in:
20413 Have configure build version string instead of relying on ANSI string
20416 1999-06-08 Jesse Thilo <jthilo@gnu.org>
20419 Dropped mention of `+' for long-named options.
20421 1999-05-30 Jesse Thilo <jthilo@gnu.org>
20423 * src/files.c: Added <unistd.h> for unlink().
20425 * src/Makefile.am, src/system.h:
20428 1999-05-30 Jesse Thilo <jthilo@gnu.org>
20430 * README: Added a FAQ list.
20432 * configure.in, acconfig.h:
20435 1999-05-30 Jesse Thilo <jthilo@gnu.org>
20437 * doc/FAQ, doc/Makefile.am:
20440 1999-05-19 Jesse Thilo <jthilo@gnu.org>
20442 * src/alloc.h, src/symtab.h, src/version.c:
20443 Protected inclusion of "config.h" with HAVE_CONFIG_H.
20445 1999-04-18 Jesse Thilo <jthilo@gnu.org>
20447 * src/.cvsignore, src/Makefile.am:
20448 Reorganized: sources in `src', documentation in `doc'.
20450 * src/lex.c (literalchar):
20451 fixed the code for escaping double quotes (thanks
20454 1999-04-18 Jesse Thilo <jthilo@gnu.org>
20456 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
20457 Adjusted paths to reflect directory reorganization.
20459 1999-04-18 Jesse Thilo <jthilo@gnu.org>
20461 * doc/.cvsignore, doc/Makefile.am:
20462 Reorganized: sources in `src', documentation in `doc'.
20464 1999-04-18 Jesse Thilo <jthilo@gnu.org>
20467 Updated AC_INIT file to reflect directory reorganization.
20469 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
20470 Reorganized: sources in `src', documentation in `doc'.
20472 1999-04-13 Jesse Thilo <jthilo@gnu.org>
20475 Don't declare calloc() and realloc() if not necessary.
20477 1999-04-13 Jesse Thilo <jthilo@gnu.org>
20479 * configure.in, acconfig.h, acinclude.m4:
20480 Don't declare calloc() and realloc() if not necessary.
20482 1999-03-23 Jesse Thilo <jthilo@gnu.org>
20484 * po/.cvsignore: Added i18n support.
20486 1999-03-23 Jesse Thilo <jthilo@gnu.org>
20488 * acconfig.h, configure.in, Makefile.am:
20489 Added i18n support.
20491 1999-03-22 Jesse Thilo <jthilo@gnu.org>
20493 * src/bison.s1: Fixed #line numbers.
20495 1999-03-15 Jesse Thilo <jthilo@gnu.org>
20497 * po/es.po, po/fr.po, po/nl.po, po/de.po:
20498 Added PO files from Translation Project.
20500 1999-03-03 Jesse Thilo <jthilo@gnu.org>
20503 Added support for non-ANSI compilers (ansi2knr).
20505 1999-02-16 Jesse Thilo <jthilo@gnu.org>
20507 * configure.in: Bumped version number to 1.27.
20510 Added `bison.simple' to list of files removed by `make distclean'.
20512 1999-02-12 Jesse Thilo <jthilo@gnu.org>
20514 * src/files.c, src/files.h:
20515 Defined locations of parser files in config.h instead of Makefile.
20517 1999-02-12 Jesse Thilo <jthilo@gnu.org>
20519 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
20520 Defined locations of parser files in config.h instead of Makefile.
20522 1999-02-09 Jesse Thilo <jthilo@gnu.org>
20525 Removed inappropriate use of $< macro.
20527 1999-02-05 Jesse Thilo <jthilo@gnu.org>
20529 * po/Makefile.in.in, po/POTFILES.in:
20530 Add `po' directory skeleton.
20532 1999-01-27 Jesse Thilo <jthilo@gnu.org>
20534 * README: Document help-bison list.
20536 * configure.in: Add check for mkstemp().
20538 1999-01-20 Jesse Thilo <jthilo@gnu.org>
20540 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
20541 Hush a few compiler warnings.
20544 Add tryclose(), which verifies that fclose was successful.
20545 Hush a couple of compiler warnings.
20547 1999-01-20 Jesse Thilo <jthilo@gnu.org>
20549 * Makefile.am, OChangeLog:
20550 ChangeLog is now automatically generated. Include the old version as
20553 1999-01-14 Jesse Thilo <jthilo@gnu.org>
20555 * 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:
20556 Update FSF address.
20558 1999-01-14 Jesse Thilo <jthilo@gnu.org>
20560 * doc/bison.texinfo: Fix formatting glitch.
20562 * doc/bison.texinfo: Update FSF address.
20564 1999-01-14 Jesse Thilo <jthilo@gnu.org>
20566 * acconfig.h: Update FSF address.
20568 1999-01-08 Jesse Thilo <jthilo@gnu.org>
20571 Don't define PACKAGE here, since config.h defines it.
20573 1998-12-30 Jesse Thilo <jthilo@gnu.org>
20575 * src/reader.c: Update copyright date.
20578 Ditch sprintf to statically-sized buffers in fatal/warn functions in
20579 favor of output directly to stderr (avoids buffer overruns).
20581 * src/reader.c: Some checks for premature EOF.
20583 * 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:
20584 Use prototypes if the compiler understands them.
20586 * src/files.c: Honor TMPDIR on Unix hosts.
20587 Use prototypes if the compiler understands them.
20590 Fix a couple of buffer overrun bugs.
20591 Use prototypes if the compiler understands them.
20593 * src/system.h: Include unistd.h and ctype.h.
20594 Use #ifdef instead of #if for NLS symbols.
20596 1998-12-30 Jesse Thilo <jthilo@gnu.org>
20598 * doc/bison.texinfo:
20599 Delete comment "consider using @set for edition number, etc..." since
20600 we now are doing so.
20602 1998-12-30 Jesse Thilo <jthilo@gnu.org>
20605 Use prototypes if the compiler understands them.
20607 * NEWS: Document 1.26 highlights.
20609 * Makefile.am: Require Automake 1.3 or later.
20612 Use prototypes if the compiler understands them.
20614 1998-12-29 Jesse Thilo <jthilo@gnu.org>
20617 Use VERSION symbol from automake for version number.
20619 1998-12-29 Jesse Thilo <jthilo@gnu.org>
20621 * acconfig.h, configure.in, version.cin:
20622 Use VERSION symbol from automake for version number.
20624 1998-11-28 Jesse Thilo <jthilo@gnu.org>
20627 Distribute original version of simple parser (bison.s1), not built
20628 version (bison.simple).
20630 1998-11-28 Jesse Thilo <jthilo@gnu.org>
20632 * doc/bison.texinfo: Add info dir entry.
20634 * doc/bison.texinfo:
20635 Let automake put version number into documentation.
20637 1998-11-26 Jesse Thilo <jthilo@gnu.org>
20639 * src/bison.cld, src/build.com, src/vmshlp.mar:
20640 Add non-RCS files from /gd/gnu/bison.
20642 1998-11-26 Jesse Thilo <jthilo@gnu.org>
20645 Document the BISON_HAIRY and BISON_SIMPLE variables.
20647 1998-11-25 Jesse Thilo <jthilo@gnu.org>
20649 * src/version.c: Build version.c automatically.
20652 Fix token numbering (used to start at 258, not 257).
20654 * src/system.h: Include config.h.
20656 * src/getargs.c: Update bug report address.
20658 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
20659 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
20661 1998-11-25 Jesse Thilo <jthilo@gnu.org>
20664 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
20666 * configure.in, version.cin:
20667 Build version.c automatically.
20669 * AUTHORS: Add AUTHORS file.
20671 * README: Update bug report address.
20674 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
20676 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
20677 Add automake stuff.
20679 1998-11-25 Jesse Thilo <jthilo@gnu.org>
20681 * doc/bison.texinfo: Clean up some formatting.
20683 1998-05-05 Richard Stallman <rms@gnu.org>
20685 * doc/bison.texinfo:
20686 Explain better why to make a pure parser.
20688 1998-01-05 Richard Stallman <rms@gnu.org>
20690 * src/files.c (openfiles):
20691 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
20692 find a temporary directory, if possible. Do not unlink files while
20695 1997-08-25 Richard Stallman <rms@gnu.org>
20697 * src/reader.c (stack_offset;):
20698 Change some warni to warns.
20700 * src/lex.c (literalchar): Use warns, not warni.
20702 1997-06-28 Richard Stallman <rms@gnu.org>
20704 * src/bison.s1: Add a Bison version comment.
20706 * src/main.c (fatal, warn, berror):
20709 1997-06-28 Richard Stallman <rms@gnu.org>
20711 * Makefile.in (bison_version): New variable.
20712 (dist): Use that variable.
20713 (bison.s1): Substitute the Bison version into bison.simple.
20715 * bison.simple: Add a Bison version comment.
20717 1997-06-18 Richard Stallman <rms@gnu.org>
20719 * src/main.c (fatal, warn, berror):
20720 Make error messages standard.
20721 (toomany): Improve error message text.
20723 * 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:
20724 new.h renamed to alloc.h.
20726 1997-06-18 Richard Stallman <rms@gnu.org>
20728 * Makefile.in: new.h renamed to alloc.h.
20730 1997-05-24 Richard Stallman <rms@gnu.org>
20732 * src/lex.c (literalchar):
20733 Fix the code for escaping \, " and '.
20735 (lex): Avoid trouble when there are many chars
20736 to discard in a char literal with just several chars in it.
20738 1997-05-17 Richard Stallman <rms@gnu.org>
20741 Use malloc, if using alloca is troublesome.
20742 (YYSTACK_USE_ALLOCA): New flag macro.
20743 Define it for some systems and compilers.
20744 (YYSTACK_ALLOC): New macro.
20745 (yyparse): Use YYSTACK_ALLOC to allocate stack.
20746 If it was malloc'd, free it.
20748 1997-05-17 Richard Stallman <rms@gnu.org>
20751 Use malloc, if using alloca is troublesome.
20752 (YYSTACK_USE_ALLOCA): New flag macro.
20753 Define it for some systems and compilers.
20754 (YYSTACK_ALLOC): New macro.
20755 (yyparse): Use YYSTACK_ALLOC to allocate stack.
20756 If it was malloc'd, free it.
20758 1997-04-23 Richard Stallman <rms@gnu.org>
20761 (alloca) [__hpux]: Always define as __builtin_alloca.
20763 1997-04-23 Richard Stallman <rms@gnu.org>
20766 (alloca) [__hpux]: Always define as __builtin_alloca.
20768 1997-04-22 Richard Stallman <rms@gnu.org>
20771 [__hpux]: Include alloca.h (right for HPUX 10)
20772 instead of declaring alloca (right for HPUX 9).
20774 * src/bison.s1 (__yy_memcpy):
20775 Declare arg `count' as unsigned int.
20776 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
20778 1997-04-22 Richard Stallman <rms@gnu.org>
20781 [__hpux]: Include alloca.h (right for HPUX 10)
20782 instead of declaring alloca (right for HPUX 9).
20784 * bison.simple (__yy_memcpy):
20785 Declare arg `count' as unsigned int.
20786 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
20788 1997-01-03 Richard Stallman <rms@gnu.org>
20790 * src/allocate.c: [__STDC__ or _MSC_VER]:
20791 Declare calloc and realloc to return void *.
20793 1997-01-02 Richard Stallman <rms@gnu.org>
20796 [_MSC_VER]: Include stdlib.h and process.h.
20797 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
20799 * src/main.c (main): Return FAILURE as a value.
20800 (printable_version): Declare arg as int, not char.
20802 1997-01-02 Richard Stallman <rms@gnu.org>
20804 * Makefile.in (dist):
20805 Explicitly check for symlinks, and copy them.
20807 1996-12-19 Richard Stallman <rms@gnu.org>
20810 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
20812 1996-12-18 Paul Eggert <eggert@gnu.org>
20814 * src/bison.s1 (yyparse):
20815 If __GNUC__ and YYPARSE_PARAM are both defined,
20816 declare yyparse to have a void * argument.
20818 1996-12-18 Paul Eggert <eggert@gnu.org>
20820 * bison.simple (yyparse):
20821 If __GNUC__ and YYPARSE_PARAM are both defined,
20822 declare yyparse to have a void * argument.
20824 1996-12-17 Richard Stallman <rms@gnu.org>
20826 * src/reduce.c (nbits): Add some casts.
20828 1996-08-12 Richard Stallman <rms@gnu.org>
20830 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
20832 1996-08-12 Richard Stallman <rms@gnu.org>
20834 * bison.simple: Test _MSDOS as well as _MSDOS_.
20836 1996-07-31 Richard Stallman <rms@gnu.org>
20839 [__sun && __i386]: Include alloca.h.
20841 1996-07-31 Richard Stallman <rms@gnu.org>
20844 [__sun && __i386]: Include alloca.h.
20846 1996-07-30 Richard Stallman <rms@gnu.org>
20848 * src/bison.s1: Comment change.
20850 * src/bison.s1: Test _MSDOS_, not MSDOS.
20852 1996-07-30 Richard Stallman <rms@gnu.org>
20854 * bison.simple: Comment change.
20856 * bison.simple: Test _MSDOS_, not MSDOS.
20858 1996-06-01 Richard Stallman <rms@gnu.org>
20860 * 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:
20861 Insert `_' macro around many string constants.
20864 Insert `_' macro around many string constants.
20866 (main): Call setlocale, bindtextdomain and textdomain.
20868 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
20869 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
20870 [ENABLE_NLS]: Include libintl.h.
20871 [ENABLE_NLS] (gettext): Define.
20872 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
20873 (N_, PACKAGE, LOCALEDIR): New macros.
20875 1996-06-01 Richard Stallman <rms@gnu.org>
20877 * POTFILES.in: New file.
20879 * Makefile.in (allocate.o):
20880 Define target explicitly.
20882 * Makefile.in (CFLAGS): Set to @CFLAGS@.
20883 (LDFLAGS): Set to @LDFLAGS@.
20884 (configure): Run autoconf only if preceding `cd' succeeds.
20885 (bison.s1): Redirect output to temporary file then move the
20886 temporary to the target, rather than redirecting directly to bison.s1.
20887 (clean): Remove config.status and config.log.
20888 (distclean): Don't remove config.status here.
20890 1996-05-12 Richard Stallman <rms@gnu.org>
20893 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
20895 1996-05-12 Richard Stallman <rms@gnu.org>
20898 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
20900 1996-05-11 Richard Stallman <rms@gnu.org>
20902 * src/bison.s1 (__yy_memcpy):
20903 Really reorder the args, as was supposedly done on Feb 14 1995.
20904 (yyparse): Calls changed accordingly.
20906 1996-05-11 Richard Stallman <rms@gnu.org>
20908 * Makefile.in (dist): Don't use $(srcdir).
20910 * bison.simple (__yy_memcpy):
20911 Really reorder the args, as was supposedly done on Feb 14 1995.
20912 (yyparse): Calls changed accordingly.
20914 1996-01-27 Richard Stallman <rms@gnu.org>
20916 * src/output.c (output_rule_data):
20917 Test YYERROR_VERBOSE in the conditional
20918 around the definition of ttyname.
20920 1995-12-29 Richard Stallman <rms@gnu.org>
20923 Fix line numbers in #line commands.
20925 1995-12-29 Richard Stallman <rms@gnu.org>
20928 Fix line numbers in #line commands.
20930 1995-12-27 Richard Stallman <rms@gnu.org>
20932 * src/bison.s1 (YYPARSE_PARAM_DECL):
20933 In C++, make it always null.
20934 (YYPARSE_PARAM_ARG): New macro.
20935 (yyparse): Use YYPARSE_PARAM_ARG.
20937 1995-12-27 Richard Stallman <rms@gnu.org>
20939 * bison.simple (YYPARSE_PARAM_DECL):
20940 In C++, make it always null.
20941 (YYPARSE_PARAM_ARG): New macro.
20942 (yyparse): Use YYPARSE_PARAM_ARG.
20944 1995-11-29 Richard Stallman <rms@gnu.org>
20946 * doc/bison.texinfo:
20947 Describe literal string tokens, %raw, %no_lines, %token_table.
20949 1995-11-29 Daniel Hagerty <hag@gnu.org>
20951 * doc/bison.texinfo: Fixed update date
20953 1995-10-16 Richard Stallman <rms@gnu.org>
20955 * src/version.c: Version 1.25.
20957 1995-10-16 Richard Stallman <rms@gnu.org>
20959 * NEWS: *** empty log message ***
20961 1995-10-16 Richard Stallman <rms@gnu.org>
20963 * doc/bison.1, doc/bison.rnh:
20966 1995-10-15 Richard Stallman <rms@gnu.org>
20968 * src/vmsgetargs.c, src/getargs.c:
20969 Added -n, -k, and -raw switches.
20970 (noparserflag, toknumflag, rawtoknumflag): New variables.
20972 * src/symtab.h (SALIAS):
20973 New #define for adding aliases to %token.
20974 (struct bucket): Added `alias' field.
20976 * src/reduce.c (reduce_grammar):
20977 Revise error message.
20978 (print_notices): Remove final `.' from error message.
20980 * src/reader.c (reader_output_yylsp):
20982 (readgram): Use `#if 0' around code that accepted %command
20983 inside grammar rules: The documentation doesn't allow it,
20984 and it will fail since the %command processors scan for the next %.
20985 (parse_token_decl): Extended the %token
20986 declaration to allow a multi-character symbol as an alias.
20987 (parse_thong_decl): New function.
20988 (read_declarations): Added %thong declarations.
20989 (read_declarations): Handle NOOP to deal with allowing
20990 % declarations as another means to specify the flags.
20991 (readgram): Allow %prec prior to semantics embedded in a rule.
20992 (skip_to_char, read_declarations, copy_definition)
20993 (parse_token_decl, parse_start_decl, parse_type_decl)
20994 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
20995 (get_type_name, copy_guard, copy_action, readgram)
20996 (get_type, packsymbols): Revised most error messages.
20997 Changed `fatal' to `warnxxx' to avoid aborting for error.
20998 Revised and use multiple warnxxx functions to avoid using VARARGS1.
20999 (read_declarations): Improve the error message for
21000 an invalid character. Do not abort.
21001 (read_declarations, copy_guard, copy_action): Use
21002 printable_version to avoid unprintable characters in printed output.
21003 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
21004 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
21005 Allow the type of a non-terminal can be given
21006 more than once, as long as all specifications give the same type.
21009 (output_headers, output_trailers, output, output_gram)
21010 (output_rule_data): Implement noparserflag variable.
21011 Implement toknumflag variable.
21012 (output): Call reader_output_yylsp to output LTYPESTR.
21014 * src/main.c (main):
21015 If reader sees an error, don't process the grammar.
21016 (fatals): Updated to not use VARARGS1.
21017 (printable_version, int_to_string, warn, warni, warns, warnss)
21018 (warnsss): New error reporting functions. Avoid abort for error.
21021 Added THONG and NOOP for alias processing.
21022 Added SETOPT for the new code that allows setting options with %flags.
21025 Include getopt.h. Add some extern decls.
21026 (safegetc): New function to deal with EOF gracefully.
21027 (literalchar); new function to deal with reading \ escapes.
21028 (lex): Use literalchar.
21029 (lex): Implemented "..." tokens.
21030 (literalchar, lex, parse_percent_token): Made tokenbuffer
21031 always contain the token. This includes growing the token
21032 buffer while reading an integer.
21033 (parse_percent_token): Replaced if-else statement with percent_table.
21034 (parse_percent_token): Added % declarations as another
21035 way to specify the flags -n, -l, and -r. Also added hooks for
21036 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
21037 major changes to files.c.
21038 (lex) Retain in the incoming stream a character following
21040 (skip_white_space, lex): Revised most error messages
21041 and changed fatal to warn to avoid aborting.
21042 (percent_table): Added %thong declarations.
21044 * src/gram.h: Comment changes.
21046 * src/files.c (openfiles, open_extra_files, done):
21048 and actfile file. Handle noparserflag. Both for -n switch.
21050 * src/conflicts.c (resolve_sr_conflict):
21051 Remove use of alloca.
21053 1995-06-01 Jim Meyering <meyering@gnu.org>
21055 * doc/bison.texinfo: *** empty log message ***
21057 1995-05-06 Richard Stallman <rms@gnu.org>
21059 * src/bison.s1: Comment change.
21061 1995-05-06 Richard Stallman <rms@gnu.org>
21063 * bison.simple: Comment change.
21065 1995-05-03 Richard Stallman <rms@gnu.org>
21067 * src/version.c: Version now 1.24.
21069 * src/bison.s1: Change distribution terms.
21071 * src/version.c: Version now 1.23.
21073 1995-05-03 Richard Stallman <rms@gnu.org>
21075 * doc/bison.texinfo:
21076 Rewrite "Conditions for Using Bison".
21077 Update version to 1.24.
21079 1995-05-03 Richard Stallman <rms@gnu.org>
21081 * bison.simple: Change distribution terms.
21083 1995-02-23 Richard Stallman <rms@gnu.org>
21085 * src/files.c: Test __VMS_POSIX as well as VMS.
21087 1995-02-14 Jim Meyering <meyering@gnu.org>
21089 * src/bison.s1 (__yy_memcpy):
21090 Renamed from __yy_bcopy to avoid
21091 confusion. Reverse FROM and TO arguments to be consistent with
21094 1995-02-14 Jim Meyering <meyering@gnu.org>
21096 * bison.simple (__yy_memcpy):
21097 Renamed from __yy_bcopy to avoid
21098 confusion. Reverse FROM and TO arguments to be consistent with
21101 1994-11-10 David J. MacKenzie <djm@gnu.org>
21107 * Makefile.in (DISTFILES): Include NEWS.
21109 * Makefile.in (DISTFILES):
21110 Include install-sh, not install.sh.
21112 * configure.in: Update to Autoconf v2 macro names.
21114 1994-10-05 David J. MacKenzie <djm@gnu.org>
21116 * Makefile.in: fix typo
21118 * Makefile.in (prefix, exec_prefix):
21119 Let configure set them.
21121 1994-09-28 David J. MacKenzie <djm@gnu.org>
21123 * Makefile.in: Set datadir to $(prefix)/share.
21125 1994-09-15 Richard Stallman <rms@gnu.org>
21128 Update copyright notice and GPL version.
21130 1994-09-15 Richard Stallman <rms@gnu.org>
21133 Update copyright notice and GPL version.
21135 1994-07-12 Richard Stallman <rms@gnu.org>
21137 * src/reduce.c, src/reader.c:
21140 1994-05-05 David J. MacKenzie <djm@gnu.org>
21142 * Makefile.in: entered into RCS
21144 1994-03-26 Richard Stallman <rms@gnu.org>
21146 * src/bison.s1: entered into RCS
21148 1994-03-26 Richard Stallman <rms@gnu.org>
21150 * bison.simple: entered into RCS
21152 1994-03-25 Richard Stallman <rms@gnu.org>
21154 * src/main.c: entered into RCS
21156 1994-03-24 Richard Stallman <rms@gnu.org>
21158 * src/conflicts.c: entered into RCS
21160 1994-01-02 Richard Stallman <rms@gnu.org>
21162 * Makefile.in: *** empty log message ***
21164 1993-11-21 Richard Stallman <rms@gnu.org>
21166 * src/bison.s1: *** empty log message ***
21168 1993-11-21 Richard Stallman <rms@gnu.org>
21170 * doc/bison.texinfo: entered into RCS
21172 * doc/bison.texinfo: *** empty log message ***
21174 1993-11-21 Richard Stallman <rms@gnu.org>
21176 * bison.simple: *** empty log message ***
21178 1993-10-25 David J. MacKenzie <djm@gnu.org>
21180 * doc/bison.texinfo: *** empty log message ***
21182 1993-10-19 Richard Stallman <rms@gnu.org>
21184 * src/bison.s1: *** empty log message ***
21186 1993-10-19 Richard Stallman <rms@gnu.org>
21188 * bison.simple: *** empty log message ***
21190 1993-10-14 Richard Stallman <rms@gnu.org>
21192 * src/bison.s1: *** empty log message ***
21194 1993-10-14 Richard Stallman <rms@gnu.org>
21196 * bison.simple: *** empty log message ***
21198 1993-09-14 David J. MacKenzie <djm@gnu.org>
21200 * doc/bison.texinfo: *** empty log message ***
21202 1993-09-13 Noah Friedman <friedman@gnu.org>
21204 * Makefile.in: *** empty log message ***
21206 1993-09-10 Richard Stallman <rms@gnu.org>
21208 * src/conflicts.c: *** empty log message ***
21210 * src/system.h: entered into RCS
21212 1993-09-10 Richard Stallman <rms@gnu.org>
21214 * doc/bison.1: entered into RCS
21216 1993-09-06 Noah Friedman <friedman@gnu.org>
21218 * src/version.c: entered into RCS
21220 1993-09-06 Noah Friedman <friedman@gnu.org>
21222 * Makefile.in: *** empty log message ***
21224 1993-07-30 David J. MacKenzie <djm@gnu.org>
21226 * Makefile.in: *** empty log message ***
21228 1993-07-24 Richard Stallman <rms@gnu.org>
21230 * src/bison.s1: *** empty log message ***
21232 1993-07-24 Richard Stallman <rms@gnu.org>
21234 * bison.simple: *** empty log message ***
21236 1993-07-08 David J. MacKenzie <djm@gnu.org>
21238 * Makefile.in: *** empty log message ***
21240 1993-07-04 Richard Stallman <rms@gnu.org>
21242 * src/bison.s1: *** empty log message ***
21244 1993-07-04 Richard Stallman <rms@gnu.org>
21246 * bison.simple: *** empty log message ***
21248 1993-06-26 David J. MacKenzie <djm@gnu.org>
21250 * src/getargs.c: entered into RCS
21252 1993-06-26 David J. MacKenzie <djm@gnu.org>
21254 * doc/bison.texinfo: *** empty log message ***
21256 * doc/bison.1: New file.
21258 1993-06-25 Richard Stallman <rms@gnu.org>
21260 * src/getargs.c: New file.
21262 1993-06-16 Richard Stallman <rms@gnu.org>
21264 * src/bison.s1: *** empty log message ***
21266 1993-06-16 Richard Stallman <rms@gnu.org>
21268 * bison.simple: *** empty log message ***
21270 1993-06-03 Richard Stallman <rms@gnu.org>
21272 * src/bison.s1: New file.
21274 1993-06-03 Richard Stallman <rms@gnu.org>
21276 * doc/bison.texinfo: *** empty log message ***
21278 1993-06-03 Richard Stallman <rms@gnu.org>
21280 * bison.simple: New file.
21282 1993-05-19 Richard Stallman <rms@gnu.org>
21284 * doc/bison.texinfo: New file.
21286 1993-05-07 Noah Friedman <friedman@gnu.org>
21288 * Makefile.in: *** empty log message ***
21290 1993-04-28 Noah Friedman <friedman@gnu.org>
21292 * src/reader.c: *** empty log message ***
21294 1993-04-23 Noah Friedman <friedman@gnu.org>
21296 * src/alloc.h: entered into RCS
21298 1993-04-20 David J. MacKenzie <djm@gnu.org>
21300 * src/version.c: *** empty log message ***
21302 * src/files.c, src/allocate.c:
21305 * src/reader.c: *** empty log message ***
21307 * src/lex.c: entered into RCS
21309 * src/conflicts.c: New file.
21311 * src/symtab.c: entered into RCS
21313 * src/alloc.h: New file.
21315 * src/LR0.c: entered into RCS
21317 1993-04-18 Noah Friedman <friedman@gnu.org>
21319 * src/reader.c: New file.
21321 * src/version.c: *** empty log message ***
21323 1993-04-18 Noah Friedman <friedman@gnu.org>
21325 * Makefile.in: *** empty log message ***
21327 1993-04-17 Noah Friedman <friedman@gnu.org>
21329 * Makefile.in: *** empty log message ***
21331 1993-04-15 Richard Stallman <rms@gnu.org>
21333 * src/main.c, src/files.c:
21336 1993-04-15 Noah Friedman <friedman@gnu.org>
21338 * configure.in: entered into RCS
21340 * configure.in: *** empty log message ***
21342 * configure.in: New file.
21344 1993-04-14 Richard Stallman <rms@gnu.org>
21346 * Makefile.in: New file.
21348 1993-04-13 Richard Stallman <rms@gnu.org>
21350 * src/version.c: New file.
21352 1993-03-25 Richard Stallman <rms@gnu.org>
21354 * src/output.c: entered into RCS
21356 1992-09-25 Richard Stallman <rms@gnu.org>
21358 * configure.bat: entered into RCS
21360 1992-06-22 Richard Stallman <rms@gnu.org>
21362 * src/vmsgetargs.c: entered into RCS
21364 1992-06-22 Richard Stallman <rms@gnu.org>
21366 * doc/bison.rnh: entered into RCS
21368 1992-04-20 David J. MacKenzie <djm@gnu.org>
21370 * README: entered into RCS
21372 1992-01-22 Richard Stallman <rms@gnu.org>
21374 * src/machine.h: entered into RCS
21376 1991-12-21 Richard Stallman <rms@gnu.org>
21378 * src/lalr.c, src/closure.c:
21381 1991-12-20 Richard Stallman <rms@gnu.org>
21383 * src/state.h: entered into RCS
21385 1991-12-18 Richard Stallman <rms@gnu.org>
21387 * src/print.c, src/nullable.c, src/derives.c:
21390 1991-11-03 David J. MacKenzie <djm@gnu.org>
21392 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
21395 1988-09-09 Richard Stallman <rms@gnu.org>
21397 * src/bison.hairy: entered into RCS
21399 1987-12-16 Richard Stallman <rms@gnu.org>
21401 * REFERENCES: entered into RCS
21406 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
21407 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
21408 2007, 2008, 2009 Free Software Foundation, Inc.
21410 Copying and distribution of this file, with or without
21411 modification, are permitted provided the copyright notice and this
21412 notice are preserved.