1 2009-08-28 Joel E. Denny <jdenny@clemson.edu>
3 %define: accept unquoted values.
4 * NEWS (2.5): Group all %define changes together, and document
5 this one. Remove quotes in IELR and canonical LR entry.
6 * doc/bison.texinfo: Remove quotes in most examples throughout.
7 (Decl Summary): Update %define documentation.
8 (Table of Symbols): Likewise.
9 * src/ielr.c (LrType): Update documentation.
10 * src/parse-gram.y (content.opt): Add production for ID.
11 * tests/actions.at: Remove quotes in most tests.
12 * tests/calc.at: Likewise.
13 * tests/existing.at: Likewise.
14 * tests/input.at: Likewise.
15 * tests/local.at: Likewise.
16 * tests/push.at: Likewise.
17 * tests/reduce.at: Likewise.
18 * tests/torture.at: Likewise.
20 2009-08-28 Joel E. Denny <jdenny@clemson.edu>
22 %define lr.type: make values lowercase IDs.
23 That is, "LALR" => "lalr", "IELR" => "ielr", and
24 "canonical LR" => "canonical-lr".
25 * NEWS (2.5): Update documentation.
26 * doc/bison.texinfo (Decl Summary): Likewise.
27 * src/ielr.c (ielr): Use new values.
28 * src/ielr.h (ielr): Update documentation.
29 * src/reader.c (prepare_percent_define_front_end_variables): Use
30 and validate new values.
31 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
33 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
35 2009-08-27 Eric Blake <ebb9@byu.net>
37 scan-gram: avoid portability trap with ctype usage.
38 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
39 Avoid compiler warning.
41 2009-08-27 Joel E. Denny <jdenny@clemson.edu>
43 tests: use perl for printing special sequences to files.
44 And skip tests if perl is not available. This is better than
45 playing tricks with shell portability. Suggested by Akim
47 * tests/input.at (Bad character literals): Use it here for
48 omitting final newlines.
49 (Bad escapes in literals): Use it here for special characters.
51 2009-08-26 Joel E. Denny <jdenny@clemson.edu>
53 tests: show a use of %define lr.default-reductions "consistent"
54 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
55 prevents the omission of expected tokens for %error-verbose.
57 2009-08-26 Akim Demaille <demaille@gostai.com>
59 tests: portability fix.
60 * tests/input.at (Bad escapes in literals): Don't expect "echo
61 '\0'" to output \ then 0.
63 2009-08-26 Joel E. Denny <jdenny@clemson.edu>
65 Actually handle the yytable zero value correctly this time.
66 * data/bison.m4 (b4_integral_parser_tables_map): Don't mention
67 zero values in the YYTABLE comments.
68 * data/glr.c (yytable_value_is_error): Don't check for zero
70 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
71 * data/yacc.c (yytable_value_is_error): Likewise.
72 * data/lalr1.java (yy_table_value_is_error_): Likewise.
73 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
74 * src/tables.h: In header comments, explain why it's useless to
75 check for a zero value in yytable.
77 2009-08-25 Joel E. Denny <jdenny@clemson.edu>
79 More fixes related to last two patches.
80 * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE
81 comments: zero indicates syntax error not default action.
82 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
84 * data/glr.c (yyis_pact_ninf): Rename to...
85 (yypact_value_is_default): ... this.
86 (yyisDefaultedState): Update for rename.
87 (yyis_table_ninf): Rename to...
88 (yytable_value_is_error): ... this, and check for value zero
89 besides just YYTABLE_NINF.
90 (yygetLRActions): Check for default value from yypact. It
91 appears that this check is always performed before this function
92 is invoked, and so adding the check here is probably redundant.
93 However, the code may evolve after this subtlety is forgotten.
94 Also, update for rename to yytable_value_is_error. Because that
95 macro now checks for zero, a different but equivalent branch of
96 the if-then-else here is evaluated.
97 (yyreportSyntaxError): Update for rename to
98 yytable_value_is_error. The zero condition was mishandled
100 (yyrecoverSyntaxError): Update for renames. No behavioral
102 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
104 (yy_table_value_is_error_): New function.
105 (parse): Use new functions where possible. No behavioral
107 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
108 The zero condition was mishandled before.
109 * data/yacc.c (yyis_pact_ninf): Rename to...
110 (yypact_value_is_default): ... this.
111 (yyis_table_ninf): Rename to...
112 (yytable_value_is_error): ... this, and check for value zero
113 besides just YYTABLE_NINF.
114 (yysyntax_error): Update for rename to yytable_value_is_error.
115 The zero condition was mishandled before.
116 (yyparse): Update for renames. No behavioral changes.
117 * src/tables.h: Improve comments about yypact, yytable, etc.
118 more. Most importantly, say yytable value of zero means syntax
119 error not default action.
121 2009-08-25 Joel E. Denny <jdenny@clemson.edu>
123 Fix %error-verbose for conflicts resolved by %nonassoc.
124 * NEWS (2.5): Document.
125 * data/glr.c (yyreportSyntaxError): Fix this by checking
127 * data/yacc.c (yysyntax_error): Likewise.
128 * data/lalr1.cc (yysyntax_error_): Fix this by checking
130 * data/lalr1.java (yysyntax_error): Likewise.
131 * tests/conflicts.at (%nonassoc and eof): Update expected output
134 2009-08-25 Joel E. Denny <jdenny@clemson.edu>
136 Some code and documentation improvements.
137 * data/c.m4 (b4_table_value_equals): New macro to capture
139 * data/glr.c (yyis_pact_ninf): Use it here.
140 (yyis_table_ninf): Likewise.
141 (yyreportSyntaxError): Improve internal comments.
142 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
143 Use it everywhere possible.
144 (yyis_table_ninf): Likewise.
145 (yysyntax_error): Improve internal comments.
146 * data/lalr1.cc (yysyntax_error_): Likewise.
147 * data/lalr1.java (yysyntax_error): Likewise.
148 * src/tables.h: Improve comments about yypact, yytable, etc.
150 2009-08-21 Joel E. Denny <jdenny@clemson.edu>
152 Use locale when quoting.
153 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
154 quote rather than implementing quoting here.
156 2009-08-20 Eric Blake <ebb9@byu.net>
158 Make previous patch more robust.
159 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
161 (output_skeleton): Use it.
162 Suggested by Akim Demaille.
164 Import latest m4/m4.m4.
165 * submodules/autoconf: Update to autoconf 2.64.
166 * configure.ac (M4_GNU_OPTION): New define.
167 * src/output.c (output_skeleton): Use it to resolve FIXME.
168 * NEWS: Mention this.
170 2009-08-19 Joel E. Denny <jdenny@clemson.edu>
172 Fix complaints about escape sequences.
173 Discussed starting at
174 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
175 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
176 For a \0 and similar escape sequences meaning the null
177 character, report an invalid escape sequence instead of an
178 invalid null character because the latter does not actually
179 appear in the user's input.
180 In all escape sequence complaints, don't escape the initial
181 backslash, and don't quote when the sequence appears at the end
182 of the complaint line unless there's whitespace that quotearg
184 Consistently say "invalid" not "unrecognized".
185 Consistently prefer "empty character literal" over "extra
186 characters in character literal" warning for invalid escape
187 sequences; that is, consistently discard those sequences.
188 * tests/input.at (Bad escapes in literals): New.
190 2009-08-19 Akim Demaille <demaille@gostai.com>
193 * doc/bison.texinfo: Fix minor Texinfo errors.
195 2009-08-19 Akim Demaille <demaille@gostai.com>
197 tests: distcc compliance.
198 * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's
199 error messages from the output.
201 2009-08-19 Akim Demaille <demaille@gostai.com>
203 variables: simplify the upgrade of namespace into api.namespace.
205 This patch simplifies "variables: rename namespace as
206 api.namespace", commit 67501061076ba46355cfd9f9361c7eed861b389c.
207 Suggested by Joel E. Denny in
208 http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html
210 * src/muscle-tab.c (muscle_percent_variable_update): New.
211 (muscle_percent_define_insert): Use it in replacement of the
212 previous tr invocation.
213 Remove variable_tr, no longer needed.
214 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
216 * data/c++.m4: No longer handle namespace -> api.namespace.
217 * tests/input.at (%define backward compatibility): Check that
218 namespace is treated as api.namespace.
220 2009-08-19 Akim Demaille <demaille@gostai.com>
222 doc: %initial-action to initialize yylloc.
223 Reported by Bill Allombert.
224 * doc/bison.texinfo: Set fill-column to 76.
225 (Location Type): Document the use of %initial-action to initialize
228 2009-08-19 Akim Demaille <demaille@gostai.com>
230 lalr1.cc: use state_type.
231 * data/lalr1.cc (yysyntax_error_): Use state_type.
232 Move argument names into yy*.
234 2009-08-19 Akim Demaille <demaille@gostai.com>
236 lalr1.cc: get rid of yyparse's yystate.
237 yystate and yystack_[0].state are equal, keep only the latter.
238 The former was also used as a temporary variable to compute the
239 post-reduction state. Move this computation into an auxiliary
242 * data/glr.c (yyLRgotoState): Fuse variable definition and first
244 * data/lalr1.cc (yy_lr_goto_state_): New.
246 Replace remaining uses of yystate by yystate_[0].state.
249 2009-08-19 Akim Demaille <demaille@gostai.com>
251 lalr1.cc: destroy $$ when YYERROR is called.
252 * data/lalr1.cc (yyreduce): Compute the resulting state before
253 running the user action so that yylhs is a valid symbol.
254 (yyerrorlab): Since yylhs is complete (it knows its type), we can
255 simply call yy_destroy_ to destroy $$ on YYERROR invocations.
256 * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants.
258 2009-08-18 Joel E. Denny <jdenny@clemson.edu>
260 maint: update for gnulib's recent update-copyright changes
262 * .x-update-copyright (COPYING): Add as it's no longer implied
263 when .x-update-copyright is present.
264 * cfg.mk (update-copyright-local): Remove, now ignored.
265 (update-copyright): Declare update-b4-copyright as a dependency.
267 2009-08-17 Akim Demaille <demaille@gostai.com>
269 build: require gettext 0.17.
271 Suggested by Bruno Haible.
272 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
273 * configure.ac: require gettext 0.17 to ensure compatibility with
276 2009-08-17 Akim Demaille <demaille@gostai.com>
278 build: lower gettext requirements.
280 Bison was uselessly requiring the formatstring macros from
281 gettext, which resulted in mo files not being installed on systems
282 that perfectly supported Bison mo files. Lower the requirement.
283 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
285 * configure.ac: Require need-ngettext instead of
286 need-formatstring-macros.
287 Reported by Martin Jabocs.
288 Suggested by Bruno Haible.
289 * INSTALL: Restructure.
290 (Internationalization): New.
292 2009-08-14 Joel E. Denny <jdenny@clemson.edu>
294 maint: fix use of copyright year intervals.
296 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
297 as now recommended in gnulib/NEWS.
298 * build-aux/update-b4-copyright: Fix.
299 * cfg.mk (update-copyright-env): Configure update-copyright.
301 2009-08-13 Joel E. Denny <jdenny@clemson.edu>
303 Make it easier to write deterministic tests.
304 Continues Akim's work from his 2009-06-10 commits.
305 * src/reader.c (check_and_convert_grammar): Don't add any
306 symbols after the first symbols_do invocation.
307 * src/symtab.c (symbols_sorted): New static global.
308 (user_token_number_redeclaration): Update comments.
309 (symbol_from_uniqstr): If a new symbol is being created, assert
310 that symbols_sorted hasn't been allocated yet.
311 (symbols_free): Free symbols_sorted.
312 (symbols_cmp, symbols_cmp_qsort): New functions.
313 (symbols_do): Sort symbol_table into symbols_sorted on first
315 * tests/input.at (Numbered tokens): Recombine tests now that the
316 output should be deterministic across multiple numbers.
318 2009-08-12 Akim Demaille <demaille@gostai.com>
320 tests: GCC 4.5 compliance.
321 * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's
322 messages about #error.
324 2009-08-12 Akim Demaille <demaille@gostai.com>
326 build: fix the generation of the documentation.
327 Some of our targets use "bison --help", but they can't depend on
328 "bison" itself (to avoid additional requirements on the user), so
329 they used to call "make src/bison" in the commands. Then
330 concurrent builds may fail: one make might be aiming one of its
331 jobs at compiling src/bison, and another job at generating the man
332 page. If the latter is faster than the former, then we have two
333 makes that concurrently try to compile src/bison.
335 This might also be a more convincing explanation for the failure
336 described in the patch "build: fix paths".
338 * Makefile.am (SUFFIXES): Initialize.
339 * build-aux/move-if-change: New, symlink to gnulib's.
340 * build-aux/local.mk: Ship it.
341 * doc/common.x: Remove, merged into...
343 * doc/local.mk (doc/bison.help): New.
344 ($(CROSS_OPTIONS_TEXI)): Depend on it.
346 (.x.1): Replace with...
347 (doc/bison.1): this explicit, simpler, target.
348 (common_dep): Remove, inlined where appropriate.
349 (SUFFIXES, PREPATH): Remove, unused.
351 2009-08-12 Akim Demaille <demaille@gostai.com>
353 gnulib: improve prefixing.
354 * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather,
355 change the value of...
357 Adjust more variables.
358 * etc/prefix-gnulib-mk (prefix_assignment): Don't rename
360 (prefix): Also transform rules whose targets have slashes.
361 Use $prefix liberally.
362 Map @MKDIR_P@ to $(MKDIR_P).
363 Prefix directories that are mkdir'd.
365 2009-08-12 Akim Demaille <demaille@gostai.com>
368 When using $(top_builddir) inconsistently, Make (including GNU
369 Make) is sometimes confused. As a result it may want to build
370 lib/libbison.la and $(top_builddir)/lib/libbison.la (the same
371 file, different names) concurrently, which, amusingly enough,
374 ranlib lib/libbison.a
375 ranlib lib/libbison.a
376 make[2]: *** [lib/libbison.a] Segmentation fault
380 * doc/local.mk, src/local.mk: Do not use $(top_builddir) when not
383 2009-08-12 Akim Demaille <demaille@gostai.com>
387 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
389 2009-08-10 Joel E. Denny <jdenny@clemson.edu>
391 * tests/local.mk (TESTSUITE_AT): Add named-refs.at.
393 2009-08-10 Joel E. Denny <jdenny@clemson.edu>
395 Miscellaneous code readability improvements.
397 * src/reader.c (reader): Move %define front-end variable
398 defaults and checking into...
399 (prepare_percent_define_front_end_variables): ... this new
402 * src/scan-gram.l (INITIAL): For consistency with string
403 literals, don't store open quote on character literal. It's
404 discarded before returning anyway.
405 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
406 Make length test more readable, and make the character stored
407 for an empty literal more obvious while consistent with the
410 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
411 USER_NUMBER_HAS_STRING_ALIAS throughout.
412 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
413 that is repeated in symtab.h. Improve argument names to make it
414 clear which side of the symbol-string alias pair is which.
415 (symbol_check_alias_consistency): Improve local variable names
416 for the same purpose.
417 * src/symtab.h (struct symbol): Make comments about aliases
419 (symbol_make_alias): Improve comments and argument name.
420 * src/output.c (token_definitions_output): Update for rename to
421 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
423 2009-08-08 Alex Rozenman <rozenman@gmail.com>
425 Convert "misleading reference" messages to warnings.
426 * src/scan-code.l: New function 'show_sub_messages', more
428 * tests/named-ref.at: Adjust tests.
430 2009-08-06 Joel E. Denny <jdenny@clemson.edu>
432 maint: run "make update-copyright"
434 2009-08-06 Joel E. Denny <jdenny@clemson.edu>
436 maint: make update-b4-copyright easier to use
437 * build-aux/update-b4-copyright: In warnings, report line
438 numbers rather than character positions.
439 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
440 that update-copyright runs it.
443 2009-08-05 Joel E. Denny <jdenny@clemson.edu>
445 maint: clean up update-b4-copyright code
446 * build-aux/update-b4-copyright: Do not accept 2-digit
447 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
448 Don't accept a `[' in a b4_copyright argument.
449 Format code more consistently.
450 Don't assume b4*copyright never occurs.
452 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
454 maint: automate b4_copyright updates.
455 * Makefile.am (update-b4-copyright): New target rule.
456 * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright.
457 * build-aux/update-b4-copyright: New.
458 * data/yacc.c: Remove stray characters around b4_copyright
461 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
463 maint: automate annual package-wide copyright-year update.
464 * .x-update-copyright: New.
465 * Makefile.am (EXTRA_DIST): Remove maint.mk.
466 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
467 update-copyright. Remove gnumakefile, which is implied by
469 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
471 * maint.mk: Remove, now copied from gnulib.
472 * examples/extexi: Add missing "(C)" in copyright statement so
473 update-copyright can recognize it.
474 * src/LR0.h: Likewise.
475 * src/print.h: Likewise.
476 * src/print_graph.h: Likewise.
477 * src/gram.c: Add missing comma in copyright statement.
478 * src/gram.h: Likewise.
480 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
482 Fix "make distcheck".
483 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
486 2009-08-01 Joel E. Denny <jdenny@clemson.edu>
488 Pacify "gcc -Wunused" for the input function from Flex.
489 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
491 * src/scan-code.l: Add "%option noinput", which I cannot find in
492 the Flex manual, but which Flex has supported since at least as
493 far back as 2.5.4. However, if any of our developers still use
494 Flex 2.5.4, they'll need to stop configuring with
495 --enable-gcc-warnings because "%option noinput" didn't work
496 correctly until Flex 2.5.6.
497 * src/scan-gram.l: Likewise.
498 * src/scan-skel.l: Likewise.
500 2009-07-31 Alex Rozenman <rozenman@gmail.com>
502 Fix --enable-gcc-warnings problems.
503 * src/reader.c: Adjust variable names.
504 * src/scan-code.l: Fix prototypes and adjust names.
505 * src/named-ref.c: Remove redundant "if".
507 2009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
509 Fix a --enable-gcc-warnings problem.
510 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
513 2009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
515 Warn about character literals not of length one.
516 * NEWS (2.5): Document.
517 * src/scan-gram.l (INITIAL): Remove comment that we don't check
519 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
520 * tests/input.at (Bad character literals): New test group.
522 2009-07-24 Alex Rozenman <rozenman@gmail.com>
524 Fix some memory leaks.
525 * src/named-ref.c: Add a pointer check (named_ref_free).
526 * src/scan-code.l: New function (variant_table_free). Called in
528 * src/symlist.c: Call to named_ref_free (symbol_list_free).
530 2009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
532 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
534 2009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
536 Some M4 cleanup in the testsuite.
537 Suggested by Eric Blake at
538 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
539 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
540 complicate the code by distinguishing between a missing value
541 and an empty string value for an optional argument. This fix is
542 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
543 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
544 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
545 arguments are not needed because of the following changes.
547 Bison developers should use GNU M4 and should not use
548 POSIXLY_CORRECT when building the test suite, so do not
549 complicate the code by avoiding $10 and above.
550 Do not quote an empty string value for an optional argument, and
551 do not distinguish between a missing value and an empty string
554 2009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
556 Revert unnecessary column realignment in --help output.
557 Reported by Akim Demaille at
558 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
559 * src/getargs.c (usage): Here.
561 2009-07-04 Alex Rozenman <rozenman@gmail.com>
563 Alphabetical order in src/local.mk.
564 * src/local.mk: Adjust.
566 2009-07-04 Alex Rozenman <rozenman@gmail.com>
568 Style changes and factoring.
569 * src/named-ref.h: Add comments.
570 * src/parse-gram.y: Readability and style changes.
571 * src/reader.c: Factoring: assign_named_ref function.
572 * src/scan-code.l: Factoring and style changes. Rename
573 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
574 Use "unsigned" type for variant index. Improve readablity.
575 * src/scan-gram.l: Change error messages and add comments.
576 * src/symlist.h: symbol_list_null: New function decl.
577 * src/symlist.c: symbol_list_null: Implement here.
578 * tests/named-refs.at: Adjust for new error messages.
580 2009-06-29 Eric Blake <ebb9@byu.net>
582 scan-code: avoid compiler warnings
583 * src/scan-code.l (parse_named_ref): Use correct specifiers.
585 2009-06-29 Akim Demaille <demaille@gostai.com>
587 build: avoid concurrent extraction of calc++.
588 * examples/calc++/Makefile.am (calc.stamp): New.
589 Depend on it to create the sources of calc++ so that concurrent
590 builds don't launch several "extexi" in parallel.
591 Not only this is inefficient, this also builds incorrect sources
592 with several extractions mixed together.
594 2009-06-29 Akim Demaille <demaille@gostai.com>
597 * data/bison.m4: Move code related to specific variables after the
598 definition of the variable-maintaining macros so that we don't
599 "invoke" b4_percent_define_check_values before it is defined.
601 2009-06-29 Akim Demaille <demaille@gostai.com>
603 variables: parse.error
605 Implement, document, and test the replacement of %error-verbose
606 by %define parse.error "verbose".
607 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
608 values of the parse.error variable.
609 Make "simple" its default value.
610 Check the valid values.
611 * src/parse-gram.y: Use %define parse.error.
612 (PERCENT_ERROR_VERBOSE): New token.
614 * src/scan-gram.l: Support %error-verbose.
616 * doc/bison.texinfo (Decl Summary): Replace the documentation of
617 %define error-verbose by that of %define parse.error.
620 * tests/actions.at, tests/calc.at: Use parse.error instead of
623 2009-06-27 Alex Rozenman <rozenman@gmail.com>
625 Implement support for named symbol references.
626 * src/parse-gram.y: Add new syntax (named_ref.opt).
627 * src/reader.c: Store named refs in symbol lists.
628 * src/reader.h: New argument for symbol_append and
629 action_append functions.
630 * src/scan-code.h: Add new field (named_ref) into
631 code_props data structure. Keeps named ref of midrule
633 * src/scan-code.l: Support for named refs in semantic
634 action code. New function 'parse_named_ref'.
635 * src/scan-gram.l: Support bracketed id.
636 * src/symlist.c: Store named refs in symbol lists.
637 * src/symlist.h: New field in symbol list: named_ref.
638 * src/named-ref.h: New file, a struct for named_ref.
639 * src/named-ref.cp: New file, named_ref_new function.
640 * src/local.mk: Add two new files.
641 * tests/testsuite.at: Include new test group:
642 * tests/named-refs.at: this new file.
644 2009-06-25 Akim Demaille <demaille@gostai.com>
646 hash: check insertion for memory exhaustion.
647 * src/uniqstr.c (uniqstr_new): New.
649 2009-06-24 Akim Demaille <demaille@gostai.com>
651 variables: rename namespace as api.namespace.
653 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
655 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
657 (b4_percent_define_use): New.
658 Use it where applicable.
659 * data/c++.m4: Replace uses of the variable "namespace" by
661 Default the latter to the former.
662 * doc/bison.texinfo (Decl Summary): Document "namespace" as
664 Document api.namespace.
665 Use @samp to document %define uses, keep @code for identifiers.
667 * tests/c++.at, tests/input.at: Test api.namespace instead of
668 namespace. (The tests passed with namespace.)
670 2009-06-11 Akim Demaille <demaille@gostai.com>
673 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
674 * src/print-xml.c: Style changes.
675 * tests/conflicts.at: Comment changes.
677 2009-06-11 Akim Demaille <demaille@gostai.com>
679 xml: beware of user strings used to give a %prec to rules.
680 * tests/conflicts.at (%prec with user strings): New.
681 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
684 2009-06-11 Akim Demaille <demaille@gostai.com>
686 hash: check insertion for memory exhaustion.
687 * src/muscle-tab.c (muscle_insert, muscle_grow)
688 * src/state.c (state_hash_insert): Check the return value of
691 2009-06-11 Akim Demaille <demaille@gostai.com>
693 tests: honor TESTSUITEFLAGS in every check target.
694 * tests/local.mk (RUN_TESTSUITE): New.
695 (check-local, installcheck-local, maintainer-check-g++)
696 (maintainer-check-posix, maintainer-check-valgrind): Use it.
698 2009-06-10 Akim Demaille <demaille@gostai.com>
700 deterministic test suite.
701 Some consistency checks on symbols are performed after all the
702 symbols were read, by an iteration over the symbol table. This
703 traversal is nondeterministic, which can be a problem for test
706 Addresses another form of nondeterminism reported by Joel E. Denny.
707 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
709 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
711 Use different file names for the three tests to make the
714 2009-06-10 Akim Demaille <demaille@gostai.com>
717 * gnulib: Update to latest.
718 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
719 * m4/.gitignore: Regen.
720 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
721 Call xalloc_die on hash_insert failures.
722 Requested by the new __warn_unused_result__ attribute of
725 2009-06-10 Akim Demaille <demaille@gostai.com>
727 deterministic user-token-number redeclaration errors.
728 Address nondeterminism reported by Joel E. Denny.
729 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
731 * src/uniqstr.h: Comment changes.
732 * src/location.h (boundary_cmp, location_cmp): New.
733 * src/symtab.c (user_token_number_redeclaration): New.
734 (symbol_translation): Use it.
735 * tests/input.at (Numbered tokens): Adjust the expected output.
737 2009-05-25 Akim Demaille <demaille@gostai.com>
739 build: avoid ignored errors.
740 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
741 errors, they pollute the output.
743 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
745 Convert multiple variable definition warnings to complaints.
746 * NEWS (2.5): Add a new entry for that change.
747 * doc/bison.texinfo (Decl Summary): Update %define entry.
748 (Bison Options): Update -D/--define/-F/--force-define entry.
749 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
750 * src/muscle-tab.h (muscle_percent_define_insert): Update
752 * tests/input.at (`%define errors'): Update.
753 (`%define, --define, --force-define'): Update.
755 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
757 -F/--force-define and relative %define/-D/--define priorities.
758 * NEWS (2.5): Add documentation to -D/--define entry.
759 * build-aux/cross-options.pl: Hard-code association of
760 --force-define with %define.
761 * doc/bison.texinfo (Decl Summary): In %define entry,
762 cross-reference command-line options.
763 (Bison Options): Add documentation to -D/--define entry.
764 (Option Cross Key): Widen column for --force-define row.
765 * src/getargs.c (usage): Document -F/--force-define. Realign
767 (short_options, long_options, getargs): Parse -F/--force-define,
768 and update muscle_percent_define_insert invocations.
769 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
770 (muscle_percent_define_insert): Add argument with that type.
771 * src/muscle-tab.c (muscle_percent_define_insert): Implement
772 -F/--force-define behavior and priorities.
773 (muscle_percent_define_ensure): Update
774 muscle_percent_define_insert invocation.
775 * src/parse-gram.y (prologue_declaration): Update
776 muscle_percent_define_insert invocations.
777 * tests/input.at (`%define, --define'): Rename to...
778 (`%define, --define, --force-define'): ... this and extend.
780 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
782 Update some comments to make sense for -D.
783 * data/bison.m4 (b4_check_user_names): In header comments, say
784 "user occurrence" instead of "grammar occurrence".
785 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
786 (muscle_percent_code_grow): Likewise just for consistency.
788 2009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
790 * data/c++.m4 (b4_namespace_close): Simplify slightly.
792 2009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
794 Handle a trailing `:' in a user-supplied C++ namespace better.
795 * data/c++.m4 (b4_namespace_close): Don't let it be printed
796 among the closing braces here. This fix might make the
797 generated code easier to debug, but otherwise it should be
798 insignificant because a trailing `:' is a C++ error already.
800 2009-05-19 Akim Demaille <demaille@gostai.com>
802 remove useless variable.
803 * src/getargs.c (skeleton_arg): Remove now useless variable.
804 Should help the compiler see that this printf-like call is sane.
806 2009-05-15 Akim Demaille <demaille@gostai.com>
808 Rename token.prefix as api.tokens.prefix.
810 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
812 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
813 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
814 (token.prefix): Rename as...
815 (api.tokens.prefix): this.
817 2009-05-11 Akim Demaille <demaille@gostai.com>
819 doc: use C++ headers.
820 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
823 2009-05-11 Akim Demaille <demaille@gostai.com>
826 * doc/bison.simple (Decl Summary): Document token.prefix.
827 (Calc++ Parser): Various fixes.
830 Introduce a macro TOKEN to shorten the code and make it more
832 (Calc++ Scanner): Adjust.
833 * NEWS (Variable token.prefix): New.
835 2009-05-04 Akim Demaille <demaille@gostai.com>
837 bison: catch bad symbol names.
838 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
839 * tests/input.at: Adjust.
841 2009-05-04 Akim Demaille <demaille@gostai.com>
843 identifiers: dashes are letters.
844 Dashes can now start identifiers (symbols and directives).
846 * src/scan-gram.l ({letter}): Add dash.
848 * tests/input.at (Symbols): Adjust.
849 Remove stray comment.
850 * tests/regression.at (Invalid inputs): Adjust error message.
851 * doc/bison.texinfo (Symbols): Update.
853 2009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
855 Declare %code to be a permanent feature.
856 * NEWS (2.4.2): Here.
857 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
859 (Decl Summary): Likewise.
861 2009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
863 Convert underscores to dashes in some %define variable names.
864 For now, just api.push-pull and lr.keep-unreachable-states.
865 Maintain old names for backward compatibility.
866 * NEWS (2.5): Document.
867 * data/c.m4 (b4_identification): Update comment.
868 * data/yacc.c: Update access.
869 * doc/bison.texinfo: Update.
870 * etc/bench.pl.in (bench_push_parser): Update use.
871 * src/files.c (tr): Move to...
872 * src/getargs.c, src/getargs.h (tr): ... here because I can't
873 think of a better place to expose it. My logic is that, for all
874 uses of tr so far, command-line arguments can be involved, and
875 getargs.h is already included.
876 * src/main.c (main): Update access.
877 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
878 variable names to new variable names before assigning value.
879 * src/reader.c (reader): Update setting default.
880 * tests/calc.at: Update uses.
881 * tests/conflicts.at (Unreachable States After Conflict
882 Resolution): Update use.
883 * tests/input.at (%define enum variables): Update use.
884 (%define backward compatibility): New test group.
885 * tests/push.at: Update uses.
886 * tests/reduce.at: Update uses.
887 * tests/torture.at: Update uses.
889 2009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
891 Set all front-end %define defaults in one place.
892 * src/main.c (main): Move lr.keep_unreachable_states default...
893 * src/reader.c (reader): ... to here.
895 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
897 Rename lr.default_reductions to lr.default-reductions.
899 * doc/bison.texinfo: Here.
900 * src/lalr.c (initialize_LA): Here.
901 * src/print.c (print_reductions): Here.
902 * src/reader.c (reader): Here.
903 * src/tables.c (action_row): Here.
904 * tests/input.at (%define enum variables): Here.
905 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
907 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
909 Pacify ./configure --enable-gcc-warnings.
910 * tests/input.at (Symbols): Prototype yyerror and yylex.
912 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
914 Document how `%define "var" "value"' is not M4-friendly.
915 * src/parse-gram.y (variable): In comments here.
917 2009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
919 Clean up recent patches a little.
920 Reported by Akim Demaille.
921 * doc/bison.texinfo (Understanding): Fix typos.
922 * src/print.c (print_reductions): Don't use negated variable.
924 2009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
926 List accepted values for a %define enum variable with an invalid value.
927 Suggested by Akim Demaille at
928 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
929 * data/bison.m4 (_b4_percent_define_check_values): Implement.
930 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
931 * tests/input.at (%define lr.default_reductions invalid values): Merge
933 (%define enum variables): ... here, and update output.
935 2009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
937 Rename "default rule" to "default reduction".
938 This includes changing variable names in code, changing
939 comments, and renaming %define lr.default_rules to %define
940 lr.default_reductions.
941 * NEWS (2.5): Update IELR documentation.
942 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
944 * data/glr.c, data/lalr1.java: Sync copyright dates.
945 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
946 and lr.type documentation. Make some other wording
948 (Glossary): Adjust cross-references and Default Reduction
950 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
951 Remove a confusing comment pointed out by Akim Demaille.
952 (initialize_LA): Adjust code.
953 * src/print-xml.c (print_reductions): Adjust code.
954 * src/print.c (print_reductions): Adjust code.
955 * src/reader.c (reader): Adjust code.
956 * src/tables.c (action_row): Adjust code.
957 (token_actions): Adjust code.
958 * src/tables.h: Adjust YYDEFACT documentation.
959 * tests/input.at (%define lr.default_rules invalid values):
960 Rename test group to...
961 (%define lr.default_reductions invalid values): ... this, and
962 update grammar file and expected output.
963 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
964 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
966 2009-04-21 Akim Demaille <demaille@gostai.com>
968 tests: check the use of dashes and periods in symbols.
969 * tests/input.at (Symbol): New test group.
971 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
973 Document %define lr.type and lr.default_rules.
974 * NEWS (2.5): Add an entry.
975 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
976 besides just LALR(1) and GLR(1).
977 * doc/bison.texinfo (Introduction): Likewise.
978 (Language and Grammar): Bison is no longer limited to LALR(1)
980 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
981 when trying to distinguish from GLR. Talk about LR(1) grammars
982 rather than LALR(1) grammars.
983 (Decl Summary): In %define api.push_pull entry, say it applies
984 to deterministic parsers in C rather than LALR(1) parsers in C.
985 Add lr.default_rules entry.
987 (Mystery Conflicts): Bison is no longer limited to LALR(1)
989 (Generalized LR Parsing): Same changes as for the previous GLR
991 (Memory Management): Say deterministic rather than LALR(1).
992 (Understanding): Correct some bison output.
993 Index discussion of "accepting state".
994 Say deterministic rather than LALR(1).
995 (Bison Options): In --yacc entry, say deterministic rather than
997 In --report, --graph, and --xml entries, just don't mention
999 (C++ Parsers): Say deterministic rather than LALR(1).
1000 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
1001 (Glossary): Add Accepting State, Consistent State, Default Rule,
1002 and IELR(1) definitions.
1003 In Generalized LR (GLR) definition, make same changes as in
1004 previous GLR sections.
1005 In LALR(1) definition, say Bison uses LALR(1) by default rather
1006 than implying Bison is limited to LALR(1).
1007 (LocalWords): Add IELR.
1009 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1011 Finish implementing %define lr.type.
1012 Its value can be "LALR", "IELR", or "canonical LR".
1013 * lib/timevar.def (TV_IELR_PHASE1): New var.
1014 (TV_IELR_PHASE2): New var.
1015 (TV_IELR_PHASE3): New var.
1016 (TV_IELR_PHASE4): New var.
1017 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
1018 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
1019 Sbitset.h, ielr.h, and ielr.c.
1020 * src/getargs.h, src/getargs.c (enum trace, trace_args,
1021 trace_types): Add trace_ielr.
1022 * src/lalr.h, src/lalr.c (ngotos): Export it.
1024 (goto_follows): ... this, update all uses, and export it.
1025 (set_goto_map): Export it.
1026 (map_goto): Export it.
1027 (compute_lookahead_tokens): Don't free goto_follows yet. Now
1029 (initialize_LA): Export it. Move lookback allocation to...
1030 (lalr): ... here because, for canonical LR, initialize_LA must
1031 be invoked but lookback and much of the rest of LALR isn't
1033 * main.c (main): Instead of lalr, invoke ielr, which invokes
1035 * src/reader.c (reader): Default lr.type to "LALR".
1036 Default lr.default_rules to "accepting" if lr.type is "canonical
1037 LR". Leave the default as "all" otherwise.
1038 Check for a valid lr.type value.
1039 * src/state.h, src/state.c (struct state_list): Add state_list
1041 (state_new): Initialize state_list member to NULL.
1042 (state_new_isocore): New function, exported.
1043 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
1044 exercises all values of lr.type.
1045 (GNU AWK Grammar): Rename test group to...
1046 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
1047 AT_TEST_EXISTING_GRAMMAR.
1048 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
1049 (GNU pic Grammar): Rename test group to...
1050 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
1051 AT_TEST_EXISTING_GRAMMAR.
1052 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
1053 all values of lr.type.
1054 (Single State Split): New test groups using AT_TEST_LR_TYPE.
1055 (Lane Split): Likewise.
1056 (Complex Lane Split): Likewise.
1057 (Split During Added Lookahead Propagation): Likewise.
1059 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1061 Add new files for IELR and canonical LR implementation.
1062 * src/AnnotationList.c: New.
1063 * src/AnnotationList.h: New.
1064 * src/InadequacyList.c: New.
1065 * src/InadequacyList.h: New.
1066 * src/Sbitset.c: New.
1067 * src/Sbitset.h: New.
1071 2009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1073 Implement %define lr.default_rules.
1074 Its value describes the states that are permitted to contain
1075 default rules: "all", "consistent", or "accepting".
1076 * src/reader.c (reader): Default lr.default_rules to "all".
1077 Check for a valid lr.default_rules value.
1078 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
1079 is "accepting", then only mark the accepting state as
1081 (initialize_LA): Tell state_lookahead_tokens_count whether
1082 lr.default_rules is "accepting".
1083 * src/tables.c (action_row): If lr.default_rules is not "all",
1084 then disable default rules in inconsistent states.
1085 * src/print.c (print_reductions): Use this opportunity to
1086 perform some assertions about whether lr.default_rules was
1088 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
1089 helps with checking the parser tables for a grammar.
1090 * tests/input.at (%define lr.default_rules invalid values): New
1092 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
1093 AT_TEST_TABLES_AND_PARSE.
1094 (`no %define lr.default_rules'): New test group generated by
1095 AT_TEST_LR_DEFAULT_RULES.
1096 (`%define lr.default_rules "all"'): Likewise.
1097 (`%define lr.default_rules "consistent"'): Likewise.
1098 (`%define lr.default_rules "accepting"'): Likewise.
1100 2009-04-20 Akim Demaille <demaille@gostai.com>
1104 2009-04-20 Akim Demaille <demaille@gostai.com>
1107 * src/output.c (token_definitions_output): Use symbol_id_get
1108 instead of duplicating its logic.
1109 * TODO (YYERRCODE): Extend.
1111 2009-04-20 Akim Demaille <demaille@gostai.com>
1113 variables: prefer error-verbose to error_verbose.
1114 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
1115 instead of error_verbose.
1116 * src/scan-gram.l (%error-verbose): Map to the error-verbose
1118 * doc/bison.texinfo: Promote %define error-verbose instead of
1120 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
1122 2009-04-15 Akim Demaille <demaille@gostai.com>
1124 variables: accept dashes.
1125 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
1127 * src/scan-gram.l ({id}): Also accept dashes after the initial
1129 ({directive}): Use {id}.
1130 * src/parse-gram.y: Comment and formatting changes.
1131 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
1133 * src/complain.h, src/complain.c (yacc_at): New.
1134 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
1136 * src/output.c (token_definitions_output): Do not #define token
1139 2009-04-20 Akim Demaille <demaille@gostai.com>
1141 Consistently refer to Yacc, not YACC.
1142 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
1144 2009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
1146 Pacify make maintainer-check-posix.
1147 * tests/input.at (%define, --define): Move bison command-line
1148 options before grammar file name.
1150 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1152 Document semicolon warnings.
1155 2009-04-14 Akim Demaille <demaille@gostai.com>
1157 variables: use `parse.assert' instead of `assert'.
1158 * TODO (assert): Remove.
1159 * data/bison.m4 (b4_assert_if): Replace with...
1160 (b4_parse_assert_if): this.
1161 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
1162 * doc/bison.texinfo (Decl Summary): Document parse.assert.
1164 2009-04-14 Akim Demaille <demaille@gostai.com>
1166 variables: use `parse.trace' instead of `debug'.
1167 * src/getargs.c (getargs): Map -t to %define trace.parse.
1168 * src/scan-gram.l (%debug): Map to %define trace.parse.
1169 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
1170 names to `_' in macro names.
1171 (b4_debug_if): Replace with...
1172 (b4_parse_trace_if): this.
1173 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1174 * data/yacc.c: Adjust.
1175 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
1176 Use @code to label the variable list.
1177 Document the variable parse.trace.
1178 (Tracing): Promote the parse.trace variable.
1179 * TODO: %printer is not documented.
1181 2009-04-14 Akim Demaille <demaille@gostai.com>
1184 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
1185 (Table of Symbols): Remove duplicate entry for %debug.
1187 2009-04-10 Eric Blake <ebb9@byu.net>
1189 submodules: update to latest
1190 * submodules/autoconf: Use latest upstream Autoconf.
1192 2009-04-06 Eric Blake <ebb9@byu.net>
1194 Work around autoconf 2.63b bug in testsuite.
1195 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
1196 autoconf bug related to # in test.
1198 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1200 * NEWS (2.5): New section. Describe new -D/--define feature.
1202 2009-04-06 Akim Demaille <demaille@gostai.com>
1205 * src/parse-gram.h, src/parse-gram.c: Regen.
1207 2009-04-06 Akim Demaille <demaille@gostai.com>
1209 rename muscle_tab.* as muscle-tab.* for consistency.
1210 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
1211 * src/muscle-tab.h, src/muscle-tab.c: these.
1212 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
1213 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
1215 2009-04-06 Akim Demaille <demaille@gostai.com>
1217 Makefile: introduce $(BISON).
1218 * src/local.mk (BISON): New.
1221 2009-04-06 Akim Demaille <demaille@gostai.com>
1223 parser: handle %locations as %define locations.
1224 * src/getargs.h, src/getargs.c (locations_flag): Remove.
1225 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
1226 to set "locations" to true.
1227 * src/output.c (prepare): Don't output "locations".
1228 * src/scan-gram.l (%locations): Handle it as a %<flag>.
1229 * src/parse-gram.y: It's no longer a token.
1231 * data/bison.m4 (b4_locations_if): Define it with
1232 b4_percent_define_if_define.
1233 * data/c.m4, data/glr.cc: Adjust.
1235 2009-04-06 Akim Demaille <demaille@gostai.com>
1238 * src/parse-gram.c: Regen.
1240 2009-04-06 Akim Demaille <demaille@gostai.com>
1242 muscle: factor the handling of obsolete of obsolete directives.
1243 Suggested by Joel E. Denny.
1245 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
1246 New, extracted from...
1247 * src/parse-gram.y (prologue_declaration: pure-parser): here.
1249 (prologue_declaration: "%<flag>"): Use
1250 muscle_percent_define_ensure.
1251 (%error-verbose, %pure-parser): No longer tokens.
1252 * src/scan-gram.l (pure-parser): Return as a %<flag>.
1254 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1256 Fix options documentation.
1257 * build-aux/cross-options.pl: As in --help output, write optional
1258 arguments as [=ARG] not =[ARG].
1259 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
1261 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1263 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
1264 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
1265 requirements for a correct m4 are stricter.
1266 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
1267 * configure.ac: Update to use AC_PROG_GNU_M4.
1268 Reported by Eric Blake.
1270 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1272 Help with updating web manual.
1273 * HACKING: Incorporate instructions from gnulib/doc/README.
1274 * bootstrap.conf (gnulib_modules): Add gendocs.
1276 2009-04-03 Akim Demaille <demaille@gostai.com>
1279 * src/parse-gram.h, src/parse-gram.c: Regen.
1281 2009-04-03 Akim Demaille <demaille@gostai.com>
1283 Factor %FLAG at scan level.
1284 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
1285 definitions and associated rules, replaced by....
1286 (PERCENT_FLAG): this new token type, and rule.
1287 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
1288 Use it for %debug and %error-verbose.
1290 2009-04-03 Akim Demaille <demaille@gostai.com>
1293 * src/parse-gram.h, src/parse-gram.c: Regen.
1295 2009-04-03 Akim Demaille <demaille@gostai.com>
1297 Treat %debug as %define debug.
1298 * data/bison.m4 (b4_debug_if): New.
1299 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
1300 * data/lalr1.java: Use it instead of b4_debug_flag.
1301 * src/getargs.h, src/getargs.c (debug_flag): Remove.
1302 * src/output.c (prepare): Don't output it.
1303 * src/parse-gram.y: Treat %debug as %define debug.
1305 2009-04-03 Akim Demaille <demaille@gostai.com>
1307 Treat %error-verbose as %define error_verbose.
1308 This allows to pass -Derror_verbose on the command line. Better
1309 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
1310 ERROR_VERBOSE being defined as false or true.
1311 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
1312 on b4_percent_define_ifdef, for does not check the defined value,
1313 but only whether the symbol is defined, rely on
1314 b4_percent_define_flag_if, so that a value of "false" is processed
1316 If not defined, define the flag to "false".
1317 (b4_error_verbose_if): New.
1318 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
1319 b4_error_verbose_flag.
1320 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
1321 * src/output.c (prepare): Don't output it.
1322 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
1324 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1326 Fix strange %define locations for default values.
1327 Reported by Akim Demaille at
1328 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
1329 and discussed again starting at
1330 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
1331 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
1332 because location information is bogus.
1333 Use angle brackets to delimit fake file name because square brackets
1334 look like underexpanded m4. Choose a better fake file name.
1335 Use negative line numbers.
1336 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
1337 * src/location.c (location_print): If line for a boundary is negative,
1338 only print that boundary's file name.
1339 * src/location.h: Document that.
1340 * tests/skeletons.at (%define Boolean variables: invalid skeleton
1341 defaults): Update output.
1343 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1345 Pacify ./configure --enable-gcc-warnings.
1346 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
1347 in lib won't compile with it.
1348 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
1350 2009-03-31 Akim Demaille <demaille@gostai.com>
1352 bootstrap: --help to stdout.
1353 * bootstrap (usage): Don't send --help to stderr.
1354 Use a here doc instead of a long string.
1356 2009-03-31 Akim Demaille <demaille@gostai.com>
1358 bootstrap: README-hacking no longer exists
1359 * bootstrap (checkout_only_file): Set to HACKING.
1361 2009-03-26 Akim Demaille <demaille@gostai.com>
1363 doc: merge HACKING and README-hacking.
1364 Two files is confusing.
1365 Reported by Alexandre Duret-Lutz.
1367 * README-hacking: Merge into...
1368 * HACKING (Working from the repository): here.
1370 2009-03-26 Akim Demaille <demaille@gostai.com>
1372 doc: update README-hacking.
1373 * README-hacking: We now use git and git submodules.
1374 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
1376 2009-03-26 Akim Demaille <demaille@gostai.com>
1378 lalr1.cc: avoid GCC 4.3 warnings.
1379 GCC 4.3 now warns about "a || b && c" and asks for explicit
1381 Reported by Alexandre Duret-Lutz.
1382 * data/location.cc: Update copyright years.
1383 (Position::operator==): Use parens to make precedence explicit.
1384 Compare lines and columns first, as they are more likely to be
1385 different, and they are faster to compare.
1387 2009-03-26 Akim Demaille <demaille@gostai.com>
1390 * gnulib: Update to latest.
1391 * src/local.mk (AM_CFLAGS): Move to...
1392 * Makefile.am: here.
1393 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
1396 2009-03-02 Akim Demaille <demaille@gostai.com>
1400 2009-03-02 Akim Demaille <demaille@gostai.com>
1402 Share b4_yytranslate_define.
1403 * data/lalr1.cc (b4_yytranslate_define): Move to...
1404 * data/c++.m4: here.
1406 2009-03-02 Akim Demaille <demaille@gostai.com>
1408 Use locations in the variant example.
1409 Yes, this obfuscates the point of this example, variants only.
1410 But glr.cc cannot work (yet?) without locations. This change
1411 makes it easier to use this example with glr.cc.
1413 * examples/variant.yy (assert): %define it.
1414 (locations): Request them.
1415 (yylex): Bind the location to the stage.
1417 2009-03-02 Akim Demaille <demaille@gostai.com>
1419 Dub make_TOKEN as a public type interface.
1420 * data/c++.m4 (b4_symbol_constructor_declare)
1421 (b4_symbol_constructor_define): New empty stubs.
1422 (b4_public_types_declare, b4_public_types_define): Use them.
1423 * data/lalr1.cc (b4_symbol_constructor_declare)
1424 (b4_symbol_constructor_declare_)
1425 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
1427 * data/variant.hh: here.
1428 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
1430 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
1431 b4_symbol_constructor_declare, as it is now done by
1432 b4_public_types_define and b4_public_types_declare.
1434 2009-03-02 Akim Demaille <demaille@gostai.com>
1436 Coding style changes.
1437 * data/lalr1.cc (b4_symbol_constructor_declaration_)
1438 (b4_symbol_constructor_declarations)
1439 (b4_symbol_constructor_definition_)
1440 (b4_symbol_constructor_definitions)
1441 (b4_yytranslate_definition): Rename as...
1442 (b4_symbol_constructor_declare_)
1443 (b4_symbol_constructor_declare)
1444 (b4_symbol_constructor_define_)
1445 (b4_symbol_constructor_define)
1446 (b4_yytranslate_define): these.
1447 * data/variant.hh (b4_variant_definition): Rename as...
1448 (b4_variant_define): this.
1450 2009-03-02 Akim Demaille <demaille@gostai.com>
1452 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
1453 * data/bison.m4 (b4_percent_define_if_define): New.
1454 * data/c++.m4 (b4_variant_if): Move to...
1455 * data/bison.m4: Here, using b4_percent_define_if_define.
1456 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
1457 * data/bison.m4: Here, using b4_percent_define_if_define.
1459 2009-03-02 Akim Demaille <demaille@gostai.com>
1461 Dub symbol_type_base as a public type.
1462 * data/c++.m4 (b4_public_types_declare): Now define
1463 symbol_type_base and symbol_type.
1464 (b4_public_types_define): New.
1465 In both cases, the definitions are taken verbatim from lalr1.cc.
1466 * data/lalr1.cc: Adjust.
1468 2009-03-02 Akim Demaille <demaille@gostai.com>
1470 b4_public_types_declare.
1471 * data/c++.m4 (b4_public_types_declare): New.
1472 * data/glr.cc, data/lalr1.cc: Use it.
1474 2009-03-02 Akim Demaille <demaille@gostai.com>
1476 b4_semantic_type_declare.
1477 * data/c++.m4 (b4_semantic_type_declare): New.
1478 Factors and generalizes what was in glr.cc and lalr1.cc.
1479 * data/variant.hh (b4_semantic_type_declare): Redefine it for
1481 * data/lalr1.cc, data/glr.cc: Use it.
1483 2009-02-26 Akim Demaille <demaille@gostai.com>
1486 * gnulib: Upgrade from master.
1487 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
1490 2009-02-25 Akim Demaille <demaille@gostai.com>
1492 Remove useless arguments.
1493 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
1496 2009-02-25 Akim Demaille <demaille@gostai.com>
1499 * data/lalr1.cc: here.
1501 2009-02-25 Akim Demaille <demaille@gostai.com>
1503 Fix glr.cc's debug level handling.
1504 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
1505 glr.c which is used.
1506 (debug_level, set_debug_level): Adjust.
1508 2009-02-25 Akim Demaille <demaille@gostai.com>
1511 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
1513 2009-02-25 Akim Demaille <demaille@gostai.com>
1516 * etc/bench.pl.in (generate_grammar_list): Consitently use
1517 location_type, not yy::location.
1519 2009-02-25 Akim Demaille <demaille@gostai.com>
1522 * data/lalr1.cc: here.
1524 2009-02-19 Akim Demaille <demaille@gostai.com>
1526 Make yyparser::error public.
1527 * data/lalr1.cc: here.
1528 There is no good reason to keep it private (and it is convenient
1529 to use it from the scanner for instance). It is already public in
1532 2009-02-19 Akim Demaille <demaille@gostai.com>
1535 * data/glr.cc: here.
1537 2009-02-19 Akim Demaille <demaille@gostai.com>
1539 Remove trailing blanks.
1540 The epilogue has its own ending \n, no need to add another.
1542 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
1544 * data/glr.cc: dnl when extending the epilogue.
1545 Remove stray "private:".
1547 2009-02-19 Akim Demaille <demaille@gostai.com>
1550 * data/c.m4 (b4_c_function_decl): Here.
1552 2009-02-19 Akim Demaille <demaille@gostai.com>
1555 * data/lalr1.cc: here.
1557 2009-02-19 Akim Demaille <demaille@gostai.com>
1560 * data/variant.hh: New, extracted from...
1561 * data/lalr1.cc: here.
1563 * data/local.mk: Adjust.
1565 2009-02-19 Akim Demaille <demaille@gostai.com>
1567 Extract stack.hh from lalr1.cc.
1568 * data/stack.hh: New.
1569 * data/lalr1.cc: Extract from here.
1570 * data/local.mk: Adjust.
1572 2009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
1574 Add reminder about uploading public key to keys.gnupg.net.
1575 * HACKING (Release Procedure): Here.
1577 2009-01-28 Akim Demaille <demaille@gostai.com>
1579 * NEWS: Update information about 2.4.1 and 2.4.2.
1581 2008-11-04 Akim Demaille <demaille@gostai.com>
1584 * NEWS: Use more outline-mode markup.
1585 Suggested by Jim Meyering.
1587 2009-01-08 Akim Demaille <demaille@gostai.com>
1589 Fix grep portability issues.
1590 Grep on Solaris does not support -q.
1591 Reported by Summum Bonum.
1593 * NEWS: Add a stub for 2.4.2.
1594 * THANKS: Add Summum Bonum.
1595 * tests/atlocal.in (EGREP): New.
1596 (CC, CXX, XSLTPROC): Make it possible to override them via
1598 * tests/java.at: Use $EGREP instead of egrep.
1599 Use AT_CHECK's ignore instead of grep's -q.
1601 2008-12-11 Akim Demaille <demaille@gostai.com>
1603 Pass the token type to yysyntax_error.
1604 * data/yacc.c (yysyntax_error): Take the transated token instead
1609 2008-12-11 Akim Demaille <demaille@gostai.com>
1612 * data/glr.c: Formatting changes.
1614 2008-12-11 Akim Demaille <demaille@gostai.com>
1616 Propagate i18n changes into glr.c.
1618 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
1619 building the error message format dynamically.
1620 * data/lalr1.java: Formatting changes.
1622 2008-12-11 Akim Demaille <demaille@gostai.com>
1625 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
1626 Solves problems when top_srcdir is an absolute path.
1627 Suggested by Eric Blake.
1628 * configure.ac: Require Autoconf 2.62.
1630 2008-12-11 Akim Demaille <demaille@gostai.com>
1632 Simplify the i18n of the error messages.
1633 * data/lalr1.cc: Comment changes.
1634 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
1635 lalr1.cc instead of building dynamically the format string.
1637 2008-12-08 Akim Demaille <demaille@gostai.com>
1639 Fix portability issue in the test suite.
1640 * tests/local.at (AT_MATCHES_CHECK): New.
1641 Based on Perl instead of Sed. Sed has too many portability
1642 pitfalls, not ever Sed is GNU Sed.
1643 * tests/actions.at (Fix user actions without a trailing semicolon):
1646 2008-12-08 Akim Demaille <demaille@gostai.com>
1649 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
1651 2008-12-08 Akim Demaille <demaille@gostai.com>
1653 Install autoconf as a submodule to get m4sugar.
1654 * .gitmodules: Add submodules/autoconf.
1655 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
1656 submodules/autoconf.
1658 2008-12-08 Akim Demaille <demaille@gostai.com>
1660 Test token.prefix in all the skeletons.
1661 * data/java.m4 (b4_token_enum): Use the token.prefix.
1662 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
1663 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
1664 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
1665 * tests/java.at: Comment changes.
1666 (AT_CHECK_JAVA_MINIMAL): Define the END token.
1667 (Java parser class and package names): Add token.prefix check.
1669 2008-12-08 Akim Demaille <demaille@gostai.com>
1671 Fix regeneration of atconfig.
1672 * tests/local.mk (tests/atconfig): The rule was incorrect, but
1673 remove it: now that there is no tests/Makefile.am, the top-level
1674 Makefile properly updates atconfig when needed.
1676 2008-12-07 Di-an Jan <dianj@freeshell.org>
1678 Implement the FIXME that ends an user action with a semicolon
1679 if it seems necessary.
1680 * src/scan-code.l (flex rules section): Flag cpp directive from
1681 any `#' to the first unescaped end-of-line. Semicolon is not
1682 needed after `;', `{', '}', or cpp directives and is needed after
1683 any other token (whitespaces and comments have no effect).
1684 * tests/actions.at (Fix user actions without a trailing semicolon):
1686 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
1687 to make user actions complete statements.
1688 Adjust column numbers in error messages.
1689 * tests/regression.at (Fix user actions without a trailing semicolon):
1690 Remove. Covered by new test.
1692 2008-12-07 Akim Demaille <demaille@gostai.com>
1695 * gnulib: Update from master.
1697 2008-12-05 Eric Blake <ebb9@byu.net>
1699 Avoid compiler warning.
1700 * src/output.c (muscle_insert_item_number_table): Delete unused
1703 2008-12-02 Eric Blake <ebb9@byu.net>
1705 Build testsuite with newer autoconf.
1706 * tests/output.at (m4_expand): Don't override in newer autoconf,
1707 where the underlying implementation changed.
1708 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
1709 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
1710 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
1711 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
1712 since some of them contain unbalanced ')'.
1714 2008-12-01 Akim Demaille <demaille@gostai.com>
1716 Use b4_symbol for printers and destructors everywhere.
1717 * data/bison.m4 (b4_symbol_action_location): New.
1718 * data/c.m4 (b4_symbol_actions): Remove.
1719 Adjust all callers to use by b4_symbol_foreach and the corresponding
1720 b4_symbol_printer/destructor macro.
1721 * data/glr.cc: Adjust.
1722 * data/lalr1.java: Adjust the %destructor sanity check.
1723 * src/output.c (symbol_code_props_output): Remove, we no longer
1724 need the b4_symbol_printers/destructors tables.
1726 2008-12-01 Akim Demaille <demaille@gostai.com>
1728 Use b4_symbol_case_.
1729 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
1732 2008-12-01 Akim Demaille <demaille@gostai.com>
1734 Move b4_symbol based macro to bison.m4.
1735 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
1736 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
1737 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
1738 (b4_type_foreach): Move to...
1739 * data/bison.m4: Here.
1740 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
1741 b4_symbol_value_template instead of b4_symbol_value.
1743 2008-12-01 Akim Demaille <demaille@gostai.com>
1745 b4_symbol/type_foreach.
1746 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
1749 2008-12-01 Akim Demaille <demaille@gostai.com>
1751 Use the symbol properties to output the printer/destructor for lalr1.cc.
1752 Instead of defining complex list of tuples to define various
1753 properties of the symbols, we now prefer to define symbols as
1754 "structs" in m4: using the symbol key (its number), and the
1755 property name, b4_symbol gives it value. Use this to handle
1756 destructors and printers.
1758 * src/output.c (CODE_PROP): New.
1759 (prepare_symbol_definitions): Use it to define the printer and
1760 destructor related attributes of the symbols.
1761 * data/lalr1.cc (b4_symbol_actions): Rename as...
1762 (b4_symbol_action): this.
1763 Use b4_symbol instead of 6 arguments.
1764 (b4_symbol_printer, b4_symbol_destructor): New.
1765 Use them instead of b4_symbol_actions.
1767 2008-12-01 Akim Demaille <demaille@gostai.com>
1769 Avoid capturing variables too easily.
1770 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
1771 v__ and p__ instead of v and p.
1773 2008-12-01 Akim Demaille <demaille@gostai.com>
1775 Remove spurious empty line before syncline.
1776 * data/bison.m4 (b4_syncline): Don't output an empty line before
1779 2008-11-26 Akim Demaille <demaille@gostai.com>
1781 Convert lib/Makefile.am into lib/local.mk.
1782 The real problem is rather gnulib.mk, which itself is extracted
1783 from a Makefile.am that gnulib expects to the "recursive". The
1784 tool prefix-gnulib-mk converts such a gnulib.mk to be
1785 non-recursive. Also, some AC_SUBST variables need to be adjusted.
1787 * etc/prefix-gnulib-mk: New.
1788 * bootstrap (slurp): Use it to convert further gnulib.mk.
1789 No longer try to avoid re-creation of lib/gnulib.mk as the changes
1791 * lib/Makefile.am: Rename as...
1792 * lib/local.mk: this.
1793 Adjust to be prefixed.
1794 * Makefile.am, configure.ac: Adjust.
1795 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
1797 2008-11-26 Akim Demaille <demaille@gostai.com>
1800 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
1801 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
1802 Reported by Eric Blake.
1804 2008-11-26 Akim Demaille <demaille@gostai.com>
1806 Use b4_parser_tables_define in glr.cc.
1807 * data/glr.c: Use b4_parser_tables_define instead of defining the
1808 (deterministic integral) tables by hand.
1810 2008-11-26 Akim Demaille <demaille@gostai.com>
1812 Use b4_parser_tables_define in Java.
1813 * data/java.m4 (b4_typed_parser_table): Rename as...
1814 (b4_typed_parser_table_define): this, for consistency.
1815 Accept a comment as $4.
1817 (b4_integral_parser_table): Rename as...
1818 (b4_integral_parser_table_define): this.
1819 * data/lalr1.java: Adjust all uses.
1820 Use b4_parser_tables_define instead of generation by hand.
1822 2008-11-26 Akim Demaille <demaille@gostai.com>
1824 Prepare the convergence bw C style and Java table generation.
1825 * data/bison.m4 (b4_tables_map, b4_tables_declare)
1826 (b4_tables_define): Rename as...
1827 (b4_integral_parser_tables_map, b4_parser_tables_declare)
1828 (b4_parser_tables_define): these.
1829 * data/c.m4 (b4_table_define): Rename as...
1830 (b4_integral_parser_table_define): this.
1831 * data/lalr1.cc: Adjust.
1832 (b4_table_define, b4_table_declare): Rename as...
1833 (b4_integral_parser_table_define)
1834 (b4_integral_parser_table_declare): these.
1835 (yyrline_): Move the comment where it is actually used.
1836 * data/yacc.c: Adjust.
1837 (yyrline): Use b4_integral_parser_table_define.
1839 2008-11-26 Akim Demaille <demaille@gostai.com>
1842 * src/parse-gram.h, src/parse-gram.c: Regen.
1844 2008-11-26 Akim Demaille <demaille@gostai.com>
1846 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
1847 * data/lalr1.cc (b4_tables_map): Move to...
1848 * data/bison.m4: here.
1849 Update the comment for yytable during the flight.
1850 (b4_tables_declare, b4_tables_define): New.
1851 * data/lalr1.cc: Use them.
1852 * data/c.m4 (b4_table_define): New.
1853 * data/yacc.c: Use b4_tables_define instead of output the tables
1855 * tests/regression.at (Web2c Actions): Adjust the expected output,
1856 the order of the tables changed.
1858 2008-11-26 Akim Demaille <demaille@gostai.com>
1860 Get rid of (yy)rhs and (yy)prhs.
1861 These tables are no longer needed in the parsers, and they don't seem to
1862 be useful. They are not documented either.
1864 * src/output.c (prepare_rules): Get rid of rhs and prhs.
1865 Adjust the computation of (yy)r2.
1867 2008-11-26 Akim Demaille <demaille@gostai.com>
1869 Rule length is unsigned.
1870 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
1872 2008-11-26 Akim Demaille <demaille@gostai.com>
1874 Get rid of lalr1-split.cc.
1875 It was no longer maintainer.
1877 * data/lalr1-split.cc: Remove.
1878 * etc/bench.pl.in (bench_fusion_parser): Remove.
1881 2008-11-26 Akim Demaille <demaille@gostai.com>
1883 Use yy* consistently.
1884 * data/glr.c: Now that yyrhs no longer exists as a global
1885 variable, rename local "rhs" variables into "yyrhs" for
1888 2008-11-25 Akim Demaille <demaille@gostai.com>
1890 Get rid of yyrhs and yyprhs in glr.c.
1891 * data/glr.c (yyrhs, yyprhs): Remove.
1892 Instead, use the state stack and yystos.
1894 2008-11-25 Akim Demaille <demaille@gostai.com>
1897 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
1898 as an Autotest keyword.
1900 2008-11-25 Akim Demaille <demaille@gostai.com>
1902 Prefer TESTSUITE_FLAGS.
1903 TESTSUITEFLAGS is barely readable.
1905 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
1906 for backward compatibility.
1907 Use the former instead of the latter.
1909 2008-11-25 Akim Demaille <demaille@gostai.com>
1911 Get rid of yyrhs and yyprhs in larl1.java.
1912 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
1913 (yy_reduce_print): Rather, use yystos_ and the state stack.
1915 2008-11-25 Akim Demaille <demaille@gostai.com>
1919 2008-11-25 Akim Demaille <demaille@gostai.com>
1921 Get rid of yyrhs and yyprhs in yacc.c.
1922 They were used to get the symbol types, given a rule number, when
1923 displaying the top of the stack before a reduction. But the
1924 symbol type is available from the state stack. This has two be
1925 benefits: two tables less in the parser (making it smaller), and a
1926 more consistent use of the three stacks which will help to fuse
1929 * data/yacc.c (yyprhs, yyrhs): Remove.
1930 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
1931 (yy_reduce_print): Take yyssp as argument.
1932 Use it, together with yystos, to get the symbol type.
1933 * tests/regression.at (Web2c Report): Remove these tables from the
1936 2008-11-25 Akim Demaille <demaille@gostai.com>
1939 The point is to factor the generation of the tables across skeletons.
1940 This is language dependant.
1942 * data/c.m4 (b4_comment_): New.
1943 Should be usable to define how to generate tables independently of
1945 (b4_c_comment): New.
1946 (b4_comment): Bounce to b4_c_comment.
1947 Now support $2 = [PREFIX] for indentation.
1948 * data/lalr1.cc (b4_table_declare): Don't output a comment if
1949 there is no comment.
1950 Indent it properly when there is one.
1951 Output the ending semicolon.
1952 (b4_table_define): Space changes.
1953 Output the ending semicolon.
1954 (b4_tables_map): New.
1955 Use it twice instead of declaring and defining the (integral)
1958 2008-11-25 Akim Demaille <demaille@gostai.com>
1961 * data/lalr1.cc (b4_table_declare): New.
1962 Use it to declare the tables defined with b4_table_define.
1963 (b4_table_define): Declare a third arg to match b4_table_declare
1965 Move all the comments around invocations of b4_table_define into
1966 the invocations itselves.
1967 Move things around to have the order for declarations and
1970 2008-11-25 Akim Demaille <demaille@gostai.com>
1973 * data/lalr1.java: here.
1975 2008-11-25 Akim Demaille <demaille@gostai.com>
1977 b4_args is more general than only C++.
1978 * data/lalr1.cc (b4_args, _b4_args): Move to...
1979 * data/bison.m4: here.
1981 2008-11-21 Di-an Jan <dianj@freeshell.org>
1983 Implement no-XXX arguments for --warnings, --report, --trace.
1984 * src/getargs.c (flags_argmatch): Handles no-XXX.
1985 Fix typo in doxygen comment.
1987 2008-11-21 Akim Demaille <demaille@gostai.com>
1989 Display the changes in cross-options.texi.
1990 * build-aux/cross-options.pl ($sep): New, to separate items.
1991 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
1994 2008-11-20 Di-an Jan <dianj@freeshell.org>
1996 Improves options in the manual.
1997 * doc/bison.texinfo (-g, -x): Add space before argument.
1998 (Option Cross Key): Implement FIXME: listing directives also.
1999 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
2000 (Short Option): Special case -d. Put arguments inside @option.
2001 (Bison Directive): Add column, automatically extracted from
2002 src/scan-gram.l (actual name passed as the first argument)
2003 with special case for %define.
2004 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
2005 to build-aux/cross-options.pl.
2006 * src/getargs.c (usage): Document limitations of cross-options.pl.
2007 * src/scan-gram.l: Likewise.
2009 2008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2011 Fix unexpanded macros in GLR defines file.
2012 Reported by Csaba Raduly at
2013 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
2014 * THANKS (Csaba Raduly): Add.
2015 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
2016 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
2017 lexer in a separate module that includes the defines file.
2018 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
2020 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
2021 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
2022 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
2023 (AT_DATA_SOURCE_PROLOGUE): New.
2024 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
2025 (AT_DATA_SOURCE): New.
2026 (AT_FULL_COMPILE): Extend to support an additional source file.
2028 2008-11-18 Akim Demaille <demaille@gostai.com>
2031 * TODO: More short term issues.
2033 2008-11-18 Akim Demaille <demaille@gostai.com>
2036 * src/parse-gram.h, src/parse-gram.c: Regen.
2038 2008-11-18 Akim Demaille <demaille@gostai.com>
2040 Use b4_subtract where possible.
2041 * data/lalr1.cc (b4_subtract): Move to...
2042 * data/bison.m4: here.
2043 * data/glr.c (b4_rhs_data): Use it.
2044 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
2046 2008-11-18 Akim Demaille <demaille@gostai.com>
2048 Remove incorrect mode specification.
2049 * data/glr.cc: Don't pretend it's C code.
2051 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2053 Simplify last patch slightly.
2054 * src/getargs.c (getargs): Here.
2056 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2058 Fix last warning from --enable-gcc-warnings.
2059 * src/getargs.c (getargs): Don't assign const address to non-const
2062 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2064 Don't let maintainer-*-check targets force a version update.
2065 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
2068 2008-11-17 Di-an Jan <dianj@freeshell.org>
2070 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
2071 Align menus. Adjust word wrapping. Use node names for menu names.
2072 (Examples): Don't abbreviate node names.
2073 (LocalWords): Remove abbreviations.
2074 (Copying): Make description a sentence.
2075 (Java Action Features): Remove period to match the rest of menu.
2077 2008-11-17 Di-an Jan <dianj@freeshell.org>
2079 Handles several --enable-gcc-warnings.
2080 * src/getargs.c (command_line_location): Set parameters to void.
2081 * src/output.c (symbol_type_name_cmp): Make static.
2082 (symbols_by_type_name): Set parameters to void.
2083 (symbol_definitions_output): Remove unused parameter. Rename as...
2084 (prepare_symbol_definitions): this.
2085 (muscles_output): Move symbol_definitions_output to...
2086 (output): here as prepare_symbol_definitions.
2087 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
2088 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
2090 2008-11-17 Di-an Jan <dianj@freeshell.org>
2092 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
2093 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
2095 2008-11-16 Akim Demaille <demaille@gostai.com>
2097 Add missing $(EXEEXT).
2098 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
2099 "src/bison$(EXEEXT)".
2100 Reported by Di-an Jan.
2102 2008-11-15 Akim Demaille <demaille@gostai.com>
2106 2008-11-15 Akim Demaille <demaille@gostai.com>
2109 * tests/input.at: here.
2111 2008-11-15 Akim Demaille <demaille@gostai.com>
2113 Remove duplicate header inclusion.
2116 2008-11-15 Akim Demaille <demaille@gostai.com>
2118 * src/parse-gram.h, src/parse-gram.c: Regen.
2120 2008-11-15 Akim Demaille <demaille@gostai.com>
2122 Support parametric types.
2124 There are two issues to handle: first scanning nested angle
2125 bracket pairs to support types such as std::pair< std::string,
2126 std::list<std::string> > >.
2128 Another issue is to address idiosyncracies of C++: do not glue two
2129 closing angle brackets together (otherwise it's operator>>), and
2130 avoid sticking blindly a TYPE to the opening <, as it can result
2131 in '<:' which is a digraph for '['.
2133 * src/scan-gram.l (brace_level): Rename as...
2136 Implement support for complex tags.
2139 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
2140 (b4_symbol_variant): Leave space around types as parameters.
2141 * examples/variant.yy: Use nested template types and leading ::.
2142 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
2144 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
2145 * tests/c++.at: Test parametric types.
2147 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2150 This is not sufficient, but we test at least that the make_SYMBOL
2151 interface is not affected by token.prefix. A more general test
2152 will be implemented when the support of token.prefix is generalized
2155 * tests/c++.at: One more variant test, using token.prefix.
2157 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2159 Test the make_TOKEN interface.
2160 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
2161 Factor the common code in yylex.
2162 Use it to test "%define lex_symbol".
2164 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2168 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2170 Simplify code for variants bench marks.
2171 * etc/bench.pl.in (&generate_grammar_list): Define and use
2173 Factor the common code in yylex.
2175 2008-11-15 Akim Demaille <demaille@gostai.com>
2177 Better error message.
2178 * bootstrap (find_tool): Fix the error message.
2180 2008-11-15 Akim Demaille <demaille@gostai.com>
2182 Update variant.yy to newest interface.
2183 * examples/variant.yy: Define lex_symbol.
2186 2008-11-15 Akim Demaille <demaille@gostai.com>
2188 Don't use locations in variant.yy.
2189 * examples/variant.yy: Adjust to not using locations.
2191 2008-11-15 Akim Demaille <demaille@gostai.com>
2194 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
2195 comments for the license.
2197 2008-11-15 Akim Demaille <demaille@gostai.com>
2199 Remove tests/Makefile.am.
2200 * tests/Makefile.am: Rename as...
2201 * tests/local.mk: this.
2202 * Makefile.am, configure.ac: Adjust.
2203 * Makefile.am (DISTCLEANFILES): Define.
2204 (maintainer-check, maintainer-xml-check, maintainer-push-check):
2205 Remove, we no longer need to bounce to the real targets.
2207 2008-11-15 Akim Demaille <demaille@gostai.com>
2211 2008-11-15 Akim Demaille <demaille@gostai.com>
2214 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
2215 * djgpp/local.mk: this new file.
2217 2008-11-15 Akim Demaille <demaille@gostai.com>
2219 Remove doc/Makefile.am.
2220 * doc/Makefile.am: Rename as...
2221 * doc/local.mk: this.
2223 * Makefile.am, configure.ac: Adjust.
2224 * Makefile.am (MOSTLYCLEANFILES): New.
2225 * src/local.mk: Adjust.
2227 2008-11-15 Akim Demaille <demaille@gostai.com>
2229 Move sc_tight_scope into maint.mk.
2230 It does not work, and I don't know how it was supposed to work: it
2231 seems to be looking for sources in the build tree. I just moved
2232 it at a better place, fixing it is still required.
2234 * src/local.mk (echo): Remove.
2235 (sc_tight_scope): Move to...
2238 2008-11-15 Akim Demaille <demaille@gostai.com>
2241 * src/parse-gram.h, src/parse-gram.h: Regen.
2243 2008-11-15 Akim Demaille <demaille@gostai.com>
2245 Remove src/Makefile.am.
2246 * src/Makefile.am: Rename as...
2247 * src/local.mk: this.
2248 Prefix all the paths with src/.
2249 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
2250 (AM_CPPFLAGS): Find find in builddir/src.
2251 (YACC): Move the flags into...
2253 * maint.mk (sc_tight_scope): Disable.
2254 It used to bounce to the version in src/Makefile.am which is now
2255 part of this very Makefile.
2256 * Makefile.am, configure.ac: Adjust.
2257 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
2258 include "..." to find files "here": we are no longer in src/, so
2259 qualify the includes with src/.
2260 * doc/Makefile.am (PREPATH): No longer include the top_builddir
2262 (.x.1): Adjust to be able to create src/foo from the top level
2263 Makefile, instead of going bounce to src/Makefile the creation of
2266 2008-11-15 Akim Demaille <demaille@gostai.com>
2268 Remove useless variable.
2269 * doc/Makefile.am (srcsrcdir): Remove.
2271 2008-11-15 Akim Demaille <demaille@gostai.com>
2273 Remove data/Makefile.am.
2274 * data/Makefile.am: Rename as...
2275 * data/local.mk: this.
2277 * Makefile.am, configure.ac: Adjust.
2279 2008-11-15 Akim Demaille <demaille@gostai.com>
2281 Remove etc/Makefile.am.
2282 * etc/Makefile.am: Rename as...
2283 * etc/local.mk: this.
2285 * Makefile.am, configure.ac: Adjust.
2287 2008-11-15 Akim Demaille <demaille@gostai.com>
2289 Remove examples/local.mk.
2290 examples/calc++/Makefile.am might be interesting to keep as is, since
2291 it is an example in itself.
2293 * examples/Makefile.am: Rename as...
2294 * examples/local.mk: this.
2296 * Makefile.am, configure.ac: Adjust.
2298 2008-11-15 Akim Demaille <demaille@gostai.com>
2300 Remove build-aux/Makefile.am.
2301 Recursive Makefiles are really way too slow, let's get rid of some of
2304 * build-aux/Makefile.am: Rename as...
2305 * build-aux/local.mk: this.
2307 * Makefile.am, configure.ac: Adjust.
2309 2008-11-15 Akim Demaille <demaille@gostai.com>
2311 Provide convenience constructors for locations and positions.
2312 * data/location.cc (position::position): Accept file, line and
2313 column as arguments with default values.
2314 Always qualify initial line and column literals as unsigned.
2315 (location::location): Provide convenience constructors.
2317 2008-11-15 Akim Demaille <demaille@gostai.com>
2319 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
2321 Using template buys us nothing, and makes it uselessly complex to
2322 construct a symbol. Besides, it could not be generalized to other
2323 languages, while make_FOO would work in C/Java etc.
2325 * data/lalr1.cc (b4_symbol_): New.
2326 (b4_symbol): Use it.
2327 (b4_symbol_constructor_declaration_)
2328 (b4_symbol_constructor_definition_): Instead of generating
2329 specializations of an overloaded template function, just generate
2330 several functions whose names are forged from the token names
2331 without the token.prefix.
2332 (b4_symbol_constructor_declarations): Generate them for all the
2333 symbols, not just by class of symbol type, now that instead of
2334 specializing a function template by the token, we generate a
2335 function named after the token.
2336 (b4_symbol_constructor_specialization_)
2337 (b4_symbol_constructor_specializations): Remove.
2338 * etc/bench.pl.in: Adjust to this new API.
2340 2008-11-13 Akim Demaille <demaille@gostai.com>
2342 %define token.prefix.
2343 Provide a means to add a prefix to the name of the tokens as
2344 output in the generated files. Because of name clashes, it is
2345 good to have such a prefix such as TOK_ that protects from names
2346 such as EOF, FILE etc. But it clutters the grammar itself.
2348 * data/bison.m4 (token.prefix): Empty by default.
2349 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
2350 * data/lalr1.cc (b4_symbol): Ditto.
2352 2008-11-13 Akim Demaille <demaille@gostai.com>
2354 Compute at M4 time some of the subtractions.
2355 * data/lalr1.cc (b4_subtract): New.
2356 (b4_rhs_data): Use it.
2358 2008-11-13 Akim Demaille <demaille@gostai.com>
2361 This allows the user to get the type of a token returned by yylex.
2363 * data/lalr1.cc (symbol::token): New.
2364 (yytoknum_): Define when %define lex_symbol, independently of
2366 (yytoken_number_): Move into...
2367 (symbol::token): here, since that's the only use.
2368 The other one is YYPRINT which was not officially supported
2369 by lalr1.cc, and anyway it did not work since YYPRINT uses this
2370 array under a different name (yytoknum).
2372 2008-11-13 Akim Demaille <demaille@gostai.com>
2375 * TODO (YYERRCODE): Mention the case of $undef.
2377 2008-11-13 Akim Demaille <demaille@gostai.com>
2380 * TODO (YYPRINT): New.
2382 2008-11-13 Akim Demaille <demaille@gostai.com>
2385 * data/lalr1.cc, data/yacc.c: Fix the description of the
2386 yytranslate and yytoknum tables.
2388 2008-11-13 Akim Demaille <demaille@gostai.com>
2390 Define make_symbol in the header.
2391 To reach good performances these functions should be inlined (yet
2392 this is to measure precisely). To this end they must be available
2395 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
2396 location_type with the class name.
2397 Since will now be output in the header, declare "inline".
2398 No longer use b4_symbol_constructor_specializations, but
2399 b4_symbol_constructor_definitions in the header.
2400 Don't call it in the *.cc file.
2402 2008-11-13 Akim Demaille <demaille@gostai.com>
2404 Define yytranslate in the header for lex_symbol.
2405 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
2406 into the header file when using %define lex_symbol.
2407 (yytranslate_): Declare inline.
2409 2008-11-13 Akim Demaille <demaille@gostai.com>
2411 Define the constructors of symbol_type in
2412 b4_symbol_constructor_definitions.
2413 The constructors are called by the make_symbol functions, which a
2414 forthcoming patch will move elsewhere. Hence the interest of
2415 putting them together.
2417 The stack_symbol_type does not need to be moved, it is used only
2420 * data/lalr1.cc: Move symbol_type and symbol_base_type
2421 constructors into...
2422 (b4_symbol_constructor_definitions): here.
2425 2008-11-13 Akim Demaille <demaille@gostai.com>
2427 Make it easier to move the definition of yytranslate_.
2428 Forthcoming changes will make it possible to use yytranslate_
2429 from outside the parser implementation file.
2431 * data/lalr1.cc (b4_yytranslate_definition): New.
2434 2008-11-13 Akim Demaille <demaille@gostai.com>
2436 Remove useless class specification.
2437 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
2438 to refer to the class name to use a type defined by the class for
2439 arguments of member functions.
2441 2008-11-13 Akim Demaille <demaille@gostai.com>
2443 Finer input type for yytranslate.
2444 This patch is debatable: the tradition expects yylex to return an int
2445 which happens to correspond to token_number (which is an enum). This
2446 allows for instance to return characters (such as '*' etc.). But this
2447 goes against the stronger typing I am trying to have with the new
2448 lex interface which return a symbol_type. So in this case, feed
2449 yytranslate_ with a token_type.
2451 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
2452 expect a token_type.
2454 2008-11-13 Akim Demaille <demaille@gostai.com>
2456 Honor lex-params in %define lex_symbol mode.
2457 * data/lalr1.cc: Use b4_lex_param.
2459 2008-11-13 Akim Demaille <demaille@gostai.com>
2462 * src/output.c (symbol_definitions_output): Rename symbol
2463 attributes type_name and has_type_name as type and has_type.
2464 * data/lalr1.cc: Adjust uses.
2466 2008-11-13 Akim Demaille <demaille@gostai.com>
2468 Use b4_type_names for the union type.
2469 The union used to compute the size of the variant used to iterate
2470 over the type of all the symbols, with a lot of redundancy. Now
2471 iterate over the lists of symbols having the same type-name.
2473 * data/lalr1.cc (b4_char_sizeof_): New.
2474 (b4_char_sizeof): Use it.
2475 Adjust to be called with a list of numbers instead of a single
2477 Adjust its caller for new-line issues.
2479 2008-11-13 Akim Demaille <demaille@gostai.com>
2481 Define the "identifier" of a symbol.
2482 Symbols may have several string representations, for instance if
2483 they have an alias. What I call its "id" is a string that can be
2484 used as an identifier. May not exist.
2486 Currently the symbols which have the "tag_is_id" flag set are
2487 those that don't have an alias. Look harder for the id.
2489 * src/output.c (is_identifier): Move to...
2490 * src/symtab.c (is_identifier): here.
2491 * src/symtab.h, src/symtab.c (symbol_id_get): New.
2492 * src/output.c (symbol_definitions_output): Use it to define "id"
2494 Remove the definition of "tag_is_id".
2495 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
2496 "tag_is_id" were used to produce code.
2497 We still use "tag" for documentation.
2499 2008-11-11 Akim Demaille <demaille@gostai.com>
2501 Locations are no longer required by lalr1.cc.
2502 * data/lalr1.cc (_b4_args, b4_args): New.
2503 Adjust all uses of locations to make them optional.
2504 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
2505 (AT_CHECK_NAMESPACE): Check the use of locations.
2506 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
2507 without locations with lalr1.cc.
2509 * tests/output.at: Check lalr1.cc with and without location
2511 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
2512 Don't use locations.
2514 2008-11-11 Akim Demaille <demaille@gostai.com>
2517 * tests/local.at (AT_FULL_COMPILE): New.
2518 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
2520 2008-11-11 Akim Demaille <demaille@gostai.com>
2522 Support parens in calc++.
2523 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
2524 * examples/calc++/test (run): Check the expected output.
2528 2008-11-11 Akim Demaille <demaille@gostai.com>
2530 Simplify lalr1.cc since %defines is mandatory.
2531 * data/lalr1.cc: Remove useless calls to b4_defines_if.
2533 2008-11-11 Akim Demaille <demaille@gostai.com>
2536 * TODO (yysyntax_error): New item.
2538 2008-11-11 Akim Demaille <demaille@gostai.com>
2541 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
2544 2008-11-11 Akim Demaille <demaille@gostai.com>
2546 Support i18n of the parse error messages.
2547 * TODO (lalr1.cc/I18n): Remove.
2548 * data/lalr1.cc (yysyntax_error_): Support the translation of the
2549 error messages, as done in yacc.c.
2550 Stay within the yy* pseudo namespace.
2552 2008-11-11 Akim Demaille <demaille@gostai.com>
2555 * TODO (single stack, yysyntax_error): New.
2557 2008-11-11 Akim Demaille <demaille@gostai.com>
2559 Make it possible to return a symbol_type from yylex.
2560 * data/lalr1.cc (b4_lex_symbol_if): New.
2561 (parse): When lex_symbol is defined, expected yylex to return the
2563 * etc/bench.pl.in (generate_grammar_list): Extend to support this
2565 (bench_variant_parser): Exercise it.
2567 2008-11-11 Akim Demaille <demaille@gostai.com>
2569 Remove useless bench case.
2570 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
2573 2008-11-11 Akim Demaille <demaille@gostai.com>
2575 Improve display of directives.
2576 * etc/bench.pl.in (parse_term): Don't add useless eol.
2578 2008-11-11 Akim Demaille <demaille@gostai.com>
2580 Use string_cast in the bench.
2581 * etc/bench.pl.in (generate_grammar_list): Define and use
2584 2008-11-11 Akim Demaille <demaille@gostai.com>
2586 Replace yychar with a Boolean.
2587 * data/lalr1.cc (parse::yychar): Replace by...
2588 (parse::yyempty): this.
2590 2008-11-11 Akim Demaille <demaille@gostai.com>
2595 2008-11-11 Akim Demaille <demaille@gostai.com>
2597 Let yytranslate handle the eof case.
2598 * data/lalr1.cc (yytranslate_): Handle the EOF case.
2600 No longer expect yychar to be equal to yyeof_, rather, test the
2601 lookahead's (translated) kind.
2603 2008-11-11 Akim Demaille <demaille@gostai.com>
2605 yychar cannot be empty in yyerrlab.
2606 * TODO (yychar == yyempty_): New.
2607 * data/lalr1.cc: Remove the handling of this case.
2608 This eases forthcoming changes related to yychar and yytranslate.
2610 2008-11-11 Akim Demaille <demaille@gostai.com>
2612 Bench: syntactic sugar for %define/#define.
2613 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
2614 (&bench_push_parser, bench_variant_parser): Use this feature.
2618 2008-11-11 Akim Demaille <demaille@gostai.com>
2620 Less memory pressure on the "list" bench.
2621 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
2622 the values, to limit memory pressure.
2624 2008-11-11 Akim Demaille <demaille@gostai.com>
2626 Introduce make_symbol.
2627 make_symbol provides a means to construct a full symbol (kind,
2628 value, location) in a single shot. It is meant to be a Symbol
2629 constructor, parameterized by the symbol kind so that overloading
2630 would prevent incorrect kind/value pairs. Unfortunately
2631 parameterized constructors do not work well in C++ (unless the
2632 parameter also appears as an argument, which is not acceptable),
2633 hence the use of a function instead of a constructor.
2635 * data/lalr1.cc (b4_symbol_constructor_declaration_)
2636 (b4_symbol_constructor_declarations)
2637 (b4_symbol_constructor_specialization_)
2638 (b4_symbol_constructor_specializations)
2639 (b4_symbol_constructor_definition_)
2640 (b4_symbol_constructor_definitions): New.
2641 Use them where appropriate to generate declaration, declaration of
2642 the specializations, and implementations of the templated
2643 overloaded function "make_symbol".
2644 (variant::variant): Always define a default ctor.
2645 Also provide a copy ctor.
2646 (symbol_base_type, symbol_type): New ctor overloads for value-less
2648 (symbol_type): Now public, so that functions such as yylex can use
2651 2008-11-11 Akim Demaille <demaille@gostai.com>
2653 Inform m4 whether a tag is a valid id.
2654 * src/output.c (is_identifier): New.
2655 (symbol_definitions_output): Use it to define tag_is_id.
2656 But maybe this should be done at m4 level?
2658 2008-11-11 Akim Demaille <demaille@gostai.com>
2660 Test 214 was failing: it greps with a pattern containing [ ]*
2661 which obviously meant to catch spaces and tabs, but contained only
2662 spaces. Tabulations in sources are a nuisance, so to simplify the
2663 matter, get rid of all the tabulations in the Java sources. The
2664 other skeletons will be treated equally later.
2666 * data/java.m4, data/lalr1.java: Untabify.
2667 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
2668 tabulations are no longer generated.
2670 2008-11-11 Paolo Bonzini <bonzini@gnu.org>
2672 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
2673 * configure.ac: Adjust usage.
2674 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
2675 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
2676 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
2678 2008-11-10 Di-an Jan <dianj@freeshell.org>
2680 Workaround Java's ``code too large'' problem for parser tables
2681 in most cases, by using one function per initialization.
2682 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
2683 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
2684 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
2685 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
2686 (yytname_): Use b4_typed_parser_table.
2687 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
2688 ``code too large'' error.
2690 2008-11-10 Di-an Jan <dianj@freeshell.org>
2692 * NEWS: Document them.
2694 General Java skeleton improvements.
2695 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
2696 using gcj < 4.3 in the testsuite, according to comments in
2697 gnulib/m4/javacomp.m4.
2698 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
2699 location_type, position_type): Remove extraneous brackets from
2700 b4_percent_define_default.
2701 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
2702 m4_define and m4_define_default.
2703 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
2704 which marks the end of user code with appropriate syncline, like all
2705 the other skeletons.
2706 (b4_user_post_prologue): Add. Don't silently drop.
2708 (parse): Inline yylex.
2709 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
2710 (%{...%}): Fix typo of %code imports.
2711 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
2713 Support annotations on parser class with %define annotations.
2714 * data/lalr1.java (annotations): Add to parser class modifier.
2715 * doc/bison.texinfo (Java Parser Interface): Document
2716 %define annotations.
2717 (Java Declarations Summary): Document %define annotations.
2718 * tests/java.at (Java parser class modifiers): Test annotations.
2720 Do not generate code for %error-verbose unless requested.
2721 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
2722 Make private. Make conditional on %error-verbose.
2723 (getErrorVerbose, setErrorVerbose): New.
2724 (yytnamerr_): Make conditional on %error-verbose.
2725 (yysyntax_error): Make some code conditional on %error-verbose.
2726 * doc/bison.texinfo (Java Bison Interface): Remove the parts
2727 about %error-verbose having no effect.
2728 (getErrorVerbose, setErrorVerbose): Document.
2730 Move constants for token names to Lexer interface.
2731 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
2732 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
2733 (parse): Qualify EOF to Lexer.EOF.
2734 * doc/bison.texinfo (Java Parser Interface): Move documentation of
2735 EOF and token names to Java Lexer Interface.
2736 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
2738 Make yyerror public.
2739 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
2740 (yyerror): Change to public. Add Javadoc comments. Use longer
2741 parameter names. Make the body rather than the declarator
2742 conditional on %locations.
2743 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
2745 Allow user to add code to the constructor with %code init.
2746 * data/java.m4 (b4_init_throws): New, for %define init_throws.
2747 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
2748 Add %code init to the front of the constructor body.
2749 * doc/bison.texinfo (YYParser.YYParser): Document %code init
2750 and %define init_throws.
2751 (Java Declarations Summary): Document %code init and
2752 %define init_throws.
2753 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
2754 (Java constructor init and init_throws): Add tests.
2756 2008-11-10 Akim Demaille <demaille@gostai.com>
2759 * TODO (-D): is implemented.
2760 (associativity): Same precedence must have the same associativity.
2761 For instance, how can a * b / c be parsed if * is %left and / is
2763 (YYERRORCODE, YYFAIL, YYBACKUP): New.
2765 2008-11-10 Akim Demaille <demaille@gostai.com>
2769 2008-11-10 Akim Demaille <demaille@gostai.com>
2771 More information about the symbols.
2772 * src/output.c (type_names_output): Document all the symbols,
2773 including those that don't have a type-name.
2774 (symbol_definitions_output): Define "is_token" and
2776 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
2777 type-name, now that they are defined too in b4_type_names.
2779 2008-11-10 Akim Demaille <demaille@gostai.com>
2783 2008-11-10 Akim Demaille <demaille@gostai.com>
2785 Make parser::yytranslate static.
2786 Small speedup (1%) on the list grammar. And makes yytranslate_
2787 available in non member functions.
2789 * data/lalr1.cc (yytranslate_): Does not need to be a instance
2792 2008-11-10 Akim Demaille <demaille@gostai.com>
2794 Avoid trailing spaces.
2795 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
2796 * data/lalr1.cc: Don't indent before rule and symbol actions, as
2797 they can be empty, and anyway this incorrectly indents the first
2800 2008-11-10 Akim Demaille <demaille@gostai.com>
2804 2008-11-10 Akim Demaille <demaille@gostai.com>
2806 Use "enum" for integral constants.
2807 This is just nicer to read, I observed no speedup.
2809 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
2810 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
2811 (yyuser_token_number_max_, yyundef_token_): Move into...
2812 (yytranslate_): here.
2814 2008-11-10 Akim Demaille <demaille@gostai.com>
2816 Shortcuts in bench directives.
2817 * etc/bench.pl.in (parse_dirs): New.
2819 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
2820 Create the benches in "benches/".
2822 2008-11-10 Akim Demaille <demaille@gostai.com>
2825 * data/lalr1.cc: here.
2827 2008-11-10 Akim Demaille <demaille@gostai.com>
2829 Adjust verbose message to using emacs.
2830 * etc/bench.pl.in: Inform compilation-mode when we change the
2832 (generate_grammar_list): Recognize %define "variant" in addition
2835 2008-11-10 Akim Demaille <demaille@gostai.com>
2837 Classify symbols by type-name.
2838 * src/uniqstr.h (UNIQSTR_CMP): New.
2839 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
2840 (type_names_output): New.
2841 (muscles_output): Use it.
2842 * data/lalr1.cc (b4_symbol_action_): Remove.
2843 (b4_symbol_case_, b4_type_action_): New.
2844 Adjust uses of b4_symbol_action_ to use b4_type_action_.
2846 2008-11-10 Akim Demaille <demaille@gostai.com>
2848 Change the handling of the symbols in the skeletons.
2849 Before we were using tables which lines were the symbols and which
2850 columns were things like number, tag, type-name etc. It is was
2851 difficult to extend: each time a column was added, all the numbers had
2852 to be updated (you asked for colon $2, not for "tag"). Also, it was
2853 hard to filter these tables when only a subset of the symbols (say the
2854 tokens, or the nterms, or the tokens that have and external number
2855 *and* a type-name) was of interest.
2857 Now instead of monolithic tables, we define one macro per cell. For
2858 instance "b4_symbol(0, tag)" is a macro name which contents is
2859 self-decriptive. The macro "b4_symbol" provides easier access to
2862 * src/output.c (type_names_output): Remove.
2863 (symbol_numbers_output, symbol_definitions_output): New.
2864 (muscles_output): Call them.
2865 (prepare_symbols): Define b4_symbols_number.
2867 2008-11-10 Akim Demaille <demaille@gostai.com>
2870 * src/getargs.h, src/getargs.c (trace_muscle): New.
2871 (trace_types, trace_args): Support it.
2872 * src/output.c (output_skeleton): Use it.
2874 2008-11-10 Akim Demaille <demaille@gostai.com>
2877 * src/output.c (muscles_output): New, extracted from...
2878 (output_skeleton): here.
2881 2008-11-10 Akim Demaille <demaille@gostai.com>
2885 2008-11-10 Akim Demaille <demaille@gostai.com>
2887 Update the variant example.
2888 * examples/variant.yy: Formatting changes.
2891 2008-11-10 Akim Demaille <demaille@gostai.com>
2893 Support constructor with an argument.
2894 This improves the "list" bench by 2%.
2896 * data/lalr1.cc (variant::build): Add an overloaded version with
2898 * tests/c++.at (AT_CHECK_VARIANT): Check it.
2900 2008-11-10 Akim Demaille <demaille@gostai.com>
2903 * tests/c++.at (AT_CHECK_VARIANTS): New.
2904 Use it with and without %define assert.
2906 2008-11-10 Akim Demaille <demaille@gostai.com>
2908 Add %precedence support.
2909 Unfortunately it is not possible to reuse the %prec directive. This
2910 is because to please POSIX, we do not require to end the rules with a
2911 semicolon. As a result,
2915 is ambiguous: either a rule which precedence is that of baz, or a rule,
2916 and then a declaration of the precedence of the token baz.
2918 * doc/bison.texinfo: Document %precedence.
2919 (Precedence Only): New.
2920 * src/assoc.h, src/assoc.c (precedence_assoc): New.
2921 * src/conflicts.c (resolve_sr_conflict): Support it.
2922 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
2924 * tests/calc.at: Use %precedence for NEG.
2925 * tests/conflicts.at (%precedence does not suffice)
2926 (%precedence suffices): New tests.
2928 2008-11-09 Akim Demaille <demaille@gostai.com>
2930 Make benches in a sub dirs.
2931 * etc/bench.pl.in ($dir): New.
2933 Check the use of constructors with an argument.
2934 (bench_variant_parser): Fix.
2936 2008-11-09 Akim Demaille <demaille@gostai.com>
2940 2008-11-09 Akim Demaille <demaille@gostai.com>
2944 2008-11-09 Akim Demaille <demaille@gostai.com>
2946 Require the generation of parse-gram.output.
2947 * src/Makefile.am (YACC): Pass --report=all.
2949 2008-11-09 Akim Demaille <demaille@gostai.com>
2953 2008-11-09 Akim Demaille <demaille@gostai.com>
2956 * TODO: Remove obsolete items.
2959 2008-11-09 Akim Demaille <demaille@gostai.com>
2962 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
2963 (@token, $grammar, $bench): New.
2964 (generate_grammar_variant): Rename as...
2965 (generate_grammar_list): this.
2966 (generate_grammar): Adjust.
2967 (bench_grammar): Rename as...
2969 Use it in the various bench-marking routines.
2970 (-b, -g): New options.
2972 2008-11-09 Akim Demaille <demaille@gostai.com>
2974 Use a static hierarchy for symbols in the C++ parser.
2975 * data/lalr1.cc (symbol_base_type, symbol_type)
2976 (stack_symbol_type): Make it a static hierarchy.
2977 Adjust dependencies.
2979 2008-11-09 Akim Demaille <demaille@gostai.com>
2981 bench.pl -d, --directive.
2982 * etc/bench.pl.in (@directive): New.
2983 (&bench_grammar): Use it.
2984 (&bench_list_grammar): New, to provide access to the "variant"
2987 (getopts): Support -d, --directive.
2989 2008-11-09 Akim Demaille <demaille@gostai.com>
2991 Use inline for small operations.
2992 * data/lalr1.cc (symbol_base_type, symbol_type)
2993 (stack_symbol_type): Declare constructor and other operations as
2995 (yy_destroy_): Inline.
2997 2008-11-09 Akim Demaille <demaille@gostai.com>
2999 Introduce a hierarchy for symbols.
3000 * data/lalr1.cc (symbol_base_type, symbol_type): New.
3001 (data_type): Rename as...
3002 (stack_symbol_type): this.
3003 Derive from symbol_base_type.
3004 (yy_symbol_value_print_): Merge into...
3005 (yy_symbol_print_): this.
3008 (yydestruct_): Rename as...
3009 (yy_destroy_): this.
3010 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
3011 (parser::parse): yyla is now of symbol_type.
3012 Use its type member instead of yytoken.
3014 2008-11-09 Akim Demaille <demaille@gostai.com>
3016 Rename data_type and stack_symbol_type.
3017 * data/lalr1.cc (data_type): Rename as...
3018 (stack_symbol_type): this.
3020 2008-11-09 Akim Demaille <demaille@gostai.com>
3022 Handle semantic value and location together.
3023 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
3024 yydata.value and yydata.location.
3025 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
3026 (YY_SYMBOL_PRINT): Now take semantic value and location as a
3029 (yydestruct_): New overload for a stack symbol.
3031 2008-11-09 Akim Demaille <demaille@gostai.com>
3033 Push a complete symbol, not connected parts.
3034 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
3035 state, value and location.
3038 2008-11-09 Akim Demaille <demaille@gostai.com>
3040 Agregate yylval and yylloc.
3041 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
3042 (parser::yyla): this.
3044 2008-11-09 Akim Demaille <demaille@gostai.com>
3046 Rely on the state stack to display reduction traces.
3047 To display rhs symbols before a reduction, we used information
3048 about the rule reduced, which required the tables yyrhs and
3049 yyprhs. Now use rely only on the state stack to get the same
3052 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
3054 (parser::yyrhs_, parser::yyprhs_): Remove.
3055 (parser::yy_reduce_print_): Use the state stack.
3057 2008-11-09 Akim Demaille <demaille@gostai.com>
3059 Fuse yyval and yyloc into yylhs.
3060 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
3062 (parse): Replace yyval and yyloc with yylhs.value and
3064 After a user action, compute yylhs.state earlier.
3065 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
3068 2008-11-09 Di-an Jan <dianj@freeshell.org>
3070 Remove unused variable.
3071 * src/output.c (type_names_output): Remove unused variable sep.
3073 2008-11-09 Paolo Bonzini <bonzini@gnu.org>
3075 Change tests/output.at quoting.
3076 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
3077 expanding arguments.
3079 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3081 Don't add a semicolon to actions for %skeleton or %language.
3082 It breaks Java test cases as reported by Akim Demaille.
3083 * src/scan-code.l: Implement.
3085 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3087 Clean up %skeleton and %language priority implementation.
3088 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
3089 remove static qualifier because others will soon need to see it.
3090 (language_prio): Likewise.
3091 (getargs): Use command_line_prio rather than 0.
3092 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
3094 (skeleton_prio): Extern it.
3095 (language_prio): Extern it.
3096 * src/parse-gram.y: Use grammar_prio rather than 1.
3098 2008-11-07 Akim Demaille <demaille@gostai.com>
3100 Moving push traces into yypush_.
3101 * data/lalr1.cc (yypush_): Now takes a optional trace message.
3104 2008-11-07 Akim Demaille <demaille@gostai.com>
3106 The single-stack C++ parser is now the standard one.
3107 * data/lalr1.cc: Rename as...
3108 * data/lalr1-split.cc: this.
3109 * data/lalr1-fusion.cc: Rename as...
3110 * data/lalr1.cc: this.
3111 * etc/bench.pl.in: Adjust.
3113 2008-11-07 Akim Demaille <demaille@gostai.com>
3115 Avoid empty-if warnings.
3116 Reported by Quentin Hocquet.
3118 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
3119 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
3121 2008-11-07 Akim Demaille <demaille@gostai.com>
3123 Pass command line location to skeleton_arg and language_argmatch.
3124 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
3125 The location argument is now mandatory.
3126 Adjust all dependencies.
3127 (getargs): Use command_line_location.
3129 2008-11-07 Akim Demaille <demaille@gostai.com>
3132 * src/getargs.c (usage): Document -D.
3133 Fix help string for --locations.
3134 (command_line_location): New.
3135 (short_options, long_options, getargs): Support -D, --define.
3136 (getargs): Move -d support at the right place.
3137 * doc/bison.texinfo (Bison Options): Update.
3138 * tests/input.at (%define, --define): New.
3140 2008-11-07 Akim Demaille <demaille@gostai.com>
3142 Initialize the muscle table before parsing the command line.
3143 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
3144 (getargs): Define file_name.
3145 * src/main.c (main): Initialize muscle_tab before calling
3147 * src/muscle_tab.c (muscle_init): No longer define file_name, as
3148 its value is not available yet.
3150 2008-11-07 Akim Demaille <demaille@gostai.com>
3152 Locations without columns for command line arguments.
3153 * src/location.c (location_print): Don't display negative columns.
3154 * src/location.h: Document this.
3156 2008-11-07 Akim Demaille <demaille@gostai.com>
3159 * src/getargs.c (usage): Fix help string for -W.
3161 2008-11-07 Akim Demaille <demaille@gostai.com>
3163 Handle more general types of option arguments.
3164 * build-aux/cross-options.pl: The argument ends at the first
3165 space, not the first non-symbol character.
3166 Use @var for each word appearing the argument description.
3168 2008-11-07 Akim Demaille <demaille@gostai.com>
3170 Destroy the variants that remain on the stack in case of error.
3171 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
3173 Display the value only if yymsg is nonnull.
3174 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
3176 2008-11-07 Akim Demaille <demaille@gostai.com>
3178 Add "%define assert" to variants.
3179 This is used to help the user catch cases where some value gets
3180 ovewritten by a new one. This should not happen, as this will
3183 Unfortunately this uncovered a bug in the C++ parser itself: the
3184 lookahead value was not destroyed between two calls to yylex. For
3185 instance if the previous lookahead was a std::string, and then an int,
3186 then the value of the std::string was correctly taken (i.e., the
3187 lookahead was now an empty string), but std::string structure itself
3190 This is now done in variant::build(other&) (which is used to take the
3191 value of the lookahead): other is not only stolen from its value, it
3192 is also destroyed. This incurs a new performance penalty of a few
3193 percent, and union becomes faster again.
3195 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
3196 (b4_variant_if): New.
3197 (variant::built): New.
3198 Use it whereever the status of the variant changes.
3199 * etc/bench.pl.in: Check the penalty of %define assert.
3201 2008-11-07 Akim Demaille <demaille@gostai.com>
3203 Use "%define variant" in bench.pl.
3204 * etc/bench.pl.in: No longer use the pseudo directive %variants,
3205 just use %define variants.
3207 2008-11-07 Akim Demaille <demaille@gostai.com>
3210 * src/parse-gram.h, src/parse-gram.c: Regen.
3212 2008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
3214 Fix user actions without a trailing semicolon.
3215 Reported by Sergei Steshenko at
3216 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
3217 * THANKS (Sergei Steshenko): Add.
3218 * src/scan-code.l (SC_RULE_ACTION): Fix it.
3219 * tests/regression.at (Fix user actions without a trailing semicolon):
3222 2008-11-04 Akim Demaille <demaille@gostai.com>
3224 Use b4_copyright_years.
3225 * data/yacc.c (b4_copyright_years): New.
3226 Fix its value according to the comments in the file.
3227 Use it and undefine it.
3229 2008-11-04 Akim Demaille <demaille@gostai.com>
3232 * data/lalr1-fusion.cc, src/parse-gram.y: here.
3234 2008-11-04 Akim Demaille <demaille@gostai.com>
3237 * data/lalr1-fusion.cc: here.
3239 2008-11-04 Akim Demaille <demaille@gostai.com>
3241 Use strict on bench.pl.
3242 * etc/bench.pl.in (&run, &generate_grammar): New.
3243 Rename the grammar generating functions for consistency.
3244 Change the interface so that the list of benches to run is passed
3245 as (optionless) arguments.
3246 (&compile): Use &run.
3248 2008-11-04 Akim Demaille <demaille@gostai.com>
3250 Remove spurious initial empty lines.
3251 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
3252 * data/yacc.c: End the @output lines with an @.
3254 2008-11-04 Akim Demaille <demaille@gostai.com>
3256 Improve the display of sizes.
3257 * etc/bench.p.in: Higher precision.
3258 Sort by decreasing size.
3260 2008-11-04 Akim Demaille <demaille@gostai.com>
3262 Don't memcpy C++ structures.
3263 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
3265 (variant::build): New overload for
3266 copy-construction-that-destroys.
3267 (variant::swap): New.
3268 (parser::yypush_): Use it in variant mode.
3270 2008-11-04 Akim Demaille <demaille@gostai.com>
3272 Better defaults for bench.pl.
3273 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
3275 Adjust &verbose uses.
3278 2008-11-04 Akim Demaille <demaille@gostai.com>
3280 Make variant.yy more complex.
3281 std::list cannot be copied via memcpy, they are more demanding than
3282 std::string. Use one std::list to strengthen the test.
3284 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
3286 Create a list of strings, instead of a single large string.
3288 2008-11-04 Akim Demaille <demaille@gostai.com>
3291 * etc/bench.pl.in (--bench, $bench): New.
3293 2008-11-04 Akim Demaille <demaille@gostai.com>
3296 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
3297 Define it after as().
3299 2008-11-04 Akim Demaille <demaille@gostai.com>
3302 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
3304 2008-11-04 Akim Demaille <demaille@gostai.com>
3306 Issue missing synclines after user actions.
3307 * data/c.m4 (b4_case): Issue synclines on the output file.
3309 2008-11-04 Akim Demaille <demaille@gostai.com>
3311 Remove trailing empty line.
3312 * data/lalr1-fusion.cc: Don't add an empty line after the user's
3315 2008-11-04 Akim Demaille <demaille@gostai.com>
3317 Fix output of copyright years.
3318 * data/bison.m4 (b4_copyright): Fix the indentation of the
3319 copyright year paragraph.
3320 Use b4_copyright_years when no years are given.
3321 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
3322 (b4_copyright_years): New.
3325 2008-11-04 Akim Demaille <demaille@gostai.com>
3327 Avoid the spurious initial empty line.
3328 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
3329 the end of @output request to suppress the empty line that
3332 2008-11-04 Akim Demaille <demaille@gostai.com>
3334 Remove parser::rhs_number_type.
3335 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
3336 (yyrhs_): Use b4_table_define.
3338 2008-11-04 Akim Demaille <demaille@gostai.com>
3341 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
3343 2008-11-04 Akim Demaille <demaille@gostai.com>
3345 Factor the declaration of the integer tables.
3346 * data/lalr1-fusion.cc (b4_table_define): New.
3349 2008-11-03 Akim Demaille <demaille@gostai.com>
3351 Fix indentation of tables in lalr1.cc
3352 * data/lalr1-fusion.cc: Fix the indentation.
3354 2008-11-03 Akim Demaille <demaille@gostai.com>
3356 Destroy the lhs symbols after reduction.
3357 * data/lalr1-fusion.cc (parse): After the user action, when in
3358 variant mode, destroy the lhs symbols.
3360 2008-11-03 Akim Demaille <demaille@gostai.com>
3362 Simplify yysyntax_error_ use.
3363 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
3364 type, but make it unnamed in the declaration when it is not used.
3366 2008-11-03 Akim Demaille <demaille@gostai.com>
3368 Let yy::variant::build return an lvalue.
3369 * data/lalr1-fusion.cc (variant::build): Return a reference to the
3372 2008-11-03 Akim Demaille <demaille@gostai.com>
3374 Define yy::variant only when needed.
3375 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
3378 2008-11-03 Akim Demaille <demaille@gostai.com>
3380 Bench the three-stack lalr1.cc.
3381 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
3384 2008-11-03 Akim Demaille <demaille@gostai.com>
3386 Fail on parse error in calc++.
3387 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
3389 * examples/calc++/test ($me, $number, $exit, run): New.
3390 Use them to propagate errors to the exit status.
3392 2008-11-03 Akim Demaille <demaille@gostai.com>
3394 Don't specify the skeleton twice in the example.
3395 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
3396 file does what is needed.
3398 2008-11-03 Akim Demaille <demaille@gostai.com>
3400 bench: Improve output.
3401 * etc/bench.pl.in (bench_grammar): Tune the printf format.
3403 2008-11-03 Akim Demaille <demaille@gostai.com>
3405 bench: check impact of %debug on variants.
3406 * etc/bench.pl.in (variant_grammar): Fix the computation of
3408 Generate a grammar file that can work with or without %debug.
3409 Do use the @directive.
3410 (bench_variant_parser): Check impact of %debug.
3411 (@directives): Rename all the occurrences to...
3412 (@directive): this, for consistency.
3414 2008-11-03 Akim Demaille <demaille@gostai.com>
3416 bench: report the size too.
3417 * etc/bench.pl.in ($iterations): Defaults to -3.
3418 (&bench_grammar): Require hireswallclock.
3419 Compute and display the size of the result.
3422 2008-11-03 Akim Demaille <demaille@gostai.com>
3424 bench: More use of the verbosity level.
3425 * etc/bench.pl.in ($verbose, &verbose): New.
3427 More POD documentation.
3429 2008-11-03 Akim Demaille <demaille@gostai.com>
3431 bench.pl: a command line interface
3432 * etc/bench.pl.in: More doc.
3433 Some fixes in the documentation.
3434 ($cflags, $iterations, &help, &getopt): New.
3436 (&variant_grammar): Let the number of stages be 10 times what is
3439 2008-11-03 Akim Demaille <demaille@gostai.com>
3441 Bench the use of Boost.Variants.
3442 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
3444 (&compile): Be ready to compile C++ parsers.
3445 (&bench_push_parser): Move debug information to the outermost
3447 * THANKS: Add Michiel De Wilde.
3449 2008-11-03 Akim Demaille <demaille@gostai.com>
3451 bench.pl: Pass directives as a list instead of as a string.
3452 * etc/bench.pl.in (&directives): New.
3453 (&triangular_grammar, &calc_grammar): Use it to format the Bison
3455 (&triangular_grammar): Do use the directives (were ignored).
3456 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
3459 2008-11-03 Akim Demaille <demaille@gostai.com>
3461 Improve genericity of bench.pl.
3462 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
3464 (&bench_push_parser): New.
3467 2008-11-03 Akim Demaille <demaille@gostai.com>
3469 Add documentation to bench.pl.
3470 * etc/bench.pl.in: Comment changes.
3472 2008-11-03 Akim Demaille <demaille@gostai.com>
3474 Fuse the three stacks into a single one.
3476 In order to make it easy to perform benchmarks to ensure that
3477 there are no performance loss, lalr1.cc is forked into
3478 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
3481 Meanwhile, to make sure that lalr1-fusion.cc is correctly
3482 exercized by the test suite, the user must install a symbolic link
3483 from lalr1.cc to it.
3485 Instead of having three stacks (state, value, location), use a
3486 stack of triples. This considerably simplifies the code (and it
3487 will be easier not to require locations as currently does the C++
3488 parser), and also gives a 10% speedup according to
3489 etc/bench (probably mainly since memory allocation is done once
3490 instead of three times).
3492 Another motivation is to make it easier to destruct properly
3493 semantic values: now that they are bound to their state (hence
3494 symbol type) it will be easier to call the appropriate destructor.
3496 These changes should probably benefit the C parser too.
3498 * data/lalr1.cc: Copy as...
3499 * data/lalr1-fusion.cc: this new file.
3500 (b4_rhs_value, b4_rhs_location): New definitions overriding those
3502 (state_stack_type, semantic_stack_type, location_stack_type)
3503 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
3504 (data_type, stack_type, yystack_): New.
3505 (YYLLOC_DEFAULT, yypush_): Adjust.
3506 (yyerror_range): Now based on data_type, not location_type.
3508 2008-11-03 Akim Demaille <demaille@gostai.com>
3510 Push the state, value, and location at the same time.
3511 This is needed to prepare a forthcoming patch that fuses the three
3514 * data/lalr1.cc (parser::yypush_): New.
3515 (parser::yynewstate): Change the semantics: instead of arriving to
3516 this label when value and location have been pushed, but yystate
3517 is to be pushed on the state stack, now the three of them must
3518 have been pushed before. yystate still must be the new state.
3519 This allows to use yypush_ everywhere instead of individual
3520 handling of the stacks.
3522 2008-11-03 Akim Demaille <demaille@gostai.com>
3524 Prefer references to pointers.
3525 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
3526 definition to use references instead of pointers.
3527 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
3528 Take the value and location as references.
3531 2008-11-03 Akim Demaille <demaille@gostai.com>
3533 stack::size instead of stack::height.
3534 * data/lalr1.cc (stack::height): Rename as...
3535 (stack::size): this.
3536 Fix the output type.
3539 2008-11-03 Akim Demaille <demaille@gostai.com>
3541 Use variants to support objects as semantic values.
3542 This patch was inspired by work by Michiel De Wilde. But he used
3543 Boost variants which (i) requires Boost on the user side, (ii) is
3544 slow, and (iii) has useless overhead (the parser knows the type of
3545 the semantic value there is no reason to duplicate this
3546 information as Boost.Variants do).
3548 This implementation reserves a buffer large enough to store the
3549 largest objects. yy::variant implements this buffer. It was
3550 implemented with Quentin Hocquet.
3552 * src/output.c (type_names_output): New.
3553 (output_skeleton): Invoke it.
3554 * data/c++.m4 (b4_variant_if): New.
3555 (b4_symbol_value): If needed, provide a definition for variants.
3556 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
3557 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
3558 (b4_char_sizeof, yy::variant): New.
3559 (parser::parse): If variants are requested, define
3560 parser::union_type, parser::variant, change the definition of
3561 semantic_type, construct $$ before running the user action instead
3562 of performing a default $$ = $1.
3563 * examples/variant.yy: New.
3564 Based on an example by Michiel De Wilde.
3566 2008-11-03 Akim Demaille <demaille@gostai.com>
3568 Parameterize the extraction of semantic values.
3569 To make future changes easier, no longer rely on ".TYPE" being the
3570 way to get a semantic value.
3572 * data/c.m4 (b4_symbol_value): New.
3574 * data/c++.m4, data/yacc.c: Use it.
3575 * data/glr.c: Use b4_symbol_value.
3579 2008-11-03 Akim Demaille <demaille@gostai.com>
3581 Prepare easier M4 changes.
3582 * data/lalr1.cc: Use escaped [] instead of literals to prepare
3585 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3587 Initiate further development.
3588 * NEWS: Create an empty section for new entries.
3589 * gnulib: Update submodule to HEAD.
3591 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3593 * NEWS: Version 2.4.
3595 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3597 Prepare for next release.
3598 * NEWS: Briefly mention changes since 2.3b.
3599 * README: Say GNU m4 1.4.6, which we've been requiring in release
3600 announcements already, not 1.4.3, which breaks the build.
3602 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3604 Say %language is experimental.
3605 We're thinking of extending it's effect on output file naming. See the
3607 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
3608 * NEWS: Say it's experimental.
3609 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
3610 recommend it over %skeleton for now.
3611 (Bison Options): Likewise.
3612 (C++ Bison Interface): Use %skeleton not %language.
3613 (Calc++ Parser): Use %skeleton not %language.
3614 * src/getargs.c (usage): Say it's experimental.
3616 2008-11-01 Di-an Jan <dianj@freeshell.org>
3617 Paolo Bonzini <bonzini@gnu.org>
3619 Support all Java parser class modifiers.
3620 * data/java.m4 (b4_percent_define_get3): New.
3621 (b4_final_if, b4_strictfp_if): New.
3622 * data/lalr1.java (final, strictfp, extends, implements): Support.
3623 * doc/bison.texinfo (final, strictfp, extends, implements): Add
3625 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
3626 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
3627 (AT_CHECK_JAVA_GREP): New.
3628 (Java parser class modifiers): New test.
3629 (Java parser class extends and implements): New test.
3631 Model exception propagation better with throws and lex_throws.
3632 * data/java.m4 (b4_list2): New.
3633 (throws): Change default.
3634 * data/lalr1.java (yyaction): Add throws.
3635 (parse): Add lex_throws in addition to throws.
3636 * doc/bison.texinfo (throws, lex_throws): Add documentation.
3637 * tests/java.at (Java throws specifications): New test.
3639 Improve documentation for Java parsers.
3640 * doc/bison.texinfo (Java Parsers): Add subsections.
3641 Don't quote first argument of %define.
3642 (Java Bison Interface): Document output files. Move documentation
3643 of parser class and merge into Java Parser Interface. Document
3644 features that error out. Document directives with no effect.
3645 Move note about Javadoc higher.
3646 (Java Semantic Values): Explicitly mention stype.
3647 Document that generic types cannot be used.
3648 (Java Location Values): Use @deftypeivar. Document constructors.
3649 Correct return value for toString.
3650 (Java Parser Interface): List undocumented constants/fields.
3651 Move documentation of fields added by %parse-param closer to list
3652 of members. Document that token names are added as fields.
3653 Document constructors accurately. Remove error method.
3654 (Java Scanner Interface): Move note on %pure-parser to Java Bison
3655 Interface. Describe %code lexer and yylex accutately.
3656 Remove documentation that does not match the code.
3657 (Java Action Features): New.
3658 (Java Differences): Add reference. Add item on semantic values.
3659 Add note about @{ ... @}. Clarify %% epilogue placement.
3660 (Java Declarations Summary): New.
3663 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
3664 (b4_remove_comma): Quote test argument.
3665 (b4_identification): Remove "bison" field.
3666 * tests/java.at (Java parser class and package names): New test.
3667 (Java %parse-param and %lex-param): New test.
3668 (Java stype, position_class and location_class): New test.
3670 2008-10-31 Di-an Jan <dianj@freeshell.org>
3672 * data/lalr1.jave: Update copyright years.
3673 (YYParser): Correct name of "generated from" file in Javadoc:
3674 use b4_file_name instead of @ofile@.
3675 (Location constructor): Correct Javadoc parameter name.
3676 (yylloc): Add missing opening m4 quote after b4_location_if.
3677 This removes a stray [ in the Javadoc of Lexer.getStartPos.
3678 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
3679 (YYParser constructor): Correct Javadoc parameter name.
3681 2008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
3683 Always put auxiliary code files in the same dir as other output files.
3684 * src/files.c (compute_file_name_parts): When the user specifies
3685 --output but not --file-prefix, extract the directory prefix from the
3686 file prefix not from the grammar file name. This affects the location
3687 of files like location.hh generated by the C++ skeleton. The includes
3688 in the other output files require this fix.
3689 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
3690 for expected output files.
3691 (Output files): Add a test for the above.
3693 2008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
3695 * gnulib: Update submodule to HEAD.
3697 2008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3699 Update copyright year.
3700 * src/files.c: Here.
3702 2008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
3704 Don't overwrite the input file.
3705 * src/files.c (output_file_name_check): Fatal error if using input file
3707 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
3709 (Conflicting output files): Add test.
3711 2008-10-28 Akim Demaille <demaille@gostai.com>
3714 * data/lalr1.cc: Formatting changes.
3716 2008-10-28 Akim Demaille <demaille@gostai.com>
3718 Don't define debugging functions when !YYDEBUG.
3719 * data/lalr1.cc (debug_stream, set_debug_stream)
3720 (debug_level_type, debug_level, set_debug_level): Don't
3721 declare them when YYDEBUG is not defined.
3722 The implementation are already YYDEBUG-aware.
3724 2008-10-28 Akim Demaille <demaille@gostai.com>
3726 Prefer "continue" for empty loop bodies.
3727 * etc/bench.pl.in: Use "continue" instead of {}.
3729 2008-10-28 Akim Demaille <demaille@gostai.com>
3731 Space and comments changes.
3732 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
3733 * data/c.m4, data/lalr1.cc: Space changes.
3735 2008-10-28 Akim Demaille <demaille@gostai.com>
3737 Make gnulib a submodule.
3739 * .gitmodules (gnulib): New.
3741 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
3743 Fix yyerror_range for user-defined location type in C++. Reported by
3745 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
3746 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
3747 * THANKS (Georg Sauthoff): Add.
3749 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
3751 Update several administrative files mainly to facilitate releasing.
3752 * HACKING (Administrivia): Make the git-merge-changelog notes more
3754 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
3755 (Release Procedure): Update for git and add numerous details that were
3757 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
3758 * maint.mk (announcement): Don't list bison as a bootstrap tool so
3759 that announcements don't claim we bootstrapped with whatever bison
3760 happened to be in PATH. Add flex as a bootstrap tool.
3761 * Makefile.maint: Remove, previously replaced by maint.mk.
3762 * Makefile.cfg: Remove, and migrate settings to...
3763 * cfg.mk: ... here for the sake of `make announcement'.
3764 * bootstrap.conf (gnulib_modules): Add announce-gen.
3765 * README: Say GNU Bison instead of just Bison. Suggested by Karl
3768 2008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
3770 Small but important bugfixes for the Java skeleton.
3771 * data/lalr1.java (yyerror): Change Location to b4_location_type.
3772 (yy_symbol_print): Call toString on yyvaluep.
3774 2008-08-29 Akim Demaille <demaille@gostai.com>
3776 Clarify UPDATED use.
3777 * doc/bison.texinfo: It refers to the last edition of this file,
3778 not to the release date of Bison.
3779 Reported by Joel E. Denny.
3781 2008-08-29 Akim Demaille <demaille@gostai.com>
3783 * README: Update FAQ pointer.
3784 Reported by Joel E. Denny.
3786 2008-08-27 Eric Blake <ebb9@byu.net>
3788 Resync m4sugar from autoconf.
3789 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
3790 (m4_init): Adjust to latest m4.git changes.
3791 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
3793 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
3794 (_m4_list_cmp): Reduce side effects.
3796 2008-08-27 Akim Demaille <demaille@gostai.com>
3798 Check yyerrok in calc.at.
3799 * tests/calc.at (calc.y): Use yyerrok on "( error )".
3800 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
3803 2008-08-27 Akim Demaille <demaille@gostai.com>
3805 Support yyerrok in lalr1.cc.
3806 YYBACKUP is still to import back into lalr1.cc.
3807 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
3809 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
3811 For maintainer-check*, don't recompile for a $(VERSION) update.
3813 (_is-dist-target): Override the one in GNUmakefile.
3814 * Makefile.am (EXTRA_DIST): Add cfg.mk.
3816 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
3818 Update for recent change to gnulib.
3819 * src/parse-gram.y: Don't include strverscmp.h. It comes from
3822 2008-08-15 Eric Blake <ebb9@byu.net>
3824 Remaining m4sugar merge from autoconf.
3825 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
3826 * data/m4sugar/foreach.m4: New file, copied from autoconf.
3827 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
3828 * src/output.c (output_skeleton): Tell m4 how to find it.
3830 Partial m4sugar merge from autoconf: m4_map.
3831 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
3832 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
3833 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
3834 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
3836 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
3838 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
3841 2008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
3843 Keep .version and PACKAGE_VERSION in sync.
3844 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
3845 dependency, and add comments justifying this in more detail. Discussed
3847 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
3849 2008-08-06 Eric Blake <ebb9@byu.net>
3851 Partial m4sugar merge from autoconf: m4_shiftn.
3852 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
3853 (m4_shift2, m4_shift3): New macros.
3854 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
3855 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
3856 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
3857 * data/java.m4 (b4_remove_comma): Likewise.
3859 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
3860 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
3861 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
3862 (m4_init): Consolidate wrapped text into single m4_wrap.
3863 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
3866 2008-08-05 Eric Blake <ebb9@byu.net>
3868 Partial m4sugar merge from autoconf: builtins, version.m4.
3869 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
3870 (m4_prepend): Remove, as it is unused and inherently quadratic,
3871 whereas m4_append is linear in newer m4.
3872 (m4_mkstemp): New builtin.
3873 (m4_symbols): Make rename conditional.
3874 (m4_version_prereq): Ensure fatal error if used in bison, which
3875 intentionally lacks version.m4.
3877 Fix comments in m4sugar.
3878 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
3880 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3882 Update for recent .gitignore fix in Gnulib.
3883 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
3884 anchored .gitignore entries.
3886 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3888 Set gnu or gnits strictness.
3889 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
3890 development and gnits strictness for releases. Based on Eric Blake's
3892 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
3894 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
3896 * NEWS: Clarify documentation of %language.
3898 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
3900 Support usage of git-merge-changelog.
3901 * .gitattributes: New.
3902 * HACKING: Document usage of git-merge-changelog.
3903 * bootstrap: Install git-merge-changelog entries in .git/config
3906 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3908 Remove remaining dependence on CVS Id keyword.
3909 * ChangeLog: For the sake of people still using CVS, don't use dollars
3911 * data/xslt/bison.xsl: Remove Id from header comments, where it was
3913 * data/xslt/xml2dot.xsl: Likewise.
3914 * data/xslt/xml2text.xsl: Likewise.
3915 * data/xslt/xml2xhtml.xsl: Likewise.
3916 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
3917 * doc/Makefile.am (neutralize): Remove, no longer needed.
3918 (.x.1): Don't use neutralize.
3919 (edit): Don't substitute for ID.
3920 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
3922 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3924 Fix dependence on computed configure variables.
3925 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
3926 $(top_srcdir)/configure.ac so that changes to computed variables, such
3927 as PACKAGE_VERSION, are seen.
3928 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
3930 2008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
3932 Update copyright dates for recent changes.
3933 * Makefile.am: Here.
3934 * src/Makefile.am: Here.
3935 * src/reduce.c: Here.
3936 * tests/reduce.at: Here.
3938 2008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
3940 Use git-version-gen for version names between releases.
3941 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
3942 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
3943 * .prev-version: New.
3944 * .version.in: Remove.
3945 * ChangeLog: Remove the Id previously used for capturing the CVS
3947 * GNUmakefile: Remove, now copied from Gnulib.
3948 * Makefile.am: Add code suggested by comments in
3949 build-aux/git-version-gen.
3950 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
3951 .prev-version, and .version.
3952 * NEWS (2.3b+): Rename to...
3953 (?.?): ... this because we're dropping the "+" version naming scheme,
3954 but, in general, we still can't be sure of our next release name.
3955 * bootstrap: Add a quick hack to remove from .gitignore the
3956 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
3957 entry. This should really be fixed in gnulib instead.
3958 * bootstrap.conf (gnulib_modules): Add gnumakefile.
3959 * configure.ac (AC_INIT): Set version name by invoking
3960 build-aux/git-version-gen.
3961 (AC_CONFIG_FILES): Remove .version, now generated by
3962 build-aux/git-version-gen.
3963 * maint.mk: New, copied from coreutils.
3964 * doc/.cvsignore (bison.1): Add.
3965 * doc/.gitignore (/bison.1): Add.
3966 * doc/bison.1: Remove, generated.
3967 * src/.cvsignore (revision.c): Remove.
3968 * src/.gitignore (/revision.c): Remove.
3969 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
3970 (BUILT_SOURCES): Remove revision.c.
3971 (revision.c): Remove.
3972 * src/getargs.c (version): Don't print revision after the VERSION.
3973 * src/revision.h: Remove.
3975 2008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
3977 Fix untranslatable composition of sentences. Reported by Goran
3979 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
3980 * THANKS (Goran Uddeborg): Add.
3981 * src/reduce.c (reduce_print): Report the number of nonterminals and
3982 rules useless in the grammar in separate sentences.
3983 * tests/reduce.at (Useless Rules): Update output.
3984 (Reduced Automaton): Likewise.
3985 (Underivable Rules): Likewise.
3986 (Empty Language): Likewise.
3988 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3990 Fix some .gitignore and .cvsignore problems.
3991 * bootstrap (insert_sorted_if_absent): Replace all uses with...
3992 (insert_vc_ignore): ... this new function, which prepends `/' to all
3993 .gitignore entries before passing them to insert_sorted_if_absent.
3994 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
3995 .cvsignore files are maintained even though Bison developers run
3996 bootstrap while using Git.
3997 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
4000 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
4001 unneeded. Reported by Eric Blake.
4002 * lib/.gitignore (/*~): Add.
4003 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
4004 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
4006 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
4008 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4010 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
4011 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
4012 * bootstrap.conf (gnulib_modules): Add unsetenv.
4013 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
4014 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
4016 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
4017 the first argument because it may become position-dependent, and unset
4018 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
4019 Add comments explaining these issues in more detail.
4021 2008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
4023 Add .gitignore everywhere based on .cvsignore.
4025 * build-aux/.gitignore: New.
4026 * data/.gitignore: New.
4027 * doc/.gitignore: New.
4028 * etc/.gitignore: New.
4029 * examples/.gitignore: New.
4030 * examples/calc++/.gitignore: New.
4031 * lib/.gitignore: New.
4032 * m4/.gitignore: New.
4033 * po/.gitignore: New.
4034 * runtime-po/.gitignore: New.
4035 * src/.gitignore: New.
4036 * tests/.gitignore: New.
4038 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4040 * NEWS (2.3b+): New section, empty for now.
4041 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
4043 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4045 * NEWS (2.3b): Update release date since there has been a delay in
4046 getting the announcements and tarballs out.
4048 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
4050 * NEWS: Version 2.3b.
4051 * configure.ac (AC_INIT): Likewise.
4052 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
4054 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
4056 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
4057 been doing it for years.
4058 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
4059 (Release Procedure): Add FIXME about make alpha being unmaintained.
4061 2008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
4063 * data/yacc.c: Reformat m4 a little for readability.
4064 * src/lalr.c (build_relations): Correct comment.
4066 2008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4068 DJGPP specific issue.
4069 * djgpp/config.sed: Fixes required to run configure scripts generated
4072 2008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4074 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
4075 coordinator@translationproject.org.
4077 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4079 * THANKS: Add Eric Blake.
4081 2008-04-23 Eric Blake <ebb9@byu.net>
4083 Revert prior patch, by working around autoconf regression.
4084 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
4085 ("Output file name: ("): Uncomment test.
4086 ("Output file name: )"): Likewise.
4087 Based on an idea from Noah Misch.
4089 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4091 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
4092 2.61. Reported by Juan Manuel Guerrero at
4093 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
4094 * tests/output.at ("Output file name: ("): Comment out test case for
4096 ("Output file name: )"): Likewise.
4098 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4100 * GNUmakefile: Update git-version-gen invocation so make dist
4103 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4105 Update to the current gnulib CVS repository, and fix trigraph handling
4107 * bootstrap: Update gnulib CVS repository URL.
4108 (symlink_to_dir): Encapsulate the code that guarantees the destination
4109 directory exists into...
4110 (check_dst_dir): ... this new function, and...
4111 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
4112 fail when copying files into lib/uniwidth/.
4113 * src/output.c (prepare_symbols): When writing yytname muscles, where
4114 symbol names will be encoded in C-string literals, tell quotearg to
4115 escape trigraphs. This used to be the default in gnulib.
4116 * tests/regression.at (Token definitions): Because of the change in
4117 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
4118 escapes trigraphs in symbol names. Thus, yytname no longer has
4119 trigraphs unnecessarily doubly escaped. Update test case output.
4120 Extend test case to be sure Bison's own error messages will no longer
4121 have trigraphs in symbol names unnecessarily escaped once.
4123 2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
4125 Fix make dist infinite loop reported by Juan Manuel Guerrero at
4126 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
4127 * .cvsignore: Add .version.
4129 * bootstrap.conf (gnulib_modules): Add git-version-gen.
4130 * configure.ac (AC_CONFIG_FILES): Add .version.
4131 * build-aux/.cvsignore: Add git-version-gen.
4133 2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4135 * NEWS (2.3a+): Mention that -g now takes an argument.
4136 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
4137 consistency. Update the -g and -x entries now that they take
4138 arguments. Use brackets to indicate optional arguments.
4139 * src/getargs.c (usage): Explain the relationship between arguments of
4140 long and short options more completely. Document --defines and -d
4141 separately since the former takes an argument but, for POSIX Yacc, the
4143 (short_options): Let -W take an optional argument like --warnings.
4144 (getargs): Sort cases.
4146 2008-02-28 Akim Demaille <demaille@gostai.com>
4148 * doc/bison.texinfo: Fix a few typos.
4150 2008-02-28 Akim Demaille <akim@epita.fr>
4152 * doc/bison.texinfo (Bison Options): Document -W.
4153 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
4155 2008-02-28 Akim Demaille <akim@epita.fr>
4157 * src/getargs.c (short_options): Split and sort for readability.
4158 -g and -x take optional arguments, just like their long options.
4159 * build-aux/cross-options.pl: Use /x to make the regexp easier to
4161 Fix the handling of $opt which resulted in all the argument to be
4162 considered as optional.
4164 2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
4166 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
4167 say its interface is experimental.
4168 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4170 (Bison Options): In the -L and --language entry, mention Java.
4171 (Java Bison Interface): Say the interface is experimental.
4172 * src/getargs.c (usage): Mention -L and --language.
4174 * NEWS (2.3a+): Say the push parsing interface is experimental.
4175 * doc/bison.texinfo (Push Decl): Likewise.
4176 (Decl Summary): Likewise in the "%define api.push_pull" entry.
4177 (Push Parser Function): Likewise.
4178 (Pull Parser Function): Likewise.
4179 (Parser Create Function): Likewise.
4180 (Parser Delete Function): Likewise.
4181 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
4182 yypull_parse, and yypush_parse entries.
4184 * NEWS (2.3a+): Mention XML support, and say the schema is
4186 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
4187 * src/getargs.c (usage): Say the XML schema is experimental.
4189 * NEWS (2.3a+): Say option instead of flag.
4191 2008-02-21 Wojciech Polak <polak@gnu.org>
4193 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
4196 2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
4198 Fix impure push parser compile error reported by Bob Rossi at
4199 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
4200 * data/yacc.c: Clean up whitespace in the output a little.
4201 (yypstate_allocated): Define for impure push parsers regardless of
4202 whether the pull interface is also requested.
4203 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
4204 check impure push parsers without the pull interface.
4206 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
4207 yyerror takes arguments specified by %parse-param while yypstate_new
4209 * doc/bison.texinfo (Parser Create Function): Document that
4210 yypstate_new returns 0 for multiple impure parser instances.
4211 * tests/push.at (Push Parsing: Multiple impure instances): Update
4212 expected stderr output.
4214 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
4216 * runtime-po/POTFILES.in (push.c): Remove.
4218 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
4220 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
4221 * data/push.c: Rename to...
4222 * data/yacc.c: ... this, overwriting it.
4223 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
4224 `%push-pull-parser' -> `%define api.push_pull "both"'.
4225 Remove old yacc.c tests, and update push.c tests to yacc.c.
4227 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
4229 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
4230 `"%code top" blocks' instead of `%code "top" blocks'.
4231 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
4232 Clean up whitespace in the output a little.
4234 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
4236 Fix documentation problems reported by Tim Josling at
4237 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
4238 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
4239 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
4240 integers. Explain the effect of literal string aliases on error
4241 messages. Copy token 0 documentation from the C++ skeleton
4244 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
4246 Accept a token number in a %left, %right, or %nonassoc for POSIX
4247 conformance. Reported by Tim Josling at
4248 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
4249 * NEWS (2.3a+): Mention.
4250 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
4251 and code numbers are treated by precedence declarations.
4252 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
4254 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
4256 (symbol.prec): New, just like symbol but allows INT.
4257 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
4259 * tests/regression.at (Token number in precedence declaration): New
4262 2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4264 DJGPP specific issues.
4265 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
4266 be changed. Copyright timestamp adjusted.
4267 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
4268 be changed. Copyright timestamp adjusted.
4269 * djgpp/config.site: Copyright timestamp adjusted.
4270 * djgpp/config_h.sed: Copyright timestamp adjusted.
4271 * djgpp/djunpack.bat: Copyright timestamp adjusted.
4272 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
4273 filename translation list.
4274 * djgpp/subpipe.c (init_subpipe): Check the environment variables
4275 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
4276 files shall be created. Before trying to use the temp dir where the
4277 environment variable points to check that the dir really exists. If
4278 not default to the cwd as temp dir. Copyright timestamp adjusted.
4279 * djgpp/subpipe.h: Copyright timestamp adjusted.
4280 * djgpp/testsuite.sed: Copyright timestamp adjusted.
4282 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
4284 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
4286 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
4288 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
4289 Problem reported by Claudio Saavedra in
4290 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
4292 2008-01-05 Wojciech Polak <polak@gnu.org>
4294 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
4295 document's title with the input grammar file name.
4297 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
4299 Automate regression testing of the XML/XSLT implementation. Discussed
4301 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
4302 * configure.ac (XSLTPROC): New substitution.
4303 * Makefile.am (maintainer-xml-check): New phony target invoking...
4304 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
4305 invoking make maintainer-check with BISON_TEST_XML=1.
4306 * tests/atlocal.in (XSLTPROC): New.
4307 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
4308 not to report reachable memory when Bison is expected to have a
4309 non-zero exit status and (2) to compare XML/XSLT output with --graph
4310 and --report=all output for every working grammar when
4312 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
4313 (AT_BISON_CHECK_XML): New.
4314 (AT_QUELL_VALGRIND): New.
4315 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
4316 (AT_CHECK): ... don't redefine this since this was the old way to
4318 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
4319 AT_BISON_CHECK invocations.
4320 * tests/c++.at: Likewise.
4321 * tests/calc.at: Likewise.
4322 * tests/conflicts.at: Likewise.
4323 * tests/cxx-type.at: Likewise.
4324 * tests/existing.at: Likewise.
4325 * tests/glr-regression.at: Likewise.
4326 * tests/headers.at: Likewise.
4327 * tests/input.at: Likewise.
4328 * tests/java.at: Likewise.
4329 * tests/output.at: Likewise.
4330 * tests/push.at: Likewise.
4331 * tests/reduce.at: Likewise.
4332 * tests/regression.at: Likewise.
4333 * tests/sets.at: Likewise.
4334 * tests/skeletons.at: Likewise.
4335 * tests/synclines.at: Likewise.
4336 * tests/torture.at: Likewise.
4337 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
4338 tends to hang xsltproc.
4339 (Big horizontal): Likewise.
4341 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
4343 In XML output, remove redundant class attribute on symbol element.
4344 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
4345 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
4346 look up a symbol to determine whether it's a nonterminal or terminal.
4347 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
4348 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
4350 Add prec/assoc information to XML output.
4351 * src/gram.c (grammar_rules_print_xml): For each rule that has a
4352 %prec, add a percent_prec attribute.
4353 * src/print-xml.c (print_grammar): For each terminal that has a
4354 precedence or associativity, add a prec or assoc attribute.
4356 (xml_puts): Use xml_indent.
4357 (xml_printf): Use xml_indent.
4358 * src/print-xml.h (xml_indent): Prototype.
4360 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
4361 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
4363 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
4365 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
4366 (bison:ruleByNumber): ... this for clarity.
4367 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
4368 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
4369 (xsl:template match="reduction"): Update.
4370 (xsl:template match="item"): Update.
4371 (xsl:template match="reduction"): Update.
4373 In the XML output, don't print the list of rules where symbols appear.
4374 Compute it in XSLT instead. Discussed at
4375 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
4376 * data/xslt/bison.xsl (bison:ruleByLhs): New.
4377 (bison:ruleByRhs): New.
4378 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
4380 (xsl:template match="terminal/rule"): Remove.
4381 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
4383 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
4385 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
4386 bison:ruleByRhs and mode="number-link" for rule template.
4387 (xsl:template match="terminal/rule"): Remove.
4388 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
4389 bison:ruleByRhs and mode="number-link" for rule template.
4390 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
4392 (xsl:template match="rule" mode="number-link"): ... this.
4393 * src/print-xml.c (print_grammar): Don't print the list of rules.
4395 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4397 Don't let --report affect XML output; always print all information.
4399 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
4400 * src/conflicts.c (log_resolution): Implement.
4401 * src/print-xml.c (print_core): Implement.
4402 (print_state): Implement.
4403 (print_xml): Implement.
4405 * NEWS (2.3a+): Fix quotes.
4406 * src/parse-gram.y (prologue_declaration): For consistency with -v,
4407 don't let %verbose clear the list specified by --report.
4409 2007-11-26 Akim Demaille <akim@epita.fr>
4411 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
4413 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
4415 In the XML output, list useless and unused symbols and rules with the
4416 useful ones and add a "usefulness" attribute. Discussed starting at
4417 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
4418 * src/gram.c (grammar_rules_partial_print_xml): Remove.
4419 (grammar_rules_print_xml): Print all rules instead of just those
4420 useful in the grammar, and add a "usefulness" attribute.
4421 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
4422 * src/print-xml.c (print_rules_useless_in_parser): Remove.
4423 (print_grammar): Print all nonterminals instead of just useful ones,
4424 and add a "usefulness" attribute to nonterminals and terminals.
4425 (print_xml): Don't print a separate "reductions" or
4426 "rules-useless-in-parser" element.
4427 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
4428 (reduce_xml): Remove.
4429 (reduce_token_unused_in_grammar): New.
4430 (reduce_nonterminal_useless_in_grammar): New.
4431 * src/reduce.h (reduce_xml): Remove prototype.
4432 (reduce_token_unused_in_grammar): Add prototype.
4433 (reduce_nonterminal_useless_in_grammar): Add prototype.
4434 * data/xslt/xml2text.xsl: Update for XML changes.
4435 * data/xslt/xml2xhtml.xsl: Update for XML changes.
4436 * tests/reduce.at (Useless Terminals): Update output.
4437 (Useless Rules): Update output.
4438 (Reduced Automaton): Update output.
4440 Say "Terminals unused in grammar" instead of "Unused terminals".
4441 * NEWS (2.3a+): Update.
4442 * doc/bison.texinfo (Understanding): Update example output.
4443 * src/reduce.c (reduce_output): Implement.
4444 * data/xslt/xml2text.xsl: Implement.
4445 * data/xslt/xml2xhtml.xsl: Implement.
4447 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
4449 Accept --report-file=FILE to override the default `.output' filename.
4450 * NEWS (2.3a+): Mention.
4451 * doc/bison.texinfo (Bison Options): Add an entry.
4452 * src/files.c (compute_output_file_names): Don't override
4453 spec_verbose_file if already set.
4454 * src/getargs.c (usage): Document --report-file.
4455 (REPORT_FILE_OPTION): New anonymous enum member.
4456 (long_options): Add entry for it.
4457 (getargs): Add case for it setting spec_verbose_file.
4459 * build-aux/cross-options.pl: Don't record a short option just because
4461 * doc/.cvsignore: Add yacc.1.
4463 2007-11-14 Akim Demaille <akim@epita.fr>
4465 * doc/yacc.1.in: New.
4466 * configure.ac, doc/Makefile.am: Adjust.
4467 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
4469 Use AC_SUBST for assignments too.
4470 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
4472 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4474 * src/gram.c: Remove comments that duplicate comments in gram.h.
4476 When reporting useless rules and nonterminals, say "useless in grammar"
4477 instead of "useless", and say "useless in parser" instead of "never
4478 reduced". Discussed starting at
4479 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
4480 * NEWS (2.3a+): Mention this change.
4481 * data/xslt/xml2text.xsl: Update output text and expected input XML
4482 element names to match changes below.
4483 * data/xslt/xml2xhtml.xsl: Likewise.
4484 (xsl:template match="bison-xml-report"): Add missing entry in Table of
4485 Contents: "Rules useless in parser due to conflicts".
4486 * doc/bison.texinfo (Decl Summary): Reword a little.
4487 (Understanding): Update example output for changes below.
4488 * src/gram.c: (rule_useful_p): Rename to...
4489 (rule_useful_in_grammar_p): ... this.
4490 (rule_useless_p): Rename to...
4491 (rule_useless_in_grammar_p): ... this.
4492 (rule_never_reduced_p): Rename to...
4493 (rule_useless_in_parser_p): ... this.
4494 (grammar_rules_print): Update for renames.
4495 (grammar_rules_print_xml): Update for renames.
4496 (grammar_rules_never_reduced_report): Rename to...
4497 (grammar_rules_useless_report): ... this since it is used for either
4498 kind of useless rule.
4499 * src/gram.h: Reword comments and update function names in prototypes.
4500 * src/main.c (main): Say "rule useless in parser due to conflicts".
4501 * src/print-xml.c (print_rules_never_reduced): Rename to...
4502 (print_rules_useless_in_parser): ... this, and rename output XML
4503 element "rules-never-reduced" to "rules-useless-in-parser".
4504 (print_xml): Update for rename.
4505 * src/print.c (print_results): Say "Rules useless in parser due to
4507 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
4508 (nonterminals_reduce): Say "nonterminal useless in grammar".
4509 (reduce_output): Say "Nonterminals useless in grammar".
4510 Say "Rules useless in grammar".
4511 (reduce_xml): Rename output XML element "useless" to
4512 "useless-in-grammar".
4513 (reduce_print): Don't report the count of grammatically useless rules
4514 as "rules never reduced" just because %yacc is specified.
4515 In the correct report of this count, say nonterminal(s) and rule(s)
4516 "useless in grammar".
4517 * tests/conflicts.at (S/R in initial): Update expected output.
4518 (Defaulted Conflicted Reduction): Likewise.
4519 (Unreachable States After Conflict Resolution): Likewise.
4520 * tests/existing.at (GNU pic Grammar): Likewise.
4521 * tests/reduce.at (Useless Nonterminals): Likewise.
4522 (Useless Rules): Likewise.
4523 (Reduced Automaton): Likewise.
4524 (Underivable Rules): Likewise.
4525 (Empty Language): Likewise.
4527 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4529 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
4530 here document and before the EOF so that BSD's implementation of Bourne
4531 shell doesn't parse the delimiter as part of the here document.
4532 * doc/.cvsignore: Add cross-options.texi.
4533 * src/getargs.c (usage): Add a blank line after the warning categories.
4535 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
4537 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
4539 2007-11-05 Akim Demaille <akim@epita.fr>
4541 Remove Id: from bison.1.
4542 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
4543 (perl -0777 -pi -e 's/\.PP\nId): New.
4544 (.x.1): Use it to ignore the version control revision.
4546 2007-11-05 Akim Demaille <demaille@gostai.com>
4548 * build-aux/Makefile.am: Ship cross-options.pl.
4549 * doc/Makefile.am: Always refer to cross-options.texi with
4551 (MAINTAINERCLEANFILES): Add it.
4553 2007-11-04 Akim Demaille <demaille@gostai.com>
4555 Generate the long/short option cross-table.
4556 * build-aux/cross-options.pl: New.
4557 * doc/Makefile.am (cross-options.texi): New.
4558 * doc/bison.texinfo: Use it.
4560 2007-11-04 Akim Demaille <demaille@gostai.com>
4562 Generate bison.1 using help2man.
4563 * doc/common.x, doc/bison.x: New.
4564 * doc/Makefile.am (bison.1, .x.1): New.
4565 The code is taken from autoconf-2.61/man/Makefile.am.
4566 * configure.ac: Look for help2man.
4568 2007-11-04 Akim Demaille <demaille@gostai.com>
4571 * src/getargs.c (usage): Document -W, make it clear that -d,
4572 -g and -x have optional arguments.
4574 2007-11-04 Akim Demaille <demaille@gostai.com>
4576 Find sha1sum when named gsha1sum.
4577 * bootstrap (find_tool): New.
4580 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4582 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
4584 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
4585 * NEWS (2.3a+): Mention.
4586 * data/bison.m4 (b4_pure_if): Don't define it here.
4587 * data/c.m4 (b4_identification): Depend on individual skeletons to
4588 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
4589 values of the %define variables api.pure or api.push_pull. Define
4590 YYPURE, YYPUSH, and YYPULL accordingly.
4591 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
4592 glr.cc has already defined b4_pure_flag.
4593 * data/push.c: Define b4_pure_if based on `%define api.pure'.
4594 Remove YYPUSH and YYPULL since they're back in b4_identification again.
4595 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
4596 * doc/bison.texinfo (Pure Decl): Update.
4597 (Push Decl): Update.
4598 (Decl Summary): Add api.pure to %define entry.
4599 In %pure-parser entry, say it's deprecated and reference %define.
4600 (Pure Calling): Update.
4601 (Error Reporting): Update.
4602 (C++ Scanner Interface): Update.
4603 (How Can I Reset the Parser): Update.
4604 (Table of Symbols): In %pure-parser entry, say it's deprecated and
4606 * src/getargs.c (pure_parser): Remove global variable.
4607 * src/getargs.h (pure_parser): Remove extern.
4608 * src/output.c (prepare): Don't define pure_flag muscle.
4609 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
4610 wrapper around `%define api.pure'.
4611 * tests/calc.at (Simple LALR Calculator): Update.
4612 (Simple GLR Calculator): Update.
4613 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
4615 (GLR: Resolve ambiguity, pure, locations): Update.
4616 (GLR: Merge conflicting parses, pure, no locations): Update.
4617 (GLR: Merge conflicting parses, pure, locations): Update.
4618 * tests/glr-regression.at (Uninitialized location when reporting
4620 * tests/input.at (Unused %define api.pure): New test case.
4621 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
4622 AT_PURE_IF and AT_PURE_AND_LOC_IF.
4623 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
4625 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4627 %define push_pull -> %define api.push_pull. Discussed starting at
4628 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
4629 * data/push.c: Expect the new name.
4630 * data/yacc.c: Likewise.
4631 * doc/bison.texinfo (Push Decl): Update.
4632 (Decl Summary): Update %define entry.
4633 (Push Parser Function): Update.
4634 (Pull Parser Function): Update.
4635 (Parser Create Function): Update.
4636 (Parser Delete Function): Update.
4637 * tests/calc.at (Simple LALR Calculator): Update.
4638 * tests/input.at (%define enum variables): Update.
4639 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
4640 (Push Parsing: Multiple impure instances): Update.
4641 (Push Parsing: Unsupported Skeletons): Update.
4642 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
4643 (Exploding the Stack Size with Malloc): Update.
4645 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
4648 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
4650 For the XML output's terminal element, rename @number to @token-number,
4651 and add @symbol-number. In the nonterminal element, rename @number to
4652 @symbol-number. Discussed starting at
4653 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
4654 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
4656 (xsl:template match="nonterminal"): Likewise.
4657 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
4658 (xsl:template match="nonterminal"): Likewise.
4659 * src/print-xml.c (print_grammar): Implement.
4661 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4663 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
4664 2007-10-11 change, the child elements here are items not rules.
4665 (xsl:template match="item"): New.
4666 (xsl:template match="rule"): Update for new reduced itemset.
4667 (xsl:template match="point"): Remove.
4668 (xsl:template match="empty"): For consistency with --graph, don't
4669 output "/* empty */".
4670 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
4671 line-wrap, don't pass a negative value as first-line-length since this
4672 won't work with the following changes.
4673 (xsl:template name="line-wrap"): Simplify slightly.
4674 (xsl:template name="ws-search"): Eliminate recursion.
4675 * src/print_graph.c (print_core): Don't print a reduction's lookahead
4676 set next to an item whose dot is not at the end of the RHS even if it
4677 happens to be associated with the same rule.
4679 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
4681 Add %define lr.keep_unreachable_states.
4682 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
4683 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
4684 * src/main.c (main): Implement it.
4685 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4686 Extend to test it, and fix a typo.
4688 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
4690 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
4691 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
4692 the example .output text.
4693 * tests/regression.at (Extra lookahead sets in report): Improve wording
4696 2007-10-17 Wojciech Polak <polak@gnu.org>
4698 * src/print-xml.c (print_grammar): Renamed
4699 <terminal> and <nonterminal> attributes:
4700 "type" to "number" and "symbol" to "name".
4701 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
4702 Use new attribute names.
4703 (xsl:template match="nonterminal"): Likewise.
4704 * data/xslt/xml2xhtml.xsl: Likewise.
4706 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
4708 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
4709 (Option Cross Key): Likewise.
4711 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
4712 next to an item whose dot is not at the end of the RHS even if it
4713 happens to be associated with the same rule.
4714 * src/print.c (print_core): Likewise.
4715 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
4716 (Resolved SR Conflicts): Update output.
4717 * tests/regression.at (Extra lookahead sets in report): New test case.
4719 2007-10-11 Wojciech Polak <polak@gnu.org>
4721 * src/print-xml.c (print_core): Remove item set
4723 * data/xslt/bison.xsl (bison:ruleNumber): New key.
4724 Improve processing time. Suggested by Joel E. Denny.
4725 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
4726 Write xsl:param "required" attribute as comment.
4727 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
4728 (xsl:template match="rule"): Support new reduced itemset.
4729 (xsl:template match="point"): Remove.
4730 * data/xslt/xml2xhtml.xsl: Likewise.
4732 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
4734 * src/getargs.c (version): Update copyright year.
4736 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
4738 Make xml2dot.xsl and --graph produce the same output.
4739 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a ` '
4740 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
4742 (xsl:template name="output-node"): Use the new escape template instead
4743 of the string-replace template directly.
4744 (xsl:template name="output-edge"): Likewise.
4745 (xsl:template name="escape"): New, escapes backslashes and newlines in
4746 addition to quotation marks.
4747 * src/graphviz.c (start_graph, output_node, output_edge): Add
4748 whitespace to output for legibility.
4750 Make xml2text.xsl and --report produce the same output, and remove the
4751 XML "conflicts" element since a conflict summary is easily extracted
4753 * data/xslt/bison.xsl: New.
4754 (xsl:template match="state" mode="bison:count-conflicts): New.
4755 * data/xslt/xml2text.xsl: Import bison.xsl.
4756 (xsl:template match="bison-xml-report"): Instead of styling the
4757 "conflicts" element, style the "automaton" element with mode
4758 "conflicts". Unlike the former, the latter lists S/R and R/R
4759 conflicts for a state on the same line.
4760 (xsl:template match="conflicts"): Remove.
4761 (xsl:template match="conflict"): Remove.
4762 (xsl:template match="terminal"): Line-wrap the list of rules in which
4763 the terminal is used.
4764 (xsl:template match="nonterminal"): Likewise for nonterminals.
4765 (xsl:template match="automaton" mode="conflicts"): New.
4766 (xsl:template match="state" mode="conflicts"): New.
4767 (xsl:template name="line-wrap"): New.
4768 (xsl:template name="ws-search"): New.
4769 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
4770 (xsl:template match="bison-xml-report"): Instead of styling the
4771 "conflicts" element, style the "automaton" element with mode
4773 (xsl:template match="conflicts"): Remove.
4774 (xsl:template match="conflict"): Remove.
4775 (xsl:template match="automaton" mode="conflicts"): New.
4776 (xsl:template match="state" mode="conflicts): New.
4777 * src/conflicts.c (conflicts_output_xml): Remove.
4778 * src/conflicts.h (conflicts_output_xml): Remove prototype.
4779 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
4780 * src/print.c (print_grammar): Consistently wrap at the 66th column so
4781 the corresponding XSLT is easier. Also, never wrap between a word and
4782 the comma that follows it.
4784 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
4786 Improve C++ namespace support. Discussed starting at
4787 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
4788 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
4789 b4_namespace_close): New macros that interpret the %define variable
4790 "namespace" so its value can contain "::" to indicate nested
4792 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
4794 * data/lalr1.cc (b4_namespace): Likewise.
4795 * data/location.cc (b4_namespace): Likewise.
4796 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
4797 inside a new table in the general %define entry. Document `%define
4798 namespace' there as well. Point the %name-prefix entry to it since it
4799 explains it more completely in the case of C++.
4800 (C++ Bison Interface): Mention `%define namespace' instead of
4802 (Table of Symbols): Remove the `%define push_pull' entry. The %define
4804 * tests/c++.at (Relative namespace references): New test case.
4805 (Absolute namespace references): New test case.
4806 (Syntactically invalid namespace references): New test case.
4807 * tests/input.at (C++ namespace reference errors): New test case.
4809 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
4811 Add syncline support and location accessor to internal %define
4813 * data/bison.m4 (b4_percent_define_get_loc): New.
4814 (b4_percent_define_get_syncline): New.
4815 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
4816 (b4_percent_define_default): Record defining location as line 1 rather
4817 than 0 for the sake of synchronizing #line's, and define
4818 b4_percent_define_syncline(VARIABLE).
4819 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
4820 * src/muscle_tab.c (muscle_syncline_grow): New.
4821 (muscle_code_grow): Use muscle_syncline_grow.
4822 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
4823 define b4_percent_define_syncline(VARIABLE).
4824 (muscle_percent_define_get_loc): New.
4825 (muscle_percent_define_get_syncline): New.
4826 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
4827 remove some unused variables.
4828 (muscle_percent_define_default): Record defining location as line 1
4829 rather than 0 for the sake of synchronizing #line's, and define
4830 b4_percent_define_syncline(VARIABLE).
4831 (muscle_percent_define_check_values): Use
4832 muscle_percent_define_get_loc.
4833 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
4834 (muscle_percent_define_get_syncline): Prototype.
4835 * tests/skeletons.at (%define Boolean variables: invalid skeleton
4836 defaults): Update output for location change.
4837 (Complaining during macro argument expansion): Extend to test
4838 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
4840 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
4842 Fix some error-reporting macro bugs.
4843 * data/bison.m4 (b4_cat): New.
4844 (b4_error, b4_error_at): Use b4_cat to send error directives directly
4845 to stdout so they don't become arguments to other macros. Update
4846 comments and add examples.
4847 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
4849 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
4850 after printing the error directive so that M4 doesn't report subsequent
4851 problems that are induced by this problem.
4852 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
4853 instead of just in them. Recognize @\n in both places. Both expand to
4854 the empty string. Needed by b4_cat.
4855 * tests/skeletons.at (Complaining during macro argument expansion):
4857 (Fatal errors make M4 exit immediately): New test case.
4859 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
4861 Implement --print-datadir.
4862 * src/getargs.c (usage): Mention.
4863 (PRINT_DATADIR_OPTION): New anonymous enum member.
4864 (long_options): Add entry for it.
4865 (getargs): Add case for it calling compute_pkgdatadir.
4866 * src/output.c (output_skeleton): Encapsulate data directory
4867 computation from here...
4868 (prepare): ... and from here...
4869 (compute_pkgdatadir): ... into this new function.
4870 * src/output.h (compute_pkgdatadir): Prototype.
4872 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
4874 * src/print-xml.c (escape_bufs): New static global variable
4876 (xml_escape_n): ... the static local variable buf here.
4877 (print_xml): Free memory for escape_bufs.
4878 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
4880 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
4882 Replace `%push-parser' and `%push-pull-parser' with
4883 `%define push_pull "push"' and `%define push_pull "both"'.
4884 `%define push_pull "pull"' is the default.
4885 * doc/bison.texinfo (Push Decl, Push Parser Function,
4886 Pull Parser Function, Parser Create Function, Parser Delete Function):
4887 Update declarations.
4888 (Decl Summary, Table of Symbols): Replace %push-parser and
4889 %push-pull-parser entries with a %define push_pull entry.
4890 * data/bison.m4 (b4_percent_define_check_values): New macro.
4891 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
4893 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
4895 * data/push.c: ... to here and compute them from the value of the
4896 %define variable push_pull.
4897 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
4898 parsing requests here...
4899 * data/yacc.c: ... hack this to switch to push.c any time
4900 b4_use_push_pull_flag or the %define variable push_pull is set. This
4901 will go away when we mv push.c yacc.c.
4902 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
4903 push parsing is not supported since unused %define variables are
4905 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
4906 * src/muscle_tab.h (muscle_percent_define_check_values): Update
4907 comments for consistency with b4_percent_define_check_values.
4908 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
4910 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
4912 (prologue_declaration): Remove %push-parser and %push-pull-parser
4914 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
4915 * tests/calc.at: Update declarations.
4916 * tests/input.at (%define enum variables): New test case.
4917 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
4919 (Push Parsing: Multiple impure instances): Update declaration.
4920 (Push Parsing: Unsupported Skeletons): New test case.
4921 * tests/torture.at (Exploding the Stack Size with Alloca): Update
4923 (Exploding the Stack Size with Malloc): Update declaration.
4925 2007-09-24 Wojciech Polak <polak@gnu.org>
4927 Add XSLT transformations.
4929 * data/xslt/xml2dot.xsl: Transform XML into DOT.
4930 * data/xslt/xml2text.xsl: Transform XML into plain text.
4931 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
4932 * data/Makefile.am (xsltdir): New variable.
4933 (dist_xslt_DATA): Add xslt/*.xsl files.
4935 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
4937 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
4938 Problem reported by Wojciech Polak.
4939 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
4940 (xml_printf): Undo change I made on 21 September; that is,
4941 indent 2 spaces, not 1.
4943 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
4945 Pacify ./configure --enable-gcc-warnings.
4946 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
4947 `char const *' instead of `char *'.
4948 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
4949 local variable `sep'.
4951 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4953 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
4955 * src/print-xml.c: Prefer "const" after types; that's more consistent.
4956 (xml_printf): Indent just 1 space for level.
4957 (e_char, xlate_char): Remove.
4958 (xml_escape_string): Rewrite to avoid undefined behavior (used
4959 storage that was freed from the stack).
4960 (xml_escape_n): Don't bother checking for subscript error.
4962 2007-09-21 Wojciech Polak <polak@gnu.org>
4964 Add Bison XML Automaton Report.
4966 Add support for an -x option to generate an XML report.
4967 It is not documented yet.
4968 * src/print-xml.c: New file.
4969 * src/print-xml.h: Likewise.
4970 * lib/timevar.def (TV_XML): New var.
4971 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
4972 * src/conflicts.c: Include print-xml.h.
4973 (solved_conflicts_xml_obstack): New var.
4974 (log_resolution, conflicts_solve, conflicts_free):
4975 Add support for XML report.
4976 (conflicts_output_val): New function.
4977 * src/conflicts.h (conflicts_output_val): New decl.
4978 * src/files.c (spec_xml_file): New var.
4979 (compute_output_file_names, output_file_names_free): Add XML support.
4980 * src/files.h (spec_xml_file): New decl.
4981 * src/getargs.c (xml_flag): New var.
4982 (usage, short_options, long_options, getargs): Add XML support.
4983 * src/getargs.h (xml_flag): New decl.
4984 * src/gram.c: Include print-xml.h.
4985 (rule_lhs_print_xml, rule_rhs_print_xml):
4986 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
4988 * src/gram.h: Declare external ones.
4989 * src/main.c: Include print-xml.h.
4990 (main): Add XML support.
4991 * src/reduce.c: Include print-xml.h.
4992 (reduce_xml): New function.
4993 * src/reduce.h: Declare it.
4994 * src/state.c: Include print-xml.h.
4995 (state_new): Add XML support.
4996 (state_rule_lookahead_tokens_print_xml): New function.
4997 * src/state.h: Declare it.
4998 (struct state): New member solved_conflicts_xml.
4999 * src/symtab.c (symbol_class_get_string): New function.
5000 * src/symtab.h: Declare it.
5002 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5004 * GNUmakefile: Switch to coreutils's version.
5005 * bootstrap: Likewise.
5006 * Makefile.cfg: Adjust to new GNUmakefile.
5007 * README-hacking: Likewise.
5011 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
5012 Bruno Haible <bruno@clisp.org>
5014 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
5015 and is a script that invokes bison. Tighten the code. Add comments.
5017 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
5019 Spell "boolean" as "Boolean". Reported by Akim Demaille.
5020 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
5021 * doc/bison.texinfo (Decl Summary): Fix.
5022 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
5023 * tests/input.at (Boolean %define variables): Update output.
5024 * tests/skeletons.at (%define boolean variables: invalid skeleton
5025 defaults): Rename to...
5026 (%define Boolean variables: invalid skeleton defaults): ... this and
5029 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
5031 In impure push mode, don't allow more than one yypstate to be allocated
5032 since multiple impure parsers would corrupt yynerrs.
5033 * data/push.c (yypstate_allocated): New static global variable
5035 (yypull_parse): If yypstate_new returns 0, don't report it as memory
5036 exhaustion if yypstate_allocated is 1, but still return 2.
5037 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
5038 already 1. Otherwise, set it to 1.
5039 (yypstate_delete): Set it to 0.
5040 * tests/push.at (Push Parsing: Multiple impure instances): New test
5043 2007-08-17 Bob Rossi <bob@brasko.net>
5045 * doc/bison.texinfo (Push Decl): Document the push parser.
5046 (Table of Symbols): Ditto.
5048 (Decl Summary): Ditto.
5049 (Multiple Parsers, Push Parser Function, Pull Parser Function,
5050 Parser Create Function, Parser Delete Function):
5051 Add new push parser symbols.
5052 (Table of Symbols): Document push-parser, push-pull-parser,
5053 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
5055 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
5058 * doc/gpl-3.0.texi: New file.
5059 * doc/gpl.texi: Remove.
5060 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
5061 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
5062 * README-hacking, TODO, bootstrap, bootstrap.conf:
5063 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
5064 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
5065 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
5066 * data/lalr1.cc, data/lalr1.java, data/location.cc:
5067 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
5068 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
5069 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
5070 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
5071 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
5072 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
5073 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
5074 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
5075 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
5076 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
5077 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
5078 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
5079 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
5080 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
5081 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
5082 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
5083 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
5084 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
5085 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
5086 * src/complain.c, src/complain.h, src/conflicts.c:
5087 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
5088 * src/files.h, src/flex-scanner.h, src/getargs.c:
5089 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
5090 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
5091 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
5092 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
5093 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
5094 * src/print.c, src/print.h, src/print_graph.c:
5095 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
5096 * src/reduce.h, src/relation.c, src/relation.h:
5097 * src/revision.h, src/scan-code.h, src/scan-code.l:
5098 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
5099 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
5100 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
5101 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
5102 * tests/Makefile.am, tests/actions.at, tests/c++.at:
5103 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
5104 * tests/existing.at, tests/glr-regression.at:
5105 * tests/headers.at, tests/input.at, tests/java.at:
5106 * tests/local.at, tests/output.at, tests/push.at:
5107 * tests/reduce.at, tests/regression.at, tests/sets.at:
5108 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
5112 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
5114 Get rid of broken %no-parser, -n, and --no-parser implementation and
5116 * TODO: Don't mention them.
5117 * doc/bison.1: Likewise.
5118 * doc/bison.texinfo (Decl Summary): Likewise.
5119 (Bison Options): Likewise.
5120 (Option Cross Key): Likewise.
5121 * src/getargs.c (no_parser_flag): Remove global variable.
5122 (usage): Don't print description of -n and --no-parser.
5123 (long_options): Remove --no-parser entry here.
5124 (getargs): Remove -n case in the switch here.
5125 * src/getargs.h (no_parser_flag): Remove extern.
5126 * tests/regression.at (Web2c Actions): Remove comment that mentions
5129 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
5131 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
5132 name user variables starting with `yy'. Just pass NULL instead of a
5133 dummy local &yylval to yypush_parse.
5134 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
5137 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
5139 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
5140 true since it's then always used regardless of whether yyoverflow is
5141 defined. Reported by Christian Burger at
5142 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
5143 * THANKS: Add Christian Burger.
5145 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
5146 node names: say "Decl Summary" not "Bison Declaration Summary".
5148 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
5150 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
5151 determine whether this function has already complained about an invalid
5152 value for a %define boolean variable, don't check whether Bison has
5153 ever examined the value. As written, the check was a tautology.
5154 Instead, record and check for this complaint using a separate muscle.
5156 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
5158 Fix push parsing memory leak reported by Brandon Lucia at
5159 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
5160 * THANKS: Add Brandon Lucia.
5161 * data/push.c (yypstate_delete): Free the stack if it was reallocated
5162 but the parse never completed and thus freed it.
5163 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
5164 * tests/testsuite.at: Include push.at.
5165 * test/push.at: New.
5166 (Push Parsing: Memory Leak for Early Deletion): New test case.
5168 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
5170 Improve handling of multiple S/R conflicts in the same state and of S/R
5171 conflicts involving multiple reductions.
5172 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
5173 set for a state here or Bison will abort if it is reassigned on a
5174 later conflicted reduction in the same state.
5175 Similarly, don't finalize and assign the solved conflicts report here
5176 or it will be lost if it is reassigned on a later conflicted reduction
5178 (set_conflicts): Instead, assign them both here after all S/R conflicts
5179 in the state have been fully examined.
5180 * src/print.c (shift_set): Rename to...
5181 (no_reduce_set): ... this.
5182 (print_reductions): Update for rename, and add %nonassoc error action
5183 tokens to no_reduce_set so that, when printing the first remaining
5184 reduction on an error action token, the reduction is enclosed in
5186 (print_results): Update for rename.
5187 * tests/conflicts.at (Solved conflicts report for multiple reductions
5188 in a state): New test case.
5189 (%nonassoc error actions for multiple reductions in a state): New test
5192 * src/main.c (main): Don't depend on C99 features.
5194 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
5196 * build-aux/.cvsignore: Add compile.
5197 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
5200 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
5202 * bootstrap (slurp): Create target directories that don't exist.
5203 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
5205 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5207 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
5209 * closure.c (closure): Likewise.
5210 * state.h (reductions): Comment sorting of rules.
5211 (state): Comment sorting of items.
5213 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
5215 Fix C++ test cases after recent Gnulib changes. Discussed starting at
5216 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
5217 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
5218 definition in order to avoid Gnulib headers since we don't use config.h
5220 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
5221 rather than AT_DATA so that config.h is included.
5223 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
5225 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
5226 instead of fprintf. Guard these functions with #if YYDEBUG instead of
5227 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
5228 and so that YYFPRINTF is guaranteed to be defined here.
5230 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
5232 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
5234 (muscle_percent_define_check_values): ... this more helpful function.
5235 Again, it's not used yet, but it will be.
5236 * src/muscle_tab.h: Likewise.
5238 Improve some comments in parser table construction.
5239 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
5240 (generate_states): Don't mention ruleset, which is internal to closure.
5241 * src/closure.c (closure): Explain sorting of core and itemset, which
5242 is required for this function to behave correctly.
5243 * src/closure.h (closure): Mention sorting.
5245 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
5247 * src/lalr.c (state_lookahead_tokens_count): For code readability,
5248 move the check for disabled transitions to an aver since conflict
5249 resolution hasn't happened yet.
5251 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
5252 labels a state as inconsistent just because it has error transitions.
5253 The original form of this check appeared in revision 1.1 of lalr.c,
5254 which was committed on 1991-12-21. Now (at least), changing the
5255 consistency label on such a state appears to have no useful effect in
5256 any of the places it is examined, which I enumerate below. The key
5257 point to understanding each item in this enumeration is that a state
5258 with an error transition is labelled consistent in the first place only
5259 if it has no rules, so the check cannot matter for states that have
5260 rules. (1) Labelling a state as inconsistent will cause set_conflicts
5261 to try to identify its conflicts, and a state must have *rules* to have
5262 conflicts. (2) Labelling a state as inconsistent will affect how
5263 action_row sets the default *rule* for the state. (3) Labelling a
5264 state as inconsistent will cause build_relations to add lookback edges
5265 to *rules* in that state.
5266 * src/state.h (struct state): Word the comment for member consistent
5269 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
5271 Don't depend on C99 features.
5272 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
5273 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
5274 * src/reader.c (check_and_convert_grammar): Fix for-loop.
5275 * src/state.c (state_mark_reachable_states): Fix for-loop.
5276 (state_remove_unreachable_states): Fix for-loop.
5278 Don't widen struct state with member reachable just to temporarily
5279 record reachability. Instead, use a local bitset.
5280 * src/state.h (struct state): Remove member.
5281 * src/state.c (state_new): Don't initialize it.
5282 (state_mark_reachable_states): Rename to...
5283 (state_record_reachable_states): ... this, and use bitset.
5284 (state_remove_unreachable_states): Use bitset.
5286 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
5288 * src/Makefile.am (yacc): Quote target action commands properly so
5289 that the yacc script isn't corrupt. Reported by Hans Aberg at
5290 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
5292 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
5293 the case of pure parsers. Reported by Frans Englich at
5294 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
5295 * THANKS: Add Frans Englich.
5297 * NEWS (2.3a+): In the %code entry, reference section `Bison
5298 Declaration Summary' from the manual now since the %code summary has
5300 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
5301 in the rules section must be terminated by semicolons.
5303 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
5305 Extend the front-end API for %define variables to more completely
5306 mirror the back-end. This will be useful in the future.
5307 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
5308 Update comments to mention the new front-end counterparts of these
5310 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
5311 for muscle_string_decode and muscle_location_decode.
5312 (muscle_string_decode): New static function.
5313 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
5314 (muscle_percent_define_get, muscle_percent_define_ifdef): New
5316 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
5317 muscle_percent_define_get to mimic the b4_percent_define_flag_if
5318 implementation more closely.
5319 (muscle_percent_define_invalid_value): New function.
5320 * src/muscle_tab.h (muscle_percent_define_get,
5321 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
5324 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
5326 * NEWS (2.3a+): Mention yesterday's state-removal change.
5327 (2.3a): Remove the %language entry, which was added after 2.3a.
5328 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
5329 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
5330 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
5331 tests/existing.at: Update copyright date.
5333 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5335 If conflict resolution makes states unreachable, remove those states,
5336 report rules that are then unused, and don't report conflicts in those
5338 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
5339 New global function.
5340 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
5342 * src/main.c (main): After conflict resolution, remove the unreachable
5343 states and update all data structures that reference states by number.
5344 * src/state.c (state_new): Initialize each state's reachable member to
5346 (state_mark_reachable_states): New static function.
5347 (state_remove_unreachable_states): New global function.
5348 * src/state.h (struct state): Add member bool reachable.
5349 (state_remove_unreachable_states): Prototype.
5350 * tests/conflicts.at (Unreachable States After Conflict Resolution):
5352 * tests/existing.at (GNU pic Grammar): Update test case output now that
5353 an unused rule is discovered.
5355 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5357 Minor code cleanup in parser table construction.
5358 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
5359 (new_itemsets, save_reductions): Update for rename to nitemset.
5360 * src/closure.c (nritemset): Rename to...
5361 (nitemset): ... this since the "r" appears to meaningless and isn't
5362 used in the comments.
5363 (closure): Update for rename.
5364 * src/closure.h (nritemset): Update extern to...
5365 (nitemset): ... this.
5366 * src/lalr.c (LA): Fix a typo in comments.
5367 * src/print.c (print_core): Update for rename to nitemset.
5368 * src/print_graph.c (print_graph): Likewise.
5369 * src/state.h: Fix some typos in header comments.
5371 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
5373 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
5374 still sticks to ASCII. Sorry!
5376 * README-hacking: New file, taken mostly from coreutils, with changes
5377 for Bison. Contains much of the contents of:
5378 * README-cvs: Remove.
5379 * bootstrap: Sync from gnulib.
5380 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
5381 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
5383 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
5385 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
5387 (Java Differences): Fix some typos.
5388 * THANKS: Add Sebastian Setzer.
5390 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
5392 * data/java.m4 (b4_single_class_if): Remove.
5393 (b4_abstract_if): Look at "%define abstract".
5395 (b4_union_name): Rename...
5396 (b4_yystype): ... to this. Map to "%define stype".
5397 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
5398 b4_maybe_throws): Fix quoting.
5399 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
5400 * data/lalr1.java (Lexer interface): Always define.
5401 (Lexer interface within parser class): Remove.
5402 (YYLexer class): New, used when "%code lexer" is present.
5403 (constructor): When "%code lexer" is used, pass %lex-param
5404 to the lexer constructor.
5405 (yylex, yyparse): Remove %lex-param from method invocations
5406 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
5408 * doc/bison.texinfo (Java Bison Interface): Mention "%define
5409 abstract". Rename "%define union_name" to "%define stype".
5410 Rename method names according to previous patch.
5411 (Java Scanner Interface): Describe "%code lexer" instead of
5412 "%pure-parser" and "%define single_class".
5413 (Java Differences): Mention "%code lexer".
5415 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
5416 Include scanner here, using macros from tests/local.at.
5417 (AT_DATA_CALC_Y): Remove final argument.
5418 (_AT_CHECK_JAVA_CALC): Likewise.
5419 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
5420 of %locations and %error-verbose.
5421 (main): Test with and without %lex-param.
5422 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
5423 (AT_BISON_OPTION_POPDEFS): Pop it.
5425 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5427 DJGPP spefic issue. Inhibit the use of disallowed characters for
5428 file name genertion on Win98, WinXP, etc. These are |<>":?*\
5429 and concern testsuite case 46.
5430 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
5431 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
5432 * djgpp/config.bat: Inhibit the use of disallowed characters.
5434 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
5436 Miscellaneous %define and %code cleanup.
5437 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
5438 values are interpreted.
5439 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
5440 documentation a little more.
5441 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
5442 muscle_percent_define_insert, muscle_percent_code_grow): New
5444 * src/muscle_tab.h (muscle_percent_define_insert,
5445 muscle_percent_code_grow): Prototype.
5446 * src/parse-gram.y (prologue_declaration): Use
5447 muscle_percent_define_insert and muscle_percent_code_grow when parsing
5448 %define and %code directives.
5450 Make it easy to share %define boolean variables between the front-end
5451 and back-end. Though not used yet, this will be useful in the future.
5452 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
5453 Bison uses of names rather than just skeleton uses of names.
5454 (b4_percent_define_get, b4_percent_define_ifdef): Rename
5455 b4_percent_define_skeleton_variables(VARIABLE) to
5456 b4_percent_define_bison_variables(VARIABLE).
5457 (b4_percent_code_get, b4_percent_code_ifdef): Rename
5458 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
5459 b4_percent_code_bison_qualifiers(QUALIFIER).
5460 (b4_check_user_names_wrap): Update for renames.
5461 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
5462 muscle_percent_define_default): New functions mimicking
5463 b4_percent_define_flag_if and b4_percent_define_default.
5465 For %define variables, report locations for invalid values and
5467 * data/bison.m4 (b4_percent_define_flag_if): Read
5468 b4_percent_define_loc(VARIABLE) to report the location of an invalid
5470 (b4_percent_define_default): Save a special location in
5471 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
5472 must later be reported as invalid.
5473 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
5475 (muscle_percent_define_insert): Record the location of VARIABLE in
5476 muscle percent_define_loc(VARIABLE), and use it to report the previous
5477 location for a redefinition.
5478 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
5479 (muscle_percent_define_default): Update like b4_percent_define_default.
5480 (muscle_grow_user_name_list): Rename to...
5481 (muscle_user_name_list_grow): ... this for consistency and use
5482 muscle_location_grow.
5483 * src/muscle_tab.h (muscle_location_grow): Prototype.
5484 * tests/input.at (%define errors): Update expected output.
5485 * tests/skeletons.at (%define boolean variables: invalid skeleton
5486 defaults): New test case.
5488 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
5490 * src/print.c (lookahead_set, state_default_rule): Remove.
5491 (print_reductions): Replace state_default_rule invocation with
5492 equivalent use of yydefact, which was computed in token_actions in
5494 (print_results): Don't allocate lookahead_set.
5496 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
5498 * data/lalr1.java: Prefix all private members with yy.
5500 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
5502 Use YYFPRINTF instead of fprintf where appropriate. Reported by
5503 Sebastien Fricker at
5504 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
5505 * THANKS: Add Sebastien Fricker.
5506 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
5507 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
5508 accept a variable number of arguments.
5510 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
5512 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
5514 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5516 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
5517 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
5518 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
5520 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
5522 Undo my 2007-02-07 change, switching back to the c-strcase module
5523 introduced in the 2007-02-03 change. Bruno Haible reported that
5524 the 2007-02-07 change would be dangerous in Turkish if we add a
5525 language whose name contains "i", since "i" is not lowercase "I"
5527 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
5528 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
5529 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
5530 * m4/.cvsignore: Remove strcase.m4.
5531 * src/getargs.c: Revert 2007-02-07 change, as follows.
5532 Include c-strcase.h.
5533 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
5535 2007-02-11 Bruno Haible <bruno@clisp.org>
5537 Enable the Java related testsuite tests when the only Java compiler
5538 found is a gcj < 4.3. Discussed at
5539 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
5540 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
5542 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
5544 * data/Makefile.am: Update copyright date.
5545 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
5546 yypstate_new returns NULL.
5547 (yypstate_new): Return NULL if malloc does.
5548 * src/reader.c (packgram): Move translation of rule actions from the
5549 beginning of packgram to...
5550 (check_and_convert_grammar): ... here right before packgram is invoked
5551 so it's easier to write more complete comments, and remove redundant
5554 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
5556 As in semantic actions, make @$ in %initial-action, %destructor, and
5557 %printer imply %locations.
5558 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
5560 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
5561 (@$ in %initial-action implies %locations,
5562 @$ in %destructor implies %locations,
5563 @$ in %printer implies %locations): ... these new test cases.
5565 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
5567 Undo most of the 2007-02-03 change, switching to the strcase module
5568 now that gnulib strcase has been fixed.
5569 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
5570 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
5571 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
5572 * m4/.cvsignore: Add strcase.m4.
5573 * src/getargs.c: Revert 2007-02-03 change, as follows.
5574 Don't include c-strcase.h.
5575 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
5576 strcasecmp has "unspecified behavior" outside the POSIX locale,
5577 but it works fine in practice if at least one argument is ASCII,
5578 as is the case in Bison.
5580 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
5582 * tests/java.at: Skip tests if only one of javac/java is present.
5583 Reported by Joel E. Denny.
5584 * tests/atlocal.in: Adjust copyright years.
5586 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
5588 * data/lalr1.java (Stack): Work around old verifiers that disallow
5589 access to the private fields of an inner class, from the outer class.
5590 We can make Stack's fields public because user code doesn't have access
5591 to the instance of Stack used by parse(). Reported by Paul Eggert.
5593 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
5595 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
5596 the right spot for these files?
5597 * bootstrap.conf (gnulib_modules): Add c-strcase.
5598 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
5600 * src/getargs.c: Include c-strcase.h.
5601 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
5602 to avoid unspecified behavior.
5604 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
5606 * doc/bison.texinfo (Decl Summary): Correct typo.
5608 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
5610 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
5611 Complain if the value does not match empty, "true" or "false".
5612 * data/c++.m4: Adjust default definitions of %define variables.
5613 * data/java.m4: Adjust default definitions of %define variables.
5614 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
5616 * tests/input.at (Boolean %define variables): Test new behavior.
5618 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
5620 * NEWS: Mention java.
5621 * TODO: Remove things that are done.
5622 * bootstrap.conf: Add javacomp-script and javaexec-script.
5623 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
5625 * data/Makefile.am: Add new files.
5626 * data/java-skel.m4: New.
5627 * data/java.m4: New.
5628 * data/lalr1.java: New.
5630 * doc/bison.texinfo: Put "A Complete C++ Example" under
5631 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
5632 under Other Languages.
5634 * src/getargs.c (valid_languages): Add Java.
5635 * src/getargs.h (struct bison_language): Update size of string fields.
5637 * tests/Makefile.am: Add java.at.
5638 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
5639 * tests/java.at: New.
5640 * tests/testsuite.at: Include it.
5642 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
5645 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
5646 at_directive_argv arguments so these no longer have to be global
5647 variables. Also, update the implementation for the following changes.
5648 (fail_for_at_directive_too_many_args,
5649 fail_for_at_directive_too_few_args): Add at_directive_name argument.
5650 (at_directive_name): Remove as at_directive_argv[0] will be used for
5652 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
5653 for the directive name.
5654 (at_directive_argc, at_directive_argv): Make these local within
5655 skel_lex instead of global.
5656 (INITIAL): Update directive start action for above changes.
5657 (SC_AT_DIRECTIVE_ARG): Rename to...
5658 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
5659 (SC_AT_DIRECTIVE_SKIP_WS): Update.
5660 (scan_skel): Move yylex_destroy to...
5661 (skel_scanner_free): ... here.
5662 * tests/skeletons.at (installed skeleton file name): Rename to...
5663 (installed skeleton file names): ... this.
5665 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
5667 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
5668 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
5669 Summary" not "Directives".
5670 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
5671 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
5672 since the former is now the more complete one.
5673 (Prologue Alternatives): Likewise and do the same for %defines.
5674 (Table of Symbols): Add summary of %code, add summary of %define, and
5675 move full %code documentation to...
5676 (Decl Summary): ... here for consistency with other entries in these
5678 Move %define entry in order to keep this list alphabetized.
5679 Reword %define entry a little to put less emphasis on the skeleton
5680 concept, which most users shouldn't have to think about.
5682 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
5684 Adjust to recent gnulib changes.
5685 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
5686 Add string.h, string_.h, unistd_.h, wchar_.h.
5687 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
5688 * src/system.h: Don't include <stpcpy.h>; this is now done by
5691 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
5693 Simplify implementation of unqualified %code, implement macros for
5694 uniform treatment of boolean %define flags. Document %define.
5695 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
5696 b4_percent_code_ifdef): New.
5697 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
5698 * data/c++.m4: Define default value for global_tokens_and_yystype.
5699 * data/glr.cc: Likewise.
5700 * data/location.cc: Use b4_percent_define_flag_if.
5702 * doc/bison.texinfo (Decl Summary): Document %define.
5704 * src/parse-gram.y (Unqualified %code): Change muscle name to
5706 (content.opt): Default to empty.
5708 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
5710 Implement support for relative and absolute skeleton file names.
5711 Discussed starting at
5712 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
5713 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
5714 (Bison Options): Document in --skeleton entry.
5715 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
5716 full_skeleton can't necessarily hold all of pkgdatadir.
5717 If the specified skeleton file name contains a `/', don't prepend
5719 * src/parse-gram.y (prologue_declaration): If the specified skeleton
5720 file name contains a `/', prepend the grammar file directory.
5721 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
5722 * skeletons.at: New file.
5723 (relative skeleton file names): New test case.
5724 (installed skeleton file names): New test case.
5725 * tests/testsuite.at: Include skeletons.at.
5727 * bootstrap: Update copyright to 2007.
5729 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
5731 * bootstrap: Remove occurrences of .#bootmp from the files.
5733 2007-01-17 Akim Demaille <akim@epita.fr>
5735 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
5737 Use per-type %printer.
5739 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
5741 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
5742 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5743 djgpp/config.site, src/files.c, src/files.h, src/main.c,
5744 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
5745 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
5746 tests/glr-regression.at, tests/input.at, tests/local.at,
5747 tests/output.at, tests/torture.at: Update copyright to 2007.
5749 2007-01-16 Akim Demaille <akim@epita.fr>
5751 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
5753 (Calc++ Scanner): Exit with failure if we can't open the input
5755 Accept "-" standing for stdin.
5756 (Calc++ Top Level): Print the result only if the parsing was
5759 2007-01-16 Akim Demaille <akim@epita.fr>
5761 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
5763 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
5764 and Joel E. Denny <jdenny@ces.clemson.edu>
5766 Clean up %define and %code implementation in M4 some. Most
5767 importantly, rename all related macros to be in the b4_percent_define
5768 and b4_percent_code namespaces. Also, complete support for `.' in
5769 %define variable names and %code qualifiers.
5770 * data/bison.m4 (b4_check_user_names): Check for special
5771 "SKELETON-NAMESPACE(name)" macros instead of using two nested
5773 (b4_get_percent_define, b4_get_percent_code): Rename to...
5774 (b4_percent_define_get, b4_percent_code_get): ... these.
5775 Extend documentation with examples.
5776 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
5777 b4_percent_define_skeleton_variables and
5778 b4_percent_code_skeleton_qualifiers.
5779 Expect any value for the %define variable `foo' to be stored in the
5780 macro named `b4_percent_define(foo)'; expect any %code blocks for the
5781 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
5782 expect any unqualified %code blocks to be stored in a macro named
5783 `b4_percent_code_unqualified'.
5784 Use m4_indir so that %define variable names and %code qualifiers can
5785 contain `.', which is allowed by the grammar parser.
5786 (b4_percent_define_default): New macro to set a default value for a
5788 (m4_wrap): Update wrapped code, and fix some underquoting.
5789 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
5790 Expect grammar uses of %define variables and %code qualifiers to be
5791 defined in b4_percent_define_user_variables and
5792 b4_percent_code_user_qualifiers.
5793 * data/c++.m4: Use b4_percent_define_default rather than
5794 m4_define_default. Fix some underquoting. Skeleton usage of %define
5795 variable define_location_comparison now implies skeleton usage of
5796 %define variable filename_type.
5797 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5798 data/push.c, data/yacc.c: Update macro names.
5799 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
5802 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5804 DJGPP specific issues.
5806 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
5807 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
5809 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5811 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
5812 run parsers in all tests so that Valgrind is invoked during
5813 maintainer-check-valgrind.
5814 (Duplicate representation of merged trees): Free all semantic values.
5815 (Duplicated user destructor for lookahead): Likewise.
5817 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5819 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
5820 command-line prefix.
5821 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
5822 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
5823 miss Valgrind messages.
5824 (Exploding the Stack Size with Malloc): Likewise.
5826 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5828 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
5829 locals. Reported by Juan Manuel Guerrero at
5830 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
5831 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
5832 Fix some indentation also.
5833 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
5834 explaining this issue.
5836 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
5837 and Joel E. Denny <jdenny@ces.clemson.edu>
5839 Simplify union and prologue handling, and escape union and lex/parse
5840 params with digraphs.
5841 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
5842 values to the empty string since these are no longer guaranteed
5843 initialized by the front-end.
5844 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
5845 braces around b4_user_stype since this is no longer done by the
5847 * src/files.c, src/files.h (pre_prologue_obstack,
5848 post_prologue_obstack): Remove.
5849 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
5850 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
5851 with digraphs. This fixes lex params and parse params.
5852 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
5853 * src/output.c (prepare): Remove muscle insertion of the prologues.
5854 (output): Remove freeing of pre_prologue_obstack and
5855 post_prologue_obstack.
5856 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
5857 than prologue_augment for prologue parsing so you don't need prologue
5859 (grammar_declaration): For %union RHS, use `braceless' instead of
5860 "{...}" so that braces are already stripped and code is escaped with
5862 * src/reader.c (prologue_augment): Remove.
5863 (reader): Remove initialization of pre_prologue_obstack and
5864 post_prologue_obstack.
5865 * src/reader.h (prologue_augment): Remove.
5867 * data/c.m4: Remove stray parenthesis.
5869 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5871 Remove quotes from variables names in %define directives and from
5872 qualifiers in %code directives, and restrict the characters that are
5873 allowed in them to M4-friendly ones. For %define, continue to support
5874 the quoted form as a deprecated feature. Discussed starting at
5875 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
5876 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
5878 * doc/bison.texinfo (Prologue Alternatives): Update.
5879 (Decl Summary): In %defines entry, update mention of `%code requires'
5880 and `%code provides'.
5881 (C++ Location Values): Update %define uses.
5882 (Calc++ Parser Interface): Likewise.
5883 (Calc++ Parser): Likewise, and update `%code requires' uses.
5884 (Table of Symbols): Update %code documentation.
5885 * src/parse-gram.y (prologue_declaration): For %define variables, use
5886 `variable' instead of `STRING'.
5887 (grammar_declaration): For %code qualifiers, use `ID' instead of
5889 (variable): New nonterminal that takes an `ID' or a `STRING'.
5890 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
5892 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
5893 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
5894 (%define errors): Update %define uses.
5896 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5898 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
5899 instead of muscle_insert for %define values so that M4-special
5900 characters are replaced with digraphs.
5901 * tests/input.at (%define errors): Extend to check weird values.
5903 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5905 Instead of having skeletons declare all valid %define variables and
5906 %code qualifiers, provide macros that retrieve the associated values
5907 and build these lists automatically. Thus Bison will now warn when a
5908 variable or qualifier is not used by the skeleton in the current
5909 invocation regardless of whether it might sometimes be used by that
5910 skeleton in other invocations. Also, move all %define value macros to
5911 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
5912 form, which is replaced by %code.
5913 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
5914 (b4_check_user_names): ... this, and change the series of valid name
5915 arguments to a single list argument for names used in the skeleton
5916 similar to the existing list argument for names used in the grammar.
5917 Warn instead of complaining.
5918 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
5919 values and %code code, to format %code code properly, and to build
5920 lists of all %define variables and %code qualifiers used in the
5921 skeleton: b4_skeleton_percent_define_variables and
5922 b4_skeleton_percent_code_qualifiers.
5923 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
5925 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
5926 the skeleton names lists can finish building first. In place of
5927 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
5928 expect the lists b4_user_percent_define_variables and
5929 b4_user_percent_code_qualifiers.
5930 * data/c++.m4: Where setting default values for b4_parser_class_name,
5931 b4_location_type, b4_filename_type, b4_namespace, and
5932 b4_define_location_comparison, update their names to the
5933 b4_percent_define_ namespace.
5934 * data/glr.c: Don't use b4_check_percent_define_variables and
5935 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5936 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
5937 (b4_parser_class_name, b4_namespace): Define these using
5938 b4_get_percent_define for parser_class_name and namespace.
5939 * data/location.cc: Use b4_get_percent_define.
5940 * data/push.c: Don't use b4_check_percent_define_variables and
5941 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5942 * data/yacc.c: Likewise, and don't call m4_exit in
5943 b4_use_push_for_pull_if or m4_wrap code will never execute.
5944 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
5946 (muscle_grow_user_name_list): ... this for consistency with the
5947 terminology used in bison.m4.
5948 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
5949 %define variable names, and rename muscle used_percent_define_variables
5950 to user_percent_define_variables.
5951 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
5952 user_percent_code_qualifiers.
5954 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
5955 {CODE} form is no longer accepted.
5956 * tests/input.at (Reject bad %code qualifiers): Rename to...
5957 (Reject unused %code qualifiers): ... this, and update test output.
5958 (%define error): Update test output.
5960 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
5962 Check for unrecognized %define variables similar to checking for
5963 unrecognized %code qualifiers. Check for redefined %define variables.
5964 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
5966 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
5967 (b4_check_percent_define_variables): New, also wraps it.
5968 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
5969 variables using b4_check_percent_define_variables.
5970 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
5971 all those exercised in the test suite and all those listed in the
5972 `Default values' section of c++.m4. Are there others?
5973 * data/push.c, data/yacc.c: Declare no valid %define variables.
5974 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
5975 similar to muscle_find, but it works even when the muscle stores a
5977 (muscle_grow_used_name_list): New function for constructing the used
5978 name list muscles that b4_check_for_unrecognized_names requires.
5979 * src/parse-gram.y (prologue_declaration): Warn if a variable is
5980 %define'd more than once. Define the b4_used_percent_define_variables
5981 muscle with muscle_grow_used_name_list.
5982 (grammar_declaration): Abbreviate %code code with
5983 muscle_grow_used_name_list.
5984 * tests/input.at (%define errors): New.
5986 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5988 Provide warn_at, complain_at, and fatal_at function callbacks to the
5989 skeletons, and use this for %code qualifier complaints.
5990 * data/bison.m4 (b4_error_at): New, invoked by...
5991 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
5992 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
5993 @fatal_at(...@) directives.
5994 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
5995 qualifiers in b4_used_percent_code_qualifiers and to use
5997 * src/location.c, src/location.h (boundary_set_from_string): New global
5999 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
6001 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
6002 to b4_used_percent_code_qualifiers.
6003 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
6005 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
6006 (lineno): Rename to...
6007 (out_lineno): ... this so I don't misunderstand it again.
6008 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
6009 here; these newlines are in the input but not the output file.
6010 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
6011 (at_directive_perform): ... this new static function, and add handling
6012 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
6014 * tests/input.at (Reject bad %code qualifiers): Update test output with
6015 locations and extend.
6017 * tests/output.at (Output file name: [, Output file name: ]): Remove
6018 bogus comment about these tests failing.
6020 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6022 Clean up b4_check_percent_code_qualifiers a little.
6023 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
6024 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
6025 documentation and add examples.
6026 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
6029 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
6031 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
6032 unreliable -- especially when they're hidden inside another macro.
6033 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
6034 data/c.m4: Remove m4_divert(-1).
6035 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6036 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
6037 m4_divert_push(0) and m4_divert_pop(0).
6038 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
6039 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
6040 pushed and popped by m4sugar, should be first on the stack.
6042 Provide warn, complain, and fatal function callbacks to the skeletons.
6043 This provides more flexibility than m4_fatal, improves the error
6044 message format, and captures messages for translation. Discussed
6046 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
6047 * data/bison.m4 (b4_error): New, invoked by...
6048 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
6049 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
6050 directives. Because these M4 macros might be called when the current
6051 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
6052 the previous removal of uses of m4_divert, which caused trouble.
6053 (b4_check_percent_code_qualifiers): Use b4_complain instead of
6054 m4_fatal to report unrecognized %code qualifiers.
6055 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
6056 push parser requests.
6057 * data/glr.c: Use b4_complain instead of m4_fatal to report
6058 non-deterministic push parser requests.
6059 Update @output usage to @output(...@) form.
6060 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
6061 report missing %defines. Update @output usage to @output(...@) form.
6062 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
6064 * src/main.c (main): Invoke skel_scanner_free.
6065 * src/scan-skel.h (skel_scanner_free): Prototype new function.
6066 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
6067 obstack_for_string from flex-scanner.h.
6068 (YY_DECL): Use to declare skel_lex static.
6069 (decode_at_digraphs): Remove; now handled in the new
6070 SC_AT_DIRECTIVE_ARG start condition.
6071 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
6073 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
6074 at_directive_argv): New static globals.
6075 (INITIAL): Use fail_for_invalid_at.
6076 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
6077 recognize the start of a generalized `@directive(...@)' form and
6079 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
6080 directive args (using the new obstack_for_string), to decode the
6081 contained @ diagraphs, and to perform the directive. It recognizes
6082 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
6084 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
6085 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
6087 (scan_skel): Initialize obstack_for_string on the first call.
6088 (skel_scanner_free): New function to free obstack_for_string.
6089 * tests/input.at (Reject bad %code qualifiers): Update test output.
6091 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
6093 Consolidate the 4 prologue alternative directives (%code, %requires,
6094 %provides, and %code-top) into a single %code directive with an
6095 optional qualifier field. Discussed at
6096 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
6097 * NEWS (2.3a+): Rewrite the existing entry for the prologue
6099 * doc/bison.texinfo (Prologue Alternatives): Update.
6100 (Decl Summary): Update to %code "requires" and %code "provides".
6101 (Calc++ Parser): Update to %code "requires".
6102 (Table of Symbols): Remove entries for %requires, %provides, and
6103 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
6104 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
6105 are replaced by b4_percent_code_provides and b4_percent_code_requires,
6106 which are skeleton-specific.
6107 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
6108 declare what %code qualifiers it supports and to complain if any other
6109 qualifiers were used in the grammar.
6110 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
6111 and b4_user_code([b4_percent_code_provides]) in place of
6112 b4_user_requires and b4_user_provides.
6113 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
6114 Add b4_user_code([b4_percent_code_top]) and
6115 b4_user_code([b4_percent_code]).
6116 Invoke b4_check_percent_code_qualifiers.
6117 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
6118 PERCENT_REQUIRES): Remove.
6119 (grammar_declaration): Remove RHS's for %code-top, %provides, and
6120 %requires. Rewrite the %code RHS as the unqualified form defining the
6121 muscle b4_percent_code. Add another RHS for the qualified %code form,
6122 which defines muscles of the form b4_percent_code_QUALIFIER and the
6123 b4_used_percent_code_qualifiers muscle.
6124 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
6125 PERCENT_REQUIRES): Remove.
6126 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
6127 %code "requires" and %code "provides".
6128 * tests/input.at (Reject bad %code qualifiers): New.
6130 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
6132 Use the new code_props interface for destructors and printers.
6133 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
6134 printer_location members, and change the type of the destructor and
6135 printer members to code_props.
6136 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
6137 symbol_printer_get, semantic_type_destructor_set,
6138 semantic_type_printer_set, default_tagged_destructor_set,
6139 default_tagless_destructor_set, default_tagged_printer_set,
6140 default_tagless_printer_set): Use code_props in arguments and return
6141 types in place of char const * and location.
6142 (symbol_destructor_location_get, symbol_printer_location_get): Remove
6143 since the locations are now contained in the return of
6144 symbol_destructor_get and symbol_printer_get.
6145 * src/output.c (symbol_destructors_output, symbol_printers_output):
6147 (symbol_code_props_output): ... this to eliminate duplicate code.
6148 (output_skeleton): Update to use symbol_code_props_output.
6149 * src/reader.c (symbol_should_be_used): Update use of
6150 symbol_destructor_get.
6151 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
6152 Update uses of the various _destructor_set and _printer_set functions.
6153 * src/symtab.c: (default_tagged_destructor_location,
6154 default_tagless_destructor_location, default_tagged_printer_location,
6155 default_tagless_printer_location): Remove since we...
6156 (default_tagged_destructor, default_tagless_destructor,
6157 default_tagged_printer, default_tagless_printer): ... change the type
6158 of these to code_props.
6159 (symbol_new, semantic_type_new, symbol_destructor_set,
6160 semantic_type_destructor_set, symbol_destructor_get,
6161 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
6162 symbol_check_alias_consistency, default_tagged_destructor_set,
6163 default_tagless_destructor_set, default_tagged_printer_set,
6164 default_tagless_printer_set): Update.
6165 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
6166 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
6168 (symbol_print): Use SYMBOL_CODE_PRINT.
6170 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
6172 Use the new code_props interface for rule actions.
6173 * src/symlist.h (symbol_list): Replace action, action_location, and
6174 used members with a code_props action_props member.
6175 * src/reader.c (symbol_should_be_used, grammar_rule_check,
6176 grammar_midrule_action, grammar_current_rule_merge_set,
6177 grammar_current_rule_symbol_append, packgram): Update.
6178 * src/scan-code.h (translate_rule_action): Remove, no longer used.
6179 * src/scan-code.l (handle_action_dollar): Update.
6180 (translate_rule_action): Remove, no longer used.
6181 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
6183 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6185 Use the new code_props interface in parse-gram.y.
6186 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
6187 Update all uses of translate_* functions to use the new code_props
6188 interface and to use gram_scanner_last_string_free and
6189 code_scanner_last_string_free where possible.
6190 (grammar_declaration): symbol_list_destructor_set and
6191 symbol_list_printer_set now perform the translation, so don't do it
6192 here. Use gram_scanner_last_string_free where possible.
6193 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
6194 translate_code): Remove, no longer used.
6195 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
6196 symbol_list_printer_set): Perform code translation here rather than
6197 depending on the caller to do so.
6199 * src/symlist.h (struct symbol_list): Correct some documentation typos.
6200 * src/scan-gram.h (gram_last_string): Remove declaration.
6201 * src/scan-gram.l (last_string): Declare it static.
6203 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6205 Encapsulate code properties and related functionality for the various
6206 destructors, printers, and actions into a code_props structure and
6207 interface. This patch merely implements code_props in scan-code.h and
6208 scan-code.l. Future patches will rewrite other modules to use it.
6209 Discussed starting at
6210 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
6211 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
6212 consistently initialize const structs that have an empty location
6214 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
6215 to ensure consistency.
6216 * src/scan-code.h (code_props): New structure.
6217 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
6218 function, macro, and const global variable for initializing a
6219 code_props with no code.
6220 (code_props_plain_init, code_props_symbol_action_init,
6221 code_props_rule_action_init, code_props_translate_code): The rest of
6222 the new code_props functional interface. Among other things, the init
6223 functions set the code_props kind field so that
6224 code_props_translate_code will know whether to behave like
6225 translate_symbol_action, translate_rule_action, or translate_code.
6226 These old translate functions must remain until all other modules are
6227 updated to use the new code_props interface.
6228 (code_scanner_last_string_free): New function similar to
6229 gram_scanner_last_string_free.
6230 (code_scanner_free): Add documentation.
6231 * src/scan-code.l: Implement the new interface.
6232 (code_lex): Make it static, add a code_props* argument, and remove the
6234 (last_string): New static global similar to the one in scan-gram.l.
6235 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
6237 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
6238 code_props since Bison may one day use this information for destructors
6240 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
6241 (handle_action_dollar): Use symbol_list_n_get and set used flag
6242 directly since symbol_list_n_used_set is removed.
6243 (translate_action): Add a code_props* argument and remove the rule,
6244 action, and location arguments. Pass the code_props* on to code_lex.
6245 (translate_rule_action, translate_symbol_action, translate_code):
6246 Rewrite as wrappers around the new code_props interface.
6247 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
6248 it would eventually need to break the encapsulation of code_props.
6250 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
6252 * etc/.cvsignore: New.
6254 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
6256 Add maintainer-push-check to run maintainer-check using push parsing in
6257 place of pull parsing where available.
6258 * Makefile.am (maintainer-push-check): New.
6259 * data/bison.m4 (b4_use_push_for_pull_if): New.
6260 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
6261 appropriately based on their existing values.
6262 (yypush_parse): Don't print push-parser-specific diagnostics if push
6263 parsing is being used in place of pull parsing.
6264 * data/yacc.c: If push parsing should replace pull parsing, redirect to
6266 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
6267 variable, and insert b4_use_push_for_pull_flag into muscles.
6268 * tests/Makefile.am (maintainer-push-check): New.
6270 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
6272 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
6273 (whether successful or failed) so that yypush_parse can be invoked
6274 again to start a new parse using the same yypstate.
6275 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
6276 check multiple yypull_parse invocations on the same yypstate. For pull
6277 mode, extend to check multiple yyparse invocations.
6278 (Exploding the Stack Size with Alloca): Extend to try with
6280 (Exploding the Stack Size with Malloc): Likewise.
6282 * tests/calc.at (Simple LALR Calculator): Don't specify
6283 %skeleton "push.c" since %push-pull-parser implies that now.
6284 * tests/headers.at (export YYLTYPE): Don't check for the push
6285 declarations. Otherwise, this test case can't be used to see if push
6286 mode can truly emulate pull mode.
6287 * tests/input.at (Torturing the Scanner): Likewise.
6288 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
6289 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
6290 AT_YACC_IF, which now includes the case of push mode since %skeleton
6291 need not be used for push mode. This will be more intuitive once
6292 push.c is renamed to yacc.c.
6294 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
6296 For push mode, convert yyparse from a macro to a function, invoke yylex
6297 instead of passing a yylexp argument to yypull_parse, and don't
6298 generate yypull_parse or yyparse unless %push-pull-parser is declared.
6299 Discussed starting at
6300 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
6301 * data/bison.m4 (b4_pull_if): New.
6302 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
6303 * data/push.c: Improve M4 quoting a little.
6304 (b4_generate_macro_args, b4_parenthesize): Remove.
6305 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
6306 any time a pull parser is requested.
6307 Don't #define this as a wrapper around yypull_parse. Instead, when
6308 both push and pull are requested, make it a function that does that
6310 (yypull_parse): If there's a b4_prefix, #define this to
6311 b4_prefix[pull_parse] when both push and pull are requested.
6312 Don't define this as a function unless both push and pull are
6314 Remove the yylexp argument and hard-code yylex invocation instead.
6315 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
6317 * src/getargs.c (pull_parser): New global initialized to true.
6318 * getargs.h (pull_parser): extern it.
6319 * src/output.c (prepare): Insert pull_flag muscle.
6320 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
6321 (prologue_declaration): Set both push_parser and pull_parser = true for
6322 %push-pull-parser. Set push_parser = true and pull_parser = false for
6324 * src/scan-gram.l: Don't accept %push_parser as an alternative to
6325 %push-parser since there's no backward-compatibility concern here.
6326 Scan %push-pull-parser.
6327 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
6328 instead of %push-parser.
6329 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
6330 prototype it in the module that calls yyparse.
6331 * tests/input.at (Torturing the Scanner): Likewise.
6332 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
6334 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
6336 Update etc/bench.pl. Optimize push mode a little (the yyn change
6337 deserves most of the credit).
6338 * Makefile.am (SUBDIRS): Add etc subdirectory.
6339 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
6340 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
6341 yytoken, yyval, and yyloc declarations to...
6342 (yyparse or yypush_parse): ... here to improve performance. For
6343 yypush_parse invocations after the first, be sure to assign yyn its old
6345 (yypstate_new): Don't bother initializing the yyresult field since the
6346 initial value isn't used.
6347 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
6348 remove the #define that, in push mode, set it to yyps->NAME.
6349 * etc/Makefile.am: New.
6350 * etc/bench.pl: Remove and build it instead from...
6351 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
6352 "tests/bison" from the build directory by default rather than just
6353 invoking "bison" from $PATH.
6354 (calc_grammar): Update push parser code: don't declare yylval globally,
6355 don't define yyparse_wrapper, and don't #define yyparse.
6356 (bench_grammar): Update to check all working combinations of yacc.c,
6357 push.c, impure, pure, pull, and push.
6359 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
6361 For push mode, add pull wrappers around yypush_parse.
6362 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
6363 (yypull_parse): New function wrapping yypush_parse.
6364 (yyparse): New #define wrapping yypull_parse.
6365 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
6367 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
6368 prototype yylex in the module that calls yyparse, and don't prototype
6369 yyparse there. Otherwise, the yyparse expansion won't compile.
6370 * tests/input.at (Torturing the Scanner): Likewise.
6372 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
6374 Enable push parsers to operate in impure mode. Thus, %push-parser no
6375 longer implies %pure-parser. The point of this change is to move
6376 towards being able to test the push parser code by running the entire
6377 test suite as if %push-parser had been declared.
6378 * data/push.c (yypush_parse): For impure mode, remove the
6379 yypushed_char, yypushed_val, and yypushed_loc arguments.
6380 Instead, declare these as local variables initialized to the global
6381 yychar, yylval, and yylloc.
6382 For the first yypush_parse invocation only, restore the initial values
6383 of these global variables when it's time to read a token since they
6384 have been overwritten.
6385 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
6387 * tests/calc.at (Simple LALR(1) Calculator): Always declare
6388 %pure-parser along with %push-parser since this test case was designed
6389 for pure push parsers.
6390 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
6391 (AT_YACC_OR_PUSH_IF): New.
6392 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
6393 add a note that it's still wrong for some cases (as it has been for a
6395 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
6396 %push-parser no longer implies %pure-parser.
6398 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
6400 Remove some unnecessary differences between the pull parser code and
6401 the push parser code. This patch enables yynerrs in push mode.
6402 * data/push.c: Reformat M4 a little.
6403 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
6404 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
6405 because push mode is on. Instead, if pure mode is on, move yynerrs
6407 (b4_declare_parser_state_variables): ... here.
6408 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
6409 to yyps->NAME so it can be used in yypush_parse.
6410 (yypush_parse): Don't omit uses of yynerrs in push mode.
6412 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
6414 Fix bug such that the first pushed token's value and location are
6415 sometimes overwritten (sometimes by %initial-action) before being used.
6416 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
6417 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
6418 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
6419 more closely mimic the pull parser logic.
6420 Don't copy the pushed token to yychar, yylval, and yylloc until it's
6421 time to read a token, which is after any initialization of yylval and
6423 (gottoken): Rename label to...
6424 (yyread_pushed_token): ... for clarity and to avoid infringing on the
6427 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
6429 Rearrange initialization of the parser state variables so that the
6430 skeleton doesn't have to have a copy for pull mode and another for push
6431 mode. This patch also fixes at least a bug such that yylloc was not
6432 initialized (with b4_location_initial_line and
6433 b4_location_initial_column) upon calling yypush_parse. However, that
6434 initialization now overwrites the first token's location;
6435 %initial-action assigning @$ already did the same thing, and both bugs
6436 will be fixed in a later patch.
6437 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
6438 (b4_declare_parser_state_variables): Remove initialization of yytoken,
6439 yyss, yyvs, yyls, and yystacksize.
6440 (yypstate_new): Remove initialization of some yypstate fields: yystate,
6441 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
6443 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
6444 yyps->NAME so it can be used in yypush_parse.
6445 (yyparse or yypush_parse): For yypush_parse, don't print the
6446 "Starting parse" diagnostic for invocations after the first.
6447 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
6448 yypush_parse, only do it for the first invocation.
6449 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
6450 initialization to occur in yypush_parse but only on the first
6453 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6455 * data/push.c: Add CPP guards around push parser declarations in both
6456 the header and the code file.
6457 In the code file, move the push parser declarations to the same place
6458 they appear in the header file.
6459 Clean up the M4 some, especially the inconsistent underquoting in
6460 some b4_c_function_def and b4_c_function_decl uses.
6462 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6464 Encapsulate the push parser state variables into an M4 macro so the
6465 push skeleton doesn't have to list them again for pull mode's yyparse.
6466 For push mode, remove yypush_parse's local equivalents of these
6467 variables to eliminate unnecessary copying between the two sets at
6468 run-time. This patch also fixes at least a bug related to multiple
6469 %initial-action invocations in push mode.
6470 * data/push.c (b4_declare_parser_variables): Rename to...
6471 (b4_declare_scanner_communication_variables): ... this for clarity and
6473 (b4_declare_yyparse_variables): Remove and move its contents to the one
6474 spot where it was invoked.
6475 (b4_declare_parser_state_variables): New macro containing the parser
6476 state variables required by push mode.
6477 (struct yypstate): Replace all fields but yynew with
6478 b4_declare_parser_state_variables.
6479 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
6480 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
6481 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
6482 (yyparse or yypush_parse): For yyparse in pull mode, replace local
6483 parser state variable declarations with
6484 b4_declare_parser_state_variables.
6485 Don't initialize parser state variables when calling yypush_parse since
6486 yypstate_new already does that.
6487 Invoke the user's initial action only upon the first yypush_parse
6489 Remove all code that copies between the local parser state variables
6492 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6494 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
6495 prevent a name collision in a future patch where these names will
6496 sometimes be #define'd.
6497 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
6498 since it no longer has the same name as the existing argument.
6499 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
6501 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
6502 and Joel E. Denny <jdenny@ces.clemson.edu>
6504 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
6505 that the argument is case-insensitive, and there's no `=' here.
6506 For the %skeleton entry, mention that %language is better.
6507 (Bison Options): Likewise for --language and --skeleton. Move the
6508 --skeleton entry so that the `Tuning the parser' section is sorted
6509 alphabetically on long options.
6510 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
6511 %language directive in detail here; cross-reference the %language
6512 documentation instead.
6513 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
6514 `%require "2.3b"' so that the example is always up-to-date.
6515 (Table of Symbols): Add entries for %language and %skeleton.
6516 * examples/extexi (normalize): Instead of replacing every %require
6517 argument with the current Bison version, just substitute for
6518 `@value{VERSION}'. This guarantees that we're testing what actually
6519 appears in the documentation.
6520 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
6521 rather than `@VERSION@'.
6523 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
6525 * NEWS: Reword the %language news a bit, and put it earlier.
6527 * src/getargs.c (skeleton_arg): Last arg is now location const *.
6528 Rewrite to simplify the logic.
6529 (language_argmatch): Likewise.
6530 (program_name): We now own this var.
6531 * src/getargs.h (struct bison_language): Use char[] rather than
6534 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
6536 * src/complain.c (program_name): Remove decl; no longer needed.
6537 * src/main.c (program_name): Remove; now belongs to getargs.
6539 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
6541 * NEWS: Document %language.
6543 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
6545 * data/c-skel.m4, data/c++-skel.m4: New files.
6546 * data/glr.c: Complain on push parsers.
6548 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
6550 (Decl Summary): Document %language and %skeleton.
6551 (Command line): Document -L.
6553 * examples/extexi: Rewrite %require directive.
6554 * examples/calc++/Makefile.am: Pass VERSION to extexi.
6556 * src/files.c (compute_exts_from_gc): Look in language structure
6558 (compute_file_name_parts): Check whether .tab should be added.
6559 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
6560 (language, skeleton_arg, language_argmatch): New.
6561 (long_options): Add --language.
6562 (getargs): Use skeleton_arg, add -L/--language.
6563 * src/getargs.h: Include location.h.
6564 (struct bison_language, language, skeleton_arg, language_argmatch): New.
6565 * src/output.c (prepare): Pick default skeleton from struct language.
6566 Don't dispatch C skeletons here.
6567 * src/parse-gram.y (PERCENT_LANGUAGE): New.
6568 (prologue_declaration): Add "%language" rule, use skeleton_arg.
6569 * src/scan-gram.l ("%language"): New rule.
6571 * tests/calc.at: Test %skeleton and %language.
6572 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
6573 (AT_GLR_IF): Look for %skeleton "glr.cc".
6574 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
6575 (AT_YACC_IF): Reject %language.
6577 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
6579 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
6580 since it wasn't used; only the typedef name 'semantic_type' is needed.
6581 Also, omit trailing white space.
6583 * bootstrap: Sync from coreutils.
6584 (gnulib_extra_files): Add build-aux/announce.gen.
6585 (slurp): Adjust .gitignore files like .cvsignore files.
6586 * build-aux/announce-gen: Remove from CVS, since bootstrap
6589 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
6591 Make %push-parser imply %pure-parser. This fixes several bugs; see
6592 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
6593 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
6595 * data/push.c: Don't bother testing b4_push_if when deciding whether
6596 to expand b4_declare_parser_variables globally.
6597 (yypush_parse): Likewise in here.
6599 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
6600 (yy_reduce_print): Reformat M4 for readability.
6602 2006-12-15 Bob Rossi <bob@brasko.net>
6603 and Joel Denny <jdenny@ces.clemson.edu>
6605 * data/push.c (yypstate): Add typedef, and update all uses of
6606 struct yypstate to just yypstate.
6607 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
6609 2006-12-14 Bob Rossi <bob@brasko.net>
6611 * data/push.c (yypush_parse): Declare prototype regardless of
6614 2006-12-14 Bob Rossi <bob@brasko.net>
6616 * data/push.c (yyparse): Remove the prototype and the #define when in
6619 2006-12-13 Bob Rossi <bob@brasko.net>
6621 * data/push.c (yypstate_init): Rename to...
6622 (yypstate_new): ... this and use b4_c_function_def.
6623 (yypstate_delete): New.
6624 (yypush_parse): Change parameters yynval and yynlloc to be const.
6625 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
6626 yypstate_delete functions.
6628 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
6630 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
6631 strange test case titles. Reported by Bob Rossi.
6633 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
6635 * TODO: Add pointer to Sylvain Schmitz's work on static detection
6636 of potential ambiguities in GLR grammers.
6638 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
6640 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
6641 `bison ', use m4_index instead of m4_substr since chopping up a string
6642 containing M4-special characters causes problems here.
6644 Fix a couple of bugs related to special characters in user-specified
6645 file names, and make it easier for skeletons to compute output file
6646 names with the same file name prefix as Bison-computed output file
6648 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
6649 b4_parser_file_name and b4_spec_defines_file instead of
6650 @output_parser_name@ and @output_header_name@, which are now redundant.
6651 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
6652 b4_parser_file_name, b4_spec_defines_file, and the new
6653 @basename(FILENAME@) instead of @output_parser_name@ and
6654 @output_header_name@, which inappropriately escaped the file names as
6656 * src/files.c (all_but_ext): Remove static qualifier.
6657 (compute_output_file_names): Move `free (all_but_ext)' to...
6658 (output_file_names_free): ... here since all_but_ext is needed later.
6659 * src/files.h (all_but_ext): Extern.
6660 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
6661 exactly what MUSCLE_INSERT_STRING used to do.
6662 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
6663 characters are escaped properly.
6664 * src/output.c (prepare): Define muscle file_name_all_but_ext as
6666 For pkgdatadir muscle, maintain previous functionality by using
6667 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
6668 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
6669 digraphs would never be expanded. Hopefully no one has M4-special
6670 characters in his Bison installation path.
6671 * src/scan-skel.l: Don't parse @output_header_name@ and
6672 @output_parser_name@ anymore since they're now redundant.
6673 In @output, use decode_at_digraphs.
6674 Parse a new @basename command that invokes last_component.
6675 (decode_at_digraphs): New.
6676 (BASE_QPUTS): Remove unused.
6677 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
6678 (Output file name): New tests.
6680 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
6682 Warn about output files that are generated by the skeletons and that
6683 conflict with other output files.
6684 * data/glr.c: Don't generate the header file here when glr.cc does.
6685 * src/files.c (file_names, file_names_count): New static globals.
6686 (compute_output_file_names): Invoke output_file_name_check for files
6687 not generated by the skeletons and remove existing checks.
6688 (output_file_name_check): New function that warns about conflicting
6690 (output_file_names_free): Free file_names.
6691 * src/files.h (output_file_name_check): Declare.
6692 * src/scan-skel.l: Invoke output_file_name_check for files generated by
6694 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
6695 (Conflicting output files): New tests.
6697 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6699 * doc/bison.texinfo: Fix a couple of typos.
6701 2006-12-08 Bob Rossi <bob@brasko.net>
6703 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
6705 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
6707 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
6708 (yypush_parse): Rename yypvars argument to yyps and remove redundant
6710 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
6711 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
6713 2006-12-07 Bob Rossi <bob@brasko.net>
6714 and Joel Denny <jdenny@ces.clemson.edu>
6716 * data/push.c (yypvarsinit): Change return type from void* to struct
6717 yypvars*. No longer cast to void* on return.
6718 (struct yypvars): Remove yylen since it need not be remembered between
6719 yypushparse invocations.
6720 (yypushparse): Don't copy between yylen and pv->yylen.
6722 2006-12-05 Bob Rossi <bob@brasko.net>
6724 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
6725 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
6726 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
6727 (struct yypvars): Remove b4_declare_parser_variables.
6728 (yypvarsinit): Remove init code for removed variables.
6729 (global scope): Do not declare b4_declare_parser_variables if
6731 (yypushparse): Add b4_declare_parser_variables.
6732 Init new local variables, and remove init code for removed
6735 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
6736 and yyparse for other modes.
6737 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
6738 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
6739 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
6740 (AT_PURE_LEX_IF): True if pure or push parser.
6742 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
6744 Document Yacc prologue alternatives and default %destructor's and
6745 %printer's as experimental. Don't mention Java yet. Discussed at
6746 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
6747 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
6748 (2.3a): Annotate this entry to say the old forms of these features were
6750 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
6751 Table of Symbols): Say they're experimental. Comment out any mention
6752 of Java (we'll want this back eventually).
6754 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
6756 Support a file name argument to %defines. Deprecate `=' in
6757 %file-prefix, %name-prefix, and %output. Discussed at
6758 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
6759 * NEWS (2.3a+): Mention.
6760 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
6761 form of %defines, and remove `=' from entries for %file-prefix,
6762 %name-prefix, and %output.
6763 * src/parse-gram.y (prologue_declaration): Implement.
6764 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
6765 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
6766 all but one occurrence of %name-prefix.
6767 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
6768 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
6769 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
6770 occurrence of each of %file-prefix and %output. Add check for %defines
6772 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
6773 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
6774 Remove the `=' from %output.
6776 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
6778 Don't escape $ in test case titles since Autoconf 2.61 now does that
6780 * tests/actions.at (Default %printer and %destructor are not for error
6781 or $undefined): Here.
6782 (Default %printer and %destructor are not for $accept): Here.
6783 * tests/input.at (Invalid $n and @n): Here.
6785 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
6787 Rename <!> to <>. Discussed starting at
6788 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
6789 * NEWS (2.3a+): Update.
6790 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
6792 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
6793 * src/scan-gram.l (INITIAL): Implement.
6794 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
6795 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
6797 * tests/actions.at (Default tagless %printer and %destructor,
6798 Default tagged and per-type %printer and %destructor,
6799 Default %printer and %destructor are not for error or $undefined,
6800 Default %printer and %destructor are not for $accept,
6801 Default %printer and %destructor for mid-rule values): Update.
6802 * tests/input.at (Default %printer and %destructor redeclared,
6803 Unused values with default %destructor): Update.
6805 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
6807 Don't let %prec take a nonterminal.
6808 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
6810 * tests/input.at (%prec takes a token): New test checking that %prec
6811 won't take a nonterminal.
6813 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6815 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
6816 it was double-quoted.
6817 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
6818 grammar is maintained with Bison's highest standards.
6819 * src/getargs.c: Fix some typos in Doxygen comments.
6821 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6823 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
6824 later. Reported by Paul Eggert in
6825 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
6826 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
6827 * src/scan-code.l (translate_action): Don't bother invoking
6828 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
6829 (code_scanner_free): Instead of invoking
6830 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
6832 * src/scan-gram.l (gram_scanner_free): Likewise.
6833 * src/scan-skel.l (scan_skel): Likewise.
6835 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
6837 * src/files.c (tr): Change return type to void.
6838 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
6839 has been called previously for the same key.
6840 (muscle_find): Return storage instead of value so that
6841 --enable-gcc-warnings doesn't produce warnings that the return discards
6842 const. aver that the value and storage are the same since storage
6843 could potentially be NULL when value is not.
6844 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
6847 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6849 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
6850 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
6851 us a slightly cleaner distribution, and also works.
6852 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
6855 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
6856 and Paul Eggert <eggert@cs.ucla.edu>
6858 Don't let Bison leak memory except when it complains.
6859 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
6860 (spec_defines_file, dir_prefix): Now char *, not const char *,
6861 since they are freed.
6862 * src/files.c: Likewise.
6863 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
6865 (tr): Now operates in-place. All uses changed.
6866 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
6868 (compute_file_name_parts, compute_output_file_names): Don't store
6869 read-only data in variables that will be freed.
6870 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
6871 src_extension, and header_extension.
6872 (output_file_names_free): New public function to free
6873 spec_verbose_file, spec_graph_file, spec_defines_file,
6874 parser_file_name, and dir_prefix.
6875 * src/getargs.c (getargs): Don't store read-only data in variables that
6877 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
6878 (which previously existed but was unused), and quotearg_free.
6879 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
6880 * src/muscle_tab.c: Likewise.
6881 (muscle_entry): Make the value char const *,
6882 and add a new storage member that is char * and can be freed.
6883 (muscle_entry_free): New private function.
6884 (muscle_init): Use it instead of free.
6885 (muscle_insert, muscle_grow): Update and use new storage member.
6886 (muscle_code_grow): Free the string passed to muscle_grow
6887 since it's not needed anymore.
6888 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
6889 add a new `char *code' member.
6890 ("{...}"): Declare semantic type as code.
6891 * src/scan-code.h (translate_rule_action):
6892 (translate_symbol_action, translate_code, translate_action): Return
6893 `char const *' rather than `char *' since external code should not free
6895 * src/scan-code.l: Likewise.
6896 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
6897 which is "{...}" in the parser.
6898 * tests/Makefile.am (maintainer-check-valgrind): Set
6899 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
6901 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
6903 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
6904 expecting a non-zero exit status sets --leak-check=summary and
6905 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
6906 this case, and we don't want to hear about it.
6908 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6910 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
6911 instead of from the template, to simplify configuration a bit.
6912 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
6913 and m4/wint_t.m4, as they are needed with the latest gnulib.
6915 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6917 Disable unset/unused mid-rule value warnings by default, and recognize
6918 --warnings=midrule-values to enable them. Discussed starting at
6919 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
6920 * NEWS (2.3a+): Mention.
6921 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
6922 warnings): Add entry for midrule-values subargument.
6923 * src/reader.c (symbol_should_be_used): Don't return true just because
6924 the value is a set/used mid-rule value unless
6925 --warnings=midrule-values was specified.
6926 * tests/input.at (Unused values, Unused values before symbol
6927 declarations): Run tests with and without --warnings=midrule-values.
6929 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
6930 than LIST_FREE directly.
6932 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6934 Finish implementing --warnings=error, which should not be implied by
6935 --warnings=all (or by its synonyms -W and --warnings without
6937 * src/complain.c (set_warning_issued): New function to report that
6938 warnings are being treated as errors and to record an error if so.
6940 (warn_at, warn): ... here.
6941 * src/getargs.c (warnings_args, warnings_types): Reorder so that
6942 "error - warnings are errors" does not appear above "all - all of the
6944 (getargs): For -W and --warnings without subarguments, don't let
6945 FLAGS_ARGMATCH set warnings_error in warnings_flag.
6946 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
6948 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6950 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
6951 empty subargument list. For example: `bison --warnings= parser.y'.
6953 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6955 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
6956 the parser header file so that gcc doesn't warn.
6958 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6960 Split the default %destructor/%printer into two kinds: <*> and <!>.
6961 Discussed starting at
6962 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
6963 * NEWS (2.3a+): Mention.
6964 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
6965 previous change today related to mid-rules.
6966 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
6967 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
6968 (TYPE_TAG_ANY): Add as <*>.
6969 (TYPE_TAG_NONE): Add as <!>.
6970 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
6972 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
6973 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
6974 * src/symlist.c (symbol_list_default_new): Split into tagged and
6976 (symbol_list_destructor_set, symbol_list_printer_set): Split
6977 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
6978 SYMLIST_DEFAULT_TAGLESS.
6979 * src/symlist.h: Update symbol_list_default*_new prototypes.
6980 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
6981 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
6982 * src/symtab.c (default_destructor, default_destructor_location,
6983 default_printer, default_printer_location): Split each into tagged and
6985 (symbol_destructor_get, symbol_destructor_location_get,
6986 symbol_printer_get, symbol_printer_location_get): Implement tagged
6987 default and tagless default cases.
6988 (default_destructor_set, default_printer_set): Split each into tagged
6989 and tagless versions.
6990 * src/symtab.h: Update prototypes.
6991 * tests/actions.at (Default %printer and %destructor): Rename to...
6992 (Default tagless %printer and %destructor): ... this, and extend.
6993 (Per-type %printer and %destructor): Rename to...
6994 (Default tagged and per-type %printer and %destructor): ... this, and
6996 (Default %printer and %destructor for user-defined end token): Extend.
6997 (Default %printer and %destructor are not for error or $undefined):
6999 (Default %printer and %destructor are not for $accept): Update.
7000 (Default %printer and %destructor for mid-rule values): Extend.
7001 * tests/input.at (Default %printer and %destructor redeclared): Extend.
7002 (Unused values with default %destructor): Extend.
7004 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7006 Don't apply the default %destructor/%printer to an unreferenced midrule
7008 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
7009 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
7010 like $@n instead of just @n so that the default %destructor/%printer
7011 logic doesn't see them as user-defined symbols.
7012 (symbol_is_dummy): Check for both forms of the name.
7013 * src/reader.c (packgram): Remove the `$' from each midrule symbol
7014 name for which the midrule value is referenced in any action.
7015 * tests/actions.at (Default %printer and %destructor for mid-rule
7017 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
7018 for change to dummy symbol names.
7020 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7022 Warn about unset midrule $$ if the corresponding $n is used.
7023 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
7025 (packgram): Before invoking grammar_rule_check on any rule, make sure
7026 all actions have already been scanned in order to set `used' flags.
7027 Otherwise, checking that a midrule's $$ is set will not always work
7028 properly because the midrule check must forward-reference the midrule's
7030 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
7033 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7035 More improvements to the documentation of the prologue alternatives:
7036 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
7038 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
7039 some text to clarify the relative importance of the new directives and
7040 to show how these directives may be viewed as code labels.
7042 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
7044 Similar to the recently removed %before-header, add %code-top as the
7045 alternative to the pre-prologue. Mentioned at
7046 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
7047 Also, let the prologue alternatives appear in the grammar section.
7048 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
7049 (prologue_declaration): Move the existing prologue alternatives to...
7050 (grammar_declaration): ... here and add %code-top.
7051 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
7053 Clean up and extend documentation for the prologue alternatives.
7054 * NEWS (2.3a+): Describe prologue alternatives.
7055 * doc/bison.texinfo (Prologue): Move discussion of prologue
7057 (Prologue Alternatives): ... this new section, and extend it to discuss
7058 all 4 directives in detail.
7059 (Table of Symbols): Clean up discussion of prologue alternatives and
7062 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7064 DJGPP specific issues.
7066 * djgpp/config.bat: config.hin has been moved to lib. Adjust
7067 config.bat accordingly.
7068 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
7069 * djgpp/config.site: Likewise.
7071 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
7073 Replace %*-header with %provides, %requires, %code. See discussion at
7074 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
7076 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
7077 (b4_user_start_header): Remove.
7078 * data/glr.c: Use new macros instead of b4_*start_header
7080 * data/glr.cc: Likewise.
7081 * data/lalr1.cc: Likewise.
7082 * data/push.c: Likewise.
7083 * data/yacc.c: Likewise.
7085 * doc/bison.texinfo: Remove %before-header, rename
7086 %{start,end,after}-header to %requires, %provides, %code.
7088 * src/parse-gram.y: Likewise (also rename token names accordingly).
7089 * src/scan-gram.l: Likewise.
7090 * tests/actions.at: Likewise.
7092 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
7094 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
7095 Problem reported by Joel E. Denny.
7097 2006-10-14 Jim Meyering <jim@meyering.net>
7099 (Sync from coreutils.)
7100 Work also when the working directory (with e.g. coreutils sources)
7101 is version controlled with git, rather than CVS.
7102 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
7104 In messages and comments, say e.g., "checked-out sources",
7105 rather than "CVS sources".
7106 (version_controlled_file): New function. Work for git as well as
7107 for CVS. Don't use grep's -q option.
7108 (slurp): Call it here, in place of CVS-specific code.
7110 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
7112 Fix testsuite for ./configure --enable-gcc-warnings:
7113 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
7114 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
7115 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
7116 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
7117 * test/regression.at (Diagnostic that expects two alternatives):
7120 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
7122 * bootstrap.conf (gnulib_modules): Add config-h.
7123 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
7124 worry about HAVE_CONFIG_H.
7125 * lib/abitset.c: Likewise.
7126 * lib/bitset.c: Likewise.
7127 * lib/bitset_stats.c: Likewise.
7128 * lib/bitsetv-print.c: Likewise.
7129 * lib/bitsetv.c: Likewise.
7130 * lib/ebitset.c: Likewise.
7131 * lib/get-errno.c: Likewise.
7132 * lib/lbitset.c: Likewise.
7133 * lib/subpipe.c: Likewise.
7134 * lib/timevar.c: Likewise.
7135 * lib/vbitset.c: Likewise.
7136 * lib/bitset.c: Include "bitset.h" first, to test interface.
7137 * lib/bitset_stats.c: Include "bitset_stats.h" first.
7138 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
7139 * lib/bitsetv.c: Include "bitsetv.h" first.
7140 * lib/get-errno.c: Include "get-errno.h" first.
7141 * m4/.cvsignore: Add config-h.m4.
7142 * tests/actions.at (Default %printer and %destructor for ...):
7143 Adjust expected line numbers in output to reflect removal of #if
7144 HAVE_CONFIG_H lines.
7145 * tests/glr-regression.at (Missed %merge type warnings when ...):
7147 * tests/regression.at (Braced code in declaration in rules section):
7149 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
7150 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
7151 Include <config.h> unconditionally.
7153 * bootstrap: Sync from coreutils, as follows:
7155 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
7157 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
7158 variable was sometimes used without being initialized. This
7159 messed up the installation of the INSTALL file in some cases.
7161 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
7163 * bootstrap (usage, main program, symlink_to_gnulib): Add option
7164 --copy. Inspired by a suggestion from Bruno Haible.
7166 2006-10-03 Jim Meyering <jim@meyering.net>
7168 * bootstrap: Undo last change to this file, since now gnulib-tool
7169 sticks with the automake default in generating dependencies.
7171 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
7173 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
7174 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
7176 * doc/bison.1: Add copyright notice.
7178 * data/glr.c: Don't include <stdarg.h>; not used.
7180 * NEWS: The -g and --graph options now output graphs in Graphviz
7181 DOT format, not VCG format.
7182 * doc/bison.1: Likewise.
7183 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
7184 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
7186 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
7187 * TODO: Remove Graphviz entry.
7188 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
7189 remove vcg.c, vcg.h, vcg_defaults.h.
7190 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
7191 * src/graphviz.c, src/graphviz.h: New files.
7192 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
7193 * src/files.h: Make comment more generic.
7194 * src/main.c (main): Likewise.
7195 * src/print_graph.h: Likewise.
7196 * src/getargs.c (usage): Make usage description more generic.
7197 * src/print_graph.c: Include graphviz.h rather than vcg.h.
7198 (static_graph, fgraph): Remove. All uses changed to pass
7199 arguments instead of sharing a static var.
7200 (print_core, print_actions, print_state, print_graph):
7201 Output graphviz format rather than VCG format.
7202 * tests/.cvsignore: Remove *.vcg; add *.dot.
7203 * tests/output.at: Expect *.dot files, not *.vcg files.
7205 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
7206 accommodates the 2006-10-08 change.
7208 2006-10-11 Bob Rossi <bob@brasko.net>
7210 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
7211 (b4_yyssa, b4_yyerror_range): New macros.
7212 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
7213 (yypvarsinit): Remove init of removed fields.
7214 (yypushparse): Remove use of removed fields; use new macros instead.
7216 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
7218 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
7219 in a push parser. Reindent slightly to match yacc.c better.
7221 2006-10-11 Bob Rossi <bob@brasko.net>
7223 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
7225 (yypvarsinit, yypushparse): Remove init of removed fields.
7226 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
7228 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
7230 * THANKS: Add Paolo Bonzini and Bob Rossi.
7232 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
7234 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
7235 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
7236 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
7237 b4_define_user_cde and uses): Remove.
7238 (b4_comment, b4_prefix, b4_sync_start): New.
7239 * data/bison.m4: New file, with most of the content removed from c.m4.
7240 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
7241 * src/output.c (output_skeleton): Pass bison.m4.
7242 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
7245 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
7247 Fix test failure reported by Tom Lane in
7248 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
7249 and try to make such failures easier to catch in the future.
7250 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
7251 that's now the caller's responsibility.
7252 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
7253 Set yychar = YYEOF if it's negative.
7254 * tests/actions.at (yylex): Abort if asked to read past EOF.
7255 * tests/conflicts.at (yylex): Likewise.
7256 * tests/cxx-type.at (yylex): Likewise.
7257 * tests/glr-regression.at (yylex): Likewise.
7258 * tests/input.at (yylex): Likewise.
7259 * tests/regression.at (yylex): Likewise.
7260 * tests/torture.at (yylex): Likewise.
7262 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
7264 Fix problems with translating English-language diagnostics.
7265 * bootstrap: Fix bug introduced in recent bootstrap changes, with
7266 respect to bison-runtime pot generation. The YY_ stuff
7267 wasn't being captured.
7268 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
7269 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
7270 * runtime-po/POTFILES.in: Add data/push.c.
7272 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
7274 Merge bootstrap changes from coreutils.
7276 2006-09-28 Jim Meyering <jim@meyering.net>
7278 Automatically generated dependencies are important even
7279 when all of the sources in a directory come from gnulib.
7280 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
7281 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
7283 2006-09-23 Jim Meyering <jim@meyering.net>
7285 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
7287 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7289 * bootstrap: Add support for --force.
7290 (usage): New function. Describe usage less tersely.
7291 (CVS_only_file): New var.
7293 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
7295 * data/push.c (YYPUSH_MORE): Make it an enum instead.
7296 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
7297 Adjust white space and comments to match GNU style better.
7299 2006-09-20 Bob Rossi <bob@brasko.net>
7301 * data/push.c (yyresult_get): Remove function.
7302 (YYPUSH_MORE): Add #define.
7303 (yypushparse): Modify return value.
7305 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7307 * stamp-h.in: Remove; no longer needed.
7308 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
7309 Remove config.h, config.hin, intl (no longer created).
7310 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
7313 Sync bootstrap from coreutils, as follows:
7315 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
7317 * bootstrap (symlink_to_gnulib): New function.
7318 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
7319 to copies-of-gnulib.
7320 (cp_mark_as_generated, slurp, gnulib_files):
7321 Avoid making a copy if it's the same as the old version.
7322 (gnulib_files): Add support for this variable (used by Bison).
7324 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7326 * src/getargs.c (usage): Rework to use conventions similar to
7327 coreutils, to make translation a bit easier and the code a bit
7328 smaller. Problem reported by Tim Van Holder.
7330 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
7332 Use some of gnulib's new modules, taken from coreutils.
7334 * bootstrap: Sync from coreutils, except add support for gnulib_files.
7335 * bootstrap.conf: New file.
7336 (gnulib_modules): Add configmake, inttypes, unistd.
7337 (XGETTEXT_OPTIONS): Add complain, complain_at,
7338 fatal, fatal_at, warn, warn_at, unexpected_end.
7339 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
7340 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
7342 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
7344 (GNULIB_AUTOCONF_SNIPPET): Remove.
7345 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
7347 * lib/.cvsignore: Add inttypes_.h.
7348 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
7349 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
7350 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
7351 no-longer-necessary initializations.
7352 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
7353 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
7354 use the unistd module.
7355 * src/system.h: Likewise.
7356 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
7357 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
7358 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
7359 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
7360 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
7361 * src/system.h: Include inttypes.h unconditionally, now that we
7362 use the inttypes module. Don't bother to include stdint.h, since
7363 inttypes.h now does that for us.
7364 (LOCALEDIR): Remove, now that we use the configmake module.
7365 * src/getargs.c: Include configmake.h.
7366 * src/main.c: Likewise.
7367 * src/output.c: Likewise.
7368 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
7369 not from $abs_top_builddir, since config.h moved.
7372 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
7373 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
7375 * src/parse-gram.y (symbol_declaration): Don't put statements
7376 before declarations; it's not portable to C89.
7377 * src/scan-code.l (handle_action_at): Likewise.
7379 * src/scan-code.l: Always initialize braces_level; the old code
7380 left it uninitialized and therefore had undefined behavior.
7382 Don't attempt to redefine 'assert', since it runs afoul of
7383 systems where standard headers (mistakenly) include <assert.h>.
7384 Instead, define and use our own alternative, called 'aver'.
7385 * src/reader.c: Don't include assert.h, since we no longer
7387 * src/scan-code.l: Likewise.
7388 * src/system.h (assert): Remove, replacing with....
7389 (aver): New function, taking a bool arg. All uses changed.
7390 * src/tables.c (pack_vector): Ensure that aver arg is bool,
7391 not merely an integer.
7393 2006-09-15 Bob Rossi <bob@brasko.net>
7395 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
7396 * data/c.m4 (YYPUSH): New.
7397 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
7398 * src/getargs.c (push_parser): New var.
7399 * src/getargs.h (push_parser): New declaration.
7400 * src/output.c (prepare): Add macro insertion of `push_flag'.
7401 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
7402 (prologue_declaration): Parse %push-parser.
7403 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
7404 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
7405 list of removed lines from the traces observed.
7406 (AT_CHECK_CALC_LALR): Added push parser tests.
7408 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
7410 * NEWS: Version 2.3a.
7411 * configure.ac (AC_INIT): Likewise.
7413 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
7414 "#define YYSTYPE int" that caused "make maintainer-check" to fail
7415 due to header ordering dependencies. I don't know why the #define
7418 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
7419 runtime cost when YYDEBUG is not defined, and so that some tests
7420 that used to fail now work. Problem and initial suggestion by
7422 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
7423 * data/glr.cc (b4_parser_class_name):
7424 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
7425 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
7426 (yydebug_) [YYDEBUG]: New member.
7427 (yycdebug_): Now defined only if YYDEBUG.
7428 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
7429 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
7430 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
7432 (debug_stream, set_debug_stream, debug_level, set_debug_level):
7433 Define only if YYDEBUG.
7434 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
7436 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
7437 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
7438 AT_CHECK_CALC_GLR_CC that are working now.
7440 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
7442 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
7443 We don't need them in glr.cc, and glr.c defines them.
7444 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
7445 assumes that defining it to anything is the same as defining
7446 it to 1. Problem reported by Paolo Bonzini.
7448 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
7450 * data/c.m4 (b4_null, b4_case): Define.
7451 * src/output.c (prepare_symbols): Use b4_null.
7452 (user_actions_output): Use b4_case.
7454 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
7456 * data/glr.c (b4_shared_declarations): Put start-header first,
7457 before any #includes that we generate, so that feature-test
7458 macros work. Problem reported by Michael Deutschmann in
7459 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
7460 * data/lalr1.cc: Likewise.
7461 * doc/bison.texinfo (Prologue): Document that feature-test macros
7462 should be defined before any Bison declarations.
7463 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
7464 that depend on location.hh after, not before, Bison decls, since
7465 we now include location.hh after the first user prologue.
7467 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
7468 Sander Brandenburg in
7469 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
7470 Also, fix minor white space and comment issues.
7471 (Prologue): Mention that it's better to define feature-test macros
7472 before Bison declarations. Problem reported by Michael Deutschmann.
7474 * README-cvs: Fix typo: "&" should be "&&". Problem reported
7476 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
7477 This adjusts to recent gnulib changes.
7479 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
7481 Finish implementation of per-type %destructor/%printer. Discussed
7483 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
7485 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
7486 * NEWS (2.3+): Add a description of this feature to the default
7487 %destructor/%printer description.
7488 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
7489 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
7490 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
7491 list node contains a semantic type.
7492 * src/symtab.c, src/symtab.h: Extend with a table that associates
7493 semantic types with their %destructor's and %printer's.
7494 (semantic_type_from_uniqstr, semantic_type_get,
7495 semantic_type_destructor_set, semantic_type_printer_set): New functions
7496 composing the public interface of that table.
7497 (symbol_destructor_get, symbol_destructor_location_get,
7498 symbol_printer_get, symbol_printer_location_get): If there's no
7499 per-symbol %destructor/%printer, look up the per-type before trying
7501 * tests/actions.at (Per-type %printer and %destructor): New test case.
7502 * tests/input.at (Default %printer and %destructor redeclared):
7503 Extend to check that multiple occurrences of %symbol-default in a
7504 single %destructor/%printer declaration is an error.
7505 (Per-type %printer and %destructor redeclared, Unused values with
7506 per-type %destructor): New test cases.
7508 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
7510 Require default %destructor/%printer to be declared using
7511 %symbol-default instead of an empty symbol list, and start working on
7512 new per-type %destructor/%printer. Discussed at
7513 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
7514 * NEWS (2.3+): Add %symbol-default to example.
7515 * bison.texinfo (Freeing Discarded Symbols): Likewise.
7516 (Table of Symbols): Add entry for %symbol-default.
7517 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
7518 (generic_symlist, generic_symlist_item): New nonterminals for creating
7519 a list in which each item is a symbol, semantic type, or
7521 (grammar_declaration): Use generic_symlist in %destructor and %printer
7522 declarations instead of symbols.1 or an empty list.
7523 (symbol_declaration, precedence_declaration, symbols.1): Update actions
7524 for changes to symbol_list.
7525 * src/reader.c: Update for changes to symbol_list.
7526 * src/scan-code.l: Likewise.
7527 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
7528 * src/symlist.c, src/symlist.h: Extend such that a list node may
7529 represent a semantic type or a %symbol-default in addition to just an
7530 ordinary symbol. Add switched functions for setting %destructor's and
7532 * tests/actions.at, tests/input.at: Add %symbol-default to all default
7533 %destructor/%printer declarations.
7535 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
7537 Whether the default %destructor/%printer applies to a particular symbol
7538 isn't a question of whether the user *declares* that symbol (in %token,
7539 for example). It's a question of whether the user by any means
7540 *defines* the symbol at all (by simply using a char token, for
7541 example). $end is defined by Bison whereas any other token with token
7542 number 0 is defined by the user. The error token is always defined by
7543 Bison regardless of whether the user declares it with %token, but we
7544 may one day let the user define error as a nonterminal instead.
7545 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
7546 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
7547 the meaning of "user-defined".
7548 * tests/actions.at (Default %printer and %destructor for user-declared
7549 end token): Rename to...
7550 (Default %printer and %destructor for user-defined end token): ...
7553 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
7554 computation of whether to apply the default, don't maintain a list of
7555 every Bison-defined symbol. Instead, just check for a first character
7556 of '$', which a user symbol cannot have, and check for the error token.
7558 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
7560 Don't apply the default %destructor or %printer to the error token,
7561 $undefined, or $accept. This change fits the general rule that the
7562 default %destructor and %printer are only for user-declared symbols,
7563 and it solves several difficulties that are described in the new test
7565 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
7566 * tests/actions.at (Default %printer and %destructor are not for error
7567 or $undefined, Default %printer and %destructor are not for $accept):
7570 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
7572 Allow %start after the first rule.
7573 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
7574 when parsing the first rule.
7575 (check_and_convert_grammar): Search for it here after all grammar
7576 declarations have been parsed. Skip midrules, which have dummy LHS
7578 * src/symtab.c (symbol_is_dummy): New function.
7579 * src/symtab.h (symbol_is_dummy): Declare it.
7580 * tests/input.at (%start after first rule): New test.
7582 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
7584 Redo some of the previous commit: add back the ability to use
7585 non-aliased/undeclared string literals since it might be useful to
7586 those declaring %token-table.
7587 * src/reader.c (check_and_convert_grammar): Undo changes in previous
7588 commit: don't worry about complaints from symbols_pack.
7589 * src/symtab.c (symbol_new, symbol_class_set,
7590 symbol_check_alias_consistency): Undo changes in previous commit: count
7591 each string literal as a new symbol and token, assign it a symbol
7592 number, and don't complain about non-aliased string literals.
7593 (symbols_pack): Since symbol_make_alias still does not decrement symbol
7594 and token counts but does still set aliased tokens to the same number,
7595 symbol_pack_processor now leaves empty slots in the symbols array.
7597 * tests/regression.at (Undeclared string literal): Remove test case
7598 added in previous commit since non-aliased string literals are allowed
7600 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
7601 remove unnecessary string literal declarations.
7602 * tests/sets.at (Firsts): Likewise.
7604 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
7606 Don't allow an undeclared string literal, but allow a string literal to
7607 be used before its declaration.
7608 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
7609 symbols_pack complained.
7610 * src/symtab.c (symbol_new): Don't count a string literal as a new
7612 (symbol_class_set): Don't count a string literal as a new token, and
7613 don't assign it a symbol number since symbol_make_alias does that.
7614 (symbol_make_alias): It's not necessary to decrement the symbol and
7615 token counts anymore. Don't assume that an alias declaration occurs
7616 before any uses of the identifier or string, and thus don't assert that
7617 one of them has the highest symbol number so far.
7618 (symbol_check_alias_consistency): Complain if there's a string literal
7619 that wasn't declared as an alias.
7620 (symbols_pack): Bail if symbol_check_alias_consistency failed since
7621 symbol_pack asserts that every token has been assigned a symbol number
7622 although undeclared string literals have not.
7623 * tests/regression.at (String alias declared after use, Undeclared
7624 string literal): New test cases.
7625 (Characters Escapes, Web2c Actions): Declare string literals as
7627 * tests/sets.at (Firsts): Likewise.
7629 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
7631 In the grammar scanner, STRING_FINISH unclosed constructs and return
7632 them to the parser in order to improve error messages.
7633 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
7634 SC_BRACED_CODE, SC_PROLOGUE): Implement.
7635 * tests/input.at (Unclosed constructs): New test case.
7636 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
7639 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
7642 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
7644 Handle string aliases for character tokens correctly.
7645 * src/symtab.c (symbol_user_token_number_set): If the token has an
7646 alias, check and set its alias's user token number instead of its own,
7647 which is set to indicate the alias. Previously, every occurrence of
7648 the character token in the grammar overwrote that alias indicator with
7650 * tests/input.at (String aliases for character tokens): New test.
7652 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
7654 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
7656 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
7658 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
7659 to prevent failures when building on older platforms.
7660 Check for autopoint failure.
7661 Set XGETTEXT_OPTIONS to values that check for C format strings,
7662 so that translators are warned about them (this also helps
7663 prevent core dumps).
7665 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
7666 function, since it simplifies our code a bit.
7668 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
7669 rather than -W, so we don't get bogus warnings about sign comparisons.
7670 Add -Wpointer-arith, since that warning is useful (it reports code
7671 that does not conform to C89 and that some compilers reject).
7672 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
7673 since it's no longer needed.
7675 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
7677 Clean up scanners a bit.
7678 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
7679 definitions so gcc won't warn when obstack_for_string is unused.
7680 * src/scan-code.l: config.h and system.h are already #include'd by
7681 scan-code-c.c, so get rid of them here.
7682 * src/scan-gram.l: Likewise.
7683 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
7684 definitions rather than duplicating the rest of it.
7685 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
7687 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
7689 Suppress signed/unsigned comparison warnings for yycheck.
7690 * data/c.m4 (b4_safest_int_type): New macro.
7691 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
7692 a signed int type, cast it to b4_safest_int_type first.
7693 * data/yacc.c: Likewise.
7694 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
7697 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
7699 * doc/bison.texinfo: Fix some typos.
7701 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
7703 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
7704 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
7706 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
7707 the latest gnulib does this a different way.
7708 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
7709 translation was patched, so stop omitting it.
7711 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
7713 Enable declaration of default %printer/%destructor. Make the parser
7714 use these for all user-declared grammar symbols for which the user does
7715 not declare a specific %printer/%destructor. Thus, the parser uses it
7716 for token 0 if the user declares it but not if Bison generates it as
7717 $end. Discussed starting at
7718 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
7719 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
7721 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
7722 * NEWS (2.3+): Mention.
7723 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
7724 declare a %destructor for a mid-rule's semantic value. It's just
7725 impossible to declare one specific to it.
7726 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
7727 code. Describe default %destructor form.
7728 * src/parse-gram.y (grammar_declaration): Parse default
7729 %printer/%destructor declarations.
7730 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
7731 and symbol_destructor_location_get rather than accessing the destructor
7732 and destructor_location members of struct symbol.
7733 (symbol_printers_output): Likewise but for %printer's.
7734 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
7736 * src/symtab.c (default_destructor, default_destructor_location,
7737 default_printer, default_printer_location): New static global
7738 variables to record the default %destructor and %printer.
7739 (symbol_destructor_get, symbol_destructor_location_get,
7740 symbol_printer_get, symbol_printer_location_get): New functions to
7741 compute the appropriate %destructor and %printer for a symbol.
7742 (default_destructor_set, default_printer_set): New functions to set the
7743 default %destructor and %printer.
7744 * src/symtab.h: Prototype all those new functions.
7745 * tests/actions.at (Default %printer and %destructor): New test to
7746 check that the right %printer and %destructor are called, that they're
7747 not called for $end, and that $$ and @$ work correctly.
7748 (Default %printer and %destructor for user-declared end token): New
7749 test to check that the default %printer and %destructor are called for
7750 a user-declared end token.
7751 * tests/input.at (Default %printer and %destructor redeclared, Unused
7752 values with default %destructor): New tests to check related grammar
7753 warnings and errors.
7755 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
7757 Clean up handling of %destructor for the end token (token 0).
7758 Discussed starting at
7759 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
7761 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
7763 Make the skeletons consistent in how they pop the end token and invoke
7765 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
7766 state, which has token number 0, since this would invoke the
7767 %destructor for the end token.
7768 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
7769 until after shifting the end token, or else it won't be popped.
7770 * data/yacc.c (yyparse): Likewise.
7772 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
7773 it's the end token. Upon termination, destroy an unshifted lookahead
7774 even when it's the end token.
7775 * data/lalr1.cc (yy::parser::parse): Likewise.
7776 * data/yacc.c (yyparse): Likewise.
7778 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
7779 value warnings for the end token when the user gives the end token a
7782 * tests/actions.at (Printers and Destructors): Test all the above.
7784 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
7786 Update to latest gnulib and gettext versions.
7787 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
7789 (gnulib_files): Add m4/warning.m4. Don't worry about files
7790 overwritten by autopoint.
7791 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
7792 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
7794 Don't use autoreconf; instead, invoke autopoint etc. by hand,
7795 so that we can remove the intl files at a better time.
7796 (intl_files_to_remove): Remove aclocal.m4, since it gets
7797 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
7798 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
7799 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
7800 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
7801 Remove datarootdir hack; no longer needed.
7802 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
7803 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
7804 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
7806 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
7807 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
7809 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
7811 * bootstrap: Adjust to today's change to gnulib-tool by invoking
7812 it with --assume-autoconf='latest-stable'.
7814 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
7816 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
7817 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
7819 * src/muscle_tab.h (muscle_grow): Replace the header comments with
7820 those from muscle_tab.c since the old ones are misleading.
7822 2006-07-13 Akim Demaille <akim@epita.fr>
7824 Support %define "KEY" {VALUE}.
7825 * src/scan-code.h, src/scan-code.l (translate_action)
7826 (translate_rule_action, translate_symbol_action, translate_code):
7827 Return char *, not const char *.
7828 * src/parse-gram.y (declaration): Rename as...
7829 (prologue_declaration): this.
7830 (string_content): Remove this nonterminal, use STRING.
7831 (braceless, content, content.opt): New nonterminal.
7833 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
7835 * src/scan-gram.l (getargs.h): Don't include it.
7837 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
7839 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
7840 rather than a for-loop that declares a local bool variable. This
7841 should work around a compatibility problem with a Cray x1e C++
7842 compiler reported by Hung Nguyen in
7843 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
7844 The for-loop was introduced in the 2004-11-17 change but I don't
7845 know why it was needed.
7847 2006-07-12 Akim Demaille <akim@epita.fr>
7849 * data/c.m4: Comment changes.
7851 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
7853 * src/complain.c (error_message, ERROR_MESSAGE): New.
7855 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
7856 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
7858 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7860 * NEWS: Instead of %union, you can define and use your own union type
7861 YYSTYPE if your grammar contains at least one <type> tag.
7862 Your YYSTYPE need not be a macro; it can be a typedef.
7863 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
7864 (Union Decl, Decl Summary): Document this.
7865 * data/glr.c (YYSTYPE): Implement this.
7866 * data/glr.cc (YYSTYPE): Likewise.
7867 * data/lalr1.cc (YYSTYPE): Likewise.
7868 * data/yacc.c (YYSTYPE): Likewise.
7869 * src/output.c (prepare): Output tag_seen_flag.
7870 * src/parse-gram.y (declaration, grammar_declaration):
7871 Use 'union_seen' rather than 'typed' to determine whether
7872 %union has been seen, since grammars can now be typed without
7874 (symbol_declaration, type.opt, symbol_def):
7875 Keep track of whether a tag has been seen.
7876 * src/reader.c (union_seen, tag_seen): New vars.
7878 * src/reader.h (union_seen, tag_seen, typed): Likewise.
7879 * src/scan-code.l (untyped_var_seen): New variable.
7880 (handle_action_dollar): Adjust to above changes.
7881 (handle_action_dollar, handle_action_at):
7882 Improve overflow checking for outlandish numbers.
7883 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
7884 avoid new diagnostics generated by above changes.
7885 * tests/regression.at (YYSTYPE typedef): Add test to check
7886 for type tags without %union.
7888 * src/symlist.c (symbol_list_length): Return int, not unsigned
7889 int, since callers expect int. This may need to get revisited
7890 once we have proper integer overflow checking.
7892 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
7893 object is now static.
7895 * src/getargs.c (flags_argmatch): Return void, not int,
7896 to pacify ./configure --enable-gcc-warnings.
7898 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
7899 since last_string is already defined to FLEX_PREFIX (last_string).
7901 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
7903 Implement --warnings/-W.
7904 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
7906 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
7908 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
7909 (warnings_args, warnings_types): New.
7910 (getargs, short_options, long_options): Accept -W/--warnings.
7911 Sort the options by alphabetical order, upper case letter right
7912 before its lower case.
7914 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
7916 Change %merge result type clash warnings to errors. Discussed at
7917 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
7918 * src/reader.c (record_merge_function_type): Use complain_at.
7919 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7920 declared later): Update test case results.
7922 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
7924 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
7925 to be in alphabetical order.
7926 (trace_args): Spelling fixes.
7928 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7930 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
7931 so they don't collide with user-defined macros.
7932 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
7933 this was never guaranteed, and now that we're using gnulib stdint,
7934 which defines int_fast16_t to long int, the problem is exposed.
7936 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
7938 * data/c.m4 (b4_basename): Simplify a bit, since we don't
7939 need the full POSIX semantics (and weren't implementing them
7942 Adjust to Autoconf 2.60 and today's gnulib.
7943 * bootstrap (gnulib_modules): Add stdint.
7944 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
7945 no longer copies it.
7946 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
7947 since stdint needs the former and wcwidth (which is now required
7948 by mbswidth) needs the latter.
7949 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
7950 work around a compatibility glitch between gettext 0.14.6 and
7952 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
7953 Do not check for uintptr_t, since new stdint module does the right
7955 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
7956 Add stdint.h, stdint_.h, wcwidth.h.
7957 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
7958 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
7959 stdint.m4, wchar_t.m4, wcwidth.m4.
7960 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
7961 usual order for ../lib/*.h files.
7962 (file_name_split): Use last_component, not base_name, to adjust
7964 * src/parse-gram.h: Include <strverscmp.h> in the usual order
7965 for ../lib/*.h files.
7966 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
7967 Define unconditionally, since we now assume the stdint module.
7968 * src/scan-skel.l: Include <dirname.h>.
7969 (BASE_QPUTS): Use last_component, not base_name.
7970 * src/system.h: Include <unlocked-io.h> in the usual order
7971 for ../lib/*.h files. Include <stdint.h> unconditionally,
7972 since we now use the stdint module.
7973 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
7974 HAVE_UINTPTR_T, since we now use the stdint module.
7975 (base_name): Remove decl, since files now include <dirname.h>
7978 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
7980 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
7982 * data/yacc.c, data/glr.c, data/location.cc: Use them.
7983 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
7985 * tests/calc.at: Adjust.
7987 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
7989 * data/c.m4 (b4_basename): New.
7990 (b4_syncline): Also output the location of its invocation (from
7992 (b4_user_action, b4_define_user_action, b4_user_actions)
7993 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
7994 (b4_user_stype): New.
7995 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
7997 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7999 In the grammar file, the first column is 1 not 0 on the first line as
8000 on every other line.
8001 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
8002 * tests/input.at (Torturing the Scanner): Update output.
8004 * src/scan-gram.l (scanner_cursor): Declare it static.
8006 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8008 In warnings, say "previous declaration" rather than "first
8010 * src/symtab.c (redeclaration): Do that here.
8011 * src/reader.c (record_merge_function_type): In the case of a result
8012 type clash, report the previous declaration rather than the very first
8013 one in the grammar file.
8014 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8015 declared later): Add a third declaration to check this behavior.
8016 * tests/input.at (Incompatible Aliases): Update output.
8018 2006-06-27 Akim Demaille <akim@epita.fr>
8020 * doc/Doxyfile.in: New.
8021 * doc/Makefile.am: Use it.
8022 * src/lalr.h, src/symtab.h: Initial doxygenation.
8024 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8026 Don't miss %merge result type warnings just because the LHS types are
8027 declared after the %merge. This continues the effort of the previous
8029 * src/reader.c (get_merge_function): Don't set the merger type yet.
8030 (record_merge_function_type): New function for setting the merger type
8031 and checking for clashes.
8032 (grammar_current_rule_merge_set): Set the location of the %merge for
8034 (packgram): Invoke record_merge_function_type for each rule now that
8035 all symbol type declarations have been parsed.
8036 * src/reader.h (merger_list.type_declaration_location): New member
8037 storing the location of the first %merge from which the type for this
8038 merging function was derived.
8039 * src/symlist.h (symbol_list.merger_declaration_location): New member
8040 storing the location of a rule's %merge, if any.
8041 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8042 declared later): New test to catch the error fixed by the above patch.
8044 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8046 Get action warnings (grammar_rule_check) right even when symbol
8047 declarations appear after the rules. Discussed at
8048 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
8050 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
8051 Don't mistake the type of $$ in a midrule to be that of its parent
8053 * src/reader.c (grammar_current_rule_end): Don't invoke
8054 grammar_rule_check yet since not all symbol declarations may have been
8056 (grammar_midrule_action): Likewise.
8057 Don't record whether the midrule's $$ has been used yet since actions
8058 haven't been translated yet.
8059 Record the midrule's parent rule and its RHS index within the parent
8061 (grammar_current_rule_action_append): Don't translate the action yet
8062 since not all symbol declarations may have been parsed yet and, thus,
8063 warnings about types for $$, $n, @$, and @n can't be reported yet.
8064 (packgram): Translate the action and invoke grammar_rule_check now that
8065 all symbol declarations have been parsed.
8066 * src/scan-code.l (handle_action_dollar): Now that this is invoked
8067 after parsing the entire grammar file, the symbol list here in the case
8068 of a midrule is actually the midrule's empty RHS, so reference its
8069 parent rule's RHS where necessary.
8070 On the other hand, now that you can already know it's a midrule, you
8071 aren't forced to think $$ has the same type as its parent rule's $$.
8072 (handle_action_at): In the case of a midrule, reference the parent rule
8074 * src/symlist.c (symbol_list_new): Initialize new midrule-related
8076 (symbol_list_length): Now that this is invoked after all rules have
8077 been parsed, a NULL symbol (rather than a NULL symbol list node)
8078 terminates a rule. symbol_list_print already does this correctly.
8079 * src/symlist.h (symbol_list.midrule_parent_rule,
8080 symbol_list.midrule_parent_rhs_index): New members so that midrules can
8081 remember their relationships with their parents.
8082 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
8083 fixed by the above patch.
8084 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
8086 (Unused values): ... this old test case and...
8087 (Unused values before symbol declarations): ... this new test case.
8088 This one is the same as `Unused values' except that all symbol
8089 declarations appear after the rules in order to catch the rest of the
8090 errors fixed by the above patch.
8092 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8095 * src/reader.c (current_rule): Declare it static since it's no longer
8096 used outside this file.
8097 (grammar_current_rule_action_append): Remove redundant arguments from
8098 translate_rule_action invocation.
8099 * src/reader.h (current_rule): Remove this unused extern.
8100 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
8101 * src/scan-code.l (translate_rule_action): Likewise.
8103 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
8105 Clean up yesterday's patch.
8106 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
8108 * src/reader.c (grammar_current_rule_action_append): ... here for
8109 consistency with grammar_current_rule_symbol_append.
8110 * tests/regression.at (Braced code in declaration in rules section):
8111 Make yyerror and yylex static as usual.
8113 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
8115 Fix bug that mistakes braced code in a declaration in the rules section
8116 to be a rule action. Mentioned at
8117 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
8118 * src/scan-gram.l: Move midrule action detection from the start of the
8119 scanning of any braced code to...
8120 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
8121 action. For readability, use $2 and @2 rather than the equivalent
8123 * tests/regression.at (Braced code in declaration in rules section):
8124 New test to catch the error fixed by the above patch.
8126 Work on code readability some.
8127 * src/scan-code.l (current_rule): Get rid of this misleading and
8128 redundant declaration: it's actually extern'ed in reader.h.
8129 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
8130 translate_action): Add a rule argument and use it instead of the global
8132 (translate_rule_action): This already receives current_rule through an
8133 argument, so pass it on to translate_action instead of assigning
8134 current_rule to current_rule.
8135 (translate_symbol_action, translate_code): Pass rule = NULL to
8138 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
8140 Rename %before-definitions to %start-header and %after-definitions to
8141 %end-header. Don't use these declarations to separate pre-prologue
8142 blocks from post-prologue blocks. Add new order-independent
8143 declarations %before-header and %after-header as alternatives to the
8144 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
8145 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
8146 * NEWS (2.3+): Update for these changes.
8147 * data/glr.c (b4_before_definitions): Update to...
8148 (b4_start_header): ... this.
8149 (b4_after_definitions): Update to...
8150 (b4_end_header): ... this.
8151 * data/glr.cc: Likewise.
8152 * data/lalr1.cc: Likewise.
8153 * data/yacc.c: Likewise.
8154 * doc/bison.texinfo (The prologue): Update names, and replace remaining
8155 prologue blocks with %*-header declarations.
8156 (Calc++ Parser): Likewise.
8157 (Decl Summary): Update names.
8158 (Table of Symbols): Update description.
8159 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
8160 (PERCENT_END_HEADER): ... this.
8161 (PERCENT_BEFORE_DEFINITIONS): Update to...
8162 (PERCENT_START_HEADER): ... this.
8163 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
8164 (declaration): Update token names and m4 macro names.
8165 When parsing %end-header and %start-header, invoke translate_code
8166 before muscle_code_grow, and no longer set global booleans to remember
8167 whether these declarations have been seen.
8168 Parse new %after-header and %before-header.
8169 * src/reader.c (before_definitions, after_definitions): Remove.
8170 (prologue_augment): Accept a new bool argument to specify whether to
8171 augment the pre-prologue or post-prologue.
8172 * src/reader.h (before_definitions, after_definitions): Remove these
8174 (prologue_augment): Add new bool argument.
8175 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
8176 (PERCENT_END_HEADER): ... this.
8177 (PERCENT_BEFORE_DEFINITIONS): Update to...
8178 (PERCENT_START_HEADER): ... this.
8179 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
8180 * tests/actions.at (Printers and Destructors): Update names.
8182 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
8184 Add comparison operators for C++ location classes. Discussed at
8185 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
8186 * data/c++.m4 (b4_define_location_comparison): New boolean %define
8187 declaration indicating whether filename_type has an operator==. If
8188 filename_type is `std::string', it defaults to `1', `0' otherwise.
8189 * data/location.cc: Iff b4_define_location_comparison is `1', add
8190 operator== and operator!= for class position and for class location.
8193 * src/scan-action.l: Remove unused file.
8194 * src/symtab.c (symbol_printer_set): Use printer_location not
8195 destructor_location.
8196 * src/symtab.h (struct symbol): Replace incorrect source comment for
8198 * tests/input.at (Incompatible Aliases): Update output with correct
8201 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
8203 Don't put the pre-prologue in the header file. For the yacc.c code
8204 file and the glr.c header and code files, move the pre-prologue before
8205 the token definitions. Add new %before-definitions and
8206 %after-definitions to declare code that will go in both the header file
8207 and code file. Discussed at
8208 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
8209 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
8211 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
8212 * NEWS (2.3+): Describe these changes.
8213 * data/glr.c (b4_pre_prologue): Move from within to before...
8214 (b4_shared_declarations): ... this.
8215 Add new b4_before_definitions before b4_token_enums.
8216 Add new b4_after_definitions at the end.
8217 * data/glr.cc (b4_pre_prologue): Replace with...
8218 (b4_before_definitions): ... this in the header file.
8219 (b4_after_definitions): New near the end of the header file.
8220 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
8221 code file right before including the header file.
8222 (b4_before_definitions): New in the previous position of
8223 b4_pre_prologue in the header file.
8224 (b4_after_definitions): New near the end of the header file.
8225 * data/yacc.c: Clean up some m4 quoting especially in the header file.
8226 (b4_token_enums_defines): In the code file, move to right before
8227 YYSTYPE for consistency with the header file.
8228 (b4_before_definitions): New right before b4_token_enums_defines in
8229 both the header and code file.
8230 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
8231 header and code file.
8232 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
8233 of prologues for %union dependencies.
8234 (Decl Summary): In %defines description, mention the effect of
8235 %before-definitions and %after-definitions on the header file.
8236 (Calc++ Parser): Forward declare driver in a %before-definitions rather
8237 than in the pre-prologue so that make check succeeds.
8238 (Table of Symbols): Add entries for %before-definitions and
8240 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
8241 %before-definitions.
8242 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
8243 (declaration): Parse those declarations and append to
8244 b4_before_definitions and b4_after_definitions, respectively.
8245 * src/reader.c (before_definitions, after_definitions): New bools to
8246 track whether those declarations have been seen.
8247 (prologue_augment): Add to the post-prologue if %union,
8248 %before-definitions, or %after-definitions has been seen.
8249 * src/reader.h (before_definitions, after_definitions): New extern's.
8250 * src/scan-gram.l: Scan the new declarations.
8251 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
8252 prologue block in a %before-definitions or a %after-definitions based
8253 on whether the %union is declared.
8254 * tests/regression.at (Early token definitions with --yacc, Early token
8255 definitions without --yacc): Move tests for token definitions into the
8256 post-prologue since token names are no longer defined in the
8259 2006-06-20 Akim Demaille <akim@epita.fr>
8261 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
8262 (symbol_get): Use it.
8263 * src/parse-gram.y: Use it.
8265 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
8267 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
8268 build succeeds when configured with --enable-gcc-warnings.
8270 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
8272 * src/parse-gram.y (char_name): New function.
8273 (CHAR, STRING, string_content): For %printer, properly escape.
8274 (ID): Prefer fputs to fprintf.
8275 (id): Reindent to be consistent with other rules.
8276 Properly quote char.
8278 The Translation Project changed its way of publishing translations
8279 to maintainers. I haven't received any responses to my request
8280 for supporting the old way, or for documenting the new way. I
8281 have modified 'bootstrap' to use screen scraping
8282 (in this case, HTML scraping). This is unreliable and inelegant,
8283 but I don't see any better way. Yuck.
8284 * bootstrap (TP_URL, WGET_COMMAND): New vars.
8285 (get_translations): New function, which uses HTML scraping to
8286 deduce locations of latest translations.
8287 Use this function to grab both bison and bison-runtime .po files.
8288 Don't bother priming the pump for the runtime-po domain any more,
8289 as it's now translated better than bison is.
8291 2006-06-19 Akim Demaille <akim@epita.fr>
8293 * src/scan-gram.l: No longer "parse" things after `%union' until
8294 `{'. Rather, return a single "%union" token.
8295 No longer make symbols: return strings, and leave the conversion
8296 to symbols to the parser.
8297 (SC_PRE_CODE, token_type): Remove.
8298 * src/parse-gram.y (%union): New field `character'.
8301 (ID, ID_COLON): Now that the scanner no longer makes them
8302 identifiers, adjust all uses to invoke symbol_get.
8303 (id_colon): New, wraps the conversion from string to symbol.
8304 (%union): Accept a possible union_name.
8305 (symbol): Now can be a char.
8306 * data/c.m4 (b4_union_name): Leave a default value.
8307 * data/glr.c, data/yacc.c: Use it.
8309 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
8311 For associating token numbers with token names for "yacc.c", don't use
8312 #define statements unless `--yacc' is specified; always use enum
8313 yytokentype. Most important discussions start at:
8314 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
8315 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
8317 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
8318 * NEWS (2.3+): Mention.
8319 * data/c.m4 (b4_yacc_if): New.
8320 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
8322 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
8323 on token name definitions.
8324 * src/getargs.c (usage): Capitalize `Yacc' in English.
8325 * src/output.c (prepare): Define b4_yacc_flag.
8326 * tests/regression.at (Early token definitions): Test that tokens names
8327 are defined before the pre-prologue not just before the post-prologue.
8328 Remove this test case and copy to...
8329 (Early token definitions with --yacc): ... this to test #define's.
8330 (Early token definitions without --yacc): ... and this to test enums.
8332 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
8334 * NEWS: Reword the post-2.3 change to not be so optimistic about
8335 removing the old "look-ahead" spelling.
8336 Update previous look-ahead/lookahead change reports.
8337 * REFERENCES: look-ahead -> lookahead (since that's
8338 what he actually wrote).
8339 * doc/refcard.tex: look ahead -> lookahead,
8340 look-ahead -> lookahead
8342 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
8344 For consistency, use `lookahead' instead of `look-ahead' or
8345 `look_ahead'. Discussed starting at
8346 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
8348 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
8349 * NEWS: For the next release, note the change to `--report'.
8350 * TODO, doc/bison.1: Update English.
8351 * doc/bison.texinfo: Update English.
8352 (Understanding Your Parser, Bison Options): Document as
8353 `--report=lookahead' rather than `--report=look-ahead'.
8354 * src/conflicts.c: Update English in comments.
8355 (lookahead_set): Rename from look_ahead_set.
8356 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
8357 (resolve_sr_conflict): Rename local look_ahead_tokens to
8358 lookahead_tokens, and update other uses.
8359 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
8360 count_rr_conflicts, conflicts_free): Update uses.
8361 * src/getargs.c (report_args): Move "lookahead" before alternate
8363 (report_types): Update uses.
8364 (usage): For `--report' usage description, state `lookahead' spelling
8365 rather than `look-ahead'.
8366 * src/getargs.h (report.report_lookahead_tokens): Rename from
8367 report_look_ahead_tokens.
8368 * src/lalr.c: Update English in comments.
8369 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
8370 (state_lookahead_tokens_count): Rename from
8371 state_look_ahead_tokens_count.
8372 Rename local n_look_ahead_tokens to n_lookahead_tokens.
8373 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
8374 Rename local n_look_ahead_tokens to n_lookahead_tokens.
8376 Update English in output.
8377 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
8378 * src/print.c: Update English in comments.
8379 (lookahead_set): Rename from look_ahead_set.
8380 (print_reduction): Rename argument lookahead_token from
8382 (print_core, state_default_rule, print_reductions, print_results):
8384 * src/print_graph.c: Update English in comments.
8385 (print_core): Update uses.
8386 * src/state.c: Update English in comments.
8387 (reductions_new): Update uses.
8388 (state_rule_lookahead_tokens_print): Rename from
8389 state_rule_look_ahead_tokens_print, and update other uses.
8390 * src/state.h: Update English in comments.
8391 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
8392 (state_rule_lookahead_tokens_print): Rename from
8393 state_rule_look_ahead_tokens_print.
8394 * src/tables.c: Update English in comments.
8395 (conflict_row, action_row): Update uses.
8396 * tests/glr-regression.at
8397 (Incorrect lookahead during deterministic GLR,
8398 Incorrect lookahead during nondeterministic GLR): Rename
8399 print_look_ahead to print_lookahead.
8400 * tests/torture.at: Update English in comments.
8401 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
8402 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
8403 (Many lookahead tokens): Update uses.
8404 * data/glr.c: Update English in comments.
8405 * lalr1.cc: Likewise.
8407 * src/conflicts.h: Likewise.
8408 * src/lalr.h: Likewise.
8409 * src/main.c: Likewise.
8410 * src/output.c: Likewise.
8411 * src/parse-gram.c: Likewise.
8412 * src/tables.h: Likewise.
8413 * tests/calc.at: Likewise.
8415 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
8417 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
8419 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
8421 * TODO: Add request from Nelson H. F. Beebe to be able to install
8422 Bison without installing the yacc script.
8424 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
8426 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
8427 and yytext if they're already #define'd.
8428 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
8429 * src/scan-code-c.c: ... here.
8430 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
8433 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
8435 Get Bison to build again when configured with --enable-gcc-warnings.
8436 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
8438 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
8439 loc argument as it shadows a global.
8440 * src/scan-gram.l: Remove stray comma that prevents boundary_set
8443 * src/.cvsignore: Add scan-code.c.
8445 2006-06-07 Akim Demaille <akim@epita.fr>
8447 * src/scan-gram.l: Move the "add a trailing ; to actions" code
8449 * src/scan-code.l: here.
8450 * tests/input.at (Torturing the Scanner): Fix another location
8453 2006-06-07 Akim Demaille <akim@epita.fr>
8455 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
8457 2006-06-06 Akim Demaille <akim@epita.fr>
8459 Extract the parsing of user actions from the grammar scanner.
8460 As a consequence, the relation between the grammar scanner and
8461 parser is much simpler. We can also split "composite tokens" back
8463 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
8464 * src/scan-gram.l (add_column_width, adjust_location): Move to and
8466 * src/location.h, src/location.c (add_column_width)
8467 (location_compute): these.
8468 Fix the column count: the initial column is 0.
8469 (location_print): Be robust to ending column being 0.
8470 * src/location.h (boundary_set): New.
8471 * src/main.c: Adjust to scanner_free being renamed as
8473 * src/output.c: Include scan-code.h.
8474 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
8476 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
8477 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
8478 which is now, again, a separate token.
8479 Adjust all dependencies.
8480 Whereever actions with $ and @ are used, use translate_code.
8481 (action): Remove this nonterminal which is now useless.
8482 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
8483 (grammar_current_rule_action_append): Use translate_code.
8484 (packgram): Bound check ruleno, itemno, and rule_length.
8485 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
8486 (last_string, last_braced_code_loc, max_left_semantic_context)
8487 (scanner_initialize, scanner_free, scanner_last_string_free)
8488 (gram_out, gram_lineno, YY_DECL_): Move to...
8489 * src/scan-gram.h: this new file.
8490 (YY_DECL): Rename as...
8492 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
8493 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8494 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8495 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8496 Move these declarations, and...
8497 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
8499 * src/flex-scanner.h: this new file.
8500 * src/scan-gram.l (rule_length, rule_length_overflow)
8501 (increment_rule_length): Remove.
8502 (last_braced_code_loc): Rename as...
8503 (gram_last_braced_code_loc): this.
8504 Adjust to the changes of the parser.
8505 Move all the handling of $ and @ into...
8506 * src/scan-code.l: here.
8507 * src/scan-gram.l (handle_dollar, handle_at): Remove.
8508 (handle_action_dollar, handle_action_at): Move to...
8509 * src/scan-code.l: here.
8510 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
8511 scan-code.h, scan-code-c.c, scan-gram.h.
8512 (EXTRA_bison_SOURCES): Add scan-code.l.
8513 (BUILT_SOURCES): Add scan-code.c.
8514 (yacc): Be robust to white spaces.
8516 * tests/conflicts.at, tests/input.at, tests/reduce.at,
8517 * tests/regression.at: Adjust the column numbers.
8518 * tests/regression.at: Adjust the error message.
8520 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
8522 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
8523 Use Akim's wording from
8524 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
8526 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
8528 Between Bison releases, manually append `+' to the previous Bison
8529 release number, and use that as a signal to automatically print the
8530 ChangeLog's CVS Id keyword from --version. Discussed starting at
8531 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
8532 * ChangeLog: Add Id header.
8533 * configure.ac (AC_INIT): Append `+' to `2.3'.
8534 * src/.cvsignore: Add revision.c.
8535 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
8536 (BUILT_SOURCES): Add revision.c.
8537 (revision.c): New target rule. This file defines a new global variable
8538 named revision. It initializes it with either the Id from ChangeLog
8539 or, if VERSION doesn't contain `+', with the empty string.
8540 * src/getargs.c (version): Print the value of revision.
8541 * src/revision.h: Extern revision.
8543 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
8545 * NEWS: Version 2.3.
8546 * configure.ac (AC_INIT): Likewise.
8548 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
8550 * data/glr.c (YYRECOVERING): Define to be a function-like macro
8551 with no arguments, not as an object-like macro. This is for
8552 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
8553 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
8554 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
8557 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
8559 * src/getargs.c (usage): Back out yesterday's modification of the
8560 --help output so that we don't have to wait for translation before
8563 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
8565 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
8566 Problem reported by Akim Demaille.
8568 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
8570 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
8572 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
8574 * data/yacc.c (yy_reduce_print): Omit trailing white space in
8575 generated source code. Problem reported by Frans Englich in
8576 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
8578 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
8580 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
8581 shell, not within 'make', so that 'make' by an ordinary builder
8582 (using GNU make) does not worry about configuring gzip. This also
8583 works around a bug reported independently by Keith Thompson and by
8584 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
8585 stderr rather than stdout, messing up the build logs.
8587 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
8589 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
8590 to make sure that YYID will never be unused. This fixes a 'make
8591 maintainer-check' failure caused by the recent changes to the 'Trivial
8592 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
8594 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
8596 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
8598 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
8599 state before an empty RHS is always resolved here. Only the location
8600 of that state is guaranteed to be resolved, and that's enough. This
8601 fixes the remaining bug reported by Derek M. Jones in
8602 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
8603 * tests/glr-regression.at (Uninitialized location when reporting
8604 ambiguity): Test the above case.
8605 Also, the embedded comments in this test case claim it checks the case
8606 of an empty RHS that has inherited the initial location. However, the
8607 corresponding LHS was already resolved, so yyresolveLocations didn't
8608 actually have reason to modify it. Fix this by forcing
8609 nondeterministic operation at the beginning of the parse.
8611 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
8613 * data/c.m4 (b4_yy_symbol_print_generate):
8614 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
8615 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
8616 of the bugs reported today by Derek M Jones in
8617 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
8618 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
8619 defined to be a type name without parens or brackets.
8620 (Location Type): Similarly for YYLTYPE.
8621 * tests/regression.at (Trivial grammars): Put in a test for this
8622 bug that will be caught by 'make maintainer-check' (though not,
8623 alas, by 'make check' unless your compiler is picky).
8625 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
8627 * NEWS: Version 2.2.
8628 * configure.ac (AC_INIT): Likewise.
8630 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
8632 * data/glr.c (yyreportTree): Make room in yystates for the state
8633 preceding the RHS. This fixes the segmentation fault reported by Derek
8635 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
8636 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
8637 to the user. Reported for yyreportTree by Derek M. Jones later in the
8639 * THANKS: Add Derek M. Jones.
8640 Update my email address.
8641 Fix typo in Steve Murphy's name.
8643 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
8645 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
8646 checking against YYLAST that caused the parser to miss a potential
8647 alternative in its diagnostic.
8648 Problem reported by Maria Jose Moron Fernandez in
8649 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
8650 * data/lalr1.cc (yysyntax_error_): Likewise.
8651 * data/yacc.c (yysyntax_error): Likewise.
8652 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
8653 tokens, in case we run into an older C compiler.
8654 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
8655 Use them to check for the off-by-one error fixed above.
8657 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
8658 YYSIZE_T, not size_t.
8659 * tests/regression.at (Trivial grammars): New test, to catch
8660 the error fixed by the above patch.
8662 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
8664 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
8666 Reported by Steve Murphy.
8668 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
8670 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
8671 * data/glr.cc: b4_location_flag is now b4_locations_flag.
8673 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
8675 Implement --trace=m4.
8676 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
8677 * src/output.c (output_skeleton): When set, pass -dV to m4.
8679 Factor the handling of flags in m4.
8680 * src/output.c (prepare): Rename the muscle names debug, defines,
8681 error_verbose to debug_flag, defines_flag, error_verbose_flag.
8682 * data/c.m4: Adjust.
8683 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
8684 Use b4_define_flag_if to define other b4_FLAG_if macros.
8685 (b4_location_if): As a consequence, rename as...
8686 (b4_locations_if): this, for consistency.
8687 Adjust all the skeletons.
8689 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
8691 * etc/bench.pm: Shorten bench names.
8693 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
8695 * src/output.h, src/output.c (error_verbose): Move to...
8696 * src/getargs.h, src/getargs.c: here.
8698 Adjust dependencies.
8700 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
8702 * data/c.m4 (b4_copyright): Put the special exception for Bison
8703 skeletons here, so we don't have to put it in each skeleton. All
8704 uses changed. Suggested by Akim Demaille. Also, wrap the
8705 copyright notice, in case it is longer than 80 columns. Replace
8706 comma by newline after title.
8708 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
8710 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
8711 incompatibility, not a bug. Mention that it wasn't fixed as of
8714 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
8716 * examples/extexi: Enforce the precedence of concatenation over
8718 Reported by Tommy Nordgren.
8720 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
8722 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
8723 with the member "token".
8724 Reported by Martin Nylin.
8726 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
8728 * data/glr.c: Switch to Bison 2.2 special-exception language in
8729 the copyright notice. Use more-regular format for titles and
8731 * data/glr.cc: Likewise.
8732 * data/location.cc: Likewise.
8733 * data/yacc.cc: Likewise.
8734 * doc/bison.texinfo (Conditions): Document this.
8735 * NEWS: likewise. Upgrade version to 2.2.
8737 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
8739 * data/glr.cc: Remove dead code.
8741 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
8743 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
8744 that variable and the line breaks the bootstrap. Problem reported
8745 by Juan M. Guerrero.
8747 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
8749 * doc/bison.texinfo (Multiple start-symbols): New.
8751 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
8753 * etc/README, etc/bench.pl: New.
8755 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
8757 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
8759 Reported by Mickael Labau.
8760 * tests/input.at (Torturing the Scanner): Test it.
8762 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
8764 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
8765 Problem reported by Bob Rossi.
8767 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
8769 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
8770 and didn't really work.
8771 For the index, use @ifnotinfo, not @iftex.
8772 Minor cleanups of spacing and terminology.
8774 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
8776 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
8777 of AT_NAME_PREFIX when %name-prefix is not used.
8779 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
8781 Apply --prefix to C++ skeletons too: they change the namespace.
8782 The test suite already exercize these cases.
8783 * data/c++.m4 (b4_namespace): New.
8784 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
8785 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
8786 * data/yacc.c, data/glr.c: Remove a useless `[]'.
8787 * doc/bison.texinfo: Document it.
8788 (Option Cross Key): Use @multitable in all formats. It looks
8789 nicer, even in TeX outputs.
8790 (Rules): Use the same code whatever the output type is.
8791 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
8792 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
8793 * tests/calc.at: Use it, instead of hard coding `yy'.
8795 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
8797 * TODO: Remove dead items.
8799 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
8801 * doc/FAQ: Remove, merged into...
8802 * doc/bison.texinfo (FAQ): this.
8803 * doc/Makefile.am (EXTRA_DIST): Adjust.
8805 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
8807 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
8809 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
8810 * doc/bison.texinfo (Calc++ Scanner): Use it.
8812 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
8814 Fix two nits reported by twlevo, plus one more that I discovered.
8816 * src/assoc.h (assoc_to_string): Give a name to the arg, as
8817 this is the usual Bison style.
8818 * src/location.h (location_print): Likewise.
8820 * src/reader.h (token_name): Likewise.
8822 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
8824 Fix some nits reported by twlevo.
8825 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
8826 and "POSIX". Use more-modern syntax for URLs. Mention C++
8827 and ask for Java. Don't hardwire OS version numbers. Add
8829 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
8830 * src/conflicts.c (solved_conflicts_obstack): Now static.
8832 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
8834 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
8835 page. Say "you can use it" not "you may use it" as on the web page;
8836 we're describing capabilities not granting permission.
8838 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
8840 * data/glr.c (yyresolveLocations): Rename local variables to avoid
8841 shadowing warnings. Use usual patter for iterating through RHS.
8842 * tests/glr-regression.at
8843 (Uninitialized location when reporting ambiguity):
8844 Modify yylex so that it uses its argument, rather than trying
8845 to rely on ARGSUSED (which doesn't work for gcc with warnings).
8846 const char -> char const.
8848 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
8849 Don't use tabs inside commands; it messes up 'ps'.
8850 Problem reported by twlevo.
8852 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
8854 * tests/glr-regression.at (Uninitialized location when reporting
8855 ambiguity): New test case.
8856 * data/glr.c (yyresolveLocations): New function, which uses
8858 (yyresolveValue): Invoke yyresolveLocations before reporting an
8860 * doc/bison.texinfo (Default Action for Locations): Note
8861 YYLLOC_DEFAULT's usage for ambiguity locations.
8862 (GLR Semantic Actions): Cross-reference those notes.
8864 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
8866 * tests/glr-regression.at (Leaked semantic values when reporting
8867 ambiguity): Remove unnecessary union and type declarations.
8868 (Leaked lookahead after nondeterministic parse syntax error): New test
8870 * data/glr.c (yyparse): Check for zero stacks remaining before
8871 attempting to shift the lookahead so that you don't lose it.
8873 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8875 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
8876 * tests/glr-regression.at (Leaked semantic values when reporting
8877 ambiguity): New test case.
8878 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
8879 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
8880 now unnecessary yystackp parameter.
8881 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
8882 destructors can be called.
8884 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
8885 in existing testcases.
8887 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8889 Don't leak semantic values for parent RHS when a user action cuts the
8890 parser, and clean up related code a bit.
8891 * tests/glr-regression.at (Leaked merged semantic value if user action
8892 cuts parse): Rename to...
8893 (Leaked semantic values if user action cuts parse): ... this. Add check
8894 for leaked parent RHS values.
8895 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
8896 between an unresolved state (non-empty chain of semantic options) and
8897 an incomplete one (signaled by an empty chain).
8898 (yyresolveStates): Document the interface. Move all manipulation of a
8899 successfully or unsuccessfully resolved yyGLRState to...
8900 (yyresolveValue): ... here so that yyresolveValue always leaves a
8901 yyGLRState with consistent data and thus is easier to understand.
8902 Remove the yyvalp and yylocp parameters since they are always just
8903 taken from the yys parameter. When reporting a discarded merged value
8904 in debugging output, note that it is incompletely merged. Document the
8906 (yyresolveAction): If resolving any of the RHS states fails, destroy
8907 them all rather than leaking them. Thus, as long as user actions are
8908 written to clean up the RHS correctly, yyresolveAction always cleans up
8909 the RHS of a semantic option. Document the interface.
8911 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
8913 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
8914 led to a segmentation fault in GNU Pascal. Problem reported
8917 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
8919 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
8920 mid-rule action inside a nonterminal symbol in order to declare a
8921 destructor for its semantic value.
8923 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
8925 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
8926 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
8927 __cplusplus && ! defined _STDLIB_H && !
8928 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
8929 defined free))]: Include <stdlib.h> rather than rolling our own
8930 declarations of malloc and free, to avoid problems with
8931 incompatible declarations (using 'throw') C++'s stdlib.h. This
8932 should fix Debian bug 340012
8933 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
8934 reported by Guillaume Melquiond.
8936 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8938 * NEWS: Clarify symbols versus types in unused-value warnings.
8940 * configure.ac (AC_INIT): Bump version number.
8942 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8944 * NEWS: Version 2.1a.
8945 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
8946 since C99 requires this.
8948 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
8950 * m4/c-working.m4: New file.
8951 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
8953 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
8955 * Makefile.maint: Merge from coreutils.
8957 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
8959 More portability fixes for problems summarized by Nelson H. F. Beebe.
8961 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
8962 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
8963 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
8964 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
8965 messes up because C++ code is compiled in 32-bit mode but linked
8968 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
8970 More portability fixes for problems summarized by Nelson H. F. Beebe.
8972 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
8973 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
8975 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
8976 nodist_PROGRAMS, since we don't need to actually compile the
8977 example if we're just doing a plain 'make'. This avoids bothering
8978 the installer unnecessarily about problems due to weird C++
8981 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
8983 More portability fixes for problems summarized by Nelson H. F. Beebe.
8985 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
8986 than #include "...", and compile with -I'.'. The old method was
8987 not portable, according to Posix and the C standard, and it does
8988 not work with Sun C 5.7, where previous #line directives affect
8989 the working directory used in later #include "..." directives.
8991 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8993 Various DJGGP specific issues in /djgpp
8995 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
8997 More portability fixes for problems summarized by Nelson H. F. Beebe.
8999 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
9000 '#include <map>' works and that you can apply ++ to iterators.
9002 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
9004 Work around portability problems summarized by Nelson H. F. Beebe in
9005 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
9007 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
9008 that '#include <string>' works.
9010 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
9011 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
9012 "warning: sorry: semantics of inline function static data `const
9013 unsigned char translate_table[262]' are wrong (you'll wind up with
9016 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
9017 or, xor to not_, and_, or_, and xor_, respectively. This works
9018 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
9019 random system header somewhere that includes the equivalent of
9022 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
9023 -E" works; it apparently doesn't work with PathScale EKO Compiler
9026 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
9028 During deterministic GLR operation, user actions should be able to
9029 influence the parse by changing yychar. To make this easier to fix and
9030 to make glr.c easier to evolve in general, don't maintain yytoken in
9031 parallel with yychar; just compute yytoken when needed.
9032 * tests/glr-regression.at (Incorrect lookahead during deterministic
9033 GLR): Check that setting yychar in a user action has the intended
9035 * data/glr.c (yyGLRStack): Remove yytokenp member.
9036 (yyclearin): Don't set *yytokenp.
9037 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
9038 yychar rather than *yytokenp to determine the current lookahead.
9039 Compute yytoken locally when needed.
9040 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
9043 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
9044 after `--report' documentation.
9046 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
9048 * src/parse-gram.y (grammar_declaration): Location of printer
9049 symbol is @1, not list->location. Bug reported by twlevo.
9050 * tests/input.at (Incompatible Aliases): Adjust to above change.
9052 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
9054 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
9055 all the test at once. This makes the output easier to read in the
9058 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
9059 got from <http://bro-ids.org/download.html>. The bug is that
9060 when two actions appeared in succession, the second one was
9061 scanned before the first one was added to the grammar rule
9062 as a midrule action. Bison then output the incorrect warning
9063 "parse.y:905.17-906.36: warning: unused value: $3".
9064 * src/parse-gram.y (BRACED_CODE, action): These are no longer
9065 associated with a value.
9066 (rhs): Don't invoke grammar_current_rule_action_append.
9067 (action): Invoke it here instead.
9068 * src/reader.c (grammar_midrule_action): Now extern.
9069 (grammar_current_rule_action_append): Don't invoke
9070 grammar_midrule_action; that is now the scanner's job.
9071 * src/reader.h (last_string, last_braced_code_loc):
9072 (grammar_midrule_action): New decls.
9073 * src/scan-gram.l (last_string): Now extern, sigh.
9074 (last_braced_code_loc): New extern variable.
9075 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
9076 rule already has an action.
9077 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
9078 * tests/input.at (AT_CHECK_UNUSED_VALUES):
9079 Add some tests to check that the above changes fixed the bug.
9081 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
9083 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
9084 All used changed. Check whether the symbol has a destructor,
9085 not whether it is typed.
9086 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
9087 that the values are still reported as unused. All line numbers
9090 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
9092 Work around a bug in bro 0.8, which underparenthesizes its
9093 definition of YYLLOC_DEFAULT.
9094 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
9096 * data/lalr1.cc: Likewise.
9097 * data/yacc.cc: Likewise.
9099 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
9101 Work around a bug in Pike 7.0, and give the Pike folks a
9102 better way to override the usual int widths.
9103 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
9104 user can override the types.
9105 (short): #undef, to work around a bug in Pike 7.0.
9106 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
9107 (union yyalloc.yyss): Use yytype_int16 rather than short.
9109 (yysigned_char): Remove.
9110 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
9111 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
9112 * tests/regression.at (Web2c Actions): Adjust to above changes.
9114 * src/reader.c (check_and_convert_grammar): New function.
9115 (reader): Close the input file even if something went wrong during
9116 parsing. Minor file descriptor leak reported by twlevo.
9118 * src/assoc.c (assoc_to_string): Use a default: abort (); case
9119 to pacify gcc -Wswitch-default.
9120 * src/scan-gram.l (adjust_location): Use a default: break; case
9121 to pacify gcc -Wswitch-default.
9122 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
9123 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
9124 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
9125 Move these decls to scan-skel.l, since they don't need to be
9127 * src/scan-skel.l: Accept the above decls.
9128 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
9131 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
9133 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
9134 since we don't want to insist on a version number at the start
9135 of the changelog every time.
9136 * Makefile.maint: Sync from coreutils a bit better.
9137 (sc_trailing_blank): Renamed from sc_trailing_space.
9139 (sc_no_if_have_config_h, sc_require_config_h):
9140 (sc_prohibit_assert_without_use): New rules.
9141 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
9142 (sc_dd_max_sym_length): Fix leading spaces in rule.
9143 (sc_system_h_headers): Prefix with @.
9144 (sc_useless_cpp_parens, m4-check): Output line numbers.
9145 (changelog-check): Allow version only in head.
9146 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
9147 satisfy new Makefile.maint rule.
9148 * data/glr.c: Likewise.
9149 * data/glr.cc: Likewise.
9150 * data/lalr1.cc: Likewise.
9151 * data/yacc.c: Likewise.
9152 * lib/ebitsetv.c: Likewise.
9153 * lib/lbitset.c: Likewise.
9154 * lib/subpipe.c: Likewise.
9155 * lib/timevar.c: Likewise.
9156 * src/system.h: Likewise.
9157 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
9158 * djgpp/Makefile.maint: Add copyright notice.
9159 * djgpp/README.in: Likewise.
9160 * djgpp/config.bat: Likewise.
9161 * djgpp/config.site: Likewise.
9162 * djgpp/config_h.sed: Likewise.
9163 * djgpp/djunpack.bat: Likewise.
9164 * djgpp/config.sed: Fix copyright notice to match standard format.
9165 * djgpp/subpipe.h: Likewise.
9166 * lib/bitsetv-print.c: Likewise.
9167 * lib/bitsetv.c: Likewise.
9168 * lib/subpipe.h: Likewise.
9169 * lib/timevar.c: Likewise.
9170 * lib/timevar.h: Likewise.
9171 * djgpp/subpipe.c: Use standard recipe for config.h.
9172 * lib/abitset.c: Likewise.
9173 * lib/bitset.c: Likewise.
9174 * lib/bitset_stats.c: Likewise.
9175 * lib/bitsetv-print.c: Likewise.
9176 * lib/bitsetv.c: Likewise.
9177 * lib/ebitsetv.c: Likewise.
9178 * lib/get-errno.c: Likewise.
9179 * lib/lbitset.c: Likewise.
9180 * lib/subpipe.c: Likewise.
9181 * lib/timevar.c: Likewise.
9182 * lib/vbitset.c: Likewise.
9183 * tests/local.at: Likewise.
9184 * src/scan-gram.l: Don't include verify.h, since system.h does
9186 * .x-sc_require_config_h: New file.
9187 * .x-sc_unmarked_diagnostics: New file.
9189 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
9191 Be a bit more systematic about using 'abort'.
9192 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
9193 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
9194 Put 'default: abort ();' before some other case, to satisfy older
9196 * lib/bitset_stats.c (bitset_stats_init): Likewise.
9197 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
9198 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
9199 * src/conflicts.c (resolve_sr_conflict): Likewise.
9200 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
9201 (get_decision_str, get_orientation_str, get_node_alignment_str):
9202 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
9203 (get_linestyle_str, get_arrowstyle_str): Likewise.
9204 * src/conflicts.c (resolve_sr_conflict):
9205 Use a default case rather than one for the one remaining enum
9206 value, to catch invalid enum values as well.
9207 * src/lalr.c (set_goto_map, map_goto):
9208 Prefer "assert (FOO);" to "if (!FOO) abort ();".
9209 * src/nullable.c (nullable_compute, token_definitions_output):
9211 * src/reader.c (packgram, reader): Likewise.
9212 * src/state.c (transitions_to, state_new, state_reduction_find):
9214 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
9215 (symbol_pack): Likewise.
9216 * src/tables.c (conflict_row, pack_vector): Likewise.
9217 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
9218 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
9219 * src/system.h: Don't include <assert.h>.
9220 (assert): New macro.
9222 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
9223 (Destructor Decl, Parser Function, Pure Calling):
9224 Describe rules for braces inside C code more carefully.
9226 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
9228 Fix some porting glitches found by Nelson H. F. Beebe.
9229 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
9230 compilers that don't understand that abort () does not return.
9231 * src/state.c (transitions_to): Likewise.
9232 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
9233 that '#include <cstdlib>' works.
9234 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
9235 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
9236 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
9237 for the benefit of some pre-C99 compilers.
9239 * bootstrap: Undo changes to gnulib files that autoreconf made.
9241 Minor fixups to get 'make maintainer-check' to work.
9242 * configure.ac: Don't use -Wnested-externs, as it's incompatible
9243 with the new verify.h implementation.
9244 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
9245 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
9246 * data/yacc.c (YYUSE): Likewise.
9247 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
9248 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
9249 * src/parse-gram.y (declaration): Don't pass a string constant
9250 to a function that expects char *, since GCC might complain
9251 about the constant value.
9252 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
9253 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
9254 before #defining them.
9255 * tests/glr-regression.at
9256 (Incorrectly initialized location for empty right-hand side in GLR):
9257 In yyerror, use the msg arg.
9258 (Corrupted semantic options if user action cuts parse):
9259 (Incorrect lookahead during deterministic GLR):
9260 (Incorrect lookahead during nondeterministic GLR):
9261 Don't name a local var 'index'; it shadows string.h's 'index'.
9263 2006-01-19 Akim Demaille <akim@epita.fr>
9265 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
9266 location, not just parts of it.
9268 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
9270 * NEWS: Document the fact that multiple %unions are now allowed.
9271 * doc/bison.texinfo (Union Decl): Likewise.
9272 * TODO: This feature is now implemented, so remove it from
9275 * Makefile.maint: Merge with coreutils Makefile.maint.
9276 (CVS_LIST): Use build-aux version if available.
9277 (VERSION_REGEXP): New macro.
9278 (syntax-check-rules): Add sc_no_if_have_config_h,
9279 sc_prohibit_assert_without_use, sc_require_config_h,
9280 sc_useless_cpp_parens.
9281 (sc_obsolete_symbols): Check for O_NDELAY.
9282 (sc_dd_max_sym_length): Track coreutils.
9283 (sc_unmarked_diagnostics): Look in all files, not just *.c.
9284 (sc_useless_cpp_parens): New rule.
9285 (news-date-check): Look for version or today's date.
9286 (changelog-check): Don't require version number near head.
9287 (copyright-check): Use current year instead of hardwiring 2005.
9288 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
9289 (announcement): Add --gpg-key-ID.
9291 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
9294 Avoid undefined behavior that addressed just before the start of an
9295 array. Problem reported by twlevo.
9296 * src/reader.c (packgram): Prepend a new sentinel before ritem.
9297 * src/lalr.c (build_relations): Rely on new sentinel.
9298 * src/gram.c (gram_free): Adjust to new sentinel.
9300 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
9302 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
9303 yylookaheadNeeds. All uses updated.
9304 (yysplitStack): Rename local yynewLookaheadStatuses to
9305 yynewLookaheadNeeds.
9306 * data/glr-regression.at (Incorrect lookahead during nondeterministic
9307 GLR): In comments, change `lookahead status' to `lookahead need'.
9309 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9311 * data/glr.c (yysplitStack): A little stylistic rewrite.
9313 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9315 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
9317 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
9319 * doc/bison.texinfo: Fix some typos.
9320 (GLR Semantic Actions): New subsection discussing special
9321 considerations because GLR semantic actions might be deferred.
9322 (Actions): Mention look-ahead usage of yylval.
9323 (Actions and Locations): Mention look-ahead usage of yylloc.
9324 (Special Features for Use in Actions): Add YYEOF entry and mention it
9325 in the yychar entry.
9326 In the yychar entry, remove mention of the local yychar case (pure
9327 parser) since this is irrelevant information when writing semantic
9328 actions and since it's already discussed in `Table of Symbols' where
9329 yychar is otherwise described as an external variable.
9330 In the yychar entry, don't call it the `current' look-ahead since it
9331 isn't when semantic actions are deferred.
9332 In the yychar and yyclearin entries, add note about deferred semantic
9334 Add yylloc and yylval entries discussing look-ahead usage.
9335 (Look-Ahead Tokens): When discussing yychar, don't call it the
9336 `current' look-ahead, and do mention yylval and yylloc.
9337 (Error Recovery): Cross-reference `Action Features' when mentioning
9339 (Table of Symbols): In the yychar entry, don't call it the `current'
9341 In the yylloc and yylval entries, mention look-ahead usage.
9343 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
9345 * tests/glr-regression.at: Update copyright year to 2006.
9347 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
9349 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
9350 use during nondeterministic operation to track which stacks have
9351 actually needed the current lookahead.
9352 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
9353 Allocate, deallocate, resize, and otherwise shuffle space for
9354 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
9355 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
9356 appropriately during nondeterministic operation.
9357 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
9358 members to store the current lookahead to be used by the deferred
9360 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
9361 from which the RHS is taken. Set the lookahead members of the new
9362 yySemanticOption according to the lookahead status for stack yyk.
9363 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
9364 yyaddDeferredAction.
9365 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
9366 members of yySemanticOption before invoking yyuserAction, and then set
9367 them back to their current values afterward.
9368 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
9369 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
9370 * tests/glr-regression.at: Remove `.' from the ends of recent test case
9371 titles for consistency.
9372 (Leaked merged semantic value if user action cuts parse): In order to
9373 suppress lint warnings, use arguments in merge function, and assign
9374 char value < 128 in main.
9375 (Incorrect lookahead during deterministic GLR): New test case.
9376 (Incorrect lookahead during nondeterministic GLR): New test case.
9378 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
9380 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
9381 !yyvaluep as signal that no semantic value is available to print.
9382 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
9383 to print a semantic value.
9385 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
9387 * tests/glr-regression.at: For consistency with my newer test cases,
9390 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
9392 * data/glr.c (yyresolveValue): When merging semantic options, if at
9393 least one user action succeeds but a later one cuts the parse, then
9394 destroy the semantic value before returning rather than leaking it.
9395 (yyresolveStates): If a user action cuts the parse and thus
9396 yyresolveValue fails, ignore the (unset) semantic value rather than
9397 corrupting the yyGLRState, and empty the semantic options list since
9398 the user actions should have called all necessary destructors.
9399 Simplify code with YYCHK.
9400 * tests/glr-regression.at (Corrupted semantic options if user action
9401 cuts parse): New test case.
9402 (Undesirable destructors if user action cuts parse): New test case.
9403 Before applying any of this patch, this test case never actually failed
9404 for me... but only because the corrupted semantic options usually
9406 (Leaked merged semantic value if user action cuts parse): New test
9409 2006-01-05 Akim Demaille <akim@epita.fr>
9411 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
9413 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
9415 * data/c.m4 (b4_c_modern): New macro, with a new provision for
9416 _MSC_VER. Problem reported by Cenzato Marco.
9417 (b4_c_function_def): Use it.
9418 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
9420 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
9421 than rolling our own.
9423 2006-01-04 Akim Demaille <akim@epita.fr>
9425 Also warn about non-used mid-rule values.
9426 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
9428 (symbol_list_new): Adjust.
9429 * src/reader.c (symbol_typed_p): New.
9430 (grammar_rule_check): Use it.
9431 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
9433 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
9435 * tests/actions.at (Exotic Dollars): Adjust.
9437 2006-01-04 Akim Demaille <akim@epita.fr>
9439 * src/reader.c (grammar_midrule_action): If $$ is set in a
9440 mid-rule, move the `used' bit to its lhs.
9441 * tests/input.at (Unused values): New.
9442 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
9444 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
9446 * doc/bison.texinfo (Bison Options): Say more accurately what
9448 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
9449 about declarations in the grammar when in Yacc mode, as POSIX does
9450 not require a diagnostic when the grammar uses extensions.
9452 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
9454 Warn about dubious constructions like "%token T T".
9456 * src/symtab.h (struct symbol.declared): New member.
9457 * src/symtab.c (symbol_new): Initialize it to false.
9458 (symbol_class_set): New arg DECLARING, specifying whether
9459 this is a declaration that we want to warn about, if there
9460 is more than one of them. All uses changed.
9462 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
9463 Allow multiple %union directives, whose contents concatenate.
9464 * src/parse-gram.y (grammar_declaration): Likewise.
9465 Use muscle_code_grow, so that we don't need stype_line any more.
9468 * src/muscle_tab.c (muscle_grow): Fix comment.
9470 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
9471 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
9472 Update copyright year to 2006.
9474 2006-01-03 Akim Demaille <akim@epita.fr>
9476 Have glr.cc pass (some of) the calc.at tests.
9477 * data/glr.cc (b4_parse_param_orig): New.
9478 (b4_parse_param): Improve its definition, and bound it more
9479 clearly in the skeleton.
9480 (b4_epilogue): Append, instead of prepending, in order to keep
9482 Simplify the generation of auxiliary functions: locations and
9483 purity are mandated.
9484 (b4_global_tokens_and_yystype): Honor it.
9485 * data/location.cc (c++.m4): Don't include it.
9486 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
9488 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
9490 Be sure to initialize the first position's filename.
9491 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
9493 (AT_CHECK_CALC_GLR_CC): New.
9494 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
9496 2006-01-02 Akim Demaille <akim@epita.fr>
9498 * src/output.c (output_skeleton): Don't hard wire the inclusion of
9500 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
9501 * data/glr.cc: Do not include stack.hh.
9503 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
9505 * data/glr.c: Reformat whitespace with tabs.
9506 (b4_lpure_formals): Remove this unused m4 macro.
9507 * tests/cxx-type.at: Reformat whitespace with tabs.
9508 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
9509 since it's a member. Rename type to isNterm for clarity.
9511 2005-12-29 Akim <akim@sulaco.local>
9513 Let glr.cc catch up with symbol_value_print.
9514 * data/glr.cc (b4_yysymprint_generate): Replace by...
9515 (b4_yy_symbol_print_generate): this.
9516 (yy_symbol_print, yy_symbol_value_print): Declare them.
9518 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
9520 * src/location.h (boundary): Note that a line or column equal
9521 to INT_MAX indicates an overflow.
9522 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
9523 (rule_length_overflow, increment_rule_length, add_column_width):
9525 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
9526 (<SC_BRACED_CODE>"}"):
9527 Use increment_rule_length rather than incrementing it by hand.
9528 (adjust_location, handle_syncline): Diagnose overflow.
9529 (handle_action_dollar, handle_action_at):
9530 Fix bug with monstrosities like $-2147483648.
9531 Remove now-unnecessary checks.
9532 (scan_integer): Verify assumptions and remove now-unnecessary checks.
9533 (convert_ucn_to_byte): Verify assumptions.
9534 (handle_syncline): New arg LOC. All callers changed.
9535 Don't store through a value derived from char const * pointer.
9537 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
9540 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
9542 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
9543 Remove unnecessary forward static decls.
9545 2005-12-27 Akim Demaille <akim@epita.fr>
9547 * src/reader.c (grammar_current_rule_check): Also check that $$
9549 Take the rule to check as argument, hence rename as...
9550 (grammar_rule_check): this.
9551 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
9553 (grammar_rule_begin, grammar_rule_end): these, for consistency.
9554 (grammar_midrule_action, grammar_symbol_append): Now static.
9555 * tests/torture.at (input): Don't rely on the default action
9556 being always performed.
9557 * tests/calc.at: "Set" $$ even when the action is "cut" with
9559 * tests/actions.at (Exotic Dollars): Instead of using unused
9560 values, check that the warning is issued.
9562 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
9564 * NEWS: Improve wording for unused-value warnings.
9566 2005-12-22 Akim Demaille <akim@epita.fr>
9568 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
9569 (b4_yysymprint_generate): Rename as...
9570 (b4_yy_symbol_print_generate): this.
9571 Generate yy_symbol_print instead of yysymprint.
9572 Generate also yy_symbol_value_print, and use it.
9574 2005-12-22 Akim Demaille <akim@epita.fr>
9576 * NEWS: Warn about unused values.
9577 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
9579 (symbol_list_n_get, symbol_list_n_used_set): New.
9580 (symbol_list_n_type_name_get): Use symbol_list_n_get.
9581 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
9582 * src/reader.c (grammar_current_rule_check): Check that values are
9584 * src/symtab.c (symbol_print): Accept 0.
9585 * tests/existing.at: Remove the type information.
9587 Remove useless actions (beware of mid-rule actions: perl -000
9588 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
9589 * tests/actions.at (Exotic Dollars): Use unused values.
9590 * tests/calc.at: Likewise.
9591 * tests/glr-regression.at (No users destructors if stack 0 deleted):
9594 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
9597 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
9599 Undo 2005-12-01 tentative license wording change. The wording is
9600 still being reviewed by the lawyers, and we don't want to wait for
9601 them before publishing a test release. For now, revert to the
9603 * NEWS: Undo 2005-12-01 change.
9604 * data/glr.c: Revert to previous license wording.
9605 * data/glr.cc: Likewise.
9606 * data/lalr1.cc: Likewise.
9607 * data/location.cc: Likewise.
9608 * data/yacc.c: Likewise.
9610 * NEWS: Reword %destructor vs YYABORT etc.
9611 * data/glr.c: Use American spacing, for consistency.
9612 * data/glr.cc: Likewise.
9613 * data/lalr1.cc: Likewise.
9614 * data/yacc.c: Likewise.
9615 * data/yacc.c: Reformat comments slightly.
9616 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
9617 for consistency. Fix some spelling errors and reword recently-included
9619 * tests/cxx-type.at: Cast results of malloc, for C++.
9621 2005-12-21 Joel E. Denny <address@hidden>
9623 * tests/cxx-type.at: Construct a tree, count the parents of shared
9624 nodes, and free each node once and only once. Previously, the memory
9625 for semantic values was leaked instead.
9627 2005-12-21 Joel E. Denny <address@hidden>
9629 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
9630 (yylval, yylloc): If pure, #define to yystackp->yyval and
9631 yystackp->yyloc similar to yychar and yynerrs.
9632 (yyparse): If pure, remove local yylval and yylloc. Add local
9633 yystackp to accommodate pure definitions of yylval and yylloc.
9634 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
9635 yylvalp and yyllocp to &yylval and &yylloc.
9636 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
9637 namespace. Previously, nerrs and char were missing, but lval and lloc
9639 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
9640 yylvalp and yyllocp parameters since, if pure, these are now always
9641 accessible through yystackp. If not pure, they are still accessible
9643 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
9644 `if (YYID (N))' to pacify lint.
9646 2005-12-21 Akim Demaille <akim@epita.fr>
9648 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
9649 destroy the RHS symbols of a rule.
9650 * data/yacc.c (yylen): Initialize to 0.
9651 Keep its value to the number of items to possibly shift.
9652 In particular, a regular successful parse that ends on YYFINAL by
9653 a (internal) YYACCEPT must not have yylen != 0.
9654 (yyerrorlab, yyreturn): Pop the RHS.
9655 Reorder a bit to emphasize the `shifting' bits of code.
9656 (YYPOPSTACK): Now accept a number of items to pop.
9657 * data/lalr1.cc: Likewise.
9658 * data/glr.c: Formatting changes.
9659 Use goto instead of fall through.
9660 * doc/bison.texinfo (Destructor Decl): Complete.
9662 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9664 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
9665 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
9666 * djgpp/config.bat: Replace every occurence of the file name
9667 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
9668 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
9669 * djgpp/config.sed: Replace every occurence of the file name
9670 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
9671 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
9672 * djgpp/djunpack.bat: DJGPP specific file.
9673 * djgpp/fnchange.lst: DJGPP specific file.
9674 * djgpp/README.in: Add new information about how to unpack the bison
9675 source on MSDOS and other systems which have 8.3 file name restrictions
9676 using djunpack.bat and fnchange.lst.
9678 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
9680 * bootstrap (build_cvs_prefix): Remove; unused.
9681 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
9682 when getting gnulib.
9684 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
9686 * data/glr.c: Reorder typedef declarations for structs to match order
9687 of struct declarations.
9688 Rename yystack everywhere to yystackp except in yyparse where it's not
9690 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
9692 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
9693 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
9694 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
9697 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
9699 * tests/sets.at (Accept): Fix typos in regular expression used to
9700 sed out the final state number.
9702 Work around portability problem on Solaris 10: flex-generated
9703 files include <stdio.h> before <config.h>, which messes up
9704 because the latter defines __EXTENSIONS__. Address the problem
9705 by creating two new little files that include <config.h> first,
9706 then include the flex-generated files. Rewrite everyone else
9707 to include <config.h> first, as well.
9708 * lib/timevar.c: Always include "config.h".
9709 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
9710 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
9711 (EXTRA_bison_SOURCES): New macro.
9712 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
9713 * src/system.h: Don't include config.h.
9714 * src/LR0.c: Include <config.h> first.
9715 * src/assoc.c: Likewise.
9716 * src/closure.c: Likewise.
9717 * src/complain.c: Likewise.
9718 * src/conflicts.c: Likewise.
9719 * src/derives.c: Likewise.
9720 * src/files.c: Likewise.
9721 * src/getargs.c: Likewise.
9722 * src/gram.c: Likewise.
9723 * src/lalr.c: Likewise.
9724 * src/location.c: Likewise.
9725 * src/main.c: Likewise.
9726 * src/muscle_tab.c: Likewise.
9727 * src/nullable.c: Likewise.
9728 * src/output.c: Likewise.
9729 * src/parse-gram.y: Likewise.
9730 * src/print.c: Likewise.
9731 * src/print_graph.c: Likewise.
9732 * src/reader.c: Likewise.
9733 * src/reduce.c: Likewise.
9734 * src/relation.c: Likewise.
9735 * src/state.c: Likewise.
9736 * src/symlist.c: Likewise.
9737 * src/symtab.c: Likewise.
9738 * src/tables.c: Likewise.
9739 * src/uniqstr.c: Likewise.
9740 * src/vcg.c: Likewise.
9742 * src/parse-gram.y: Fix minor problems uncovered by lint.
9743 (current_lhs, current_lhs_location): Now static.
9744 (current_assoc): Remove unused variable.
9746 Cleanups so that Bison-generated parsers have less lint.
9747 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
9748 Prepend /*ARGSUSED*/, for lint's sake.
9749 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
9750 definition if 'lint' is defined.
9751 (YYID): New macro (or function, if lint).
9752 All uses of /*CONSTCOND*/0 replaced by YYID(0).
9753 * data/yacc.c: Likewise.
9754 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
9755 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
9756 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
9758 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
9759 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
9760 Use YYID(0) rather than 0, for lint.
9761 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
9762 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
9764 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
9766 * tests/glr-regression.at
9767 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9768 Close memory leak reported by twlevo.
9770 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
9772 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
9774 (yyparse): Iterate another stack in order to call user destructors.
9775 * tests/glr-regression.at (No users destructors if stack 0 deleted):
9777 (Duplicated user destructor for lookahead): This test now is expected
9780 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
9782 * NEWS: Document the following change.
9783 * data/yacc.c: Say "parser skeleton" rather than "file", since
9784 it's no longer just a file.
9785 * data/glr.c: Grant a special exception for C GLR parsers, that
9786 reads like the already-existing exception for C LALR(1) parsers.
9787 * data/glr.cc: Likewise.
9788 * data/lalr1.cc: Likewise.
9789 * data/location.cc: Likewise.
9790 * data/yacc.c: Reword the "written by" statement to clarify that
9791 it was the parser skeleton, not the entire output file.
9792 * data/glr.c: Written by Paul Hilfinger.
9793 * data/glr.cc: Written by Akim Demaille.
9794 * data/lalr1.cc: Likewise.
9796 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
9798 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
9799 Fix typos in previous change that broke 'make check'.
9800 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
9802 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
9803 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
9804 We can revert this once things settle down.
9806 * src/conflicts.c (conflicts_print): Don't print file name twice
9807 when %expect fails because there were no conflicts.
9808 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
9810 * tests/conflicts.at (%expect not enough, %expect too much):
9811 (%expect with reduce conflicts): Adjust to new behavior.
9813 2005-11-18 Akim Demaille <akim@epita.fr>
9815 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
9817 * NEWS: Document this.
9818 * doc/bison.texinfo (Expect Decl): Likewise.
9820 2005-11-16 Akim Demaille <akim@epita.fr>
9822 Generalize the display of semantic values and locations in traces.
9823 * data/glr.c (yy_reduce_print): Fix indices (again).
9824 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
9826 * data/lalr1.cc (yyreduce_print): Rename as...
9827 (yy_reduce_print): this.
9828 Display values and locations.
9829 * data/yacc.c (yy_reduce_print): Likewise.
9830 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
9831 (yysymprint): Move higher to be visible from yy_reduce_print).
9833 * tests/calc.at: Adjust the expected length of the traces.
9835 2005-11-14 Akim Demaille <akim@epita.fr>
9837 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
9838 from 1 to N, while values and location start at 0.
9839 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
9841 2005-11-14 Akim Demaille <akim@epita.fr>
9843 * data/glr.c (yy_reduce_print): Fix the $ number.
9845 2005-11-14 Akim Demaille <akim@epita.fr>
9847 "Use" parse parameters.
9848 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
9849 * data/glr.c, data/glr.cc: Use them.
9850 * data/glr.c (YYUSE): Have a C++ definition that supports
9853 2005-11-14 Akim Demaille <akim@epita.fr>
9855 * data/glr.c (yyexpandGLRStack): Declare only if defined.
9857 2005-11-14 Akim Demaille <akim@epita.fr>
9860 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
9862 2005-11-12 Akim Demaille <akim@epita.fr>
9864 Let position and location be PODs.
9865 * data/location.cc (position::initialize, location::initialize): New.
9866 (position::position, location::location): Define only if
9867 b4_location_constructors is defined.
9868 * data/lalr1.cc (b4_location_constructors): Define it for backward
9870 * doc/bison.texinfo (Initial Action Decl): Use initialize.
9872 2005-11-12 Akim Demaille <akim@epita.fr>
9874 * data/lalr1.cc: Move the body of the ctor and dtor into the
9875 parser file (instead of the header).
9876 Wrap the implementations in a "namespace yy".
9878 2005-11-12 Akim Demaille <akim@epita.fr>
9880 Have glr.c include its header file when created.
9881 * data/glr.c (b4_shared_declarations): New.
9882 Output them verbatim in the parser if !%defines, otherwise
9883 output then in the header file, and include it instead.
9885 2005-11-11 Akim Demaille <akim@epita.fr>
9887 * data/glr.c: Comment changes.
9889 2005-11-11 Akim Demaille <akim@epita.fr>
9891 When yydebug, report semantic and location values for reductions.
9892 * data/glr.c (yy_reduce_print): Report the semantic values and the
9894 (YY_REDUCE_PRINT): Adjust.
9895 (yyglrReduce): Use them.
9896 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
9897 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
9898 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
9901 2005-11-10 Akim Demaille <akim@epita.fr>
9903 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
9904 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
9905 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
9907 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
9909 * m4/cxx.m4, examples/Makefile.am: Don't build
9910 examples/calc++ if no C++ compiler is available. (trivial change)
9912 2005-11-09 Akim Demaille <akim@epita.fr>
9914 * src/scan-skel.l: Use a couple of asserts.
9916 2005-11-03 Akim Demaille <akim@epita.fr>
9918 In some (weird) cases, the final state number is incorrect.
9919 Reported by Alexandre Duret-Lutz.
9920 * src/LR0.c (state_list_append): Remove the computation of
9922 (save_reductions): Do it here.
9923 (get_state): Alpha conversion.
9924 (generate_states): Use a for loop.
9925 * src/gram.h (item_number_is_rule_number)
9926 (item_number_is_symbol_number): New.
9927 * src/state.c: Use assert.
9928 * src/system.h: Include assert.h.
9929 * tests/sets.at (Accept): New.
9931 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9933 * data/glr.c (yyfill): Adjust comment.
9934 (yyresolveAction): Initialize default location properly
9935 for empty right-hand sides.
9936 (yydoAction): Ditto.
9937 Add comment explaining apparently dead code.
9938 * tests/glr-regression.at
9939 (Incorrectly initialized location for empty right-hand side in GLR):
9942 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
9944 * bootstrap (cleanup_gnulib): New function. Use it to clean up
9945 gnulib when interrupted. This fixes some race conditions and
9946 works around some portability problems (one noted by Paul
9949 2005-10-22 Akim <akim@epita.fr>
9951 * Makefile.cfg: Adjust to config -> build-aux.
9954 2005-10-21 Akim Demaille <akim@epita.fr>
9956 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
9958 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
9959 * data/yacc.c (b4_Pure_if): Rename as...
9960 (b4_yacc_pure_if): this.
9961 (YY_SYMBOL_PRINT, yyparse): Adjust.
9962 * doc/bison.texinfo: Formatting changes.
9964 2005-10-21 Akim Demaille <akim@epita.fr>
9966 Finish the transition config -> build-aux.
9967 * configure.ac, Makefile.am: Use build-aux.
9968 * config/prev-version, config/announce-gen, config/Makefile.am:
9970 * build-aux/prev-version, build-aux/announce-gen,
9971 * build-aux/Makefile.am: here.
9973 2005-10-14 Akim Demaille <akim@epita.fr>
9975 * examples/calc++/test: Use set -x only when VERBOSE.
9977 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
9979 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
9980 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
9982 2005-10-13 Akim Demaille <akim@epita.fr>
9984 * src/scan-skel.l: Output the base name parts of the parser and
9986 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
9988 Use this to exercise C++ outputs in subdirs.
9989 Reported by Oleg Smolsky.
9991 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
9993 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
9994 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
9995 Problem reported by John P. Hartmann.
9996 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
9999 2005-10-12 Akim Demaille <akim@epita.fr>
10001 * src/parse-gram.y (version_check): Exit 63 to please missing
10002 (stands for "version mismatch).
10003 * tests/input.at, doc/bison.texinfo: Adjust.
10005 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
10007 Work around portability problems with Visual Age C compiler
10008 (xlc and xlC_r) reported by John P. Hartmann.
10009 * data/location.cc (initial_column, initial_line): Remove.
10010 All uses replaced by 0 and 1.
10011 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
10012 that xlc complains about.
10013 * src/scan-skel.l (skel_wrap): Likewise.
10014 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
10016 * data/yacc.c (YYMODERN_C): New macro, which also looks at
10017 __STDC_VERSION__. Use it everywhere instead of looking at
10018 __STDC__ and __cplusplus.
10020 2005-10-10 Akim Demaille <akim@epita.fr>
10022 * examples/calc++/test: Be quiet unless VERBOSE.
10024 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
10026 * data/c.m4 (yydestruct, yysymprint):
10027 Use YYUSE instead of casting to void.
10028 * data/glr.c (YYUSE): New macro.
10029 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
10030 Use it instead of rolling our own.
10031 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10033 Use /*CONSTCOND*/ to suppress lint warnings.
10034 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10035 (YY_STACK_PRINT): Use 'false' not '0'.
10036 (YYUSE): New macro.
10037 (yysymprint_, yydestruct_): Use it instead of rolling our own.
10038 * data/yacc.c (YYUSE): New macro.
10039 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
10040 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
10041 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
10044 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
10045 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
10047 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
10049 Undo the parts of the unlocked-I/O change that substituted
10050 putc or puts for printf. This might hurt performance a bit,
10051 but some people prefer the printf style.
10052 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
10053 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
10054 All uses replaced by YYFPRINTF and YYDPRINTF.
10055 * data/yacc.c: Likewise.
10056 * lib/bitset.c (bitset_print): Likewise.
10057 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
10059 * lib/lbitset.c (debug_lbitset): Likewise.
10060 * src/closure.c (print_firsts, print_fderives): Likewise.
10061 * src/gram.c (grammar_dump): Likewise.
10062 * src/lalr.c (look_ahead_tokens_print): Likewise.
10063 * src/output.c (escaped_output): Likewise.
10064 (user_actions_output): Break apart two printfs.
10065 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
10066 * src/reduce.c (reduce_print): Likewise.
10067 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
10068 * src/system.h: Include unlocked-io.h rathe than stdio.h.
10070 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
10071 Use assignments rather than casts-to-void to suppress
10072 unused-variable warnings. This pacifies 'lint'.
10073 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
10074 unused-variable warnings.
10076 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10078 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
10080 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
10082 Use unlocked I/O for a minor performance improvement on hosts like
10083 GNU/Linux and Solaris that support unlocked I/O. The basic idea
10084 is to use the gnlib unlocked-io module, and to prefer putc and
10085 puts to printf when either will work (since the latter doesn't
10086 come in an unlocked flavor).
10087 * bootstrap (gnulib_modules): Add unlocked-io.
10088 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
10089 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
10090 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
10091 and similarly for puts and putc and printf.
10092 * data/yacc.c: Likewise.
10093 * lib/bitset.c (bitset_print): Likewise.
10094 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
10095 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
10097 * lib/lbitset.c (debug_lbitset): Likewise.
10098 * src/closure.c (print_firsts, print_fderives): Likewise.
10099 * src/gram.c (grammar_dump): Likewise.
10100 * src/lalr.c (look_ahead_tokens_print): Likewise.
10101 * src/output.c (escaped_output): Likewise.
10102 (user_actions_output): Coalesce two printfs.
10103 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
10104 * src/reduce.c (reduce_print): Likewise.
10105 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
10106 * src/system.h: Include unlocked-io.h rather than stdio.h.
10108 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
10109 this confuses xgettext.
10111 2005-10-02 Akim Demaille <akim@epita.fr>
10113 * bootstrap (gnulib_modules): Add strverscmp.
10114 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
10115 * m4/.cvsignore: Add strverscmp.m4.
10116 * src/parse-gram.y (%require): New token, new rule.
10117 (version_check): New.
10118 * src/scan-gram.l (%require): Adjust.
10119 * tests/input.at (AT_REQUIRE): New.
10121 * doc/bison.texinfo (Require Decl): New.
10122 (Calc++ Parser): Use %require.
10124 2005-10-02 Akim Demaille <akim@epita.fr>
10126 * data/location.cc: New.
10128 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
10129 Akim Demaille <akim@epita.fr>
10131 Make sure -odir/foo.cc creates dir/location.hh etc.
10132 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
10133 (spec_file_prefix, spec_verbose_file, spec_graph_file)
10134 (spec_defines_file): Now const.
10136 (short_base_name): Remove.
10137 * src/files.c: Adjust.
10138 (dirname.h): Include.
10139 (base_name): Don't prototype it.
10140 (finput): Remove, duplicates gram_in.
10141 (full_base_name, short_base_name): Replace by...
10142 (all_but_ext, all_but_tab_ext): these.
10143 (compute_base_names): Rename as...
10144 (compute_file_name_parts): this.
10145 Update to compute the new variables, including dir_prefix.
10146 Adjust dependencies.
10147 * src/output.c (prepare): Output them.
10148 * src/reader.c: Adjust to use gram_in, not finput.
10149 * src/scan-skel.l (@dir_prefix@): New.
10151 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10153 * lib/subpipe.c: New function end_of_output_subpipe() added
10154 to allow support for non-posix systems. This is a no-op function
10157 * lib/subpipe.h: New function end_of_output_subpipe() added
10158 to allow support for non-posix systems. This is a no-op function
10161 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
10162 handle the lack of pipe/fork functionality on non-posix systems.
10164 * djgpp/Makefile.maint: DJGPP specific file.
10166 * djgpp/README.in: DJGPP specific file.
10168 * djgpp/config.bat: DJGPP specific configuration file.
10170 * djgpp/config.sed: DJGPP specific configuration file.
10172 * djgpp/config.site: DJGPP specific configuration file.
10174 * djgpp/config_h.sed: DJGPP specific configuration file.
10176 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
10178 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
10180 2005-10-02 Akim Demaille <akim@epita.fr>
10182 * data/location.cc: New, extract from...
10183 * data/lalr1.cc: here.
10184 (location.hh): Include it after the user prologue, in case the
10185 filename type is defined by the user.
10186 Forward declation location and position before the pre-prologue.
10187 (yyresult_): Rename as...
10188 (yyresult): this, it's a local variable, not an attribute.
10189 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
10191 2005-10-01 Akim Demaille <akim@epita.fr>
10193 * examples/extexi: Restore the #line generation.
10195 2005-09-30 Akim Demaille <akim@epita.fr>,
10196 Alexandre Duret-Lutz <adl@gnu.org>
10198 Move the token type and YYSTYPE in the parser class.
10199 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
10200 (parser::token): New, from the moved free definition of tokens.
10201 (parser::semantic_value): Now a full definition instead of an
10202 indirection to YYSTYPE.
10203 (b4_post_prologue): No longer included in the header file, but
10204 in the implementation file.
10205 * doc/bison.texi (C+ Language Interface): Update.
10206 * src/parse-gram.y: Support unary %define.
10207 * tests/actions.at: Define global_tokens_and_yystype for backward
10208 compatibility until we update the tests.
10209 * tests/calc.at: Idem.
10210 (first_line, first_column, last_line, last_column): Define for lalr1.cc
10211 to simplify the code.
10213 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
10215 Port to SunOS 4.1.4, which lacks strtoul and strerror.
10216 Ah, the good old days! Problem reported by Peter Klein.
10217 * bootstrap (gnulib_modules): Add strerror, strtoul.
10218 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
10219 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
10221 2005-09-29 Akim Demaille <akim@epita.fr>
10223 * data/c.m4 (b4_error_verbose_if): New.
10224 * data/lalr1.cc: Use it.
10225 (YYERROR_VERBOSE_IF): Remove.
10226 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
10227 parser members, replaced by...
10228 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
10230 (yysyntax_error_): Takes the state number as argument.
10231 (yyreduce_print_): Use the argument yyrule, not the former
10234 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
10236 * bootstrap (gnulib_modules): Add verify.
10237 * lib/.cvsignore: Add verify.h.
10238 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
10239 * src/system.h (verify): Remove.
10240 Include verify.h instead.
10241 * src/tables.c (tables_generate): Use new API for 'verify'.
10243 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
10245 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
10246 local variables whose names begin with 'yy'.
10247 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
10248 Trivial changes from Joel E. Denny.
10250 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
10252 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
10253 don't use alloca any more.
10255 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
10256 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
10257 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
10258 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
10259 to match yacc.c, to test more hosts.
10261 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
10263 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
10264 doesn't affect behavior.
10265 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
10267 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
10268 This works a bit better with glibc, if user code has already included
10270 * doc/bison.texinfo (Bison Parser): Document that users can't
10271 arbitrarily use malloc and free for other purposes. Document
10272 that <alloca.h> and <malloc.h> might be included.
10273 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
10274 user must declare alloca.
10276 * HACKING (release): Forwarn the Translation Project about
10279 2005-09-20 Akim Demaille <akim@epita.fr>
10281 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
10283 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
10285 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
10286 (YYSTACK_ALLOC_MAXIMUM): Use it.
10287 (yysyntax_error): New function.
10288 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
10289 multiple syntax errors are reported, and alloca is being used.
10290 Instead, reallocate buffers twice as big each time, so that
10291 we waste at most half the allocated memory. Start with a small
10292 (128-byte) buffer that will suffice in most cases anyway.
10293 Use yysyntax_error to do most of the work.
10295 * doc/bison.texinfo (Error Reporting, Table of Symbols):
10296 yynerrs is the number of errors reported, not the number of
10297 errors encountered.
10299 * tests/glr-regression.at (Duplicated user destructor for lookahead):
10300 Mark it as expected to fail.
10301 Cast result of malloc; problem reported by twlevo@xs4all.nl.
10302 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
10303 Don't start user-code symbols with "yy", to avoid name space problems.
10305 2005-09-19 Akim Demaille <akim@epita.fr>
10307 Remove the traits, failed experiment.
10308 It never proved useful, and anyway because of the current
10309 definition, it was not possible to have several specialization of
10310 this traits, making it useless.
10311 * data/lalr1.cc (yy:traits): Remove.
10312 Inline its definitions in the parser class.
10314 2005-09-19 Akim Demaille <akim@epita.fr>
10316 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
10317 least Mac OSX with a /usr/local install of gettext.
10319 2005-09-19 Akim Demaille <akim@epita.fr>
10321 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
10322 and yytoken for similarity with the other skeletons.
10324 2005-09-19 Akim Demaille <akim@epita.fr>
10326 * NEWS, configure.ac: update version number to 2.1a.
10328 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
10330 * NEWS: Version 2.1.
10332 * NEWS: Remove notice of yytname change, since it was never in an
10334 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
10336 * src/output.c (prepare): Likewise.
10337 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
10338 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
10339 is not defined. This is an awful hack, but it's enough for now.
10340 All callers changed.
10341 * tests/glr-regression-at (make_value): Args are const pointers now,
10342 to avoid GCC warning.
10343 (Duplicated user destructor for lookahead): New test. Currently
10344 skipped. It fails on my host but I'm not sure it'll always fail.
10346 2005-09-16 Akim Demaille <akim@epita.fr>
10348 * src/symtab.h (struct symbol): Declare the printer and destructor
10349 as const, to avoid accidental calls to free.
10350 (symbol_destructor_set, symbol_printer_set): Adjust.
10351 * src/symtab.c: Adjust.
10353 2005-09-16 Akim Demaille <akim@epita.fr>
10355 * data/c.m4 (b4_token_enums): New.
10356 (b4_token_defines): Rename as...
10357 (b4_token_enums_defines): this.
10358 (b4_token_defines): New, output only the #defines.
10359 * data/yacc.c, data/glr.c: Adjust.
10360 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
10361 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
10364 2005-09-16 Akim Demaille <akim@epita.fr>
10366 * data/lalr1.cc (yylex_): Remove, inline its code.
10367 (yyreport_syntax_error_): Remove, replaced by...
10368 (yysyntax_error_): this which returns a string and leaves to the
10369 caller the call to the users' error function.
10370 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
10371 Move from members of the parser object...
10372 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
10373 to local variables of the parse function.
10375 2005-09-16 Akim Demaille <akim@epita.fr>
10377 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
10378 since it's in Bison's name space.
10380 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
10382 * data/glr.c (yyresolveValue): Add default case to pacify
10383 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
10385 * NEWS: Document when yyparse started to return 2.
10386 * doc/bison.texinfo (Parser Function): Document when yyparse
10389 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
10390 (b4_filename_type): Renamed back from b4_file_name_type. All uses
10392 (class position): file_name -> filename (reverting). All uses changed.
10394 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
10396 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
10397 do anything if $@ exists. This reverts part of the 2005-07-07
10400 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
10402 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
10403 contains obsolete information and isn't worth distributing as a
10404 separate file anyway.
10405 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
10406 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
10407 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
10408 (yyparse): Abort if user code uses longjmp to throw an unexpected
10411 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
10413 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
10414 Suggested by twlevo@xs4all.nl.
10416 * data/glr.c (YYCHK1): Do not assume YYE is in range.
10417 This avoids a diagnostic from gcc -Wswitch-enum.
10418 Problem reported by twlevo@xs4all.nl.
10420 * doc/bison.texinfo: Don't use "filename", as per GNU coding
10421 standards. Use "file name" or "file" or "name", depending on
10423 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
10424 not to hack/foo.tab.c.
10425 (Calc++ Top Level): 2nd arg of main is not const.
10426 * data/glr.c: b4_filename -> b4_file_name.
10427 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
10429 (class position): filename -> file_name. All uses changed.
10430 * data/yacc.c: b4_filename -> b4_file_name.
10431 * lib/bitset.h: filename -> file_name in local vars.
10432 * lib/bitset_stats.c: Likewise.
10433 * src/files.c: Likewise.
10434 * src/scan-skel.l ("@output ".*\n): Likewise.
10435 * src/files.c (file_name_split): Renamed from filename_split.
10436 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
10438 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
10440 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
10441 to accommodate latest gnulib.
10443 * tests/glr-regression.at (Duplicate representation of merged trees):
10444 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
10446 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
10449 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
10451 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
10452 All uses changed. Invoke user destructor after an error during a
10453 split parse (trivial change from Joel E. Denny).
10455 * tests/glr-regression.at
10456 (User destructor after an error during a split parse): New test case.
10457 Problem reported by Joel E. Denny in:
10458 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
10460 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
10462 * README-cvs: Give URLs for recommended tools.
10463 Mention Gzip version problem, and bootstrapping issues.
10464 Remove troubleshooting section, as it's somewhat obsolete.
10466 * bootstrap (no_cache): New var, to accommodate different wget
10467 variants. Use it instead of '-C off'. Problem reported by
10470 * data/glr.c (yydestroyStackItem): New function.
10471 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
10472 debugging information. Problem reported by Joel E. Denny.
10474 2005-08-25 Akim Demaille <akim@epita.fr>
10476 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
10478 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
10480 * data/glr.c (yyrecoverSyntaxError, yyreturn):
10481 Don't invoke destructor on unresolved entries.
10482 * tests/glr-regression.at
10483 (User destructor for unresolved GLR semantic value): New test case.
10484 Problem reported by Joel E. Denny in:
10485 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
10487 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
10489 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
10491 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
10492 lib-prefix.m4, po.m4.
10494 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
10495 in yydestruct diagnostic, since it might not be an error.
10496 Problem reported by Joel Denny near end of
10497 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
10498 * data/lalr1.cc (yyerturn): Likewise.
10499 * data/yacc.c (yyreturn): Likewise.
10500 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
10502 * src/files.c: Remove obsolete FIXME comment.
10504 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
10505 with the other templates, and to fix bogus run-on messages such
10506 as the one reported at the end of
10507 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
10508 All callers changed to avoid the newline.
10509 (yyprocessOneStack): Output two lines rather than one, to accommodate
10510 the above change. This changes the debug output format slightly.
10512 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
10513 reported by Joel E. Denny in
10514 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
10516 * tests/glr-regression.at (Duplicate representation of merged trees):
10517 New test, from Joel E. Denny in:
10518 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
10519 * THANKS: Add Joel E. Denny.
10521 * configure.ac (AC_INIT): Bump to 2.0c.
10523 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
10525 * NEWS: Version 2.0b.
10527 * Makefile.am (SUBDIRS): Put examples before tests, so that
10528 "make check" doesn't finish with "All 1 tests passed".
10530 * tests/regression.at (Token definitions): Don't rely on
10531 AT_PARSER_CHECK for data that contains backslashes. It currently
10532 uses 'echo', and 'echo' isn't portable if its argument contains
10533 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
10534 that the byte '\0xff' is not printable in the C locale; it is,
10535 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
10536 not printable, so use '\0x81' to test.
10538 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
10539 version of GCC, since the macro is used with non-GCC compilers.
10541 Fix core dump reported by Pablo De Napoli in
10542 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
10543 * tests/regression.at (Invalid inputs with {}): New test.
10544 * src/parse-gram.y (token_name): Translate type before using
10547 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
10548 the user's name space. All uses changed to __attribute__
10550 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
10551 Add __attribute__ ((__noreturn__)).
10553 * etc/clcommit: Remove. We weren't using it, and it failed
10554 "make maintainer-distcheck".
10555 * Makefile.maint: Merge from coreutils.
10556 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
10557 (syntax-check-rules): Change list of rules as described below.
10558 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
10559 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
10560 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
10561 (sc_trailing_space): New rules.
10562 (sc_xalloc_h_in_src): Remove.
10563 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
10564 (sc_space_tab, sc_error_exit_success, sc_changelog):
10565 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
10566 (makefile-check, po-check, author_mark_check):
10567 (makefile_path_separator_check, copyright-check):
10568 Use grep -n, to make it easier to find violations.
10569 Use CVS_LIST and CVS_LIST_EXCEPT.
10570 (header_regexp, h_re): Remove.
10572 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
10573 (my-distcheck): Use more-modern GCC flags.
10574 (signatures, %.asc): Remove.
10575 (rel-files, announcement): Remove signatures.
10576 Restore old updating code, even though we don't use it, so
10577 that we're the same as coreutils.
10578 (alpha, beta, major): Depend on news-date-check.
10579 Make the upload commands.
10581 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
10582 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
10583 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
10584 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
10585 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
10586 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
10587 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
10588 * tests/sets.at: Likewise.
10590 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
10591 we comment out the Autoconf version number.
10592 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
10593 it's error-prone and "make maintainer-distcheck" rejects it.
10595 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
10596 Indent calls to "error" to pacify "make maintainer-distcheck",
10597 when the calls are not intended to be translated.
10598 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
10600 * src/Makefile.am (DEFS): Use +=, to pacify
10601 "make maintainer-distcheck".
10602 (bison_SOURCES): Add scan-skel.h.
10603 (sc_tight_scope): New rule, from coreutils.
10605 * src/files.c (src_extension, header_extension):
10606 Now static, not extern.
10607 * src/getargs.c (short_options): Likewise.
10608 * src/muscle_tab.c (muscle_table): Likewise.
10609 * src/parse-gram.y (current_class, current_type, current_prec):
10611 * src/reader.c (grammar_end, previous_rule_end): Likewise.
10612 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
10613 * src/main.c (main): Cast bindtextdomain and textdomain calls to
10614 void, to avoid warning when NLS is disabled.
10615 * src/output.c: Include scan-skel.h.
10616 (scan_skel): Remove decl, since scan-skel.h does this.
10618 Indent calls to "error" to pacify "make maintainer-distcheck".
10619 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
10620 * src/reader.h (gram_end, gram_lineno): New decls to pacify
10621 "make maintainer-distcheck".
10622 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
10623 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
10624 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
10625 (skel_lex_destroy, scan_skel): Move these decls to...
10626 * src/scan-skel.h: New file.
10627 * src/uniqstr.c (uniqstr_assert):
10628 Indent calls to "error" to pacify "make maintainer-distcheck".
10630 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
10633 * tests/torture.at: Revamp to avoid misuse of atoi that
10634 "make maintainer-distcheck" complained about.
10636 * examples/extexi (message): Don't print a message more than once,
10637 and omit line-number decoration that makes Emacs compile think
10638 that informative messages are worth worrying about.
10640 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
10642 * configure.ac: Update version number.
10644 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
10646 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
10647 autogenerated by the maintainer.
10648 * examples/calc++/.cvsignore: Add *.yy.
10650 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
10651 * lib/bitset_stats.c (bitset_stats_init): Likewise.
10652 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10654 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
10656 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
10657 from maintainer-distcheck about casting the argument of 'free'.
10659 * NEWS: Mention recent yytname changes.
10660 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
10662 * bootstrap: For translations that have not yet been upgraded to
10663 the new runtime-po domain, prime the pump by extracting the
10664 relevant strings from the obsolete translations. This code can be
10665 removed once the bison-runtime domain has been translated by each
10668 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
10669 now that token names are already quoted.
10671 Fix problem reported by Anthony Heading.
10672 * data/glr.c (YYTOKEN_TABLE): New macro.
10673 (yytname): Define if YYTOKEN_TABLE.
10674 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
10675 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
10676 (YYERROR_VERBOSE): Define the same way the other skeletons do.
10677 * src/output.c (prepare_symbols): Output token_table_flag.
10679 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
10681 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
10682 again if the first call fails.
10684 * data/glr.c (yytnamerr): New function.
10685 (yyreportSyntaxError): Use it to dequote most string literals.
10686 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
10687 with other skeletons. All uses changed.
10688 (yytnameerr_): New function.
10689 (yyreport_syntax_error): Use it to dequote most string literals.
10690 * data/yacc.c (yytnamerr): New function.
10691 (yyerrlab): Use it to decode most string literals.
10692 * doc/bison.texinfo (Decl Summary, Calling Convention):
10693 Clarify quoting convention of yytname.
10694 * src/output.c (prepare_symbols): Quote all names. This undoes
10695 the 2005-04-17 change, which is now accomplished (mostly) via
10696 changes in the parsers as described above.
10697 * tests/regression.at (Token definitions, Web2c Actions):
10698 Undo most 2005-04-17 change here, too.
10700 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
10702 Fix more problems reported by twlevo@xs4all.nl.
10703 * tests/cxx-type.at: Don't pipe output of ./types through sed to
10704 remove trailing spaces. This loses the exit status of ./types,
10705 and isn't needed since ./types shouldn't be emitting trailing
10707 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
10708 as the stack isn't valid in that case.
10710 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
10711 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
10712 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
10713 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
10715 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
10716 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
10717 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
10720 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
10721 overly-picky compilers that reject 'char *foo = "bar";'.
10723 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
10724 to FILE * parameter, not to stderr. This fixes a typo introduced
10725 in the 2005-07-12 change.
10727 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
10728 warnings from GCC 4.
10730 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
10731 (yyglrShiftDefer, yysplitStack):
10732 Remove unused parameters b4_pure_formals. All uses changed.
10733 (yyglrShift): Remove unused parameters b4_user_formals.
10735 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
10737 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
10739 Destructor cleanups and regularization among the three skeletons.
10740 * NEWS: Document the behavior changes.
10741 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
10742 stack before failing, as the cleanup code will do it for us now.
10743 * data/lalr1.cc (yyerrlab): Likewise.
10744 * data/glr.c (yyparse): Pop everything off the stack before
10745 freeing it, so that destructors get called properly.
10746 * data/lalr1.cc (yyreturn): Likewise.
10747 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
10748 This is more consistent.
10749 * doc/bison.texinfo (Destructor Decl): Mention more reasons
10750 why destructors might be called. 1.875 -> 2.1.
10751 (Destructor Decl, Decl Summary, Table of Symbols):
10752 Some English-language cleanups for %destructor.
10753 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10754 Add output line for destructor of start symbol.
10755 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
10756 because of that same extra output line.
10758 * NEWS: Document minor wording changes in diagnostics of
10759 Bison-generated parsers.
10760 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
10761 Remove unused formals. All uses changed.
10762 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
10763 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
10764 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
10765 Rename yyoverflowab to yyexhaustedlab.
10766 When memory exhaustion occurs during syntax-error reporting,
10767 report it separately rather than in a single diagnostic; this
10769 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
10770 (Memory Exhausted): Renamed from Parser Stack Overflow.
10771 Revamp wording slightly to prefer "memory exhaustion".
10772 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
10774 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
10776 Add i18n support to the GLR skeleton. Partially fix the C++
10777 skeleton; a C++ expert needs to finish this. Remove debugging
10778 msgids; there's little point to having them translated, since they
10779 can be understood only by someone who can read the
10780 (English-language) source code.
10782 Generate runtime-po/bison-runtime.pot automatically, so that we
10783 don't have to worry about garbage getting in that file. We'll
10784 make sure after the next official release that old msgids don't
10786 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
10788 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
10789 Now auto-generated.
10790 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
10791 Fix typos in explanations of the runtime file.
10792 * bootstrap: Change gettext keyword from YYI18N to YY_.
10793 Use standard Makefile.in.in in runtime-po, since we'll arrange
10794 for backward-compatible bison-runtime.po files in a different way.
10795 * data/glr.c (YY_): New macro, from yacc.c.
10796 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
10797 Translate messages intended for users.
10798 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
10799 the wording in the other skeletons. We don't know that the memory
10801 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
10802 Use same method that yacc.c uses.
10803 Don't translate debugging messages.
10804 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
10805 it doesn't work (yet), and requires C++ expertise to fix.
10806 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
10807 Move defn to a more logical place, to be consistent with other
10809 Don't translate debugging messages.
10810 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
10811 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
10812 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
10813 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
10815 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
10816 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
10818 * tests/glr-regression.at (Badly Collapsed GLR States):
10820 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10821 yylex should return 0 at EOF rather than aborting.
10823 Improve tests for stack overflow in GLR parser.
10824 Problem reported by twlevo@xs4all.nl.
10825 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
10827 (yyStackOverflow): Just longjmp, but with value 2 so that caller
10828 can handle the problem.
10829 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
10830 (yyparse): New local variable yyresult to record the result.
10831 Use result of setjmp to set it, rather than storing itinto
10833 (yyDone): Remove label.
10834 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
10835 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
10836 if YYABORT is used).
10837 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
10838 yyparse status; put status > 1 into diagnostic.
10839 Check that status==2 works.
10840 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
10841 Use exit status 3 for failure to open (which shouldn't happen).
10843 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
10845 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
10846 1 on syntax error; just let yyparse do its thing.
10847 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
10848 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
10849 (Exploding the Stack Size with Alloca):
10850 (Exploding the Stack Size with Malloc):
10851 Expect exit status 2, not 1, since the parser is supposed to blow
10852 its stack. Problem reported by twlevo@xs4all.nl.
10854 * data/glr.c (yyparse): Don't assume that the initial calls
10855 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
10856 Print a stack-overflow message and fail instead.
10857 Initialize the line-number information before creating the stack,
10858 so that the stack-overflow message can report line zero safely.
10860 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
10862 Fix problems reported by twlevo@xs4all.nl.
10863 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
10864 (yyuserMerge): Provide a default case if b4_mergers is empty.
10865 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
10866 * tests/glr-regression.at
10867 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10868 Add casts to pacify C++ compilers.
10869 * tests/glr-regression.at (Improper merging of GLR delayed action
10870 sets): Declare yylex before using it.
10871 * tests/Makefile.am (maintainer-check-g++): Fix a stray
10872 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
10873 test for valgrind; valgrind is independent of g++.
10874 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
10875 for compatibility with POSIX 1003.1-2001 (if running coreutils).
10876 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
10877 Use a destructor, so that we can expand the stack. Change
10878 YYSTYPE to char * so that we can free it. Cast result of malloc.
10880 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10882 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
10883 a valgrind failure. Problem reported by twlevo@xs4all.nl.
10885 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
10887 * PACKAGING: New file, suggested by Bruno Haible and taken from
10888 similar wording in gettext's PACKAGING file.
10889 * NEWS: Mention PACKAGING.
10890 * Makefile.am (EXTRA_DIST): Add PACKAGING.
10892 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
10894 * NEWS: Document recent i18n improvements.
10895 * bootstrap: Get runtime translations into runtime-po.
10896 Create runtime-po files automatically, if possible.
10897 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
10898 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
10899 does not infringe on the user's name space.
10900 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
10901 * doc/bison.texinfo (Internationalization): Revamp the English
10902 and Texinfo syntax a bit, to try to make it clearer.
10903 (Bison Options, Option Cross Key): Mention --print-localedir.
10904 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
10905 YYENABLE_NLS. Quote a bit more.
10906 * runtime-po/.cvsignore: New file.
10907 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
10908 * runtime-po/Rules-quot: Remove; now created by bootstrap.
10909 * runtime-po/quot.sed: Likewise.
10910 * runtime-po/boldquot.sed: Likewise.
10911 * runtime-po/en@quot.header: Likewise.
10912 * runtime-po/en@boldquot.header: Likewise.
10913 * runtime-po/insert-header.sin: Likewise.
10914 * runtime-po/remove-potcdate.sin: Likewise.
10915 * runtime-po/Makevars: Likewise.
10916 * runtime-po/LINGUAS: Likewise.
10917 * runtime-po/de.po: Likewise; we will rely on the translation project
10918 to maintain this, so "bootstrap" should get it.
10919 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
10921 * src/main.c (main): Bind the bison-runtime domain, too.
10923 2005-07-12 Bruno Haible <bruno@clisp.org>
10925 * data/yacc.c: Include <libintl.h> when NLS is enabled.
10926 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
10927 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
10928 * runtime-po: New directory.
10929 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
10930 $(DOMAIN).pot-update rule, so that old messages are never dropped.
10931 * runtime-po/Rules-quot: New file, copied from po/.
10932 * runtime-po/quot.sed: Likewise.
10933 * runtime-po/boldquot.sed: Likewise.
10934 * runtime-po/en@quot.header: Likewise.
10935 * runtime-po/en@boldquot.header: Likewise.
10936 * runtime-po/insert-header.sin: Likewise.
10937 * runtime-po/remove-potcdate.sin: Likewise.
10938 * runtime-po/Makevars: New file.
10939 * runtime-po/POTFILES.in: New file.
10940 * runtime-po/LINGUAS: New file.
10941 * runtime-po/bison-runtime.pot: New file.
10942 * runtime-po/de.po: New file.
10943 * m4/bison.m4: New file.
10944 * Makefile.am (SUBDIRS): Add runtime-po.
10945 (aclocaldir, aclocal_DATA): New variables.
10946 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
10948 * src/getargs.c (usage): Document --print-localedir option.
10949 (PRINT_LOCALEDIR_OPTION): New enum item.
10950 (long_options): Add --print-localedir option.
10951 (getargs): Handle --print-localedir option.
10952 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
10953 (Internationalization): New section.
10955 2005-07-12 Akim Demaille <akim@epita.fr>
10957 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
10958 for consistency with the rest of the code.
10959 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
10962 2005-07-12 Akim Demaille <akim@epita.fr>
10964 * src/parse-gram.y: Use %printer instead of YYPRINT.
10966 2005-07-12 Akim Demaille <akim@epita.fr>
10968 * src/symtab.h, src/symtab.c (symbol_print): New.
10969 * src/symlist.h, src/symlist.c (symbol_list_print): New.
10970 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
10972 2005-07-12 Akim Demaille <akim@epita.fr>
10974 * data/glr.c (b4_syncline): Fix (swap) the definitions of
10975 b4_at_dollar and b4_dollar_dollar.
10977 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
10979 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
10980 and Pennello's paper.
10982 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
10984 * data/yacc.c (yyparse): Undo previous patch. Instead,
10985 set yylsp[0] and yyvsp[0] only if the initial action
10986 sets yylloc and yylval, respectively.
10988 * data/yacc.c (yyparse): In the initial action, set
10989 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
10990 This avoids the use of undefined variables if the initial
10991 action does not set yylloc and/or yylval.
10993 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
10995 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
10996 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
10997 Remove from CVS. These files are automatically generated.
10998 * examples/extexi: Clarify that this file is now part of Bison,
10999 not GNU M4, and that it works with any POSIX-compatible Awk.
11000 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
11001 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
11002 so that we also get calc++-parser.yy. Geneate it.
11003 Use $(AWK), not gawk, since any conforming Awk will do.
11004 Put comment before action, since older 'make' can't handle comment
11006 $(BUILT_SOURCES): List all built sources, not just some of them.
11007 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
11008 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
11009 $($(calc_sources_generated)): Remove unnecessary test for existence
11010 of target. (This had a shell syntax error anyway; a stray "x".)
11011 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
11013 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
11015 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
11016 implied by the other modules.
11018 2005-07-06 Akim Demaille <akim@epita.fr>
11020 Bind examples/calc++ to the package.
11021 * examples/calc++/Makefile: Remove, replaced by...
11022 * examples/calc++/Makefile.am: ... this new file.
11023 * examples/calc++/test: Remove input.
11024 * examples/calc++/compile: Remove.
11025 * examples/Makefile.am: New.
11026 * configure.ac, Makefile.am: Adjust.
11027 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
11029 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
11031 * data/glr.c (yyFail): Drastically simplify; since the format argument
11032 never had any % directives, we can simply pass it to yyerror.
11033 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
11034 be modified later, as that is the usual style in glr.c.
11035 Problems reported by Paul Hilfinger.
11037 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
11038 and size overflow errors.
11039 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
11040 in case the user prolog sets feature-test macros like _GNU_SOURCE.
11041 (YYSIZEMAX): New macro.
11042 (yystpcpy): New function, taken from yacc.c.
11043 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
11044 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
11045 so that we don't have to maintain their signatures.
11046 (yyFail): Check for buffer overflow, by using vsnprintf rather
11047 than vsprintf. Allocate a bigger buffer if possible.
11048 Report an error if buffer allocation fails.
11049 (yyStackOverflow): New function.
11050 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
11051 the initialization was successful. It might fail if storage was
11053 (yyexpandGLRStack): Add more checks for storage allocation failure.
11054 Use yyStackOverflow to report failures.
11055 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
11056 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
11057 Don't assume stack number fits in int.
11058 (yysplitStack): Check for storage allocation failure.
11059 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
11060 can print diagnostics on storage allocation failure. All callers
11062 (yyresolveValue): Use yybool for boolean.
11063 (yyreportSyntaxError): Check for size-calculation overflow.
11064 This code is taken from yacc.c.
11065 (yyparse): Check for storage allocation errors when allocating
11068 2005-07-05 Akim Demaille <akim@epita.fr>
11070 Extract calc++ from the documentation.
11071 * doc/bison.texinfo (Calc++): Add the extraction marks.
11072 * examples/extexi: New, from the aborted GNU Programming 2E.
11073 Separate the different paragraph of a file with empty lines.
11074 * examples/Makefile: Use it to extract the whole calc++ example.
11076 2005-06-24 Akim Demaille <akim@epita.fr>
11078 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
11081 2005-06-22 Akim Demaille <akim@epita.fr>
11083 * doc/bison.texinfo (C++ Language Interface): First stab.
11084 (C++ Parsers): Remove.
11086 2005-06-22 Akim Demaille <akim@epita.fr>
11088 * data/lalr1.cc (yylex_): Honor %lex-param.
11090 2005-06-22 Akim Demaille <akim@epita.fr>
11092 Start a set of simple examples.
11093 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
11094 * examples/calc++/calc++-driver.hh,
11095 * examples/calc++/calc++-parser.yy,
11096 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
11097 * examples/calc++/compile, examples/calc++/test: New.
11099 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
11101 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
11102 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
11103 which stems from the 2005-05-27 patch.
11105 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11107 * data/glr.c: Modify treatment of unused parameters to permit use
11108 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
11110 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
11112 Fix infringement on user name space reported by Janos Zoltan Szabo.
11113 * data/yacc.c (yyparse): strlen -> yystrlen.
11115 2005-05-30 Akim Demaille <akim@epita.fr>
11117 * data/lalr1.cc (_): New.
11118 Translate the various messages.
11120 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
11122 Fix infringement on user name space reported by Bruno Haible.
11123 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
11124 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
11125 the user's name space.
11126 (alloca): Include <stdlib.h> to get it, if it's not built in.
11127 (YYMALLOC, YYFREE): Define only if needed.
11128 (malloc, free): Declare, but only if needed, as this infringes on
11129 the user name space.
11131 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
11133 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
11134 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
11136 * lib/ebitset.c (min, max): Undef before defining.
11137 * lib/vbitset.c (min, max): Likewise.
11138 * lib/subpipe.c (create_subpipe): Save local variables in case
11139 vfork clobbers them.
11141 2005-05-24 Bruno Haible <bruno@clisp.org>
11143 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
11144 error message syntax used by gcc-4.0.
11146 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
11148 * README: Mention m4 1.4.3. Remove obsolete advice about
11149 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
11151 * bootstrap: Remove workaround for problem I encountered with
11152 gettext 0.14.1; it seems to be fixed now.
11154 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
11156 * NEWS: Version 2.0a.
11158 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
11159 the previous change.
11161 Various maintainer cleanups.
11162 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
11163 conftest*, for benefit of CVS commands run at the same time as
11164 "configure". Add build-aux, since "bootstrap" now creates it and
11166 * Makefile.cfg (move_if_change): Remove.
11167 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
11168 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
11169 (po_repo, do-po-update, po-update, wget_files, get-targets):
11170 (config.guess-url_prefix, config.sub-url_prefix):
11171 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
11172 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
11173 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
11175 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
11176 this is now the recommended name.
11177 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
11178 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
11179 ylwrap. These files now go into build-aux.
11180 * config/move-if-change: Remove.
11181 * config/prev-version.txt: Bump from 1.75 to 2.0.
11183 * bootstrap: Add stdio-safer, unistd-safer modules.
11184 Remove m4/glibc2.m4 (introduced by latest gnulib, but
11186 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
11187 fopen-safer.c, stdio-safer.h, unistd-safer.h.
11188 * lib/subpipe.c: Include "unistd-safer.h".
11189 (create_subpipe): Make sure all the newly-created
11190 file descriptors are > 2, so that diagnostics don't
11191 get sent down them (which might cause Bison to hang, in theory).
11192 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
11193 * src/files.c (xfopen): Use fopen_safer, not fopen.
11195 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
11196 yesterday's yacc.c fix.
11198 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
11200 * data/glr.c, data/lalr1.cc: Update copyright date.
11202 Fix a destructor bug reported by Wolfgang Spraul in
11203 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
11204 * data/yacc.c (yyabortlab): Don't call destructor, and
11205 don't set yychar to EMPTY.
11206 (yyoverflowlab): Don't call destructor.
11207 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
11208 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
11209 since we no longer output the message "discarding lookahead token
11212 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11214 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
11215 fix a small glitch in debugging output.
11216 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
11217 after YY_SYMBOL_PRINT where needed.
11219 (struct yyGLRState): Add some comments.
11220 (struct yySemanticOption): Add some comments.
11221 (union yyGLRStackItem): Add comment.
11223 (yymergeOptionSets): Correct this to properly perform the union,
11224 avoiding infinite reported by Michael Rosien.
11227 * tests/glr-regression.at: Add test for GLR merging error reported
11230 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
11232 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
11233 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
11234 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
11235 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
11236 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
11237 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
11238 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
11239 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
11240 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
11241 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
11242 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
11243 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
11244 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
11245 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
11246 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
11247 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
11248 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
11249 src/derives.h, src/files.c, src/files.h, src/getargs.c,
11250 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
11251 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
11252 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
11253 src/output.h, src/parse-gram.c, src/parse-gram.h,
11254 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
11255 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
11256 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
11257 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
11258 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
11259 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
11260 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
11261 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
11262 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
11263 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
11264 tests/reduce.at, tests/regression.at, tests/sets.at,
11265 tests/synclines.at, tests/testsuite.at, tests/torture.at:
11266 Update FSF postal mail address.
11268 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
11270 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
11271 Problem reported by Ralf Menzel.
11273 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
11275 * tests/actions.at: Test that stack overflow invokes destructors.
11276 From Marcus Holland-Moritz.
11277 * data/yacc.c (yyerrlab): Move the code that destroys the stack
11279 (yyreturn): to here. That way, destructors are called properly
11280 even if the stack overflows, or the user calls YYACCEPT or
11281 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
11282 (yyoverflowlab): Destroy the lookahead.
11284 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
11286 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
11288 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
11290 * NEWS: Bison-generated C parsers no longer quote literal strings
11291 associated with tokens.
11292 * src/output.c (prepare_symbols): Don't escape strings,
11293 since users don't want to see C escapes.
11294 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
11296 * tests/input.at (Torturing the Scanner): Likewise.
11297 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
11299 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
11301 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
11302 the data size is known to be too small and we can't increase it.
11303 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
11305 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
11307 * src/parse-gram.y: Include quotearg.h.
11308 (string_as_id): Quote $1 before using it as a key, since the
11309 lexer no longer quotes it for us.
11310 (string_content): Don't strip quotes, since lexer no longer
11312 * src/scan-gram.l: Include quotearg.h.
11313 ("\""): Omit quote.
11314 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
11315 a key, since the rest of the lexer doesn't quote it.
11316 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
11317 * tests/regression.at (Token definitions): Check for backslashes
11320 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
11321 (YYSIZE_T): Define to unsigned long int when using an older compiler.
11322 (yyparse): Revamp code to generate long syntax error message, to
11323 make it easier to translate, and to avoid problems with arithmetic
11324 overflow. Change "virtual memory" to "memory" in diagnostic, since
11325 we don't know whether the memory is virtual.
11327 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
11329 * NEWS: Bison-generated C parsers now use the _ macro to
11331 * data/yacc.c (_) [!defined _]: New macro.
11332 All English strings wrapped inside this macro.
11333 * doc/bison.texinfo (Bison Parser): Document _.
11334 * po/POTFILES.in: Include src/parse-gram.c, since it now
11335 includes translateable strings that parse-gram.y doesn't.
11337 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
11339 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
11340 reverting the 2004-10-11 change to this function.
11341 (symbol_check_alias_consistency): Don't call symbol_type_set
11342 if the type name is already correct.
11343 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
11345 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
11347 * tests/regression.at (Token definitions): Don't use a token named
11348 c, as that generates a "#define c ..." that runs afoul of buggy
11349 stdlib.h that uses the identifier c as a member of struct
11350 drand48_data. Problem reported by Horst Wente.
11352 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
11354 * bootstrap: Change translation URL from
11355 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
11356 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
11357 redirection glitches. Problem reported by twlevo@xs4all.nl.
11359 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
11361 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
11362 after operands; POSIX says this isn't portable for the c99 command.
11364 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
11366 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
11367 immediately if a data overrun has occurred; this may help us track
11368 down what may be a spurious failure on MacOS.
11370 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
11372 Respond to problems reported by twlevo@xs4all.nl.
11374 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
11376 * src/vcg.h: Comment fix.
11377 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
11378 (G_CMAX): Change to -1 instead of INT_MAX.
11380 * data/yacc.c (yyparse): Omit spaces before #line.
11382 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
11384 * src/tables.c (state_number_to_vector_number): Put it inside an
11385 "#if 0", since it's not currently used. Problem reported by
11388 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
11390 * src/output.c (escaped_output): Renamed from
11391 escaped_file_name_output, since we now use it for symbol tags as
11392 well. All uses changed.
11393 (symbol_destructors_output, symbol_printers_output):
11394 Escape symbol tags too.
11395 Problem reported by Matyas Forstner in
11396 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
11398 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
11400 * src/output.c (user_actions_output, token_definitions_output,
11401 symbol_destructors_output, symbol_printers_output): Likewise.
11402 * src/reader.c (prologue_augment): Likewise.
11403 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
11405 * src/vcg.c (output_edge): Don't quote linestyle arg.
11406 Problem reported by twlevo@xs4all.nl.
11408 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
11410 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
11411 example, reported by Derek M Jones. Also, make the example even
11412 more outrageous, to better illustrate how bad the problem is.
11414 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
11416 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
11417 putsym. Typo reported by Sebastian Piping.
11419 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
11421 * doc/bison.texinfo (Language and Grammar): some -> same
11422 (Epilogue): int he -> in the
11423 Typos reported by Sebastian Piping via Justin Pence.
11425 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
11427 * tests/glr-regression.at (Improper handling of embedded actions
11428 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
11429 embedded actions and $-N in GLR parsers", work around an Autoconf bug
11430 with dollar signs in test names.
11431 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
11432 for a similar reason.
11434 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
11436 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
11437 wants to redefine G_VIEW.
11439 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
11441 * src/vcg.c (get_view_str): Remove case for normal_view.
11442 Problem reported by twlevo@xs4all.nl.
11444 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
11446 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
11447 Problem reported by twlevo@xs4all.nl.
11449 * doc/bison.texinfo: Change @dircategory from "GNU programming
11450 tools" to "Software development". Requested by Richard Stallman
11453 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
11455 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
11456 Problem reported by twlevo@xs4all.nl.
11458 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
11460 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
11461 keyword; it's not needed with modern compilers, and it doesn't
11462 affect correctness with older compilers. Suggested by
11465 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
11467 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
11468 gcc -Wswitch-default.
11469 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11470 * data/yacc.c (yyparse): Likewise.
11472 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
11474 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
11475 already. Let config.h define any nonstandard values.
11477 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
11479 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
11480 for the benefit of slower hosts. Problem reported by
11481 Nelson H. F. Beebe.
11483 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
11485 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
11486 being defined and not used.
11487 * data/lalr1.cc (yyparse): Likewise.
11488 Use "if (false)" rather than "if (0)".
11490 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
11492 * TODO: Mention that we should allow NUL bytes in tokens.
11494 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
11496 * src/scan-skel.l (<<EOF>>): Don't close standard output.
11497 Problem reported by Hans Aberg.
11499 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
11501 * src/getargs.c (version): Happy new year; update overall
11502 program copyright date from 2004 to 2005.
11504 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
11505 Problem reported by Hans Aberg.
11506 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
11507 (Output file names.): Add a test for the case when standard output
11510 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
11512 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
11513 to fix an oversight in the Bison 2.0 manual.
11515 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
11517 * NEWS: Version 2.0. Reformat the existing news items since
11518 1.875, so that related items are grouped together.
11519 * configure.ac (AC_INIT): Bump version to 2.0.
11520 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
11522 * tests/torture.at (Exploding the Stack Size with Alloca): Set
11523 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
11524 otherwise, we're not testing alloca. Unfortunately there's no
11525 simple way to consult HAVE_ALLOCA here.
11527 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
11530 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
11531 hand. This avoids a warning about comparing int to size_t when
11532 GCC warnings are enabled.
11534 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
11536 * NEWS: Bison-generated parsers no longer default to using the
11537 alloca function (when available) to extend the parser stack, due
11538 to widespread problems in unchecked stack-overflow detection.
11539 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
11540 responsibility to set it to a positive value. This lets the user
11541 specify a value that is not a preprocessor constant.
11542 * data/yacc.c (YYMAXDEPTH): Likewise.
11543 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
11544 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
11545 to be a compile-time constant. However, explain the constraints on it.
11546 Also, explain the constraints on YYINITDEPTH.
11547 (Table of Symbols): Explain that alloca is no longer the default.
11548 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
11551 * doc/bison.texinfo (Location Default Action): Mention that n must
11552 be zero when k is zero. Suggested by Frank Heckenbach.
11554 2004-12-22 Akim Demaille <akim@epita.fr>
11556 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
11557 (parser::state_type, parser::semantic_type, parser::location_type):
11558 Private, not public.
11559 (parser::parse): Return ints, not bool.
11560 Returning a bool introduces a problem: 0 corresponds to false, and
11561 it seems weird to return false on success. Returning true changes
11562 the conventions for yyparse.
11563 Alternatively we could return void and send an exception.
11564 There is no clear consensus (yet?).
11565 (state_stack, semantic_stack, location_stack): Rename as...
11566 (state_stack_type, semantic_stack_type, location_stack_type): these.
11567 Private, not public.
11568 * tests/c++.at: New.
11569 * tests/testsuite.at, tests/Makefile.am: Adjust.
11571 2004-12-21 Akim Demaille <akim@epita.fr>
11573 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
11575 2004-12-21 Akim Demaille <akim@epita.fr>
11577 Don't impose std::string for filenames.
11579 * data/lalr1.cc (b4_filename_type): New.
11580 (position::filename): Use it.
11581 (parser.hh): Move the inclusion of stack.hh and location.hh below
11582 the user code, so that needed headers for the filename type can be
11584 Forward declare them before the user code.
11585 * tests/Makefile.am (check-local, installcheck-local): Pass
11586 TESTSUITEFLAGS to the TESTSUITE.
11588 2004-12-20 Akim Demaille <akim@epita.fr>
11590 Use more STL like names: my_class instead of MyClass.
11592 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
11593 (SemanticStack, SemanticType, StateStack, StateType)
11594 (TokenNumberType, Stack, Slice, Traits, Parser::location)
11595 (Parser::value): Rename as...
11596 (location_stack, location_type, rhs_number_type, semantic_stack)
11597 (semantic_type, state_stack, state_type, token_number_type, stack)
11598 (slice, traits, parser::yylloc, parser::yylval): these.
11600 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
11602 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
11604 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
11605 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
11607 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
11609 Remove uses of 'short int' and 'unsigned short int'. This raises
11610 some arbitrary limits. It uses more memory but nowadays that's
11611 not much of an issue.
11613 This change does not affect the generated parsers; that's a different
11614 task, as some users will want to conserve memory there.
11616 Ideally we should use size_t to represent all object counts, and
11617 something like ptrdiff_t to represent signed differences of object
11618 counts; but that will require more code-cleanup than I have the
11619 time to do right now.
11621 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
11622 Use size_t, not int or short int, to count objects.
11623 * src/closure.c (nritemset, closure): Likewise.
11624 * src/closure.h (nritemset, closure): Likewise.
11625 * src/nullable.c (nullable_compute): Likewise.
11626 * src/print.c (print_core): Likewise.
11627 * src/print_graph.c (print_core): Likewise.
11628 * src/state.c (state_compare, state_hash): Likewise.
11629 * src/state.h (struct state): Likewise.
11630 * src/tables.c (default_goto, goto_actions): Likewise.
11632 * src/gram.h (rule_number, rule): Use int, not short int.
11633 * src/output.c (prepare_rules): Likewise.
11634 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
11635 errs, reductions): Likewise.
11636 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
11638 * src/tables.c (vector_number, tally, action_number,
11639 ACTION_NUMBER_MINIMUM): Likewise.
11640 * src/output.c (muscle_insert_short_int_table): Remove.
11642 2004-12-17 Akim Demaille <akim@epita.fr>
11644 * data/lalr1.cc: Extensive Doxygenation.
11645 (error_): Rename as...
11646 (error): this, since it is visible to the user.
11648 (Parser::message): Now an automatic variable from...
11649 (Parser::yyreport_syntax_error_): here.
11650 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
11652 * tests/input.at: Escape $.
11654 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
11656 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
11657 Parenthesize rhs to avoid obscure problems with mistakes like
11658 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
11659 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
11660 b4_rhs_location): Likewise.
11661 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
11662 b4_rhs_location): Likewise.
11664 2004-12-16 Akim Demaille <akim@epita.fr>
11666 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
11667 yacc.c: be sure to stay within yycheck_.
11668 * tests/actions.at: Re-enable C++ tests.
11670 2004-12-16 Akim Demaille <akim@epita.fr>
11672 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
11675 2004-12-16 Akim Demaille <akim@epita.fr>
11677 Use #define to handle the %name-prefix.
11679 * data/glr.c, data/yacc.c: Comment changes.
11680 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
11681 so that one can refer to yylex in the parser file, and have it
11682 renamed, as is the case with other skeletons.
11684 2004-12-16 Akim Demaille <akim@epita.fr>
11686 Move lalr1.cc internals into yy*.
11688 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
11689 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
11690 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
11691 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
11692 (empty_, final_, terror_, errcode_, ntokens_)
11693 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
11694 (looka_, ilooka_, error_range_, nerrs_):
11696 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
11697 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
11698 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
11699 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
11700 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
11701 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
11702 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
11703 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
11706 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
11708 Fix some problems reported by twlevo at xs4all.
11709 * src/symtab.c (symbol_new): Report an error if the input grammar
11710 contains too many symbols. This is better than calling abort() later.
11711 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
11712 (struct node, struct graph):
11713 Rename member expand to stretch. All uses changed.
11714 (struct graph): Remove member layoutalgorithm. All uses removed.
11715 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
11716 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
11718 (N_STRETCH): Rename from N_EXPAND. All uses changed.
11720 2004-12-15 Akim Demaille <akim@epita.fr>
11722 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
11723 Add more Doxygen comments.
11724 (symprint_, stack_print_, reduce_print_, destruct_, pop)
11725 (report_syntax_error_, translate_): Rename as...
11726 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
11727 (yypop_, yyreport_syntax_error_, yytranslate_): this.
11729 2004-12-15 Akim Demaille <akim@epita.fr>
11731 * data/lalr1.cc (lex_): Rename as...
11733 Move the trace here.
11734 Take the %name-prefix into account.
11735 Reported by Alexandre Duret-Lutz.
11737 2004-12-15 Akim Demaille <akim@epita.fr>
11739 Simplify the C++ parser constructor.
11741 * data/lalr1.cc (debug_): Rename as...
11742 (yydebug_): so that the parser's internals are always in the yy*
11745 (b4_parse_param_decl): Remove the leading comma as it is now only
11746 called as unique argument list.
11747 (Parser::Parser): Remove the constructor accepting a location and
11748 an initial debugging level.
11749 Remove from the other ctor the argument for the debugging level.
11750 (debug_level_type, debug_level, set_debug_level): New.
11752 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
11755 2004-12-15 Akim Demaille <akim@epita.fr>
11757 Remove b4_root related material: failure experiment
11758 (which goal was to allow to derive from a class).
11760 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
11761 definitions and uses.
11763 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
11765 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
11766 not 2, since it's not portable to subtract 1 from the start of an
11767 array. The new item 0 is never set or used. All uses changed.
11769 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
11770 the default definition of YYLLOC_DEFAULT. Problem reported
11771 by Frank Heckenbach.
11773 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
11775 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
11776 the normal case and one for the error case. Just use the
11777 first one uniformly. Problem reported by Frank Heckenbach.
11778 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
11779 use exactly the same macro in both places.
11780 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
11781 so that the normal-case YYRHSLOC works for the error case too.
11783 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
11784 (YYLLOC_DEFAULT): Use the same macro as glr.c.
11785 * doc/bison.texinfo (Location Default Action): Don't claim that
11786 we have an array of locations. Use the same macro for both glr
11787 and lalr parsers. Mention YYRHSLOC. Mention what happens when
11790 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
11792 * HACKING: Update email addresses to send announcements to.
11794 * configure.ac (AC_INIT): Bump version to 1.875f.
11796 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
11798 * NEWS: Version 1.875e.
11799 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
11801 * src/scan-skel.l: Include "complain.h", for "fatal".
11803 * src/relation.h (relation_print, relation_digraph):
11804 Relation sizes are of type relation_node, not size_t (this is
11805 merely a doc fix, since the two types are equivalent).
11806 (relation_transpose): Relation sizes are of type relation_node,
11808 * src/relation.c: Likewise.
11809 (top, infinity): Now of type relation_node, not int.
11810 (traverse, relation_transpose): Use relation_node, not int.
11812 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
11813 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
11814 (yyparse): Remove unused local introduced in 2004-10-25 patch.
11816 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
11817 specifying whether the test should be skipped. Use it tp
11818 specify that the [%defines %skeleton "lalr1.cc"] tests currently
11819 fail on some hosts, and should be skipped.
11821 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
11823 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
11824 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
11825 unless otherwise specified below.
11827 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
11828 to allocate kernel_base, kernel_items, kernel_size, since
11829 they needn't be initialized to 0.
11830 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
11831 * src/closure.c (new_closure): Likewise, for itemset.
11832 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
11833 * src/lalr.c (set_goto_map): Likewise, for temp_map.
11834 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
11835 (build_relations): Likewise for edge, states1, includes.
11836 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
11837 * src/reader.c (packgram): Likewise, for ritem, rules.
11838 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
11839 * src/relation.c (relation_digraph): Likewise for VERTICES.
11840 (relation_transpose): Likewise for new_R, end_R.
11841 * src/symtab.c (symbols_token_translations_init): Likewise for
11842 token_translations.
11843 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
11844 (token_actions): Likewise for yydefact, actrow, conflrow,
11846 (save_column): Likewise for froms[symno], tos[symno].
11847 (goto_actions): Likewise for state_count.
11848 (pack_table): Likewise for base, pos, check.
11849 (tables_generate): Likewise for width.
11851 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
11852 for initial core. Just have a separate core, so we needn't worry
11853 about whether kernel_size and kernel_base are initialized.
11855 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
11856 kernel_size, kernel_items): Remove unnecessary initialization.
11857 * src/conflicts.c (conflicts): Likewise.
11858 * src/derives.c (derives): Likewise.
11859 * src/muscle_tablc (muscle_insert): Likewise.
11860 * src/relation.c (relation_digraph): Likewise.
11861 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
11862 conflrow, conflict_table, conflict_list, table, check):
11865 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
11866 This is because all callers pass unsigned int.
11867 * src/closure.h (new_closure): Likewise.
11869 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
11870 (build_relations): Initialize includes[i] in all cases.
11871 * src/reader.c (packgram): Always initialize rules[ruleno].prec
11872 and rules[ruleno].precsym. Initialize members in order.
11873 * src/relation.c (relation_transpose): Always initialize new_R[i]
11875 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
11877 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
11878 conflict_list[0] was always 0, but now it isn't initialized.
11880 * src/table.c (table_grow): When conflict_table grew, the grown
11881 area wasn't cleared. Fix this.
11883 * lib/.cvsignore: Add strdup.c, strdup.h.
11884 * m4/.cvsignore: Add strdup.m4.
11886 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
11888 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
11889 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
11890 GOTO_NUMBER_MAXIMUM, since we occasionally compute
11891 ngotos + 1 without checking for overflow.
11892 (build_relations): Use END_NODE, not -1, to denote end of edges.
11893 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
11894 build_relations): Use goto_number, not int, for goto numbers.
11895 * src/tables.c (save_column, default_goto): Likewise.
11897 2004-11-23 Akim Demaille <akim@epita.fr>
11899 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
11900 of #defining from yystype.
11901 Don't typedef yystype, C++ does not need it.
11902 This lets it possible to forward declare it as union.
11904 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
11906 * bootstrap (gnulib_modules): Add extensions.
11907 Problem reported by Jim Meyering.
11909 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
11911 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
11912 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
11913 src/system.h, src/tables.c: XFREE -> free, to accommodate
11914 recent change to gnulib xalloc.h.
11915 Problem reported by Jim Meyering.
11917 2004-11-17 Akim Demaille <akim@epita.fr>
11919 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
11921 2004-11-17 Akim Demaille <akim@epita.fr>,
11922 Alexandre Duret-Lutz <adl@gnu.org>
11924 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
11926 (YYCDEBUG): Adjust.
11927 Use it instead of cdebug_.
11928 (Parser::debug_stream, Parser::set_debug_stream): New.
11929 (Parser::symprint_): Define cdebug_ for temporary backward
11931 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
11934 2004-11-17 Akim Demaille <akim@epita.fr>
11936 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
11937 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
11938 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
11939 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
11941 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
11943 * data/glr.c (yyloc_default): Remove; not used.
11944 Problem reported by Frank Heckenbach.
11946 2004-10-25 Akim Demaille <akim@epita.fr>
11948 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
11949 Introduce another definition to address simple location arrays.
11950 (yyGLRStack): New member: yyerror_range.
11951 (yyrecoverSyntaxError, yyparse): Update it.
11952 (yyrecoverSyntaxError): Use it when shifting the error token to
11953 have an accurate range, equivalent to the one computed by both
11954 yacc.c and lalr1.cc.
11955 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
11956 that column numbers start at column 0, as per GNU Coding
11957 Standards, the others tests, and the doc.
11958 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
11959 Adjust to the above change (first column is 0).
11960 And adjust the location of the "<error>", now covering the whole
11963 2004-10-22 Akim Demaille <akim@epita.fr>
11964 and Paul Eggert <eggert@cs.ucla.edu>
11966 Remove some arbitrary limits on goto numbers and relations.
11967 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
11968 initial values, since they're never used.
11969 (set_goto_map): ngotos is now unsigned, so test for overflow
11970 by seeing whether it wraps around to zero.
11971 * src/lalr.h (goto_number): Now size_t, not short int.
11972 (GOTO_NUMBER_MAXIMUM): Remove.
11973 * src/relation.c (relation_print, traverse, relation_transpose):
11974 Check for END_NODE rather than looking at sign.
11975 * src/relation.h (END_NODE): New macro.
11976 (relation_node): Now size_t, not short int.
11978 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
11980 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
11981 keyword, not an identifier. Problem reported by Baron Schwartz in
11982 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
11984 2004-10-11 Akim Demaille <akim@epita.fr>
11986 * src/symtab.c (symbol_check_alias_consistency): Also check
11987 type names, destructors, and printers.
11988 Reported by Alexandre Duret-Lutz.
11989 Recode the handling of associativity and precedence in terms
11990 of symbol_precedence_set.
11991 Accept no redeclaration at all, not even equal to the previous
11993 (redeclaration): New.
11994 Use it to factor redeclaration complaints.
11995 (symbol_make_alias): Don't set the type of the alias, let
11996 symbol_check_alias_consistency do it as for other features.
11997 * src/symtab.h (symbol): Add new member prec_location, and
11999 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
12000 * tests/input.at (Incompatible Aliases): New.
12002 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
12004 .cvsignore fixes to accommodate gnulib changes,
12005 and the practice of naming build directories "_build".
12006 * .cvsignore: Add "_*". Sort.
12007 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
12008 * m4/.cvsignore: Add "*_gl.m4".
12010 2004-10-06 Akim Demaille <akim@epita.fr>
12012 * src/parse-gram.y (add_param): Fix the truncation of trailing
12015 2004-10-05 Akim Demaille <akim@epita.fr>
12017 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
12018 whether the reducion was empty or not. This leaves room to
12019 improve the use of YYLLOC_DEFAULT in such a case.
12020 lalr1.cc is still experimental, so changing this is acceptable.
12021 And finally, there are probably not many users who changed the
12022 handling of locations in GLR, so changing is admissible too.
12024 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
12025 empty reduction, set @$ to an empty location ending the previously
12027 Adjust uses to make sure the code is triggered on empty
12029 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
12030 expected output: empty reductions have empty locations.
12032 2004-09-29 Akim Demaille <akim@epita.fr>
12034 * data/lalr1.cc: Move towards a more standard C++ coding style
12035 for templates: Class < T > -> Class<T>.
12037 2004-09-29 Akim Demaille <akim@epita.fr>
12039 * data/lalr1.cc: Reinstall the former ctor, for sake of
12040 compatibility, but warn it will be removed.
12041 Move towards a more standard C++ coding style (i.e., type *var ->
12044 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
12046 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
12047 since it's less likely to work if NULs are involved in the future.
12049 2004-09-27 Akim Demaille <akim@epita.fr>
12051 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
12053 2004-09-27 Akim Demaille <akim@epita.fr>
12055 * data/lalr1.cc (b4_parse_param_decl_1): New.
12056 (b4_parse_param_decl): Use it to have different names between attribute
12057 and argument names.
12058 (b4_cc_constructor_call): Likewise.
12060 2004-09-24 Akim Demaille <akim@epita.fr>
12062 * src/parse-gram.y (add_param): Strip the leading and trailing
12063 blanks from a formal argument declaration.
12064 (YY_LOCATION_PRINT): New.
12066 2004-09-24 Akim Demaille <akim@epita.fr>
12068 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
12069 after the location.
12071 2004-09-24 Akim Demaille <akim@epita.fr>
12073 * doc/bison.texinfo (Table of Symbols): Sort.
12075 2004-09-21 Akim Demaille <akim@epita.fr>
12077 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
12078 the useless parentheses.
12079 Suggested by Paul Eggert.
12081 2004-09-20 Akim Demaille <akim@epita.fr>
12083 Let the initial-action act on the look-ahead, and use it for the
12084 "initial push" (corresponding to an hypothetical beginning-of-file).
12085 And let lalr1.cc honor %initial-action.
12087 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
12089 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
12090 (Parser::Parser): Remove the ctor that used to initialize it.
12091 (Parser::parse): Like in the other skeletons, issue the "starting
12092 parse" message before any action.
12093 Honor %initial-action.
12094 Initialize the stacks with the lookahead.
12095 * data/yacc.c: Let $$ and @$ in %initial-action designate the
12097 Push them in the stacks.
12098 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
12100 2004-09-20 Akim Demaille <akim@epita.fr>
12102 * doc/bison.texinfo (Initial Action Decl): New.
12104 2004-09-20 Akim Demaille <akim@epita.fr>
12106 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
12107 clearer criterion to define it.
12108 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
12109 When reducing on an empty RHS, use the latest stacked location as
12111 yylloc is not always available.
12112 * data/glr.c: Likewise.
12113 Also, honor initial-actions.
12115 2004-09-20 Akim Demaille <akim@epita.fr>
12117 * data/yacc.c (YY_LOCATION_PRINT): New.
12118 Define when we know YYLTYPE's structure, i.e., when the default
12119 YYLLOC_DEFAULT is used.
12120 * data/c.m4 (b4_yysymprint_generate): Use it.
12121 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
12122 value of the result.
12123 (error_start_): Replace with...
12124 (error_range_): this location array.
12125 This allows to replace code relying on the implementation of
12126 locations by portable code.
12127 * data/yacc.c (yylerrsp): Replace with...
12128 (yyerror_range): this.
12129 Every time a token is popped, update yyerror_range[0], to have an
12130 accurate location for the error token.
12131 * data/glr.c (YY_LOCATION_PRINT): New.
12132 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
12133 deference a pointer.
12134 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
12135 report the location in %printers.
12137 * src/scan-skel.l: Instead of abort, report error messages to ease
12138 understanding skeleton scanning failures.
12140 2004-09-16 Akim Demaille <akim@epita.fr>
12142 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
12143 (iterator, const_iterator): these, to be more in the C++ spirit.
12144 Also, return reverse iterators so that when displaying the stack
12145 we display its bottom first.
12146 (Parser::stack_print_, Parser::reduce_print_): Match the messages
12148 We should probably use vector here though.
12150 2004-09-16 Akim Demaille <akim@epita.fr>
12152 Have more complete shift traces.
12154 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
12155 to report Shifts instead of ad hoc YYDPRINTF invocations,
12156 including for the error token.
12157 * data/lalr1.cc (symprint_): Output the location.
12158 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
12159 output the location within the %printer.
12160 Activate GLR tests, at least to make sure they compile properly.
12161 They still don't pass though.
12162 * tests/calc.at: Adjust expect verbose output, since now "Entering
12163 state..." is on a different line than the "Shifting" message.
12165 2004-09-08 Akim Demaille <akim@epita.fr>
12167 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
12168 Bison directive from the Bison file to the invocation of this
12169 macro, so that these directives are passed to
12170 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
12171 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
12172 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
12173 the extra Bison directives instead of the whole series.
12174 Change the grammar so that there are recoverable errors, and
12175 unrecoverable errors. Now we can have the parser give up before
12176 consuming the whole input. As a result we now can observe that
12177 the lookahead is freed when needed.
12178 Change the parser source to parse argv[1] instead of a hard coded
12180 Simplify yylex, and give a value and location to EOF.
12181 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
12182 passed directives already coded in the file.
12183 Add some tests to check the location of "error".
12184 For some tests, the C++ parser is correct, and not yacc.c.
12185 For other tests, they provide different, but unsatisfying, values,
12186 so keep the C++ value so that at least one parser is "correct"
12187 according to the test suite.
12188 (Actions after errors): Remove, this is subsumed by the
12189 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
12191 2004-09-06 Akim Demaille <akim@epita.fr>
12193 * data/lalr1.cc: Adjust the indentation of the labels.
12194 (Parser::pop): New.
12197 2004-09-06 Akim Demaille <akim@epita.fr>
12199 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
12200 argument, an informative message.
12201 Call YY_SYMBOL_PRINT.
12202 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
12203 * data/lalr1.cc (destruct_): Likewise.
12204 In addition, no longer depend on b4_yysymprint_generate and
12205 b4_yydestruct_generate to generate these functions, do it "by
12208 2004-09-03 Akim Demaille <akim@epita.fr>
12210 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
12211 invoked, yydestruct the lookahead.
12212 * tests/calc.at (Calculator $1): Update the expected lengths of
12213 traces: there is an added line for the discarded lookahead.
12214 * doc/bison.texinfo (Destructor Decl): Some rewording.
12215 Define "discarded" symbols.
12217 2004-09-02 Akim Demaille <akim@epita.fr>
12219 * data/lalr1.cc (translate_, destruct_): No reason to be static.
12221 2004-09-02 Akim Demaille <akim@epita.fr>
12223 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
12224 (YYDSYMPRINTF): Rename as...
12225 (YY_SYMBOL_PRINT): this.
12226 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
12228 Use it instead of direct symprint_ calls.
12229 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
12232 2004-09-02 Akim Demaille <akim@epita.fr>
12234 * data/lalr1.cc (b4_yysymprint_generate): New.
12235 (symprint_): New member function, defined when YYDEBUG.
12236 Use it consistently instead of token/nterm debugging output by
12238 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
12239 %printer calls to use cdebug_ when using lalr1.cc.
12241 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
12243 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
12244 with #ifdef YYDEBUG.
12246 2004-08-26 Akim Demaille <akim@epita.fr>
12248 * doc/bison.texinfo (Implementing Loops): Rename as...
12249 (Implementing Gotos/Loops): this.
12251 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
12253 Adjust to latest gnulib.
12254 * bootstrap (gnulib_modules): Add xalloc-die.
12255 Set LC_ALL=C so that file names sort consistently.
12256 Prefer the gnulib copies of gettext.m4, glibc21.m4,
12257 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
12258 uintmax_t.m4, ulonglong.m4.
12259 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
12260 po.m4 since we are now using _gl.m4 instead.
12262 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
12264 * src/scan-action.l: Remove. Scanning of semantic actions is
12265 handled in scan-gram.l.
12267 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
12269 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
12271 * src/location.h (struct): The file member is a uniqstr.
12272 (equal_boundaries): Use UNIQSTR_EQ for comparison.
12274 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
12276 Fix bug with non-%union parsers that have printers or destructors,
12277 which led to a Bison core dump. Reported by Peter Fales in
12278 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
12280 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
12281 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
12282 not to our own type.
12283 * src/output.c (symbol_destructors_output, symbol_printers_output):
12284 Don't assume %union.
12285 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
12286 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
12287 UNION-FLAG. All callers changed.
12288 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
12289 Use type char, not unsigned int, when declaring an array of char;
12290 this lets us remove a cast.
12291 (Printers and Destructors): Add non-%union test cases.
12293 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
12295 * doc/bison.texinfo: Minor editorial changes, mostly to the new
12296 GLR writeups. E.g., avoid frenchspacing and the future tense,
12297 change "lookahead" to "look-ahead", and change "wrt" to "with
12300 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12302 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
12303 New sections, split off from the GLR Parsers section. Put the new
12304 Simple GLR Parser near the start of the GLR section, for clarity.
12305 Rewrite connective text.
12307 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
12309 * doc/bison.texinfo (Simple GLR Parsers): New section.
12311 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
12313 * NEWS, TODO, doc/bison.texinfo:
12314 Use "look-ahead" instead of "lookahead", to be consistent.
12315 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
12316 while we're fixing "look-ahead".
12317 * src/conflicts.c (shift_set): Renamed from shiftset.
12318 (look_ahead_set): Renamed from lookaheadset.
12319 * src/print.c: Likewise.
12320 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
12321 name for "lookahead".
12322 (report_types, usage): Likewise.
12323 * src/getargs.h (report_look_ahead_tokens): Renamed from
12325 * src/lalr.c (compute_look_ahead_tokens): Renamed from
12326 compute_lookaheads.
12327 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
12328 (look_ahead_tokens_print): Renamed from lookaheads_print.
12329 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
12330 state_rule_lookaheads_print.
12331 * src/state.h: Likewise.
12332 (reductions.look_ahead_tokens): Renamed from lookaheads.
12333 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
12334 AT_DATA_LOOKAHEADS_GRAMMAR.
12336 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
12338 * README: Update location of patched M4 distribution.
12340 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
12342 Don't assume the C++ compiler takes the same arguments as the C compiler
12344 * configure.ac (O0CXXFLAGS): New var.
12345 * tests/atlocal.in (CXXFLAGS): Use it.
12347 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
12349 Fix some "make check" problems with C++ reported by
12350 Albert Chin-A-Young for Tru64 C++ in this thread:
12351 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
12353 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
12354 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12355 Output to a .cc file for C++, not to a .c file.
12356 * tests/calc.at (AT_CHECK_CALC): Likewise.
12357 * tests/regression.at (AT_CHECK_DANCER): Likewise.
12358 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
12360 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
12362 * tests/calc.at, tests/actions.at: Workaround for SGI
12363 C++ compiler. (trivial change)
12365 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
12367 Spent a few hours checking out which prerequisite versions the
12368 current sources actually require. I went all the way back to
12369 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
12370 a seemingly endless set of combinations of versions more recent
12371 than that. The bottom line is that the current sources require
12372 fairly recent versions of the build tools, and it'll be some work
12374 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
12375 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
12376 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
12377 Add comments explaining why those particular versions are
12380 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
12381 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
12382 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
12384 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
12385 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
12387 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
12389 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
12390 0.11.5. Suggested by Bruno Haible.
12391 * bootstrap: Remove gettext version checking.
12393 * doc/bison.texinfo (Decl Summary): Also mention that %union
12394 can depend on prerequisite types. Problem reported by Tim
12397 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
12399 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
12400 * README-alpha: Don't tell people not to package this.
12402 * bootstrap: Don't assume $(...) works; use `...` instead.
12403 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
12406 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
12407 put into the -d output file, and mention what to do if YYSTYPE is
12408 defined as a macro.
12410 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
12412 Undo change made earlier today: it caused autopoint to not bring
12413 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
12416 * bootstrap: Check that gettext version matches what's in
12417 configure.ac. Warn users to ignore robots.txt ERROR 404.
12418 * bootstrap: Undo today's earlier change (logged below).
12419 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
12421 The gettext version checking is causing more trouble than it's
12422 curing; remove it. Problem reported by Paul Hilfinger.
12424 * bootstrap: Issue a warning that one can expect a message
12425 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
12426 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
12428 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
12430 Ensure that the C++ compiler used for testing actually works on a
12431 simple test program; if not, skip the C++-related tests. Problem
12432 reported by Vin Shelton in:
12433 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
12435 * m4/cxx.m4: New file.
12436 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
12437 * tests/atlocal.in (BISON_CXX_WORKS): Add.
12438 * tests/local.at (AT_COMPILE_CXX): Use it.
12440 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
12442 * data/glr.c (yylloc): Output this macro even if locations are not
12443 being generated, as the GLR parser needs it even in that case.
12444 Problem reported by Troy A. Johnson
12445 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
12447 * configure.ac (AC_INIT): Update to 1.875e.
12449 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
12451 * NEWS: Version 1.875d.
12452 * configure.ac (AC_INIT): Likewise.
12453 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
12455 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
12456 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
12457 lalr1.cc runs afoul of the first, and the last two are no longer
12458 supported by GCC 3.4.0.
12459 * README: Mention GNU m4 1.4 or later; mention m4 patches.
12460 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
12462 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
12464 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
12465 unsigned int, for compatibility with latest gnulib hash module.
12466 * src/state.c (state_hash, state_hasher): Likewise.
12467 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
12468 * src/uniqstr.c (hash_uniqstr): Likewise.
12470 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
12472 * NEWS: Unescaped newlines are no longer allowed in char & strings.
12474 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
12475 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
12476 character and string literals.
12477 (unexpected_end): New function.
12478 (unexpected_eof): Use it.
12479 (unexpected_newline): New function.
12480 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
12483 * NEWS: Document %expect-rr.
12485 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
12486 Fix typo by replacing $1 with $option.
12487 Remove more 'intl'-related files.
12488 Don't DEFUN AM_INTL_SUBDIR twice.
12490 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
12491 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
12493 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
12494 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
12495 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
12496 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
12497 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
12498 * src/.cvsignore: Add *.output.
12500 * src/parse-gram.y: Put copyright notice inside %{ %} so it
12501 gets copied to the output file.
12503 2004-04-28 Paul Eggert <eggert@twinsun.com>
12505 Get files from the gnulib and po repositories, instead of relying
12506 on them being in our CVS. Upgrade to latest versions of gnulib
12509 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
12510 * bootstrap: Bootstrap from gnulib and po repositories.
12511 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
12512 * README-cvs: Document these changes. Remove version numbers from
12513 mentions of build tools, since they change so often. Mention Flex.
12515 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
12516 (gl_USE_SYSTEM_EXTENSIONS): Add.
12517 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
12518 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
12520 (AC_ISC_POSIX): Remove; we no longer support this
12521 ancient OS, as it gets in the way of latest Autoconf & gnulib.
12522 (AC_HEADER_STDC): Remove: we now assume C89 or better.
12523 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
12524 Do not check for C89 headers, except for locale.h which is used
12525 by the Yacc library and must port to K&R hosts.
12526 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
12527 Do not check for C89 functions, except for setlocale which is
12528 used by the Yacc library.
12529 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
12530 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
12531 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
12532 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
12533 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
12534 AM_GNU_GETTEXT): Remove; now done by:
12535 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
12536 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
12539 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
12540 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
12541 Define to empty, as gnulib.mk will do the rest for us.
12542 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
12544 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
12545 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
12547 * src/files.c: Include gnulib's xstrndup.h.
12549 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
12550 (REALLOC): Use xnrealloc, for likewise.
12551 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
12552 (strnlen, memrchr): Remove decls; functions no longer used.
12553 Include <stpcpy.h>.
12555 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
12556 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
12557 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
12558 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
12559 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
12560 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
12561 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
12562 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
12563 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
12564 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
12565 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
12566 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
12567 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
12568 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
12569 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
12570 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
12571 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
12572 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
12573 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
12574 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
12575 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
12576 Remove, as these files are now generated automatically
12577 by bootstrap or automake.
12579 * po/ChangeLog: Remove: all but one entry was a duplicate
12580 of this file, and I moved that 2000-11-02 entry here.
12582 * config/.cvsignore: Add Makefile, depcomp, install-sh.
12583 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
12584 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
12585 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
12586 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
12587 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
12588 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
12589 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
12590 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
12591 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
12592 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
12594 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
12595 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
12596 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
12597 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
12598 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
12599 * src/.cvsignore: Remove *_.c.
12602 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
12603 support it. (The latest stable gzip doesn't.)
12605 2004-04-27 Paul Eggert <eggert@twinsun.com>
12607 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
12608 case, as stos_ is now used by destructors due to the 2004-02-09
12611 Remove more K&R C support.
12612 * lib/libiberty.y (PARAMS): Remove. All uses removed.
12613 * lib/subpipe.c (errno): Remove decl.
12614 Include <stdlib.h> unconditionally.
12615 (EXIT_FAILURE): Remove macro.
12616 * src/complain.c (vfprintf, strerror): Remove.
12617 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
12619 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
12620 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
12621 (strchr, strspn, memchr): Remove decls.
12622 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
12623 unconditionally. Do not declare perror.
12624 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
12627 * src/complain.c (_): Remove useless defn, as system.h defines this.
12629 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
12630 with latest obstack.h.
12631 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
12632 to procedure types, as obstack.h now does that for us.
12633 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
12635 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
12636 so that this include file can stand alone.
12637 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
12638 does this now. Include subpipe.h first after config.h, to
12639 test whether it can stand alone.
12641 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
12642 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
12643 unused declaration.
12645 * tests/synclines.at (%union synch line): Put a dummy member in
12646 the union, because empty unions aren't allowed in C. Caught
12649 2004-04-13 Jim Meyering <jim@meyering.net>
12651 * src/conflicts.c (conflicts_print): Correct format string typo:
12652 use `%%' to produce literal `%'. (trivial change)
12654 2004-03-30 Paul Eggert <eggert@twinsun.com>
12656 * src/getargs.c (version): Update copyright year to 2004.
12658 * data/c.m4 (b4_int_type): Use 'short int' rather than
12659 'short', and similarly for 'long', 'unsigned', etc.
12660 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
12661 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
12662 yy_yypstack, yydumpstack): Likewise.
12663 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
12664 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
12666 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
12667 yy_stack_print, yyparse): Likewise.
12668 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
12669 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
12670 * lib/bitset.c (bitset_print): Likewise.
12671 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
12672 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12673 * lib/bitsetv.c (bitsetv_dump): Likewise.
12674 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
12675 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
12677 * src/LR0.c (allocate_itemsets): Likewise.
12678 * src/gram.h (rule_number, rule): Likewise.
12679 * src/lalr.h (goto_number): Likewise.
12680 * src/nullable.c (nullable_compute): Likewise.
12681 * src/output.c (prepare_rules): Likewise.
12682 * src/relation.c (relation_print, relation_digraph): Likewise.
12683 * src/relation.h (relation_node): Likewise.
12684 * src/state.h (state_number, transitions, errs, reductions,
12685 struct state): Likewise.
12686 * src/symtab.h (symbol_number, struct symbol): Likewise.
12687 * src/tables.c (vector_number, tally, action_number,
12688 default_goto, goto_actions): Likewise.
12689 * tests/existing.at (GNU Cim Grammar): Likewise.
12690 * tests/regression.at (Web2c Actions): Likewise.
12692 * src/output.c (muscle_insert_short_int_table): Renamed from
12693 muscle_insert_short_table. All uses changed.
12695 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
12697 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
12698 (declaration): Replace expected_conflicts with expected_sr_conflicts.
12699 Add %expect-rr rule.
12701 * src/scan-gram.l: Recognize %expect-rr.
12703 * src/conflicts.h (expected_sr_conflicts): Rename from
12704 expected_conflicts.
12705 (expected_rr_conflicts): Declare.
12707 * src/conflicts.c (expected_sr_conflicts): Rename from
12708 expected_conflicts.
12709 (expected_rr_conflicts): Define.
12710 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
12712 Use expected_sr_conflicts in place of expected_conflicts.
12713 Warn if expected_rr_conflicts used in non-GLR parser.
12715 * doc/bison.texinfo: Add documentation for %expect-rr.
12717 2004-03-08 Paul Eggert <eggert@gnu.org>
12719 Add support for hex token numbers. Suggested by Odd Arild Olsen in
12720 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
12722 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
12724 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
12725 * src/scan-gram.l (scan_integer): New function.
12727 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
12728 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
12729 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
12730 Say "long int", not "long", for uniformity with GNU style.
12732 2004-02-25 Paul Eggert <eggert@twinsun.com>
12734 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
12735 compilers. This fixes a problem with Intel's C++ compiler being
12736 chatty, reported by Guido Trentalancia in
12737 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
12739 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
12741 Support %destructor and merge error locations in lalr1.cc.
12743 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
12744 (Parser::stos_): Define unconditionally.
12745 (Parser::destruct_): New method. Generate its body with
12746 b4_yydestruct_generate.
12747 (Parser::error_start_): New attribute.
12748 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
12749 token which are discarded.
12750 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
12751 error_start_ when erroneous token are discarded.
12752 (Parser::parse) <yyerrlab1>: Compute the location of the error
12753 token so that it covers all the discarded tokens.
12754 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
12755 it can be called with `%skeleton "lalr1.cc"', and do that.
12757 2004-02-02 Paul Eggert <eggert@twinsun.com>
12759 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
12760 $(top_srcdir)/lib and ../lib. This fixes a bug reported
12761 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
12762 There's no need to mention top_builddir since Automake does that
12764 (INCLUDES): Remove, as Automake says it's obsolescent.
12765 Contents migrated into AM_CPPFLAGS as described above.
12766 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
12768 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12770 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
12771 (yyreportSyntaxError): Handle case where lookahead token is
12774 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12776 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
12777 resulting parsers are compilable with C++.
12779 2003-12-23 Paul Eggert <eggert@twinsun.com>
12781 * config/depcomp, config/install-sh: Sync with Automake 1.8.
12782 * src/output.c (output_skeleton): Rename local var.
12783 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
12784 Bison tokens, as this runs afoul of the 2003-10-07 change that
12785 disallowed NUL bytes in character constants or string literals.
12787 * tests/local.at: Require Autoconf 2.59's Autotest.
12788 * tests/testsuite.at: Don't include local.at, since we now assume
12789 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
12791 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
12792 multiple inclusion warnings.
12794 2003-12-02 Akim Demaille <akim@epita.fr>
12796 * doc/bison.texinfo (How Can I Reset the Parser): More about start
12800 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
12802 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
12804 2003-10-07 Paul Eggert <eggert@twinsun.com>
12806 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
12807 if testsuite doesn't exist.
12809 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
12810 literals, unfortunately.
12811 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
12812 Complain about NUL bytes in character constants or string literals.
12814 2003-10-05 Paul Eggert <eggert@twinsun.com>
12816 * NEWS: Don't document %no-default-prec, as it's still
12818 * doc/bison.texinfo: Document %no-default-prec only if
12819 the defaultprec flag is set. Normally it's not.
12821 2003-10-04 Paul Eggert <eggert@twinsun.com>
12823 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
12824 non-modifiable lvalue, instead of a modifiable one.
12825 * doc/bison.texinfo (Actions): Document that $$ can
12826 be assigned to. Do not claim that $$ and $N are
12827 array element references: user code should not rely on this.
12829 2003-10-01 Paul Eggert <eggert@twinsun.com>
12831 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
12832 (grammar_declaration): Use it.
12833 * src/scan-gram.l: New token %no-default-prec.
12834 * tests/conflicts.at: Revamp tests to use %no-default-prec.
12835 * NEWS, doc/bison.texinfo: Document the above.
12837 2003-10-01 Akim Demaille <akim@epita.fr>
12839 VCG no longer supports long_straight_phase.
12841 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
12842 * src/print_graph.c (print_graph): Adjust.
12844 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
12845 and Paul Eggert <eggert@twinsun.com>
12847 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
12848 Table of Symbols): Document %default-prec.
12849 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
12850 (grammar_declaration): Set default_prec on %default-prec.
12851 * src/scan-gram.l (%default-prec): New token.
12852 * src/reader.h (default_prec): New flag.
12853 * src/reader.c: Likewise.
12854 (packgram): Handle it.
12855 * tests/conflicts.at (%default-prec without %prec,
12856 %default-prec with %prec, %default-prec 1): New tests.
12858 2003-09-30 Paul Eggert <eggert@twinsun.com>
12860 * tests/testsuite.at: Include local.at, not input.at, fixing
12861 a typo in the 2003-08-25 patch.
12863 2003-08-27 Akim Demaille <akim@epita.fr>
12865 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
12868 2003-08-26 Akim Demaille <akim@epita.fr>
12870 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
12871 "<\#" to avoid magic from Gnus when posting parts of this script.
12873 2003-08-26 Akim Demaille <akim@epita.fr>
12875 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
12876 (Parser::parse): here.
12877 Adjust: nerrs and errstatus is now replaced by...
12878 (Parser::nerrs_, Parser::errstatus_): New.
12880 2003-08-25 Akim Demaille <akim@epita.fr>
12882 * config/announce-gen, Makefile.cfg: New.
12883 * Makefile.am: Adjust.
12884 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
12885 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
12887 2003-08-25 Akim Demaille <akim@epita.fr>
12889 When reducing initial empty rules, Bison parser read an initial
12890 location that is not defined. This results in garbage, and that
12891 affects Bison's own parser. Therefore we need (i) to extend Bison
12892 to support a means to initialize this location, and (ii) to use
12893 this CVS Bison to fix CVS Bison's parser.
12895 * src/reader.h, reader.c (epilogue_augment): Remove, replace
12897 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
12898 * src/parse-gram.y: Adjust.
12899 (%initial-action): New.
12900 (%error-verbose): Since we require CVS Bison, there is no reason
12902 * src/scan-gram.l: Adjust.
12903 * src/Makefile.am (YACC): New, to make sure we use our own parser.
12904 * data/yacc.c (yyparse): Use b4_initial_action.
12906 2003-08-25 Akim Demaille <akim@epita.fr>
12908 * doc/bison.texinfo: Don't promote stdout for error messages.
12910 2003-08-25 Akim Demaille <akim@epita.fr>
12912 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
12913 From Alexandre Duret-Lutz.
12915 2003-08-25 Akim Demaille <akim@epita.fr>
12919 2003-08-25 Akim Demaille <akim@epita.fr>
12921 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
12924 2003-08-25 Akim Demaille <akim@epita.fr>
12926 * data/lalr1.cc (Parser::reduce_print_): New.
12929 2003-08-25 Akim Demaille <akim@epita.fr>
12931 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
12932 error recovery loops. This patch is based on
12933 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
12934 Also, augment the similarity between lalr1.cc and yacc.c.
12935 Note: the locations of error recovery rules are not correct yet.
12937 * data/lalr1.cc: Comment changes to augment the similarity between
12938 lalr1.cc and yacc.c.
12939 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
12940 (yyerrlab1): Remove, but where it used to be (now the bottom part of
12941 yyerrlab), when hitting EOF, pop the whole stack here instead of
12942 merely falling thru the default error handling mechanism.
12943 (yyerrorlab): New label, with the old contents of YYERROR,
12944 plus the following change: pop the stack of rhs corresponding
12945 to the production that invoked YYERROR. That is how Yacc
12946 behaves (required by POSIX).
12947 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
12950 2003-08-25 Akim Demaille <akim@epita.fr>
12952 Tune local.at so that people can "autom4te -l autotest calc.at -o
12953 calc" for instance, to extract a sub test suite.
12955 * tests/testsuite.at: Move the initialization, Autotest version
12956 requirement, and AT_TESTED invocation into...
12957 * tests/local.at: here.
12958 * tests/testsuite.at: Include it for compatibility with Autoconf
12960 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
12963 2003-08-04 Paul Eggert <eggert@twinsun.com>
12965 Rework code slightly to avoid gcc -Wtraditional warnings.
12966 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
12967 The returned value is now stored in *YY0. All callers changed.
12968 * src/output.c (merge_output): Adjust to the above change.
12970 2003-07-26 Paul Eggert <eggert@twinsun.com>
12972 * data/glr.c (YYASSERT): New macro.
12973 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
12974 yyresolveStates, yyprocessOneStack):
12975 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
12976 Derived from a suggestion by Frank Heckenbach.
12978 2003-07-25 Paul Eggert <eggert@twinsun.com>
12980 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
12981 for portability to K&R C (after ansi2knr, presumably). See
12982 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
12983 by Frank Heckenbach, though I have omitted the structure-initialization
12984 part of his glr-knr.diff patch since I recall that the Portable
12985 C Compiler didn't require that change.
12987 Let the user specify how to allocate and free memory.
12988 Derived from a suggestion by Frank Heckenbach in
12989 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
12990 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
12991 All uses of free, malloc, realloc changed to use these macros,
12992 and unnecessary casts removed.
12993 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
12995 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
12997 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
12998 use s.empty() rather than s == "" to test for empty string; see
12999 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
13002 2003-06-25 Akim Demaille <akim@epita.fr>
13004 * config/depcomp, config/install-sh: Update from masters.
13006 2003-06-20 Paul Eggert <eggert@twinsun.com>
13008 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
13009 and return properly parenthesized result.
13010 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
13011 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
13012 Remove unnecessary parentheses from uses.
13013 * doc/bison.texinfo (Location Default Action): Describe the
13014 conventions for parentheses.
13016 2003-06-19 Paul Eggert <eggert@twinsun.com>
13018 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
13019 yyreportTree): Do not assume that size_t is the same width as int,
13020 when printing sizes. Print sizes using an unsigned format.
13021 Problem reported by Frank Heckenbach in
13022 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
13024 Port to Forte Developer 7 C compiler.
13025 * data/glr.c (struct YYLTYPE): If locations are not being used,
13026 declare a single dummy member, as empty structs do not conform
13028 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
13029 the Forte Developer 7 C compiler complains that end-of-loop
13030 code is not reached.
13032 2003-06-17 Paul Eggert <eggert@twinsun.com>
13034 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
13035 avoid warnings from picky compilers about redefinition of PARAMS.
13037 2003-06-17 Paul Eggert <eggert@twinsun.com>
13041 * NEWS: Document 1.875b.
13043 * lib/bbitset.h: Do not include config.h; that's the includer's job.
13044 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
13045 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
13046 Don't use 'index' in comments, as it's a builtin fn on some hosts.
13047 * lib/bitset_stats.c: Include gettext.h unconditionally, as
13048 per recent gettext manual's suggestion.
13049 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
13050 Use prototypes, not old-style definitions.
13051 * lib/lbitset.c (lbitset_unused_clear): Likewise.
13052 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
13053 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
13054 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
13055 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
13056 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
13057 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
13058 vbitset_or_and_cmp, vbitset_copy): Likewise.
13060 * lib/libiberty.h: Do not include config.h; that's the includer's job.
13061 Do not include <stdlib.h>.
13062 (PARAMS): Define unconditionally for C89.
13063 (ATTRIBUTE_NORETURN): Remove.
13064 (ATTRIBUTE_UNUSED): Define unconditionally.
13066 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
13067 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
13068 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
13069 * lib/vbitset.c, lib/vbitset.h: New files.
13070 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
13071 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
13074 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
13075 `How Can I Reset @code{yyparse}', since texinfo does not allow
13076 arbitrary @ in node names.
13078 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
13079 shouldn't be needed according to the gettext 0.12.1 documentation
13080 but which seem to be needed anyway: codeset.m4 glibc21.m4
13081 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
13082 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
13083 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
13085 * lib/.cvsignore: Add stdbool.h.
13086 * m4/.cvsignore: Add nls.m4, po.m4.
13088 Upgrade to CVS gnulib.
13089 * stdbool_.h: File renamed from stdbool.h.in.
13090 * configure.ac (AM_STDBOOL_H): Invoke this instead of
13092 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
13093 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
13094 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
13095 (MOSTLYCLEANFILES): New var.
13096 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
13097 (stdbool.h): New rule.
13098 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
13099 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
13100 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
13101 m4/quote.m4: Upgrade to today's gnulib.
13103 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
13104 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
13105 the tests right now.
13106 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
13107 yyerror are declared before use; C99 requires this.
13109 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13111 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
13113 (yyrecoverSyntaxError): Correct the logic for setting and testing
13115 Correct comment on handling EOF.
13116 Allow states with only a default reduction, rather than failing
13117 (I can't quite reconstruct why these were not allowed before).
13119 Fixes to avoid problem that $-N rules in GLR parsers can cause
13120 buffer overruns, corrupting state.
13122 * src/output.c (prepare_rules): Output max_left_semantic_context
13124 * src/reader.h (max_left_semantic_context): New variable declaration.
13125 * src/scan-gram.l (max_left_semantic_context): Define.
13126 (handle_action_dollar): Update max_left_semantic_context.
13127 * data/glr.c (YYMAXLEFT): New definition.
13128 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
13129 (yyresolveAction): Ditto.
13131 Fixes to problems with location handling in GLR parsers reported by
13132 Frank Heckenbach (2003/06/05).
13134 * data/glr.c (YYLTYPE): Make trivial if locations not used.
13135 (YYRHSLOC): Add parentheses, and define only if locations used.
13136 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
13137 locations not used.
13138 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
13139 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
13141 * tests/cxx-type.at: Exercise location information; update tests
13142 to differentiate output with and without locations.
13143 Remove forward declarations of yylex and yyerror---caused errors
13144 because default YYLTYPE not yet defined.
13145 Change semantic actions to compute strings, rather than printing
13146 them directly (to test proper passing of semantics values). Change
13147 output to prefix notation and update test data and expected results.
13148 (yylex): Track locations.
13149 (stmtMerge): Return value rather than printing, and include arguments
13152 2003-06-03 Paul Eggert <eggert@twinsun.com>
13154 Avoid warnings generated by GCC 2.95.4 when Bison is
13155 configured with --enable-gcc-warnings.
13156 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
13157 yy::]b4_parser_class_name[::translate_,
13158 yy::Stack::operator[] (unsigned),
13159 yy::Stack::operator[] (unsigned) const,
13160 yy::Slice::operator[] (unsigned),
13161 yy::Slice::operator[] (unsigned) const):
13162 Rename local vars to avoid warnings.
13163 * tests/glr-regression.at (Improper handling of embedded actions
13164 and $-N in GLR parsers): Remove unused local variable from yylex.
13165 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
13166 (void) as arg when not pure, since we now assume C89 when building
13167 Bison. Pacify GCC by using parameter.
13169 2003-06-02 Paul Eggert <eggert@twinsun.com>
13171 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
13172 yy::Location::lines, yy::Location::columns): Rename arguments
13173 to avoid shadowing; this removes a warning generated by GCC 3.3.
13175 2003-06-01 Paul Eggert <eggert@twinsun.com>
13177 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
13178 to g++, as GCC 3.3 complains if you do it.
13179 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
13180 everything that WARNING_CFLAGS has, except omit warnings
13181 not suitable for C++.
13182 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
13183 * tests/atlocal.in (CXXFLAGS): New var.
13184 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
13186 Fix a GLR parser bug I reported in February; see
13187 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
13188 The problem was that GLR parsers did not conform to the C standard,
13189 because actions like { $1 = $2 + $3; } expanded to expressions
13190 that invoked YYFILL in separate subexpressions, and YYFILL assigned
13191 to a local variable. The C standard says that expressions
13192 like (var = f ()) + (var = f ()) have undefined behavior.
13193 Another problem was that GCC sometimes issues warnings that
13194 yyfill and its parameters are unused.
13196 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
13197 as possibly unused.
13198 (yyfill): New function.
13200 (yyuserAction): Change type of yynormal to bool, so that it matches
13201 the new yyfill signature. Mark it as possibly unused.
13204 Follow up on a bug I reported in February, where a Bison-generated
13205 parser can loop. Provide a test case and a fix for yacc.c. I
13206 don't have a fix for lalr1.cc or for glr.c, unfortunately.
13207 The original bug report is in:
13208 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
13210 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
13211 macro's size was becoming unwieldy.
13212 (yyerrlab): Do not discard an empty lookahead symbol, as this
13213 might destroy garbage.
13214 (yyerrorlab): New label, with the old contents of YYERROR,
13215 plus the following change: pop the stack of rhs corresponding
13216 to the production that invoked YYERROR. That is how Yacc
13217 behaves, and POSIX requires this behavior.
13218 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
13219 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
13220 Define 'alarm' to do nothing if unistd.h is not available.
13221 Add a new rule "exp: '-' error;" to test the above change to
13222 data/yacc.c. Use 'alarm' to abort any test taking longer than
13223 10 seconds, as it's probably looping.
13224 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
13225 Also, the new yacc.c generates two fewer diagnostics for an
13228 2003-05-24 Paul Eggert <eggert@twinsun.com>
13230 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
13231 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
13232 This fixes a problem reported by John Bowman when the Compaq/HP
13233 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
13234 -ansi -Wall -gall).
13235 * data/yacc.c (union yyalloc): Likewise.
13236 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
13238 Switch from 'int' to 'bool' where that makes sense.
13240 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
13241 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
13242 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
13243 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
13244 Return or accept bool, not int. All callers changed.
13245 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
13246 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
13247 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
13248 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
13249 bitset_or_and_cmp_): Likewise.
13250 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
13251 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
13252 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
13253 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
13254 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
13255 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
13256 bitset_stats_or_and_cmp): Likewise.
13257 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
13258 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
13259 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
13260 ebitset_xor_cmp): Likewise.
13261 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
13262 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
13263 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
13264 lbitset_xor_cmp): Likewise.
13265 * lib/bbitset.h: Include <stdbool.h>.
13266 (struct bitset_vtable): The following members now return bool, not
13267 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
13268 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
13270 * src/conflicts.c (count_rr_conflicts): Likewise.
13271 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
13273 * lib/ebitset.c (ebitset_obstack_init): Likewise.
13274 * lib/lbitset.c (lbitset_obstack_init): Likewise.
13275 * src/getargs.c (debug_flag, defines_flag, locations_flag,
13276 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
13277 graph_flag): Likewise.
13278 * src/getargs.h (debug_flag, defines_flag, locations_flag,
13279 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
13280 graph_flag): Likewise.
13281 * src/output.c (error_verbose): Likewise.
13282 * src/output.h (error_verbose): Likewise.
13283 * src/reader.c (start_flag, typed): Likewise.
13284 * src/reader.h (typed): Likewise.
13285 * src/getargs.c (LOCATIONS_OPTION): New constant.
13286 (long_options, getargs): Use it.
13287 * src/lalr.c (build_relations): Use bool, not int.
13288 * src/nullable.c (nullable_compute): Likewise.
13289 * src/print.c (print_reductions): Likewise.
13290 * src/tables.c (action_row, pack_vector): Likewise.
13291 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
13292 * src/output.c (prepare): Use it.
13293 * src/output.c (token_definitions_output,
13294 symbol_destructors_output, symbol_destructors_output): Use string,
13295 not boolean integer, to keep track of whether to output separator.
13296 * src/print_graph.c (print_core): Likewise.
13297 * src/state.c (state_rule_lookaheads_print): Likewise.
13299 * config/install-sh: Sync from automake 1.7.5.
13301 2003-05-14 Paul Eggert <eggert@twinsun.com>
13303 * src/parse-gram.y (rules_or_grammar_declaration): Require a
13304 semicolon after a grammar declaration, in the interest of possible
13305 future changes to the Bison input language.
13306 Do not allow a stray semicolon at the start of the grammar.
13307 (rhses.1): Allow one or more semicolons after any rule, including
13308 just before "|" as required by POSIX.
13309 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
13312 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
13314 %parse-param support for lalr1.cc.
13316 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
13317 b4_cc_constructor_calls, b4_cc_constructor_call,
13318 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
13320 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
13321 parse-param arguments.
13322 (yy::b4_parser_class_name): Declare instance variables to
13323 hold parse-param arguments.
13324 * tests/calc.at: s/value/semantic_value/ because value clashes
13325 with a member of yy::b4_parser_class_name. Adjust C++ code
13326 to handle %parse-param. Enable %parse-param test in C++.
13328 2003-05-12 Paul Eggert <eggert@twinsun.com>
13330 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
13331 English a bit. Fix fclose typo. Change "const char" to "char
13332 const", and use ANSI C rather than K&R for "main". Suggest
13333 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
13334 and suggest yy_switch_to_buffer.
13336 2003-05-05 Paul Eggert <eggert@twinsun.com>
13338 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
13339 C89. This avoids a diagnostic on compilers that define __STDC__
13340 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
13341 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
13343 2003-05-03 Paul Eggert <eggert@twinsun.com>
13345 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
13346 Do not overrun array bounds.
13347 This should fix a bug reported today by Olatunji Oluwabukunmi in
13348 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
13350 2003-04-29 Akim Demaille <akim@epita.fr>
13352 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
13353 * src/getargs.c, src/getargs.h: here, as bool, not int.
13354 (nondeterministic_parser): New.
13355 * src/parse-gram.y, src/scan-gram.l: Support
13356 %nondeterministic-parser.
13357 * src/output.c (prepare): Use nondeterministic_parser instead
13358 of glr_parser where appropriate.
13359 * src/tables.c (conflict_row, action_row, save_row)
13360 (token_actions, token_actions, pack_vector): Ditto.
13362 2003-04-29 Akim Demaille <akim@epita.fr>
13364 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
13366 2003-04-29 Akim Demaille <akim@epita.fr>
13368 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
13369 with %pure-parser and %locations to exercise the patch from Yakov
13372 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
13374 * data/yacc.c: (b4_lex_param): Corrected for the case where
13375 %lex-param is provided and %pure-parser isn't.
13377 2003-04-27 Paul Eggert <eggert@twinsun.com>
13379 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
13380 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
13381 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
13382 if it is not defined.
13383 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
13385 2003-04-26 Paul Eggert <eggert@twinsun.com>
13387 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
13388 Declare to be of type suitable for the ninf value itself, not of
13389 type suitable for the corresponding table, since the latter might
13390 be unsigned but the ninf value might be negative. This fixes a
13391 bug reported by Alexandre Duret-Lutz in
13392 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
13394 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
13395 invokes it. We shouldn't invoke it twice because it will attempt
13396 to put error.o in the archive twice. This fixes a glitch reported
13397 by Martin Mokrejs in
13398 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
13400 2003-04-21 Paul Eggert <eggert@twinsun.com>
13402 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
13405 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
13407 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
13408 Fix obvious typo that results in uncompilable GLR parsers
13409 when both %pure-parser and %locations are used. (trivial change)
13411 2003-04-17 Paul Eggert <eggert@twinsun.com>
13413 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
13414 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
13415 Do not insert the expected token via unput, as this runs afoul
13416 of a POSIX-compatibility bug in flex 2.5.31.
13417 All uses changed to BEGIN the parent state,
13418 since we no longer insert the expected token via unput.
13419 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
13420 that is no longer emitted after the above change.
13422 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
13423 the first one. This change is from Paul Hilfinger, and it fixes
13424 regression reported by Werner Lemberg in
13425 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
13427 (resolve_sr_conflict): Don't invoke state_errs_set
13428 unless one or more tokens have been explicitly made errors.
13429 Otherwise, the above change causes Bison to abort.
13431 * tests/existing.at (GNU pic Grammar): New test case, taken from
13434 2003-03-31 Akim Demaille <akim@epita.fr>
13436 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
13438 2003-03-31 Akim Demaille <akim@epita.fr>
13440 * src/output.c (prepare_symbols): Avoid trailing spaces in the
13443 2003-03-31 Akim Demaille <akim@epita.fr>
13445 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
13446 From Paul Hilfinger.
13448 2003-03-29 Akim Demaille <akim@epita.fr>
13450 * m4/error.m4: Do not put under dynamic conditions some code which
13451 expansion is under static control.
13453 2003-03-29 Akim Demaille <akim@epita.fr>
13455 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
13457 2003-03-29 Akim Demaille <akim@epita.fr>
13459 * doc/bison.texinfo (Strings are Destroyed): New.
13461 2003-03-13 Paul Eggert <eggert@twinsun.com>
13463 * .cvsignore: Add configure.lineno.
13464 * src/.cvsignore: Add yacc.
13465 * tests/.cvsignore: Add testsuite.log.
13466 * doc/fdl.texi: Sync with latest FSF version.
13468 2003-03-12 Paul Eggert <eggert@twinsun.com>
13470 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
13471 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
13472 cursor, instead of leaving it undefined. This fixes a bug
13473 reported by Tim Van Holder in
13474 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
13475 * tests/input.at (Torturing the Scanner): Test the scanner on
13476 an empty input file, which was Tim Van Holder's test case.
13478 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
13479 <sys/resource.h> can be included, include sys/time.h and
13480 sys/times.h first, if available. This works around the SunOS
13481 4.1.4 porting bug reported by Bruce Becker in
13482 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
13484 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
13485 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
13486 AC_HEADER_SYS_WAIT.
13488 Merge changes from gnulib. This was prompted because the CVS
13489 snapshot didn't build on Solaris 7 due to strnlen problems.
13491 These changes need to be merged back into gnulib:
13492 * lib/hash.c: Include <stdbool.h> unconditionally.
13493 * m4/onceonly.m4 (m4_quote): New macro.
13494 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
13495 Quote AC_FOREACH variable-expansions properly.
13496 The 2003-01-03 obstack.h change also needs merging.
13497 {end of changes requiring merging}
13499 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
13500 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
13501 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
13502 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
13503 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
13504 New files, imported from gnulib.
13505 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
13508 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
13509 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
13512 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
13514 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
13515 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
13516 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
13517 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
13518 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
13519 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
13520 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
13521 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
13522 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
13523 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
13524 (jm_PREREQ_ARGMATCH): Remove.
13525 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
13526 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
13528 * src/system.h: Include <stdbool.h> unconditionally.
13530 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
13531 assuming at least C89 in the bitset code for some time now.
13533 2003-03-03 Akim Demaille <akim@epita.fr>
13537 2003-03-02 Akim Demaille <akim@epita.fr>
13539 * doc/bison.texinfo (Table of Symbols): Reactivate the
13540 documentation for %lex-param, and %parse-param.
13542 2003-03-02 Akim Demaille <akim@epita.fr>
13544 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
13545 generate verbose error messages.
13546 Use the number of tokens as an upper bound in yytname, as it
13547 cannot be a non terminal.
13549 2003-03-02 Akim Demaille <akim@epita.fr>
13551 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
13554 2003-03-02 Akim Demaille <akim@epita.fr>
13556 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
13557 Use them to exercise yycheck overrun.
13558 Based on Andrew Suffield's grammar.
13560 2003-03-02 Akim Demaille <akim@epita.fr>
13562 Create tests/local.at for Bison generic testing macros.
13564 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
13565 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
13567 * tests/calc.at (AT_CHECK_CALC): Adjust.
13568 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
13569 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
13570 * tests/local.at: here.
13571 (AT_COMPILE_CXX): Tags the tests using it as c++.
13572 Ignore the test if CXX is not functional.
13574 2003-03-01 Paul Eggert <eggert@twinsun.com>
13576 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
13577 not loc->end, since loc->end might contain garbage and this leads
13578 to undefined behavior on some platforms.
13579 (id_loc, token_start): Use (IF_LINTed) initial values that do not
13580 depend on *loc, so that the reader doesn't give the the false
13581 impression that *loc is initialized.
13582 (<INITIAL>"%%"): Do not bother setting code_start, since its value
13583 does not survive the return.
13585 2003-03-01 Akim Demaille <akim@epita.fr>
13587 * src/scan-gram.l (code_start): Always initialize it when entering
13588 into yylex, as SC_EPILOGUE is activated *before* the corresponding
13589 yylex invocation. An alternative would be making it static, but
13590 then it starts with the second %%'s beginning, instead of its end.
13592 2003-02-28 Paul Eggert <eggert@twinsun.com>
13594 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
13595 around a UnixWare 7.1.1 porting bug reported by John Hughes in
13596 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
13598 2003-02-26 Paul Eggert <eggert@twinsun.com>
13600 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
13601 Remove Sequent/Pyramid discussion (nobody uses them any more).
13602 Merge VMS and MS-DOS discussion; these ports may well be dead
13603 but let's keep mentioning them for now. Put <> around email
13604 addresses. Add copyright notice.
13606 2003-02-24 Paul Eggert <eggert@twinsun.com>
13608 * data/glr.c (yy_reduce_print): yylineno -> yylno,
13609 to avoid collision with flex use of yylineno.
13610 Problem reported by Bruce Lilly in
13611 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
13612 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
13613 * data/yacc.c (yy_reduce_print): Likewise.
13615 * config/depcomp: Sync with Automake 1.7.3.
13617 2003-02-21 Akim Demaille <akim@epita.fr>
13619 * data/lalr1.cc: Use temporary variables instead of casts to
13620 change integer types.
13621 Suggested by Paul Eggert.
13623 2003-02-21 Akim Demaille <akim@epita.fr>
13625 * doc/bison.texinfo: Use "location" consistently to refer to @n,
13626 to avoid confusions with lalr1.cc's notion of Position.
13627 Suggested by Paul Eggert.
13629 2003-02-20 Akim Demaille <akim@epita.fr>
13631 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
13632 before initial_columns.
13633 (location.hh): Use consistent variable names when defining the
13635 Use "last" so that we subtract from Positions, not from unsigned.
13637 2003-02-20 Akim Demaille <akim@epita.fr>
13639 * data/lalr1.cc (position.hh): New subfile, including the extended
13640 and Doxygen'ed documentation of class Position.
13641 (location.hh): Use it.
13642 Document a` la Doxygen.
13643 With the help of Benoit Perrot.
13645 2003-02-20 Akim Demaille <akim@epita.fr>
13647 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
13649 Redefine AT_YYERROR_SEES_LOC_IF using it.
13650 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
13652 Don't use the location in yy::Parser::error_ and
13653 yy::Parser::print_ when not %locations.
13654 Activate more lalr1.cc tests.
13656 2003-02-19 Akim Demaille <akim@epita.fr>
13658 * data/lalr1.cc: When displaying a line number, be sure to make it
13661 2003-02-19 Akim Demaille <akim@epita.fr>
13663 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
13665 (YYABORT, YYACCEPT, YYERROR): New.
13666 * tests/calc.at: Renable the lalr1.cc test.
13668 2003-02-19 Akim Demaille <akim@epita.fr>
13670 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
13671 error recovery, mixing with/without pops and discarding of the
13674 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
13676 2003-02-17 Paul Eggert <eggert@twinsun.com>
13678 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
13679 * tests/testsuite.at (AT_COMPILE): Use them.
13680 This fixes the testsuite problem reported by Robert Lentz in
13681 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
13683 2003-02-12 Paul Eggert <eggert@twinsun.com>
13685 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
13686 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
13687 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
13688 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
13689 Check for malloc failure, for consistency with yacc.c.
13690 (yytname_size): Remove, for consistency with yacc.c.
13692 The bug still remains in data/lalr1.cc, as I didn't have time
13695 2003-02-06 Akim Demaille <akim@epita.fr>
13697 * configure.ac (GXX): Rename as...
13698 (CXX): this, to keep the original Autoconf semantics.
13700 * data/lalr1.cc: Fix b4_copyright invocations.
13701 If YYDEBUG is not defined, don't depend upon name_ being defined.
13702 (location.hh): Include string and iostream.
13703 (Position::filename): New member.
13704 (Position::Position ()): New.
13705 (operator<< (Position)): New.
13706 (operator- (Position, int)): New.
13707 (Location::first, Location::last): Rename as...
13708 (Location::begin, Location::end): these, to mock the conventional
13710 (operator<< (Location)): New.
13711 * tests/atlocal.in (CXX): New.
13712 * tests/testsuite.at (AT_COMPILE_CXX): New.
13713 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
13714 locations in a more synthetic way.
13715 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
13717 Adjust the C locations to match those from Emacs: first column is
13719 Change all the expected results.
13720 Conform to the GCS: simplify the locations when applicable.
13721 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
13722 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
13723 these CPP macros with the m4 macros new defined by...
13724 (AT_CHECK_PUSHDEFS): this, i.e.:
13725 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
13726 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
13728 (AT_CHECK_POPDEFS): Undefine them.
13729 (AT_CHECK_CALC_LALR1_CC): New.
13730 Use it for the first lalr1.cc test.
13732 2003-02-04 Akim Demaille <akim@epita.fr>
13734 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
13735 Location as is defined.
13737 2003-02-04 Akim Demaille <akim@epita.fr>
13739 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
13740 name_ being defined.
13742 2003-02-03 Paul Eggert <eggert@twinsun.com>
13744 * src/gram.h (start_symbol): Remove unused decl.
13746 Use more-consistent naming conventions for local vars.
13748 * src/derives.c (derives_compute): Change type of local var from
13749 int to rule_number.
13750 * src/gram.c (grammar_rules_partial_print): Likewise.
13751 * src/print.c (print_core): Likewise.
13752 * src/reduce.c (reduce_grammar_tables): Likewise.
13754 * src/gram.c (grammar_dump): Change name of item_number *
13755 local var from r to rp.
13756 * src/nullable.c (nullable_compute): Likewise.
13758 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
13760 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
13761 for symbol or symbol_number var.
13762 * src/reader.c (grammar_start_symbol_set): Likewise.
13763 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
13765 * src/state.c (transitions_to): Likewise.
13766 * src/state.h: Likewise.
13767 * src/tables.c (symbol_number_to_vector_number): Likewise.
13769 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
13772 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
13775 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
13778 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
13779 Use str, not s, for char * var. Use ch, not c, for character var.
13780 Use size for size var.
13782 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
13784 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
13786 * src/uniqstr.h: Likewise.
13788 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
13789 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
13790 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
13791 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
13792 param to have same name as that of enum, so that we don't use
13793 "s" to stand for a non-state.
13795 2003-02-02 Akim Demaille <akim@epita.fr>
13797 * src/scan-skel.l: Scan more than one inert character per yylex
13800 2003-02-01 Paul Eggert <eggert@twinsun.com>
13804 * po/LINGUAS: Add ms.
13806 2003-01-30 Akim Demaille <akim@epita.fr>
13808 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
13810 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13812 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
13815 Changes in response to error report by S. Eken: GLR mode does not
13816 handle negative $ indices or $ indices in embedded rules correctly.
13817 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
13819 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
13820 (b4_rhs_location): Ditto.
13821 (yyfill): New function to copy from stack tree into array
13823 (yyuserAction): Modify to allow incremental move of semantic values
13824 to rhs array when in GLR mode.
13825 Define YYFILL to use in user-defined actions to fill semantic array
13827 Remove dummy use of yystack, as there is now a guaranteed use.
13828 (yydoAction): Modify to allow incremental move of semantic values
13829 to rhs array when in GLR mode.
13830 (yyresolveAction): Ditto.
13831 (yyglrShiftDefer): Update comment.
13832 (yyresolveStates): Use X == NULL for pointers, not !X.
13833 (yyglrReduce): Ditto.
13834 (yydoAction): Ditto
13836 * tests/glr-regr1.at: Rename to ...
13837 * tests/glr-regression.at: Add new regression test for the problems
13838 described above (adapted from S. Eken).
13839 Update copyright notice.
13840 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
13841 * tests/Makefile.am: Ditto.
13843 2003-01-28 Paul Eggert <eggert@twinsun.com>
13845 * data/lalr1.cc: Do not use @output_header_name@ unless
13846 b4_defines_flag is set. This fixes two bugs reported by
13848 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
13849 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
13851 2003-01-21 Paul Eggert <eggert@twinsun.com>
13853 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
13854 we don't need to worry about yyerrlab1 being reported as an
13855 "unused label" by non-GCC C compilers. The downside is that if
13856 locations are used then a couple of statements are duplicated each
13857 time YYERROR is invoked, but the upside is that the warnings
13859 (yyerrlab1): Move code to YERROR.
13860 (yyerrlab2): Remove. Change uses back to yyerrlab1.
13861 This reverts some of the 2002-12-27 change.
13863 2003-01-17 Paul Eggert <eggert@twinsun.com>
13865 * src/output.c (symbol_printers_output): Fix typo that led
13866 to core dump. Problem reported by Antonio Rus in
13867 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
13869 2003-01-13 Akim Demaille <akim@epita.fr>,
13870 Quoc Peyrot <chojin@lrde.epita.fr>,
13871 Robert Anisko <anisko_r@lrde.epita.fr>
13873 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
13874 when the stacks contain one element, as the loop would otherwise
13875 free the last state, and then use the top state (the one we just
13876 popped). This means that the initial elements will not be freed
13877 explicitly, as is the case in yacc.c; it is not a problem, as
13878 these elements have fake values.
13880 2003-01-11 Paul Eggert <eggert@twinsun.com>
13882 * NEWS: %expect-violations are now just warnings, reverting
13883 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
13884 bootstrapping problem reported by Matthias Klose; see
13885 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
13886 * src/conflicts.c (conflicts_print): Likewise.
13887 * tests/conflicts.at (%expect not enough, %expect too much,
13888 %expect with reduce conflicts): Likewise.
13889 * doc/bison.texinfo (Expect Decl): Document this. Also mention
13890 that the warning is enabled if the number of conflicts changes
13891 (not necessarily increases).
13893 * src/getargs.c (version): Update copyright year.
13895 2003-01-09 Akim Demaille <akim@epita.fr>
13897 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
13899 2003-01-08 Paul Eggert <eggert@twinsun.com>
13901 * Makefile.maint (WGETFLAGS):
13902 New macro, containing "-C off" to disable proxy caches.
13903 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
13904 (rel-check): Use $(WGET) instead of wget.
13906 2003-01-06 Paul Eggert <eggert@twinsun.com>
13908 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
13909 the GLR paper of Scott, Johnstone and Hussain.
13911 2003-01-04 Paul Eggert <eggert@twinsun.com>
13913 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
13914 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
13915 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
13916 (EXTRA_LIBRARIES): New var, for liby.a.
13917 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
13918 (EXTRA_SCRIPTS): New var, for yacc.
13920 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
13921 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
13922 Problem reported by Nelson H. F. Beebe.
13924 2003-01-03 Paul Eggert <eggert@twinsun.com>
13926 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
13927 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
13928 when compiling Bison 1.875's `bitset bset = obstack_alloc
13929 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
13931 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
13932 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
13933 grow to a huge size with typical invocation.
13935 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
13936 Use the pattern recommended by Autoconf 2.57, except also protect
13937 against double-definition.
13938 * src/system.h: Likewise.
13939 Portability issues reported by Nelson H. F. Beebe.
13941 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
13942 All uses changed. Provide a definition in both C and C++.
13943 (yytrue, yyfalse): Define even if defined (__cplusplus).
13945 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
13946 Reported by Nelson H. F. Beebe.
13948 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
13950 2003-01-02 Paul Eggert <eggert@twinsun.com>
13952 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
13953 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
13954 Bug reported by Nelson H. F. Beebe.
13956 2003-01-01 Paul Eggert <eggert@twinsun.com>
13960 2002-12-30 Paul Eggert <eggert@twinsun.com>
13962 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
13964 (<INITIAL>","): Here. This causes stray "," to be treated
13967 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
13968 last brace in braced code when not in Yacc mode, for compatibility
13969 with Bison 1.35. This resurrects the 2001-12-15 patch to
13972 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
13973 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
13975 2002-12-28 Paul Eggert <eggert@twinsun.com>
13977 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
13978 that of SYM's type. This fixes Debian bug 168069, reported by
13981 2002-12-28 Paul Eggert <eggert@twinsun.com>
13985 Switch back to the Yacc style of conflict reports, undoing some
13986 of the 2002-07-30 change.
13987 * doc/bison.texinfo (Understanding): Use Yacc style for
13988 conflict reports. Also, use new way of locating rules.
13989 * src/conflicts.c (conflict_report):
13990 Renamed from conflict_report_yacc, removing the old
13991 'conflict_report'. Translate the entire conflict report at once,
13992 so that we don't assume that "," has the same interpretation in
13994 (conflicts_output): Use Yacc-style conflict report for each state,
13995 instead of our more-complicated style.
13996 (conflicts_print): Use Yacc-style conflict report, except print
13997 the input file name when not emulating Yacc.
13998 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
13999 Conflicted Reduction, %expect not enough, %expect too much,
14000 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
14001 * tests/existing.at (GNU Cim Grammar): Likewise.
14002 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
14004 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
14005 fatal): Don't invoke fflush; it's not needed and it might even be
14006 harmful for stdout, as stdout might not be open.
14007 * src/reduce.c (reduce_print): Likewise.
14009 2002-12-27 Paul Eggert <eggert@twinsun.com>
14011 Fix a bug where error locations were not being recorded correctly.
14012 This problem was originally reported by Paul Hilfinger in
14013 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
14015 * data/yacc.c (yyparse): New local var yylerrsp, to record the
14016 top of the location stack's error locations.
14017 (yyerrlab): Set it. When discarding a token, push its location
14018 onto yylerrsp so that we don't lose track of the error's end.
14019 (yyerrlab1): Now is only the target of YYERROR, so that we can
14020 properly record the location of the action that failed. For GCC
14021 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
14022 GCC warning about yyerrlab1 being unused if YYERROR is unused.
14023 (yyerrlab2): New label, which yyerrlab now falls through to.
14024 Compute the error's location by applying YYLLOC_DEFAULT to
14025 the locations of all the symbols that went into the error.
14026 * doc/bison.texinfo (Location Default Action): Mention that
14027 YYLLOC_DEFAULT is also invoked for syntax errors.
14028 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
14029 Error locations include the locations of all the tokens that were
14030 discarded, not just the last token.
14032 2002-12-26 Paul Eggert <eggert@twinsun.com>
14034 * src/files.c: Include quote.h.
14035 (compute_output_file_names): Warn if we detect conflicting
14036 outputs to the same file. This should catch the misunderstanding
14037 exemplified by Debian Bug 165349, reported by Bruce Stephens..
14039 * src/conflicts.c (conflicts_print): If the user specifies
14040 "%expect N", report an error if there are any reduce/reduce
14041 conflicts. This is what the manual says should happen.
14042 This fixes Debian bug 130890, reported by Anthony DeRobertis.
14043 * tests/conflicts.at (%expect with reduce conflicts): New test.
14045 Don't use m4_include on relative file names, as it doesn't work as
14046 desired if there happens to be a file with that name under ".".
14048 * m4sugar/version.m4: Remove; it was included but it wasn't used.
14049 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
14050 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
14051 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
14052 * src/output.c (output_skeleton): Use full path names when
14053 specifying a file to include; don't rely on include path, as
14054 it's unreliable when the working file contains a file with
14057 2002-12-25 Paul Eggert <eggert@twinsun.com>
14059 Remove obsolete references to bison.simple and bison.hairy.
14060 Problem mentioned by Aubin Mahe in
14061 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
14062 * data/glr.c: Comment fix.
14063 * doc/bison.1: Remove references. Also, mention "yacc".
14065 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
14068 * src/parse-gram.y (declaration): Use enum "report_states" rather
14069 than its numeric value 1.
14071 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
14072 opening a new one. This fixes Debian bug 165349, reported by
14075 2002-12-24 Paul Eggert <eggert@twinsun.com>
14079 * Makefile.maint (cvs-update): Don't assume that the shell
14080 supports $(...), as Solaris sh doesn't.
14082 * src/parse-gram.y (lloc_default): Remove test for empty
14083 nonterminals at the end, since it didn't change the result.
14085 2002-12-24 Paul Eggert <eggert@twinsun.com>
14087 If the user does not define YYSTYPE as a macro, Bison now declares it
14088 using typedef instead of defining it as a macro. POSIX requires this.
14089 For consistency, YYLTYPE is also declared instead of defined.
14091 %union directives can now have a tag before the `{', e.g., the
14092 directive `%union foo {...}' now generates the C code
14093 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
14094 The default union tag is `YYSTYPE', for compatibility with Solaris 9
14095 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
14096 instead of `yyltype'.
14098 `yystype' and `yyltype' are now obsolescent macros instead of being
14099 typedefs or tags; they are no longer documented and will be
14100 withdrawn in a future release.
14102 * data/glr.c (b4_location_type): Remove.
14103 (YYSTYPE): Renamed from yystype.
14104 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
14105 (struct YYLTYPE): Renamed from struct yyltype.
14106 (YYLTYPE): Renamed from yyltype.
14107 (yyltype, yystype): New (and obsolescent) macros,
14108 for backward compatibility.
14109 * data/yacc.c: Likewise.
14111 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
14112 does not specify a union tag. This is for compatibility with
14115 * src/parse-gram.y (add_param): 2nd arg is now char * not char
14116 const *, since it is now modified by stripping surrounding { }.
14117 (current_braced_code): Remove.
14118 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
14119 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
14120 trailing " {...}". Now of type <chars>.
14121 (grammar_declaration): Adjust to bundled tokens.
14122 (code_content): Remove; stripping is now done by add_param.
14123 (print_token_value): Print contents of bundled tokens.
14124 (token_name): New function.
14126 * src/reader.h (braced_code, current_braced_code): Remove.
14127 (token_name): New decl.
14129 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
14130 token_type, not braced_code code_kind. All uses changed.
14131 (SC_PRE_CODE): New state, for scanning after a keyword that
14132 has (or usually has) an immediately-following braced code.
14133 (token_type): New local var, to keep track of which token type
14134 to return when scanning braced code.
14135 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
14136 <INITIAL>"%parse-param", <INITIAL>"%printer",
14137 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
14138 instead of returning a token type immediately.
14139 (<INITIAL>"{"): Set token type.
14140 (<SC_BRACED_CODE>"}"): Use it.
14141 (handle_action_dollar, handle_action_at): Now returns bool
14142 indicating success. Fail if ! current_rule; this prevents a core dump.
14143 (handle_symbol_code_dollar, handle_symbol_code_at):
14144 Remove; merge body into caller.
14145 (handle_dollar, handle_at): Complain in invalid contexts.
14147 * NEWS, doc/bison.texinfo: Document the above.
14148 * NEWS: Fix years and program names in copyright notice.
14150 2002-12-17 Paul Eggert <eggert@twinsun.com>
14152 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
14153 Reporting, Table of Symbols): Omit mentions of %lex-param and
14154 %parse-param from the documentation for now.
14156 2002-12-15 Paul Eggert <eggert@twinsun.com>
14158 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
14159 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
14160 lookahead symbol, and which sets yychar in parser actions) and it
14161 disagreed with the Bison documentation. Bug
14162 reported by Andrew Walrond.
14164 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
14165 as the caller now does that.
14166 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
14167 (YYEMPTY): Parenthesize right hand side, since others use it.
14168 (yyparse): Don't assume that our generated code is the only code
14171 2002-12-13 Paul Eggert <eggert@twinsun.com>
14175 POSIX requires a "yacc" command.
14176 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
14177 (MOSTLYCLEANFILES): Add yacc.
14179 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
14180 as an alias for bison y.
14182 * po/LINGUAS: Add da.
14184 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
14185 problem with latest <getopt.h>.
14186 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
14188 * doc/fdl.texi: Upgrade to 1.2.
14189 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
14190 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
14191 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
14193 * config/install-sh: Sync with autotools.
14195 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
14196 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
14197 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
14198 locations are requested.
14199 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
14200 locations are requested.
14202 2002-12-12 Paul Eggert <eggert@twinsun.com>
14204 Remove unportable casts and storage allocation tricks.
14205 While we're at it, remove almost all casts, since they
14206 usually aren't needed and are a sign of trouble.
14208 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
14210 * src/derives.c (derives_compute): Do not subtract NTOKENS from
14211 the pointer DSET returned by malloc; this isn't portable.
14212 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
14213 Similarly for DERIVES.
14214 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
14215 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
14216 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
14218 * src/derives.c (derives_compute): Do not bother invoking
14219 int_of_rule_number, since rule numbers are integers.
14221 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
14222 rather than XMALLOC (char, N).
14224 * src/files.c (filename_split): Rewrite to avoid cast.
14226 * src/gram.h (symbol_number_as_item_number,
14227 item_number_as_symbol_number, rule_number_as_item_number,
14228 item_number_as_rule_number):
14229 Now inline functions rather than macros, to avoid casts.
14230 * src/state.h (state_number_as_int): Likewise.
14231 * src/tables.c (state_number_to_vector_number,
14232 symbol_number_to_vector_number): Likewise.
14234 * src/gram.h (int_of_rule_number): Remove; no longer used.
14236 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
14237 since the resulting storage is always stored into.
14239 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
14242 * src/muscle_tab.c (muscle_m4_output):
14243 Now inline. Return bool, not int.
14244 * src/state.c (state_compare): Likewise.
14245 * src/symtab.c (symbol_check_defined,
14246 symbol_check_alias_consistency, symbol_pack, symbol_translation,
14247 hash_compare_symbol, hash_symbol):
14249 * src/uniqstr.c (uniqstr_print): Likewise.
14250 * src/muscle_tab.c (muscle_m4_output_processor):
14251 New function, to avoid casts.
14252 * src/state.c (state_comparator, stage_hasher): Likewise.
14253 * src/symtab.c (symbol_check_defined_processor,
14254 symbol_check_alias_consistency_processor, symbol_pack_processor,
14255 symbol_translation_processor, hash_symbol_comparator,
14256 hash_symbol_hasher): Likewise.
14257 * src/uniqstr.c (uniqstr_print_processor): Likewise.
14258 * src/muscle_tab.c (muscles_m4_output):
14259 Use new functions instead of casting old functions unportably.
14260 * src/state.c (state_hash_new): Likewise.
14261 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
14262 symbols_token_translations_init):
14264 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
14266 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
14267 var instead of casting to long, to avoid casts.
14268 (prepare_states): Use MALLOC rather than alloca, so that we don't
14269 have to worry about alloca.
14270 * src/state.c (state_hash_lookup): Likewise.
14272 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
14273 local var instead of casting to unsigned char, to avoid casts.
14275 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
14276 STATE_ALLOC): Remove.
14277 (transitions_new, errs_new, reductions_new, state_new): Use malloc
14278 rather than calloc, and use offsetof to avoid allocating slightly
14280 (state_new): Initialize all members.
14282 * src/state.c (state_hash): Use unsigned accumulator, not signed.
14284 * src/symtab.c (symbol_free): Remove; unused.
14285 (symbol_get): Remove cast in lhs of assignment.
14286 (symbols_do): Now static. Accept generic arguments, not
14287 hashing-related ones.
14289 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
14290 (symbol_processor): Remove.
14291 (symbols_do): Remove decl; now static.
14293 * src/system.h (alloca): Remove; decl no longer needed.
14294 (<stddef.h>): Include, for offsetof.
14295 (<inttypes.>, <stdint.h>): Include if available.
14296 (uintptr_t): New type, if system lacks it.
14297 (CALLOC, MALLOC, REALLOC): New macros.
14298 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
14301 * src/tables.c (table_size): Now int, to pacify GCC.
14302 (table_grow, table_ninf_remap): Use signed table size.
14303 (save_row): Don't bother initializing locals when not needed.
14304 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
14305 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
14307 * src/vcg.h: Correct misspellings.
14309 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
14312 * src/getargs.c (getargs): Don't assume EOF == -1.
14314 2002-12-09 Paul Eggert <eggert@twinsun.com>
14316 Change identifier spellings to avoid collisions with names
14317 that are reserved by POSIX.
14319 Don't use names ending in _t, since POSIX reserves them.
14320 For consistency, remove _e and _s endings -- they're weren't
14321 needed to remove ambiguity. All uses changed.
14322 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
14323 turn was just renamed from struniq_t.
14324 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
14325 which in turn was just renamed from struniq_processor_t.
14326 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
14327 in turn was renamed from hash_compare_struniq_t.
14328 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
14329 (state_list): Renamed from state_list_t.
14330 * src/assoc.h (assoc): Renamed from assoc_t.
14331 * src/conflicts.c (enum conflict_resolution): Renamed from
14332 enum conflict_resolution_e.
14333 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
14334 (rule_list): Renamed from rule_list_t.
14335 * src/getargs.h (enum trace): Renamed from enum trace_e.
14336 (enum report): Renamed from enum report_e.
14337 * src/gram.h (item_number): Renamed from item_number_t.
14338 (rule_number): Renamed from rule_number_t.
14339 (struct rule_s): Remove the "rule_s" part; not used.
14340 (rule): Renamed from rule_t.
14341 (rule_filter): Renamed from rule_filter_t.
14342 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
14343 (goto_list): Renamed from goto_list_t.
14344 * src/lalr.h (goto_number): Renamed from goto_number_t.
14345 * src/location.h (location): Renamed from location_t.
14346 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
14347 and moved here from:
14348 * src/muscle_tab.h (muscle_entry_t): here.
14349 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
14350 (rule_list): Renamed from rule_list_t.
14351 * src/print_graph.c (static_graph): Renamed from graph.
14352 * src/reader.h (braced_code): Renamed from braced_code_t.
14353 Remove brace_code_e tag.
14354 * src/relation.h (relation_node): Renamed from relation_node_t.
14355 (relation_nodes): Renamed from relation_nodes_t.
14356 (relation): Renamed from relation_t.
14357 * src/state.h (state_number): Renamed from state_number_t.
14358 (struct state): Renamed from struct state_s.
14359 (state): Renamed from state_t.
14360 (transitions): Renamed from transitions_t. Unused (and
14361 misspelled) transtion_s tag removed.
14362 (errs): Renamed from errs_t. Unused errs_s tag removed.
14363 (reductions): Renamed from reductions_t. Unused tag
14364 reductions_s removed.
14365 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
14366 (struct symbol_list): Renamed from struct symbol_list_s.
14367 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
14368 (struct symbol): Renamed from struct symbol_s.
14369 (symbol): Renamed from symbol_t.
14370 * src/tables.c (vector_number): Renamed from vector_number_t.
14371 (action_number): Renamed from action_t.
14372 * src/tables.h (base_number): Renamed from base_t.
14373 * src/vcg.h (enum color): Renamed from enum color_e.
14374 (enum textmode): Renamed from enum textmode_e.
14375 (enum shape): Renamed from enum shape_e.
14376 (struct colorentry): Renamed from struct colorentry_s.
14377 (struct classname): Renamed from struct classname_s.
14378 (struct infoname): Renamed from struct infoname_s.
14379 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
14380 (enum decision): Renamed from enum decision_e.
14381 (enum orientation): Renamed from enum orientation_e.
14382 (enum alignment): Renamed from enum alignment_e.
14383 (enum arrow_mode): Renamed from enum arrow_mode_e.
14384 (enum crossing_type): Renamed from enum crossing_type_e.
14385 (enum view): Renamed from enum view_e.
14386 (struct node): Renamed from struct node_s.
14387 (node): Renamed from node_t.
14388 (enum linestyle): Renamed from enum linestyle_e.
14389 (enum arrowstyle): Renamed from enum arrowstyle_e.
14390 (struct edge): Renamed from struct edge.
14391 (edge): Renamed from edge_t.
14392 (struct graph): Renamed from struct graph_s.
14393 (graph): Renamed from graph_t.
14394 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
14395 Rename value_t -> value.
14396 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
14397 value_t_as_yystype -> value_as_yystype.
14399 Don't include <errno.h> in the mainstream code, since it
14400 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
14401 * lib/get-errno.c, lib/get-errno.h: New files.
14402 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
14404 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
14405 * src/output.c (output_skeleton): Likewise.
14406 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
14408 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
14410 (handle_action_dollar, handle_action_at): Likewise.
14411 * src/system.h: Do not include <errno.h>.
14412 (TAB_EXT): Renamed from EXT_TAB.
14413 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
14415 Avoid str[a-z]*, since <string.h> reserves that name space.
14416 Change all instances of "struniq" in names to "uniqstr", and
14417 likewise for "STRUNIQ" and "UNIQSTR".
14418 * src/uniqstr.c: Renamed from src/struniq.c.
14419 * src/uniqstr.h: Renamed from src/struniq.h.
14420 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
14421 * src/files.c (strsuffix): Remove; unused.
14422 (concat2): Renamed from stringappend. Now static.
14423 * src/files.h (strsuffix, stringappend): Remove; unused.
14424 * src/parse-gram.y (<chars>): Renamed from <string>.
14425 (<uniqstr>): Renamed from <struniq>.
14426 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
14427 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
14428 (struct graph_s.expand): Renamed from struct graph_s.stretch.
14429 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
14430 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
14431 (N_EXPAND): Renamed from N_STRETCH.
14433 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
14434 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
14435 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
14437 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
14438 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
14439 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
14440 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
14441 (BASE_MAXIMUM): Renamed from BASE_MAX.
14442 (BASE_MINIMUM): Renamed from BASE_MIN.
14443 (ACTION_MAX): Remove; unused.
14444 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
14445 Unnecessary casts removed from above defines.
14448 Fix misspelling in names.
14449 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
14450 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
14454 * lib/timevar.c (timevar_report): Renamed from time_report,
14455 for consistency with other names.
14456 * lib/timevar.h (timevar_report): New decl.
14457 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
14460 Sort include-file uses.
14462 Reorder all include files under src to be in the order "system.h".
14463 then the ../lib include files in angle brackets (alphabetized),
14464 then the . include files in double-quotes (alphabetized). Fix
14465 dependency breakages encountered in this process, as follows:
14466 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
14467 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
14468 * src/state.h: Include "symtab.h".
14470 2002-12-08 Paul Eggert <eggert@twinsun.com>
14472 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
14473 since this causes problems when __file__ contains character
14474 sequences like "@" that are treated specially by src/scan-skel.l.
14475 Instead, just use the file's basename. This fixes the bug
14476 reported by Martin Mokrejs in
14477 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
14479 2002-12-06 Paul Eggert <eggert@twinsun.com>
14481 Add support for rules that do not have trailing semicolons, as
14482 POSIX requires. Improve the quality of locations in Bison
14485 * src/location.c: Include <quotearg.h>.
14486 (empty_location): Now const.
14487 (location_print): New function. Follow the recommendation of the
14488 GNU Coding Standards for locations that span file boundaries.
14489 * src/location.h: Do not include <quotearg.h>; no longer needed.
14490 (boundary): New type.
14491 (location_t): Use it. This allows locations to span file boundaries.
14492 All member uses changed: file -> start.file or end.file (as needed),
14493 first_line -> start.line, first_column -> start.column,
14494 last_line -> end.line, last_column -> end.column.
14495 (equal_boundaries): New function.
14496 (LOCATION_RESET, LOCATION_STEP): Remove.
14497 (LOCATION_PRINT): Remove. All callers changed to use location_print.
14498 (empty_location): Now const.
14499 (location_print): New decl.
14500 * src/parse-gram.y (lloc_default): New function, which handles
14501 empty locations more accurately.
14502 (YYLLOC_DEFAULT): Use it.
14503 (%token COLON): Remove.
14504 (%token ID_COLON): New token.
14506 (declarations, rules): Remove trailing semicolon.
14507 (declaration, rules_or_grammar_declaration):
14508 Allow empty (";") declaration.
14509 (symbol_def): Remove empty actions; no longer needed.
14510 (rules_or_grammar_declaration): Remove trailing semicolon.
14511 (semi_colon.opt): Remove.
14512 * src/reader.h: Include location.h.
14513 (scanner_cursor): New decl.
14514 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
14516 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
14518 (STEP): Remove. No longer needed, now that adjust_location does
14519 the work. All uses removed.
14520 (scanner_cursor): New var.
14521 (adjust_location): Renamed from extend_location. It now sets
14522 *loc and adjusts the scanner cursor. All uses changed.
14523 Don't bother testing for CR.
14524 (handle_syncline): Remove location arg; now updates scanner cursor.
14525 All callers changed.
14526 (unexpected_end_of_file): Now accepts start boundary of token or
14527 comment, not location. All callers changed. Update scanner cursor,
14529 (SC_AFTER_IDENTIFIER): New state.
14530 (context_state): Renamed from c_context. All uses changed.
14531 (id_loc, code_start, token_start): New local vars.
14532 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
14533 processing of Yacc white space and equivalents here.
14534 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
14535 instead of returning ID immediately, since we need to search for
14536 a subsequent colon.
14537 (<INITIAL>"'", "\""): Save token_start.
14538 (<INITIAL>"%{", "{", "%%"): Save code_start.
14539 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
14540 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
14541 BEGIN context_state at end, not INITIAL.
14542 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
14543 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
14544 Return correct token start.
14545 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
14546 the start of a character, string or multiline comment is found.
14547 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
14548 Reduction): Adjust reported locations to match the more-precise
14549 results now expected.
14550 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
14551 * tests/reduce.at (Useless Rules, Reduced Automaton,
14552 Underivable Rules): Likewise.
14553 * tests/regression.at (Invalid inputs): No longer `expecting ";"
14554 or "|"' now that so many other tokens are allowed by the new grammar.
14556 * src/complain.h (current_file): Remove duplicate decl;
14557 current_file is now owned by files.h.
14558 * src/complain.c, src/scan-gram.l: Include files.h.
14560 2002-12-06 Paul Eggert <eggert@twinsun.com>
14562 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
14563 promotes to int; it might be unsigned int.
14564 * data/yacc.c (yy_reduce_print): Likewise.
14566 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
14567 be #defined in the prologue, not in the Bison declarations.
14568 This fixes Debian Bug 102878, reported by Shaul Karl.
14570 2002-12-02 Paul Eggert <eggert@twinsun.com>
14572 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
14573 * lib/strtoul.c: New file, from gnulib.
14574 This fixes a porting bug reported by Peter Klein in
14575 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
14577 2002-11-30 Paul Eggert <eggert@twinsun.com>
14579 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
14580 and put only a forward declaration in the prologue. This is for
14581 consistency with the other scanner helper functions.
14583 Type clashes now generate warnings, not errors, since it
14584 appears that POSIX may allow some grammars with type clashes.
14585 * src/reader.c (grammar_current_rule_check): Warn about
14586 type clashes instead of complaining.
14587 * tests/input.at (Type Clashes): Expect warnings, not complaints.
14589 Add Yacc library, since POSIX requires it.
14590 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
14591 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
14592 * lib/main.c, lib/yyerror.c: New files.
14594 gram_error can be static; it need not be extern.
14595 * src/reader.h (gram_error): Remove decl.
14596 * src/parse-gram.y (gram_error): Now static. Add static decl.
14597 (print_token_value): Omit parameter names from forward decl,
14600 2002-11-29 Paul Eggert <eggert@twinsun.com>
14602 * doc/bison.texinfo: Emphasize that yylex and yyerror must
14603 be declared before being used. E.g., one should typically
14604 declare them in the prologue. Use GNU coding style in examples.
14605 Put "const" consistently after the type it modifies. Mention
14606 that C99 supports "inline". Mention that yyerror traditionally
14609 %parse-param and %lex-param now take just one argument, the
14610 declaration; the argument name is deduced from the declaration.
14612 * doc/bison.texinfo (Parser Function, Pure Calling, Error
14613 Reporting, Table of Symbols): Document this.
14614 * src/parse-gram.y (add_param): New function.
14616 (declaration): Implement new rule for %parse-param and %lex-param.
14617 * src/scan-gram.l: "," now elicits a warning, rather than being
14618 a token; this is more compatible with byacc.
14619 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
14621 2002-11-27 Paul Eggert <eggert@twinsun.com>
14623 Rename identifiers to avoid real and potential collisions.
14625 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
14626 to avoid collision with lex macro described by Bruce Lilly in
14627 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
14628 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
14629 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
14630 * src/parse-gram.y (print_token_value): Renamed from yyprint.
14632 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
14633 The name "yycontrol" violates the name space rules, and this stuff
14634 wasn't being used anyway.
14635 (input): Remove action; this stuff wasn't being used.
14636 (gram_error): Rename local variable yylloc -> loc.
14637 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
14638 (YY_DECL): Don't use "yy" at start of local variables.
14639 All uses changed, e.g., yylloc -> loc.
14640 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
14641 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
14642 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
14643 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
14645 * src/parse-gram.y (gram_error): loc is now const *.
14646 * src/reader.h (gram_error): Likewise.
14648 2002-11-24 Paul Eggert <eggert@twinsun.com>
14652 * tests/actions.at (Actions after errors): Use an output format
14653 more similar to that of the Printers and Destructors test.
14654 Test the position of the ';' token too.
14655 (Printers and Destructors): Likewise.
14656 (Printers and Destructors: %glr-parser): Remove for now, to avoid
14657 unnecessarily alarming people when the test fails.
14659 * data/yacc.c (yyerrlab1): Move this label down, so that the
14660 parser does not discard the lookahead token if the user code
14661 invokes YYERROR. This change is required for POSIX conformance.
14663 * lib/error.c: Sync with gnulib.
14665 2002-11-22 Paul Eggert <eggert@twinsun.com>
14667 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
14668 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
14669 * lib/xmalloc.c: Likewise.
14671 2002-11-20 Paul Eggert <eggert@twinsun.com>
14673 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
14675 2002-11-20 Paul Eggert <eggert@twinsun.com>
14677 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
14678 should use `if (! x) abort ();' rather than `assert (x);', and
14679 anyway it's one less thing to worry about configuring.
14681 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
14682 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
14683 and replace all instances of assert with abort.
14684 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
14685 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
14687 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
14688 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
14689 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
14690 hash_find_entry, hash_rehash, hash_insert): Likewise.
14691 * src/conflicts.c (resolve_sr_conflict): Likewise.
14692 * src/lalr.c (set_goto_map, map_goto): Likewise.
14693 * src/nullable.c (nullable_compute): Likewise.
14694 * src/output.c (prepare_rules, token_definitions_output): Likewise.
14695 * src/reader.c (packgram, reader): Likewise.
14696 * src/state.c (state_new, state_free, state_transitions_set,
14697 state_reduction_find): Likewise.
14698 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
14699 symbol_pack): Likewise.
14700 * src/tables.c (conflict_row, pack_vector): Likewise.
14701 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
14702 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
14703 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
14704 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
14706 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
14707 (ARGMATCH_CONSTRAINT): New macro.
14708 (ARGMATCH_ASSERT): Use it.
14710 * src/system.h (verify): New macro.
14711 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
14712 rather than assert.
14713 * src/tables.c (tables_generate): Likewise.
14715 * src/struniq.c (struniq_assert): Now returns void, and aborts
14716 if the assertion is false.
14717 (struniq_assert_p): Remove.
14718 * src/struniq.h: Likewise.
14720 2002-11-18 Paul Eggert <eggert@twinsun.com>
14722 * data/glr.c (yygetLRActions): Replace `yyindex' with
14723 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
14724 This fixes the regression with Sun ONE Studio 7 cc that I reported in
14725 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
14727 2002-11-18 Akim Demaille <akim@epita.fr>
14729 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
14731 From Tim Van Holder.
14733 2002-11-17 Paul Eggert <eggert@twinsun.com>
14735 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
14736 to "SyntaxError" for consistency with my 2002-11-15 change.
14738 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
14739 not define to {}, since this breaks the common use of `YYDPRINTF
14740 ((...));' if a single statement is desired (e.g. before `else').
14741 Work around GCC warnings by surrounding corresponding calls with
14743 (yyhasResolvedValue): Remove unused function.
14744 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
14746 (yyreportSyntaxError): Renamed from yyreportParseError.
14747 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
14749 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
14750 extern when possible. Remove unused initializations.
14752 2002-11-16 Akim Demaille <akim@epita.fr>
14754 Augment the similarity between GLR and LALR traces.
14756 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
14757 (YY_REDUCE_PRINT): New.
14758 (yyparse): Use them.
14759 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
14761 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
14762 state reached after the reduction/recovery, since...
14763 (yyparse, yyprocessOneStack): Report the state we are entering in.
14765 2002-11-16 Akim Demaille <akim@epita.fr>
14767 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
14768 Add support for --trace=skeleton.
14769 * src/scan-skel.l: %option debug.
14770 Scan strings of non-@ or \n instead of character by character.
14771 (scan_skel): Handle trace_skeleton.
14773 (@output_parser_name@, @output_header_name@): ``Restore'' their
14774 support (used to be M4 macros).
14775 * data/yacc.c: Quote larger chunks, a la glr.c.
14776 * data/lalr1.cc: Likewise.
14777 The header guards are no longer available, so use some other
14778 string than `YYLSP_NEEDED'.
14780 2002-11-16 Akim Demaille <akim@epita.fr>
14782 Make the ``Printers and Destructors'' test more verbose, taking
14783 `yacc.c''s behavior as (possibly wrong) reference.
14785 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
14786 instead of fprint on stdout.
14787 Set and report the last_line of the symbols.
14788 Consistently display values and locations.
14790 2002-11-16 Paul Eggert <eggert@twinsun.com>
14792 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
14794 2002-11-15 Paul Eggert <eggert@twinsun.com>
14796 * tests/actions.at (Actions after errors): New test case.
14798 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
14799 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
14800 tests/action.at, tests/calc.at, tests/conflicts.at,
14801 tests/cxx-type.at, tests/regression.at:
14802 "parse error" -> "syntax error" for POSIX compatibility.
14803 "parsing stack overflow..." -> "parser stack overflow" so
14804 that code matches Bison documentation.
14806 2002-11-15 Akim Demaille <akim@epita.fr>
14808 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
14809 take two BRACED_CODE, not two string_content.
14810 Free the scanner's obstack when we are done.
14811 (code_content): New.
14812 * tests/calc.at: Adjust.
14813 * doc/bison.texinfo: Adjust.
14814 Also, make sure to include the `,' for these declarations.
14816 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
14818 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
14819 definition; avoids potential autoreconf problems.
14821 2002-11-15 Akim Demaille <akim@epita.fr>
14823 Always check the value returned by yyparse.
14825 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
14826 returned by yyparse.
14827 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
14829 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
14830 returned by yyparse.
14832 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14834 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
14837 2002-11-14 Paul Eggert <eggert@twinsun.com>
14839 * src/output.c (output_skeleton): Call xfopen instead of
14840 duplicating xfopen's body.
14842 Fix bugs reported by Nelson H. F. Beebe in
14843 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
14845 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
14846 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
14847 Group compiler. Instead, use "$CC -E bar.c". Include the .h
14848 file twice in the grammar, as an extra check.
14850 * tests/input.at (Torturing the Scanner): Surround the
14851 backslash-newline tests with "#if 0", to make it less likely that
14852 we'll run into compiler bugs. Bring back solitary \ inside
14853 comment, but add a closing comment to work around HP C bug. Don't
14854 test backslash-newline in C character constant.
14856 2002-11-14 Akim Demaille <akim@epita.fr>
14858 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
14859 status of the compiler.
14860 Calling `exit 1' is no longer needed.
14861 Reported by Nelson H. F. Beebe.
14863 2002-11-14 Akim Demaille <akim@epita.fr>
14865 * tests/atlocal.in (CPPFLAGS): We have config.h.
14866 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
14868 * tests/actions.at, tests/calc.at, tests/conflicts.at,
14869 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
14870 * tests/regression.at, tests/torture.at: Use them for all the
14871 grammars that are to be compiled.
14872 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
14873 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
14874 * doc/bison.texinfo (GLR Parsers): Document `inline'.
14876 2002-11-14 Akim Demaille <akim@epita.fr>
14878 * doc/bison.texinfo: Various formatting changes (alignments in
14879 samples, additional @group/@end group, GCS in samples.
14880 Use @deffn instead of simple @table to define the directives,
14881 macros, variables etc.
14883 2002-11-13 Paul Eggert <eggert@twinsun.com>
14885 Fix some bugs reported by Albert Chin-A-Young in
14886 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
14888 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
14889 -o c"; the HP C compiler chatters during compilation.
14890 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
14891 * tests/headers.at (export YYLTYPE): Likewise.
14893 * tests/input.at (Torturing the Scanner): Remove lines containing
14894 solitary backslashes, as they tickle a bug in the HP C compiler.
14896 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
14897 comments, since they're not portable. Use GNU coding style.
14899 2002-11-13 Akim Demaille <akim@epita.fr>
14901 * data/yacc.c: Leave bigger chunks of quoted text.
14902 (YYDSYMPRINTF): New.
14903 Use it to report symbol activities.
14904 * data/glr.c (YYDSYMPRINTF): New.
14907 2002-11-12 Paul Eggert <eggert@twinsun.com>
14911 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
14912 (yyglrReduce): Return yyok, not 0.
14913 This should avoid the enumerated-type warnings reported
14914 by Nelson H. F. Beebe in
14915 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
14917 * lib/bbitset.h (BITSET_INLINE): Remove.
14918 * lib/bitset.h [! BITSET_INLINE]: Remove.
14919 (bitset_set, bitset_reset, bitset_test): Rename local vars
14920 to avoid shadowing warnings by GCC.
14922 * data/glr.c (inline): Remove #define. It's the user's
14923 responsibility to #define it away, just like 'const'.
14924 This fixes one of the bugs reported by Nelson H. F. Beebe in
14925 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
14927 * Makefile.maint (po-check): Scan .l and .y files instead of the
14928 .c and the .h files that they generate. This fixes the bug
14929 reported by Tim Van Holder in:
14930 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
14931 Look for N_ as well as for _. Try to avoid matching #define for
14933 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
14934 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
14935 * src/scan-gram.l: Revamp regular expressions so that " and '
14936 do not confuse xgettext.
14938 * src/struniq.h (struniq_new): Do not declare the return type
14939 to be 'const'; this violates the C standard.
14940 * src/struniq.c (struniq_new): Likewise.
14942 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
14944 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
14945 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
14948 2002-11-12 Akim Demaille <akim@epita.fr>
14950 * Makefile.maint: Sync with Autoconf:
14951 (local_updates): New.
14953 2002-11-12 Akim Demaille <akim@epita.fr>
14955 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
14957 2002-11-12 Akim Demaille <akim@epita.fr>
14959 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
14962 2002-11-12 Akim Demaille <akim@epita.fr>
14964 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
14967 2002-11-12 Akim Demaille <akim@epita.fr>
14969 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
14970 Use it to test the GLR parser.
14972 2002-11-12 Akim Demaille <akim@epita.fr>
14974 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
14976 * data/glr.c (yystos): New.
14977 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
14978 (YYDSYMPRINT): New.
14979 (yyval): Don't define it, it is handled via M4.
14980 (yyrecoverParseError): Free verbosely the discarded symbols.
14981 * data/yacc.c (yysymprint): Remove, rather...
14982 (b4_yysymprint_generate): invoke.
14983 * data/c.m4 (b4_yysymprint_generate): New.
14984 Accept pointers as arguments, as opposed to the version from
14986 (b4_yydestruct_generate): Likewise.
14987 * tests/cations.at (Printers and Destructors): Use Bison directives
14988 instead of CPP macros.
14989 Don't rely on internal details.
14991 2002-11-12 Akim Demaille <akim@epita.fr>
14993 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
14994 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
14995 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
14996 it against YYEMPTY and so forth), work on yytoken (i.e., set
14997 it to YYEMPTY etc.).
14998 (yydestruct): Replace with a b4_yydestruct_generate invocation.
14999 (b4_symbol_actions): Remove.
15000 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
15001 for 0, end-of-input.
15003 2002-11-12 Akim Demaille <akim@epita.fr>
15005 * doc/bison.texinfo (Destructor Decl): New.
15007 2002-11-12 Akim Demaille <akim@epita.fr>
15009 * src/tables.c (tables_generate): Use free for pointers that
15010 cannot be NULL, not XFREE.
15011 (pack_vector): Use assert, not fatal, for bound violations.
15012 * src/state.c (state_new): Likewise.
15013 * src/reader.c (reader): Likewise.
15014 * src/lalr.c (set_goto_map): Likewise.
15015 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
15018 2002-11-12 Akim Demaille <akim@epita.fr>
15020 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
15022 * src/scan-gram.l (last_string): Is global to the file, not to
15024 * src/parse-gram.y (input): Don't append the epilogue here,
15025 (epilogue.opt): do it here, and free the scanner's obstack.
15026 * src/reader.c (epilogue_set): Rename as...
15027 (epilogue_augment): this.
15028 * data/c.m4 (b4_epilogue): Defaults to empty.
15030 2002-11-12 Akim Demaille <akim@epita.fr>
15032 * src/getargs.c (long_options): Remove duplicates.
15033 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
15035 * doc/bison.rnh: Remove.
15036 * doc/bison.texinfo (VMS Invocation): Remove.
15038 2002-11-12 Akim Demaille <akim@epita.fr>
15040 * src/struniq.h, src/struniq.c (struniq_t): Is const.
15041 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
15043 Use struniq for symbols.
15045 * src/symtab.h (symbol_t): The tag member is a struniq.
15046 (symbol_type_set): Adjust.
15047 * src/symtab.c (symbol_new): Takes a struniq.
15048 (symbol_free): Don't free the tag member.
15049 (hash_compare_symbol_t, hash_symbol_t): Rename as...
15050 (hash_compare_symbol, hash_symbol): these.
15051 Use the fact that tags as struniqs.
15052 (symbol_get): Use struniq_new.
15053 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
15055 * src/reader.h (merger_list, grammar_currentmerge_set): The name
15056 and type members are struniqs.
15057 * src/reader.c (get_merge_function)
15058 (grammar_current_rule_merge_set): Adjust.
15059 (TYPE, current_type): Are struniq.
15061 Use struniq for file names.
15063 * src/files.h, src/files.c (infile): Split into...
15064 (grammar_file, current_file): these.
15065 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
15066 * src/reduce.c (reduce_print): Likewise.
15067 * src/getargs.c (getargs): Likewise.
15068 * src/complain.h, src/complain.c: Likewise.
15069 * src/main.c (main): Call struniqs_new early enough to use it for
15071 Don't free the input file name.
15073 2002-11-12 Akim Demaille <akim@epita.fr>
15075 * src/symtab.c (symbol_free): Remove dead deactivated code:
15076 type_name are properly removed.
15077 Don't use XFREE to free items that cannot be NULL.
15078 * src/struniq.h, src/struniq.c: New.
15079 * src/main.c (main): Initialize/free struniqs.
15080 * src/parse-gram.y (%union): Add astruniq member.
15082 * src/scan-gram.l (<{tag}>): Return a struniq.
15083 Free the obstack bit that used to store it.
15084 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
15086 2002-11-11 Paul Eggert <eggert@twinsun.com>
15088 Revamp to fix many (but not all) of the C- and M4-related quoting
15089 problems. Among other things, this fixes the Bison bug reported
15090 by Jan Hubicka when processing the Bash grammar; see:
15091 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
15093 Use new @ escapes consistently. Represent brackets with @{ and @}
15094 rather than @<:@ and @:>@, since this works a bit better with dumb
15095 editors like vi. Represent @ with @@, since @ is now consistently
15096 an escape. Use @oline@ and @ofile@ rather than __oline__ and
15097 __ofile__, to avoid unexpected expansions. Similarly, use @output
15098 rather than #output.
15100 * data/c.m4 (b4_copyright): Omit file name from comment, since
15101 the file name could contain "*/".
15102 (b4_synclines_flag): Don't quote the 2nd argument; it should already
15103 be quoted. All uses changed.
15105 * data/glr.c: Use new @ escapes consistently.
15106 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
15107 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
15108 Remove, since they couldn't handle arbitrary characters in file
15110 * data/lalr1.cc: Likewise.
15111 * data/yacc.c: Likewise.
15113 * src/files.c (output_infix): Remove; all uses removed.
15114 * src/files.h: Likewise.
15116 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
15117 mishandled funny characters in file names, and anyway it isn't
15119 * data/yacc.c: Likewise.
15120 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
15122 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
15123 * data/yacc.c: Likewise.
15125 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
15127 (muscle_init): Quote filename as a C string.
15128 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
15129 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
15130 * src/output.c (escaped_file_name_output): New function.
15131 (prepare_symbols): Quote tokens for M4.
15132 (prepare): Don't insert output_infix, output_prefix,
15133 output_parser_name, output_header_name; this is now down by scan-skel.
15134 Insert skeleton as a C string.
15136 * src/output.c (user_actions_output, symbol_destructors_output,
15137 symbol_printers_output): Quote filenames for C and M4.
15138 * src/reader.c (prologue_augment, epilogue_set): Likewise.
15140 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
15141 escapes other than \\ and \'; this simplifies the code.
15142 (<SC_STRING>): Likewise, for \\ and \".
15143 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
15144 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
15145 Use new escapes @{ and @} for [ and ].
15147 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
15148 them with auto vars.
15149 Switch to new escape scheme, where @ is the escape character uniformly.
15150 Abort if a stray escape character is found. Avoid unbounded input
15151 buffer when parsing non-escaped text.
15153 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
15154 __oline__, #output, $@, and @{ do not have unintended meanings.
15156 2002-11-09 Paul Eggert <eggert@twinsun.com>
15158 Fix the test failure due to GCC warnings described in
15159 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
15160 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
15161 evaluate to 0 if it's impossible for NINF to be in the respective
15163 (yygetLRActions, yyrecoverParseError): Use them.
15165 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
15166 counted in the token inserted at end of file. Now takes
15167 location_t *, not location_t, so that the location can be
15168 adjusted. All uses changed.
15170 * tests/regression.at (Invalid inputs): Adjust wording in
15171 diagnostic to match the new behavior.
15173 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
15174 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
15175 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
15176 abort ();'. This reduces the runtime of the "Many lookaheads"
15177 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
15180 2002-11-07 Paul Eggert <eggert@twinsun.com>
15182 * src/parse-gram.y (CHARACTER): Remove unused token.
15185 * src/scan-gram.l: Remove stack option. We no longer use the
15186 stack, since the stack was never deeper than 1; instead, use the
15187 new auto var c_context to record the stacked value.
15189 Remove nounput option. At an unexpected end of file, we now unput
15190 the minimal input necessary to end cleanly; this simplifies the
15193 Avoid unbounded token sizes where this is easy.
15195 (unexpected_end_of_file): New function.
15196 Use it to systematize the error message on unexpected EOF.
15197 (last-string): Now auto, not static.
15198 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
15199 (scanner_last_string_free): Remove; not used.
15200 (percent_percent_count): Move decl to just before use.
15201 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
15202 not the (never otherwised-used) CHARACTER.
15204 2002-11-07 Akim Demaille <akim@epita.fr>
15206 Let yyerror always receive the msg as last argument, so that
15207 yyerror can be variadic.
15209 * data/yacc.c (b4_yyerror_args): New.
15210 Use it when calling yyerror.
15211 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
15212 Use it when calling yyerror.
15213 * doc/bison.texinfo (Error Reporting): Adjust.
15214 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
15215 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
15217 2002-11-06 Akim Demaille <akim@epita.fr>
15219 #line should have quoted strings.
15220 Ideally, this should be done by m4_quotearg.
15222 * src/scan-skel.l: Include quotearg.h.
15224 * src/output.c (symbol_printers_output)
15225 (symbol_destructors_output): Quote the file name.
15227 2002-11-06 Akim Demaille <akim@epita.fr>
15229 * tests/regression.at (Invalid inputs): Adjust to the recent
15232 2002-11-06 Akim Demaille <akim@epita.fr>
15234 Restore --no-lines.
15235 Reported by Jim Kent.
15237 * data/c.m4 (b4_syncline): New.
15238 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
15239 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
15240 * src/output.c (user_actions_output): Likewise.
15241 (prepare): Define 'b4_synclines_flag'.
15242 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
15244 2002-11-06 Akim Demaille <akim@epita.fr>
15246 * src/main.c (main): Free `infile'.
15247 * src/scan-gram.l (handle_syncline): New.
15249 * src/output.c (user_actions_output, symbol_destructors_output)
15250 (symbol_printers_output): Use the location's file name, not
15252 * src/reader.c (prologue_augment, epilogue_set): Likewise.
15254 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15256 * src/tables.c (matching_state): Don't allow states to match if
15257 either has GLR conflict entries.
15259 2002-11-05 Paul Eggert <eggert@twinsun.com>
15261 * src/scan-gram.l: Use more accurate diagnostics, e.g.
15262 "integer out of range" rather than "invalid value".
15263 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
15266 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
15267 Also, remove one static variable in the scanner.
15269 * src/scan-gram.l (braces_level): Now auto, not static.
15270 Initialize to zero if the compiler is being picky.
15271 (INITIAL): Clear braces_level instead of incrementing it.
15272 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
15273 as POSIX 1003.1-2001 requires.
15274 * src/system.h (IF_LINT): New macro, taken from coreutils.
15275 * configure.ac: Define "lint" if --enable-gcc-warnings.
15277 2002-11-05 Akim Demaille <akim@epita.fr>
15279 * src/scan-gram.l: When it starts with `%', complain about the
15280 whole directive, not just that `invalid character: %'.
15282 2002-11-04 Akim Demaille <akim@epita.fr>
15284 * Makefile.maint: Update from Autoconf.
15285 (update, cvs-update, po-update, do-po-update): New.
15287 2002-11-04 Akim Demaille <akim@epita.fr>
15289 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
15291 Have yyerror `use' its arguments.
15292 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
15293 returns true when location & yacc & pure & parse-param.
15294 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
15296 2002-11-04 Akim Demaille <akim@epita.fr>
15298 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
15300 * src/scan-gram.l: Use [\'] instead of ['] to pacify
15303 Use quote, not quote_n since LOCATION_PRINT no longer uses the
15306 2002-11-03 Paul Eggert <eggert@twinsun.com>
15308 * src/reader.c (get_merge_function, grammar_current_rule_check):
15309 Use consistent diagnostics for reporting type name clashes.
15310 Quote the types with <>, for consistency with Yacc.
15311 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
15313 2002-11-03 Akim Demaille <akim@epita.fr>
15315 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
15317 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
15318 (b4_parse_param): Remove.
15319 Use b4_identification.
15320 Propagate b4_pure_args where needed to pass them to yyerror.
15321 * data/glr.m4 (b4_parse_param): Remove.
15322 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
15323 (b4_lpure_formals): New.
15324 Use b4_identification.
15325 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
15326 b4_user_formals and b4_user_args.
15327 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
15328 (yyreportAmbiguity): When using a pure parser, also need
15329 the location, and the parse-params.
15331 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
15332 When using a pure parser, also need the parse-params.
15334 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
15335 (%pure-parser + %parse-param) LALR and GLR parsers.
15336 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
15337 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
15338 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
15339 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
15340 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
15341 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
15342 * doc/bison.texinfo: Untabify the whole file.
15343 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
15344 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
15345 (Error Reporting): Adjust to these new directives.
15346 Document %error-verbose, deprecate YYERROR_VERBOSE.
15348 2002-11-03 Akim Demaille <akim@epita.fr>
15350 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
15351 AT_CHECK_CALC_GLR invocations to use % directives, instead of
15352 command line options.
15353 * tests/cxx-type.at: Formatting changes.
15355 2002-11-03 Paul Eggert <eggert@twinsun.com>
15357 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
15358 to count columns correctly, and to check for invalid inputs.
15360 Use mbsnwidth to count columns correctly. Account for tabs, too.
15361 Include mbswidth.h.
15362 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
15363 (extend_location): New function.
15364 (YY_LINES): Remove.
15366 Handle CRLF in C code rather than in Lex code.
15367 (YY_INPUT): New macro.
15368 (no_cr_read): New function.
15370 Scan UCNs, even though we don't fully handle them yet.
15371 (convert_ucn_to_byte): New function.
15373 Handle backslash-newline correctly in C code.
15374 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
15375 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
15377 (tag, splice): New EREs. Do not allow NUL or newline in tags.
15378 Use {splice} wherever C allows backslash-newline.
15379 YY_STEP after space, newline, vertical-tab.
15380 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
15382 (letter, id): Don't assume ASCII; e.g., spell out a-z.
15384 ({int}, handle_action_dollar, handle_action_at): Check for integer
15387 (YY_STEP): Omit trailing semicolon, so that it's more like C.
15389 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
15390 as well as \000. Check for UCHAR_MAX, not 255.
15391 Allow \x with an arbitrary positive number of digits, as in C.
15392 Check for overflow here.
15393 Allow \? and UCNs, for compatibility with C.
15395 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
15396 with quote slot used by complain_at.
15398 * tests/input.at: Add tests for backslash-newline, m4 quotes
15399 in symbols, long literals, and funny escapes in strings.
15401 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
15402 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
15403 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
15404 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
15405 * m4/mbswidth.m4: New file, from GNU coreutils.
15407 * doc/bison.texinfo (Grammar Outline): Document // comments.
15408 (Symbols): Document that trigraphs have no special meaning in Bison,
15409 nor is backslash-newline allowed.
15410 (Actions): Document that trigraphs have no special meaning.
15412 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
15415 2002-11-02 Paul Eggert <eggert@twinsun.com>
15417 * src/reader.c: Don't include quote.h; not needed.
15418 (get_merge_function): Reword warning to be consistent with
15419 type clash diagnostic in grammar_current_rule_check.
15421 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
15422 bug in trigraph handling.
15424 * src/output.c (prepare_symbols): When printing token names,
15425 escape "[" as "@<:@" and likewise for "]".
15427 * src/system.h (errno): Remove declaration, as we are now
15428 assuming C89 or better, and C89 guarantees errno.
15430 2002-10-30 Paul Eggert <eggert@twinsun.com>
15432 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
15433 Check for close failures.
15434 * src/files.h (xfclose): Return void, not int, since it always
15436 * src/files.c (xfclose): Likewise. Report I/O error if ferror
15438 * src/output.c (output_skeleton): Use xfclose rather than fclose
15439 and ferror. xfclose now checks ferror.
15441 * data/glr.c (YYLEFTMOST_STATE): Remove.
15442 (yyreportTree): Use a stack-based leftmost state. This avoids
15443 our continuing battles with bogus warnings about initializers.
15445 2002-10-30 Akim Demaille <akim@epita.fr>
15447 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
15450 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15452 * tests/glr-regr1.at: New test for reported regressions.
15453 * tests/testsuite.at: Add glr-regr1.at test.
15454 * tests/Makefile.am: Add glr-regr1.at test.
15456 2002-10-24 Paul Eggert <eggert@twinsun.com>
15460 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
15461 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
15462 we use malloc. Don't assume 'A' through 'Z' are contiguous.
15463 Don't assume strdup exists; POSIX says its an XSI extension.
15464 Check for buffer overflow on input.
15466 2002-10-24 Akim Demaille <akim@epita.fr>
15468 * src/output.c (output_skeleton): Don't disable M4sugar comments
15469 too soon: it results in comments being expanded.
15470 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
15473 2002-10-24 Akim Demaille <akim@epita.fr>
15475 * data/yacc.c (m4_int_type): New.
15476 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
15477 char' as only yacc.c wants K&R portability.
15478 * data/glr.c (yysigned_char): Remove.
15479 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
15480 Reported by Quoc Peyrot.
15482 2002-10-23 Paul Eggert <eggert@twinsun.com>
15484 * src/main.c (main): With --trace=time, report times even if a
15485 non-fatal error occurs. Formerly, the times were reported in some
15486 such cases but not in others.
15487 * src/reader.c (reader): Just return if a complaint has been issued,
15488 instead of exiting, so that 'main' can report times.
15490 2002-10-22 Akim Demaille <akim@epita.fr>
15492 * src/system.h: Include sys/types.
15493 Reported by Bert Deknuydt.
15495 2002-10-23 Paul Eggert <eggert@twinsun.com>
15497 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
15498 Suggested by Art Haas.
15500 2002-10-22 Paul Eggert <eggert@twinsun.com>
15502 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
15503 decl; not needed any more.
15504 * src/main.c (main): Use return to exit, undoing yesterday's change.
15505 The last OS that we could find where this wouldn't work is
15506 SunOS 3.5, and that's too old to worry about now.
15508 * data/glr.c (struct yyltype): Define members even when not
15509 doing locations. This is more consistent with yacc.c, and it
15510 works around the following bug reports:
15511 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
15512 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
15514 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
15515 @acronym consistently. Standardize on "Yacc" instead of "YACC",
15516 "Algol" instead of "ALGOL". Give a bit more history about BNF.
15518 2002-10-22 Akim Demaille <akim@epita.fr>
15520 * data/README: New.
15522 2002-10-21 Paul Eggert <eggert@twinsun.com>
15524 Be consistent about 'bool'; the old code used an enum in one
15525 module and an int in another, and this violates the C standard.
15526 * m4/stdbool.m4: New file, from coreutils 4.5.3.
15527 * configure.ac (AC_HEADER_STDBOOL): Add.
15528 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
15529 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
15530 * src/symtab.c (hash_compare_symbol_t): Likewise.
15531 * src/system.h (bool, false, true): Use a definition consistent
15532 with ../lib/hash.c. All uses changed.
15534 * src/complain.c (warning_issued): Renamed from warn_message_count,
15535 so that we needn't worry about integer overflow (!).
15536 Now of type bool. All uses changed.
15537 (complaint_issued): Renamed from complain_message_count; likewise.
15539 * src/main.c (main): Use exit to exit with failure.
15541 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
15542 rather than 1 and 0.
15543 * src/main.c (main): Likewise.
15544 * src/getargs.c (getargs): Likewise.
15545 * src/reader.c (reader): Likewise.
15547 * src/getarg.c (getargs): Remove duplicate code for
15548 "Try `bison --help'".
15550 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
15551 What was that "2" for?
15553 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
15554 * src/getargs.c (usage): Likewise.
15556 * src/getargs.c (getargs): When there are too few operands, report
15557 the last one. When there are too many, report the first extra
15558 one. This is how diffutils does it.
15560 2002-10-20 Paul Eggert <eggert@twinsun.com>
15562 Remove K&R vestiges.
15563 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
15564 * src/complain.c (VA_START): Remove. Assume prototypes.
15565 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
15566 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
15567 fatal): Assume prototypes.
15568 * src/complain.h: Assume prototypes.
15569 * src/system.h (PARAMS): Remove.
15570 Include <limits.h> unconditionally, since it's guaranteeed even
15571 for a freestanding C89 compiler.
15572 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
15573 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
15575 2002-10-20 Akim Demaille <akim@epita.fr>
15577 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
15578 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
15579 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
15580 (yyresolveStates, yyresolveAction, yyresolveStack)
15581 (yyprocessOneStack): Use them.
15582 (yy_reduce_print): New.
15583 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
15585 2002-10-20 Akim Demaille <akim@epita.fr>
15587 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
15588 arguments and output `void'.
15589 (b4_c_function): Rename as...
15590 (b4_c_function_def): this.
15591 (b4_c_function_decl, b4_c_ansi_function_def)
15592 (b4_c_ansi_function_decl): New.
15593 Change the interpretation of the arguments: before `int, foo', now
15595 * data/yacc.c (yyparse): Prototype and define thanks to these.
15596 Adjust b4_c_function_def uses.
15597 * data/glr.c (yyparse): Likewise, but ANSI only.
15599 2002-10-20 Akim Demaille <akim@epita.fr>
15601 * src/output.c (prepare): Move the definition of `tokens_number',
15602 `nterms_number', `undef_token_number', `user_token_number_max'
15604 (prepare_tokens): Here.
15605 (prepare_tokens): Rename as...
15606 (prepare_symbols): this.
15607 (prepare): Move the definition of `rules_number' to...
15608 (prepare_rules): here.
15609 (prepare): Move the definition of `last', `final_state_number',
15610 `states_number' to...
15611 (prepare_states): here.
15612 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
15614 2002-10-20 Akim Demaille <akim@epita.fr>
15616 * src/tables.h, src/tables.c, src/output.c: Comment changes.
15618 2002-10-20 Akim Demaille <akim@epita.fr>
15620 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
15623 2002-10-20 Akim Demaille <akim@epita.fr>
15625 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
15626 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
15628 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
15630 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
15631 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
15634 2002-10-19 Paul Eggert <eggert@twinsun.com>
15636 Do not create a temporary file, as that involves security and
15637 cleanup headaches. Instead, use a pair of pipes.
15638 Derived from a suggestion by Florian Krohm.
15639 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
15640 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
15641 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
15642 (BISON_PREREQ_SUBPIPE): Add.
15643 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
15644 Add subpipe.h, subpipe.c.
15645 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
15646 * po/POTFILES.in: Add lib/subpipe.c.
15647 * src/output.c: Include "subpipe.h".
15648 (m4_invoke): Remove decl.
15649 (scan_skel): New decl.
15650 (output_skeleton): Use pipe rather than temporary file for m4 input.
15651 Check that m4sugar.m4 is readable, to avoid deadlock.
15652 Check for pipe I/O error.
15653 * src/scan-skel.l (readpipe): Remove decl.
15654 (scan_skel): New function, to be used in place of m4_invoke.
15655 Read from stream rather than file.
15657 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
15658 float, as this generates a warning on Solaris 8 + GCC 3.2 with
15659 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
15660 this generates a more-accurate value anyway.
15662 * lib/timevar.c (timervar_accumulate): Rename locals to
15663 avoid confusion with similarly-named more-global.
15664 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
15666 * src/output.c (prepare): Use xstrdup to convert char const *
15667 to char *, to avoid GCC warning.
15669 2002-10-19 Akim Demaille <akim@epita.fr>
15671 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
15672 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
15673 Use them to have `calc.y' ready for %pure-parser.
15674 * data/yacc.c (YYLEX): Pass a yylex return type to
15675 b4_c_function_call.
15677 2002-10-19 Akim Demaille <akim@epita.fr>
15679 Prototype support of %lex-param and %parse-param.
15681 * src/parse-gram.y: Add the definition of the %lex-param and
15682 %parse-param tokens, plus their rules.
15683 Drop the `_' version of %glr-parser.
15685 * src/scan-gram.l (INITIAL): Scan them.
15686 * src/muscle_tab.c: Comment changes.
15687 (muscle_insert, muscle_find): Rename `pair' as `probe'.
15688 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
15689 (muscle_entry_s): The `value' member is no longer const.
15690 Adjust all dependencies.
15691 * src/muscle_tab.c (muscle_init): Adjust: use
15692 MUSCLE_INSERT_STRING.
15693 Initialize the obstack earlier.
15694 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
15695 (muscle_pair_list_grow): New.
15696 * data/c.m4 (b4_c_function_call, b4_c_args): New.
15697 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
15698 * tests/calc.at: Use %locations, not --locations.
15699 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
15701 2002-10-19 Akim Demaille <akim@epita.fr>
15703 * src/getargs.c (usage): Take status as argument and exit
15705 Report the traditional `Try ... --help' message when status != 0.
15706 (usage, version): Don't take a FILE * as arg, it is pointless.
15707 (getargs): When there is an incorrect number of arguments, make it
15708 an error, and report it GNUlically thanks to `usage ()'.
15710 2002-10-18 Paul Eggert <eggert@twinsun.com>
15712 * data/glr.c (yyreportParseError): Don't assume that sprintf
15713 yields the length of the printed string, as this is not true
15714 on SunOS 4.1.4. Reported by Peter Klein.
15716 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
15717 * tests/conflicts.at (%nonassoc and eof): Likewise.
15718 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
15720 2002-10-17 Akim Demaille <akim@epita.fr>
15722 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
15723 * src/getargs.c (trace_types, trace_args): Adjust.
15724 * src/reader.c (grammar_current_rule_prec_set)
15725 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
15726 Standardize error messages.
15727 And s/@prec/%prec/!
15728 (reader): Use trace_flag to enable scanner/parser debugging,
15729 instead of an adhoc scheme.
15730 * src/scan-gram.l: Remove trailing debugging code.
15732 2002-10-16 Paul Eggert <eggert@twinsun.com>
15734 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
15737 * NEWS: Officially drop support for building Bison with K&R C,
15738 since it didn't work anyway and it's not worth worrying about.
15739 * Makefile.maint (wget_files): Remove ansi2knr.c.
15740 (ansi2knr.c-url_prefix): Remove.
15741 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
15742 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15743 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15745 2002-10-15 Paul Eggert <eggert@twinsun.com>
15747 Stop using the "enum_" trick for K&R-style function definitions;
15748 it confused me, and I was the author! Instead, assume that people
15749 who want to use K&R C compilers (when using these modules in GCC,
15750 perhaps?) will run ansi2knr.
15752 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
15753 All uses of "enum_" changed to "enum ".
15754 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
15755 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
15757 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
15758 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
15759 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
15760 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
15761 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
15762 abitset_not, abitset_ones, abitset_or, abitset_or_and,
15763 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
15764 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
15765 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
15766 Use function prototypes; this removes the need for declaring
15767 static functions simply to provide their prototypes.
15768 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
15769 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
15770 bitset_count_, bitset_create, bitset_dump, bitset_first,
15771 bitset_free, bitset_init, bitset_last, bitset_next,
15772 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
15773 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
15774 bitset_print, bitset_release_memory, bitset_toggle_,
15775 bitset_type_choose, bitset_type_get, bitset_type_name_get,
15776 debug_bitset): Likewise.
15777 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
15778 * lib/bitset_stats.c (bitset_log_histogram_print,
15779 bitset_percent_histogram_print, bitset_stats_and,
15780 bitset_stats_and_cmp, bitset_stats_and_or,
15781 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
15782 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
15783 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
15784 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
15785 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
15786 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
15787 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
15788 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
15789 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
15790 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
15791 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
15792 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
15793 bitset_stats_zero): Likewise.
15794 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
15795 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
15796 bitsetv_dump, debug_bitsetv): Likewise.
15797 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
15798 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
15799 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
15800 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
15801 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
15802 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
15803 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
15804 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
15805 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
15806 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
15807 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
15809 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
15810 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
15811 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
15812 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
15813 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
15814 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
15815 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
15816 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
15817 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
15818 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
15819 lbitset_xor_cmp, lbitset_zero): Likewise.
15821 2002-10-14 Akim Demaille <akim@epita.fr>
15825 2002-10-14 Akim Demaille <akim@epita.fr>
15827 * tests/Makefile.am (maintainer-check-posix): New.
15829 2002-10-14 Akim Demaille <akim@epita.fr>
15831 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
15834 2002-10-14 Akim Demaille <akim@epita.fr>
15836 * src/tables.c (table_ninf_remap): base -> tab.
15837 Reported by Matt Rosing.
15839 2002-10-14 Paul Eggert <eggert@twinsun.com>
15841 * tests/action.at, tests/calc.at, tests/conflicts.at,
15842 tests/cxx-type.at, tests/headers.at, tests/input.at,
15843 tests/regression.at, tests/synclines.at, tests/torture.at:
15844 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
15845 so that the tests still work even if POSIXLY_CORRECT is set.
15846 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
15848 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
15849 for portability to K&R hosts. Fix typo: signed char is guaranteed
15850 only to 127, not to 128.
15851 * data/glr.c (yysigned_char): New type.
15852 * data/yacc.c (yysigned_char): Likewise.
15853 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
15855 2002-10-13 Paul Eggert <eggert@twinsun.com>
15857 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
15858 true due to limited range of data type" warning from GCC.
15860 * data/c.m4 (b4_token_defines): Protect against double-inclusion
15861 by wrapping enum yytokentype's definition inside #ifndef
15862 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
15864 2002-10-13 Akim Demaille <akim@epita.fr>
15866 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
15867 Un yy- yyrhs to avoid the name clash with the global YYRHS.
15869 2002-10-13 Akim Demaille <akim@epita.fr>
15871 * Makefile.maint: Update from Autoconf 2.54.
15872 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
15874 2002-10-13 Akim Demaille <akim@epita.fr>
15876 * src/print.c (print_state): Separate the list of solved conflicts
15877 from the other items.
15878 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
15880 2002-10-13 Akim Demaille <akim@epita.fr>
15882 Let nondeterministic skeletons be usable with deterministic
15885 With the patch, GAWK compiled by GCC without -O2 passes its test
15886 suite using a GLR parser driven by LALR tables. It fails with -O2
15887 because `struct stat' gives two different answers on my machine:
15888 88 (definition of an auto var) and later 96 (memset on this var).
15889 Hence the stack is badly corrumpted. The headers inclusion is to
15890 blame: if I move the awk.h inclusion before GLR's system header
15891 inclusion, the two struct stat have the same size.
15893 * src/tables.c (pack_table): Always create conflict_table.
15894 (token_actions): Always create conflict_list.
15895 * data/glr.c (YYFLAG): Remove, unused.
15897 2002-10-13 Akim Demaille <akim@epita.fr>
15899 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
15901 (VALGRIND, GXX): New.
15902 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
15903 * tests/bison.in: Run $PREBISON a pre-command.
15904 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
15905 (maintainer-check-g++): New.
15906 * Makefile.am (maintainer-check): New.
15908 2002-10-13 Akim Demaille <akim@epita.fr>
15910 * data/glr.c: Formatting changes.
15911 Tweak some trace messages to match yacc.c's.
15913 2002-10-13 Akim Demaille <akim@epita.fr>
15915 GLR parsers sometimes raise parse errors instead of performing the
15917 Reported by Charles-Henry de Boysson.
15919 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
15920 check the length of the traces when %glr.
15921 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
15923 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
15925 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
15926 (yyltype): Remove the yy prefix from the member names.
15927 (yytable): Complete its comment.
15928 (yygetLRActions): Map error action number from YYTABLE from
15930 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
15931 (which was a bug: it should have been YYTABEL_NINF, and yet it was
15932 not satisfying as we could compare an YYACTION computed from
15933 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
15934 only value for error actions.
15935 (yyreportParseError): In verbose parse error messages, don't issue
15936 `error' in the list of expected tokens.
15937 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
15938 next action to perform to match glr.c's decoding.
15939 (yytable): Complete its comment.
15941 2002-10-13 Paul Eggert <eggert@twinsun.com>
15943 Fix problem reported by Henrik Grubbstroem in
15944 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
15945 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
15946 because the Bison parser reads the second action before reducing
15948 * src/scan-gram.l (rule_length): New static var.
15949 Use it to keep track of the rule length in the scanner, since
15950 we can't expect the parser to be in lock-step sync with the scanner.
15951 (handle_action_dollar, handle_action_at): Use this var.
15952 * tests/actions.at (Exotic Dollars): Test for the problem.
15954 2002-10-12 Paul Eggert <eggert@twinsun.com>
15956 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
15957 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
15958 Include <sys/time.h> when checking for clock_t and struct tms.
15959 Use same include order as source.
15960 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
15961 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
15963 * lib/timevar.c: Update copyright date and clarify comments.
15964 (get_time) [IN_GCC]: Keep the GCC version for reference.
15966 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
15967 GCC version as of today, then merge Bison's changes.
15968 Change "GCC" to "Bison" in copyright notice. timevar.def's
15969 author is Akim, so change that too.
15971 * src/reader.c (grammar_current_rule_check):
15972 Don't worry about the default action if $$ is untyped.
15973 Prevents bogus warnings reported by Jim Gifford in
15974 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
15976 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
15977 * data/glr.c, data/lalr1.cc, data/yacc.c:
15978 Output token definitions before the first part of user declarations.
15979 Fixes compatibility problem reported by Jim Gifford for kbd in
15980 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
15982 2002-10-11 Paul Eggert <eggert@twinsun.com>
15984 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
15985 (yyparse): here. This undoes some of the 2002-07-25 change.
15986 Compatibility problem reported by Ralf S. Engelschall with
15987 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
15989 2002-10-11 Akim Demaille <akim@epita.fr>
15991 * tests/regression.at Characters Escapes): New.
15992 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
15994 Reported by Jan Nieuwenhuizen.
15996 2002-10-11 Akim Demaille <akim@epita.fr>
16000 2002-10-10 Paul Eggert <eggert@twinsun.com>
16002 Portability fixes for bitsets; this also avoids several GCC
16005 * lib/abitset.c: Include <stddef.h>, for offsetof.
16006 * lib/lbitset.c: Likewise.
16008 * lib/abitset.c (abitset_bytes): Return a size that is aligned
16009 properly for vectors of objects. Do not assume that adding a
16010 header size to a multiple of a word size yields a value that is
16011 properly aligned for the whole union.
16012 * lib/bitsetv.c (bitsetv_alloc): Likewise.
16014 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
16015 unique names for structures.
16016 * lib/ebitset.c (ebitset_bytes): Likewise.
16017 * lib/lbitset.c (lbitset_bytes): Likewise.
16019 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
16020 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
16021 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
16022 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
16023 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
16024 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
16025 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
16026 to improve the type-checking that GCC can do.
16027 * lib/bitset.c (bitset_op4_cmp): Likewise.
16028 * lib/bitset_stats.c (bitset_stats_count,
16029 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
16030 bitset_stats_copy, bitset_stats_disjoint_p,
16031 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
16032 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
16033 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
16034 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
16035 bitset_stats_and_or_cmp, bitset_stats_andn_or,
16036 bitset_stats_andn_or_cmp, bitset_stats_or_and,
16037 bitset_stats_or_and_cmp): Likewise.
16038 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
16039 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
16040 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
16041 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
16043 * lib/abitset.h: Include bitset.h, not bbitset.h.
16044 * lib/ebitset.h: Likewise.
16045 * lib/lbitset.h: Likewise.
16047 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
16048 All instances of parameters of type enum bitset_opts are now of
16049 type enum_bitset_opts, to conform to the C Standard, and similarly
16050 for enum_bitset_type.
16051 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
16052 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
16054 Do not use "struct bitset_struct" to mean different things in
16055 different modules. Not only is this confusing, it violates
16056 the C Standard, which requires that structure types in different
16057 modules must be compatible if one is to be passed to the other.
16058 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
16059 All instances of "struct bitset_struct *" replaced with "bitset".
16060 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
16061 (union bitset_union, struct abitset_struct, struct ebitset_struct,
16062 struct lbitset_struct, struct bitset_stats_struct): New types.
16063 All uses of struct bitset_struct changed to union bitset_union,
16065 * lib/abitset.c (struct abitset_struct, abitset,
16066 struct bitset_struct): Remove.
16067 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
16068 struct bitset_struct): Remove.
16069 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
16070 bitset_struct): Remove.
16071 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
16074 Do not call a function of type T using a call that assumes the
16075 function is of a different type U. Standard C requires that a
16076 function must be called with a type that is compatible with its
16078 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
16080 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
16082 * lib/ebitset.c (PFV): Remove.
16083 * lib/lbitset.c (PFV): Likewise.
16084 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
16085 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
16087 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
16088 (ebitset_vtable): Use them.
16089 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
16090 lbitset_xor): New functions.
16091 (lbitset_vtable): Use them.
16093 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
16096 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
16098 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
16099 Use offsetof, for simplicity.
16101 2002-10-06 Paul Eggert <eggert@twinsun.com>
16103 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
16104 the same width as int. This reapplies a hunk of the 2002-08-12 patch
16105 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
16106 which was inadvertently undone by the 2002-09-30 patch.
16107 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
16108 the same width as int.
16110 2002-10-04 Paul Eggert <eggert@twinsun.com>
16114 * configure.ac (AC_INIT), NEWS: Increment version number.
16116 * doc/bison.texinfo: Minor spelling, grammar, and white space
16118 (Symbols): Mention that any negative value returned from yylex
16119 signifies end-of-input. Warn about negative chars. Mention
16120 the portable Standard C character set.
16122 The GNU coding standard says CFLAGS and YFLAGS are reserved
16123 for the installer to set.
16124 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
16125 * src/Makefile.am (AM_CFLAGS): Likewise.
16126 (AM_YFLAGS): Renamed from YFLAGS.
16128 Fix some MAX and MIN problems.
16129 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
16130 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
16131 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
16132 * src/reader.c (reader): Use it.
16134 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
16135 POSIX 1003.1-2001 has removed fgrep.
16137 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
16139 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
16140 interpreted as signed.
16141 * lib/ebitset.c (ebitset_list): Fix bug.
16143 2002-10-01 Paul Eggert <eggert@twinsun.com>
16145 More fixes for 64-bit hosts and large bitsets.
16147 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
16148 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
16149 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
16150 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
16151 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
16152 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
16153 bitset_count_): Likewise.
16154 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
16155 bitset_first, bitset_last): Likewise.
16156 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
16157 bitset_stats_list_reverse, bitset_stats_size,
16158 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
16160 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
16161 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
16162 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
16163 bitsetv_reflexive_transitive_closure): Likewise.
16164 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
16165 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
16167 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
16170 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
16171 Use size_t, not unsigned int, to count bytes.
16172 * lib/abitset.h (abitset_bytes): Likewise.
16173 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
16175 * lib/bitset.h (bitset_bytes): Likewise.
16176 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
16177 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
16178 * lib/bitsetv.c (bitsetv_alloc): Likewise.
16179 * lib/ebitset.c (ebitset_bytes): Likewise.
16180 * lib/ebitset.h (ebitset_bytes): Likewise.
16181 * lib/lbitset.c (lbitset_bytes): Likewise.
16182 * lib/lbitset.h (lbitset_bytes): Likewise.
16184 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
16185 abitset_subset_p, abitset_disjoint_p, abitset_and,
16186 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
16187 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
16188 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
16189 abitset_or_and, abitset_or_and_cmp):
16190 Use bitset_windex instead of unsigned int.
16191 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
16192 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
16193 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
16194 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
16196 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
16198 * lib/bitset.c (bitset_print):
16199 Use proper printf formats for widths of integer types.
16200 * lib/bitset_stats.c (bitset_percent_histogram_print,
16201 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
16202 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
16203 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
16204 * lib/lbitset.c (lbitset_bytes): Likewise.
16206 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
16207 BITSET_SIZE_MAX): New macros.
16208 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
16209 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
16210 to BITSET_WINDEX_MAX.
16212 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
16213 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
16214 since we now return the bitset_bindex type (not int).
16216 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
16217 when computing sizes.
16218 * lib/ebitset.c (ebitset_elts_grow): Likewise.
16220 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
16221 and avoid cast to unsigned.
16223 2002-09-30 Akim Demaille <akim@epita.fr>
16225 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
16226 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
16227 Updates from Michael Hayes.
16229 2002-09-30 Art Haas <ahaas@neosoft.com>
16231 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
16233 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
16236 2002-09-27 Akim Demaille <akim@epita.fr>
16240 2002-09-27 Akim Demaille <akim@epita.fr>
16242 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
16243 (Because of AC_LIBSOURCE).
16245 2002-09-27 Akim Demaille <akim@epita.fr>
16247 Playing with Autoscan.
16249 * configure.ac: Remove the old LIBOBJ tweaks.
16250 (AC_REPLACE_FUNCS): Add strrchr and strtol.
16251 * lib/strrchr.c: New.
16252 * lib/strtol.c: New, from the Coreutils 4.5.1.
16254 2002-09-27 Akim Demaille <akim@epita.fr>
16256 Playing with Autoscan.
16258 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
16259 * lib/Makefile.am (libbison_a_SOURCES): No longer include
16260 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
16261 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
16264 2002-09-24 Akim Demaille <akim@epita.fr>
16266 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
16267 (Frequently Asked Questions, Parser Stack Overflow): New.
16269 2002-09-13 Akim Demaille <akim@epita.fr>
16271 Playing with autoscan.
16273 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
16274 * src/files.c (skeleton_find): Remove, unused.
16275 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
16276 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
16278 2002-09-13 Akim Demaille <akim@epita.fr>
16280 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
16281 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
16283 2002-09-13 Akim Demaille <akim@epita.fr>
16285 * configure.ac: Require 2.54.
16286 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
16287 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
16288 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
16289 Remove, provided by Autoconf macros.
16291 2002-09-12 Akim Demaille <akim@epita.fr>
16293 * m4/prereq.m4: Update, from Coreutils 4.5.1.
16295 2002-09-12 Akim Demaille <akim@epita.fr>
16297 * m4/prereq.m4: Update, from Fileutils 4.1.5.
16298 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
16299 Reported by Martin Mokrejs.
16301 2002-09-10 Akim Demaille <akim@epita.fr>
16303 * src/parse-gram.y: Associate a human readable string to each
16305 * tests/regression.at (Invalid inputs): Adjust.
16307 2002-09-10 Gary V. Vaughan <gary@gnu.org>
16309 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
16310 with an Autoconf-2.5x style configure.ac.
16312 2002-09-06 Paul Eggert <eggert@twinsun.com>
16314 * doc/bison.texinfo (Conditions): Make explicit that the GPL
16315 exception applies only to yacc.c. This is a modification of a
16316 patch originally suggested by Akim Demaille.
16318 2002-09-06 Akim Demaille <akim@epita.fr>
16320 * data/c.m4 (b4_copyright): Move the GPL exception comment from
16322 * data/yacc.c: here.
16324 * data/lalr1.cc (struct yyltype): Don't define it, since we use
16326 (b4_ltype): Default to yy::Location from location.hh.
16328 2002-09-04 Jim Meyering <jim@meyering.net>
16330 * data/yacc.c: Guard the declaration of yytoknum also with
16331 `#ifdef YYPRINT', so it is declared only when used.
16333 2002-09-04 Akim Demaille <akim@epita.fr>
16335 * configure.in: Rename as...
16336 * configure.ac: this.
16339 2002-09-04 Akim Demaille <akim@epita.fr>
16341 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
16342 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
16343 translate maintainer only messages.
16345 2002-08-12 Paul Eggert <eggert@twinsun.com>
16349 * Makefile.am (SUBDIRS): Remove intl.
16350 (DISTCLEANFILES): Remove.
16351 * NEWS: Mention that GNU M4 is now required. Clarify what is
16352 meant by "larger grammars". Mention the pt_BR translation.
16353 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
16354 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
16355 Bump version from 0.11.2 to 0.11.5.
16356 (BISON_PREREQ_STAGE): Remove.
16357 (AM_GNU_GETTEXT): Use external gettext.
16358 (AC_OUTPUT): Remove intl/Makefile.
16360 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
16362 * data/glr.c: Include string.h, for strlen.
16363 (yyreportParseError): Use size_t for yysize.
16364 (yy_yypstack): No longer nested inside yypstates, as nested
16365 functions are not portable. Do not assume size_t is the
16367 (yypstates): Do not assume that ptrdiff_t is the same width
16368 as int, and similarly for yyposn and YYINDEX.
16370 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
16372 * lib/Makefile.am (INCLUDES): Do not include from the intl
16373 directory, which has been removed.
16374 * src/Makefile.am (INCLUDES): Likewise.
16376 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
16377 (bitsets_sources, additional_bitsets_sources, timevars_sources):
16380 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
16381 * tests/Makefile.am (EXTRA_DIST): Likewise.
16383 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
16384 Do not assume that bitset_windex is the same width as unsigned.
16386 * lib/abitset.c (abitset_unused_clear): Do not assume that
16387 bitset_word is the same width as int.
16388 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
16389 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
16390 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
16391 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
16392 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
16394 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
16395 portability to one's complement hosts!).
16396 * lib/ebitset.c (ebitset_op1): Likewise.
16397 * lib/lbitset.c (lbitset_op1): Likewise.
16399 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
16400 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
16401 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
16402 Sync with fileutils.
16403 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
16404 lib/gettext.h: Sync with diffutils.
16406 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
16407 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
16409 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
16410 PROTOTYPES to check for prototypes, and "defined __STDC__" to
16413 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
16414 size_t; the old version tried to do this but casted improperly.
16415 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
16416 (bitset_test): Now returns int, not unsigned long.
16418 * lib/bitset_stats.c: Include "gettext.h".
16420 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
16421 name locals "index", as it generates unnecessary warnings on some
16422 hosts that have an "index" function.
16424 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
16425 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
16426 they need translation.
16427 * src/LR0.c (state_list_append, new_itemsets, get_state,
16428 append_states, generate_states): Likewise.
16429 * src/assoc.c (assoc_to_string): Likewise.
16430 * src/closure.c (print_closure, set_firsts, closure): Likewise.
16431 * src/gram.c (grammar_dump): Likewise.
16432 * src/injections.c (injections_compute): Likewise.
16433 * src/lalr.c (lookaheads_print): Likewise.
16434 * src/relation.c (relation_transpose): Likewise.
16435 * src/scan-gram.l: Likewise.
16436 * src/tables.c (table_grow, pack_vector): Likewise.
16438 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
16439 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
16440 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
16441 * m4/mbstate_t.m4: Sync with fileutils.
16442 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
16444 * po/LINGUAS: Add pt_BR.
16445 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
16446 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
16448 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
16450 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
16452 * src/complain.c (strerror_r): Remove decl; not needed.
16453 (strerror): Use same pattern as ../lib/error.c.
16455 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
16457 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
16459 * src/main.c (main): Cast result of bindtextdomain and textdomain
16460 to void, to avoid a GCC warning when --disable-nls is in effect.
16462 * src/scan-gram.l: Use strings rather than escapes when possible,
16463 to minimize the number of warnings from xgettext.
16464 (handle_action_dollar, handle_action_at): Don't use isdigit,
16465 as it mishandles negative chars and it may not work as expected
16466 outside the C locale.
16468 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
16469 this is a GCC extension and is not portable to other compilers.
16471 * src/system.h (alloca): Use same pattern as ../lib/error.c.
16472 Do not include <ctype.h>; no longer needed.
16473 Do not include <malloc.h>; no longer needed (and generates
16474 warnings on OpenBSD 3.0).
16476 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
16479 * tests/regression.at: Do not use 'cc -c input.c -o input';
16480 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
16482 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
16483 exit status as failure, not just exit status 1. Sun C exits
16484 with status 2 sometimes.
16486 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
16487 Use it for the two large tests.
16489 2002-08-02 Akim Demaille <akim@epita.fr>
16491 * src/conflicts.c (conflicts_output): Don't output rules never
16492 reduced here, since anyway that computation doesn't work.
16493 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
16494 (rule_useless_p, rule_never_reduced_p): New.
16495 (grammar_rules_partial_print): Use a filter instead of a range.
16496 Display the title only if needed.
16497 (grammar_rules_print): Adjust.
16498 (grammar_rules_never_reduced_report): New.
16499 * src/tables.c (action_row): Move the computation of rules never
16501 (token_actions): here.
16502 * src/main.c (main): Make the parser before making the report, so
16503 that rules never reduced are computed.
16504 Call grammar_rules_never_reduced_report.
16505 * src/print.c (print_results): Report rules never reduced.
16506 * tests/conflicts.at, tests/reduce.at: Adjust.
16508 2002-08-01 Akim Demaille <akim@epita.fr>
16510 Instead of attaching lookaheads and duplicating the rules being
16511 reduced by a state, attach the lookaheads to the reductions.
16513 * src/state.h (state_t): Remove the `lookaheads',
16514 `lookaheads_rule' member.
16515 (reductions_t): Add a `lookaheads' member.
16516 Use a regular array for the `rules'.
16517 * src/state.c (reductions_new): Initialize the lookaheads member
16519 (state_rule_lookaheads_print): Adjust.
16520 * src/state.h, src/state.c (state_reductions_find): New.
16521 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
16522 (count_rr_conflicts): Adjust.
16523 * src/lalr.c (LArule): Remove.
16524 (add_lookback_edge): Adjust.
16525 (state_lookaheads_count): New.
16526 (states_lookaheads_initialize): Merge into...
16527 (initialize_LA): this.
16528 (lalr_free): Adjust.
16529 * src/main.c (main): Don't free nullable and derives too early: it
16530 is used by --verbose.
16531 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
16533 2002-08-01 Akim Demaille <akim@epita.fr>
16535 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
16537 (set_derives, free_derives): Rename as...
16538 (derives_compute, derives_free): this.
16539 Adjust all dependencies.
16540 * src/nullable.c (set_nullable, free_nullable): Rename as...
16541 (nullable_compute, nullable_free): these.
16542 (rule_list_t): Store rule_t *, not rule_number_t.
16543 * src/state.c (state_rule_lookaheads_print): Directly compare rule
16544 pointers, instead of their numbers.
16545 * src/main.c (main): Call nullable_free, and derives_free earlier,
16546 as they were lo longer used.
16548 2002-08-01 Akim Demaille <akim@epita.fr>
16550 * lib/timevar.c (get_time): Include children time.
16551 * src/lalr.h (LA, LArule): Don't export them: used with the
16553 * src/lalr.c (LA, LArule): Static.
16554 * src/lalr.h, src/lalr.c (lalr_free): New.
16555 * src/main.c (main): Call it.
16556 * src/tables.c (pack_vector): Check whether loc is >= to the
16558 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
16559 (tables_generate): do it, since that's also it which allocates
16561 Don't free LA and LArule, main does.
16563 2002-07-31 Akim Demaille <akim@epita.fr>
16565 Separate parser tables computation and output.
16567 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
16568 (conflict_list, conflict_list_cnt, table, check, table_ninf)
16569 (yydefgoto, yydefact, high): Move to...
16570 * src/tables.h, src/tables.c: here.
16571 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
16572 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
16573 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
16574 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
16575 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
16576 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
16577 (action_row, save_row, token_actions, save_column, default_goto)
16578 (goto_actions, sort_actions, matching_state, pack_vector)
16579 (table_ninf_remap, pack_table, prepare_actions): Move to...
16580 * src/tables.c: here.
16581 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
16582 * src/output.c (token_actions, output_base, output_conflicts)
16583 (output_check): Merge into...
16584 (prepare_actions): this.
16585 (actions_output): Rename as...
16586 (user_actions_output): this.
16587 * src/main.c (main): Call tables_generate and tables_free.
16589 2002-07-31 Akim Demaille <akim@epita.fr>
16591 Steal GCC's --time-report support.
16593 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
16594 stolen/adjusted from GCC.
16595 * m4/stage.m4: Remove time related checks.
16596 * m4/timevar.m4: New.
16597 * configure.in: Adjust.
16598 * src/system.h: Adjust to using timevar.h.
16599 * src/getargs.h, src/getargs.c: Support trace_time for
16601 * src/main.c (stage): Remove.
16602 (main): Replace `stage' invocations with timevar calls.
16603 * src/output.c: Insert pertinent timevar calls.
16605 2002-07-31 Akim Demaille <akim@epita.fr>
16607 Let --trace have arguments.
16609 * src/getargs.h (enum trace_e): New.
16610 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
16611 (long_options, short_options): --trace/-T takes an optional
16613 Change all the uses of trace_flag to reflect the new flags.
16614 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
16616 Strengthen `stage' portability.
16618 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
16619 * configure.in: Use it.
16620 Don't check for malloc.h and sys/times.h.
16621 * src/system.h: Include them when appropriate.
16622 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
16623 times and struct tms are available.
16625 2002-07-30 Akim Demaille <akim@epita.fr>
16627 In verbose parse error message, don't report `error' as an
16629 * tests/actions.at (Printers and Destructors): Adjust.
16630 * tests/calc.at (Calculator $1): Adjust.
16631 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
16632 error message, do not report the parser accepts the error token in
16635 2002-07-30 Akim Demaille <akim@epita.fr>
16637 Normalize conflict related messages.
16639 * src/complain.h, src/complain.c (warn, complain): New.
16640 * src/conflicts.c (conflicts_print): Use them.
16641 (conflict_report_yacc): New, extracted from...
16642 (conflicts_print): here.
16643 * tests/conflicts.at, tests/existing.at: Adjust.
16645 2002-07-30 Akim Demaille <akim@epita.fr>
16647 Report rules which are never reduced by the parser: those hidden
16650 * src/LR0.c (save_reductions): Don't make the final state too
16651 different: save its reduction (accept) instead of having a state
16652 without any action (no shift or goto, no reduce).
16653 Note: the final state is now a ``regular'' state, i.e., the
16654 parsers now contain `reduce 0' as default reduction.
16655 Nevertheless, since they decide to `accept' when yystate =
16656 final_state, they still will not reduce rule 0.
16657 * src/print.c (print_actions, print_reduction): Adjust.
16658 * src/output.c (action_row): Track reduced rules.
16659 (token_actions): Report rules never reduced.
16660 * tests/conflicts.at, tests/regression.at: Adjust.
16662 2002-07-30 Akim Demaille <akim@epita.fr>
16664 `stage' was accidently included in a previous patch.
16665 Initiate its autoconfiscation.
16667 * configure.in: Look for malloc.h and sys/times.h.
16668 * src/main.c (stage): Adjust.
16669 Report only when trace_flag.
16671 2002-07-29 Akim Demaille <akim@epita.fr>
16673 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
16675 (errs_t): symbol_t*, not symbol_number_t.
16676 (reductions_t): rule_t*, not rule_number_t.
16677 (FOR_EACH_SHIFT): New.
16678 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
16679 * src/print.c, src/print_graph.c: Adjust.
16681 2002-07-29 Akim Demaille <akim@epita.fr>
16683 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
16685 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
16686 (endtoken, accept): these.
16687 * src/reader.c (reader): Set endtoken's default tag to "$end".
16688 Set undeftoken's tag to "$undefined" instead of "$undefined.".
16689 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
16692 2002-07-29 Akim Demaille <akim@epita.fr>
16694 * src/reduce.c (reduce_grammar): When the language is empty,
16695 complain about the start symbol, not the axiom.
16697 * tests/reduce.at (Empty Language): New.
16699 2002-07-26 Akim Demaille <akim@epita.fr>
16701 * src/reader.h, src/reader.c (gram_error): ... can't get
16702 yycontrol without making too strong assumptions on the parser
16704 * src/output.c (prepare_tokens): Use the real 0th value of
16705 token_translations instead of `0'.
16706 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
16708 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
16709 for the time being: %locations ought to provide it to yyerror.
16711 2002-07-25 Akim Demaille <akim@epita.fr>
16713 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
16714 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
16715 * tests/regression.at (Web2c Actions): Adjust.
16717 2002-07-25 Akim Demaille <akim@epita.fr>
16719 Stop storing rules from 1 to nrules + 1.
16721 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
16722 * src/nullable.c, src/output.c, src/print.c, src/reader.c
16723 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
16724 Iterate from 0 to nrules.
16725 Use rule_number_as_item_number and item_number_as_rule_number.
16726 Adjust to `derive' now containing possibly 0.
16727 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
16728 Handle the `- 1' part in rule numbers from/to item numbers.
16729 * src/conflicts.c (log_resolution): Fix the message which reversed
16731 * src/output.c (action_row): Initialize default_rule to -1.
16732 (token_actions): Adjust.
16733 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
16735 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
16737 2002-07-25 Akim Demaille <akim@epita.fr>
16739 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
16740 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
16741 (b4_c_knr_arg_decl): New.
16742 * data/yacc.c: Use it to define yysymprint, yydestruct, and
16743 yyreport_parse_error.
16745 2002-07-25 Akim Demaille <akim@epita.fr>
16747 * data/yacc.c (yyreport_parse_error): New, extracted from...
16749 (yydestruct, yysymprint): Move above yyparse.
16752 2002-07-25 Akim Demaille <akim@epita.fr>
16754 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
16756 (b4_sint_type, b4_uint_type): these.
16757 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
16758 * tests/regression.at (Web2c Actions): Adjust.
16760 2002-07-25 Akim Demaille <akim@epita.fr>
16762 * src/gram.h (TIEM_NUMBER_MAX): New.
16763 (item_number_of_rule_number, rule_number_of_item_number): Rename
16765 (rule_number_as_item_number, item_number_as_rule_number): these.
16766 Adjust dependencies.
16767 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
16768 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
16769 (symbol_number_to_vector_number): New.
16770 (order): Of vector_number_t* type.
16771 (base_t, BASE_MAX, BASE_MIN): New.
16772 (froms, tos, width, pos, check): Of base_t type.
16773 (action_number_t, ACTION_MIN, ACTION_MAX): New.
16774 (actrow): Of action_number_t type.
16775 (conflrow): Of unsigned int type.
16776 (table_ninf, base_ninf): New.
16777 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
16778 (muscle_insert_int_table, muscle_insert_base_table)
16779 (muscle_insert_rule_number_table): New.
16780 (prepare_tokens): Output `toknum' as int_table.
16781 (action_row): Returns a rule_number_t.
16782 Use ACTION_MIN, not SHRT_MIN.
16783 (token_actions): yydefact is rule_number_t*.
16784 (table_ninf_remap): New.
16785 (pack_table): Use it for `base' and `table'.
16786 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
16788 (YYPACT_NINF, YYTABLE_NINF): these.
16789 (yypact, yytable): Compute their types instead of hard-coded
16791 * tests/regression.at (Web2c Actions): Adjust.
16793 2002-07-19 Akim Demaille <akim@epita.fr>
16795 * src/scan-gram.l (id): Can start with an underscore.
16797 2002-07-16 Akim Demaille <akim@epita.fr>
16799 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
16800 Adjust all former `associativity' dependencies.
16801 * src/symtab.c (symbol_new): Default associativity is `undef', not
16803 (symbol_check_alias_consistence): Adjust.
16805 2002-07-09 Akim Demaille <akim@epita.fr>
16807 * doc/bison.texinfo: Properly set the ``header'' part.
16808 Use @dircategory ``GNU programming tools'' as per Texinfo's
16812 2002-07-09 Akim Demaille <akim@epita.fr>
16814 * lib/quotearg.h: Protect against multiple inclusions.
16815 * src/location.h (location_t): Add a `file' member.
16816 (LOCATION_RESET, LOCATION_PRINT): Adjust.
16817 * src/complain.c (warn_at, complain_at, fatal_at): Drop
16818 `error_one_per_line' support.
16820 2002-07-09 Akim Demaille <akim@epita.fr>
16822 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
16823 * src/reader.c (lineno): Remove.
16824 Adjust all dependencies.
16825 (get_merge_function): Take a location and use complain_at.
16826 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
16827 * tests/regression.at (Invalid inputs, Mixing %token styles):
16830 2002-07-09 Akim Demaille <akim@epita.fr>
16832 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
16833 recovery rule, and forbid extensions when --yacc.
16834 (gram_error): Use complain_at.
16835 * src/reader.c (reader): Exit if there were parse errors.
16837 2002-07-09 Akim Demaille <akim@epita.fr>
16839 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
16840 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
16841 Reported by R Blake <blakers@mac.com>.
16843 2002-07-09 Akim Demaille <akim@epita.fr>
16845 * data/yacc.c: Output the copyright notive in the header.
16847 2002-07-03 Akim Demaille <akim@epita.fr>
16849 * src/output.c (froms, tos): Are state_number_t.
16850 (save_column): sp, sp1, and sp2 are state_number_t.
16851 (prepare): Rename `final' as `final_state_number', `nnts' as
16852 `nterms_number', `nrules' as `rules_number', `nstates' as
16853 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
16855 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
16856 * data/lalr1.cc (nsym_): Remove, unused.
16858 2002-07-03 Akim Demaille <akim@epita.fr>
16860 * src/lalr.h, src/lalr.c (goto_number_t): New.
16861 * src/lalr.c (goto_list_t): New.
16863 * src/nullable.c (rule_list_t): New.
16865 * src/types.h: Remove.
16867 2002-07-03 Akim Demaille <akim@epita.fr>
16869 * src/closure.c (print_fderives): Use rule_rhs_print.
16870 * src/derives.c (print_derives): Use rule_rhs_print.
16871 (rule_list_t): New, replaces `shorts'.
16872 (set_derives): Add comments.
16873 * tests/sets.at (Nullable, Firsts): Adjust.
16875 2002-07-03 Akim Demaille <akim@epita.fr>
16877 * src/output.c (prepare_actions): Free `tally' and `width'.
16878 (prepare_actions): Allocate and free `order'.
16879 * src/symtab.c (symbols_free): Free `symbols'.
16880 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
16881 * src/output.c (m4_invoke): Move to...
16882 * src/scan-skel.l: here.
16883 (<<EOF>>): Close yyout, and free its name.
16885 2002-07-03 Akim Demaille <akim@epita.fr>
16887 Fix some memory leaks, and fix a bug: state 0 was examined twice.
16889 * src/LR0.c (new_state): Merge into...
16890 (state_list_append): this.
16891 (new_states): Merge into...
16892 (generate_states): here.
16893 (set_states): Don't ensure a proper `errs' state member here, do it...
16894 * src/conflicts.c (conflicts_solve): here.
16895 * src/state.h, src/state.c: Comment changes.
16896 (state_t): Rename member `shifts' as `transitions'.
16897 Adjust all dependencies.
16898 (errs_new): For consistency, also take the values as argument.
16899 (errs_dup): Remove.
16900 (state_errs_set): New.
16901 (state_reductions_set, state_transitions_set): Assert that no
16902 previous value was assigned.
16904 (states_free): Use it.
16905 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
16906 temporary storage: use `errs' and `nerrs' as elsewhere.
16907 (set_conflicts): Allocate and free this `errs'.
16909 2002-07-02 Akim Demaille <akim@epita.fr>
16911 * lib/libiberty.h: New.
16912 * lib: Update the bitset implementation from upstream.
16913 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
16914 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
16915 * src/main.c: Adjust bitset stats calls.
16917 2002-07-01 Paul Eggert <eggert@twinsun.com>
16919 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
16920 char, so that negative chars don't collide with $.
16922 2002-06-30 Akim Demaille <akim@epita.fr>
16924 Have the GLR tests be `warning' checked, and fix the warnings.
16926 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
16927 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
16928 (yyremoveDeletes): `yyi' and `yyj' are size_t.
16929 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
16930 (yyaddDeferredAction): static.
16931 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
16932 (yyreportParseError): yyprefix is const.
16933 yytokenp is used only when verbose.
16934 (yy__GNUC__): Replace with __GNUC__.
16935 (yypdumpstack): yyi is size_t.
16936 (yypreference): Un-yy local variables and arguments, to avoid
16937 clashes with `yyr1'. Anyway, we are not in the user name space.
16938 (yytname_size): be an int, as is compared with ints.
16939 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
16941 * tests/cxx-gram.at: Use quotation to protect $1.
16942 Use AT_COMPILE to enable warnings hunts.
16943 Prototype yylex and yyerror.
16945 Include `string.h', not `strings.h'.
16946 Produce and prototype stmtMerge only when used.
16947 yylex takes a location.
16949 2002-06-30 Akim Demaille <akim@epita.fr>
16951 We spend a lot of time in quotearg, in particular when --verbose.
16953 * src/symtab.c (symbol_get): Store a quoted version of the key.
16954 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
16955 Adjust all callers.
16957 2002-06-30 Akim Demaille <akim@epita.fr>
16959 * src/state.h (reductions_t): Rename member `nreds' as num.
16960 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
16961 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
16963 2002-06-30 Akim Demaille <akim@epita.fr>
16965 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
16966 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
16967 (shifts_to): Rename as...
16968 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
16969 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
16970 (TRANSITION_IS_DISABLED, transitions_to): these.
16972 2002-06-30 Akim Demaille <akim@epita.fr>
16974 * src/print.c (print_shifts, print_gotos): Merge into...
16975 (print_transitions): this.
16976 (print_transitions, print_errs, print_reductions): Align the
16977 lookaheads columns.
16978 (print_core, print_transitions, print_errs, print_state,
16979 print_grammar): Output empty lines separator before, not after.
16980 (state_default_rule_compute): Rename as...
16981 (state_default_rule): this.
16982 * tests/conflicts.at (Defaulted Conflicted Reduction),
16983 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
16984 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
16986 2002-06-30 Akim Demaille <akim@epita.fr>
16988 Display items as we display rules.
16990 * src/gram.h, src/gram.c (rule_lhs_print): New.
16991 * src/gram.c (grammar_rules_partial_print): Use it.
16992 * src/print.c (print_core): Likewise.
16993 * tests/conflicts.at (Defaulted Conflicted Reduction),
16994 (Unresolved SR Conflicts): Adjust.
16995 (Unresolved SR Conflicts): Adjust and rename as...
16996 (Resolved SR Conflicts): this, as was meant.
16997 * tests/regression.at (Web2c Report): Adjust.
16999 2002-06-30 Akim Demaille <akim@epita.fr>
17001 * src/print.c (state_default_rule_compute): New, extracted from...
17002 (print_reductions): here.
17003 Pessimize, but clarify the code.
17004 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
17006 2002-06-30 Akim Demaille <akim@epita.fr>
17008 * src/output.c (action_row): Let default_rule be always a rule
17011 2002-06-30 Akim Demaille <akim@epita.fr>
17013 * src/closure.c (print_firsts, print_fderives, closure):
17014 Use BITSET_EXECUTE.
17015 * src/lalr.c (lookaheads_print): Likewise.
17016 * src/state.c (state_rule_lookaheads_print): Likewise.
17017 * src/print_graph.c (print_core): Likewise.
17018 * src/print.c (print_reductions): Likewise.
17019 * src/output.c (action_row): Likewise.
17020 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
17022 2002-06-30 Akim Demaille <akim@epita.fr>
17024 * src/print_graph.c: Use report_flag.
17026 2002-06-30 Akim Demaille <akim@epita.fr>
17028 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
17030 * src/relation.h, src/relation.c (traverse, relation_digraph)
17031 (relation_print, relation_transpose): New.
17033 2002-06-30 Akim Demaille <akim@epita.fr>
17035 * src/state.h, src/state.c (shifts_to): New.
17036 * src/lalr.c (build_relations): Use it.
17038 2002-06-30 Akim Demaille <akim@epita.fr>
17040 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
17041 (item_number_of_rule_number, rule_number_of_item_number): New.
17042 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
17043 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
17044 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
17045 Propagate their use.
17046 Much remains to be done, in particular wrt `shorts' from types.h.
17048 2002-06-30 Akim Demaille <akim@epita.fr>
17050 * src/symtab.c (symbol_new): Initialize the `printer' member.
17052 2002-06-30 Akim Demaille <akim@epita.fr>
17054 * src/LR0.c (save_reductions): Remove, replaced by...
17055 * src/state.h, src/state.c (state_reductions_set): New.
17056 (reductions, errs): Rename as...
17057 (reductions_t, errs_t): these.
17058 Adjust all dependencies.
17060 2002-06-30 Akim Demaille <akim@epita.fr>
17062 * src/LR0.c (state_list_t, state_list_append): New.
17063 (first_state, last_state): Now symbol_list_t.
17064 (this_state): Remove.
17065 (new_itemsets, append_states, save_reductions): Take a state_t as
17067 (set_states, generate_states): Adjust.
17068 (save_shifts): Remove, replaced by...
17069 * src/state.h, src/state.c (state_shifts_set): New.
17070 (shifts): Rename as...
17072 Adjust all dependencies.
17073 * src/state.h (state_t): Remove the `next' member.
17075 2002-06-30 Akim Demaille <akim@epita.fr>
17077 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
17080 2002-06-30 Akim Demaille <akim@epita.fr>
17082 Use hash.h for the state hash table.
17084 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
17085 (allocate_storage): Use state_hash_new.
17086 (free_storage): Use state_hash_free.
17087 (new_state, get_state): Adjust.
17088 * src/lalr.h, src/lalr.c (states): Move to...
17089 * src/states.h (state_t): Remove the `link' member, no longer
17091 * src/states.h, src/states.c: here.
17092 (state_hash_new, state_hash_free, state_hash_lookup)
17093 (state_hash_insert, states_free): New.
17094 * src/states.c (state_table, state_compare, state_hash): New.
17095 * src/output.c (output_actions): Do not free states now, since we
17096 still need to know the final_state number in `prepare', called
17097 afterwards. Do it...
17098 * src/main.c (main): here: call states_free after `output'.
17100 2002-06-30 Akim Demaille <akim@epita.fr>
17102 * src/state.h, src/state.c (state_new): New, extracted from...
17103 * src/LR0.c (new_state): here.
17104 * src/state.h (STATE_ALLOC): Move to...
17105 * src/state.c: here.
17106 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
17107 * src/state.h, src/state.c: here.
17109 2002-06-30 Akim Demaille <akim@epita.fr>
17111 * src/reader.c (gensym): Rename as...
17112 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
17113 (getsym): Rename as...
17114 (symbol_get): this.
17116 2002-06-30 Akim Demaille <akim@epita.fr>
17118 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
17119 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
17120 * src/output.c, src/print.c, src/print_graph.c: Propagate.
17121 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
17123 2002-06-30 Akim Demaille <akim@epita.fr>
17125 Make the test suite pass with warnings checked.
17127 * tests/actions.at (Printers and Destructors): Improve.
17128 Avoid unsigned vs. signed issues.
17129 * tests/calc.at: Don't exercise the scanner here, do it...
17130 * tests/input.at (Torturing the Scanner): here.
17132 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17134 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
17135 reorganize first lines parallel to yacc.c.
17137 2002-06-28 Akim Demaille <akim@epita.fr>
17139 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
17140 (b4_token_enum, b4_token_defines): New, factored from...
17141 * data/lalr1.cc, data/yacc.c, glr.c: here.
17143 2002-06-28 Akim Demaille <akim@epita.fr>
17145 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
17147 * src/output.c (merger_output): static.
17149 2002-06-28 Akim Demaille <akim@epita.fr>
17151 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
17152 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
17154 * src/output.c (save_row): Initialize all the variables to pacify GCC.
17156 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17158 Accumulated changelog for new GLR parsing features.
17160 * src/conflicts.c (count_total_conflicts): Change name to
17161 conflicts_total_count.
17162 * src/conflicts.h: Ditto.
17163 * src/output.c (token_actions): Use the new name.
17164 (output_conflicts): Change conflp => conflict_list_heads, and
17165 confl => conflict_list for better readability.
17166 * data/glr.c: Use the new names.
17167 * NEWS: Add self to GLR announcement.
17169 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
17171 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
17174 * data/bison.glr: Change name to glr.c
17175 * data/glr.c: Renamed from bison.glr.
17176 * data/Makefile.am: Add glr.c
17180 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
17181 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
17183 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17185 * data/bison.glr: Be sure to restore the
17186 current #line when returning to the skeleton contents after having
17187 exposed the input file's #line.
17189 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17191 * data/bison.glr: Bring up to date with changes to bison.simple.
17193 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17195 * data/bison.glr: Correct definitions that use b4_prefix.
17196 Various reformatting.
17197 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
17198 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
17199 yytokenp argument; now part of stack.
17200 (yychar): Define to behave as documented.
17201 (yyclearin): Ditto.
17203 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17205 * src/reader.h: Add declaration for free_merger_functions.
17207 * src/reader.c (merge_functions): New variable.
17208 (get_merge_function): New function.
17209 (free_merger_functions): New function.
17210 (readgram): Check for %prec that is not followed by a symbol.
17211 Handle %dprec and %merge declarations.
17212 (packgram): Initialize dprec and merger fields in rules array.
17214 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
17215 conflict_list_cnt, conflict_list_free): New variables.
17216 (table_grow): Also grow conflict_table.
17217 (prepare_rules): Output dprec and merger tables.
17218 (conflict_row): New function.
17219 (action_row): Output conflict lists for GLR parser. Don't use
17220 default reduction in conflicted states for GLR parser so that there
17221 are spaces for the conflict lists.
17222 (save_row): Also save conflict information.
17223 (token_actions): Allocate conflict list.
17224 (merger_output): New function.
17225 (pack_vector): Pack conflict table, too.
17226 (output_conflicts): New function to output yyconflp and yyconfl.
17227 (output_check): Allocate conflict_tos.
17228 (output_actions): Output conflict tables, also.
17229 (output_skeleton): Output b4_mergers definition.
17230 (prepare): Output b4_max_rhs_length definition.
17231 Use 'bison.glr' as default skeleton for GLR parsers.
17233 * src/gram.c (glr_parser): New flag.
17234 (grammar_free): Call free_merger_functions.
17236 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
17237 all pairs of conflicting reductions, rather than just all tokens
17238 causing conflicts. Needed to size conflict tables.
17239 (conflicts_output): Modify call to count_rr_conflicts for new
17241 (conflicts_print): Ditto.
17242 (count_total_conflicts): New function.
17244 * src/reader.h (merger_list): New type.
17245 (merge_functions): New variable.
17247 * src/lex.h (tok_dprec, tok_merge): New token types.
17249 * src/gram.h (rule_s): Add dprec and merger fields.
17250 (glr_parser): New flag.
17252 * src/conflicts.h (count_total_conflicts): New function.
17254 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
17256 * doc/bison.texinfo (Generalized LR Parsing): New section.
17257 (GLR Parsers): New section.
17258 (Language and Grammar): Mention GLR parsing.
17259 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
17260 Correct typo ("tge" -> "the").
17262 * data/bison.glr: New skeleton for GLR parsing.
17264 * tests/cxx-gram.at: New tests for GLR parsing.
17266 * tests/testsuite.at: Include cxx-gram.at.
17268 * tests/Makefile.am: Add cxx-gram.at.
17270 * src/parse-gram.y:
17272 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
17274 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
17276 2002-06-27 Akim Demaille <akim@epita.fr>
17278 * src/options.h, src/options.c: Remove.
17279 * src/getargs.c (short_options, long_options): New.
17281 2002-06-27 Akim Demaille <akim@epita.fr>
17283 * data/bison.simple, data/bison.c++: Rename as...
17284 * data/yacc.c, data/lalr1.cc: these.
17285 * doc/bison.texinfo (Environment Variables): Remove.
17287 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
17289 * src/getargs.c (report_argmatch): Initialize strtok().
17291 2002-06-20 Akim Demaille <akim@epita.fr>
17293 * data/bison.simple (b4_symbol_actions): New, replaces...
17294 (b4_symbol_destructor, b4_symbol_printer): these.
17295 (yysymprint): Be sure to call YYPRINT only for tokens, and using
17296 user token numbers.
17298 2002-06-20 Akim Demaille <akim@epita.fr>
17300 * data/bison.simple (yydestructor): Rename as...
17301 (yydestruct): this.
17303 2002-06-20 Akim Demaille <akim@epita.fr>
17305 * src/symtab.h, src/symtab.c (symbol_type_set)
17306 (symbol_destructor_set, symbol_precedence_set): The location is
17308 Adjust all callers.
17310 2002-06-20 Akim Demaille <akim@epita.fr>
17312 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
17314 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
17316 * src/symtab.h, src/symtab.c (symbol_class_set)
17317 (symbol_user_token_number_set): Likewise.
17318 Adjust all callers.
17319 Promote complain_at.
17320 * tests/input.at (Type Clashes): Adjust.
17322 2002-06-20 Akim Demaille <akim@epita.fr>
17324 * data/bison.simple (YYLEX): Fix the declaration when
17327 2002-06-20 Akim Demaille <akim@epita.fr>
17329 * data/bison.simple (yysymprint): Don't print the token number,
17331 * tests/actions.at (Destructors): Rename as...
17332 (Printers and Destructors): this.
17333 Also exercise %printer.
17335 2002-06-20 Akim Demaille <akim@epita.fr>
17337 * data/bison.simple (YYDSYMPRINT): New.
17338 Use it to remove many of the #if YYDEBUG/if (yydebug).
17340 2002-06-20 Akim Demaille <akim@epita.fr>
17342 * src/symtab.h, src/symtab.c (symbol_t): printer and
17343 printer_location are new members.
17344 (symbol_printer_set): New.
17345 * src/parse-gram.y (PERCENT_PRINTER): New token.
17346 Handle its associated rule.
17347 * src/scan-gram.l: Adjust.
17348 (handle_destructor_at, handle_destructor_dollar): Rename as...
17349 (handle_symbol_code_at, handle_symbol_code_dollar): these.
17350 * src/output.c (symbol_printers_output): New.
17351 (output_skeleton): Call it.
17352 * data/bison.simple (yysymprint): New. Cannot be named yyprint
17353 since there are already many grammar files with a user `yyprint'.
17354 Replace the calls to YYPRINT to calls to yysymprint.
17355 * tests/calc.at: Adjust.
17356 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
17357 taking advantage of parser very internal details (stack size!).
17359 2002-06-20 Akim Demaille <akim@epita.fr>
17361 * src/scan-gram.l: Complete the scanner with the missing patterns
17363 Use `quote' and `symbol_tag_get' where appropriate.
17365 2002-06-19 Akim Demaille <akim@epita.fr>
17367 * tests/actions.at (Destructors): Augment to test locations.
17368 * data/bison.simple (yydestructor): Pass it the current location
17369 if locations are enabled.
17370 Prototype only when __STDC__ or C++.
17371 Change the argument names to move into the yy name space: there is
17374 2002-06-19 Akim Demaille <akim@epita.fr>
17376 * data/bison.simple (b4_pure_if): New.
17377 Use it instead of #ifdef YYPURE.
17379 2002-06-19 Akim Demaille <akim@epita.fr>
17381 * data/bison.simple (b4_location_if): New.
17382 Use it instead of #ifdef YYLSP_NEEDED.
17384 2002-06-19 Akim Demaille <akim@epita.fr>
17386 Prepare @$ in %destructor, but currently don't bind it in the
17387 skeleton, as %location use is not cleaned up yet.
17389 * src/scan-gram.l (handle_dollar, handle_destructor_at)
17390 (handle_action_at): New.
17391 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
17392 a braced_code_t and a location as additional arguments.
17393 (handle_destructor_dollar): Instead of requiring `b4_eval', just
17394 unquote one when outputting `b4_dollar_dollar'.
17396 * data/bison.simple (b4_eval): Remove.
17397 (b4_symbol_destructor): Adjust.
17398 * tests/input.at (Invalid @n): Adjust.
17400 2002-06-19 Zack Weinberg <zack@codesourcery.com>
17402 * doc/bison.texinfo: Document ability to have multiple
17405 2002-06-18 Akim Demaille <akim@epita.fr>
17407 * src/files.c (compute_base_names): When computing the output file
17408 names from the input file name, strip the directory part.
17410 2002-06-18 Akim Demaille <akim@epita.fr>
17412 * data/bison.simple.new: Comment changes.
17413 Reported by Andreas Schwab.
17415 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
17417 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
17418 there are no `label `yyoverflowlab' defined but not used' warnings
17419 when yyoverflow is defined.
17421 2002-06-18 Akim Demaille <akim@epita.fr>
17423 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
17425 (symbol_destructor_set): Adjust.
17426 * src/output.c (symbol_destructors_output): Output the destructor
17428 Output the symbol name.
17429 * data/bison.simple (b4_symbol_destructor): Adjust.
17431 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
17432 and Akim Demaille <akim@epita.fr>
17434 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
17435 what's left on the stack when the error recovery hits EOF.
17436 * tests/actions.at (Destructors): Complete to exercise this case.
17438 2002-06-17 Akim Demaille <akim@epita.fr>
17440 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
17441 arguments is really empty, not only equal to `[]'.
17442 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
17444 (symbol_destructor_set): New.
17445 * src/output.c (symbol_destructors_output): New.
17446 * src/reader.h (brace_code_t, current_braced_code): New.
17447 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
17448 (handle_dollar): Rename as...
17449 (handle_action_dollar): this.
17450 (handle_destructor_dollar): New.
17451 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
17452 (grammar_declaration): Use it.
17453 * data/bison.simple (yystos): Is always defined.
17454 (yydestructor): New.
17455 * tests/actions.at (Destructors): New.
17456 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
17458 2002-06-17 Akim Demaille <akim@epita.fr>
17460 * src/symlist.h, src/symlist.c (symbol_list_length): New.
17461 * src/scan-gram.l (handle_dollar, handle_at): Compute the
17462 rule_length only when needed.
17463 * src/output.c (actions_output, token_definitions_output): Output
17465 * src/symtab.c: Don't access directly to the symbol tag, use
17467 * src/parse-gram.y: Use symbol_list_free.
17469 2002-06-17 Akim Demaille <akim@epita.fr>
17471 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
17472 (symbol_list_prepend, get_type_name): Move to...
17473 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
17474 (symbol_list_prepend, symbol_list_n_type_name_get): here.
17475 Adjust all callers.
17476 (symbol_list_free): New.
17477 * src/scan-gram.l (handle_dollar): Takes a location.
17478 * tests/input.at (Invalid $n): Adjust.
17480 2002-06-17 Akim Demaille <akim@epita.fr>
17482 * src/reader.h, src/reader.c (symbol_list_new): Export it.
17483 (symbol_list_prepend): New.
17484 * src/parse-gram.y (%union): `list' is a new member.
17485 (symbols.1): New, replaces...
17486 (terms_to_prec.1, nterms_to_type.1): these.
17487 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
17488 Take a location as additional argument.
17489 Adjust all callers.
17491 2002-06-15 Akim Demaille <akim@epita.fr>
17493 * src/parse-gram.y: Move %token in the declaration section so that
17494 we don't depend upon CVS Bison.
17496 2002-06-15 Akim Demaille <akim@epita.fr>
17498 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
17499 * src/print.c (print_core): Use it.
17501 2002-06-15 Akim Demaille <akim@epita.fr>
17503 * src/conflicts.c (log_resolution): Accept the rule involved in
17504 the sr conflicts instead of the lookahead number that points to
17506 (flush_reduce): Accept the current lookahead vector as argument,
17507 instead of the index in LA.
17508 (resolve_sr_conflict): Accept the current number of lookahead
17509 bitset to consider for the STATE, instead of the index in LA.
17510 (set_conflicts): Adjust.
17511 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
17513 2002-06-15 Akim Demaille <akim@epita.fr>
17515 * src/state.h (state_t): Replace the `lookaheadsp' member, a
17516 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
17517 Adjust all dependencies.
17518 * src/lalr.c (initialize_lookaheads): Split into...
17519 (states_lookaheads_count, states_lookaheads_initialize): these.
17522 2002-06-15 Akim Demaille <akim@epita.fr>
17524 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
17526 (grammar_rules_print): here.
17527 * src/reduce.c (reduce_output): Use it.
17528 * tests/reduce.at (Useless Rules, Reduced Automaton)
17529 (Underivable Rules): Adjust.
17531 2002-06-15 Akim Demaille <akim@epita.fr>
17533 Copy BYacc's nice way to report the grammar.
17535 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
17537 Don't print the rules' location, it is confusing and useless.
17538 (rule_print): Use grammar_rhs_print.
17539 * src/print.c (print_grammar): Use grammar_rules_print.
17541 2002-06-15 Akim Demaille <akim@epita.fr>
17543 Complete and rationalize `useless thing' warnings.
17545 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
17546 (symbol_tag_print): New.
17547 Use them everywhere in place of accessing directly the tag member.
17548 * src/gram.h, src/gram.c (rule_print): New.
17549 Use it where a rule used to be printed `by hand'.
17550 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
17551 (reduce_grammar_tables): Report the useless rules.
17552 (reduce_print): Useless things are a warning, not an error.
17554 * tests/reduce.at (Useless Nonterminals, Useless Rules):
17555 (Reduced Automaton, Underivable Rules): Adjust.
17556 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
17557 * tests/conflicts.at (Unresolved SR Conflicts)
17558 (Solved SR Conflicts): Adjust.
17560 2002-06-15 Akim Demaille <akim@epita.fr>
17562 Let symbols have a location.
17564 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
17566 Adjust all callers.
17567 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
17568 Use location_t, not int.
17569 * src/symtab.c (symbol_check_defined): Take advantage of the
17571 * tests/regression.at (Invalid inputs): Adjust.
17573 2002-06-15 Akim Demaille <akim@epita.fr>
17575 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
17576 (input): Don't try to initialize yylloc here, do it in the
17578 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
17579 * src/gram.h (rule_t): Change line and action_line into location
17580 and action_location, of location_t type.
17581 Adjust all dependencies.
17582 * src/location.h, src/location.c (empty_location): New.
17583 * src/reader.h, src/reader.c (grammar_start_symbol_set)
17584 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
17585 (grammar_current_rule_symbol_append)
17586 (grammar_current_rule_action_append): Expect a location as argument.
17587 * src/reader.c (grammar_midrule_action): Adjust to attach an
17588 action's location as dummy symbol location.
17589 * src/symtab.h, src/symtab.c (startsymbol_location): New.
17590 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
17593 2002-06-14 Akim Demaille <akim@epita.fr>
17595 Grammar declarations may be found in the grammar section.
17597 * src/parse-gram.y (rules_or_grammar_declaration): New.
17598 (declarations): Each declaration may end with a semicolon, not
17600 (grammar_declaration): `"%union"'.
17601 (grammar): Branch to rules_or_grammar_declaration.
17603 2002-06-14 Akim Demaille <akim@epita.fr>
17605 * src/main.c (main): Invoke scanner_free.
17607 2002-06-14 Akim Demaille <akim@epita.fr>
17609 * src/output.c (m4_invoke): Extracted from...
17610 (output_skeleton): here.
17613 2002-06-14 Akim Demaille <akim@epita.fr>
17615 * src/parse-gram.y (directives, directive, gram)
17616 (grammar_directives, precedence_directives, precedence_directive):
17618 (declarations, declaration, grammar, grammar_declaration)
17619 (precedence_declaration, precedence_declarator): these.
17620 (symbol_declaration): New.
17622 2002-06-14 Akim Demaille <akim@epita.fr>
17624 * src/files.c (action_obstack): Remove, unused.
17625 (output_obstack): Remove it, and all its dependencies, as it is no
17627 * src/reader.c (epilogue_set): Build the epilogue in the
17629 * src/output.h, src/output.c (muscle_obstack): Move to...
17630 * src/muscle_tab.h, src/muscle_tab.h: here.
17631 (muscle_init): Initialize muscle_obstack.
17632 (muscle_free): New.
17633 * src/main.c (main): Call it.
17635 2002-06-14 Akim Demaille <akim@epita.fr>
17637 * src/location.h: New, extracted from...
17638 * src/reader.h: here.
17639 * src/Makefile.am (noinst_HEADERS): Merge into
17640 (bison_SOURCES): this.
17642 * src/parse-gram.y: Use location_t instead of Bison's.
17643 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
17644 Use location_t instead of ints.
17646 2002-06-14 Akim Demaille <akim@epita.fr>
17648 * data/bison.simple, data/bison.c++: Be sure to restore the
17649 current #line when returning to the skeleton contents after having
17650 exposed the input file's #line.
17652 2002-06-12 Akim Demaille <akim@epita.fr>
17654 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
17656 * tests/actions.at (Exotic Dollars): New.
17658 2002-06-12 Akim Demaille <akim@epita.fr>
17660 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
17662 * tests/input.at (Torturing the Scanner): New.
17664 2002-06-11 Akim Demaille <akim@epita.fr>
17666 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
17667 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
17668 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
17669 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
17670 * src/reader.c (reader): Use it.
17672 2002-06-11 Akim Demaille <akim@epita.fr>
17674 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
17675 Adjust all callers.
17676 (scanner_last_string_free): New.
17678 2002-06-11 Akim Demaille <akim@epita.fr>
17680 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
17681 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
17682 (last_string, YY_OBS_FREE): New.
17683 Use them when returning an ID.
17685 2002-06-11 Akim Demaille <akim@epita.fr>
17687 Have Bison grammars parsed by a Bison grammar.
17689 * src/reader.c, src/reader.h (prologue_augment): New.
17690 * src/reader.c (copy_definition): Remove.
17692 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
17693 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
17694 (grammar_current_rule_prec_set, grammar_current_rule_check)
17695 (grammar_current_rule_symbol_append)
17696 (grammar_current_rule_action_append): Export.
17697 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
17698 (symbol_list_action_append): Remove.
17699 Hook the routines from reader.
17700 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
17701 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
17703 * src/reader.c (read_declarations): Remove, unused.
17705 * src/parse-gram.y: Handle the epilogue.
17706 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
17707 (grammar_start_symbol_set): this.
17708 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
17709 * src/reader.c (readgram): Remove, unused.
17710 (reader): Adjust to insert eoftoken and axiom where appropriate.
17712 * src/reader.c (copy_dollar): Replace with...
17713 * src/scan-gram.h (handle_dollar): this.
17714 * src/parse-gram.y: Remove `%thong'.
17716 * src/reader.c (copy_at): Replace with...
17717 * src/scan-gram.h (handle_at): this.
17719 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
17722 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
17725 * src/reader.h, src/reader.c (grammar_rule_end): New.
17727 * src/parse.y (current_type, current_class): New.
17728 Implement `%nterm', `%token' support.
17729 Merge `%term' into `%token'.
17730 (string_as_id): New.
17731 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
17734 * src/parse-gram.y: Be sure to handle properly the beginning of
17737 * src/parse-gram.y: Handle %type.
17738 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
17740 * src/parse-gram.y: More directives support.
17741 * src/options.c: No longer handle source directives.
17743 * src/parse-gram.y: Fix %output.
17745 * src/parse-gram.y: Handle %union.
17746 Use the prologue locations.
17747 * src/reader.c (parse_union_decl): Remove.
17749 * src/reader.h, src/reader.c (epilogue_set): New.
17750 * src/parse-gram.y: Use it.
17752 * data/bison.simple, data/bison.c++: b4_stype is now either not
17753 defined, then default to int, or to the contents of %union,
17754 without `union' itself.
17756 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
17758 * src/output.c (actions_output): Don't output braces, as they are
17759 already handled by the scanner.
17761 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
17762 characters to themselves.
17764 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
17765 that the epilogue has a proper #line.
17767 * src/parse-gram.y: Handle precedence/associativity.
17769 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
17771 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
17772 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
17773 at all to define terminals that cannot be emitted.
17775 * src/scan-gram.l: Escape M4 characters.
17777 * src/scan-gram.l: Working properly with escapes in user
17778 strings/characters.
17780 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
17781 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
17783 Use more modest sizes, as for the time being the parser does not
17784 release memory, and therefore the process swallows a huge amount
17787 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
17788 stricter %token grammar.
17790 * src/symtab.h (associativity): Add `undef_assoc'.
17791 (symbol_precedence_set): Do nothing when passed an undef_assoc.
17792 * src/symtab.c (symbol_check_alias_consistence): Adjust.
17794 * tests/regression.at (Invalid %directive): Remove, as it is now
17796 (Invalid inputs): Adjust to the new error messages.
17797 (Token definitions): The new grammar doesn't allow too many
17800 * src/lex.h, src/lex.c: Remove.
17801 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
17802 (copy_character, copy_string2, copy_string, copy_identifier)
17803 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
17804 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
17805 (parse_action): Remove.
17806 * po/POTFILES.in: Adjust.
17808 2002-06-11 Akim Demaille <akim@epita.fr>
17810 * src/reader.c (parse_action): Don't store directly into the
17811 rule's action member: return the action as a string.
17812 Don't require `rule_length' as an argument: compute it.
17813 (grammar_current_rule_symbol_append)
17814 (grammar_current_rule_action_append): New, eved out from
17816 Remove `action_flag', `rulelength', unused now.
17818 2002-06-11 Akim Demaille <akim@epita.fr>
17820 * src/reader.c (grammar_current_rule_prec_set).
17821 (grammar_current_rule_check): New, eved out from...
17823 Remove `xaction', `first_rhs': useless.
17824 * tests/input.at (Type clashes): New.
17825 * tests/existing.at (GNU Cim Grammar): Adjust.
17827 2002-06-11 Akim Demaille <akim@epita.fr>
17829 * src/reader.c (grammar_midrule_action): New, Eved out from
17832 2002-06-11 Akim Demaille <akim@epita.fr>
17834 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
17836 (readgram): Use them as replacement of inlined code, crule and
17839 2002-06-11 Akim Demaille <akim@epita.fr>
17841 * src/reader.c (grammar_end, grammar_symbol_append): New.
17842 (readgram): Use them.
17843 Make the use of `p' as local as possible.
17845 2002-06-10 Akim Demaille <akim@epita.fr>
17847 GCJ's parser requires the tokens to be defined before the prologue.
17849 * data/bison.simple: Output the token definition before the user's
17851 * tests/regression.at (Braces parsing, Duplicate string)
17852 (Mixing %token styles): Check the output from bison.
17853 (Early token definitions): New.
17855 2002-06-10 Akim Demaille <akim@epita.fr>
17857 * src/symtab.c (symbol_user_token_number_set): Don't complain when
17858 assigning twice the same user number to a token, so that we can
17860 * src/lex.c (lex): here.
17861 Also use `symbol_class_set' instead of hand written code.
17862 * src/reader.c (parse_assoc_decl): Likewise.
17864 2002-06-10 Akim Demaille <akim@epita.fr>
17866 * src/symtab.c, src/symtab.c (symbol_class_set)
17867 (symbol_user_token_number_set): New.
17868 * src/reader.c (parse_token_decl): Use them.
17869 Use a switch instead of ifs.
17870 Use a single argument.
17872 2002-06-10 Akim Demaille <akim@epita.fr>
17874 Remove `%thong' support as it is undocumented, unused, duplicates
17875 `%token's job, and creates useless e-mail traffic with people who
17876 want to know what it is, why it is undocumented, unused, and
17877 duplicates `%token's job.
17879 * src/reader.c (parse_thong_decl): Remove.
17880 * src/options.c (option_table): Remove "thong".
17881 * src/lex.h (tok_thong): Remove.
17883 2002-06-10 Akim Demaille <akim@epita.fr>
17885 * src/symtab.c, src/symtab.c (symbol_type_set)
17886 (symbol_precedence_set): New.
17887 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
17888 (value_components_used): Remove, unused.
17890 2002-06-09 Akim Demaille <akim@epita.fr>
17892 Move symbols handling code out of the reader.
17894 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
17895 (axiom): Move to...
17896 * src/symtab.h, src/symtab.c: here.
17898 * src/gram.c (start_symbol): Remove: use startsymbol->number.
17899 * src/reader.c (startval): Rename as...
17900 * src/symtab.h, src/symtab.c (startsymbol): this.
17901 * src/reader.c: Adjust.
17903 * src/reader.c (symbol_check_defined, symbol_make_alias)
17904 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17905 (token_translations_init)
17907 * src/symtab.c: here.
17908 * src/reader.c (packsymbols): Move to...
17909 * src/symtab.h, src/symtab.c (symbols_pack): here.
17910 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
17913 2002-06-03 Akim Demaille <akim@epita.fr>
17915 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
17918 2002-06-03 Akim Demaille <akim@epita.fr>
17920 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
17921 structs with non literals.
17922 * src/scan-skel.l: never-interactive.
17923 * src/conflicts.c (enum conflict_resolution_e): No trailing
17925 * src/getargs.c (usage): Split long literal strings.
17926 Reported by Hans Aberg.
17928 2002-05-28 Akim Demaille <akim@epita.fr>
17930 * data/bison.c++: Use C++ ostreams.
17931 (cdebug_): New member.
17933 2002-05-28 Akim Demaille <akim@epita.fr>
17935 * src/output.c (output_skeleton): Be sure to allocate enough room
17936 for `/' _and_ for `\0' in full_skeleton.
17938 2002-05-28 Akim Demaille <akim@epita.fr>
17940 * data/bison.c++: Catch up with bison.simple:
17941 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17942 and Paul Eggert <eggert@twinsun.com>: `error' handing.
17943 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
17944 and popping traces.
17946 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17948 * src/output.c (output_skeleton): Put an explicit path in front of
17949 the skeleton file name, rather than relying on the -I directory,
17950 to partially alleviate effects of having a skeleton file lying around
17951 in the current directory.
17953 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17955 * src/conflicts.c (log_resolution): Correct typo:
17956 obstack_printf should be obstack_fgrow1.
17958 2002-05-26 Akim Demaille <akim@epita.fr>
17960 * src/state.h (state_t): `solved_conflicts' is a new member.
17961 * src/LR0.c (new_state): Set it to 0.
17962 * src/conflicts.h, src/conflicts.c (print_conflicts)
17963 (free_conflicts, solve_conflicts): Rename as...
17964 (conflicts_print, conflicts_free, conflicts_solve): these.
17966 * src/conflicts.c (enum conflict_resolution_e)
17967 (solved_conflicts_obstack): New, used by...
17968 (log_resolution): this.
17969 Adjust to attach the conflict resolution to each state.
17970 Complete the description with the precedence/associativity
17972 (resolve_sr_conflict): Adjust.
17973 * src/print.c (print_state): Output its solved_conflicts.
17974 * tests/conflicts.at (Unresolved SR Conflicts)
17975 (Solved SR Conflicts): Exercise --report=all.
17977 2002-05-26 Akim Demaille <akim@epita.fr>
17979 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17980 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
17981 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
17982 (token_number_t, item_number_as_token_number)
17983 (token_number_as_item_number, muscle_insert_token_number_table):
17985 (symbol_number_t, item_number_as_symbol_number)
17986 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
17987 these, since it is more appropriate.
17989 2002-05-26 Akim Demaille <akim@epita.fr>
17991 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
17993 * data/bison.simple (yystos) [YYDEBUG]: New.
17994 (yyparse) [YYDEBUG]: Display the symbols which are popped during
17996 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
17998 2002-05-25 Akim Demaille <akim@epita.fr>
18000 * doc/bison.texinfo (Debugging): Split into...
18001 (Tracing): this new section, its former contents, and...
18002 (Understanding): this new section.
18003 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
18005 (report_flag): this.
18006 Adjust all dependencies.
18007 (report_args, report_types, report_argmatch): New.
18008 (usage, getargs): Report/support -r, --report.
18010 (struct option_table_struct): Rename as..,
18011 (struct option_table_s): this.
18012 Rename the `set_flag' member to `flag' to match with getopt_long's
18014 * src/options.c (option_table): Split verbose into an entry for
18015 %verbose, and another for --verbose.
18016 Support --report/-r, so remove -r from the obsolete --raw.
18017 * src/print.c: Attach full item sets and lookaheads reports to
18018 report_flag instead of trace_flag.
18019 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
18021 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18022 and Paul Eggert <eggert@twinsun.com>
18024 * data/bison.simple (yyparse): Correct error handling to conform to
18025 POSIX and yacc. Specifically, after syntax error is discovered,
18026 do not reduce further before shifting the error token.
18027 Clean up the code a bit by removing the labels yyerrdefault,
18028 yyerrhandle, yyerrpop.
18029 * NEWS: Document the above.
18031 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18033 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
18034 type; it isn't always big enough, since it doesn't necessarily
18035 include non-terminals.
18036 (yytranslate): Expand definition of yy_token_number_type, so that
18037 the latter can be removed.
18038 (yy_token_number_type): Remove, only one use.
18039 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
18040 don't use TokenNumberType as element type.
18042 * tests/regression.at: Modify expected output to agree with change
18043 to yyr1 and yytranslate.
18045 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
18047 * src/reader.c (parse_action): Use copy_character instead of
18050 2002-05-13 Akim Demaille <akim@epita.fr>
18052 * tests/regression.at (Token definitions): Prototype yylex and
18055 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18057 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
18058 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
18060 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
18062 2002-05-07 Akim Demaille <akim@epita.fr>
18064 * tests/synclines.at: Be sure to prototype yylex and yyerror to
18065 avoid GCC warnings.
18067 2002-05-07 Akim Demaille <akim@epita.fr>
18071 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
18072 over the RHS of each rule.
18073 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
18074 * src/state.h (state_t): Member `nitems' is unsigned short.
18075 * src/LR0.c (get_state): Adjust.
18076 * src/reader.c (packgram): Likewise.
18077 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
18079 (muscle_insert_int_table): Remove, unused.
18080 (prepare_rules): Remove `max'.
18082 2002-05-06 Akim Demaille <akim@epita.fr>
18084 * src/closure.c (print_firsts): Display of the symbol tags.
18085 (bitmatrix_print): Move to...
18086 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
18088 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
18090 2002-05-06 Akim Demaille <akim@epita.fr>
18092 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
18095 2002-05-06 Akim Demaille <akim@epita.fr>
18097 * src/LR0.c (new_state, get_state): Instead of using the global
18098 `kernel_size' and `kernel_base', have two new arguments:
18099 `core_size' and `core'.
18102 2002-05-06 Akim Demaille <akim@epita.fr>
18104 * src/reader.c (packgram): No longer end `ritem' with a 0
18105 sentinel: it is not used.
18107 2002-05-05 Akim Demaille <akim@epita.fr>
18109 New experimental feature: display the lookaheads in the report and
18112 * src/print (print_core): When --trace-flag, display the rules
18114 * src/print_graph.c (print_core): Likewise.
18115 Swap the arguments.
18118 2002-05-05 Akim Demaille <akim@epita.fr>
18120 * tests/torture.at (Many lookaheads): New test.
18122 2002-05-05 Akim Demaille <akim@epita.fr>
18124 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
18125 (GENERATE_MUSCLE_INSERT_TABLE): this.
18126 (output_int_table, output_unsigned_int_table, output_short_table)
18127 (output_token_number_table, output_item_number_table): Replace with...
18128 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
18129 (muscle_insert_short_table, muscle_insert_token_number_table)
18130 (muscle_insert_item_number_table): these.
18131 Adjust all callers.
18132 (prepare_tokens): Don't free `translations', since...
18133 * src/reader.h, src/reader.c (grammar_free): do it.
18135 * src/gram.h, src/gram.c (grammar_free): here.
18136 * data/bison.simple, data/bison.c++: b4_token_number_max is now
18139 2002-05-05 Akim Demaille <akim@epita.fr>
18141 * src/output.c (output_unsigned_int_table): New.
18142 (prepare_rules): `i' is unsigned.
18143 `prhs', `rline', `r2' are unsigned int.
18144 Rename muscle `rhs_number_max' as `rhs_max'.
18145 Output muscles `prhs_max', `rline_max', and `r2_max'.
18147 * data/bison.simple, data/bison.c++: Adjust to use these muscles
18148 to compute types instead of constant types.
18149 * tests/regression.at (Web2c Actions): Adjust.
18151 2002-05-04 Akim Demaille <akim@epita.fr>
18153 * src/symtab.h (SALIAS, SUNDEF): Rename as...
18154 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
18155 Adjust dependencies.
18156 * src/output.c (token_definitions_output): Be sure not to output a
18157 `#define 'a'' when fed with `%token 'a' "a"'.
18158 * tests/regression.at (Token definitions): New.
18160 2002-05-03 Paul Eggert <eggert@twinsun.com>
18162 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
18165 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
18167 * Makefile.am (SUBDIRS): Remove intl.
18168 (EXTRA_DIST): Add config/config.rpath.
18170 2002-05-03 Akim Demaille <akim@epita.fr>
18172 * data/bison.simple (m4_if): Don't output empty enums.
18173 And actually, output valid enum definitions :(.
18175 2002-05-03 Akim Demaille <akim@epita.fr>
18177 * configure.bat: Remove, completely obsolete.
18178 * Makefile.am (EXTRA_DIST): Adjust.
18179 Don't distribute config.rpath...
18180 * config/Makefile.am (EXTRA_DIST): Do it.
18182 2002-05-03 Akim Demaille <akim@epita.fr>
18184 * configure.in (GETTEXT_VERSION): New.
18185 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
18187 2002-05-03 Akim Demaille <akim@epita.fr>
18189 * data/bison.simple (b4_token_enum): New.
18190 (b4_token_defines): Use it to output tokens both as #define and
18192 Suggested by Paul Eggert.
18193 * src/output.c (token_definitions_output): Don't output spurious
18196 2002-05-03 Akim Demaille <akim@epita.fr>
18198 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
18200 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
18202 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
18203 Update the stack class, give a try to deque as the default container.
18205 2002-05-02 Akim Demaille <akim@epita.fr>
18207 * data/bison.simple (yyparse): Do not implement @$ = @1.
18208 (YYLLOC_DEFAULT): Adjust to do it.
18209 * doc/bison.texinfo (Location Default Action): Fix.
18211 2002-05-02 Akim Demaille <akim@epita.fr>
18213 * src/reader.c (parse_braces): Merge into...
18214 (parse_action): this.
18216 2002-05-02 Akim Demaille <akim@epita.fr>
18218 * configure.in (ALL_LINGUAS): Remove.
18219 * po/LINGUAS, hr.po: New.
18221 2002-05-02 Akim Demaille <akim@epita.fr>
18223 Remove the so called hairy (semantic) parsers.
18225 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
18226 * src/gram.h, src/gram.c (semantic_parser): Remove.
18227 (rule_t): Remove the guard and guard_line members.
18228 * src/lex.h (token_t): remove tok_guard.
18229 * src/options.c (option_table): Remove %guard and %semantic_parser
18231 * src/output.c, src/output.h (guards_output): Remove.
18233 (token_definitions_output): Don't output the `T'
18235 (output_skeleton): Don't output the guards.
18236 * src/files.c, src/files.c (attrsfile): Remove.
18237 * src/reader.c (symbol_list): Remove the guard and guard_line
18239 Adjust dependencies.
18240 (parse_guard): Remove.
18241 * data/bison.hairy: Remove.
18242 * doc/bison.texinfo (Environment Variables): Remove occurrences of
18245 2002-05-02 Akim Demaille <akim@epita.fr>
18247 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
18248 (parse_guard): Rename the formal argument `stack_offset' as
18249 `rule_length', which is more readable.
18251 (copy_at, copy_dollar): Instead of outputting the hard coded
18252 values of $$, $n and so forth, output invocation to b4_lhs_value,
18253 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
18254 Note: this patch partially drops `semantic-parser' support: it
18255 always does `rule_length - n', where semantic parsers ought to
18257 * data/bison.simple, data/bison.c++ (b4_lhs_value)
18258 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
18260 2002-05-02 Akim Demaille <akim@epita.fr>
18262 * configure.in (AC_INIT): Bump to 1.49b.
18263 (AM_INIT_AUTOMAKE): Short invocation.
18265 2002-05-02 Akim Demaille <akim@epita.fr>
18269 2002-05-01 Akim Demaille <akim@epita.fr>
18271 * src/skeleton.h: Remove.
18273 2002-05-01 Akim Demaille <akim@epita.fr>
18275 * src/skeleton.h: Fix the #endif.
18276 Reported by Magnus Fromreide.
18278 2002-04-26 Paul Eggert <eggert@twinsun.com>
18280 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
18281 Define if we define YYSTYPE and YYLTYPE, respectively.
18282 (YYCOPY): Fix [] quoting problem in the non-GCC case.
18284 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
18286 * src/scan-skel.l: Postprocess quadrigraphs.
18288 * src/reader.c (copy_character): New function, used to output
18289 single characters while replacing `[' and `]' with quadrigraphs, to
18290 avoid troubles with M4 quotes.
18291 (copy_comment): Output characters with copy_character.
18292 (read_additionnal_code): Likewise.
18293 (copy_string2): Likewise.
18294 (copy_definition): Likewise.
18296 * tests/calc.at: Exercise M4 quoting.
18298 2002-04-25 Akim Demaille <akim@epita.fr>
18300 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
18301 between `!' and the command.
18302 Reported by Paul Eggert.
18304 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
18306 * tests/calc.at: Exercise prologue splitting.
18308 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
18309 `b4_post_prologue' instead of `b4_prologue'.
18311 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
18313 (output): Free pre_prologue_obstack and post_prologue_obstack.
18314 * src/files.h, src/files.c (attrs_obstack): Remove.
18315 (pre_prologue_obstack, post_prologue_obstack): New.
18316 * src/reader.c (copy_definition): Add a parameter to specify the
18317 obstack to fill, instead of using attrs_obstack unconditionally.
18318 (read_declarations): Pass pre_prologue_obstack to copy_definition if
18319 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
18321 2002-04-23 Paul Eggert <eggert@twinsun.com>
18323 * data/bison.simple: Remove unnecessary commentary and white
18324 space differences from 1_29-branch.
18325 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
18327 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
18328 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
18329 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
18330 constructors or destructors.
18332 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
18334 2002-04-23 Akim Demaille <akim@epita.fr>
18336 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
18337 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
18338 location with columns.
18339 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
18340 All reported by Paul Eggert.
18342 2002-04-22 Akim Demaille <akim@epita.fr>
18344 * src/reduce.c (dump_grammar): Move to...
18345 * src/gram.h, src/gram.c (grammar_dump): here.
18346 Be sure to separate long item numbers.
18347 Don't read the members of a rule's prec if its nil.
18349 2002-04-22 Akim Demaille <akim@epita.fr>
18351 * src/output.c (table_size, table_grow): New.
18352 (MAXTABLE): Remove, replace uses with table_size.
18353 (pack_vector): Instead of dying when the table is too big, grow it.
18355 2002-04-22 Akim Demaille <akim@epita.fr>
18357 * data/bison.simple (yyr1): Its type is that of a token number.
18358 * data/bison.c++ (r1_): Likewise.
18359 * tests/regression.at (Web2c Actions): Adjust.
18361 2002-04-22 Akim Demaille <akim@epita.fr>
18363 * src/reader.c (token_translations_init): 256 is now the default
18364 value for the error token, i.e., it will be assigned another
18365 number if the user assigned 256 to one of her tokens.
18366 (reader): Don't force 256 to error.
18367 * doc/bison.texinfo (Symbols): Adjust.
18368 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
18369 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
18370 etc. instead of 10, 20, 30 (which was used to `jump' over error
18371 (256) and undefined (2)).
18373 2002-04-22 Akim Demaille <akim@epita.fr>
18375 Propagate more token_number_t.
18377 * src/gram.h (token_number_as_item_number)
18378 (item_number_as_token_number): New.
18379 * src/output.c (GENERATE_OUTPUT_TABLE): New.
18380 Use it to create output_item_number_table and
18381 output_token_number_table.
18382 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
18383 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
18384 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
18385 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
18387 2002-04-22 Akim Demaille <akim@epita.fr>
18389 * src/output.h, src/output.c (get_lines_number): Remove.
18391 2002-04-19 Akim Demaille <akim@epita.fr>
18393 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
18395 (Debugging): More details about enabling the debugging features.
18396 (Table of Symbols): Describe $$, $n, @$, and @n.
18397 Suggested by Tim Josling.
18399 2002-04-19 Akim Demaille <akim@epita.fr>
18401 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
18403 2002-04-10 Akim Demaille <akim@epita.fr>
18405 * src/system.h: Rely on HAVE_LIMITS_H.
18406 Suggested by Paul Eggert.
18408 2002-04-09 Akim Demaille <akim@epita.fr>
18410 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
18411 full stderr, and strip it according to the bison options, instead
18412 of composing the error message from different bits.
18413 This makes it easier to check for several error messages.
18414 Adjust all the invocations.
18415 Add an invocation exercising the error token.
18416 Add an invocation demonstrating a stupid error message.
18417 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
18419 Error message are for stderr, not stdout.
18421 2002-04-09 Akim Demaille <akim@epita.fr>
18423 * src/gram.h, src/gram.c (error_token_number): Remove, use
18425 * src/reader.c (reader): Don't specify the user token number (2)
18426 for $undefined, as it uselessly prevents using it.
18427 * src/gram.h (token_number_t): Move to...
18428 * src/symtab.h: here.
18429 (state_t.number): Is a token_number_t.
18430 * src/print.c, src/reader.c: Use undeftoken->number instead of
18432 (Even though this 2 is not the same as above: the number of the
18433 undeftoken remains being 2, it is its user token number which
18435 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
18436 `user_token_number_max'.
18437 Output `undef_token_number'.
18438 * data/bison.simple, data/bison.c++: Use them.
18439 Be sure to map invalid yylex return values to
18440 `undef_token_number'. This saves us from gratuitous SEGV.
18442 * tests/conflicts.at (Solved SR Conflicts)
18443 (Unresolved SR Conflicts): Adjust.
18444 * tests/regression.at (Web2c Actions): Adjust.
18446 2002-04-08 Akim Demaille <akim@epita.fr>
18448 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
18450 Remove the duplicate `typedefs'.
18451 (RhsNumberType): Fix the declaration and various other typos.
18453 * data/bison.simple: Use __ofile__.
18454 * src/scan-skel.l: Handle __ofile__.
18456 2002-04-08 Akim Demaille <akim@epita.fr>
18458 * src/gram.h (item_number_t): New, the type of item numbers in
18459 RITEM. Note that it must be able to code symbol numbers as
18460 positive number, and the negation of rule numbers as negative
18462 Adjust all dependencies (pretty many).
18463 * src/reduce.c (rule): Remove this `short *' pointer: use
18465 * src/system.h (MINSHORT, MAXSHORT): Remove.
18466 Include `limits.h'.
18467 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
18468 (shortcpy): Remove.
18469 (MAXTABLE): Move to...
18470 * src/output.c (MAXTABLE): here.
18471 (prepare_rules): Use output_int_table to output rhs.
18472 * data/bison.simple, data/bison.c++: Adjust.
18473 * tests/torture.at (Big triangle): Move the limit from 254 to
18475 * tests/regression.at (Web2c Actions): Ajust.
18477 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
18478 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
18479 passes, but produces negative #line number, once fixed, GCC is
18480 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
18482 * src/state.h (state_h): Code input lines on ints, not shorts.
18484 2002-04-08 Akim Demaille <akim@epita.fr>
18486 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
18487 and then the grammar.
18489 2002-04-08 Akim Demaille <akim@epita.fr>
18491 * src/system.h: No longer using strndup.
18493 2002-04-07 Akim Demaille <akim@epita.fr>
18495 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
18496 * src/output.c (output_table_data): Return the longest number.
18497 (prepare_tokens): Output `token_number_max').
18498 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
18500 Use them to define yy_token_number_type/TokenNumberType.
18501 Use this type for yytranslate.
18502 * tests/torture.at (Big triangle): Push the limit from 124 to
18504 * tests/regression.at (Web2c Actions): Adjust.
18506 2002-04-07 Akim Demaille <akim@epita.fr>
18508 * tests/torture.at (Big triangle): New.
18509 (GNU AWK Grammar, GNU Cim Grammar): Move to...
18510 * tests/existing.at: here.
18512 2002-04-07 Akim Demaille <akim@epita.fr>
18514 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
18516 Adjust dependencies.
18518 2002-04-07 Akim Demaille <akim@epita.fr>
18520 * src/reader.c: Normalize increments to prefix form.
18522 2002-04-07 Akim Demaille <akim@epita.fr>
18524 * src/reader.c, symtab.c: Remove debugging code.
18526 2002-04-07 Akim Demaille <akim@epita.fr>
18528 Rename all the `bucket's as `symbol_t'.
18530 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
18531 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
18532 * src/symtab.c, src/symtab.h (bucket): Rename as...
18534 (symbol_list_new, bucket_check_defined, bucket_make_alias)
18535 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
18536 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
18537 (buckets_new, buckets_free, buckets_do): Rename as...
18538 (symbol_list_new, symbol_check_defined, symbol_make_alias)
18539 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
18540 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
18541 (symbols_new, symbols_free, symbols_do): these.
18543 2002-04-07 Akim Demaille <akim@epita.fr>
18545 Use lib/hash for the symbol table.
18547 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
18549 * src/lex.c (lex): Set the `number' member of new terminals.
18550 * src/reader.c (bucket_check_defined, bucket_make_alias)
18551 (bucket_check_alias_consistence, bucket_translation): New.
18552 (reader, grammar_free, readgram, token_translations_init)
18553 (packsymbols): Adjust.
18554 (reader): Number the predefined tokens.
18555 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
18556 for predefined tokens.
18557 * src/symtab.h (bucket): Remove all the hash table related
18559 * src/symtab.c (symtab): Replace by...
18560 (bucket_table): this.
18561 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
18562 (buckets_new, buckets_do): New.
18564 2002-04-07 Akim Demaille <akim@epita.fr>
18566 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
18567 (start_symbol, max_user_token_number, semantic_parser)
18568 (error_token_number): Initialize.
18569 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
18572 (errtoken, eoftoken, undeftoken, axiom): Extern.
18574 2002-04-07 Akim Demaille <akim@epita.fr>
18576 * src/gram.h (rule_s): prec and precsym are now pointers
18577 to the bucket giving the priority/associativity.
18578 Member `associativity' removed: useless.
18579 * src/reduce.c, src/conflicts.c: Adjust.
18581 2002-04-07 Akim Demaille <akim@epita.fr>
18583 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
18584 Properly escape the symbols' TAG when outputting them.
18586 2002-04-07 Akim Demaille <akim@epita.fr>
18588 * src/lalr.h (LA): Is a bitsetv, not bitset*.
18590 2002-04-07 Akim Demaille <akim@epita.fr>
18592 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
18593 (LArule): this, which is an array to rule_t*.
18594 * src/print.c, src/conflicts.c: Adjust.
18596 2002-04-07 Akim Demaille <akim@epita.fr>
18598 * src/gram.h (rule_t): Rename `number' as `user_number'.
18599 `number' is a new member.
18600 Adjust dependencies.
18601 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
18603 2002-04-07 Akim Demaille <akim@epita.fr>
18605 As a result of the previous patch, it is no longer needed
18606 to reorder ritem itself.
18608 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
18610 2002-04-07 Akim Demaille <akim@epita.fr>
18612 Be sure never to walk through RITEMS, but use only data related to
18613 the rules themselves. RITEMS should be banished.
18615 * src/output.c (output_token_translations): Rename as...
18616 (prepare_tokens): this.
18617 In addition to `translate', prepare the muscles `tname' and
18618 `toknum', which were handled by...
18619 (output_rule_data): this.
18620 Remove, and move the remainder of its outputs into...
18621 (prepare_rules): this new routines, which also merges content from
18622 (output_gram): this.
18623 (prepare_rules): Be sure never to walk through RITEMS.
18624 (output_stos): Rename as...
18625 (prepare_stos): this.
18626 (output): Always invoke prepare_states, after all, just don't use it
18627 in the output if you don't need it.
18629 2002-04-07 Akim Demaille <akim@epita.fr>
18631 * src/LR0.c (new_state): Display `nstates' as the name of the
18632 newly created state.
18633 Adjust to initialize first_state and last_state if needed.
18634 Be sure to distinguish the initial from the final state.
18635 (new_states): Create the itemset of the initial state, and use
18637 * src/closure.c (closure): Now that the initial state has its
18638 items properly set, there is no need for a special case when
18639 creating `ruleset'.
18641 As a result, now the rule 0, reducing to $axiom, is visible in the
18642 outputs. Adjust the test suite.
18644 * tests/conflicts.at (Solved SR Conflicts)
18645 (Unresolved SR Conflicts): Adjust.
18646 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
18647 * tests/conflicts.at (S/R in initial): New.
18649 2002-04-07 Akim Demaille <akim@epita.fr>
18651 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
18652 the RHS of the rules.
18653 * src/output.c (output_gram): Likewise.
18655 2002-04-07 Akim Demaille <akim@epita.fr>
18657 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
18659 Adjust all dependencies.
18660 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
18661 `number' of the buckets too.
18662 * src/gram.h: Include `symtab.h'.
18663 (associativity): Move to...
18664 * src/symtab.h: here.
18665 No longer include `gram.h'.
18667 2002-04-07 Akim Demaille <akim@epita.fr>
18669 * src/gram.h, src/gram.c (rules_rhs_length): New.
18670 (ritem_longest_rhs): Use it.
18671 * src/gram.h (rule_t): `number' is a new member.
18672 * src/reader.c (packgram): Set it.
18673 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
18674 the end of `rules', and count them out of `nrules'.
18675 (reduce_output, dump_grammar): Adjust.
18676 * src/print.c (print_grammar): It is no longer needed to check for
18677 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
18678 * tests/reduce.at (Reduced Automaton): New test.
18680 2002-04-07 Akim Demaille <akim@epita.fr>
18682 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
18683 lacking `+ 1' to nrules, Bison reported as useless a token if it
18684 was used solely to set the precedence of the last rule...
18686 2002-04-07 Akim Demaille <akim@epita.fr>
18688 * data/bison.c++, data/bison.simple: Don't output the current file
18689 name in #line, to avoid useless diffs between two identical
18690 outputs under different names.
18692 2002-04-07 Akim Demaille <akim@epita.fr>
18694 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
18695 Normalize loops to using `< nrules + 1', not `<= nrules'.
18697 2002-04-07 Akim Demaille <akim@epita.fr>
18701 2002-04-07 Akim Demaille <akim@epita.fr>
18703 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
18704 bucket.value as bucket.number.
18706 2002-04-07 Akim Demaille <akim@epita.fr>
18708 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
18709 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
18710 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
18711 RHS, instead of being an index in RITEMS.
18713 2002-04-04 Paul Eggert <eggert@twinsun.com>
18715 * doc/bison.texinfo: Update copyright date.
18716 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
18717 (Symbols): Warn about running Bison in one character set,
18718 but compiling and/or running in an incompatible one.
18719 Warn about character code 256, too.
18721 2002-04-03 Paul Eggert <eggert@twinsun.com>
18723 * src/bison.data (YYSTACK_ALLOC): Depend on whether
18724 YYERROR_VERBOSE is nonzero, not whether it is defined.
18726 Merge changes from bison-1_29-branch.
18728 2002-03-20 Paul Eggert <eggert@twinsun.com>
18730 Merge fixes from Debian bison_1.34-1.diff.
18732 * configure.in (AC_PREREQ): 2.53.
18734 2002-03-20 Akim Demaille <akim@epita.fr>
18736 * src/conflicts.c (log_resolution): Argument `resolution' is const.
18738 2002-03-19 Paul Eggert <eggert@twinsun.com>
18740 * src/bison.simple (YYCOPY): New macro.
18741 (YYSTACK_RELOCATE): Use it.
18742 Remove Type arg; no longer needed. All callers changed.
18743 (yymemcpy): Remove; no longer needed.
18745 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
18746 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
18748 2002-03-19 Akim Demaille <akim@epita.fr>
18750 Test and fix the #line outputs.
18752 * tests/atlocal.at (GCC): New.
18753 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
18754 (Prologue synch line, %union synch line, Postprologue synch line)
18755 (Action synch line, Epilogue synch line): New tests.
18756 * src/reader.c (parse_union_decl): Define the muscle stype_line.
18757 * data/bison.simple, data/bison.c++: Use it.
18759 2002-03-19 Akim Demaille <akim@epita.fr>
18761 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
18762 (Solved SR Conflicts, %expect not enough, %expect right)
18763 (%expect too much): Move to...
18764 * tests/conflicts.at: this new file.
18766 2002-03-19 Akim Demaille <akim@epita.fr>
18768 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
18769 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
18770 that we can move to enums for instance.
18771 * src/output.c (token_definitions_output): Output a list of
18772 `token-name, token-number' instead of the #define.
18773 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
18775 2002-03-14 Akim Demaille <akim@epita.fr>
18777 Use Gettext 0.11.1.
18779 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
18781 * data/bison.c++: Make the user able to add members to the generated
18782 parser by subclassing.
18784 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
18786 * src/reader.c (read_additionnal_code): `c' should be an integer, not
18788 Reported by Nicolas Tisserand and Nicolas Burrus.
18790 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
18792 * src/reader.c: Warn about lacking semi-colons, do not complain.
18794 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
18796 * data/bison.c++: Remove a debug line.
18798 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
18800 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
18801 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
18802 provide a default implementation.
18804 2002-03-04 Akim Demaille <akim@epita.fr>
18806 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
18807 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
18808 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
18809 * tests/semantic.at (Parsing Guards): Similarly.
18810 * src/reader.at (readgram): Complain if the last rule is not ended
18813 2002-03-04 Akim Demaille <akim@epita.fr>
18815 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
18816 * src/closure.c: here.
18817 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
18819 * src/warshall.h, src/warshall.c: Remove.
18820 * tests/sets.at (Broken Closure): Adjust.
18822 2002-03-04 Akim Demaille <akim@epita.fr>
18824 * src/output.c (output_skeleton): tempdir is const.
18825 bytes_read is unused.
18827 2002-03-04 Akim Demaille <akim@epita.fr>
18829 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18830 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
18832 From Michael Hayes.
18834 2002-03-04 Akim Demaille <akim@epita.fr>
18836 * src/closure.c (closure): `r' is unused.
18838 2002-03-04 Akim Demaille <akim@epita.fr>
18840 * tests/sets.at (Broken Closure): Add the ending `;'.
18841 * src/reader.at (readgram): Complain if a rule is not ended with a
18844 2002-03-04 Akim Demaille <akim@epita.fr>
18846 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
18847 (count_sr_conflicts): Use bitset_count.
18848 * src/reduce.c (inaccessable_symbols): Ditto.
18849 (bits_size): Remove.
18850 * src/warshall.h, src/warshall.c: Convert to bitsetv.
18852 2002-03-04 Akim Demaille <akim@epita.fr>
18854 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
18855 * src/reduce.c: Remove the `bitset_zero's following the
18856 `bitset_create's, as now it is performed by the latter.
18858 2002-03-04 Akim Demaille <akim@epita.fr>
18860 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
18861 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
18862 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
18863 latest sources from Michael.
18865 2002-03-04 Akim Demaille <akim@epita.fr>
18867 * src/output.c (output): Don't free the grammar.
18868 * src/reader.c (grammar_free): New.
18869 * src/main.c (main): Call it and don't free symtab here.
18871 2002-03-04 Akim Demaille <akim@epita.fr>
18873 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
18875 Reported by Benoit Perrot.
18877 2002-03-04 Akim Demaille <akim@epita.fr>
18879 Use bitset operations when possible, not loops over bits.
18881 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
18883 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
18884 * src/reduce.c (useless_nonterminals): Formatting changes.
18885 * src/warshall.c (TC): Use bitset_or.
18887 2002-03-04 Akim Demaille <akim@epita.fr>
18889 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
18890 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
18893 2002-03-04 Akim Demaille <akim@epita.fr>
18895 * src/lalr.c (F): Now a bitset*.
18896 Adjust all dependencies.
18898 2002-03-04 Akim Demaille <akim@epita.fr>
18900 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
18901 Adjust all dependencies.
18903 2002-03-04 Akim Demaille <akim@epita.fr>
18905 * src/L0.c, src/LR0.h (nstates): Be size_t.
18906 Adjust comparisons (signed vs unsigned).
18907 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
18909 Adjust all dependencies.
18911 2002-03-04 Akim Demaille <akim@epita.fr>
18913 * src/closure.c (firsts): Now, also a bitset.
18914 Adjust all dependencies.
18915 (varsetsize): Remove, now unused.
18916 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
18918 2002-03-04 Akim Demaille <akim@epita.fr>
18920 * src/print.c: Convert to use bitset.h, not hand coded iterations
18923 2002-03-04 Akim Demaille <akim@epita.fr>
18925 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
18927 2002-03-04 Akim Demaille <akim@epita.fr>
18929 * src/closure.c (ruleset): Be a bitset.
18930 (rulesetsize): Remove.
18932 2002-03-04 Akim Demaille <akim@epita.fr>
18934 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18935 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
18936 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
18937 * src/closure.c (fderives): Be an array of bitsets.
18939 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
18941 * data/bison.c++: Merge the two generated headers. Insert a copyright
18942 notice in each output file.
18944 2002-02-28 Akim Demaille <akim@epita.fr>
18946 * data/bison.c++: Copy the prologue of bison.simple to fetch
18947 useful M4 definitions, such as b4_header_guard.
18949 2002-02-25 Akim Demaille <akim@epita.fr>
18951 * src/getargs.c (version): Give the name of the authors, and use a
18952 translator friendly scheme for the bgr
18955 2002-02-25 Akim Demaille <akim@epita.fr>
18957 * src/output.c (header_output): Remove, now handled completely via
18960 2002-02-25 Akim Demaille <akim@epita.fr>
18962 * m4/m4.m4: New, from CVS Autoconf.
18963 * configure.in: Invoke it.
18964 * src/output.c (output_skeleton): Use its result instead of the
18967 2002-02-25 Akim Demaille <akim@epita.fr>
18969 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
18971 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
18972 * src/output.c (output_skeleton): Use mkstemp to create a real
18974 Move the filling of `skeleton' and its muscle to...
18976 (output): Move the definition of the prologue muscle to...
18978 * src/system.h (DEFAULT_TMPDIR): New.
18980 2002-02-14 Paul Eggert <eggert@twinsun.com>
18982 Remove the support for C++ namespace cleanliness; it was
18983 causing more problems than it was curing, since it didn't work
18984 properly on some nonstandard C++ compilers. This can wait
18985 for a proper C++ parser.
18987 * NEWS: Document this.
18988 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
18989 of C++, as it's treated like C now.
18990 * src/bison.simple (YYSTD): Remove.
18991 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
18992 Treat C++ just like Standard C instead of trying to support
18993 namespace cleanliness.
18995 2002-02-14 Akim Demaille <akim@epita.fr>
18997 * tests/regression.at (else): Adjust to Andreas' change.
18999 2002-02-14 Akim Demaille <akim@epita.fr>
19001 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
19003 2002-02-13 Andreas Schwab <schwab@suse.de>
19005 * src/output.c (output_rule_data): Don't output NULL, it might
19006 not be defined yet.
19008 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
19010 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
19011 (Copyright notice): Update.
19013 2002-02-11 Akim Demaille <akim@epita.fr>
19015 * tests/regression.at (%nonassoc and eof): Don't include
19016 nonportable headers.
19018 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
19020 * data/bison.c++: Correct error recovery. Make the user able to
19021 initialize the starting location.
19023 2002-02-07 Akim Demaille <akim@epita.fr>
19025 * tests/input.at: New.
19027 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
19029 * data/bison.c++: Replace some direct m4 expansions by constants. Be
19030 more consistent when naming methods and variables. Put preprocessor
19031 directives around tables only needed for debugging.
19033 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
19035 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
19037 (yy::b4_name::parse): Use print_.
19039 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
19041 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
19043 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
19045 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
19047 (yy::b4_name::parse): Build verbose error messages, and use error_.
19049 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
19051 * data/bison.c++: Fix m4 quoting in comments.
19053 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
19055 * data/bison.c++: Adjust the parser code. Fix some muscles that were
19056 not expanded by m4.
19058 2002-02-05 Akim Demaille <akim@epita.fr>
19060 * data/bison.c++: Adjust to the M4 back end.
19061 More is certainly needed.
19063 2002-02-05 Akim Demaille <akim@epita.fr>
19065 Give a try to M4 as a back end.
19067 * lib/readpipe.c: New, from wdiff.
19068 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
19070 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
19071 specific values. Now it is m4 that performs the lookup.
19072 * src/parse-skel.y: Remove.
19073 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
19074 * src/output.c (actions_output, guards_output)
19075 (token_definitions_output): No longer keeps track of the output
19076 line number, hence remove the second argument.
19077 (guards_output): Check against the guard member of a rule, not the
19080 (output_skeleton): Don't look for the skeleton location, let m4 do
19082 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
19084 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
19085 (prepare): Given that for the time being changesyntax is not
19086 usable in M4, rename the muscles using `-' to `_'.
19087 Define `defines_flag', `output_parser_name' and `output_header_name'.
19088 * src/output.h (actions_output, guards_output)
19089 (token_definitions_output): Adjust prototypes.
19090 * src/scan-skel.l: Instead of scanning the skeletons, it now
19091 processes the output of m4: `__oline__' and `#output'.
19092 * data/bison.simple: Adjust to be used by M4(sugar).
19093 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
19095 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
19096 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
19097 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
19098 shamelessly stolen from CVS Autoconf.
19100 2002-02-05 Akim Demaille <akim@epita.fr>
19102 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
19103 * configure.in: Check for the declarations of free and malloc.
19104 * src/muscle_tab.c: Adjust.
19106 2002-02-05 Akim Demaille <akim@epita.fr>
19108 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
19109 which have no values.
19111 2002-02-05 Akim Demaille <akim@epita.fr>
19113 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
19116 2002-01-29 Paul Eggert <eggert@twinsun.com>
19118 * src/bison.simple (YYSIZE_T): Do not define merely because
19119 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
19120 On some platforms, <alloca.h> does not declare YYSTD (size_t).
19122 2002-01-27 Akim Demaille <akim@epita.fr>
19124 Fix `%nonassoc and eof'.
19126 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
19127 which were not properly copied! Replace
19128 memcpy (res->errs, src->errs, src->nerrs);
19130 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
19132 * tests/regression.at (%nonassoc and eof): Adjust to newest
19133 Autotest: `.' is not in the PATH.
19135 2002-01-27 Akim Demaille <akim@epita.fr>
19137 * tests/sets.at (AT_EXTRACT_SETS): New.
19138 (Nullable): Use it.
19141 2002-01-26 Akim Demaille <akim@epita.fr>
19143 * tests/actions.at, tests/calc.at, tests/headers.at,
19144 * tests/torture.at: Adjust to the newest Autotest which no longer
19145 forces `.' in the PATH.
19147 2002-01-25 Akim Demaille <akim@epita.fr>
19149 * tests/regression.at (%nonassoc and eof): New.
19150 Suggested by Robert Anisko.
19152 2002-01-24 Akim Demaille <akim@epita.fr>
19154 Bison dumps core when trying to complain about broken input files.
19155 Reported by Cris van Pelt.
19157 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
19158 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
19160 (Invalid inputs): Strengthen: exercise parse_percent_token.
19162 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
19164 * src/Makefile.am: Add bison.c++.
19165 * src/bison.c++: New skeleton.
19167 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
19171 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
19173 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
19175 2002-01-20 Marc Autret <marc@gnu.org>
19177 * src/files.c (compute_output_file_names): Fix
19179 2002-01-20 Marc Autret <marc@gnu.org>
19181 * tests/output.at: New test.
19182 * src/files.c (compute_base_names): Don't map extensions when
19183 the YACC flag is set, use defaults.
19184 Reported by Evgeny Stambulchik.
19186 2002-01-20 Marc Autret <marc@gnu.org>
19188 * src/system.h: Need to define __attribute__ away for non-GCC
19189 compilers as well (i.e., the vendor C compiler).
19190 Suggested by Albert Chin-A-Young.
19192 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
19194 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
19195 canonical definition.
19196 * src/system.h: Use the canonical definition for PARAMS (avoids
19197 a conflict with the macro from lib/hash.h).
19199 2002-01-11 Akim Demaille <akim@epita.fr>
19201 * configure.in: Use AC_FUNC_STRNLEN.
19202 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
19204 2002-01-09 Akim Demaille <akim@epita.fr>
19206 * src/files.c, src/files.h (output_infix): New.
19207 (tab_extension): Remove.
19208 (compute_base_names): Compute the former, drop the latter.
19209 * src/output.c (prepare): Insert the muscles `output-infix', and
19211 * src/parse-skel.y (string, string.1): New.
19212 (section.header): Use it.
19213 (section.yacc): Remove.
19214 (prefix): Remove too.
19215 * src/scan-skel.l: Adjust.
19216 * src/bison.simple, src/bison.hairy: Adjust.
19218 2002-01-09 Akim Demaille <akim@epita.fr>
19220 * configure.in (WERROR_CFLAGS): Compute it.
19221 * src/Makefile.am (CFLAGS): Pass it.
19222 * tests/atlocal.in (CFLAGS): Idem.
19223 * src/files.c: Fix a few warnings.
19224 (get_extension_index): Remove, unused.
19226 2002-01-08 Akim Demaille <akim@epita.fr>
19228 * src/getargs.c (AS_FILE_NAME): New.
19229 (getargs): Use it to convert DOSish file names.
19230 * src/files.c (base_name): Rename as full_base_name to avoid
19231 clashes with `base_name ()'.
19232 (filename_split): New.
19233 (compute_base_names): N-th rewrite, using filename_split.
19235 2002-01-08 Akim Demaille <akim@epita.fr>
19237 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
19238 New, stolen from the Fileutils 4.1.
19239 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
19240 * configure.in: Check for the presence of memrchr, and of its
19243 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
19245 * lib/hash.h (__P): Added definition for this macro.
19246 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
19247 BUILT_SOURCES, to ensure they are generated first.
19248 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
19249 %error-verbose to allow bootstrapping with bison 1.30x.
19251 2002-01-06 Akim Demaille <akim@epita.fr>
19253 * src/reader.c (parse_braces): Don't fetch the next char, the
19254 convention is to fetch on entry.
19255 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
19256 'switch' without a following semicolon.
19257 * tests/regression.at (braces parsing): New.
19259 2002-01-06 Akim Demaille <akim@epita.fr>
19261 Bison is dead wrong in its RR conflict reports.
19263 * tests/torture.at (GNU Cim Grammar): New.
19264 * src/conflicts.c (count_rr_conflicts): Fix.
19266 2002-01-06 Akim Demaille <akim@epita.fr>
19268 Creating package.m4 from configure.ac causes too many problems.
19270 * tests/Makefile.am (package.m4): Create it by hand,
19271 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
19273 2002-01-06 Akim Demaille <akim@epita.fr>
19275 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
19278 2002-01-04 Paul Eggert <eggert@twinsun.com>
19280 * doc/bison.texinfo (Debugging):
19281 Remove YYSTDERR; it's no longer defined or used.
19282 Also, s/cstdio.h/cstdio/.
19284 2002-01-03 Akim Demaille <akim@epita.fr>
19286 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
19288 2002-01-03 Akim Demaille <akim@epita.fr>
19290 * src/parse-skel.y (process_skeleton): Don't bind the parser's
19291 tracing code to --trace, wait for a better --trace option, with
19294 2002-01-03 Akim Demaille <akim@epita.fr>
19296 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
19297 The ISO C++ standard is extremely clear about it: stderr is
19298 considered a macro, not a regular symbol (see table 94 `Header
19299 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
19300 Therefore std:: does not apply to it. It still does with fprintf.
19301 Also, s/cstdio.h/cstdio/.
19303 2002-01-03 Akim Demaille <akim@epita.fr>
19305 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
19306 for non system headers.
19308 2002-01-02 Akim Demaille <akim@epita.fr>
19310 Equip the skeleton chain with location tracking, runtime trace,
19311 pure parser and scanner.
19313 * src/parse-skel.y: Request a pure parser, locations, and prefix
19315 (%union): Having several members with the same type does not help
19316 type mismatches, simplify.
19317 (YYPRINT, yyprint): New.
19318 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
19319 (skel_error): this.
19321 * src/scan-skel.l: Adjust to these changes.
19322 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
19323 (LOCATION_PRINT, skel_control_t): New.
19325 2001-12-30 Akim Demaille <akim@epita.fr>
19327 * src/parse-skel.y: Get rid of the shift/reduce conflict:
19328 replace `gb' with BLANKS.
19329 * src/scan-skel.l: Adjust.
19331 2001-12-30 Akim Demaille <akim@epita.fr>
19333 * src/system.h: We don't need nor want bcopy.
19334 Throw away MS-DOS crap: we don't need getpid.
19335 * configure.in: We don't need strndup. It was even causing
19336 problems: because Flex includes the headers *before* us,
19337 _GNU_SOURCE is not defined by config.h, and therefore strndup was
19339 * lib/xstrndup.c: New.
19340 * src/scan-skel.l: Use it.
19341 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
19342 * src/parse-skel.y: Use %directives instead of #defines.
19344 2001-12-30 Akim Demaille <akim@epita.fr>
19346 * src/skeleton.h: New.
19347 * src/output.c (output_parser, output_master_parser): Remove, dead
19349 * src/output.h (get_lines_number, actions_output, guards_output)
19350 (token_definitions_output): Prototype them.
19351 * src/parse-skel.y: Add the license notice.
19352 Include output.h and skeleton.h.
19353 (process_skeleton): Returns void, and takes a single parameter.
19354 * src/scan-skel.l: Add the license notice.
19355 Include skeleton.h.
19356 Don't use %option yylineno: it seems that then Flex imagines
19357 REJECT has been used, and therefore it won't reallocate its
19358 buffers (which makes no other sense to me than a bug). It results
19359 in warnings for `unused: yy_flex_realloc'.
19361 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
19363 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
19364 (MUSCLE_INSERT_PREFIX): ...to there.
19365 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
19366 (MUSCLE_INSERT_PREFIX): Move from here...
19368 * src/bison.hairy: Add a section directive. Put braces around muscle
19369 names. This parser skeleton is still broken, but Bison should not
19370 choke on a bad muscle 'syntax'.
19371 * src/bison.simple: Add a section directive. Put braces around muscle
19374 * src/files.h (strsuffix, stringappend): Add declarations.
19375 (tab_extension): Add declaration.
19376 (short_base_name): Add declaration.
19378 * src/files.c (strsuffix, stringappend): No longer static. These
19379 functions are used in the skeleton parser.
19380 (tab_extension): New.
19381 (compute_base_names): Use the computations done in this function
19382 to guess if the generated parsers should have '.tab' in their
19384 (short_base_name): No longer static.
19386 * src/output.c (output_skeleton): New.
19387 (output): Disable call to output_master_parser, and give a try to
19388 a new skeleton handling system.
19389 (guards_output, actions_output): No longer static.
19390 (token_definitions_output, get_lines_number): No longer static.
19392 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
19394 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
19397 * src/parse-skel.y: New file.
19398 * src/scan-skel.l: New file.
19400 2001-12-29 Akim Demaille <akim@epita.fr>
19402 %name-prefix is broken.
19404 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
19405 Adjust all dependencies.
19406 * tests/headers.at (export YYLTYPE): Strengthen this test: use
19409 Renaming yylval but not yylloc is not consistent. Now we do.
19411 * src/bison.simple: Prefix yylloc if used.
19412 * doc/bison.texinfo (Decl Summary): Document that.
19414 2001-12-29 Akim Demaille <akim@epita.fr>
19416 * doc/bison.texinfo: Promote `%long-directive' over
19418 Remove all references to fixed-output-files, yacc is enough.
19420 2001-12-29 Akim Demaille <akim@epita.fr>
19422 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
19423 user prologue. These are defaults.
19424 * tests/actions.at (Mid-rule actions): Make sure the user can
19425 define YYDEBUG and YYERROR_VERBOSE.
19427 2001-12-29 Akim Demaille <akim@epita.fr>
19429 * src/output.c (header_output): Don't forget to export YYLTYPE and
19431 * tests/headers.at (export YYLTYPE): New, make sure it does.
19432 * tests/regression.at (%union and --defines, Invalid CPP headers):
19434 * tests/headers.at: here.
19436 2001-12-29 Akim Demaille <akim@epita.fr>
19438 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
19440 2001-12-29 Akim Demaille <akim@epita.fr>
19442 * tests/actions.at (Mid-rule actions): Output on a single line
19443 instead of several.
19445 2001-12-29 Akim Demaille <akim@epita.fr>
19447 * doc/bison.texinfo: Formatting changes.
19449 2001-12-29 Akim Demaille <akim@epita.fr>
19451 Don't store the token defs in a muscle, just be ready to output it
19452 on command. Now possible via `symbols'. Fixes a memory leak.
19454 * src/output.c (token_definitions_output): New.
19455 (output_parser, header_output): Use it.
19456 * src/reader.c (symbols_save): Remove.
19458 2001-12-29 Akim Demaille <akim@epita.fr>
19460 * src/bison.simple: Do not provide a default for YYSTYPE and
19461 YYLTYPE before the user's prologue. Otherwise it's hardly... a
19464 2001-12-29 Akim Demaille <akim@epita.fr>
19466 Mid-rule actions are simply... ignored!
19468 * src/reader.c (readgram): Be sure to attach mid-rule actions to
19469 the empty-rule associated to the dummy symbol, not to the host
19471 * tests/actions.at (Mid-rule actions): New.
19473 2001-12-29 Akim Demaille <akim@epita.fr>
19477 * src/reader.c (reader): Free grammar.
19479 2001-12-29 Akim Demaille <akim@epita.fr>
19483 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
19484 since it allocates it for each state, although only one is needed.
19485 (allocate_storage): Do it here.
19487 2001-12-29 Akim Demaille <akim@epita.fr>
19489 * src/options.h, src/options.c (create_long_option_table): Rename
19491 (long_option_table_new): this, with a clearer prototype.
19492 (percent_table): Remove, unused,
19493 * src/getargs.c (getargs): Adjust.
19495 2001-12-29 Akim Demaille <akim@epita.fr>
19497 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
19498 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
19501 2001-12-29 Akim Demaille <akim@epita.fr>
19503 * src/lalr.c (build_relations): Rename `states' as `states1'.
19504 Sorry, I don't understand exactly what it is, no better name...
19506 2001-12-29 Akim Demaille <akim@epita.fr>
19508 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
19509 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
19510 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
19513 2001-12-29 Akim Demaille <akim@epita.fr>
19515 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
19518 2001-12-29 Akim Demaille <akim@epita.fr>
19520 * src/reader.c, src/reader.h (user_toknums): Remove.
19521 Adjust all users to use symbols[i]->user_token_number.
19523 2001-12-29 Akim Demaille <akim@epita.fr>
19525 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
19526 Adjust all users to use symbols[i]->prec or ->assoc.
19528 2001-12-29 Akim Demaille <akim@epita.fr>
19530 * src/reader.c, src/reader.h (tags): Remove.
19531 Adjust all users to use symbols[i]->tag.
19533 2001-12-29 Akim Demaille <akim@epita.fr>
19535 * src/gram.h, src/gram.c (symbols): New, similar to state_table
19537 * src/reader.c (packsymbols): Fill this table.
19539 * src/conflicts.c (resolve_sr_conflict): Adjust.
19540 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
19542 Use symbols[i]->tag instead of tags[i].
19544 2001-12-29 Akim Demaille <akim@epita.fr>
19546 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
19547 In addition, put a comment in there, to replace...
19548 * tests/regression.at (%union and C comments): Remove.
19550 2001-12-29 Akim Demaille <akim@epita.fr>
19552 * tests/regression.at (Web2c Actions): Blindly move the actual
19553 output as expected output. The contents *seem* right to me, but I
19554 can't pretend reading perfectly parser tables... Nonetheless, all
19555 the other tests pass correctly, the table look OK, even though the
19556 presence of `$axiom' is to be noted: AFAICS it is useless (but
19559 2001-12-29 Akim Demaille <akim@epita.fr>
19561 * src/reader.c (readgram): Don't add the rule 0 if there were no
19562 rules read. In other words, add it _after_ having performed
19563 grammar sanity checks.
19564 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
19566 2001-12-29 Akim Demaille <akim@epita.fr>
19568 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
19569 visible, and some states have now a different number.
19571 2001-12-29 Akim Demaille <akim@epita.fr>
19573 * src/reader.c (readgram): Bind the initial rule's lineno to that
19575 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
19576 (Solved SR Conflicts): Adjust rule 0's line number.
19578 2001-12-29 Akim Demaille <akim@epita.fr>
19580 Fix the `GAWK Grammar' failure.
19582 * src/LR0.c (final_state): Initialize to -1 so that we do compute
19583 the reductions of the first state which was mistakenly confused
19584 with the final state because precisely final_state was initialized
19586 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
19587 now noticed by Bison.
19588 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
19589 have a reduction on $default.
19591 2001-12-29 Akim Demaille <akim@epita.fr>
19593 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
19595 * src/closure.c (print_closure): Likewise.
19596 * src/derives.c (print_derives): Likewise.
19597 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
19600 2001-12-29 Akim Demaille <akim@epita.fr>
19602 * src/lalr.c (lookaheads_print): New.
19603 (lalr): Call it when --trace-flag.
19604 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
19607 2001-12-29 Akim Demaille <akim@epita.fr>
19609 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
19610 when walking through ritem, even via rule->rhs.
19611 * src/reduce.c (dump_grammar, useful_production, reduce_output)
19612 (useful_production, useless_nonterminals): Likewise.
19613 (reduce_grammar_tables): Likewise, plus update nritems.
19614 * src/nullable.c (set_nullable): Likewise.
19615 * src/lalr.c (build_relations): Likewise.
19616 * tests/sets.at (Nullable): Adjust.
19617 Fortunately, now, the $axiom is no longer nullable.
19619 2001-12-29 Akim Demaille <akim@epita.fr>
19621 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
19623 * src/gram.c (ritem_longest_rhs): Likewise.
19624 * src/reduce.c (nonterminals_reduce): Likewise.
19625 * src/print_graph.c (print_graph): Likewise.
19626 * src/output.c (output_rule_data): Likewise.
19627 * src/nullable.c (set_nullable): Likewise.
19629 2001-12-29 Akim Demaille <akim@epita.fr>
19631 * src/output.c: Comment changes.
19633 2001-12-27 Paul Eggert <eggert@twinsun.com>
19635 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
19636 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
19637 Sparc, as they were causing more porting problems than the
19638 (minor) performance improvement was worth.
19640 Also, catch up with 1.31's YYSTD.
19642 2001-12-27 Akim Demaille <akim@epita.fr>
19644 * src/output.c (output_gram): Rely on nritems, not the
19645 0-sentinel. See below.
19646 Use -1 as separator, not 0.
19647 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
19648 Rely on -1 as separator in yyrhs, instead of 0.
19649 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
19650 twice `Now at end of input', therefore there are two lines less to
19653 2001-12-27 Akim Demaille <akim@epita.fr>
19655 * tests/regression.at (Unresolved SR Conflicts):
19656 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
19659 2001-12-27 Akim Demaille <akim@epita.fr>
19661 * src/LR0.c (new_state): Recognize the final state by the fact it
19662 is reached by eoftoken.
19663 (insert_start_shifting_state, insert_eof_shifting_state)
19664 (insert_accepting_state, augment_automaton): Remove, since now
19665 these states are automatically computed from the initial state.
19666 (generate_states): Adjust.
19667 * src/print.c: When reporting a rule number to the user, substract
19668 1, so that the axiom rule is rule 0, and the first user rule is 1.
19669 * src/reduce.c: Likewise.
19670 * src/print_graph.c (print_core): For the time being, just as for
19671 the report, depend upon --trace-flags to dump the full set of
19673 * src/reader.c (readgram): Once the grammar read, insert the rule
19674 0: `$axiom: START-SYMBOL $'.
19675 * tests/set.at: Adjust: rule 0 is now displayed, and since the
19676 number of the states has changed (the final state is no longer
19677 necessarily the last), catch up.
19679 2001-12-27 Akim Demaille <akim@epita.fr>
19681 Try to make the use of the eoftoken valid. Given that its value
19682 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
19683 is used instead of > 0 where appropriate, (ii), depend upon nritems
19684 instead of the 0-sentinel.
19686 * src/gram.h, src/gram.c (nritems): New.
19687 Expected to be duplication of nitems, but for the time being...
19688 * src/reader.c (packgram): Assert nritems and nitems are equal.
19689 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
19690 * src/closure.c (print_closure, print_fderives): Likewise.
19691 * src/gram.c (ritem_print): Likewise.
19692 * src/print.c (print_core, print_grammar): Likewise.
19693 * src/print_graph.c: Likewise.
19695 2001-12-27 Akim Demaille <akim@epita.fr>
19697 * src/main.c (main): If there are complains after grammar
19698 reductions, then output the report anyway if requested, then die.
19699 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
19700 * src/reader.c (eoftoken): New.
19701 (parse_token_decl): If the token being defined has value `0', it
19703 (packsymbols): No longer hack `tags' to insert `$' by hand.
19704 Be sure to preserve the value of the eoftoken.
19705 (reader): Make sure eoftoken is defined.
19706 Initialize nsyms to 0: now eoftoken is created just like the others.
19707 * src/print.c (print_grammar): Don't special case the eof token.
19708 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
19709 lie anyway, albeit pleasant.
19710 * tests/calc.at: Exercise error messages with eoftoken.
19711 Change the grammar so that empty input is invalid.
19712 Adjust expectations.
19713 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
19715 2001-12-27 Akim Demaille <akim@epita.fr>
19717 * configure.in: Check the protos of strchr ans strspn.
19718 Replace strchr if needed.
19719 * src/system.h: Provide the protos of strchr, strspn and memchr if
19721 * lib/strchr.c: New.
19722 * src/reader.c (symbols_save): Use strchr.
19724 2001-12-27 Akim Demaille <akim@epita.fr>
19726 * src/print.c, src/print_graph.c (escape): New.
19727 Use it to quote the TAGS outputs.
19728 * src/print_graph.c (print_state): Now errors are in red, and
19729 reductions in green.
19730 Prefer high to wide: output the state number on a line of its own.
19732 2001-12-27 Akim Demaille <akim@epita.fr>
19734 * src/state.h, src/state.c (reductions_new): New.
19735 * src/LR0.c (set_state_table): Let all the states have a
19736 `reductions', even if reduced to 0.
19737 (save_reductions): Adjust.
19738 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
19739 * src/print.c (print_reductions, print_actions): Adjust.
19740 * src/output.c (action_row): Adjust.
19742 2001-12-27 Akim Demaille <akim@epita.fr>
19744 * src/state.h, src/state.c (errs_new, errs_dup): New.
19745 * src/LR0.c (set_state_table): Let all the states have an errs,
19746 even if reduced to 0.
19747 * src/print.c (print_errs, print_reductions): Adjust.
19748 * src/output.c (output_actions, action_row): Adjust.
19749 * src/conflicts.c (resolve_sr_conflict): Adjust.
19751 2001-12-27 Akim Demaille <akim@epita.fr>
19753 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
19755 2001-12-27 Akim Demaille <akim@epita.fr>
19757 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
19758 * src/print.c: here.
19759 (lookaheadset, shiftset): New, used as additional storage by
19761 (print_results): Adjust.
19762 (print_shifts, print_gotos, print_errs): New, extracted from...
19763 (print_actions): here.
19764 * src/print_graph.c (print_actions): Remove dead code.
19766 2001-12-27 Akim Demaille <akim@epita.fr>
19768 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
19771 2001-12-27 Akim Demaille <akim@epita.fr>
19773 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
19774 (build_relations): Adjust.
19776 2001-12-27 Akim Demaille <akim@epita.fr>
19778 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
19781 2001-12-27 Akim Demaille <akim@epita.fr>
19783 * src/reader.c (packgram): Catch nitems overflows.
19785 2001-12-27 Akim Demaille <akim@epita.fr>
19787 * src/files.c, src/files.h (guard_obstack): Remove.
19788 * src/output.c (output): Adjust.
19789 * src/reader.c (parse_braces): New, factoring...
19790 (copy_action, copy_guard): these two which are renamed as...
19791 (parse_action, parse_guard): these.
19792 As a voluntary consequence, using braces around guards is now
19795 2001-12-27 Akim Demaille <akim@epita.fr>
19797 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
19798 * src/reader.c (symbol_list): `guard' and `guard_line' are new
19800 (symbol_list_new): Adjust.
19801 (copy_action): action_line is the first line, not the last.
19802 (copy_guard): Just as for actions, store the `action' only, not
19803 the switch/case/break flesh.
19804 Don't parse the user action that might follow the guard, let...
19805 (readgram): do it, i.e., now, there can be an action after a
19807 In other words the guard is just explicitly optional.
19808 (packgram): Adjust.
19809 * src/output.c (guards_output): New.
19810 (output_parser): Call it when needed.
19811 (output): Also free the guard and attrs obstacks.
19812 * src/files.c, src/files.h (obstack_save): Remove.
19813 (output_files): Remove.
19814 As a result, if one needs the former `.act' file, using an
19815 appropriate skeleton which requires actions and guards is now
19817 * src/main.c (main): Adjust.
19818 * tests/semantic.at: New.
19819 * tests/regression.at: Use `input.y' as input file name.
19820 Avoid 8+3 problems by requiring input.c when the test needs the
19823 2001-12-27 Akim Demaille <akim@epita.fr>
19825 * src/reader.c (symbol_list_new): Be sure to initialize all the
19828 2001-12-27 Akim Demaille <akim@epita.fr>
19830 All the hacks using a final pseudo state are now useless.
19832 * src/LR0.c (set_state_table): state_table holds exactly nstates.
19833 * src/lalr.c (nLA): New.
19834 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
19835 instead of lookaheadsp from the pseudo state (nstate + 1).
19837 2001-12-27 Akim Demaille <akim@epita.fr>
19839 * src/output.c (action_row, token_actions): Use a state_t instead
19840 of a integer, and nlookaheads instead of the following state's
19843 2001-12-27 Akim Demaille <akim@epita.fr>
19845 * src/conflicts.c (log_resolution, flush_shift)
19846 (resolve_sr_conflict, set_conflicts, solve_conflicts)
19847 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
19848 (conflicts_print, print_reductions): Use a state_t instead of an
19849 integer when referring to a state.
19850 As much as possible, depend upon nlookaheads, instead of the
19851 `lookaheadsp' member of the following state (since lookaheads of
19852 successive states are successive, the difference between state n + 1
19853 and n served as the number of lookaheads for state n).
19854 * src/lalr.c (add_lookback_edge): Likewise.
19855 * src/print.c (print_core, print_actions, print_state)
19856 (print_results): Likewise.
19857 * src/print_graph.c (print_core, print_actions, print_state)
19858 (print_graph): Likewise.
19859 * src/conflicts.h: Adjust.
19861 2001-12-27 Akim Demaille <akim@epita.fr>
19863 * src/bison.hairy: Formatting/comment changes.
19865 Remove `register' indications.
19866 Add plenty of `static'.
19868 2001-12-27 Akim Demaille <akim@epita.fr>
19870 * src/output.c (prepare): Drop the muscle `ntbase' which
19871 duplicates ntokens.
19872 * src/bison.simple: Formatting/comment changes.
19873 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
19874 is an undocumented synonym.
19876 2001-12-22 Akim Demaille <akim@epita.fr>
19878 * src/output.c (output_table_data): Change the prototype to use
19879 `int' for array ranges: some invocations do pass an int, not a
19881 Reported by Wayne Green.
19883 2001-12-22 Akim Demaille <akim@epita.fr>
19885 Some actions of web2c.y are improperly triggered.
19886 Reported by Mike Castle.
19888 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
19889 * tests/regression.at (Web2c): Rename as...
19890 (Web2c Report): this.
19891 (Web2c Actions): New.
19893 2001-12-22 Akim Demaille <akim@epita.fr>
19895 Reductions in web2c.y are improperly reported.
19896 Reported by Mike Castle.
19898 * src/conflicts.c (print_reductions): Fix.
19899 * tests/regression.at (Web2c): New.
19901 2001-12-18 Akim Demaille <akim@epita.fr>
19903 Some host fail on `assert (!"foo")', which expands to
19904 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
19905 Reported by Nelson Beebee.
19907 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
19908 `#define it_succeeded 0' and `assert (it_succeeded)'.
19910 2001-12-17 Marc Autret <autret_m@epita.fr>
19912 * src/bison.simple: Don't hard code the skeleton line and filename.
19913 * src/output.c (output_parser): Rename 'line' as 'output_line'.
19914 New line counter 'skeleton_line' (skeleton-line muscle).
19916 2001-12-17 Paul Eggert <eggert@twinsun.com>
19918 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
19919 YYDEBUG must be defined to a nonzero value.
19921 * src/bison.simple (yytname): Do not assume that the user defines
19922 YYDEBUG to a properly parenthesized expression.
19924 2001-12-17 Akim Demaille <akim@epita.fr>
19926 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
19927 nlookaheads is a new member.
19929 * src/lalr.h (nlookaheads): Remove this orphan declaration.
19930 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
19933 2001-12-17 Akim Demaille <akim@epita.fr>
19935 * src/files.h, src/files.c (open_files, close_files): Remove.
19936 * src/main.c (main): Don't open/close files, nor invoke lex_free,
19938 * src/reader.c (reader): Do it.
19940 2001-12-17 Akim Demaille <akim@epita.fr>
19942 * src/conflicts.c (print_reductions): Formatting changes.
19944 2001-12-17 Akim Demaille <akim@epita.fr>
19946 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
19947 (flush_reduce): New.
19948 (resolve_sr_conflict): Adjust.
19950 2001-12-17 Akim Demaille <akim@epita.fr>
19952 * src/output.c (output_obstack): Be static and rename as...
19953 (format_obstack): this, to avoid any confusion with files.c's
19955 * src/reader.h (muscle_obstack): Move to...
19956 * src/output.h: here, since it's defined in output.c.
19958 2001-12-17 Akim Demaille <akim@epita.fr>
19960 * src/output.c (action_row, save_column, default_goto)
19961 (sort_actions, matching_state, pack_vector): Better variable
19964 2001-12-17 Akim Demaille <akim@epita.fr>
19966 * src/output.c: Various formatting changes.
19968 2001-12-17 Akim Demaille <akim@epita.fr>
19970 * src/files.c (output_files): Free the output_obstack.
19971 * src/main.c (main): Call print and print_graph conditionally.
19972 * src/print.c (print): Work unconditionally.
19973 * src/print_graph.c (print_graph): Work unconditionally.
19974 * src/conflicts.c (log_resolution): Output only if verbose_flag.
19976 2001-12-16 Marc Autret <autret_m@epita.fr>
19978 * src/output.c (actions_output): Fix. When we use %no-lines,
19979 there is one less line per action.
19981 2001-12-16 Marc Autret <autret_m@epita.fr>
19983 * src/bison.simple: Remove a useless #line directive.
19984 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
19985 * src/output.c (get_lines_number): New.
19986 (output_parser): Adjust, now takes care about the lines of a
19988 Fix line numbering.
19989 (actions_output): Computes the number of lines taken by actions.
19990 (output_master_parser): Insert new skeleton which is the name of
19991 the output parser file name.
19993 2001-12-15 Marc Autret <autret_m@epita.fr>
19995 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
19997 2001-12-15 Marc Autret <autret_m@epita.fr>
19999 * src/output.c (output_gram): Keep track of the hairy one.
20001 2001-12-15 Akim Demaille <akim@epita.fr>
20003 Make `make distcheck' work.
20005 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
20006 system.h which uses libgettext.h.
20008 2001-12-15 Akim Demaille <akim@epita.fr>
20010 * src/nullable.c (set_nullable): Useless rules must be skipped,
20011 otherwise, since we range over their symbols, we might look at a
20012 nonterminal which no longer ``exists'', i.e., it is not counted in
20013 `nvars', hence we overflow our arrays.
20015 2001-12-15 Akim Demaille <akim@epita.fr>
20017 The header can also be produced directly, without any obstack!
20020 * src/files.c, src/files.h (defines_obstack): Remove.
20021 (compute_header_macro): Global.
20022 (defines_obstack_save): Remove.
20023 * src/reader.c (parse_union_decl): No longer output to
20024 defines_obstack: its content can be found in the `stype' muscle
20026 (output_token_translations): Merge into...
20027 (symbols_output): this.
20029 (symbols_save): this.
20031 * src/output.c (header_output): New.
20034 2001-12-15 Akim Demaille <akim@epita.fr>
20036 * src/reader.c (parse_union_decl): Instead of handling two obstack
20037 simultaneously, use one to define the `stype' muscle, and use the
20038 value of the latter to fill defines_obstack.
20039 (copy_comment): Remove.
20040 (copy_comment2): Work for a single obstack.
20042 (copy_comment): this.
20044 2001-12-15 Akim Demaille <akim@epita.fr>
20046 * src/lex.c, src/lex.h (xgetc): No longer static.
20047 * src/reader.c (parse_union_decl): Revamp.
20049 2001-12-15 Akim Demaille <akim@epita.fr>
20051 Still making progress in separating Bison into (i) input, (ii)
20052 process, (iii) output: now we can directly output the parser file
20053 without using table_obstack at all.
20055 * src/files.c, src/files.h (table_obstack): Bye bye.
20056 (parser_file_name): New.
20057 * src/files.c (compute_output_file_names): Compute it.
20058 * src/output.c (actions_output, output_parser)
20059 (output_master_parser): To a file instead of an obstack.
20061 2001-12-15 Akim Demaille <akim@epita.fr>
20063 Attach actions to rules, instead of pre-outputting them to
20066 * src/gram.h (rule_t): action and action_line are new members.
20067 * src/reader.c (symbol_list): Likewise.
20068 (copy_action): Save the actions within the rule.
20069 (packgram): Save them in rule_table.
20070 * src/output.c (actions_output): New.
20071 (output_parser): Use it on `%%actions'.
20072 (output_rule_data): Don't free rule_table.
20074 (prepare): Don't save the `action' muscle.
20075 * src/bison.simple: s/%%action/%%actions/.
20077 2001-12-15 Akim Demaille <akim@epita.fr>
20079 * src/reader.c (copy_action): When --yacc, don't append a `;'
20080 to the user action: let it fail if lacking.
20081 Suggested by Arnold Robbins and Tom Tromey.
20083 2001-12-14 Akim Demaille <akim@epita.fr>
20085 * src/lex.c (literalchar): Simply return the char you decoded, non
20086 longer mess around with obstacks and int pointers.
20087 Adjust all callers.
20089 2001-12-14 Akim Demaille <akim@epita.fr>
20091 * src/lex.c (literalchar): Don't escape the special characters,
20092 just decode them, and keep them as char (before, eol was output as
20093 the 2 char string `\n' etc.).
20094 * src/output.c (output_rule_data): Use quotearg to output the
20097 2001-12-13 Paul Eggert <eggert@twinsun.com>
20099 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
20100 Do not infringe on the global user namespace when using C++.
20101 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
20102 All uses of `fprintf' and `stderr' changed.
20104 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
20106 2001-12-13 Akim Demaille <akim@epita.fr>
20108 The computation of nullable is broken: it doesn't handle empty
20111 * tests/torture.at (GNU AWK Grammar): New.
20112 * tests/sets.at (Nullable): New.
20113 * src/nullable.c (set_nullable): Instead of blindly looping over
20114 `ritems', loop over the rules, and then over their rhs's.
20116 Work around Autotest bugs.
20118 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
20119 frame, because Autotest understand lines starting with a `+' as
20120 traces from the shell. Then, they are not processed properly.
20121 Admittedly an Autotest bug, but we don't have time to wait for
20122 Autotest to catch up.
20123 * tests/regression.at (Broken Closure): Adjust to the new table
20126 * tests/sets.at: here.
20128 2001-12-13 Akim Demaille <akim@epita.fr>
20130 * src/closure.c (closure): Use nrules instead of playing tricks
20131 with BITS_PER_WORD.
20133 2001-12-13 Akim Demaille <akim@epita.fr>
20135 * src/print.c (print_actions): Output the handling of `$' as the
20136 traces do: shifting the token EOF. Before EOF was treated as a
20138 * tests/regression.at: Adjust some tests.
20139 * src/print_graph.c (print_core): Complete the set of items via
20140 closure. The next-to-final and final states are still unsatisfying,
20141 but that's to be addressed elsewhere.
20142 No longer output the rule numbers, but do output the state number.
20143 A single loop for the shifts + gotos is enough, but picked a
20144 distinct color for each.
20145 (print_graph): Initialize and finalize closure.
20147 2001-12-13 Akim Demaille <akim@epita.fr>
20149 * src/reader.c (readgram): Remove dead code, an strip useless
20151 (get_type): Remove, unused.
20153 2001-12-12 Akim Demaille <akim@epita.fr>
20155 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
20156 on that of lib/error.c.
20158 2001-12-12 Akim Demaille <akim@epita.fr>
20160 Some hosts don't like `/' in includes.
20162 * src/system.h: Include libgettext.h without qualifying the path.
20163 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
20166 2001-12-11 Marc Autret <autret_m@epita.fr>
20168 * src/output.c (output_parser): Remove useless muscle.
20170 2001-12-11 Marc Autret <autret_m@epita.fr>
20172 * src/bison.simple: Remove #line just before %%epilogue. It
20173 is now handled in ...
20174 * src/reader.c (read_additionnal_code): Add the output of a
20175 #line for the epilogue.
20177 2001-12-10 Marc Autret <autret_m@epita.fr>
20179 * src/reader.c (copy_definition): Re-use CPP-outed code which
20180 replace precedent remove.
20181 * src/bison.simple: Remove #line before %%prologue because
20182 %%input-line is wrong at this time.
20184 2001-12-10 Marc Autret <autret_m@epita.fr>
20186 * src/reader.c (symbols_output): Clean up.
20187 * src/output.c (output_gram, output): Clean up.
20189 2001-12-10 Akim Demaille <akim@epita.fr>
20191 * src/lalr.c (initialize_lookaheads): New. Extracted from...
20192 * src/LR0.c (set_state_table): here.
20193 * src/lalr.c (lalr): Call it.
20195 2001-12-10 Akim Demaille <akim@epita.fr>
20197 * src/state.h (shifts): Remove the `number' member: shifts are
20198 attached to state, hence no longer need to be labelled with a
20201 2001-12-10 Akim Demaille <akim@epita.fr>
20203 Now that states have a complete set of members, the linked list of
20204 shifts is useless: just fill directly the state's shifts member.
20206 * src/state.h (shifts): Remove the `next' member.
20207 * src/LR0.c (first_state, last_state): Remove.
20208 Adjust the callers.
20209 (augment_automaton): Don't look for the shifts that must be added
20210 a shift on EOF: it is those of the state we looked for! But now,
20211 since shifts are attached, it is no longer needed to looking
20212 merely by its id: its number.
20214 2001-12-10 Akim Demaille <akim@epita.fr>
20216 * src/LR0.c (augment_automaton): Better variable locality.
20217 Remove an impossible branch: if there is a state corresponding to
20218 the start symbol being shifted, then there is shift for the start
20219 symbol from the initial state.
20221 2001-12-10 Akim Demaille <akim@epita.fr>
20223 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
20224 only when appropriate: when insert_start_shifting_state' is not
20226 * tests/regression.at (Rule Line Numbers): Adjust.
20228 2001-12-10 Akim Demaille <akim@epita.fr>
20230 * src/LR0.c (augment_automaton): Now that all states have shifts,
20231 merge the two cases addition shifts to the initial state.
20233 2001-12-10 Akim Demaille <akim@epita.fr>
20235 * src/lalr.c (set_state_table): Move to...
20237 * src/lalr.c (lalr): Don't call it...
20238 * src/LR0.c (generate_states): do it.
20239 * src/LR0.h (first_state): Remove, only the table is used.
20241 2001-12-10 Akim Demaille <akim@epita.fr>
20243 * src/LR0.h (first_shift, first_reduction): Remove.
20244 * src/lalr.c: Don't use first_shift: find shifts through the
20247 2001-12-10 Akim Demaille <akim@epita.fr>
20249 * src/LR0.c: Attach shifts to states as soon as they are
20251 * src/lalr.c (set_state_table): Instead of assigning shifts to
20252 state, just assert that the mapping was properly done.
20254 2001-12-10 Akim Demaille <akim@epita.fr>
20256 * src/LR0.c (insert_start_shift): Rename as...
20257 (insert_start_shifting_state): this.
20258 (insert_eof_shifting_state, insert_accepting_state): New.
20259 (augment_automaton): Adjust.
20260 Better locality of the variables.
20261 When looking if the start_symbol is shifted from the initial
20262 state, using `while (... symbol != start_symbol ...)' sounds
20263 better than `while (... symbol < start_symbol ...)': If fail
20264 to see how the order between symbols could be relevant!
20266 2001-12-10 Akim Demaille <akim@epita.fr>
20268 * src/getargs.h: Don't declare `spec_name_prefix' and
20269 `spec_file_prefix', declared by src/files.h.
20270 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
20271 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
20272 * src/output.c (prepare): Adjust.
20273 * src/reader.c (symbols_output): Likewise.
20274 * src/vmsgetargs.c: Vaguely adjust, but who cares?
20276 2001-12-10 Akim Demaille <akim@epita.fr>
20278 * src/muscle_tab.c (muscle_init): NULL is a better default than
20281 2001-12-10 Akim Demaille <akim@epita.fr>
20283 * src/reader.c (reader): Calling symbols_output once is enough.
20285 2001-12-10 Akim Demaille <akim@epita.fr>
20287 Now that states have a complete set of members, the linked list of
20288 reductions is useless: just fill directly the state's reductions
20291 * src/state.h (struct reductions): Remove member `number' and
20293 * src/LR0.c (first_reduction, last_reduction): Remove.
20294 (save_reductions): Don't link the new reductions, store them in
20296 * src/lalr.c (set_state_table): No need to attach reductions to
20297 states, it's already done.
20298 * src/output.c (output_actions): No longer free the shifts, then
20299 the reductions, then the states: free all the states and their
20302 2001-12-10 Akim Demaille <akim@epita.fr>
20304 * src/options.c (OPTN, DRTV, BOTH): New.
20305 (option_table): Use them.
20307 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
20308 the job of system.h.
20309 * src/options.c: Don't include stdio.h and xalloc.h for the same
20312 2001-12-10 Akim Demaille <akim@epita.fr>
20314 * src/output.c (output, prepare): Make sure the values of the
20315 muscles `action' and `prologue' are 0-terminated.
20317 2001-12-10 Akim Demaille <akim@epita.fr>
20319 Clean up GCC warnings.
20321 * src/reader.c (copy_action): `buf' is not used.
20322 (parse_skel_decl): Be static.
20323 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
20324 * src/options.h (create_long_option_table): Have a real prototype.
20325 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
20326 (hash_delete_at): Return const void *.
20327 Adjust casts to preserve the const.
20329 2001-12-10 Akim Demaille <akim@epita.fr>
20331 * configure.in: Require 2.52g.
20332 M4 is not needed, but AUTOM4TE is.
20333 * m4/m4.m4: Remove.
20334 * tests/Makefile.am: Adjust.
20336 2001-12-10 Akim Demaille <akim@epita.fr>
20338 One structure for states is enough, even though theoretically
20339 there are LR(0) states and LALR(1) states.
20341 * src/lalr.h (state_t): Remove.
20342 (state_table): Be state_t **, not state_t *.
20343 * src/state.h (core, CORE_ALLOC): Rename as...
20344 (state_t, STATE_ALLOC): this.
20345 Add the LALR(1) members: shifts, reductions, errs.
20346 * src/LR0.c (state_table): Rename as...
20347 (state_hash): this, to avoid name clashes with the global
20349 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
20350 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
20352 2001-12-10 Akim Demaille <akim@epita.fr>
20354 Bison dumps core on bash.y.
20355 Reported by Pascal Bart.
20357 * src/warshall.c (bitmatrix_print): New.
20359 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
20360 j must be the outer loop.
20361 * tests/regression.at (Broken Closure): New.
20363 2001-12-05 Akim Demaille <akim@epita.fr>
20365 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
20367 Reported by Peter Hamorsky.
20369 2001-12-05 Akim Demaille <akim@epita.fr>
20371 * src/conflicts.c (err_table): Remove.
20372 (resolve_sr_conflict): Adjust.
20373 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
20375 (state_t.reductions, state_t.shifts): this.
20377 2001-12-05 Akim Demaille <akim@epita.fr>
20379 * src/reduce.c (reduce_grammar_tables): No longer disable the
20380 removal of useless rules via CPP but via `if (0)', so that the
20381 compiler still check the code is valid.
20382 For instance, it should have noticed `rline' no longer exists: use
20383 the `line' member of rule_t.
20384 * src/gram.c (dummy, rline): Remove, unused.
20386 2001-12-05 Akim Demaille <akim@epita.fr>
20388 * src/output.c (pack_vector): Use assert, not berror.
20389 * src/main.c (berror): Remove, unused.
20391 2001-12-05 Akim Demaille <akim@epita.fr>
20393 New experimental feature: if --verbose --trace output all the
20394 items of a state, not only its kernel.
20396 * src/print.c (print_core): If `trace_flag', then invoke closure
20397 before outputting the items of the state (print_core is no longer
20398 a correct name them).
20399 (print_results): Invoke new_closure/free_closure if needed.
20401 2001-12-05 Akim Demaille <akim@epita.fr>
20403 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
20404 * src/closure.c, src/closure.h (itemsetsize): Rename as...
20405 (nitemset): for consistency with the rest of the project.
20407 2001-12-05 Akim Demaille <akim@epita.fr>
20409 * src/closure.c (print_closure): Improve.
20410 (closure): Use it for printing input and output.
20412 2001-12-05 Akim Demaille <akim@epita.fr>
20414 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
20415 indexed by nonterminals.
20417 2001-12-05 Akim Demaille <akim@epita.fr>
20419 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
20421 * src/warshall.h: Remove accidental duplication of the content.
20423 2001-12-05 Akim Demaille <akim@epita.fr>
20425 * src/closure.c (set_fderives): De-obfuscate.
20427 2001-12-05 Akim Demaille <akim@epita.fr>
20429 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
20431 2001-12-05 Akim Demaille <akim@epita.fr>
20433 * src/closure.c (set_firsts): De-obfuscate.
20435 2001-12-05 Akim Demaille <akim@epita.fr>
20437 * src/output.c (action_row): De-obfuscate
20438 using the good o' techniques: arrays not pointers, variable
20439 locality, BITISSET, RESETBIT etc.
20441 2001-12-05 Akim Demaille <akim@epita.fr>
20443 Pessimize the code to simplify it: from now on, all the states
20444 have a valid SHIFTS, which NSHIFTS is possibly 0.
20446 * src/LR0.c (shifts_new): Be global and move to..
20447 * src/state.c, src/state.h: here.
20448 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
20449 * src/print_graph: Adjust.
20451 2001-12-05 Akim Demaille <akim@epita.fr>
20453 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
20454 * src/conflicts.c: Use it.
20455 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
20456 incorrectly ``simplified''.
20458 2001-12-05 Akim Demaille <akim@epita.fr>
20460 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
20461 using the good o' techniques: arrays not pointers, variable
20462 locality, BITISSET, RESETBIT etc.
20464 2001-12-05 Akim Demaille <akim@epita.fr>
20466 * src/state.h (SHIFT_SYMBOL): New.
20467 * src/conflicts.c: Use it to deobfuscate.
20469 2001-12-05 Akim Demaille <akim@epita.fr>
20471 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
20472 (print_reductions): De-obfuscate using the good o' techniques:
20473 arrays not pointers, variable locality, BITISSET.
20475 2001-12-05 Akim Demaille <akim@epita.fr>
20477 * src/conflicts.c (print_reductions): Arrays, not pointers.
20480 2001-12-05 Akim Demaille <akim@epita.fr>
20482 * src/conflicts.c (print_reductions): Pessimize, but clarify.
20484 2001-12-05 Akim Demaille <akim@epita.fr>
20486 * src/conflicts.c (print_reductions): Improve variable locality.
20488 2001-12-05 Akim Demaille <akim@epita.fr>
20490 * src/conflicts.c (print_reductions): Pessimize, but clarify.
20492 2001-12-05 Akim Demaille <akim@epita.fr>
20494 * src/conflicts.c (print_reductions): Improve variable locality.
20496 2001-12-05 Akim Demaille <akim@epita.fr>
20498 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
20499 * src/lalr.c: Use them.
20501 2001-12-05 Akim Demaille <akim@epita.fr>
20503 * src/LR0.c (augment_automaton): Formatting changes.
20504 Better variable locality.
20506 2001-12-05 Akim Demaille <akim@epita.fr>
20508 * src/lalr.c (matrix_print): New.
20509 (transpose): Use it.
20510 Use arrays instead of pointers.
20512 2001-12-05 Akim Demaille <akim@epita.fr>
20514 * src/lalr.c (maxrhs): Move to...
20515 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
20516 * src/lalr.c (build_relations): Adjust.
20518 2001-12-05 Akim Demaille <akim@epita.fr>
20520 * src/lalr.c (transpose): Free the memory allocated to the
20521 argument, as it is replaced by the results by the unique caller.
20522 (build_relations): Merely invoke transpose: it handles the memory
20524 Improve variable locality.
20525 Avoid variables used as mere abbreviations.
20526 (compute_lookaheads): Use arrays instead of pointers.
20528 2001-12-05 Akim Demaille <akim@epita.fr>
20530 * src/lalr.c (initialize_F): Improve variable locality.
20531 Avoid variables used as mere abbreviations.
20533 2001-12-05 Akim Demaille <akim@epita.fr>
20535 * src/derives.c (print_derives): Display the ruleno.
20536 * src/lalr.c (initialize_F, transpose): Better variable locality
20537 to improve readability.
20538 Avoid variables used as mere abbreviations.
20540 2001-12-05 Akim Demaille <akim@epita.fr>
20542 * src/lalr.c (traverse): Use arrays instead of pointers.
20544 2001-12-05 Akim Demaille <akim@epita.fr>
20546 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
20547 the handling of squeue.
20548 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
20550 2001-12-05 Akim Demaille <akim@epita.fr>
20552 Because useless nonterminals are now kept alive (instead of being
20553 `destroyed'), we now sometimes examine them, and store information
20554 related to them. Hence we need to know their number, and adjust
20555 memory allocations.
20557 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
20559 * src/LR0.c (allocate_itemsets): The memory allocated to
20560 `symbol_count' was used for two different purpose: once to count
20561 the number of occurrences of each symbol, and later reassigned to
20562 `shift_symbol', containing the symbol that can be shifted from a
20564 Deobfuscate, i.e., allocate, use and free `symbol_count' here
20566 (new_itemsets): Allocate `shift_symbol' here.
20567 (allocate_itemsets): symbol_count includes useless nonterminals.
20568 Make room for them.
20569 (free_storage): Use `free', not `XFREE', for pointers that cannot
20572 2001-12-05 Akim Demaille <akim@epita.fr>
20574 * src/nullable.c (set_nullable): Deobfuscate the handling of
20576 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
20578 2001-12-05 Akim Demaille <akim@epita.fr>
20580 * src/gram.c, src/gram.h (ritem_print): New.
20581 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
20582 (This useless function was defined only to work around VMS linkers
20583 that can't handle compilation units with variables only).
20584 * src/reduce.c (dump_grammar): Use it to trace the construction of
20587 2001-12-04 Paul Eggert <eggert@twinsun.com>
20589 * src/bison.simple (union yyalloc): Change member names
20590 to be the same as the stack names.
20591 (yyparse): yyptr is now union yyalloc *, not char *.
20592 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
20593 and may generate better code on some machines.
20594 (yystpcpy): Use prototype if __STDC__ is defined, not just
20595 if __cplusplus is defined.
20597 2001-11-30 Akim Demaille <akim@epita.fr>
20599 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
20600 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
20601 Gettext doesn't compile cleanly, and dies with -Werror.
20602 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
20603 Include WARNING_CFLAGS here.
20604 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
20605 before being defined.
20607 2001-11-27 Paul Eggert <eggert@twinsun.com>
20609 * lib/quotearg.h (quotearg_n, quotearg_n_style):
20610 First arg is int, not unsigned.
20611 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
20612 (SIZE_MAX, UINT_MAX): New macros.
20613 (quotearg_n_options): Abort if N is negative.
20614 Avoid overflow check on hosts where size_t is 64 bits and int
20615 is 32 bits, as overflow is impossible there.
20616 Fix off-by-one typo that caused unnecessary reallocation.
20618 2001-11-29 Paul Eggert <eggert@twinsun.com>
20620 Name space cleanup in generated parser.
20622 * doc/bison.texinfo (Bison Parser): Discuss system headers
20623 and their effect on the user name space.
20625 * src/bison.simple:
20626 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
20627 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
20628 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
20630 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
20631 on user names when possible.
20633 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
20634 Simplify test for whather <alloca.h> exists.
20636 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
20638 (<stdio.h>): Include if YYDEBUG.
20640 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
20641 ! defined (yyoverflow) && ! defined (yymemcpy).
20643 (yymemcpy, yyparse): Rename local variables as needed so that
20644 they all begin with 'yy'.
20646 (yystrlen, yystpcpy): New functions.
20648 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
20651 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
20652 instead of relying on string.h functions. Use YYSTACK_ALLOC
20653 and YYSTACK_FREE instead of malloc and free.
20655 2001-11-30 Akim Demaille <akim@epita.fr>
20657 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
20658 before their first uses.
20659 (YYBISON, YYPURE): Move to the top of the output.
20661 2001-11-30 Akim Demaille <akim@epita.fr>
20663 * tests/reduce.at (Useless Nonterminals): Fix.
20665 2001-11-30 Akim Demaille <akim@epita.fr>
20667 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
20668 if body instead of `;' to pacify GCC's warnings.
20670 2001-11-30 Akim Demaille <akim@epita.fr>
20672 Instead of mapping the LHS of unused rules to -1, keep the LHS
20673 valid, but flag the rules as invalid.
20675 * src/gram.h (rule_t): `useful' is a new member.
20676 * src/print.c (print_grammar): Adjust.
20677 * src/derives.c (set_derives): Likewise.
20678 * src/reader.c (packgram, reduce_output): Likewise.
20679 * src/reduce.c (reduce_grammar_tables): Likewise.
20680 * tests/reduce.at (Underivable Rules, Useless Rules): New.
20682 2001-11-30 Akim Demaille <akim@epita.fr>
20684 * src/reduce.c (reduce_output): Formatting changes.
20685 * src/print.c (print_results, print_grammar): Likewise.
20686 * tests/regression.at (Rule Line Numbers)
20687 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
20689 2001-11-30 Akim Demaille <akim@epita.fr>
20691 * src/reduce.c (nonterminals_reduce): Instead of throwing away
20692 useless nonterminals, move them at the end of the symbol arrays.
20693 (reduce_output): Adjust.
20694 * tests/reduce.at (Useless Nonterminals): Adjust.
20696 2001-11-30 Akim Demaille <akim@epita.fr>
20698 * src/reduce.c: Various comment/formatting changes.
20699 (nonterminals_reduce): New, extracted from...
20700 (reduce_grammar_tables): here.
20701 (reduce_grammar): Call nonterminals_reduce.
20703 2001-11-29 Paul Eggert <eggert@twinsun.com>
20705 * src/bison.simple (YYSTACK_REALLOC): Remove.
20706 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
20707 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
20709 (union yyalloc): New type.
20710 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
20711 an arbitrary restriction on hosts where size_t is wider than int.
20713 (yyparse): Don't dump core if alloca or malloc fails; instead, report
20714 a parser stack overflow. Allocate just one block of memory for all
20715 three stacks, instead of allocating three blocks; this typically is
20716 faster and reduces fragmentation.
20718 Do not limit the number of items in the stack to a value that fits
20719 in 'int', as this is an arbitrary limit on hosts with 64-bit
20720 size_t and 32-bit int.
20722 2001-11-29 Marc Autret <autret_m@epita.fr>
20724 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
20725 of defining YYERROR_VERBOSE.
20726 [AT_DATA]: $4 is now out of C declarations in the prologue.
20728 2001-11-28 Marc Autret <autret_m@epita.fr>
20730 * src/reader.c (parse_dquoted_param): New.
20731 (parse_skel_decl): Use it.
20732 * src/lex.h: Add its prototype.
20733 * src/lex.c (literalchar): Become not static.
20735 2001-11-28 Marc Autret <autret_m@epita.fr>
20737 * src/output.h: And put its extern declaration here.
20738 * src/output.c (error_verbose): Define here.
20739 (prepare): Echo name modification.
20740 * src/getargs.h: Clean its extern declaration.
20741 * src/getargs.c (error_verbose_flag): Remove.
20742 (getargs): Remove case 'e'.
20743 * src/options.c (option_table): 'error-verbose' is now seen as simple
20747 * src/reader.c (read_declarations): Remove case tok_include.
20748 (parse_include_decl): Remove.
20749 * src/lex.h (token_t): Remove tok_include.
20750 * src/options.c (option_table): 'include' is now a simple command line
20753 2001-11-28 Marc Autret <autret_m@epita.fr>
20755 * src/bison.simple: Adjust muscle names.
20756 * src/muscle_tab.c (muscle_init): Also rename the muscles.
20757 * src/output.c (prepare): s/_/-/ for the muscles names.
20758 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
20760 2001-11-28 Marc Autret <autret_m@epita.fr>
20762 * src/bison.simple: Fix debug.
20763 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
20765 2001-11-28 Akim Demaille <akim@epita.fr>
20767 * src/LR0.c (shifts_new): New.
20768 (save_shifts, insert_start_shift, augment_automaton): Use it.
20770 2001-11-28 Akim Demaille <akim@epita.fr>
20772 * src/closure.c (closure): `b' and `ruleno' denote the same value:
20775 2001-11-28 Akim Demaille <akim@epita.fr>
20777 * src/closure.c (closure): Instead of looping over word in array
20778 then bits in words, loop over bits in array.
20780 2001-11-28 Akim Demaille <akim@epita.fr>
20782 * src/closure.c (closure): No longer optimize the special case
20783 where all the bits of `ruleset[r]' are set to 0, to make the code
20786 2001-11-28 Akim Demaille <akim@epita.fr>
20788 * src/closure.c (closure): `r' and `c' are new variables, used to
20789 de-obfuscate accesses to RULESET and CORE.
20791 2001-11-28 Akim Demaille <akim@epita.fr>
20793 * src/reduce.c (reduce_print): Use ngettext.
20794 (dump_grammar): Improve the trace accuracy.
20796 2001-11-28 Akim Demaille <akim@epita.fr>
20798 * src/reduce.c (dump_grammar): Don't translate trace messages.
20800 2001-11-28 Akim Demaille <akim@epita.fr>
20802 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
20803 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
20804 as all tags are free'ed afterwards.
20805 From Enrico Scholz.
20807 2001-11-27 Paul Eggert <eggert@twinsun.com>
20809 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
20810 use alloca when we didn't want to, and vice versa.
20812 2001-11-27 Marc Autret <autret_m@epita.fr>
20814 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
20816 * src/output.c (prepare): Remove its update.
20818 2001-11-27 Marc Autret <autret_m@epita.fr>
20820 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
20821 Use %error-verbose.
20823 2001-11-27 Marc Autret <autret_m@epita.fr>
20825 * src/bison.simple: Remove YYERROR_VERBOSE using.
20826 Use %%error_verbose.
20827 (yyparse): Likewise.
20828 * src/output.c (prepare): Give its final value.
20829 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
20830 * src/getargs.h: Add its extern declaration.
20831 * src/getargs.c (error_verbose_flag): New int.
20832 (getargs): Update to catch new case.
20833 * src/options.c (option_table): 'error-verbose' is a new option.
20834 (shortopts): Update.
20836 2001-11-27 Akim Demaille <akim@epita.fr>
20838 * src/system.h: Use intl/libgettext.h.
20839 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
20841 2001-11-27 Akim Demaille <akim@epita.fr>
20843 * tests/torture.at (Exploding the Stack Size with Malloc):
20844 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
20846 2001-11-27 Akim Demaille <akim@epita.fr>
20848 * src/files.c: Include error.h.
20849 Reported by Hans Aberg.
20851 2001-11-26 Marc Autret <autret_m@epita.fr>
20853 * src/reader.c (parse_include_decl): New, not yet implemented.
20854 (read_declarations): Add case tok_include.
20855 * src/getargs.h (include): Add its extern definition.
20856 * src/getargs.c (include): New const char *.
20857 (getargs): Add case '-I'.
20858 * src/options.c (option_table): Add include as command line and
20860 * src/lex.h (token_t): Add tok_include.
20862 2001-11-26 Akim Demaille <akim@epita.fr>
20864 * src/reader.c (readgram): Make sure rules for mid-rule actions
20865 have a lineno equal to that of their host rule.
20866 Reported by Hans Aberg.
20867 * tests/regression.at (Rule Line Numbers): New.
20869 2001-11-26 Akim Demaille <akim@epita.fr>
20871 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
20874 2001-11-26 Akim Demaille <akim@epita.fr>
20876 * src/complain.c, src/complain.h (error): Remove, provided by
20879 2001-11-26 Akim Demaille <akim@epita.fr>
20881 * src/reader.c (read_declarations): Don't abort on tok_illegal,
20882 issue an error message.
20883 * tests/regression.at (Invalid %directive): New.
20884 Reported by Hans Aberg.
20886 2001-11-26 Akim Demaille <akim@epita.fr>
20888 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
20889 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20891 2001-11-26 Akim Demaille <akim@epita.fr>
20893 * src/conflicts.c (conflicts_print): Don't complain at all when
20894 there are no reduce/reduce conflicts, and as many shift/reduce
20895 conflicts as expected.
20896 * tests/regression.at (%expect right): Adjust.
20898 2001-11-23 Akim Demaille <akim@epita.fr>
20900 * lib/alloca.c: Update, from fileutils.
20902 2001-11-23 Akim Demaille <akim@epita.fr>
20904 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
20906 2001-11-23 Akim Demaille <akim@epita.fr>
20908 * src/system.h: Include alloca.h.
20909 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
20911 2001-11-23 Akim Demaille <akim@epita.fr>
20913 * src/print_graph.c (print_actions): Remove `rule', unused.
20914 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
20915 pacify GCC's signed < unsigned warnings.
20916 * src/closure.c (itemsetsize): Likewise.
20917 * src/reader.c (symbol_list_new): Static.
20919 2001-11-23 Akim Demaille <akim@epita.fr>
20921 Attaching lineno to buckets is stupid, since only one copy of each
20922 symbol is kept, only the line of the first occurrence is kept too.
20924 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
20925 * src/reader.c (rline_allocated): Remove, unused.
20926 (symbol_list): Have a `line' member.
20927 (symbol_list_new): New.
20928 (readgram): Use it.
20929 * src/print.c (print_grammar): Output the rule line numbers.
20930 * tests/regression.at (Solved SR Conflicts)
20931 (Unresolved SR Conflicts): Adjust.
20932 Reported by Hans Aberg.
20934 2001-11-22 Marc Autret <autret_m@epita.fr>
20936 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
20938 2001-11-22 Marc Autret <autret_m@epita.fr>
20940 * src/muscle_tab.c (muscle_init): Remove initialization of
20942 * src/output.c (output_master_parser): Do it here.
20944 2001-11-20 Akim Demaille <akim@epita.fr>
20947 * configure.in (ALL_LINGUAS): Adjust.
20948 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
20949 longer contains strings to translate.
20951 2001-11-19 Akim Demaille <akim@epita.fr>
20953 * src/conflicts.c (conflicts_print): Add a missing \n.
20955 2001-11-19 Akim Demaille <akim@epita.fr>
20957 * src/nullable.c (nullable_print): New.
20958 (set_nullable): Call it when tracing.
20959 Better locality of variables.
20961 2001-11-19 Akim Demaille <akim@epita.fr>
20963 * src/print.c (print_actions): Better locality of variables.
20965 2001-11-19 Akim Demaille <akim@epita.fr>
20967 * src/derives.c (print_derives): Fix and enrich.
20968 * src/closure.c (print_fderives): Likewise.
20970 2001-11-19 Akim Demaille <akim@epita.fr>
20972 * src/closure.c (itemsetend): Remove, replaced with...
20973 (itemsetsize): new.
20975 2001-11-19 Akim Demaille <akim@epita.fr>
20977 * src/LR0.c (kernel_end): Remove, replaced with...
20978 (kernel_size): new.
20980 2001-11-19 Akim Demaille <akim@epita.fr>
20982 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
20985 2001-11-19 Akim Demaille <akim@epita.fr>
20987 * src/closure.c (closure): Use arrays instead of pointers to clarify.
20989 2001-11-19 Akim Demaille <akim@epita.fr>
20991 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
20993 * src/LR0.c: Likewise.
20994 (allocate_itemsets): Use arrays instead of pointers to clarify.
20996 2001-11-19 Akim Demaille <akim@epita.fr>
20998 * src/getargs.c (statistics_flag): Replace with...
21000 (longopts): Accept --trace instead of --statistics.
21001 * src/getargs.h, src/options.c: Adjust.
21002 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
21003 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
21005 2001-11-19 Akim Demaille <akim@epita.fr>
21007 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
21008 pointers to clarify the code.
21009 (save_reductions, save_shifts): Factor common parts of alternatives.
21011 2001-11-19 Akim Demaille <akim@epita.fr>
21013 * src/LR0.c (new_state, get_state): Complete TRACE code.
21014 * src/closure.c: Include `reader.h' to get `tags', needed by the
21016 Rename the conditional DEBUG as TRACE.
21017 Output consistently TRACEs to stderr, not stdout.
21018 * src/derives.c: Likewise.
21019 * src/reduce.c: (inaccessable_symbols): Using if is better style
21021 Use `#if TRACE' instead of `#if 0' for tracing code.
21023 2001-11-19 Akim Demaille <akim@epita.fr>
21025 * src/system.h (LIST_FREE, shortcpy): New.
21026 * src/LR0.c: Use them.
21027 * src/output.c (free_itemsets, free_reductions, free_shifts):
21028 Remove, replaced by LIST_FREE.
21030 2001-11-19 Akim Demaille <akim@epita.fr>
21032 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
21033 (REDUCTIONS_ALLOC): New.
21034 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
21037 2001-11-19 Akim Demaille <akim@epita.fr>
21039 * src/LR0.c (new_state): Complete trace code.
21040 * src/nullable.c (set_nullable): Don't translate traces.
21042 2001-11-19 Akim Demaille <akim@epita.fr>
21044 * src/print_graph.c (print_core): Better locality of variables.
21045 * src/print.c (print_core): Likewise.
21047 2001-11-19 Akim Demaille <akim@epita.fr>
21049 * src/vcg.c: You do the output, so you are responsible of the
21050 handling of VCG syntax, in particular: use quotearg.
21051 * src/print_graph.c: Don't.
21052 (print_actions): Don't output the actions as part of the nodes,
21053 since that's the job of the edges.
21054 (print_state): Don't output by hand: fill the node description,
21055 and ask for its output.
21057 2001-11-19 Akim Demaille <akim@epita.fr>
21059 * src/bison.simple (yyparse): When verbosely reporting an error,
21060 no longer put additional quotes around token names.
21061 * tests/calc.at: Adjust.
21063 2001-11-19 Akim Demaille <akim@epita.fr>
21065 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
21066 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
21067 * src/output.c: Adjust.
21069 2001-11-19 Akim Demaille <akim@epita.fr>
21071 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
21073 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
21075 2001-11-19 Akim Demaille <akim@epita.fr>
21077 * src/gram.h (rule_t): New.
21079 (rrhs, rlhs): Remove, part of state_t.
21080 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
21081 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
21082 * src/reader.c, src/reduce.c: Adjust.
21084 2001-11-19 Akim Demaille <akim@epita.fr>
21086 * src/reader.c (symbols_output): New, extracted from...
21087 (packsymbols): Here.
21090 2001-11-19 Akim Demaille <akim@epita.fr>
21092 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
21093 (maxrhs): this new function.
21095 2001-11-19 Akim Demaille <akim@epita.fr>
21097 * src/lalr.c (F): New macro to access the variable F.
21100 2001-11-19 Akim Demaille <akim@epita.fr>
21102 * src/lalr.h (LA): New macro to access the variable LA.
21103 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21104 * src/lalr.c: Adjust.
21106 2001-11-19 Akim Demaille <akim@epita.fr>
21108 * src/lalr.c (initialize_LA): Only initialize LA. Let...
21109 (set_state_table): handle the `lookaheads' members.
21111 2001-11-19 Akim Demaille <akim@epita.fr>
21113 * src/lalr.h (lookaheads): Removed array, whose contents is now
21115 (state_t): this structure.
21116 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21119 2001-11-19 Akim Demaille <akim@epita.fr>
21121 * src/lalr.h (consistent): Removed array, whose contents is now
21123 (state_t): this structure.
21124 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21127 2001-11-19 Akim Demaille <akim@epita.fr>
21129 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
21130 contents are now members of...
21131 (state_t): this structure.
21132 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21135 2001-11-19 Akim Demaille <akim@epita.fr>
21137 * src/lalr.h (state_t): New.
21138 (state_table): Be a state_t * instead of a core **.
21139 (accessing_symbol): Remove, part of state_t.
21140 * src/lalr.c: Adjust.
21141 (set_accessing_symbol): Merge into...
21142 (set_state_table): this.
21143 * src/print_graph.c, src/conflicts.c: Adjust.
21145 2001-11-14 Akim Demaille <akim@epita.fr>
21147 * tests/calc.at, tests/output.at, tests/regression.at,
21148 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
21149 now the tests are run in private dirs, therefore AC_CLEANUP and
21150 family can be simplified to 0-ary.
21151 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
21152 use abs. path to find config.h.
21153 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
21154 stderr, there can be way too much random noise.
21155 Instead pass -Werror to GCC and rely on the exit status.
21156 Reported by Wolfram Wagner.
21158 2001-11-14 Akim Demaille <akim@epita.fr>
21160 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
21161 defined only if yyoverflow is defined, to avoid `warning: unused
21163 Reported by The Test Suite.
21165 2001-11-14 Akim Demaille <akim@epita.fr>
21167 * src/print.c: Include reduce.h.
21168 Reported by Hans Aberg.
21170 2001-11-14 Akim Demaille <akim@epita.fr>
21172 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
21173 Revert a previous patch: these are really const.
21174 * src/conflicts.c (conflict_report): Additional useless pair of
21175 braces to pacify GCC's warnings for `if () if () {} else {}'.
21176 * src/lex.c (parse_percent_token): Replace equal_offset with
21179 Be sure to strdup `arg' when used, since there is no reason for
21180 token_buffer not to change.
21182 2001-11-14 Akim Demaille <akim@epita.fr>
21184 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
21186 * src/main.c (main): Use them.
21187 Suggested by Hans Aberg.
21189 2001-11-12 Akim Demaille <akim@epita.fr>
21191 * src/system.h (ngettext): Now that we use ngettext, be sure to
21192 provide a default definition when NLS are not used.
21194 2001-11-12 Akim Demaille <akim@epita.fr>
21196 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
21197 Use @kbd to denote user input.
21198 (Language and Grammar): ANSIfy the example.
21199 Adjust its layout for info/notinfo.
21200 (Location Tracking Calc): Output error messages to stderr.
21201 Output locations in a more GNUtically correct way.
21202 Fix a couple of Englishos.
21203 Adjust @group/@end group pairs.
21205 2001-11-12 Akim Demaille <akim@epita.fr>
21207 %expect was not functioning at all.
21209 * src/conflicts.c (expected_conflicts): Set to -1.
21210 (conflict_report): Use ngettext.
21211 (conflicts_print): Check %expect and make its violation an error.
21212 * doc/bison.texinfo (Expect Decl): Adjust.
21213 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
21214 * tests/regression.at (%expect not enough, %expect right)
21215 (%expect too much): New.
21217 2001-11-12 Akim Demaille <akim@epita.fr>
21219 * tests/regression.at (Conflicts): Rename as...
21220 (Unresolved SR Conflicts): this.
21221 (Solved SR Conflicts): New.
21223 2001-11-12 Akim Demaille <akim@epita.fr>
21225 * src/reduce.c (print_results): Rename as...
21226 (reduce_output): This.
21227 Output to OUT, passed as argument, instead of output_obstack.
21228 (dump_grammar): Likewise.
21229 (reduce_free): New.
21231 (reduce_grammar): No longer call reduce_output, since...
21232 * src/print.c (print_results): do it.
21233 * src/main.c (main): Call reduce_free;
21235 2001-11-12 Akim Demaille <akim@epita.fr>
21237 * src/conflicts.c (print_reductions): Accept OUT as argument.
21238 Output to it, not to output_obstack.
21239 * src/print.c (print_actions): Adjust.
21241 2001-11-12 Akim Demaille <akim@epita.fr>
21243 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
21244 the result instead of using...
21245 (src_total, rrc_total, src_count, rrc_count): Remove.
21246 (any_conflicts): Remove.
21247 (print_conflicts): Split into...
21248 (conflicts_print, conflicts_output): New.
21249 * src/conflicts.h: Adjust.
21250 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
21251 * src/print.c (print_grammar): Issue `\n' between two rules.
21252 * tests/regression.at (Conflicts): New.
21253 Reported by Tom Lane.
21255 2001-11-12 Akim Demaille <akim@epita.fr>
21257 * tests/regression.at (Invalid input): Remove, duplicate with
21258 ``Invalid input: 1''.
21260 2001-11-12 Akim Demaille <akim@epita.fr>
21262 * tests/torture.at (AT_DATA_STACK_TORTURE)
21263 (Exploding the Stack Size with Alloca)
21264 (Exploding the Stack Size with Malloc): New.
21266 2001-11-12 Akim Demaille <akim@epita.fr>
21268 * src/bison.simple (YYSTACK_REALLOC): New.
21269 (yyparse) [!yyoverflow]: Use it and free the old stack.
21270 Reported by Per Allansson.
21272 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
21274 * src/bison.simple: Define type yystype instead of YYSTYPE, and
21275 define CPP macro, which substitute YYSTYPE by yystype.
21276 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
21277 with yyltype/YYLTYPE. This allows inclusion of the generated
21278 header within the parser if the compiler, such as GGC, accepts
21279 multiple equivalent #defines.
21282 2001-11-05 Akim Demaille <akim@epita.fr>
21284 * src/reader.c (symbols_output): New, extracted from...
21285 (packsymbols): here.
21288 2001-11-05 Akim Demaille <akim@epita.fr>
21290 * src/lex.c (parse_percent_token): s/quotearg/quote/.
21292 2001-11-05 Akim Demaille <akim@epita.fr>
21294 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
21297 2001-11-05 Akim Demaille <akim@epita.fr>
21299 * src/options.h (struct option_table_struct): set_flags is void*.
21300 * src/options.c (longopts): Support `--output' and `%output'.
21302 * src/lex.h (tok_setopt): Remove, replaced with...
21303 (tok_intopt, tok_stropt): these new guys.
21304 * src/lex.c (getopt.h): Not needed.
21305 (token_buffer, unlexed_token_buffer): Not const.
21306 (percent_table): Promote `-' over `_' in directive names.
21307 Active `%name-prefix', `file-prefix', and `output'.
21308 (parse_percent_token): Accept possible arguments to directives.
21309 Promote `-' over `_' in directive names.
21311 2001-11-04 Akim Demaille <akim@epita.fr>
21313 * doc/bison.texinfo (Decl Summary): Split the list into
21314 `directives for grammars' and `directives for bison'.
21316 Add description of `%name-prefix', `file-prefix', and `output'.
21317 Promote `-' over `_' in directive names.
21318 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
21319 Simplify the description of `--name-prefix'.
21320 Promote `-' over `_' in directive names.
21321 Promote `--output' over `--output-file'.
21322 Fix the description of `--defines'.
21323 * tests/output.at: Exercise %file-prefix and %output.
21325 2001-11-02 Akim Demaille <akim@epita.fr>
21327 * doc/refcard.tex: Update.
21329 2001-11-02 Akim Demaille <akim@epita.fr>
21331 * src/symtab.h (SUNDEF): New.
21332 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
21333 stand for `uninitialized', instead of 0.
21334 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
21335 * src/lex.c (lex): Adjust.
21337 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
21339 Let yylex return it instead of a plain 0.
21340 Reported by Dick Streefland.
21342 2001-11-02 Akim Demaille <akim@epita.fr>
21344 * tests/regression.at (Mixing %token styles): New test.
21346 2001-11-02 Akim Demaille <akim@epita.fr>
21348 * src/reader.c (parse_thong_decl): Formatting changes.
21349 (token_translations_init): New, extracted from...
21350 (packsymbols): Here.
21353 2001-11-01 Akim Demaille <akim@epita.fr>
21355 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
21356 Check that `9foo.y' produces correct cpp guards.
21357 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
21361 2001-11-01 Akim Demaille <akim@epita.fr>
21363 * tests/regression.at (Invalid input: 2): New.
21364 * src/lex.c (unlexed_token_buffer): New.
21365 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
21369 2001-11-01 Akim Demaille <akim@epita.fr>
21371 * tests/calc.at: Catch up with 1.30.
21372 * configure.in: Bump to 1.49a.
21373 Adjust to newer Autotest.
21375 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
21377 * src/conflicts.c: Move global variables rrc_total and src_total ...
21378 (print_conflicts): here.
21379 * src/output.c (output): Free global variable user_toknums.
21380 * src/lex.c (token_obstack): Become static.
21382 2001-10-18 Akim Demaille <akim@epita.fr>
21384 * tests/atlocal.in (GCC): Add.
21385 * tests/calc.at: s/m4_match/m4_bmatch/.
21386 s/m4_patsubst/m4_bpatsubst/.
21387 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
21388 * configure.in: AC_SUBST(GCC).
21390 2001-10-14 Marc Autret <autret_m@epita.fr>
21392 * src/options.c (create_long_option_table): Fix.
21394 2001-10-10 Akim Demaille <akim@epita.fr>
21396 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
21398 2001-10-04 Akim Demaille <akim@epita.fr>
21400 * src/reader.c (parse_union_decl): Push the caracters in
21401 union_obstack, not attrs_obstack.
21403 2001-10-04 Akim Demaille <akim@epita.fr>
21405 Merge in the branch 1.29.
21407 * src/reader.c (packsymbols): Use a temporary obstack for
21408 `%%tokendef', since output_stack is already used elsewhere.
21410 2001-10-02 Akim Demaille <akim@epita.fr>
21414 2001-10-02 Akim Demaille <akim@epita.fr>
21418 2001-10-02 Akim Demaille <akim@epita.fr>
21420 * tests/regression.at (Invalid CPP headers): New.
21421 From Alexander Belopolsky.
21422 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
21424 2001-10-02 Akim Demaille <akim@epita.fr>
21426 * tests/regression.at (Invalid input): New.
21427 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
21430 2001-10-02 Akim Demaille <akim@epita.fr>
21432 * tests/calc.at: Now that --debug works, the tests must be adjusted.
21434 2001-10-02 Akim Demaille <akim@epita.fr>
21436 * src/output.c (output_parser): Assert `skeleton'.
21437 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
21441 2001-10-01 Marc Autret <autret_m@epita.fr>
21443 * src/lex.h: Echo modifications.
21444 * src/lex.c (unlex): Parameter is now token_t.
21447 2001-10-01 Marc Autret <autret_m@epita.fr>
21449 * src/main.c: Include lex.h.
21452 2001-09-29 Akim Demaille <akim@epita.fr>
21454 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
21456 2001-09-28 Akim Demaille <akim@epita.fr>
21458 * tests/testsuite.at: Update to newer Autotest.
21459 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
21461 2001-09-27 Akim Demaille <akim@epita.fr>
21463 Position independent wrapper.
21465 * tests/bison: Remove.
21466 * tests/bison.in: New.
21467 * configure.in: Adjust.
21469 2001-09-27 Paul Eggert <eggert@twinsun.com>
21471 Port quotearg fixes from tar 1.13.24.
21473 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
21475 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
21476 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
21478 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
21479 * m4/mbrtowc.m4: New file.
21480 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
21481 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
21483 2001-09-27 Akim Demaille <akim@epita.fr>
21487 2001-09-27 Akim Demaille <akim@epita.fr>
21491 2001-09-25 Akim Demaille <akim@epita.fr>
21493 * src/system.h: Include `xalloc.h'.
21494 Remove it from the C files.
21495 * src/files.c (output_files): Free the obstacks.
21496 * src/lex.c (init_lex): Rename as...
21499 * src/main.c (main): Use it.
21501 2001-09-24 Marc Autret <autret_m@epita.fr>
21503 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
21504 to output informations in fout (FILE*).
21505 (open_graph, close_graph): Likewise.
21506 (output_graph, output_edge, output_node): Likewise.
21507 * src/vcg.h: Update function prototypes.
21508 * src/print_graph.c (print_graph): Open output graph file.
21509 (print_actions): Adjust.
21510 * src/files.h: Remove extern declaration.
21511 * src/files.c: Remove graph_obstack declaration.
21512 (open_files): Remove graph_obstack initialization.
21513 (output_files): Remove graph_obstack saving.
21515 2001-09-24 Marc Autret <autret_m@epita.fr>
21517 * src/files.c (compute_output_file_names): Fix.
21519 2001-09-24 Marc Autret <autret_m@epita.fr>,
21520 Akim Demaille <akim@epita.fr>
21522 * src/reader.c (reader): Remove call to free_symtab ().
21523 * src/main.c (main): Call it here.
21525 * src/conflicts.c (initialize_conflicts): Rename as...
21526 (solve_conflicts): this.
21527 * src/print.c (print_core, print_actions, print_state)
21528 (print_grammar): Dump to a file instead a `output_obstack'.
21529 (print_results): Dump `output_obstack', and then proceed with the
21531 * src/files.c (compute_output_file_names, close_files): New.
21532 (output_files): Adjust.
21533 * src/main.c (main): Adjust.
21535 2001-09-23 Marc Autret <autret_m@epita.fr>
21537 * src/files.c (compute_header_macro): Computes header macro name
21538 from spec_defines_file when given.
21540 2001-09-23 Marc Autret <autret_m@epita.fr>
21542 * src/files.c (output_files): Add default extensions.
21544 2001-09-22 Akim Demaille <akim@epita.fr>
21546 * src/conflicts.c (finalize_conflicts): Rename as...
21547 (free_conflicts): this.
21549 2001-09-22 Akim Demaille <akim@epita.fr>
21551 * src/gram.c (gram_free): Rename back as...
21553 (output_token_translations): Free `token_translations'.
21554 * src/symtab.c (free_symtab): Free the tag field.
21556 2001-09-22 Akim Demaille <akim@epita.fr>
21558 Remove `translations' as it is always set to true.
21560 * src/gram.h: Adjust.
21561 * src/reader.c (packsymbols, parse_token_decl): Adjust
21562 * src/print.c (print_grammar): Adjust.
21563 * src/output.c (output_token_translations): Adjust.
21564 * src/lex.c (lex): Adjust.
21565 * src/gram.c: Be sure the set pointers to NULL.
21566 (dummy): Rename as...
21569 2001-09-22 Akim Demaille <akim@epita.fr>
21571 * configure.in: Invoke AM_LIB_DMALLOC.
21572 * src/system.h: Use dmalloc.
21573 * src/LR0.c: Be sure to have pointers initialized to NULL.
21574 (allocate_itemsets): Allocate kernel_items only if needed.
21576 2001-09-22 Akim Demaille <akim@epita.fr>
21578 * configure.in: Bump to 1.29b.
21579 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
21580 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
21581 need xmalloc.c in calc.y.
21584 2001-09-21 Akim Demaille <akim@epita.fr>
21587 * Makefile.maint, config/config.guess, config/config.sub,
21588 * config/missing: Update from masters.
21589 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
21591 * configure.in (ALL_LINGUAS): Add `tr'.
21593 2001-09-21 Akim Demaille <akim@epita.fr>
21595 * tests/Makefile.am (package.m4): Move to...
21596 ($(srcdir)/$(TESTSUITE)): here.
21598 2001-09-20 Akim Demaille <akim@epita.fr>
21600 * src/complain.c: No longer try to be standalone: use system.h.
21601 Don't assume __STDC__ is defined to 1. Just test if it is defined.
21602 * src/complain.h: Likewise.
21603 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
21604 Remove the unused variable `n'.
21605 From Albert Chin-A-Young.
21607 2001-09-18 Marc Autret <autret_m@epita.fr>
21609 * doc/bison.1: Update.
21610 * doc/bison.texinfo (Bison Options): Update --defines and --graph
21612 (Option Cross Key): Update.
21615 2001-09-18 Marc Autret <autret_m@epita.fr>
21617 * tests/regression.at: New test (comment in %union).
21619 2001-09-18 Marc Autret <autret_m@epita.fr>
21621 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
21623 Reported by Keith Browne.
21625 2001-09-18 Marc Autret <autret_m@epita.fr>
21627 * tests/output.at: Add tests for --defines and --graph.
21629 2001-09-18 Marc Autret <autret_m@epita.fr>
21631 * tests/output.at: Removes tests of %{header,src}_extension features.
21633 2001-09-18 Akim Demaille <akim@epita.fr>
21635 * tests/Makefile.am (package.m4): New.
21636 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
21637 (_AT_CHECK_CALC_ERROR): Likewise.
21638 Factor the `, ' part of verbose error messages.
21640 2001-09-18 Marc Autret <autret_m@epita.fr>
21642 * src/getargs.c (longopts): Declare --defines and --graph as options
21643 with optional arguments.
21644 * src/files.h: Add extern declarations.
21645 * src/files.c (spec_graph_file, spec_defines_file): New.
21646 (output_files): Update.
21647 Remove CPP-outed code.
21649 2001-09-18 Marc Autret <autret_m@epita.fr>
21651 Turn off %{source,header}_extension feature.
21653 * src/files.c (compute_exts_from_gf): Update.
21654 (compute_exts_from_src): Update.
21655 (output_files): CPP-out useless code.
21656 * src/files.h: Remove {header,source}_extension extern declarations.
21657 * src/reader.c (parse_dquoted_param): CPP-out.
21658 (parse_header_extension_decl): Remove.
21659 (parse_source_extension_decl): Remove.
21660 (read_declarations): Remove cases tok_{hdrext,srcext}.
21661 * src/lex.c (percent_table): Remove {header,source}_extension entries.
21662 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
21664 2001-09-10 Akim Demaille <akim@epita.fr>
21666 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
21667 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
21668 (AT_CHECK_OUTPUT): this.
21669 Merely check ls' exit status, its output is useless.
21671 2001-09-10 Akim Demaille <akim@epita.fr>
21673 * tests/calc.at: Use m4_match.
21674 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
21676 2001-09-10 Marc Autret <autret_m@epita.fr>,
21677 Akim Demaille <akim@epita.fr>
21679 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
21681 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
21683 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
21684 * src/lex.h: Adjust prototype.
21685 (token_t): Add `tok_undef'.
21686 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
21687 (parse_percent_token): Now returns token_t.
21688 Add default statement in switch.
21689 (lex): Separate `c' as an input variable, from the token_t result
21691 (unlexed): Is a token_t.
21693 2001-09-10 Akim Demaille <akim@epita.fr>
21695 * configure.in: Bump to 1.29a.
21697 2001-09-07 Akim Demaille <akim@epita.fr>
21701 2001-08-30 Akim Demaille <akim@epita.fr>
21703 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
21704 * m4/atconfig.m4: Remove.
21705 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
21706 * tests/bison: New.
21707 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
21708 m4_if, m4_patsubst, and m4_regexp.
21709 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
21710 `input' file instead of echo.
21712 2001-08-29 Akim Demaille <akim@epita.fr>
21716 2001-08-29 Akim Demaille <akim@epita.fr>
21720 2001-08-29 Paul Eggert <eggert@twinsun.com>
21722 * src/bison.simple (yyparse): Don't take the address of an
21723 item before the start of an array, as that doesn't conform to
21726 2001-08-29 Robert Anisko <anisko_r@epita.fr>
21728 * doc/bison.texinfo (Location Tracking Calc): New node.
21730 2001-08-29 Paul Eggert <eggert@twinsun.com>
21732 * src/output.c (output): Do not define const, as this now
21733 causes more problems than it cures.
21735 2001-08-29 Akim Demaille <akim@epita.fr>
21737 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
21739 Be sure to tag the `detailmenu'.
21741 2001-08-29 Akim Demaille <akim@epita.fr>
21743 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
21744 download in a tmp dir.
21746 2001-08-28 Marc Autret <autret_m@epita.fr>
21748 * config/depcomp: New file.
21750 2001-08-28 Marc Autret <autret_m@epita.fr>
21752 * doc/bison.1 (mandoc): Adjust.
21753 From Juan Manuel Guerrero.
21755 2001-08-28 Marc Autret <autret_m@epita.fr>
21757 * src/print_graph.c (print_state): Fix.
21759 2001-08-27 Marc Autret <autret_m@epita.fr>
21761 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
21763 Echo modifications to the functions prototypes.
21764 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
21766 2001-08-27 Marc Autret <autret_m@epita.fr>
21768 * src/vcg.c: Include `xalloc.h'.
21769 (add_colorentry): New.
21770 (add_classname): New.
21771 (add_infoname): New.
21772 * src/vcg.h: Add new prototypes.
21774 2001-08-27 Akim Demaille <akim@epita.fr>
21776 * Makefile.maint: Sync. again with CVS Autoconf.
21778 2001-08-27 Akim Demaille <akim@epita.fr>
21780 * Makefile.maint: Formatting changes.
21781 (po-update, cvs-update, update): New targets.
21784 2001-08-27 Akim Demaille <akim@epita.fr>
21786 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
21787 * Makefile.maint: Sync. with CVS Autoconf.
21789 2001-08-27 Marc Autret <autret_m@epita.fr>
21791 * src/vcg.h (struct infoname_s): New.
21792 (struct colorentry_s): New.
21793 (graph_s): New fields {vertical,horizontal}_order in structure.
21794 Add `infoname' field.
21795 Add `colorentry' field;
21796 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
21797 (G_HORIZONTAL_ORDER): New.
21799 (G_COLORENTRY): New.
21800 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
21801 Add output of `infoname'.
21802 Add output of `colorentry'.
21804 2001-08-27 Marc Autret <autret_m@epita.fr>
21806 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
21807 This one shadowed a global parameter.
21809 2001-08-24 Marc Autret <autret_m@epita.fr>
21811 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
21812 instead of `unsigned'.
21813 (print_state): Do not call obstack_object_size () in obstack_grow ()
21814 to avoid macro variables shadowing.
21816 2001-08-23 Marc Autret <autret_m@epita.fr>
21818 * src/lex.c (percent_table): Typo: s/naem/name/.
21820 Normalize new options declarations.
21822 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
21824 * tests/suite.at: Exercise %header_extension and %source_extension.
21826 2001-08-16 Marc Autret <autret_m@epita.fr>
21828 * src/reader.c (parse_dquoted_param): New.
21829 (parse_header_extension_decl): Use it.
21830 (parse_source_extension_decl): Likewise.
21832 2001-08-16 Marc Autret <autret_m@epita.fr>
21834 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
21835 (get_xxxx_str): Use assert () instead of complain ().
21836 Remove return invokations in default cases.
21837 (get_decision_str): Modify default behaviour. Remove second argument.
21838 Echo modifications on calls.
21839 (output_graph): Fix.
21841 2001-08-16 Marc Autret <autret_m@epita.fr>
21843 * src/getargs.c (usage): Update with ``-g, --graph''.
21845 2001-08-16 Marc Autret <autret_m@epita.fr>
21847 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
21848 (Option Cross Key): Likewise.
21849 * doc/bison.1: Update.
21851 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
21853 * src/output.c (output_master_parser): Don't finish action_obstack.
21854 (output_parser): Don't care about the muscle action, here.
21855 (prepare): Copy the action_obstack in the action muscle.
21856 (output): Free action_obstack.
21858 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
21860 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
21861 will contain `%union' declaration.
21862 (parse_union_decl): Delete #line directive output.
21863 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
21864 informations about %union.
21865 (parse_union_decl): Copy the union_obstack in the muscle stype.
21866 * src/bison.simple: Add new #line directive.
21867 Add typdef %%stype YYSTYPE.
21869 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
21871 * src/bison.simple: Add new `#line' directive.
21873 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
21875 * src/bison.simple: New `#line' directive.
21876 * src/output.c (output_parser): Support new dynamic muscle input_line.
21878 2001-09-22 Marc Autret <autret_m@epita.fr>
21880 * src/output.c (output_master_parser): New.
21881 (output_parser): Be more re-entrant.
21883 2001-09-21 Marc Autret <autret_m@epita.fr>
21885 * src/reader.c (copy_definition, parse_union_decl): Update and use
21887 (copy_action): Likewise.
21888 Use obstack_1grow ().
21889 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
21891 2001-09-21 Marc Autret <autret_m@epita.fr>
21893 * src/options.c (option_table): Adjust.
21894 * src/lex.c (parse_percent_token): Fix.
21896 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
21898 * src/options.c (symtab.h): Include it, need by lex.h.
21900 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
21902 * src/lex.c (parse_percent_token): Change type of variable `tx', which
21903 is now an option_table_struct*.
21904 (option_strcmp): New function option_strcmp.
21905 (parse_percent_token): Call option_strcmp.
21906 * src/getargs.c (xalloc.h, options.h): Include it.
21907 (getargs): Call create_long_option_table.
21908 (getargs): Free longopts at the end of the function.
21909 (shortopts): Move in options.c.
21910 * src/options.c (create_long_option_table): New function. Convert
21911 information from option_table to option structure.
21912 * src/reader.c (options.h): Include it.
21914 * src/Makefile.am: Adjust.
21915 * src/options.c (option_table): Create from longopts and percent_table.
21916 * src/getargs.c (longopts): Delete.
21917 * src/lex.c (struct percent_table_struct): Delete.
21918 (percent_table): Delete.
21919 (options.h): Include it.
21920 * src/options.c: Create.
21921 * src/options.h: Create.
21922 Declare enum opt_access_e.
21923 Define struct option_table_struct.
21925 2001-09-20 Marc Autret <autret_m@epita.fr>
21927 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
21930 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
21932 * src/bison.simple: s/%%filename/%%skeleton.
21933 * src/muscle_tab.c (getargs.h): Include it.
21934 (muscle_init): Insert new muscle skeleton.
21936 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
21938 * src/output.c (output_parser): Delete unused variable actions_dumped.
21940 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
21942 * src/output.c (output): Delete call to reader_output_yylsp.
21943 * src/reader.c (reader): Likewise.
21944 * src/reader.h: Delete declaration of reader_output_yylsp.
21946 2001-09-02 Marc Autret <autret_m@epita.fr>
21948 * src/reader.c: Include muscle_tab.h.
21949 (parse_union_decl): Update.
21950 (parse_macro_decl): Rename parse_muscle_decl.
21951 Update to use renamed functions and variable.
21952 (read_declarations, copy_action, read_additionnal_code, : Updated
21953 with correct variables and functions names.
21954 (packsymbols, reader): Likewise.
21956 * src/reader.h (muscle_obstack): Extern declaration update.
21958 * src/output.c: Include muscle_tab.h
21959 In all functions using macro_insert, change by using muscle_insert ().
21960 (macro_obstack): Rename muscle_obstack.
21961 Echo modifications in the whole file.
21962 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
21963 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
21964 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
21966 * src/muscle_tab.h: Update double inclusion macros.
21967 (macro_entry_s): Rename muscle_entry_s.
21970 * src/muscle_tab.c: Include muscle_tab.h.
21971 Rename macro_tabble to muscle_table.
21972 (mhash1, mhash2, mcmp): Use muscle_entry.
21973 (macro_init): Rename muscle_init. Update.
21974 (macro_insert): Rename muscle_insert. Update.
21975 (macro_find): Rename muscle_find. Update.
21977 * src/main.c: Include muscle_tab.h.
21978 (main): Call muscle_init ().
21979 * src/Makefile.am (bison_SOURCES): Echo modifications.
21981 2001-09-02 Marc Autret <autret_m@epita.fr>
21983 Now the files macro_tab.[ch] are named muscle_tab.[ch].
21985 * src/muscle_tab.c, src/muscle_tab.h: Add files.
21987 2001-09-02 Marc Autret <autret_m@epita.fr>
21989 * src/macrotab.c, src/macrotab.h: Remove.
21991 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
21993 * src/reader.c (copy_guard): Use muscle to specify the `#line'
21996 2001-09-01 Marc Autret <autret_m@epita.fr>
21998 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
21999 to an explicit value to activate the feature. We do it here.
22001 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
22003 * src/output.c (prepare): Delete the `filename' muscule insertion.
22004 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
22005 (parse_union_decl): Likewise.
22006 * src/macrotab.c (macro_init): Initialize filename by infile.
22008 2001-08-31 Marc Autret <autret_m@epita.fr>
22010 * src/bison.simple (YYLSP_NEEDED): New definition.
22011 * src/output.c (prepare): Add macro insertion of `locations_flag'
22013 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
22015 * src/output.c (prepare): Delete insertion of previous muscles,
22016 and insert the `prefix' muscles.
22017 * src/macrotab.c (macro_init): Likewise.
22018 (macro_init): Initialization prefix directive by `yy'.
22019 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
22020 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
22021 yylval, yydebug, yyerror, yynerrs and yyparse.
22022 New directive `#define' to substitute yydebug, ... with option
22025 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
22027 * src/main.c (main): Standardize.
22028 * src/output.c (output_table_data, output_parser): Likewise.
22029 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
22031 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
22033 * src/reader.c (read_additionnal_code): Rename %%user_code to
22035 * src/output.c (output): Rename %%declarations to %%prologue.
22036 * src/bison.simple: Echo modifications.
22038 2001-08-31 Marc Autret <autret_m@epita.fr>
22040 * src/reader.c (readgram): CleanUp.
22041 (output_token_defines): Likewise.
22042 (packsymbols): Likewise.
22043 (reader): Likewise.
22044 * src/output.c (output): CPP-out useless code.
22046 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
22048 * src/reader.c (reader): Delete obsolete call to function
22049 output_trailers and output_headers.
22050 * src/output.h: Remove obsolete functions prototypes of output_headers
22051 and output_trailers.
22053 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
22055 * src/main.c: Include macrotab.h.
22056 * src/macrotab.h (macro_entry_s): Constify fields.
22057 Adjust functions prototypes.
22058 * src/macrotab.c (macro_insert): Constify key and value.
22059 (macro_find): Constify key.
22060 (macro_insert): Include 'xalloc.h'
22061 (macro_insert): Use XMALLOC.
22062 (macro_find): Constify return value.
22063 * src/output.c (output_table_data): Rename table to table_data.
22064 (output_parser): Constify macro_key, macro_value.
22066 2001-08-30 Marc Autret <autret_m@epita.fr>
22068 * src/reader.c (parse_skel_decl): New.
22069 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
22070 * src/lex.h (token_t): New token `tok_skel'.
22071 * src/lex.c (percent_table): Add skeleton option entry.
22074 2001-08-29 Marc Autret <autret_m@epita.fr>
22076 * src/bison.simple: Add %%user_code directive at the end.
22077 * src/reader.c (read_additionnal_code): New.
22079 * src/output.c (output_program): Remove.
22082 2001-08-28 Marc Autret <autret_m@epita.fr>
22084 * src/output.c (output_actions): Clean up.
22085 (output_gram): CPP-out useless code.
22086 * src/reader.c (reader): Clean up, CPP-out useless code.
22088 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
22090 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
22092 * src/bison.simple: Add `%%definitions'.
22094 2001-08-28 Marc Autret <autret_m@epita.fr>
22096 * config/depcomp: New file.
22098 2001-08-27 Paul Eggert <eggert@twinsun.com>
22100 * src/bison.simple (yyparse): Don't take the address of an
22101 item before the start of an array, as that doesn't conform to
22104 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
22106 * src/output.c (output): Remove the initialization of the macro
22107 obstack. It was done too late here.
22109 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
22111 (reader): Initialize the macro obstack here, since we need it to grow
22112 '%define' directives.
22114 * src/reader.h: Declare the macro obstack as extern.
22116 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
22118 * src/output.c (output_parser): Fix. Store single '%' characters in
22119 the output obstack instead of throwing them away.
22121 2001-08-27 Akim Demaille <akim@epita.fr>
22123 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
22125 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22127 * lib/Makefile.am: Adjust.
22129 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22131 * src/bison.simple: Update and add '%%' directives.
22133 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22135 * src/reader.c (reader): Remove calls to 'output_headers' and
22136 'output_trailers'. Remove some C output.
22137 (readgram): Disable a piece of code that was writing a default
22138 definition for 'YYSTYPE'.
22139 (reader_output_yylsp): Remove.
22140 (packsymbols): Output token defintions to a macro.
22141 (copy_definition): Disable C output.
22143 * src/reader.c (parse_macro_decl): New function used to parse macro
22145 (copy_string2): Put the body of copy_string into this new function.
22146 Add a parameter to let the caller choose whether he wants to copy the
22147 string delimiters or not.
22148 (copy_string): Be a simple call to copy_string2 with the last argument
22150 (read_declarations): Add case for macro definition.
22151 (copy_identifier): New.
22152 (parse_macro_decl): Read macro identifiers using copy_identifier
22155 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22157 * src/output.c (prepare): Add prefixed names.
22158 (output_parser): Output semantic actions.
22159 (output_parser): Fix bug on '%%line' directives.
22161 * src/output.c (output_headers): Remove. The C code printed by this
22162 function should now be in the skeletons.
22163 (output_trailers): Remove.
22164 (output): Disable call to 'reader_output_yylsp'.
22165 (output_rule_data): Do not output tables to the table obstack.
22167 * src/output.c: Remove some C dedicated output.
22168 Improve the use of macro and output obstacks.
22169 (output_defines): Remove.
22171 * src/output.c (output_token_translations): Associate 'translate'
22172 table with a macro. No output to the table obstack.
22173 (output_gram): Same for 'rhs' and 'prhs'.
22174 (output_stos): Same for 'stos'.
22175 (output_rule_data): Same for 'r1' and 'r2'.
22176 (token_actions): Same for 'defact'.
22177 (goto_actions): Same for 'defgoto'.
22178 (output_base): Same for 'pact' and 'pgoto'.
22179 (output_table): Same for 'table'.
22180 (output_check): Same for 'check'.
22182 * src/output.c (output_table_data): New function.
22183 (output_short_table): Remove.
22184 (output_short_or_char_table): Remove.
22186 * src/output.c (output_parser): Replace most of the skeleton copy code
22187 with something new. Skeletons are now processed character by character
22188 rather than line by line, and Bison looks for '%%' macros. This is the
22189 first step in making Bison's output process (a lot) more flexible.
22190 (output_parser): Use the macro table.
22192 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22194 * src/main.c (main): Initialize the macro table.
22196 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22198 * src/lex.c (percent_table): Add tok_define.
22199 * src/lex.h: Add tok_define.
22201 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22203 * src/macrotab.c: New file.
22204 * src/macrotab.h: New file.
22205 * src/Makefile.am: Update.
22207 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22209 * lib/hash.c: New file.
22210 * lib/hash.h: New file.
22211 * lib/Makefile.am: Update.
22213 2001-08-15 Akim Demaille <akim@epita.fr>
22217 2001-08-15 Marc Autret <autret_m@epita.fr>
22219 * src/reader.c (readgram): Indent output macro YYSTYPE.
22220 (packsymbols): Likewise.
22221 (output_token_defines): Likewise.
22222 * src/files.c: Standardize.
22223 (compute_header_macro): New.
22224 (defines_obstack_save): New. Use compute_header_macro.
22225 (output_files): Update. Use defines_obstack_save.
22227 2001-08-15 Akim Demaille <akim@epita.fr>
22229 * doc/bison.texinfo (Table of Symbols): Document
22230 YYSTACK_USE_ALLOCA.
22232 2001-08-15 Akim Demaille <akim@epita.fr>
22234 * missing: Update from CVS Automake.
22235 * config/config.guess, config/config.sub, config/texinfo.tex:
22236 Update from gnu.org.
22238 2001-08-15 Akim Demaille <akim@epita.fr>
22240 * Makefile.maint: Sync with CVS Autoconf.
22242 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
22244 * doc/bison.texinfo: Include GNU Free Documentation License from
22246 * doc/fdl.texi: Add to package.
22248 2001-08-14 Marc Autret <autret_m@epita.fr>
22250 Turn on %{source,header}_extension features.
22252 * src/lex.c (percent_table): Un-CPP out header_extension and
22254 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
22255 (compute_exts_from_src): Remove conditions. It restores priorities
22258 2001-08-14 Marc Autret <autret_m@epita.fr>
22260 * src/files.c (compute_base_names): Add extensions computing when
22261 `--file-prefix' used.
22262 Standardize function calls.
22264 2001-08-13 Marc Autret <autret_m@epita.fr>
22266 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
22267 defining it (defined but null disables alloca).
22269 2001-08-13 Marc Autret <autret_m@epita.fr>
22271 * src/bison.simple (_yy_memcpy): CPP reformat.
22273 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
22275 * tests/atconfig.in (CPPFLAGS): Fix.
22277 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
22279 * doc/bison.texinfo: Include GNU General Public License from
22281 * doc/gpl.texi: Add to package.
22283 2001-08-10 Marc Autret <autret_m@epita.fr>
22285 * src/print_graph.h: Fix.
22286 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
22288 2001-08-10 Akim Demaille <akim@epita.fr>
22290 * src/system.h: Provide default declarations for stpcpy, strndup,
22293 2001-08-10 Robert Anisko <anisko_r@epita.fr>
22295 * doc/bison.texinfo (Locations): Update @$ stuff.
22297 2001-08-09 Robert Anisko <anisko_r@epita.fr>
22299 * src/bison.simple (YYLLOC_DEFAULT): Update.
22302 2001-08-08 Marc Autret <autret_m@epita.fr>
22304 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
22305 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
22306 Reported by Fabrice Bauzac.
22308 2001-08-08 Marc Autret <autret_m@epita.fr>
22310 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
22311 * src/vcg.c (output_node): Fix.
22312 * src/vcg.h: Cleanup.
22313 * src/print_graph.c: Add comments.
22314 (node_output_size): New global variable. Simplify the formatting of
22315 the VCG graph output.
22316 (print_actions): Unused code is now used. It notifies the final state
22317 and no action states in the VCG graph. It also give the reduce actions.
22318 The `shift and goto' edges are red and the `go to state' edges are
22320 Get the current node name and node_obstack by argument.
22321 (node_obstack): New variable.
22322 (print_state): Manage node_obstack.
22323 (print_core): Use node_obstack given by argument.
22324 A node is not only computed here but in print_actions also.
22325 (print_graph): CPP out useless code instead of commenting it.
22327 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
22329 * tests/atconfig.in (CPPFLAGS): Fix.
22331 2001-08-07 Akim Demaille <akim@epita.fr>
22333 * src/print_graph.c (quote): New.
22334 (print_core): Use it.
22336 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
22338 * src/vcg.c (complain.h): Include it.
22339 Unepitaize `return' invocations.
22340 [NDEBUG] (main): Remove.
22341 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
22342 * src/files.c (open_files): Initialize graph_obstack.
22343 * src/print_graph.c (print_actions): CPP out useless code.
22344 (print_core): Don't output the last `\n' in labels.
22346 * src/files.c (output_files): Output the VCG file.
22347 * src/main.c (main): Invoke print_graph ();
22349 2001-08-06 Marc Autret <autret_m@epita.fr>
22351 Automaton VCG graph output.
22352 Using option ``-g'' or long option ``--graph'', you can generate
22353 a gram_filename.vcg file containing a VCG description of the LALR (1)
22354 automaton of your grammar.
22356 * src/main.c: Call to print_graph() function.
22357 * src/getargs.h: Update.
22358 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
22359 (graph_flag): New flag.
22360 (longopts): Update.
22361 (getargs): Add case `g'.
22362 * src/files.c (graph_obstack): New obstack struct.
22363 (open_files): Initialize new obstack.
22364 (output_files): Saves graph_obstack if required.
22365 * src/files.h (graph_obstack): New extern declaration.
22366 * src/Makefile.am: Add new source files.
22368 2001-08-06 Marc Autret <autret_m@epita.fr>
22370 * src/print_graph.c, src/print_graph.h (graph): New.
22371 * src/vcg.h: New file.
22372 * src/vcg.c: New file, VCG graph handling.
22374 2001-08-06 Marc Autret <autret_m@epita.fr>
22376 Add of %source_extension and %header_extension which specify
22377 the source or/and the header output file extension.
22379 * src/files.c (compute_base_names): Remove initialisation of
22380 src_extension and header_extension.
22381 (compute_exts_from_gf): Update.
22382 (compute_exts_from_src): Update.
22383 (output_files): Update.
22384 * src/reader.c (parse_header_extension_decl): New.
22385 (parse_source_extension_decl): New.
22386 (read_declarations): New case statements for the new tokens.
22387 * src/lex.c (percent_table): Add entries for %source_extension
22388 and %header_extension.
22389 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
22391 2001-08-06 Marc Autret <autret_m@epita.fr>
22393 * configure.in: Bump to 1.28c.
22394 * doc/bison.texinfo: Texinfo thingies.
22396 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
22398 * tests/atconfig.in (CPPFLAGS): Add.
22399 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
22401 2001-08-03 Akim Demaille <akim@epita.fr>
22405 2001-08-03 Akim Demaille <akim@epita.fr>
22407 * tests/Makefile.am (check-local): Ship testsuite.
22408 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
22409 Include `string.h'.
22411 2001-08-03 Akim Demaille <akim@epita.fr>
22413 * configure.in: Try using -Wformat when compiling.
22415 2001-08-03 Akim Demaille <akim@epita.fr>
22417 * configure.in: Bump to 1.28b.
22419 2001-08-03 Akim Demaille <akim@epita.fr>
22421 * src/complain.c: Adjust strerror_r portability issues.
22423 2001-08-03 Akim Demaille <akim@epita.fr>
22427 2001-08-03 Akim Demaille <akim@epita.fr>
22429 * src/getargs.c, src/getarg.h (skeleton)): Constify.
22430 * src/lex.c (literalchar): Avoid name clashes on `buf'.
22431 * src/getargs.c: Include complain.h.
22432 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
22433 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
22435 2001-08-03 Akim Demaille <akim@epita.fr>
22437 * src/reader.c (readgram): Display hidden chars in error messages.
22439 2001-08-03 Akim Demaille <akim@epita.fr>
22441 Update to gettext 0.10.39.
22443 2001-08-03 Akim Demaille <akim@epita.fr>
22445 * lib/strspn.c: New.
22447 2001-08-01 Marc Autret <autret_m@epita.fr>
22449 * doc/bison.texinfo: Update.
22450 * doc/bison.1 (mandoc): Update.
22451 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
22452 * src/files.c: Support output files extensions computing.
22453 (src_extension): New static variable.
22454 (header_extension): New static variable.
22455 (tr): New function.
22456 (get_extension_index): New function, gets the index of an extension
22457 filename in a string.
22458 (compute_exts_from_gf): New function, computes extensions from the
22459 grammar file extension.
22460 (compute_exts_from_src): New functions, computes extensions from the
22461 C source file extension, file given by ``-o'' option.
22462 (compute_base_names): Update.
22463 (output_files): Update.
22465 2001-08-01 Robert Anisko <anisko_r@epita.fr>
22467 * doc/bison.texi: Document @$.
22468 (Locations): New section.
22470 2001-07-18 Akim Demaille <akim@epita.fr>
22472 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
22473 * config/prev-version.txt, config/move-if-change: New.
22474 * Makefile.am: Adjust.
22476 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
22478 * src/bison.simple (yyparse): Suppress warning `comparaison
22479 between signed and unsigned'.
22481 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
22483 * src/getargs.h (raw_flag): Remove.
22484 * src/getargs.c: Die on `-r'/`--raw'.
22485 * src/lex.c (parse_percent_token): Die on `%raw'.
22486 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
22487 * tests/calc.at: Suppress test with option `--raw'.
22489 2001-07-14 Akim Demaille <akim@epita.fr>
22492 * configure.in: Require Autoconf 2.50.
22493 Update to gettext 0.10.38.
22495 2001-03-16 Akim Demaille <akim@epita.fr>
22497 * doc/bison.texinfo: ANSIfy the examples.
22499 2001-03-16 Akim Demaille <akim@epita.fr>
22501 * getargs.c (skeleton): New variable.
22502 (longopts): --skeleton is a new option.
22503 (shortopts, getargs): -S is a new option.
22504 * getargs.h: Declare skeleton.
22505 * output.c (output_parser): Use it.
22507 2001-03-16 Akim Demaille <akim@epita.fr>
22509 * m4/strerror_r.m4: New.
22510 * m4/error.m4: Run AC_FUNC_STRERROR_R.
22511 * lib/error.h, lib/error.c: Update.
22513 2001-03-16 Akim Demaille <akim@epita.fr>
22515 * src/getargs.c (longopts): Clean up.
22517 2001-02-21 Akim Demaille <akim@epita.fr>
22519 * src/reader.c (gensym): `gensym_count' is your own.
22520 Use a static buf to create the symbol name, as token_buffer is no
22523 2001-02-08 Akim Demaille <akim@epita.fr>
22525 * src/conflicts.c (conflict_report): Be sure not to append to res
22526 between two calls, which could happen if both first sprintf were
22527 skipped, but not the first cp += strlen.
22529 2001-02-08 Akim Demaille <akim@epita.fr>
22531 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
22532 New, from fileutils 4.0.37.
22533 * configure.in: Require Autoconf 2.49c. I took some time before
22534 making this decision. This is the only way out for portability
22535 issues in Bison, it would mean way too much duplicate effort to
22536 import in Bison features implemented in 2.49c since 2.13.
22537 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
22539 2001-02-02 Akim Demaille <akim@epita.fr>
22541 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
22542 * lib/xalloc.h, lib/xmalloc.c: Update.
22544 2001-01-19 Akim Demaille <akim@epita.fr>
22546 Get rid of the ad hoc handling of token_buffer in the scanner: use
22549 * src/lex.c (token_obstack): New.
22550 (init_lex): Initialize it. No longer call...
22551 (grow_token_buffer): this. Remove it.
22552 Adjust all the places which used it to use the obstack.
22554 2001-01-19 Akim Demaille <akim@epita.fr>
22556 * src/lex.h: Rename all the tokens:
22557 s/\bENDFILE\b/tok_eof/g;
22558 s/\bIDENTIFIER\b/tok_identifier/g;
22560 Let them be enums, not #define, to ease debugging.
22561 Adjust all the code.
22563 2001-01-18 Akim Demaille <akim@epita.fr>
22565 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
22566 * src/lex.c (maxtoken, grow_token_buffer): Static.
22568 2001-01-18 Akim Demaille <akim@epita.fr>
22570 Since we now use obstacks, more % directives can be enabled.
22572 * src/lex.c (percent_table): Also accept `%yacc',
22573 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
22575 Handle the actions for `%semantic_parser' and `%pure_parser' here,
22576 instead of returning a token.
22577 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
22578 * src/reader.c (read_declarations): Adjust.
22579 * src/files.c (open_files): Don't call `compute_base_names', don't
22580 compute `attrsfile' since they depend upon data which might be
22581 *in* the input file now.
22582 (output_files): Do it here.
22583 * src/output.c (output_headers): Document the fact that this patch
22584 introduces a guaranteed SEGV for semantic parsers.
22585 * doc/bison.texinfo: Document them.
22586 * tests/suite.at: Exercise these %options.
22588 2000-12-20 Akim Demaille <akim@epita.fr>
22590 Also handle the output file (--verbose) with obstacks.
22592 * files.c (foutput): Remove.
22593 (output_obstack): New.
22594 Adjust all dependencies.
22595 * src/conflicts.c: Return a string.
22596 * src/system.h (obstack_grow_string): Rename as...
22597 (obstack_sgrow): this. Be ready to work with non literals.
22598 (obstack_fgrow4): New.
22600 2000-12-20 Akim Demaille <akim@epita.fr>
22602 * src/files.c (open_files): Fix the computation of short_base_name
22603 in the case of `-o foo.tab.c'.
22605 2000-12-20 Akim Demaille <akim@epita.fr>
22607 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
22608 (copy_dollar): Now that everything uses obstacks, get rid of the
22611 2000-12-20 Akim Demaille <akim@epita.fr>
22613 * src/files.c (open_files): Actually the `.output' file is based
22614 on the short_base_name, not base_name.
22615 * tests/suite.at (Checking output file names): Adjust.
22617 2000-12-20 Akim Demaille <akim@epita.fr>
22619 * src/bison.s1: Remove, we now use directly...
22620 * src/bison.simple: this.
22621 * src/Makefile.am: Use pkgdata instead of data.
22623 2000-12-20 Akim Demaille <akim@epita.fr>
22625 * src/files.c (guard_obstack): New.
22626 (open_files): Initialize it.
22627 (output_files): Dump it...
22628 * src/files.h: Export it.
22629 * src/reader.c (copy_guard): Use it.
22631 2000-12-19 Akim Demaille <akim@epita.fr>
22633 * src/files.c (outfile, defsfile, actfile): Removed as global
22635 (open_files): Don't compute them.
22636 (output_files): Adjust.
22637 (base_name, short_base_name): Be global.
22638 Adjust dependencies.
22640 2000-12-19 Akim Demaille <akim@epita.fr>
22642 * src/files.c (strsuffix): New.
22643 (stringappend): Be just like strcat but allocate.
22644 (base_names): Eve out from open_files.
22645 Try to simplify the rather hairy computation of base_name and
22647 (open_files): Use it.
22648 * tests/suite.at (Checking output file names): New test.
22650 2000-12-19 Akim Demaille <akim@epita.fr>
22652 * src/system.h (obstack_grow_literal_string): Rename as...
22653 (obstack_grow_string): this.
22654 * src/output.c (output_parser): Recognize `%% actions' instead of
22656 * src/bison.s1: s/$/%% actions/.
22657 * src/bison.hairy: Likewise.
22659 2000-12-19 Akim Demaille <akim@epita.fr>
22661 * src/output.c (output_parser): Compute the `#line' lines when
22663 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
22664 Suggested by Hans Aberg.
22666 2000-12-19 Akim Demaille <akim@epita.fr>
22668 Let the handling of the skeleton files be local to the procedures
22671 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
22673 (fparser, open_extra_files): Remove.
22674 (open_files, output_files): Don't take care of fparser.
22675 * src/files.h: Adjust.
22676 * src/output.c (output_parser): Open and close the file to the
22678 * src/reader.c (read_declarations): When %semantic_parser, open
22681 2000-12-19 Akim Demaille <akim@epita.fr>
22683 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
22684 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
22686 2000-12-19 Akim Demaille <akim@epita.fr>
22688 * src/files.c (open_files): Yipee! We no longer need all the code
22689 looking for `/tmp' since we have no tmp file.
22691 2000-12-19 Akim Demaille <akim@epita.fr>
22693 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
22695 * src/files.c (open_files): Less dependency on MSDOS etc.
22697 2000-12-14 Akim Demaille <akim@epita.fr>
22699 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
22700 Provide a default definition.
22701 Use it when executing the default @ action.
22702 * src/reader.c (reader_output_yylsp): No longer include
22703 `timestamp' and `text' in the default YYLTYPE.
22705 2000-12-12 Akim Demaille <akim@epita.fr>
22707 * src/reader.c (copy_definition, parse_union_decl, copy_action)
22708 (copy_guard): Quote the file names.
22709 Reported by Laurent Mascherpa.
22711 2000-12-12 Akim Demaille <akim@epita.fr>
22713 * src/output.c (output_headers, output_program, output): Be sure
22714 to escape special characters when outputting filenames.
22715 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
22716 (output_headers): Don't depend on them, Use ACTSTR.
22718 2000-11-17 Akim Demaille <akim@epita.fr>
22720 * lib/obstack.h: Formatting changes.
22721 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
22722 prevents type checking.
22723 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
22724 cast the value to (void *): assigning a `foo *' to a `void *'
22726 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
22727 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
22730 2000-11-17 Akim Demaille <akim@epita.fr>
22732 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
22734 (suite.m4, regression.m4, calc.m4): these.
22735 * tests/atgeneral.m4: Update from CVS Autoconf.
22737 2000-11-17 Akim Demaille <akim@epita.fr>
22739 * tests/regression.m4 (%union and --defines): New test,
22740 demonstrating a current bug in the obstack implementation.
22742 2000-11-17 Akim Demaille <akim@epita.fr>
22744 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
22746 Use them to declare the variables which are global or local to
22749 2000-11-17 Akim Demaille <akim@epita.fr>
22751 * acconfig.h: Remove, no longer used.
22753 2000-11-07 Akim Demaille <akim@epita.fr>
22755 * src: s/Copyright (C)/Copyright/g.
22757 2000-11-07 Akim Demaille <akim@epita.fr>
22759 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
22761 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
22763 2000-11-07 Akim Demaille <akim@epita.fr>
22765 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
22766 Merge in a single CPP if/else.
22768 2000-11-07 Akim Demaille <akim@epita.fr>
22770 * src/output.c (output): Remove useless variables.
22771 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
22772 argument `data' for consistency with the prototypes.
22773 Qualify it `const'.
22774 (obstack_copy, obstack_copy0): Rename the second argument as
22775 `address' for consistency. Qualify it `const'.
22776 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
22777 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
22778 `const' their input argument (`data' or `address').
22779 Adjust the corresponding macros to include `const' in casts.
22781 2000-11-03 Akim Demaille <akim@epita.fr>
22783 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
22784 s/PFILE1/BISON_HAIRY/.
22785 Adjust dependencies.
22787 2000-11-03 Akim Demaille <akim@epita.fr>
22789 For some reason, this was not applied.
22791 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
22792 `unlink': it's no longer used.
22794 2000-11-03 Akim Demaille <akim@epita.fr>
22796 * src/files.c (skeleton_find): New function, eved out of...
22797 (open_files, open_extra_files): here.
22799 2000-11-03 Akim Demaille <akim@epita.fr>
22801 Don't use `atexit'.
22803 * src/files.c (obstack_save): New function.
22804 (done): Rename as...
22805 (output_files): this.
22806 Use `obstack_save'.
22807 * src/main.c (main): Don't use `atexit' to register `done', since
22808 it no longer has to remove tmp files, just call `output_files'
22809 when there are no errors.
22811 2000-11-02 Akim Demaille <akim@epita.fr>
22813 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
22814 `unlink': it's no longer used.
22815 * src/files.h: Formatting changes.
22817 2000-11-02 Akim Demaille <akim@epita.fr>
22819 Remove the last uses of mktemp and unlink/delete.
22821 * src/files.c (fdefines, ftable): Removed.
22822 (defines_ostack, table_obstack): New.
22823 Adjust dependencies of the former into uses of the latter.
22824 * src/output.c (output_short_or_char_table, output_short_table):
22825 Convert to using obstacks.
22826 * src/reader.c (copy_comment2): Accept one FILE * and two
22828 (output_token_defines, reader_output_yylsp): Use obstacks.
22829 * src/system.h (obstack_fgrow3): New.
22830 * po/POTFILES.in: Adjust.
22832 2000-11-01 Akim Demaille <akim@epita.fr>
22834 Change each use of `fattrs' into a use of `attrs_obstack'.
22836 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
22837 * src/files.c (fattrs): Remove.
22838 (attrs_obstack): New.
22839 Adjust all dependencies.
22840 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
22842 2000-11-01 Akim Demaille <akim@epita.fr>
22844 Introduce obstacks.
22845 Change each use of `faction' into a use of `action_obstack'.
22847 * lib/obstack.h, lib/obstack.c: New files.
22848 * src/files.c (faction): Remove.
22849 (action_obstack): New.
22850 Adjust all dependencies.
22852 2000-10-20 Akim Demaille <akim@epita.fr>
22854 * lib/quote.h (PARAMS): New macro. Use it.
22856 2000-10-16 Akim Demaille <akim@epita.fr>
22858 * src/output.c (output_short_or_char_table): New function.
22859 (output_short_table, output_token_translations): Use it.
22860 (goto_actions): Use output_short_table.
22862 2000-10-16 Akim Demaille <akim@epita.fr>
22864 * src/symtab.c (bucket_new): New function.
22867 * src/output.c (output_short_table): New argument to display the
22868 comment associated with the table.
22869 Adjust dependencies.
22870 (output_gram): Use it.
22871 (output_rule_data): Nicer output layout for YYTNAME.
22873 2000-10-16 Akim Demaille <akim@epita.fr>
22875 * src/lex.c (read_typename): New function.
22877 * src/reader.c (copy_dollar): Likewise.
22879 2000-10-16 Akim Demaille <akim@epita.fr>
22881 * src/reader.c (copy_comment2): Expect the input stream to be on
22882 the `/' which is suspected to open a comment, instead of being
22883 called after `//' or `/*' was read.
22884 (copy_comment, copy_definition, parse_union_decl, copy_action)
22885 (copy_guard): Adjust.
22887 2000-10-16 Akim Demaille <akim@epita.fr>
22889 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
22890 `read_signed_integer'.
22892 2000-10-16 Akim Demaille <akim@epita.fr>
22894 * src/reader.c (copy_dollar): New function.
22895 (copy_guard, copy_action): Use it.
22897 2000-10-16 Akim Demaille <akim@epita.fr>
22899 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
22900 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
22901 New files, from Fileutils 4.0.27.
22902 * src/main.c (printable_version): Remove.
22903 * src/lex.c, src/reader.c: Use `quote'.
22905 2000-10-04 Akim Demaille <akim@epita.fr>
22907 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
22909 2000-10-04 Akim Demaille <akim@epita.fr>
22911 * doc/bison.texinfo: Various typos spotted by Neil Booth.
22913 2000-10-04 Akim Demaille <akim@epita.fr>
22915 When a literal string is used to define two different tokens,
22916 `bison -v' segfaults.
22917 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
22919 * tests/regression.m4: New file.
22920 Include the core of the sample provided by Piotr Gackiewicz.
22921 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
22924 2000-10-04 Akim Demaille <akim@epita.fr>
22926 * src/reader.c (parse_expect_decl): Keep `count' within the size
22930 2000-10-02 Paul Eggert <eggert@twinsun.com>
22932 * bison.s1 (yyparse): Assign the default value
22933 unconditionally, to avoid a GCC warning and make the parser a
22936 2000-10-02 Akim Demaille <akim@epita.fr>
22938 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
22941 2000-10-02 Akim Demaille <akim@epita.fr>
22943 * src/derives.c, src/print.c, src/reduce.c: To ease the
22944 translation, move some `\n' out of the translated strings.
22946 2000-10-02 Akim Demaille <akim@epita.fr>
22948 The location tracking mechanism is precious for parse error
22949 messages. Nevertheless, it is enabled only when `@n' is used in
22950 the grammar, which is a different issue (you can use it in error
22951 message, but not in the grammar per se). Therefore, there should
22952 be another means to enable it.
22954 * src/getargs.c (getargs): Support `--locations'.
22955 (usage): Report it.
22956 * src/getargs.h (locationsflag): Export it.
22957 * src/lex.c (percent_table): Support `%locations'.
22958 * src/reader.c (yylsp_needed): Remove this variable, now replaced
22959 with `locationsflag'.
22960 * doc/bison.texinfo: Document `--locations' and `%locations'.
22962 * tests/calc.m4: Test it.
22964 For regularity of the names, replace each
22965 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
22966 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
22967 In addition replace each `flag' with `_flag'.
22969 2000-10-02 Akim Demaille <akim@epita.fr>
22971 Also test parse error messages, including with YYERROR_VERBOSE.
22973 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
22975 Use it to check the computations.
22976 Use it to check `nonassoc' is honored.
22977 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
22978 `--yyerror-verbose'.
22979 (_AT_CHECK_CALC): Adjust to this option.
22980 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
22982 2000-10-02 Akim Demaille <akim@epita.fr>
22984 Test also `--verbose', `--defines' and `--name-prefix'. Testing
22985 the latter demonstrates a flaw in the handling of non debugging
22986 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
22987 was used in order to simplify:
23003 unfortunately this leads to a CPP conflict when
23004 `--name-prefix=foo' is used since it produces `#define yydebug
23007 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
23008 (YYDPRINTF): New macro.
23010 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
23012 Also test `--verbose', `--defines' and `--name-prefix'.
23014 2000-10-02 Akim Demaille <akim@epita.fr>
23016 Improve the readability of the produced parsers.
23018 * src/bison.s1: Formatting changes.
23019 Improve the comment related to the `$' mark.
23020 (yydefault): Don't fall through to `yyresume': `goto' there.
23021 * src/output.c (output_parser): When the `$' is met, skip the end
23023 New variable, `number_of_dollar_signs', to check there's exactly
23024 one `$' in the parser skeleton.
23026 2000-10-02 Akim Demaille <akim@epita.fr>
23028 * lib/xstrdup.c: New file, from the fileutils.
23029 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
23030 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
23031 instead of strlen + xmalloc + strcpy.
23032 * src/symtab.c (copys): Remove, use xstrdup instead.
23034 2000-10-02 Akim Demaille <akim@epita.fr>
23036 * src/gram.h (associativity): New enum type which replaces the
23037 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
23038 `right_assoc', `left_assoc' and `non_assoc'.
23039 Adjust all dependencies.
23040 * src/reader.c: Formatting changes.
23041 (LTYPESTR): Don't define it, use it as a literal in
23042 `reader_output_yylsp'.
23043 * src/symtab.h (symbol_class): New enum type which replaces the
23044 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
23045 `sunknown', `stoken and `snterm'.
23047 2000-10-02 Akim Demaille <akim@epita.fr>
23049 * src/getargs.c (fixed_outfiles): Rename as...
23050 (yaccflag): for consistency and accuracy.
23051 Adjust dependencies.
23053 2000-10-02 Akim Demaille <akim@epita.fr>
23055 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
23056 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
23057 difficult and introduced a lot of core dump. It turns out that
23058 Bison used an implementation of `xmalloc' based on `calloc', and
23059 at various places it does depend upon the initialization to 0. I
23060 have not tried to isolate the pertinent places, and all the former
23061 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
23062 someone should address this issue.
23064 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
23065 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
23067 Adjust dependencies.
23068 * src/warshall.h: New file.
23071 2000-10-02 Akim Demaille <akim@epita.fr>
23073 Various anti-`extern in *.c' changes.
23075 * src/system.h: Include `assert.h'.
23077 2000-10-02 Akim Demaille <akim@epita.fr>
23079 * src/state.h (nstates, final_state, first_state, first_shift)
23080 (first_reduction): Move their exportation from here...
23081 * src/LR0.h: to here.
23082 Adjust dependencies.
23083 * src/getargs.c (statisticsflag): New variable.
23084 Add support for `--statistics'.
23085 Adjust dependencies.
23087 Remove a lot of now useless `extern' statements in most files.
23089 2000-10-02 Akim Demaille <akim@epita.fr>
23091 * src/LR0.h: New file.
23094 2000-10-02 Akim Demaille <akim@epita.fr>
23096 * src/print.h: New file.
23098 * src/print.c: Formatting and ordering changes.
23099 (verbose, terse): Replace with...
23100 (print_results): this new function.
23101 Adjust dependencies.
23103 2000-10-02 Akim Demaille <akim@epita.fr>
23105 * src/conflicts.c (conflict_report): New function.
23106 (conflict_log, verbose_conflict_log): Replace with...
23107 (print_conflicts): this function.
23108 Adjust dependencies.
23109 * src/conflicts.h: New file.
23110 Propagate its inclusion.
23112 2000-10-02 Akim Demaille <akim@epita.fr>
23114 * src/nullable.h: New file.
23115 Propagate its inclusion.
23116 * src/nullable.c: Formatting changes.
23118 2000-10-02 Akim Demaille <akim@epita.fr>
23120 * src/reduce.h: New file.
23121 Propagate its inclusion.
23122 * src/reduce.c: Topological sort and other formatting changes.
23123 (bool, TRUE, FALSE): Move their definition to...
23124 * src/system.h: here.
23126 2000-10-02 Akim Demaille <akim@epita.fr>
23128 * src/files.c: Formatting changes.
23129 (tryopen, tryclose, openfiles): Rename as...
23130 (xfopen, xfclose, open_files): this.
23131 (stringappend): static.
23132 * src/files.h: Complete the list of exported symbols.
23135 2000-10-02 Akim Demaille <akim@epita.fr>
23137 * src/reader.h: New file.
23138 Propagate its use instead of tedious list of `extern' and
23140 * src/reader.c: Formatting changes, topological sort,
23143 2000-10-02 Akim Demaille <akim@epita.fr>
23145 * src/lex.h: Prototype `lex.c' exported functions.
23146 * src/reader.c: Adjust.
23147 * src/lex.c: Formatting changes.
23148 (safegetc): Rename as...
23151 2000-10-02 Akim Demaille <akim@epita.fr>
23153 * src/lalr.h: New file.
23154 Propagate its inclusion instead of prototypes and `extern'.
23155 * src/lalr.c: Formatting changes, topological sorting etc.
23157 2000-10-02 Akim Demaille <akim@epita.fr>
23159 * src/output.c (token_actions): Introduce a temporary array,
23160 YYDEFACT, that makes it possible for this function to use
23161 output_short_table.
23163 2000-10-02 Akim Demaille <akim@epita.fr>
23165 `user_toknums' is output as a `short[]' in `output.c', while it is
23166 defined as a `int[]' in `reader.c'. For consistency with the
23167 other output tables, `user_toknums' is now defined as a table of
23170 * src/reader.c (user_toknums): Be a short table instead of an int
23172 Adjust dependencies.
23174 Factor the short table outputs.
23176 * src/output.c (output_short_table): New function.
23177 * src/output.c (output_gram, output_stos, output_rule_data)
23178 (output_base, output_table, output_check): Use it.
23180 2000-10-02 Akim Demaille <akim@epita.fr>
23182 * src/output.c (output): Topological sort of the functions, in
23183 order to get rid of the `static' prototypes.
23184 No longer use `register'.
23185 * src/output.h: New file.
23186 Propagate its inclusion in files explicitly prototyping functions
23189 2000-09-21 Akim Demaille <akim@epita.fr>
23191 * src/atgeneral.m4: Update from Autoconf.
23193 2000-09-21 Akim Demaille <akim@epita.fr>
23195 * src/closure.h: New file.
23196 * src/closure.c: Formatting changes, topological sort over the
23197 functions, use of closure.h.
23198 (initialize_closure, finalize_closure): Rename as...
23199 (new_closure, free_closure): these. Adjust dependencies.
23200 * src/LR0.c: Formatting changes, topological sort, use of
23202 (initialize_states): Rename as...
23203 (new_states): this.
23204 * src/Makefile.am (noinst_HEADERS): Adjust.
23206 2000-09-20 Akim Demaille <akim@epita.fr>
23208 * src/acconfig.h: Don't protect config.h against multiple
23210 Don't define PARAMS.
23211 * src/system.h: Define PARAMS.
23212 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
23213 purpose of config.h. system.h must not try to fix wrong
23214 definitions in config.h.
23216 2000-09-20 Akim Demaille <akim@epita.fr>
23218 * src/derives.h: New file.
23219 * src/main.c, src/derives.h: Use it.
23220 Formatting changes.
23221 * src/Makefile.am (noinst_HEADERS): Adjust.
23223 2000-09-20 Akim Demaille <akim@epita.fr>
23225 * tests/atgeneral.m4: Update from Autoconf.
23226 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
23227 (AT_CHECK_CALC): New macros.
23228 Use these macros to test bison with options `', `--raw',
23229 `--debug', `--yacc', `--yacc --debug'.
23231 2000-09-19 Akim Demaille <akim@epita.fr>
23233 * src/output.c: Formatting changes.
23234 * src/machine.h: Remove, leaving its contents in...
23235 * src/system.h: here.
23237 Adjust all dependencies on stdio.h and machine.h.
23238 * src/getargs.h: New file.
23239 Let all `extern' declarations about getargs.c be replaced with
23240 inclusion of `getargs.h'.
23241 * src/Makefile.am (noinst_HEADERS): Adjust.
23243 * tests/calc.m4 (yyin): Be initialized in main, not on the global
23245 (yyerror): Returns void, not int.
23246 * doc/bison.texinfo: Formatting changes.
23248 2000-09-19 Akim Demaille <akim@epita.fr>
23250 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
23253 2000-09-18 Akim Demaille <akim@epita.fr>
23255 * configure.in: Append WARNING_CFLAGS to CFLAGS.
23256 * src/Makefile.am (INCLUDES): Don't.
23257 Be ready to fetch headers in lib/.
23259 2000-09-18 Akim Demaille <akim@epita.fr>
23261 * doc/bison.texinfo: Update the copyright.
23262 ANSIfy and GNUify the examples.
23263 Remove the old menu.
23265 2000-09-18 Akim Demaille <akim@epita.fr>
23267 First set of tests: use the `calc' example from the documentation.
23269 * src/bison.s1 (yyparse): Condition the code using `yytname' which
23270 is defined only when YYDEBUG is.
23271 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
23272 * src/files.c (tryopen, tryclose): Formatting changes.
23273 Move to the top and be static.
23274 * src/reader.c (read_signed_integer): Likewise.
23275 * tests/calc.m4: New file.
23276 * Makefile.am, suite.m4: Adjust.
23277 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
23279 2000-09-18 Akim Demaille <akim@epita.fr>
23281 Add support for an Autotest test suite for Bison.
23283 * m4/m4.m4, m4/atconfig.m4: New files.
23284 * m4/Makefile.am (EXTRA_DIST): Adjust.
23285 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
23287 * src/getargs.c: Display a more standard --version message.
23288 * src/reader.c (reader): Formatting changes.
23289 No longer depend upon VERSION_STRING.
23290 * configure.in: No longer use `dnl'.
23291 Set up the test suite and the new directory `tests/.
23292 (VERSION_STRING): Remove.
23294 2000-04-14 Akim Demaille <akim@epita.fr>
23296 * src/reader.c (copy_comment2): New function, same as former
23297 `copy_comment', but outputs into two FILE *.
23298 (copy_comment): Use it.
23299 (parse_union_decl): Use it.
23300 (get_type, parse_start_decl): Use the same `invalid' message.
23301 (parse_start_decl, parse_union_decl): Use the same `multiple'
23303 (parse_union_decl, copy_guard, copy_action): Use the same
23304 `unmatched' message.
23305 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
23307 2000-03-31 Akim Demaille <akim@epita.fr>
23309 * src/files.c (tryopen, tryclose): Move to the top.
23312 2000-03-31 Akim Demaille <akim@epita.fr>
23314 * src/main.c (main): Don't call `done', exit does it.
23316 2000-03-31 Akim Demaille <akim@epita.fr>
23318 * allocate.c: s/return (foo)/return foo/.
23319 * lalr.c: Likewise.
23321 * output.c: Likewise.
23322 * reader.c: Likewise.
23323 * symtab.c: Likewise.
23324 * vmsgetargs.c: Likewise.
23326 2000-03-31 Akim Demaille <akim@epita.fr>
23328 Clean up the error reporting functions.
23330 * src/report.c: New file.
23331 * src/report.h: Likewise.
23332 * src/Makefile.am: Adjust.
23333 * m4/error.m4: New file.
23334 * m4/Makefile.am: Adjust.
23335 * configure.in (jm_PREREQ_ERROR): Call it.
23336 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
23338 (fatal, fatals): Remove. All callers use complain.c::fatal.
23339 (warn, warni, warns, warnss, warnss): Remove. All callers use
23340 complain.c::complain.
23341 (toomany): Remove, use fatal instead.
23342 * src/files.c (done): No argument, use complain_message_count.
23343 * src/main.c (main): Register `done' to `atexit'.
23345 * src/getargs.c (usage): More `fputs', less `fprintf'.
23347 2000-03-28 Akim Demaille <akim@epita.fr>
23349 * lib/: New directory.
23350 * Makefile.am (SUBDIRS): Adjust.
23351 * configure.in: Adjust.
23352 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
23354 * src/alloca.c: Moved to lib/.
23355 * src/getopt.c: Likewise.
23356 * src/getopt1.c: Likewise.
23357 * src/getopt.h: Likewise.
23358 * src/ansi2knr.c: Likewise.
23359 * src/ansi2knr.1: Likewise.
23360 * src/Makefile.am: Adjust.
23361 * lib/Makefile.am: New file.
23363 2000-03-28 Akim Demaille <akim@epita.fr>
23365 * src/getargs.c (usage): Refresh the help message.
23367 2000-03-17 Akim Demaille <akim@epita.fr>
23369 * src/getopt1.c: Updated from textutils 2.0e
23370 * src/getopt.c: Likewise.
23371 * src/getopt.h: Likewise.
23373 2000-03-17 Akim Demaille <akim@epita.fr>
23375 * src/Makefile.am (bison.simple): Fix the awk program: quote only
23376 the file name, not the whole `#line LINE FILE'.
23378 2000-03-17 Akim Demaille <akim@epita.fr>
23380 On syntax errors, report the token on which we choked.
23382 * src/bison.s1 (yyparse): In the label yyerrlab, when
23383 YYERROR_VERBOSE, add yychar in msg.
23385 2000-03-17 Akim Demaille <akim@epita.fr>
23387 * src/reader.c (copy_at): New function.
23388 (copy_guard): Use it.
23389 (copy_action): Use it.
23391 2000-03-17 Akim Demaille <akim@epita.fr>
23393 Be kind to translators, save some useless translations.
23395 * src/main.c (banner): New function.
23396 (fatal_banner): Use it.
23397 (warn_banner): Use it.
23399 2000-03-17 Akim Demaille <akim@epita.fr>
23401 * src/reader.c (copy_definition): Use copy_string and
23402 copy_comment. Removed now unused `match', `ended',
23404 (copy_comment, copy_string): Moved, to be visible from
23407 2000-03-17 Akim Demaille <akim@epita.fr>
23409 * src/reader.c (copy_string): Declare `static inline'. No
23410 problems with inline, since it is checked by configure.
23411 (copy_comment): Likewise.
23413 2000-03-17 Akim Demaille <akim@epita.fr>
23415 * src/reader.c (packsymbols): Formatting changes.
23417 2000-03-17 Akim Demaille <akim@epita.fr>
23419 * src/reader.c (copy_comment): New function, factored out from:
23420 (copy_action): Use it. Removed now unused `match', `ended',
23422 (copy_guard): Likewise.
23424 2000-03-17 Akim Demaille <akim@epita.fr>
23426 * src/reader.c (copy_string): New function, factored out from:
23427 (copy_action): Use it.
23428 (copy_guard): Likewise.
23430 2000-03-17 Akim Demaille <akim@epita.fr>
23432 Change the handling of @s so that they behave exactly like $s.
23433 There is now a pseudo variable @$ (readble and writable), location
23434 of the lhs of the rule (by default ranging from the location of
23435 the first symbol of the rhs, to the location of the last symbol,
23436 or, if the rhs is empty, YYLLOC).
23438 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
23440 (yyparse): When providing a default semantic action, provide a
23441 default location action.
23442 (after the $): No longer change `*YYLSP', just stack YYLOC the
23443 same way you stack YYVAL.
23444 * src/reader.c (read_declarations): Use warns.
23445 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
23446 (copy_action, case '@'): Likewise.
23447 Use a standard error message, to save useless work from
23450 2000-03-17 Akim Demaille <akim@epita.fr>
23452 * src/bison.s1: Formatting and cosmetics changes.
23453 * src/reader.c: Likewise.
23454 Update the Copyright notice.
23456 2000-03-17 Akim Demaille <akim@epita.fr>
23458 * src/bison.s1 (#line): All set to `#line' only, since the
23459 Makefile now handles them.
23461 2000-03-16 Akim Demaille <akim@epita.fr>
23463 * src/output.c (output_rule_data): Output the documentation of
23464 some of the tables.
23465 (Copyright notice): Update.
23466 Formatting changes.
23468 2000-03-16 Akim Demaille <akim@epita.fr>
23470 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
23471 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
23472 One `#if YYDEBUG' remains, since it uses variables which are
23473 defined only if `YYDEBUG != 0'.
23475 2000-03-16 Akim Demaille <akim@epita.fr>
23477 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
23478 and related variables so that the similarities are highlighted.
23480 2000-03-16 Akim Demaille <akim@epita.fr>
23482 * src/bison.s1: Properly indent CPP directives.
23484 2000-03-16 Akim Demaille <akim@epita.fr>
23486 * src/bison.s1: Properly indent the `alloca' CPP section.
23488 2000-03-16 Akim Demaille <akim@epita.fr>
23490 Do not hard code values of directories in `configure.in'.
23491 Update the `configure' tool chain.
23493 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
23495 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
23496 (AC_OUTPUT): Add m4/Makefile.
23497 Bump to bison 1.28a, 1.29 has never been released.
23498 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
23499 handled via src/Makefile.am.
23500 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
23501 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
23503 * Makefile.am (SUBDIRS): Add m4.
23504 (ACLOCAL_AM_FLAGS): New variable.
23505 (AUTOMAKE_OPTIONS): Add check-news.
23506 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
23507 the proper line number and file name.
23508 (DEFS): Propagate the location of bison library files and of the
23510 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
23512 * acinclude.m4: Remove, replaced by the directory m4.
23513 * m4/Makefile.am (EXTRA_DIST): New variable.
23514 * m4/gettext.m4: New file, from the fileutils.
23515 * m4/lcmessage.m4: Likewise
23516 * m4/progtest.m4: Likewise.
23517 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
23519 2000-03-10 Akim Demaille <akim@epita.fr>
23522 Formatting changes of various comments.
23523 Respect the GNU coding standards at various places.
23524 Don't use `_()' when no translation is needed.
23526 1999-12-13 Jesse Thilo <jthilo@gnu.org>
23529 OS/2 honors TMPDIR environment variable.
23531 1999-12-13 Jesse Thilo <jthilo@gnu.org>
23533 * doc/bison.texinfo: Tweaked spelling and grammar.
23535 Removed reference to price of printed copy.
23536 Mention BISON_SIMPLE and BISON_HAIRY.
23538 1999-12-13 Jesse Thilo <jthilo@gnu.org>
23540 * configure.in, NEWS:
23541 Bison 1.29 released.
23543 1999-10-27 Jesse Thilo <jthilo@gnu.org>
23545 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
23546 Added reference card.
23548 1999-07-26 Jesse Thilo <jthilo@gnu.org>
23550 * po/ru.po: Added Russian translation.
23552 1999-07-26 Jesse Thilo <jthilo@gnu.org>
23554 * configure.in: Added Russian translation.
23556 1999-07-06 Jesse Thilo <jthilo@gnu.org>
23558 * configure.in, NEWS, README:
23559 Released version 1.28.
23561 1999-06-14 Jesse Thilo <jthilo@gnu.org>
23564 Squashed redefinition warning on some systems.
23566 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
23567 Have configure build version string instead of relying on ANSI string
23570 1999-06-14 Jesse Thilo <jthilo@gnu.org>
23572 * po/POTFILES.in: Got rid of version.c.
23574 1999-06-14 Jesse Thilo <jthilo@gnu.org>
23576 * acconfig.h, configure.in:
23577 Have configure build version string instead of relying on ANSI string
23580 1999-06-08 Jesse Thilo <jthilo@gnu.org>
23583 Dropped mention of `+' for long-named options.
23585 1999-05-30 Jesse Thilo <jthilo@gnu.org>
23587 * src/files.c: Added <unistd.h> for unlink().
23589 * src/Makefile.am, src/system.h:
23592 1999-05-30 Jesse Thilo <jthilo@gnu.org>
23594 * README: Added a FAQ list.
23596 * configure.in, acconfig.h:
23599 1999-05-30 Jesse Thilo <jthilo@gnu.org>
23601 * doc/FAQ, doc/Makefile.am:
23604 1999-05-19 Jesse Thilo <jthilo@gnu.org>
23606 * src/alloc.h, src/symtab.h, src/version.c:
23607 Protected inclusion of "config.h" with HAVE_CONFIG_H.
23609 1999-04-18 Jesse Thilo <jthilo@gnu.org>
23611 * src/.cvsignore, src/Makefile.am:
23612 Reorganized: sources in `src', documentation in `doc'.
23614 * src/lex.c (literalchar):
23615 fixed the code for escaping double quotes (thanks
23618 1999-04-18 Jesse Thilo <jthilo@gnu.org>
23620 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
23621 Adjusted paths to reflect directory reorganization.
23623 1999-04-18 Jesse Thilo <jthilo@gnu.org>
23625 * doc/.cvsignore, doc/Makefile.am:
23626 Reorganized: sources in `src', documentation in `doc'.
23628 1999-04-18 Jesse Thilo <jthilo@gnu.org>
23631 Updated AC_INIT file to reflect directory reorganization.
23633 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
23634 Reorganized: sources in `src', documentation in `doc'.
23636 1999-04-13 Jesse Thilo <jthilo@gnu.org>
23639 Don't declare calloc() and realloc() if not necessary.
23641 1999-04-13 Jesse Thilo <jthilo@gnu.org>
23643 * configure.in, acconfig.h, acinclude.m4:
23644 Don't declare calloc() and realloc() if not necessary.
23646 1999-03-23 Jesse Thilo <jthilo@gnu.org>
23648 * po/.cvsignore: Added i18n support.
23650 1999-03-23 Jesse Thilo <jthilo@gnu.org>
23652 * acconfig.h, configure.in, Makefile.am:
23653 Added i18n support.
23655 1999-03-22 Jesse Thilo <jthilo@gnu.org>
23657 * src/bison.s1: Fixed #line numbers.
23659 1999-03-15 Jesse Thilo <jthilo@gnu.org>
23661 * po/es.po, po/fr.po, po/nl.po, po/de.po:
23662 Added PO files from Translation Project.
23664 1999-03-03 Jesse Thilo <jthilo@gnu.org>
23667 Added support for non-ANSI compilers (ansi2knr).
23669 1999-02-16 Jesse Thilo <jthilo@gnu.org>
23671 * configure.in: Bumped version number to 1.27.
23674 Added `bison.simple' to list of files removed by `make distclean'.
23676 1999-02-12 Jesse Thilo <jthilo@gnu.org>
23678 * src/files.c, src/files.h:
23679 Defined locations of parser files in config.h instead of Makefile.
23681 1999-02-12 Jesse Thilo <jthilo@gnu.org>
23683 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
23684 Defined locations of parser files in config.h instead of Makefile.
23686 1999-02-09 Jesse Thilo <jthilo@gnu.org>
23689 Removed inappropriate use of $< macro.
23691 1999-02-05 Jesse Thilo <jthilo@gnu.org>
23693 * po/Makefile.in.in, po/POTFILES.in:
23694 Add `po' directory skeleton.
23696 1999-01-27 Jesse Thilo <jthilo@gnu.org>
23698 * README: Document help-bison list.
23700 * configure.in: Add check for mkstemp().
23702 1999-01-20 Jesse Thilo <jthilo@gnu.org>
23704 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
23705 Hush a few compiler warnings.
23708 Add tryclose(), which verifies that fclose was successful.
23709 Hush a couple of compiler warnings.
23711 1999-01-20 Jesse Thilo <jthilo@gnu.org>
23713 * Makefile.am, OChangeLog:
23714 ChangeLog is now automatically generated. Include the old version as
23717 1999-01-14 Jesse Thilo <jthilo@gnu.org>
23719 * 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:
23720 Update FSF address.
23722 1999-01-14 Jesse Thilo <jthilo@gnu.org>
23724 * doc/bison.texinfo: Fix formatting glitch.
23726 * doc/bison.texinfo: Update FSF address.
23728 1999-01-14 Jesse Thilo <jthilo@gnu.org>
23730 * acconfig.h: Update FSF address.
23732 1999-01-08 Jesse Thilo <jthilo@gnu.org>
23735 Don't define PACKAGE here, since config.h defines it.
23737 1998-12-30 Jesse Thilo <jthilo@gnu.org>
23739 * src/reader.c: Update copyright date.
23742 Ditch sprintf to statically-sized buffers in fatal/warn functions in
23743 favor of output directly to stderr (avoids buffer overruns).
23745 * src/reader.c: Some checks for premature EOF.
23747 * 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:
23748 Use prototypes if the compiler understands them.
23750 * src/files.c: Honor TMPDIR on Unix hosts.
23751 Use prototypes if the compiler understands them.
23754 Fix a couple of buffer overrun bugs.
23755 Use prototypes if the compiler understands them.
23757 * src/system.h: Include unistd.h and ctype.h.
23758 Use #ifdef instead of #if for NLS symbols.
23760 1998-12-30 Jesse Thilo <jthilo@gnu.org>
23762 * doc/bison.texinfo:
23763 Delete comment "consider using @set for edition number, etc..." since
23764 we now are doing so.
23766 1998-12-30 Jesse Thilo <jthilo@gnu.org>
23769 Use prototypes if the compiler understands them.
23771 * NEWS: Document 1.26 highlights.
23773 * Makefile.am: Require Automake 1.3 or later.
23776 Use prototypes if the compiler understands them.
23778 1998-12-29 Jesse Thilo <jthilo@gnu.org>
23781 Use VERSION symbol from automake for version number.
23783 1998-12-29 Jesse Thilo <jthilo@gnu.org>
23785 * acconfig.h, configure.in, version.cin:
23786 Use VERSION symbol from automake for version number.
23788 1998-11-28 Jesse Thilo <jthilo@gnu.org>
23791 Distribute original version of simple parser (bison.s1), not built
23792 version (bison.simple).
23794 1998-11-28 Jesse Thilo <jthilo@gnu.org>
23796 * doc/bison.texinfo: Add info dir entry.
23798 * doc/bison.texinfo:
23799 Let automake put version number into documentation.
23801 1998-11-26 Jesse Thilo <jthilo@gnu.org>
23803 * src/bison.cld, src/build.com, src/vmshlp.mar:
23804 Add non-RCS files from /gd/gnu/bison.
23806 1998-11-26 Jesse Thilo <jthilo@gnu.org>
23809 Document the BISON_HAIRY and BISON_SIMPLE variables.
23811 1998-11-25 Jesse Thilo <jthilo@gnu.org>
23813 * src/version.c: Build version.c automatically.
23816 Fix token numbering (used to start at 258, not 257).
23818 * src/system.h: Include config.h.
23820 * src/getargs.c: Update bug report address.
23822 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
23823 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
23825 1998-11-25 Jesse Thilo <jthilo@gnu.org>
23828 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23830 * configure.in, version.cin:
23831 Build version.c automatically.
23833 * AUTHORS: Add AUTHORS file.
23835 * README: Update bug report address.
23838 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23840 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
23841 Add automake stuff.
23843 1998-11-25 Jesse Thilo <jthilo@gnu.org>
23845 * doc/bison.texinfo: Clean up some formatting.
23847 1998-05-05 Richard Stallman <rms@gnu.org>
23849 * doc/bison.texinfo:
23850 Explain better why to make a pure parser.
23852 1998-01-05 Richard Stallman <rms@gnu.org>
23854 * src/files.c (openfiles):
23855 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
23856 find a temporary directory, if possible. Do not unlink files while
23859 1997-08-25 Richard Stallman <rms@gnu.org>
23861 * src/reader.c (stack_offset;):
23862 Change some warni to warns.
23864 * src/lex.c (literalchar): Use warns, not warni.
23866 1997-06-28 Richard Stallman <rms@gnu.org>
23868 * src/bison.s1: Add a Bison version comment.
23870 * src/main.c (fatal, warn, berror):
23873 1997-06-28 Richard Stallman <rms@gnu.org>
23875 * Makefile.in (bison_version): New variable.
23876 (dist): Use that variable.
23877 (bison.s1): Substitute the Bison version into bison.simple.
23879 * bison.simple: Add a Bison version comment.
23881 1997-06-18 Richard Stallman <rms@gnu.org>
23883 * src/main.c (fatal, warn, berror):
23884 Make error messages standard.
23885 (toomany): Improve error message text.
23887 * 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:
23888 new.h renamed to alloc.h.
23890 1997-06-18 Richard Stallman <rms@gnu.org>
23892 * Makefile.in: new.h renamed to alloc.h.
23894 1997-05-24 Richard Stallman <rms@gnu.org>
23896 * src/lex.c (literalchar):
23897 Fix the code for escaping \, " and '.
23899 (lex): Avoid trouble when there are many chars
23900 to discard in a char literal with just several chars in it.
23902 1997-05-17 Richard Stallman <rms@gnu.org>
23905 Use malloc, if using alloca is troublesome.
23906 (YYSTACK_USE_ALLOCA): New flag macro.
23907 Define it for some systems and compilers.
23908 (YYSTACK_ALLOC): New macro.
23909 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23910 If it was malloc'd, free it.
23912 1997-05-17 Richard Stallman <rms@gnu.org>
23915 Use malloc, if using alloca is troublesome.
23916 (YYSTACK_USE_ALLOCA): New flag macro.
23917 Define it for some systems and compilers.
23918 (YYSTACK_ALLOC): New macro.
23919 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23920 If it was malloc'd, free it.
23922 1997-04-23 Richard Stallman <rms@gnu.org>
23925 (alloca) [__hpux]: Always define as __builtin_alloca.
23927 1997-04-23 Richard Stallman <rms@gnu.org>
23930 (alloca) [__hpux]: Always define as __builtin_alloca.
23932 1997-04-22 Richard Stallman <rms@gnu.org>
23935 [__hpux]: Include alloca.h (right for HPUX 10)
23936 instead of declaring alloca (right for HPUX 9).
23938 * src/bison.s1 (__yy_memcpy):
23939 Declare arg `count' as unsigned int.
23940 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23942 1997-04-22 Richard Stallman <rms@gnu.org>
23945 [__hpux]: Include alloca.h (right for HPUX 10)
23946 instead of declaring alloca (right for HPUX 9).
23948 * bison.simple (__yy_memcpy):
23949 Declare arg `count' as unsigned int.
23950 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23952 1997-01-03 Richard Stallman <rms@gnu.org>
23954 * src/allocate.c: [__STDC__ or _MSC_VER]:
23955 Declare calloc and realloc to return void *.
23957 1997-01-02 Richard Stallman <rms@gnu.org>
23960 [_MSC_VER]: Include stdlib.h and process.h.
23961 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
23963 * src/main.c (main): Return FAILURE as a value.
23964 (printable_version): Declare arg as int, not char.
23966 1997-01-02 Richard Stallman <rms@gnu.org>
23968 * Makefile.in (dist):
23969 Explicitly check for symlinks, and copy them.
23971 1996-12-19 Richard Stallman <rms@gnu.org>
23974 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
23976 1996-12-18 Paul Eggert <eggert@gnu.org>
23978 * src/bison.s1 (yyparse):
23979 If __GNUC__ and YYPARSE_PARAM are both defined,
23980 declare yyparse to have a void * argument.
23982 1996-12-18 Paul Eggert <eggert@gnu.org>
23984 * bison.simple (yyparse):
23985 If __GNUC__ and YYPARSE_PARAM are both defined,
23986 declare yyparse to have a void * argument.
23988 1996-12-17 Richard Stallman <rms@gnu.org>
23990 * src/reduce.c (nbits): Add some casts.
23992 1996-08-12 Richard Stallman <rms@gnu.org>
23994 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
23996 1996-08-12 Richard Stallman <rms@gnu.org>
23998 * bison.simple: Test _MSDOS as well as _MSDOS_.
24000 1996-07-31 Richard Stallman <rms@gnu.org>
24003 [__sun && __i386]: Include alloca.h.
24005 1996-07-31 Richard Stallman <rms@gnu.org>
24008 [__sun && __i386]: Include alloca.h.
24010 1996-07-30 Richard Stallman <rms@gnu.org>
24012 * src/bison.s1: Comment change.
24014 * src/bison.s1: Test _MSDOS_, not MSDOS.
24016 1996-07-30 Richard Stallman <rms@gnu.org>
24018 * bison.simple: Comment change.
24020 * bison.simple: Test _MSDOS_, not MSDOS.
24022 1996-06-01 Richard Stallman <rms@gnu.org>
24024 * 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:
24025 Insert `_' macro around many string constants.
24028 Insert `_' macro around many string constants.
24030 (main): Call setlocale, bindtextdomain and textdomain.
24032 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
24033 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
24034 [ENABLE_NLS]: Include libintl.h.
24035 [ENABLE_NLS] (gettext): Define.
24036 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
24037 (N_, PACKAGE, LOCALEDIR): New macros.
24039 1996-06-01 Richard Stallman <rms@gnu.org>
24041 * POTFILES.in: New file.
24043 * Makefile.in (allocate.o):
24044 Define target explicitly.
24046 * Makefile.in (CFLAGS): Set to @CFLAGS@.
24047 (LDFLAGS): Set to @LDFLAGS@.
24048 (configure): Run autoconf only if preceding `cd' succeeds.
24049 (bison.s1): Redirect output to temporary file then move the
24050 temporary to the target, rather than redirecting directly to bison.s1.
24051 (clean): Remove config.status and config.log.
24052 (distclean): Don't remove config.status here.
24054 1996-05-12 Richard Stallman <rms@gnu.org>
24057 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
24059 1996-05-12 Richard Stallman <rms@gnu.org>
24062 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
24064 1996-05-11 Richard Stallman <rms@gnu.org>
24066 * src/bison.s1 (__yy_memcpy):
24067 Really reorder the args, as was supposedly done on Feb 14 1995.
24068 (yyparse): Calls changed accordingly.
24070 1996-05-11 Richard Stallman <rms@gnu.org>
24072 * Makefile.in (dist): Don't use $(srcdir).
24074 * bison.simple (__yy_memcpy):
24075 Really reorder the args, as was supposedly done on Feb 14 1995.
24076 (yyparse): Calls changed accordingly.
24078 1996-01-27 Richard Stallman <rms@gnu.org>
24080 * src/output.c (output_rule_data):
24081 Test YYERROR_VERBOSE in the conditional
24082 around the definition of ttyname.
24084 1995-12-29 Richard Stallman <rms@gnu.org>
24087 Fix line numbers in #line commands.
24089 1995-12-29 Richard Stallman <rms@gnu.org>
24092 Fix line numbers in #line commands.
24094 1995-12-27 Richard Stallman <rms@gnu.org>
24096 * src/bison.s1 (YYPARSE_PARAM_DECL):
24097 In C++, make it always null.
24098 (YYPARSE_PARAM_ARG): New macro.
24099 (yyparse): Use YYPARSE_PARAM_ARG.
24101 1995-12-27 Richard Stallman <rms@gnu.org>
24103 * bison.simple (YYPARSE_PARAM_DECL):
24104 In C++, make it always null.
24105 (YYPARSE_PARAM_ARG): New macro.
24106 (yyparse): Use YYPARSE_PARAM_ARG.
24108 1995-11-29 Richard Stallman <rms@gnu.org>
24110 * doc/bison.texinfo:
24111 Describe literal string tokens, %raw, %no_lines, %token_table.
24113 1995-11-29 Daniel Hagerty <hag@gnu.org>
24115 * doc/bison.texinfo: Fixed update date
24117 1995-10-16 Richard Stallman <rms@gnu.org>
24119 * src/version.c: Version 1.25.
24121 1995-10-16 Richard Stallman <rms@gnu.org>
24123 * NEWS: *** empty log message ***
24125 1995-10-16 Richard Stallman <rms@gnu.org>
24127 * doc/bison.1, doc/bison.rnh:
24130 1995-10-15 Richard Stallman <rms@gnu.org>
24132 * src/vmsgetargs.c, src/getargs.c:
24133 Added -n, -k, and -raw switches.
24134 (noparserflag, toknumflag, rawtoknumflag): New variables.
24136 * src/symtab.h (SALIAS):
24137 New #define for adding aliases to %token.
24138 (struct bucket): Added `alias' field.
24140 * src/reduce.c (reduce_grammar):
24141 Revise error message.
24142 (print_notices): Remove final `.' from error message.
24144 * src/reader.c (reader_output_yylsp):
24146 (readgram): Use `#if 0' around code that accepted %command
24147 inside grammar rules: The documentation doesn't allow it,
24148 and it will fail since the %command processors scan for the next %.
24149 (parse_token_decl): Extended the %token
24150 declaration to allow a multi-character symbol as an alias.
24151 (parse_thong_decl): New function.
24152 (read_declarations): Added %thong declarations.
24153 (read_declarations): Handle NOOP to deal with allowing
24154 % declarations as another means to specify the flags.
24155 (readgram): Allow %prec prior to semantics embedded in a rule.
24156 (skip_to_char, read_declarations, copy_definition)
24157 (parse_token_decl, parse_start_decl, parse_type_decl)
24158 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
24159 (get_type_name, copy_guard, copy_action, readgram)
24160 (get_type, packsymbols): Revised most error messages.
24161 Changed `fatal' to `warnxxx' to avoid aborting for error.
24162 Revised and use multiple warnxxx functions to avoid using VARARGS1.
24163 (read_declarations): Improve the error message for
24164 an invalid character. Do not abort.
24165 (read_declarations, copy_guard, copy_action): Use
24166 printable_version to avoid unprintable characters in printed output.
24167 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
24168 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
24169 Allow the type of a non-terminal can be given
24170 more than once, as long as all specifications give the same type.
24173 (output_headers, output_trailers, output, output_gram)
24174 (output_rule_data): Implement noparserflag variable.
24175 Implement toknumflag variable.
24176 (output): Call reader_output_yylsp to output LTYPESTR.
24178 * src/main.c (main):
24179 If reader sees an error, don't process the grammar.
24180 (fatals): Updated to not use VARARGS1.
24181 (printable_version, int_to_string, warn, warni, warns, warnss)
24182 (warnsss): New error reporting functions. Avoid abort for error.
24185 Added THONG and NOOP for alias processing.
24186 Added SETOPT for the new code that allows setting options with %flags.
24189 Include getopt.h. Add some extern decls.
24190 (safegetc): New function to deal with EOF gracefully.
24191 (literalchar); new function to deal with reading \ escapes.
24192 (lex): Use literalchar.
24193 (lex): Implemented "..." tokens.
24194 (literalchar, lex, parse_percent_token): Made tokenbuffer
24195 always contain the token. This includes growing the token
24196 buffer while reading an integer.
24197 (parse_percent_token): Replaced if-else statement with percent_table.
24198 (parse_percent_token): Added % declarations as another
24199 way to specify the flags -n, -l, and -r. Also added hooks for
24200 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
24201 major changes to files.c.
24202 (lex) Retain in the incoming stream a character following
24204 (skip_white_space, lex): Revised most error messages
24205 and changed fatal to warn to avoid aborting.
24206 (percent_table): Added %thong declarations.
24208 * src/gram.h: Comment changes.
24210 * src/files.c (openfiles, open_extra_files, done):
24212 and actfile file. Handle noparserflag. Both for -n switch.
24214 * src/conflicts.c (resolve_sr_conflict):
24215 Remove use of alloca.
24217 1995-06-01 Jim Meyering <meyering@gnu.org>
24219 * doc/bison.texinfo: *** empty log message ***
24221 1995-05-06 Richard Stallman <rms@gnu.org>
24223 * src/bison.s1: Comment change.
24225 1995-05-06 Richard Stallman <rms@gnu.org>
24227 * bison.simple: Comment change.
24229 1995-05-03 Richard Stallman <rms@gnu.org>
24231 * src/version.c: Version now 1.24.
24233 * src/bison.s1: Change distribution terms.
24235 * src/version.c: Version now 1.23.
24237 1995-05-03 Richard Stallman <rms@gnu.org>
24239 * doc/bison.texinfo:
24240 Rewrite "Conditions for Using Bison".
24241 Update version to 1.24.
24243 1995-05-03 Richard Stallman <rms@gnu.org>
24245 * bison.simple: Change distribution terms.
24247 1995-02-23 Richard Stallman <rms@gnu.org>
24249 * src/files.c: Test __VMS_POSIX as well as VMS.
24251 1995-02-14 Jim Meyering <meyering@gnu.org>
24253 * src/bison.s1 (__yy_memcpy):
24254 Renamed from __yy_bcopy to avoid
24255 confusion. Reverse FROM and TO arguments to be consistent with
24258 1995-02-14 Jim Meyering <meyering@gnu.org>
24260 * bison.simple (__yy_memcpy):
24261 Renamed from __yy_bcopy to avoid
24262 confusion. Reverse FROM and TO arguments to be consistent with
24265 1994-11-10 David J. MacKenzie <djm@gnu.org>
24271 * Makefile.in (DISTFILES): Include NEWS.
24273 * Makefile.in (DISTFILES):
24274 Include install-sh, not install.sh.
24276 * configure.in: Update to Autoconf v2 macro names.
24278 1994-10-05 David J. MacKenzie <djm@gnu.org>
24280 * Makefile.in: fix typo
24282 * Makefile.in (prefix, exec_prefix):
24283 Let configure set them.
24285 1994-09-28 David J. MacKenzie <djm@gnu.org>
24287 * Makefile.in: Set datadir to $(prefix)/share.
24289 1994-09-15 Richard Stallman <rms@gnu.org>
24292 Update copyright notice and GPL version.
24294 1994-09-15 Richard Stallman <rms@gnu.org>
24297 Update copyright notice and GPL version.
24299 1994-07-12 Richard Stallman <rms@gnu.org>
24301 * src/reduce.c, src/reader.c:
24304 1994-05-05 David J. MacKenzie <djm@gnu.org>
24306 * Makefile.in: entered into RCS
24308 1994-03-26 Richard Stallman <rms@gnu.org>
24310 * src/bison.s1: entered into RCS
24312 1994-03-26 Richard Stallman <rms@gnu.org>
24314 * bison.simple: entered into RCS
24316 1994-03-25 Richard Stallman <rms@gnu.org>
24318 * src/main.c: entered into RCS
24320 1994-03-24 Richard Stallman <rms@gnu.org>
24322 * src/conflicts.c: entered into RCS
24324 1994-01-02 Richard Stallman <rms@gnu.org>
24326 * Makefile.in: *** empty log message ***
24328 1993-11-21 Richard Stallman <rms@gnu.org>
24330 * src/bison.s1: *** empty log message ***
24332 1993-11-21 Richard Stallman <rms@gnu.org>
24334 * doc/bison.texinfo: entered into RCS
24336 * doc/bison.texinfo: *** empty log message ***
24338 1993-11-21 Richard Stallman <rms@gnu.org>
24340 * bison.simple: *** empty log message ***
24342 1993-10-25 David J. MacKenzie <djm@gnu.org>
24344 * doc/bison.texinfo: *** empty log message ***
24346 1993-10-19 Richard Stallman <rms@gnu.org>
24348 * src/bison.s1: *** empty log message ***
24350 1993-10-19 Richard Stallman <rms@gnu.org>
24352 * bison.simple: *** empty log message ***
24354 1993-10-14 Richard Stallman <rms@gnu.org>
24356 * src/bison.s1: *** empty log message ***
24358 1993-10-14 Richard Stallman <rms@gnu.org>
24360 * bison.simple: *** empty log message ***
24362 1993-09-14 David J. MacKenzie <djm@gnu.org>
24364 * doc/bison.texinfo: *** empty log message ***
24366 1993-09-13 Noah Friedman <friedman@gnu.org>
24368 * Makefile.in: *** empty log message ***
24370 1993-09-10 Richard Stallman <rms@gnu.org>
24372 * src/conflicts.c: *** empty log message ***
24374 * src/system.h: entered into RCS
24376 1993-09-10 Richard Stallman <rms@gnu.org>
24378 * doc/bison.1: entered into RCS
24380 1993-09-06 Noah Friedman <friedman@gnu.org>
24382 * src/version.c: entered into RCS
24384 1993-09-06 Noah Friedman <friedman@gnu.org>
24386 * Makefile.in: *** empty log message ***
24388 1993-07-30 David J. MacKenzie <djm@gnu.org>
24390 * Makefile.in: *** empty log message ***
24392 1993-07-24 Richard Stallman <rms@gnu.org>
24394 * src/bison.s1: *** empty log message ***
24396 1993-07-24 Richard Stallman <rms@gnu.org>
24398 * bison.simple: *** empty log message ***
24400 1993-07-08 David J. MacKenzie <djm@gnu.org>
24402 * Makefile.in: *** empty log message ***
24404 1993-07-04 Richard Stallman <rms@gnu.org>
24406 * src/bison.s1: *** empty log message ***
24408 1993-07-04 Richard Stallman <rms@gnu.org>
24410 * bison.simple: *** empty log message ***
24412 1993-06-26 David J. MacKenzie <djm@gnu.org>
24414 * src/getargs.c: entered into RCS
24416 1993-06-26 David J. MacKenzie <djm@gnu.org>
24418 * doc/bison.texinfo: *** empty log message ***
24420 * doc/bison.1: New file.
24422 1993-06-25 Richard Stallman <rms@gnu.org>
24424 * src/getargs.c: New file.
24426 1993-06-16 Richard Stallman <rms@gnu.org>
24428 * src/bison.s1: *** empty log message ***
24430 1993-06-16 Richard Stallman <rms@gnu.org>
24432 * bison.simple: *** empty log message ***
24434 1993-06-03 Richard Stallman <rms@gnu.org>
24436 * src/bison.s1: New file.
24438 1993-06-03 Richard Stallman <rms@gnu.org>
24440 * doc/bison.texinfo: *** empty log message ***
24442 1993-06-03 Richard Stallman <rms@gnu.org>
24444 * bison.simple: New file.
24446 1993-05-19 Richard Stallman <rms@gnu.org>
24448 * doc/bison.texinfo: New file.
24450 1993-05-07 Noah Friedman <friedman@gnu.org>
24452 * Makefile.in: *** empty log message ***
24454 1993-04-28 Noah Friedman <friedman@gnu.org>
24456 * src/reader.c: *** empty log message ***
24458 1993-04-23 Noah Friedman <friedman@gnu.org>
24460 * src/alloc.h: entered into RCS
24462 1993-04-20 David J. MacKenzie <djm@gnu.org>
24464 * src/version.c: *** empty log message ***
24466 * src/files.c, src/allocate.c:
24469 * src/reader.c: *** empty log message ***
24471 * src/lex.c: entered into RCS
24473 * src/conflicts.c: New file.
24475 * src/symtab.c: entered into RCS
24477 * src/alloc.h: New file.
24479 * src/LR0.c: entered into RCS
24481 1993-04-18 Noah Friedman <friedman@gnu.org>
24483 * src/reader.c: New file.
24485 * src/version.c: *** empty log message ***
24487 1993-04-18 Noah Friedman <friedman@gnu.org>
24489 * Makefile.in: *** empty log message ***
24491 1993-04-17 Noah Friedman <friedman@gnu.org>
24493 * Makefile.in: *** empty log message ***
24495 1993-04-15 Richard Stallman <rms@gnu.org>
24497 * src/main.c, src/files.c:
24500 1993-04-15 Noah Friedman <friedman@gnu.org>
24502 * configure.in: entered into RCS
24504 * configure.in: *** empty log message ***
24506 * configure.in: New file.
24508 1993-04-14 Richard Stallman <rms@gnu.org>
24510 * Makefile.in: New file.
24512 1993-04-13 Richard Stallman <rms@gnu.org>
24514 * src/version.c: New file.
24516 1993-03-25 Richard Stallman <rms@gnu.org>
24518 * src/output.c: entered into RCS
24520 1992-09-25 Richard Stallman <rms@gnu.org>
24522 * configure.bat: entered into RCS
24524 1992-06-22 Richard Stallman <rms@gnu.org>
24526 * src/vmsgetargs.c: entered into RCS
24528 1992-06-22 Richard Stallman <rms@gnu.org>
24530 * doc/bison.rnh: entered into RCS
24532 1992-04-20 David J. MacKenzie <djm@gnu.org>
24534 * README: entered into RCS
24536 1992-01-22 Richard Stallman <rms@gnu.org>
24538 * src/machine.h: entered into RCS
24540 1991-12-21 Richard Stallman <rms@gnu.org>
24542 * src/lalr.c, src/closure.c:
24545 1991-12-20 Richard Stallman <rms@gnu.org>
24547 * src/state.h: entered into RCS
24549 1991-12-18 Richard Stallman <rms@gnu.org>
24551 * src/print.c, src/nullable.c, src/derives.c:
24554 1991-11-03 David J. MacKenzie <djm@gnu.org>
24556 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
24559 1988-09-09 Richard Stallman <rms@gnu.org>
24561 * src/bison.hairy: entered into RCS
24563 1987-12-16 Richard Stallman <rms@gnu.org>
24565 * REFERENCES: entered into RCS
24570 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
24571 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
24572 2008, 2009 Free Software Foundation, Inc.
24574 Copying and distribution of this file, with or without
24575 modification, are permitted provided the copyright notice and this
24576 notice are preserved.