1 2009-04-10 Eric Blake <ebb9@byu.net>
3 submodules: update to latest
4 * submodules/autoconf: Use latest upstream Autoconf.
6 2009-04-06 Eric Blake <ebb9@byu.net>
8 Work around autoconf 2.63b bug in testsuite.
9 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
10 autoconf bug related to # in test.
12 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
14 * NEWS (2.5): New section. Describe new -D/--define feature.
16 2009-04-06 Akim Demaille <demaille@gostai.com>
19 * src/parse-gram.h, src/parse-gram.c: Regen.
21 2009-04-06 Akim Demaille <demaille@gostai.com>
23 rename muscle_tab.* as muscle-tab.* for consistency.
24 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
25 * src/muscle-tab.h, src/muscle-tab.c: these.
26 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
27 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
29 2009-04-06 Akim Demaille <demaille@gostai.com>
31 Makefile: introduce $(BISON).
32 * src/local.mk (BISON): New.
35 2009-04-06 Akim Demaille <demaille@gostai.com>
37 parser: handle %locations as %define locations.
38 * src/getargs.h, src/getargs.c (locations_flag): Remove.
39 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
40 to set "locations" to true.
41 * src/output.c (prepare): Don't output "locations".
42 * src/scan-gram.l (%locations): Handle it as a %<flag>.
43 * src/parse-gram.y: It's no longer a token.
45 * data/bison.m4 (b4_locations_if): Define it with
46 b4_percent_define_if_define.
47 * data/c.m4, data/glr.cc: Adjust.
49 2009-04-06 Akim Demaille <demaille@gostai.com>
52 * src/parse-gram.c: Regen.
54 2009-04-06 Akim Demaille <demaille@gostai.com>
56 muscle: factor the handling of obsolete of obsolete directives.
57 Suggested by Joel E. Denny.
59 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
60 New, extracted from...
61 * src/parse-gram.y (prologue_declaration: pure-parser): here.
63 (prologue_declaration: "%<flag>"): Use
64 muscle_percent_define_ensure.
65 (%error-verbose, %pure-parser): No longer tokens.
66 * src/scan-gram.l (pure-parser): Return as a %<flag>.
68 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
70 Fix options documentation.
71 * build-aux/cross-options.pl: As in --help output, write optional
72 arguments as [=ARG] not =[ARG].
73 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
75 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
77 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
78 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
79 requirements for a correct m4 are stricter.
80 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
81 * configure.ac: Update to use AC_PROG_GNU_M4.
82 Reported by Eric Blake.
84 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
86 Help with updating web manual.
87 * HACKING: Incorporate instructions from gnulib/doc/README.
88 * bootstrap.conf (gnulib_modules): Add gendocs.
90 2009-04-03 Akim Demaille <demaille@gostai.com>
93 * src/parse-gram.h, src/parse-gram.c: Regen.
95 2009-04-03 Akim Demaille <demaille@gostai.com>
97 Factor %FLAG at scan level.
98 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
99 definitions and associated rules, replaced by....
100 (PERCENT_FLAG): this new token type, and rule.
101 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
102 Use it for %debug and %error-verbose.
104 2009-04-03 Akim Demaille <demaille@gostai.com>
107 * src/parse-gram.h, src/parse-gram.c: Regen.
109 2009-04-03 Akim Demaille <demaille@gostai.com>
111 Treat %debug as %define debug.
112 * data/bison.m4 (b4_debug_if): New.
113 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
114 * data/lalr1.java: Use it instead of b4_debug_flag.
115 * src/getargs.h, src/getargs.c (debug_flag): Remove.
116 * src/output.c (prepare): Don't output it.
117 * src/parse-gram.y: Treat %debug as %define debug.
119 2009-04-03 Akim Demaille <demaille@gostai.com>
121 Treat %error-verbose as %define error_verbose.
122 This allows to pass -Derror_verbose on the command line. Better
123 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
124 ERROR_VERBOSE being defined as false or true.
125 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
126 on b4_percent_define_ifdef, for does not check the defined value,
127 but only whether the symbol is defined, rely on
128 b4_percent_define_flag_if, so that a value of "false" is processed
130 If not defined, define the flag to "false".
131 (b4_error_verbose_if): New.
132 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
133 b4_error_verbose_flag.
134 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
135 * src/output.c (prepare): Don't output it.
136 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
138 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
140 Fix strange %define locations for default values.
141 Reported by Akim Demaille at
142 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
143 and discussed again starting at
144 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
145 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
146 because location information is bogus.
147 Use angle brackets to delimit fake file name because square brackets
148 look like underexpanded m4. Choose a better fake file name.
149 Use negative line numbers.
150 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
151 * src/location.c (location_print): If line for a boundary is negative,
152 only print that boundary's file name.
153 * src/location.h: Document that.
154 * tests/skeletons.at (%define Boolean variables: invalid skeleton
155 defaults): Update output.
157 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
159 Pacify ./configure --enable-gcc-warnings.
160 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
161 in lib won't compile with it.
162 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
164 2009-03-31 Akim Demaille <demaille@gostai.com>
166 bootstrap: --help to stdout.
167 * bootstrap (usage): Don't send --help to stderr.
168 Use a here doc instead of a long string.
170 2009-03-31 Akim Demaille <demaille@gostai.com>
172 bootstrap: README-hacking no longer exists
173 * bootstrap (checkout_only_file): Set to HACKING.
175 2009-03-26 Akim Demaille <demaille@gostai.com>
177 doc: merge HACKING and README-hacking.
178 Two files is confusing.
179 Reported by Alexandre Duret-Lutz.
181 * README-hacking: Merge into...
182 * HACKING (Working from the repository): here.
184 2009-03-26 Akim Demaille <demaille@gostai.com>
186 doc: update README-hacking.
187 * README-hacking: We now use git and git submodules.
188 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
190 2009-03-26 Akim Demaille <demaille@gostai.com>
192 lalr1.cc: avoid GCC 4.3 warnings.
193 GCC 4.3 now warns about "a || b && c" and asks for explicit
195 Reported by Alexandre Duret-Lutz.
196 * data/location.cc: Update copyright years.
197 (Position::operator==): Use parens to make precedence explicit.
198 Compare lines and columns first, as they are more likely to be
199 different, and they are faster to compare.
201 2009-03-26 Akim Demaille <demaille@gostai.com>
204 * gnulib: Update to latest.
205 * src/local.mk (AM_CFLAGS): Move to...
207 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
210 2009-03-02 Akim Demaille <demaille@gostai.com>
214 2009-03-02 Akim Demaille <demaille@gostai.com>
216 Share b4_yytranslate_define.
217 * data/lalr1.cc (b4_yytranslate_define): Move to...
220 2009-03-02 Akim Demaille <demaille@gostai.com>
222 Use locations in the variant example.
223 Yes, this obfuscates the point of this example, variants only.
224 But glr.cc cannot work (yet?) without locations. This change
225 makes it easier to use this example with glr.cc.
227 * examples/variant.yy (assert): %define it.
228 (locations): Request them.
229 (yylex): Bind the location to the stage.
231 2009-03-02 Akim Demaille <demaille@gostai.com>
233 Dub make_TOKEN as a public type interface.
234 * data/c++.m4 (b4_symbol_constructor_declare)
235 (b4_symbol_constructor_define): New empty stubs.
236 (b4_public_types_declare, b4_public_types_define): Use them.
237 * data/lalr1.cc (b4_symbol_constructor_declare)
238 (b4_symbol_constructor_declare_)
239 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
241 * data/variant.hh: here.
242 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
244 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
245 b4_symbol_constructor_declare, as it is now done by
246 b4_public_types_define and b4_public_types_declare.
248 2009-03-02 Akim Demaille <demaille@gostai.com>
250 Coding style changes.
251 * data/lalr1.cc (b4_symbol_constructor_declaration_)
252 (b4_symbol_constructor_declarations)
253 (b4_symbol_constructor_definition_)
254 (b4_symbol_constructor_definitions)
255 (b4_yytranslate_definition): Rename as...
256 (b4_symbol_constructor_declare_)
257 (b4_symbol_constructor_declare)
258 (b4_symbol_constructor_define_)
259 (b4_symbol_constructor_define)
260 (b4_yytranslate_define): these.
261 * data/variant.hh (b4_variant_definition): Rename as...
262 (b4_variant_define): this.
264 2009-03-02 Akim Demaille <demaille@gostai.com>
266 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
267 * data/bison.m4 (b4_percent_define_if_define): New.
268 * data/c++.m4 (b4_variant_if): Move to...
269 * data/bison.m4: Here, using b4_percent_define_if_define.
270 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
271 * data/bison.m4: Here, using b4_percent_define_if_define.
273 2009-03-02 Akim Demaille <demaille@gostai.com>
275 Dub symbol_type_base as a public type.
276 * data/c++.m4 (b4_public_types_declare): Now define
277 symbol_type_base and symbol_type.
278 (b4_public_types_define): New.
279 In both cases, the definitions are taken verbatim from lalr1.cc.
280 * data/lalr1.cc: Adjust.
282 2009-03-02 Akim Demaille <demaille@gostai.com>
284 b4_public_types_declare.
285 * data/c++.m4 (b4_public_types_declare): New.
286 * data/glr.cc, data/lalr1.cc: Use it.
288 2009-03-02 Akim Demaille <demaille@gostai.com>
290 b4_semantic_type_declare.
291 * data/c++.m4 (b4_semantic_type_declare): New.
292 Factors and generalizes what was in glr.cc and lalr1.cc.
293 * data/variant.hh (b4_semantic_type_declare): Redefine it for
295 * data/lalr1.cc, data/glr.cc: Use it.
297 2009-02-26 Akim Demaille <demaille@gostai.com>
300 * gnulib: Upgrade from master.
301 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
304 2009-02-25 Akim Demaille <demaille@gostai.com>
306 Remove useless arguments.
307 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
310 2009-02-25 Akim Demaille <demaille@gostai.com>
313 * data/lalr1.cc: here.
315 2009-02-25 Akim Demaille <demaille@gostai.com>
317 Fix glr.cc's debug level handling.
318 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
320 (debug_level, set_debug_level): Adjust.
322 2009-02-25 Akim Demaille <demaille@gostai.com>
325 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
327 2009-02-25 Akim Demaille <demaille@gostai.com>
330 * etc/bench.pl.in (generate_grammar_list): Consitently use
331 location_type, not yy::location.
333 2009-02-25 Akim Demaille <demaille@gostai.com>
336 * data/lalr1.cc: here.
338 2009-02-19 Akim Demaille <demaille@gostai.com>
340 Make yyparser::error public.
341 * data/lalr1.cc: here.
342 There is no good reason to keep it private (and it is convenient
343 to use it from the scanner for instance). It is already public in
346 2009-02-19 Akim Demaille <demaille@gostai.com>
351 2009-02-19 Akim Demaille <demaille@gostai.com>
353 Remove trailing blanks.
354 The epilogue has its own ending \n, no need to add another.
356 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
358 * data/glr.cc: dnl when extending the epilogue.
359 Remove stray "private:".
361 2009-02-19 Akim Demaille <demaille@gostai.com>
364 * data/c.m4 (b4_c_function_decl): Here.
366 2009-02-19 Akim Demaille <demaille@gostai.com>
369 * data/lalr1.cc: here.
371 2009-02-19 Akim Demaille <demaille@gostai.com>
374 * data/variant.hh: New, extracted from...
375 * data/lalr1.cc: here.
377 * data/local.mk: Adjust.
379 2009-02-19 Akim Demaille <demaille@gostai.com>
381 Extract stack.hh from lalr1.cc.
382 * data/stack.hh: New.
383 * data/lalr1.cc: Extract from here.
384 * data/local.mk: Adjust.
386 2009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
388 Add reminder about uploading public key to keys.gnupg.net.
389 * HACKING (Release Procedure): Here.
391 2009-01-28 Akim Demaille <demaille@gostai.com>
393 * NEWS: Update information about 2.4.1 and 2.4.2.
395 2008-11-04 Akim Demaille <demaille@gostai.com>
398 * NEWS: Use more outline-mode markup.
399 Suggested by Jim Meyering.
401 2009-01-08 Akim Demaille <demaille@gostai.com>
403 Fix grep portability issues.
404 Grep on Solaris does not support -q.
405 Reported by Summum Bonum.
407 * NEWS: Add a stub for 2.4.2.
408 * THANKS: Add Summum Bonum.
409 * tests/atlocal.in (EGREP): New.
410 (CC, CXX, XSLTPROC): Make it possible to override them via
412 * tests/java.at: Use $EGREP instead of egrep.
413 Use AT_CHECK's ignore instead of grep's -q.
415 2008-12-11 Akim Demaille <demaille@gostai.com>
417 Pass the token type to yysyntax_error.
418 * data/yacc.c (yysyntax_error): Take the transated token instead
423 2008-12-11 Akim Demaille <demaille@gostai.com>
426 * data/glr.c: Formatting changes.
428 2008-12-11 Akim Demaille <demaille@gostai.com>
430 Propagate i18n changes into glr.c.
432 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
433 building the error message format dynamically.
434 * data/lalr1.java: Formatting changes.
436 2008-12-11 Akim Demaille <demaille@gostai.com>
439 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
440 Solves problems when top_srcdir is an absolute path.
441 Suggested by Eric Blake.
442 * configure.ac: Require Autoconf 2.62.
444 2008-12-11 Akim Demaille <demaille@gostai.com>
446 Simplify the i18n of the error messages.
447 * data/lalr1.cc: Comment changes.
448 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
449 lalr1.cc instead of building dynamically the format string.
451 2008-12-08 Akim Demaille <demaille@gostai.com>
453 Fix portability issue in the test suite.
454 * tests/local.at (AT_MATCHES_CHECK): New.
455 Based on Perl instead of Sed. Sed has too many portability
456 pitfalls, not ever Sed is GNU Sed.
457 * tests/actions.at (Fix user actions without a trailing semicolon):
460 2008-12-08 Akim Demaille <demaille@gostai.com>
463 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
465 2008-12-08 Akim Demaille <demaille@gostai.com>
467 Install autoconf as a submodule to get m4sugar.
468 * .gitmodules: Add submodules/autoconf.
469 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
472 2008-12-08 Akim Demaille <demaille@gostai.com>
474 Test token.prefix in all the skeletons.
475 * data/java.m4 (b4_token_enum): Use the token.prefix.
476 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
477 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
478 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
479 * tests/java.at: Comment changes.
480 (AT_CHECK_JAVA_MINIMAL): Define the END token.
481 (Java parser class and package names): Add token.prefix check.
483 2008-12-08 Akim Demaille <demaille@gostai.com>
485 Fix regeneration of atconfig.
486 * tests/local.mk (tests/atconfig): The rule was incorrect, but
487 remove it: now that there is no tests/Makefile.am, the top-level
488 Makefile properly updates atconfig when needed.
490 2008-12-07 Di-an Jan <dianj@freeshell.org>
492 Implement the FIXME that ends an user action with a semicolon
493 if it seems necessary.
494 * src/scan-code.l (flex rules section): Flag cpp directive from
495 any `#' to the first unescaped end-of-line. Semicolon is not
496 needed after `;', `{', '}', or cpp directives and is needed after
497 any other token (whitespaces and comments have no effect).
498 * tests/actions.at (Fix user actions without a trailing semicolon):
500 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
501 to make user actions complete statements.
502 Adjust column numbers in error messages.
503 * tests/regression.at (Fix user actions without a trailing semicolon):
504 Remove. Covered by new test.
506 2008-12-07 Akim Demaille <demaille@gostai.com>
509 * gnulib: Update from master.
511 2008-12-05 Eric Blake <ebb9@byu.net>
513 Avoid compiler warning.
514 * src/output.c (muscle_insert_item_number_table): Delete unused
517 2008-12-02 Eric Blake <ebb9@byu.net>
519 Build testsuite with newer autoconf.
520 * tests/output.at (m4_expand): Don't override in newer autoconf,
521 where the underlying implementation changed.
522 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
523 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
524 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
525 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
526 since some of them contain unbalanced ')'.
528 2008-12-01 Akim Demaille <demaille@gostai.com>
530 Use b4_symbol for printers and destructors everywhere.
531 * data/bison.m4 (b4_symbol_action_location): New.
532 * data/c.m4 (b4_symbol_actions): Remove.
533 Adjust all callers to use by b4_symbol_foreach and the corresponding
534 b4_symbol_printer/destructor macro.
535 * data/glr.cc: Adjust.
536 * data/lalr1.java: Adjust the %destructor sanity check.
537 * src/output.c (symbol_code_props_output): Remove, we no longer
538 need the b4_symbol_printers/destructors tables.
540 2008-12-01 Akim Demaille <demaille@gostai.com>
543 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
546 2008-12-01 Akim Demaille <demaille@gostai.com>
548 Move b4_symbol based macro to bison.m4.
549 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
550 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
551 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
552 (b4_type_foreach): Move to...
553 * data/bison.m4: Here.
554 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
555 b4_symbol_value_template instead of b4_symbol_value.
557 2008-12-01 Akim Demaille <demaille@gostai.com>
559 b4_symbol/type_foreach.
560 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
563 2008-12-01 Akim Demaille <demaille@gostai.com>
565 Use the symbol properties to output the printer/destructor for lalr1.cc.
566 Instead of defining complex list of tuples to define various
567 properties of the symbols, we now prefer to define symbols as
568 "structs" in m4: using the symbol key (its number), and the
569 property name, b4_symbol gives it value. Use this to handle
570 destructors and printers.
572 * src/output.c (CODE_PROP): New.
573 (prepare_symbol_definitions): Use it to define the printer and
574 destructor related attributes of the symbols.
575 * data/lalr1.cc (b4_symbol_actions): Rename as...
576 (b4_symbol_action): this.
577 Use b4_symbol instead of 6 arguments.
578 (b4_symbol_printer, b4_symbol_destructor): New.
579 Use them instead of b4_symbol_actions.
581 2008-12-01 Akim Demaille <demaille@gostai.com>
583 Avoid capturing variables too easily.
584 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
585 v__ and p__ instead of v and p.
587 2008-12-01 Akim Demaille <demaille@gostai.com>
589 Remove spurious empty line before syncline.
590 * data/bison.m4 (b4_syncline): Don't output an empty line before
593 2008-11-26 Akim Demaille <demaille@gostai.com>
595 Convert lib/Makefile.am into lib/local.mk.
596 The real problem is rather gnulib.mk, which itself is extracted
597 from a Makefile.am that gnulib expects to the "recursive". The
598 tool prefix-gnulib-mk converts such a gnulib.mk to be
599 non-recursive. Also, some AC_SUBST variables need to be adjusted.
601 * etc/prefix-gnulib-mk: New.
602 * bootstrap (slurp): Use it to convert further gnulib.mk.
603 No longer try to avoid re-creation of lib/gnulib.mk as the changes
605 * lib/Makefile.am: Rename as...
606 * lib/local.mk: this.
607 Adjust to be prefixed.
608 * Makefile.am, configure.ac: Adjust.
609 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
611 2008-11-26 Akim Demaille <demaille@gostai.com>
614 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
615 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
616 Reported by Eric Blake.
618 2008-11-26 Akim Demaille <demaille@gostai.com>
620 Use b4_parser_tables_define in glr.cc.
621 * data/glr.c: Use b4_parser_tables_define instead of defining the
622 (deterministic integral) tables by hand.
624 2008-11-26 Akim Demaille <demaille@gostai.com>
626 Use b4_parser_tables_define in Java.
627 * data/java.m4 (b4_typed_parser_table): Rename as...
628 (b4_typed_parser_table_define): this, for consistency.
629 Accept a comment as $4.
631 (b4_integral_parser_table): Rename as...
632 (b4_integral_parser_table_define): this.
633 * data/lalr1.java: Adjust all uses.
634 Use b4_parser_tables_define instead of generation by hand.
636 2008-11-26 Akim Demaille <demaille@gostai.com>
638 Prepare the convergence bw C style and Java table generation.
639 * data/bison.m4 (b4_tables_map, b4_tables_declare)
640 (b4_tables_define): Rename as...
641 (b4_integral_parser_tables_map, b4_parser_tables_declare)
642 (b4_parser_tables_define): these.
643 * data/c.m4 (b4_table_define): Rename as...
644 (b4_integral_parser_table_define): this.
645 * data/lalr1.cc: Adjust.
646 (b4_table_define, b4_table_declare): Rename as...
647 (b4_integral_parser_table_define)
648 (b4_integral_parser_table_declare): these.
649 (yyrline_): Move the comment where it is actually used.
650 * data/yacc.c: Adjust.
651 (yyrline): Use b4_integral_parser_table_define.
653 2008-11-26 Akim Demaille <demaille@gostai.com>
656 * src/parse-gram.h, src/parse-gram.c: Regen.
658 2008-11-26 Akim Demaille <demaille@gostai.com>
660 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
661 * data/lalr1.cc (b4_tables_map): Move to...
662 * data/bison.m4: here.
663 Update the comment for yytable during the flight.
664 (b4_tables_declare, b4_tables_define): New.
665 * data/lalr1.cc: Use them.
666 * data/c.m4 (b4_table_define): New.
667 * data/yacc.c: Use b4_tables_define instead of output the tables
669 * tests/regression.at (Web2c Actions): Adjust the expected output,
670 the order of the tables changed.
672 2008-11-26 Akim Demaille <demaille@gostai.com>
674 Get rid of (yy)rhs and (yy)prhs.
675 These tables are no longer needed in the parsers, and they don't seem to
676 be useful. They are not documented either.
678 * src/output.c (prepare_rules): Get rid of rhs and prhs.
679 Adjust the computation of (yy)r2.
681 2008-11-26 Akim Demaille <demaille@gostai.com>
683 Rule length is unsigned.
684 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
686 2008-11-26 Akim Demaille <demaille@gostai.com>
688 Get rid of lalr1-split.cc.
689 It was no longer maintainer.
691 * data/lalr1-split.cc: Remove.
692 * etc/bench.pl.in (bench_fusion_parser): Remove.
695 2008-11-26 Akim Demaille <demaille@gostai.com>
697 Use yy* consistently.
698 * data/glr.c: Now that yyrhs no longer exists as a global
699 variable, rename local "rhs" variables into "yyrhs" for
702 2008-11-25 Akim Demaille <demaille@gostai.com>
704 Get rid of yyrhs and yyprhs in glr.c.
705 * data/glr.c (yyrhs, yyprhs): Remove.
706 Instead, use the state stack and yystos.
708 2008-11-25 Akim Demaille <demaille@gostai.com>
711 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
712 as an Autotest keyword.
714 2008-11-25 Akim Demaille <demaille@gostai.com>
716 Prefer TESTSUITE_FLAGS.
717 TESTSUITEFLAGS is barely readable.
719 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
720 for backward compatibility.
721 Use the former instead of the latter.
723 2008-11-25 Akim Demaille <demaille@gostai.com>
725 Get rid of yyrhs and yyprhs in larl1.java.
726 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
727 (yy_reduce_print): Rather, use yystos_ and the state stack.
729 2008-11-25 Akim Demaille <demaille@gostai.com>
733 2008-11-25 Akim Demaille <demaille@gostai.com>
735 Get rid of yyrhs and yyprhs in yacc.c.
736 They were used to get the symbol types, given a rule number, when
737 displaying the top of the stack before a reduction. But the
738 symbol type is available from the state stack. This has two be
739 benefits: two tables less in the parser (making it smaller), and a
740 more consistent use of the three stacks which will help to fuse
743 * data/yacc.c (yyprhs, yyrhs): Remove.
744 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
745 (yy_reduce_print): Take yyssp as argument.
746 Use it, together with yystos, to get the symbol type.
747 * tests/regression.at (Web2c Report): Remove these tables from the
750 2008-11-25 Akim Demaille <demaille@gostai.com>
753 The point is to factor the generation of the tables across skeletons.
754 This is language dependant.
756 * data/c.m4 (b4_comment_): New.
757 Should be usable to define how to generate tables independently of
760 (b4_comment): Bounce to b4_c_comment.
761 Now support $2 = [PREFIX] for indentation.
762 * data/lalr1.cc (b4_table_declare): Don't output a comment if
764 Indent it properly when there is one.
765 Output the ending semicolon.
766 (b4_table_define): Space changes.
767 Output the ending semicolon.
768 (b4_tables_map): New.
769 Use it twice instead of declaring and defining the (integral)
772 2008-11-25 Akim Demaille <demaille@gostai.com>
775 * data/lalr1.cc (b4_table_declare): New.
776 Use it to declare the tables defined with b4_table_define.
777 (b4_table_define): Declare a third arg to match b4_table_declare
779 Move all the comments around invocations of b4_table_define into
780 the invocations itselves.
781 Move things around to have the order for declarations and
784 2008-11-25 Akim Demaille <demaille@gostai.com>
787 * data/lalr1.java: here.
789 2008-11-25 Akim Demaille <demaille@gostai.com>
791 b4_args is more general than only C++.
792 * data/lalr1.cc (b4_args, _b4_args): Move to...
793 * data/bison.m4: here.
795 2008-11-21 Di-an Jan <dianj@freeshell.org>
797 Implement no-XXX arguments for --warnings, --report, --trace.
798 * src/getargs.c (flags_argmatch): Handles no-XXX.
799 Fix typo in doxygen comment.
801 2008-11-21 Akim Demaille <demaille@gostai.com>
803 Display the changes in cross-options.texi.
804 * build-aux/cross-options.pl ($sep): New, to separate items.
805 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
808 2008-11-20 Di-an Jan <dianj@freeshell.org>
810 Improves options in the manual.
811 * doc/bison.texinfo (-g, -x): Add space before argument.
812 (Option Cross Key): Implement FIXME: listing directives also.
813 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
814 (Short Option): Special case -d. Put arguments inside @option.
815 (Bison Directive): Add column, automatically extracted from
816 src/scan-gram.l (actual name passed as the first argument)
817 with special case for %define.
818 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
819 to build-aux/cross-options.pl.
820 * src/getargs.c (usage): Document limitations of cross-options.pl.
821 * src/scan-gram.l: Likewise.
823 2008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
825 Fix unexpanded macros in GLR defines file.
826 Reported by Csaba Raduly at
827 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
828 * THANKS (Csaba Raduly): Add.
829 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
830 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
831 lexer in a separate module that includes the defines file.
832 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
834 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
835 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
836 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
837 (AT_DATA_SOURCE_PROLOGUE): New.
838 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
839 (AT_DATA_SOURCE): New.
840 (AT_FULL_COMPILE): Extend to support an additional source file.
842 2008-11-18 Akim Demaille <demaille@gostai.com>
845 * TODO: More short term issues.
847 2008-11-18 Akim Demaille <demaille@gostai.com>
850 * src/parse-gram.h, src/parse-gram.c: Regen.
852 2008-11-18 Akim Demaille <demaille@gostai.com>
854 Use b4_subtract where possible.
855 * data/lalr1.cc (b4_subtract): Move to...
856 * data/bison.m4: here.
857 * data/glr.c (b4_rhs_data): Use it.
858 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
860 2008-11-18 Akim Demaille <demaille@gostai.com>
862 Remove incorrect mode specification.
863 * data/glr.cc: Don't pretend it's C code.
865 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
867 Simplify last patch slightly.
868 * src/getargs.c (getargs): Here.
870 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
872 Fix last warning from --enable-gcc-warnings.
873 * src/getargs.c (getargs): Don't assign const address to non-const
876 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
878 Don't let maintainer-*-check targets force a version update.
879 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
882 2008-11-17 Di-an Jan <dianj@freeshell.org>
884 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
885 Align menus. Adjust word wrapping. Use node names for menu names.
886 (Examples): Don't abbreviate node names.
887 (LocalWords): Remove abbreviations.
888 (Copying): Make description a sentence.
889 (Java Action Features): Remove period to match the rest of menu.
891 2008-11-17 Di-an Jan <dianj@freeshell.org>
893 Handles several --enable-gcc-warnings.
894 * src/getargs.c (command_line_location): Set parameters to void.
895 * src/output.c (symbol_type_name_cmp): Make static.
896 (symbols_by_type_name): Set parameters to void.
897 (symbol_definitions_output): Remove unused parameter. Rename as...
898 (prepare_symbol_definitions): this.
899 (muscles_output): Move symbol_definitions_output to...
900 (output): here as prepare_symbol_definitions.
901 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
902 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
904 2008-11-17 Di-an Jan <dianj@freeshell.org>
906 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
907 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
909 2008-11-16 Akim Demaille <demaille@gostai.com>
911 Add missing $(EXEEXT).
912 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
913 "src/bison$(EXEEXT)".
914 Reported by Di-an Jan.
916 2008-11-15 Akim Demaille <demaille@gostai.com>
920 2008-11-15 Akim Demaille <demaille@gostai.com>
923 * tests/input.at: here.
925 2008-11-15 Akim Demaille <demaille@gostai.com>
927 Remove duplicate header inclusion.
930 2008-11-15 Akim Demaille <demaille@gostai.com>
932 * src/parse-gram.h, src/parse-gram.c: Regen.
934 2008-11-15 Akim Demaille <demaille@gostai.com>
936 Support parametric types.
938 There are two issues to handle: first scanning nested angle
939 bracket pairs to support types such as std::pair< std::string,
940 std::list<std::string> > >.
942 Another issue is to address idiosyncracies of C++: do not glue two
943 closing angle brackets together (otherwise it's operator>>), and
944 avoid sticking blindly a TYPE to the opening <, as it can result
945 in '<:' which is a digraph for '['.
947 * src/scan-gram.l (brace_level): Rename as...
950 Implement support for complex tags.
953 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
954 (b4_symbol_variant): Leave space around types as parameters.
955 * examples/variant.yy: Use nested template types and leading ::.
956 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
958 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
959 * tests/c++.at: Test parametric types.
961 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
964 This is not sufficient, but we test at least that the make_SYMBOL
965 interface is not affected by token.prefix. A more general test
966 will be implemented when the support of token.prefix is generalized
969 * tests/c++.at: One more variant test, using token.prefix.
971 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
973 Test the make_TOKEN interface.
974 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
975 Factor the common code in yylex.
976 Use it to test "%define lex_symbol".
978 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
982 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
984 Simplify code for variants bench marks.
985 * etc/bench.pl.in (&generate_grammar_list): Define and use
987 Factor the common code in yylex.
989 2008-11-15 Akim Demaille <demaille@gostai.com>
991 Better error message.
992 * bootstrap (find_tool): Fix the error message.
994 2008-11-15 Akim Demaille <demaille@gostai.com>
996 Update variant.yy to newest interface.
997 * examples/variant.yy: Define lex_symbol.
1000 2008-11-15 Akim Demaille <demaille@gostai.com>
1002 Don't use locations in variant.yy.
1003 * examples/variant.yy: Adjust to not using locations.
1005 2008-11-15 Akim Demaille <demaille@gostai.com>
1008 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
1009 comments for the license.
1011 2008-11-15 Akim Demaille <demaille@gostai.com>
1013 Remove tests/Makefile.am.
1014 * tests/Makefile.am: Rename as...
1015 * tests/local.mk: this.
1016 * Makefile.am, configure.ac: Adjust.
1017 * Makefile.am (DISTCLEANFILES): Define.
1018 (maintainer-check, maintainer-xml-check, maintainer-push-check):
1019 Remove, we no longer need to bounce to the real targets.
1021 2008-11-15 Akim Demaille <demaille@gostai.com>
1025 2008-11-15 Akim Demaille <demaille@gostai.com>
1028 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
1029 * djgpp/local.mk: this new file.
1031 2008-11-15 Akim Demaille <demaille@gostai.com>
1033 Remove doc/Makefile.am.
1034 * doc/Makefile.am: Rename as...
1035 * doc/local.mk: this.
1037 * Makefile.am, configure.ac: Adjust.
1038 * Makefile.am (MOSTLYCLEANFILES): New.
1039 * src/local.mk: Adjust.
1041 2008-11-15 Akim Demaille <demaille@gostai.com>
1043 Move sc_tight_scope into maint.mk.
1044 It does not work, and I don't know how it was supposed to work: it
1045 seems to be looking for sources in the build tree. I just moved
1046 it at a better place, fixing it is still required.
1048 * src/local.mk (echo): Remove.
1049 (sc_tight_scope): Move to...
1052 2008-11-15 Akim Demaille <demaille@gostai.com>
1055 * src/parse-gram.h, src/parse-gram.h: Regen.
1057 2008-11-15 Akim Demaille <demaille@gostai.com>
1059 Remove src/Makefile.am.
1060 * src/Makefile.am: Rename as...
1061 * src/local.mk: this.
1062 Prefix all the paths with src/.
1063 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
1064 (AM_CPPFLAGS): Find find in builddir/src.
1065 (YACC): Move the flags into...
1067 * maint.mk (sc_tight_scope): Disable.
1068 It used to bounce to the version in src/Makefile.am which is now
1069 part of this very Makefile.
1070 * Makefile.am, configure.ac: Adjust.
1071 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
1072 include "..." to find files "here": we are no longer in src/, so
1073 qualify the includes with src/.
1074 * doc/Makefile.am (PREPATH): No longer include the top_builddir
1076 (.x.1): Adjust to be able to create src/foo from the top level
1077 Makefile, instead of going bounce to src/Makefile the creation of
1080 2008-11-15 Akim Demaille <demaille@gostai.com>
1082 Remove useless variable.
1083 * doc/Makefile.am (srcsrcdir): Remove.
1085 2008-11-15 Akim Demaille <demaille@gostai.com>
1087 Remove data/Makefile.am.
1088 * data/Makefile.am: Rename as...
1089 * data/local.mk: this.
1091 * Makefile.am, configure.ac: Adjust.
1093 2008-11-15 Akim Demaille <demaille@gostai.com>
1095 Remove etc/Makefile.am.
1096 * etc/Makefile.am: Rename as...
1097 * etc/local.mk: this.
1099 * Makefile.am, configure.ac: Adjust.
1101 2008-11-15 Akim Demaille <demaille@gostai.com>
1103 Remove examples/local.mk.
1104 examples/calc++/Makefile.am might be interesting to keep as is, since
1105 it is an example in itself.
1107 * examples/Makefile.am: Rename as...
1108 * examples/local.mk: this.
1110 * Makefile.am, configure.ac: Adjust.
1112 2008-11-15 Akim Demaille <demaille@gostai.com>
1114 Remove build-aux/Makefile.am.
1115 Recursive Makefiles are really way too slow, let's get rid of some of
1118 * build-aux/Makefile.am: Rename as...
1119 * build-aux/local.mk: this.
1121 * Makefile.am, configure.ac: Adjust.
1123 2008-11-15 Akim Demaille <demaille@gostai.com>
1125 Provide convenience constructors for locations and positions.
1126 * data/location.cc (position::position): Accept file, line and
1127 column as arguments with default values.
1128 Always qualify initial line and column literals as unsigned.
1129 (location::location): Provide convenience constructors.
1131 2008-11-15 Akim Demaille <demaille@gostai.com>
1133 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
1135 Using template buys us nothing, and makes it uselessly complex to
1136 construct a symbol. Besides, it could not be generalized to other
1137 languages, while make_FOO would work in C/Java etc.
1139 * data/lalr1.cc (b4_symbol_): New.
1140 (b4_symbol): Use it.
1141 (b4_symbol_constructor_declaration_)
1142 (b4_symbol_constructor_definition_): Instead of generating
1143 specializations of an overloaded template function, just generate
1144 several functions whose names are forged from the token names
1145 without the token.prefix.
1146 (b4_symbol_constructor_declarations): Generate them for all the
1147 symbols, not just by class of symbol type, now that instead of
1148 specializing a function template by the token, we generate a
1149 function named after the token.
1150 (b4_symbol_constructor_specialization_)
1151 (b4_symbol_constructor_specializations): Remove.
1152 * etc/bench.pl.in: Adjust to this new API.
1154 2008-11-13 Akim Demaille <demaille@gostai.com>
1156 %define token.prefix.
1157 Provide a means to add a prefix to the name of the tokens as
1158 output in the generated files. Because of name clashes, it is
1159 good to have such a prefix such as TOK_ that protects from names
1160 such as EOF, FILE etc. But it clutters the grammar itself.
1162 * data/bison.m4 (token.prefix): Empty by default.
1163 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
1164 * data/lalr1.cc (b4_symbol): Ditto.
1166 2008-11-13 Akim Demaille <demaille@gostai.com>
1168 Compute at M4 time some of the subtractions.
1169 * data/lalr1.cc (b4_subtract): New.
1170 (b4_rhs_data): Use it.
1172 2008-11-13 Akim Demaille <demaille@gostai.com>
1175 This allows the user to get the type of a token returned by yylex.
1177 * data/lalr1.cc (symbol::token): New.
1178 (yytoknum_): Define when %define lex_symbol, independently of
1180 (yytoken_number_): Move into...
1181 (symbol::token): here, since that's the only use.
1182 The other one is YYPRINT which was not officially supported
1183 by lalr1.cc, and anyway it did not work since YYPRINT uses this
1184 array under a different name (yytoknum).
1186 2008-11-13 Akim Demaille <demaille@gostai.com>
1189 * TODO (YYERRCODE): Mention the case of $undef.
1191 2008-11-13 Akim Demaille <demaille@gostai.com>
1194 * TODO (YYPRINT): New.
1196 2008-11-13 Akim Demaille <demaille@gostai.com>
1199 * data/lalr1.cc, data/yacc.c: Fix the description of the
1200 yytranslate and yytoknum tables.
1202 2008-11-13 Akim Demaille <demaille@gostai.com>
1204 Define make_symbol in the header.
1205 To reach good performances these functions should be inlined (yet
1206 this is to measure precisely). To this end they must be available
1209 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
1210 location_type with the class name.
1211 Since will now be output in the header, declare "inline".
1212 No longer use b4_symbol_constructor_specializations, but
1213 b4_symbol_constructor_definitions in the header.
1214 Don't call it in the *.cc file.
1216 2008-11-13 Akim Demaille <demaille@gostai.com>
1218 Define yytranslate in the header for lex_symbol.
1219 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
1220 into the header file when using %define lex_symbol.
1221 (yytranslate_): Declare inline.
1223 2008-11-13 Akim Demaille <demaille@gostai.com>
1225 Define the constructors of symbol_type in
1226 b4_symbol_constructor_definitions.
1227 The constructors are called by the make_symbol functions, which a
1228 forthcoming patch will move elsewhere. Hence the interest of
1229 putting them together.
1231 The stack_symbol_type does not need to be moved, it is used only
1234 * data/lalr1.cc: Move symbol_type and symbol_base_type
1235 constructors into...
1236 (b4_symbol_constructor_definitions): here.
1239 2008-11-13 Akim Demaille <demaille@gostai.com>
1241 Make it easier to move the definition of yytranslate_.
1242 Forthcoming changes will make it possible to use yytranslate_
1243 from outside the parser implementation file.
1245 * data/lalr1.cc (b4_yytranslate_definition): New.
1248 2008-11-13 Akim Demaille <demaille@gostai.com>
1250 Remove useless class specification.
1251 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
1252 to refer to the class name to use a type defined by the class for
1253 arguments of member functions.
1255 2008-11-13 Akim Demaille <demaille@gostai.com>
1257 Finer input type for yytranslate.
1258 This patch is debatable: the tradition expects yylex to return an int
1259 which happens to correspond to token_number (which is an enum). This
1260 allows for instance to return characters (such as '*' etc.). But this
1261 goes against the stronger typing I am trying to have with the new
1262 lex interface which return a symbol_type. So in this case, feed
1263 yytranslate_ with a token_type.
1265 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
1266 expect a token_type.
1268 2008-11-13 Akim Demaille <demaille@gostai.com>
1270 Honor lex-params in %define lex_symbol mode.
1271 * data/lalr1.cc: Use b4_lex_param.
1273 2008-11-13 Akim Demaille <demaille@gostai.com>
1276 * src/output.c (symbol_definitions_output): Rename symbol
1277 attributes type_name and has_type_name as type and has_type.
1278 * data/lalr1.cc: Adjust uses.
1280 2008-11-13 Akim Demaille <demaille@gostai.com>
1282 Use b4_type_names for the union type.
1283 The union used to compute the size of the variant used to iterate
1284 over the type of all the symbols, with a lot of redundancy. Now
1285 iterate over the lists of symbols having the same type-name.
1287 * data/lalr1.cc (b4_char_sizeof_): New.
1288 (b4_char_sizeof): Use it.
1289 Adjust to be called with a list of numbers instead of a single
1291 Adjust its caller for new-line issues.
1293 2008-11-13 Akim Demaille <demaille@gostai.com>
1295 Define the "identifier" of a symbol.
1296 Symbols may have several string representations, for instance if
1297 they have an alias. What I call its "id" is a string that can be
1298 used as an identifier. May not exist.
1300 Currently the symbols which have the "tag_is_id" flag set are
1301 those that don't have an alias. Look harder for the id.
1303 * src/output.c (is_identifier): Move to...
1304 * src/symtab.c (is_identifier): here.
1305 * src/symtab.h, src/symtab.c (symbol_id_get): New.
1306 * src/output.c (symbol_definitions_output): Use it to define "id"
1308 Remove the definition of "tag_is_id".
1309 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
1310 "tag_is_id" were used to produce code.
1311 We still use "tag" for documentation.
1313 2008-11-11 Akim Demaille <demaille@gostai.com>
1315 Locations are no longer required by lalr1.cc.
1316 * data/lalr1.cc (_b4_args, b4_args): New.
1317 Adjust all uses of locations to make them optional.
1318 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
1319 (AT_CHECK_NAMESPACE): Check the use of locations.
1320 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
1321 without locations with lalr1.cc.
1323 * tests/output.at: Check lalr1.cc with and without location
1325 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
1326 Don't use locations.
1328 2008-11-11 Akim Demaille <demaille@gostai.com>
1331 * tests/local.at (AT_FULL_COMPILE): New.
1332 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
1334 2008-11-11 Akim Demaille <demaille@gostai.com>
1336 Support parens in calc++.
1337 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
1338 * examples/calc++/test (run): Check the expected output.
1342 2008-11-11 Akim Demaille <demaille@gostai.com>
1344 Simplify lalr1.cc since %defines is mandatory.
1345 * data/lalr1.cc: Remove useless calls to b4_defines_if.
1347 2008-11-11 Akim Demaille <demaille@gostai.com>
1350 * TODO (yysyntax_error): New item.
1352 2008-11-11 Akim Demaille <demaille@gostai.com>
1355 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
1358 2008-11-11 Akim Demaille <demaille@gostai.com>
1360 Support i18n of the parse error messages.
1361 * TODO (lalr1.cc/I18n): Remove.
1362 * data/lalr1.cc (yysyntax_error_): Support the translation of the
1363 error messages, as done in yacc.c.
1364 Stay within the yy* pseudo namespace.
1366 2008-11-11 Akim Demaille <demaille@gostai.com>
1369 * TODO (single stack, yysyntax_error): New.
1371 2008-11-11 Akim Demaille <demaille@gostai.com>
1373 Make it possible to return a symbol_type from yylex.
1374 * data/lalr1.cc (b4_lex_symbol_if): New.
1375 (parse): When lex_symbol is defined, expected yylex to return the
1377 * etc/bench.pl.in (generate_grammar_list): Extend to support this
1379 (bench_variant_parser): Exercise it.
1381 2008-11-11 Akim Demaille <demaille@gostai.com>
1383 Remove useless bench case.
1384 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
1387 2008-11-11 Akim Demaille <demaille@gostai.com>
1389 Improve display of directives.
1390 * etc/bench.pl.in (parse_term): Don't add useless eol.
1392 2008-11-11 Akim Demaille <demaille@gostai.com>
1394 Use string_cast in the bench.
1395 * etc/bench.pl.in (generate_grammar_list): Define and use
1398 2008-11-11 Akim Demaille <demaille@gostai.com>
1400 Replace yychar with a Boolean.
1401 * data/lalr1.cc (parse::yychar): Replace by...
1402 (parse::yyempty): this.
1404 2008-11-11 Akim Demaille <demaille@gostai.com>
1409 2008-11-11 Akim Demaille <demaille@gostai.com>
1411 Let yytranslate handle the eof case.
1412 * data/lalr1.cc (yytranslate_): Handle the EOF case.
1414 No longer expect yychar to be equal to yyeof_, rather, test the
1415 lookahead's (translated) kind.
1417 2008-11-11 Akim Demaille <demaille@gostai.com>
1419 yychar cannot be empty in yyerrlab.
1420 * TODO (yychar == yyempty_): New.
1421 * data/lalr1.cc: Remove the handling of this case.
1422 This eases forthcoming changes related to yychar and yytranslate.
1424 2008-11-11 Akim Demaille <demaille@gostai.com>
1426 Bench: syntactic sugar for %define/#define.
1427 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
1428 (&bench_push_parser, bench_variant_parser): Use this feature.
1432 2008-11-11 Akim Demaille <demaille@gostai.com>
1434 Less memory pressure on the "list" bench.
1435 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
1436 the values, to limit memory pressure.
1438 2008-11-11 Akim Demaille <demaille@gostai.com>
1440 Introduce make_symbol.
1441 make_symbol provides a means to construct a full symbol (kind,
1442 value, location) in a single shot. It is meant to be a Symbol
1443 constructor, parameterized by the symbol kind so that overloading
1444 would prevent incorrect kind/value pairs. Unfortunately
1445 parameterized constructors do not work well in C++ (unless the
1446 parameter also appears as an argument, which is not acceptable),
1447 hence the use of a function instead of a constructor.
1449 * data/lalr1.cc (b4_symbol_constructor_declaration_)
1450 (b4_symbol_constructor_declarations)
1451 (b4_symbol_constructor_specialization_)
1452 (b4_symbol_constructor_specializations)
1453 (b4_symbol_constructor_definition_)
1454 (b4_symbol_constructor_definitions): New.
1455 Use them where appropriate to generate declaration, declaration of
1456 the specializations, and implementations of the templated
1457 overloaded function "make_symbol".
1458 (variant::variant): Always define a default ctor.
1459 Also provide a copy ctor.
1460 (symbol_base_type, symbol_type): New ctor overloads for value-less
1462 (symbol_type): Now public, so that functions such as yylex can use
1465 2008-11-11 Akim Demaille <demaille@gostai.com>
1467 Inform m4 whether a tag is a valid id.
1468 * src/output.c (is_identifier): New.
1469 (symbol_definitions_output): Use it to define tag_is_id.
1470 But maybe this should be done at m4 level?
1472 2008-11-11 Akim Demaille <demaille@gostai.com>
1474 Test 214 was failing: it greps with a pattern containing [ ]*
1475 which obviously meant to catch spaces and tabs, but contained only
1476 spaces. Tabulations in sources are a nuisance, so to simplify the
1477 matter, get rid of all the tabulations in the Java sources. The
1478 other skeletons will be treated equally later.
1480 * data/java.m4, data/lalr1.java: Untabify.
1481 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
1482 tabulations are no longer generated.
1484 2008-11-11 Paolo Bonzini <bonzini@gnu.org>
1486 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
1487 * configure.ac: Adjust usage.
1488 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1489 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1490 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
1492 2008-11-10 Di-an Jan <dianj@freeshell.org>
1494 Workaround Java's ``code too large'' problem for parser tables
1495 in most cases, by using one function per initialization.
1496 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
1497 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
1498 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
1499 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
1500 (yytname_): Use b4_typed_parser_table.
1501 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
1502 ``code too large'' error.
1504 2008-11-10 Di-an Jan <dianj@freeshell.org>
1506 * NEWS: Document them.
1508 General Java skeleton improvements.
1509 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
1510 using gcj < 4.3 in the testsuite, according to comments in
1511 gnulib/m4/javacomp.m4.
1512 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
1513 location_type, position_type): Remove extraneous brackets from
1514 b4_percent_define_default.
1515 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
1516 m4_define and m4_define_default.
1517 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
1518 which marks the end of user code with appropriate syncline, like all
1519 the other skeletons.
1520 (b4_user_post_prologue): Add. Don't silently drop.
1522 (parse): Inline yylex.
1523 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
1524 (%{...%}): Fix typo of %code imports.
1525 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
1527 Support annotations on parser class with %define annotations.
1528 * data/lalr1.java (annotations): Add to parser class modifier.
1529 * doc/bison.texinfo (Java Parser Interface): Document
1530 %define annotations.
1531 (Java Declarations Summary): Document %define annotations.
1532 * tests/java.at (Java parser class modifiers): Test annotations.
1534 Do not generate code for %error-verbose unless requested.
1535 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
1536 Make private. Make conditional on %error-verbose.
1537 (getErrorVerbose, setErrorVerbose): New.
1538 (yytnamerr_): Make conditional on %error-verbose.
1539 (yysyntax_error): Make some code conditional on %error-verbose.
1540 * doc/bison.texinfo (Java Bison Interface): Remove the parts
1541 about %error-verbose having no effect.
1542 (getErrorVerbose, setErrorVerbose): Document.
1544 Move constants for token names to Lexer interface.
1545 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
1546 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
1547 (parse): Qualify EOF to Lexer.EOF.
1548 * doc/bison.texinfo (Java Parser Interface): Move documentation of
1549 EOF and token names to Java Lexer Interface.
1550 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
1552 Make yyerror public.
1553 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
1554 (yyerror): Change to public. Add Javadoc comments. Use longer
1555 parameter names. Make the body rather than the declarator
1556 conditional on %locations.
1557 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
1559 Allow user to add code to the constructor with %code init.
1560 * data/java.m4 (b4_init_throws): New, for %define init_throws.
1561 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
1562 Add %code init to the front of the constructor body.
1563 * doc/bison.texinfo (YYParser.YYParser): Document %code init
1564 and %define init_throws.
1565 (Java Declarations Summary): Document %code init and
1566 %define init_throws.
1567 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
1568 (Java constructor init and init_throws): Add tests.
1570 2008-11-10 Akim Demaille <demaille@gostai.com>
1573 * TODO (-D): is implemented.
1574 (associativity): Same precedence must have the same associativity.
1575 For instance, how can a * b / c be parsed if * is %left and / is
1577 (YYERRORCODE, YYFAIL, YYBACKUP): New.
1579 2008-11-10 Akim Demaille <demaille@gostai.com>
1583 2008-11-10 Akim Demaille <demaille@gostai.com>
1585 More information about the symbols.
1586 * src/output.c (type_names_output): Document all the symbols,
1587 including those that don't have a type-name.
1588 (symbol_definitions_output): Define "is_token" and
1590 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
1591 type-name, now that they are defined too in b4_type_names.
1593 2008-11-10 Akim Demaille <demaille@gostai.com>
1597 2008-11-10 Akim Demaille <demaille@gostai.com>
1599 Make parser::yytranslate static.
1600 Small speedup (1%) on the list grammar. And makes yytranslate_
1601 available in non member functions.
1603 * data/lalr1.cc (yytranslate_): Does not need to be a instance
1606 2008-11-10 Akim Demaille <demaille@gostai.com>
1608 Avoid trailing spaces.
1609 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
1610 * data/lalr1.cc: Don't indent before rule and symbol actions, as
1611 they can be empty, and anyway this incorrectly indents the first
1614 2008-11-10 Akim Demaille <demaille@gostai.com>
1618 2008-11-10 Akim Demaille <demaille@gostai.com>
1620 Use "enum" for integral constants.
1621 This is just nicer to read, I observed no speedup.
1623 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
1624 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
1625 (yyuser_token_number_max_, yyundef_token_): Move into...
1626 (yytranslate_): here.
1628 2008-11-10 Akim Demaille <demaille@gostai.com>
1630 Shortcuts in bench directives.
1631 * etc/bench.pl.in (parse_dirs): New.
1633 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
1634 Create the benches in "benches/".
1636 2008-11-10 Akim Demaille <demaille@gostai.com>
1639 * data/lalr1.cc: here.
1641 2008-11-10 Akim Demaille <demaille@gostai.com>
1643 Adjust verbose message to using emacs.
1644 * etc/bench.pl.in: Inform compilation-mode when we change the
1646 (generate_grammar_list): Recognize %define "variant" in addition
1649 2008-11-10 Akim Demaille <demaille@gostai.com>
1651 Classify symbols by type-name.
1652 * src/uniqstr.h (UNIQSTR_CMP): New.
1653 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
1654 (type_names_output): New.
1655 (muscles_output): Use it.
1656 * data/lalr1.cc (b4_symbol_action_): Remove.
1657 (b4_symbol_case_, b4_type_action_): New.
1658 Adjust uses of b4_symbol_action_ to use b4_type_action_.
1660 2008-11-10 Akim Demaille <demaille@gostai.com>
1662 Change the handling of the symbols in the skeletons.
1663 Before we were using tables which lines were the symbols and which
1664 columns were things like number, tag, type-name etc. It is was
1665 difficult to extend: each time a column was added, all the numbers had
1666 to be updated (you asked for colon $2, not for "tag"). Also, it was
1667 hard to filter these tables when only a subset of the symbols (say the
1668 tokens, or the nterms, or the tokens that have and external number
1669 *and* a type-name) was of interest.
1671 Now instead of monolithic tables, we define one macro per cell. For
1672 instance "b4_symbol(0, tag)" is a macro name which contents is
1673 self-decriptive. The macro "b4_symbol" provides easier access to
1676 * src/output.c (type_names_output): Remove.
1677 (symbol_numbers_output, symbol_definitions_output): New.
1678 (muscles_output): Call them.
1679 (prepare_symbols): Define b4_symbols_number.
1681 2008-11-10 Akim Demaille <demaille@gostai.com>
1684 * src/getargs.h, src/getargs.c (trace_muscle): New.
1685 (trace_types, trace_args): Support it.
1686 * src/output.c (output_skeleton): Use it.
1688 2008-11-10 Akim Demaille <demaille@gostai.com>
1691 * src/output.c (muscles_output): New, extracted from...
1692 (output_skeleton): here.
1695 2008-11-10 Akim Demaille <demaille@gostai.com>
1699 2008-11-10 Akim Demaille <demaille@gostai.com>
1701 Update the variant example.
1702 * examples/variant.yy: Formatting changes.
1705 2008-11-10 Akim Demaille <demaille@gostai.com>
1707 Support constructor with an argument.
1708 This improves the "list" bench by 2%.
1710 * data/lalr1.cc (variant::build): Add an overloaded version with
1712 * tests/c++.at (AT_CHECK_VARIANT): Check it.
1714 2008-11-10 Akim Demaille <demaille@gostai.com>
1717 * tests/c++.at (AT_CHECK_VARIANTS): New.
1718 Use it with and without %define assert.
1720 2008-11-10 Akim Demaille <demaille@gostai.com>
1722 Add %precedence support.
1723 Unfortunately it is not possible to reuse the %prec directive. This
1724 is because to please POSIX, we do not require to end the rules with a
1725 semicolon. As a result,
1729 is ambiguous: either a rule which precedence is that of baz, or a rule,
1730 and then a declaration of the precedence of the token baz.
1732 * doc/bison.texinfo: Document %precedence.
1733 (Precedence Only): New.
1734 * src/assoc.h, src/assoc.c (precedence_assoc): New.
1735 * src/conflicts.c (resolve_sr_conflict): Support it.
1736 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
1738 * tests/calc.at: Use %precedence for NEG.
1739 * tests/conflicts.at (%precedence does not suffice)
1740 (%precedence suffices): New tests.
1742 2008-11-09 Akim Demaille <demaille@gostai.com>
1744 Make benches in a sub dirs.
1745 * etc/bench.pl.in ($dir): New.
1747 Check the use of constructors with an argument.
1748 (bench_variant_parser): Fix.
1750 2008-11-09 Akim Demaille <demaille@gostai.com>
1754 2008-11-09 Akim Demaille <demaille@gostai.com>
1758 2008-11-09 Akim Demaille <demaille@gostai.com>
1760 Require the generation of parse-gram.output.
1761 * src/Makefile.am (YACC): Pass --report=all.
1763 2008-11-09 Akim Demaille <demaille@gostai.com>
1767 2008-11-09 Akim Demaille <demaille@gostai.com>
1770 * TODO: Remove obsolete items.
1773 2008-11-09 Akim Demaille <demaille@gostai.com>
1776 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
1777 (@token, $grammar, $bench): New.
1778 (generate_grammar_variant): Rename as...
1779 (generate_grammar_list): this.
1780 (generate_grammar): Adjust.
1781 (bench_grammar): Rename as...
1783 Use it in the various bench-marking routines.
1784 (-b, -g): New options.
1786 2008-11-09 Akim Demaille <demaille@gostai.com>
1788 Use a static hierarchy for symbols in the C++ parser.
1789 * data/lalr1.cc (symbol_base_type, symbol_type)
1790 (stack_symbol_type): Make it a static hierarchy.
1791 Adjust dependencies.
1793 2008-11-09 Akim Demaille <demaille@gostai.com>
1795 bench.pl -d, --directive.
1796 * etc/bench.pl.in (@directive): New.
1797 (&bench_grammar): Use it.
1798 (&bench_list_grammar): New, to provide access to the "variant"
1801 (getopts): Support -d, --directive.
1803 2008-11-09 Akim Demaille <demaille@gostai.com>
1805 Use inline for small operations.
1806 * data/lalr1.cc (symbol_base_type, symbol_type)
1807 (stack_symbol_type): Declare constructor and other operations as
1809 (yy_destroy_): Inline.
1811 2008-11-09 Akim Demaille <demaille@gostai.com>
1813 Introduce a hierarchy for symbols.
1814 * data/lalr1.cc (symbol_base_type, symbol_type): New.
1815 (data_type): Rename as...
1816 (stack_symbol_type): this.
1817 Derive from symbol_base_type.
1818 (yy_symbol_value_print_): Merge into...
1819 (yy_symbol_print_): this.
1822 (yydestruct_): Rename as...
1823 (yy_destroy_): this.
1824 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
1825 (parser::parse): yyla is now of symbol_type.
1826 Use its type member instead of yytoken.
1828 2008-11-09 Akim Demaille <demaille@gostai.com>
1830 Rename data_type and stack_symbol_type.
1831 * data/lalr1.cc (data_type): Rename as...
1832 (stack_symbol_type): this.
1834 2008-11-09 Akim Demaille <demaille@gostai.com>
1836 Handle semantic value and location together.
1837 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
1838 yydata.value and yydata.location.
1839 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
1840 (YY_SYMBOL_PRINT): Now take semantic value and location as a
1843 (yydestruct_): New overload for a stack symbol.
1845 2008-11-09 Akim Demaille <demaille@gostai.com>
1847 Push a complete symbol, not connected parts.
1848 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
1849 state, value and location.
1852 2008-11-09 Akim Demaille <demaille@gostai.com>
1854 Agregate yylval and yylloc.
1855 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
1856 (parser::yyla): this.
1858 2008-11-09 Akim Demaille <demaille@gostai.com>
1860 Rely on the state stack to display reduction traces.
1861 To display rhs symbols before a reduction, we used information
1862 about the rule reduced, which required the tables yyrhs and
1863 yyprhs. Now use rely only on the state stack to get the same
1866 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
1868 (parser::yyrhs_, parser::yyprhs_): Remove.
1869 (parser::yy_reduce_print_): Use the state stack.
1871 2008-11-09 Akim Demaille <demaille@gostai.com>
1873 Fuse yyval and yyloc into yylhs.
1874 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
1876 (parse): Replace yyval and yyloc with yylhs.value and
1878 After a user action, compute yylhs.state earlier.
1879 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
1882 2008-11-09 Di-an Jan <dianj@freeshell.org>
1884 Remove unused variable.
1885 * src/output.c (type_names_output): Remove unused variable sep.
1887 2008-11-09 Paolo Bonzini <bonzini@gnu.org>
1889 Change tests/output.at quoting.
1890 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
1891 expanding arguments.
1893 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1895 Don't add a semicolon to actions for %skeleton or %language.
1896 It breaks Java test cases as reported by Akim Demaille.
1897 * src/scan-code.l: Implement.
1899 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1901 Clean up %skeleton and %language priority implementation.
1902 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
1903 remove static qualifier because others will soon need to see it.
1904 (language_prio): Likewise.
1905 (getargs): Use command_line_prio rather than 0.
1906 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
1908 (skeleton_prio): Extern it.
1909 (language_prio): Extern it.
1910 * src/parse-gram.y: Use grammar_prio rather than 1.
1912 2008-11-07 Akim Demaille <demaille@gostai.com>
1914 Moving push traces into yypush_.
1915 * data/lalr1.cc (yypush_): Now takes a optional trace message.
1918 2008-11-07 Akim Demaille <demaille@gostai.com>
1920 The single-stack C++ parser is now the standard one.
1921 * data/lalr1.cc: Rename as...
1922 * data/lalr1-split.cc: this.
1923 * data/lalr1-fusion.cc: Rename as...
1924 * data/lalr1.cc: this.
1925 * etc/bench.pl.in: Adjust.
1927 2008-11-07 Akim Demaille <demaille@gostai.com>
1929 Avoid empty-if warnings.
1930 Reported by Quentin Hocquet.
1932 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
1933 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
1935 2008-11-07 Akim Demaille <demaille@gostai.com>
1937 Pass command line location to skeleton_arg and language_argmatch.
1938 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
1939 The location argument is now mandatory.
1940 Adjust all dependencies.
1941 (getargs): Use command_line_location.
1943 2008-11-07 Akim Demaille <demaille@gostai.com>
1946 * src/getargs.c (usage): Document -D.
1947 Fix help string for --locations.
1948 (command_line_location): New.
1949 (short_options, long_options, getargs): Support -D, --define.
1950 (getargs): Move -d support at the right place.
1951 * doc/bison.texinfo (Bison Options): Update.
1952 * tests/input.at (%define, --define): New.
1954 2008-11-07 Akim Demaille <demaille@gostai.com>
1956 Initialize the muscle table before parsing the command line.
1957 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
1958 (getargs): Define file_name.
1959 * src/main.c (main): Initialize muscle_tab before calling
1961 * src/muscle_tab.c (muscle_init): No longer define file_name, as
1962 its value is not available yet.
1964 2008-11-07 Akim Demaille <demaille@gostai.com>
1966 Locations without columns for command line arguments.
1967 * src/location.c (location_print): Don't display negative columns.
1968 * src/location.h: Document this.
1970 2008-11-07 Akim Demaille <demaille@gostai.com>
1973 * src/getargs.c (usage): Fix help string for -W.
1975 2008-11-07 Akim Demaille <demaille@gostai.com>
1977 Handle more general types of option arguments.
1978 * build-aux/cross-options.pl: The argument ends at the first
1979 space, not the first non-symbol character.
1980 Use @var for each word appearing the argument description.
1982 2008-11-07 Akim Demaille <demaille@gostai.com>
1984 Destroy the variants that remain on the stack in case of error.
1985 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
1987 Display the value only if yymsg is nonnull.
1988 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
1990 2008-11-07 Akim Demaille <demaille@gostai.com>
1992 Add "%define assert" to variants.
1993 This is used to help the user catch cases where some value gets
1994 ovewritten by a new one. This should not happen, as this will
1997 Unfortunately this uncovered a bug in the C++ parser itself: the
1998 lookahead value was not destroyed between two calls to yylex. For
1999 instance if the previous lookahead was a std::string, and then an int,
2000 then the value of the std::string was correctly taken (i.e., the
2001 lookahead was now an empty string), but std::string structure itself
2004 This is now done in variant::build(other&) (which is used to take the
2005 value of the lookahead): other is not only stolen from its value, it
2006 is also destroyed. This incurs a new performance penalty of a few
2007 percent, and union becomes faster again.
2009 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
2010 (b4_variant_if): New.
2011 (variant::built): New.
2012 Use it whereever the status of the variant changes.
2013 * etc/bench.pl.in: Check the penalty of %define assert.
2015 2008-11-07 Akim Demaille <demaille@gostai.com>
2017 Use "%define variant" in bench.pl.
2018 * etc/bench.pl.in: No longer use the pseudo directive %variants,
2019 just use %define variants.
2021 2008-11-07 Akim Demaille <demaille@gostai.com>
2024 * src/parse-gram.h, src/parse-gram.c: Regen.
2026 2008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
2028 Fix user actions without a trailing semicolon.
2029 Reported by Sergei Steshenko at
2030 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
2031 * THANKS (Sergei Steshenko): Add.
2032 * src/scan-code.l (SC_RULE_ACTION): Fix it.
2033 * tests/regression.at (Fix user actions without a trailing semicolon):
2036 2008-11-04 Akim Demaille <demaille@gostai.com>
2038 Use b4_copyright_years.
2039 * data/yacc.c (b4_copyright_years): New.
2040 Fix its value according to the comments in the file.
2041 Use it and undefine it.
2043 2008-11-04 Akim Demaille <demaille@gostai.com>
2046 * data/lalr1-fusion.cc, src/parse-gram.y: here.
2048 2008-11-04 Akim Demaille <demaille@gostai.com>
2051 * data/lalr1-fusion.cc: here.
2053 2008-11-04 Akim Demaille <demaille@gostai.com>
2055 Use strict on bench.pl.
2056 * etc/bench.pl.in (&run, &generate_grammar): New.
2057 Rename the grammar generating functions for consistency.
2058 Change the interface so that the list of benches to run is passed
2059 as (optionless) arguments.
2060 (&compile): Use &run.
2062 2008-11-04 Akim Demaille <demaille@gostai.com>
2064 Remove spurious initial empty lines.
2065 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
2066 * data/yacc.c: End the @output lines with an @.
2068 2008-11-04 Akim Demaille <demaille@gostai.com>
2070 Improve the display of sizes.
2071 * etc/bench.p.in: Higher precision.
2072 Sort by decreasing size.
2074 2008-11-04 Akim Demaille <demaille@gostai.com>
2076 Don't memcpy C++ structures.
2077 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
2079 (variant::build): New overload for
2080 copy-construction-that-destroys.
2081 (variant::swap): New.
2082 (parser::yypush_): Use it in variant mode.
2084 2008-11-04 Akim Demaille <demaille@gostai.com>
2086 Better defaults for bench.pl.
2087 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
2089 Adjust &verbose uses.
2092 2008-11-04 Akim Demaille <demaille@gostai.com>
2094 Make variant.yy more complex.
2095 std::list cannot be copied via memcpy, they are more demanding than
2096 std::string. Use one std::list to strengthen the test.
2098 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
2100 Create a list of strings, instead of a single large string.
2102 2008-11-04 Akim Demaille <demaille@gostai.com>
2105 * etc/bench.pl.in (--bench, $bench): New.
2107 2008-11-04 Akim Demaille <demaille@gostai.com>
2110 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
2111 Define it after as().
2113 2008-11-04 Akim Demaille <demaille@gostai.com>
2116 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
2118 2008-11-04 Akim Demaille <demaille@gostai.com>
2120 Issue missing synclines after user actions.
2121 * data/c.m4 (b4_case): Issue synclines on the output file.
2123 2008-11-04 Akim Demaille <demaille@gostai.com>
2125 Remove trailing empty line.
2126 * data/lalr1-fusion.cc: Don't add an empty line after the user's
2129 2008-11-04 Akim Demaille <demaille@gostai.com>
2131 Fix output of copyright years.
2132 * data/bison.m4 (b4_copyright): Fix the indentation of the
2133 copyright year paragraph.
2134 Use b4_copyright_years when no years are given.
2135 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
2136 (b4_copyright_years): New.
2139 2008-11-04 Akim Demaille <demaille@gostai.com>
2141 Avoid the spurious initial empty line.
2142 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
2143 the end of @output request to suppress the empty line that
2146 2008-11-04 Akim Demaille <demaille@gostai.com>
2148 Remove parser::rhs_number_type.
2149 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
2150 (yyrhs_): Use b4_table_define.
2152 2008-11-04 Akim Demaille <demaille@gostai.com>
2155 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
2157 2008-11-04 Akim Demaille <demaille@gostai.com>
2159 Factor the declaration of the integer tables.
2160 * data/lalr1-fusion.cc (b4_table_define): New.
2163 2008-11-03 Akim Demaille <demaille@gostai.com>
2165 Fix indentation of tables in lalr1.cc
2166 * data/lalr1-fusion.cc: Fix the indentation.
2168 2008-11-03 Akim Demaille <demaille@gostai.com>
2170 Destroy the lhs symbols after reduction.
2171 * data/lalr1-fusion.cc (parse): After the user action, when in
2172 variant mode, destroy the lhs symbols.
2174 2008-11-03 Akim Demaille <demaille@gostai.com>
2176 Simplify yysyntax_error_ use.
2177 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
2178 type, but make it unnamed in the declaration when it is not used.
2180 2008-11-03 Akim Demaille <demaille@gostai.com>
2182 Let yy::variant::build return an lvalue.
2183 * data/lalr1-fusion.cc (variant::build): Return a reference to the
2186 2008-11-03 Akim Demaille <demaille@gostai.com>
2188 Define yy::variant only when needed.
2189 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
2192 2008-11-03 Akim Demaille <demaille@gostai.com>
2194 Bench the three-stack lalr1.cc.
2195 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
2198 2008-11-03 Akim Demaille <demaille@gostai.com>
2200 Fail on parse error in calc++.
2201 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
2203 * examples/calc++/test ($me, $number, $exit, run): New.
2204 Use them to propagate errors to the exit status.
2206 2008-11-03 Akim Demaille <demaille@gostai.com>
2208 Don't specify the skeleton twice in the example.
2209 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
2210 file does what is needed.
2212 2008-11-03 Akim Demaille <demaille@gostai.com>
2214 bench: Improve output.
2215 * etc/bench.pl.in (bench_grammar): Tune the printf format.
2217 2008-11-03 Akim Demaille <demaille@gostai.com>
2219 bench: check impact of %debug on variants.
2220 * etc/bench.pl.in (variant_grammar): Fix the computation of
2222 Generate a grammar file that can work with or without %debug.
2223 Do use the @directive.
2224 (bench_variant_parser): Check impact of %debug.
2225 (@directives): Rename all the occurrences to...
2226 (@directive): this, for consistency.
2228 2008-11-03 Akim Demaille <demaille@gostai.com>
2230 bench: report the size too.
2231 * etc/bench.pl.in ($iterations): Defaults to -3.
2232 (&bench_grammar): Require hireswallclock.
2233 Compute and display the size of the result.
2236 2008-11-03 Akim Demaille <demaille@gostai.com>
2238 bench: More use of the verbosity level.
2239 * etc/bench.pl.in ($verbose, &verbose): New.
2241 More POD documentation.
2243 2008-11-03 Akim Demaille <demaille@gostai.com>
2245 bench.pl: a command line interface
2246 * etc/bench.pl.in: More doc.
2247 Some fixes in the documentation.
2248 ($cflags, $iterations, &help, &getopt): New.
2250 (&variant_grammar): Let the number of stages be 10 times what is
2253 2008-11-03 Akim Demaille <demaille@gostai.com>
2255 Bench the use of Boost.Variants.
2256 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
2258 (&compile): Be ready to compile C++ parsers.
2259 (&bench_push_parser): Move debug information to the outermost
2261 * THANKS: Add Michiel De Wilde.
2263 2008-11-03 Akim Demaille <demaille@gostai.com>
2265 bench.pl: Pass directives as a list instead of as a string.
2266 * etc/bench.pl.in (&directives): New.
2267 (&triangular_grammar, &calc_grammar): Use it to format the Bison
2269 (&triangular_grammar): Do use the directives (were ignored).
2270 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
2273 2008-11-03 Akim Demaille <demaille@gostai.com>
2275 Improve genericity of bench.pl.
2276 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
2278 (&bench_push_parser): New.
2281 2008-11-03 Akim Demaille <demaille@gostai.com>
2283 Add documentation to bench.pl.
2284 * etc/bench.pl.in: Comment changes.
2286 2008-11-03 Akim Demaille <demaille@gostai.com>
2288 Fuse the three stacks into a single one.
2290 In order to make it easy to perform benchmarks to ensure that
2291 there are no performance loss, lalr1.cc is forked into
2292 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
2295 Meanwhile, to make sure that lalr1-fusion.cc is correctly
2296 exercized by the test suite, the user must install a symbolic link
2297 from lalr1.cc to it.
2299 Instead of having three stacks (state, value, location), use a
2300 stack of triples. This considerably simplifies the code (and it
2301 will be easier not to require locations as currently does the C++
2302 parser), and also gives a 10% speedup according to
2303 etc/bench (probably mainly since memory allocation is done once
2304 instead of three times).
2306 Another motivation is to make it easier to destruct properly
2307 semantic values: now that they are bound to their state (hence
2308 symbol type) it will be easier to call the appropriate destructor.
2310 These changes should probably benefit the C parser too.
2312 * data/lalr1.cc: Copy as...
2313 * data/lalr1-fusion.cc: this new file.
2314 (b4_rhs_value, b4_rhs_location): New definitions overriding those
2316 (state_stack_type, semantic_stack_type, location_stack_type)
2317 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
2318 (data_type, stack_type, yystack_): New.
2319 (YYLLOC_DEFAULT, yypush_): Adjust.
2320 (yyerror_range): Now based on data_type, not location_type.
2322 2008-11-03 Akim Demaille <demaille@gostai.com>
2324 Push the state, value, and location at the same time.
2325 This is needed to prepare a forthcoming patch that fuses the three
2328 * data/lalr1.cc (parser::yypush_): New.
2329 (parser::yynewstate): Change the semantics: instead of arriving to
2330 this label when value and location have been pushed, but yystate
2331 is to be pushed on the state stack, now the three of them must
2332 have been pushed before. yystate still must be the new state.
2333 This allows to use yypush_ everywhere instead of individual
2334 handling of the stacks.
2336 2008-11-03 Akim Demaille <demaille@gostai.com>
2338 Prefer references to pointers.
2339 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
2340 definition to use references instead of pointers.
2341 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
2342 Take the value and location as references.
2345 2008-11-03 Akim Demaille <demaille@gostai.com>
2347 stack::size instead of stack::height.
2348 * data/lalr1.cc (stack::height): Rename as...
2349 (stack::size): this.
2350 Fix the output type.
2353 2008-11-03 Akim Demaille <demaille@gostai.com>
2355 Use variants to support objects as semantic values.
2356 This patch was inspired by work by Michiel De Wilde. But he used
2357 Boost variants which (i) requires Boost on the user side, (ii) is
2358 slow, and (iii) has useless overhead (the parser knows the type of
2359 the semantic value there is no reason to duplicate this
2360 information as Boost.Variants do).
2362 This implementation reserves a buffer large enough to store the
2363 largest objects. yy::variant implements this buffer. It was
2364 implemented with Quentin Hocquet.
2366 * src/output.c (type_names_output): New.
2367 (output_skeleton): Invoke it.
2368 * data/c++.m4 (b4_variant_if): New.
2369 (b4_symbol_value): If needed, provide a definition for variants.
2370 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
2371 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
2372 (b4_char_sizeof, yy::variant): New.
2373 (parser::parse): If variants are requested, define
2374 parser::union_type, parser::variant, change the definition of
2375 semantic_type, construct $$ before running the user action instead
2376 of performing a default $$ = $1.
2377 * examples/variant.yy: New.
2378 Based on an example by Michiel De Wilde.
2380 2008-11-03 Akim Demaille <demaille@gostai.com>
2382 Parameterize the extraction of semantic values.
2383 To make future changes easier, no longer rely on ".TYPE" being the
2384 way to get a semantic value.
2386 * data/c.m4 (b4_symbol_value): New.
2388 * data/c++.m4, data/yacc.c: Use it.
2389 * data/glr.c: Use b4_symbol_value.
2393 2008-11-03 Akim Demaille <demaille@gostai.com>
2395 Prepare easier M4 changes.
2396 * data/lalr1.cc: Use escaped [] instead of literals to prepare
2399 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2401 Initiate further development.
2402 * NEWS: Create an empty section for new entries.
2403 * gnulib: Update submodule to HEAD.
2405 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2407 * NEWS: Version 2.4.
2409 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2411 Prepare for next release.
2412 * NEWS: Briefly mention changes since 2.3b.
2413 * README: Say GNU m4 1.4.6, which we've been requiring in release
2414 announcements already, not 1.4.3, which breaks the build.
2416 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2418 Say %language is experimental.
2419 We're thinking of extending it's effect on output file naming. See the
2421 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
2422 * NEWS: Say it's experimental.
2423 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
2424 recommend it over %skeleton for now.
2425 (Bison Options): Likewise.
2426 (C++ Bison Interface): Use %skeleton not %language.
2427 (Calc++ Parser): Use %skeleton not %language.
2428 * src/getargs.c (usage): Say it's experimental.
2430 2008-11-01 Di-an Jan <dianj@freeshell.org>
2431 Paolo Bonzini <bonzini@gnu.org>
2433 Support all Java parser class modifiers.
2434 * data/java.m4 (b4_percent_define_get3): New.
2435 (b4_final_if, b4_strictfp_if): New.
2436 * data/lalr1.java (final, strictfp, extends, implements): Support.
2437 * doc/bison.texinfo (final, strictfp, extends, implements): Add
2439 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
2440 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
2441 (AT_CHECK_JAVA_GREP): New.
2442 (Java parser class modifiers): New test.
2443 (Java parser class extends and implements): New test.
2445 Model exception propagation better with throws and lex_throws.
2446 * data/java.m4 (b4_list2): New.
2447 (throws): Change default.
2448 * data/lalr1.java (yyaction): Add throws.
2449 (parse): Add lex_throws in addition to throws.
2450 * doc/bison.texinfo (throws, lex_throws): Add documentation.
2451 * tests/java.at (Java throws specifications): New test.
2453 Improve documentation for Java parsers.
2454 * doc/bison.texinfo (Java Parsers): Add subsections.
2455 Don't quote first argument of %define.
2456 (Java Bison Interface): Document output files. Move documentation
2457 of parser class and merge into Java Parser Interface. Document
2458 features that error out. Document directives with no effect.
2459 Move note about Javadoc higher.
2460 (Java Semantic Values): Explicitly mention stype.
2461 Document that generic types cannot be used.
2462 (Java Location Values): Use @deftypeivar. Document constructors.
2463 Correct return value for toString.
2464 (Java Parser Interface): List undocumented constants/fields.
2465 Move documentation of fields added by %parse-param closer to list
2466 of members. Document that token names are added as fields.
2467 Document constructors accurately. Remove error method.
2468 (Java Scanner Interface): Move note on %pure-parser to Java Bison
2469 Interface. Describe %code lexer and yylex accutately.
2470 Remove documentation that does not match the code.
2471 (Java Action Features): New.
2472 (Java Differences): Add reference. Add item on semantic values.
2473 Add note about @{ ... @}. Clarify %% epilogue placement.
2474 (Java Declarations Summary): New.
2477 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
2478 (b4_remove_comma): Quote test argument.
2479 (b4_identification): Remove "bison" field.
2480 * tests/java.at (Java parser class and package names): New test.
2481 (Java %parse-param and %lex-param): New test.
2482 (Java stype, position_class and location_class): New test.
2484 2008-10-31 Di-an Jan <dianj@freeshell.org>
2486 * data/lalr1.jave: Update copyright years.
2487 (YYParser): Correct name of "generated from" file in Javadoc:
2488 use b4_file_name instead of @ofile@.
2489 (Location constructor): Correct Javadoc parameter name.
2490 (yylloc): Add missing opening m4 quote after b4_location_if.
2491 This removes a stray [ in the Javadoc of Lexer.getStartPos.
2492 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
2493 (YYParser constructor): Correct Javadoc parameter name.
2495 2008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
2497 Always put auxiliary code files in the same dir as other output files.
2498 * src/files.c (compute_file_name_parts): When the user specifies
2499 --output but not --file-prefix, extract the directory prefix from the
2500 file prefix not from the grammar file name. This affects the location
2501 of files like location.hh generated by the C++ skeleton. The includes
2502 in the other output files require this fix.
2503 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
2504 for expected output files.
2505 (Output files): Add a test for the above.
2507 2008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
2509 * gnulib: Update submodule to HEAD.
2511 2008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2513 Update copyright year.
2514 * src/files.c: Here.
2516 2008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
2518 Don't overwrite the input file.
2519 * src/files.c (output_file_name_check): Fatal error if using input file
2521 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
2523 (Conflicting output files): Add test.
2525 2008-10-28 Akim Demaille <demaille@gostai.com>
2528 * data/lalr1.cc: Formatting changes.
2530 2008-10-28 Akim Demaille <demaille@gostai.com>
2532 Don't define debugging functions when !YYDEBUG.
2533 * data/lalr1.cc (debug_stream, set_debug_stream)
2534 (debug_level_type, debug_level, set_debug_level): Don't
2535 declare them when YYDEBUG is not defined.
2536 The implementation are already YYDEBUG-aware.
2538 2008-10-28 Akim Demaille <demaille@gostai.com>
2540 Prefer "continue" for empty loop bodies.
2541 * etc/bench.pl.in: Use "continue" instead of {}.
2543 2008-10-28 Akim Demaille <demaille@gostai.com>
2545 Space and comments changes.
2546 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
2547 * data/c.m4, data/lalr1.cc: Space changes.
2549 2008-10-28 Akim Demaille <demaille@gostai.com>
2551 Make gnulib a submodule.
2553 * .gitmodules (gnulib): New.
2555 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
2557 Fix yyerror_range for user-defined location type in C++. Reported by
2559 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
2560 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
2561 * THANKS (Georg Sauthoff): Add.
2563 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
2565 Update several administrative files mainly to facilitate releasing.
2566 * HACKING (Administrivia): Make the git-merge-changelog notes more
2568 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
2569 (Release Procedure): Update for git and add numerous details that were
2571 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
2572 * maint.mk (announcement): Don't list bison as a bootstrap tool so
2573 that announcements don't claim we bootstrapped with whatever bison
2574 happened to be in PATH. Add flex as a bootstrap tool.
2575 * Makefile.maint: Remove, previously replaced by maint.mk.
2576 * Makefile.cfg: Remove, and migrate settings to...
2577 * cfg.mk: ... here for the sake of `make announcement'.
2578 * bootstrap.conf (gnulib_modules): Add announce-gen.
2579 * README: Say GNU Bison instead of just Bison. Suggested by Karl
2582 2008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
2584 Small but important bugfixes for the Java skeleton.
2585 * data/lalr1.java (yyerror): Change Location to b4_location_type.
2586 (yy_symbol_print): Call toString on yyvaluep.
2588 2008-08-29 Akim Demaille <demaille@gostai.com>
2590 Clarify UPDATED use.
2591 * doc/bison.texinfo: It refers to the last edition of this file,
2592 not to the release date of Bison.
2593 Reported by Joel E. Denny.
2595 2008-08-29 Akim Demaille <demaille@gostai.com>
2597 * README: Update FAQ pointer.
2598 Reported by Joel E. Denny.
2600 2008-08-27 Eric Blake <ebb9@byu.net>
2602 Resync m4sugar from autoconf.
2603 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
2604 (m4_init): Adjust to latest m4.git changes.
2605 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
2607 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
2608 (_m4_list_cmp): Reduce side effects.
2610 2008-08-27 Akim Demaille <demaille@gostai.com>
2612 Check yyerrok in calc.at.
2613 * tests/calc.at (calc.y): Use yyerrok on "( error )".
2614 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
2617 2008-08-27 Akim Demaille <demaille@gostai.com>
2619 Support yyerrok in lalr1.cc.
2620 YYBACKUP is still to import back into lalr1.cc.
2621 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
2623 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
2625 For maintainer-check*, don't recompile for a $(VERSION) update.
2627 (_is-dist-target): Override the one in GNUmakefile.
2628 * Makefile.am (EXTRA_DIST): Add cfg.mk.
2630 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
2632 Update for recent change to gnulib.
2633 * src/parse-gram.y: Don't include strverscmp.h. It comes from
2636 2008-08-15 Eric Blake <ebb9@byu.net>
2638 Remaining m4sugar merge from autoconf.
2639 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
2640 * data/m4sugar/foreach.m4: New file, copied from autoconf.
2641 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
2642 * src/output.c (output_skeleton): Tell m4 how to find it.
2644 Partial m4sugar merge from autoconf: m4_map.
2645 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
2646 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
2647 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
2648 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
2650 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
2652 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
2655 2008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
2657 Keep .version and PACKAGE_VERSION in sync.
2658 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
2659 dependency, and add comments justifying this in more detail. Discussed
2661 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
2663 2008-08-06 Eric Blake <ebb9@byu.net>
2665 Partial m4sugar merge from autoconf: m4_shiftn.
2666 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
2667 (m4_shift2, m4_shift3): New macros.
2668 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
2669 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
2670 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
2671 * data/java.m4 (b4_remove_comma): Likewise.
2673 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
2674 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
2675 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
2676 (m4_init): Consolidate wrapped text into single m4_wrap.
2677 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
2680 2008-08-05 Eric Blake <ebb9@byu.net>
2682 Partial m4sugar merge from autoconf: builtins, version.m4.
2683 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
2684 (m4_prepend): Remove, as it is unused and inherently quadratic,
2685 whereas m4_append is linear in newer m4.
2686 (m4_mkstemp): New builtin.
2687 (m4_symbols): Make rename conditional.
2688 (m4_version_prereq): Ensure fatal error if used in bison, which
2689 intentionally lacks version.m4.
2691 Fix comments in m4sugar.
2692 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
2694 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
2696 Update for recent .gitignore fix in Gnulib.
2697 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
2698 anchored .gitignore entries.
2700 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
2702 Set gnu or gnits strictness.
2703 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
2704 development and gnits strictness for releases. Based on Eric Blake's
2706 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
2708 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
2710 * NEWS: Clarify documentation of %language.
2712 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
2714 Support usage of git-merge-changelog.
2715 * .gitattributes: New.
2716 * HACKING: Document usage of git-merge-changelog.
2717 * bootstrap: Install git-merge-changelog entries in .git/config
2720 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2722 Remove remaining dependence on CVS Id keyword.
2723 * ChangeLog: For the sake of people still using CVS, don't use dollars
2725 * data/xslt/bison.xsl: Remove Id from header comments, where it was
2727 * data/xslt/xml2dot.xsl: Likewise.
2728 * data/xslt/xml2text.xsl: Likewise.
2729 * data/xslt/xml2xhtml.xsl: Likewise.
2730 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
2731 * doc/Makefile.am (neutralize): Remove, no longer needed.
2732 (.x.1): Don't use neutralize.
2733 (edit): Don't substitute for ID.
2734 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
2736 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2738 Fix dependence on computed configure variables.
2739 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
2740 $(top_srcdir)/configure.ac so that changes to computed variables, such
2741 as PACKAGE_VERSION, are seen.
2742 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
2744 2008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
2746 Update copyright dates for recent changes.
2747 * Makefile.am: Here.
2748 * src/Makefile.am: Here.
2749 * src/reduce.c: Here.
2750 * tests/reduce.at: Here.
2752 2008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
2754 Use git-version-gen for version names between releases.
2755 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
2756 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
2757 * .prev-version: New.
2758 * .version.in: Remove.
2759 * ChangeLog: Remove the Id previously used for capturing the CVS
2761 * GNUmakefile: Remove, now copied from Gnulib.
2762 * Makefile.am: Add code suggested by comments in
2763 build-aux/git-version-gen.
2764 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
2765 .prev-version, and .version.
2766 * NEWS (2.3b+): Rename to...
2767 (?.?): ... this because we're dropping the "+" version naming scheme,
2768 but, in general, we still can't be sure of our next release name.
2769 * bootstrap: Add a quick hack to remove from .gitignore the
2770 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
2771 entry. This should really be fixed in gnulib instead.
2772 * bootstrap.conf (gnulib_modules): Add gnumakefile.
2773 * configure.ac (AC_INIT): Set version name by invoking
2774 build-aux/git-version-gen.
2775 (AC_CONFIG_FILES): Remove .version, now generated by
2776 build-aux/git-version-gen.
2777 * maint.mk: New, copied from coreutils.
2778 * doc/.cvsignore (bison.1): Add.
2779 * doc/.gitignore (/bison.1): Add.
2780 * doc/bison.1: Remove, generated.
2781 * src/.cvsignore (revision.c): Remove.
2782 * src/.gitignore (/revision.c): Remove.
2783 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
2784 (BUILT_SOURCES): Remove revision.c.
2785 (revision.c): Remove.
2786 * src/getargs.c (version): Don't print revision after the VERSION.
2787 * src/revision.h: Remove.
2789 2008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
2791 Fix untranslatable composition of sentences. Reported by Goran
2793 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
2794 * THANKS (Goran Uddeborg): Add.
2795 * src/reduce.c (reduce_print): Report the number of nonterminals and
2796 rules useless in the grammar in separate sentences.
2797 * tests/reduce.at (Useless Rules): Update output.
2798 (Reduced Automaton): Likewise.
2799 (Underivable Rules): Likewise.
2800 (Empty Language): Likewise.
2802 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2804 Fix some .gitignore and .cvsignore problems.
2805 * bootstrap (insert_sorted_if_absent): Replace all uses with...
2806 (insert_vc_ignore): ... this new function, which prepends `/' to all
2807 .gitignore entries before passing them to insert_sorted_if_absent.
2808 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
2809 .cvsignore files are maintained even though Bison developers run
2810 bootstrap while using Git.
2811 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
2814 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
2815 unneeded. Reported by Eric Blake.
2816 * lib/.gitignore (/*~): Add.
2817 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
2818 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
2820 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
2822 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2824 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
2825 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
2826 * bootstrap.conf (gnulib_modules): Add unsetenv.
2827 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
2828 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
2830 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
2831 the first argument because it may become position-dependent, and unset
2832 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
2833 Add comments explaining these issues in more detail.
2835 2008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
2837 Add .gitignore everywhere based on .cvsignore.
2839 * build-aux/.gitignore: New.
2840 * data/.gitignore: New.
2841 * doc/.gitignore: New.
2842 * etc/.gitignore: New.
2843 * examples/.gitignore: New.
2844 * examples/calc++/.gitignore: New.
2845 * lib/.gitignore: New.
2846 * m4/.gitignore: New.
2847 * po/.gitignore: New.
2848 * runtime-po/.gitignore: New.
2849 * src/.gitignore: New.
2850 * tests/.gitignore: New.
2852 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2854 * NEWS (2.3b+): New section, empty for now.
2855 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
2857 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2859 * NEWS (2.3b): Update release date since there has been a delay in
2860 getting the announcements and tarballs out.
2862 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
2864 * NEWS: Version 2.3b.
2865 * configure.ac (AC_INIT): Likewise.
2866 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
2868 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
2870 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
2871 been doing it for years.
2872 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
2873 (Release Procedure): Add FIXME about make alpha being unmaintained.
2875 2008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
2877 * data/yacc.c: Reformat m4 a little for readability.
2878 * src/lalr.c (build_relations): Correct comment.
2880 2008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2882 DJGPP specific issue.
2883 * djgpp/config.sed: Fixes required to run configure scripts generated
2886 2008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
2888 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
2889 coordinator@translationproject.org.
2891 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2893 * THANKS: Add Eric Blake.
2895 2008-04-23 Eric Blake <ebb9@byu.net>
2897 Revert prior patch, by working around autoconf regression.
2898 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
2899 ("Output file name: ("): Uncomment test.
2900 ("Output file name: )"): Likewise.
2901 Based on an idea from Noah Misch.
2903 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2905 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
2906 2.61. Reported by Juan Manuel Guerrero at
2907 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
2908 * tests/output.at ("Output file name: ("): Comment out test case for
2910 ("Output file name: )"): Likewise.
2912 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2914 * GNUmakefile: Update git-version-gen invocation so make dist
2917 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2919 Update to the current gnulib CVS repository, and fix trigraph handling
2921 * bootstrap: Update gnulib CVS repository URL.
2922 (symlink_to_dir): Encapsulate the code that guarantees the destination
2923 directory exists into...
2924 (check_dst_dir): ... this new function, and...
2925 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
2926 fail when copying files into lib/uniwidth/.
2927 * src/output.c (prepare_symbols): When writing yytname muscles, where
2928 symbol names will be encoded in C-string literals, tell quotearg to
2929 escape trigraphs. This used to be the default in gnulib.
2930 * tests/regression.at (Token definitions): Because of the change in
2931 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
2932 escapes trigraphs in symbol names. Thus, yytname no longer has
2933 trigraphs unnecessarily doubly escaped. Update test case output.
2934 Extend test case to be sure Bison's own error messages will no longer
2935 have trigraphs in symbol names unnecessarily escaped once.
2937 2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2939 Fix make dist infinite loop reported by Juan Manuel Guerrero at
2940 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
2941 * .cvsignore: Add .version.
2943 * bootstrap.conf (gnulib_modules): Add git-version-gen.
2944 * configure.ac (AC_CONFIG_FILES): Add .version.
2945 * build-aux/.cvsignore: Add git-version-gen.
2947 2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2949 * NEWS (2.3a+): Mention that -g now takes an argument.
2950 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
2951 consistency. Update the -g and -x entries now that they take
2952 arguments. Use brackets to indicate optional arguments.
2953 * src/getargs.c (usage): Explain the relationship between arguments of
2954 long and short options more completely. Document --defines and -d
2955 separately since the former takes an argument but, for POSIX Yacc, the
2957 (short_options): Let -W take an optional argument like --warnings.
2958 (getargs): Sort cases.
2960 2008-02-28 Akim Demaille <demaille@gostai.com>
2962 * doc/bison.texinfo: Fix a few typos.
2964 2008-02-28 Akim Demaille <akim@epita.fr>
2966 * doc/bison.texinfo (Bison Options): Document -W.
2967 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
2969 2008-02-28 Akim Demaille <akim@epita.fr>
2971 * src/getargs.c (short_options): Split and sort for readability.
2972 -g and -x take optional arguments, just like their long options.
2973 * build-aux/cross-options.pl: Use /x to make the regexp easier to
2975 Fix the handling of $opt which resulted in all the argument to be
2976 considered as optional.
2978 2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
2980 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
2981 say its interface is experimental.
2982 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
2984 (Bison Options): In the -L and --language entry, mention Java.
2985 (Java Bison Interface): Say the interface is experimental.
2986 * src/getargs.c (usage): Mention -L and --language.
2988 * NEWS (2.3a+): Say the push parsing interface is experimental.
2989 * doc/bison.texinfo (Push Decl): Likewise.
2990 (Decl Summary): Likewise in the "%define api.push_pull" entry.
2991 (Push Parser Function): Likewise.
2992 (Pull Parser Function): Likewise.
2993 (Parser Create Function): Likewise.
2994 (Parser Delete Function): Likewise.
2995 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
2996 yypull_parse, and yypush_parse entries.
2998 * NEWS (2.3a+): Mention XML support, and say the schema is
3000 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
3001 * src/getargs.c (usage): Say the XML schema is experimental.
3003 * NEWS (2.3a+): Say option instead of flag.
3005 2008-02-21 Wojciech Polak <polak@gnu.org>
3007 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
3010 2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
3012 Fix impure push parser compile error reported by Bob Rossi at
3013 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
3014 * data/yacc.c: Clean up whitespace in the output a little.
3015 (yypstate_allocated): Define for impure push parsers regardless of
3016 whether the pull interface is also requested.
3017 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
3018 check impure push parsers without the pull interface.
3020 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
3021 yyerror takes arguments specified by %parse-param while yypstate_new
3023 * doc/bison.texinfo (Parser Create Function): Document that
3024 yypstate_new returns 0 for multiple impure parser instances.
3025 * tests/push.at (Push Parsing: Multiple impure instances): Update
3026 expected stderr output.
3028 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3030 * runtime-po/POTFILES.in (push.c): Remove.
3032 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3034 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
3035 * data/push.c: Rename to...
3036 * data/yacc.c: ... this, overwriting it.
3037 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
3038 `%push-pull-parser' -> `%define api.push_pull "both"'.
3039 Remove old yacc.c tests, and update push.c tests to yacc.c.
3041 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3043 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
3044 `"%code top" blocks' instead of `%code "top" blocks'.
3045 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
3046 Clean up whitespace in the output a little.
3048 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3050 Fix documentation problems reported by Tim Josling at
3051 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
3052 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
3053 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
3054 integers. Explain the effect of literal string aliases on error
3055 messages. Copy token 0 documentation from the C++ skeleton
3058 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3060 Accept a token number in a %left, %right, or %nonassoc for POSIX
3061 conformance. Reported by Tim Josling at
3062 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
3063 * NEWS (2.3a+): Mention.
3064 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
3065 and code numbers are treated by precedence declarations.
3066 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
3068 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
3070 (symbol.prec): New, just like symbol but allows INT.
3071 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
3073 * tests/regression.at (Token number in precedence declaration): New
3076 2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3078 DJGPP specific issues.
3079 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
3080 be changed. Copyright timestamp adjusted.
3081 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
3082 be changed. Copyright timestamp adjusted.
3083 * djgpp/config.site: Copyright timestamp adjusted.
3084 * djgpp/config_h.sed: Copyright timestamp adjusted.
3085 * djgpp/djunpack.bat: Copyright timestamp adjusted.
3086 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
3087 filename translation list.
3088 * djgpp/subpipe.c (init_subpipe): Check the environment variables
3089 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
3090 files shall be created. Before trying to use the temp dir where the
3091 environment variable points to check that the dir really exists. If
3092 not default to the cwd as temp dir. Copyright timestamp adjusted.
3093 * djgpp/subpipe.h: Copyright timestamp adjusted.
3094 * djgpp/testsuite.sed: Copyright timestamp adjusted.
3096 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
3098 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
3100 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
3102 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
3103 Problem reported by Claudio Saavedra in
3104 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
3106 2008-01-05 Wojciech Polak <polak@gnu.org>
3108 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
3109 document's title with the input grammar file name.
3111 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
3113 Automate regression testing of the XML/XSLT implementation. Discussed
3115 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
3116 * configure.ac (XSLTPROC): New substitution.
3117 * Makefile.am (maintainer-xml-check): New phony target invoking...
3118 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
3119 invoking make maintainer-check with BISON_TEST_XML=1.
3120 * tests/atlocal.in (XSLTPROC): New.
3121 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
3122 not to report reachable memory when Bison is expected to have a
3123 non-zero exit status and (2) to compare XML/XSLT output with --graph
3124 and --report=all output for every working grammar when
3126 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
3127 (AT_BISON_CHECK_XML): New.
3128 (AT_QUELL_VALGRIND): New.
3129 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
3130 (AT_CHECK): ... don't redefine this since this was the old way to
3132 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
3133 AT_BISON_CHECK invocations.
3134 * tests/c++.at: Likewise.
3135 * tests/calc.at: Likewise.
3136 * tests/conflicts.at: Likewise.
3137 * tests/cxx-type.at: Likewise.
3138 * tests/existing.at: Likewise.
3139 * tests/glr-regression.at: Likewise.
3140 * tests/headers.at: Likewise.
3141 * tests/input.at: Likewise.
3142 * tests/java.at: Likewise.
3143 * tests/output.at: Likewise.
3144 * tests/push.at: Likewise.
3145 * tests/reduce.at: Likewise.
3146 * tests/regression.at: Likewise.
3147 * tests/sets.at: Likewise.
3148 * tests/skeletons.at: Likewise.
3149 * tests/synclines.at: Likewise.
3150 * tests/torture.at: Likewise.
3151 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
3152 tends to hang xsltproc.
3153 (Big horizontal): Likewise.
3155 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3157 In XML output, remove redundant class attribute on symbol element.
3158 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
3159 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
3160 look up a symbol to determine whether it's a nonterminal or terminal.
3161 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
3162 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
3164 Add prec/assoc information to XML output.
3165 * src/gram.c (grammar_rules_print_xml): For each rule that has a
3166 %prec, add a percent_prec attribute.
3167 * src/print-xml.c (print_grammar): For each terminal that has a
3168 precedence or associativity, add a prec or assoc attribute.
3170 (xml_puts): Use xml_indent.
3171 (xml_printf): Use xml_indent.
3172 * src/print-xml.h (xml_indent): Prototype.
3174 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
3175 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
3177 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3179 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
3180 (bison:ruleByNumber): ... this for clarity.
3181 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
3182 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
3183 (xsl:template match="reduction"): Update.
3184 (xsl:template match="item"): Update.
3185 (xsl:template match="reduction"): Update.
3187 In the XML output, don't print the list of rules where symbols appear.
3188 Compute it in XSLT instead. Discussed at
3189 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
3190 * data/xslt/bison.xsl (bison:ruleByLhs): New.
3191 (bison:ruleByRhs): New.
3192 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
3194 (xsl:template match="terminal/rule"): Remove.
3195 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3197 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3199 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
3200 bison:ruleByRhs and mode="number-link" for rule template.
3201 (xsl:template match="terminal/rule"): Remove.
3202 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3203 bison:ruleByRhs and mode="number-link" for rule template.
3204 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3206 (xsl:template match="rule" mode="number-link"): ... this.
3207 * src/print-xml.c (print_grammar): Don't print the list of rules.
3209 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
3211 Don't let --report affect XML output; always print all information.
3213 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
3214 * src/conflicts.c (log_resolution): Implement.
3215 * src/print-xml.c (print_core): Implement.
3216 (print_state): Implement.
3217 (print_xml): Implement.
3219 * NEWS (2.3a+): Fix quotes.
3220 * src/parse-gram.y (prologue_declaration): For consistency with -v,
3221 don't let %verbose clear the list specified by --report.
3223 2007-11-26 Akim Demaille <akim@epita.fr>
3225 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
3227 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
3229 In the XML output, list useless and unused symbols and rules with the
3230 useful ones and add a "usefulness" attribute. Discussed starting at
3231 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
3232 * src/gram.c (grammar_rules_partial_print_xml): Remove.
3233 (grammar_rules_print_xml): Print all rules instead of just those
3234 useful in the grammar, and add a "usefulness" attribute.
3235 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
3236 * src/print-xml.c (print_rules_useless_in_parser): Remove.
3237 (print_grammar): Print all nonterminals instead of just useful ones,
3238 and add a "usefulness" attribute to nonterminals and terminals.
3239 (print_xml): Don't print a separate "reductions" or
3240 "rules-useless-in-parser" element.
3241 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
3242 (reduce_xml): Remove.
3243 (reduce_token_unused_in_grammar): New.
3244 (reduce_nonterminal_useless_in_grammar): New.
3245 * src/reduce.h (reduce_xml): Remove prototype.
3246 (reduce_token_unused_in_grammar): Add prototype.
3247 (reduce_nonterminal_useless_in_grammar): Add prototype.
3248 * data/xslt/xml2text.xsl: Update for XML changes.
3249 * data/xslt/xml2xhtml.xsl: Update for XML changes.
3250 * tests/reduce.at (Useless Terminals): Update output.
3251 (Useless Rules): Update output.
3252 (Reduced Automaton): Update output.
3254 Say "Terminals unused in grammar" instead of "Unused terminals".
3255 * NEWS (2.3a+): Update.
3256 * doc/bison.texinfo (Understanding): Update example output.
3257 * src/reduce.c (reduce_output): Implement.
3258 * data/xslt/xml2text.xsl: Implement.
3259 * data/xslt/xml2xhtml.xsl: Implement.
3261 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
3263 Accept --report-file=FILE to override the default `.output' filename.
3264 * NEWS (2.3a+): Mention.
3265 * doc/bison.texinfo (Bison Options): Add an entry.
3266 * src/files.c (compute_output_file_names): Don't override
3267 spec_verbose_file if already set.
3268 * src/getargs.c (usage): Document --report-file.
3269 (REPORT_FILE_OPTION): New anonymous enum member.
3270 (long_options): Add entry for it.
3271 (getargs): Add case for it setting spec_verbose_file.
3273 * build-aux/cross-options.pl: Don't record a short option just because
3275 * doc/.cvsignore: Add yacc.1.
3277 2007-11-14 Akim Demaille <akim@epita.fr>
3279 * doc/yacc.1.in: New.
3280 * configure.ac, doc/Makefile.am: Adjust.
3281 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
3283 Use AC_SUBST for assignments too.
3284 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
3286 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
3288 * src/gram.c: Remove comments that duplicate comments in gram.h.
3290 When reporting useless rules and nonterminals, say "useless in grammar"
3291 instead of "useless", and say "useless in parser" instead of "never
3292 reduced". Discussed starting at
3293 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
3294 * NEWS (2.3a+): Mention this change.
3295 * data/xslt/xml2text.xsl: Update output text and expected input XML
3296 element names to match changes below.
3297 * data/xslt/xml2xhtml.xsl: Likewise.
3298 (xsl:template match="bison-xml-report"): Add missing entry in Table of
3299 Contents: "Rules useless in parser due to conflicts".
3300 * doc/bison.texinfo (Decl Summary): Reword a little.
3301 (Understanding): Update example output for changes below.
3302 * src/gram.c: (rule_useful_p): Rename to...
3303 (rule_useful_in_grammar_p): ... this.
3304 (rule_useless_p): Rename to...
3305 (rule_useless_in_grammar_p): ... this.
3306 (rule_never_reduced_p): Rename to...
3307 (rule_useless_in_parser_p): ... this.
3308 (grammar_rules_print): Update for renames.
3309 (grammar_rules_print_xml): Update for renames.
3310 (grammar_rules_never_reduced_report): Rename to...
3311 (grammar_rules_useless_report): ... this since it is used for either
3312 kind of useless rule.
3313 * src/gram.h: Reword comments and update function names in prototypes.
3314 * src/main.c (main): Say "rule useless in parser due to conflicts".
3315 * src/print-xml.c (print_rules_never_reduced): Rename to...
3316 (print_rules_useless_in_parser): ... this, and rename output XML
3317 element "rules-never-reduced" to "rules-useless-in-parser".
3318 (print_xml): Update for rename.
3319 * src/print.c (print_results): Say "Rules useless in parser due to
3321 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
3322 (nonterminals_reduce): Say "nonterminal useless in grammar".
3323 (reduce_output): Say "Nonterminals useless in grammar".
3324 Say "Rules useless in grammar".
3325 (reduce_xml): Rename output XML element "useless" to
3326 "useless-in-grammar".
3327 (reduce_print): Don't report the count of grammatically useless rules
3328 as "rules never reduced" just because %yacc is specified.
3329 In the correct report of this count, say nonterminal(s) and rule(s)
3330 "useless in grammar".
3331 * tests/conflicts.at (S/R in initial): Update expected output.
3332 (Defaulted Conflicted Reduction): Likewise.
3333 (Unreachable States After Conflict Resolution): Likewise.
3334 * tests/existing.at (GNU pic Grammar): Likewise.
3335 * tests/reduce.at (Useless Nonterminals): Likewise.
3336 (Useless Rules): Likewise.
3337 (Reduced Automaton): Likewise.
3338 (Underivable Rules): Likewise.
3339 (Empty Language): Likewise.
3341 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
3343 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
3344 here document and before the EOF so that BSD's implementation of Bourne
3345 shell doesn't parse the delimiter as part of the here document.
3346 * doc/.cvsignore: Add cross-options.texi.
3347 * src/getargs.c (usage): Add a blank line after the warning categories.
3349 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
3351 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
3353 2007-11-05 Akim Demaille <akim@epita.fr>
3355 Remove Id: from bison.1.
3356 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
3357 (perl -0777 -pi -e 's/\.PP\nId): New.
3358 (.x.1): Use it to ignore the version control revision.
3360 2007-11-05 Akim Demaille <demaille@gostai.com>
3362 * build-aux/Makefile.am: Ship cross-options.pl.
3363 * doc/Makefile.am: Always refer to cross-options.texi with
3365 (MAINTAINERCLEANFILES): Add it.
3367 2007-11-04 Akim Demaille <demaille@gostai.com>
3369 Generate the long/short option cross-table.
3370 * build-aux/cross-options.pl: New.
3371 * doc/Makefile.am (cross-options.texi): New.
3372 * doc/bison.texinfo: Use it.
3374 2007-11-04 Akim Demaille <demaille@gostai.com>
3376 Generate bison.1 using help2man.
3377 * doc/common.x, doc/bison.x: New.
3378 * doc/Makefile.am (bison.1, .x.1): New.
3379 The code is taken from autoconf-2.61/man/Makefile.am.
3380 * configure.ac: Look for help2man.
3382 2007-11-04 Akim Demaille <demaille@gostai.com>
3385 * src/getargs.c (usage): Document -W, make it clear that -d,
3386 -g and -x have optional arguments.
3388 2007-11-04 Akim Demaille <demaille@gostai.com>
3390 Find sha1sum when named gsha1sum.
3391 * bootstrap (find_tool): New.
3394 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3396 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
3398 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
3399 * NEWS (2.3a+): Mention.
3400 * data/bison.m4 (b4_pure_if): Don't define it here.
3401 * data/c.m4 (b4_identification): Depend on individual skeletons to
3402 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
3403 values of the %define variables api.pure or api.push_pull. Define
3404 YYPURE, YYPUSH, and YYPULL accordingly.
3405 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
3406 glr.cc has already defined b4_pure_flag.
3407 * data/push.c: Define b4_pure_if based on `%define api.pure'.
3408 Remove YYPUSH and YYPULL since they're back in b4_identification again.
3409 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
3410 * doc/bison.texinfo (Pure Decl): Update.
3411 (Push Decl): Update.
3412 (Decl Summary): Add api.pure to %define entry.
3413 In %pure-parser entry, say it's deprecated and reference %define.
3414 (Pure Calling): Update.
3415 (Error Reporting): Update.
3416 (C++ Scanner Interface): Update.
3417 (How Can I Reset the Parser): Update.
3418 (Table of Symbols): In %pure-parser entry, say it's deprecated and
3420 * src/getargs.c (pure_parser): Remove global variable.
3421 * src/getargs.h (pure_parser): Remove extern.
3422 * src/output.c (prepare): Don't define pure_flag muscle.
3423 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
3424 wrapper around `%define api.pure'.
3425 * tests/calc.at (Simple LALR Calculator): Update.
3426 (Simple GLR Calculator): Update.
3427 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
3429 (GLR: Resolve ambiguity, pure, locations): Update.
3430 (GLR: Merge conflicting parses, pure, no locations): Update.
3431 (GLR: Merge conflicting parses, pure, locations): Update.
3432 * tests/glr-regression.at (Uninitialized location when reporting
3434 * tests/input.at (Unused %define api.pure): New test case.
3435 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
3436 AT_PURE_IF and AT_PURE_AND_LOC_IF.
3437 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
3439 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3441 %define push_pull -> %define api.push_pull. Discussed starting at
3442 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
3443 * data/push.c: Expect the new name.
3444 * data/yacc.c: Likewise.
3445 * doc/bison.texinfo (Push Decl): Update.
3446 (Decl Summary): Update %define entry.
3447 (Push Parser Function): Update.
3448 (Pull Parser Function): Update.
3449 (Parser Create Function): Update.
3450 (Parser Delete Function): Update.
3451 * tests/calc.at (Simple LALR Calculator): Update.
3452 * tests/input.at (%define enum variables): Update.
3453 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
3454 (Push Parsing: Multiple impure instances): Update.
3455 (Push Parsing: Unsupported Skeletons): Update.
3456 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
3457 (Exploding the Stack Size with Malloc): Update.
3459 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
3462 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
3464 For the XML output's terminal element, rename @number to @token-number,
3465 and add @symbol-number. In the nonterminal element, rename @number to
3466 @symbol-number. Discussed starting at
3467 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
3468 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
3470 (xsl:template match="nonterminal"): Likewise.
3471 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
3472 (xsl:template match="nonterminal"): Likewise.
3473 * src/print-xml.c (print_grammar): Implement.
3475 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3477 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
3478 2007-10-11 change, the child elements here are items not rules.
3479 (xsl:template match="item"): New.
3480 (xsl:template match="rule"): Update for new reduced itemset.
3481 (xsl:template match="point"): Remove.
3482 (xsl:template match="empty"): For consistency with --graph, don't
3483 output "/* empty */".
3484 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
3485 line-wrap, don't pass a negative value as first-line-length since this
3486 won't work with the following changes.
3487 (xsl:template name="line-wrap"): Simplify slightly.
3488 (xsl:template name="ws-search"): Eliminate recursion.
3489 * src/print_graph.c (print_core): Don't print a reduction's lookahead
3490 set next to an item whose dot is not at the end of the RHS even if it
3491 happens to be associated with the same rule.
3493 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
3495 Add %define lr.keep_unreachable_states.
3496 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
3497 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
3498 * src/main.c (main): Implement it.
3499 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3500 Extend to test it, and fix a typo.
3502 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
3504 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
3505 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
3506 the example .output text.
3507 * tests/regression.at (Extra lookahead sets in report): Improve wording
3510 2007-10-17 Wojciech Polak <polak@gnu.org>
3512 * src/print-xml.c (print_grammar): Renamed
3513 <terminal> and <nonterminal> attributes:
3514 "type" to "number" and "symbol" to "name".
3515 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
3516 Use new attribute names.
3517 (xsl:template match="nonterminal"): Likewise.
3518 * data/xslt/xml2xhtml.xsl: Likewise.
3520 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
3522 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
3523 (Option Cross Key): Likewise.
3525 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
3526 next to an item whose dot is not at the end of the RHS even if it
3527 happens to be associated with the same rule.
3528 * src/print.c (print_core): Likewise.
3529 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
3530 (Resolved SR Conflicts): Update output.
3531 * tests/regression.at (Extra lookahead sets in report): New test case.
3533 2007-10-11 Wojciech Polak <polak@gnu.org>
3535 * src/print-xml.c (print_core): Remove item set
3537 * data/xslt/bison.xsl (bison:ruleNumber): New key.
3538 Improve processing time. Suggested by Joel E. Denny.
3539 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
3540 Write xsl:param "required" attribute as comment.
3541 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
3542 (xsl:template match="rule"): Support new reduced itemset.
3543 (xsl:template match="point"): Remove.
3544 * data/xslt/xml2xhtml.xsl: Likewise.
3546 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
3548 * src/getargs.c (version): Update copyright year.
3550 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
3552 Make xml2dot.xsl and --graph produce the same output.
3553 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a ` '
3554 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
3556 (xsl:template name="output-node"): Use the new escape template instead
3557 of the string-replace template directly.
3558 (xsl:template name="output-edge"): Likewise.
3559 (xsl:template name="escape"): New, escapes backslashes and newlines in
3560 addition to quotation marks.
3561 * src/graphviz.c (start_graph, output_node, output_edge): Add
3562 whitespace to output for legibility.
3564 Make xml2text.xsl and --report produce the same output, and remove the
3565 XML "conflicts" element since a conflict summary is easily extracted
3567 * data/xslt/bison.xsl: New.
3568 (xsl:template match="state" mode="bison:count-conflicts): New.
3569 * data/xslt/xml2text.xsl: Import bison.xsl.
3570 (xsl:template match="bison-xml-report"): Instead of styling the
3571 "conflicts" element, style the "automaton" element with mode
3572 "conflicts". Unlike the former, the latter lists S/R and R/R
3573 conflicts for a state on the same line.
3574 (xsl:template match="conflicts"): Remove.
3575 (xsl:template match="conflict"): Remove.
3576 (xsl:template match="terminal"): Line-wrap the list of rules in which
3577 the terminal is used.
3578 (xsl:template match="nonterminal"): Likewise for nonterminals.
3579 (xsl:template match="automaton" mode="conflicts"): New.
3580 (xsl:template match="state" mode="conflicts"): New.
3581 (xsl:template name="line-wrap"): New.
3582 (xsl:template name="ws-search"): New.
3583 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
3584 (xsl:template match="bison-xml-report"): Instead of styling the
3585 "conflicts" element, style the "automaton" element with mode
3587 (xsl:template match="conflicts"): Remove.
3588 (xsl:template match="conflict"): Remove.
3589 (xsl:template match="automaton" mode="conflicts"): New.
3590 (xsl:template match="state" mode="conflicts): New.
3591 * src/conflicts.c (conflicts_output_xml): Remove.
3592 * src/conflicts.h (conflicts_output_xml): Remove prototype.
3593 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
3594 * src/print.c (print_grammar): Consistently wrap at the 66th column so
3595 the corresponding XSLT is easier. Also, never wrap between a word and
3596 the comma that follows it.
3598 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
3600 Improve C++ namespace support. Discussed starting at
3601 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
3602 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
3603 b4_namespace_close): New macros that interpret the %define variable
3604 "namespace" so its value can contain "::" to indicate nested
3606 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
3608 * data/lalr1.cc (b4_namespace): Likewise.
3609 * data/location.cc (b4_namespace): Likewise.
3610 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
3611 inside a new table in the general %define entry. Document `%define
3612 namespace' there as well. Point the %name-prefix entry to it since it
3613 explains it more completely in the case of C++.
3614 (C++ Bison Interface): Mention `%define namespace' instead of
3616 (Table of Symbols): Remove the `%define push_pull' entry. The %define
3618 * tests/c++.at (Relative namespace references): New test case.
3619 (Absolute namespace references): New test case.
3620 (Syntactically invalid namespace references): New test case.
3621 * tests/input.at (C++ namespace reference errors): New test case.
3623 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
3625 Add syncline support and location accessor to internal %define
3627 * data/bison.m4 (b4_percent_define_get_loc): New.
3628 (b4_percent_define_get_syncline): New.
3629 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
3630 (b4_percent_define_default): Record defining location as line 1 rather
3631 than 0 for the sake of synchronizing #line's, and define
3632 b4_percent_define_syncline(VARIABLE).
3633 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
3634 * src/muscle_tab.c (muscle_syncline_grow): New.
3635 (muscle_code_grow): Use muscle_syncline_grow.
3636 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
3637 define b4_percent_define_syncline(VARIABLE).
3638 (muscle_percent_define_get_loc): New.
3639 (muscle_percent_define_get_syncline): New.
3640 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
3641 remove some unused variables.
3642 (muscle_percent_define_default): Record defining location as line 1
3643 rather than 0 for the sake of synchronizing #line's, and define
3644 b4_percent_define_syncline(VARIABLE).
3645 (muscle_percent_define_check_values): Use
3646 muscle_percent_define_get_loc.
3647 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
3648 (muscle_percent_define_get_syncline): Prototype.
3649 * tests/skeletons.at (%define Boolean variables: invalid skeleton
3650 defaults): Update output for location change.
3651 (Complaining during macro argument expansion): Extend to test
3652 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
3654 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
3656 Fix some error-reporting macro bugs.
3657 * data/bison.m4 (b4_cat): New.
3658 (b4_error, b4_error_at): Use b4_cat to send error directives directly
3659 to stdout so they don't become arguments to other macros. Update
3660 comments and add examples.
3661 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
3663 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
3664 after printing the error directive so that M4 doesn't report subsequent
3665 problems that are induced by this problem.
3666 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
3667 instead of just in them. Recognize @\n in both places. Both expand to
3668 the empty string. Needed by b4_cat.
3669 * tests/skeletons.at (Complaining during macro argument expansion):
3671 (Fatal errors make M4 exit immediately): New test case.
3673 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
3675 Implement --print-datadir.
3676 * src/getargs.c (usage): Mention.
3677 (PRINT_DATADIR_OPTION): New anonymous enum member.
3678 (long_options): Add entry for it.
3679 (getargs): Add case for it calling compute_pkgdatadir.
3680 * src/output.c (output_skeleton): Encapsulate data directory
3681 computation from here...
3682 (prepare): ... and from here...
3683 (compute_pkgdatadir): ... into this new function.
3684 * src/output.h (compute_pkgdatadir): Prototype.
3686 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
3688 * src/print-xml.c (escape_bufs): New static global variable
3690 (xml_escape_n): ... the static local variable buf here.
3691 (print_xml): Free memory for escape_bufs.
3692 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
3694 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
3696 Replace `%push-parser' and `%push-pull-parser' with
3697 `%define push_pull "push"' and `%define push_pull "both"'.
3698 `%define push_pull "pull"' is the default.
3699 * doc/bison.texinfo (Push Decl, Push Parser Function,
3700 Pull Parser Function, Parser Create Function, Parser Delete Function):
3701 Update declarations.
3702 (Decl Summary, Table of Symbols): Replace %push-parser and
3703 %push-pull-parser entries with a %define push_pull entry.
3704 * data/bison.m4 (b4_percent_define_check_values): New macro.
3705 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
3707 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
3709 * data/push.c: ... to here and compute them from the value of the
3710 %define variable push_pull.
3711 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
3712 parsing requests here...
3713 * data/yacc.c: ... hack this to switch to push.c any time
3714 b4_use_push_pull_flag or the %define variable push_pull is set. This
3715 will go away when we mv push.c yacc.c.
3716 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
3717 push parsing is not supported since unused %define variables are
3719 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
3720 * src/muscle_tab.h (muscle_percent_define_check_values): Update
3721 comments for consistency with b4_percent_define_check_values.
3722 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
3724 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
3726 (prologue_declaration): Remove %push-parser and %push-pull-parser
3728 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
3729 * tests/calc.at: Update declarations.
3730 * tests/input.at (%define enum variables): New test case.
3731 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
3733 (Push Parsing: Multiple impure instances): Update declaration.
3734 (Push Parsing: Unsupported Skeletons): New test case.
3735 * tests/torture.at (Exploding the Stack Size with Alloca): Update
3737 (Exploding the Stack Size with Malloc): Update declaration.
3739 2007-09-24 Wojciech Polak <polak@gnu.org>
3741 Add XSLT transformations.
3743 * data/xslt/xml2dot.xsl: Transform XML into DOT.
3744 * data/xslt/xml2text.xsl: Transform XML into plain text.
3745 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
3746 * data/Makefile.am (xsltdir): New variable.
3747 (dist_xslt_DATA): Add xslt/*.xsl files.
3749 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
3751 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
3752 Problem reported by Wojciech Polak.
3753 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
3754 (xml_printf): Undo change I made on 21 September; that is,
3755 indent 2 spaces, not 1.
3757 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
3759 Pacify ./configure --enable-gcc-warnings.
3760 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
3761 `char const *' instead of `char *'.
3762 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
3763 local variable `sep'.
3765 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
3767 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
3769 * src/print-xml.c: Prefer "const" after types; that's more consistent.
3770 (xml_printf): Indent just 1 space for level.
3771 (e_char, xlate_char): Remove.
3772 (xml_escape_string): Rewrite to avoid undefined behavior (used
3773 storage that was freed from the stack).
3774 (xml_escape_n): Don't bother checking for subscript error.
3776 2007-09-21 Wojciech Polak <polak@gnu.org>
3778 Add Bison XML Automaton Report.
3780 Add support for an -x option to generate an XML report.
3781 It is not documented yet.
3782 * src/print-xml.c: New file.
3783 * src/print-xml.h: Likewise.
3784 * lib/timevar.def (TV_XML): New var.
3785 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
3786 * src/conflicts.c: Include print-xml.h.
3787 (solved_conflicts_xml_obstack): New var.
3788 (log_resolution, conflicts_solve, conflicts_free):
3789 Add support for XML report.
3790 (conflicts_output_val): New function.
3791 * src/conflicts.h (conflicts_output_val): New decl.
3792 * src/files.c (spec_xml_file): New var.
3793 (compute_output_file_names, output_file_names_free): Add XML support.
3794 * src/files.h (spec_xml_file): New decl.
3795 * src/getargs.c (xml_flag): New var.
3796 (usage, short_options, long_options, getargs): Add XML support.
3797 * src/getargs.h (xml_flag): New decl.
3798 * src/gram.c: Include print-xml.h.
3799 (rule_lhs_print_xml, rule_rhs_print_xml):
3800 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
3802 * src/gram.h: Declare external ones.
3803 * src/main.c: Include print-xml.h.
3804 (main): Add XML support.
3805 * src/reduce.c: Include print-xml.h.
3806 (reduce_xml): New function.
3807 * src/reduce.h: Declare it.
3808 * src/state.c: Include print-xml.h.
3809 (state_new): Add XML support.
3810 (state_rule_lookahead_tokens_print_xml): New function.
3811 * src/state.h: Declare it.
3812 (struct state): New member solved_conflicts_xml.
3813 * src/symtab.c (symbol_class_get_string): New function.
3814 * src/symtab.h: Declare it.
3816 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
3818 * GNUmakefile: Switch to coreutils's version.
3819 * bootstrap: Likewise.
3820 * Makefile.cfg: Adjust to new GNUmakefile.
3821 * README-hacking: Likewise.
3825 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
3826 Bruno Haible <bruno@clisp.org>
3828 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
3829 and is a script that invokes bison. Tighten the code. Add comments.
3831 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
3833 Spell "boolean" as "Boolean". Reported by Akim Demaille.
3834 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
3835 * doc/bison.texinfo (Decl Summary): Fix.
3836 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
3837 * tests/input.at (Boolean %define variables): Update output.
3838 * tests/skeletons.at (%define boolean variables: invalid skeleton
3839 defaults): Rename to...
3840 (%define Boolean variables: invalid skeleton defaults): ... this and
3843 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
3845 In impure push mode, don't allow more than one yypstate to be allocated
3846 since multiple impure parsers would corrupt yynerrs.
3847 * data/push.c (yypstate_allocated): New static global variable
3849 (yypull_parse): If yypstate_new returns 0, don't report it as memory
3850 exhaustion if yypstate_allocated is 1, but still return 2.
3851 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
3852 already 1. Otherwise, set it to 1.
3853 (yypstate_delete): Set it to 0.
3854 * tests/push.at (Push Parsing: Multiple impure instances): New test
3857 2007-08-17 Bob Rossi <bob@brasko.net>
3859 * doc/bison.texinfo (Push Decl): Document the push parser.
3860 (Table of Symbols): Ditto.
3862 (Decl Summary): Ditto.
3863 (Multiple Parsers, Push Parser Function, Pull Parser Function,
3864 Parser Create Function, Parser Delete Function):
3865 Add new push parser symbols.
3866 (Table of Symbols): Document push-parser, push-pull-parser,
3867 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
3869 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
3872 * doc/gpl-3.0.texi: New file.
3873 * doc/gpl.texi: Remove.
3874 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
3875 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
3876 * README-hacking, TODO, bootstrap, bootstrap.conf:
3877 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
3878 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
3879 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
3880 * data/lalr1.cc, data/lalr1.java, data/location.cc:
3881 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
3882 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
3883 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
3884 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
3885 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
3886 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
3887 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
3888 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
3889 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
3890 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
3891 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
3892 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
3893 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
3894 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
3895 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
3896 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
3897 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
3898 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
3899 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
3900 * src/complain.c, src/complain.h, src/conflicts.c:
3901 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
3902 * src/files.h, src/flex-scanner.h, src/getargs.c:
3903 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
3904 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
3905 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
3906 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
3907 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
3908 * src/print.c, src/print.h, src/print_graph.c:
3909 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
3910 * src/reduce.h, src/relation.c, src/relation.h:
3911 * src/revision.h, src/scan-code.h, src/scan-code.l:
3912 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
3913 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
3914 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
3915 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
3916 * tests/Makefile.am, tests/actions.at, tests/c++.at:
3917 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
3918 * tests/existing.at, tests/glr-regression.at:
3919 * tests/headers.at, tests/input.at, tests/java.at:
3920 * tests/local.at, tests/output.at, tests/push.at:
3921 * tests/reduce.at, tests/regression.at, tests/sets.at:
3922 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
3926 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
3928 Get rid of broken %no-parser, -n, and --no-parser implementation and
3930 * TODO: Don't mention them.
3931 * doc/bison.1: Likewise.
3932 * doc/bison.texinfo (Decl Summary): Likewise.
3933 (Bison Options): Likewise.
3934 (Option Cross Key): Likewise.
3935 * src/getargs.c (no_parser_flag): Remove global variable.
3936 (usage): Don't print description of -n and --no-parser.
3937 (long_options): Remove --no-parser entry here.
3938 (getargs): Remove -n case in the switch here.
3939 * src/getargs.h (no_parser_flag): Remove extern.
3940 * tests/regression.at (Web2c Actions): Remove comment that mentions
3943 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
3945 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
3946 name user variables starting with `yy'. Just pass NULL instead of a
3947 dummy local &yylval to yypush_parse.
3948 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
3951 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
3953 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
3954 true since it's then always used regardless of whether yyoverflow is
3955 defined. Reported by Christian Burger at
3956 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
3957 * THANKS: Add Christian Burger.
3959 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3960 node names: say "Decl Summary" not "Bison Declaration Summary".
3962 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
3964 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
3965 determine whether this function has already complained about an invalid
3966 value for a %define boolean variable, don't check whether Bison has
3967 ever examined the value. As written, the check was a tautology.
3968 Instead, record and check for this complaint using a separate muscle.
3970 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3972 Fix push parsing memory leak reported by Brandon Lucia at
3973 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
3974 * THANKS: Add Brandon Lucia.
3975 * data/push.c (yypstate_delete): Free the stack if it was reallocated
3976 but the parse never completed and thus freed it.
3977 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
3978 * tests/testsuite.at: Include push.at.
3979 * test/push.at: New.
3980 (Push Parsing: Memory Leak for Early Deletion): New test case.
3982 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
3984 Improve handling of multiple S/R conflicts in the same state and of S/R
3985 conflicts involving multiple reductions.
3986 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
3987 set for a state here or Bison will abort if it is reassigned on a
3988 later conflicted reduction in the same state.
3989 Similarly, don't finalize and assign the solved conflicts report here
3990 or it will be lost if it is reassigned on a later conflicted reduction
3992 (set_conflicts): Instead, assign them both here after all S/R conflicts
3993 in the state have been fully examined.
3994 * src/print.c (shift_set): Rename to...
3995 (no_reduce_set): ... this.
3996 (print_reductions): Update for rename, and add %nonassoc error action
3997 tokens to no_reduce_set so that, when printing the first remaining
3998 reduction on an error action token, the reduction is enclosed in
4000 (print_results): Update for rename.
4001 * tests/conflicts.at (Solved conflicts report for multiple reductions
4002 in a state): New test case.
4003 (%nonassoc error actions for multiple reductions in a state): New test
4006 * src/main.c (main): Don't depend on C99 features.
4008 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4010 * build-aux/.cvsignore: Add compile.
4011 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
4014 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
4016 * bootstrap (slurp): Create target directories that don't exist.
4017 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
4019 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
4021 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
4023 * closure.c (closure): Likewise.
4024 * state.h (reductions): Comment sorting of rules.
4025 (state): Comment sorting of items.
4027 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
4029 Fix C++ test cases after recent Gnulib changes. Discussed starting at
4030 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
4031 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
4032 definition in order to avoid Gnulib headers since we don't use config.h
4034 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
4035 rather than AT_DATA so that config.h is included.
4037 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
4039 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
4040 instead of fprintf. Guard these functions with #if YYDEBUG instead of
4041 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
4042 and so that YYFPRINTF is guaranteed to be defined here.
4044 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4046 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
4048 (muscle_percent_define_check_values): ... this more helpful function.
4049 Again, it's not used yet, but it will be.
4050 * src/muscle_tab.h: Likewise.
4052 Improve some comments in parser table construction.
4053 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
4054 (generate_states): Don't mention ruleset, which is internal to closure.
4055 * src/closure.c (closure): Explain sorting of core and itemset, which
4056 is required for this function to behave correctly.
4057 * src/closure.h (closure): Mention sorting.
4059 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
4061 * src/lalr.c (state_lookahead_tokens_count): For code readability,
4062 move the check for disabled transitions to an aver since conflict
4063 resolution hasn't happened yet.
4065 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
4066 labels a state as inconsistent just because it has error transitions.
4067 The original form of this check appeared in revision 1.1 of lalr.c,
4068 which was committed on 1991-12-21. Now (at least), changing the
4069 consistency label on such a state appears to have no useful effect in
4070 any of the places it is examined, which I enumerate below. The key
4071 point to understanding each item in this enumeration is that a state
4072 with an error transition is labelled consistent in the first place only
4073 if it has no rules, so the check cannot matter for states that have
4074 rules. (1) Labelling a state as inconsistent will cause set_conflicts
4075 to try to identify its conflicts, and a state must have *rules* to have
4076 conflicts. (2) Labelling a state as inconsistent will affect how
4077 action_row sets the default *rule* for the state. (3) Labelling a
4078 state as inconsistent will cause build_relations to add lookback edges
4079 to *rules* in that state.
4080 * src/state.h (struct state): Word the comment for member consistent
4083 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4085 Don't depend on C99 features.
4086 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
4087 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
4088 * src/reader.c (check_and_convert_grammar): Fix for-loop.
4089 * src/state.c (state_mark_reachable_states): Fix for-loop.
4090 (state_remove_unreachable_states): Fix for-loop.
4092 Don't widen struct state with member reachable just to temporarily
4093 record reachability. Instead, use a local bitset.
4094 * src/state.h (struct state): Remove member.
4095 * src/state.c (state_new): Don't initialize it.
4096 (state_mark_reachable_states): Rename to...
4097 (state_record_reachable_states): ... this, and use bitset.
4098 (state_remove_unreachable_states): Use bitset.
4100 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
4102 * src/Makefile.am (yacc): Quote target action commands properly so
4103 that the yacc script isn't corrupt. Reported by Hans Aberg at
4104 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
4106 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
4107 the case of pure parsers. Reported by Frans Englich at
4108 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
4109 * THANKS: Add Frans Englich.
4111 * NEWS (2.3a+): In the %code entry, reference section `Bison
4112 Declaration Summary' from the manual now since the %code summary has
4114 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
4115 in the rules section must be terminated by semicolons.
4117 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
4119 Extend the front-end API for %define variables to more completely
4120 mirror the back-end. This will be useful in the future.
4121 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
4122 Update comments to mention the new front-end counterparts of these
4124 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
4125 for muscle_string_decode and muscle_location_decode.
4126 (muscle_string_decode): New static function.
4127 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
4128 (muscle_percent_define_get, muscle_percent_define_ifdef): New
4130 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
4131 muscle_percent_define_get to mimic the b4_percent_define_flag_if
4132 implementation more closely.
4133 (muscle_percent_define_invalid_value): New function.
4134 * src/muscle_tab.h (muscle_percent_define_get,
4135 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
4138 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4140 * NEWS (2.3a+): Mention yesterday's state-removal change.
4141 (2.3a): Remove the %language entry, which was added after 2.3a.
4142 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
4143 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
4144 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
4145 tests/existing.at: Update copyright date.
4147 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4149 If conflict resolution makes states unreachable, remove those states,
4150 report rules that are then unused, and don't report conflicts in those
4152 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
4153 New global function.
4154 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
4156 * src/main.c (main): After conflict resolution, remove the unreachable
4157 states and update all data structures that reference states by number.
4158 * src/state.c (state_new): Initialize each state's reachable member to
4160 (state_mark_reachable_states): New static function.
4161 (state_remove_unreachable_states): New global function.
4162 * src/state.h (struct state): Add member bool reachable.
4163 (state_remove_unreachable_states): Prototype.
4164 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4166 * tests/existing.at (GNU pic Grammar): Update test case output now that
4167 an unused rule is discovered.
4169 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4171 Minor code cleanup in parser table construction.
4172 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
4173 (new_itemsets, save_reductions): Update for rename to nitemset.
4174 * src/closure.c (nritemset): Rename to...
4175 (nitemset): ... this since the "r" appears to meaningless and isn't
4176 used in the comments.
4177 (closure): Update for rename.
4178 * src/closure.h (nritemset): Update extern to...
4179 (nitemset): ... this.
4180 * src/lalr.c (LA): Fix a typo in comments.
4181 * src/print.c (print_core): Update for rename to nitemset.
4182 * src/print_graph.c (print_graph): Likewise.
4183 * src/state.h: Fix some typos in header comments.
4185 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
4187 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
4188 still sticks to ASCII. Sorry!
4190 * README-hacking: New file, taken mostly from coreutils, with changes
4191 for Bison. Contains much of the contents of:
4192 * README-cvs: Remove.
4193 * bootstrap: Sync from gnulib.
4194 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
4195 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
4197 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
4199 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
4201 (Java Differences): Fix some typos.
4202 * THANKS: Add Sebastian Setzer.
4204 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
4206 * data/java.m4 (b4_single_class_if): Remove.
4207 (b4_abstract_if): Look at "%define abstract".
4209 (b4_union_name): Rename...
4210 (b4_yystype): ... to this. Map to "%define stype".
4211 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
4212 b4_maybe_throws): Fix quoting.
4213 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
4214 * data/lalr1.java (Lexer interface): Always define.
4215 (Lexer interface within parser class): Remove.
4216 (YYLexer class): New, used when "%code lexer" is present.
4217 (constructor): When "%code lexer" is used, pass %lex-param
4218 to the lexer constructor.
4219 (yylex, yyparse): Remove %lex-param from method invocations
4220 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
4222 * doc/bison.texinfo (Java Bison Interface): Mention "%define
4223 abstract". Rename "%define union_name" to "%define stype".
4224 Rename method names according to previous patch.
4225 (Java Scanner Interface): Describe "%code lexer" instead of
4226 "%pure-parser" and "%define single_class".
4227 (Java Differences): Mention "%code lexer".
4229 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
4230 Include scanner here, using macros from tests/local.at.
4231 (AT_DATA_CALC_Y): Remove final argument.
4232 (_AT_CHECK_JAVA_CALC): Likewise.
4233 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
4234 of %locations and %error-verbose.
4235 (main): Test with and without %lex-param.
4236 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
4237 (AT_BISON_OPTION_POPDEFS): Pop it.
4239 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4241 DJGPP spefic issue. Inhibit the use of disallowed characters for
4242 file name genertion on Win98, WinXP, etc. These are |<>":?*\
4243 and concern testsuite case 46.
4244 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
4245 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
4246 * djgpp/config.bat: Inhibit the use of disallowed characters.
4248 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4250 Miscellaneous %define and %code cleanup.
4251 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
4252 values are interpreted.
4253 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
4254 documentation a little more.
4255 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
4256 muscle_percent_define_insert, muscle_percent_code_grow): New
4258 * src/muscle_tab.h (muscle_percent_define_insert,
4259 muscle_percent_code_grow): Prototype.
4260 * src/parse-gram.y (prologue_declaration): Use
4261 muscle_percent_define_insert and muscle_percent_code_grow when parsing
4262 %define and %code directives.
4264 Make it easy to share %define boolean variables between the front-end
4265 and back-end. Though not used yet, this will be useful in the future.
4266 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
4267 Bison uses of names rather than just skeleton uses of names.
4268 (b4_percent_define_get, b4_percent_define_ifdef): Rename
4269 b4_percent_define_skeleton_variables(VARIABLE) to
4270 b4_percent_define_bison_variables(VARIABLE).
4271 (b4_percent_code_get, b4_percent_code_ifdef): Rename
4272 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
4273 b4_percent_code_bison_qualifiers(QUALIFIER).
4274 (b4_check_user_names_wrap): Update for renames.
4275 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
4276 muscle_percent_define_default): New functions mimicking
4277 b4_percent_define_flag_if and b4_percent_define_default.
4279 For %define variables, report locations for invalid values and
4281 * data/bison.m4 (b4_percent_define_flag_if): Read
4282 b4_percent_define_loc(VARIABLE) to report the location of an invalid
4284 (b4_percent_define_default): Save a special location in
4285 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
4286 must later be reported as invalid.
4287 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
4289 (muscle_percent_define_insert): Record the location of VARIABLE in
4290 muscle percent_define_loc(VARIABLE), and use it to report the previous
4291 location for a redefinition.
4292 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
4293 (muscle_percent_define_default): Update like b4_percent_define_default.
4294 (muscle_grow_user_name_list): Rename to...
4295 (muscle_user_name_list_grow): ... this for consistency and use
4296 muscle_location_grow.
4297 * src/muscle_tab.h (muscle_location_grow): Prototype.
4298 * tests/input.at (%define errors): Update expected output.
4299 * tests/skeletons.at (%define boolean variables: invalid skeleton
4300 defaults): New test case.
4302 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
4304 * src/print.c (lookahead_set, state_default_rule): Remove.
4305 (print_reductions): Replace state_default_rule invocation with
4306 equivalent use of yydefact, which was computed in token_actions in
4308 (print_results): Don't allocate lookahead_set.
4310 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
4312 * data/lalr1.java: Prefix all private members with yy.
4314 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
4316 Use YYFPRINTF instead of fprintf where appropriate. Reported by
4317 Sebastien Fricker at
4318 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
4319 * THANKS: Add Sebastien Fricker.
4320 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
4321 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
4322 accept a variable number of arguments.
4324 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
4326 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
4328 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4330 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
4331 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
4332 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
4334 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
4336 Undo my 2007-02-07 change, switching back to the c-strcase module
4337 introduced in the 2007-02-03 change. Bruno Haible reported that
4338 the 2007-02-07 change would be dangerous in Turkish if we add a
4339 language whose name contains "i", since "i" is not lowercase "I"
4341 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
4342 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
4343 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
4344 * m4/.cvsignore: Remove strcase.m4.
4345 * src/getargs.c: Revert 2007-02-07 change, as follows.
4346 Include c-strcase.h.
4347 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
4349 2007-02-11 Bruno Haible <bruno@clisp.org>
4351 Enable the Java related testsuite tests when the only Java compiler
4352 found is a gcj < 4.3. Discussed at
4353 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
4354 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
4356 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
4358 * data/Makefile.am: Update copyright date.
4359 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
4360 yypstate_new returns NULL.
4361 (yypstate_new): Return NULL if malloc does.
4362 * src/reader.c (packgram): Move translation of rule actions from the
4363 beginning of packgram to...
4364 (check_and_convert_grammar): ... here right before packgram is invoked
4365 so it's easier to write more complete comments, and remove redundant
4368 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
4370 As in semantic actions, make @$ in %initial-action, %destructor, and
4371 %printer imply %locations.
4372 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
4374 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
4375 (@$ in %initial-action implies %locations,
4376 @$ in %destructor implies %locations,
4377 @$ in %printer implies %locations): ... these new test cases.
4379 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
4381 Undo most of the 2007-02-03 change, switching to the strcase module
4382 now that gnulib strcase has been fixed.
4383 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
4384 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
4385 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
4386 * m4/.cvsignore: Add strcase.m4.
4387 * src/getargs.c: Revert 2007-02-03 change, as follows.
4388 Don't include c-strcase.h.
4389 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
4390 strcasecmp has "unspecified behavior" outside the POSIX locale,
4391 but it works fine in practice if at least one argument is ASCII,
4392 as is the case in Bison.
4394 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
4396 * tests/java.at: Skip tests if only one of javac/java is present.
4397 Reported by Joel E. Denny.
4398 * tests/atlocal.in: Adjust copyright years.
4400 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
4402 * data/lalr1.java (Stack): Work around old verifiers that disallow
4403 access to the private fields of an inner class, from the outer class.
4404 We can make Stack's fields public because user code doesn't have access
4405 to the instance of Stack used by parse(). Reported by Paul Eggert.
4407 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
4409 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
4410 the right spot for these files?
4411 * bootstrap.conf (gnulib_modules): Add c-strcase.
4412 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
4414 * src/getargs.c: Include c-strcase.h.
4415 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
4416 to avoid unspecified behavior.
4418 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
4420 * doc/bison.texinfo (Decl Summary): Correct typo.
4422 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
4424 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
4425 Complain if the value does not match empty, "true" or "false".
4426 * data/c++.m4: Adjust default definitions of %define variables.
4427 * data/java.m4: Adjust default definitions of %define variables.
4428 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
4430 * tests/input.at (Boolean %define variables): Test new behavior.
4432 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
4434 * NEWS: Mention java.
4435 * TODO: Remove things that are done.
4436 * bootstrap.conf: Add javacomp-script and javaexec-script.
4437 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
4439 * data/Makefile.am: Add new files.
4440 * data/java-skel.m4: New.
4441 * data/java.m4: New.
4442 * data/lalr1.java: New.
4444 * doc/bison.texinfo: Put "A Complete C++ Example" under
4445 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
4446 under Other Languages.
4448 * src/getargs.c (valid_languages): Add Java.
4449 * src/getargs.h (struct bison_language): Update size of string fields.
4451 * tests/Makefile.am: Add java.at.
4452 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
4453 * tests/java.at: New.
4454 * tests/testsuite.at: Include it.
4456 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
4459 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
4460 at_directive_argv arguments so these no longer have to be global
4461 variables. Also, update the implementation for the following changes.
4462 (fail_for_at_directive_too_many_args,
4463 fail_for_at_directive_too_few_args): Add at_directive_name argument.
4464 (at_directive_name): Remove as at_directive_argv[0] will be used for
4466 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
4467 for the directive name.
4468 (at_directive_argc, at_directive_argv): Make these local within
4469 skel_lex instead of global.
4470 (INITIAL): Update directive start action for above changes.
4471 (SC_AT_DIRECTIVE_ARG): Rename to...
4472 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
4473 (SC_AT_DIRECTIVE_SKIP_WS): Update.
4474 (scan_skel): Move yylex_destroy to...
4475 (skel_scanner_free): ... here.
4476 * tests/skeletons.at (installed skeleton file name): Rename to...
4477 (installed skeleton file names): ... this.
4479 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
4481 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
4482 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
4483 Summary" not "Directives".
4484 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
4485 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
4486 since the former is now the more complete one.
4487 (Prologue Alternatives): Likewise and do the same for %defines.
4488 (Table of Symbols): Add summary of %code, add summary of %define, and
4489 move full %code documentation to...
4490 (Decl Summary): ... here for consistency with other entries in these
4492 Move %define entry in order to keep this list alphabetized.
4493 Reword %define entry a little to put less emphasis on the skeleton
4494 concept, which most users shouldn't have to think about.
4496 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
4498 Adjust to recent gnulib changes.
4499 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
4500 Add string.h, string_.h, unistd_.h, wchar_.h.
4501 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
4502 * src/system.h: Don't include <stpcpy.h>; this is now done by
4505 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
4507 Simplify implementation of unqualified %code, implement macros for
4508 uniform treatment of boolean %define flags. Document %define.
4509 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
4510 b4_percent_code_ifdef): New.
4511 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
4512 * data/c++.m4: Define default value for global_tokens_and_yystype.
4513 * data/glr.cc: Likewise.
4514 * data/location.cc: Use b4_percent_define_flag_if.
4516 * doc/bison.texinfo (Decl Summary): Document %define.
4518 * src/parse-gram.y (Unqualified %code): Change muscle name to
4520 (content.opt): Default to empty.
4522 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
4524 Implement support for relative and absolute skeleton file names.
4525 Discussed starting at
4526 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
4527 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
4528 (Bison Options): Document in --skeleton entry.
4529 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
4530 full_skeleton can't necessarily hold all of pkgdatadir.
4531 If the specified skeleton file name contains a `/', don't prepend
4533 * src/parse-gram.y (prologue_declaration): If the specified skeleton
4534 file name contains a `/', prepend the grammar file directory.
4535 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
4536 * skeletons.at: New file.
4537 (relative skeleton file names): New test case.
4538 (installed skeleton file names): New test case.
4539 * tests/testsuite.at: Include skeletons.at.
4541 * bootstrap: Update copyright to 2007.
4543 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
4545 * bootstrap: Remove occurrences of .#bootmp from the files.
4547 2007-01-17 Akim Demaille <akim@epita.fr>
4549 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
4551 Use per-type %printer.
4553 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
4555 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
4556 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4557 djgpp/config.site, src/files.c, src/files.h, src/main.c,
4558 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
4559 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
4560 tests/glr-regression.at, tests/input.at, tests/local.at,
4561 tests/output.at, tests/torture.at: Update copyright to 2007.
4563 2007-01-16 Akim Demaille <akim@epita.fr>
4565 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
4567 (Calc++ Scanner): Exit with failure if we can't open the input
4569 Accept "-" standing for stdin.
4570 (Calc++ Top Level): Print the result only if the parsing was
4573 2007-01-16 Akim Demaille <akim@epita.fr>
4575 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
4577 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
4578 and Joel E. Denny <jdenny@ces.clemson.edu>
4580 Clean up %define and %code implementation in M4 some. Most
4581 importantly, rename all related macros to be in the b4_percent_define
4582 and b4_percent_code namespaces. Also, complete support for `.' in
4583 %define variable names and %code qualifiers.
4584 * data/bison.m4 (b4_check_user_names): Check for special
4585 "SKELETON-NAMESPACE(name)" macros instead of using two nested
4587 (b4_get_percent_define, b4_get_percent_code): Rename to...
4588 (b4_percent_define_get, b4_percent_code_get): ... these.
4589 Extend documentation with examples.
4590 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
4591 b4_percent_define_skeleton_variables and
4592 b4_percent_code_skeleton_qualifiers.
4593 Expect any value for the %define variable `foo' to be stored in the
4594 macro named `b4_percent_define(foo)'; expect any %code blocks for the
4595 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
4596 expect any unqualified %code blocks to be stored in a macro named
4597 `b4_percent_code_unqualified'.
4598 Use m4_indir so that %define variable names and %code qualifiers can
4599 contain `.', which is allowed by the grammar parser.
4600 (b4_percent_define_default): New macro to set a default value for a
4602 (m4_wrap): Update wrapped code, and fix some underquoting.
4603 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
4604 Expect grammar uses of %define variables and %code qualifiers to be
4605 defined in b4_percent_define_user_variables and
4606 b4_percent_code_user_qualifiers.
4607 * data/c++.m4: Use b4_percent_define_default rather than
4608 m4_define_default. Fix some underquoting. Skeleton usage of %define
4609 variable define_location_comparison now implies skeleton usage of
4610 %define variable filename_type.
4611 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4612 data/push.c, data/yacc.c: Update macro names.
4613 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
4616 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4618 DJGPP specific issues.
4620 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
4621 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
4623 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4625 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
4626 run parsers in all tests so that Valgrind is invoked during
4627 maintainer-check-valgrind.
4628 (Duplicate representation of merged trees): Free all semantic values.
4629 (Duplicated user destructor for lookahead): Likewise.
4631 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4633 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
4634 command-line prefix.
4635 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
4636 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
4637 miss Valgrind messages.
4638 (Exploding the Stack Size with Malloc): Likewise.
4640 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4642 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
4643 locals. Reported by Juan Manuel Guerrero at
4644 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
4645 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
4646 Fix some indentation also.
4647 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
4648 explaining this issue.
4650 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
4651 and Joel E. Denny <jdenny@ces.clemson.edu>
4653 Simplify union and prologue handling, and escape union and lex/parse
4654 params with digraphs.
4655 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
4656 values to the empty string since these are no longer guaranteed
4657 initialized by the front-end.
4658 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
4659 braces around b4_user_stype since this is no longer done by the
4661 * src/files.c, src/files.h (pre_prologue_obstack,
4662 post_prologue_obstack): Remove.
4663 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
4664 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
4665 with digraphs. This fixes lex params and parse params.
4666 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
4667 * src/output.c (prepare): Remove muscle insertion of the prologues.
4668 (output): Remove freeing of pre_prologue_obstack and
4669 post_prologue_obstack.
4670 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
4671 than prologue_augment for prologue parsing so you don't need prologue
4673 (grammar_declaration): For %union RHS, use `braceless' instead of
4674 "{...}" so that braces are already stripped and code is escaped with
4676 * src/reader.c (prologue_augment): Remove.
4677 (reader): Remove initialization of pre_prologue_obstack and
4678 post_prologue_obstack.
4679 * src/reader.h (prologue_augment): Remove.
4681 * data/c.m4: Remove stray parenthesis.
4683 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4685 Remove quotes from variables names in %define directives and from
4686 qualifiers in %code directives, and restrict the characters that are
4687 allowed in them to M4-friendly ones. For %define, continue to support
4688 the quoted form as a deprecated feature. Discussed starting at
4689 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
4690 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
4692 * doc/bison.texinfo (Prologue Alternatives): Update.
4693 (Decl Summary): In %defines entry, update mention of `%code requires'
4694 and `%code provides'.
4695 (C++ Location Values): Update %define uses.
4696 (Calc++ Parser Interface): Likewise.
4697 (Calc++ Parser): Likewise, and update `%code requires' uses.
4698 (Table of Symbols): Update %code documentation.
4699 * src/parse-gram.y (prologue_declaration): For %define variables, use
4700 `variable' instead of `STRING'.
4701 (grammar_declaration): For %code qualifiers, use `ID' instead of
4703 (variable): New nonterminal that takes an `ID' or a `STRING'.
4704 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
4706 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
4707 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
4708 (%define errors): Update %define uses.
4710 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4712 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
4713 instead of muscle_insert for %define values so that M4-special
4714 characters are replaced with digraphs.
4715 * tests/input.at (%define errors): Extend to check weird values.
4717 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4719 Instead of having skeletons declare all valid %define variables and
4720 %code qualifiers, provide macros that retrieve the associated values
4721 and build these lists automatically. Thus Bison will now warn when a
4722 variable or qualifier is not used by the skeleton in the current
4723 invocation regardless of whether it might sometimes be used by that
4724 skeleton in other invocations. Also, move all %define value macros to
4725 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
4726 form, which is replaced by %code.
4727 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
4728 (b4_check_user_names): ... this, and change the series of valid name
4729 arguments to a single list argument for names used in the skeleton
4730 similar to the existing list argument for names used in the grammar.
4731 Warn instead of complaining.
4732 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
4733 values and %code code, to format %code code properly, and to build
4734 lists of all %define variables and %code qualifiers used in the
4735 skeleton: b4_skeleton_percent_define_variables and
4736 b4_skeleton_percent_code_qualifiers.
4737 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
4739 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
4740 the skeleton names lists can finish building first. In place of
4741 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
4742 expect the lists b4_user_percent_define_variables and
4743 b4_user_percent_code_qualifiers.
4744 * data/c++.m4: Where setting default values for b4_parser_class_name,
4745 b4_location_type, b4_filename_type, b4_namespace, and
4746 b4_define_location_comparison, update their names to the
4747 b4_percent_define_ namespace.
4748 * data/glr.c: Don't use b4_check_percent_define_variables and
4749 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
4750 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
4751 (b4_parser_class_name, b4_namespace): Define these using
4752 b4_get_percent_define for parser_class_name and namespace.
4753 * data/location.cc: Use b4_get_percent_define.
4754 * data/push.c: Don't use b4_check_percent_define_variables and
4755 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
4756 * data/yacc.c: Likewise, and don't call m4_exit in
4757 b4_use_push_for_pull_if or m4_wrap code will never execute.
4758 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
4760 (muscle_grow_user_name_list): ... this for consistency with the
4761 terminology used in bison.m4.
4762 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
4763 %define variable names, and rename muscle used_percent_define_variables
4764 to user_percent_define_variables.
4765 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
4766 user_percent_code_qualifiers.
4768 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
4769 {CODE} form is no longer accepted.
4770 * tests/input.at (Reject bad %code qualifiers): Rename to...
4771 (Reject unused %code qualifiers): ... this, and update test output.
4772 (%define error): Update test output.
4774 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
4776 Check for unrecognized %define variables similar to checking for
4777 unrecognized %code qualifiers. Check for redefined %define variables.
4778 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
4780 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
4781 (b4_check_percent_define_variables): New, also wraps it.
4782 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
4783 variables using b4_check_percent_define_variables.
4784 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
4785 all those exercised in the test suite and all those listed in the
4786 `Default values' section of c++.m4. Are there others?
4787 * data/push.c, data/yacc.c: Declare no valid %define variables.
4788 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
4789 similar to muscle_find, but it works even when the muscle stores a
4791 (muscle_grow_used_name_list): New function for constructing the used
4792 name list muscles that b4_check_for_unrecognized_names requires.
4793 * src/parse-gram.y (prologue_declaration): Warn if a variable is
4794 %define'd more than once. Define the b4_used_percent_define_variables
4795 muscle with muscle_grow_used_name_list.
4796 (grammar_declaration): Abbreviate %code code with
4797 muscle_grow_used_name_list.
4798 * tests/input.at (%define errors): New.
4800 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4802 Provide warn_at, complain_at, and fatal_at function callbacks to the
4803 skeletons, and use this for %code qualifier complaints.
4804 * data/bison.m4 (b4_error_at): New, invoked by...
4805 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
4806 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
4807 @fatal_at(...@) directives.
4808 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
4809 qualifiers in b4_used_percent_code_qualifiers and to use
4811 * src/location.c, src/location.h (boundary_set_from_string): New global
4813 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
4815 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
4816 to b4_used_percent_code_qualifiers.
4817 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
4819 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
4820 (lineno): Rename to...
4821 (out_lineno): ... this so I don't misunderstand it again.
4822 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
4823 here; these newlines are in the input but not the output file.
4824 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
4825 (at_directive_perform): ... this new static function, and add handling
4826 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
4828 * tests/input.at (Reject bad %code qualifiers): Update test output with
4829 locations and extend.
4831 * tests/output.at (Output file name: [, Output file name: ]): Remove
4832 bogus comment about these tests failing.
4834 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4836 Clean up b4_check_percent_code_qualifiers a little.
4837 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
4838 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
4839 documentation and add examples.
4840 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
4843 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
4845 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
4846 unreliable -- especially when they're hidden inside another macro.
4847 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
4848 data/c.m4: Remove m4_divert(-1).
4849 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4850 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
4851 m4_divert_push(0) and m4_divert_pop(0).
4852 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
4853 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
4854 pushed and popped by m4sugar, should be first on the stack.
4856 Provide warn, complain, and fatal function callbacks to the skeletons.
4857 This provides more flexibility than m4_fatal, improves the error
4858 message format, and captures messages for translation. Discussed
4860 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
4861 * data/bison.m4 (b4_error): New, invoked by...
4862 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
4863 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
4864 directives. Because these M4 macros might be called when the current
4865 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
4866 the previous removal of uses of m4_divert, which caused trouble.
4867 (b4_check_percent_code_qualifiers): Use b4_complain instead of
4868 m4_fatal to report unrecognized %code qualifiers.
4869 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
4870 push parser requests.
4871 * data/glr.c: Use b4_complain instead of m4_fatal to report
4872 non-deterministic push parser requests.
4873 Update @output usage to @output(...@) form.
4874 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
4875 report missing %defines. Update @output usage to @output(...@) form.
4876 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
4878 * src/main.c (main): Invoke skel_scanner_free.
4879 * src/scan-skel.h (skel_scanner_free): Prototype new function.
4880 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
4881 obstack_for_string from flex-scanner.h.
4882 (YY_DECL): Use to declare skel_lex static.
4883 (decode_at_digraphs): Remove; now handled in the new
4884 SC_AT_DIRECTIVE_ARG start condition.
4885 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
4887 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
4888 at_directive_argv): New static globals.
4889 (INITIAL): Use fail_for_invalid_at.
4890 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
4891 recognize the start of a generalized `@directive(...@)' form and
4893 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
4894 directive args (using the new obstack_for_string), to decode the
4895 contained @ diagraphs, and to perform the directive. It recognizes
4896 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
4898 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
4899 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
4901 (scan_skel): Initialize obstack_for_string on the first call.
4902 (skel_scanner_free): New function to free obstack_for_string.
4903 * tests/input.at (Reject bad %code qualifiers): Update test output.
4905 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
4907 Consolidate the 4 prologue alternative directives (%code, %requires,
4908 %provides, and %code-top) into a single %code directive with an
4909 optional qualifier field. Discussed at
4910 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
4911 * NEWS (2.3a+): Rewrite the existing entry for the prologue
4913 * doc/bison.texinfo (Prologue Alternatives): Update.
4914 (Decl Summary): Update to %code "requires" and %code "provides".
4915 (Calc++ Parser): Update to %code "requires".
4916 (Table of Symbols): Remove entries for %requires, %provides, and
4917 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
4918 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
4919 are replaced by b4_percent_code_provides and b4_percent_code_requires,
4920 which are skeleton-specific.
4921 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
4922 declare what %code qualifiers it supports and to complain if any other
4923 qualifiers were used in the grammar.
4924 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
4925 and b4_user_code([b4_percent_code_provides]) in place of
4926 b4_user_requires and b4_user_provides.
4927 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
4928 Add b4_user_code([b4_percent_code_top]) and
4929 b4_user_code([b4_percent_code]).
4930 Invoke b4_check_percent_code_qualifiers.
4931 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
4932 PERCENT_REQUIRES): Remove.
4933 (grammar_declaration): Remove RHS's for %code-top, %provides, and
4934 %requires. Rewrite the %code RHS as the unqualified form defining the
4935 muscle b4_percent_code. Add another RHS for the qualified %code form,
4936 which defines muscles of the form b4_percent_code_QUALIFIER and the
4937 b4_used_percent_code_qualifiers muscle.
4938 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
4939 PERCENT_REQUIRES): Remove.
4940 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
4941 %code "requires" and %code "provides".
4942 * tests/input.at (Reject bad %code qualifiers): New.
4944 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
4946 Use the new code_props interface for destructors and printers.
4947 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
4948 printer_location members, and change the type of the destructor and
4949 printer members to code_props.
4950 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
4951 symbol_printer_get, semantic_type_destructor_set,
4952 semantic_type_printer_set, default_tagged_destructor_set,
4953 default_tagless_destructor_set, default_tagged_printer_set,
4954 default_tagless_printer_set): Use code_props in arguments and return
4955 types in place of char const * and location.
4956 (symbol_destructor_location_get, symbol_printer_location_get): Remove
4957 since the locations are now contained in the return of
4958 symbol_destructor_get and symbol_printer_get.
4959 * src/output.c (symbol_destructors_output, symbol_printers_output):
4961 (symbol_code_props_output): ... this to eliminate duplicate code.
4962 (output_skeleton): Update to use symbol_code_props_output.
4963 * src/reader.c (symbol_should_be_used): Update use of
4964 symbol_destructor_get.
4965 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
4966 Update uses of the various _destructor_set and _printer_set functions.
4967 * src/symtab.c: (default_tagged_destructor_location,
4968 default_tagless_destructor_location, default_tagged_printer_location,
4969 default_tagless_printer_location): Remove since we...
4970 (default_tagged_destructor, default_tagless_destructor,
4971 default_tagged_printer, default_tagless_printer): ... change the type
4972 of these to code_props.
4973 (symbol_new, semantic_type_new, symbol_destructor_set,
4974 semantic_type_destructor_set, symbol_destructor_get,
4975 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
4976 symbol_check_alias_consistency, default_tagged_destructor_set,
4977 default_tagless_destructor_set, default_tagged_printer_set,
4978 default_tagless_printer_set): Update.
4979 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
4980 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
4982 (symbol_print): Use SYMBOL_CODE_PRINT.
4984 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
4986 Use the new code_props interface for rule actions.
4987 * src/symlist.h (symbol_list): Replace action, action_location, and
4988 used members with a code_props action_props member.
4989 * src/reader.c (symbol_should_be_used, grammar_rule_check,
4990 grammar_midrule_action, grammar_current_rule_merge_set,
4991 grammar_current_rule_symbol_append, packgram): Update.
4992 * src/scan-code.h (translate_rule_action): Remove, no longer used.
4993 * src/scan-code.l (handle_action_dollar): Update.
4994 (translate_rule_action): Remove, no longer used.
4995 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
4997 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4999 Use the new code_props interface in parse-gram.y.
5000 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
5001 Update all uses of translate_* functions to use the new code_props
5002 interface and to use gram_scanner_last_string_free and
5003 code_scanner_last_string_free where possible.
5004 (grammar_declaration): symbol_list_destructor_set and
5005 symbol_list_printer_set now perform the translation, so don't do it
5006 here. Use gram_scanner_last_string_free where possible.
5007 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
5008 translate_code): Remove, no longer used.
5009 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
5010 symbol_list_printer_set): Perform code translation here rather than
5011 depending on the caller to do so.
5013 * src/symlist.h (struct symbol_list): Correct some documentation typos.
5014 * src/scan-gram.h (gram_last_string): Remove declaration.
5015 * src/scan-gram.l (last_string): Declare it static.
5017 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5019 Encapsulate code properties and related functionality for the various
5020 destructors, printers, and actions into a code_props structure and
5021 interface. This patch merely implements code_props in scan-code.h and
5022 scan-code.l. Future patches will rewrite other modules to use it.
5023 Discussed starting at
5024 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
5025 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
5026 consistently initialize const structs that have an empty location
5028 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
5029 to ensure consistency.
5030 * src/scan-code.h (code_props): New structure.
5031 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
5032 function, macro, and const global variable for initializing a
5033 code_props with no code.
5034 (code_props_plain_init, code_props_symbol_action_init,
5035 code_props_rule_action_init, code_props_translate_code): The rest of
5036 the new code_props functional interface. Among other things, the init
5037 functions set the code_props kind field so that
5038 code_props_translate_code will know whether to behave like
5039 translate_symbol_action, translate_rule_action, or translate_code.
5040 These old translate functions must remain until all other modules are
5041 updated to use the new code_props interface.
5042 (code_scanner_last_string_free): New function similar to
5043 gram_scanner_last_string_free.
5044 (code_scanner_free): Add documentation.
5045 * src/scan-code.l: Implement the new interface.
5046 (code_lex): Make it static, add a code_props* argument, and remove the
5048 (last_string): New static global similar to the one in scan-gram.l.
5049 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
5051 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
5052 code_props since Bison may one day use this information for destructors
5054 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
5055 (handle_action_dollar): Use symbol_list_n_get and set used flag
5056 directly since symbol_list_n_used_set is removed.
5057 (translate_action): Add a code_props* argument and remove the rule,
5058 action, and location arguments. Pass the code_props* on to code_lex.
5059 (translate_rule_action, translate_symbol_action, translate_code):
5060 Rewrite as wrappers around the new code_props interface.
5061 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
5062 it would eventually need to break the encapsulation of code_props.
5064 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5066 * etc/.cvsignore: New.
5068 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5070 Add maintainer-push-check to run maintainer-check using push parsing in
5071 place of pull parsing where available.
5072 * Makefile.am (maintainer-push-check): New.
5073 * data/bison.m4 (b4_use_push_for_pull_if): New.
5074 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
5075 appropriately based on their existing values.
5076 (yypush_parse): Don't print push-parser-specific diagnostics if push
5077 parsing is being used in place of pull parsing.
5078 * data/yacc.c: If push parsing should replace pull parsing, redirect to
5080 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
5081 variable, and insert b4_use_push_for_pull_flag into muscles.
5082 * tests/Makefile.am (maintainer-push-check): New.
5084 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5086 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
5087 (whether successful or failed) so that yypush_parse can be invoked
5088 again to start a new parse using the same yypstate.
5089 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
5090 check multiple yypull_parse invocations on the same yypstate. For pull
5091 mode, extend to check multiple yyparse invocations.
5092 (Exploding the Stack Size with Alloca): Extend to try with
5094 (Exploding the Stack Size with Malloc): Likewise.
5096 * tests/calc.at (Simple LALR Calculator): Don't specify
5097 %skeleton "push.c" since %push-pull-parser implies that now.
5098 * tests/headers.at (export YYLTYPE): Don't check for the push
5099 declarations. Otherwise, this test case can't be used to see if push
5100 mode can truly emulate pull mode.
5101 * tests/input.at (Torturing the Scanner): Likewise.
5102 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
5103 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
5104 AT_YACC_IF, which now includes the case of push mode since %skeleton
5105 need not be used for push mode. This will be more intuitive once
5106 push.c is renamed to yacc.c.
5108 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5110 For push mode, convert yyparse from a macro to a function, invoke yylex
5111 instead of passing a yylexp argument to yypull_parse, and don't
5112 generate yypull_parse or yyparse unless %push-pull-parser is declared.
5113 Discussed starting at
5114 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
5115 * data/bison.m4 (b4_pull_if): New.
5116 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
5117 * data/push.c: Improve M4 quoting a little.
5118 (b4_generate_macro_args, b4_parenthesize): Remove.
5119 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
5120 any time a pull parser is requested.
5121 Don't #define this as a wrapper around yypull_parse. Instead, when
5122 both push and pull are requested, make it a function that does that
5124 (yypull_parse): If there's a b4_prefix, #define this to
5125 b4_prefix[pull_parse] when both push and pull are requested.
5126 Don't define this as a function unless both push and pull are
5128 Remove the yylexp argument and hard-code yylex invocation instead.
5129 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
5131 * src/getargs.c (pull_parser): New global initialized to true.
5132 * getargs.h (pull_parser): extern it.
5133 * src/output.c (prepare): Insert pull_flag muscle.
5134 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
5135 (prologue_declaration): Set both push_parser and pull_parser = true for
5136 %push-pull-parser. Set push_parser = true and pull_parser = false for
5138 * src/scan-gram.l: Don't accept %push_parser as an alternative to
5139 %push-parser since there's no backward-compatibility concern here.
5140 Scan %push-pull-parser.
5141 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
5142 instead of %push-parser.
5143 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
5144 prototype it in the module that calls yyparse.
5145 * tests/input.at (Torturing the Scanner): Likewise.
5146 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
5148 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
5150 Update etc/bench.pl. Optimize push mode a little (the yyn change
5151 deserves most of the credit).
5152 * Makefile.am (SUBDIRS): Add etc subdirectory.
5153 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
5154 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
5155 yytoken, yyval, and yyloc declarations to...
5156 (yyparse or yypush_parse): ... here to improve performance. For
5157 yypush_parse invocations after the first, be sure to assign yyn its old
5159 (yypstate_new): Don't bother initializing the yyresult field since the
5160 initial value isn't used.
5161 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
5162 remove the #define that, in push mode, set it to yyps->NAME.
5163 * etc/Makefile.am: New.
5164 * etc/bench.pl: Remove and build it instead from...
5165 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
5166 "tests/bison" from the build directory by default rather than just
5167 invoking "bison" from $PATH.
5168 (calc_grammar): Update push parser code: don't declare yylval globally,
5169 don't define yyparse_wrapper, and don't #define yyparse.
5170 (bench_grammar): Update to check all working combinations of yacc.c,
5171 push.c, impure, pure, pull, and push.
5173 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5175 For push mode, add pull wrappers around yypush_parse.
5176 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
5177 (yypull_parse): New function wrapping yypush_parse.
5178 (yyparse): New #define wrapping yypull_parse.
5179 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
5181 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
5182 prototype yylex in the module that calls yyparse, and don't prototype
5183 yyparse there. Otherwise, the yyparse expansion won't compile.
5184 * tests/input.at (Torturing the Scanner): Likewise.
5186 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5188 Enable push parsers to operate in impure mode. Thus, %push-parser no
5189 longer implies %pure-parser. The point of this change is to move
5190 towards being able to test the push parser code by running the entire
5191 test suite as if %push-parser had been declared.
5192 * data/push.c (yypush_parse): For impure mode, remove the
5193 yypushed_char, yypushed_val, and yypushed_loc arguments.
5194 Instead, declare these as local variables initialized to the global
5195 yychar, yylval, and yylloc.
5196 For the first yypush_parse invocation only, restore the initial values
5197 of these global variables when it's time to read a token since they
5198 have been overwritten.
5199 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
5201 * tests/calc.at (Simple LALR(1) Calculator): Always declare
5202 %pure-parser along with %push-parser since this test case was designed
5203 for pure push parsers.
5204 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
5205 (AT_YACC_OR_PUSH_IF): New.
5206 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
5207 add a note that it's still wrong for some cases (as it has been for a
5209 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
5210 %push-parser no longer implies %pure-parser.
5212 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5214 Remove some unnecessary differences between the pull parser code and
5215 the push parser code. This patch enables yynerrs in push mode.
5216 * data/push.c: Reformat M4 a little.
5217 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
5218 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
5219 because push mode is on. Instead, if pure mode is on, move yynerrs
5221 (b4_declare_parser_state_variables): ... here.
5222 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
5223 to yyps->NAME so it can be used in yypush_parse.
5224 (yypush_parse): Don't omit uses of yynerrs in push mode.
5226 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5228 Fix bug such that the first pushed token's value and location are
5229 sometimes overwritten (sometimes by %initial-action) before being used.
5230 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
5231 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
5232 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
5233 more closely mimic the pull parser logic.
5234 Don't copy the pushed token to yychar, yylval, and yylloc until it's
5235 time to read a token, which is after any initialization of yylval and
5237 (gottoken): Rename label to...
5238 (yyread_pushed_token): ... for clarity and to avoid infringing on the
5241 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5243 Rearrange initialization of the parser state variables so that the
5244 skeleton doesn't have to have a copy for pull mode and another for push
5245 mode. This patch also fixes at least a bug such that yylloc was not
5246 initialized (with b4_location_initial_line and
5247 b4_location_initial_column) upon calling yypush_parse. However, that
5248 initialization now overwrites the first token's location;
5249 %initial-action assigning @$ already did the same thing, and both bugs
5250 will be fixed in a later patch.
5251 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
5252 (b4_declare_parser_state_variables): Remove initialization of yytoken,
5253 yyss, yyvs, yyls, and yystacksize.
5254 (yypstate_new): Remove initialization of some yypstate fields: yystate,
5255 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
5257 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
5258 yyps->NAME so it can be used in yypush_parse.
5259 (yyparse or yypush_parse): For yypush_parse, don't print the
5260 "Starting parse" diagnostic for invocations after the first.
5261 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
5262 yypush_parse, only do it for the first invocation.
5263 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
5264 initialization to occur in yypush_parse but only on the first
5267 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5269 * data/push.c: Add CPP guards around push parser declarations in both
5270 the header and the code file.
5271 In the code file, move the push parser declarations to the same place
5272 they appear in the header file.
5273 Clean up the M4 some, especially the inconsistent underquoting in
5274 some b4_c_function_def and b4_c_function_decl uses.
5276 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5278 Encapsulate the push parser state variables into an M4 macro so the
5279 push skeleton doesn't have to list them again for pull mode's yyparse.
5280 For push mode, remove yypush_parse's local equivalents of these
5281 variables to eliminate unnecessary copying between the two sets at
5282 run-time. This patch also fixes at least a bug related to multiple
5283 %initial-action invocations in push mode.
5284 * data/push.c (b4_declare_parser_variables): Rename to...
5285 (b4_declare_scanner_communication_variables): ... this for clarity and
5287 (b4_declare_yyparse_variables): Remove and move its contents to the one
5288 spot where it was invoked.
5289 (b4_declare_parser_state_variables): New macro containing the parser
5290 state variables required by push mode.
5291 (struct yypstate): Replace all fields but yynew with
5292 b4_declare_parser_state_variables.
5293 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
5294 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
5295 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
5296 (yyparse or yypush_parse): For yyparse in pull mode, replace local
5297 parser state variable declarations with
5298 b4_declare_parser_state_variables.
5299 Don't initialize parser state variables when calling yypush_parse since
5300 yypstate_new already does that.
5301 Invoke the user's initial action only upon the first yypush_parse
5303 Remove all code that copies between the local parser state variables
5306 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5308 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
5309 prevent a name collision in a future patch where these names will
5310 sometimes be #define'd.
5311 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
5312 since it no longer has the same name as the existing argument.
5313 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
5315 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
5316 and Joel E. Denny <jdenny@ces.clemson.edu>
5318 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
5319 that the argument is case-insensitive, and there's no `=' here.
5320 For the %skeleton entry, mention that %language is better.
5321 (Bison Options): Likewise for --language and --skeleton. Move the
5322 --skeleton entry so that the `Tuning the parser' section is sorted
5323 alphabetically on long options.
5324 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
5325 %language directive in detail here; cross-reference the %language
5326 documentation instead.
5327 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
5328 `%require "2.3b"' so that the example is always up-to-date.
5329 (Table of Symbols): Add entries for %language and %skeleton.
5330 * examples/extexi (normalize): Instead of replacing every %require
5331 argument with the current Bison version, just substitute for
5332 `@value{VERSION}'. This guarantees that we're testing what actually
5333 appears in the documentation.
5334 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
5335 rather than `@VERSION@'.
5337 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5339 * NEWS: Reword the %language news a bit, and put it earlier.
5341 * src/getargs.c (skeleton_arg): Last arg is now location const *.
5342 Rewrite to simplify the logic.
5343 (language_argmatch): Likewise.
5344 (program_name): We now own this var.
5345 * src/getargs.h (struct bison_language): Use char[] rather than
5348 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
5350 * src/complain.c (program_name): Remove decl; no longer needed.
5351 * src/main.c (program_name): Remove; now belongs to getargs.
5353 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
5355 * NEWS: Document %language.
5357 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
5359 * data/c-skel.m4, data/c++-skel.m4: New files.
5360 * data/glr.c: Complain on push parsers.
5362 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
5364 (Decl Summary): Document %language and %skeleton.
5365 (Command line): Document -L.
5367 * examples/extexi: Rewrite %require directive.
5368 * examples/calc++/Makefile.am: Pass VERSION to extexi.
5370 * src/files.c (compute_exts_from_gc): Look in language structure
5372 (compute_file_name_parts): Check whether .tab should be added.
5373 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
5374 (language, skeleton_arg, language_argmatch): New.
5375 (long_options): Add --language.
5376 (getargs): Use skeleton_arg, add -L/--language.
5377 * src/getargs.h: Include location.h.
5378 (struct bison_language, language, skeleton_arg, language_argmatch): New.
5379 * src/output.c (prepare): Pick default skeleton from struct language.
5380 Don't dispatch C skeletons here.
5381 * src/parse-gram.y (PERCENT_LANGUAGE): New.
5382 (prologue_declaration): Add "%language" rule, use skeleton_arg.
5383 * src/scan-gram.l ("%language"): New rule.
5385 * tests/calc.at: Test %skeleton and %language.
5386 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
5387 (AT_GLR_IF): Look for %skeleton "glr.cc".
5388 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
5389 (AT_YACC_IF): Reject %language.
5391 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5393 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
5394 since it wasn't used; only the typedef name 'semantic_type' is needed.
5395 Also, omit trailing white space.
5397 * bootstrap: Sync from coreutils.
5398 (gnulib_extra_files): Add build-aux/announce.gen.
5399 (slurp): Adjust .gitignore files like .cvsignore files.
5400 * build-aux/announce-gen: Remove from CVS, since bootstrap
5403 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
5405 Make %push-parser imply %pure-parser. This fixes several bugs; see
5406 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
5407 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
5409 * data/push.c: Don't bother testing b4_push_if when deciding whether
5410 to expand b4_declare_parser_variables globally.
5411 (yypush_parse): Likewise in here.
5413 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
5414 (yy_reduce_print): Reformat M4 for readability.
5416 2006-12-15 Bob Rossi <bob@brasko.net>
5417 and Joel Denny <jdenny@ces.clemson.edu>
5419 * data/push.c (yypstate): Add typedef, and update all uses of
5420 struct yypstate to just yypstate.
5421 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
5423 2006-12-14 Bob Rossi <bob@brasko.net>
5425 * data/push.c (yypush_parse): Declare prototype regardless of
5428 2006-12-14 Bob Rossi <bob@brasko.net>
5430 * data/push.c (yyparse): Remove the prototype and the #define when in
5433 2006-12-13 Bob Rossi <bob@brasko.net>
5435 * data/push.c (yypstate_init): Rename to...
5436 (yypstate_new): ... this and use b4_c_function_def.
5437 (yypstate_delete): New.
5438 (yypush_parse): Change parameters yynval and yynlloc to be const.
5439 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
5440 yypstate_delete functions.
5442 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
5444 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
5445 strange test case titles. Reported by Bob Rossi.
5447 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
5449 * TODO: Add pointer to Sylvain Schmitz's work on static detection
5450 of potential ambiguities in GLR grammers.
5452 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
5454 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
5455 `bison ', use m4_index instead of m4_substr since chopping up a string
5456 containing M4-special characters causes problems here.
5458 Fix a couple of bugs related to special characters in user-specified
5459 file names, and make it easier for skeletons to compute output file
5460 names with the same file name prefix as Bison-computed output file
5462 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
5463 b4_parser_file_name and b4_spec_defines_file instead of
5464 @output_parser_name@ and @output_header_name@, which are now redundant.
5465 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
5466 b4_parser_file_name, b4_spec_defines_file, and the new
5467 @basename(FILENAME@) instead of @output_parser_name@ and
5468 @output_header_name@, which inappropriately escaped the file names as
5470 * src/files.c (all_but_ext): Remove static qualifier.
5471 (compute_output_file_names): Move `free (all_but_ext)' to...
5472 (output_file_names_free): ... here since all_but_ext is needed later.
5473 * src/files.h (all_but_ext): Extern.
5474 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
5475 exactly what MUSCLE_INSERT_STRING used to do.
5476 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
5477 characters are escaped properly.
5478 * src/output.c (prepare): Define muscle file_name_all_but_ext as
5480 For pkgdatadir muscle, maintain previous functionality by using
5481 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
5482 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
5483 digraphs would never be expanded. Hopefully no one has M4-special
5484 characters in his Bison installation path.
5485 * src/scan-skel.l: Don't parse @output_header_name@ and
5486 @output_parser_name@ anymore since they're now redundant.
5487 In @output, use decode_at_digraphs.
5488 Parse a new @basename command that invokes last_component.
5489 (decode_at_digraphs): New.
5490 (BASE_QPUTS): Remove unused.
5491 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
5492 (Output file name): New tests.
5494 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
5496 Warn about output files that are generated by the skeletons and that
5497 conflict with other output files.
5498 * data/glr.c: Don't generate the header file here when glr.cc does.
5499 * src/files.c (file_names, file_names_count): New static globals.
5500 (compute_output_file_names): Invoke output_file_name_check for files
5501 not generated by the skeletons and remove existing checks.
5502 (output_file_name_check): New function that warns about conflicting
5504 (output_file_names_free): Free file_names.
5505 * src/files.h (output_file_name_check): Declare.
5506 * src/scan-skel.l: Invoke output_file_name_check for files generated by
5508 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
5509 (Conflicting output files): New tests.
5511 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5513 * doc/bison.texinfo: Fix a couple of typos.
5515 2006-12-08 Bob Rossi <bob@brasko.net>
5517 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
5519 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
5521 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
5522 (yypush_parse): Rename yypvars argument to yyps and remove redundant
5524 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
5525 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
5527 2006-12-07 Bob Rossi <bob@brasko.net>
5528 and Joel Denny <jdenny@ces.clemson.edu>
5530 * data/push.c (yypvarsinit): Change return type from void* to struct
5531 yypvars*. No longer cast to void* on return.
5532 (struct yypvars): Remove yylen since it need not be remembered between
5533 yypushparse invocations.
5534 (yypushparse): Don't copy between yylen and pv->yylen.
5536 2006-12-05 Bob Rossi <bob@brasko.net>
5538 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
5539 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
5540 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
5541 (struct yypvars): Remove b4_declare_parser_variables.
5542 (yypvarsinit): Remove init code for removed variables.
5543 (global scope): Do not declare b4_declare_parser_variables if
5545 (yypushparse): Add b4_declare_parser_variables.
5546 Init new local variables, and remove init code for removed
5549 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
5550 and yyparse for other modes.
5551 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
5552 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
5553 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
5554 (AT_PURE_LEX_IF): True if pure or push parser.
5556 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
5558 Document Yacc prologue alternatives and default %destructor's and
5559 %printer's as experimental. Don't mention Java yet. Discussed at
5560 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
5561 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
5562 (2.3a): Annotate this entry to say the old forms of these features were
5564 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
5565 Table of Symbols): Say they're experimental. Comment out any mention
5566 of Java (we'll want this back eventually).
5568 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
5570 Support a file name argument to %defines. Deprecate `=' in
5571 %file-prefix, %name-prefix, and %output. Discussed at
5572 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
5573 * NEWS (2.3a+): Mention.
5574 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
5575 form of %defines, and remove `=' from entries for %file-prefix,
5576 %name-prefix, and %output.
5577 * src/parse-gram.y (prologue_declaration): Implement.
5578 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
5579 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
5580 all but one occurrence of %name-prefix.
5581 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
5582 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
5583 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
5584 occurrence of each of %file-prefix and %output. Add check for %defines
5586 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
5587 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
5588 Remove the `=' from %output.
5590 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
5592 Don't escape $ in test case titles since Autoconf 2.61 now does that
5594 * tests/actions.at (Default %printer and %destructor are not for error
5595 or $undefined): Here.
5596 (Default %printer and %destructor are not for $accept): Here.
5597 * tests/input.at (Invalid $n and @n): Here.
5599 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
5601 Rename <!> to <>. Discussed starting at
5602 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
5603 * NEWS (2.3a+): Update.
5604 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
5606 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
5607 * src/scan-gram.l (INITIAL): Implement.
5608 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
5609 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
5611 * tests/actions.at (Default tagless %printer and %destructor,
5612 Default tagged and per-type %printer and %destructor,
5613 Default %printer and %destructor are not for error or $undefined,
5614 Default %printer and %destructor are not for $accept,
5615 Default %printer and %destructor for mid-rule values): Update.
5616 * tests/input.at (Default %printer and %destructor redeclared,
5617 Unused values with default %destructor): Update.
5619 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
5621 Don't let %prec take a nonterminal.
5622 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
5624 * tests/input.at (%prec takes a token): New test checking that %prec
5625 won't take a nonterminal.
5627 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5629 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
5630 it was double-quoted.
5631 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
5632 grammar is maintained with Bison's highest standards.
5633 * src/getargs.c: Fix some typos in Doxygen comments.
5635 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5637 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
5638 later. Reported by Paul Eggert in
5639 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
5640 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
5641 * src/scan-code.l (translate_action): Don't bother invoking
5642 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
5643 (code_scanner_free): Instead of invoking
5644 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
5646 * src/scan-gram.l (gram_scanner_free): Likewise.
5647 * src/scan-skel.l (scan_skel): Likewise.
5649 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
5651 * src/files.c (tr): Change return type to void.
5652 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
5653 has been called previously for the same key.
5654 (muscle_find): Return storage instead of value so that
5655 --enable-gcc-warnings doesn't produce warnings that the return discards
5656 const. aver that the value and storage are the same since storage
5657 could potentially be NULL when value is not.
5658 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
5661 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
5663 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
5664 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
5665 us a slightly cleaner distribution, and also works.
5666 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
5669 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
5670 and Paul Eggert <eggert@cs.ucla.edu>
5672 Don't let Bison leak memory except when it complains.
5673 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
5674 (spec_defines_file, dir_prefix): Now char *, not const char *,
5675 since they are freed.
5676 * src/files.c: Likewise.
5677 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
5679 (tr): Now operates in-place. All uses changed.
5680 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
5682 (compute_file_name_parts, compute_output_file_names): Don't store
5683 read-only data in variables that will be freed.
5684 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
5685 src_extension, and header_extension.
5686 (output_file_names_free): New public function to free
5687 spec_verbose_file, spec_graph_file, spec_defines_file,
5688 parser_file_name, and dir_prefix.
5689 * src/getargs.c (getargs): Don't store read-only data in variables that
5691 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
5692 (which previously existed but was unused), and quotearg_free.
5693 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
5694 * src/muscle_tab.c: Likewise.
5695 (muscle_entry): Make the value char const *,
5696 and add a new storage member that is char * and can be freed.
5697 (muscle_entry_free): New private function.
5698 (muscle_init): Use it instead of free.
5699 (muscle_insert, muscle_grow): Update and use new storage member.
5700 (muscle_code_grow): Free the string passed to muscle_grow
5701 since it's not needed anymore.
5702 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
5703 add a new `char *code' member.
5704 ("{...}"): Declare semantic type as code.
5705 * src/scan-code.h (translate_rule_action):
5706 (translate_symbol_action, translate_code, translate_action): Return
5707 `char const *' rather than `char *' since external code should not free
5709 * src/scan-code.l: Likewise.
5710 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
5711 which is "{...}" in the parser.
5712 * tests/Makefile.am (maintainer-check-valgrind): Set
5713 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
5715 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
5717 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
5718 expecting a non-zero exit status sets --leak-check=summary and
5719 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
5720 this case, and we don't want to hear about it.
5722 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
5724 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
5725 instead of from the template, to simplify configuration a bit.
5726 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
5727 and m4/wint_t.m4, as they are needed with the latest gnulib.
5729 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5731 Disable unset/unused mid-rule value warnings by default, and recognize
5732 --warnings=midrule-values to enable them. Discussed starting at
5733 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
5734 * NEWS (2.3a+): Mention.
5735 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
5736 warnings): Add entry for midrule-values subargument.
5737 * src/reader.c (symbol_should_be_used): Don't return true just because
5738 the value is a set/used mid-rule value unless
5739 --warnings=midrule-values was specified.
5740 * tests/input.at (Unused values, Unused values before symbol
5741 declarations): Run tests with and without --warnings=midrule-values.
5743 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
5744 than LIST_FREE directly.
5746 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5748 Finish implementing --warnings=error, which should not be implied by
5749 --warnings=all (or by its synonyms -W and --warnings without
5751 * src/complain.c (set_warning_issued): New function to report that
5752 warnings are being treated as errors and to record an error if so.
5754 (warn_at, warn): ... here.
5755 * src/getargs.c (warnings_args, warnings_types): Reorder so that
5756 "error - warnings are errors" does not appear above "all - all of the
5758 (getargs): For -W and --warnings without subarguments, don't let
5759 FLAGS_ARGMATCH set warnings_error in warnings_flag.
5760 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
5762 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5764 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
5765 empty subargument list. For example: `bison --warnings= parser.y'.
5767 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5769 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
5770 the parser header file so that gcc doesn't warn.
5772 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5774 Split the default %destructor/%printer into two kinds: <*> and <!>.
5775 Discussed starting at
5776 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
5777 * NEWS (2.3a+): Mention.
5778 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
5779 previous change today related to mid-rules.
5780 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
5781 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
5782 (TYPE_TAG_ANY): Add as <*>.
5783 (TYPE_TAG_NONE): Add as <!>.
5784 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
5786 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
5787 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
5788 * src/symlist.c (symbol_list_default_new): Split into tagged and
5790 (symbol_list_destructor_set, symbol_list_printer_set): Split
5791 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
5792 SYMLIST_DEFAULT_TAGLESS.
5793 * src/symlist.h: Update symbol_list_default*_new prototypes.
5794 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
5795 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
5796 * src/symtab.c (default_destructor, default_destructor_location,
5797 default_printer, default_printer_location): Split each into tagged and
5799 (symbol_destructor_get, symbol_destructor_location_get,
5800 symbol_printer_get, symbol_printer_location_get): Implement tagged
5801 default and tagless default cases.
5802 (default_destructor_set, default_printer_set): Split each into tagged
5803 and tagless versions.
5804 * src/symtab.h: Update prototypes.
5805 * tests/actions.at (Default %printer and %destructor): Rename to...
5806 (Default tagless %printer and %destructor): ... this, and extend.
5807 (Per-type %printer and %destructor): Rename to...
5808 (Default tagged and per-type %printer and %destructor): ... this, and
5810 (Default %printer and %destructor for user-defined end token): Extend.
5811 (Default %printer and %destructor are not for error or $undefined):
5813 (Default %printer and %destructor are not for $accept): Update.
5814 (Default %printer and %destructor for mid-rule values): Extend.
5815 * tests/input.at (Default %printer and %destructor redeclared): Extend.
5816 (Unused values with default %destructor): Extend.
5818 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5820 Don't apply the default %destructor/%printer to an unreferenced midrule
5822 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
5823 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
5824 like $@n instead of just @n so that the default %destructor/%printer
5825 logic doesn't see them as user-defined symbols.
5826 (symbol_is_dummy): Check for both forms of the name.
5827 * src/reader.c (packgram): Remove the `$' from each midrule symbol
5828 name for which the midrule value is referenced in any action.
5829 * tests/actions.at (Default %printer and %destructor for mid-rule
5831 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
5832 for change to dummy symbol names.
5834 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
5836 Warn about unset midrule $$ if the corresponding $n is used.
5837 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
5839 (packgram): Before invoking grammar_rule_check on any rule, make sure
5840 all actions have already been scanned in order to set `used' flags.
5841 Otherwise, checking that a midrule's $$ is set will not always work
5842 properly because the midrule check must forward-reference the midrule's
5844 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
5847 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
5849 More improvements to the documentation of the prologue alternatives:
5850 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
5852 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
5853 some text to clarify the relative importance of the new directives and
5854 to show how these directives may be viewed as code labels.
5856 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
5858 Similar to the recently removed %before-header, add %code-top as the
5859 alternative to the pre-prologue. Mentioned at
5860 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
5861 Also, let the prologue alternatives appear in the grammar section.
5862 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
5863 (prologue_declaration): Move the existing prologue alternatives to...
5864 (grammar_declaration): ... here and add %code-top.
5865 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
5867 Clean up and extend documentation for the prologue alternatives.
5868 * NEWS (2.3a+): Describe prologue alternatives.
5869 * doc/bison.texinfo (Prologue): Move discussion of prologue
5871 (Prologue Alternatives): ... this new section, and extend it to discuss
5872 all 4 directives in detail.
5873 (Table of Symbols): Clean up discussion of prologue alternatives and
5876 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5878 DJGPP specific issues.
5880 * djgpp/config.bat: config.hin has been moved to lib. Adjust
5881 config.bat accordingly.
5882 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
5883 * djgpp/config.site: Likewise.
5885 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
5887 Replace %*-header with %provides, %requires, %code. See discussion at
5888 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
5890 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
5891 (b4_user_start_header): Remove.
5892 * data/glr.c: Use new macros instead of b4_*start_header
5894 * data/glr.cc: Likewise.
5895 * data/lalr1.cc: Likewise.
5896 * data/push.c: Likewise.
5897 * data/yacc.c: Likewise.
5899 * doc/bison.texinfo: Remove %before-header, rename
5900 %{start,end,after}-header to %requires, %provides, %code.
5902 * src/parse-gram.y: Likewise (also rename token names accordingly).
5903 * src/scan-gram.l: Likewise.
5904 * tests/actions.at: Likewise.
5906 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
5908 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
5909 Problem reported by Joel E. Denny.
5911 2006-10-14 Jim Meyering <jim@meyering.net>
5913 (Sync from coreutils.)
5914 Work also when the working directory (with e.g. coreutils sources)
5915 is version controlled with git, rather than CVS.
5916 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
5918 In messages and comments, say e.g., "checked-out sources",
5919 rather than "CVS sources".
5920 (version_controlled_file): New function. Work for git as well as
5921 for CVS. Don't use grep's -q option.
5922 (slurp): Call it here, in place of CVS-specific code.
5924 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
5926 Fix testsuite for ./configure --enable-gcc-warnings:
5927 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
5928 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
5929 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
5930 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
5931 * test/regression.at (Diagnostic that expects two alternatives):
5934 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
5936 * bootstrap.conf (gnulib_modules): Add config-h.
5937 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
5938 worry about HAVE_CONFIG_H.
5939 * lib/abitset.c: Likewise.
5940 * lib/bitset.c: Likewise.
5941 * lib/bitset_stats.c: Likewise.
5942 * lib/bitsetv-print.c: Likewise.
5943 * lib/bitsetv.c: Likewise.
5944 * lib/ebitset.c: Likewise.
5945 * lib/get-errno.c: Likewise.
5946 * lib/lbitset.c: Likewise.
5947 * lib/subpipe.c: Likewise.
5948 * lib/timevar.c: Likewise.
5949 * lib/vbitset.c: Likewise.
5950 * lib/bitset.c: Include "bitset.h" first, to test interface.
5951 * lib/bitset_stats.c: Include "bitset_stats.h" first.
5952 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
5953 * lib/bitsetv.c: Include "bitsetv.h" first.
5954 * lib/get-errno.c: Include "get-errno.h" first.
5955 * m4/.cvsignore: Add config-h.m4.
5956 * tests/actions.at (Default %printer and %destructor for ...):
5957 Adjust expected line numbers in output to reflect removal of #if
5958 HAVE_CONFIG_H lines.
5959 * tests/glr-regression.at (Missed %merge type warnings when ...):
5961 * tests/regression.at (Braced code in declaration in rules section):
5963 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
5964 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
5965 Include <config.h> unconditionally.
5967 * bootstrap: Sync from coreutils, as follows:
5969 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
5971 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
5972 variable was sometimes used without being initialized. This
5973 messed up the installation of the INSTALL file in some cases.
5975 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
5977 * bootstrap (usage, main program, symlink_to_gnulib): Add option
5978 --copy. Inspired by a suggestion from Bruno Haible.
5980 2006-10-03 Jim Meyering <jim@meyering.net>
5982 * bootstrap: Undo last change to this file, since now gnulib-tool
5983 sticks with the automake default in generating dependencies.
5985 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
5987 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
5988 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
5990 * doc/bison.1: Add copyright notice.
5992 * data/glr.c: Don't include <stdarg.h>; not used.
5994 * NEWS: The -g and --graph options now output graphs in Graphviz
5995 DOT format, not VCG format.
5996 * doc/bison.1: Likewise.
5997 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
5998 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
6000 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
6001 * TODO: Remove Graphviz entry.
6002 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
6003 remove vcg.c, vcg.h, vcg_defaults.h.
6004 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
6005 * src/graphviz.c, src/graphviz.h: New files.
6006 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
6007 * src/files.h: Make comment more generic.
6008 * src/main.c (main): Likewise.
6009 * src/print_graph.h: Likewise.
6010 * src/getargs.c (usage): Make usage description more generic.
6011 * src/print_graph.c: Include graphviz.h rather than vcg.h.
6012 (static_graph, fgraph): Remove. All uses changed to pass
6013 arguments instead of sharing a static var.
6014 (print_core, print_actions, print_state, print_graph):
6015 Output graphviz format rather than VCG format.
6016 * tests/.cvsignore: Remove *.vcg; add *.dot.
6017 * tests/output.at: Expect *.dot files, not *.vcg files.
6019 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
6020 accommodates the 2006-10-08 change.
6022 2006-10-11 Bob Rossi <bob@brasko.net>
6024 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
6025 (b4_yyssa, b4_yyerror_range): New macros.
6026 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
6027 (yypvarsinit): Remove init of removed fields.
6028 (yypushparse): Remove use of removed fields; use new macros instead.
6030 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6032 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
6033 in a push parser. Reindent slightly to match yacc.c better.
6035 2006-10-11 Bob Rossi <bob@brasko.net>
6037 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
6039 (yypvarsinit, yypushparse): Remove init of removed fields.
6040 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
6042 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6044 * THANKS: Add Paolo Bonzini and Bob Rossi.
6046 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
6048 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
6049 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
6050 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
6051 b4_define_user_cde and uses): Remove.
6052 (b4_comment, b4_prefix, b4_sync_start): New.
6053 * data/bison.m4: New file, with most of the content removed from c.m4.
6054 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
6055 * src/output.c (output_skeleton): Pass bison.m4.
6056 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
6059 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
6061 Fix test failure reported by Tom Lane in
6062 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
6063 and try to make such failures easier to catch in the future.
6064 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
6065 that's now the caller's responsibility.
6066 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
6067 Set yychar = YYEOF if it's negative.
6068 * tests/actions.at (yylex): Abort if asked to read past EOF.
6069 * tests/conflicts.at (yylex): Likewise.
6070 * tests/cxx-type.at (yylex): Likewise.
6071 * tests/glr-regression.at (yylex): Likewise.
6072 * tests/input.at (yylex): Likewise.
6073 * tests/regression.at (yylex): Likewise.
6074 * tests/torture.at (yylex): Likewise.
6076 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
6078 Fix problems with translating English-language diagnostics.
6079 * bootstrap: Fix bug introduced in recent bootstrap changes, with
6080 respect to bison-runtime pot generation. The YY_ stuff
6081 wasn't being captured.
6082 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
6083 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
6084 * runtime-po/POTFILES.in: Add data/push.c.
6086 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
6088 Merge bootstrap changes from coreutils.
6090 2006-09-28 Jim Meyering <jim@meyering.net>
6092 Automatically generated dependencies are important even
6093 when all of the sources in a directory come from gnulib.
6094 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
6095 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
6097 2006-09-23 Jim Meyering <jim@meyering.net>
6099 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
6101 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6103 * bootstrap: Add support for --force.
6104 (usage): New function. Describe usage less tersely.
6105 (CVS_only_file): New var.
6107 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
6109 * data/push.c (YYPUSH_MORE): Make it an enum instead.
6110 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
6111 Adjust white space and comments to match GNU style better.
6113 2006-09-20 Bob Rossi <bob@brasko.net>
6115 * data/push.c (yyresult_get): Remove function.
6116 (YYPUSH_MORE): Add #define.
6117 (yypushparse): Modify return value.
6119 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6121 * stamp-h.in: Remove; no longer needed.
6122 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
6123 Remove config.h, config.hin, intl (no longer created).
6124 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
6127 Sync bootstrap from coreutils, as follows:
6129 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
6131 * bootstrap (symlink_to_gnulib): New function.
6132 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
6133 to copies-of-gnulib.
6134 (cp_mark_as_generated, slurp, gnulib_files):
6135 Avoid making a copy if it's the same as the old version.
6136 (gnulib_files): Add support for this variable (used by Bison).
6138 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6140 * src/getargs.c (usage): Rework to use conventions similar to
6141 coreutils, to make translation a bit easier and the code a bit
6142 smaller. Problem reported by Tim Van Holder.
6144 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
6146 Use some of gnulib's new modules, taken from coreutils.
6148 * bootstrap: Sync from coreutils, except add support for gnulib_files.
6149 * bootstrap.conf: New file.
6150 (gnulib_modules): Add configmake, inttypes, unistd.
6151 (XGETTEXT_OPTIONS): Add complain, complain_at,
6152 fatal, fatal_at, warn, warn_at, unexpected_end.
6153 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
6154 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
6156 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
6158 (GNULIB_AUTOCONF_SNIPPET): Remove.
6159 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
6161 * lib/.cvsignore: Add inttypes_.h.
6162 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
6163 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
6164 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
6165 no-longer-necessary initializations.
6166 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
6167 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
6168 use the unistd module.
6169 * src/system.h: Likewise.
6170 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
6171 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
6172 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
6173 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
6174 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
6175 * src/system.h: Include inttypes.h unconditionally, now that we
6176 use the inttypes module. Don't bother to include stdint.h, since
6177 inttypes.h now does that for us.
6178 (LOCALEDIR): Remove, now that we use the configmake module.
6179 * src/getargs.c: Include configmake.h.
6180 * src/main.c: Likewise.
6181 * src/output.c: Likewise.
6182 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
6183 not from $abs_top_builddir, since config.h moved.
6186 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
6187 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
6189 * src/parse-gram.y (symbol_declaration): Don't put statements
6190 before declarations; it's not portable to C89.
6191 * src/scan-code.l (handle_action_at): Likewise.
6193 * src/scan-code.l: Always initialize braces_level; the old code
6194 left it uninitialized and therefore had undefined behavior.
6196 Don't attempt to redefine 'assert', since it runs afoul of
6197 systems where standard headers (mistakenly) include <assert.h>.
6198 Instead, define and use our own alternative, called 'aver'.
6199 * src/reader.c: Don't include assert.h, since we no longer
6201 * src/scan-code.l: Likewise.
6202 * src/system.h (assert): Remove, replacing with....
6203 (aver): New function, taking a bool arg. All uses changed.
6204 * src/tables.c (pack_vector): Ensure that aver arg is bool,
6205 not merely an integer.
6207 2006-09-15 Bob Rossi <bob@brasko.net>
6209 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
6210 * data/c.m4 (YYPUSH): New.
6211 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
6212 * src/getargs.c (push_parser): New var.
6213 * src/getargs.h (push_parser): New declaration.
6214 * src/output.c (prepare): Add macro insertion of `push_flag'.
6215 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
6216 (prologue_declaration): Parse %push-parser.
6217 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
6218 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
6219 list of removed lines from the traces observed.
6220 (AT_CHECK_CALC_LALR): Added push parser tests.
6222 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
6224 * NEWS: Version 2.3a.
6225 * configure.ac (AC_INIT): Likewise.
6227 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
6228 "#define YYSTYPE int" that caused "make maintainer-check" to fail
6229 due to header ordering dependencies. I don't know why the #define
6232 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
6233 runtime cost when YYDEBUG is not defined, and so that some tests
6234 that used to fail now work. Problem and initial suggestion by
6236 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
6237 * data/glr.cc (b4_parser_class_name):
6238 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
6239 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
6240 (yydebug_) [YYDEBUG]: New member.
6241 (yycdebug_): Now defined only if YYDEBUG.
6242 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
6243 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
6244 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
6246 (debug_stream, set_debug_stream, debug_level, set_debug_level):
6247 Define only if YYDEBUG.
6248 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
6250 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
6251 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
6252 AT_CHECK_CALC_GLR_CC that are working now.
6254 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
6256 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
6257 We don't need them in glr.cc, and glr.c defines them.
6258 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
6259 assumes that defining it to anything is the same as defining
6260 it to 1. Problem reported by Paolo Bonzini.
6262 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
6264 * data/c.m4 (b4_null, b4_case): Define.
6265 * src/output.c (prepare_symbols): Use b4_null.
6266 (user_actions_output): Use b4_case.
6268 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
6270 * data/glr.c (b4_shared_declarations): Put start-header first,
6271 before any #includes that we generate, so that feature-test
6272 macros work. Problem reported by Michael Deutschmann in
6273 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
6274 * data/lalr1.cc: Likewise.
6275 * doc/bison.texinfo (Prologue): Document that feature-test macros
6276 should be defined before any Bison declarations.
6277 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
6278 that depend on location.hh after, not before, Bison decls, since
6279 we now include location.hh after the first user prologue.
6281 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
6282 Sander Brandenburg in
6283 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
6284 Also, fix minor white space and comment issues.
6285 (Prologue): Mention that it's better to define feature-test macros
6286 before Bison declarations. Problem reported by Michael Deutschmann.
6288 * README-cvs: Fix typo: "&" should be "&&". Problem reported
6290 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
6291 This adjusts to recent gnulib changes.
6293 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
6295 Finish implementation of per-type %destructor/%printer. Discussed
6297 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
6299 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
6300 * NEWS (2.3+): Add a description of this feature to the default
6301 %destructor/%printer description.
6302 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
6303 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
6304 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
6305 list node contains a semantic type.
6306 * src/symtab.c, src/symtab.h: Extend with a table that associates
6307 semantic types with their %destructor's and %printer's.
6308 (semantic_type_from_uniqstr, semantic_type_get,
6309 semantic_type_destructor_set, semantic_type_printer_set): New functions
6310 composing the public interface of that table.
6311 (symbol_destructor_get, symbol_destructor_location_get,
6312 symbol_printer_get, symbol_printer_location_get): If there's no
6313 per-symbol %destructor/%printer, look up the per-type before trying
6315 * tests/actions.at (Per-type %printer and %destructor): New test case.
6316 * tests/input.at (Default %printer and %destructor redeclared):
6317 Extend to check that multiple occurrences of %symbol-default in a
6318 single %destructor/%printer declaration is an error.
6319 (Per-type %printer and %destructor redeclared, Unused values with
6320 per-type %destructor): New test cases.
6322 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
6324 Require default %destructor/%printer to be declared using
6325 %symbol-default instead of an empty symbol list, and start working on
6326 new per-type %destructor/%printer. Discussed at
6327 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
6328 * NEWS (2.3+): Add %symbol-default to example.
6329 * bison.texinfo (Freeing Discarded Symbols): Likewise.
6330 (Table of Symbols): Add entry for %symbol-default.
6331 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
6332 (generic_symlist, generic_symlist_item): New nonterminals for creating
6333 a list in which each item is a symbol, semantic type, or
6335 (grammar_declaration): Use generic_symlist in %destructor and %printer
6336 declarations instead of symbols.1 or an empty list.
6337 (symbol_declaration, precedence_declaration, symbols.1): Update actions
6338 for changes to symbol_list.
6339 * src/reader.c: Update for changes to symbol_list.
6340 * src/scan-code.l: Likewise.
6341 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
6342 * src/symlist.c, src/symlist.h: Extend such that a list node may
6343 represent a semantic type or a %symbol-default in addition to just an
6344 ordinary symbol. Add switched functions for setting %destructor's and
6346 * tests/actions.at, tests/input.at: Add %symbol-default to all default
6347 %destructor/%printer declarations.
6349 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
6351 Whether the default %destructor/%printer applies to a particular symbol
6352 isn't a question of whether the user *declares* that symbol (in %token,
6353 for example). It's a question of whether the user by any means
6354 *defines* the symbol at all (by simply using a char token, for
6355 example). $end is defined by Bison whereas any other token with token
6356 number 0 is defined by the user. The error token is always defined by
6357 Bison regardless of whether the user declares it with %token, but we
6358 may one day let the user define error as a nonterminal instead.
6359 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
6360 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
6361 the meaning of "user-defined".
6362 * tests/actions.at (Default %printer and %destructor for user-declared
6363 end token): Rename to...
6364 (Default %printer and %destructor for user-defined end token): ...
6367 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
6368 computation of whether to apply the default, don't maintain a list of
6369 every Bison-defined symbol. Instead, just check for a first character
6370 of '$', which a user symbol cannot have, and check for the error token.
6372 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
6374 Don't apply the default %destructor or %printer to the error token,
6375 $undefined, or $accept. This change fits the general rule that the
6376 default %destructor and %printer are only for user-declared symbols,
6377 and it solves several difficulties that are described in the new test
6379 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
6380 * tests/actions.at (Default %printer and %destructor are not for error
6381 or $undefined, Default %printer and %destructor are not for $accept):
6384 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
6386 Allow %start after the first rule.
6387 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
6388 when parsing the first rule.
6389 (check_and_convert_grammar): Search for it here after all grammar
6390 declarations have been parsed. Skip midrules, which have dummy LHS
6392 * src/symtab.c (symbol_is_dummy): New function.
6393 * src/symtab.h (symbol_is_dummy): Declare it.
6394 * tests/input.at (%start after first rule): New test.
6396 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
6398 Redo some of the previous commit: add back the ability to use
6399 non-aliased/undeclared string literals since it might be useful to
6400 those declaring %token-table.
6401 * src/reader.c (check_and_convert_grammar): Undo changes in previous
6402 commit: don't worry about complaints from symbols_pack.
6403 * src/symtab.c (symbol_new, symbol_class_set,
6404 symbol_check_alias_consistency): Undo changes in previous commit: count
6405 each string literal as a new symbol and token, assign it a symbol
6406 number, and don't complain about non-aliased string literals.
6407 (symbols_pack): Since symbol_make_alias still does not decrement symbol
6408 and token counts but does still set aliased tokens to the same number,
6409 symbol_pack_processor now leaves empty slots in the symbols array.
6411 * tests/regression.at (Undeclared string literal): Remove test case
6412 added in previous commit since non-aliased string literals are allowed
6414 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
6415 remove unnecessary string literal declarations.
6416 * tests/sets.at (Firsts): Likewise.
6418 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
6420 Don't allow an undeclared string literal, but allow a string literal to
6421 be used before its declaration.
6422 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
6423 symbols_pack complained.
6424 * src/symtab.c (symbol_new): Don't count a string literal as a new
6426 (symbol_class_set): Don't count a string literal as a new token, and
6427 don't assign it a symbol number since symbol_make_alias does that.
6428 (symbol_make_alias): It's not necessary to decrement the symbol and
6429 token counts anymore. Don't assume that an alias declaration occurs
6430 before any uses of the identifier or string, and thus don't assert that
6431 one of them has the highest symbol number so far.
6432 (symbol_check_alias_consistency): Complain if there's a string literal
6433 that wasn't declared as an alias.
6434 (symbols_pack): Bail if symbol_check_alias_consistency failed since
6435 symbol_pack asserts that every token has been assigned a symbol number
6436 although undeclared string literals have not.
6437 * tests/regression.at (String alias declared after use, Undeclared
6438 string literal): New test cases.
6439 (Characters Escapes, Web2c Actions): Declare string literals as
6441 * tests/sets.at (Firsts): Likewise.
6443 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
6445 In the grammar scanner, STRING_FINISH unclosed constructs and return
6446 them to the parser in order to improve error messages.
6447 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
6448 SC_BRACED_CODE, SC_PROLOGUE): Implement.
6449 * tests/input.at (Unclosed constructs): New test case.
6450 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
6453 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
6456 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
6458 Handle string aliases for character tokens correctly.
6459 * src/symtab.c (symbol_user_token_number_set): If the token has an
6460 alias, check and set its alias's user token number instead of its own,
6461 which is set to indicate the alias. Previously, every occurrence of
6462 the character token in the grammar overwrote that alias indicator with
6464 * tests/input.at (String aliases for character tokens): New test.
6466 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
6468 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
6470 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
6472 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
6473 to prevent failures when building on older platforms.
6474 Check for autopoint failure.
6475 Set XGETTEXT_OPTIONS to values that check for C format strings,
6476 so that translators are warned about them (this also helps
6477 prevent core dumps).
6479 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
6480 function, since it simplifies our code a bit.
6482 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
6483 rather than -W, so we don't get bogus warnings about sign comparisons.
6484 Add -Wpointer-arith, since that warning is useful (it reports code
6485 that does not conform to C89 and that some compilers reject).
6486 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
6487 since it's no longer needed.
6489 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
6491 Clean up scanners a bit.
6492 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
6493 definitions so gcc won't warn when obstack_for_string is unused.
6494 * src/scan-code.l: config.h and system.h are already #include'd by
6495 scan-code-c.c, so get rid of them here.
6496 * src/scan-gram.l: Likewise.
6497 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
6498 definitions rather than duplicating the rest of it.
6499 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
6501 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
6503 Suppress signed/unsigned comparison warnings for yycheck.
6504 * data/c.m4 (b4_safest_int_type): New macro.
6505 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
6506 a signed int type, cast it to b4_safest_int_type first.
6507 * data/yacc.c: Likewise.
6508 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
6511 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
6513 * doc/bison.texinfo: Fix some typos.
6515 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
6517 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
6518 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
6520 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
6521 the latest gnulib does this a different way.
6522 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
6523 translation was patched, so stop omitting it.
6525 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
6527 Enable declaration of default %printer/%destructor. Make the parser
6528 use these for all user-declared grammar symbols for which the user does
6529 not declare a specific %printer/%destructor. Thus, the parser uses it
6530 for token 0 if the user declares it but not if Bison generates it as
6531 $end. Discussed starting at
6532 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
6533 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
6535 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
6536 * NEWS (2.3+): Mention.
6537 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
6538 declare a %destructor for a mid-rule's semantic value. It's just
6539 impossible to declare one specific to it.
6540 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
6541 code. Describe default %destructor form.
6542 * src/parse-gram.y (grammar_declaration): Parse default
6543 %printer/%destructor declarations.
6544 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
6545 and symbol_destructor_location_get rather than accessing the destructor
6546 and destructor_location members of struct symbol.
6547 (symbol_printers_output): Likewise but for %printer's.
6548 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
6550 * src/symtab.c (default_destructor, default_destructor_location,
6551 default_printer, default_printer_location): New static global
6552 variables to record the default %destructor and %printer.
6553 (symbol_destructor_get, symbol_destructor_location_get,
6554 symbol_printer_get, symbol_printer_location_get): New functions to
6555 compute the appropriate %destructor and %printer for a symbol.
6556 (default_destructor_set, default_printer_set): New functions to set the
6557 default %destructor and %printer.
6558 * src/symtab.h: Prototype all those new functions.
6559 * tests/actions.at (Default %printer and %destructor): New test to
6560 check that the right %printer and %destructor are called, that they're
6561 not called for $end, and that $$ and @$ work correctly.
6562 (Default %printer and %destructor for user-declared end token): New
6563 test to check that the default %printer and %destructor are called for
6564 a user-declared end token.
6565 * tests/input.at (Default %printer and %destructor redeclared, Unused
6566 values with default %destructor): New tests to check related grammar
6567 warnings and errors.
6569 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
6571 Clean up handling of %destructor for the end token (token 0).
6572 Discussed starting at
6573 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
6575 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
6577 Make the skeletons consistent in how they pop the end token and invoke
6579 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
6580 state, which has token number 0, since this would invoke the
6581 %destructor for the end token.
6582 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
6583 until after shifting the end token, or else it won't be popped.
6584 * data/yacc.c (yyparse): Likewise.
6586 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
6587 it's the end token. Upon termination, destroy an unshifted lookahead
6588 even when it's the end token.
6589 * data/lalr1.cc (yy::parser::parse): Likewise.
6590 * data/yacc.c (yyparse): Likewise.
6592 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
6593 value warnings for the end token when the user gives the end token a
6596 * tests/actions.at (Printers and Destructors): Test all the above.
6598 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
6600 Update to latest gnulib and gettext versions.
6601 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
6603 (gnulib_files): Add m4/warning.m4. Don't worry about files
6604 overwritten by autopoint.
6605 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
6606 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
6608 Don't use autoreconf; instead, invoke autopoint etc. by hand,
6609 so that we can remove the intl files at a better time.
6610 (intl_files_to_remove): Remove aclocal.m4, since it gets
6611 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
6612 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
6613 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
6614 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
6615 Remove datarootdir hack; no longer needed.
6616 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
6617 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
6618 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
6620 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
6621 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
6623 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
6625 * bootstrap: Adjust to today's change to gnulib-tool by invoking
6626 it with --assume-autoconf='latest-stable'.
6628 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
6630 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
6631 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
6633 * src/muscle_tab.h (muscle_grow): Replace the header comments with
6634 those from muscle_tab.c since the old ones are misleading.
6636 2006-07-13 Akim Demaille <akim@epita.fr>
6638 Support %define "KEY" {VALUE}.
6639 * src/scan-code.h, src/scan-code.l (translate_action)
6640 (translate_rule_action, translate_symbol_action, translate_code):
6641 Return char *, not const char *.
6642 * src/parse-gram.y (declaration): Rename as...
6643 (prologue_declaration): this.
6644 (string_content): Remove this nonterminal, use STRING.
6645 (braceless, content, content.opt): New nonterminal.
6647 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
6649 * src/scan-gram.l (getargs.h): Don't include it.
6651 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
6653 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
6654 rather than a for-loop that declares a local bool variable. This
6655 should work around a compatibility problem with a Cray x1e C++
6656 compiler reported by Hung Nguyen in
6657 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
6658 The for-loop was introduced in the 2004-11-17 change but I don't
6659 know why it was needed.
6661 2006-07-12 Akim Demaille <akim@epita.fr>
6663 * data/c.m4: Comment changes.
6665 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
6667 * src/complain.c (error_message, ERROR_MESSAGE): New.
6669 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
6670 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
6672 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
6674 * NEWS: Instead of %union, you can define and use your own union type
6675 YYSTYPE if your grammar contains at least one <type> tag.
6676 Your YYSTYPE need not be a macro; it can be a typedef.
6677 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
6678 (Union Decl, Decl Summary): Document this.
6679 * data/glr.c (YYSTYPE): Implement this.
6680 * data/glr.cc (YYSTYPE): Likewise.
6681 * data/lalr1.cc (YYSTYPE): Likewise.
6682 * data/yacc.c (YYSTYPE): Likewise.
6683 * src/output.c (prepare): Output tag_seen_flag.
6684 * src/parse-gram.y (declaration, grammar_declaration):
6685 Use 'union_seen' rather than 'typed' to determine whether
6686 %union has been seen, since grammars can now be typed without
6688 (symbol_declaration, type.opt, symbol_def):
6689 Keep track of whether a tag has been seen.
6690 * src/reader.c (union_seen, tag_seen): New vars.
6692 * src/reader.h (union_seen, tag_seen, typed): Likewise.
6693 * src/scan-code.l (untyped_var_seen): New variable.
6694 (handle_action_dollar): Adjust to above changes.
6695 (handle_action_dollar, handle_action_at):
6696 Improve overflow checking for outlandish numbers.
6697 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
6698 avoid new diagnostics generated by above changes.
6699 * tests/regression.at (YYSTYPE typedef): Add test to check
6700 for type tags without %union.
6702 * src/symlist.c (symbol_list_length): Return int, not unsigned
6703 int, since callers expect int. This may need to get revisited
6704 once we have proper integer overflow checking.
6706 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
6707 object is now static.
6709 * src/getargs.c (flags_argmatch): Return void, not int,
6710 to pacify ./configure --enable-gcc-warnings.
6712 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
6713 since last_string is already defined to FLEX_PREFIX (last_string).
6715 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
6717 Implement --warnings/-W.
6718 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
6720 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
6722 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
6723 (warnings_args, warnings_types): New.
6724 (getargs, short_options, long_options): Accept -W/--warnings.
6725 Sort the options by alphabetical order, upper case letter right
6726 before its lower case.
6728 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
6730 Change %merge result type clash warnings to errors. Discussed at
6731 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
6732 * src/reader.c (record_merge_function_type): Use complain_at.
6733 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6734 declared later): Update test case results.
6736 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
6738 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
6739 to be in alphabetical order.
6740 (trace_args): Spelling fixes.
6742 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
6744 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
6745 so they don't collide with user-defined macros.
6746 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
6747 this was never guaranteed, and now that we're using gnulib stdint,
6748 which defines int_fast16_t to long int, the problem is exposed.
6750 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
6752 * data/c.m4 (b4_basename): Simplify a bit, since we don't
6753 need the full POSIX semantics (and weren't implementing them
6756 Adjust to Autoconf 2.60 and today's gnulib.
6757 * bootstrap (gnulib_modules): Add stdint.
6758 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
6759 no longer copies it.
6760 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
6761 since stdint needs the former and wcwidth (which is now required
6762 by mbswidth) needs the latter.
6763 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
6764 work around a compatibility glitch between gettext 0.14.6 and
6766 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
6767 Do not check for uintptr_t, since new stdint module does the right
6769 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
6770 Add stdint.h, stdint_.h, wcwidth.h.
6771 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
6772 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
6773 stdint.m4, wchar_t.m4, wcwidth.m4.
6774 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
6775 usual order for ../lib/*.h files.
6776 (file_name_split): Use last_component, not base_name, to adjust
6778 * src/parse-gram.h: Include <strverscmp.h> in the usual order
6779 for ../lib/*.h files.
6780 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
6781 Define unconditionally, since we now assume the stdint module.
6782 * src/scan-skel.l: Include <dirname.h>.
6783 (BASE_QPUTS): Use last_component, not base_name.
6784 * src/system.h: Include <unlocked-io.h> in the usual order
6785 for ../lib/*.h files. Include <stdint.h> unconditionally,
6786 since we now use the stdint module.
6787 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
6788 HAVE_UINTPTR_T, since we now use the stdint module.
6789 (base_name): Remove decl, since files now include <dirname.h>
6792 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
6794 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
6796 * data/yacc.c, data/glr.c, data/location.cc: Use them.
6797 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
6799 * tests/calc.at: Adjust.
6801 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
6803 * data/c.m4 (b4_basename): New.
6804 (b4_syncline): Also output the location of its invocation (from
6806 (b4_user_action, b4_define_user_action, b4_user_actions)
6807 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
6808 (b4_user_stype): New.
6809 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
6811 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
6813 In the grammar file, the first column is 1 not 0 on the first line as
6814 on every other line.
6815 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
6816 * tests/input.at (Torturing the Scanner): Update output.
6818 * src/scan-gram.l (scanner_cursor): Declare it static.
6820 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
6822 In warnings, say "previous declaration" rather than "first
6824 * src/symtab.c (redeclaration): Do that here.
6825 * src/reader.c (record_merge_function_type): In the case of a result
6826 type clash, report the previous declaration rather than the very first
6827 one in the grammar file.
6828 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6829 declared later): Add a third declaration to check this behavior.
6830 * tests/input.at (Incompatible Aliases): Update output.
6832 2006-06-27 Akim Demaille <akim@epita.fr>
6834 * doc/Doxyfile.in: New.
6835 * doc/Makefile.am: Use it.
6836 * src/lalr.h, src/symtab.h: Initial doxygenation.
6838 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6840 Don't miss %merge result type warnings just because the LHS types are
6841 declared after the %merge. This continues the effort of the previous
6843 * src/reader.c (get_merge_function): Don't set the merger type yet.
6844 (record_merge_function_type): New function for setting the merger type
6845 and checking for clashes.
6846 (grammar_current_rule_merge_set): Set the location of the %merge for
6848 (packgram): Invoke record_merge_function_type for each rule now that
6849 all symbol type declarations have been parsed.
6850 * src/reader.h (merger_list.type_declaration_location): New member
6851 storing the location of the first %merge from which the type for this
6852 merging function was derived.
6853 * src/symlist.h (symbol_list.merger_declaration_location): New member
6854 storing the location of a rule's %merge, if any.
6855 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6856 declared later): New test to catch the error fixed by the above patch.
6858 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6860 Get action warnings (grammar_rule_check) right even when symbol
6861 declarations appear after the rules. Discussed at
6862 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
6864 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
6865 Don't mistake the type of $$ in a midrule to be that of its parent
6867 * src/reader.c (grammar_current_rule_end): Don't invoke
6868 grammar_rule_check yet since not all symbol declarations may have been
6870 (grammar_midrule_action): Likewise.
6871 Don't record whether the midrule's $$ has been used yet since actions
6872 haven't been translated yet.
6873 Record the midrule's parent rule and its RHS index within the parent
6875 (grammar_current_rule_action_append): Don't translate the action yet
6876 since not all symbol declarations may have been parsed yet and, thus,
6877 warnings about types for $$, $n, @$, and @n can't be reported yet.
6878 (packgram): Translate the action and invoke grammar_rule_check now that
6879 all symbol declarations have been parsed.
6880 * src/scan-code.l (handle_action_dollar): Now that this is invoked
6881 after parsing the entire grammar file, the symbol list here in the case
6882 of a midrule is actually the midrule's empty RHS, so reference its
6883 parent rule's RHS where necessary.
6884 On the other hand, now that you can already know it's a midrule, you
6885 aren't forced to think $$ has the same type as its parent rule's $$.
6886 (handle_action_at): In the case of a midrule, reference the parent rule
6888 * src/symlist.c (symbol_list_new): Initialize new midrule-related
6890 (symbol_list_length): Now that this is invoked after all rules have
6891 been parsed, a NULL symbol (rather than a NULL symbol list node)
6892 terminates a rule. symbol_list_print already does this correctly.
6893 * src/symlist.h (symbol_list.midrule_parent_rule,
6894 symbol_list.midrule_parent_rhs_index): New members so that midrules can
6895 remember their relationships with their parents.
6896 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
6897 fixed by the above patch.
6898 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
6900 (Unused values): ... this old test case and...
6901 (Unused values before symbol declarations): ... this new test case.
6902 This one is the same as `Unused values' except that all symbol
6903 declarations appear after the rules in order to catch the rest of the
6904 errors fixed by the above patch.
6906 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6909 * src/reader.c (current_rule): Declare it static since it's no longer
6910 used outside this file.
6911 (grammar_current_rule_action_append): Remove redundant arguments from
6912 translate_rule_action invocation.
6913 * src/reader.h (current_rule): Remove this unused extern.
6914 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
6915 * src/scan-code.l (translate_rule_action): Likewise.
6917 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
6919 Clean up yesterday's patch.
6920 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
6922 * src/reader.c (grammar_current_rule_action_append): ... here for
6923 consistency with grammar_current_rule_symbol_append.
6924 * tests/regression.at (Braced code in declaration in rules section):
6925 Make yyerror and yylex static as usual.
6927 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
6929 Fix bug that mistakes braced code in a declaration in the rules section
6930 to be a rule action. Mentioned at
6931 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
6932 * src/scan-gram.l: Move midrule action detection from the start of the
6933 scanning of any braced code to...
6934 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
6935 action. For readability, use $2 and @2 rather than the equivalent
6937 * tests/regression.at (Braced code in declaration in rules section):
6938 New test to catch the error fixed by the above patch.
6940 Work on code readability some.
6941 * src/scan-code.l (current_rule): Get rid of this misleading and
6942 redundant declaration: it's actually extern'ed in reader.h.
6943 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
6944 translate_action): Add a rule argument and use it instead of the global
6946 (translate_rule_action): This already receives current_rule through an
6947 argument, so pass it on to translate_action instead of assigning
6948 current_rule to current_rule.
6949 (translate_symbol_action, translate_code): Pass rule = NULL to
6952 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
6954 Rename %before-definitions to %start-header and %after-definitions to
6955 %end-header. Don't use these declarations to separate pre-prologue
6956 blocks from post-prologue blocks. Add new order-independent
6957 declarations %before-header and %after-header as alternatives to the
6958 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
6959 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
6960 * NEWS (2.3+): Update for these changes.
6961 * data/glr.c (b4_before_definitions): Update to...
6962 (b4_start_header): ... this.
6963 (b4_after_definitions): Update to...
6964 (b4_end_header): ... this.
6965 * data/glr.cc: Likewise.
6966 * data/lalr1.cc: Likewise.
6967 * data/yacc.c: Likewise.
6968 * doc/bison.texinfo (The prologue): Update names, and replace remaining
6969 prologue blocks with %*-header declarations.
6970 (Calc++ Parser): Likewise.
6971 (Decl Summary): Update names.
6972 (Table of Symbols): Update description.
6973 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
6974 (PERCENT_END_HEADER): ... this.
6975 (PERCENT_BEFORE_DEFINITIONS): Update to...
6976 (PERCENT_START_HEADER): ... this.
6977 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
6978 (declaration): Update token names and m4 macro names.
6979 When parsing %end-header and %start-header, invoke translate_code
6980 before muscle_code_grow, and no longer set global booleans to remember
6981 whether these declarations have been seen.
6982 Parse new %after-header and %before-header.
6983 * src/reader.c (before_definitions, after_definitions): Remove.
6984 (prologue_augment): Accept a new bool argument to specify whether to
6985 augment the pre-prologue or post-prologue.
6986 * src/reader.h (before_definitions, after_definitions): Remove these
6988 (prologue_augment): Add new bool argument.
6989 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
6990 (PERCENT_END_HEADER): ... this.
6991 (PERCENT_BEFORE_DEFINITIONS): Update to...
6992 (PERCENT_START_HEADER): ... this.
6993 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
6994 * tests/actions.at (Printers and Destructors): Update names.
6996 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
6998 Add comparison operators for C++ location classes. Discussed at
6999 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
7000 * data/c++.m4 (b4_define_location_comparison): New boolean %define
7001 declaration indicating whether filename_type has an operator==. If
7002 filename_type is `std::string', it defaults to `1', `0' otherwise.
7003 * data/location.cc: Iff b4_define_location_comparison is `1', add
7004 operator== and operator!= for class position and for class location.
7007 * src/scan-action.l: Remove unused file.
7008 * src/symtab.c (symbol_printer_set): Use printer_location not
7009 destructor_location.
7010 * src/symtab.h (struct symbol): Replace incorrect source comment for
7012 * tests/input.at (Incompatible Aliases): Update output with correct
7015 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
7017 Don't put the pre-prologue in the header file. For the yacc.c code
7018 file and the glr.c header and code files, move the pre-prologue before
7019 the token definitions. Add new %before-definitions and
7020 %after-definitions to declare code that will go in both the header file
7021 and code file. Discussed at
7022 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
7023 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
7025 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
7026 * NEWS (2.3+): Describe these changes.
7027 * data/glr.c (b4_pre_prologue): Move from within to before...
7028 (b4_shared_declarations): ... this.
7029 Add new b4_before_definitions before b4_token_enums.
7030 Add new b4_after_definitions at the end.
7031 * data/glr.cc (b4_pre_prologue): Replace with...
7032 (b4_before_definitions): ... this in the header file.
7033 (b4_after_definitions): New near the end of the header file.
7034 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
7035 code file right before including the header file.
7036 (b4_before_definitions): New in the previous position of
7037 b4_pre_prologue in the header file.
7038 (b4_after_definitions): New near the end of the header file.
7039 * data/yacc.c: Clean up some m4 quoting especially in the header file.
7040 (b4_token_enums_defines): In the code file, move to right before
7041 YYSTYPE for consistency with the header file.
7042 (b4_before_definitions): New right before b4_token_enums_defines in
7043 both the header and code file.
7044 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
7045 header and code file.
7046 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
7047 of prologues for %union dependencies.
7048 (Decl Summary): In %defines description, mention the effect of
7049 %before-definitions and %after-definitions on the header file.
7050 (Calc++ Parser): Forward declare driver in a %before-definitions rather
7051 than in the pre-prologue so that make check succeeds.
7052 (Table of Symbols): Add entries for %before-definitions and
7054 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
7055 %before-definitions.
7056 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
7057 (declaration): Parse those declarations and append to
7058 b4_before_definitions and b4_after_definitions, respectively.
7059 * src/reader.c (before_definitions, after_definitions): New bools to
7060 track whether those declarations have been seen.
7061 (prologue_augment): Add to the post-prologue if %union,
7062 %before-definitions, or %after-definitions has been seen.
7063 * src/reader.h (before_definitions, after_definitions): New extern's.
7064 * src/scan-gram.l: Scan the new declarations.
7065 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
7066 prologue block in a %before-definitions or a %after-definitions based
7067 on whether the %union is declared.
7068 * tests/regression.at (Early token definitions with --yacc, Early token
7069 definitions without --yacc): Move tests for token definitions into the
7070 post-prologue since token names are no longer defined in the
7073 2006-06-20 Akim Demaille <akim@epita.fr>
7075 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
7076 (symbol_get): Use it.
7077 * src/parse-gram.y: Use it.
7079 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
7081 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
7082 build succeeds when configured with --enable-gcc-warnings.
7084 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
7086 * src/parse-gram.y (char_name): New function.
7087 (CHAR, STRING, string_content): For %printer, properly escape.
7088 (ID): Prefer fputs to fprintf.
7089 (id): Reindent to be consistent with other rules.
7090 Properly quote char.
7092 The Translation Project changed its way of publishing translations
7093 to maintainers. I haven't received any responses to my request
7094 for supporting the old way, or for documenting the new way. I
7095 have modified 'bootstrap' to use screen scraping
7096 (in this case, HTML scraping). This is unreliable and inelegant,
7097 but I don't see any better way. Yuck.
7098 * bootstrap (TP_URL, WGET_COMMAND): New vars.
7099 (get_translations): New function, which uses HTML scraping to
7100 deduce locations of latest translations.
7101 Use this function to grab both bison and bison-runtime .po files.
7102 Don't bother priming the pump for the runtime-po domain any more,
7103 as it's now translated better than bison is.
7105 2006-06-19 Akim Demaille <akim@epita.fr>
7107 * src/scan-gram.l: No longer "parse" things after `%union' until
7108 `{'. Rather, return a single "%union" token.
7109 No longer make symbols: return strings, and leave the conversion
7110 to symbols to the parser.
7111 (SC_PRE_CODE, token_type): Remove.
7112 * src/parse-gram.y (%union): New field `character'.
7115 (ID, ID_COLON): Now that the scanner no longer makes them
7116 identifiers, adjust all uses to invoke symbol_get.
7117 (id_colon): New, wraps the conversion from string to symbol.
7118 (%union): Accept a possible union_name.
7119 (symbol): Now can be a char.
7120 * data/c.m4 (b4_union_name): Leave a default value.
7121 * data/glr.c, data/yacc.c: Use it.
7123 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
7125 For associating token numbers with token names for "yacc.c", don't use
7126 #define statements unless `--yacc' is specified; always use enum
7127 yytokentype. Most important discussions start at:
7128 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
7129 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
7131 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
7132 * NEWS (2.3+): Mention.
7133 * data/c.m4 (b4_yacc_if): New.
7134 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
7136 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
7137 on token name definitions.
7138 * src/getargs.c (usage): Capitalize `Yacc' in English.
7139 * src/output.c (prepare): Define b4_yacc_flag.
7140 * tests/regression.at (Early token definitions): Test that tokens names
7141 are defined before the pre-prologue not just before the post-prologue.
7142 Remove this test case and copy to...
7143 (Early token definitions with --yacc): ... this to test #define's.
7144 (Early token definitions without --yacc): ... and this to test enums.
7146 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
7148 * NEWS: Reword the post-2.3 change to not be so optimistic about
7149 removing the old "look-ahead" spelling.
7150 Update previous look-ahead/lookahead change reports.
7151 * REFERENCES: look-ahead -> lookahead (since that's
7152 what he actually wrote).
7153 * doc/refcard.tex: look ahead -> lookahead,
7154 look-ahead -> lookahead
7156 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
7158 For consistency, use `lookahead' instead of `look-ahead' or
7159 `look_ahead'. Discussed starting at
7160 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
7162 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
7163 * NEWS: For the next release, note the change to `--report'.
7164 * TODO, doc/bison.1: Update English.
7165 * doc/bison.texinfo: Update English.
7166 (Understanding Your Parser, Bison Options): Document as
7167 `--report=lookahead' rather than `--report=look-ahead'.
7168 * src/conflicts.c: Update English in comments.
7169 (lookahead_set): Rename from look_ahead_set.
7170 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
7171 (resolve_sr_conflict): Rename local look_ahead_tokens to
7172 lookahead_tokens, and update other uses.
7173 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
7174 count_rr_conflicts, conflicts_free): Update uses.
7175 * src/getargs.c (report_args): Move "lookahead" before alternate
7177 (report_types): Update uses.
7178 (usage): For `--report' usage description, state `lookahead' spelling
7179 rather than `look-ahead'.
7180 * src/getargs.h (report.report_lookahead_tokens): Rename from
7181 report_look_ahead_tokens.
7182 * src/lalr.c: Update English in comments.
7183 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
7184 (state_lookahead_tokens_count): Rename from
7185 state_look_ahead_tokens_count.
7186 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7187 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
7188 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7190 Update English in output.
7191 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
7192 * src/print.c: Update English in comments.
7193 (lookahead_set): Rename from look_ahead_set.
7194 (print_reduction): Rename argument lookahead_token from
7196 (print_core, state_default_rule, print_reductions, print_results):
7198 * src/print_graph.c: Update English in comments.
7199 (print_core): Update uses.
7200 * src/state.c: Update English in comments.
7201 (reductions_new): Update uses.
7202 (state_rule_lookahead_tokens_print): Rename from
7203 state_rule_look_ahead_tokens_print, and update other uses.
7204 * src/state.h: Update English in comments.
7205 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
7206 (state_rule_lookahead_tokens_print): Rename from
7207 state_rule_look_ahead_tokens_print.
7208 * src/tables.c: Update English in comments.
7209 (conflict_row, action_row): Update uses.
7210 * tests/glr-regression.at
7211 (Incorrect lookahead during deterministic GLR,
7212 Incorrect lookahead during nondeterministic GLR): Rename
7213 print_look_ahead to print_lookahead.
7214 * tests/torture.at: Update English in comments.
7215 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
7216 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
7217 (Many lookahead tokens): Update uses.
7218 * data/glr.c: Update English in comments.
7219 * lalr1.cc: Likewise.
7221 * src/conflicts.h: Likewise.
7222 * src/lalr.h: Likewise.
7223 * src/main.c: Likewise.
7224 * src/output.c: Likewise.
7225 * src/parse-gram.c: Likewise.
7226 * src/tables.h: Likewise.
7227 * tests/calc.at: Likewise.
7229 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
7231 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
7233 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
7235 * TODO: Add request from Nelson H. F. Beebe to be able to install
7236 Bison without installing the yacc script.
7238 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7240 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
7241 and yytext if they're already #define'd.
7242 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
7243 * src/scan-code-c.c: ... here.
7244 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
7247 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7249 Get Bison to build again when configured with --enable-gcc-warnings.
7250 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
7252 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
7253 loc argument as it shadows a global.
7254 * src/scan-gram.l: Remove stray comma that prevents boundary_set
7257 * src/.cvsignore: Add scan-code.c.
7259 2006-06-07 Akim Demaille <akim@epita.fr>
7261 * src/scan-gram.l: Move the "add a trailing ; to actions" code
7263 * src/scan-code.l: here.
7264 * tests/input.at (Torturing the Scanner): Fix another location
7267 2006-06-07 Akim Demaille <akim@epita.fr>
7269 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
7271 2006-06-06 Akim Demaille <akim@epita.fr>
7273 Extract the parsing of user actions from the grammar scanner.
7274 As a consequence, the relation between the grammar scanner and
7275 parser is much simpler. We can also split "composite tokens" back
7277 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
7278 * src/scan-gram.l (add_column_width, adjust_location): Move to and
7280 * src/location.h, src/location.c (add_column_width)
7281 (location_compute): these.
7282 Fix the column count: the initial column is 0.
7283 (location_print): Be robust to ending column being 0.
7284 * src/location.h (boundary_set): New.
7285 * src/main.c: Adjust to scanner_free being renamed as
7287 * src/output.c: Include scan-code.h.
7288 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
7290 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
7291 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
7292 which is now, again, a separate token.
7293 Adjust all dependencies.
7294 Whereever actions with $ and @ are used, use translate_code.
7295 (action): Remove this nonterminal which is now useless.
7296 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
7297 (grammar_current_rule_action_append): Use translate_code.
7298 (packgram): Bound check ruleno, itemno, and rule_length.
7299 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
7300 (last_string, last_braced_code_loc, max_left_semantic_context)
7301 (scanner_initialize, scanner_free, scanner_last_string_free)
7302 (gram_out, gram_lineno, YY_DECL_): Move to...
7303 * src/scan-gram.h: this new file.
7304 (YY_DECL): Rename as...
7306 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
7307 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
7308 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
7309 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
7310 Move these declarations, and...
7311 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
7313 * src/flex-scanner.h: this new file.
7314 * src/scan-gram.l (rule_length, rule_length_overflow)
7315 (increment_rule_length): Remove.
7316 (last_braced_code_loc): Rename as...
7317 (gram_last_braced_code_loc): this.
7318 Adjust to the changes of the parser.
7319 Move all the handling of $ and @ into...
7320 * src/scan-code.l: here.
7321 * src/scan-gram.l (handle_dollar, handle_at): Remove.
7322 (handle_action_dollar, handle_action_at): Move to...
7323 * src/scan-code.l: here.
7324 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
7325 scan-code.h, scan-code-c.c, scan-gram.h.
7326 (EXTRA_bison_SOURCES): Add scan-code.l.
7327 (BUILT_SOURCES): Add scan-code.c.
7328 (yacc): Be robust to white spaces.
7330 * tests/conflicts.at, tests/input.at, tests/reduce.at,
7331 * tests/regression.at: Adjust the column numbers.
7332 * tests/regression.at: Adjust the error message.
7334 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
7336 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
7337 Use Akim's wording from
7338 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
7340 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
7342 Between Bison releases, manually append `+' to the previous Bison
7343 release number, and use that as a signal to automatically print the
7344 ChangeLog's CVS Id keyword from --version. Discussed starting at
7345 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
7346 * ChangeLog: Add Id header.
7347 * configure.ac (AC_INIT): Append `+' to `2.3'.
7348 * src/.cvsignore: Add revision.c.
7349 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
7350 (BUILT_SOURCES): Add revision.c.
7351 (revision.c): New target rule. This file defines a new global variable
7352 named revision. It initializes it with either the Id from ChangeLog
7353 or, if VERSION doesn't contain `+', with the empty string.
7354 * src/getargs.c (version): Print the value of revision.
7355 * src/revision.h: Extern revision.
7357 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
7359 * NEWS: Version 2.3.
7360 * configure.ac (AC_INIT): Likewise.
7362 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
7364 * data/glr.c (YYRECOVERING): Define to be a function-like macro
7365 with no arguments, not as an object-like macro. This is for
7366 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
7367 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
7368 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
7371 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
7373 * src/getargs.c (usage): Back out yesterday's modification of the
7374 --help output so that we don't have to wait for translation before
7377 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
7379 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
7380 Problem reported by Akim Demaille.
7382 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
7384 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
7386 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
7388 * data/yacc.c (yy_reduce_print): Omit trailing white space in
7389 generated source code. Problem reported by Frans Englich in
7390 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
7392 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
7394 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
7395 shell, not within 'make', so that 'make' by an ordinary builder
7396 (using GNU make) does not worry about configuring gzip. This also
7397 works around a bug reported independently by Keith Thompson and by
7398 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
7399 stderr rather than stdout, messing up the build logs.
7401 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
7403 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
7404 to make sure that YYID will never be unused. This fixes a 'make
7405 maintainer-check' failure caused by the recent changes to the 'Trivial
7406 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
7408 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
7410 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
7412 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
7413 state before an empty RHS is always resolved here. Only the location
7414 of that state is guaranteed to be resolved, and that's enough. This
7415 fixes the remaining bug reported by Derek M. Jones in
7416 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
7417 * tests/glr-regression.at (Uninitialized location when reporting
7418 ambiguity): Test the above case.
7419 Also, the embedded comments in this test case claim it checks the case
7420 of an empty RHS that has inherited the initial location. However, the
7421 corresponding LHS was already resolved, so yyresolveLocations didn't
7422 actually have reason to modify it. Fix this by forcing
7423 nondeterministic operation at the beginning of the parse.
7425 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
7427 * data/c.m4 (b4_yy_symbol_print_generate):
7428 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
7429 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
7430 of the bugs reported today by Derek M Jones in
7431 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
7432 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
7433 defined to be a type name without parens or brackets.
7434 (Location Type): Similarly for YYLTYPE.
7435 * tests/regression.at (Trivial grammars): Put in a test for this
7436 bug that will be caught by 'make maintainer-check' (though not,
7437 alas, by 'make check' unless your compiler is picky).
7439 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
7441 * NEWS: Version 2.2.
7442 * configure.ac (AC_INIT): Likewise.
7444 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
7446 * data/glr.c (yyreportTree): Make room in yystates for the state
7447 preceding the RHS. This fixes the segmentation fault reported by Derek
7449 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
7450 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
7451 to the user. Reported for yyreportTree by Derek M. Jones later in the
7453 * THANKS: Add Derek M. Jones.
7454 Update my email address.
7455 Fix typo in Steve Murphy's name.
7457 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
7459 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
7460 checking against YYLAST that caused the parser to miss a potential
7461 alternative in its diagnostic.
7462 Problem reported by Maria Jose Moron Fernandez in
7463 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
7464 * data/lalr1.cc (yysyntax_error_): Likewise.
7465 * data/yacc.c (yysyntax_error): Likewise.
7466 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
7467 tokens, in case we run into an older C compiler.
7468 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
7469 Use them to check for the off-by-one error fixed above.
7471 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
7472 YYSIZE_T, not size_t.
7473 * tests/regression.at (Trivial grammars): New test, to catch
7474 the error fixed by the above patch.
7476 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7478 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
7480 Reported by Steve Murphy.
7482 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7484 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
7485 * data/glr.cc: b4_location_flag is now b4_locations_flag.
7487 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7489 Implement --trace=m4.
7490 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
7491 * src/output.c (output_skeleton): When set, pass -dV to m4.
7493 Factor the handling of flags in m4.
7494 * src/output.c (prepare): Rename the muscle names debug, defines,
7495 error_verbose to debug_flag, defines_flag, error_verbose_flag.
7496 * data/c.m4: Adjust.
7497 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
7498 Use b4_define_flag_if to define other b4_FLAG_if macros.
7499 (b4_location_if): As a consequence, rename as...
7500 (b4_locations_if): this, for consistency.
7501 Adjust all the skeletons.
7503 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7505 * etc/bench.pm: Shorten bench names.
7507 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7509 * src/output.h, src/output.c (error_verbose): Move to...
7510 * src/getargs.h, src/getargs.c: here.
7512 Adjust dependencies.
7514 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
7516 * data/c.m4 (b4_copyright): Put the special exception for Bison
7517 skeletons here, so we don't have to put it in each skeleton. All
7518 uses changed. Suggested by Akim Demaille. Also, wrap the
7519 copyright notice, in case it is longer than 80 columns. Replace
7520 comma by newline after title.
7522 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
7524 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
7525 incompatibility, not a bug. Mention that it wasn't fixed as of
7528 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
7530 * examples/extexi: Enforce the precedence of concatenation over
7532 Reported by Tommy Nordgren.
7534 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
7536 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
7537 with the member "token".
7538 Reported by Martin Nylin.
7540 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
7542 * data/glr.c: Switch to Bison 2.2 special-exception language in
7543 the copyright notice. Use more-regular format for titles and
7545 * data/glr.cc: Likewise.
7546 * data/location.cc: Likewise.
7547 * data/yacc.cc: Likewise.
7548 * doc/bison.texinfo (Conditions): Document this.
7549 * NEWS: likewise. Upgrade version to 2.2.
7551 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
7553 * data/glr.cc: Remove dead code.
7555 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
7557 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
7558 that variable and the line breaks the bootstrap. Problem reported
7559 by Juan M. Guerrero.
7561 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
7563 * doc/bison.texinfo (Multiple start-symbols): New.
7565 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
7567 * etc/README, etc/bench.pl: New.
7569 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
7571 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
7573 Reported by Mickael Labau.
7574 * tests/input.at (Torturing the Scanner): Test it.
7576 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
7578 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
7579 Problem reported by Bob Rossi.
7581 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
7583 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
7584 and didn't really work.
7585 For the index, use @ifnotinfo, not @iftex.
7586 Minor cleanups of spacing and terminology.
7588 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
7590 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
7591 of AT_NAME_PREFIX when %name-prefix is not used.
7593 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
7595 Apply --prefix to C++ skeletons too: they change the namespace.
7596 The test suite already exercize these cases.
7597 * data/c++.m4 (b4_namespace): New.
7598 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
7599 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
7600 * data/yacc.c, data/glr.c: Remove a useless `[]'.
7601 * doc/bison.texinfo: Document it.
7602 (Option Cross Key): Use @multitable in all formats. It looks
7603 nicer, even in TeX outputs.
7604 (Rules): Use the same code whatever the output type is.
7605 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
7606 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
7607 * tests/calc.at: Use it, instead of hard coding `yy'.
7609 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
7611 * TODO: Remove dead items.
7613 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
7615 * doc/FAQ: Remove, merged into...
7616 * doc/bison.texinfo (FAQ): this.
7617 * doc/Makefile.am (EXTRA_DIST): Adjust.
7619 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
7621 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
7623 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
7624 * doc/bison.texinfo (Calc++ Scanner): Use it.
7626 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
7628 Fix two nits reported by twlevo, plus one more that I discovered.
7630 * src/assoc.h (assoc_to_string): Give a name to the arg, as
7631 this is the usual Bison style.
7632 * src/location.h (location_print): Likewise.
7634 * src/reader.h (token_name): Likewise.
7636 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
7638 Fix some nits reported by twlevo.
7639 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
7640 and "POSIX". Use more-modern syntax for URLs. Mention C++
7641 and ask for Java. Don't hardwire OS version numbers. Add
7643 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
7644 * src/conflicts.c (solved_conflicts_obstack): Now static.
7646 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
7648 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
7649 page. Say "you can use it" not "you may use it" as on the web page;
7650 we're describing capabilities not granting permission.
7652 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
7654 * data/glr.c (yyresolveLocations): Rename local variables to avoid
7655 shadowing warnings. Use usual patter for iterating through RHS.
7656 * tests/glr-regression.at
7657 (Uninitialized location when reporting ambiguity):
7658 Modify yylex so that it uses its argument, rather than trying
7659 to rely on ARGSUSED (which doesn't work for gcc with warnings).
7660 const char -> char const.
7662 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
7663 Don't use tabs inside commands; it messes up 'ps'.
7664 Problem reported by twlevo.
7666 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
7668 * tests/glr-regression.at (Uninitialized location when reporting
7669 ambiguity): New test case.
7670 * data/glr.c (yyresolveLocations): New function, which uses
7672 (yyresolveValue): Invoke yyresolveLocations before reporting an
7674 * doc/bison.texinfo (Default Action for Locations): Note
7675 YYLLOC_DEFAULT's usage for ambiguity locations.
7676 (GLR Semantic Actions): Cross-reference those notes.
7678 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
7680 * tests/glr-regression.at (Leaked semantic values when reporting
7681 ambiguity): Remove unnecessary union and type declarations.
7682 (Leaked lookahead after nondeterministic parse syntax error): New test
7684 * data/glr.c (yyparse): Check for zero stacks remaining before
7685 attempting to shift the lookahead so that you don't lose it.
7687 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
7689 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
7690 * tests/glr-regression.at (Leaked semantic values when reporting
7691 ambiguity): New test case.
7692 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
7693 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
7694 now unnecessary yystackp parameter.
7695 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
7696 destructors can be called.
7698 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
7699 in existing testcases.
7701 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
7703 Don't leak semantic values for parent RHS when a user action cuts the
7704 parser, and clean up related code a bit.
7705 * tests/glr-regression.at (Leaked merged semantic value if user action
7706 cuts parse): Rename to...
7707 (Leaked semantic values if user action cuts parse): ... this. Add check
7708 for leaked parent RHS values.
7709 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
7710 between an unresolved state (non-empty chain of semantic options) and
7711 an incomplete one (signaled by an empty chain).
7712 (yyresolveStates): Document the interface. Move all manipulation of a
7713 successfully or unsuccessfully resolved yyGLRState to...
7714 (yyresolveValue): ... here so that yyresolveValue always leaves a
7715 yyGLRState with consistent data and thus is easier to understand.
7716 Remove the yyvalp and yylocp parameters since they are always just
7717 taken from the yys parameter. When reporting a discarded merged value
7718 in debugging output, note that it is incompletely merged. Document the
7720 (yyresolveAction): If resolving any of the RHS states fails, destroy
7721 them all rather than leaking them. Thus, as long as user actions are
7722 written to clean up the RHS correctly, yyresolveAction always cleans up
7723 the RHS of a semantic option. Document the interface.
7725 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
7727 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
7728 led to a segmentation fault in GNU Pascal. Problem reported
7731 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
7733 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
7734 mid-rule action inside a nonterminal symbol in order to declare a
7735 destructor for its semantic value.
7737 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
7739 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
7740 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
7741 __cplusplus && ! defined _STDLIB_H && !
7742 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
7743 defined free))]: Include <stdlib.h> rather than rolling our own
7744 declarations of malloc and free, to avoid problems with
7745 incompatible declarations (using 'throw') C++'s stdlib.h. This
7746 should fix Debian bug 340012
7747 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
7748 reported by Guillaume Melquiond.
7750 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
7752 * NEWS: Clarify symbols versus types in unused-value warnings.
7754 * configure.ac (AC_INIT): Bump version number.
7756 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
7758 * NEWS: Version 2.1a.
7759 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
7760 since C99 requires this.
7762 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
7764 * m4/c-working.m4: New file.
7765 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
7767 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
7769 * Makefile.maint: Merge from coreutils.
7771 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
7773 More portability fixes for problems summarized by Nelson H. F. Beebe.
7775 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
7776 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
7777 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
7778 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
7779 messes up because C++ code is compiled in 32-bit mode but linked
7782 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
7784 More portability fixes for problems summarized by Nelson H. F. Beebe.
7786 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
7787 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
7789 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
7790 nodist_PROGRAMS, since we don't need to actually compile the
7791 example if we're just doing a plain 'make'. This avoids bothering
7792 the installer unnecessarily about problems due to weird C++
7795 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
7797 More portability fixes for problems summarized by Nelson H. F. Beebe.
7799 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
7800 than #include "...", and compile with -I'.'. The old method was
7801 not portable, according to Posix and the C standard, and it does
7802 not work with Sun C 5.7, where previous #line directives affect
7803 the working directory used in later #include "..." directives.
7805 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7807 Various DJGGP specific issues in /djgpp
7809 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
7811 More portability fixes for problems summarized by Nelson H. F. Beebe.
7813 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
7814 '#include <map>' works and that you can apply ++ to iterators.
7816 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
7818 Work around portability problems summarized by Nelson H. F. Beebe in
7819 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
7821 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
7822 that '#include <string>' works.
7824 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
7825 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
7826 "warning: sorry: semantics of inline function static data `const
7827 unsigned char translate_table[262]' are wrong (you'll wind up with
7830 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
7831 or, xor to not_, and_, or_, and xor_, respectively. This works
7832 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
7833 random system header somewhere that includes the equivalent of
7836 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
7837 -E" works; it apparently doesn't work with PathScale EKO Compiler
7840 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
7842 During deterministic GLR operation, user actions should be able to
7843 influence the parse by changing yychar. To make this easier to fix and
7844 to make glr.c easier to evolve in general, don't maintain yytoken in
7845 parallel with yychar; just compute yytoken when needed.
7846 * tests/glr-regression.at (Incorrect lookahead during deterministic
7847 GLR): Check that setting yychar in a user action has the intended
7849 * data/glr.c (yyGLRStack): Remove yytokenp member.
7850 (yyclearin): Don't set *yytokenp.
7851 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
7852 yychar rather than *yytokenp to determine the current lookahead.
7853 Compute yytoken locally when needed.
7854 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
7857 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
7858 after `--report' documentation.
7860 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
7862 * src/parse-gram.y (grammar_declaration): Location of printer
7863 symbol is @1, not list->location. Bug reported by twlevo.
7864 * tests/input.at (Incompatible Aliases): Adjust to above change.
7866 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
7868 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
7869 all the test at once. This makes the output easier to read in the
7872 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
7873 got from <http://bro-ids.org/download.html>. The bug is that
7874 when two actions appeared in succession, the second one was
7875 scanned before the first one was added to the grammar rule
7876 as a midrule action. Bison then output the incorrect warning
7877 "parse.y:905.17-906.36: warning: unused value: $3".
7878 * src/parse-gram.y (BRACED_CODE, action): These are no longer
7879 associated with a value.
7880 (rhs): Don't invoke grammar_current_rule_action_append.
7881 (action): Invoke it here instead.
7882 * src/reader.c (grammar_midrule_action): Now extern.
7883 (grammar_current_rule_action_append): Don't invoke
7884 grammar_midrule_action; that is now the scanner's job.
7885 * src/reader.h (last_string, last_braced_code_loc):
7886 (grammar_midrule_action): New decls.
7887 * src/scan-gram.l (last_string): Now extern, sigh.
7888 (last_braced_code_loc): New extern variable.
7889 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
7890 rule already has an action.
7891 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
7892 * tests/input.at (AT_CHECK_UNUSED_VALUES):
7893 Add some tests to check that the above changes fixed the bug.
7895 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
7897 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
7898 All used changed. Check whether the symbol has a destructor,
7899 not whether it is typed.
7900 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
7901 that the values are still reported as unused. All line numbers
7904 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
7906 Work around a bug in bro 0.8, which underparenthesizes its
7907 definition of YYLLOC_DEFAULT.
7908 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
7910 * data/lalr1.cc: Likewise.
7911 * data/yacc.cc: Likewise.
7913 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
7915 Work around a bug in Pike 7.0, and give the Pike folks a
7916 better way to override the usual int widths.
7917 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
7918 user can override the types.
7919 (short): #undef, to work around a bug in Pike 7.0.
7920 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
7921 (union yyalloc.yyss): Use yytype_int16 rather than short.
7923 (yysigned_char): Remove.
7924 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
7925 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
7926 * tests/regression.at (Web2c Actions): Adjust to above changes.
7928 * src/reader.c (check_and_convert_grammar): New function.
7929 (reader): Close the input file even if something went wrong during
7930 parsing. Minor file descriptor leak reported by twlevo.
7932 * src/assoc.c (assoc_to_string): Use a default: abort (); case
7933 to pacify gcc -Wswitch-default.
7934 * src/scan-gram.l (adjust_location): Use a default: break; case
7935 to pacify gcc -Wswitch-default.
7936 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
7937 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
7938 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
7939 Move these decls to scan-skel.l, since they don't need to be
7941 * src/scan-skel.l: Accept the above decls.
7942 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
7945 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
7947 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
7948 since we don't want to insist on a version number at the start
7949 of the changelog every time.
7950 * Makefile.maint: Sync from coreutils a bit better.
7951 (sc_trailing_blank): Renamed from sc_trailing_space.
7953 (sc_no_if_have_config_h, sc_require_config_h):
7954 (sc_prohibit_assert_without_use): New rules.
7955 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
7956 (sc_dd_max_sym_length): Fix leading spaces in rule.
7957 (sc_system_h_headers): Prefix with @.
7958 (sc_useless_cpp_parens, m4-check): Output line numbers.
7959 (changelog-check): Allow version only in head.
7960 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
7961 satisfy new Makefile.maint rule.
7962 * data/glr.c: Likewise.
7963 * data/glr.cc: Likewise.
7964 * data/lalr1.cc: Likewise.
7965 * data/yacc.c: Likewise.
7966 * lib/ebitsetv.c: Likewise.
7967 * lib/lbitset.c: Likewise.
7968 * lib/subpipe.c: Likewise.
7969 * lib/timevar.c: Likewise.
7970 * src/system.h: Likewise.
7971 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
7972 * djgpp/Makefile.maint: Add copyright notice.
7973 * djgpp/README.in: Likewise.
7974 * djgpp/config.bat: Likewise.
7975 * djgpp/config.site: Likewise.
7976 * djgpp/config_h.sed: Likewise.
7977 * djgpp/djunpack.bat: Likewise.
7978 * djgpp/config.sed: Fix copyright notice to match standard format.
7979 * djgpp/subpipe.h: Likewise.
7980 * lib/bitsetv-print.c: Likewise.
7981 * lib/bitsetv.c: Likewise.
7982 * lib/subpipe.h: Likewise.
7983 * lib/timevar.c: Likewise.
7984 * lib/timevar.h: Likewise.
7985 * djgpp/subpipe.c: Use standard recipe for config.h.
7986 * lib/abitset.c: Likewise.
7987 * lib/bitset.c: Likewise.
7988 * lib/bitset_stats.c: Likewise.
7989 * lib/bitsetv-print.c: Likewise.
7990 * lib/bitsetv.c: Likewise.
7991 * lib/ebitsetv.c: Likewise.
7992 * lib/get-errno.c: Likewise.
7993 * lib/lbitset.c: Likewise.
7994 * lib/subpipe.c: Likewise.
7995 * lib/timevar.c: Likewise.
7996 * lib/vbitset.c: Likewise.
7997 * tests/local.at: Likewise.
7998 * src/scan-gram.l: Don't include verify.h, since system.h does
8000 * .x-sc_require_config_h: New file.
8001 * .x-sc_unmarked_diagnostics: New file.
8003 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
8005 Be a bit more systematic about using 'abort'.
8006 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
8007 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
8008 Put 'default: abort ();' before some other case, to satisfy older
8010 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8011 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
8012 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
8013 * src/conflicts.c (resolve_sr_conflict): Likewise.
8014 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
8015 (get_decision_str, get_orientation_str, get_node_alignment_str):
8016 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
8017 (get_linestyle_str, get_arrowstyle_str): Likewise.
8018 * src/conflicts.c (resolve_sr_conflict):
8019 Use a default case rather than one for the one remaining enum
8020 value, to catch invalid enum values as well.
8021 * src/lalr.c (set_goto_map, map_goto):
8022 Prefer "assert (FOO);" to "if (!FOO) abort ();".
8023 * src/nullable.c (nullable_compute, token_definitions_output):
8025 * src/reader.c (packgram, reader): Likewise.
8026 * src/state.c (transitions_to, state_new, state_reduction_find):
8028 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
8029 (symbol_pack): Likewise.
8030 * src/tables.c (conflict_row, pack_vector): Likewise.
8031 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
8032 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
8033 * src/system.h: Don't include <assert.h>.
8034 (assert): New macro.
8036 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
8037 (Destructor Decl, Parser Function, Pure Calling):
8038 Describe rules for braces inside C code more carefully.
8040 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
8042 Fix some porting glitches found by Nelson H. F. Beebe.
8043 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
8044 compilers that don't understand that abort () does not return.
8045 * src/state.c (transitions_to): Likewise.
8046 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8047 that '#include <cstdlib>' works.
8048 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
8049 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
8050 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
8051 for the benefit of some pre-C99 compilers.
8053 * bootstrap: Undo changes to gnulib files that autoreconf made.
8055 Minor fixups to get 'make maintainer-check' to work.
8056 * configure.ac: Don't use -Wnested-externs, as it's incompatible
8057 with the new verify.h implementation.
8058 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
8059 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
8060 * data/yacc.c (YYUSE): Likewise.
8061 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
8062 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
8063 * src/parse-gram.y (declaration): Don't pass a string constant
8064 to a function that expects char *, since GCC might complain
8065 about the constant value.
8066 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
8067 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
8068 before #defining them.
8069 * tests/glr-regression.at
8070 (Incorrectly initialized location for empty right-hand side in GLR):
8071 In yyerror, use the msg arg.
8072 (Corrupted semantic options if user action cuts parse):
8073 (Incorrect lookahead during deterministic GLR):
8074 (Incorrect lookahead during nondeterministic GLR):
8075 Don't name a local var 'index'; it shadows string.h's 'index'.
8077 2006-01-19 Akim Demaille <akim@epita.fr>
8079 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
8080 location, not just parts of it.
8082 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
8084 * NEWS: Document the fact that multiple %unions are now allowed.
8085 * doc/bison.texinfo (Union Decl): Likewise.
8086 * TODO: This feature is now implemented, so remove it from
8089 * Makefile.maint: Merge with coreutils Makefile.maint.
8090 (CVS_LIST): Use build-aux version if available.
8091 (VERSION_REGEXP): New macro.
8092 (syntax-check-rules): Add sc_no_if_have_config_h,
8093 sc_prohibit_assert_without_use, sc_require_config_h,
8094 sc_useless_cpp_parens.
8095 (sc_obsolete_symbols): Check for O_NDELAY.
8096 (sc_dd_max_sym_length): Track coreutils.
8097 (sc_unmarked_diagnostics): Look in all files, not just *.c.
8098 (sc_useless_cpp_parens): New rule.
8099 (news-date-check): Look for version or today's date.
8100 (changelog-check): Don't require version number near head.
8101 (copyright-check): Use current year instead of hardwiring 2005.
8102 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
8103 (announcement): Add --gpg-key-ID.
8105 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
8108 Avoid undefined behavior that addressed just before the start of an
8109 array. Problem reported by twlevo.
8110 * src/reader.c (packgram): Prepend a new sentinel before ritem.
8111 * src/lalr.c (build_relations): Rely on new sentinel.
8112 * src/gram.c (gram_free): Adjust to new sentinel.
8114 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
8116 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
8117 yylookaheadNeeds. All uses updated.
8118 (yysplitStack): Rename local yynewLookaheadStatuses to
8119 yynewLookaheadNeeds.
8120 * data/glr-regression.at (Incorrect lookahead during nondeterministic
8121 GLR): In comments, change `lookahead status' to `lookahead need'.
8123 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8125 * data/glr.c (yysplitStack): A little stylistic rewrite.
8127 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8129 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
8131 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
8133 * doc/bison.texinfo: Fix some typos.
8134 (GLR Semantic Actions): New subsection discussing special
8135 considerations because GLR semantic actions might be deferred.
8136 (Actions): Mention look-ahead usage of yylval.
8137 (Actions and Locations): Mention look-ahead usage of yylloc.
8138 (Special Features for Use in Actions): Add YYEOF entry and mention it
8139 in the yychar entry.
8140 In the yychar entry, remove mention of the local yychar case (pure
8141 parser) since this is irrelevant information when writing semantic
8142 actions and since it's already discussed in `Table of Symbols' where
8143 yychar is otherwise described as an external variable.
8144 In the yychar entry, don't call it the `current' look-ahead since it
8145 isn't when semantic actions are deferred.
8146 In the yychar and yyclearin entries, add note about deferred semantic
8148 Add yylloc and yylval entries discussing look-ahead usage.
8149 (Look-Ahead Tokens): When discussing yychar, don't call it the
8150 `current' look-ahead, and do mention yylval and yylloc.
8151 (Error Recovery): Cross-reference `Action Features' when mentioning
8153 (Table of Symbols): In the yychar entry, don't call it the `current'
8155 In the yylloc and yylval entries, mention look-ahead usage.
8157 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
8159 * tests/glr-regression.at: Update copyright year to 2006.
8161 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8163 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
8164 use during nondeterministic operation to track which stacks have
8165 actually needed the current lookahead.
8166 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
8167 Allocate, deallocate, resize, and otherwise shuffle space for
8168 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
8169 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
8170 appropriately during nondeterministic operation.
8171 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
8172 members to store the current lookahead to be used by the deferred
8174 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
8175 from which the RHS is taken. Set the lookahead members of the new
8176 yySemanticOption according to the lookahead status for stack yyk.
8177 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
8178 yyaddDeferredAction.
8179 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
8180 members of yySemanticOption before invoking yyuserAction, and then set
8181 them back to their current values afterward.
8182 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
8183 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
8184 * tests/glr-regression.at: Remove `.' from the ends of recent test case
8185 titles for consistency.
8186 (Leaked merged semantic value if user action cuts parse): In order to
8187 suppress lint warnings, use arguments in merge function, and assign
8188 char value < 128 in main.
8189 (Incorrect lookahead during deterministic GLR): New test case.
8190 (Incorrect lookahead during nondeterministic GLR): New test case.
8192 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8194 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
8195 !yyvaluep as signal that no semantic value is available to print.
8196 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
8197 to print a semantic value.
8199 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8201 * tests/glr-regression.at: For consistency with my newer test cases,
8204 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
8206 * data/glr.c (yyresolveValue): When merging semantic options, if at
8207 least one user action succeeds but a later one cuts the parse, then
8208 destroy the semantic value before returning rather than leaking it.
8209 (yyresolveStates): If a user action cuts the parse and thus
8210 yyresolveValue fails, ignore the (unset) semantic value rather than
8211 corrupting the yyGLRState, and empty the semantic options list since
8212 the user actions should have called all necessary destructors.
8213 Simplify code with YYCHK.
8214 * tests/glr-regression.at (Corrupted semantic options if user action
8215 cuts parse): New test case.
8216 (Undesirable destructors if user action cuts parse): New test case.
8217 Before applying any of this patch, this test case never actually failed
8218 for me... but only because the corrupted semantic options usually
8220 (Leaked merged semantic value if user action cuts parse): New test
8223 2006-01-05 Akim Demaille <akim@epita.fr>
8225 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
8227 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
8229 * data/c.m4 (b4_c_modern): New macro, with a new provision for
8230 _MSC_VER. Problem reported by Cenzato Marco.
8231 (b4_c_function_def): Use it.
8232 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
8234 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
8235 than rolling our own.
8237 2006-01-04 Akim Demaille <akim@epita.fr>
8239 Also warn about non-used mid-rule values.
8240 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
8242 (symbol_list_new): Adjust.
8243 * src/reader.c (symbol_typed_p): New.
8244 (grammar_rule_check): Use it.
8245 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
8247 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
8249 * tests/actions.at (Exotic Dollars): Adjust.
8251 2006-01-04 Akim Demaille <akim@epita.fr>
8253 * src/reader.c (grammar_midrule_action): If $$ is set in a
8254 mid-rule, move the `used' bit to its lhs.
8255 * tests/input.at (Unused values): New.
8256 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
8258 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
8260 * doc/bison.texinfo (Bison Options): Say more accurately what
8262 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
8263 about declarations in the grammar when in Yacc mode, as POSIX does
8264 not require a diagnostic when the grammar uses extensions.
8266 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
8268 Warn about dubious constructions like "%token T T".
8270 * src/symtab.h (struct symbol.declared): New member.
8271 * src/symtab.c (symbol_new): Initialize it to false.
8272 (symbol_class_set): New arg DECLARING, specifying whether
8273 this is a declaration that we want to warn about, if there
8274 is more than one of them. All uses changed.
8276 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
8277 Allow multiple %union directives, whose contents concatenate.
8278 * src/parse-gram.y (grammar_declaration): Likewise.
8279 Use muscle_code_grow, so that we don't need stype_line any more.
8282 * src/muscle_tab.c (muscle_grow): Fix comment.
8284 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
8285 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
8286 Update copyright year to 2006.
8288 2006-01-03 Akim Demaille <akim@epita.fr>
8290 Have glr.cc pass (some of) the calc.at tests.
8291 * data/glr.cc (b4_parse_param_orig): New.
8292 (b4_parse_param): Improve its definition, and bound it more
8293 clearly in the skeleton.
8294 (b4_epilogue): Append, instead of prepending, in order to keep
8296 Simplify the generation of auxiliary functions: locations and
8297 purity are mandated.
8298 (b4_global_tokens_and_yystype): Honor it.
8299 * data/location.cc (c++.m4): Don't include it.
8300 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
8302 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
8304 Be sure to initialize the first position's filename.
8305 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
8307 (AT_CHECK_CALC_GLR_CC): New.
8308 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
8310 2006-01-02 Akim Demaille <akim@epita.fr>
8312 * src/output.c (output_skeleton): Don't hard wire the inclusion of
8314 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
8315 * data/glr.cc: Do not include stack.hh.
8317 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
8319 * data/glr.c: Reformat whitespace with tabs.
8320 (b4_lpure_formals): Remove this unused m4 macro.
8321 * tests/cxx-type.at: Reformat whitespace with tabs.
8322 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
8323 since it's a member. Rename type to isNterm for clarity.
8325 2005-12-29 Akim <akim@sulaco.local>
8327 Let glr.cc catch up with symbol_value_print.
8328 * data/glr.cc (b4_yysymprint_generate): Replace by...
8329 (b4_yy_symbol_print_generate): this.
8330 (yy_symbol_print, yy_symbol_value_print): Declare them.
8332 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
8334 * src/location.h (boundary): Note that a line or column equal
8335 to INT_MAX indicates an overflow.
8336 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
8337 (rule_length_overflow, increment_rule_length, add_column_width):
8339 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
8340 (<SC_BRACED_CODE>"}"):
8341 Use increment_rule_length rather than incrementing it by hand.
8342 (adjust_location, handle_syncline): Diagnose overflow.
8343 (handle_action_dollar, handle_action_at):
8344 Fix bug with monstrosities like $-2147483648.
8345 Remove now-unnecessary checks.
8346 (scan_integer): Verify assumptions and remove now-unnecessary checks.
8347 (convert_ucn_to_byte): Verify assumptions.
8348 (handle_syncline): New arg LOC. All callers changed.
8349 Don't store through a value derived from char const * pointer.
8351 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
8354 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
8356 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
8357 Remove unnecessary forward static decls.
8359 2005-12-27 Akim Demaille <akim@epita.fr>
8361 * src/reader.c (grammar_current_rule_check): Also check that $$
8363 Take the rule to check as argument, hence rename as...
8364 (grammar_rule_check): this.
8365 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
8367 (grammar_rule_begin, grammar_rule_end): these, for consistency.
8368 (grammar_midrule_action, grammar_symbol_append): Now static.
8369 * tests/torture.at (input): Don't rely on the default action
8370 being always performed.
8371 * tests/calc.at: "Set" $$ even when the action is "cut" with
8373 * tests/actions.at (Exotic Dollars): Instead of using unused
8374 values, check that the warning is issued.
8376 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
8378 * NEWS: Improve wording for unused-value warnings.
8380 2005-12-22 Akim Demaille <akim@epita.fr>
8382 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
8383 (b4_yysymprint_generate): Rename as...
8384 (b4_yy_symbol_print_generate): this.
8385 Generate yy_symbol_print instead of yysymprint.
8386 Generate also yy_symbol_value_print, and use it.
8388 2005-12-22 Akim Demaille <akim@epita.fr>
8390 * NEWS: Warn about unused values.
8391 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
8393 (symbol_list_n_get, symbol_list_n_used_set): New.
8394 (symbol_list_n_type_name_get): Use symbol_list_n_get.
8395 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
8396 * src/reader.c (grammar_current_rule_check): Check that values are
8398 * src/symtab.c (symbol_print): Accept 0.
8399 * tests/existing.at: Remove the type information.
8401 Remove useless actions (beware of mid-rule actions: perl -000
8402 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
8403 * tests/actions.at (Exotic Dollars): Use unused values.
8404 * tests/calc.at: Likewise.
8405 * tests/glr-regression.at (No users destructors if stack 0 deleted):
8408 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
8411 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
8413 Undo 2005-12-01 tentative license wording change. The wording is
8414 still being reviewed by the lawyers, and we don't want to wait for
8415 them before publishing a test release. For now, revert to the
8417 * NEWS: Undo 2005-12-01 change.
8418 * data/glr.c: Revert to previous license wording.
8419 * data/glr.cc: Likewise.
8420 * data/lalr1.cc: Likewise.
8421 * data/location.cc: Likewise.
8422 * data/yacc.c: Likewise.
8424 * NEWS: Reword %destructor vs YYABORT etc.
8425 * data/glr.c: Use American spacing, for consistency.
8426 * data/glr.cc: Likewise.
8427 * data/lalr1.cc: Likewise.
8428 * data/yacc.c: Likewise.
8429 * data/yacc.c: Reformat comments slightly.
8430 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
8431 for consistency. Fix some spelling errors and reword recently-included
8433 * tests/cxx-type.at: Cast results of malloc, for C++.
8435 2005-12-21 Joel E. Denny <address@hidden>
8437 * tests/cxx-type.at: Construct a tree, count the parents of shared
8438 nodes, and free each node once and only once. Previously, the memory
8439 for semantic values was leaked instead.
8441 2005-12-21 Joel E. Denny <address@hidden>
8443 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
8444 (yylval, yylloc): If pure, #define to yystackp->yyval and
8445 yystackp->yyloc similar to yychar and yynerrs.
8446 (yyparse): If pure, remove local yylval and yylloc. Add local
8447 yystackp to accommodate pure definitions of yylval and yylloc.
8448 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
8449 yylvalp and yyllocp to &yylval and &yylloc.
8450 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
8451 namespace. Previously, nerrs and char were missing, but lval and lloc
8453 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
8454 yylvalp and yyllocp parameters since, if pure, these are now always
8455 accessible through yystackp. If not pure, they are still accessible
8457 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
8458 `if (YYID (N))' to pacify lint.
8460 2005-12-21 Akim Demaille <akim@epita.fr>
8462 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
8463 destroy the RHS symbols of a rule.
8464 * data/yacc.c (yylen): Initialize to 0.
8465 Keep its value to the number of items to possibly shift.
8466 In particular, a regular successful parse that ends on YYFINAL by
8467 a (internal) YYACCEPT must not have yylen != 0.
8468 (yyerrorlab, yyreturn): Pop the RHS.
8469 Reorder a bit to emphasize the `shifting' bits of code.
8470 (YYPOPSTACK): Now accept a number of items to pop.
8471 * data/lalr1.cc: Likewise.
8472 * data/glr.c: Formatting changes.
8473 Use goto instead of fall through.
8474 * doc/bison.texinfo (Destructor Decl): Complete.
8476 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8478 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
8479 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
8480 * djgpp/config.bat: Replace every occurence of the file name
8481 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
8482 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
8483 * djgpp/config.sed: Replace every occurence of the file name
8484 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
8485 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
8486 * djgpp/djunpack.bat: DJGPP specific file.
8487 * djgpp/fnchange.lst: DJGPP specific file.
8488 * djgpp/README.in: Add new information about how to unpack the bison
8489 source on MSDOS and other systems which have 8.3 file name restrictions
8490 using djunpack.bat and fnchange.lst.
8492 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
8494 * bootstrap (build_cvs_prefix): Remove; unused.
8495 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
8496 when getting gnulib.
8498 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
8500 * data/glr.c: Reorder typedef declarations for structs to match order
8501 of struct declarations.
8502 Rename yystack everywhere to yystackp except in yyparse where it's not
8504 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
8506 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
8507 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
8508 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
8511 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
8513 * tests/sets.at (Accept): Fix typos in regular expression used to
8514 sed out the final state number.
8516 Work around portability problem on Solaris 10: flex-generated
8517 files include <stdio.h> before <config.h>, which messes up
8518 because the latter defines __EXTENSIONS__. Address the problem
8519 by creating two new little files that include <config.h> first,
8520 then include the flex-generated files. Rewrite everyone else
8521 to include <config.h> first, as well.
8522 * lib/timevar.c: Always include "config.h".
8523 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
8524 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
8525 (EXTRA_bison_SOURCES): New macro.
8526 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
8527 * src/system.h: Don't include config.h.
8528 * src/LR0.c: Include <config.h> first.
8529 * src/assoc.c: Likewise.
8530 * src/closure.c: Likewise.
8531 * src/complain.c: Likewise.
8532 * src/conflicts.c: Likewise.
8533 * src/derives.c: Likewise.
8534 * src/files.c: Likewise.
8535 * src/getargs.c: Likewise.
8536 * src/gram.c: Likewise.
8537 * src/lalr.c: Likewise.
8538 * src/location.c: Likewise.
8539 * src/main.c: Likewise.
8540 * src/muscle_tab.c: Likewise.
8541 * src/nullable.c: Likewise.
8542 * src/output.c: Likewise.
8543 * src/parse-gram.y: Likewise.
8544 * src/print.c: Likewise.
8545 * src/print_graph.c: Likewise.
8546 * src/reader.c: Likewise.
8547 * src/reduce.c: Likewise.
8548 * src/relation.c: Likewise.
8549 * src/state.c: Likewise.
8550 * src/symlist.c: Likewise.
8551 * src/symtab.c: Likewise.
8552 * src/tables.c: Likewise.
8553 * src/uniqstr.c: Likewise.
8554 * src/vcg.c: Likewise.
8556 * src/parse-gram.y: Fix minor problems uncovered by lint.
8557 (current_lhs, current_lhs_location): Now static.
8558 (current_assoc): Remove unused variable.
8560 Cleanups so that Bison-generated parsers have less lint.
8561 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
8562 Prepend /*ARGSUSED*/, for lint's sake.
8563 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
8564 definition if 'lint' is defined.
8565 (YYID): New macro (or function, if lint).
8566 All uses of /*CONSTCOND*/0 replaced by YYID(0).
8567 * data/yacc.c: Likewise.
8568 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
8569 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
8570 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
8572 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
8573 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
8574 Use YYID(0) rather than 0, for lint.
8575 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
8576 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
8578 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
8580 * tests/glr-regression.at
8581 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8582 Close memory leak reported by twlevo.
8584 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
8586 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
8588 (yyparse): Iterate another stack in order to call user destructors.
8589 * tests/glr-regression.at (No users destructors if stack 0 deleted):
8591 (Duplicated user destructor for lookahead): This test now is expected
8594 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
8596 * NEWS: Document the following change.
8597 * data/yacc.c: Say "parser skeleton" rather than "file", since
8598 it's no longer just a file.
8599 * data/glr.c: Grant a special exception for C GLR parsers, that
8600 reads like the already-existing exception for C LALR(1) parsers.
8601 * data/glr.cc: Likewise.
8602 * data/lalr1.cc: Likewise.
8603 * data/location.cc: Likewise.
8604 * data/yacc.c: Reword the "written by" statement to clarify that
8605 it was the parser skeleton, not the entire output file.
8606 * data/glr.c: Written by Paul Hilfinger.
8607 * data/glr.cc: Written by Akim Demaille.
8608 * data/lalr1.cc: Likewise.
8610 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
8612 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
8613 Fix typos in previous change that broke 'make check'.
8614 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
8616 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
8617 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
8618 We can revert this once things settle down.
8620 * src/conflicts.c (conflicts_print): Don't print file name twice
8621 when %expect fails because there were no conflicts.
8622 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
8624 * tests/conflicts.at (%expect not enough, %expect too much):
8625 (%expect with reduce conflicts): Adjust to new behavior.
8627 2005-11-18 Akim Demaille <akim@epita.fr>
8629 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
8631 * NEWS: Document this.
8632 * doc/bison.texinfo (Expect Decl): Likewise.
8634 2005-11-16 Akim Demaille <akim@epita.fr>
8636 Generalize the display of semantic values and locations in traces.
8637 * data/glr.c (yy_reduce_print): Fix indices (again).
8638 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
8640 * data/lalr1.cc (yyreduce_print): Rename as...
8641 (yy_reduce_print): this.
8642 Display values and locations.
8643 * data/yacc.c (yy_reduce_print): Likewise.
8644 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
8645 (yysymprint): Move higher to be visible from yy_reduce_print).
8647 * tests/calc.at: Adjust the expected length of the traces.
8649 2005-11-14 Akim Demaille <akim@epita.fr>
8651 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
8652 from 1 to N, while values and location start at 0.
8653 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
8655 2005-11-14 Akim Demaille <akim@epita.fr>
8657 * data/glr.c (yy_reduce_print): Fix the $ number.
8659 2005-11-14 Akim Demaille <akim@epita.fr>
8661 "Use" parse parameters.
8662 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
8663 * data/glr.c, data/glr.cc: Use them.
8664 * data/glr.c (YYUSE): Have a C++ definition that supports
8667 2005-11-14 Akim Demaille <akim@epita.fr>
8669 * data/glr.c (yyexpandGLRStack): Declare only if defined.
8671 2005-11-14 Akim Demaille <akim@epita.fr>
8674 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
8676 2005-11-12 Akim Demaille <akim@epita.fr>
8678 Let position and location be PODs.
8679 * data/location.cc (position::initialize, location::initialize): New.
8680 (position::position, location::location): Define only if
8681 b4_location_constructors is defined.
8682 * data/lalr1.cc (b4_location_constructors): Define it for backward
8684 * doc/bison.texinfo (Initial Action Decl): Use initialize.
8686 2005-11-12 Akim Demaille <akim@epita.fr>
8688 * data/lalr1.cc: Move the body of the ctor and dtor into the
8689 parser file (instead of the header).
8690 Wrap the implementations in a "namespace yy".
8692 2005-11-12 Akim Demaille <akim@epita.fr>
8694 Have glr.c include its header file when created.
8695 * data/glr.c (b4_shared_declarations): New.
8696 Output them verbatim in the parser if !%defines, otherwise
8697 output then in the header file, and include it instead.
8699 2005-11-11 Akim Demaille <akim@epita.fr>
8701 * data/glr.c: Comment changes.
8703 2005-11-11 Akim Demaille <akim@epita.fr>
8705 When yydebug, report semantic and location values for reductions.
8706 * data/glr.c (yy_reduce_print): Report the semantic values and the
8708 (YY_REDUCE_PRINT): Adjust.
8709 (yyglrReduce): Use them.
8710 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
8711 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
8712 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
8715 2005-11-10 Akim Demaille <akim@epita.fr>
8717 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
8718 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
8719 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
8721 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
8723 * m4/cxx.m4, examples/Makefile.am: Don't build
8724 examples/calc++ if no C++ compiler is available. (trivial change)
8726 2005-11-09 Akim Demaille <akim@epita.fr>
8728 * src/scan-skel.l: Use a couple of asserts.
8730 2005-11-03 Akim Demaille <akim@epita.fr>
8732 In some (weird) cases, the final state number is incorrect.
8733 Reported by Alexandre Duret-Lutz.
8734 * src/LR0.c (state_list_append): Remove the computation of
8736 (save_reductions): Do it here.
8737 (get_state): Alpha conversion.
8738 (generate_states): Use a for loop.
8739 * src/gram.h (item_number_is_rule_number)
8740 (item_number_is_symbol_number): New.
8741 * src/state.c: Use assert.
8742 * src/system.h: Include assert.h.
8743 * tests/sets.at (Accept): New.
8745 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8747 * data/glr.c (yyfill): Adjust comment.
8748 (yyresolveAction): Initialize default location properly
8749 for empty right-hand sides.
8750 (yydoAction): Ditto.
8751 Add comment explaining apparently dead code.
8752 * tests/glr-regression.at
8753 (Incorrectly initialized location for empty right-hand side in GLR):
8756 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
8758 * bootstrap (cleanup_gnulib): New function. Use it to clean up
8759 gnulib when interrupted. This fixes some race conditions and
8760 works around some portability problems (one noted by Paul
8763 2005-10-22 Akim <akim@epita.fr>
8765 * Makefile.cfg: Adjust to config -> build-aux.
8768 2005-10-21 Akim Demaille <akim@epita.fr>
8770 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
8772 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
8773 * data/yacc.c (b4_Pure_if): Rename as...
8774 (b4_yacc_pure_if): this.
8775 (YY_SYMBOL_PRINT, yyparse): Adjust.
8776 * doc/bison.texinfo: Formatting changes.
8778 2005-10-21 Akim Demaille <akim@epita.fr>
8780 Finish the transition config -> build-aux.
8781 * configure.ac, Makefile.am: Use build-aux.
8782 * config/prev-version, config/announce-gen, config/Makefile.am:
8784 * build-aux/prev-version, build-aux/announce-gen,
8785 * build-aux/Makefile.am: here.
8787 2005-10-14 Akim Demaille <akim@epita.fr>
8789 * examples/calc++/test: Use set -x only when VERBOSE.
8791 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
8793 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
8794 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
8796 2005-10-13 Akim Demaille <akim@epita.fr>
8798 * src/scan-skel.l: Output the base name parts of the parser and
8800 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
8802 Use this to exercise C++ outputs in subdirs.
8803 Reported by Oleg Smolsky.
8805 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
8807 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
8808 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
8809 Problem reported by John P. Hartmann.
8810 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
8813 2005-10-12 Akim Demaille <akim@epita.fr>
8815 * src/parse-gram.y (version_check): Exit 63 to please missing
8816 (stands for "version mismatch).
8817 * tests/input.at, doc/bison.texinfo: Adjust.
8819 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
8821 Work around portability problems with Visual Age C compiler
8822 (xlc and xlC_r) reported by John P. Hartmann.
8823 * data/location.cc (initial_column, initial_line): Remove.
8824 All uses replaced by 0 and 1.
8825 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
8826 that xlc complains about.
8827 * src/scan-skel.l (skel_wrap): Likewise.
8828 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
8830 * data/yacc.c (YYMODERN_C): New macro, which also looks at
8831 __STDC_VERSION__. Use it everywhere instead of looking at
8832 __STDC__ and __cplusplus.
8834 2005-10-10 Akim Demaille <akim@epita.fr>
8836 * examples/calc++/test: Be quiet unless VERBOSE.
8838 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
8840 * data/c.m4 (yydestruct, yysymprint):
8841 Use YYUSE instead of casting to void.
8842 * data/glr.c (YYUSE): New macro.
8843 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
8844 Use it instead of rolling our own.
8845 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
8847 Use /*CONSTCOND*/ to suppress lint warnings.
8848 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
8849 (YY_STACK_PRINT): Use 'false' not '0'.
8851 (yysymprint_, yydestruct_): Use it instead of rolling our own.
8852 * data/yacc.c (YYUSE): New macro.
8853 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
8854 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
8855 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
8858 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
8859 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
8861 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
8863 Undo the parts of the unlocked-I/O change that substituted
8864 putc or puts for printf. This might hurt performance a bit,
8865 but some people prefer the printf style.
8866 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
8867 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
8868 All uses replaced by YYFPRINTF and YYDPRINTF.
8869 * data/yacc.c: Likewise.
8870 * lib/bitset.c (bitset_print): Likewise.
8871 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
8873 * lib/lbitset.c (debug_lbitset): Likewise.
8874 * src/closure.c (print_firsts, print_fderives): Likewise.
8875 * src/gram.c (grammar_dump): Likewise.
8876 * src/lalr.c (look_ahead_tokens_print): Likewise.
8877 * src/output.c (escaped_output): Likewise.
8878 (user_actions_output): Break apart two printfs.
8879 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
8880 * src/reduce.c (reduce_print): Likewise.
8881 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
8882 * src/system.h: Include unlocked-io.h rathe than stdio.h.
8884 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
8885 Use assignments rather than casts-to-void to suppress
8886 unused-variable warnings. This pacifies 'lint'.
8887 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
8888 unused-variable warnings.
8890 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8892 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
8894 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
8896 Use unlocked I/O for a minor performance improvement on hosts like
8897 GNU/Linux and Solaris that support unlocked I/O. The basic idea
8898 is to use the gnlib unlocked-io module, and to prefer putc and
8899 puts to printf when either will work (since the latter doesn't
8900 come in an unlocked flavor).
8901 * bootstrap (gnulib_modules): Add unlocked-io.
8902 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
8903 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
8904 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
8905 and similarly for puts and putc and printf.
8906 * data/yacc.c: Likewise.
8907 * lib/bitset.c (bitset_print): Likewise.
8908 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
8909 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
8911 * lib/lbitset.c (debug_lbitset): Likewise.
8912 * src/closure.c (print_firsts, print_fderives): Likewise.
8913 * src/gram.c (grammar_dump): Likewise.
8914 * src/lalr.c (look_ahead_tokens_print): Likewise.
8915 * src/output.c (escaped_output): Likewise.
8916 (user_actions_output): Coalesce two printfs.
8917 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
8918 * src/reduce.c (reduce_print): Likewise.
8919 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
8920 * src/system.h: Include unlocked-io.h rather than stdio.h.
8922 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
8923 this confuses xgettext.
8925 2005-10-02 Akim Demaille <akim@epita.fr>
8927 * bootstrap (gnulib_modules): Add strverscmp.
8928 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
8929 * m4/.cvsignore: Add strverscmp.m4.
8930 * src/parse-gram.y (%require): New token, new rule.
8931 (version_check): New.
8932 * src/scan-gram.l (%require): Adjust.
8933 * tests/input.at (AT_REQUIRE): New.
8935 * doc/bison.texinfo (Require Decl): New.
8936 (Calc++ Parser): Use %require.
8938 2005-10-02 Akim Demaille <akim@epita.fr>
8940 * data/location.cc: New.
8942 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
8943 Akim Demaille <akim@epita.fr>
8945 Make sure -odir/foo.cc creates dir/location.hh etc.
8946 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
8947 (spec_file_prefix, spec_verbose_file, spec_graph_file)
8948 (spec_defines_file): Now const.
8950 (short_base_name): Remove.
8951 * src/files.c: Adjust.
8952 (dirname.h): Include.
8953 (base_name): Don't prototype it.
8954 (finput): Remove, duplicates gram_in.
8955 (full_base_name, short_base_name): Replace by...
8956 (all_but_ext, all_but_tab_ext): these.
8957 (compute_base_names): Rename as...
8958 (compute_file_name_parts): this.
8959 Update to compute the new variables, including dir_prefix.
8960 Adjust dependencies.
8961 * src/output.c (prepare): Output them.
8962 * src/reader.c: Adjust to use gram_in, not finput.
8963 * src/scan-skel.l (@dir_prefix@): New.
8965 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8967 * lib/subpipe.c: New function end_of_output_subpipe() added
8968 to allow support for non-posix systems. This is a no-op function
8971 * lib/subpipe.h: New function end_of_output_subpipe() added
8972 to allow support for non-posix systems. This is a no-op function
8975 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
8976 handle the lack of pipe/fork functionality on non-posix systems.
8978 * djgpp/Makefile.maint: DJGPP specific file.
8980 * djgpp/README.in: DJGPP specific file.
8982 * djgpp/config.bat: DJGPP specific configuration file.
8984 * djgpp/config.sed: DJGPP specific configuration file.
8986 * djgpp/config.site: DJGPP specific configuration file.
8988 * djgpp/config_h.sed: DJGPP specific configuration file.
8990 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
8992 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
8994 2005-10-02 Akim Demaille <akim@epita.fr>
8996 * data/location.cc: New, extract from...
8997 * data/lalr1.cc: here.
8998 (location.hh): Include it after the user prologue, in case the
8999 filename type is defined by the user.
9000 Forward declation location and position before the pre-prologue.
9001 (yyresult_): Rename as...
9002 (yyresult): this, it's a local variable, not an attribute.
9003 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
9005 2005-10-01 Akim Demaille <akim@epita.fr>
9007 * examples/extexi: Restore the #line generation.
9009 2005-09-30 Akim Demaille <akim@epita.fr>,
9010 Alexandre Duret-Lutz <adl@gnu.org>
9012 Move the token type and YYSTYPE in the parser class.
9013 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
9014 (parser::token): New, from the moved free definition of tokens.
9015 (parser::semantic_value): Now a full definition instead of an
9016 indirection to YYSTYPE.
9017 (b4_post_prologue): No longer included in the header file, but
9018 in the implementation file.
9019 * doc/bison.texi (C+ Language Interface): Update.
9020 * src/parse-gram.y: Support unary %define.
9021 * tests/actions.at: Define global_tokens_and_yystype for backward
9022 compatibility until we update the tests.
9023 * tests/calc.at: Idem.
9024 (first_line, first_column, last_line, last_column): Define for lalr1.cc
9025 to simplify the code.
9027 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
9029 Port to SunOS 4.1.4, which lacks strtoul and strerror.
9030 Ah, the good old days! Problem reported by Peter Klein.
9031 * bootstrap (gnulib_modules): Add strerror, strtoul.
9032 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
9033 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
9035 2005-09-29 Akim Demaille <akim@epita.fr>
9037 * data/c.m4 (b4_error_verbose_if): New.
9038 * data/lalr1.cc: Use it.
9039 (YYERROR_VERBOSE_IF): Remove.
9040 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
9041 parser members, replaced by...
9042 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
9044 (yysyntax_error_): Takes the state number as argument.
9045 (yyreduce_print_): Use the argument yyrule, not the former
9048 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
9050 * bootstrap (gnulib_modules): Add verify.
9051 * lib/.cvsignore: Add verify.h.
9052 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
9053 * src/system.h (verify): Remove.
9054 Include verify.h instead.
9055 * src/tables.c (tables_generate): Use new API for 'verify'.
9057 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
9059 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
9060 local variables whose names begin with 'yy'.
9061 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
9062 Trivial changes from Joel E. Denny.
9064 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
9066 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
9067 don't use alloca any more.
9069 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
9070 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
9071 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
9072 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
9073 to match yacc.c, to test more hosts.
9075 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
9077 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
9078 doesn't affect behavior.
9079 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
9081 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
9082 This works a bit better with glibc, if user code has already included
9084 * doc/bison.texinfo (Bison Parser): Document that users can't
9085 arbitrarily use malloc and free for other purposes. Document
9086 that <alloca.h> and <malloc.h> might be included.
9087 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
9088 user must declare alloca.
9090 * HACKING (release): Forwarn the Translation Project about
9093 2005-09-20 Akim Demaille <akim@epita.fr>
9095 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
9097 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
9099 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
9100 (YYSTACK_ALLOC_MAXIMUM): Use it.
9101 (yysyntax_error): New function.
9102 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
9103 multiple syntax errors are reported, and alloca is being used.
9104 Instead, reallocate buffers twice as big each time, so that
9105 we waste at most half the allocated memory. Start with a small
9106 (128-byte) buffer that will suffice in most cases anyway.
9107 Use yysyntax_error to do most of the work.
9109 * doc/bison.texinfo (Error Reporting, Table of Symbols):
9110 yynerrs is the number of errors reported, not the number of
9113 * tests/glr-regression.at (Duplicated user destructor for lookahead):
9114 Mark it as expected to fail.
9115 Cast result of malloc; problem reported by twlevo@xs4all.nl.
9116 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
9117 Don't start user-code symbols with "yy", to avoid name space problems.
9119 2005-09-19 Akim Demaille <akim@epita.fr>
9121 Remove the traits, failed experiment.
9122 It never proved useful, and anyway because of the current
9123 definition, it was not possible to have several specialization of
9124 this traits, making it useless.
9125 * data/lalr1.cc (yy:traits): Remove.
9126 Inline its definitions in the parser class.
9128 2005-09-19 Akim Demaille <akim@epita.fr>
9130 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
9131 least Mac OSX with a /usr/local install of gettext.
9133 2005-09-19 Akim Demaille <akim@epita.fr>
9135 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
9136 and yytoken for similarity with the other skeletons.
9138 2005-09-19 Akim Demaille <akim@epita.fr>
9140 * NEWS, configure.ac: update version number to 2.1a.
9142 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
9144 * NEWS: Version 2.1.
9146 * NEWS: Remove notice of yytname change, since it was never in an
9148 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
9150 * src/output.c (prepare): Likewise.
9151 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
9152 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
9153 is not defined. This is an awful hack, but it's enough for now.
9154 All callers changed.
9155 * tests/glr-regression-at (make_value): Args are const pointers now,
9156 to avoid GCC warning.
9157 (Duplicated user destructor for lookahead): New test. Currently
9158 skipped. It fails on my host but I'm not sure it'll always fail.
9160 2005-09-16 Akim Demaille <akim@epita.fr>
9162 * src/symtab.h (struct symbol): Declare the printer and destructor
9163 as const, to avoid accidental calls to free.
9164 (symbol_destructor_set, symbol_printer_set): Adjust.
9165 * src/symtab.c: Adjust.
9167 2005-09-16 Akim Demaille <akim@epita.fr>
9169 * data/c.m4 (b4_token_enums): New.
9170 (b4_token_defines): Rename as...
9171 (b4_token_enums_defines): this.
9172 (b4_token_defines): New, output only the #defines.
9173 * data/yacc.c, data/glr.c: Adjust.
9174 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
9175 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
9178 2005-09-16 Akim Demaille <akim@epita.fr>
9180 * data/lalr1.cc (yylex_): Remove, inline its code.
9181 (yyreport_syntax_error_): Remove, replaced by...
9182 (yysyntax_error_): this which returns a string and leaves to the
9183 caller the call to the users' error function.
9184 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
9185 Move from members of the parser object...
9186 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
9187 to local variables of the parse function.
9189 2005-09-16 Akim Demaille <akim@epita.fr>
9191 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
9192 since it's in Bison's name space.
9194 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
9196 * data/glr.c (yyresolveValue): Add default case to pacify
9197 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
9199 * NEWS: Document when yyparse started to return 2.
9200 * doc/bison.texinfo (Parser Function): Document when yyparse
9203 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
9204 (b4_filename_type): Renamed back from b4_file_name_type. All uses
9206 (class position): file_name -> filename (reverting). All uses changed.
9208 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
9210 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
9211 do anything if $@ exists. This reverts part of the 2005-07-07
9214 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
9216 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
9217 contains obsolete information and isn't worth distributing as a
9218 separate file anyway.
9219 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
9220 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
9221 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
9222 (yyparse): Abort if user code uses longjmp to throw an unexpected
9225 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
9227 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
9228 Suggested by twlevo@xs4all.nl.
9230 * data/glr.c (YYCHK1): Do not assume YYE is in range.
9231 This avoids a diagnostic from gcc -Wswitch-enum.
9232 Problem reported by twlevo@xs4all.nl.
9234 * doc/bison.texinfo: Don't use "filename", as per GNU coding
9235 standards. Use "file name" or "file" or "name", depending on
9237 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
9238 not to hack/foo.tab.c.
9239 (Calc++ Top Level): 2nd arg of main is not const.
9240 * data/glr.c: b4_filename -> b4_file_name.
9241 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
9243 (class position): filename -> file_name. All uses changed.
9244 * data/yacc.c: b4_filename -> b4_file_name.
9245 * lib/bitset.h: filename -> file_name in local vars.
9246 * lib/bitset_stats.c: Likewise.
9247 * src/files.c: Likewise.
9248 * src/scan-skel.l ("@output ".*\n): Likewise.
9249 * src/files.c (file_name_split): Renamed from filename_split.
9250 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
9252 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
9254 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
9255 to accommodate latest gnulib.
9257 * tests/glr-regression.at (Duplicate representation of merged trees):
9258 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
9260 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
9263 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
9265 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
9266 All uses changed. Invoke user destructor after an error during a
9267 split parse (trivial change from Joel E. Denny).
9269 * tests/glr-regression.at
9270 (User destructor after an error during a split parse): New test case.
9271 Problem reported by Joel E. Denny in:
9272 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
9274 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
9276 * README-cvs: Give URLs for recommended tools.
9277 Mention Gzip version problem, and bootstrapping issues.
9278 Remove troubleshooting section, as it's somewhat obsolete.
9280 * bootstrap (no_cache): New var, to accommodate different wget
9281 variants. Use it instead of '-C off'. Problem reported by
9284 * data/glr.c (yydestroyStackItem): New function.
9285 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
9286 debugging information. Problem reported by Joel E. Denny.
9288 2005-08-25 Akim Demaille <akim@epita.fr>
9290 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
9292 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
9294 * data/glr.c (yyrecoverSyntaxError, yyreturn):
9295 Don't invoke destructor on unresolved entries.
9296 * tests/glr-regression.at
9297 (User destructor for unresolved GLR semantic value): New test case.
9298 Problem reported by Joel E. Denny in:
9299 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
9301 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
9303 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
9305 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
9306 lib-prefix.m4, po.m4.
9308 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
9309 in yydestruct diagnostic, since it might not be an error.
9310 Problem reported by Joel Denny near end of
9311 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
9312 * data/lalr1.cc (yyerturn): Likewise.
9313 * data/yacc.c (yyreturn): Likewise.
9314 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
9316 * src/files.c: Remove obsolete FIXME comment.
9318 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
9319 with the other templates, and to fix bogus run-on messages such
9320 as the one reported at the end of
9321 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
9322 All callers changed to avoid the newline.
9323 (yyprocessOneStack): Output two lines rather than one, to accommodate
9324 the above change. This changes the debug output format slightly.
9326 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
9327 reported by Joel E. Denny in
9328 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
9330 * tests/glr-regression.at (Duplicate representation of merged trees):
9331 New test, from Joel E. Denny in:
9332 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
9333 * THANKS: Add Joel E. Denny.
9335 * configure.ac (AC_INIT): Bump to 2.0c.
9337 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
9339 * NEWS: Version 2.0b.
9341 * Makefile.am (SUBDIRS): Put examples before tests, so that
9342 "make check" doesn't finish with "All 1 tests passed".
9344 * tests/regression.at (Token definitions): Don't rely on
9345 AT_PARSER_CHECK for data that contains backslashes. It currently
9346 uses 'echo', and 'echo' isn't portable if its argument contains
9347 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
9348 that the byte '\0xff' is not printable in the C locale; it is,
9349 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
9350 not printable, so use '\0x81' to test.
9352 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
9353 version of GCC, since the macro is used with non-GCC compilers.
9355 Fix core dump reported by Pablo De Napoli in
9356 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
9357 * tests/regression.at (Invalid inputs with {}): New test.
9358 * src/parse-gram.y (token_name): Translate type before using
9361 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
9362 the user's name space. All uses changed to __attribute__
9364 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
9365 Add __attribute__ ((__noreturn__)).
9367 * etc/clcommit: Remove. We weren't using it, and it failed
9368 "make maintainer-distcheck".
9369 * Makefile.maint: Merge from coreutils.
9370 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
9371 (syntax-check-rules): Change list of rules as described below.
9372 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
9373 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
9374 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
9375 (sc_trailing_space): New rules.
9376 (sc_xalloc_h_in_src): Remove.
9377 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
9378 (sc_space_tab, sc_error_exit_success, sc_changelog):
9379 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
9380 (makefile-check, po-check, author_mark_check):
9381 (makefile_path_separator_check, copyright-check):
9382 Use grep -n, to make it easier to find violations.
9383 Use CVS_LIST and CVS_LIST_EXCEPT.
9384 (header_regexp, h_re): Remove.
9386 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
9387 (my-distcheck): Use more-modern GCC flags.
9388 (signatures, %.asc): Remove.
9389 (rel-files, announcement): Remove signatures.
9390 Restore old updating code, even though we don't use it, so
9391 that we're the same as coreutils.
9392 (alpha, beta, major): Depend on news-date-check.
9393 Make the upload commands.
9395 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
9396 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
9397 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
9398 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
9399 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
9400 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
9401 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
9402 * tests/sets.at: Likewise.
9404 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
9405 we comment out the Autoconf version number.
9406 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
9407 it's error-prone and "make maintainer-distcheck" rejects it.
9409 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
9410 Indent calls to "error" to pacify "make maintainer-distcheck",
9411 when the calls are not intended to be translated.
9412 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
9414 * src/Makefile.am (DEFS): Use +=, to pacify
9415 "make maintainer-distcheck".
9416 (bison_SOURCES): Add scan-skel.h.
9417 (sc_tight_scope): New rule, from coreutils.
9419 * src/files.c (src_extension, header_extension):
9420 Now static, not extern.
9421 * src/getargs.c (short_options): Likewise.
9422 * src/muscle_tab.c (muscle_table): Likewise.
9423 * src/parse-gram.y (current_class, current_type, current_prec):
9425 * src/reader.c (grammar_end, previous_rule_end): Likewise.
9426 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
9427 * src/main.c (main): Cast bindtextdomain and textdomain calls to
9428 void, to avoid warning when NLS is disabled.
9429 * src/output.c: Include scan-skel.h.
9430 (scan_skel): Remove decl, since scan-skel.h does this.
9432 Indent calls to "error" to pacify "make maintainer-distcheck".
9433 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
9434 * src/reader.h (gram_end, gram_lineno): New decls to pacify
9435 "make maintainer-distcheck".
9436 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
9437 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
9438 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
9439 (skel_lex_destroy, scan_skel): Move these decls to...
9440 * src/scan-skel.h: New file.
9441 * src/uniqstr.c (uniqstr_assert):
9442 Indent calls to "error" to pacify "make maintainer-distcheck".
9444 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
9447 * tests/torture.at: Revamp to avoid misuse of atoi that
9448 "make maintainer-distcheck" complained about.
9450 * examples/extexi (message): Don't print a message more than once,
9451 and omit line-number decoration that makes Emacs compile think
9452 that informative messages are worth worrying about.
9454 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
9456 * configure.ac: Update version number.
9458 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
9460 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
9461 autogenerated by the maintainer.
9462 * examples/calc++/.cvsignore: Add *.yy.
9464 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
9465 * lib/bitset_stats.c (bitset_stats_init): Likewise.
9466 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9468 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
9470 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
9471 from maintainer-distcheck about casting the argument of 'free'.
9473 * NEWS: Mention recent yytname changes.
9474 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
9476 * bootstrap: For translations that have not yet been upgraded to
9477 the new runtime-po domain, prime the pump by extracting the
9478 relevant strings from the obsolete translations. This code can be
9479 removed once the bison-runtime domain has been translated by each
9482 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
9483 now that token names are already quoted.
9485 Fix problem reported by Anthony Heading.
9486 * data/glr.c (YYTOKEN_TABLE): New macro.
9487 (yytname): Define if YYTOKEN_TABLE.
9488 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
9489 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
9490 (YYERROR_VERBOSE): Define the same way the other skeletons do.
9491 * src/output.c (prepare_symbols): Output token_table_flag.
9493 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
9495 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
9496 again if the first call fails.
9498 * data/glr.c (yytnamerr): New function.
9499 (yyreportSyntaxError): Use it to dequote most string literals.
9500 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
9501 with other skeletons. All uses changed.
9502 (yytnameerr_): New function.
9503 (yyreport_syntax_error): Use it to dequote most string literals.
9504 * data/yacc.c (yytnamerr): New function.
9505 (yyerrlab): Use it to decode most string literals.
9506 * doc/bison.texinfo (Decl Summary, Calling Convention):
9507 Clarify quoting convention of yytname.
9508 * src/output.c (prepare_symbols): Quote all names. This undoes
9509 the 2005-04-17 change, which is now accomplished (mostly) via
9510 changes in the parsers as described above.
9511 * tests/regression.at (Token definitions, Web2c Actions):
9512 Undo most 2005-04-17 change here, too.
9514 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
9516 Fix more problems reported by twlevo@xs4all.nl.
9517 * tests/cxx-type.at: Don't pipe output of ./types through sed to
9518 remove trailing spaces. This loses the exit status of ./types,
9519 and isn't needed since ./types shouldn't be emitting trailing
9521 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
9522 as the stack isn't valid in that case.
9524 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
9525 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
9526 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
9527 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
9529 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
9530 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
9531 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
9534 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
9535 overly-picky compilers that reject 'char *foo = "bar";'.
9537 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
9538 to FILE * parameter, not to stderr. This fixes a typo introduced
9539 in the 2005-07-12 change.
9541 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
9542 warnings from GCC 4.
9544 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
9545 (yyglrShiftDefer, yysplitStack):
9546 Remove unused parameters b4_pure_formals. All uses changed.
9547 (yyglrShift): Remove unused parameters b4_user_formals.
9549 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
9551 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
9553 Destructor cleanups and regularization among the three skeletons.
9554 * NEWS: Document the behavior changes.
9555 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
9556 stack before failing, as the cleanup code will do it for us now.
9557 * data/lalr1.cc (yyerrlab): Likewise.
9558 * data/glr.c (yyparse): Pop everything off the stack before
9559 freeing it, so that destructors get called properly.
9560 * data/lalr1.cc (yyreturn): Likewise.
9561 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
9562 This is more consistent.
9563 * doc/bison.texinfo (Destructor Decl): Mention more reasons
9564 why destructors might be called. 1.875 -> 2.1.
9565 (Destructor Decl, Decl Summary, Table of Symbols):
9566 Some English-language cleanups for %destructor.
9567 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9568 Add output line for destructor of start symbol.
9569 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
9570 because of that same extra output line.
9572 * NEWS: Document minor wording changes in diagnostics of
9573 Bison-generated parsers.
9574 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
9575 Remove unused formals. All uses changed.
9576 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
9577 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
9578 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
9579 Rename yyoverflowab to yyexhaustedlab.
9580 When memory exhaustion occurs during syntax-error reporting,
9581 report it separately rather than in a single diagnostic; this
9583 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
9584 (Memory Exhausted): Renamed from Parser Stack Overflow.
9585 Revamp wording slightly to prefer "memory exhaustion".
9586 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
9588 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
9590 Add i18n support to the GLR skeleton. Partially fix the C++
9591 skeleton; a C++ expert needs to finish this. Remove debugging
9592 msgids; there's little point to having them translated, since they
9593 can be understood only by someone who can read the
9594 (English-language) source code.
9596 Generate runtime-po/bison-runtime.pot automatically, so that we
9597 don't have to worry about garbage getting in that file. We'll
9598 make sure after the next official release that old msgids don't
9600 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
9602 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
9604 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
9605 Fix typos in explanations of the runtime file.
9606 * bootstrap: Change gettext keyword from YYI18N to YY_.
9607 Use standard Makefile.in.in in runtime-po, since we'll arrange
9608 for backward-compatible bison-runtime.po files in a different way.
9609 * data/glr.c (YY_): New macro, from yacc.c.
9610 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
9611 Translate messages intended for users.
9612 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
9613 the wording in the other skeletons. We don't know that the memory
9615 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
9616 Use same method that yacc.c uses.
9617 Don't translate debugging messages.
9618 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
9619 it doesn't work (yet), and requires C++ expertise to fix.
9620 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
9621 Move defn to a more logical place, to be consistent with other
9623 Don't translate debugging messages.
9624 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
9625 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
9626 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
9627 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
9629 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
9630 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
9632 * tests/glr-regression.at (Badly Collapsed GLR States):
9634 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9635 yylex should return 0 at EOF rather than aborting.
9637 Improve tests for stack overflow in GLR parser.
9638 Problem reported by twlevo@xs4all.nl.
9639 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
9641 (yyStackOverflow): Just longjmp, but with value 2 so that caller
9642 can handle the problem.
9643 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
9644 (yyparse): New local variable yyresult to record the result.
9645 Use result of setjmp to set it, rather than storing itinto
9647 (yyDone): Remove label.
9648 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
9649 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
9650 if YYABORT is used).
9651 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
9652 yyparse status; put status > 1 into diagnostic.
9653 Check that status==2 works.
9654 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
9655 Use exit status 3 for failure to open (which shouldn't happen).
9657 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
9659 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
9660 1 on syntax error; just let yyparse do its thing.
9661 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
9662 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
9663 (Exploding the Stack Size with Alloca):
9664 (Exploding the Stack Size with Malloc):
9665 Expect exit status 2, not 1, since the parser is supposed to blow
9666 its stack. Problem reported by twlevo@xs4all.nl.
9668 * data/glr.c (yyparse): Don't assume that the initial calls
9669 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
9670 Print a stack-overflow message and fail instead.
9671 Initialize the line-number information before creating the stack,
9672 so that the stack-overflow message can report line zero safely.
9674 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
9676 Fix problems reported by twlevo@xs4all.nl.
9677 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
9678 (yyuserMerge): Provide a default case if b4_mergers is empty.
9679 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
9680 * tests/glr-regression.at
9681 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9682 Add casts to pacify C++ compilers.
9683 * tests/glr-regression.at (Improper merging of GLR delayed action
9684 sets): Declare yylex before using it.
9685 * tests/Makefile.am (maintainer-check-g++): Fix a stray
9686 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
9687 test for valgrind; valgrind is independent of g++.
9688 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
9689 for compatibility with POSIX 1003.1-2001 (if running coreutils).
9690 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
9691 Use a destructor, so that we can expand the stack. Change
9692 YYSTYPE to char * so that we can free it. Cast result of malloc.
9694 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9696 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
9697 a valgrind failure. Problem reported by twlevo@xs4all.nl.
9699 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
9701 * PACKAGING: New file, suggested by Bruno Haible and taken from
9702 similar wording in gettext's PACKAGING file.
9703 * NEWS: Mention PACKAGING.
9704 * Makefile.am (EXTRA_DIST): Add PACKAGING.
9706 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
9708 * NEWS: Document recent i18n improvements.
9709 * bootstrap: Get runtime translations into runtime-po.
9710 Create runtime-po files automatically, if possible.
9711 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
9712 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
9713 does not infringe on the user's name space.
9714 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
9715 * doc/bison.texinfo (Internationalization): Revamp the English
9716 and Texinfo syntax a bit, to try to make it clearer.
9717 (Bison Options, Option Cross Key): Mention --print-localedir.
9718 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
9719 YYENABLE_NLS. Quote a bit more.
9720 * runtime-po/.cvsignore: New file.
9721 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
9722 * runtime-po/Rules-quot: Remove; now created by bootstrap.
9723 * runtime-po/quot.sed: Likewise.
9724 * runtime-po/boldquot.sed: Likewise.
9725 * runtime-po/en@quot.header: Likewise.
9726 * runtime-po/en@boldquot.header: Likewise.
9727 * runtime-po/insert-header.sin: Likewise.
9728 * runtime-po/remove-potcdate.sin: Likewise.
9729 * runtime-po/Makevars: Likewise.
9730 * runtime-po/LINGUAS: Likewise.
9731 * runtime-po/de.po: Likewise; we will rely on the translation project
9732 to maintain this, so "bootstrap" should get it.
9733 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
9735 * src/main.c (main): Bind the bison-runtime domain, too.
9737 2005-07-12 Bruno Haible <bruno@clisp.org>
9739 * data/yacc.c: Include <libintl.h> when NLS is enabled.
9740 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
9741 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
9742 * runtime-po: New directory.
9743 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
9744 $(DOMAIN).pot-update rule, so that old messages are never dropped.
9745 * runtime-po/Rules-quot: New file, copied from po/.
9746 * runtime-po/quot.sed: Likewise.
9747 * runtime-po/boldquot.sed: Likewise.
9748 * runtime-po/en@quot.header: Likewise.
9749 * runtime-po/en@boldquot.header: Likewise.
9750 * runtime-po/insert-header.sin: Likewise.
9751 * runtime-po/remove-potcdate.sin: Likewise.
9752 * runtime-po/Makevars: New file.
9753 * runtime-po/POTFILES.in: New file.
9754 * runtime-po/LINGUAS: New file.
9755 * runtime-po/bison-runtime.pot: New file.
9756 * runtime-po/de.po: New file.
9757 * m4/bison.m4: New file.
9758 * Makefile.am (SUBDIRS): Add runtime-po.
9759 (aclocaldir, aclocal_DATA): New variables.
9760 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
9762 * src/getargs.c (usage): Document --print-localedir option.
9763 (PRINT_LOCALEDIR_OPTION): New enum item.
9764 (long_options): Add --print-localedir option.
9765 (getargs): Handle --print-localedir option.
9766 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
9767 (Internationalization): New section.
9769 2005-07-12 Akim Demaille <akim@epita.fr>
9771 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
9772 for consistency with the rest of the code.
9773 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
9776 2005-07-12 Akim Demaille <akim@epita.fr>
9778 * src/parse-gram.y: Use %printer instead of YYPRINT.
9780 2005-07-12 Akim Demaille <akim@epita.fr>
9782 * src/symtab.h, src/symtab.c (symbol_print): New.
9783 * src/symlist.h, src/symlist.c (symbol_list_print): New.
9784 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
9786 2005-07-12 Akim Demaille <akim@epita.fr>
9788 * data/glr.c (b4_syncline): Fix (swap) the definitions of
9789 b4_at_dollar and b4_dollar_dollar.
9791 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
9793 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
9794 and Pennello's paper.
9796 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
9798 * data/yacc.c (yyparse): Undo previous patch. Instead,
9799 set yylsp[0] and yyvsp[0] only if the initial action
9800 sets yylloc and yylval, respectively.
9802 * data/yacc.c (yyparse): In the initial action, set
9803 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
9804 This avoids the use of undefined variables if the initial
9805 action does not set yylloc and/or yylval.
9807 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
9809 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
9810 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
9811 Remove from CVS. These files are automatically generated.
9812 * examples/extexi: Clarify that this file is now part of Bison,
9813 not GNU M4, and that it works with any POSIX-compatible Awk.
9814 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
9815 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
9816 so that we also get calc++-parser.yy. Geneate it.
9817 Use $(AWK), not gawk, since any conforming Awk will do.
9818 Put comment before action, since older 'make' can't handle comment
9820 $(BUILT_SOURCES): List all built sources, not just some of them.
9821 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
9822 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
9823 $($(calc_sources_generated)): Remove unnecessary test for existence
9824 of target. (This had a shell syntax error anyway; a stray "x".)
9825 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
9827 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
9829 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
9830 implied by the other modules.
9832 2005-07-06 Akim Demaille <akim@epita.fr>
9834 Bind examples/calc++ to the package.
9835 * examples/calc++/Makefile: Remove, replaced by...
9836 * examples/calc++/Makefile.am: ... this new file.
9837 * examples/calc++/test: Remove input.
9838 * examples/calc++/compile: Remove.
9839 * examples/Makefile.am: New.
9840 * configure.ac, Makefile.am: Adjust.
9841 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
9843 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
9845 * data/glr.c (yyFail): Drastically simplify; since the format argument
9846 never had any % directives, we can simply pass it to yyerror.
9847 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
9848 be modified later, as that is the usual style in glr.c.
9849 Problems reported by Paul Hilfinger.
9851 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
9852 and size overflow errors.
9853 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
9854 in case the user prolog sets feature-test macros like _GNU_SOURCE.
9855 (YYSIZEMAX): New macro.
9856 (yystpcpy): New function, taken from yacc.c.
9857 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
9858 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
9859 so that we don't have to maintain their signatures.
9860 (yyFail): Check for buffer overflow, by using vsnprintf rather
9861 than vsprintf. Allocate a bigger buffer if possible.
9862 Report an error if buffer allocation fails.
9863 (yyStackOverflow): New function.
9864 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
9865 the initialization was successful. It might fail if storage was
9867 (yyexpandGLRStack): Add more checks for storage allocation failure.
9868 Use yyStackOverflow to report failures.
9869 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
9870 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
9871 Don't assume stack number fits in int.
9872 (yysplitStack): Check for storage allocation failure.
9873 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
9874 can print diagnostics on storage allocation failure. All callers
9876 (yyresolveValue): Use yybool for boolean.
9877 (yyreportSyntaxError): Check for size-calculation overflow.
9878 This code is taken from yacc.c.
9879 (yyparse): Check for storage allocation errors when allocating
9882 2005-07-05 Akim Demaille <akim@epita.fr>
9884 Extract calc++ from the documentation.
9885 * doc/bison.texinfo (Calc++): Add the extraction marks.
9886 * examples/extexi: New, from the aborted GNU Programming 2E.
9887 Separate the different paragraph of a file with empty lines.
9888 * examples/Makefile: Use it to extract the whole calc++ example.
9890 2005-06-24 Akim Demaille <akim@epita.fr>
9892 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
9895 2005-06-22 Akim Demaille <akim@epita.fr>
9897 * doc/bison.texinfo (C++ Language Interface): First stab.
9898 (C++ Parsers): Remove.
9900 2005-06-22 Akim Demaille <akim@epita.fr>
9902 * data/lalr1.cc (yylex_): Honor %lex-param.
9904 2005-06-22 Akim Demaille <akim@epita.fr>
9906 Start a set of simple examples.
9907 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
9908 * examples/calc++/calc++-driver.hh,
9909 * examples/calc++/calc++-parser.yy,
9910 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
9911 * examples/calc++/compile, examples/calc++/test: New.
9913 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
9915 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
9916 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
9917 which stems from the 2005-05-27 patch.
9919 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9921 * data/glr.c: Modify treatment of unused parameters to permit use
9922 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
9924 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
9926 Fix infringement on user name space reported by Janos Zoltan Szabo.
9927 * data/yacc.c (yyparse): strlen -> yystrlen.
9929 2005-05-30 Akim Demaille <akim@epita.fr>
9931 * data/lalr1.cc (_): New.
9932 Translate the various messages.
9934 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
9936 Fix infringement on user name space reported by Bruno Haible.
9937 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
9938 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
9939 the user's name space.
9940 (alloca): Include <stdlib.h> to get it, if it's not built in.
9941 (YYMALLOC, YYFREE): Define only if needed.
9942 (malloc, free): Declare, but only if needed, as this infringes on
9943 the user name space.
9945 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
9947 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
9948 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
9950 * lib/ebitset.c (min, max): Undef before defining.
9951 * lib/vbitset.c (min, max): Likewise.
9952 * lib/subpipe.c (create_subpipe): Save local variables in case
9953 vfork clobbers them.
9955 2005-05-24 Bruno Haible <bruno@clisp.org>
9957 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
9958 error message syntax used by gcc-4.0.
9960 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
9962 * README: Mention m4 1.4.3. Remove obsolete advice about
9963 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
9965 * bootstrap: Remove workaround for problem I encountered with
9966 gettext 0.14.1; it seems to be fixed now.
9968 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
9970 * NEWS: Version 2.0a.
9972 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
9973 the previous change.
9975 Various maintainer cleanups.
9976 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
9977 conftest*, for benefit of CVS commands run at the same time as
9978 "configure". Add build-aux, since "bootstrap" now creates it and
9980 * Makefile.cfg (move_if_change): Remove.
9981 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
9982 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
9983 (po_repo, do-po-update, po-update, wget_files, get-targets):
9984 (config.guess-url_prefix, config.sub-url_prefix):
9985 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
9986 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
9987 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
9989 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
9990 this is now the recommended name.
9991 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
9992 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
9993 ylwrap. These files now go into build-aux.
9994 * config/move-if-change: Remove.
9995 * config/prev-version.txt: Bump from 1.75 to 2.0.
9997 * bootstrap: Add stdio-safer, unistd-safer modules.
9998 Remove m4/glibc2.m4 (introduced by latest gnulib, but
10000 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
10001 fopen-safer.c, stdio-safer.h, unistd-safer.h.
10002 * lib/subpipe.c: Include "unistd-safer.h".
10003 (create_subpipe): Make sure all the newly-created
10004 file descriptors are > 2, so that diagnostics don't
10005 get sent down them (which might cause Bison to hang, in theory).
10006 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
10007 * src/files.c (xfopen): Use fopen_safer, not fopen.
10009 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
10010 yesterday's yacc.c fix.
10012 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
10014 * data/glr.c, data/lalr1.cc: Update copyright date.
10016 Fix a destructor bug reported by Wolfgang Spraul in
10017 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
10018 * data/yacc.c (yyabortlab): Don't call destructor, and
10019 don't set yychar to EMPTY.
10020 (yyoverflowlab): Don't call destructor.
10021 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
10022 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
10023 since we no longer output the message "discarding lookahead token
10026 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10028 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
10029 fix a small glitch in debugging output.
10030 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
10031 after YY_SYMBOL_PRINT where needed.
10033 (struct yyGLRState): Add some comments.
10034 (struct yySemanticOption): Add some comments.
10035 (union yyGLRStackItem): Add comment.
10037 (yymergeOptionSets): Correct this to properly perform the union,
10038 avoiding infinite reported by Michael Rosien.
10041 * tests/glr-regression.at: Add test for GLR merging error reported
10044 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
10046 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
10047 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
10048 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
10049 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
10050 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
10051 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
10052 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
10053 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
10054 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
10055 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
10056 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
10057 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
10058 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
10059 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
10060 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
10061 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
10062 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
10063 src/derives.h, src/files.c, src/files.h, src/getargs.c,
10064 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
10065 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
10066 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
10067 src/output.h, src/parse-gram.c, src/parse-gram.h,
10068 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
10069 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
10070 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
10071 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
10072 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
10073 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
10074 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
10075 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
10076 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
10077 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
10078 tests/reduce.at, tests/regression.at, tests/sets.at,
10079 tests/synclines.at, tests/testsuite.at, tests/torture.at:
10080 Update FSF postal mail address.
10082 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
10084 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
10085 Problem reported by Ralf Menzel.
10087 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
10089 * tests/actions.at: Test that stack overflow invokes destructors.
10090 From Marcus Holland-Moritz.
10091 * data/yacc.c (yyerrlab): Move the code that destroys the stack
10093 (yyreturn): to here. That way, destructors are called properly
10094 even if the stack overflows, or the user calls YYACCEPT or
10095 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
10096 (yyoverflowlab): Destroy the lookahead.
10098 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
10100 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
10102 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
10104 * NEWS: Bison-generated C parsers no longer quote literal strings
10105 associated with tokens.
10106 * src/output.c (prepare_symbols): Don't escape strings,
10107 since users don't want to see C escapes.
10108 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
10110 * tests/input.at (Torturing the Scanner): Likewise.
10111 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
10113 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
10115 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
10116 the data size is known to be too small and we can't increase it.
10117 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
10119 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
10121 * src/parse-gram.y: Include quotearg.h.
10122 (string_as_id): Quote $1 before using it as a key, since the
10123 lexer no longer quotes it for us.
10124 (string_content): Don't strip quotes, since lexer no longer
10126 * src/scan-gram.l: Include quotearg.h.
10127 ("\""): Omit quote.
10128 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
10129 a key, since the rest of the lexer doesn't quote it.
10130 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
10131 * tests/regression.at (Token definitions): Check for backslashes
10134 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
10135 (YYSIZE_T): Define to unsigned long int when using an older compiler.
10136 (yyparse): Revamp code to generate long syntax error message, to
10137 make it easier to translate, and to avoid problems with arithmetic
10138 overflow. Change "virtual memory" to "memory" in diagnostic, since
10139 we don't know whether the memory is virtual.
10141 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
10143 * NEWS: Bison-generated C parsers now use the _ macro to
10145 * data/yacc.c (_) [!defined _]: New macro.
10146 All English strings wrapped inside this macro.
10147 * doc/bison.texinfo (Bison Parser): Document _.
10148 * po/POTFILES.in: Include src/parse-gram.c, since it now
10149 includes translateable strings that parse-gram.y doesn't.
10151 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
10153 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
10154 reverting the 2004-10-11 change to this function.
10155 (symbol_check_alias_consistency): Don't call symbol_type_set
10156 if the type name is already correct.
10157 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
10159 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
10161 * tests/regression.at (Token definitions): Don't use a token named
10162 c, as that generates a "#define c ..." that runs afoul of buggy
10163 stdlib.h that uses the identifier c as a member of struct
10164 drand48_data. Problem reported by Horst Wente.
10166 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
10168 * bootstrap: Change translation URL from
10169 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
10170 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
10171 redirection glitches. Problem reported by twlevo@xs4all.nl.
10173 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
10175 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
10176 after operands; POSIX says this isn't portable for the c99 command.
10178 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
10180 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
10181 immediately if a data overrun has occurred; this may help us track
10182 down what may be a spurious failure on MacOS.
10184 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
10186 Respond to problems reported by twlevo@xs4all.nl.
10188 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
10190 * src/vcg.h: Comment fix.
10191 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
10192 (G_CMAX): Change to -1 instead of INT_MAX.
10194 * data/yacc.c (yyparse): Omit spaces before #line.
10196 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
10198 * src/tables.c (state_number_to_vector_number): Put it inside an
10199 "#if 0", since it's not currently used. Problem reported by
10202 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
10204 * src/output.c (escaped_output): Renamed from
10205 escaped_file_name_output, since we now use it for symbol tags as
10206 well. All uses changed.
10207 (symbol_destructors_output, symbol_printers_output):
10208 Escape symbol tags too.
10209 Problem reported by Matyas Forstner in
10210 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
10212 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
10214 * src/output.c (user_actions_output, token_definitions_output,
10215 symbol_destructors_output, symbol_printers_output): Likewise.
10216 * src/reader.c (prologue_augment): Likewise.
10217 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
10219 * src/vcg.c (output_edge): Don't quote linestyle arg.
10220 Problem reported by twlevo@xs4all.nl.
10222 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
10224 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
10225 example, reported by Derek M Jones. Also, make the example even
10226 more outrageous, to better illustrate how bad the problem is.
10228 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
10230 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
10231 putsym. Typo reported by Sebastian Piping.
10233 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
10235 * doc/bison.texinfo (Language and Grammar): some -> same
10236 (Epilogue): int he -> in the
10237 Typos reported by Sebastian Piping via Justin Pence.
10239 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
10241 * tests/glr-regression.at (Improper handling of embedded actions
10242 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
10243 embedded actions and $-N in GLR parsers", work around an Autoconf bug
10244 with dollar signs in test names.
10245 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
10246 for a similar reason.
10248 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
10250 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
10251 wants to redefine G_VIEW.
10253 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
10255 * src/vcg.c (get_view_str): Remove case for normal_view.
10256 Problem reported by twlevo@xs4all.nl.
10258 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
10260 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
10261 Problem reported by twlevo@xs4all.nl.
10263 * doc/bison.texinfo: Change @dircategory from "GNU programming
10264 tools" to "Software development". Requested by Richard Stallman
10267 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
10269 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
10270 Problem reported by twlevo@xs4all.nl.
10272 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
10274 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
10275 keyword; it's not needed with modern compilers, and it doesn't
10276 affect correctness with older compilers. Suggested by
10279 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
10281 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
10282 gcc -Wswitch-default.
10283 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
10284 * data/yacc.c (yyparse): Likewise.
10286 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
10288 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
10289 already. Let config.h define any nonstandard values.
10291 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
10293 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
10294 for the benefit of slower hosts. Problem reported by
10295 Nelson H. F. Beebe.
10297 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
10299 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
10300 being defined and not used.
10301 * data/lalr1.cc (yyparse): Likewise.
10302 Use "if (false)" rather than "if (0)".
10304 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
10306 * TODO: Mention that we should allow NUL bytes in tokens.
10308 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
10310 * src/scan-skel.l (<<EOF>>): Don't close standard output.
10311 Problem reported by Hans Aberg.
10313 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
10315 * src/getargs.c (version): Happy new year; update overall
10316 program copyright date from 2004 to 2005.
10318 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
10319 Problem reported by Hans Aberg.
10320 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
10321 (Output file names.): Add a test for the case when standard output
10324 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
10326 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
10327 to fix an oversight in the Bison 2.0 manual.
10329 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
10331 * NEWS: Version 2.0. Reformat the existing news items since
10332 1.875, so that related items are grouped together.
10333 * configure.ac (AC_INIT): Bump version to 2.0.
10334 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
10336 * tests/torture.at (Exploding the Stack Size with Alloca): Set
10337 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
10338 otherwise, we're not testing alloca. Unfortunately there's no
10339 simple way to consult HAVE_ALLOCA here.
10341 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
10344 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
10345 hand. This avoids a warning about comparing int to size_t when
10346 GCC warnings are enabled.
10348 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
10350 * NEWS: Bison-generated parsers no longer default to using the
10351 alloca function (when available) to extend the parser stack, due
10352 to widespread problems in unchecked stack-overflow detection.
10353 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
10354 responsibility to set it to a positive value. This lets the user
10355 specify a value that is not a preprocessor constant.
10356 * data/yacc.c (YYMAXDEPTH): Likewise.
10357 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
10358 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
10359 to be a compile-time constant. However, explain the constraints on it.
10360 Also, explain the constraints on YYINITDEPTH.
10361 (Table of Symbols): Explain that alloca is no longer the default.
10362 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
10365 * doc/bison.texinfo (Location Default Action): Mention that n must
10366 be zero when k is zero. Suggested by Frank Heckenbach.
10368 2004-12-22 Akim Demaille <akim@epita.fr>
10370 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
10371 (parser::state_type, parser::semantic_type, parser::location_type):
10372 Private, not public.
10373 (parser::parse): Return ints, not bool.
10374 Returning a bool introduces a problem: 0 corresponds to false, and
10375 it seems weird to return false on success. Returning true changes
10376 the conventions for yyparse.
10377 Alternatively we could return void and send an exception.
10378 There is no clear consensus (yet?).
10379 (state_stack, semantic_stack, location_stack): Rename as...
10380 (state_stack_type, semantic_stack_type, location_stack_type): these.
10381 Private, not public.
10382 * tests/c++.at: New.
10383 * tests/testsuite.at, tests/Makefile.am: Adjust.
10385 2004-12-21 Akim Demaille <akim@epita.fr>
10387 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
10389 2004-12-21 Akim Demaille <akim@epita.fr>
10391 Don't impose std::string for filenames.
10393 * data/lalr1.cc (b4_filename_type): New.
10394 (position::filename): Use it.
10395 (parser.hh): Move the inclusion of stack.hh and location.hh below
10396 the user code, so that needed headers for the filename type can be
10398 Forward declare them before the user code.
10399 * tests/Makefile.am (check-local, installcheck-local): Pass
10400 TESTSUITEFLAGS to the TESTSUITE.
10402 2004-12-20 Akim Demaille <akim@epita.fr>
10404 Use more STL like names: my_class instead of MyClass.
10406 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
10407 (SemanticStack, SemanticType, StateStack, StateType)
10408 (TokenNumberType, Stack, Slice, Traits, Parser::location)
10409 (Parser::value): Rename as...
10410 (location_stack, location_type, rhs_number_type, semantic_stack)
10411 (semantic_type, state_stack, state_type, token_number_type, stack)
10412 (slice, traits, parser::yylloc, parser::yylval): these.
10414 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
10416 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
10418 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
10419 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10421 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
10423 Remove uses of 'short int' and 'unsigned short int'. This raises
10424 some arbitrary limits. It uses more memory but nowadays that's
10425 not much of an issue.
10427 This change does not affect the generated parsers; that's a different
10428 task, as some users will want to conserve memory there.
10430 Ideally we should use size_t to represent all object counts, and
10431 something like ptrdiff_t to represent signed differences of object
10432 counts; but that will require more code-cleanup than I have the
10433 time to do right now.
10435 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
10436 Use size_t, not int or short int, to count objects.
10437 * src/closure.c (nritemset, closure): Likewise.
10438 * src/closure.h (nritemset, closure): Likewise.
10439 * src/nullable.c (nullable_compute): Likewise.
10440 * src/print.c (print_core): Likewise.
10441 * src/print_graph.c (print_core): Likewise.
10442 * src/state.c (state_compare, state_hash): Likewise.
10443 * src/state.h (struct state): Likewise.
10444 * src/tables.c (default_goto, goto_actions): Likewise.
10446 * src/gram.h (rule_number, rule): Use int, not short int.
10447 * src/output.c (prepare_rules): Likewise.
10448 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
10449 errs, reductions): Likewise.
10450 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
10452 * src/tables.c (vector_number, tally, action_number,
10453 ACTION_NUMBER_MINIMUM): Likewise.
10454 * src/output.c (muscle_insert_short_int_table): Remove.
10456 2004-12-17 Akim Demaille <akim@epita.fr>
10458 * data/lalr1.cc: Extensive Doxygenation.
10459 (error_): Rename as...
10460 (error): this, since it is visible to the user.
10462 (Parser::message): Now an automatic variable from...
10463 (Parser::yyreport_syntax_error_): here.
10464 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
10466 * tests/input.at: Escape $.
10468 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
10470 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
10471 Parenthesize rhs to avoid obscure problems with mistakes like
10472 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
10473 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
10474 b4_rhs_location): Likewise.
10475 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
10476 b4_rhs_location): Likewise.
10478 2004-12-16 Akim Demaille <akim@epita.fr>
10480 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
10481 yacc.c: be sure to stay within yycheck_.
10482 * tests/actions.at: Re-enable C++ tests.
10484 2004-12-16 Akim Demaille <akim@epita.fr>
10486 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
10489 2004-12-16 Akim Demaille <akim@epita.fr>
10491 Use #define to handle the %name-prefix.
10493 * data/glr.c, data/yacc.c: Comment changes.
10494 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
10495 so that one can refer to yylex in the parser file, and have it
10496 renamed, as is the case with other skeletons.
10498 2004-12-16 Akim Demaille <akim@epita.fr>
10500 Move lalr1.cc internals into yy*.
10502 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
10503 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
10504 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
10505 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
10506 (empty_, final_, terror_, errcode_, ntokens_)
10507 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
10508 (looka_, ilooka_, error_range_, nerrs_):
10510 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
10511 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
10512 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
10513 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
10514 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
10515 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
10516 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
10517 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
10520 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
10522 Fix some problems reported by twlevo at xs4all.
10523 * src/symtab.c (symbol_new): Report an error if the input grammar
10524 contains too many symbols. This is better than calling abort() later.
10525 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
10526 (struct node, struct graph):
10527 Rename member expand to stretch. All uses changed.
10528 (struct graph): Remove member layoutalgorithm. All uses removed.
10529 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
10530 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
10532 (N_STRETCH): Rename from N_EXPAND. All uses changed.
10534 2004-12-15 Akim Demaille <akim@epita.fr>
10536 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
10537 Add more Doxygen comments.
10538 (symprint_, stack_print_, reduce_print_, destruct_, pop)
10539 (report_syntax_error_, translate_): Rename as...
10540 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
10541 (yypop_, yyreport_syntax_error_, yytranslate_): this.
10543 2004-12-15 Akim Demaille <akim@epita.fr>
10545 * data/lalr1.cc (lex_): Rename as...
10547 Move the trace here.
10548 Take the %name-prefix into account.
10549 Reported by Alexandre Duret-Lutz.
10551 2004-12-15 Akim Demaille <akim@epita.fr>
10553 Simplify the C++ parser constructor.
10555 * data/lalr1.cc (debug_): Rename as...
10556 (yydebug_): so that the parser's internals are always in the yy*
10559 (b4_parse_param_decl): Remove the leading comma as it is now only
10560 called as unique argument list.
10561 (Parser::Parser): Remove the constructor accepting a location and
10562 an initial debugging level.
10563 Remove from the other ctor the argument for the debugging level.
10564 (debug_level_type, debug_level, set_debug_level): New.
10566 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
10569 2004-12-15 Akim Demaille <akim@epita.fr>
10571 Remove b4_root related material: failure experiment
10572 (which goal was to allow to derive from a class).
10574 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
10575 definitions and uses.
10577 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
10579 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
10580 not 2, since it's not portable to subtract 1 from the start of an
10581 array. The new item 0 is never set or used. All uses changed.
10583 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
10584 the default definition of YYLLOC_DEFAULT. Problem reported
10585 by Frank Heckenbach.
10587 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
10589 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
10590 the normal case and one for the error case. Just use the
10591 first one uniformly. Problem reported by Frank Heckenbach.
10592 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
10593 use exactly the same macro in both places.
10594 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
10595 so that the normal-case YYRHSLOC works for the error case too.
10597 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
10598 (YYLLOC_DEFAULT): Use the same macro as glr.c.
10599 * doc/bison.texinfo (Location Default Action): Don't claim that
10600 we have an array of locations. Use the same macro for both glr
10601 and lalr parsers. Mention YYRHSLOC. Mention what happens when
10604 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
10606 * HACKING: Update email addresses to send announcements to.
10608 * configure.ac (AC_INIT): Bump version to 1.875f.
10610 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
10612 * NEWS: Version 1.875e.
10613 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
10615 * src/scan-skel.l: Include "complain.h", for "fatal".
10617 * src/relation.h (relation_print, relation_digraph):
10618 Relation sizes are of type relation_node, not size_t (this is
10619 merely a doc fix, since the two types are equivalent).
10620 (relation_transpose): Relation sizes are of type relation_node,
10622 * src/relation.c: Likewise.
10623 (top, infinity): Now of type relation_node, not int.
10624 (traverse, relation_transpose): Use relation_node, not int.
10626 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
10627 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
10628 (yyparse): Remove unused local introduced in 2004-10-25 patch.
10630 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
10631 specifying whether the test should be skipped. Use it tp
10632 specify that the [%defines %skeleton "lalr1.cc"] tests currently
10633 fail on some hosts, and should be skipped.
10635 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
10637 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
10638 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
10639 unless otherwise specified below.
10641 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
10642 to allocate kernel_base, kernel_items, kernel_size, since
10643 they needn't be initialized to 0.
10644 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
10645 * src/closure.c (new_closure): Likewise, for itemset.
10646 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
10647 * src/lalr.c (set_goto_map): Likewise, for temp_map.
10648 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
10649 (build_relations): Likewise for edge, states1, includes.
10650 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
10651 * src/reader.c (packgram): Likewise, for ritem, rules.
10652 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
10653 * src/relation.c (relation_digraph): Likewise for VERTICES.
10654 (relation_transpose): Likewise for new_R, end_R.
10655 * src/symtab.c (symbols_token_translations_init): Likewise for
10656 token_translations.
10657 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
10658 (token_actions): Likewise for yydefact, actrow, conflrow,
10660 (save_column): Likewise for froms[symno], tos[symno].
10661 (goto_actions): Likewise for state_count.
10662 (pack_table): Likewise for base, pos, check.
10663 (tables_generate): Likewise for width.
10665 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
10666 for initial core. Just have a separate core, so we needn't worry
10667 about whether kernel_size and kernel_base are initialized.
10669 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
10670 kernel_size, kernel_items): Remove unnecessary initialization.
10671 * src/conflicts.c (conflicts): Likewise.
10672 * src/derives.c (derives): Likewise.
10673 * src/muscle_tablc (muscle_insert): Likewise.
10674 * src/relation.c (relation_digraph): Likewise.
10675 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
10676 conflrow, conflict_table, conflict_list, table, check):
10679 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
10680 This is because all callers pass unsigned int.
10681 * src/closure.h (new_closure): Likewise.
10683 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
10684 (build_relations): Initialize includes[i] in all cases.
10685 * src/reader.c (packgram): Always initialize rules[ruleno].prec
10686 and rules[ruleno].precsym. Initialize members in order.
10687 * src/relation.c (relation_transpose): Always initialize new_R[i]
10689 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
10691 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
10692 conflict_list[0] was always 0, but now it isn't initialized.
10694 * src/table.c (table_grow): When conflict_table grew, the grown
10695 area wasn't cleared. Fix this.
10697 * lib/.cvsignore: Add strdup.c, strdup.h.
10698 * m4/.cvsignore: Add strdup.m4.
10700 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
10702 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
10703 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
10704 GOTO_NUMBER_MAXIMUM, since we occasionally compute
10705 ngotos + 1 without checking for overflow.
10706 (build_relations): Use END_NODE, not -1, to denote end of edges.
10707 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
10708 build_relations): Use goto_number, not int, for goto numbers.
10709 * src/tables.c (save_column, default_goto): Likewise.
10711 2004-11-23 Akim Demaille <akim@epita.fr>
10713 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
10714 of #defining from yystype.
10715 Don't typedef yystype, C++ does not need it.
10716 This lets it possible to forward declare it as union.
10718 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
10720 * bootstrap (gnulib_modules): Add extensions.
10721 Problem reported by Jim Meyering.
10723 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
10725 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
10726 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
10727 src/system.h, src/tables.c: XFREE -> free, to accommodate
10728 recent change to gnulib xalloc.h.
10729 Problem reported by Jim Meyering.
10731 2004-11-17 Akim Demaille <akim@epita.fr>
10733 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
10735 2004-11-17 Akim Demaille <akim@epita.fr>,
10736 Alexandre Duret-Lutz <adl@gnu.org>
10738 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
10740 (YYCDEBUG): Adjust.
10741 Use it instead of cdebug_.
10742 (Parser::debug_stream, Parser::set_debug_stream): New.
10743 (Parser::symprint_): Define cdebug_ for temporary backward
10745 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
10748 2004-11-17 Akim Demaille <akim@epita.fr>
10750 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
10751 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
10752 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
10753 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
10755 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
10757 * data/glr.c (yyloc_default): Remove; not used.
10758 Problem reported by Frank Heckenbach.
10760 2004-10-25 Akim Demaille <akim@epita.fr>
10762 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
10763 Introduce another definition to address simple location arrays.
10764 (yyGLRStack): New member: yyerror_range.
10765 (yyrecoverSyntaxError, yyparse): Update it.
10766 (yyrecoverSyntaxError): Use it when shifting the error token to
10767 have an accurate range, equivalent to the one computed by both
10768 yacc.c and lalr1.cc.
10769 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
10770 that column numbers start at column 0, as per GNU Coding
10771 Standards, the others tests, and the doc.
10772 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
10773 Adjust to the above change (first column is 0).
10774 And adjust the location of the "<error>", now covering the whole
10777 2004-10-22 Akim Demaille <akim@epita.fr>
10778 and Paul Eggert <eggert@cs.ucla.edu>
10780 Remove some arbitrary limits on goto numbers and relations.
10781 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
10782 initial values, since they're never used.
10783 (set_goto_map): ngotos is now unsigned, so test for overflow
10784 by seeing whether it wraps around to zero.
10785 * src/lalr.h (goto_number): Now size_t, not short int.
10786 (GOTO_NUMBER_MAXIMUM): Remove.
10787 * src/relation.c (relation_print, traverse, relation_transpose):
10788 Check for END_NODE rather than looking at sign.
10789 * src/relation.h (END_NODE): New macro.
10790 (relation_node): Now size_t, not short int.
10792 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
10794 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
10795 keyword, not an identifier. Problem reported by Baron Schwartz in
10796 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
10798 2004-10-11 Akim Demaille <akim@epita.fr>
10800 * src/symtab.c (symbol_check_alias_consistency): Also check
10801 type names, destructors, and printers.
10802 Reported by Alexandre Duret-Lutz.
10803 Recode the handling of associativity and precedence in terms
10804 of symbol_precedence_set.
10805 Accept no redeclaration at all, not even equal to the previous
10807 (redeclaration): New.
10808 Use it to factor redeclaration complaints.
10809 (symbol_make_alias): Don't set the type of the alias, let
10810 symbol_check_alias_consistency do it as for other features.
10811 * src/symtab.h (symbol): Add new member prec_location, and
10813 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
10814 * tests/input.at (Incompatible Aliases): New.
10816 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
10818 .cvsignore fixes to accommodate gnulib changes,
10819 and the practice of naming build directories "_build".
10820 * .cvsignore: Add "_*". Sort.
10821 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
10822 * m4/.cvsignore: Add "*_gl.m4".
10824 2004-10-06 Akim Demaille <akim@epita.fr>
10826 * src/parse-gram.y (add_param): Fix the truncation of trailing
10829 2004-10-05 Akim Demaille <akim@epita.fr>
10831 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
10832 whether the reducion was empty or not. This leaves room to
10833 improve the use of YYLLOC_DEFAULT in such a case.
10834 lalr1.cc is still experimental, so changing this is acceptable.
10835 And finally, there are probably not many users who changed the
10836 handling of locations in GLR, so changing is admissible too.
10838 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
10839 empty reduction, set @$ to an empty location ending the previously
10841 Adjust uses to make sure the code is triggered on empty
10843 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
10844 expected output: empty reductions have empty locations.
10846 2004-09-29 Akim Demaille <akim@epita.fr>
10848 * data/lalr1.cc: Move towards a more standard C++ coding style
10849 for templates: Class < T > -> Class<T>.
10851 2004-09-29 Akim Demaille <akim@epita.fr>
10853 * data/lalr1.cc: Reinstall the former ctor, for sake of
10854 compatibility, but warn it will be removed.
10855 Move towards a more standard C++ coding style (i.e., type *var ->
10858 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
10860 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
10861 since it's less likely to work if NULs are involved in the future.
10863 2004-09-27 Akim Demaille <akim@epita.fr>
10865 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
10867 2004-09-27 Akim Demaille <akim@epita.fr>
10869 * data/lalr1.cc (b4_parse_param_decl_1): New.
10870 (b4_parse_param_decl): Use it to have different names between attribute
10871 and argument names.
10872 (b4_cc_constructor_call): Likewise.
10874 2004-09-24 Akim Demaille <akim@epita.fr>
10876 * src/parse-gram.y (add_param): Strip the leading and trailing
10877 blanks from a formal argument declaration.
10878 (YY_LOCATION_PRINT): New.
10880 2004-09-24 Akim Demaille <akim@epita.fr>
10882 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
10883 after the location.
10885 2004-09-24 Akim Demaille <akim@epita.fr>
10887 * doc/bison.texinfo (Table of Symbols): Sort.
10889 2004-09-21 Akim Demaille <akim@epita.fr>
10891 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
10892 the useless parentheses.
10893 Suggested by Paul Eggert.
10895 2004-09-20 Akim Demaille <akim@epita.fr>
10897 Let the initial-action act on the look-ahead, and use it for the
10898 "initial push" (corresponding to an hypothetical beginning-of-file).
10899 And let lalr1.cc honor %initial-action.
10901 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
10903 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
10904 (Parser::Parser): Remove the ctor that used to initialize it.
10905 (Parser::parse): Like in the other skeletons, issue the "starting
10906 parse" message before any action.
10907 Honor %initial-action.
10908 Initialize the stacks with the lookahead.
10909 * data/yacc.c: Let $$ and @$ in %initial-action designate the
10911 Push them in the stacks.
10912 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
10914 2004-09-20 Akim Demaille <akim@epita.fr>
10916 * doc/bison.texinfo (Initial Action Decl): New.
10918 2004-09-20 Akim Demaille <akim@epita.fr>
10920 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
10921 clearer criterion to define it.
10922 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
10923 When reducing on an empty RHS, use the latest stacked location as
10925 yylloc is not always available.
10926 * data/glr.c: Likewise.
10927 Also, honor initial-actions.
10929 2004-09-20 Akim Demaille <akim@epita.fr>
10931 * data/yacc.c (YY_LOCATION_PRINT): New.
10932 Define when we know YYLTYPE's structure, i.e., when the default
10933 YYLLOC_DEFAULT is used.
10934 * data/c.m4 (b4_yysymprint_generate): Use it.
10935 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
10936 value of the result.
10937 (error_start_): Replace with...
10938 (error_range_): this location array.
10939 This allows to replace code relying on the implementation of
10940 locations by portable code.
10941 * data/yacc.c (yylerrsp): Replace with...
10942 (yyerror_range): this.
10943 Every time a token is popped, update yyerror_range[0], to have an
10944 accurate location for the error token.
10945 * data/glr.c (YY_LOCATION_PRINT): New.
10946 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
10947 deference a pointer.
10948 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
10949 report the location in %printers.
10951 * src/scan-skel.l: Instead of abort, report error messages to ease
10952 understanding skeleton scanning failures.
10954 2004-09-16 Akim Demaille <akim@epita.fr>
10956 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
10957 (iterator, const_iterator): these, to be more in the C++ spirit.
10958 Also, return reverse iterators so that when displaying the stack
10959 we display its bottom first.
10960 (Parser::stack_print_, Parser::reduce_print_): Match the messages
10962 We should probably use vector here though.
10964 2004-09-16 Akim Demaille <akim@epita.fr>
10966 Have more complete shift traces.
10968 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
10969 to report Shifts instead of ad hoc YYDPRINTF invocations,
10970 including for the error token.
10971 * data/lalr1.cc (symprint_): Output the location.
10972 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
10973 output the location within the %printer.
10974 Activate GLR tests, at least to make sure they compile properly.
10975 They still don't pass though.
10976 * tests/calc.at: Adjust expect verbose output, since now "Entering
10977 state..." is on a different line than the "Shifting" message.
10979 2004-09-08 Akim Demaille <akim@epita.fr>
10981 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
10982 Bison directive from the Bison file to the invocation of this
10983 macro, so that these directives are passed to
10984 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
10985 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
10986 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
10987 the extra Bison directives instead of the whole series.
10988 Change the grammar so that there are recoverable errors, and
10989 unrecoverable errors. Now we can have the parser give up before
10990 consuming the whole input. As a result we now can observe that
10991 the lookahead is freed when needed.
10992 Change the parser source to parse argv[1] instead of a hard coded
10994 Simplify yylex, and give a value and location to EOF.
10995 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
10996 passed directives already coded in the file.
10997 Add some tests to check the location of "error".
10998 For some tests, the C++ parser is correct, and not yacc.c.
10999 For other tests, they provide different, but unsatisfying, values,
11000 so keep the C++ value so that at least one parser is "correct"
11001 according to the test suite.
11002 (Actions after errors): Remove, this is subsumed by the
11003 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
11005 2004-09-06 Akim Demaille <akim@epita.fr>
11007 * data/lalr1.cc: Adjust the indentation of the labels.
11008 (Parser::pop): New.
11011 2004-09-06 Akim Demaille <akim@epita.fr>
11013 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
11014 argument, an informative message.
11015 Call YY_SYMBOL_PRINT.
11016 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
11017 * data/lalr1.cc (destruct_): Likewise.
11018 In addition, no longer depend on b4_yysymprint_generate and
11019 b4_yydestruct_generate to generate these functions, do it "by
11022 2004-09-03 Akim Demaille <akim@epita.fr>
11024 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
11025 invoked, yydestruct the lookahead.
11026 * tests/calc.at (Calculator $1): Update the expected lengths of
11027 traces: there is an added line for the discarded lookahead.
11028 * doc/bison.texinfo (Destructor Decl): Some rewording.
11029 Define "discarded" symbols.
11031 2004-09-02 Akim Demaille <akim@epita.fr>
11033 * data/lalr1.cc (translate_, destruct_): No reason to be static.
11035 2004-09-02 Akim Demaille <akim@epita.fr>
11037 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
11038 (YYDSYMPRINTF): Rename as...
11039 (YY_SYMBOL_PRINT): this.
11040 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
11042 Use it instead of direct symprint_ calls.
11043 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
11046 2004-09-02 Akim Demaille <akim@epita.fr>
11048 * data/lalr1.cc (b4_yysymprint_generate): New.
11049 (symprint_): New member function, defined when YYDEBUG.
11050 Use it consistently instead of token/nterm debugging output by
11052 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
11053 %printer calls to use cdebug_ when using lalr1.cc.
11055 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
11057 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
11058 with #ifdef YYDEBUG.
11060 2004-08-26 Akim Demaille <akim@epita.fr>
11062 * doc/bison.texinfo (Implementing Loops): Rename as...
11063 (Implementing Gotos/Loops): this.
11065 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
11067 Adjust to latest gnulib.
11068 * bootstrap (gnulib_modules): Add xalloc-die.
11069 Set LC_ALL=C so that file names sort consistently.
11070 Prefer the gnulib copies of gettext.m4, glibc21.m4,
11071 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
11072 uintmax_t.m4, ulonglong.m4.
11073 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
11074 po.m4 since we are now using _gl.m4 instead.
11076 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
11078 * src/scan-action.l: Remove. Scanning of semantic actions is
11079 handled in scan-gram.l.
11081 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
11083 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
11085 * src/location.h (struct): The file member is a uniqstr.
11086 (equal_boundaries): Use UNIQSTR_EQ for comparison.
11088 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
11090 Fix bug with non-%union parsers that have printers or destructors,
11091 which led to a Bison core dump. Reported by Peter Fales in
11092 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
11094 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
11095 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
11096 not to our own type.
11097 * src/output.c (symbol_destructors_output, symbol_printers_output):
11098 Don't assume %union.
11099 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
11100 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
11101 UNION-FLAG. All callers changed.
11102 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
11103 Use type char, not unsigned int, when declaring an array of char;
11104 this lets us remove a cast.
11105 (Printers and Destructors): Add non-%union test cases.
11107 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11109 * doc/bison.texinfo: Minor editorial changes, mostly to the new
11110 GLR writeups. E.g., avoid frenchspacing and the future tense,
11111 change "lookahead" to "look-ahead", and change "wrt" to "with
11114 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11116 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
11117 New sections, split off from the GLR Parsers section. Put the new
11118 Simple GLR Parser near the start of the GLR section, for clarity.
11119 Rewrite connective text.
11121 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
11123 * doc/bison.texinfo (Simple GLR Parsers): New section.
11125 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11127 * NEWS, TODO, doc/bison.texinfo:
11128 Use "look-ahead" instead of "lookahead", to be consistent.
11129 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
11130 while we're fixing "look-ahead".
11131 * src/conflicts.c (shift_set): Renamed from shiftset.
11132 (look_ahead_set): Renamed from lookaheadset.
11133 * src/print.c: Likewise.
11134 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
11135 name for "lookahead".
11136 (report_types, usage): Likewise.
11137 * src/getargs.h (report_look_ahead_tokens): Renamed from
11139 * src/lalr.c (compute_look_ahead_tokens): Renamed from
11140 compute_lookaheads.
11141 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
11142 (look_ahead_tokens_print): Renamed from lookaheads_print.
11143 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
11144 state_rule_lookaheads_print.
11145 * src/state.h: Likewise.
11146 (reductions.look_ahead_tokens): Renamed from lookaheads.
11147 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
11148 AT_DATA_LOOKAHEADS_GRAMMAR.
11150 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
11152 * README: Update location of patched M4 distribution.
11154 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
11156 Don't assume the C++ compiler takes the same arguments as the C compiler
11158 * configure.ac (O0CXXFLAGS): New var.
11159 * tests/atlocal.in (CXXFLAGS): Use it.
11161 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
11163 Fix some "make check" problems with C++ reported by
11164 Albert Chin-A-Young for Tru64 C++ in this thread:
11165 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
11167 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
11168 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11169 Output to a .cc file for C++, not to a .c file.
11170 * tests/calc.at (AT_CHECK_CALC): Likewise.
11171 * tests/regression.at (AT_CHECK_DANCER): Likewise.
11172 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
11174 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
11176 * tests/calc.at, tests/actions.at: Workaround for SGI
11177 C++ compiler. (trivial change)
11179 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
11181 Spent a few hours checking out which prerequisite versions the
11182 current sources actually require. I went all the way back to
11183 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
11184 a seemingly endless set of combinations of versions more recent
11185 than that. The bottom line is that the current sources require
11186 fairly recent versions of the build tools, and it'll be some work
11188 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
11189 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
11190 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
11191 Add comments explaining why those particular versions are
11194 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
11195 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
11196 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
11198 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
11199 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
11201 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
11203 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
11204 0.11.5. Suggested by Bruno Haible.
11205 * bootstrap: Remove gettext version checking.
11207 * doc/bison.texinfo (Decl Summary): Also mention that %union
11208 can depend on prerequisite types. Problem reported by Tim
11211 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
11213 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
11214 * README-alpha: Don't tell people not to package this.
11216 * bootstrap: Don't assume $(...) works; use `...` instead.
11217 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
11220 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
11221 put into the -d output file, and mention what to do if YYSTYPE is
11222 defined as a macro.
11224 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
11226 Undo change made earlier today: it caused autopoint to not bring
11227 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
11230 * bootstrap: Check that gettext version matches what's in
11231 configure.ac. Warn users to ignore robots.txt ERROR 404.
11232 * bootstrap: Undo today's earlier change (logged below).
11233 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
11235 The gettext version checking is causing more trouble than it's
11236 curing; remove it. Problem reported by Paul Hilfinger.
11238 * bootstrap: Issue a warning that one can expect a message
11239 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
11240 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
11242 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
11244 Ensure that the C++ compiler used for testing actually works on a
11245 simple test program; if not, skip the C++-related tests. Problem
11246 reported by Vin Shelton in:
11247 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
11249 * m4/cxx.m4: New file.
11250 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
11251 * tests/atlocal.in (BISON_CXX_WORKS): Add.
11252 * tests/local.at (AT_COMPILE_CXX): Use it.
11254 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11256 * data/glr.c (yylloc): Output this macro even if locations are not
11257 being generated, as the GLR parser needs it even in that case.
11258 Problem reported by Troy A. Johnson
11259 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
11261 * configure.ac (AC_INIT): Update to 1.875e.
11263 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11265 * NEWS: Version 1.875d.
11266 * configure.ac (AC_INIT): Likewise.
11267 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
11269 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
11270 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
11271 lalr1.cc runs afoul of the first, and the last two are no longer
11272 supported by GCC 3.4.0.
11273 * README: Mention GNU m4 1.4 or later; mention m4 patches.
11274 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
11276 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
11278 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
11279 unsigned int, for compatibility with latest gnulib hash module.
11280 * src/state.c (state_hash, state_hasher): Likewise.
11281 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
11282 * src/uniqstr.c (hash_uniqstr): Likewise.
11284 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
11286 * NEWS: Unescaped newlines are no longer allowed in char & strings.
11288 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
11289 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
11290 character and string literals.
11291 (unexpected_end): New function.
11292 (unexpected_eof): Use it.
11293 (unexpected_newline): New function.
11294 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
11297 * NEWS: Document %expect-rr.
11299 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
11300 Fix typo by replacing $1 with $option.
11301 Remove more 'intl'-related files.
11302 Don't DEFUN AM_INTL_SUBDIR twice.
11304 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
11305 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
11307 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
11308 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
11309 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
11310 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
11311 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
11312 * src/.cvsignore: Add *.output.
11314 * src/parse-gram.y: Put copyright notice inside %{ %} so it
11315 gets copied to the output file.
11317 2004-04-28 Paul Eggert <eggert@twinsun.com>
11319 Get files from the gnulib and po repositories, instead of relying
11320 on them being in our CVS. Upgrade to latest versions of gnulib
11323 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
11324 * bootstrap: Bootstrap from gnulib and po repositories.
11325 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
11326 * README-cvs: Document these changes. Remove version numbers from
11327 mentions of build tools, since they change so often. Mention Flex.
11329 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
11330 (gl_USE_SYSTEM_EXTENSIONS): Add.
11331 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
11332 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
11334 (AC_ISC_POSIX): Remove; we no longer support this
11335 ancient OS, as it gets in the way of latest Autoconf & gnulib.
11336 (AC_HEADER_STDC): Remove: we now assume C89 or better.
11337 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
11338 Do not check for C89 headers, except for locale.h which is used
11339 by the Yacc library and must port to K&R hosts.
11340 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
11341 Do not check for C89 functions, except for setlocale which is
11342 used by the Yacc library.
11343 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
11344 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
11345 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
11346 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
11347 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
11348 AM_GNU_GETTEXT): Remove; now done by:
11349 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
11350 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
11353 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
11354 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
11355 Define to empty, as gnulib.mk will do the rest for us.
11356 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
11358 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
11359 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
11361 * src/files.c: Include gnulib's xstrndup.h.
11363 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
11364 (REALLOC): Use xnrealloc, for likewise.
11365 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
11366 (strnlen, memrchr): Remove decls; functions no longer used.
11367 Include <stpcpy.h>.
11369 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
11370 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
11371 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
11372 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
11373 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
11374 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
11375 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
11376 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
11377 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
11378 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
11379 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
11380 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11381 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
11382 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
11383 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
11384 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
11385 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
11386 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
11387 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
11388 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
11389 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
11390 Remove, as these files are now generated automatically
11391 by bootstrap or automake.
11393 * po/ChangeLog: Remove: all but one entry was a duplicate
11394 of this file, and I moved that 2000-11-02 entry here.
11396 * config/.cvsignore: Add Makefile, depcomp, install-sh.
11397 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
11398 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
11399 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
11400 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
11401 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
11402 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
11403 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
11404 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
11405 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
11406 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
11408 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
11409 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
11410 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
11411 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
11412 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
11413 * src/.cvsignore: Remove *_.c.
11416 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
11417 support it. (The latest stable gzip doesn't.)
11419 2004-04-27 Paul Eggert <eggert@twinsun.com>
11421 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
11422 case, as stos_ is now used by destructors due to the 2004-02-09
11425 Remove more K&R C support.
11426 * lib/libiberty.y (PARAMS): Remove. All uses removed.
11427 * lib/subpipe.c (errno): Remove decl.
11428 Include <stdlib.h> unconditionally.
11429 (EXIT_FAILURE): Remove macro.
11430 * src/complain.c (vfprintf, strerror): Remove.
11431 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
11433 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
11434 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
11435 (strchr, strspn, memchr): Remove decls.
11436 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
11437 unconditionally. Do not declare perror.
11438 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
11441 * src/complain.c (_): Remove useless defn, as system.h defines this.
11443 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
11444 with latest obstack.h.
11445 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
11446 to procedure types, as obstack.h now does that for us.
11447 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
11449 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
11450 so that this include file can stand alone.
11451 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
11452 does this now. Include subpipe.h first after config.h, to
11453 test whether it can stand alone.
11455 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
11456 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
11457 unused declaration.
11459 * tests/synclines.at (%union synch line): Put a dummy member in
11460 the union, because empty unions aren't allowed in C. Caught
11463 2004-04-13 Jim Meyering <jim@meyering.net>
11465 * src/conflicts.c (conflicts_print): Correct format string typo:
11466 use `%%' to produce literal `%'. (trivial change)
11468 2004-03-30 Paul Eggert <eggert@twinsun.com>
11470 * src/getargs.c (version): Update copyright year to 2004.
11472 * data/c.m4 (b4_int_type): Use 'short int' rather than
11473 'short', and similarly for 'long', 'unsigned', etc.
11474 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
11475 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
11476 yy_yypstack, yydumpstack): Likewise.
11477 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
11478 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
11480 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
11481 yy_stack_print, yyparse): Likewise.
11482 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
11483 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
11484 * lib/bitset.c (bitset_print): Likewise.
11485 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
11486 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11487 * lib/bitsetv.c (bitsetv_dump): Likewise.
11488 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
11489 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
11491 * src/LR0.c (allocate_itemsets): Likewise.
11492 * src/gram.h (rule_number, rule): Likewise.
11493 * src/lalr.h (goto_number): Likewise.
11494 * src/nullable.c (nullable_compute): Likewise.
11495 * src/output.c (prepare_rules): Likewise.
11496 * src/relation.c (relation_print, relation_digraph): Likewise.
11497 * src/relation.h (relation_node): Likewise.
11498 * src/state.h (state_number, transitions, errs, reductions,
11499 struct state): Likewise.
11500 * src/symtab.h (symbol_number, struct symbol): Likewise.
11501 * src/tables.c (vector_number, tally, action_number,
11502 default_goto, goto_actions): Likewise.
11503 * tests/existing.at (GNU Cim Grammar): Likewise.
11504 * tests/regression.at (Web2c Actions): Likewise.
11506 * src/output.c (muscle_insert_short_int_table): Renamed from
11507 muscle_insert_short_table. All uses changed.
11509 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11511 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
11512 (declaration): Replace expected_conflicts with expected_sr_conflicts.
11513 Add %expect-rr rule.
11515 * src/scan-gram.l: Recognize %expect-rr.
11517 * src/conflicts.h (expected_sr_conflicts): Rename from
11518 expected_conflicts.
11519 (expected_rr_conflicts): Declare.
11521 * src/conflicts.c (expected_sr_conflicts): Rename from
11522 expected_conflicts.
11523 (expected_rr_conflicts): Define.
11524 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
11526 Use expected_sr_conflicts in place of expected_conflicts.
11527 Warn if expected_rr_conflicts used in non-GLR parser.
11529 * doc/bison.texinfo: Add documentation for %expect-rr.
11531 2004-03-08 Paul Eggert <eggert@gnu.org>
11533 Add support for hex token numbers. Suggested by Odd Arild Olsen in
11534 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
11536 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
11538 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
11539 * src/scan-gram.l (scan_integer): New function.
11541 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
11542 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
11543 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
11544 Say "long int", not "long", for uniformity with GNU style.
11546 2004-02-25 Paul Eggert <eggert@twinsun.com>
11548 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
11549 compilers. This fixes a problem with Intel's C++ compiler being
11550 chatty, reported by Guido Trentalancia in
11551 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
11553 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
11555 Support %destructor and merge error locations in lalr1.cc.
11557 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
11558 (Parser::stos_): Define unconditionally.
11559 (Parser::destruct_): New method. Generate its body with
11560 b4_yydestruct_generate.
11561 (Parser::error_start_): New attribute.
11562 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
11563 token which are discarded.
11564 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
11565 error_start_ when erroneous token are discarded.
11566 (Parser::parse) <yyerrlab1>: Compute the location of the error
11567 token so that it covers all the discarded tokens.
11568 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
11569 it can be called with `%skeleton "lalr1.cc"', and do that.
11571 2004-02-02 Paul Eggert <eggert@twinsun.com>
11573 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
11574 $(top_srcdir)/lib and ../lib. This fixes a bug reported
11575 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
11576 There's no need to mention top_builddir since Automake does that
11578 (INCLUDES): Remove, as Automake says it's obsolescent.
11579 Contents migrated into AM_CPPFLAGS as described above.
11580 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
11582 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11584 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
11585 (yyreportSyntaxError): Handle case where lookahead token is
11588 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11590 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
11591 resulting parsers are compilable with C++.
11593 2003-12-23 Paul Eggert <eggert@twinsun.com>
11595 * config/depcomp, config/install-sh: Sync with Automake 1.8.
11596 * src/output.c (output_skeleton): Rename local var.
11597 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
11598 Bison tokens, as this runs afoul of the 2003-10-07 change that
11599 disallowed NUL bytes in character constants or string literals.
11601 * tests/local.at: Require Autoconf 2.59's Autotest.
11602 * tests/testsuite.at: Don't include local.at, since we now assume
11603 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
11605 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
11606 multiple inclusion warnings.
11608 2003-12-02 Akim Demaille <akim@epita.fr>
11610 * doc/bison.texinfo (How Can I Reset the Parser): More about start
11614 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
11616 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
11618 2003-10-07 Paul Eggert <eggert@twinsun.com>
11620 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
11621 if testsuite doesn't exist.
11623 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
11624 literals, unfortunately.
11625 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
11626 Complain about NUL bytes in character constants or string literals.
11628 2003-10-05 Paul Eggert <eggert@twinsun.com>
11630 * NEWS: Don't document %no-default-prec, as it's still
11632 * doc/bison.texinfo: Document %no-default-prec only if
11633 the defaultprec flag is set. Normally it's not.
11635 2003-10-04 Paul Eggert <eggert@twinsun.com>
11637 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
11638 non-modifiable lvalue, instead of a modifiable one.
11639 * doc/bison.texinfo (Actions): Document that $$ can
11640 be assigned to. Do not claim that $$ and $N are
11641 array element references: user code should not rely on this.
11643 2003-10-01 Paul Eggert <eggert@twinsun.com>
11645 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
11646 (grammar_declaration): Use it.
11647 * src/scan-gram.l: New token %no-default-prec.
11648 * tests/conflicts.at: Revamp tests to use %no-default-prec.
11649 * NEWS, doc/bison.texinfo: Document the above.
11651 2003-10-01 Akim Demaille <akim@epita.fr>
11653 VCG no longer supports long_straight_phase.
11655 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
11656 * src/print_graph.c (print_graph): Adjust.
11658 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
11659 and Paul Eggert <eggert@twinsun.com>
11661 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
11662 Table of Symbols): Document %default-prec.
11663 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
11664 (grammar_declaration): Set default_prec on %default-prec.
11665 * src/scan-gram.l (%default-prec): New token.
11666 * src/reader.h (default_prec): New flag.
11667 * src/reader.c: Likewise.
11668 (packgram): Handle it.
11669 * tests/conflicts.at (%default-prec without %prec,
11670 %default-prec with %prec, %default-prec 1): New tests.
11672 2003-09-30 Paul Eggert <eggert@twinsun.com>
11674 * tests/testsuite.at: Include local.at, not input.at, fixing
11675 a typo in the 2003-08-25 patch.
11677 2003-08-27 Akim Demaille <akim@epita.fr>
11679 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
11682 2003-08-26 Akim Demaille <akim@epita.fr>
11684 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
11685 "<\#" to avoid magic from Gnus when posting parts of this script.
11687 2003-08-26 Akim Demaille <akim@epita.fr>
11689 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
11690 (Parser::parse): here.
11691 Adjust: nerrs and errstatus is now replaced by...
11692 (Parser::nerrs_, Parser::errstatus_): New.
11694 2003-08-25 Akim Demaille <akim@epita.fr>
11696 * config/announce-gen, Makefile.cfg: New.
11697 * Makefile.am: Adjust.
11698 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
11699 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
11701 2003-08-25 Akim Demaille <akim@epita.fr>
11703 When reducing initial empty rules, Bison parser read an initial
11704 location that is not defined. This results in garbage, and that
11705 affects Bison's own parser. Therefore we need (i) to extend Bison
11706 to support a means to initialize this location, and (ii) to use
11707 this CVS Bison to fix CVS Bison's parser.
11709 * src/reader.h, reader.c (epilogue_augment): Remove, replace
11711 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
11712 * src/parse-gram.y: Adjust.
11713 (%initial-action): New.
11714 (%error-verbose): Since we require CVS Bison, there is no reason
11716 * src/scan-gram.l: Adjust.
11717 * src/Makefile.am (YACC): New, to make sure we use our own parser.
11718 * data/yacc.c (yyparse): Use b4_initial_action.
11720 2003-08-25 Akim Demaille <akim@epita.fr>
11722 * doc/bison.texinfo: Don't promote stdout for error messages.
11724 2003-08-25 Akim Demaille <akim@epita.fr>
11726 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
11727 From Alexandre Duret-Lutz.
11729 2003-08-25 Akim Demaille <akim@epita.fr>
11733 2003-08-25 Akim Demaille <akim@epita.fr>
11735 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
11738 2003-08-25 Akim Demaille <akim@epita.fr>
11740 * data/lalr1.cc (Parser::reduce_print_): New.
11743 2003-08-25 Akim Demaille <akim@epita.fr>
11745 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
11746 error recovery loops. This patch is based on
11747 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
11748 Also, augment the similarity between lalr1.cc and yacc.c.
11749 Note: the locations of error recovery rules are not correct yet.
11751 * data/lalr1.cc: Comment changes to augment the similarity between
11752 lalr1.cc and yacc.c.
11753 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
11754 (yyerrlab1): Remove, but where it used to be (now the bottom part of
11755 yyerrlab), when hitting EOF, pop the whole stack here instead of
11756 merely falling thru the default error handling mechanism.
11757 (yyerrorlab): New label, with the old contents of YYERROR,
11758 plus the following change: pop the stack of rhs corresponding
11759 to the production that invoked YYERROR. That is how Yacc
11760 behaves (required by POSIX).
11761 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
11764 2003-08-25 Akim Demaille <akim@epita.fr>
11766 Tune local.at so that people can "autom4te -l autotest calc.at -o
11767 calc" for instance, to extract a sub test suite.
11769 * tests/testsuite.at: Move the initialization, Autotest version
11770 requirement, and AT_TESTED invocation into...
11771 * tests/local.at: here.
11772 * tests/testsuite.at: Include it for compatibility with Autoconf
11774 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
11777 2003-08-04 Paul Eggert <eggert@twinsun.com>
11779 Rework code slightly to avoid gcc -Wtraditional warnings.
11780 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
11781 The returned value is now stored in *YY0. All callers changed.
11782 * src/output.c (merge_output): Adjust to the above change.
11784 2003-07-26 Paul Eggert <eggert@twinsun.com>
11786 * data/glr.c (YYASSERT): New macro.
11787 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
11788 yyresolveStates, yyprocessOneStack):
11789 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
11790 Derived from a suggestion by Frank Heckenbach.
11792 2003-07-25 Paul Eggert <eggert@twinsun.com>
11794 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
11795 for portability to K&R C (after ansi2knr, presumably). See
11796 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
11797 by Frank Heckenbach, though I have omitted the structure-initialization
11798 part of his glr-knr.diff patch since I recall that the Portable
11799 C Compiler didn't require that change.
11801 Let the user specify how to allocate and free memory.
11802 Derived from a suggestion by Frank Heckenbach in
11803 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
11804 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
11805 All uses of free, malloc, realloc changed to use these macros,
11806 and unnecessary casts removed.
11807 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
11809 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
11811 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
11812 use s.empty() rather than s == "" to test for empty string; see
11813 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
11816 2003-06-25 Akim Demaille <akim@epita.fr>
11818 * config/depcomp, config/install-sh: Update from masters.
11820 2003-06-20 Paul Eggert <eggert@twinsun.com>
11822 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
11823 and return properly parenthesized result.
11824 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
11825 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
11826 Remove unnecessary parentheses from uses.
11827 * doc/bison.texinfo (Location Default Action): Describe the
11828 conventions for parentheses.
11830 2003-06-19 Paul Eggert <eggert@twinsun.com>
11832 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
11833 yyreportTree): Do not assume that size_t is the same width as int,
11834 when printing sizes. Print sizes using an unsigned format.
11835 Problem reported by Frank Heckenbach in
11836 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
11838 Port to Forte Developer 7 C compiler.
11839 * data/glr.c (struct YYLTYPE): If locations are not being used,
11840 declare a single dummy member, as empty structs do not conform
11842 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
11843 the Forte Developer 7 C compiler complains that end-of-loop
11844 code is not reached.
11846 2003-06-17 Paul Eggert <eggert@twinsun.com>
11848 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
11849 avoid warnings from picky compilers about redefinition of PARAMS.
11851 2003-06-17 Paul Eggert <eggert@twinsun.com>
11855 * NEWS: Document 1.875b.
11857 * lib/bbitset.h: Do not include config.h; that's the includer's job.
11858 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
11859 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
11860 Don't use 'index' in comments, as it's a builtin fn on some hosts.
11861 * lib/bitset_stats.c: Include gettext.h unconditionally, as
11862 per recent gettext manual's suggestion.
11863 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
11864 Use prototypes, not old-style definitions.
11865 * lib/lbitset.c (lbitset_unused_clear): Likewise.
11866 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
11867 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
11868 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
11869 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
11870 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
11871 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
11872 vbitset_or_and_cmp, vbitset_copy): Likewise.
11874 * lib/libiberty.h: Do not include config.h; that's the includer's job.
11875 Do not include <stdlib.h>.
11876 (PARAMS): Define unconditionally for C89.
11877 (ATTRIBUTE_NORETURN): Remove.
11878 (ATTRIBUTE_UNUSED): Define unconditionally.
11880 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
11881 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
11882 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
11883 * lib/vbitset.c, lib/vbitset.h: New files.
11884 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
11885 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
11888 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
11889 `How Can I Reset @code{yyparse}', since texinfo does not allow
11890 arbitrary @ in node names.
11892 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
11893 shouldn't be needed according to the gettext 0.12.1 documentation
11894 but which seem to be needed anyway: codeset.m4 glibc21.m4
11895 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
11896 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
11897 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
11899 * lib/.cvsignore: Add stdbool.h.
11900 * m4/.cvsignore: Add nls.m4, po.m4.
11902 Upgrade to CVS gnulib.
11903 * stdbool_.h: File renamed from stdbool.h.in.
11904 * configure.ac (AM_STDBOOL_H): Invoke this instead of
11906 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
11907 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
11908 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
11909 (MOSTLYCLEANFILES): New var.
11910 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
11911 (stdbool.h): New rule.
11912 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
11913 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
11914 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
11915 m4/quote.m4: Upgrade to today's gnulib.
11917 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
11918 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
11919 the tests right now.
11920 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
11921 yyerror are declared before use; C99 requires this.
11923 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11925 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
11927 (yyrecoverSyntaxError): Correct the logic for setting and testing
11929 Correct comment on handling EOF.
11930 Allow states with only a default reduction, rather than failing
11931 (I can't quite reconstruct why these were not allowed before).
11933 Fixes to avoid problem that $-N rules in GLR parsers can cause
11934 buffer overruns, corrupting state.
11936 * src/output.c (prepare_rules): Output max_left_semantic_context
11938 * src/reader.h (max_left_semantic_context): New variable declaration.
11939 * src/scan-gram.l (max_left_semantic_context): Define.
11940 (handle_action_dollar): Update max_left_semantic_context.
11941 * data/glr.c (YYMAXLEFT): New definition.
11942 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
11943 (yyresolveAction): Ditto.
11945 Fixes to problems with location handling in GLR parsers reported by
11946 Frank Heckenbach (2003/06/05).
11948 * data/glr.c (YYLTYPE): Make trivial if locations not used.
11949 (YYRHSLOC): Add parentheses, and define only if locations used.
11950 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
11951 locations not used.
11952 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
11953 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
11955 * tests/cxx-type.at: Exercise location information; update tests
11956 to differentiate output with and without locations.
11957 Remove forward declarations of yylex and yyerror---caused errors
11958 because default YYLTYPE not yet defined.
11959 Change semantic actions to compute strings, rather than printing
11960 them directly (to test proper passing of semantics values). Change
11961 output to prefix notation and update test data and expected results.
11962 (yylex): Track locations.
11963 (stmtMerge): Return value rather than printing, and include arguments
11966 2003-06-03 Paul Eggert <eggert@twinsun.com>
11968 Avoid warnings generated by GCC 2.95.4 when Bison is
11969 configured with --enable-gcc-warnings.
11970 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
11971 yy::]b4_parser_class_name[::translate_,
11972 yy::Stack::operator[] (unsigned),
11973 yy::Stack::operator[] (unsigned) const,
11974 yy::Slice::operator[] (unsigned),
11975 yy::Slice::operator[] (unsigned) const):
11976 Rename local vars to avoid warnings.
11977 * tests/glr-regression.at (Improper handling of embedded actions
11978 and $-N in GLR parsers): Remove unused local variable from yylex.
11979 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
11980 (void) as arg when not pure, since we now assume C89 when building
11981 Bison. Pacify GCC by using parameter.
11983 2003-06-02 Paul Eggert <eggert@twinsun.com>
11985 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
11986 yy::Location::lines, yy::Location::columns): Rename arguments
11987 to avoid shadowing; this removes a warning generated by GCC 3.3.
11989 2003-06-01 Paul Eggert <eggert@twinsun.com>
11991 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
11992 to g++, as GCC 3.3 complains if you do it.
11993 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
11994 everything that WARNING_CFLAGS has, except omit warnings
11995 not suitable for C++.
11996 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
11997 * tests/atlocal.in (CXXFLAGS): New var.
11998 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
12000 Fix a GLR parser bug I reported in February; see
12001 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
12002 The problem was that GLR parsers did not conform to the C standard,
12003 because actions like { $1 = $2 + $3; } expanded to expressions
12004 that invoked YYFILL in separate subexpressions, and YYFILL assigned
12005 to a local variable. The C standard says that expressions
12006 like (var = f ()) + (var = f ()) have undefined behavior.
12007 Another problem was that GCC sometimes issues warnings that
12008 yyfill and its parameters are unused.
12010 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
12011 as possibly unused.
12012 (yyfill): New function.
12014 (yyuserAction): Change type of yynormal to bool, so that it matches
12015 the new yyfill signature. Mark it as possibly unused.
12018 Follow up on a bug I reported in February, where a Bison-generated
12019 parser can loop. Provide a test case and a fix for yacc.c. I
12020 don't have a fix for lalr1.cc or for glr.c, unfortunately.
12021 The original bug report is in:
12022 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
12024 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
12025 macro's size was becoming unwieldy.
12026 (yyerrlab): Do not discard an empty lookahead symbol, as this
12027 might destroy garbage.
12028 (yyerrorlab): New label, with the old contents of YYERROR,
12029 plus the following change: pop the stack of rhs corresponding
12030 to the production that invoked YYERROR. That is how Yacc
12031 behaves, and POSIX requires this behavior.
12032 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
12033 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
12034 Define 'alarm' to do nothing if unistd.h is not available.
12035 Add a new rule "exp: '-' error;" to test the above change to
12036 data/yacc.c. Use 'alarm' to abort any test taking longer than
12037 10 seconds, as it's probably looping.
12038 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
12039 Also, the new yacc.c generates two fewer diagnostics for an
12042 2003-05-24 Paul Eggert <eggert@twinsun.com>
12044 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
12045 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
12046 This fixes a problem reported by John Bowman when the Compaq/HP
12047 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
12048 -ansi -Wall -gall).
12049 * data/yacc.c (union yyalloc): Likewise.
12050 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
12052 Switch from 'int' to 'bool' where that makes sense.
12054 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
12055 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
12056 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
12057 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
12058 Return or accept bool, not int. All callers changed.
12059 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
12060 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
12061 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
12062 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
12063 bitset_or_and_cmp_): Likewise.
12064 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
12065 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
12066 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
12067 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
12068 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
12069 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
12070 bitset_stats_or_and_cmp): Likewise.
12071 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
12072 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
12073 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
12074 ebitset_xor_cmp): Likewise.
12075 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
12076 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
12077 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
12078 lbitset_xor_cmp): Likewise.
12079 * lib/bbitset.h: Include <stdbool.h>.
12080 (struct bitset_vtable): The following members now return bool, not
12081 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
12082 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
12084 * src/conflicts.c (count_rr_conflicts): Likewise.
12085 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
12087 * lib/ebitset.c (ebitset_obstack_init): Likewise.
12088 * lib/lbitset.c (lbitset_obstack_init): Likewise.
12089 * src/getargs.c (debug_flag, defines_flag, locations_flag,
12090 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12091 graph_flag): Likewise.
12092 * src/getargs.h (debug_flag, defines_flag, locations_flag,
12093 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12094 graph_flag): Likewise.
12095 * src/output.c (error_verbose): Likewise.
12096 * src/output.h (error_verbose): Likewise.
12097 * src/reader.c (start_flag, typed): Likewise.
12098 * src/reader.h (typed): Likewise.
12099 * src/getargs.c (LOCATIONS_OPTION): New constant.
12100 (long_options, getargs): Use it.
12101 * src/lalr.c (build_relations): Use bool, not int.
12102 * src/nullable.c (nullable_compute): Likewise.
12103 * src/print.c (print_reductions): Likewise.
12104 * src/tables.c (action_row, pack_vector): Likewise.
12105 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
12106 * src/output.c (prepare): Use it.
12107 * src/output.c (token_definitions_output,
12108 symbol_destructors_output, symbol_destructors_output): Use string,
12109 not boolean integer, to keep track of whether to output separator.
12110 * src/print_graph.c (print_core): Likewise.
12111 * src/state.c (state_rule_lookaheads_print): Likewise.
12113 * config/install-sh: Sync from automake 1.7.5.
12115 2003-05-14 Paul Eggert <eggert@twinsun.com>
12117 * src/parse-gram.y (rules_or_grammar_declaration): Require a
12118 semicolon after a grammar declaration, in the interest of possible
12119 future changes to the Bison input language.
12120 Do not allow a stray semicolon at the start of the grammar.
12121 (rhses.1): Allow one or more semicolons after any rule, including
12122 just before "|" as required by POSIX.
12123 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
12126 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
12128 %parse-param support for lalr1.cc.
12130 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
12131 b4_cc_constructor_calls, b4_cc_constructor_call,
12132 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
12134 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
12135 parse-param arguments.
12136 (yy::b4_parser_class_name): Declare instance variables to
12137 hold parse-param arguments.
12138 * tests/calc.at: s/value/semantic_value/ because value clashes
12139 with a member of yy::b4_parser_class_name. Adjust C++ code
12140 to handle %parse-param. Enable %parse-param test in C++.
12142 2003-05-12 Paul Eggert <eggert@twinsun.com>
12144 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
12145 English a bit. Fix fclose typo. Change "const char" to "char
12146 const", and use ANSI C rather than K&R for "main". Suggest
12147 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
12148 and suggest yy_switch_to_buffer.
12150 2003-05-05 Paul Eggert <eggert@twinsun.com>
12152 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
12153 C89. This avoids a diagnostic on compilers that define __STDC__
12154 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
12155 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
12157 2003-05-03 Paul Eggert <eggert@twinsun.com>
12159 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
12160 Do not overrun array bounds.
12161 This should fix a bug reported today by Olatunji Oluwabukunmi in
12162 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
12164 2003-04-29 Akim Demaille <akim@epita.fr>
12166 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
12167 * src/getargs.c, src/getargs.h: here, as bool, not int.
12168 (nondeterministic_parser): New.
12169 * src/parse-gram.y, src/scan-gram.l: Support
12170 %nondeterministic-parser.
12171 * src/output.c (prepare): Use nondeterministic_parser instead
12172 of glr_parser where appropriate.
12173 * src/tables.c (conflict_row, action_row, save_row)
12174 (token_actions, token_actions, pack_vector): Ditto.
12176 2003-04-29 Akim Demaille <akim@epita.fr>
12178 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
12180 2003-04-29 Akim Demaille <akim@epita.fr>
12182 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
12183 with %pure-parser and %locations to exercise the patch from Yakov
12186 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
12188 * data/yacc.c: (b4_lex_param): Corrected for the case where
12189 %lex-param is provided and %pure-parser isn't.
12191 2003-04-27 Paul Eggert <eggert@twinsun.com>
12193 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
12194 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
12195 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
12196 if it is not defined.
12197 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
12199 2003-04-26 Paul Eggert <eggert@twinsun.com>
12201 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
12202 Declare to be of type suitable for the ninf value itself, not of
12203 type suitable for the corresponding table, since the latter might
12204 be unsigned but the ninf value might be negative. This fixes a
12205 bug reported by Alexandre Duret-Lutz in
12206 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
12208 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
12209 invokes it. We shouldn't invoke it twice because it will attempt
12210 to put error.o in the archive twice. This fixes a glitch reported
12211 by Martin Mokrejs in
12212 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
12214 2003-04-21 Paul Eggert <eggert@twinsun.com>
12216 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
12219 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
12221 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
12222 Fix obvious typo that results in uncompilable GLR parsers
12223 when both %pure-parser and %locations are used. (trivial change)
12225 2003-04-17 Paul Eggert <eggert@twinsun.com>
12227 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
12228 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
12229 Do not insert the expected token via unput, as this runs afoul
12230 of a POSIX-compatibility bug in flex 2.5.31.
12231 All uses changed to BEGIN the parent state,
12232 since we no longer insert the expected token via unput.
12233 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
12234 that is no longer emitted after the above change.
12236 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
12237 the first one. This change is from Paul Hilfinger, and it fixes
12238 regression reported by Werner Lemberg in
12239 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
12241 (resolve_sr_conflict): Don't invoke state_errs_set
12242 unless one or more tokens have been explicitly made errors.
12243 Otherwise, the above change causes Bison to abort.
12245 * tests/existing.at (GNU pic Grammar): New test case, taken from
12248 2003-03-31 Akim Demaille <akim@epita.fr>
12250 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
12252 2003-03-31 Akim Demaille <akim@epita.fr>
12254 * src/output.c (prepare_symbols): Avoid trailing spaces in the
12257 2003-03-31 Akim Demaille <akim@epita.fr>
12259 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
12260 From Paul Hilfinger.
12262 2003-03-29 Akim Demaille <akim@epita.fr>
12264 * m4/error.m4: Do not put under dynamic conditions some code which
12265 expansion is under static control.
12267 2003-03-29 Akim Demaille <akim@epita.fr>
12269 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
12271 2003-03-29 Akim Demaille <akim@epita.fr>
12273 * doc/bison.texinfo (Strings are Destroyed): New.
12275 2003-03-13 Paul Eggert <eggert@twinsun.com>
12277 * .cvsignore: Add configure.lineno.
12278 * src/.cvsignore: Add yacc.
12279 * tests/.cvsignore: Add testsuite.log.
12280 * doc/fdl.texi: Sync with latest FSF version.
12282 2003-03-12 Paul Eggert <eggert@twinsun.com>
12284 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
12285 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
12286 cursor, instead of leaving it undefined. This fixes a bug
12287 reported by Tim Van Holder in
12288 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
12289 * tests/input.at (Torturing the Scanner): Test the scanner on
12290 an empty input file, which was Tim Van Holder's test case.
12292 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
12293 <sys/resource.h> can be included, include sys/time.h and
12294 sys/times.h first, if available. This works around the SunOS
12295 4.1.4 porting bug reported by Bruce Becker in
12296 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
12298 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
12299 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
12300 AC_HEADER_SYS_WAIT.
12302 Merge changes from gnulib. This was prompted because the CVS
12303 snapshot didn't build on Solaris 7 due to strnlen problems.
12305 These changes need to be merged back into gnulib:
12306 * lib/hash.c: Include <stdbool.h> unconditionally.
12307 * m4/onceonly.m4 (m4_quote): New macro.
12308 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
12309 Quote AC_FOREACH variable-expansions properly.
12310 The 2003-01-03 obstack.h change also needs merging.
12311 {end of changes requiring merging}
12313 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
12314 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
12315 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
12316 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
12317 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
12318 New files, imported from gnulib.
12319 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
12322 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
12323 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
12326 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
12328 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
12329 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
12330 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
12331 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
12332 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
12333 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
12334 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
12335 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
12336 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
12337 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
12338 (jm_PREREQ_ARGMATCH): Remove.
12339 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
12340 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
12342 * src/system.h: Include <stdbool.h> unconditionally.
12344 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
12345 assuming at least C89 in the bitset code for some time now.
12347 2003-03-03 Akim Demaille <akim@epita.fr>
12351 2003-03-02 Akim Demaille <akim@epita.fr>
12353 * doc/bison.texinfo (Table of Symbols): Reactivate the
12354 documentation for %lex-param, and %parse-param.
12356 2003-03-02 Akim Demaille <akim@epita.fr>
12358 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
12359 generate verbose error messages.
12360 Use the number of tokens as an upper bound in yytname, as it
12361 cannot be a non terminal.
12363 2003-03-02 Akim Demaille <akim@epita.fr>
12365 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
12368 2003-03-02 Akim Demaille <akim@epita.fr>
12370 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
12371 Use them to exercise yycheck overrun.
12372 Based on Andrew Suffield's grammar.
12374 2003-03-02 Akim Demaille <akim@epita.fr>
12376 Create tests/local.at for Bison generic testing macros.
12378 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
12379 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
12381 * tests/calc.at (AT_CHECK_CALC): Adjust.
12382 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
12383 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
12384 * tests/local.at: here.
12385 (AT_COMPILE_CXX): Tags the tests using it as c++.
12386 Ignore the test if CXX is not functional.
12388 2003-03-01 Paul Eggert <eggert@twinsun.com>
12390 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
12391 not loc->end, since loc->end might contain garbage and this leads
12392 to undefined behavior on some platforms.
12393 (id_loc, token_start): Use (IF_LINTed) initial values that do not
12394 depend on *loc, so that the reader doesn't give the the false
12395 impression that *loc is initialized.
12396 (<INITIAL>"%%"): Do not bother setting code_start, since its value
12397 does not survive the return.
12399 2003-03-01 Akim Demaille <akim@epita.fr>
12401 * src/scan-gram.l (code_start): Always initialize it when entering
12402 into yylex, as SC_EPILOGUE is activated *before* the corresponding
12403 yylex invocation. An alternative would be making it static, but
12404 then it starts with the second %%'s beginning, instead of its end.
12406 2003-02-28 Paul Eggert <eggert@twinsun.com>
12408 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
12409 around a UnixWare 7.1.1 porting bug reported by John Hughes in
12410 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
12412 2003-02-26 Paul Eggert <eggert@twinsun.com>
12414 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
12415 Remove Sequent/Pyramid discussion (nobody uses them any more).
12416 Merge VMS and MS-DOS discussion; these ports may well be dead
12417 but let's keep mentioning them for now. Put <> around email
12418 addresses. Add copyright notice.
12420 2003-02-24 Paul Eggert <eggert@twinsun.com>
12422 * data/glr.c (yy_reduce_print): yylineno -> yylno,
12423 to avoid collision with flex use of yylineno.
12424 Problem reported by Bruce Lilly in
12425 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
12426 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
12427 * data/yacc.c (yy_reduce_print): Likewise.
12429 * config/depcomp: Sync with Automake 1.7.3.
12431 2003-02-21 Akim Demaille <akim@epita.fr>
12433 * data/lalr1.cc: Use temporary variables instead of casts to
12434 change integer types.
12435 Suggested by Paul Eggert.
12437 2003-02-21 Akim Demaille <akim@epita.fr>
12439 * doc/bison.texinfo: Use "location" consistently to refer to @n,
12440 to avoid confusions with lalr1.cc's notion of Position.
12441 Suggested by Paul Eggert.
12443 2003-02-20 Akim Demaille <akim@epita.fr>
12445 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
12446 before initial_columns.
12447 (location.hh): Use consistent variable names when defining the
12449 Use "last" so that we subtract from Positions, not from unsigned.
12451 2003-02-20 Akim Demaille <akim@epita.fr>
12453 * data/lalr1.cc (position.hh): New subfile, including the extended
12454 and Doxygen'ed documentation of class Position.
12455 (location.hh): Use it.
12456 Document a` la Doxygen.
12457 With the help of Benoit Perrot.
12459 2003-02-20 Akim Demaille <akim@epita.fr>
12461 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
12463 Redefine AT_YYERROR_SEES_LOC_IF using it.
12464 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
12466 Don't use the location in yy::Parser::error_ and
12467 yy::Parser::print_ when not %locations.
12468 Activate more lalr1.cc tests.
12470 2003-02-19 Akim Demaille <akim@epita.fr>
12472 * data/lalr1.cc: When displaying a line number, be sure to make it
12475 2003-02-19 Akim Demaille <akim@epita.fr>
12477 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
12479 (YYABORT, YYACCEPT, YYERROR): New.
12480 * tests/calc.at: Renable the lalr1.cc test.
12482 2003-02-19 Akim Demaille <akim@epita.fr>
12484 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
12485 error recovery, mixing with/without pops and discarding of the
12488 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
12490 2003-02-17 Paul Eggert <eggert@twinsun.com>
12492 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
12493 * tests/testsuite.at (AT_COMPILE): Use them.
12494 This fixes the testsuite problem reported by Robert Lentz in
12495 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
12497 2003-02-12 Paul Eggert <eggert@twinsun.com>
12499 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
12500 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
12501 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
12502 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
12503 Check for malloc failure, for consistency with yacc.c.
12504 (yytname_size): Remove, for consistency with yacc.c.
12506 The bug still remains in data/lalr1.cc, as I didn't have time
12509 2003-02-06 Akim Demaille <akim@epita.fr>
12511 * configure.ac (GXX): Rename as...
12512 (CXX): this, to keep the original Autoconf semantics.
12514 * data/lalr1.cc: Fix b4_copyright invocations.
12515 If YYDEBUG is not defined, don't depend upon name_ being defined.
12516 (location.hh): Include string and iostream.
12517 (Position::filename): New member.
12518 (Position::Position ()): New.
12519 (operator<< (Position)): New.
12520 (operator- (Position, int)): New.
12521 (Location::first, Location::last): Rename as...
12522 (Location::begin, Location::end): these, to mock the conventional
12524 (operator<< (Location)): New.
12525 * tests/atlocal.in (CXX): New.
12526 * tests/testsuite.at (AT_COMPILE_CXX): New.
12527 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
12528 locations in a more synthetic way.
12529 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
12531 Adjust the C locations to match those from Emacs: first column is
12533 Change all the expected results.
12534 Conform to the GCS: simplify the locations when applicable.
12535 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
12536 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
12537 these CPP macros with the m4 macros new defined by...
12538 (AT_CHECK_PUSHDEFS): this, i.e.:
12539 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
12540 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
12542 (AT_CHECK_POPDEFS): Undefine them.
12543 (AT_CHECK_CALC_LALR1_CC): New.
12544 Use it for the first lalr1.cc test.
12546 2003-02-04 Akim Demaille <akim@epita.fr>
12548 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
12549 Location as is defined.
12551 2003-02-04 Akim Demaille <akim@epita.fr>
12553 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
12554 name_ being defined.
12556 2003-02-03 Paul Eggert <eggert@twinsun.com>
12558 * src/gram.h (start_symbol): Remove unused decl.
12560 Use more-consistent naming conventions for local vars.
12562 * src/derives.c (derives_compute): Change type of local var from
12563 int to rule_number.
12564 * src/gram.c (grammar_rules_partial_print): Likewise.
12565 * src/print.c (print_core): Likewise.
12566 * src/reduce.c (reduce_grammar_tables): Likewise.
12568 * src/gram.c (grammar_dump): Change name of item_number *
12569 local var from r to rp.
12570 * src/nullable.c (nullable_compute): Likewise.
12572 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
12574 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
12575 for symbol or symbol_number var.
12576 * src/reader.c (grammar_start_symbol_set): Likewise.
12577 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
12579 * src/state.c (transitions_to): Likewise.
12580 * src/state.h: Likewise.
12581 * src/tables.c (symbol_number_to_vector_number): Likewise.
12583 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
12586 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
12589 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
12592 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
12593 Use str, not s, for char * var. Use ch, not c, for character var.
12594 Use size for size var.
12596 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
12598 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
12600 * src/uniqstr.h: Likewise.
12602 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12603 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12604 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
12605 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
12606 param to have same name as that of enum, so that we don't use
12607 "s" to stand for a non-state.
12609 2003-02-02 Akim Demaille <akim@epita.fr>
12611 * src/scan-skel.l: Scan more than one inert character per yylex
12614 2003-02-01 Paul Eggert <eggert@twinsun.com>
12618 * po/LINGUAS: Add ms.
12620 2003-01-30 Akim Demaille <akim@epita.fr>
12622 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
12624 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12626 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
12629 Changes in response to error report by S. Eken: GLR mode does not
12630 handle negative $ indices or $ indices in embedded rules correctly.
12631 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
12633 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
12634 (b4_rhs_location): Ditto.
12635 (yyfill): New function to copy from stack tree into array
12637 (yyuserAction): Modify to allow incremental move of semantic values
12638 to rhs array when in GLR mode.
12639 Define YYFILL to use in user-defined actions to fill semantic array
12641 Remove dummy use of yystack, as there is now a guaranteed use.
12642 (yydoAction): Modify to allow incremental move of semantic values
12643 to rhs array when in GLR mode.
12644 (yyresolveAction): Ditto.
12645 (yyglrShiftDefer): Update comment.
12646 (yyresolveStates): Use X == NULL for pointers, not !X.
12647 (yyglrReduce): Ditto.
12648 (yydoAction): Ditto
12650 * tests/glr-regr1.at: Rename to ...
12651 * tests/glr-regression.at: Add new regression test for the problems
12652 described above (adapted from S. Eken).
12653 Update copyright notice.
12654 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
12655 * tests/Makefile.am: Ditto.
12657 2003-01-28 Paul Eggert <eggert@twinsun.com>
12659 * data/lalr1.cc: Do not use @output_header_name@ unless
12660 b4_defines_flag is set. This fixes two bugs reported by
12662 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
12663 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
12665 2003-01-21 Paul Eggert <eggert@twinsun.com>
12667 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
12668 we don't need to worry about yyerrlab1 being reported as an
12669 "unused label" by non-GCC C compilers. The downside is that if
12670 locations are used then a couple of statements are duplicated each
12671 time YYERROR is invoked, but the upside is that the warnings
12673 (yyerrlab1): Move code to YERROR.
12674 (yyerrlab2): Remove. Change uses back to yyerrlab1.
12675 This reverts some of the 2002-12-27 change.
12677 2003-01-17 Paul Eggert <eggert@twinsun.com>
12679 * src/output.c (symbol_printers_output): Fix typo that led
12680 to core dump. Problem reported by Antonio Rus in
12681 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
12683 2003-01-13 Akim Demaille <akim@epita.fr>,
12684 Quoc Peyrot <chojin@lrde.epita.fr>,
12685 Robert Anisko <anisko_r@lrde.epita.fr>
12687 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
12688 when the stacks contain one element, as the loop would otherwise
12689 free the last state, and then use the top state (the one we just
12690 popped). This means that the initial elements will not be freed
12691 explicitly, as is the case in yacc.c; it is not a problem, as
12692 these elements have fake values.
12694 2003-01-11 Paul Eggert <eggert@twinsun.com>
12696 * NEWS: %expect-violations are now just warnings, reverting
12697 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
12698 bootstrapping problem reported by Matthias Klose; see
12699 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
12700 * src/conflicts.c (conflicts_print): Likewise.
12701 * tests/conflicts.at (%expect not enough, %expect too much,
12702 %expect with reduce conflicts): Likewise.
12703 * doc/bison.texinfo (Expect Decl): Document this. Also mention
12704 that the warning is enabled if the number of conflicts changes
12705 (not necessarily increases).
12707 * src/getargs.c (version): Update copyright year.
12709 2003-01-09 Akim Demaille <akim@epita.fr>
12711 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
12713 2003-01-08 Paul Eggert <eggert@twinsun.com>
12715 * Makefile.maint (WGETFLAGS):
12716 New macro, containing "-C off" to disable proxy caches.
12717 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
12718 (rel-check): Use $(WGET) instead of wget.
12720 2003-01-06 Paul Eggert <eggert@twinsun.com>
12722 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
12723 the GLR paper of Scott, Johnstone and Hussain.
12725 2003-01-04 Paul Eggert <eggert@twinsun.com>
12727 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
12728 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
12729 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
12730 (EXTRA_LIBRARIES): New var, for liby.a.
12731 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
12732 (EXTRA_SCRIPTS): New var, for yacc.
12734 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
12735 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
12736 Problem reported by Nelson H. F. Beebe.
12738 2003-01-03 Paul Eggert <eggert@twinsun.com>
12740 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
12741 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
12742 when compiling Bison 1.875's `bitset bset = obstack_alloc
12743 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
12745 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
12746 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
12747 grow to a huge size with typical invocation.
12749 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
12750 Use the pattern recommended by Autoconf 2.57, except also protect
12751 against double-definition.
12752 * src/system.h: Likewise.
12753 Portability issues reported by Nelson H. F. Beebe.
12755 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
12756 All uses changed. Provide a definition in both C and C++.
12757 (yytrue, yyfalse): Define even if defined (__cplusplus).
12759 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
12760 Reported by Nelson H. F. Beebe.
12762 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
12764 2003-01-02 Paul Eggert <eggert@twinsun.com>
12766 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
12767 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
12768 Bug reported by Nelson H. F. Beebe.
12770 2003-01-01 Paul Eggert <eggert@twinsun.com>
12774 2002-12-30 Paul Eggert <eggert@twinsun.com>
12776 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
12778 (<INITIAL>","): Here. This causes stray "," to be treated
12781 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
12782 last brace in braced code when not in Yacc mode, for compatibility
12783 with Bison 1.35. This resurrects the 2001-12-15 patch to
12786 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
12787 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
12789 2002-12-28 Paul Eggert <eggert@twinsun.com>
12791 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
12792 that of SYM's type. This fixes Debian bug 168069, reported by
12795 2002-12-28 Paul Eggert <eggert@twinsun.com>
12799 Switch back to the Yacc style of conflict reports, undoing some
12800 of the 2002-07-30 change.
12801 * doc/bison.texinfo (Understanding): Use Yacc style for
12802 conflict reports. Also, use new way of locating rules.
12803 * src/conflicts.c (conflict_report):
12804 Renamed from conflict_report_yacc, removing the old
12805 'conflict_report'. Translate the entire conflict report at once,
12806 so that we don't assume that "," has the same interpretation in
12808 (conflicts_output): Use Yacc-style conflict report for each state,
12809 instead of our more-complicated style.
12810 (conflicts_print): Use Yacc-style conflict report, except print
12811 the input file name when not emulating Yacc.
12812 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
12813 Conflicted Reduction, %expect not enough, %expect too much,
12814 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
12815 * tests/existing.at (GNU Cim Grammar): Likewise.
12816 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
12818 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
12819 fatal): Don't invoke fflush; it's not needed and it might even be
12820 harmful for stdout, as stdout might not be open.
12821 * src/reduce.c (reduce_print): Likewise.
12823 2002-12-27 Paul Eggert <eggert@twinsun.com>
12825 Fix a bug where error locations were not being recorded correctly.
12826 This problem was originally reported by Paul Hilfinger in
12827 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
12829 * data/yacc.c (yyparse): New local var yylerrsp, to record the
12830 top of the location stack's error locations.
12831 (yyerrlab): Set it. When discarding a token, push its location
12832 onto yylerrsp so that we don't lose track of the error's end.
12833 (yyerrlab1): Now is only the target of YYERROR, so that we can
12834 properly record the location of the action that failed. For GCC
12835 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
12836 GCC warning about yyerrlab1 being unused if YYERROR is unused.
12837 (yyerrlab2): New label, which yyerrlab now falls through to.
12838 Compute the error's location by applying YYLLOC_DEFAULT to
12839 the locations of all the symbols that went into the error.
12840 * doc/bison.texinfo (Location Default Action): Mention that
12841 YYLLOC_DEFAULT is also invoked for syntax errors.
12842 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12843 Error locations include the locations of all the tokens that were
12844 discarded, not just the last token.
12846 2002-12-26 Paul Eggert <eggert@twinsun.com>
12848 * src/files.c: Include quote.h.
12849 (compute_output_file_names): Warn if we detect conflicting
12850 outputs to the same file. This should catch the misunderstanding
12851 exemplified by Debian Bug 165349, reported by Bruce Stephens..
12853 * src/conflicts.c (conflicts_print): If the user specifies
12854 "%expect N", report an error if there are any reduce/reduce
12855 conflicts. This is what the manual says should happen.
12856 This fixes Debian bug 130890, reported by Anthony DeRobertis.
12857 * tests/conflicts.at (%expect with reduce conflicts): New test.
12859 Don't use m4_include on relative file names, as it doesn't work as
12860 desired if there happens to be a file with that name under ".".
12862 * m4sugar/version.m4: Remove; it was included but it wasn't used.
12863 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
12864 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
12865 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
12866 * src/output.c (output_skeleton): Use full path names when
12867 specifying a file to include; don't rely on include path, as
12868 it's unreliable when the working file contains a file with
12871 2002-12-25 Paul Eggert <eggert@twinsun.com>
12873 Remove obsolete references to bison.simple and bison.hairy.
12874 Problem mentioned by Aubin Mahe in
12875 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
12876 * data/glr.c: Comment fix.
12877 * doc/bison.1: Remove references. Also, mention "yacc".
12879 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
12882 * src/parse-gram.y (declaration): Use enum "report_states" rather
12883 than its numeric value 1.
12885 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
12886 opening a new one. This fixes Debian bug 165349, reported by
12889 2002-12-24 Paul Eggert <eggert@twinsun.com>
12893 * Makefile.maint (cvs-update): Don't assume that the shell
12894 supports $(...), as Solaris sh doesn't.
12896 * src/parse-gram.y (lloc_default): Remove test for empty
12897 nonterminals at the end, since it didn't change the result.
12899 2002-12-24 Paul Eggert <eggert@twinsun.com>
12901 If the user does not define YYSTYPE as a macro, Bison now declares it
12902 using typedef instead of defining it as a macro. POSIX requires this.
12903 For consistency, YYLTYPE is also declared instead of defined.
12905 %union directives can now have a tag before the `{', e.g., the
12906 directive `%union foo {...}' now generates the C code
12907 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
12908 The default union tag is `YYSTYPE', for compatibility with Solaris 9
12909 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
12910 instead of `yyltype'.
12912 `yystype' and `yyltype' are now obsolescent macros instead of being
12913 typedefs or tags; they are no longer documented and will be
12914 withdrawn in a future release.
12916 * data/glr.c (b4_location_type): Remove.
12917 (YYSTYPE): Renamed from yystype.
12918 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
12919 (struct YYLTYPE): Renamed from struct yyltype.
12920 (YYLTYPE): Renamed from yyltype.
12921 (yyltype, yystype): New (and obsolescent) macros,
12922 for backward compatibility.
12923 * data/yacc.c: Likewise.
12925 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
12926 does not specify a union tag. This is for compatibility with
12929 * src/parse-gram.y (add_param): 2nd arg is now char * not char
12930 const *, since it is now modified by stripping surrounding { }.
12931 (current_braced_code): Remove.
12932 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
12933 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
12934 trailing " {...}". Now of type <chars>.
12935 (grammar_declaration): Adjust to bundled tokens.
12936 (code_content): Remove; stripping is now done by add_param.
12937 (print_token_value): Print contents of bundled tokens.
12938 (token_name): New function.
12940 * src/reader.h (braced_code, current_braced_code): Remove.
12941 (token_name): New decl.
12943 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
12944 token_type, not braced_code code_kind. All uses changed.
12945 (SC_PRE_CODE): New state, for scanning after a keyword that
12946 has (or usually has) an immediately-following braced code.
12947 (token_type): New local var, to keep track of which token type
12948 to return when scanning braced code.
12949 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
12950 <INITIAL>"%parse-param", <INITIAL>"%printer",
12951 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
12952 instead of returning a token type immediately.
12953 (<INITIAL>"{"): Set token type.
12954 (<SC_BRACED_CODE>"}"): Use it.
12955 (handle_action_dollar, handle_action_at): Now returns bool
12956 indicating success. Fail if ! current_rule; this prevents a core dump.
12957 (handle_symbol_code_dollar, handle_symbol_code_at):
12958 Remove; merge body into caller.
12959 (handle_dollar, handle_at): Complain in invalid contexts.
12961 * NEWS, doc/bison.texinfo: Document the above.
12962 * NEWS: Fix years and program names in copyright notice.
12964 2002-12-17 Paul Eggert <eggert@twinsun.com>
12966 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
12967 Reporting, Table of Symbols): Omit mentions of %lex-param and
12968 %parse-param from the documentation for now.
12970 2002-12-15 Paul Eggert <eggert@twinsun.com>
12972 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
12973 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
12974 lookahead symbol, and which sets yychar in parser actions) and it
12975 disagreed with the Bison documentation. Bug
12976 reported by Andrew Walrond.
12978 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
12979 as the caller now does that.
12980 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
12981 (YYEMPTY): Parenthesize right hand side, since others use it.
12982 (yyparse): Don't assume that our generated code is the only code
12985 2002-12-13 Paul Eggert <eggert@twinsun.com>
12989 POSIX requires a "yacc" command.
12990 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
12991 (MOSTLYCLEANFILES): Add yacc.
12993 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
12994 as an alias for bison y.
12996 * po/LINGUAS: Add da.
12998 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
12999 problem with latest <getopt.h>.
13000 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
13002 * doc/fdl.texi: Upgrade to 1.2.
13003 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
13004 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
13005 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
13007 * config/install-sh: Sync with autotools.
13009 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
13010 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
13011 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
13012 locations are requested.
13013 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
13014 locations are requested.
13016 2002-12-12 Paul Eggert <eggert@twinsun.com>
13018 Remove unportable casts and storage allocation tricks.
13019 While we're at it, remove almost all casts, since they
13020 usually aren't needed and are a sign of trouble.
13022 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
13024 * src/derives.c (derives_compute): Do not subtract NTOKENS from
13025 the pointer DSET returned by malloc; this isn't portable.
13026 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
13027 Similarly for DERIVES.
13028 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
13029 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
13030 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
13032 * src/derives.c (derives_compute): Do not bother invoking
13033 int_of_rule_number, since rule numbers are integers.
13035 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
13036 rather than XMALLOC (char, N).
13038 * src/files.c (filename_split): Rewrite to avoid cast.
13040 * src/gram.h (symbol_number_as_item_number,
13041 item_number_as_symbol_number, rule_number_as_item_number,
13042 item_number_as_rule_number):
13043 Now inline functions rather than macros, to avoid casts.
13044 * src/state.h (state_number_as_int): Likewise.
13045 * src/tables.c (state_number_to_vector_number,
13046 symbol_number_to_vector_number): Likewise.
13048 * src/gram.h (int_of_rule_number): Remove; no longer used.
13050 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
13051 since the resulting storage is always stored into.
13053 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
13056 * src/muscle_tab.c (muscle_m4_output):
13057 Now inline. Return bool, not int.
13058 * src/state.c (state_compare): Likewise.
13059 * src/symtab.c (symbol_check_defined,
13060 symbol_check_alias_consistency, symbol_pack, symbol_translation,
13061 hash_compare_symbol, hash_symbol):
13063 * src/uniqstr.c (uniqstr_print): Likewise.
13064 * src/muscle_tab.c (muscle_m4_output_processor):
13065 New function, to avoid casts.
13066 * src/state.c (state_comparator, stage_hasher): Likewise.
13067 * src/symtab.c (symbol_check_defined_processor,
13068 symbol_check_alias_consistency_processor, symbol_pack_processor,
13069 symbol_translation_processor, hash_symbol_comparator,
13070 hash_symbol_hasher): Likewise.
13071 * src/uniqstr.c (uniqstr_print_processor): Likewise.
13072 * src/muscle_tab.c (muscles_m4_output):
13073 Use new functions instead of casting old functions unportably.
13074 * src/state.c (state_hash_new): Likewise.
13075 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
13076 symbols_token_translations_init):
13078 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
13080 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
13081 var instead of casting to long, to avoid casts.
13082 (prepare_states): Use MALLOC rather than alloca, so that we don't
13083 have to worry about alloca.
13084 * src/state.c (state_hash_lookup): Likewise.
13086 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
13087 local var instead of casting to unsigned char, to avoid casts.
13089 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
13090 STATE_ALLOC): Remove.
13091 (transitions_new, errs_new, reductions_new, state_new): Use malloc
13092 rather than calloc, and use offsetof to avoid allocating slightly
13094 (state_new): Initialize all members.
13096 * src/state.c (state_hash): Use unsigned accumulator, not signed.
13098 * src/symtab.c (symbol_free): Remove; unused.
13099 (symbol_get): Remove cast in lhs of assignment.
13100 (symbols_do): Now static. Accept generic arguments, not
13101 hashing-related ones.
13103 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
13104 (symbol_processor): Remove.
13105 (symbols_do): Remove decl; now static.
13107 * src/system.h (alloca): Remove; decl no longer needed.
13108 (<stddef.h>): Include, for offsetof.
13109 (<inttypes.>, <stdint.h>): Include if available.
13110 (uintptr_t): New type, if system lacks it.
13111 (CALLOC, MALLOC, REALLOC): New macros.
13112 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
13115 * src/tables.c (table_size): Now int, to pacify GCC.
13116 (table_grow, table_ninf_remap): Use signed table size.
13117 (save_row): Don't bother initializing locals when not needed.
13118 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
13119 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
13121 * src/vcg.h: Correct misspellings.
13123 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
13126 * src/getargs.c (getargs): Don't assume EOF == -1.
13128 2002-12-09 Paul Eggert <eggert@twinsun.com>
13130 Change identifier spellings to avoid collisions with names
13131 that are reserved by POSIX.
13133 Don't use names ending in _t, since POSIX reserves them.
13134 For consistency, remove _e and _s endings -- they're weren't
13135 needed to remove ambiguity. All uses changed.
13136 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
13137 turn was just renamed from struniq_t.
13138 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
13139 which in turn was just renamed from struniq_processor_t.
13140 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
13141 in turn was renamed from hash_compare_struniq_t.
13142 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
13143 (state_list): Renamed from state_list_t.
13144 * src/assoc.h (assoc): Renamed from assoc_t.
13145 * src/conflicts.c (enum conflict_resolution): Renamed from
13146 enum conflict_resolution_e.
13147 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
13148 (rule_list): Renamed from rule_list_t.
13149 * src/getargs.h (enum trace): Renamed from enum trace_e.
13150 (enum report): Renamed from enum report_e.
13151 * src/gram.h (item_number): Renamed from item_number_t.
13152 (rule_number): Renamed from rule_number_t.
13153 (struct rule_s): Remove the "rule_s" part; not used.
13154 (rule): Renamed from rule_t.
13155 (rule_filter): Renamed from rule_filter_t.
13156 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
13157 (goto_list): Renamed from goto_list_t.
13158 * src/lalr.h (goto_number): Renamed from goto_number_t.
13159 * src/location.h (location): Renamed from location_t.
13160 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
13161 and moved here from:
13162 * src/muscle_tab.h (muscle_entry_t): here.
13163 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
13164 (rule_list): Renamed from rule_list_t.
13165 * src/print_graph.c (static_graph): Renamed from graph.
13166 * src/reader.h (braced_code): Renamed from braced_code_t.
13167 Remove brace_code_e tag.
13168 * src/relation.h (relation_node): Renamed from relation_node_t.
13169 (relation_nodes): Renamed from relation_nodes_t.
13170 (relation): Renamed from relation_t.
13171 * src/state.h (state_number): Renamed from state_number_t.
13172 (struct state): Renamed from struct state_s.
13173 (state): Renamed from state_t.
13174 (transitions): Renamed from transitions_t. Unused (and
13175 misspelled) transtion_s tag removed.
13176 (errs): Renamed from errs_t. Unused errs_s tag removed.
13177 (reductions): Renamed from reductions_t. Unused tag
13178 reductions_s removed.
13179 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
13180 (struct symbol_list): Renamed from struct symbol_list_s.
13181 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
13182 (struct symbol): Renamed from struct symbol_s.
13183 (symbol): Renamed from symbol_t.
13184 * src/tables.c (vector_number): Renamed from vector_number_t.
13185 (action_number): Renamed from action_t.
13186 * src/tables.h (base_number): Renamed from base_t.
13187 * src/vcg.h (enum color): Renamed from enum color_e.
13188 (enum textmode): Renamed from enum textmode_e.
13189 (enum shape): Renamed from enum shape_e.
13190 (struct colorentry): Renamed from struct colorentry_s.
13191 (struct classname): Renamed from struct classname_s.
13192 (struct infoname): Renamed from struct infoname_s.
13193 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
13194 (enum decision): Renamed from enum decision_e.
13195 (enum orientation): Renamed from enum orientation_e.
13196 (enum alignment): Renamed from enum alignment_e.
13197 (enum arrow_mode): Renamed from enum arrow_mode_e.
13198 (enum crossing_type): Renamed from enum crossing_type_e.
13199 (enum view): Renamed from enum view_e.
13200 (struct node): Renamed from struct node_s.
13201 (node): Renamed from node_t.
13202 (enum linestyle): Renamed from enum linestyle_e.
13203 (enum arrowstyle): Renamed from enum arrowstyle_e.
13204 (struct edge): Renamed from struct edge.
13205 (edge): Renamed from edge_t.
13206 (struct graph): Renamed from struct graph_s.
13207 (graph): Renamed from graph_t.
13208 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
13209 Rename value_t -> value.
13210 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
13211 value_t_as_yystype -> value_as_yystype.
13213 Don't include <errno.h> in the mainstream code, since it
13214 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
13215 * lib/get-errno.c, lib/get-errno.h: New files.
13216 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
13218 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
13219 * src/output.c (output_skeleton): Likewise.
13220 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
13222 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
13224 (handle_action_dollar, handle_action_at): Likewise.
13225 * src/system.h: Do not include <errno.h>.
13226 (TAB_EXT): Renamed from EXT_TAB.
13227 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
13229 Avoid str[a-z]*, since <string.h> reserves that name space.
13230 Change all instances of "struniq" in names to "uniqstr", and
13231 likewise for "STRUNIQ" and "UNIQSTR".
13232 * src/uniqstr.c: Renamed from src/struniq.c.
13233 * src/uniqstr.h: Renamed from src/struniq.h.
13234 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
13235 * src/files.c (strsuffix): Remove; unused.
13236 (concat2): Renamed from stringappend. Now static.
13237 * src/files.h (strsuffix, stringappend): Remove; unused.
13238 * src/parse-gram.y (<chars>): Renamed from <string>.
13239 (<uniqstr>): Renamed from <struniq>.
13240 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
13241 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
13242 (struct graph_s.expand): Renamed from struct graph_s.stretch.
13243 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
13244 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
13245 (N_EXPAND): Renamed from N_STRETCH.
13247 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
13248 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
13249 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
13251 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
13252 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
13253 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
13254 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
13255 (BASE_MAXIMUM): Renamed from BASE_MAX.
13256 (BASE_MINIMUM): Renamed from BASE_MIN.
13257 (ACTION_MAX): Remove; unused.
13258 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
13259 Unnecessary casts removed from above defines.
13262 Fix misspelling in names.
13263 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
13264 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
13268 * lib/timevar.c (timevar_report): Renamed from time_report,
13269 for consistency with other names.
13270 * lib/timevar.h (timevar_report): New decl.
13271 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
13274 Sort include-file uses.
13276 Reorder all include files under src to be in the order "system.h".
13277 then the ../lib include files in angle brackets (alphabetized),
13278 then the . include files in double-quotes (alphabetized). Fix
13279 dependency breakages encountered in this process, as follows:
13280 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
13281 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
13282 * src/state.h: Include "symtab.h".
13284 2002-12-08 Paul Eggert <eggert@twinsun.com>
13286 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
13287 since this causes problems when __file__ contains character
13288 sequences like "@" that are treated specially by src/scan-skel.l.
13289 Instead, just use the file's basename. This fixes the bug
13290 reported by Martin Mokrejs in
13291 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
13293 2002-12-06 Paul Eggert <eggert@twinsun.com>
13295 Add support for rules that do not have trailing semicolons, as
13296 POSIX requires. Improve the quality of locations in Bison
13299 * src/location.c: Include <quotearg.h>.
13300 (empty_location): Now const.
13301 (location_print): New function. Follow the recommendation of the
13302 GNU Coding Standards for locations that span file boundaries.
13303 * src/location.h: Do not include <quotearg.h>; no longer needed.
13304 (boundary): New type.
13305 (location_t): Use it. This allows locations to span file boundaries.
13306 All member uses changed: file -> start.file or end.file (as needed),
13307 first_line -> start.line, first_column -> start.column,
13308 last_line -> end.line, last_column -> end.column.
13309 (equal_boundaries): New function.
13310 (LOCATION_RESET, LOCATION_STEP): Remove.
13311 (LOCATION_PRINT): Remove. All callers changed to use location_print.
13312 (empty_location): Now const.
13313 (location_print): New decl.
13314 * src/parse-gram.y (lloc_default): New function, which handles
13315 empty locations more accurately.
13316 (YYLLOC_DEFAULT): Use it.
13317 (%token COLON): Remove.
13318 (%token ID_COLON): New token.
13320 (declarations, rules): Remove trailing semicolon.
13321 (declaration, rules_or_grammar_declaration):
13322 Allow empty (";") declaration.
13323 (symbol_def): Remove empty actions; no longer needed.
13324 (rules_or_grammar_declaration): Remove trailing semicolon.
13325 (semi_colon.opt): Remove.
13326 * src/reader.h: Include location.h.
13327 (scanner_cursor): New decl.
13328 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
13330 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
13332 (STEP): Remove. No longer needed, now that adjust_location does
13333 the work. All uses removed.
13334 (scanner_cursor): New var.
13335 (adjust_location): Renamed from extend_location. It now sets
13336 *loc and adjusts the scanner cursor. All uses changed.
13337 Don't bother testing for CR.
13338 (handle_syncline): Remove location arg; now updates scanner cursor.
13339 All callers changed.
13340 (unexpected_end_of_file): Now accepts start boundary of token or
13341 comment, not location. All callers changed. Update scanner cursor,
13343 (SC_AFTER_IDENTIFIER): New state.
13344 (context_state): Renamed from c_context. All uses changed.
13345 (id_loc, code_start, token_start): New local vars.
13346 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
13347 processing of Yacc white space and equivalents here.
13348 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
13349 instead of returning ID immediately, since we need to search for
13350 a subsequent colon.
13351 (<INITIAL>"'", "\""): Save token_start.
13352 (<INITIAL>"%{", "{", "%%"): Save code_start.
13353 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
13354 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
13355 BEGIN context_state at end, not INITIAL.
13356 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
13357 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
13358 Return correct token start.
13359 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
13360 the start of a character, string or multiline comment is found.
13361 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
13362 Reduction): Adjust reported locations to match the more-precise
13363 results now expected.
13364 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
13365 * tests/reduce.at (Useless Rules, Reduced Automaton,
13366 Underivable Rules): Likewise.
13367 * tests/regression.at (Invalid inputs): No longer `expecting ";"
13368 or "|"' now that so many other tokens are allowed by the new grammar.
13370 * src/complain.h (current_file): Remove duplicate decl;
13371 current_file is now owned by files.h.
13372 * src/complain.c, src/scan-gram.l: Include files.h.
13374 2002-12-06 Paul Eggert <eggert@twinsun.com>
13376 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
13377 promotes to int; it might be unsigned int.
13378 * data/yacc.c (yy_reduce_print): Likewise.
13380 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
13381 be #defined in the prologue, not in the Bison declarations.
13382 This fixes Debian Bug 102878, reported by Shaul Karl.
13384 2002-12-02 Paul Eggert <eggert@twinsun.com>
13386 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
13387 * lib/strtoul.c: New file, from gnulib.
13388 This fixes a porting bug reported by Peter Klein in
13389 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
13391 2002-11-30 Paul Eggert <eggert@twinsun.com>
13393 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
13394 and put only a forward declaration in the prologue. This is for
13395 consistency with the other scanner helper functions.
13397 Type clashes now generate warnings, not errors, since it
13398 appears that POSIX may allow some grammars with type clashes.
13399 * src/reader.c (grammar_current_rule_check): Warn about
13400 type clashes instead of complaining.
13401 * tests/input.at (Type Clashes): Expect warnings, not complaints.
13403 Add Yacc library, since POSIX requires it.
13404 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
13405 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
13406 * lib/main.c, lib/yyerror.c: New files.
13408 gram_error can be static; it need not be extern.
13409 * src/reader.h (gram_error): Remove decl.
13410 * src/parse-gram.y (gram_error): Now static. Add static decl.
13411 (print_token_value): Omit parameter names from forward decl,
13414 2002-11-29 Paul Eggert <eggert@twinsun.com>
13416 * doc/bison.texinfo: Emphasize that yylex and yyerror must
13417 be declared before being used. E.g., one should typically
13418 declare them in the prologue. Use GNU coding style in examples.
13419 Put "const" consistently after the type it modifies. Mention
13420 that C99 supports "inline". Mention that yyerror traditionally
13423 %parse-param and %lex-param now take just one argument, the
13424 declaration; the argument name is deduced from the declaration.
13426 * doc/bison.texinfo (Parser Function, Pure Calling, Error
13427 Reporting, Table of Symbols): Document this.
13428 * src/parse-gram.y (add_param): New function.
13430 (declaration): Implement new rule for %parse-param and %lex-param.
13431 * src/scan-gram.l: "," now elicits a warning, rather than being
13432 a token; this is more compatible with byacc.
13433 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
13435 2002-11-27 Paul Eggert <eggert@twinsun.com>
13437 Rename identifiers to avoid real and potential collisions.
13439 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
13440 to avoid collision with lex macro described by Bruce Lilly in
13441 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
13442 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
13443 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
13444 * src/parse-gram.y (print_token_value): Renamed from yyprint.
13446 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
13447 The name "yycontrol" violates the name space rules, and this stuff
13448 wasn't being used anyway.
13449 (input): Remove action; this stuff wasn't being used.
13450 (gram_error): Rename local variable yylloc -> loc.
13451 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
13452 (YY_DECL): Don't use "yy" at start of local variables.
13453 All uses changed, e.g., yylloc -> loc.
13454 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
13455 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
13456 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
13457 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
13459 * src/parse-gram.y (gram_error): loc is now const *.
13460 * src/reader.h (gram_error): Likewise.
13462 2002-11-24 Paul Eggert <eggert@twinsun.com>
13466 * tests/actions.at (Actions after errors): Use an output format
13467 more similar to that of the Printers and Destructors test.
13468 Test the position of the ';' token too.
13469 (Printers and Destructors): Likewise.
13470 (Printers and Destructors: %glr-parser): Remove for now, to avoid
13471 unnecessarily alarming people when the test fails.
13473 * data/yacc.c (yyerrlab1): Move this label down, so that the
13474 parser does not discard the lookahead token if the user code
13475 invokes YYERROR. This change is required for POSIX conformance.
13477 * lib/error.c: Sync with gnulib.
13479 2002-11-22 Paul Eggert <eggert@twinsun.com>
13481 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
13482 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
13483 * lib/xmalloc.c: Likewise.
13485 2002-11-20 Paul Eggert <eggert@twinsun.com>
13487 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
13489 2002-11-20 Paul Eggert <eggert@twinsun.com>
13491 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
13492 should use `if (! x) abort ();' rather than `assert (x);', and
13493 anyway it's one less thing to worry about configuring.
13495 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
13496 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
13497 and replace all instances of assert with abort.
13498 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
13499 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
13501 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
13502 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
13503 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
13504 hash_find_entry, hash_rehash, hash_insert): Likewise.
13505 * src/conflicts.c (resolve_sr_conflict): Likewise.
13506 * src/lalr.c (set_goto_map, map_goto): Likewise.
13507 * src/nullable.c (nullable_compute): Likewise.
13508 * src/output.c (prepare_rules, token_definitions_output): Likewise.
13509 * src/reader.c (packgram, reader): Likewise.
13510 * src/state.c (state_new, state_free, state_transitions_set,
13511 state_reduction_find): Likewise.
13512 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
13513 symbol_pack): Likewise.
13514 * src/tables.c (conflict_row, pack_vector): Likewise.
13515 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
13516 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
13517 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
13518 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
13520 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
13521 (ARGMATCH_CONSTRAINT): New macro.
13522 (ARGMATCH_ASSERT): Use it.
13524 * src/system.h (verify): New macro.
13525 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
13526 rather than assert.
13527 * src/tables.c (tables_generate): Likewise.
13529 * src/struniq.c (struniq_assert): Now returns void, and aborts
13530 if the assertion is false.
13531 (struniq_assert_p): Remove.
13532 * src/struniq.h: Likewise.
13534 2002-11-18 Paul Eggert <eggert@twinsun.com>
13536 * data/glr.c (yygetLRActions): Replace `yyindex' with
13537 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
13538 This fixes the regression with Sun ONE Studio 7 cc that I reported in
13539 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
13541 2002-11-18 Akim Demaille <akim@epita.fr>
13543 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
13545 From Tim Van Holder.
13547 2002-11-17 Paul Eggert <eggert@twinsun.com>
13549 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
13550 to "SyntaxError" for consistency with my 2002-11-15 change.
13552 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
13553 not define to {}, since this breaks the common use of `YYDPRINTF
13554 ((...));' if a single statement is desired (e.g. before `else').
13555 Work around GCC warnings by surrounding corresponding calls with
13557 (yyhasResolvedValue): Remove unused function.
13558 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
13560 (yyreportSyntaxError): Renamed from yyreportParseError.
13561 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
13563 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
13564 extern when possible. Remove unused initializations.
13566 2002-11-16 Akim Demaille <akim@epita.fr>
13568 Augment the similarity between GLR and LALR traces.
13570 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
13571 (YY_REDUCE_PRINT): New.
13572 (yyparse): Use them.
13573 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
13575 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
13576 state reached after the reduction/recovery, since...
13577 (yyparse, yyprocessOneStack): Report the state we are entering in.
13579 2002-11-16 Akim Demaille <akim@epita.fr>
13581 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
13582 Add support for --trace=skeleton.
13583 * src/scan-skel.l: %option debug.
13584 Scan strings of non-@ or \n instead of character by character.
13585 (scan_skel): Handle trace_skeleton.
13587 (@output_parser_name@, @output_header_name@): ``Restore'' their
13588 support (used to be M4 macros).
13589 * data/yacc.c: Quote larger chunks, a la glr.c.
13590 * data/lalr1.cc: Likewise.
13591 The header guards are no longer available, so use some other
13592 string than `YYLSP_NEEDED'.
13594 2002-11-16 Akim Demaille <akim@epita.fr>
13596 Make the ``Printers and Destructors'' test more verbose, taking
13597 `yacc.c''s behavior as (possibly wrong) reference.
13599 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
13600 instead of fprint on stdout.
13601 Set and report the last_line of the symbols.
13602 Consistently display values and locations.
13604 2002-11-16 Paul Eggert <eggert@twinsun.com>
13606 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
13608 2002-11-15 Paul Eggert <eggert@twinsun.com>
13610 * tests/actions.at (Actions after errors): New test case.
13612 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
13613 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
13614 tests/action.at, tests/calc.at, tests/conflicts.at,
13615 tests/cxx-type.at, tests/regression.at:
13616 "parse error" -> "syntax error" for POSIX compatibility.
13617 "parsing stack overflow..." -> "parser stack overflow" so
13618 that code matches Bison documentation.
13620 2002-11-15 Akim Demaille <akim@epita.fr>
13622 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
13623 take two BRACED_CODE, not two string_content.
13624 Free the scanner's obstack when we are done.
13625 (code_content): New.
13626 * tests/calc.at: Adjust.
13627 * doc/bison.texinfo: Adjust.
13628 Also, make sure to include the `,' for these declarations.
13630 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
13632 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
13633 definition; avoids potential autoreconf problems.
13635 2002-11-15 Akim Demaille <akim@epita.fr>
13637 Always check the value returned by yyparse.
13639 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
13640 returned by yyparse.
13641 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
13643 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
13644 returned by yyparse.
13646 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13648 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
13651 2002-11-14 Paul Eggert <eggert@twinsun.com>
13653 * src/output.c (output_skeleton): Call xfopen instead of
13654 duplicating xfopen's body.
13656 Fix bugs reported by Nelson H. F. Beebe in
13657 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
13659 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
13660 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
13661 Group compiler. Instead, use "$CC -E bar.c". Include the .h
13662 file twice in the grammar, as an extra check.
13664 * tests/input.at (Torturing the Scanner): Surround the
13665 backslash-newline tests with "#if 0", to make it less likely that
13666 we'll run into compiler bugs. Bring back solitary \ inside
13667 comment, but add a closing comment to work around HP C bug. Don't
13668 test backslash-newline in C character constant.
13670 2002-11-14 Akim Demaille <akim@epita.fr>
13672 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
13673 status of the compiler.
13674 Calling `exit 1' is no longer needed.
13675 Reported by Nelson H. F. Beebe.
13677 2002-11-14 Akim Demaille <akim@epita.fr>
13679 * tests/atlocal.in (CPPFLAGS): We have config.h.
13680 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
13682 * tests/actions.at, tests/calc.at, tests/conflicts.at,
13683 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
13684 * tests/regression.at, tests/torture.at: Use them for all the
13685 grammars that are to be compiled.
13686 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
13687 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
13688 * doc/bison.texinfo (GLR Parsers): Document `inline'.
13690 2002-11-14 Akim Demaille <akim@epita.fr>
13692 * doc/bison.texinfo: Various formatting changes (alignments in
13693 samples, additional @group/@end group, GCS in samples.
13694 Use @deffn instead of simple @table to define the directives,
13695 macros, variables etc.
13697 2002-11-13 Paul Eggert <eggert@twinsun.com>
13699 Fix some bugs reported by Albert Chin-A-Young in
13700 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
13702 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
13703 -o c"; the HP C compiler chatters during compilation.
13704 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
13705 * tests/headers.at (export YYLTYPE): Likewise.
13707 * tests/input.at (Torturing the Scanner): Remove lines containing
13708 solitary backslashes, as they tickle a bug in the HP C compiler.
13710 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
13711 comments, since they're not portable. Use GNU coding style.
13713 2002-11-13 Akim Demaille <akim@epita.fr>
13715 * data/yacc.c: Leave bigger chunks of quoted text.
13716 (YYDSYMPRINTF): New.
13717 Use it to report symbol activities.
13718 * data/glr.c (YYDSYMPRINTF): New.
13721 2002-11-12 Paul Eggert <eggert@twinsun.com>
13725 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
13726 (yyglrReduce): Return yyok, not 0.
13727 This should avoid the enumerated-type warnings reported
13728 by Nelson H. F. Beebe in
13729 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
13731 * lib/bbitset.h (BITSET_INLINE): Remove.
13732 * lib/bitset.h [! BITSET_INLINE]: Remove.
13733 (bitset_set, bitset_reset, bitset_test): Rename local vars
13734 to avoid shadowing warnings by GCC.
13736 * data/glr.c (inline): Remove #define. It's the user's
13737 responsibility to #define it away, just like 'const'.
13738 This fixes one of the bugs reported by Nelson H. F. Beebe in
13739 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
13741 * Makefile.maint (po-check): Scan .l and .y files instead of the
13742 .c and the .h files that they generate. This fixes the bug
13743 reported by Tim Van Holder in:
13744 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
13745 Look for N_ as well as for _. Try to avoid matching #define for
13747 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
13748 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
13749 * src/scan-gram.l: Revamp regular expressions so that " and '
13750 do not confuse xgettext.
13752 * src/struniq.h (struniq_new): Do not declare the return type
13753 to be 'const'; this violates the C standard.
13754 * src/struniq.c (struniq_new): Likewise.
13756 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
13758 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
13759 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
13762 2002-11-12 Akim Demaille <akim@epita.fr>
13764 * Makefile.maint: Sync with Autoconf:
13765 (local_updates): New.
13767 2002-11-12 Akim Demaille <akim@epita.fr>
13769 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
13771 2002-11-12 Akim Demaille <akim@epita.fr>
13773 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
13776 2002-11-12 Akim Demaille <akim@epita.fr>
13778 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
13781 2002-11-12 Akim Demaille <akim@epita.fr>
13783 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
13784 Use it to test the GLR parser.
13786 2002-11-12 Akim Demaille <akim@epita.fr>
13788 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
13790 * data/glr.c (yystos): New.
13791 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
13792 (YYDSYMPRINT): New.
13793 (yyval): Don't define it, it is handled via M4.
13794 (yyrecoverParseError): Free verbosely the discarded symbols.
13795 * data/yacc.c (yysymprint): Remove, rather...
13796 (b4_yysymprint_generate): invoke.
13797 * data/c.m4 (b4_yysymprint_generate): New.
13798 Accept pointers as arguments, as opposed to the version from
13800 (b4_yydestruct_generate): Likewise.
13801 * tests/cations.at (Printers and Destructors): Use Bison directives
13802 instead of CPP macros.
13803 Don't rely on internal details.
13805 2002-11-12 Akim Demaille <akim@epita.fr>
13807 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
13808 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
13809 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
13810 it against YYEMPTY and so forth), work on yytoken (i.e., set
13811 it to YYEMPTY etc.).
13812 (yydestruct): Replace with a b4_yydestruct_generate invocation.
13813 (b4_symbol_actions): Remove.
13814 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
13815 for 0, end-of-input.
13817 2002-11-12 Akim Demaille <akim@epita.fr>
13819 * doc/bison.texinfo (Destructor Decl): New.
13821 2002-11-12 Akim Demaille <akim@epita.fr>
13823 * src/tables.c (tables_generate): Use free for pointers that
13824 cannot be NULL, not XFREE.
13825 (pack_vector): Use assert, not fatal, for bound violations.
13826 * src/state.c (state_new): Likewise.
13827 * src/reader.c (reader): Likewise.
13828 * src/lalr.c (set_goto_map): Likewise.
13829 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
13832 2002-11-12 Akim Demaille <akim@epita.fr>
13834 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
13836 * src/scan-gram.l (last_string): Is global to the file, not to
13838 * src/parse-gram.y (input): Don't append the epilogue here,
13839 (epilogue.opt): do it here, and free the scanner's obstack.
13840 * src/reader.c (epilogue_set): Rename as...
13841 (epilogue_augment): this.
13842 * data/c.m4 (b4_epilogue): Defaults to empty.
13844 2002-11-12 Akim Demaille <akim@epita.fr>
13846 * src/getargs.c (long_options): Remove duplicates.
13847 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
13849 * doc/bison.rnh: Remove.
13850 * doc/bison.texinfo (VMS Invocation): Remove.
13852 2002-11-12 Akim Demaille <akim@epita.fr>
13854 * src/struniq.h, src/struniq.c (struniq_t): Is const.
13855 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
13857 Use struniq for symbols.
13859 * src/symtab.h (symbol_t): The tag member is a struniq.
13860 (symbol_type_set): Adjust.
13861 * src/symtab.c (symbol_new): Takes a struniq.
13862 (symbol_free): Don't free the tag member.
13863 (hash_compare_symbol_t, hash_symbol_t): Rename as...
13864 (hash_compare_symbol, hash_symbol): these.
13865 Use the fact that tags as struniqs.
13866 (symbol_get): Use struniq_new.
13867 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
13869 * src/reader.h (merger_list, grammar_currentmerge_set): The name
13870 and type members are struniqs.
13871 * src/reader.c (get_merge_function)
13872 (grammar_current_rule_merge_set): Adjust.
13873 (TYPE, current_type): Are struniq.
13875 Use struniq for file names.
13877 * src/files.h, src/files.c (infile): Split into...
13878 (grammar_file, current_file): these.
13879 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
13880 * src/reduce.c (reduce_print): Likewise.
13881 * src/getargs.c (getargs): Likewise.
13882 * src/complain.h, src/complain.c: Likewise.
13883 * src/main.c (main): Call struniqs_new early enough to use it for
13885 Don't free the input file name.
13887 2002-11-12 Akim Demaille <akim@epita.fr>
13889 * src/symtab.c (symbol_free): Remove dead deactivated code:
13890 type_name are properly removed.
13891 Don't use XFREE to free items that cannot be NULL.
13892 * src/struniq.h, src/struniq.c: New.
13893 * src/main.c (main): Initialize/free struniqs.
13894 * src/parse-gram.y (%union): Add astruniq member.
13896 * src/scan-gram.l (<{tag}>): Return a struniq.
13897 Free the obstack bit that used to store it.
13898 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
13900 2002-11-11 Paul Eggert <eggert@twinsun.com>
13902 Revamp to fix many (but not all) of the C- and M4-related quoting
13903 problems. Among other things, this fixes the Bison bug reported
13904 by Jan Hubicka when processing the Bash grammar; see:
13905 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
13907 Use new @ escapes consistently. Represent brackets with @{ and @}
13908 rather than @<:@ and @:>@, since this works a bit better with dumb
13909 editors like vi. Represent @ with @@, since @ is now consistently
13910 an escape. Use @oline@ and @ofile@ rather than __oline__ and
13911 __ofile__, to avoid unexpected expansions. Similarly, use @output
13912 rather than #output.
13914 * data/c.m4 (b4_copyright): Omit file name from comment, since
13915 the file name could contain "*/".
13916 (b4_synclines_flag): Don't quote the 2nd argument; it should already
13917 be quoted. All uses changed.
13919 * data/glr.c: Use new @ escapes consistently.
13920 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
13921 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
13922 Remove, since they couldn't handle arbitrary characters in file
13924 * data/lalr1.cc: Likewise.
13925 * data/yacc.c: Likewise.
13927 * src/files.c (output_infix): Remove; all uses removed.
13928 * src/files.h: Likewise.
13930 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
13931 mishandled funny characters in file names, and anyway it isn't
13933 * data/yacc.c: Likewise.
13934 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
13936 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
13937 * data/yacc.c: Likewise.
13939 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
13941 (muscle_init): Quote filename as a C string.
13942 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
13943 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
13944 * src/output.c (escaped_file_name_output): New function.
13945 (prepare_symbols): Quote tokens for M4.
13946 (prepare): Don't insert output_infix, output_prefix,
13947 output_parser_name, output_header_name; this is now down by scan-skel.
13948 Insert skeleton as a C string.
13950 * src/output.c (user_actions_output, symbol_destructors_output,
13951 symbol_printers_output): Quote filenames for C and M4.
13952 * src/reader.c (prologue_augment, epilogue_set): Likewise.
13954 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
13955 escapes other than \\ and \'; this simplifies the code.
13956 (<SC_STRING>): Likewise, for \\ and \".
13957 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
13958 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
13959 Use new escapes @{ and @} for [ and ].
13961 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
13962 them with auto vars.
13963 Switch to new escape scheme, where @ is the escape character uniformly.
13964 Abort if a stray escape character is found. Avoid unbounded input
13965 buffer when parsing non-escaped text.
13967 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
13968 __oline__, #output, $@, and @{ do not have unintended meanings.
13970 2002-11-09 Paul Eggert <eggert@twinsun.com>
13972 Fix the test failure due to GCC warnings described in
13973 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
13974 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
13975 evaluate to 0 if it's impossible for NINF to be in the respective
13977 (yygetLRActions, yyrecoverParseError): Use them.
13979 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
13980 counted in the token inserted at end of file. Now takes
13981 location_t *, not location_t, so that the location can be
13982 adjusted. All uses changed.
13984 * tests/regression.at (Invalid inputs): Adjust wording in
13985 diagnostic to match the new behavior.
13987 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
13988 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
13989 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
13990 abort ();'. This reduces the runtime of the "Many lookaheads"
13991 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
13994 2002-11-07 Paul Eggert <eggert@twinsun.com>
13996 * src/parse-gram.y (CHARACTER): Remove unused token.
13999 * src/scan-gram.l: Remove stack option. We no longer use the
14000 stack, since the stack was never deeper than 1; instead, use the
14001 new auto var c_context to record the stacked value.
14003 Remove nounput option. At an unexpected end of file, we now unput
14004 the minimal input necessary to end cleanly; this simplifies the
14007 Avoid unbounded token sizes where this is easy.
14009 (unexpected_end_of_file): New function.
14010 Use it to systematize the error message on unexpected EOF.
14011 (last-string): Now auto, not static.
14012 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
14013 (scanner_last_string_free): Remove; not used.
14014 (percent_percent_count): Move decl to just before use.
14015 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
14016 not the (never otherwised-used) CHARACTER.
14018 2002-11-07 Akim Demaille <akim@epita.fr>
14020 Let yyerror always receive the msg as last argument, so that
14021 yyerror can be variadic.
14023 * data/yacc.c (b4_yyerror_args): New.
14024 Use it when calling yyerror.
14025 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
14026 Use it when calling yyerror.
14027 * doc/bison.texinfo (Error Reporting): Adjust.
14028 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
14029 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
14031 2002-11-06 Akim Demaille <akim@epita.fr>
14033 #line should have quoted strings.
14034 Ideally, this should be done by m4_quotearg.
14036 * src/scan-skel.l: Include quotearg.h.
14038 * src/output.c (symbol_printers_output)
14039 (symbol_destructors_output): Quote the file name.
14041 2002-11-06 Akim Demaille <akim@epita.fr>
14043 * tests/regression.at (Invalid inputs): Adjust to the recent
14046 2002-11-06 Akim Demaille <akim@epita.fr>
14048 Restore --no-lines.
14049 Reported by Jim Kent.
14051 * data/c.m4 (b4_syncline): New.
14052 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
14053 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
14054 * src/output.c (user_actions_output): Likewise.
14055 (prepare): Define 'b4_synclines_flag'.
14056 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
14058 2002-11-06 Akim Demaille <akim@epita.fr>
14060 * src/main.c (main): Free `infile'.
14061 * src/scan-gram.l (handle_syncline): New.
14063 * src/output.c (user_actions_output, symbol_destructors_output)
14064 (symbol_printers_output): Use the location's file name, not
14066 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14068 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14070 * src/tables.c (matching_state): Don't allow states to match if
14071 either has GLR conflict entries.
14073 2002-11-05 Paul Eggert <eggert@twinsun.com>
14075 * src/scan-gram.l: Use more accurate diagnostics, e.g.
14076 "integer out of range" rather than "invalid value".
14077 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
14080 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
14081 Also, remove one static variable in the scanner.
14083 * src/scan-gram.l (braces_level): Now auto, not static.
14084 Initialize to zero if the compiler is being picky.
14085 (INITIAL): Clear braces_level instead of incrementing it.
14086 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
14087 as POSIX 1003.1-2001 requires.
14088 * src/system.h (IF_LINT): New macro, taken from coreutils.
14089 * configure.ac: Define "lint" if --enable-gcc-warnings.
14091 2002-11-05 Akim Demaille <akim@epita.fr>
14093 * src/scan-gram.l: When it starts with `%', complain about the
14094 whole directive, not just that `invalid character: %'.
14096 2002-11-04 Akim Demaille <akim@epita.fr>
14098 * Makefile.maint: Update from Autoconf.
14099 (update, cvs-update, po-update, do-po-update): New.
14101 2002-11-04 Akim Demaille <akim@epita.fr>
14103 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
14105 Have yyerror `use' its arguments.
14106 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
14107 returns true when location & yacc & pure & parse-param.
14108 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
14110 2002-11-04 Akim Demaille <akim@epita.fr>
14112 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
14114 * src/scan-gram.l: Use [\'] instead of ['] to pacify
14117 Use quote, not quote_n since LOCATION_PRINT no longer uses the
14120 2002-11-03 Paul Eggert <eggert@twinsun.com>
14122 * src/reader.c (get_merge_function, grammar_current_rule_check):
14123 Use consistent diagnostics for reporting type name clashes.
14124 Quote the types with <>, for consistency with Yacc.
14125 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
14127 2002-11-03 Akim Demaille <akim@epita.fr>
14129 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
14131 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
14132 (b4_parse_param): Remove.
14133 Use b4_identification.
14134 Propagate b4_pure_args where needed to pass them to yyerror.
14135 * data/glr.m4 (b4_parse_param): Remove.
14136 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
14137 (b4_lpure_formals): New.
14138 Use b4_identification.
14139 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
14140 b4_user_formals and b4_user_args.
14141 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
14142 (yyreportAmbiguity): When using a pure parser, also need
14143 the location, and the parse-params.
14145 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
14146 When using a pure parser, also need the parse-params.
14148 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
14149 (%pure-parser + %parse-param) LALR and GLR parsers.
14150 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
14151 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
14152 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
14153 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
14154 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
14155 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
14156 * doc/bison.texinfo: Untabify the whole file.
14157 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
14158 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
14159 (Error Reporting): Adjust to these new directives.
14160 Document %error-verbose, deprecate YYERROR_VERBOSE.
14162 2002-11-03 Akim Demaille <akim@epita.fr>
14164 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
14165 AT_CHECK_CALC_GLR invocations to use % directives, instead of
14166 command line options.
14167 * tests/cxx-type.at: Formatting changes.
14169 2002-11-03 Paul Eggert <eggert@twinsun.com>
14171 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
14172 to count columns correctly, and to check for invalid inputs.
14174 Use mbsnwidth to count columns correctly. Account for tabs, too.
14175 Include mbswidth.h.
14176 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
14177 (extend_location): New function.
14178 (YY_LINES): Remove.
14180 Handle CRLF in C code rather than in Lex code.
14181 (YY_INPUT): New macro.
14182 (no_cr_read): New function.
14184 Scan UCNs, even though we don't fully handle them yet.
14185 (convert_ucn_to_byte): New function.
14187 Handle backslash-newline correctly in C code.
14188 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
14189 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
14191 (tag, splice): New EREs. Do not allow NUL or newline in tags.
14192 Use {splice} wherever C allows backslash-newline.
14193 YY_STEP after space, newline, vertical-tab.
14194 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
14196 (letter, id): Don't assume ASCII; e.g., spell out a-z.
14198 ({int}, handle_action_dollar, handle_action_at): Check for integer
14201 (YY_STEP): Omit trailing semicolon, so that it's more like C.
14203 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
14204 as well as \000. Check for UCHAR_MAX, not 255.
14205 Allow \x with an arbitrary positive number of digits, as in C.
14206 Check for overflow here.
14207 Allow \? and UCNs, for compatibility with C.
14209 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
14210 with quote slot used by complain_at.
14212 * tests/input.at: Add tests for backslash-newline, m4 quotes
14213 in symbols, long literals, and funny escapes in strings.
14215 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
14216 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
14217 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
14218 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
14219 * m4/mbswidth.m4: New file, from GNU coreutils.
14221 * doc/bison.texinfo (Grammar Outline): Document // comments.
14222 (Symbols): Document that trigraphs have no special meaning in Bison,
14223 nor is backslash-newline allowed.
14224 (Actions): Document that trigraphs have no special meaning.
14226 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
14229 2002-11-02 Paul Eggert <eggert@twinsun.com>
14231 * src/reader.c: Don't include quote.h; not needed.
14232 (get_merge_function): Reword warning to be consistent with
14233 type clash diagnostic in grammar_current_rule_check.
14235 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
14236 bug in trigraph handling.
14238 * src/output.c (prepare_symbols): When printing token names,
14239 escape "[" as "@<:@" and likewise for "]".
14241 * src/system.h (errno): Remove declaration, as we are now
14242 assuming C89 or better, and C89 guarantees errno.
14244 2002-10-30 Paul Eggert <eggert@twinsun.com>
14246 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
14247 Check for close failures.
14248 * src/files.h (xfclose): Return void, not int, since it always
14250 * src/files.c (xfclose): Likewise. Report I/O error if ferror
14252 * src/output.c (output_skeleton): Use xfclose rather than fclose
14253 and ferror. xfclose now checks ferror.
14255 * data/glr.c (YYLEFTMOST_STATE): Remove.
14256 (yyreportTree): Use a stack-based leftmost state. This avoids
14257 our continuing battles with bogus warnings about initializers.
14259 2002-10-30 Akim Demaille <akim@epita.fr>
14261 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
14264 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14266 * tests/glr-regr1.at: New test for reported regressions.
14267 * tests/testsuite.at: Add glr-regr1.at test.
14268 * tests/Makefile.am: Add glr-regr1.at test.
14270 2002-10-24 Paul Eggert <eggert@twinsun.com>
14274 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
14275 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
14276 we use malloc. Don't assume 'A' through 'Z' are contiguous.
14277 Don't assume strdup exists; POSIX says its an XSI extension.
14278 Check for buffer overflow on input.
14280 2002-10-24 Akim Demaille <akim@epita.fr>
14282 * src/output.c (output_skeleton): Don't disable M4sugar comments
14283 too soon: it results in comments being expanded.
14284 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
14287 2002-10-24 Akim Demaille <akim@epita.fr>
14289 * data/yacc.c (m4_int_type): New.
14290 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
14291 char' as only yacc.c wants K&R portability.
14292 * data/glr.c (yysigned_char): Remove.
14293 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
14294 Reported by Quoc Peyrot.
14296 2002-10-23 Paul Eggert <eggert@twinsun.com>
14298 * src/main.c (main): With --trace=time, report times even if a
14299 non-fatal error occurs. Formerly, the times were reported in some
14300 such cases but not in others.
14301 * src/reader.c (reader): Just return if a complaint has been issued,
14302 instead of exiting, so that 'main' can report times.
14304 2002-10-22 Akim Demaille <akim@epita.fr>
14306 * src/system.h: Include sys/types.
14307 Reported by Bert Deknuydt.
14309 2002-10-23 Paul Eggert <eggert@twinsun.com>
14311 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
14312 Suggested by Art Haas.
14314 2002-10-22 Paul Eggert <eggert@twinsun.com>
14316 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
14317 decl; not needed any more.
14318 * src/main.c (main): Use return to exit, undoing yesterday's change.
14319 The last OS that we could find where this wouldn't work is
14320 SunOS 3.5, and that's too old to worry about now.
14322 * data/glr.c (struct yyltype): Define members even when not
14323 doing locations. This is more consistent with yacc.c, and it
14324 works around the following bug reports:
14325 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
14326 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
14328 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
14329 @acronym consistently. Standardize on "Yacc" instead of "YACC",
14330 "Algol" instead of "ALGOL". Give a bit more history about BNF.
14332 2002-10-22 Akim Demaille <akim@epita.fr>
14334 * data/README: New.
14336 2002-10-21 Paul Eggert <eggert@twinsun.com>
14338 Be consistent about 'bool'; the old code used an enum in one
14339 module and an int in another, and this violates the C standard.
14340 * m4/stdbool.m4: New file, from coreutils 4.5.3.
14341 * configure.ac (AC_HEADER_STDBOOL): Add.
14342 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
14343 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
14344 * src/symtab.c (hash_compare_symbol_t): Likewise.
14345 * src/system.h (bool, false, true): Use a definition consistent
14346 with ../lib/hash.c. All uses changed.
14348 * src/complain.c (warning_issued): Renamed from warn_message_count,
14349 so that we needn't worry about integer overflow (!).
14350 Now of type bool. All uses changed.
14351 (complaint_issued): Renamed from complain_message_count; likewise.
14353 * src/main.c (main): Use exit to exit with failure.
14355 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
14356 rather than 1 and 0.
14357 * src/main.c (main): Likewise.
14358 * src/getargs.c (getargs): Likewise.
14359 * src/reader.c (reader): Likewise.
14361 * src/getarg.c (getargs): Remove duplicate code for
14362 "Try `bison --help'".
14364 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
14365 What was that "2" for?
14367 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
14368 * src/getargs.c (usage): Likewise.
14370 * src/getargs.c (getargs): When there are too few operands, report
14371 the last one. When there are too many, report the first extra
14372 one. This is how diffutils does it.
14374 2002-10-20 Paul Eggert <eggert@twinsun.com>
14376 Remove K&R vestiges.
14377 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
14378 * src/complain.c (VA_START): Remove. Assume prototypes.
14379 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
14380 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
14381 fatal): Assume prototypes.
14382 * src/complain.h: Assume prototypes.
14383 * src/system.h (PARAMS): Remove.
14384 Include <limits.h> unconditionally, since it's guaranteeed even
14385 for a freestanding C89 compiler.
14386 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
14387 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
14389 2002-10-20 Akim Demaille <akim@epita.fr>
14391 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
14392 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
14393 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
14394 (yyresolveStates, yyresolveAction, yyresolveStack)
14395 (yyprocessOneStack): Use them.
14396 (yy_reduce_print): New.
14397 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
14399 2002-10-20 Akim Demaille <akim@epita.fr>
14401 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
14402 arguments and output `void'.
14403 (b4_c_function): Rename as...
14404 (b4_c_function_def): this.
14405 (b4_c_function_decl, b4_c_ansi_function_def)
14406 (b4_c_ansi_function_decl): New.
14407 Change the interpretation of the arguments: before `int, foo', now
14409 * data/yacc.c (yyparse): Prototype and define thanks to these.
14410 Adjust b4_c_function_def uses.
14411 * data/glr.c (yyparse): Likewise, but ANSI only.
14413 2002-10-20 Akim Demaille <akim@epita.fr>
14415 * src/output.c (prepare): Move the definition of `tokens_number',
14416 `nterms_number', `undef_token_number', `user_token_number_max'
14418 (prepare_tokens): Here.
14419 (prepare_tokens): Rename as...
14420 (prepare_symbols): this.
14421 (prepare): Move the definition of `rules_number' to...
14422 (prepare_rules): here.
14423 (prepare): Move the definition of `last', `final_state_number',
14424 `states_number' to...
14425 (prepare_states): here.
14426 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
14428 2002-10-20 Akim Demaille <akim@epita.fr>
14430 * src/tables.h, src/tables.c, src/output.c: Comment changes.
14432 2002-10-20 Akim Demaille <akim@epita.fr>
14434 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
14437 2002-10-20 Akim Demaille <akim@epita.fr>
14439 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
14440 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
14442 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
14444 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
14445 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
14448 2002-10-19 Paul Eggert <eggert@twinsun.com>
14450 Do not create a temporary file, as that involves security and
14451 cleanup headaches. Instead, use a pair of pipes.
14452 Derived from a suggestion by Florian Krohm.
14453 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
14454 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
14455 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
14456 (BISON_PREREQ_SUBPIPE): Add.
14457 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
14458 Add subpipe.h, subpipe.c.
14459 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
14460 * po/POTFILES.in: Add lib/subpipe.c.
14461 * src/output.c: Include "subpipe.h".
14462 (m4_invoke): Remove decl.
14463 (scan_skel): New decl.
14464 (output_skeleton): Use pipe rather than temporary file for m4 input.
14465 Check that m4sugar.m4 is readable, to avoid deadlock.
14466 Check for pipe I/O error.
14467 * src/scan-skel.l (readpipe): Remove decl.
14468 (scan_skel): New function, to be used in place of m4_invoke.
14469 Read from stream rather than file.
14471 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
14472 float, as this generates a warning on Solaris 8 + GCC 3.2 with
14473 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
14474 this generates a more-accurate value anyway.
14476 * lib/timevar.c (timervar_accumulate): Rename locals to
14477 avoid confusion with similarly-named more-global.
14478 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
14480 * src/output.c (prepare): Use xstrdup to convert char const *
14481 to char *, to avoid GCC warning.
14483 2002-10-19 Akim Demaille <akim@epita.fr>
14485 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
14486 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
14487 Use them to have `calc.y' ready for %pure-parser.
14488 * data/yacc.c (YYLEX): Pass a yylex return type to
14489 b4_c_function_call.
14491 2002-10-19 Akim Demaille <akim@epita.fr>
14493 Prototype support of %lex-param and %parse-param.
14495 * src/parse-gram.y: Add the definition of the %lex-param and
14496 %parse-param tokens, plus their rules.
14497 Drop the `_' version of %glr-parser.
14499 * src/scan-gram.l (INITIAL): Scan them.
14500 * src/muscle_tab.c: Comment changes.
14501 (muscle_insert, muscle_find): Rename `pair' as `probe'.
14502 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
14503 (muscle_entry_s): The `value' member is no longer const.
14504 Adjust all dependencies.
14505 * src/muscle_tab.c (muscle_init): Adjust: use
14506 MUSCLE_INSERT_STRING.
14507 Initialize the obstack earlier.
14508 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
14509 (muscle_pair_list_grow): New.
14510 * data/c.m4 (b4_c_function_call, b4_c_args): New.
14511 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
14512 * tests/calc.at: Use %locations, not --locations.
14513 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
14515 2002-10-19 Akim Demaille <akim@epita.fr>
14517 * src/getargs.c (usage): Take status as argument and exit
14519 Report the traditional `Try ... --help' message when status != 0.
14520 (usage, version): Don't take a FILE * as arg, it is pointless.
14521 (getargs): When there is an incorrect number of arguments, make it
14522 an error, and report it GNUlically thanks to `usage ()'.
14524 2002-10-18 Paul Eggert <eggert@twinsun.com>
14526 * data/glr.c (yyreportParseError): Don't assume that sprintf
14527 yields the length of the printed string, as this is not true
14528 on SunOS 4.1.4. Reported by Peter Klein.
14530 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
14531 * tests/conflicts.at (%nonassoc and eof): Likewise.
14532 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
14534 2002-10-17 Akim Demaille <akim@epita.fr>
14536 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
14537 * src/getargs.c (trace_types, trace_args): Adjust.
14538 * src/reader.c (grammar_current_rule_prec_set)
14539 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
14540 Standardize error messages.
14541 And s/@prec/%prec/!
14542 (reader): Use trace_flag to enable scanner/parser debugging,
14543 instead of an adhoc scheme.
14544 * src/scan-gram.l: Remove trailing debugging code.
14546 2002-10-16 Paul Eggert <eggert@twinsun.com>
14548 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
14551 * NEWS: Officially drop support for building Bison with K&R C,
14552 since it didn't work anyway and it's not worth worrying about.
14553 * Makefile.maint (wget_files): Remove ansi2knr.c.
14554 (ansi2knr.c-url_prefix): Remove.
14555 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
14556 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14557 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14559 2002-10-15 Paul Eggert <eggert@twinsun.com>
14561 Stop using the "enum_" trick for K&R-style function definitions;
14562 it confused me, and I was the author! Instead, assume that people
14563 who want to use K&R C compilers (when using these modules in GCC,
14564 perhaps?) will run ansi2knr.
14566 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
14567 All uses of "enum_" changed to "enum ".
14568 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
14569 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
14571 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
14572 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
14573 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
14574 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
14575 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
14576 abitset_not, abitset_ones, abitset_or, abitset_or_and,
14577 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
14578 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
14579 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
14580 Use function prototypes; this removes the need for declaring
14581 static functions simply to provide their prototypes.
14582 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
14583 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
14584 bitset_count_, bitset_create, bitset_dump, bitset_first,
14585 bitset_free, bitset_init, bitset_last, bitset_next,
14586 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
14587 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
14588 bitset_print, bitset_release_memory, bitset_toggle_,
14589 bitset_type_choose, bitset_type_get, bitset_type_name_get,
14590 debug_bitset): Likewise.
14591 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
14592 * lib/bitset_stats.c (bitset_log_histogram_print,
14593 bitset_percent_histogram_print, bitset_stats_and,
14594 bitset_stats_and_cmp, bitset_stats_and_or,
14595 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
14596 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
14597 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
14598 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
14599 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
14600 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
14601 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
14602 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
14603 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
14604 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
14605 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
14606 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
14607 bitset_stats_zero): Likewise.
14608 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
14609 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
14610 bitsetv_dump, debug_bitsetv): Likewise.
14611 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
14612 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
14613 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
14614 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
14615 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
14616 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
14617 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
14618 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
14619 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
14620 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
14621 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
14623 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
14624 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
14625 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
14626 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
14627 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
14628 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
14629 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
14630 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
14631 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
14632 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
14633 lbitset_xor_cmp, lbitset_zero): Likewise.
14635 2002-10-14 Akim Demaille <akim@epita.fr>
14639 2002-10-14 Akim Demaille <akim@epita.fr>
14641 * tests/Makefile.am (maintainer-check-posix): New.
14643 2002-10-14 Akim Demaille <akim@epita.fr>
14645 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
14648 2002-10-14 Akim Demaille <akim@epita.fr>
14650 * src/tables.c (table_ninf_remap): base -> tab.
14651 Reported by Matt Rosing.
14653 2002-10-14 Paul Eggert <eggert@twinsun.com>
14655 * tests/action.at, tests/calc.at, tests/conflicts.at,
14656 tests/cxx-type.at, tests/headers.at, tests/input.at,
14657 tests/regression.at, tests/synclines.at, tests/torture.at:
14658 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
14659 so that the tests still work even if POSIXLY_CORRECT is set.
14660 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
14662 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
14663 for portability to K&R hosts. Fix typo: signed char is guaranteed
14664 only to 127, not to 128.
14665 * data/glr.c (yysigned_char): New type.
14666 * data/yacc.c (yysigned_char): Likewise.
14667 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
14669 2002-10-13 Paul Eggert <eggert@twinsun.com>
14671 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
14672 true due to limited range of data type" warning from GCC.
14674 * data/c.m4 (b4_token_defines): Protect against double-inclusion
14675 by wrapping enum yytokentype's definition inside #ifndef
14676 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
14678 2002-10-13 Akim Demaille <akim@epita.fr>
14680 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
14681 Un yy- yyrhs to avoid the name clash with the global YYRHS.
14683 2002-10-13 Akim Demaille <akim@epita.fr>
14685 * Makefile.maint: Update from Autoconf 2.54.
14686 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
14688 2002-10-13 Akim Demaille <akim@epita.fr>
14690 * src/print.c (print_state): Separate the list of solved conflicts
14691 from the other items.
14692 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
14694 2002-10-13 Akim Demaille <akim@epita.fr>
14696 Let nondeterministic skeletons be usable with deterministic
14699 With the patch, GAWK compiled by GCC without -O2 passes its test
14700 suite using a GLR parser driven by LALR tables. It fails with -O2
14701 because `struct stat' gives two different answers on my machine:
14702 88 (definition of an auto var) and later 96 (memset on this var).
14703 Hence the stack is badly corrumpted. The headers inclusion is to
14704 blame: if I move the awk.h inclusion before GLR's system header
14705 inclusion, the two struct stat have the same size.
14707 * src/tables.c (pack_table): Always create conflict_table.
14708 (token_actions): Always create conflict_list.
14709 * data/glr.c (YYFLAG): Remove, unused.
14711 2002-10-13 Akim Demaille <akim@epita.fr>
14713 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
14715 (VALGRIND, GXX): New.
14716 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
14717 * tests/bison.in: Run $PREBISON a pre-command.
14718 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
14719 (maintainer-check-g++): New.
14720 * Makefile.am (maintainer-check): New.
14722 2002-10-13 Akim Demaille <akim@epita.fr>
14724 * data/glr.c: Formatting changes.
14725 Tweak some trace messages to match yacc.c's.
14727 2002-10-13 Akim Demaille <akim@epita.fr>
14729 GLR parsers sometimes raise parse errors instead of performing the
14731 Reported by Charles-Henry de Boysson.
14733 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
14734 check the length of the traces when %glr.
14735 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
14737 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
14739 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
14740 (yyltype): Remove the yy prefix from the member names.
14741 (yytable): Complete its comment.
14742 (yygetLRActions): Map error action number from YYTABLE from
14744 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
14745 (which was a bug: it should have been YYTABEL_NINF, and yet it was
14746 not satisfying as we could compare an YYACTION computed from
14747 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
14748 only value for error actions.
14749 (yyreportParseError): In verbose parse error messages, don't issue
14750 `error' in the list of expected tokens.
14751 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
14752 next action to perform to match glr.c's decoding.
14753 (yytable): Complete its comment.
14755 2002-10-13 Paul Eggert <eggert@twinsun.com>
14757 Fix problem reported by Henrik Grubbstroem in
14758 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
14759 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
14760 because the Bison parser reads the second action before reducing
14762 * src/scan-gram.l (rule_length): New static var.
14763 Use it to keep track of the rule length in the scanner, since
14764 we can't expect the parser to be in lock-step sync with the scanner.
14765 (handle_action_dollar, handle_action_at): Use this var.
14766 * tests/actions.at (Exotic Dollars): Test for the problem.
14768 2002-10-12 Paul Eggert <eggert@twinsun.com>
14770 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
14771 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
14772 Include <sys/time.h> when checking for clock_t and struct tms.
14773 Use same include order as source.
14774 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
14775 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
14777 * lib/timevar.c: Update copyright date and clarify comments.
14778 (get_time) [IN_GCC]: Keep the GCC version for reference.
14780 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
14781 GCC version as of today, then merge Bison's changes.
14782 Change "GCC" to "Bison" in copyright notice. timevar.def's
14783 author is Akim, so change that too.
14785 * src/reader.c (grammar_current_rule_check):
14786 Don't worry about the default action if $$ is untyped.
14787 Prevents bogus warnings reported by Jim Gifford in
14788 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
14790 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
14791 * data/glr.c, data/lalr1.cc, data/yacc.c:
14792 Output token definitions before the first part of user declarations.
14793 Fixes compatibility problem reported by Jim Gifford for kbd in
14794 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14796 2002-10-11 Paul Eggert <eggert@twinsun.com>
14798 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
14799 (yyparse): here. This undoes some of the 2002-07-25 change.
14800 Compatibility problem reported by Ralf S. Engelschall with
14801 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
14803 2002-10-11 Akim Demaille <akim@epita.fr>
14805 * tests/regression.at Characters Escapes): New.
14806 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
14808 Reported by Jan Nieuwenhuizen.
14810 2002-10-11 Akim Demaille <akim@epita.fr>
14814 2002-10-10 Paul Eggert <eggert@twinsun.com>
14816 Portability fixes for bitsets; this also avoids several GCC
14819 * lib/abitset.c: Include <stddef.h>, for offsetof.
14820 * lib/lbitset.c: Likewise.
14822 * lib/abitset.c (abitset_bytes): Return a size that is aligned
14823 properly for vectors of objects. Do not assume that adding a
14824 header size to a multiple of a word size yields a value that is
14825 properly aligned for the whole union.
14826 * lib/bitsetv.c (bitsetv_alloc): Likewise.
14828 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
14829 unique names for structures.
14830 * lib/ebitset.c (ebitset_bytes): Likewise.
14831 * lib/lbitset.c (lbitset_bytes): Likewise.
14833 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
14834 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
14835 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
14836 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
14837 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
14838 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
14839 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
14840 to improve the type-checking that GCC can do.
14841 * lib/bitset.c (bitset_op4_cmp): Likewise.
14842 * lib/bitset_stats.c (bitset_stats_count,
14843 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
14844 bitset_stats_copy, bitset_stats_disjoint_p,
14845 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
14846 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
14847 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
14848 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
14849 bitset_stats_and_or_cmp, bitset_stats_andn_or,
14850 bitset_stats_andn_or_cmp, bitset_stats_or_and,
14851 bitset_stats_or_and_cmp): Likewise.
14852 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
14853 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
14854 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
14855 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
14857 * lib/abitset.h: Include bitset.h, not bbitset.h.
14858 * lib/ebitset.h: Likewise.
14859 * lib/lbitset.h: Likewise.
14861 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
14862 All instances of parameters of type enum bitset_opts are now of
14863 type enum_bitset_opts, to conform to the C Standard, and similarly
14864 for enum_bitset_type.
14865 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
14866 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
14868 Do not use "struct bitset_struct" to mean different things in
14869 different modules. Not only is this confusing, it violates
14870 the C Standard, which requires that structure types in different
14871 modules must be compatible if one is to be passed to the other.
14872 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
14873 All instances of "struct bitset_struct *" replaced with "bitset".
14874 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
14875 (union bitset_union, struct abitset_struct, struct ebitset_struct,
14876 struct lbitset_struct, struct bitset_stats_struct): New types.
14877 All uses of struct bitset_struct changed to union bitset_union,
14879 * lib/abitset.c (struct abitset_struct, abitset,
14880 struct bitset_struct): Remove.
14881 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
14882 struct bitset_struct): Remove.
14883 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
14884 bitset_struct): Remove.
14885 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
14888 Do not call a function of type T using a call that assumes the
14889 function is of a different type U. Standard C requires that a
14890 function must be called with a type that is compatible with its
14892 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
14894 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
14896 * lib/ebitset.c (PFV): Remove.
14897 * lib/lbitset.c (PFV): Likewise.
14898 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
14899 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
14901 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
14902 (ebitset_vtable): Use them.
14903 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
14904 lbitset_xor): New functions.
14905 (lbitset_vtable): Use them.
14907 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
14910 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
14912 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
14913 Use offsetof, for simplicity.
14915 2002-10-06 Paul Eggert <eggert@twinsun.com>
14917 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
14918 the same width as int. This reapplies a hunk of the 2002-08-12 patch
14919 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
14920 which was inadvertently undone by the 2002-09-30 patch.
14921 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
14922 the same width as int.
14924 2002-10-04 Paul Eggert <eggert@twinsun.com>
14928 * configure.ac (AC_INIT), NEWS: Increment version number.
14930 * doc/bison.texinfo: Minor spelling, grammar, and white space
14932 (Symbols): Mention that any negative value returned from yylex
14933 signifies end-of-input. Warn about negative chars. Mention
14934 the portable Standard C character set.
14936 The GNU coding standard says CFLAGS and YFLAGS are reserved
14937 for the installer to set.
14938 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
14939 * src/Makefile.am (AM_CFLAGS): Likewise.
14940 (AM_YFLAGS): Renamed from YFLAGS.
14942 Fix some MAX and MIN problems.
14943 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
14944 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
14945 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
14946 * src/reader.c (reader): Use it.
14948 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
14949 POSIX 1003.1-2001 has removed fgrep.
14951 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
14953 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
14954 interpreted as signed.
14955 * lib/ebitset.c (ebitset_list): Fix bug.
14957 2002-10-01 Paul Eggert <eggert@twinsun.com>
14959 More fixes for 64-bit hosts and large bitsets.
14961 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
14962 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
14963 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
14964 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
14965 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
14966 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
14967 bitset_count_): Likewise.
14968 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
14969 bitset_first, bitset_last): Likewise.
14970 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
14971 bitset_stats_list_reverse, bitset_stats_size,
14972 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
14974 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14975 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
14976 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
14977 bitsetv_reflexive_transitive_closure): Likewise.
14978 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
14979 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
14981 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
14984 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
14985 Use size_t, not unsigned int, to count bytes.
14986 * lib/abitset.h (abitset_bytes): Likewise.
14987 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
14989 * lib/bitset.h (bitset_bytes): Likewise.
14990 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
14991 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
14992 * lib/bitsetv.c (bitsetv_alloc): Likewise.
14993 * lib/ebitset.c (ebitset_bytes): Likewise.
14994 * lib/ebitset.h (ebitset_bytes): Likewise.
14995 * lib/lbitset.c (lbitset_bytes): Likewise.
14996 * lib/lbitset.h (lbitset_bytes): Likewise.
14998 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
14999 abitset_subset_p, abitset_disjoint_p, abitset_and,
15000 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
15001 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
15002 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
15003 abitset_or_and, abitset_or_and_cmp):
15004 Use bitset_windex instead of unsigned int.
15005 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15006 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
15007 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
15008 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
15010 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
15012 * lib/bitset.c (bitset_print):
15013 Use proper printf formats for widths of integer types.
15014 * lib/bitset_stats.c (bitset_percent_histogram_print,
15015 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
15016 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15017 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15018 * lib/lbitset.c (lbitset_bytes): Likewise.
15020 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
15021 BITSET_SIZE_MAX): New macros.
15022 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
15023 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
15024 to BITSET_WINDEX_MAX.
15026 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
15027 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
15028 since we now return the bitset_bindex type (not int).
15030 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
15031 when computing sizes.
15032 * lib/ebitset.c (ebitset_elts_grow): Likewise.
15034 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
15035 and avoid cast to unsigned.
15037 2002-09-30 Akim Demaille <akim@epita.fr>
15039 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
15040 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
15041 Updates from Michael Hayes.
15043 2002-09-30 Art Haas <ahaas@neosoft.com>
15045 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
15047 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
15050 2002-09-27 Akim Demaille <akim@epita.fr>
15054 2002-09-27 Akim Demaille <akim@epita.fr>
15056 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
15057 (Because of AC_LIBSOURCE).
15059 2002-09-27 Akim Demaille <akim@epita.fr>
15061 Playing with Autoscan.
15063 * configure.ac: Remove the old LIBOBJ tweaks.
15064 (AC_REPLACE_FUNCS): Add strrchr and strtol.
15065 * lib/strrchr.c: New.
15066 * lib/strtol.c: New, from the Coreutils 4.5.1.
15068 2002-09-27 Akim Demaille <akim@epita.fr>
15070 Playing with Autoscan.
15072 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
15073 * lib/Makefile.am (libbison_a_SOURCES): No longer include
15074 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
15075 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
15078 2002-09-24 Akim Demaille <akim@epita.fr>
15080 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
15081 (Frequently Asked Questions, Parser Stack Overflow): New.
15083 2002-09-13 Akim Demaille <akim@epita.fr>
15085 Playing with autoscan.
15087 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
15088 * src/files.c (skeleton_find): Remove, unused.
15089 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
15090 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
15092 2002-09-13 Akim Demaille <akim@epita.fr>
15094 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
15095 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
15097 2002-09-13 Akim Demaille <akim@epita.fr>
15099 * configure.ac: Require 2.54.
15100 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
15101 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
15102 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
15103 Remove, provided by Autoconf macros.
15105 2002-09-12 Akim Demaille <akim@epita.fr>
15107 * m4/prereq.m4: Update, from Coreutils 4.5.1.
15109 2002-09-12 Akim Demaille <akim@epita.fr>
15111 * m4/prereq.m4: Update, from Fileutils 4.1.5.
15112 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
15113 Reported by Martin Mokrejs.
15115 2002-09-10 Akim Demaille <akim@epita.fr>
15117 * src/parse-gram.y: Associate a human readable string to each
15119 * tests/regression.at (Invalid inputs): Adjust.
15121 2002-09-10 Gary V. Vaughan <gary@gnu.org>
15123 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
15124 with an Autoconf-2.5x style configure.ac.
15126 2002-09-06 Paul Eggert <eggert@twinsun.com>
15128 * doc/bison.texinfo (Conditions): Make explicit that the GPL
15129 exception applies only to yacc.c. This is a modification of a
15130 patch originally suggested by Akim Demaille.
15132 2002-09-06 Akim Demaille <akim@epita.fr>
15134 * data/c.m4 (b4_copyright): Move the GPL exception comment from
15136 * data/yacc.c: here.
15138 * data/lalr1.cc (struct yyltype): Don't define it, since we use
15140 (b4_ltype): Default to yy::Location from location.hh.
15142 2002-09-04 Jim Meyering <jim@meyering.net>
15144 * data/yacc.c: Guard the declaration of yytoknum also with
15145 `#ifdef YYPRINT', so it is declared only when used.
15147 2002-09-04 Akim Demaille <akim@epita.fr>
15149 * configure.in: Rename as...
15150 * configure.ac: this.
15153 2002-09-04 Akim Demaille <akim@epita.fr>
15155 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
15156 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
15157 translate maintainer only messages.
15159 2002-08-12 Paul Eggert <eggert@twinsun.com>
15163 * Makefile.am (SUBDIRS): Remove intl.
15164 (DISTCLEANFILES): Remove.
15165 * NEWS: Mention that GNU M4 is now required. Clarify what is
15166 meant by "larger grammars". Mention the pt_BR translation.
15167 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
15168 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
15169 Bump version from 0.11.2 to 0.11.5.
15170 (BISON_PREREQ_STAGE): Remove.
15171 (AM_GNU_GETTEXT): Use external gettext.
15172 (AC_OUTPUT): Remove intl/Makefile.
15174 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
15176 * data/glr.c: Include string.h, for strlen.
15177 (yyreportParseError): Use size_t for yysize.
15178 (yy_yypstack): No longer nested inside yypstates, as nested
15179 functions are not portable. Do not assume size_t is the
15181 (yypstates): Do not assume that ptrdiff_t is the same width
15182 as int, and similarly for yyposn and YYINDEX.
15184 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
15186 * lib/Makefile.am (INCLUDES): Do not include from the intl
15187 directory, which has been removed.
15188 * src/Makefile.am (INCLUDES): Likewise.
15190 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
15191 (bitsets_sources, additional_bitsets_sources, timevars_sources):
15194 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
15195 * tests/Makefile.am (EXTRA_DIST): Likewise.
15197 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
15198 Do not assume that bitset_windex is the same width as unsigned.
15200 * lib/abitset.c (abitset_unused_clear): Do not assume that
15201 bitset_word is the same width as int.
15202 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
15203 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
15204 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
15205 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
15206 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
15208 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
15209 portability to one's complement hosts!).
15210 * lib/ebitset.c (ebitset_op1): Likewise.
15211 * lib/lbitset.c (lbitset_op1): Likewise.
15213 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
15214 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
15215 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
15216 Sync with fileutils.
15217 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
15218 lib/gettext.h: Sync with diffutils.
15220 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
15221 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
15223 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
15224 PROTOTYPES to check for prototypes, and "defined __STDC__" to
15227 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
15228 size_t; the old version tried to do this but casted improperly.
15229 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
15230 (bitset_test): Now returns int, not unsigned long.
15232 * lib/bitset_stats.c: Include "gettext.h".
15234 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
15235 name locals "index", as it generates unnecessary warnings on some
15236 hosts that have an "index" function.
15238 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
15239 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
15240 they need translation.
15241 * src/LR0.c (state_list_append, new_itemsets, get_state,
15242 append_states, generate_states): Likewise.
15243 * src/assoc.c (assoc_to_string): Likewise.
15244 * src/closure.c (print_closure, set_firsts, closure): Likewise.
15245 * src/gram.c (grammar_dump): Likewise.
15246 * src/injections.c (injections_compute): Likewise.
15247 * src/lalr.c (lookaheads_print): Likewise.
15248 * src/relation.c (relation_transpose): Likewise.
15249 * src/scan-gram.l: Likewise.
15250 * src/tables.c (table_grow, pack_vector): Likewise.
15252 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
15253 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
15254 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
15255 * m4/mbstate_t.m4: Sync with fileutils.
15256 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
15258 * po/LINGUAS: Add pt_BR.
15259 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
15260 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
15262 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
15264 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
15266 * src/complain.c (strerror_r): Remove decl; not needed.
15267 (strerror): Use same pattern as ../lib/error.c.
15269 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
15271 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
15273 * src/main.c (main): Cast result of bindtextdomain and textdomain
15274 to void, to avoid a GCC warning when --disable-nls is in effect.
15276 * src/scan-gram.l: Use strings rather than escapes when possible,
15277 to minimize the number of warnings from xgettext.
15278 (handle_action_dollar, handle_action_at): Don't use isdigit,
15279 as it mishandles negative chars and it may not work as expected
15280 outside the C locale.
15282 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
15283 this is a GCC extension and is not portable to other compilers.
15285 * src/system.h (alloca): Use same pattern as ../lib/error.c.
15286 Do not include <ctype.h>; no longer needed.
15287 Do not include <malloc.h>; no longer needed (and generates
15288 warnings on OpenBSD 3.0).
15290 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
15293 * tests/regression.at: Do not use 'cc -c input.c -o input';
15294 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
15296 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
15297 exit status as failure, not just exit status 1. Sun C exits
15298 with status 2 sometimes.
15300 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
15301 Use it for the two large tests.
15303 2002-08-02 Akim Demaille <akim@epita.fr>
15305 * src/conflicts.c (conflicts_output): Don't output rules never
15306 reduced here, since anyway that computation doesn't work.
15307 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
15308 (rule_useless_p, rule_never_reduced_p): New.
15309 (grammar_rules_partial_print): Use a filter instead of a range.
15310 Display the title only if needed.
15311 (grammar_rules_print): Adjust.
15312 (grammar_rules_never_reduced_report): New.
15313 * src/tables.c (action_row): Move the computation of rules never
15315 (token_actions): here.
15316 * src/main.c (main): Make the parser before making the report, so
15317 that rules never reduced are computed.
15318 Call grammar_rules_never_reduced_report.
15319 * src/print.c (print_results): Report rules never reduced.
15320 * tests/conflicts.at, tests/reduce.at: Adjust.
15322 2002-08-01 Akim Demaille <akim@epita.fr>
15324 Instead of attaching lookaheads and duplicating the rules being
15325 reduced by a state, attach the lookaheads to the reductions.
15327 * src/state.h (state_t): Remove the `lookaheads',
15328 `lookaheads_rule' member.
15329 (reductions_t): Add a `lookaheads' member.
15330 Use a regular array for the `rules'.
15331 * src/state.c (reductions_new): Initialize the lookaheads member
15333 (state_rule_lookaheads_print): Adjust.
15334 * src/state.h, src/state.c (state_reductions_find): New.
15335 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
15336 (count_rr_conflicts): Adjust.
15337 * src/lalr.c (LArule): Remove.
15338 (add_lookback_edge): Adjust.
15339 (state_lookaheads_count): New.
15340 (states_lookaheads_initialize): Merge into...
15341 (initialize_LA): this.
15342 (lalr_free): Adjust.
15343 * src/main.c (main): Don't free nullable and derives too early: it
15344 is used by --verbose.
15345 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
15347 2002-08-01 Akim Demaille <akim@epita.fr>
15349 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
15351 (set_derives, free_derives): Rename as...
15352 (derives_compute, derives_free): this.
15353 Adjust all dependencies.
15354 * src/nullable.c (set_nullable, free_nullable): Rename as...
15355 (nullable_compute, nullable_free): these.
15356 (rule_list_t): Store rule_t *, not rule_number_t.
15357 * src/state.c (state_rule_lookaheads_print): Directly compare rule
15358 pointers, instead of their numbers.
15359 * src/main.c (main): Call nullable_free, and derives_free earlier,
15360 as they were lo longer used.
15362 2002-08-01 Akim Demaille <akim@epita.fr>
15364 * lib/timevar.c (get_time): Include children time.
15365 * src/lalr.h (LA, LArule): Don't export them: used with the
15367 * src/lalr.c (LA, LArule): Static.
15368 * src/lalr.h, src/lalr.c (lalr_free): New.
15369 * src/main.c (main): Call it.
15370 * src/tables.c (pack_vector): Check whether loc is >= to the
15372 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
15373 (tables_generate): do it, since that's also it which allocates
15375 Don't free LA and LArule, main does.
15377 2002-07-31 Akim Demaille <akim@epita.fr>
15379 Separate parser tables computation and output.
15381 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
15382 (conflict_list, conflict_list_cnt, table, check, table_ninf)
15383 (yydefgoto, yydefact, high): Move to...
15384 * src/tables.h, src/tables.c: here.
15385 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
15386 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
15387 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
15388 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
15389 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
15390 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
15391 (action_row, save_row, token_actions, save_column, default_goto)
15392 (goto_actions, sort_actions, matching_state, pack_vector)
15393 (table_ninf_remap, pack_table, prepare_actions): Move to...
15394 * src/tables.c: here.
15395 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
15396 * src/output.c (token_actions, output_base, output_conflicts)
15397 (output_check): Merge into...
15398 (prepare_actions): this.
15399 (actions_output): Rename as...
15400 (user_actions_output): this.
15401 * src/main.c (main): Call tables_generate and tables_free.
15403 2002-07-31 Akim Demaille <akim@epita.fr>
15405 Steal GCC's --time-report support.
15407 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
15408 stolen/adjusted from GCC.
15409 * m4/stage.m4: Remove time related checks.
15410 * m4/timevar.m4: New.
15411 * configure.in: Adjust.
15412 * src/system.h: Adjust to using timevar.h.
15413 * src/getargs.h, src/getargs.c: Support trace_time for
15415 * src/main.c (stage): Remove.
15416 (main): Replace `stage' invocations with timevar calls.
15417 * src/output.c: Insert pertinent timevar calls.
15419 2002-07-31 Akim Demaille <akim@epita.fr>
15421 Let --trace have arguments.
15423 * src/getargs.h (enum trace_e): New.
15424 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
15425 (long_options, short_options): --trace/-T takes an optional
15427 Change all the uses of trace_flag to reflect the new flags.
15428 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
15430 Strengthen `stage' portability.
15432 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
15433 * configure.in: Use it.
15434 Don't check for malloc.h and sys/times.h.
15435 * src/system.h: Include them when appropriate.
15436 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
15437 times and struct tms are available.
15439 2002-07-30 Akim Demaille <akim@epita.fr>
15441 In verbose parse error message, don't report `error' as an
15443 * tests/actions.at (Printers and Destructors): Adjust.
15444 * tests/calc.at (Calculator $1): Adjust.
15445 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
15446 error message, do not report the parser accepts the error token in
15449 2002-07-30 Akim Demaille <akim@epita.fr>
15451 Normalize conflict related messages.
15453 * src/complain.h, src/complain.c (warn, complain): New.
15454 * src/conflicts.c (conflicts_print): Use them.
15455 (conflict_report_yacc): New, extracted from...
15456 (conflicts_print): here.
15457 * tests/conflicts.at, tests/existing.at: Adjust.
15459 2002-07-30 Akim Demaille <akim@epita.fr>
15461 Report rules which are never reduced by the parser: those hidden
15464 * src/LR0.c (save_reductions): Don't make the final state too
15465 different: save its reduction (accept) instead of having a state
15466 without any action (no shift or goto, no reduce).
15467 Note: the final state is now a ``regular'' state, i.e., the
15468 parsers now contain `reduce 0' as default reduction.
15469 Nevertheless, since they decide to `accept' when yystate =
15470 final_state, they still will not reduce rule 0.
15471 * src/print.c (print_actions, print_reduction): Adjust.
15472 * src/output.c (action_row): Track reduced rules.
15473 (token_actions): Report rules never reduced.
15474 * tests/conflicts.at, tests/regression.at: Adjust.
15476 2002-07-30 Akim Demaille <akim@epita.fr>
15478 `stage' was accidently included in a previous patch.
15479 Initiate its autoconfiscation.
15481 * configure.in: Look for malloc.h and sys/times.h.
15482 * src/main.c (stage): Adjust.
15483 Report only when trace_flag.
15485 2002-07-29 Akim Demaille <akim@epita.fr>
15487 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
15489 (errs_t): symbol_t*, not symbol_number_t.
15490 (reductions_t): rule_t*, not rule_number_t.
15491 (FOR_EACH_SHIFT): New.
15492 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
15493 * src/print.c, src/print_graph.c: Adjust.
15495 2002-07-29 Akim Demaille <akim@epita.fr>
15497 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
15499 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
15500 (endtoken, accept): these.
15501 * src/reader.c (reader): Set endtoken's default tag to "$end".
15502 Set undeftoken's tag to "$undefined" instead of "$undefined.".
15503 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
15506 2002-07-29 Akim Demaille <akim@epita.fr>
15508 * src/reduce.c (reduce_grammar): When the language is empty,
15509 complain about the start symbol, not the axiom.
15511 * tests/reduce.at (Empty Language): New.
15513 2002-07-26 Akim Demaille <akim@epita.fr>
15515 * src/reader.h, src/reader.c (gram_error): ... can't get
15516 yycontrol without making too strong assumptions on the parser
15518 * src/output.c (prepare_tokens): Use the real 0th value of
15519 token_translations instead of `0'.
15520 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
15522 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
15523 for the time being: %locations ought to provide it to yyerror.
15525 2002-07-25 Akim Demaille <akim@epita.fr>
15527 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
15528 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
15529 * tests/regression.at (Web2c Actions): Adjust.
15531 2002-07-25 Akim Demaille <akim@epita.fr>
15533 Stop storing rules from 1 to nrules + 1.
15535 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
15536 * src/nullable.c, src/output.c, src/print.c, src/reader.c
15537 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
15538 Iterate from 0 to nrules.
15539 Use rule_number_as_item_number and item_number_as_rule_number.
15540 Adjust to `derive' now containing possibly 0.
15541 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
15542 Handle the `- 1' part in rule numbers from/to item numbers.
15543 * src/conflicts.c (log_resolution): Fix the message which reversed
15545 * src/output.c (action_row): Initialize default_rule to -1.
15546 (token_actions): Adjust.
15547 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
15549 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
15551 2002-07-25 Akim Demaille <akim@epita.fr>
15553 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
15554 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
15555 (b4_c_knr_arg_decl): New.
15556 * data/yacc.c: Use it to define yysymprint, yydestruct, and
15557 yyreport_parse_error.
15559 2002-07-25 Akim Demaille <akim@epita.fr>
15561 * data/yacc.c (yyreport_parse_error): New, extracted from...
15563 (yydestruct, yysymprint): Move above yyparse.
15566 2002-07-25 Akim Demaille <akim@epita.fr>
15568 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
15570 (b4_sint_type, b4_uint_type): these.
15571 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
15572 * tests/regression.at (Web2c Actions): Adjust.
15574 2002-07-25 Akim Demaille <akim@epita.fr>
15576 * src/gram.h (TIEM_NUMBER_MAX): New.
15577 (item_number_of_rule_number, rule_number_of_item_number): Rename
15579 (rule_number_as_item_number, item_number_as_rule_number): these.
15580 Adjust dependencies.
15581 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
15582 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
15583 (symbol_number_to_vector_number): New.
15584 (order): Of vector_number_t* type.
15585 (base_t, BASE_MAX, BASE_MIN): New.
15586 (froms, tos, width, pos, check): Of base_t type.
15587 (action_number_t, ACTION_MIN, ACTION_MAX): New.
15588 (actrow): Of action_number_t type.
15589 (conflrow): Of unsigned int type.
15590 (table_ninf, base_ninf): New.
15591 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
15592 (muscle_insert_int_table, muscle_insert_base_table)
15593 (muscle_insert_rule_number_table): New.
15594 (prepare_tokens): Output `toknum' as int_table.
15595 (action_row): Returns a rule_number_t.
15596 Use ACTION_MIN, not SHRT_MIN.
15597 (token_actions): yydefact is rule_number_t*.
15598 (table_ninf_remap): New.
15599 (pack_table): Use it for `base' and `table'.
15600 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
15602 (YYPACT_NINF, YYTABLE_NINF): these.
15603 (yypact, yytable): Compute their types instead of hard-coded
15605 * tests/regression.at (Web2c Actions): Adjust.
15607 2002-07-19 Akim Demaille <akim@epita.fr>
15609 * src/scan-gram.l (id): Can start with an underscore.
15611 2002-07-16 Akim Demaille <akim@epita.fr>
15613 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
15614 Adjust all former `associativity' dependencies.
15615 * src/symtab.c (symbol_new): Default associativity is `undef', not
15617 (symbol_check_alias_consistence): Adjust.
15619 2002-07-09 Akim Demaille <akim@epita.fr>
15621 * doc/bison.texinfo: Properly set the ``header'' part.
15622 Use @dircategory ``GNU programming tools'' as per Texinfo's
15626 2002-07-09 Akim Demaille <akim@epita.fr>
15628 * lib/quotearg.h: Protect against multiple inclusions.
15629 * src/location.h (location_t): Add a `file' member.
15630 (LOCATION_RESET, LOCATION_PRINT): Adjust.
15631 * src/complain.c (warn_at, complain_at, fatal_at): Drop
15632 `error_one_per_line' support.
15634 2002-07-09 Akim Demaille <akim@epita.fr>
15636 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
15637 * src/reader.c (lineno): Remove.
15638 Adjust all dependencies.
15639 (get_merge_function): Take a location and use complain_at.
15640 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
15641 * tests/regression.at (Invalid inputs, Mixing %token styles):
15644 2002-07-09 Akim Demaille <akim@epita.fr>
15646 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
15647 recovery rule, and forbid extensions when --yacc.
15648 (gram_error): Use complain_at.
15649 * src/reader.c (reader): Exit if there were parse errors.
15651 2002-07-09 Akim Demaille <akim@epita.fr>
15653 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
15654 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
15655 Reported by R Blake <blakers@mac.com>.
15657 2002-07-09 Akim Demaille <akim@epita.fr>
15659 * data/yacc.c: Output the copyright notive in the header.
15661 2002-07-03 Akim Demaille <akim@epita.fr>
15663 * src/output.c (froms, tos): Are state_number_t.
15664 (save_column): sp, sp1, and sp2 are state_number_t.
15665 (prepare): Rename `final' as `final_state_number', `nnts' as
15666 `nterms_number', `nrules' as `rules_number', `nstates' as
15667 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
15669 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
15670 * data/lalr1.cc (nsym_): Remove, unused.
15672 2002-07-03 Akim Demaille <akim@epita.fr>
15674 * src/lalr.h, src/lalr.c (goto_number_t): New.
15675 * src/lalr.c (goto_list_t): New.
15677 * src/nullable.c (rule_list_t): New.
15679 * src/types.h: Remove.
15681 2002-07-03 Akim Demaille <akim@epita.fr>
15683 * src/closure.c (print_fderives): Use rule_rhs_print.
15684 * src/derives.c (print_derives): Use rule_rhs_print.
15685 (rule_list_t): New, replaces `shorts'.
15686 (set_derives): Add comments.
15687 * tests/sets.at (Nullable, Firsts): Adjust.
15689 2002-07-03 Akim Demaille <akim@epita.fr>
15691 * src/output.c (prepare_actions): Free `tally' and `width'.
15692 (prepare_actions): Allocate and free `order'.
15693 * src/symtab.c (symbols_free): Free `symbols'.
15694 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
15695 * src/output.c (m4_invoke): Move to...
15696 * src/scan-skel.l: here.
15697 (<<EOF>>): Close yyout, and free its name.
15699 2002-07-03 Akim Demaille <akim@epita.fr>
15701 Fix some memory leaks, and fix a bug: state 0 was examined twice.
15703 * src/LR0.c (new_state): Merge into...
15704 (state_list_append): this.
15705 (new_states): Merge into...
15706 (generate_states): here.
15707 (set_states): Don't ensure a proper `errs' state member here, do it...
15708 * src/conflicts.c (conflicts_solve): here.
15709 * src/state.h, src/state.c: Comment changes.
15710 (state_t): Rename member `shifts' as `transitions'.
15711 Adjust all dependencies.
15712 (errs_new): For consistency, also take the values as argument.
15713 (errs_dup): Remove.
15714 (state_errs_set): New.
15715 (state_reductions_set, state_transitions_set): Assert that no
15716 previous value was assigned.
15718 (states_free): Use it.
15719 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
15720 temporary storage: use `errs' and `nerrs' as elsewhere.
15721 (set_conflicts): Allocate and free this `errs'.
15723 2002-07-02 Akim Demaille <akim@epita.fr>
15725 * lib/libiberty.h: New.
15726 * lib: Update the bitset implementation from upstream.
15727 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
15728 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
15729 * src/main.c: Adjust bitset stats calls.
15731 2002-07-01 Paul Eggert <eggert@twinsun.com>
15733 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
15734 char, so that negative chars don't collide with $.
15736 2002-06-30 Akim Demaille <akim@epita.fr>
15738 Have the GLR tests be `warning' checked, and fix the warnings.
15740 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
15741 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
15742 (yyremoveDeletes): `yyi' and `yyj' are size_t.
15743 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
15744 (yyaddDeferredAction): static.
15745 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
15746 (yyreportParseError): yyprefix is const.
15747 yytokenp is used only when verbose.
15748 (yy__GNUC__): Replace with __GNUC__.
15749 (yypdumpstack): yyi is size_t.
15750 (yypreference): Un-yy local variables and arguments, to avoid
15751 clashes with `yyr1'. Anyway, we are not in the user name space.
15752 (yytname_size): be an int, as is compared with ints.
15753 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
15755 * tests/cxx-gram.at: Use quotation to protect $1.
15756 Use AT_COMPILE to enable warnings hunts.
15757 Prototype yylex and yyerror.
15759 Include `string.h', not `strings.h'.
15760 Produce and prototype stmtMerge only when used.
15761 yylex takes a location.
15763 2002-06-30 Akim Demaille <akim@epita.fr>
15765 We spend a lot of time in quotearg, in particular when --verbose.
15767 * src/symtab.c (symbol_get): Store a quoted version of the key.
15768 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
15769 Adjust all callers.
15771 2002-06-30 Akim Demaille <akim@epita.fr>
15773 * src/state.h (reductions_t): Rename member `nreds' as num.
15774 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
15775 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
15777 2002-06-30 Akim Demaille <akim@epita.fr>
15779 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
15780 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
15781 (shifts_to): Rename as...
15782 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
15783 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
15784 (TRANSITION_IS_DISABLED, transitions_to): these.
15786 2002-06-30 Akim Demaille <akim@epita.fr>
15788 * src/print.c (print_shifts, print_gotos): Merge into...
15789 (print_transitions): this.
15790 (print_transitions, print_errs, print_reductions): Align the
15791 lookaheads columns.
15792 (print_core, print_transitions, print_errs, print_state,
15793 print_grammar): Output empty lines separator before, not after.
15794 (state_default_rule_compute): Rename as...
15795 (state_default_rule): this.
15796 * tests/conflicts.at (Defaulted Conflicted Reduction),
15797 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
15798 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
15800 2002-06-30 Akim Demaille <akim@epita.fr>
15802 Display items as we display rules.
15804 * src/gram.h, src/gram.c (rule_lhs_print): New.
15805 * src/gram.c (grammar_rules_partial_print): Use it.
15806 * src/print.c (print_core): Likewise.
15807 * tests/conflicts.at (Defaulted Conflicted Reduction),
15808 (Unresolved SR Conflicts): Adjust.
15809 (Unresolved SR Conflicts): Adjust and rename as...
15810 (Resolved SR Conflicts): this, as was meant.
15811 * tests/regression.at (Web2c Report): Adjust.
15813 2002-06-30 Akim Demaille <akim@epita.fr>
15815 * src/print.c (state_default_rule_compute): New, extracted from...
15816 (print_reductions): here.
15817 Pessimize, but clarify the code.
15818 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
15820 2002-06-30 Akim Demaille <akim@epita.fr>
15822 * src/output.c (action_row): Let default_rule be always a rule
15825 2002-06-30 Akim Demaille <akim@epita.fr>
15827 * src/closure.c (print_firsts, print_fderives, closure):
15828 Use BITSET_EXECUTE.
15829 * src/lalr.c (lookaheads_print): Likewise.
15830 * src/state.c (state_rule_lookaheads_print): Likewise.
15831 * src/print_graph.c (print_core): Likewise.
15832 * src/print.c (print_reductions): Likewise.
15833 * src/output.c (action_row): Likewise.
15834 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
15836 2002-06-30 Akim Demaille <akim@epita.fr>
15838 * src/print_graph.c: Use report_flag.
15840 2002-06-30 Akim Demaille <akim@epita.fr>
15842 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
15844 * src/relation.h, src/relation.c (traverse, relation_digraph)
15845 (relation_print, relation_transpose): New.
15847 2002-06-30 Akim Demaille <akim@epita.fr>
15849 * src/state.h, src/state.c (shifts_to): New.
15850 * src/lalr.c (build_relations): Use it.
15852 2002-06-30 Akim Demaille <akim@epita.fr>
15854 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
15855 (item_number_of_rule_number, rule_number_of_item_number): New.
15856 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
15857 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
15858 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
15859 Propagate their use.
15860 Much remains to be done, in particular wrt `shorts' from types.h.
15862 2002-06-30 Akim Demaille <akim@epita.fr>
15864 * src/symtab.c (symbol_new): Initialize the `printer' member.
15866 2002-06-30 Akim Demaille <akim@epita.fr>
15868 * src/LR0.c (save_reductions): Remove, replaced by...
15869 * src/state.h, src/state.c (state_reductions_set): New.
15870 (reductions, errs): Rename as...
15871 (reductions_t, errs_t): these.
15872 Adjust all dependencies.
15874 2002-06-30 Akim Demaille <akim@epita.fr>
15876 * src/LR0.c (state_list_t, state_list_append): New.
15877 (first_state, last_state): Now symbol_list_t.
15878 (this_state): Remove.
15879 (new_itemsets, append_states, save_reductions): Take a state_t as
15881 (set_states, generate_states): Adjust.
15882 (save_shifts): Remove, replaced by...
15883 * src/state.h, src/state.c (state_shifts_set): New.
15884 (shifts): Rename as...
15886 Adjust all dependencies.
15887 * src/state.h (state_t): Remove the `next' member.
15889 2002-06-30 Akim Demaille <akim@epita.fr>
15891 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
15894 2002-06-30 Akim Demaille <akim@epita.fr>
15896 Use hash.h for the state hash table.
15898 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
15899 (allocate_storage): Use state_hash_new.
15900 (free_storage): Use state_hash_free.
15901 (new_state, get_state): Adjust.
15902 * src/lalr.h, src/lalr.c (states): Move to...
15903 * src/states.h (state_t): Remove the `link' member, no longer
15905 * src/states.h, src/states.c: here.
15906 (state_hash_new, state_hash_free, state_hash_lookup)
15907 (state_hash_insert, states_free): New.
15908 * src/states.c (state_table, state_compare, state_hash): New.
15909 * src/output.c (output_actions): Do not free states now, since we
15910 still need to know the final_state number in `prepare', called
15911 afterwards. Do it...
15912 * src/main.c (main): here: call states_free after `output'.
15914 2002-06-30 Akim Demaille <akim@epita.fr>
15916 * src/state.h, src/state.c (state_new): New, extracted from...
15917 * src/LR0.c (new_state): here.
15918 * src/state.h (STATE_ALLOC): Move to...
15919 * src/state.c: here.
15920 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
15921 * src/state.h, src/state.c: here.
15923 2002-06-30 Akim Demaille <akim@epita.fr>
15925 * src/reader.c (gensym): Rename as...
15926 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
15927 (getsym): Rename as...
15928 (symbol_get): this.
15930 2002-06-30 Akim Demaille <akim@epita.fr>
15932 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
15933 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
15934 * src/output.c, src/print.c, src/print_graph.c: Propagate.
15935 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
15937 2002-06-30 Akim Demaille <akim@epita.fr>
15939 Make the test suite pass with warnings checked.
15941 * tests/actions.at (Printers and Destructors): Improve.
15942 Avoid unsigned vs. signed issues.
15943 * tests/calc.at: Don't exercise the scanner here, do it...
15944 * tests/input.at (Torturing the Scanner): here.
15946 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15948 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
15949 reorganize first lines parallel to yacc.c.
15951 2002-06-28 Akim Demaille <akim@epita.fr>
15953 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
15954 (b4_token_enum, b4_token_defines): New, factored from...
15955 * data/lalr1.cc, data/yacc.c, glr.c: here.
15957 2002-06-28 Akim Demaille <akim@epita.fr>
15959 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
15961 * src/output.c (merger_output): static.
15963 2002-06-28 Akim Demaille <akim@epita.fr>
15965 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
15966 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
15968 * src/output.c (save_row): Initialize all the variables to pacify GCC.
15970 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15972 Accumulated changelog for new GLR parsing features.
15974 * src/conflicts.c (count_total_conflicts): Change name to
15975 conflicts_total_count.
15976 * src/conflicts.h: Ditto.
15977 * src/output.c (token_actions): Use the new name.
15978 (output_conflicts): Change conflp => conflict_list_heads, and
15979 confl => conflict_list for better readability.
15980 * data/glr.c: Use the new names.
15981 * NEWS: Add self to GLR announcement.
15983 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
15985 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
15988 * data/bison.glr: Change name to glr.c
15989 * data/glr.c: Renamed from bison.glr.
15990 * data/Makefile.am: Add glr.c
15994 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
15995 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
15997 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15999 * data/bison.glr: Be sure to restore the
16000 current #line when returning to the skeleton contents after having
16001 exposed the input file's #line.
16003 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16005 * data/bison.glr: Bring up to date with changes to bison.simple.
16007 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16009 * data/bison.glr: Correct definitions that use b4_prefix.
16010 Various reformatting.
16011 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
16012 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
16013 yytokenp argument; now part of stack.
16014 (yychar): Define to behave as documented.
16015 (yyclearin): Ditto.
16017 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16019 * src/reader.h: Add declaration for free_merger_functions.
16021 * src/reader.c (merge_functions): New variable.
16022 (get_merge_function): New function.
16023 (free_merger_functions): New function.
16024 (readgram): Check for %prec that is not followed by a symbol.
16025 Handle %dprec and %merge declarations.
16026 (packgram): Initialize dprec and merger fields in rules array.
16028 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
16029 conflict_list_cnt, conflict_list_free): New variables.
16030 (table_grow): Also grow conflict_table.
16031 (prepare_rules): Output dprec and merger tables.
16032 (conflict_row): New function.
16033 (action_row): Output conflict lists for GLR parser. Don't use
16034 default reduction in conflicted states for GLR parser so that there
16035 are spaces for the conflict lists.
16036 (save_row): Also save conflict information.
16037 (token_actions): Allocate conflict list.
16038 (merger_output): New function.
16039 (pack_vector): Pack conflict table, too.
16040 (output_conflicts): New function to output yyconflp and yyconfl.
16041 (output_check): Allocate conflict_tos.
16042 (output_actions): Output conflict tables, also.
16043 (output_skeleton): Output b4_mergers definition.
16044 (prepare): Output b4_max_rhs_length definition.
16045 Use 'bison.glr' as default skeleton for GLR parsers.
16047 * src/gram.c (glr_parser): New flag.
16048 (grammar_free): Call free_merger_functions.
16050 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
16051 all pairs of conflicting reductions, rather than just all tokens
16052 causing conflicts. Needed to size conflict tables.
16053 (conflicts_output): Modify call to count_rr_conflicts for new
16055 (conflicts_print): Ditto.
16056 (count_total_conflicts): New function.
16058 * src/reader.h (merger_list): New type.
16059 (merge_functions): New variable.
16061 * src/lex.h (tok_dprec, tok_merge): New token types.
16063 * src/gram.h (rule_s): Add dprec and merger fields.
16064 (glr_parser): New flag.
16066 * src/conflicts.h (count_total_conflicts): New function.
16068 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
16070 * doc/bison.texinfo (Generalized LR Parsing): New section.
16071 (GLR Parsers): New section.
16072 (Language and Grammar): Mention GLR parsing.
16073 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
16074 Correct typo ("tge" -> "the").
16076 * data/bison.glr: New skeleton for GLR parsing.
16078 * tests/cxx-gram.at: New tests for GLR parsing.
16080 * tests/testsuite.at: Include cxx-gram.at.
16082 * tests/Makefile.am: Add cxx-gram.at.
16084 * src/parse-gram.y:
16086 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
16088 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
16090 2002-06-27 Akim Demaille <akim@epita.fr>
16092 * src/options.h, src/options.c: Remove.
16093 * src/getargs.c (short_options, long_options): New.
16095 2002-06-27 Akim Demaille <akim@epita.fr>
16097 * data/bison.simple, data/bison.c++: Rename as...
16098 * data/yacc.c, data/lalr1.cc: these.
16099 * doc/bison.texinfo (Environment Variables): Remove.
16101 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
16103 * src/getargs.c (report_argmatch): Initialize strtok().
16105 2002-06-20 Akim Demaille <akim@epita.fr>
16107 * data/bison.simple (b4_symbol_actions): New, replaces...
16108 (b4_symbol_destructor, b4_symbol_printer): these.
16109 (yysymprint): Be sure to call YYPRINT only for tokens, and using
16110 user token numbers.
16112 2002-06-20 Akim Demaille <akim@epita.fr>
16114 * data/bison.simple (yydestructor): Rename as...
16115 (yydestruct): this.
16117 2002-06-20 Akim Demaille <akim@epita.fr>
16119 * src/symtab.h, src/symtab.c (symbol_type_set)
16120 (symbol_destructor_set, symbol_precedence_set): The location is
16122 Adjust all callers.
16124 2002-06-20 Akim Demaille <akim@epita.fr>
16126 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
16128 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
16130 * src/symtab.h, src/symtab.c (symbol_class_set)
16131 (symbol_user_token_number_set): Likewise.
16132 Adjust all callers.
16133 Promote complain_at.
16134 * tests/input.at (Type Clashes): Adjust.
16136 2002-06-20 Akim Demaille <akim@epita.fr>
16138 * data/bison.simple (YYLEX): Fix the declaration when
16141 2002-06-20 Akim Demaille <akim@epita.fr>
16143 * data/bison.simple (yysymprint): Don't print the token number,
16145 * tests/actions.at (Destructors): Rename as...
16146 (Printers and Destructors): this.
16147 Also exercise %printer.
16149 2002-06-20 Akim Demaille <akim@epita.fr>
16151 * data/bison.simple (YYDSYMPRINT): New.
16152 Use it to remove many of the #if YYDEBUG/if (yydebug).
16154 2002-06-20 Akim Demaille <akim@epita.fr>
16156 * src/symtab.h, src/symtab.c (symbol_t): printer and
16157 printer_location are new members.
16158 (symbol_printer_set): New.
16159 * src/parse-gram.y (PERCENT_PRINTER): New token.
16160 Handle its associated rule.
16161 * src/scan-gram.l: Adjust.
16162 (handle_destructor_at, handle_destructor_dollar): Rename as...
16163 (handle_symbol_code_at, handle_symbol_code_dollar): these.
16164 * src/output.c (symbol_printers_output): New.
16165 (output_skeleton): Call it.
16166 * data/bison.simple (yysymprint): New. Cannot be named yyprint
16167 since there are already many grammar files with a user `yyprint'.
16168 Replace the calls to YYPRINT to calls to yysymprint.
16169 * tests/calc.at: Adjust.
16170 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
16171 taking advantage of parser very internal details (stack size!).
16173 2002-06-20 Akim Demaille <akim@epita.fr>
16175 * src/scan-gram.l: Complete the scanner with the missing patterns
16177 Use `quote' and `symbol_tag_get' where appropriate.
16179 2002-06-19 Akim Demaille <akim@epita.fr>
16181 * tests/actions.at (Destructors): Augment to test locations.
16182 * data/bison.simple (yydestructor): Pass it the current location
16183 if locations are enabled.
16184 Prototype only when __STDC__ or C++.
16185 Change the argument names to move into the yy name space: there is
16188 2002-06-19 Akim Demaille <akim@epita.fr>
16190 * data/bison.simple (b4_pure_if): New.
16191 Use it instead of #ifdef YYPURE.
16193 2002-06-19 Akim Demaille <akim@epita.fr>
16195 * data/bison.simple (b4_location_if): New.
16196 Use it instead of #ifdef YYLSP_NEEDED.
16198 2002-06-19 Akim Demaille <akim@epita.fr>
16200 Prepare @$ in %destructor, but currently don't bind it in the
16201 skeleton, as %location use is not cleaned up yet.
16203 * src/scan-gram.l (handle_dollar, handle_destructor_at)
16204 (handle_action_at): New.
16205 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
16206 a braced_code_t and a location as additional arguments.
16207 (handle_destructor_dollar): Instead of requiring `b4_eval', just
16208 unquote one when outputting `b4_dollar_dollar'.
16210 * data/bison.simple (b4_eval): Remove.
16211 (b4_symbol_destructor): Adjust.
16212 * tests/input.at (Invalid @n): Adjust.
16214 2002-06-19 Zack Weinberg <zack@codesourcery.com>
16216 * doc/bison.texinfo: Document ability to have multiple
16219 2002-06-18 Akim Demaille <akim@epita.fr>
16221 * src/files.c (compute_base_names): When computing the output file
16222 names from the input file name, strip the directory part.
16224 2002-06-18 Akim Demaille <akim@epita.fr>
16226 * data/bison.simple.new: Comment changes.
16227 Reported by Andreas Schwab.
16229 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
16231 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
16232 there are no `label `yyoverflowlab' defined but not used' warnings
16233 when yyoverflow is defined.
16235 2002-06-18 Akim Demaille <akim@epita.fr>
16237 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
16239 (symbol_destructor_set): Adjust.
16240 * src/output.c (symbol_destructors_output): Output the destructor
16242 Output the symbol name.
16243 * data/bison.simple (b4_symbol_destructor): Adjust.
16245 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
16246 and Akim Demaille <akim@epita.fr>
16248 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
16249 what's left on the stack when the error recovery hits EOF.
16250 * tests/actions.at (Destructors): Complete to exercise this case.
16252 2002-06-17 Akim Demaille <akim@epita.fr>
16254 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
16255 arguments is really empty, not only equal to `[]'.
16256 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
16258 (symbol_destructor_set): New.
16259 * src/output.c (symbol_destructors_output): New.
16260 * src/reader.h (brace_code_t, current_braced_code): New.
16261 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
16262 (handle_dollar): Rename as...
16263 (handle_action_dollar): this.
16264 (handle_destructor_dollar): New.
16265 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
16266 (grammar_declaration): Use it.
16267 * data/bison.simple (yystos): Is always defined.
16268 (yydestructor): New.
16269 * tests/actions.at (Destructors): New.
16270 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
16272 2002-06-17 Akim Demaille <akim@epita.fr>
16274 * src/symlist.h, src/symlist.c (symbol_list_length): New.
16275 * src/scan-gram.l (handle_dollar, handle_at): Compute the
16276 rule_length only when needed.
16277 * src/output.c (actions_output, token_definitions_output): Output
16279 * src/symtab.c: Don't access directly to the symbol tag, use
16281 * src/parse-gram.y: Use symbol_list_free.
16283 2002-06-17 Akim Demaille <akim@epita.fr>
16285 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
16286 (symbol_list_prepend, get_type_name): Move to...
16287 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
16288 (symbol_list_prepend, symbol_list_n_type_name_get): here.
16289 Adjust all callers.
16290 (symbol_list_free): New.
16291 * src/scan-gram.l (handle_dollar): Takes a location.
16292 * tests/input.at (Invalid $n): Adjust.
16294 2002-06-17 Akim Demaille <akim@epita.fr>
16296 * src/reader.h, src/reader.c (symbol_list_new): Export it.
16297 (symbol_list_prepend): New.
16298 * src/parse-gram.y (%union): `list' is a new member.
16299 (symbols.1): New, replaces...
16300 (terms_to_prec.1, nterms_to_type.1): these.
16301 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
16302 Take a location as additional argument.
16303 Adjust all callers.
16305 2002-06-15 Akim Demaille <akim@epita.fr>
16307 * src/parse-gram.y: Move %token in the declaration section so that
16308 we don't depend upon CVS Bison.
16310 2002-06-15 Akim Demaille <akim@epita.fr>
16312 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
16313 * src/print.c (print_core): Use it.
16315 2002-06-15 Akim Demaille <akim@epita.fr>
16317 * src/conflicts.c (log_resolution): Accept the rule involved in
16318 the sr conflicts instead of the lookahead number that points to
16320 (flush_reduce): Accept the current lookahead vector as argument,
16321 instead of the index in LA.
16322 (resolve_sr_conflict): Accept the current number of lookahead
16323 bitset to consider for the STATE, instead of the index in LA.
16324 (set_conflicts): Adjust.
16325 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
16327 2002-06-15 Akim Demaille <akim@epita.fr>
16329 * src/state.h (state_t): Replace the `lookaheadsp' member, a
16330 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
16331 Adjust all dependencies.
16332 * src/lalr.c (initialize_lookaheads): Split into...
16333 (states_lookaheads_count, states_lookaheads_initialize): these.
16336 2002-06-15 Akim Demaille <akim@epita.fr>
16338 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
16340 (grammar_rules_print): here.
16341 * src/reduce.c (reduce_output): Use it.
16342 * tests/reduce.at (Useless Rules, Reduced Automaton)
16343 (Underivable Rules): Adjust.
16345 2002-06-15 Akim Demaille <akim@epita.fr>
16347 Copy BYacc's nice way to report the grammar.
16349 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
16351 Don't print the rules' location, it is confusing and useless.
16352 (rule_print): Use grammar_rhs_print.
16353 * src/print.c (print_grammar): Use grammar_rules_print.
16355 2002-06-15 Akim Demaille <akim@epita.fr>
16357 Complete and rationalize `useless thing' warnings.
16359 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
16360 (symbol_tag_print): New.
16361 Use them everywhere in place of accessing directly the tag member.
16362 * src/gram.h, src/gram.c (rule_print): New.
16363 Use it where a rule used to be printed `by hand'.
16364 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
16365 (reduce_grammar_tables): Report the useless rules.
16366 (reduce_print): Useless things are a warning, not an error.
16368 * tests/reduce.at (Useless Nonterminals, Useless Rules):
16369 (Reduced Automaton, Underivable Rules): Adjust.
16370 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
16371 * tests/conflicts.at (Unresolved SR Conflicts)
16372 (Solved SR Conflicts): Adjust.
16374 2002-06-15 Akim Demaille <akim@epita.fr>
16376 Let symbols have a location.
16378 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
16380 Adjust all callers.
16381 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
16382 Use location_t, not int.
16383 * src/symtab.c (symbol_check_defined): Take advantage of the
16385 * tests/regression.at (Invalid inputs): Adjust.
16387 2002-06-15 Akim Demaille <akim@epita.fr>
16389 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
16390 (input): Don't try to initialize yylloc here, do it in the
16392 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
16393 * src/gram.h (rule_t): Change line and action_line into location
16394 and action_location, of location_t type.
16395 Adjust all dependencies.
16396 * src/location.h, src/location.c (empty_location): New.
16397 * src/reader.h, src/reader.c (grammar_start_symbol_set)
16398 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
16399 (grammar_current_rule_symbol_append)
16400 (grammar_current_rule_action_append): Expect a location as argument.
16401 * src/reader.c (grammar_midrule_action): Adjust to attach an
16402 action's location as dummy symbol location.
16403 * src/symtab.h, src/symtab.c (startsymbol_location): New.
16404 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
16407 2002-06-14 Akim Demaille <akim@epita.fr>
16409 Grammar declarations may be found in the grammar section.
16411 * src/parse-gram.y (rules_or_grammar_declaration): New.
16412 (declarations): Each declaration may end with a semicolon, not
16414 (grammar_declaration): `"%union"'.
16415 (grammar): Branch to rules_or_grammar_declaration.
16417 2002-06-14 Akim Demaille <akim@epita.fr>
16419 * src/main.c (main): Invoke scanner_free.
16421 2002-06-14 Akim Demaille <akim@epita.fr>
16423 * src/output.c (m4_invoke): Extracted from...
16424 (output_skeleton): here.
16427 2002-06-14 Akim Demaille <akim@epita.fr>
16429 * src/parse-gram.y (directives, directive, gram)
16430 (grammar_directives, precedence_directives, precedence_directive):
16432 (declarations, declaration, grammar, grammar_declaration)
16433 (precedence_declaration, precedence_declarator): these.
16434 (symbol_declaration): New.
16436 2002-06-14 Akim Demaille <akim@epita.fr>
16438 * src/files.c (action_obstack): Remove, unused.
16439 (output_obstack): Remove it, and all its dependencies, as it is no
16441 * src/reader.c (epilogue_set): Build the epilogue in the
16443 * src/output.h, src/output.c (muscle_obstack): Move to...
16444 * src/muscle_tab.h, src/muscle_tab.h: here.
16445 (muscle_init): Initialize muscle_obstack.
16446 (muscle_free): New.
16447 * src/main.c (main): Call it.
16449 2002-06-14 Akim Demaille <akim@epita.fr>
16451 * src/location.h: New, extracted from...
16452 * src/reader.h: here.
16453 * src/Makefile.am (noinst_HEADERS): Merge into
16454 (bison_SOURCES): this.
16456 * src/parse-gram.y: Use location_t instead of Bison's.
16457 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
16458 Use location_t instead of ints.
16460 2002-06-14 Akim Demaille <akim@epita.fr>
16462 * data/bison.simple, data/bison.c++: Be sure to restore the
16463 current #line when returning to the skeleton contents after having
16464 exposed the input file's #line.
16466 2002-06-12 Akim Demaille <akim@epita.fr>
16468 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
16470 * tests/actions.at (Exotic Dollars): New.
16472 2002-06-12 Akim Demaille <akim@epita.fr>
16474 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
16476 * tests/input.at (Torturing the Scanner): New.
16478 2002-06-11 Akim Demaille <akim@epita.fr>
16480 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
16481 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
16482 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
16483 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
16484 * src/reader.c (reader): Use it.
16486 2002-06-11 Akim Demaille <akim@epita.fr>
16488 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
16489 Adjust all callers.
16490 (scanner_last_string_free): New.
16492 2002-06-11 Akim Demaille <akim@epita.fr>
16494 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
16495 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
16496 (last_string, YY_OBS_FREE): New.
16497 Use them when returning an ID.
16499 2002-06-11 Akim Demaille <akim@epita.fr>
16501 Have Bison grammars parsed by a Bison grammar.
16503 * src/reader.c, src/reader.h (prologue_augment): New.
16504 * src/reader.c (copy_definition): Remove.
16506 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
16507 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
16508 (grammar_current_rule_prec_set, grammar_current_rule_check)
16509 (grammar_current_rule_symbol_append)
16510 (grammar_current_rule_action_append): Export.
16511 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
16512 (symbol_list_action_append): Remove.
16513 Hook the routines from reader.
16514 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
16515 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
16517 * src/reader.c (read_declarations): Remove, unused.
16519 * src/parse-gram.y: Handle the epilogue.
16520 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
16521 (grammar_start_symbol_set): this.
16522 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
16523 * src/reader.c (readgram): Remove, unused.
16524 (reader): Adjust to insert eoftoken and axiom where appropriate.
16526 * src/reader.c (copy_dollar): Replace with...
16527 * src/scan-gram.h (handle_dollar): this.
16528 * src/parse-gram.y: Remove `%thong'.
16530 * src/reader.c (copy_at): Replace with...
16531 * src/scan-gram.h (handle_at): this.
16533 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
16536 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
16539 * src/reader.h, src/reader.c (grammar_rule_end): New.
16541 * src/parse.y (current_type, current_class): New.
16542 Implement `%nterm', `%token' support.
16543 Merge `%term' into `%token'.
16544 (string_as_id): New.
16545 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
16548 * src/parse-gram.y: Be sure to handle properly the beginning of
16551 * src/parse-gram.y: Handle %type.
16552 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
16554 * src/parse-gram.y: More directives support.
16555 * src/options.c: No longer handle source directives.
16557 * src/parse-gram.y: Fix %output.
16559 * src/parse-gram.y: Handle %union.
16560 Use the prologue locations.
16561 * src/reader.c (parse_union_decl): Remove.
16563 * src/reader.h, src/reader.c (epilogue_set): New.
16564 * src/parse-gram.y: Use it.
16566 * data/bison.simple, data/bison.c++: b4_stype is now either not
16567 defined, then default to int, or to the contents of %union,
16568 without `union' itself.
16570 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
16572 * src/output.c (actions_output): Don't output braces, as they are
16573 already handled by the scanner.
16575 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
16576 characters to themselves.
16578 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
16579 that the epilogue has a proper #line.
16581 * src/parse-gram.y: Handle precedence/associativity.
16583 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
16585 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
16586 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
16587 at all to define terminals that cannot be emitted.
16589 * src/scan-gram.l: Escape M4 characters.
16591 * src/scan-gram.l: Working properly with escapes in user
16592 strings/characters.
16594 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
16595 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
16597 Use more modest sizes, as for the time being the parser does not
16598 release memory, and therefore the process swallows a huge amount
16601 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
16602 stricter %token grammar.
16604 * src/symtab.h (associativity): Add `undef_assoc'.
16605 (symbol_precedence_set): Do nothing when passed an undef_assoc.
16606 * src/symtab.c (symbol_check_alias_consistence): Adjust.
16608 * tests/regression.at (Invalid %directive): Remove, as it is now
16610 (Invalid inputs): Adjust to the new error messages.
16611 (Token definitions): The new grammar doesn't allow too many
16614 * src/lex.h, src/lex.c: Remove.
16615 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
16616 (copy_character, copy_string2, copy_string, copy_identifier)
16617 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
16618 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
16619 (parse_action): Remove.
16620 * po/POTFILES.in: Adjust.
16622 2002-06-11 Akim Demaille <akim@epita.fr>
16624 * src/reader.c (parse_action): Don't store directly into the
16625 rule's action member: return the action as a string.
16626 Don't require `rule_length' as an argument: compute it.
16627 (grammar_current_rule_symbol_append)
16628 (grammar_current_rule_action_append): New, eved out from
16630 Remove `action_flag', `rulelength', unused now.
16632 2002-06-11 Akim Demaille <akim@epita.fr>
16634 * src/reader.c (grammar_current_rule_prec_set).
16635 (grammar_current_rule_check): New, eved out from...
16637 Remove `xaction', `first_rhs': useless.
16638 * tests/input.at (Type clashes): New.
16639 * tests/existing.at (GNU Cim Grammar): Adjust.
16641 2002-06-11 Akim Demaille <akim@epita.fr>
16643 * src/reader.c (grammar_midrule_action): New, Eved out from
16646 2002-06-11 Akim Demaille <akim@epita.fr>
16648 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
16650 (readgram): Use them as replacement of inlined code, crule and
16653 2002-06-11 Akim Demaille <akim@epita.fr>
16655 * src/reader.c (grammar_end, grammar_symbol_append): New.
16656 (readgram): Use them.
16657 Make the use of `p' as local as possible.
16659 2002-06-10 Akim Demaille <akim@epita.fr>
16661 GCJ's parser requires the tokens to be defined before the prologue.
16663 * data/bison.simple: Output the token definition before the user's
16665 * tests/regression.at (Braces parsing, Duplicate string)
16666 (Mixing %token styles): Check the output from bison.
16667 (Early token definitions): New.
16669 2002-06-10 Akim Demaille <akim@epita.fr>
16671 * src/symtab.c (symbol_user_token_number_set): Don't complain when
16672 assigning twice the same user number to a token, so that we can
16674 * src/lex.c (lex): here.
16675 Also use `symbol_class_set' instead of hand written code.
16676 * src/reader.c (parse_assoc_decl): Likewise.
16678 2002-06-10 Akim Demaille <akim@epita.fr>
16680 * src/symtab.c, src/symtab.c (symbol_class_set)
16681 (symbol_user_token_number_set): New.
16682 * src/reader.c (parse_token_decl): Use them.
16683 Use a switch instead of ifs.
16684 Use a single argument.
16686 2002-06-10 Akim Demaille <akim@epita.fr>
16688 Remove `%thong' support as it is undocumented, unused, duplicates
16689 `%token's job, and creates useless e-mail traffic with people who
16690 want to know what it is, why it is undocumented, unused, and
16691 duplicates `%token's job.
16693 * src/reader.c (parse_thong_decl): Remove.
16694 * src/options.c (option_table): Remove "thong".
16695 * src/lex.h (tok_thong): Remove.
16697 2002-06-10 Akim Demaille <akim@epita.fr>
16699 * src/symtab.c, src/symtab.c (symbol_type_set)
16700 (symbol_precedence_set): New.
16701 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
16702 (value_components_used): Remove, unused.
16704 2002-06-09 Akim Demaille <akim@epita.fr>
16706 Move symbols handling code out of the reader.
16708 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
16709 (axiom): Move to...
16710 * src/symtab.h, src/symtab.c: here.
16712 * src/gram.c (start_symbol): Remove: use startsymbol->number.
16713 * src/reader.c (startval): Rename as...
16714 * src/symtab.h, src/symtab.c (startsymbol): this.
16715 * src/reader.c: Adjust.
16717 * src/reader.c (symbol_check_defined, symbol_make_alias)
16718 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16719 (token_translations_init)
16721 * src/symtab.c: here.
16722 * src/reader.c (packsymbols): Move to...
16723 * src/symtab.h, src/symtab.c (symbols_pack): here.
16724 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
16727 2002-06-03 Akim Demaille <akim@epita.fr>
16729 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
16732 2002-06-03 Akim Demaille <akim@epita.fr>
16734 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
16735 structs with non literals.
16736 * src/scan-skel.l: never-interactive.
16737 * src/conflicts.c (enum conflict_resolution_e): No trailing
16739 * src/getargs.c (usage): Split long literal strings.
16740 Reported by Hans Aberg.
16742 2002-05-28 Akim Demaille <akim@epita.fr>
16744 * data/bison.c++: Use C++ ostreams.
16745 (cdebug_): New member.
16747 2002-05-28 Akim Demaille <akim@epita.fr>
16749 * src/output.c (output_skeleton): Be sure to allocate enough room
16750 for `/' _and_ for `\0' in full_skeleton.
16752 2002-05-28 Akim Demaille <akim@epita.fr>
16754 * data/bison.c++: Catch up with bison.simple:
16755 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16756 and Paul Eggert <eggert@twinsun.com>: `error' handing.
16757 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
16758 and popping traces.
16760 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16762 * src/output.c (output_skeleton): Put an explicit path in front of
16763 the skeleton file name, rather than relying on the -I directory,
16764 to partially alleviate effects of having a skeleton file lying around
16765 in the current directory.
16767 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16769 * src/conflicts.c (log_resolution): Correct typo:
16770 obstack_printf should be obstack_fgrow1.
16772 2002-05-26 Akim Demaille <akim@epita.fr>
16774 * src/state.h (state_t): `solved_conflicts' is a new member.
16775 * src/LR0.c (new_state): Set it to 0.
16776 * src/conflicts.h, src/conflicts.c (print_conflicts)
16777 (free_conflicts, solve_conflicts): Rename as...
16778 (conflicts_print, conflicts_free, conflicts_solve): these.
16780 * src/conflicts.c (enum conflict_resolution_e)
16781 (solved_conflicts_obstack): New, used by...
16782 (log_resolution): this.
16783 Adjust to attach the conflict resolution to each state.
16784 Complete the description with the precedence/associativity
16786 (resolve_sr_conflict): Adjust.
16787 * src/print.c (print_state): Output its solved_conflicts.
16788 * tests/conflicts.at (Unresolved SR Conflicts)
16789 (Solved SR Conflicts): Exercise --report=all.
16791 2002-05-26 Akim Demaille <akim@epita.fr>
16793 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
16794 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16795 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
16796 (token_number_t, item_number_as_token_number)
16797 (token_number_as_item_number, muscle_insert_token_number_table):
16799 (symbol_number_t, item_number_as_symbol_number)
16800 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
16801 these, since it is more appropriate.
16803 2002-05-26 Akim Demaille <akim@epita.fr>
16805 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
16807 * data/bison.simple (yystos) [YYDEBUG]: New.
16808 (yyparse) [YYDEBUG]: Display the symbols which are popped during
16810 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
16812 2002-05-25 Akim Demaille <akim@epita.fr>
16814 * doc/bison.texinfo (Debugging): Split into...
16815 (Tracing): this new section, its former contents, and...
16816 (Understanding): this new section.
16817 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
16819 (report_flag): this.
16820 Adjust all dependencies.
16821 (report_args, report_types, report_argmatch): New.
16822 (usage, getargs): Report/support -r, --report.
16824 (struct option_table_struct): Rename as..,
16825 (struct option_table_s): this.
16826 Rename the `set_flag' member to `flag' to match with getopt_long's
16828 * src/options.c (option_table): Split verbose into an entry for
16829 %verbose, and another for --verbose.
16830 Support --report/-r, so remove -r from the obsolete --raw.
16831 * src/print.c: Attach full item sets and lookaheads reports to
16832 report_flag instead of trace_flag.
16833 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
16835 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16836 and Paul Eggert <eggert@twinsun.com>
16838 * data/bison.simple (yyparse): Correct error handling to conform to
16839 POSIX and yacc. Specifically, after syntax error is discovered,
16840 do not reduce further before shifting the error token.
16841 Clean up the code a bit by removing the labels yyerrdefault,
16842 yyerrhandle, yyerrpop.
16843 * NEWS: Document the above.
16845 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16847 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
16848 type; it isn't always big enough, since it doesn't necessarily
16849 include non-terminals.
16850 (yytranslate): Expand definition of yy_token_number_type, so that
16851 the latter can be removed.
16852 (yy_token_number_type): Remove, only one use.
16853 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
16854 don't use TokenNumberType as element type.
16856 * tests/regression.at: Modify expected output to agree with change
16857 to yyr1 and yytranslate.
16859 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
16861 * src/reader.c (parse_action): Use copy_character instead of
16864 2002-05-13 Akim Demaille <akim@epita.fr>
16866 * tests/regression.at (Token definitions): Prototype yylex and
16869 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16871 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
16872 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
16874 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
16876 2002-05-07 Akim Demaille <akim@epita.fr>
16878 * tests/synclines.at: Be sure to prototype yylex and yyerror to
16879 avoid GCC warnings.
16881 2002-05-07 Akim Demaille <akim@epita.fr>
16885 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
16886 over the RHS of each rule.
16887 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
16888 * src/state.h (state_t): Member `nitems' is unsigned short.
16889 * src/LR0.c (get_state): Adjust.
16890 * src/reader.c (packgram): Likewise.
16891 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
16893 (muscle_insert_int_table): Remove, unused.
16894 (prepare_rules): Remove `max'.
16896 2002-05-06 Akim Demaille <akim@epita.fr>
16898 * src/closure.c (print_firsts): Display of the symbol tags.
16899 (bitmatrix_print): Move to...
16900 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
16902 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
16904 2002-05-06 Akim Demaille <akim@epita.fr>
16906 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
16909 2002-05-06 Akim Demaille <akim@epita.fr>
16911 * src/LR0.c (new_state, get_state): Instead of using the global
16912 `kernel_size' and `kernel_base', have two new arguments:
16913 `core_size' and `core'.
16916 2002-05-06 Akim Demaille <akim@epita.fr>
16918 * src/reader.c (packgram): No longer end `ritem' with a 0
16919 sentinel: it is not used.
16921 2002-05-05 Akim Demaille <akim@epita.fr>
16923 New experimental feature: display the lookaheads in the report and
16926 * src/print (print_core): When --trace-flag, display the rules
16928 * src/print_graph.c (print_core): Likewise.
16929 Swap the arguments.
16932 2002-05-05 Akim Demaille <akim@epita.fr>
16934 * tests/torture.at (Many lookaheads): New test.
16936 2002-05-05 Akim Demaille <akim@epita.fr>
16938 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
16939 (GENERATE_MUSCLE_INSERT_TABLE): this.
16940 (output_int_table, output_unsigned_int_table, output_short_table)
16941 (output_token_number_table, output_item_number_table): Replace with...
16942 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
16943 (muscle_insert_short_table, muscle_insert_token_number_table)
16944 (muscle_insert_item_number_table): these.
16945 Adjust all callers.
16946 (prepare_tokens): Don't free `translations', since...
16947 * src/reader.h, src/reader.c (grammar_free): do it.
16949 * src/gram.h, src/gram.c (grammar_free): here.
16950 * data/bison.simple, data/bison.c++: b4_token_number_max is now
16953 2002-05-05 Akim Demaille <akim@epita.fr>
16955 * src/output.c (output_unsigned_int_table): New.
16956 (prepare_rules): `i' is unsigned.
16957 `prhs', `rline', `r2' are unsigned int.
16958 Rename muscle `rhs_number_max' as `rhs_max'.
16959 Output muscles `prhs_max', `rline_max', and `r2_max'.
16961 * data/bison.simple, data/bison.c++: Adjust to use these muscles
16962 to compute types instead of constant types.
16963 * tests/regression.at (Web2c Actions): Adjust.
16965 2002-05-04 Akim Demaille <akim@epita.fr>
16967 * src/symtab.h (SALIAS, SUNDEF): Rename as...
16968 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
16969 Adjust dependencies.
16970 * src/output.c (token_definitions_output): Be sure not to output a
16971 `#define 'a'' when fed with `%token 'a' "a"'.
16972 * tests/regression.at (Token definitions): New.
16974 2002-05-03 Paul Eggert <eggert@twinsun.com>
16976 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
16979 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
16981 * Makefile.am (SUBDIRS): Remove intl.
16982 (EXTRA_DIST): Add config/config.rpath.
16984 2002-05-03 Akim Demaille <akim@epita.fr>
16986 * data/bison.simple (m4_if): Don't output empty enums.
16987 And actually, output valid enum definitions :(.
16989 2002-05-03 Akim Demaille <akim@epita.fr>
16991 * configure.bat: Remove, completely obsolete.
16992 * Makefile.am (EXTRA_DIST): Adjust.
16993 Don't distribute config.rpath...
16994 * config/Makefile.am (EXTRA_DIST): Do it.
16996 2002-05-03 Akim Demaille <akim@epita.fr>
16998 * configure.in (GETTEXT_VERSION): New.
16999 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
17001 2002-05-03 Akim Demaille <akim@epita.fr>
17003 * data/bison.simple (b4_token_enum): New.
17004 (b4_token_defines): Use it to output tokens both as #define and
17006 Suggested by Paul Eggert.
17007 * src/output.c (token_definitions_output): Don't output spurious
17010 2002-05-03 Akim Demaille <akim@epita.fr>
17012 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
17014 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
17016 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
17017 Update the stack class, give a try to deque as the default container.
17019 2002-05-02 Akim Demaille <akim@epita.fr>
17021 * data/bison.simple (yyparse): Do not implement @$ = @1.
17022 (YYLLOC_DEFAULT): Adjust to do it.
17023 * doc/bison.texinfo (Location Default Action): Fix.
17025 2002-05-02 Akim Demaille <akim@epita.fr>
17027 * src/reader.c (parse_braces): Merge into...
17028 (parse_action): this.
17030 2002-05-02 Akim Demaille <akim@epita.fr>
17032 * configure.in (ALL_LINGUAS): Remove.
17033 * po/LINGUAS, hr.po: New.
17035 2002-05-02 Akim Demaille <akim@epita.fr>
17037 Remove the so called hairy (semantic) parsers.
17039 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
17040 * src/gram.h, src/gram.c (semantic_parser): Remove.
17041 (rule_t): Remove the guard and guard_line members.
17042 * src/lex.h (token_t): remove tok_guard.
17043 * src/options.c (option_table): Remove %guard and %semantic_parser
17045 * src/output.c, src/output.h (guards_output): Remove.
17047 (token_definitions_output): Don't output the `T'
17049 (output_skeleton): Don't output the guards.
17050 * src/files.c, src/files.c (attrsfile): Remove.
17051 * src/reader.c (symbol_list): Remove the guard and guard_line
17053 Adjust dependencies.
17054 (parse_guard): Remove.
17055 * data/bison.hairy: Remove.
17056 * doc/bison.texinfo (Environment Variables): Remove occurrences of
17059 2002-05-02 Akim Demaille <akim@epita.fr>
17061 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
17062 (parse_guard): Rename the formal argument `stack_offset' as
17063 `rule_length', which is more readable.
17065 (copy_at, copy_dollar): Instead of outputting the hard coded
17066 values of $$, $n and so forth, output invocation to b4_lhs_value,
17067 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
17068 Note: this patch partially drops `semantic-parser' support: it
17069 always does `rule_length - n', where semantic parsers ought to
17071 * data/bison.simple, data/bison.c++ (b4_lhs_value)
17072 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
17074 2002-05-02 Akim Demaille <akim@epita.fr>
17076 * configure.in (AC_INIT): Bump to 1.49b.
17077 (AM_INIT_AUTOMAKE): Short invocation.
17079 2002-05-02 Akim Demaille <akim@epita.fr>
17083 2002-05-01 Akim Demaille <akim@epita.fr>
17085 * src/skeleton.h: Remove.
17087 2002-05-01 Akim Demaille <akim@epita.fr>
17089 * src/skeleton.h: Fix the #endif.
17090 Reported by Magnus Fromreide.
17092 2002-04-26 Paul Eggert <eggert@twinsun.com>
17094 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
17095 Define if we define YYSTYPE and YYLTYPE, respectively.
17096 (YYCOPY): Fix [] quoting problem in the non-GCC case.
17098 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
17100 * src/scan-skel.l: Postprocess quadrigraphs.
17102 * src/reader.c (copy_character): New function, used to output
17103 single characters while replacing `[' and `]' with quadrigraphs, to
17104 avoid troubles with M4 quotes.
17105 (copy_comment): Output characters with copy_character.
17106 (read_additionnal_code): Likewise.
17107 (copy_string2): Likewise.
17108 (copy_definition): Likewise.
17110 * tests/calc.at: Exercise M4 quoting.
17112 2002-04-25 Akim Demaille <akim@epita.fr>
17114 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
17115 between `!' and the command.
17116 Reported by Paul Eggert.
17118 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
17120 * tests/calc.at: Exercise prologue splitting.
17122 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
17123 `b4_post_prologue' instead of `b4_prologue'.
17125 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
17127 (output): Free pre_prologue_obstack and post_prologue_obstack.
17128 * src/files.h, src/files.c (attrs_obstack): Remove.
17129 (pre_prologue_obstack, post_prologue_obstack): New.
17130 * src/reader.c (copy_definition): Add a parameter to specify the
17131 obstack to fill, instead of using attrs_obstack unconditionally.
17132 (read_declarations): Pass pre_prologue_obstack to copy_definition if
17133 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
17135 2002-04-23 Paul Eggert <eggert@twinsun.com>
17137 * data/bison.simple: Remove unnecessary commentary and white
17138 space differences from 1_29-branch.
17139 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
17141 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
17142 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
17143 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
17144 constructors or destructors.
17146 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
17148 2002-04-23 Akim Demaille <akim@epita.fr>
17150 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
17151 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
17152 location with columns.
17153 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
17154 All reported by Paul Eggert.
17156 2002-04-22 Akim Demaille <akim@epita.fr>
17158 * src/reduce.c (dump_grammar): Move to...
17159 * src/gram.h, src/gram.c (grammar_dump): here.
17160 Be sure to separate long item numbers.
17161 Don't read the members of a rule's prec if its nil.
17163 2002-04-22 Akim Demaille <akim@epita.fr>
17165 * src/output.c (table_size, table_grow): New.
17166 (MAXTABLE): Remove, replace uses with table_size.
17167 (pack_vector): Instead of dying when the table is too big, grow it.
17169 2002-04-22 Akim Demaille <akim@epita.fr>
17171 * data/bison.simple (yyr1): Its type is that of a token number.
17172 * data/bison.c++ (r1_): Likewise.
17173 * tests/regression.at (Web2c Actions): Adjust.
17175 2002-04-22 Akim Demaille <akim@epita.fr>
17177 * src/reader.c (token_translations_init): 256 is now the default
17178 value for the error token, i.e., it will be assigned another
17179 number if the user assigned 256 to one of her tokens.
17180 (reader): Don't force 256 to error.
17181 * doc/bison.texinfo (Symbols): Adjust.
17182 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
17183 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
17184 etc. instead of 10, 20, 30 (which was used to `jump' over error
17185 (256) and undefined (2)).
17187 2002-04-22 Akim Demaille <akim@epita.fr>
17189 Propagate more token_number_t.
17191 * src/gram.h (token_number_as_item_number)
17192 (item_number_as_token_number): New.
17193 * src/output.c (GENERATE_OUTPUT_TABLE): New.
17194 Use it to create output_item_number_table and
17195 output_token_number_table.
17196 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17197 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
17198 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
17199 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
17201 2002-04-22 Akim Demaille <akim@epita.fr>
17203 * src/output.h, src/output.c (get_lines_number): Remove.
17205 2002-04-19 Akim Demaille <akim@epita.fr>
17207 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
17209 (Debugging): More details about enabling the debugging features.
17210 (Table of Symbols): Describe $$, $n, @$, and @n.
17211 Suggested by Tim Josling.
17213 2002-04-19 Akim Demaille <akim@epita.fr>
17215 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
17217 2002-04-10 Akim Demaille <akim@epita.fr>
17219 * src/system.h: Rely on HAVE_LIMITS_H.
17220 Suggested by Paul Eggert.
17222 2002-04-09 Akim Demaille <akim@epita.fr>
17224 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
17225 full stderr, and strip it according to the bison options, instead
17226 of composing the error message from different bits.
17227 This makes it easier to check for several error messages.
17228 Adjust all the invocations.
17229 Add an invocation exercising the error token.
17230 Add an invocation demonstrating a stupid error message.
17231 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
17233 Error message are for stderr, not stdout.
17235 2002-04-09 Akim Demaille <akim@epita.fr>
17237 * src/gram.h, src/gram.c (error_token_number): Remove, use
17239 * src/reader.c (reader): Don't specify the user token number (2)
17240 for $undefined, as it uselessly prevents using it.
17241 * src/gram.h (token_number_t): Move to...
17242 * src/symtab.h: here.
17243 (state_t.number): Is a token_number_t.
17244 * src/print.c, src/reader.c: Use undeftoken->number instead of
17246 (Even though this 2 is not the same as above: the number of the
17247 undeftoken remains being 2, it is its user token number which
17249 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
17250 `user_token_number_max'.
17251 Output `undef_token_number'.
17252 * data/bison.simple, data/bison.c++: Use them.
17253 Be sure to map invalid yylex return values to
17254 `undef_token_number'. This saves us from gratuitous SEGV.
17256 * tests/conflicts.at (Solved SR Conflicts)
17257 (Unresolved SR Conflicts): Adjust.
17258 * tests/regression.at (Web2c Actions): Adjust.
17260 2002-04-08 Akim Demaille <akim@epita.fr>
17262 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
17264 Remove the duplicate `typedefs'.
17265 (RhsNumberType): Fix the declaration and various other typos.
17267 * data/bison.simple: Use __ofile__.
17268 * src/scan-skel.l: Handle __ofile__.
17270 2002-04-08 Akim Demaille <akim@epita.fr>
17272 * src/gram.h (item_number_t): New, the type of item numbers in
17273 RITEM. Note that it must be able to code symbol numbers as
17274 positive number, and the negation of rule numbers as negative
17276 Adjust all dependencies (pretty many).
17277 * src/reduce.c (rule): Remove this `short *' pointer: use
17279 * src/system.h (MINSHORT, MAXSHORT): Remove.
17280 Include `limits.h'.
17281 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
17282 (shortcpy): Remove.
17283 (MAXTABLE): Move to...
17284 * src/output.c (MAXTABLE): here.
17285 (prepare_rules): Use output_int_table to output rhs.
17286 * data/bison.simple, data/bison.c++: Adjust.
17287 * tests/torture.at (Big triangle): Move the limit from 254 to
17289 * tests/regression.at (Web2c Actions): Ajust.
17291 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
17292 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
17293 passes, but produces negative #line number, once fixed, GCC is
17294 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
17296 * src/state.h (state_h): Code input lines on ints, not shorts.
17298 2002-04-08 Akim Demaille <akim@epita.fr>
17300 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
17301 and then the grammar.
17303 2002-04-08 Akim Demaille <akim@epita.fr>
17305 * src/system.h: No longer using strndup.
17307 2002-04-07 Akim Demaille <akim@epita.fr>
17309 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
17310 * src/output.c (output_table_data): Return the longest number.
17311 (prepare_tokens): Output `token_number_max').
17312 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
17314 Use them to define yy_token_number_type/TokenNumberType.
17315 Use this type for yytranslate.
17316 * tests/torture.at (Big triangle): Push the limit from 124 to
17318 * tests/regression.at (Web2c Actions): Adjust.
17320 2002-04-07 Akim Demaille <akim@epita.fr>
17322 * tests/torture.at (Big triangle): New.
17323 (GNU AWK Grammar, GNU Cim Grammar): Move to...
17324 * tests/existing.at: here.
17326 2002-04-07 Akim Demaille <akim@epita.fr>
17328 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
17330 Adjust dependencies.
17332 2002-04-07 Akim Demaille <akim@epita.fr>
17334 * src/reader.c: Normalize increments to prefix form.
17336 2002-04-07 Akim Demaille <akim@epita.fr>
17338 * src/reader.c, symtab.c: Remove debugging code.
17340 2002-04-07 Akim Demaille <akim@epita.fr>
17342 Rename all the `bucket's as `symbol_t'.
17344 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
17345 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
17346 * src/symtab.c, src/symtab.h (bucket): Rename as...
17348 (symbol_list_new, bucket_check_defined, bucket_make_alias)
17349 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
17350 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
17351 (buckets_new, buckets_free, buckets_do): Rename as...
17352 (symbol_list_new, symbol_check_defined, symbol_make_alias)
17353 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17354 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
17355 (symbols_new, symbols_free, symbols_do): these.
17357 2002-04-07 Akim Demaille <akim@epita.fr>
17359 Use lib/hash for the symbol table.
17361 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
17363 * src/lex.c (lex): Set the `number' member of new terminals.
17364 * src/reader.c (bucket_check_defined, bucket_make_alias)
17365 (bucket_check_alias_consistence, bucket_translation): New.
17366 (reader, grammar_free, readgram, token_translations_init)
17367 (packsymbols): Adjust.
17368 (reader): Number the predefined tokens.
17369 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
17370 for predefined tokens.
17371 * src/symtab.h (bucket): Remove all the hash table related
17373 * src/symtab.c (symtab): Replace by...
17374 (bucket_table): this.
17375 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
17376 (buckets_new, buckets_do): New.
17378 2002-04-07 Akim Demaille <akim@epita.fr>
17380 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
17381 (start_symbol, max_user_token_number, semantic_parser)
17382 (error_token_number): Initialize.
17383 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
17386 (errtoken, eoftoken, undeftoken, axiom): Extern.
17388 2002-04-07 Akim Demaille <akim@epita.fr>
17390 * src/gram.h (rule_s): prec and precsym are now pointers
17391 to the bucket giving the priority/associativity.
17392 Member `associativity' removed: useless.
17393 * src/reduce.c, src/conflicts.c: Adjust.
17395 2002-04-07 Akim Demaille <akim@epita.fr>
17397 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
17398 Properly escape the symbols' TAG when outputting them.
17400 2002-04-07 Akim Demaille <akim@epita.fr>
17402 * src/lalr.h (LA): Is a bitsetv, not bitset*.
17404 2002-04-07 Akim Demaille <akim@epita.fr>
17406 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
17407 (LArule): this, which is an array to rule_t*.
17408 * src/print.c, src/conflicts.c: Adjust.
17410 2002-04-07 Akim Demaille <akim@epita.fr>
17412 * src/gram.h (rule_t): Rename `number' as `user_number'.
17413 `number' is a new member.
17414 Adjust dependencies.
17415 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
17417 2002-04-07 Akim Demaille <akim@epita.fr>
17419 As a result of the previous patch, it is no longer needed
17420 to reorder ritem itself.
17422 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
17424 2002-04-07 Akim Demaille <akim@epita.fr>
17426 Be sure never to walk through RITEMS, but use only data related to
17427 the rules themselves. RITEMS should be banished.
17429 * src/output.c (output_token_translations): Rename as...
17430 (prepare_tokens): this.
17431 In addition to `translate', prepare the muscles `tname' and
17432 `toknum', which were handled by...
17433 (output_rule_data): this.
17434 Remove, and move the remainder of its outputs into...
17435 (prepare_rules): this new routines, which also merges content from
17436 (output_gram): this.
17437 (prepare_rules): Be sure never to walk through RITEMS.
17438 (output_stos): Rename as...
17439 (prepare_stos): this.
17440 (output): Always invoke prepare_states, after all, just don't use it
17441 in the output if you don't need it.
17443 2002-04-07 Akim Demaille <akim@epita.fr>
17445 * src/LR0.c (new_state): Display `nstates' as the name of the
17446 newly created state.
17447 Adjust to initialize first_state and last_state if needed.
17448 Be sure to distinguish the initial from the final state.
17449 (new_states): Create the itemset of the initial state, and use
17451 * src/closure.c (closure): Now that the initial state has its
17452 items properly set, there is no need for a special case when
17453 creating `ruleset'.
17455 As a result, now the rule 0, reducing to $axiom, is visible in the
17456 outputs. Adjust the test suite.
17458 * tests/conflicts.at (Solved SR Conflicts)
17459 (Unresolved SR Conflicts): Adjust.
17460 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
17461 * tests/conflicts.at (S/R in initial): New.
17463 2002-04-07 Akim Demaille <akim@epita.fr>
17465 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
17466 the RHS of the rules.
17467 * src/output.c (output_gram): Likewise.
17469 2002-04-07 Akim Demaille <akim@epita.fr>
17471 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
17473 Adjust all dependencies.
17474 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
17475 `number' of the buckets too.
17476 * src/gram.h: Include `symtab.h'.
17477 (associativity): Move to...
17478 * src/symtab.h: here.
17479 No longer include `gram.h'.
17481 2002-04-07 Akim Demaille <akim@epita.fr>
17483 * src/gram.h, src/gram.c (rules_rhs_length): New.
17484 (ritem_longest_rhs): Use it.
17485 * src/gram.h (rule_t): `number' is a new member.
17486 * src/reader.c (packgram): Set it.
17487 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
17488 the end of `rules', and count them out of `nrules'.
17489 (reduce_output, dump_grammar): Adjust.
17490 * src/print.c (print_grammar): It is no longer needed to check for
17491 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
17492 * tests/reduce.at (Reduced Automaton): New test.
17494 2002-04-07 Akim Demaille <akim@epita.fr>
17496 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
17497 lacking `+ 1' to nrules, Bison reported as useless a token if it
17498 was used solely to set the precedence of the last rule...
17500 2002-04-07 Akim Demaille <akim@epita.fr>
17502 * data/bison.c++, data/bison.simple: Don't output the current file
17503 name in #line, to avoid useless diffs between two identical
17504 outputs under different names.
17506 2002-04-07 Akim Demaille <akim@epita.fr>
17508 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
17509 Normalize loops to using `< nrules + 1', not `<= nrules'.
17511 2002-04-07 Akim Demaille <akim@epita.fr>
17515 2002-04-07 Akim Demaille <akim@epita.fr>
17517 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
17518 bucket.value as bucket.number.
17520 2002-04-07 Akim Demaille <akim@epita.fr>
17522 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
17523 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
17524 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
17525 RHS, instead of being an index in RITEMS.
17527 2002-04-04 Paul Eggert <eggert@twinsun.com>
17529 * doc/bison.texinfo: Update copyright date.
17530 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
17531 (Symbols): Warn about running Bison in one character set,
17532 but compiling and/or running in an incompatible one.
17533 Warn about character code 256, too.
17535 2002-04-03 Paul Eggert <eggert@twinsun.com>
17537 * src/bison.data (YYSTACK_ALLOC): Depend on whether
17538 YYERROR_VERBOSE is nonzero, not whether it is defined.
17540 Merge changes from bison-1_29-branch.
17542 2002-03-20 Paul Eggert <eggert@twinsun.com>
17544 Merge fixes from Debian bison_1.34-1.diff.
17546 * configure.in (AC_PREREQ): 2.53.
17548 2002-03-20 Akim Demaille <akim@epita.fr>
17550 * src/conflicts.c (log_resolution): Argument `resolution' is const.
17552 2002-03-19 Paul Eggert <eggert@twinsun.com>
17554 * src/bison.simple (YYCOPY): New macro.
17555 (YYSTACK_RELOCATE): Use it.
17556 Remove Type arg; no longer needed. All callers changed.
17557 (yymemcpy): Remove; no longer needed.
17559 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
17560 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
17562 2002-03-19 Akim Demaille <akim@epita.fr>
17564 Test and fix the #line outputs.
17566 * tests/atlocal.at (GCC): New.
17567 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
17568 (Prologue synch line, %union synch line, Postprologue synch line)
17569 (Action synch line, Epilogue synch line): New tests.
17570 * src/reader.c (parse_union_decl): Define the muscle stype_line.
17571 * data/bison.simple, data/bison.c++: Use it.
17573 2002-03-19 Akim Demaille <akim@epita.fr>
17575 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
17576 (Solved SR Conflicts, %expect not enough, %expect right)
17577 (%expect too much): Move to...
17578 * tests/conflicts.at: this new file.
17580 2002-03-19 Akim Demaille <akim@epita.fr>
17582 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
17583 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
17584 that we can move to enums for instance.
17585 * src/output.c (token_definitions_output): Output a list of
17586 `token-name, token-number' instead of the #define.
17587 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
17589 2002-03-14 Akim Demaille <akim@epita.fr>
17591 Use Gettext 0.11.1.
17593 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
17595 * data/bison.c++: Make the user able to add members to the generated
17596 parser by subclassing.
17598 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
17600 * src/reader.c (read_additionnal_code): `c' should be an integer, not
17602 Reported by Nicolas Tisserand and Nicolas Burrus.
17604 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
17606 * src/reader.c: Warn about lacking semi-colons, do not complain.
17608 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
17610 * data/bison.c++: Remove a debug line.
17612 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
17614 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
17615 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
17616 provide a default implementation.
17618 2002-03-04 Akim Demaille <akim@epita.fr>
17620 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
17621 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
17622 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
17623 * tests/semantic.at (Parsing Guards): Similarly.
17624 * src/reader.at (readgram): Complain if the last rule is not ended
17627 2002-03-04 Akim Demaille <akim@epita.fr>
17629 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
17630 * src/closure.c: here.
17631 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
17633 * src/warshall.h, src/warshall.c: Remove.
17634 * tests/sets.at (Broken Closure): Adjust.
17636 2002-03-04 Akim Demaille <akim@epita.fr>
17638 * src/output.c (output_skeleton): tempdir is const.
17639 bytes_read is unused.
17641 2002-03-04 Akim Demaille <akim@epita.fr>
17643 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
17644 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
17646 From Michael Hayes.
17648 2002-03-04 Akim Demaille <akim@epita.fr>
17650 * src/closure.c (closure): `r' is unused.
17652 2002-03-04 Akim Demaille <akim@epita.fr>
17654 * tests/sets.at (Broken Closure): Add the ending `;'.
17655 * src/reader.at (readgram): Complain if a rule is not ended with a
17658 2002-03-04 Akim Demaille <akim@epita.fr>
17660 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
17661 (count_sr_conflicts): Use bitset_count.
17662 * src/reduce.c (inaccessable_symbols): Ditto.
17663 (bits_size): Remove.
17664 * src/warshall.h, src/warshall.c: Convert to bitsetv.
17666 2002-03-04 Akim Demaille <akim@epita.fr>
17668 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
17669 * src/reduce.c: Remove the `bitset_zero's following the
17670 `bitset_create's, as now it is performed by the latter.
17672 2002-03-04 Akim Demaille <akim@epita.fr>
17674 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
17675 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
17676 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
17677 latest sources from Michael.
17679 2002-03-04 Akim Demaille <akim@epita.fr>
17681 * src/output.c (output): Don't free the grammar.
17682 * src/reader.c (grammar_free): New.
17683 * src/main.c (main): Call it and don't free symtab here.
17685 2002-03-04 Akim Demaille <akim@epita.fr>
17687 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
17689 Reported by Benoit Perrot.
17691 2002-03-04 Akim Demaille <akim@epita.fr>
17693 Use bitset operations when possible, not loops over bits.
17695 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
17697 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
17698 * src/reduce.c (useless_nonterminals): Formatting changes.
17699 * src/warshall.c (TC): Use bitset_or.
17701 2002-03-04 Akim Demaille <akim@epita.fr>
17703 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
17704 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
17707 2002-03-04 Akim Demaille <akim@epita.fr>
17709 * src/lalr.c (F): Now a bitset*.
17710 Adjust all dependencies.
17712 2002-03-04 Akim Demaille <akim@epita.fr>
17714 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
17715 Adjust all dependencies.
17717 2002-03-04 Akim Demaille <akim@epita.fr>
17719 * src/L0.c, src/LR0.h (nstates): Be size_t.
17720 Adjust comparisons (signed vs unsigned).
17721 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
17723 Adjust all dependencies.
17725 2002-03-04 Akim Demaille <akim@epita.fr>
17727 * src/closure.c (firsts): Now, also a bitset.
17728 Adjust all dependencies.
17729 (varsetsize): Remove, now unused.
17730 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
17732 2002-03-04 Akim Demaille <akim@epita.fr>
17734 * src/print.c: Convert to use bitset.h, not hand coded iterations
17737 2002-03-04 Akim Demaille <akim@epita.fr>
17739 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
17741 2002-03-04 Akim Demaille <akim@epita.fr>
17743 * src/closure.c (ruleset): Be a bitset.
17744 (rulesetsize): Remove.
17746 2002-03-04 Akim Demaille <akim@epita.fr>
17748 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
17749 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
17750 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
17751 * src/closure.c (fderives): Be an array of bitsets.
17753 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
17755 * data/bison.c++: Merge the two generated headers. Insert a copyright
17756 notice in each output file.
17758 2002-02-28 Akim Demaille <akim@epita.fr>
17760 * data/bison.c++: Copy the prologue of bison.simple to fetch
17761 useful M4 definitions, such as b4_header_guard.
17763 2002-02-25 Akim Demaille <akim@epita.fr>
17765 * src/getargs.c (version): Give the name of the authors, and use a
17766 translator friendly scheme for the bgr
17769 2002-02-25 Akim Demaille <akim@epita.fr>
17771 * src/output.c (header_output): Remove, now handled completely via
17774 2002-02-25 Akim Demaille <akim@epita.fr>
17776 * m4/m4.m4: New, from CVS Autoconf.
17777 * configure.in: Invoke it.
17778 * src/output.c (output_skeleton): Use its result instead of the
17781 2002-02-25 Akim Demaille <akim@epita.fr>
17783 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
17785 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
17786 * src/output.c (output_skeleton): Use mkstemp to create a real
17788 Move the filling of `skeleton' and its muscle to...
17790 (output): Move the definition of the prologue muscle to...
17792 * src/system.h (DEFAULT_TMPDIR): New.
17794 2002-02-14 Paul Eggert <eggert@twinsun.com>
17796 Remove the support for C++ namespace cleanliness; it was
17797 causing more problems than it was curing, since it didn't work
17798 properly on some nonstandard C++ compilers. This can wait
17799 for a proper C++ parser.
17801 * NEWS: Document this.
17802 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
17803 of C++, as it's treated like C now.
17804 * src/bison.simple (YYSTD): Remove.
17805 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
17806 Treat C++ just like Standard C instead of trying to support
17807 namespace cleanliness.
17809 2002-02-14 Akim Demaille <akim@epita.fr>
17811 * tests/regression.at (else): Adjust to Andreas' change.
17813 2002-02-14 Akim Demaille <akim@epita.fr>
17815 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
17817 2002-02-13 Andreas Schwab <schwab@suse.de>
17819 * src/output.c (output_rule_data): Don't output NULL, it might
17820 not be defined yet.
17822 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
17824 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
17825 (Copyright notice): Update.
17827 2002-02-11 Akim Demaille <akim@epita.fr>
17829 * tests/regression.at (%nonassoc and eof): Don't include
17830 nonportable headers.
17832 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
17834 * data/bison.c++: Correct error recovery. Make the user able to
17835 initialize the starting location.
17837 2002-02-07 Akim Demaille <akim@epita.fr>
17839 * tests/input.at: New.
17841 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17843 * data/bison.c++: Replace some direct m4 expansions by constants. Be
17844 more consistent when naming methods and variables. Put preprocessor
17845 directives around tables only needed for debugging.
17847 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17849 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
17851 (yy::b4_name::parse): Use print_.
17853 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17855 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
17857 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17859 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
17861 (yy::b4_name::parse): Build verbose error messages, and use error_.
17863 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
17865 * data/bison.c++: Fix m4 quoting in comments.
17867 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
17869 * data/bison.c++: Adjust the parser code. Fix some muscles that were
17870 not expanded by m4.
17872 2002-02-05 Akim Demaille <akim@epita.fr>
17874 * data/bison.c++: Adjust to the M4 back end.
17875 More is certainly needed.
17877 2002-02-05 Akim Demaille <akim@epita.fr>
17879 Give a try to M4 as a back end.
17881 * lib/readpipe.c: New, from wdiff.
17882 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
17884 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
17885 specific values. Now it is m4 that performs the lookup.
17886 * src/parse-skel.y: Remove.
17887 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
17888 * src/output.c (actions_output, guards_output)
17889 (token_definitions_output): No longer keeps track of the output
17890 line number, hence remove the second argument.
17891 (guards_output): Check against the guard member of a rule, not the
17894 (output_skeleton): Don't look for the skeleton location, let m4 do
17896 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
17898 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
17899 (prepare): Given that for the time being changesyntax is not
17900 usable in M4, rename the muscles using `-' to `_'.
17901 Define `defines_flag', `output_parser_name' and `output_header_name'.
17902 * src/output.h (actions_output, guards_output)
17903 (token_definitions_output): Adjust prototypes.
17904 * src/scan-skel.l: Instead of scanning the skeletons, it now
17905 processes the output of m4: `__oline__' and `#output'.
17906 * data/bison.simple: Adjust to be used by M4(sugar).
17907 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
17909 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
17910 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
17911 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
17912 shamelessly stolen from CVS Autoconf.
17914 2002-02-05 Akim Demaille <akim@epita.fr>
17916 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
17917 * configure.in: Check for the declarations of free and malloc.
17918 * src/muscle_tab.c: Adjust.
17920 2002-02-05 Akim Demaille <akim@epita.fr>
17922 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
17923 which have no values.
17925 2002-02-05 Akim Demaille <akim@epita.fr>
17927 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
17930 2002-01-29 Paul Eggert <eggert@twinsun.com>
17932 * src/bison.simple (YYSIZE_T): Do not define merely because
17933 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
17934 On some platforms, <alloca.h> does not declare YYSTD (size_t).
17936 2002-01-27 Akim Demaille <akim@epita.fr>
17938 Fix `%nonassoc and eof'.
17940 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
17941 which were not properly copied! Replace
17942 memcpy (res->errs, src->errs, src->nerrs);
17944 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
17946 * tests/regression.at (%nonassoc and eof): Adjust to newest
17947 Autotest: `.' is not in the PATH.
17949 2002-01-27 Akim Demaille <akim@epita.fr>
17951 * tests/sets.at (AT_EXTRACT_SETS): New.
17952 (Nullable): Use it.
17955 2002-01-26 Akim Demaille <akim@epita.fr>
17957 * tests/actions.at, tests/calc.at, tests/headers.at,
17958 * tests/torture.at: Adjust to the newest Autotest which no longer
17959 forces `.' in the PATH.
17961 2002-01-25 Akim Demaille <akim@epita.fr>
17963 * tests/regression.at (%nonassoc and eof): New.
17964 Suggested by Robert Anisko.
17966 2002-01-24 Akim Demaille <akim@epita.fr>
17968 Bison dumps core when trying to complain about broken input files.
17969 Reported by Cris van Pelt.
17971 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
17972 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
17974 (Invalid inputs): Strengthen: exercise parse_percent_token.
17976 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
17978 * src/Makefile.am: Add bison.c++.
17979 * src/bison.c++: New skeleton.
17981 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
17985 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
17987 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
17989 2002-01-20 Marc Autret <marc@gnu.org>
17991 * src/files.c (compute_output_file_names): Fix
17993 2002-01-20 Marc Autret <marc@gnu.org>
17995 * tests/output.at: New test.
17996 * src/files.c (compute_base_names): Don't map extensions when
17997 the YACC flag is set, use defaults.
17998 Reported by Evgeny Stambulchik.
18000 2002-01-20 Marc Autret <marc@gnu.org>
18002 * src/system.h: Need to define __attribute__ away for non-GCC
18003 compilers as well (i.e., the vendor C compiler).
18004 Suggested by Albert Chin-A-Young.
18006 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
18008 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
18009 canonical definition.
18010 * src/system.h: Use the canonical definition for PARAMS (avoids
18011 a conflict with the macro from lib/hash.h).
18013 2002-01-11 Akim Demaille <akim@epita.fr>
18015 * configure.in: Use AC_FUNC_STRNLEN.
18016 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
18018 2002-01-09 Akim Demaille <akim@epita.fr>
18020 * src/files.c, src/files.h (output_infix): New.
18021 (tab_extension): Remove.
18022 (compute_base_names): Compute the former, drop the latter.
18023 * src/output.c (prepare): Insert the muscles `output-infix', and
18025 * src/parse-skel.y (string, string.1): New.
18026 (section.header): Use it.
18027 (section.yacc): Remove.
18028 (prefix): Remove too.
18029 * src/scan-skel.l: Adjust.
18030 * src/bison.simple, src/bison.hairy: Adjust.
18032 2002-01-09 Akim Demaille <akim@epita.fr>
18034 * configure.in (WERROR_CFLAGS): Compute it.
18035 * src/Makefile.am (CFLAGS): Pass it.
18036 * tests/atlocal.in (CFLAGS): Idem.
18037 * src/files.c: Fix a few warnings.
18038 (get_extension_index): Remove, unused.
18040 2002-01-08 Akim Demaille <akim@epita.fr>
18042 * src/getargs.c (AS_FILE_NAME): New.
18043 (getargs): Use it to convert DOSish file names.
18044 * src/files.c (base_name): Rename as full_base_name to avoid
18045 clashes with `base_name ()'.
18046 (filename_split): New.
18047 (compute_base_names): N-th rewrite, using filename_split.
18049 2002-01-08 Akim Demaille <akim@epita.fr>
18051 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
18052 New, stolen from the Fileutils 4.1.
18053 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18054 * configure.in: Check for the presence of memrchr, and of its
18057 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
18059 * lib/hash.h (__P): Added definition for this macro.
18060 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
18061 BUILT_SOURCES, to ensure they are generated first.
18062 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
18063 %error-verbose to allow bootstrapping with bison 1.30x.
18065 2002-01-06 Akim Demaille <akim@epita.fr>
18067 * src/reader.c (parse_braces): Don't fetch the next char, the
18068 convention is to fetch on entry.
18069 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
18070 'switch' without a following semicolon.
18071 * tests/regression.at (braces parsing): New.
18073 2002-01-06 Akim Demaille <akim@epita.fr>
18075 Bison is dead wrong in its RR conflict reports.
18077 * tests/torture.at (GNU Cim Grammar): New.
18078 * src/conflicts.c (count_rr_conflicts): Fix.
18080 2002-01-06 Akim Demaille <akim@epita.fr>
18082 Creating package.m4 from configure.ac causes too many problems.
18084 * tests/Makefile.am (package.m4): Create it by hand,
18085 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
18087 2002-01-06 Akim Demaille <akim@epita.fr>
18089 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
18092 2002-01-04 Paul Eggert <eggert@twinsun.com>
18094 * doc/bison.texinfo (Debugging):
18095 Remove YYSTDERR; it's no longer defined or used.
18096 Also, s/cstdio.h/cstdio/.
18098 2002-01-03 Akim Demaille <akim@epita.fr>
18100 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
18102 2002-01-03 Akim Demaille <akim@epita.fr>
18104 * src/parse-skel.y (process_skeleton): Don't bind the parser's
18105 tracing code to --trace, wait for a better --trace option, with
18108 2002-01-03 Akim Demaille <akim@epita.fr>
18110 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
18111 The ISO C++ standard is extremely clear about it: stderr is
18112 considered a macro, not a regular symbol (see table 94 `Header
18113 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
18114 Therefore std:: does not apply to it. It still does with fprintf.
18115 Also, s/cstdio.h/cstdio/.
18117 2002-01-03 Akim Demaille <akim@epita.fr>
18119 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
18120 for non system headers.
18122 2002-01-02 Akim Demaille <akim@epita.fr>
18124 Equip the skeleton chain with location tracking, runtime trace,
18125 pure parser and scanner.
18127 * src/parse-skel.y: Request a pure parser, locations, and prefix
18129 (%union): Having several members with the same type does not help
18130 type mismatches, simplify.
18131 (YYPRINT, yyprint): New.
18132 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
18133 (skel_error): this.
18135 * src/scan-skel.l: Adjust to these changes.
18136 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
18137 (LOCATION_PRINT, skel_control_t): New.
18139 2001-12-30 Akim Demaille <akim@epita.fr>
18141 * src/parse-skel.y: Get rid of the shift/reduce conflict:
18142 replace `gb' with BLANKS.
18143 * src/scan-skel.l: Adjust.
18145 2001-12-30 Akim Demaille <akim@epita.fr>
18147 * src/system.h: We don't need nor want bcopy.
18148 Throw away MS-DOS crap: we don't need getpid.
18149 * configure.in: We don't need strndup. It was even causing
18150 problems: because Flex includes the headers *before* us,
18151 _GNU_SOURCE is not defined by config.h, and therefore strndup was
18153 * lib/xstrndup.c: New.
18154 * src/scan-skel.l: Use it.
18155 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
18156 * src/parse-skel.y: Use %directives instead of #defines.
18158 2001-12-30 Akim Demaille <akim@epita.fr>
18160 * src/skeleton.h: New.
18161 * src/output.c (output_parser, output_master_parser): Remove, dead
18163 * src/output.h (get_lines_number, actions_output, guards_output)
18164 (token_definitions_output): Prototype them.
18165 * src/parse-skel.y: Add the license notice.
18166 Include output.h and skeleton.h.
18167 (process_skeleton): Returns void, and takes a single parameter.
18168 * src/scan-skel.l: Add the license notice.
18169 Include skeleton.h.
18170 Don't use %option yylineno: it seems that then Flex imagines
18171 REJECT has been used, and therefore it won't reallocate its
18172 buffers (which makes no other sense to me than a bug). It results
18173 in warnings for `unused: yy_flex_realloc'.
18175 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
18177 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18178 (MUSCLE_INSERT_PREFIX): ...to there.
18179 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18180 (MUSCLE_INSERT_PREFIX): Move from here...
18182 * src/bison.hairy: Add a section directive. Put braces around muscle
18183 names. This parser skeleton is still broken, but Bison should not
18184 choke on a bad muscle 'syntax'.
18185 * src/bison.simple: Add a section directive. Put braces around muscle
18188 * src/files.h (strsuffix, stringappend): Add declarations.
18189 (tab_extension): Add declaration.
18190 (short_base_name): Add declaration.
18192 * src/files.c (strsuffix, stringappend): No longer static. These
18193 functions are used in the skeleton parser.
18194 (tab_extension): New.
18195 (compute_base_names): Use the computations done in this function
18196 to guess if the generated parsers should have '.tab' in their
18198 (short_base_name): No longer static.
18200 * src/output.c (output_skeleton): New.
18201 (output): Disable call to output_master_parser, and give a try to
18202 a new skeleton handling system.
18203 (guards_output, actions_output): No longer static.
18204 (token_definitions_output, get_lines_number): No longer static.
18206 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
18208 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
18211 * src/parse-skel.y: New file.
18212 * src/scan-skel.l: New file.
18214 2001-12-29 Akim Demaille <akim@epita.fr>
18216 %name-prefix is broken.
18218 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
18219 Adjust all dependencies.
18220 * tests/headers.at (export YYLTYPE): Strengthen this test: use
18223 Renaming yylval but not yylloc is not consistent. Now we do.
18225 * src/bison.simple: Prefix yylloc if used.
18226 * doc/bison.texinfo (Decl Summary): Document that.
18228 2001-12-29 Akim Demaille <akim@epita.fr>
18230 * doc/bison.texinfo: Promote `%long-directive' over
18232 Remove all references to fixed-output-files, yacc is enough.
18234 2001-12-29 Akim Demaille <akim@epita.fr>
18236 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
18237 user prologue. These are defaults.
18238 * tests/actions.at (Mid-rule actions): Make sure the user can
18239 define YYDEBUG and YYERROR_VERBOSE.
18241 2001-12-29 Akim Demaille <akim@epita.fr>
18243 * src/output.c (header_output): Don't forget to export YYLTYPE and
18245 * tests/headers.at (export YYLTYPE): New, make sure it does.
18246 * tests/regression.at (%union and --defines, Invalid CPP headers):
18248 * tests/headers.at: here.
18250 2001-12-29 Akim Demaille <akim@epita.fr>
18252 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
18254 2001-12-29 Akim Demaille <akim@epita.fr>
18256 * tests/actions.at (Mid-rule actions): Output on a single line
18257 instead of several.
18259 2001-12-29 Akim Demaille <akim@epita.fr>
18261 * doc/bison.texinfo: Formatting changes.
18263 2001-12-29 Akim Demaille <akim@epita.fr>
18265 Don't store the token defs in a muscle, just be ready to output it
18266 on command. Now possible via `symbols'. Fixes a memory leak.
18268 * src/output.c (token_definitions_output): New.
18269 (output_parser, header_output): Use it.
18270 * src/reader.c (symbols_save): Remove.
18272 2001-12-29 Akim Demaille <akim@epita.fr>
18274 * src/bison.simple: Do not provide a default for YYSTYPE and
18275 YYLTYPE before the user's prologue. Otherwise it's hardly... a
18278 2001-12-29 Akim Demaille <akim@epita.fr>
18280 Mid-rule actions are simply... ignored!
18282 * src/reader.c (readgram): Be sure to attach mid-rule actions to
18283 the empty-rule associated to the dummy symbol, not to the host
18285 * tests/actions.at (Mid-rule actions): New.
18287 2001-12-29 Akim Demaille <akim@epita.fr>
18291 * src/reader.c (reader): Free grammar.
18293 2001-12-29 Akim Demaille <akim@epita.fr>
18297 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
18298 since it allocates it for each state, although only one is needed.
18299 (allocate_storage): Do it here.
18301 2001-12-29 Akim Demaille <akim@epita.fr>
18303 * src/options.h, src/options.c (create_long_option_table): Rename
18305 (long_option_table_new): this, with a clearer prototype.
18306 (percent_table): Remove, unused,
18307 * src/getargs.c (getargs): Adjust.
18309 2001-12-29 Akim Demaille <akim@epita.fr>
18311 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
18312 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
18315 2001-12-29 Akim Demaille <akim@epita.fr>
18317 * src/lalr.c (build_relations): Rename `states' as `states1'.
18318 Sorry, I don't understand exactly what it is, no better name...
18320 2001-12-29 Akim Demaille <akim@epita.fr>
18322 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
18323 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
18324 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
18327 2001-12-29 Akim Demaille <akim@epita.fr>
18329 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
18332 2001-12-29 Akim Demaille <akim@epita.fr>
18334 * src/reader.c, src/reader.h (user_toknums): Remove.
18335 Adjust all users to use symbols[i]->user_token_number.
18337 2001-12-29 Akim Demaille <akim@epita.fr>
18339 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
18340 Adjust all users to use symbols[i]->prec or ->assoc.
18342 2001-12-29 Akim Demaille <akim@epita.fr>
18344 * src/reader.c, src/reader.h (tags): Remove.
18345 Adjust all users to use symbols[i]->tag.
18347 2001-12-29 Akim Demaille <akim@epita.fr>
18349 * src/gram.h, src/gram.c (symbols): New, similar to state_table
18351 * src/reader.c (packsymbols): Fill this table.
18353 * src/conflicts.c (resolve_sr_conflict): Adjust.
18354 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
18356 Use symbols[i]->tag instead of tags[i].
18358 2001-12-29 Akim Demaille <akim@epita.fr>
18360 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
18361 In addition, put a comment in there, to replace...
18362 * tests/regression.at (%union and C comments): Remove.
18364 2001-12-29 Akim Demaille <akim@epita.fr>
18366 * tests/regression.at (Web2c Actions): Blindly move the actual
18367 output as expected output. The contents *seem* right to me, but I
18368 can't pretend reading perfectly parser tables... Nonetheless, all
18369 the other tests pass correctly, the table look OK, even though the
18370 presence of `$axiom' is to be noted: AFAICS it is useless (but
18373 2001-12-29 Akim Demaille <akim@epita.fr>
18375 * src/reader.c (readgram): Don't add the rule 0 if there were no
18376 rules read. In other words, add it _after_ having performed
18377 grammar sanity checks.
18378 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
18380 2001-12-29 Akim Demaille <akim@epita.fr>
18382 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
18383 visible, and some states have now a different number.
18385 2001-12-29 Akim Demaille <akim@epita.fr>
18387 * src/reader.c (readgram): Bind the initial rule's lineno to that
18389 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
18390 (Solved SR Conflicts): Adjust rule 0's line number.
18392 2001-12-29 Akim Demaille <akim@epita.fr>
18394 Fix the `GAWK Grammar' failure.
18396 * src/LR0.c (final_state): Initialize to -1 so that we do compute
18397 the reductions of the first state which was mistakenly confused
18398 with the final state because precisely final_state was initialized
18400 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
18401 now noticed by Bison.
18402 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
18403 have a reduction on $default.
18405 2001-12-29 Akim Demaille <akim@epita.fr>
18407 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
18409 * src/closure.c (print_closure): Likewise.
18410 * src/derives.c (print_derives): Likewise.
18411 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
18414 2001-12-29 Akim Demaille <akim@epita.fr>
18416 * src/lalr.c (lookaheads_print): New.
18417 (lalr): Call it when --trace-flag.
18418 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
18421 2001-12-29 Akim Demaille <akim@epita.fr>
18423 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
18424 when walking through ritem, even via rule->rhs.
18425 * src/reduce.c (dump_grammar, useful_production, reduce_output)
18426 (useful_production, useless_nonterminals): Likewise.
18427 (reduce_grammar_tables): Likewise, plus update nritems.
18428 * src/nullable.c (set_nullable): Likewise.
18429 * src/lalr.c (build_relations): Likewise.
18430 * tests/sets.at (Nullable): Adjust.
18431 Fortunately, now, the $axiom is no longer nullable.
18433 2001-12-29 Akim Demaille <akim@epita.fr>
18435 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
18437 * src/gram.c (ritem_longest_rhs): Likewise.
18438 * src/reduce.c (nonterminals_reduce): Likewise.
18439 * src/print_graph.c (print_graph): Likewise.
18440 * src/output.c (output_rule_data): Likewise.
18441 * src/nullable.c (set_nullable): Likewise.
18443 2001-12-29 Akim Demaille <akim@epita.fr>
18445 * src/output.c: Comment changes.
18447 2001-12-27 Paul Eggert <eggert@twinsun.com>
18449 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
18450 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
18451 Sparc, as they were causing more porting problems than the
18452 (minor) performance improvement was worth.
18454 Also, catch up with 1.31's YYSTD.
18456 2001-12-27 Akim Demaille <akim@epita.fr>
18458 * src/output.c (output_gram): Rely on nritems, not the
18459 0-sentinel. See below.
18460 Use -1 as separator, not 0.
18461 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
18462 Rely on -1 as separator in yyrhs, instead of 0.
18463 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
18464 twice `Now at end of input', therefore there are two lines less to
18467 2001-12-27 Akim Demaille <akim@epita.fr>
18469 * tests/regression.at (Unresolved SR Conflicts):
18470 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
18473 2001-12-27 Akim Demaille <akim@epita.fr>
18475 * src/LR0.c (new_state): Recognize the final state by the fact it
18476 is reached by eoftoken.
18477 (insert_start_shifting_state, insert_eof_shifting_state)
18478 (insert_accepting_state, augment_automaton): Remove, since now
18479 these states are automatically computed from the initial state.
18480 (generate_states): Adjust.
18481 * src/print.c: When reporting a rule number to the user, substract
18482 1, so that the axiom rule is rule 0, and the first user rule is 1.
18483 * src/reduce.c: Likewise.
18484 * src/print_graph.c (print_core): For the time being, just as for
18485 the report, depend upon --trace-flags to dump the full set of
18487 * src/reader.c (readgram): Once the grammar read, insert the rule
18488 0: `$axiom: START-SYMBOL $'.
18489 * tests/set.at: Adjust: rule 0 is now displayed, and since the
18490 number of the states has changed (the final state is no longer
18491 necessarily the last), catch up.
18493 2001-12-27 Akim Demaille <akim@epita.fr>
18495 Try to make the use of the eoftoken valid. Given that its value
18496 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
18497 is used instead of > 0 where appropriate, (ii), depend upon nritems
18498 instead of the 0-sentinel.
18500 * src/gram.h, src/gram.c (nritems): New.
18501 Expected to be duplication of nitems, but for the time being...
18502 * src/reader.c (packgram): Assert nritems and nitems are equal.
18503 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
18504 * src/closure.c (print_closure, print_fderives): Likewise.
18505 * src/gram.c (ritem_print): Likewise.
18506 * src/print.c (print_core, print_grammar): Likewise.
18507 * src/print_graph.c: Likewise.
18509 2001-12-27 Akim Demaille <akim@epita.fr>
18511 * src/main.c (main): If there are complains after grammar
18512 reductions, then output the report anyway if requested, then die.
18513 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
18514 * src/reader.c (eoftoken): New.
18515 (parse_token_decl): If the token being defined has value `0', it
18517 (packsymbols): No longer hack `tags' to insert `$' by hand.
18518 Be sure to preserve the value of the eoftoken.
18519 (reader): Make sure eoftoken is defined.
18520 Initialize nsyms to 0: now eoftoken is created just like the others.
18521 * src/print.c (print_grammar): Don't special case the eof token.
18522 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
18523 lie anyway, albeit pleasant.
18524 * tests/calc.at: Exercise error messages with eoftoken.
18525 Change the grammar so that empty input is invalid.
18526 Adjust expectations.
18527 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
18529 2001-12-27 Akim Demaille <akim@epita.fr>
18531 * configure.in: Check the protos of strchr ans strspn.
18532 Replace strchr if needed.
18533 * src/system.h: Provide the protos of strchr, strspn and memchr if
18535 * lib/strchr.c: New.
18536 * src/reader.c (symbols_save): Use strchr.
18538 2001-12-27 Akim Demaille <akim@epita.fr>
18540 * src/print.c, src/print_graph.c (escape): New.
18541 Use it to quote the TAGS outputs.
18542 * src/print_graph.c (print_state): Now errors are in red, and
18543 reductions in green.
18544 Prefer high to wide: output the state number on a line of its own.
18546 2001-12-27 Akim Demaille <akim@epita.fr>
18548 * src/state.h, src/state.c (reductions_new): New.
18549 * src/LR0.c (set_state_table): Let all the states have a
18550 `reductions', even if reduced to 0.
18551 (save_reductions): Adjust.
18552 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
18553 * src/print.c (print_reductions, print_actions): Adjust.
18554 * src/output.c (action_row): Adjust.
18556 2001-12-27 Akim Demaille <akim@epita.fr>
18558 * src/state.h, src/state.c (errs_new, errs_dup): New.
18559 * src/LR0.c (set_state_table): Let all the states have an errs,
18560 even if reduced to 0.
18561 * src/print.c (print_errs, print_reductions): Adjust.
18562 * src/output.c (output_actions, action_row): Adjust.
18563 * src/conflicts.c (resolve_sr_conflict): Adjust.
18565 2001-12-27 Akim Demaille <akim@epita.fr>
18567 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
18569 2001-12-27 Akim Demaille <akim@epita.fr>
18571 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
18572 * src/print.c: here.
18573 (lookaheadset, shiftset): New, used as additional storage by
18575 (print_results): Adjust.
18576 (print_shifts, print_gotos, print_errs): New, extracted from...
18577 (print_actions): here.
18578 * src/print_graph.c (print_actions): Remove dead code.
18580 2001-12-27 Akim Demaille <akim@epita.fr>
18582 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
18585 2001-12-27 Akim Demaille <akim@epita.fr>
18587 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
18588 (build_relations): Adjust.
18590 2001-12-27 Akim Demaille <akim@epita.fr>
18592 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
18595 2001-12-27 Akim Demaille <akim@epita.fr>
18597 * src/reader.c (packgram): Catch nitems overflows.
18599 2001-12-27 Akim Demaille <akim@epita.fr>
18601 * src/files.c, src/files.h (guard_obstack): Remove.
18602 * src/output.c (output): Adjust.
18603 * src/reader.c (parse_braces): New, factoring...
18604 (copy_action, copy_guard): these two which are renamed as...
18605 (parse_action, parse_guard): these.
18606 As a voluntary consequence, using braces around guards is now
18609 2001-12-27 Akim Demaille <akim@epita.fr>
18611 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
18612 * src/reader.c (symbol_list): `guard' and `guard_line' are new
18614 (symbol_list_new): Adjust.
18615 (copy_action): action_line is the first line, not the last.
18616 (copy_guard): Just as for actions, store the `action' only, not
18617 the switch/case/break flesh.
18618 Don't parse the user action that might follow the guard, let...
18619 (readgram): do it, i.e., now, there can be an action after a
18621 In other words the guard is just explicitly optional.
18622 (packgram): Adjust.
18623 * src/output.c (guards_output): New.
18624 (output_parser): Call it when needed.
18625 (output): Also free the guard and attrs obstacks.
18626 * src/files.c, src/files.h (obstack_save): Remove.
18627 (output_files): Remove.
18628 As a result, if one needs the former `.act' file, using an
18629 appropriate skeleton which requires actions and guards is now
18631 * src/main.c (main): Adjust.
18632 * tests/semantic.at: New.
18633 * tests/regression.at: Use `input.y' as input file name.
18634 Avoid 8+3 problems by requiring input.c when the test needs the
18637 2001-12-27 Akim Demaille <akim@epita.fr>
18639 * src/reader.c (symbol_list_new): Be sure to initialize all the
18642 2001-12-27 Akim Demaille <akim@epita.fr>
18644 All the hacks using a final pseudo state are now useless.
18646 * src/LR0.c (set_state_table): state_table holds exactly nstates.
18647 * src/lalr.c (nLA): New.
18648 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
18649 instead of lookaheadsp from the pseudo state (nstate + 1).
18651 2001-12-27 Akim Demaille <akim@epita.fr>
18653 * src/output.c (action_row, token_actions): Use a state_t instead
18654 of a integer, and nlookaheads instead of the following state's
18657 2001-12-27 Akim Demaille <akim@epita.fr>
18659 * src/conflicts.c (log_resolution, flush_shift)
18660 (resolve_sr_conflict, set_conflicts, solve_conflicts)
18661 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
18662 (conflicts_print, print_reductions): Use a state_t instead of an
18663 integer when referring to a state.
18664 As much as possible, depend upon nlookaheads, instead of the
18665 `lookaheadsp' member of the following state (since lookaheads of
18666 successive states are successive, the difference between state n + 1
18667 and n served as the number of lookaheads for state n).
18668 * src/lalr.c (add_lookback_edge): Likewise.
18669 * src/print.c (print_core, print_actions, print_state)
18670 (print_results): Likewise.
18671 * src/print_graph.c (print_core, print_actions, print_state)
18672 (print_graph): Likewise.
18673 * src/conflicts.h: Adjust.
18675 2001-12-27 Akim Demaille <akim@epita.fr>
18677 * src/bison.hairy: Formatting/comment changes.
18679 Remove `register' indications.
18680 Add plenty of `static'.
18682 2001-12-27 Akim Demaille <akim@epita.fr>
18684 * src/output.c (prepare): Drop the muscle `ntbase' which
18685 duplicates ntokens.
18686 * src/bison.simple: Formatting/comment changes.
18687 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
18688 is an undocumented synonym.
18690 2001-12-22 Akim Demaille <akim@epita.fr>
18692 * src/output.c (output_table_data): Change the prototype to use
18693 `int' for array ranges: some invocations do pass an int, not a
18695 Reported by Wayne Green.
18697 2001-12-22 Akim Demaille <akim@epita.fr>
18699 Some actions of web2c.y are improperly triggered.
18700 Reported by Mike Castle.
18702 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
18703 * tests/regression.at (Web2c): Rename as...
18704 (Web2c Report): this.
18705 (Web2c Actions): New.
18707 2001-12-22 Akim Demaille <akim@epita.fr>
18709 Reductions in web2c.y are improperly reported.
18710 Reported by Mike Castle.
18712 * src/conflicts.c (print_reductions): Fix.
18713 * tests/regression.at (Web2c): New.
18715 2001-12-18 Akim Demaille <akim@epita.fr>
18717 Some host fail on `assert (!"foo")', which expands to
18718 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
18719 Reported by Nelson Beebee.
18721 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
18722 `#define it_succeeded 0' and `assert (it_succeeded)'.
18724 2001-12-17 Marc Autret <autret_m@epita.fr>
18726 * src/bison.simple: Don't hard code the skeleton line and filename.
18727 * src/output.c (output_parser): Rename 'line' as 'output_line'.
18728 New line counter 'skeleton_line' (skeleton-line muscle).
18730 2001-12-17 Paul Eggert <eggert@twinsun.com>
18732 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
18733 YYDEBUG must be defined to a nonzero value.
18735 * src/bison.simple (yytname): Do not assume that the user defines
18736 YYDEBUG to a properly parenthesized expression.
18738 2001-12-17 Akim Demaille <akim@epita.fr>
18740 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
18741 nlookaheads is a new member.
18743 * src/lalr.h (nlookaheads): Remove this orphan declaration.
18744 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
18747 2001-12-17 Akim Demaille <akim@epita.fr>
18749 * src/files.h, src/files.c (open_files, close_files): Remove.
18750 * src/main.c (main): Don't open/close files, nor invoke lex_free,
18752 * src/reader.c (reader): Do it.
18754 2001-12-17 Akim Demaille <akim@epita.fr>
18756 * src/conflicts.c (print_reductions): Formatting changes.
18758 2001-12-17 Akim Demaille <akim@epita.fr>
18760 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
18761 (flush_reduce): New.
18762 (resolve_sr_conflict): Adjust.
18764 2001-12-17 Akim Demaille <akim@epita.fr>
18766 * src/output.c (output_obstack): Be static and rename as...
18767 (format_obstack): this, to avoid any confusion with files.c's
18769 * src/reader.h (muscle_obstack): Move to...
18770 * src/output.h: here, since it's defined in output.c.
18772 2001-12-17 Akim Demaille <akim@epita.fr>
18774 * src/output.c (action_row, save_column, default_goto)
18775 (sort_actions, matching_state, pack_vector): Better variable
18778 2001-12-17 Akim Demaille <akim@epita.fr>
18780 * src/output.c: Various formatting changes.
18782 2001-12-17 Akim Demaille <akim@epita.fr>
18784 * src/files.c (output_files): Free the output_obstack.
18785 * src/main.c (main): Call print and print_graph conditionally.
18786 * src/print.c (print): Work unconditionally.
18787 * src/print_graph.c (print_graph): Work unconditionally.
18788 * src/conflicts.c (log_resolution): Output only if verbose_flag.
18790 2001-12-16 Marc Autret <autret_m@epita.fr>
18792 * src/output.c (actions_output): Fix. When we use %no-lines,
18793 there is one less line per action.
18795 2001-12-16 Marc Autret <autret_m@epita.fr>
18797 * src/bison.simple: Remove a useless #line directive.
18798 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
18799 * src/output.c (get_lines_number): New.
18800 (output_parser): Adjust, now takes care about the lines of a
18802 Fix line numbering.
18803 (actions_output): Computes the number of lines taken by actions.
18804 (output_master_parser): Insert new skeleton which is the name of
18805 the output parser file name.
18807 2001-12-15 Marc Autret <autret_m@epita.fr>
18809 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
18811 2001-12-15 Marc Autret <autret_m@epita.fr>
18813 * src/output.c (output_gram): Keep track of the hairy one.
18815 2001-12-15 Akim Demaille <akim@epita.fr>
18817 Make `make distcheck' work.
18819 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
18820 system.h which uses libgettext.h.
18822 2001-12-15 Akim Demaille <akim@epita.fr>
18824 * src/nullable.c (set_nullable): Useless rules must be skipped,
18825 otherwise, since we range over their symbols, we might look at a
18826 nonterminal which no longer ``exists'', i.e., it is not counted in
18827 `nvars', hence we overflow our arrays.
18829 2001-12-15 Akim Demaille <akim@epita.fr>
18831 The header can also be produced directly, without any obstack!
18834 * src/files.c, src/files.h (defines_obstack): Remove.
18835 (compute_header_macro): Global.
18836 (defines_obstack_save): Remove.
18837 * src/reader.c (parse_union_decl): No longer output to
18838 defines_obstack: its content can be found in the `stype' muscle
18840 (output_token_translations): Merge into...
18841 (symbols_output): this.
18843 (symbols_save): this.
18845 * src/output.c (header_output): New.
18848 2001-12-15 Akim Demaille <akim@epita.fr>
18850 * src/reader.c (parse_union_decl): Instead of handling two obstack
18851 simultaneously, use one to define the `stype' muscle, and use the
18852 value of the latter to fill defines_obstack.
18853 (copy_comment): Remove.
18854 (copy_comment2): Work for a single obstack.
18856 (copy_comment): this.
18858 2001-12-15 Akim Demaille <akim@epita.fr>
18860 * src/lex.c, src/lex.h (xgetc): No longer static.
18861 * src/reader.c (parse_union_decl): Revamp.
18863 2001-12-15 Akim Demaille <akim@epita.fr>
18865 Still making progress in separating Bison into (i) input, (ii)
18866 process, (iii) output: now we can directly output the parser file
18867 without using table_obstack at all.
18869 * src/files.c, src/files.h (table_obstack): Bye bye.
18870 (parser_file_name): New.
18871 * src/files.c (compute_output_file_names): Compute it.
18872 * src/output.c (actions_output, output_parser)
18873 (output_master_parser): To a file instead of an obstack.
18875 2001-12-15 Akim Demaille <akim@epita.fr>
18877 Attach actions to rules, instead of pre-outputting them to
18880 * src/gram.h (rule_t): action and action_line are new members.
18881 * src/reader.c (symbol_list): Likewise.
18882 (copy_action): Save the actions within the rule.
18883 (packgram): Save them in rule_table.
18884 * src/output.c (actions_output): New.
18885 (output_parser): Use it on `%%actions'.
18886 (output_rule_data): Don't free rule_table.
18888 (prepare): Don't save the `action' muscle.
18889 * src/bison.simple: s/%%action/%%actions/.
18891 2001-12-15 Akim Demaille <akim@epita.fr>
18893 * src/reader.c (copy_action): When --yacc, don't append a `;'
18894 to the user action: let it fail if lacking.
18895 Suggested by Arnold Robbins and Tom Tromey.
18897 2001-12-14 Akim Demaille <akim@epita.fr>
18899 * src/lex.c (literalchar): Simply return the char you decoded, non
18900 longer mess around with obstacks and int pointers.
18901 Adjust all callers.
18903 2001-12-14 Akim Demaille <akim@epita.fr>
18905 * src/lex.c (literalchar): Don't escape the special characters,
18906 just decode them, and keep them as char (before, eol was output as
18907 the 2 char string `\n' etc.).
18908 * src/output.c (output_rule_data): Use quotearg to output the
18911 2001-12-13 Paul Eggert <eggert@twinsun.com>
18913 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
18914 Do not infringe on the global user namespace when using C++.
18915 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
18916 All uses of `fprintf' and `stderr' changed.
18918 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
18920 2001-12-13 Akim Demaille <akim@epita.fr>
18922 The computation of nullable is broken: it doesn't handle empty
18925 * tests/torture.at (GNU AWK Grammar): New.
18926 * tests/sets.at (Nullable): New.
18927 * src/nullable.c (set_nullable): Instead of blindly looping over
18928 `ritems', loop over the rules, and then over their rhs's.
18930 Work around Autotest bugs.
18932 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
18933 frame, because Autotest understand lines starting with a `+' as
18934 traces from the shell. Then, they are not processed properly.
18935 Admittedly an Autotest bug, but we don't have time to wait for
18936 Autotest to catch up.
18937 * tests/regression.at (Broken Closure): Adjust to the new table
18940 * tests/sets.at: here.
18942 2001-12-13 Akim Demaille <akim@epita.fr>
18944 * src/closure.c (closure): Use nrules instead of playing tricks
18945 with BITS_PER_WORD.
18947 2001-12-13 Akim Demaille <akim@epita.fr>
18949 * src/print.c (print_actions): Output the handling of `$' as the
18950 traces do: shifting the token EOF. Before EOF was treated as a
18952 * tests/regression.at: Adjust some tests.
18953 * src/print_graph.c (print_core): Complete the set of items via
18954 closure. The next-to-final and final states are still unsatisfying,
18955 but that's to be addressed elsewhere.
18956 No longer output the rule numbers, but do output the state number.
18957 A single loop for the shifts + gotos is enough, but picked a
18958 distinct color for each.
18959 (print_graph): Initialize and finalize closure.
18961 2001-12-13 Akim Demaille <akim@epita.fr>
18963 * src/reader.c (readgram): Remove dead code, an strip useless
18965 (get_type): Remove, unused.
18967 2001-12-12 Akim Demaille <akim@epita.fr>
18969 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
18970 on that of lib/error.c.
18972 2001-12-12 Akim Demaille <akim@epita.fr>
18974 Some hosts don't like `/' in includes.
18976 * src/system.h: Include libgettext.h without qualifying the path.
18977 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
18980 2001-12-11 Marc Autret <autret_m@epita.fr>
18982 * src/output.c (output_parser): Remove useless muscle.
18984 2001-12-11 Marc Autret <autret_m@epita.fr>
18986 * src/bison.simple: Remove #line just before %%epilogue. It
18987 is now handled in ...
18988 * src/reader.c (read_additionnal_code): Add the output of a
18989 #line for the epilogue.
18991 2001-12-10 Marc Autret <autret_m@epita.fr>
18993 * src/reader.c (copy_definition): Re-use CPP-outed code which
18994 replace precedent remove.
18995 * src/bison.simple: Remove #line before %%prologue because
18996 %%input-line is wrong at this time.
18998 2001-12-10 Marc Autret <autret_m@epita.fr>
19000 * src/reader.c (symbols_output): Clean up.
19001 * src/output.c (output_gram, output): Clean up.
19003 2001-12-10 Akim Demaille <akim@epita.fr>
19005 * src/lalr.c (initialize_lookaheads): New. Extracted from...
19006 * src/LR0.c (set_state_table): here.
19007 * src/lalr.c (lalr): Call it.
19009 2001-12-10 Akim Demaille <akim@epita.fr>
19011 * src/state.h (shifts): Remove the `number' member: shifts are
19012 attached to state, hence no longer need to be labelled with a
19015 2001-12-10 Akim Demaille <akim@epita.fr>
19017 Now that states have a complete set of members, the linked list of
19018 shifts is useless: just fill directly the state's shifts member.
19020 * src/state.h (shifts): Remove the `next' member.
19021 * src/LR0.c (first_state, last_state): Remove.
19022 Adjust the callers.
19023 (augment_automaton): Don't look for the shifts that must be added
19024 a shift on EOF: it is those of the state we looked for! But now,
19025 since shifts are attached, it is no longer needed to looking
19026 merely by its id: its number.
19028 2001-12-10 Akim Demaille <akim@epita.fr>
19030 * src/LR0.c (augment_automaton): Better variable locality.
19031 Remove an impossible branch: if there is a state corresponding to
19032 the start symbol being shifted, then there is shift for the start
19033 symbol from the initial state.
19035 2001-12-10 Akim Demaille <akim@epita.fr>
19037 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
19038 only when appropriate: when insert_start_shifting_state' is not
19040 * tests/regression.at (Rule Line Numbers): Adjust.
19042 2001-12-10 Akim Demaille <akim@epita.fr>
19044 * src/LR0.c (augment_automaton): Now that all states have shifts,
19045 merge the two cases addition shifts to the initial state.
19047 2001-12-10 Akim Demaille <akim@epita.fr>
19049 * src/lalr.c (set_state_table): Move to...
19051 * src/lalr.c (lalr): Don't call it...
19052 * src/LR0.c (generate_states): do it.
19053 * src/LR0.h (first_state): Remove, only the table is used.
19055 2001-12-10 Akim Demaille <akim@epita.fr>
19057 * src/LR0.h (first_shift, first_reduction): Remove.
19058 * src/lalr.c: Don't use first_shift: find shifts through the
19061 2001-12-10 Akim Demaille <akim@epita.fr>
19063 * src/LR0.c: Attach shifts to states as soon as they are
19065 * src/lalr.c (set_state_table): Instead of assigning shifts to
19066 state, just assert that the mapping was properly done.
19068 2001-12-10 Akim Demaille <akim@epita.fr>
19070 * src/LR0.c (insert_start_shift): Rename as...
19071 (insert_start_shifting_state): this.
19072 (insert_eof_shifting_state, insert_accepting_state): New.
19073 (augment_automaton): Adjust.
19074 Better locality of the variables.
19075 When looking if the start_symbol is shifted from the initial
19076 state, using `while (... symbol != start_symbol ...)' sounds
19077 better than `while (... symbol < start_symbol ...)': If fail
19078 to see how the order between symbols could be relevant!
19080 2001-12-10 Akim Demaille <akim@epita.fr>
19082 * src/getargs.h: Don't declare `spec_name_prefix' and
19083 `spec_file_prefix', declared by src/files.h.
19084 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
19085 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
19086 * src/output.c (prepare): Adjust.
19087 * src/reader.c (symbols_output): Likewise.
19088 * src/vmsgetargs.c: Vaguely adjust, but who cares?
19090 2001-12-10 Akim Demaille <akim@epita.fr>
19092 * src/muscle_tab.c (muscle_init): NULL is a better default than
19095 2001-12-10 Akim Demaille <akim@epita.fr>
19097 * src/reader.c (reader): Calling symbols_output once is enough.
19099 2001-12-10 Akim Demaille <akim@epita.fr>
19101 Now that states have a complete set of members, the linked list of
19102 reductions is useless: just fill directly the state's reductions
19105 * src/state.h (struct reductions): Remove member `number' and
19107 * src/LR0.c (first_reduction, last_reduction): Remove.
19108 (save_reductions): Don't link the new reductions, store them in
19110 * src/lalr.c (set_state_table): No need to attach reductions to
19111 states, it's already done.
19112 * src/output.c (output_actions): No longer free the shifts, then
19113 the reductions, then the states: free all the states and their
19116 2001-12-10 Akim Demaille <akim@epita.fr>
19118 * src/options.c (OPTN, DRTV, BOTH): New.
19119 (option_table): Use them.
19121 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
19122 the job of system.h.
19123 * src/options.c: Don't include stdio.h and xalloc.h for the same
19126 2001-12-10 Akim Demaille <akim@epita.fr>
19128 * src/output.c (output, prepare): Make sure the values of the
19129 muscles `action' and `prologue' are 0-terminated.
19131 2001-12-10 Akim Demaille <akim@epita.fr>
19133 Clean up GCC warnings.
19135 * src/reader.c (copy_action): `buf' is not used.
19136 (parse_skel_decl): Be static.
19137 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
19138 * src/options.h (create_long_option_table): Have a real prototype.
19139 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
19140 (hash_delete_at): Return const void *.
19141 Adjust casts to preserve the const.
19143 2001-12-10 Akim Demaille <akim@epita.fr>
19145 * configure.in: Require 2.52g.
19146 M4 is not needed, but AUTOM4TE is.
19147 * m4/m4.m4: Remove.
19148 * tests/Makefile.am: Adjust.
19150 2001-12-10 Akim Demaille <akim@epita.fr>
19152 One structure for states is enough, even though theoretically
19153 there are LR(0) states and LALR(1) states.
19155 * src/lalr.h (state_t): Remove.
19156 (state_table): Be state_t **, not state_t *.
19157 * src/state.h (core, CORE_ALLOC): Rename as...
19158 (state_t, STATE_ALLOC): this.
19159 Add the LALR(1) members: shifts, reductions, errs.
19160 * src/LR0.c (state_table): Rename as...
19161 (state_hash): this, to avoid name clashes with the global
19163 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
19164 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
19166 2001-12-10 Akim Demaille <akim@epita.fr>
19168 Bison dumps core on bash.y.
19169 Reported by Pascal Bart.
19171 * src/warshall.c (bitmatrix_print): New.
19173 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
19174 j must be the outer loop.
19175 * tests/regression.at (Broken Closure): New.
19177 2001-12-05 Akim Demaille <akim@epita.fr>
19179 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
19181 Reported by Peter Hamorsky.
19183 2001-12-05 Akim Demaille <akim@epita.fr>
19185 * src/conflicts.c (err_table): Remove.
19186 (resolve_sr_conflict): Adjust.
19187 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
19189 (state_t.reductions, state_t.shifts): this.
19191 2001-12-05 Akim Demaille <akim@epita.fr>
19193 * src/reduce.c (reduce_grammar_tables): No longer disable the
19194 removal of useless rules via CPP but via `if (0)', so that the
19195 compiler still check the code is valid.
19196 For instance, it should have noticed `rline' no longer exists: use
19197 the `line' member of rule_t.
19198 * src/gram.c (dummy, rline): Remove, unused.
19200 2001-12-05 Akim Demaille <akim@epita.fr>
19202 * src/output.c (pack_vector): Use assert, not berror.
19203 * src/main.c (berror): Remove, unused.
19205 2001-12-05 Akim Demaille <akim@epita.fr>
19207 New experimental feature: if --verbose --trace output all the
19208 items of a state, not only its kernel.
19210 * src/print.c (print_core): If `trace_flag', then invoke closure
19211 before outputting the items of the state (print_core is no longer
19212 a correct name them).
19213 (print_results): Invoke new_closure/free_closure if needed.
19215 2001-12-05 Akim Demaille <akim@epita.fr>
19217 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
19218 * src/closure.c, src/closure.h (itemsetsize): Rename as...
19219 (nitemset): for consistency with the rest of the project.
19221 2001-12-05 Akim Demaille <akim@epita.fr>
19223 * src/closure.c (print_closure): Improve.
19224 (closure): Use it for printing input and output.
19226 2001-12-05 Akim Demaille <akim@epita.fr>
19228 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
19229 indexed by nonterminals.
19231 2001-12-05 Akim Demaille <akim@epita.fr>
19233 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
19235 * src/warshall.h: Remove accidental duplication of the content.
19237 2001-12-05 Akim Demaille <akim@epita.fr>
19239 * src/closure.c (set_fderives): De-obfuscate.
19241 2001-12-05 Akim Demaille <akim@epita.fr>
19243 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
19245 2001-12-05 Akim Demaille <akim@epita.fr>
19247 * src/closure.c (set_firsts): De-obfuscate.
19249 2001-12-05 Akim Demaille <akim@epita.fr>
19251 * src/output.c (action_row): De-obfuscate
19252 using the good o' techniques: arrays not pointers, variable
19253 locality, BITISSET, RESETBIT etc.
19255 2001-12-05 Akim Demaille <akim@epita.fr>
19257 Pessimize the code to simplify it: from now on, all the states
19258 have a valid SHIFTS, which NSHIFTS is possibly 0.
19260 * src/LR0.c (shifts_new): Be global and move to..
19261 * src/state.c, src/state.h: here.
19262 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
19263 * src/print_graph: Adjust.
19265 2001-12-05 Akim Demaille <akim@epita.fr>
19267 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
19268 * src/conflicts.c: Use it.
19269 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
19270 incorrectly ``simplified''.
19272 2001-12-05 Akim Demaille <akim@epita.fr>
19274 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
19275 using the good o' techniques: arrays not pointers, variable
19276 locality, BITISSET, RESETBIT etc.
19278 2001-12-05 Akim Demaille <akim@epita.fr>
19280 * src/state.h (SHIFT_SYMBOL): New.
19281 * src/conflicts.c: Use it to deobfuscate.
19283 2001-12-05 Akim Demaille <akim@epita.fr>
19285 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
19286 (print_reductions): De-obfuscate using the good o' techniques:
19287 arrays not pointers, variable locality, BITISSET.
19289 2001-12-05 Akim Demaille <akim@epita.fr>
19291 * src/conflicts.c (print_reductions): Arrays, not pointers.
19294 2001-12-05 Akim Demaille <akim@epita.fr>
19296 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19298 2001-12-05 Akim Demaille <akim@epita.fr>
19300 * src/conflicts.c (print_reductions): Improve variable locality.
19302 2001-12-05 Akim Demaille <akim@epita.fr>
19304 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19306 2001-12-05 Akim Demaille <akim@epita.fr>
19308 * src/conflicts.c (print_reductions): Improve variable locality.
19310 2001-12-05 Akim Demaille <akim@epita.fr>
19312 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
19313 * src/lalr.c: Use them.
19315 2001-12-05 Akim Demaille <akim@epita.fr>
19317 * src/LR0.c (augment_automaton): Formatting changes.
19318 Better variable locality.
19320 2001-12-05 Akim Demaille <akim@epita.fr>
19322 * src/lalr.c (matrix_print): New.
19323 (transpose): Use it.
19324 Use arrays instead of pointers.
19326 2001-12-05 Akim Demaille <akim@epita.fr>
19328 * src/lalr.c (maxrhs): Move to...
19329 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
19330 * src/lalr.c (build_relations): Adjust.
19332 2001-12-05 Akim Demaille <akim@epita.fr>
19334 * src/lalr.c (transpose): Free the memory allocated to the
19335 argument, as it is replaced by the results by the unique caller.
19336 (build_relations): Merely invoke transpose: it handles the memory
19338 Improve variable locality.
19339 Avoid variables used as mere abbreviations.
19340 (compute_lookaheads): Use arrays instead of pointers.
19342 2001-12-05 Akim Demaille <akim@epita.fr>
19344 * src/lalr.c (initialize_F): Improve variable locality.
19345 Avoid variables used as mere abbreviations.
19347 2001-12-05 Akim Demaille <akim@epita.fr>
19349 * src/derives.c (print_derives): Display the ruleno.
19350 * src/lalr.c (initialize_F, transpose): Better variable locality
19351 to improve readability.
19352 Avoid variables used as mere abbreviations.
19354 2001-12-05 Akim Demaille <akim@epita.fr>
19356 * src/lalr.c (traverse): Use arrays instead of pointers.
19358 2001-12-05 Akim Demaille <akim@epita.fr>
19360 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
19361 the handling of squeue.
19362 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
19364 2001-12-05 Akim Demaille <akim@epita.fr>
19366 Because useless nonterminals are now kept alive (instead of being
19367 `destroyed'), we now sometimes examine them, and store information
19368 related to them. Hence we need to know their number, and adjust
19369 memory allocations.
19371 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
19373 * src/LR0.c (allocate_itemsets): The memory allocated to
19374 `symbol_count' was used for two different purpose: once to count
19375 the number of occurrences of each symbol, and later reassigned to
19376 `shift_symbol', containing the symbol that can be shifted from a
19378 Deobfuscate, i.e., allocate, use and free `symbol_count' here
19380 (new_itemsets): Allocate `shift_symbol' here.
19381 (allocate_itemsets): symbol_count includes useless nonterminals.
19382 Make room for them.
19383 (free_storage): Use `free', not `XFREE', for pointers that cannot
19386 2001-12-05 Akim Demaille <akim@epita.fr>
19388 * src/nullable.c (set_nullable): Deobfuscate the handling of
19390 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
19392 2001-12-05 Akim Demaille <akim@epita.fr>
19394 * src/gram.c, src/gram.h (ritem_print): New.
19395 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
19396 (This useless function was defined only to work around VMS linkers
19397 that can't handle compilation units with variables only).
19398 * src/reduce.c (dump_grammar): Use it to trace the construction of
19401 2001-12-04 Paul Eggert <eggert@twinsun.com>
19403 * src/bison.simple (union yyalloc): Change member names
19404 to be the same as the stack names.
19405 (yyparse): yyptr is now union yyalloc *, not char *.
19406 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
19407 and may generate better code on some machines.
19408 (yystpcpy): Use prototype if __STDC__ is defined, not just
19409 if __cplusplus is defined.
19411 2001-11-30 Akim Demaille <akim@epita.fr>
19413 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
19414 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
19415 Gettext doesn't compile cleanly, and dies with -Werror.
19416 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
19417 Include WARNING_CFLAGS here.
19418 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
19419 before being defined.
19421 2001-11-27 Paul Eggert <eggert@twinsun.com>
19423 * lib/quotearg.h (quotearg_n, quotearg_n_style):
19424 First arg is int, not unsigned.
19425 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
19426 (SIZE_MAX, UINT_MAX): New macros.
19427 (quotearg_n_options): Abort if N is negative.
19428 Avoid overflow check on hosts where size_t is 64 bits and int
19429 is 32 bits, as overflow is impossible there.
19430 Fix off-by-one typo that caused unnecessary reallocation.
19432 2001-11-29 Paul Eggert <eggert@twinsun.com>
19434 Name space cleanup in generated parser.
19436 * doc/bison.texinfo (Bison Parser): Discuss system headers
19437 and their effect on the user name space.
19439 * src/bison.simple:
19440 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
19441 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
19442 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
19444 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
19445 on user names when possible.
19447 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
19448 Simplify test for whather <alloca.h> exists.
19450 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
19452 (<stdio.h>): Include if YYDEBUG.
19454 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
19455 ! defined (yyoverflow) && ! defined (yymemcpy).
19457 (yymemcpy, yyparse): Rename local variables as needed so that
19458 they all begin with 'yy'.
19460 (yystrlen, yystpcpy): New functions.
19462 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
19465 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
19466 instead of relying on string.h functions. Use YYSTACK_ALLOC
19467 and YYSTACK_FREE instead of malloc and free.
19469 2001-11-30 Akim Demaille <akim@epita.fr>
19471 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
19472 before their first uses.
19473 (YYBISON, YYPURE): Move to the top of the output.
19475 2001-11-30 Akim Demaille <akim@epita.fr>
19477 * tests/reduce.at (Useless Nonterminals): Fix.
19479 2001-11-30 Akim Demaille <akim@epita.fr>
19481 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
19482 if body instead of `;' to pacify GCC's warnings.
19484 2001-11-30 Akim Demaille <akim@epita.fr>
19486 Instead of mapping the LHS of unused rules to -1, keep the LHS
19487 valid, but flag the rules as invalid.
19489 * src/gram.h (rule_t): `useful' is a new member.
19490 * src/print.c (print_grammar): Adjust.
19491 * src/derives.c (set_derives): Likewise.
19492 * src/reader.c (packgram, reduce_output): Likewise.
19493 * src/reduce.c (reduce_grammar_tables): Likewise.
19494 * tests/reduce.at (Underivable Rules, Useless Rules): New.
19496 2001-11-30 Akim Demaille <akim@epita.fr>
19498 * src/reduce.c (reduce_output): Formatting changes.
19499 * src/print.c (print_results, print_grammar): Likewise.
19500 * tests/regression.at (Rule Line Numbers)
19501 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
19503 2001-11-30 Akim Demaille <akim@epita.fr>
19505 * src/reduce.c (nonterminals_reduce): Instead of throwing away
19506 useless nonterminals, move them at the end of the symbol arrays.
19507 (reduce_output): Adjust.
19508 * tests/reduce.at (Useless Nonterminals): Adjust.
19510 2001-11-30 Akim Demaille <akim@epita.fr>
19512 * src/reduce.c: Various comment/formatting changes.
19513 (nonterminals_reduce): New, extracted from...
19514 (reduce_grammar_tables): here.
19515 (reduce_grammar): Call nonterminals_reduce.
19517 2001-11-29 Paul Eggert <eggert@twinsun.com>
19519 * src/bison.simple (YYSTACK_REALLOC): Remove.
19520 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
19521 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
19523 (union yyalloc): New type.
19524 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
19525 an arbitrary restriction on hosts where size_t is wider than int.
19527 (yyparse): Don't dump core if alloca or malloc fails; instead, report
19528 a parser stack overflow. Allocate just one block of memory for all
19529 three stacks, instead of allocating three blocks; this typically is
19530 faster and reduces fragmentation.
19532 Do not limit the number of items in the stack to a value that fits
19533 in 'int', as this is an arbitrary limit on hosts with 64-bit
19534 size_t and 32-bit int.
19536 2001-11-29 Marc Autret <autret_m@epita.fr>
19538 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
19539 of defining YYERROR_VERBOSE.
19540 [AT_DATA]: $4 is now out of C declarations in the prologue.
19542 2001-11-28 Marc Autret <autret_m@epita.fr>
19544 * src/reader.c (parse_dquoted_param): New.
19545 (parse_skel_decl): Use it.
19546 * src/lex.h: Add its prototype.
19547 * src/lex.c (literalchar): Become not static.
19549 2001-11-28 Marc Autret <autret_m@epita.fr>
19551 * src/output.h: And put its extern declaration here.
19552 * src/output.c (error_verbose): Define here.
19553 (prepare): Echo name modification.
19554 * src/getargs.h: Clean its extern declaration.
19555 * src/getargs.c (error_verbose_flag): Remove.
19556 (getargs): Remove case 'e'.
19557 * src/options.c (option_table): 'error-verbose' is now seen as simple
19561 * src/reader.c (read_declarations): Remove case tok_include.
19562 (parse_include_decl): Remove.
19563 * src/lex.h (token_t): Remove tok_include.
19564 * src/options.c (option_table): 'include' is now a simple command line
19567 2001-11-28 Marc Autret <autret_m@epita.fr>
19569 * src/bison.simple: Adjust muscle names.
19570 * src/muscle_tab.c (muscle_init): Also rename the muscles.
19571 * src/output.c (prepare): s/_/-/ for the muscles names.
19572 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
19574 2001-11-28 Marc Autret <autret_m@epita.fr>
19576 * src/bison.simple: Fix debug.
19577 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
19579 2001-11-28 Akim Demaille <akim@epita.fr>
19581 * src/LR0.c (shifts_new): New.
19582 (save_shifts, insert_start_shift, augment_automaton): Use it.
19584 2001-11-28 Akim Demaille <akim@epita.fr>
19586 * src/closure.c (closure): `b' and `ruleno' denote the same value:
19589 2001-11-28 Akim Demaille <akim@epita.fr>
19591 * src/closure.c (closure): Instead of looping over word in array
19592 then bits in words, loop over bits in array.
19594 2001-11-28 Akim Demaille <akim@epita.fr>
19596 * src/closure.c (closure): No longer optimize the special case
19597 where all the bits of `ruleset[r]' are set to 0, to make the code
19600 2001-11-28 Akim Demaille <akim@epita.fr>
19602 * src/closure.c (closure): `r' and `c' are new variables, used to
19603 de-obfuscate accesses to RULESET and CORE.
19605 2001-11-28 Akim Demaille <akim@epita.fr>
19607 * src/reduce.c (reduce_print): Use ngettext.
19608 (dump_grammar): Improve the trace accuracy.
19610 2001-11-28 Akim Demaille <akim@epita.fr>
19612 * src/reduce.c (dump_grammar): Don't translate trace messages.
19614 2001-11-28 Akim Demaille <akim@epita.fr>
19616 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
19617 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
19618 as all tags are free'ed afterwards.
19619 From Enrico Scholz.
19621 2001-11-27 Paul Eggert <eggert@twinsun.com>
19623 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
19624 use alloca when we didn't want to, and vice versa.
19626 2001-11-27 Marc Autret <autret_m@epita.fr>
19628 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
19630 * src/output.c (prepare): Remove its update.
19632 2001-11-27 Marc Autret <autret_m@epita.fr>
19634 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
19635 Use %error-verbose.
19637 2001-11-27 Marc Autret <autret_m@epita.fr>
19639 * src/bison.simple: Remove YYERROR_VERBOSE using.
19640 Use %%error_verbose.
19641 (yyparse): Likewise.
19642 * src/output.c (prepare): Give its final value.
19643 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
19644 * src/getargs.h: Add its extern declaration.
19645 * src/getargs.c (error_verbose_flag): New int.
19646 (getargs): Update to catch new case.
19647 * src/options.c (option_table): 'error-verbose' is a new option.
19648 (shortopts): Update.
19650 2001-11-27 Akim Demaille <akim@epita.fr>
19652 * src/system.h: Use intl/libgettext.h.
19653 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
19655 2001-11-27 Akim Demaille <akim@epita.fr>
19657 * tests/torture.at (Exploding the Stack Size with Malloc):
19658 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
19660 2001-11-27 Akim Demaille <akim@epita.fr>
19662 * src/files.c: Include error.h.
19663 Reported by Hans Aberg.
19665 2001-11-26 Marc Autret <autret_m@epita.fr>
19667 * src/reader.c (parse_include_decl): New, not yet implemented.
19668 (read_declarations): Add case tok_include.
19669 * src/getargs.h (include): Add its extern definition.
19670 * src/getargs.c (include): New const char *.
19671 (getargs): Add case '-I'.
19672 * src/options.c (option_table): Add include as command line and
19674 * src/lex.h (token_t): Add tok_include.
19676 2001-11-26 Akim Demaille <akim@epita.fr>
19678 * src/reader.c (readgram): Make sure rules for mid-rule actions
19679 have a lineno equal to that of their host rule.
19680 Reported by Hans Aberg.
19681 * tests/regression.at (Rule Line Numbers): New.
19683 2001-11-26 Akim Demaille <akim@epita.fr>
19685 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
19688 2001-11-26 Akim Demaille <akim@epita.fr>
19690 * src/complain.c, src/complain.h (error): Remove, provided by
19693 2001-11-26 Akim Demaille <akim@epita.fr>
19695 * src/reader.c (read_declarations): Don't abort on tok_illegal,
19696 issue an error message.
19697 * tests/regression.at (Invalid %directive): New.
19698 Reported by Hans Aberg.
19700 2001-11-26 Akim Demaille <akim@epita.fr>
19702 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
19703 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
19705 2001-11-26 Akim Demaille <akim@epita.fr>
19707 * src/conflicts.c (conflicts_print): Don't complain at all when
19708 there are no reduce/reduce conflicts, and as many shift/reduce
19709 conflicts as expected.
19710 * tests/regression.at (%expect right): Adjust.
19712 2001-11-23 Akim Demaille <akim@epita.fr>
19714 * lib/alloca.c: Update, from fileutils.
19716 2001-11-23 Akim Demaille <akim@epita.fr>
19718 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
19720 2001-11-23 Akim Demaille <akim@epita.fr>
19722 * src/system.h: Include alloca.h.
19723 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
19725 2001-11-23 Akim Demaille <akim@epita.fr>
19727 * src/print_graph.c (print_actions): Remove `rule', unused.
19728 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
19729 pacify GCC's signed < unsigned warnings.
19730 * src/closure.c (itemsetsize): Likewise.
19731 * src/reader.c (symbol_list_new): Static.
19733 2001-11-23 Akim Demaille <akim@epita.fr>
19735 Attaching lineno to buckets is stupid, since only one copy of each
19736 symbol is kept, only the line of the first occurrence is kept too.
19738 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
19739 * src/reader.c (rline_allocated): Remove, unused.
19740 (symbol_list): Have a `line' member.
19741 (symbol_list_new): New.
19742 (readgram): Use it.
19743 * src/print.c (print_grammar): Output the rule line numbers.
19744 * tests/regression.at (Solved SR Conflicts)
19745 (Unresolved SR Conflicts): Adjust.
19746 Reported by Hans Aberg.
19748 2001-11-22 Marc Autret <autret_m@epita.fr>
19750 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
19752 2001-11-22 Marc Autret <autret_m@epita.fr>
19754 * src/muscle_tab.c (muscle_init): Remove initialization of
19756 * src/output.c (output_master_parser): Do it here.
19758 2001-11-20 Akim Demaille <akim@epita.fr>
19761 * configure.in (ALL_LINGUAS): Adjust.
19762 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
19763 longer contains strings to translate.
19765 2001-11-19 Akim Demaille <akim@epita.fr>
19767 * src/conflicts.c (conflicts_print): Add a missing \n.
19769 2001-11-19 Akim Demaille <akim@epita.fr>
19771 * src/nullable.c (nullable_print): New.
19772 (set_nullable): Call it when tracing.
19773 Better locality of variables.
19775 2001-11-19 Akim Demaille <akim@epita.fr>
19777 * src/print.c (print_actions): Better locality of variables.
19779 2001-11-19 Akim Demaille <akim@epita.fr>
19781 * src/derives.c (print_derives): Fix and enrich.
19782 * src/closure.c (print_fderives): Likewise.
19784 2001-11-19 Akim Demaille <akim@epita.fr>
19786 * src/closure.c (itemsetend): Remove, replaced with...
19787 (itemsetsize): new.
19789 2001-11-19 Akim Demaille <akim@epita.fr>
19791 * src/LR0.c (kernel_end): Remove, replaced with...
19792 (kernel_size): new.
19794 2001-11-19 Akim Demaille <akim@epita.fr>
19796 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
19799 2001-11-19 Akim Demaille <akim@epita.fr>
19801 * src/closure.c (closure): Use arrays instead of pointers to clarify.
19803 2001-11-19 Akim Demaille <akim@epita.fr>
19805 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
19807 * src/LR0.c: Likewise.
19808 (allocate_itemsets): Use arrays instead of pointers to clarify.
19810 2001-11-19 Akim Demaille <akim@epita.fr>
19812 * src/getargs.c (statistics_flag): Replace with...
19814 (longopts): Accept --trace instead of --statistics.
19815 * src/getargs.h, src/options.c: Adjust.
19816 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
19817 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
19819 2001-11-19 Akim Demaille <akim@epita.fr>
19821 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
19822 pointers to clarify the code.
19823 (save_reductions, save_shifts): Factor common parts of alternatives.
19825 2001-11-19 Akim Demaille <akim@epita.fr>
19827 * src/LR0.c (new_state, get_state): Complete TRACE code.
19828 * src/closure.c: Include `reader.h' to get `tags', needed by the
19830 Rename the conditional DEBUG as TRACE.
19831 Output consistently TRACEs to stderr, not stdout.
19832 * src/derives.c: Likewise.
19833 * src/reduce.c: (inaccessable_symbols): Using if is better style
19835 Use `#if TRACE' instead of `#if 0' for tracing code.
19837 2001-11-19 Akim Demaille <akim@epita.fr>
19839 * src/system.h (LIST_FREE, shortcpy): New.
19840 * src/LR0.c: Use them.
19841 * src/output.c (free_itemsets, free_reductions, free_shifts):
19842 Remove, replaced by LIST_FREE.
19844 2001-11-19 Akim Demaille <akim@epita.fr>
19846 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
19847 (REDUCTIONS_ALLOC): New.
19848 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
19851 2001-11-19 Akim Demaille <akim@epita.fr>
19853 * src/LR0.c (new_state): Complete trace code.
19854 * src/nullable.c (set_nullable): Don't translate traces.
19856 2001-11-19 Akim Demaille <akim@epita.fr>
19858 * src/print_graph.c (print_core): Better locality of variables.
19859 * src/print.c (print_core): Likewise.
19861 2001-11-19 Akim Demaille <akim@epita.fr>
19863 * src/vcg.c: You do the output, so you are responsible of the
19864 handling of VCG syntax, in particular: use quotearg.
19865 * src/print_graph.c: Don't.
19866 (print_actions): Don't output the actions as part of the nodes,
19867 since that's the job of the edges.
19868 (print_state): Don't output by hand: fill the node description,
19869 and ask for its output.
19871 2001-11-19 Akim Demaille <akim@epita.fr>
19873 * src/bison.simple (yyparse): When verbosely reporting an error,
19874 no longer put additional quotes around token names.
19875 * tests/calc.at: Adjust.
19877 2001-11-19 Akim Demaille <akim@epita.fr>
19879 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
19880 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
19881 * src/output.c: Adjust.
19883 2001-11-19 Akim Demaille <akim@epita.fr>
19885 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
19887 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
19889 2001-11-19 Akim Demaille <akim@epita.fr>
19891 * src/gram.h (rule_t): New.
19893 (rrhs, rlhs): Remove, part of state_t.
19894 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
19895 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
19896 * src/reader.c, src/reduce.c: Adjust.
19898 2001-11-19 Akim Demaille <akim@epita.fr>
19900 * src/reader.c (symbols_output): New, extracted from...
19901 (packsymbols): Here.
19904 2001-11-19 Akim Demaille <akim@epita.fr>
19906 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
19907 (maxrhs): this new function.
19909 2001-11-19 Akim Demaille <akim@epita.fr>
19911 * src/lalr.c (F): New macro to access the variable F.
19914 2001-11-19 Akim Demaille <akim@epita.fr>
19916 * src/lalr.h (LA): New macro to access the variable LA.
19917 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19918 * src/lalr.c: Adjust.
19920 2001-11-19 Akim Demaille <akim@epita.fr>
19922 * src/lalr.c (initialize_LA): Only initialize LA. Let...
19923 (set_state_table): handle the `lookaheads' members.
19925 2001-11-19 Akim Demaille <akim@epita.fr>
19927 * src/lalr.h (lookaheads): Removed array, whose contents is now
19929 (state_t): this structure.
19930 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19933 2001-11-19 Akim Demaille <akim@epita.fr>
19935 * src/lalr.h (consistent): Removed array, whose contents is now
19937 (state_t): this structure.
19938 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19941 2001-11-19 Akim Demaille <akim@epita.fr>
19943 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
19944 contents are now members of...
19945 (state_t): this structure.
19946 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19949 2001-11-19 Akim Demaille <akim@epita.fr>
19951 * src/lalr.h (state_t): New.
19952 (state_table): Be a state_t * instead of a core **.
19953 (accessing_symbol): Remove, part of state_t.
19954 * src/lalr.c: Adjust.
19955 (set_accessing_symbol): Merge into...
19956 (set_state_table): this.
19957 * src/print_graph.c, src/conflicts.c: Adjust.
19959 2001-11-14 Akim Demaille <akim@epita.fr>
19961 * tests/calc.at, tests/output.at, tests/regression.at,
19962 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
19963 now the tests are run in private dirs, therefore AC_CLEANUP and
19964 family can be simplified to 0-ary.
19965 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
19966 use abs. path to find config.h.
19967 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
19968 stderr, there can be way too much random noise.
19969 Instead pass -Werror to GCC and rely on the exit status.
19970 Reported by Wolfram Wagner.
19972 2001-11-14 Akim Demaille <akim@epita.fr>
19974 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
19975 defined only if yyoverflow is defined, to avoid `warning: unused
19977 Reported by The Test Suite.
19979 2001-11-14 Akim Demaille <akim@epita.fr>
19981 * src/print.c: Include reduce.h.
19982 Reported by Hans Aberg.
19984 2001-11-14 Akim Demaille <akim@epita.fr>
19986 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
19987 Revert a previous patch: these are really const.
19988 * src/conflicts.c (conflict_report): Additional useless pair of
19989 braces to pacify GCC's warnings for `if () if () {} else {}'.
19990 * src/lex.c (parse_percent_token): Replace equal_offset with
19993 Be sure to strdup `arg' when used, since there is no reason for
19994 token_buffer not to change.
19996 2001-11-14 Akim Demaille <akim@epita.fr>
19998 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
20000 * src/main.c (main): Use them.
20001 Suggested by Hans Aberg.
20003 2001-11-12 Akim Demaille <akim@epita.fr>
20005 * src/system.h (ngettext): Now that we use ngettext, be sure to
20006 provide a default definition when NLS are not used.
20008 2001-11-12 Akim Demaille <akim@epita.fr>
20010 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
20011 Use @kbd to denote user input.
20012 (Language and Grammar): ANSIfy the example.
20013 Adjust its layout for info/notinfo.
20014 (Location Tracking Calc): Output error messages to stderr.
20015 Output locations in a more GNUtically correct way.
20016 Fix a couple of Englishos.
20017 Adjust @group/@end group pairs.
20019 2001-11-12 Akim Demaille <akim@epita.fr>
20021 %expect was not functioning at all.
20023 * src/conflicts.c (expected_conflicts): Set to -1.
20024 (conflict_report): Use ngettext.
20025 (conflicts_print): Check %expect and make its violation an error.
20026 * doc/bison.texinfo (Expect Decl): Adjust.
20027 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
20028 * tests/regression.at (%expect not enough, %expect right)
20029 (%expect too much): New.
20031 2001-11-12 Akim Demaille <akim@epita.fr>
20033 * tests/regression.at (Conflicts): Rename as...
20034 (Unresolved SR Conflicts): this.
20035 (Solved SR Conflicts): New.
20037 2001-11-12 Akim Demaille <akim@epita.fr>
20039 * src/reduce.c (print_results): Rename as...
20040 (reduce_output): This.
20041 Output to OUT, passed as argument, instead of output_obstack.
20042 (dump_grammar): Likewise.
20043 (reduce_free): New.
20045 (reduce_grammar): No longer call reduce_output, since...
20046 * src/print.c (print_results): do it.
20047 * src/main.c (main): Call reduce_free;
20049 2001-11-12 Akim Demaille <akim@epita.fr>
20051 * src/conflicts.c (print_reductions): Accept OUT as argument.
20052 Output to it, not to output_obstack.
20053 * src/print.c (print_actions): Adjust.
20055 2001-11-12 Akim Demaille <akim@epita.fr>
20057 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
20058 the result instead of using...
20059 (src_total, rrc_total, src_count, rrc_count): Remove.
20060 (any_conflicts): Remove.
20061 (print_conflicts): Split into...
20062 (conflicts_print, conflicts_output): New.
20063 * src/conflicts.h: Adjust.
20064 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
20065 * src/print.c (print_grammar): Issue `\n' between two rules.
20066 * tests/regression.at (Conflicts): New.
20067 Reported by Tom Lane.
20069 2001-11-12 Akim Demaille <akim@epita.fr>
20071 * tests/regression.at (Invalid input): Remove, duplicate with
20072 ``Invalid input: 1''.
20074 2001-11-12 Akim Demaille <akim@epita.fr>
20076 * tests/torture.at (AT_DATA_STACK_TORTURE)
20077 (Exploding the Stack Size with Alloca)
20078 (Exploding the Stack Size with Malloc): New.
20080 2001-11-12 Akim Demaille <akim@epita.fr>
20082 * src/bison.simple (YYSTACK_REALLOC): New.
20083 (yyparse) [!yyoverflow]: Use it and free the old stack.
20084 Reported by Per Allansson.
20086 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
20088 * src/bison.simple: Define type yystype instead of YYSTYPE, and
20089 define CPP macro, which substitute YYSTYPE by yystype.
20090 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
20091 with yyltype/YYLTYPE. This allows inclusion of the generated
20092 header within the parser if the compiler, such as GGC, accepts
20093 multiple equivalent #defines.
20096 2001-11-05 Akim Demaille <akim@epita.fr>
20098 * src/reader.c (symbols_output): New, extracted from...
20099 (packsymbols): here.
20102 2001-11-05 Akim Demaille <akim@epita.fr>
20104 * src/lex.c (parse_percent_token): s/quotearg/quote/.
20106 2001-11-05 Akim Demaille <akim@epita.fr>
20108 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
20111 2001-11-05 Akim Demaille <akim@epita.fr>
20113 * src/options.h (struct option_table_struct): set_flags is void*.
20114 * src/options.c (longopts): Support `--output' and `%output'.
20116 * src/lex.h (tok_setopt): Remove, replaced with...
20117 (tok_intopt, tok_stropt): these new guys.
20118 * src/lex.c (getopt.h): Not needed.
20119 (token_buffer, unlexed_token_buffer): Not const.
20120 (percent_table): Promote `-' over `_' in directive names.
20121 Active `%name-prefix', `file-prefix', and `output'.
20122 (parse_percent_token): Accept possible arguments to directives.
20123 Promote `-' over `_' in directive names.
20125 2001-11-04 Akim Demaille <akim@epita.fr>
20127 * doc/bison.texinfo (Decl Summary): Split the list into
20128 `directives for grammars' and `directives for bison'.
20130 Add description of `%name-prefix', `file-prefix', and `output'.
20131 Promote `-' over `_' in directive names.
20132 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
20133 Simplify the description of `--name-prefix'.
20134 Promote `-' over `_' in directive names.
20135 Promote `--output' over `--output-file'.
20136 Fix the description of `--defines'.
20137 * tests/output.at: Exercise %file-prefix and %output.
20139 2001-11-02 Akim Demaille <akim@epita.fr>
20141 * doc/refcard.tex: Update.
20143 2001-11-02 Akim Demaille <akim@epita.fr>
20145 * src/symtab.h (SUNDEF): New.
20146 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
20147 stand for `uninitialized', instead of 0.
20148 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
20149 * src/lex.c (lex): Adjust.
20151 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
20153 Let yylex return it instead of a plain 0.
20154 Reported by Dick Streefland.
20156 2001-11-02 Akim Demaille <akim@epita.fr>
20158 * tests/regression.at (Mixing %token styles): New test.
20160 2001-11-02 Akim Demaille <akim@epita.fr>
20162 * src/reader.c (parse_thong_decl): Formatting changes.
20163 (token_translations_init): New, extracted from...
20164 (packsymbols): Here.
20167 2001-11-01 Akim Demaille <akim@epita.fr>
20169 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
20170 Check that `9foo.y' produces correct cpp guards.
20171 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
20175 2001-11-01 Akim Demaille <akim@epita.fr>
20177 * tests/regression.at (Invalid input: 2): New.
20178 * src/lex.c (unlexed_token_buffer): New.
20179 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
20183 2001-11-01 Akim Demaille <akim@epita.fr>
20185 * tests/calc.at: Catch up with 1.30.
20186 * configure.in: Bump to 1.49a.
20187 Adjust to newer Autotest.
20189 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
20191 * src/conflicts.c: Move global variables rrc_total and src_total ...
20192 (print_conflicts): here.
20193 * src/output.c (output): Free global variable user_toknums.
20194 * src/lex.c (token_obstack): Become static.
20196 2001-10-18 Akim Demaille <akim@epita.fr>
20198 * tests/atlocal.in (GCC): Add.
20199 * tests/calc.at: s/m4_match/m4_bmatch/.
20200 s/m4_patsubst/m4_bpatsubst/.
20201 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
20202 * configure.in: AC_SUBST(GCC).
20204 2001-10-14 Marc Autret <autret_m@epita.fr>
20206 * src/options.c (create_long_option_table): Fix.
20208 2001-10-10 Akim Demaille <akim@epita.fr>
20210 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
20212 2001-10-04 Akim Demaille <akim@epita.fr>
20214 * src/reader.c (parse_union_decl): Push the caracters in
20215 union_obstack, not attrs_obstack.
20217 2001-10-04 Akim Demaille <akim@epita.fr>
20219 Merge in the branch 1.29.
20221 * src/reader.c (packsymbols): Use a temporary obstack for
20222 `%%tokendef', since output_stack is already used elsewhere.
20224 2001-10-02 Akim Demaille <akim@epita.fr>
20228 2001-10-02 Akim Demaille <akim@epita.fr>
20232 2001-10-02 Akim Demaille <akim@epita.fr>
20234 * tests/regression.at (Invalid CPP headers): New.
20235 From Alexander Belopolsky.
20236 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
20238 2001-10-02 Akim Demaille <akim@epita.fr>
20240 * tests/regression.at (Invalid input): New.
20241 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
20244 2001-10-02 Akim Demaille <akim@epita.fr>
20246 * tests/calc.at: Now that --debug works, the tests must be adjusted.
20248 2001-10-02 Akim Demaille <akim@epita.fr>
20250 * src/output.c (output_parser): Assert `skeleton'.
20251 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
20255 2001-10-01 Marc Autret <autret_m@epita.fr>
20257 * src/lex.h: Echo modifications.
20258 * src/lex.c (unlex): Parameter is now token_t.
20261 2001-10-01 Marc Autret <autret_m@epita.fr>
20263 * src/main.c: Include lex.h.
20266 2001-09-29 Akim Demaille <akim@epita.fr>
20268 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
20270 2001-09-28 Akim Demaille <akim@epita.fr>
20272 * tests/testsuite.at: Update to newer Autotest.
20273 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
20275 2001-09-27 Akim Demaille <akim@epita.fr>
20277 Position independent wrapper.
20279 * tests/bison: Remove.
20280 * tests/bison.in: New.
20281 * configure.in: Adjust.
20283 2001-09-27 Paul Eggert <eggert@twinsun.com>
20285 Port quotearg fixes from tar 1.13.24.
20287 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
20289 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
20290 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
20292 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
20293 * m4/mbrtowc.m4: New file.
20294 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
20295 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
20297 2001-09-27 Akim Demaille <akim@epita.fr>
20301 2001-09-27 Akim Demaille <akim@epita.fr>
20305 2001-09-25 Akim Demaille <akim@epita.fr>
20307 * src/system.h: Include `xalloc.h'.
20308 Remove it from the C files.
20309 * src/files.c (output_files): Free the obstacks.
20310 * src/lex.c (init_lex): Rename as...
20313 * src/main.c (main): Use it.
20315 2001-09-24 Marc Autret <autret_m@epita.fr>
20317 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
20318 to output informations in fout (FILE*).
20319 (open_graph, close_graph): Likewise.
20320 (output_graph, output_edge, output_node): Likewise.
20321 * src/vcg.h: Update function prototypes.
20322 * src/print_graph.c (print_graph): Open output graph file.
20323 (print_actions): Adjust.
20324 * src/files.h: Remove extern declaration.
20325 * src/files.c: Remove graph_obstack declaration.
20326 (open_files): Remove graph_obstack initialization.
20327 (output_files): Remove graph_obstack saving.
20329 2001-09-24 Marc Autret <autret_m@epita.fr>
20331 * src/files.c (compute_output_file_names): Fix.
20333 2001-09-24 Marc Autret <autret_m@epita.fr>,
20334 Akim Demaille <akim@epita.fr>
20336 * src/reader.c (reader): Remove call to free_symtab ().
20337 * src/main.c (main): Call it here.
20339 * src/conflicts.c (initialize_conflicts): Rename as...
20340 (solve_conflicts): this.
20341 * src/print.c (print_core, print_actions, print_state)
20342 (print_grammar): Dump to a file instead a `output_obstack'.
20343 (print_results): Dump `output_obstack', and then proceed with the
20345 * src/files.c (compute_output_file_names, close_files): New.
20346 (output_files): Adjust.
20347 * src/main.c (main): Adjust.
20349 2001-09-23 Marc Autret <autret_m@epita.fr>
20351 * src/files.c (compute_header_macro): Computes header macro name
20352 from spec_defines_file when given.
20354 2001-09-23 Marc Autret <autret_m@epita.fr>
20356 * src/files.c (output_files): Add default extensions.
20358 2001-09-22 Akim Demaille <akim@epita.fr>
20360 * src/conflicts.c (finalize_conflicts): Rename as...
20361 (free_conflicts): this.
20363 2001-09-22 Akim Demaille <akim@epita.fr>
20365 * src/gram.c (gram_free): Rename back as...
20367 (output_token_translations): Free `token_translations'.
20368 * src/symtab.c (free_symtab): Free the tag field.
20370 2001-09-22 Akim Demaille <akim@epita.fr>
20372 Remove `translations' as it is always set to true.
20374 * src/gram.h: Adjust.
20375 * src/reader.c (packsymbols, parse_token_decl): Adjust
20376 * src/print.c (print_grammar): Adjust.
20377 * src/output.c (output_token_translations): Adjust.
20378 * src/lex.c (lex): Adjust.
20379 * src/gram.c: Be sure the set pointers to NULL.
20380 (dummy): Rename as...
20383 2001-09-22 Akim Demaille <akim@epita.fr>
20385 * configure.in: Invoke AM_LIB_DMALLOC.
20386 * src/system.h: Use dmalloc.
20387 * src/LR0.c: Be sure to have pointers initialized to NULL.
20388 (allocate_itemsets): Allocate kernel_items only if needed.
20390 2001-09-22 Akim Demaille <akim@epita.fr>
20392 * configure.in: Bump to 1.29b.
20393 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
20394 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
20395 need xmalloc.c in calc.y.
20398 2001-09-21 Akim Demaille <akim@epita.fr>
20401 * Makefile.maint, config/config.guess, config/config.sub,
20402 * config/missing: Update from masters.
20403 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
20405 * configure.in (ALL_LINGUAS): Add `tr'.
20407 2001-09-21 Akim Demaille <akim@epita.fr>
20409 * tests/Makefile.am (package.m4): Move to...
20410 ($(srcdir)/$(TESTSUITE)): here.
20412 2001-09-20 Akim Demaille <akim@epita.fr>
20414 * src/complain.c: No longer try to be standalone: use system.h.
20415 Don't assume __STDC__ is defined to 1. Just test if it is defined.
20416 * src/complain.h: Likewise.
20417 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
20418 Remove the unused variable `n'.
20419 From Albert Chin-A-Young.
20421 2001-09-18 Marc Autret <autret_m@epita.fr>
20423 * doc/bison.1: Update.
20424 * doc/bison.texinfo (Bison Options): Update --defines and --graph
20426 (Option Cross Key): Update.
20429 2001-09-18 Marc Autret <autret_m@epita.fr>
20431 * tests/regression.at: New test (comment in %union).
20433 2001-09-18 Marc Autret <autret_m@epita.fr>
20435 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
20437 Reported by Keith Browne.
20439 2001-09-18 Marc Autret <autret_m@epita.fr>
20441 * tests/output.at: Add tests for --defines and --graph.
20443 2001-09-18 Marc Autret <autret_m@epita.fr>
20445 * tests/output.at: Removes tests of %{header,src}_extension features.
20447 2001-09-18 Akim Demaille <akim@epita.fr>
20449 * tests/Makefile.am (package.m4): New.
20450 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
20451 (_AT_CHECK_CALC_ERROR): Likewise.
20452 Factor the `, ' part of verbose error messages.
20454 2001-09-18 Marc Autret <autret_m@epita.fr>
20456 * src/getargs.c (longopts): Declare --defines and --graph as options
20457 with optional arguments.
20458 * src/files.h: Add extern declarations.
20459 * src/files.c (spec_graph_file, spec_defines_file): New.
20460 (output_files): Update.
20461 Remove CPP-outed code.
20463 2001-09-18 Marc Autret <autret_m@epita.fr>
20465 Turn off %{source,header}_extension feature.
20467 * src/files.c (compute_exts_from_gf): Update.
20468 (compute_exts_from_src): Update.
20469 (output_files): CPP-out useless code.
20470 * src/files.h: Remove {header,source}_extension extern declarations.
20471 * src/reader.c (parse_dquoted_param): CPP-out.
20472 (parse_header_extension_decl): Remove.
20473 (parse_source_extension_decl): Remove.
20474 (read_declarations): Remove cases tok_{hdrext,srcext}.
20475 * src/lex.c (percent_table): Remove {header,source}_extension entries.
20476 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
20478 2001-09-10 Akim Demaille <akim@epita.fr>
20480 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
20481 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
20482 (AT_CHECK_OUTPUT): this.
20483 Merely check ls' exit status, its output is useless.
20485 2001-09-10 Akim Demaille <akim@epita.fr>
20487 * tests/calc.at: Use m4_match.
20488 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
20490 2001-09-10 Marc Autret <autret_m@epita.fr>,
20491 Akim Demaille <akim@epita.fr>
20493 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
20495 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
20497 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
20498 * src/lex.h: Adjust prototype.
20499 (token_t): Add `tok_undef'.
20500 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
20501 (parse_percent_token): Now returns token_t.
20502 Add default statement in switch.
20503 (lex): Separate `c' as an input variable, from the token_t result
20505 (unlexed): Is a token_t.
20507 2001-09-10 Akim Demaille <akim@epita.fr>
20509 * configure.in: Bump to 1.29a.
20511 2001-09-07 Akim Demaille <akim@epita.fr>
20515 2001-08-30 Akim Demaille <akim@epita.fr>
20517 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
20518 * m4/atconfig.m4: Remove.
20519 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
20520 * tests/bison: New.
20521 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
20522 m4_if, m4_patsubst, and m4_regexp.
20523 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
20524 `input' file instead of echo.
20526 2001-08-29 Akim Demaille <akim@epita.fr>
20530 2001-08-29 Akim Demaille <akim@epita.fr>
20534 2001-08-29 Paul Eggert <eggert@twinsun.com>
20536 * src/bison.simple (yyparse): Don't take the address of an
20537 item before the start of an array, as that doesn't conform to
20540 2001-08-29 Robert Anisko <anisko_r@epita.fr>
20542 * doc/bison.texinfo (Location Tracking Calc): New node.
20544 2001-08-29 Paul Eggert <eggert@twinsun.com>
20546 * src/output.c (output): Do not define const, as this now
20547 causes more problems than it cures.
20549 2001-08-29 Akim Demaille <akim@epita.fr>
20551 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
20553 Be sure to tag the `detailmenu'.
20555 2001-08-29 Akim Demaille <akim@epita.fr>
20557 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
20558 download in a tmp dir.
20560 2001-08-28 Marc Autret <autret_m@epita.fr>
20562 * config/depcomp: New file.
20564 2001-08-28 Marc Autret <autret_m@epita.fr>
20566 * doc/bison.1 (mandoc): Adjust.
20567 From Juan Manuel Guerrero.
20569 2001-08-28 Marc Autret <autret_m@epita.fr>
20571 * src/print_graph.c (print_state): Fix.
20573 2001-08-27 Marc Autret <autret_m@epita.fr>
20575 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
20577 Echo modifications to the functions prototypes.
20578 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
20580 2001-08-27 Marc Autret <autret_m@epita.fr>
20582 * src/vcg.c: Include `xalloc.h'.
20583 (add_colorentry): New.
20584 (add_classname): New.
20585 (add_infoname): New.
20586 * src/vcg.h: Add new prototypes.
20588 2001-08-27 Akim Demaille <akim@epita.fr>
20590 * Makefile.maint: Sync. again with CVS Autoconf.
20592 2001-08-27 Akim Demaille <akim@epita.fr>
20594 * Makefile.maint: Formatting changes.
20595 (po-update, cvs-update, update): New targets.
20598 2001-08-27 Akim Demaille <akim@epita.fr>
20600 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
20601 * Makefile.maint: Sync. with CVS Autoconf.
20603 2001-08-27 Marc Autret <autret_m@epita.fr>
20605 * src/vcg.h (struct infoname_s): New.
20606 (struct colorentry_s): New.
20607 (graph_s): New fields {vertical,horizontal}_order in structure.
20608 Add `infoname' field.
20609 Add `colorentry' field;
20610 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
20611 (G_HORIZONTAL_ORDER): New.
20613 (G_COLORENTRY): New.
20614 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
20615 Add output of `infoname'.
20616 Add output of `colorentry'.
20618 2001-08-27 Marc Autret <autret_m@epita.fr>
20620 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
20621 This one shadowed a global parameter.
20623 2001-08-24 Marc Autret <autret_m@epita.fr>
20625 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
20626 instead of `unsigned'.
20627 (print_state): Do not call obstack_object_size () in obstack_grow ()
20628 to avoid macro variables shadowing.
20630 2001-08-23 Marc Autret <autret_m@epita.fr>
20632 * src/lex.c (percent_table): Typo: s/naem/name/.
20634 Normalize new options declarations.
20636 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
20638 * tests/suite.at: Exercise %header_extension and %source_extension.
20640 2001-08-16 Marc Autret <autret_m@epita.fr>
20642 * src/reader.c (parse_dquoted_param): New.
20643 (parse_header_extension_decl): Use it.
20644 (parse_source_extension_decl): Likewise.
20646 2001-08-16 Marc Autret <autret_m@epita.fr>
20648 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
20649 (get_xxxx_str): Use assert () instead of complain ().
20650 Remove return invokations in default cases.
20651 (get_decision_str): Modify default behaviour. Remove second argument.
20652 Echo modifications on calls.
20653 (output_graph): Fix.
20655 2001-08-16 Marc Autret <autret_m@epita.fr>
20657 * src/getargs.c (usage): Update with ``-g, --graph''.
20659 2001-08-16 Marc Autret <autret_m@epita.fr>
20661 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
20662 (Option Cross Key): Likewise.
20663 * doc/bison.1: Update.
20665 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
20667 * src/output.c (output_master_parser): Don't finish action_obstack.
20668 (output_parser): Don't care about the muscle action, here.
20669 (prepare): Copy the action_obstack in the action muscle.
20670 (output): Free action_obstack.
20672 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
20674 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
20675 will contain `%union' declaration.
20676 (parse_union_decl): Delete #line directive output.
20677 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
20678 informations about %union.
20679 (parse_union_decl): Copy the union_obstack in the muscle stype.
20680 * src/bison.simple: Add new #line directive.
20681 Add typdef %%stype YYSTYPE.
20683 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
20685 * src/bison.simple: Add new `#line' directive.
20687 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
20689 * src/bison.simple: New `#line' directive.
20690 * src/output.c (output_parser): Support new dynamic muscle input_line.
20692 2001-09-22 Marc Autret <autret_m@epita.fr>
20694 * src/output.c (output_master_parser): New.
20695 (output_parser): Be more re-entrant.
20697 2001-09-21 Marc Autret <autret_m@epita.fr>
20699 * src/reader.c (copy_definition, parse_union_decl): Update and use
20701 (copy_action): Likewise.
20702 Use obstack_1grow ().
20703 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
20705 2001-09-21 Marc Autret <autret_m@epita.fr>
20707 * src/options.c (option_table): Adjust.
20708 * src/lex.c (parse_percent_token): Fix.
20710 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
20712 * src/options.c (symtab.h): Include it, need by lex.h.
20714 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
20716 * src/lex.c (parse_percent_token): Change type of variable `tx', which
20717 is now an option_table_struct*.
20718 (option_strcmp): New function option_strcmp.
20719 (parse_percent_token): Call option_strcmp.
20720 * src/getargs.c (xalloc.h, options.h): Include it.
20721 (getargs): Call create_long_option_table.
20722 (getargs): Free longopts at the end of the function.
20723 (shortopts): Move in options.c.
20724 * src/options.c (create_long_option_table): New function. Convert
20725 information from option_table to option structure.
20726 * src/reader.c (options.h): Include it.
20728 * src/Makefile.am: Adjust.
20729 * src/options.c (option_table): Create from longopts and percent_table.
20730 * src/getargs.c (longopts): Delete.
20731 * src/lex.c (struct percent_table_struct): Delete.
20732 (percent_table): Delete.
20733 (options.h): Include it.
20734 * src/options.c: Create.
20735 * src/options.h: Create.
20736 Declare enum opt_access_e.
20737 Define struct option_table_struct.
20739 2001-09-20 Marc Autret <autret_m@epita.fr>
20741 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
20744 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
20746 * src/bison.simple: s/%%filename/%%skeleton.
20747 * src/muscle_tab.c (getargs.h): Include it.
20748 (muscle_init): Insert new muscle skeleton.
20750 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
20752 * src/output.c (output_parser): Delete unused variable actions_dumped.
20754 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
20756 * src/output.c (output): Delete call to reader_output_yylsp.
20757 * src/reader.c (reader): Likewise.
20758 * src/reader.h: Delete declaration of reader_output_yylsp.
20760 2001-09-02 Marc Autret <autret_m@epita.fr>
20762 * src/reader.c: Include muscle_tab.h.
20763 (parse_union_decl): Update.
20764 (parse_macro_decl): Rename parse_muscle_decl.
20765 Update to use renamed functions and variable.
20766 (read_declarations, copy_action, read_additionnal_code, : Updated
20767 with correct variables and functions names.
20768 (packsymbols, reader): Likewise.
20770 * src/reader.h (muscle_obstack): Extern declaration update.
20772 * src/output.c: Include muscle_tab.h
20773 In all functions using macro_insert, change by using muscle_insert ().
20774 (macro_obstack): Rename muscle_obstack.
20775 Echo modifications in the whole file.
20776 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
20777 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
20778 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
20780 * src/muscle_tab.h: Update double inclusion macros.
20781 (macro_entry_s): Rename muscle_entry_s.
20784 * src/muscle_tab.c: Include muscle_tab.h.
20785 Rename macro_tabble to muscle_table.
20786 (mhash1, mhash2, mcmp): Use muscle_entry.
20787 (macro_init): Rename muscle_init. Update.
20788 (macro_insert): Rename muscle_insert. Update.
20789 (macro_find): Rename muscle_find. Update.
20791 * src/main.c: Include muscle_tab.h.
20792 (main): Call muscle_init ().
20793 * src/Makefile.am (bison_SOURCES): Echo modifications.
20795 2001-09-02 Marc Autret <autret_m@epita.fr>
20797 Now the files macro_tab.[ch] are named muscle_tab.[ch].
20799 * src/muscle_tab.c, src/muscle_tab.h: Add files.
20801 2001-09-02 Marc Autret <autret_m@epita.fr>
20803 * src/macrotab.c, src/macrotab.h: Remove.
20805 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
20807 * src/reader.c (copy_guard): Use muscle to specify the `#line'
20810 2001-09-01 Marc Autret <autret_m@epita.fr>
20812 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
20813 to an explicit value to activate the feature. We do it here.
20815 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20817 * src/output.c (prepare): Delete the `filename' muscule insertion.
20818 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
20819 (parse_union_decl): Likewise.
20820 * src/macrotab.c (macro_init): Initialize filename by infile.
20822 2001-08-31 Marc Autret <autret_m@epita.fr>
20824 * src/bison.simple (YYLSP_NEEDED): New definition.
20825 * src/output.c (prepare): Add macro insertion of `locations_flag'
20827 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20829 * src/output.c (prepare): Delete insertion of previous muscles,
20830 and insert the `prefix' muscles.
20831 * src/macrotab.c (macro_init): Likewise.
20832 (macro_init): Initialization prefix directive by `yy'.
20833 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
20834 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
20835 yylval, yydebug, yyerror, yynerrs and yyparse.
20836 New directive `#define' to substitute yydebug, ... with option
20839 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20841 * src/main.c (main): Standardize.
20842 * src/output.c (output_table_data, output_parser): Likewise.
20843 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
20845 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
20847 * src/reader.c (read_additionnal_code): Rename %%user_code to
20849 * src/output.c (output): Rename %%declarations to %%prologue.
20850 * src/bison.simple: Echo modifications.
20852 2001-08-31 Marc Autret <autret_m@epita.fr>
20854 * src/reader.c (readgram): CleanUp.
20855 (output_token_defines): Likewise.
20856 (packsymbols): Likewise.
20857 (reader): Likewise.
20858 * src/output.c (output): CPP-out useless code.
20860 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20862 * src/reader.c (reader): Delete obsolete call to function
20863 output_trailers and output_headers.
20864 * src/output.h: Remove obsolete functions prototypes of output_headers
20865 and output_trailers.
20867 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
20869 * src/main.c: Include macrotab.h.
20870 * src/macrotab.h (macro_entry_s): Constify fields.
20871 Adjust functions prototypes.
20872 * src/macrotab.c (macro_insert): Constify key and value.
20873 (macro_find): Constify key.
20874 (macro_insert): Include 'xalloc.h'
20875 (macro_insert): Use XMALLOC.
20876 (macro_find): Constify return value.
20877 * src/output.c (output_table_data): Rename table to table_data.
20878 (output_parser): Constify macro_key, macro_value.
20880 2001-08-30 Marc Autret <autret_m@epita.fr>
20882 * src/reader.c (parse_skel_decl): New.
20883 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
20884 * src/lex.h (token_t): New token `tok_skel'.
20885 * src/lex.c (percent_table): Add skeleton option entry.
20888 2001-08-29 Marc Autret <autret_m@epita.fr>
20890 * src/bison.simple: Add %%user_code directive at the end.
20891 * src/reader.c (read_additionnal_code): New.
20893 * src/output.c (output_program): Remove.
20896 2001-08-28 Marc Autret <autret_m@epita.fr>
20898 * src/output.c (output_actions): Clean up.
20899 (output_gram): CPP-out useless code.
20900 * src/reader.c (reader): Clean up, CPP-out useless code.
20902 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
20904 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
20906 * src/bison.simple: Add `%%definitions'.
20908 2001-08-28 Marc Autret <autret_m@epita.fr>
20910 * config/depcomp: New file.
20912 2001-08-27 Paul Eggert <eggert@twinsun.com>
20914 * src/bison.simple (yyparse): Don't take the address of an
20915 item before the start of an array, as that doesn't conform to
20918 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
20920 * src/output.c (output): Remove the initialization of the macro
20921 obstack. It was done too late here.
20923 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
20925 (reader): Initialize the macro obstack here, since we need it to grow
20926 '%define' directives.
20928 * src/reader.h: Declare the macro obstack as extern.
20930 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
20932 * src/output.c (output_parser): Fix. Store single '%' characters in
20933 the output obstack instead of throwing them away.
20935 2001-08-27 Akim Demaille <akim@epita.fr>
20937 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
20939 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20941 * lib/Makefile.am: Adjust.
20943 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20945 * src/bison.simple: Update and add '%%' directives.
20947 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20949 * src/reader.c (reader): Remove calls to 'output_headers' and
20950 'output_trailers'. Remove some C output.
20951 (readgram): Disable a piece of code that was writing a default
20952 definition for 'YYSTYPE'.
20953 (reader_output_yylsp): Remove.
20954 (packsymbols): Output token defintions to a macro.
20955 (copy_definition): Disable C output.
20957 * src/reader.c (parse_macro_decl): New function used to parse macro
20959 (copy_string2): Put the body of copy_string into this new function.
20960 Add a parameter to let the caller choose whether he wants to copy the
20961 string delimiters or not.
20962 (copy_string): Be a simple call to copy_string2 with the last argument
20964 (read_declarations): Add case for macro definition.
20965 (copy_identifier): New.
20966 (parse_macro_decl): Read macro identifiers using copy_identifier
20969 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20971 * src/output.c (prepare): Add prefixed names.
20972 (output_parser): Output semantic actions.
20973 (output_parser): Fix bug on '%%line' directives.
20975 * src/output.c (output_headers): Remove. The C code printed by this
20976 function should now be in the skeletons.
20977 (output_trailers): Remove.
20978 (output): Disable call to 'reader_output_yylsp'.
20979 (output_rule_data): Do not output tables to the table obstack.
20981 * src/output.c: Remove some C dedicated output.
20982 Improve the use of macro and output obstacks.
20983 (output_defines): Remove.
20985 * src/output.c (output_token_translations): Associate 'translate'
20986 table with a macro. No output to the table obstack.
20987 (output_gram): Same for 'rhs' and 'prhs'.
20988 (output_stos): Same for 'stos'.
20989 (output_rule_data): Same for 'r1' and 'r2'.
20990 (token_actions): Same for 'defact'.
20991 (goto_actions): Same for 'defgoto'.
20992 (output_base): Same for 'pact' and 'pgoto'.
20993 (output_table): Same for 'table'.
20994 (output_check): Same for 'check'.
20996 * src/output.c (output_table_data): New function.
20997 (output_short_table): Remove.
20998 (output_short_or_char_table): Remove.
21000 * src/output.c (output_parser): Replace most of the skeleton copy code
21001 with something new. Skeletons are now processed character by character
21002 rather than line by line, and Bison looks for '%%' macros. This is the
21003 first step in making Bison's output process (a lot) more flexible.
21004 (output_parser): Use the macro table.
21006 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21008 * src/main.c (main): Initialize the macro table.
21010 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21012 * src/lex.c (percent_table): Add tok_define.
21013 * src/lex.h: Add tok_define.
21015 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21017 * src/macrotab.c: New file.
21018 * src/macrotab.h: New file.
21019 * src/Makefile.am: Update.
21021 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21023 * lib/hash.c: New file.
21024 * lib/hash.h: New file.
21025 * lib/Makefile.am: Update.
21027 2001-08-15 Akim Demaille <akim@epita.fr>
21031 2001-08-15 Marc Autret <autret_m@epita.fr>
21033 * src/reader.c (readgram): Indent output macro YYSTYPE.
21034 (packsymbols): Likewise.
21035 (output_token_defines): Likewise.
21036 * src/files.c: Standardize.
21037 (compute_header_macro): New.
21038 (defines_obstack_save): New. Use compute_header_macro.
21039 (output_files): Update. Use defines_obstack_save.
21041 2001-08-15 Akim Demaille <akim@epita.fr>
21043 * doc/bison.texinfo (Table of Symbols): Document
21044 YYSTACK_USE_ALLOCA.
21046 2001-08-15 Akim Demaille <akim@epita.fr>
21048 * missing: Update from CVS Automake.
21049 * config/config.guess, config/config.sub, config/texinfo.tex:
21050 Update from gnu.org.
21052 2001-08-15 Akim Demaille <akim@epita.fr>
21054 * Makefile.maint: Sync with CVS Autoconf.
21056 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
21058 * doc/bison.texinfo: Include GNU Free Documentation License from
21060 * doc/fdl.texi: Add to package.
21062 2001-08-14 Marc Autret <autret_m@epita.fr>
21064 Turn on %{source,header}_extension features.
21066 * src/lex.c (percent_table): Un-CPP out header_extension and
21068 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
21069 (compute_exts_from_src): Remove conditions. It restores priorities
21072 2001-08-14 Marc Autret <autret_m@epita.fr>
21074 * src/files.c (compute_base_names): Add extensions computing when
21075 `--file-prefix' used.
21076 Standardize function calls.
21078 2001-08-13 Marc Autret <autret_m@epita.fr>
21080 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
21081 defining it (defined but null disables alloca).
21083 2001-08-13 Marc Autret <autret_m@epita.fr>
21085 * src/bison.simple (_yy_memcpy): CPP reformat.
21087 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
21089 * tests/atconfig.in (CPPFLAGS): Fix.
21091 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
21093 * doc/bison.texinfo: Include GNU General Public License from
21095 * doc/gpl.texi: Add to package.
21097 2001-08-10 Marc Autret <autret_m@epita.fr>
21099 * src/print_graph.h: Fix.
21100 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
21102 2001-08-10 Akim Demaille <akim@epita.fr>
21104 * src/system.h: Provide default declarations for stpcpy, strndup,
21107 2001-08-10 Robert Anisko <anisko_r@epita.fr>
21109 * doc/bison.texinfo (Locations): Update @$ stuff.
21111 2001-08-09 Robert Anisko <anisko_r@epita.fr>
21113 * src/bison.simple (YYLLOC_DEFAULT): Update.
21116 2001-08-08 Marc Autret <autret_m@epita.fr>
21118 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
21119 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
21120 Reported by Fabrice Bauzac.
21122 2001-08-08 Marc Autret <autret_m@epita.fr>
21124 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
21125 * src/vcg.c (output_node): Fix.
21126 * src/vcg.h: Cleanup.
21127 * src/print_graph.c: Add comments.
21128 (node_output_size): New global variable. Simplify the formatting of
21129 the VCG graph output.
21130 (print_actions): Unused code is now used. It notifies the final state
21131 and no action states in the VCG graph. It also give the reduce actions.
21132 The `shift and goto' edges are red and the `go to state' edges are
21134 Get the current node name and node_obstack by argument.
21135 (node_obstack): New variable.
21136 (print_state): Manage node_obstack.
21137 (print_core): Use node_obstack given by argument.
21138 A node is not only computed here but in print_actions also.
21139 (print_graph): CPP out useless code instead of commenting it.
21141 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
21143 * tests/atconfig.in (CPPFLAGS): Fix.
21145 2001-08-07 Akim Demaille <akim@epita.fr>
21147 * src/print_graph.c (quote): New.
21148 (print_core): Use it.
21150 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
21152 * src/vcg.c (complain.h): Include it.
21153 Unepitaize `return' invocations.
21154 [NDEBUG] (main): Remove.
21155 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
21156 * src/files.c (open_files): Initialize graph_obstack.
21157 * src/print_graph.c (print_actions): CPP out useless code.
21158 (print_core): Don't output the last `\n' in labels.
21160 * src/files.c (output_files): Output the VCG file.
21161 * src/main.c (main): Invoke print_graph ();
21163 2001-08-06 Marc Autret <autret_m@epita.fr>
21165 Automaton VCG graph output.
21166 Using option ``-g'' or long option ``--graph'', you can generate
21167 a gram_filename.vcg file containing a VCG description of the LALR (1)
21168 automaton of your grammar.
21170 * src/main.c: Call to print_graph() function.
21171 * src/getargs.h: Update.
21172 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
21173 (graph_flag): New flag.
21174 (longopts): Update.
21175 (getargs): Add case `g'.
21176 * src/files.c (graph_obstack): New obstack struct.
21177 (open_files): Initialize new obstack.
21178 (output_files): Saves graph_obstack if required.
21179 * src/files.h (graph_obstack): New extern declaration.
21180 * src/Makefile.am: Add new source files.
21182 2001-08-06 Marc Autret <autret_m@epita.fr>
21184 * src/print_graph.c, src/print_graph.h (graph): New.
21185 * src/vcg.h: New file.
21186 * src/vcg.c: New file, VCG graph handling.
21188 2001-08-06 Marc Autret <autret_m@epita.fr>
21190 Add of %source_extension and %header_extension which specify
21191 the source or/and the header output file extension.
21193 * src/files.c (compute_base_names): Remove initialisation of
21194 src_extension and header_extension.
21195 (compute_exts_from_gf): Update.
21196 (compute_exts_from_src): Update.
21197 (output_files): Update.
21198 * src/reader.c (parse_header_extension_decl): New.
21199 (parse_source_extension_decl): New.
21200 (read_declarations): New case statements for the new tokens.
21201 * src/lex.c (percent_table): Add entries for %source_extension
21202 and %header_extension.
21203 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
21205 2001-08-06 Marc Autret <autret_m@epita.fr>
21207 * configure.in: Bump to 1.28c.
21208 * doc/bison.texinfo: Texinfo thingies.
21210 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
21212 * tests/atconfig.in (CPPFLAGS): Add.
21213 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
21215 2001-08-03 Akim Demaille <akim@epita.fr>
21219 2001-08-03 Akim Demaille <akim@epita.fr>
21221 * tests/Makefile.am (check-local): Ship testsuite.
21222 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
21223 Include `string.h'.
21225 2001-08-03 Akim Demaille <akim@epita.fr>
21227 * configure.in: Try using -Wformat when compiling.
21229 2001-08-03 Akim Demaille <akim@epita.fr>
21231 * configure.in: Bump to 1.28b.
21233 2001-08-03 Akim Demaille <akim@epita.fr>
21235 * src/complain.c: Adjust strerror_r portability issues.
21237 2001-08-03 Akim Demaille <akim@epita.fr>
21241 2001-08-03 Akim Demaille <akim@epita.fr>
21243 * src/getargs.c, src/getarg.h (skeleton)): Constify.
21244 * src/lex.c (literalchar): Avoid name clashes on `buf'.
21245 * src/getargs.c: Include complain.h.
21246 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
21247 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
21249 2001-08-03 Akim Demaille <akim@epita.fr>
21251 * src/reader.c (readgram): Display hidden chars in error messages.
21253 2001-08-03 Akim Demaille <akim@epita.fr>
21255 Update to gettext 0.10.39.
21257 2001-08-03 Akim Demaille <akim@epita.fr>
21259 * lib/strspn.c: New.
21261 2001-08-01 Marc Autret <autret_m@epita.fr>
21263 * doc/bison.texinfo: Update.
21264 * doc/bison.1 (mandoc): Update.
21265 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
21266 * src/files.c: Support output files extensions computing.
21267 (src_extension): New static variable.
21268 (header_extension): New static variable.
21269 (tr): New function.
21270 (get_extension_index): New function, gets the index of an extension
21271 filename in a string.
21272 (compute_exts_from_gf): New function, computes extensions from the
21273 grammar file extension.
21274 (compute_exts_from_src): New functions, computes extensions from the
21275 C source file extension, file given by ``-o'' option.
21276 (compute_base_names): Update.
21277 (output_files): Update.
21279 2001-08-01 Robert Anisko <anisko_r@epita.fr>
21281 * doc/bison.texi: Document @$.
21282 (Locations): New section.
21284 2001-07-18 Akim Demaille <akim@epita.fr>
21286 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
21287 * config/prev-version.txt, config/move-if-change: New.
21288 * Makefile.am: Adjust.
21290 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
21292 * src/bison.simple (yyparse): Suppress warning `comparaison
21293 between signed and unsigned'.
21295 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
21297 * src/getargs.h (raw_flag): Remove.
21298 * src/getargs.c: Die on `-r'/`--raw'.
21299 * src/lex.c (parse_percent_token): Die on `%raw'.
21300 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
21301 * tests/calc.at: Suppress test with option `--raw'.
21303 2001-07-14 Akim Demaille <akim@epita.fr>
21306 * configure.in: Require Autoconf 2.50.
21307 Update to gettext 0.10.38.
21309 2001-03-16 Akim Demaille <akim@epita.fr>
21311 * doc/bison.texinfo: ANSIfy the examples.
21313 2001-03-16 Akim Demaille <akim@epita.fr>
21315 * getargs.c (skeleton): New variable.
21316 (longopts): --skeleton is a new option.
21317 (shortopts, getargs): -S is a new option.
21318 * getargs.h: Declare skeleton.
21319 * output.c (output_parser): Use it.
21321 2001-03-16 Akim Demaille <akim@epita.fr>
21323 * m4/strerror_r.m4: New.
21324 * m4/error.m4: Run AC_FUNC_STRERROR_R.
21325 * lib/error.h, lib/error.c: Update.
21327 2001-03-16 Akim Demaille <akim@epita.fr>
21329 * src/getargs.c (longopts): Clean up.
21331 2001-02-21 Akim Demaille <akim@epita.fr>
21333 * src/reader.c (gensym): `gensym_count' is your own.
21334 Use a static buf to create the symbol name, as token_buffer is no
21337 2001-02-08 Akim Demaille <akim@epita.fr>
21339 * src/conflicts.c (conflict_report): Be sure not to append to res
21340 between two calls, which could happen if both first sprintf were
21341 skipped, but not the first cp += strlen.
21343 2001-02-08 Akim Demaille <akim@epita.fr>
21345 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
21346 New, from fileutils 4.0.37.
21347 * configure.in: Require Autoconf 2.49c. I took some time before
21348 making this decision. This is the only way out for portability
21349 issues in Bison, it would mean way too much duplicate effort to
21350 import in Bison features implemented in 2.49c since 2.13.
21351 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
21353 2001-02-02 Akim Demaille <akim@epita.fr>
21355 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
21356 * lib/xalloc.h, lib/xmalloc.c: Update.
21358 2001-01-19 Akim Demaille <akim@epita.fr>
21360 Get rid of the ad hoc handling of token_buffer in the scanner: use
21363 * src/lex.c (token_obstack): New.
21364 (init_lex): Initialize it. No longer call...
21365 (grow_token_buffer): this. Remove it.
21366 Adjust all the places which used it to use the obstack.
21368 2001-01-19 Akim Demaille <akim@epita.fr>
21370 * src/lex.h: Rename all the tokens:
21371 s/\bENDFILE\b/tok_eof/g;
21372 s/\bIDENTIFIER\b/tok_identifier/g;
21374 Let them be enums, not #define, to ease debugging.
21375 Adjust all the code.
21377 2001-01-18 Akim Demaille <akim@epita.fr>
21379 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
21380 * src/lex.c (maxtoken, grow_token_buffer): Static.
21382 2001-01-18 Akim Demaille <akim@epita.fr>
21384 Since we now use obstacks, more % directives can be enabled.
21386 * src/lex.c (percent_table): Also accept `%yacc',
21387 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
21389 Handle the actions for `%semantic_parser' and `%pure_parser' here,
21390 instead of returning a token.
21391 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
21392 * src/reader.c (read_declarations): Adjust.
21393 * src/files.c (open_files): Don't call `compute_base_names', don't
21394 compute `attrsfile' since they depend upon data which might be
21395 *in* the input file now.
21396 (output_files): Do it here.
21397 * src/output.c (output_headers): Document the fact that this patch
21398 introduces a guaranteed SEGV for semantic parsers.
21399 * doc/bison.texinfo: Document them.
21400 * tests/suite.at: Exercise these %options.
21402 2000-12-20 Akim Demaille <akim@epita.fr>
21404 Also handle the output file (--verbose) with obstacks.
21406 * files.c (foutput): Remove.
21407 (output_obstack): New.
21408 Adjust all dependencies.
21409 * src/conflicts.c: Return a string.
21410 * src/system.h (obstack_grow_string): Rename as...
21411 (obstack_sgrow): this. Be ready to work with non literals.
21412 (obstack_fgrow4): New.
21414 2000-12-20 Akim Demaille <akim@epita.fr>
21416 * src/files.c (open_files): Fix the computation of short_base_name
21417 in the case of `-o foo.tab.c'.
21419 2000-12-20 Akim Demaille <akim@epita.fr>
21421 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
21422 (copy_dollar): Now that everything uses obstacks, get rid of the
21425 2000-12-20 Akim Demaille <akim@epita.fr>
21427 * src/files.c (open_files): Actually the `.output' file is based
21428 on the short_base_name, not base_name.
21429 * tests/suite.at (Checking output file names): Adjust.
21431 2000-12-20 Akim Demaille <akim@epita.fr>
21433 * src/bison.s1: Remove, we now use directly...
21434 * src/bison.simple: this.
21435 * src/Makefile.am: Use pkgdata instead of data.
21437 2000-12-20 Akim Demaille <akim@epita.fr>
21439 * src/files.c (guard_obstack): New.
21440 (open_files): Initialize it.
21441 (output_files): Dump it...
21442 * src/files.h: Export it.
21443 * src/reader.c (copy_guard): Use it.
21445 2000-12-19 Akim Demaille <akim@epita.fr>
21447 * src/files.c (outfile, defsfile, actfile): Removed as global
21449 (open_files): Don't compute them.
21450 (output_files): Adjust.
21451 (base_name, short_base_name): Be global.
21452 Adjust dependencies.
21454 2000-12-19 Akim Demaille <akim@epita.fr>
21456 * src/files.c (strsuffix): New.
21457 (stringappend): Be just like strcat but allocate.
21458 (base_names): Eve out from open_files.
21459 Try to simplify the rather hairy computation of base_name and
21461 (open_files): Use it.
21462 * tests/suite.at (Checking output file names): New test.
21464 2000-12-19 Akim Demaille <akim@epita.fr>
21466 * src/system.h (obstack_grow_literal_string): Rename as...
21467 (obstack_grow_string): this.
21468 * src/output.c (output_parser): Recognize `%% actions' instead of
21470 * src/bison.s1: s/$/%% actions/.
21471 * src/bison.hairy: Likewise.
21473 2000-12-19 Akim Demaille <akim@epita.fr>
21475 * src/output.c (output_parser): Compute the `#line' lines when
21477 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
21478 Suggested by Hans Aberg.
21480 2000-12-19 Akim Demaille <akim@epita.fr>
21482 Let the handling of the skeleton files be local to the procedures
21485 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
21487 (fparser, open_extra_files): Remove.
21488 (open_files, output_files): Don't take care of fparser.
21489 * src/files.h: Adjust.
21490 * src/output.c (output_parser): Open and close the file to the
21492 * src/reader.c (read_declarations): When %semantic_parser, open
21495 2000-12-19 Akim Demaille <akim@epita.fr>
21497 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
21498 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
21500 2000-12-19 Akim Demaille <akim@epita.fr>
21502 * src/files.c (open_files): Yipee! We no longer need all the code
21503 looking for `/tmp' since we have no tmp file.
21505 2000-12-19 Akim Demaille <akim@epita.fr>
21507 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
21509 * src/files.c (open_files): Less dependency on MSDOS etc.
21511 2000-12-14 Akim Demaille <akim@epita.fr>
21513 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
21514 Provide a default definition.
21515 Use it when executing the default @ action.
21516 * src/reader.c (reader_output_yylsp): No longer include
21517 `timestamp' and `text' in the default YYLTYPE.
21519 2000-12-12 Akim Demaille <akim@epita.fr>
21521 * src/reader.c (copy_definition, parse_union_decl, copy_action)
21522 (copy_guard): Quote the file names.
21523 Reported by Laurent Mascherpa.
21525 2000-12-12 Akim Demaille <akim@epita.fr>
21527 * src/output.c (output_headers, output_program, output): Be sure
21528 to escape special characters when outputting filenames.
21529 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
21530 (output_headers): Don't depend on them, Use ACTSTR.
21532 2000-11-17 Akim Demaille <akim@epita.fr>
21534 * lib/obstack.h: Formatting changes.
21535 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
21536 prevents type checking.
21537 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
21538 cast the value to (void *): assigning a `foo *' to a `void *'
21540 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
21541 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
21544 2000-11-17 Akim Demaille <akim@epita.fr>
21546 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
21548 (suite.m4, regression.m4, calc.m4): these.
21549 * tests/atgeneral.m4: Update from CVS Autoconf.
21551 2000-11-17 Akim Demaille <akim@epita.fr>
21553 * tests/regression.m4 (%union and --defines): New test,
21554 demonstrating a current bug in the obstack implementation.
21556 2000-11-17 Akim Demaille <akim@epita.fr>
21558 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
21560 Use them to declare the variables which are global or local to
21563 2000-11-17 Akim Demaille <akim@epita.fr>
21565 * acconfig.h: Remove, no longer used.
21567 2000-11-07 Akim Demaille <akim@epita.fr>
21569 * src: s/Copyright (C)/Copyright/g.
21571 2000-11-07 Akim Demaille <akim@epita.fr>
21573 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
21575 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
21577 2000-11-07 Akim Demaille <akim@epita.fr>
21579 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
21580 Merge in a single CPP if/else.
21582 2000-11-07 Akim Demaille <akim@epita.fr>
21584 * src/output.c (output): Remove useless variables.
21585 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
21586 argument `data' for consistency with the prototypes.
21587 Qualify it `const'.
21588 (obstack_copy, obstack_copy0): Rename the second argument as
21589 `address' for consistency. Qualify it `const'.
21590 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
21591 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
21592 `const' their input argument (`data' or `address').
21593 Adjust the corresponding macros to include `const' in casts.
21595 2000-11-03 Akim Demaille <akim@epita.fr>
21597 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
21598 s/PFILE1/BISON_HAIRY/.
21599 Adjust dependencies.
21601 2000-11-03 Akim Demaille <akim@epita.fr>
21603 For some reason, this was not applied.
21605 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
21606 `unlink': it's no longer used.
21608 2000-11-03 Akim Demaille <akim@epita.fr>
21610 * src/files.c (skeleton_find): New function, eved out of...
21611 (open_files, open_extra_files): here.
21613 2000-11-03 Akim Demaille <akim@epita.fr>
21615 Don't use `atexit'.
21617 * src/files.c (obstack_save): New function.
21618 (done): Rename as...
21619 (output_files): this.
21620 Use `obstack_save'.
21621 * src/main.c (main): Don't use `atexit' to register `done', since
21622 it no longer has to remove tmp files, just call `output_files'
21623 when there are no errors.
21625 2000-11-02 Akim Demaille <akim@epita.fr>
21627 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
21628 `unlink': it's no longer used.
21629 * src/files.h: Formatting changes.
21631 2000-11-02 Akim Demaille <akim@epita.fr>
21633 Remove the last uses of mktemp and unlink/delete.
21635 * src/files.c (fdefines, ftable): Removed.
21636 (defines_ostack, table_obstack): New.
21637 Adjust dependencies of the former into uses of the latter.
21638 * src/output.c (output_short_or_char_table, output_short_table):
21639 Convert to using obstacks.
21640 * src/reader.c (copy_comment2): Accept one FILE * and two
21642 (output_token_defines, reader_output_yylsp): Use obstacks.
21643 * src/system.h (obstack_fgrow3): New.
21644 * po/POTFILES.in: Adjust.
21646 2000-11-01 Akim Demaille <akim@epita.fr>
21648 Change each use of `fattrs' into a use of `attrs_obstack'.
21650 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
21651 * src/files.c (fattrs): Remove.
21652 (attrs_obstack): New.
21653 Adjust all dependencies.
21654 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
21656 2000-11-01 Akim Demaille <akim@epita.fr>
21658 Introduce obstacks.
21659 Change each use of `faction' into a use of `action_obstack'.
21661 * lib/obstack.h, lib/obstack.c: New files.
21662 * src/files.c (faction): Remove.
21663 (action_obstack): New.
21664 Adjust all dependencies.
21666 2000-10-20 Akim Demaille <akim@epita.fr>
21668 * lib/quote.h (PARAMS): New macro. Use it.
21670 2000-10-16 Akim Demaille <akim@epita.fr>
21672 * src/output.c (output_short_or_char_table): New function.
21673 (output_short_table, output_token_translations): Use it.
21674 (goto_actions): Use output_short_table.
21676 2000-10-16 Akim Demaille <akim@epita.fr>
21678 * src/symtab.c (bucket_new): New function.
21681 * src/output.c (output_short_table): New argument to display the
21682 comment associated with the table.
21683 Adjust dependencies.
21684 (output_gram): Use it.
21685 (output_rule_data): Nicer output layout for YYTNAME.
21687 2000-10-16 Akim Demaille <akim@epita.fr>
21689 * src/lex.c (read_typename): New function.
21691 * src/reader.c (copy_dollar): Likewise.
21693 2000-10-16 Akim Demaille <akim@epita.fr>
21695 * src/reader.c (copy_comment2): Expect the input stream to be on
21696 the `/' which is suspected to open a comment, instead of being
21697 called after `//' or `/*' was read.
21698 (copy_comment, copy_definition, parse_union_decl, copy_action)
21699 (copy_guard): Adjust.
21701 2000-10-16 Akim Demaille <akim@epita.fr>
21703 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
21704 `read_signed_integer'.
21706 2000-10-16 Akim Demaille <akim@epita.fr>
21708 * src/reader.c (copy_dollar): New function.
21709 (copy_guard, copy_action): Use it.
21711 2000-10-16 Akim Demaille <akim@epita.fr>
21713 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
21714 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
21715 New files, from Fileutils 4.0.27.
21716 * src/main.c (printable_version): Remove.
21717 * src/lex.c, src/reader.c: Use `quote'.
21719 2000-10-04 Akim Demaille <akim@epita.fr>
21721 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
21723 2000-10-04 Akim Demaille <akim@epita.fr>
21725 * doc/bison.texinfo: Various typos spotted by Neil Booth.
21727 2000-10-04 Akim Demaille <akim@epita.fr>
21729 When a literal string is used to define two different tokens,
21730 `bison -v' segfaults.
21731 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
21733 * tests/regression.m4: New file.
21734 Include the core of the sample provided by Piotr Gackiewicz.
21735 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
21738 2000-10-04 Akim Demaille <akim@epita.fr>
21740 * src/reader.c (parse_expect_decl): Keep `count' within the size
21744 2000-10-02 Paul Eggert <eggert@twinsun.com>
21746 * bison.s1 (yyparse): Assign the default value
21747 unconditionally, to avoid a GCC warning and make the parser a
21750 2000-10-02 Akim Demaille <akim@epita.fr>
21752 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
21755 2000-10-02 Akim Demaille <akim@epita.fr>
21757 * src/derives.c, src/print.c, src/reduce.c: To ease the
21758 translation, move some `\n' out of the translated strings.
21760 2000-10-02 Akim Demaille <akim@epita.fr>
21762 The location tracking mechanism is precious for parse error
21763 messages. Nevertheless, it is enabled only when `@n' is used in
21764 the grammar, which is a different issue (you can use it in error
21765 message, but not in the grammar per se). Therefore, there should
21766 be another means to enable it.
21768 * src/getargs.c (getargs): Support `--locations'.
21769 (usage): Report it.
21770 * src/getargs.h (locationsflag): Export it.
21771 * src/lex.c (percent_table): Support `%locations'.
21772 * src/reader.c (yylsp_needed): Remove this variable, now replaced
21773 with `locationsflag'.
21774 * doc/bison.texinfo: Document `--locations' and `%locations'.
21776 * tests/calc.m4: Test it.
21778 For regularity of the names, replace each
21779 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
21780 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
21781 In addition replace each `flag' with `_flag'.
21783 2000-10-02 Akim Demaille <akim@epita.fr>
21785 Also test parse error messages, including with YYERROR_VERBOSE.
21787 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
21789 Use it to check the computations.
21790 Use it to check `nonassoc' is honored.
21791 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
21792 `--yyerror-verbose'.
21793 (_AT_CHECK_CALC): Adjust to this option.
21794 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
21796 2000-10-02 Akim Demaille <akim@epita.fr>
21798 Test also `--verbose', `--defines' and `--name-prefix'. Testing
21799 the latter demonstrates a flaw in the handling of non debugging
21800 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
21801 was used in order to simplify:
21817 unfortunately this leads to a CPP conflict when
21818 `--name-prefix=foo' is used since it produces `#define yydebug
21821 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
21822 (YYDPRINTF): New macro.
21824 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
21826 Also test `--verbose', `--defines' and `--name-prefix'.
21828 2000-10-02 Akim Demaille <akim@epita.fr>
21830 Improve the readability of the produced parsers.
21832 * src/bison.s1: Formatting changes.
21833 Improve the comment related to the `$' mark.
21834 (yydefault): Don't fall through to `yyresume': `goto' there.
21835 * src/output.c (output_parser): When the `$' is met, skip the end
21837 New variable, `number_of_dollar_signs', to check there's exactly
21838 one `$' in the parser skeleton.
21840 2000-10-02 Akim Demaille <akim@epita.fr>
21842 * lib/xstrdup.c: New file, from the fileutils.
21843 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
21844 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
21845 instead of strlen + xmalloc + strcpy.
21846 * src/symtab.c (copys): Remove, use xstrdup instead.
21848 2000-10-02 Akim Demaille <akim@epita.fr>
21850 * src/gram.h (associativity): New enum type which replaces the
21851 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
21852 `right_assoc', `left_assoc' and `non_assoc'.
21853 Adjust all dependencies.
21854 * src/reader.c: Formatting changes.
21855 (LTYPESTR): Don't define it, use it as a literal in
21856 `reader_output_yylsp'.
21857 * src/symtab.h (symbol_class): New enum type which replaces the
21858 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
21859 `sunknown', `stoken and `snterm'.
21861 2000-10-02 Akim Demaille <akim@epita.fr>
21863 * src/getargs.c (fixed_outfiles): Rename as...
21864 (yaccflag): for consistency and accuracy.
21865 Adjust dependencies.
21867 2000-10-02 Akim Demaille <akim@epita.fr>
21869 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
21870 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
21871 difficult and introduced a lot of core dump. It turns out that
21872 Bison used an implementation of `xmalloc' based on `calloc', and
21873 at various places it does depend upon the initialization to 0. I
21874 have not tried to isolate the pertinent places, and all the former
21875 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
21876 someone should address this issue.
21878 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
21879 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
21881 Adjust dependencies.
21882 * src/warshall.h: New file.
21885 2000-10-02 Akim Demaille <akim@epita.fr>
21887 Various anti-`extern in *.c' changes.
21889 * src/system.h: Include `assert.h'.
21891 2000-10-02 Akim Demaille <akim@epita.fr>
21893 * src/state.h (nstates, final_state, first_state, first_shift)
21894 (first_reduction): Move their exportation from here...
21895 * src/LR0.h: to here.
21896 Adjust dependencies.
21897 * src/getargs.c (statisticsflag): New variable.
21898 Add support for `--statistics'.
21899 Adjust dependencies.
21901 Remove a lot of now useless `extern' statements in most files.
21903 2000-10-02 Akim Demaille <akim@epita.fr>
21905 * src/LR0.h: New file.
21908 2000-10-02 Akim Demaille <akim@epita.fr>
21910 * src/print.h: New file.
21912 * src/print.c: Formatting and ordering changes.
21913 (verbose, terse): Replace with...
21914 (print_results): this new function.
21915 Adjust dependencies.
21917 2000-10-02 Akim Demaille <akim@epita.fr>
21919 * src/conflicts.c (conflict_report): New function.
21920 (conflict_log, verbose_conflict_log): Replace with...
21921 (print_conflicts): this function.
21922 Adjust dependencies.
21923 * src/conflicts.h: New file.
21924 Propagate its inclusion.
21926 2000-10-02 Akim Demaille <akim@epita.fr>
21928 * src/nullable.h: New file.
21929 Propagate its inclusion.
21930 * src/nullable.c: Formatting changes.
21932 2000-10-02 Akim Demaille <akim@epita.fr>
21934 * src/reduce.h: New file.
21935 Propagate its inclusion.
21936 * src/reduce.c: Topological sort and other formatting changes.
21937 (bool, TRUE, FALSE): Move their definition to...
21938 * src/system.h: here.
21940 2000-10-02 Akim Demaille <akim@epita.fr>
21942 * src/files.c: Formatting changes.
21943 (tryopen, tryclose, openfiles): Rename as...
21944 (xfopen, xfclose, open_files): this.
21945 (stringappend): static.
21946 * src/files.h: Complete the list of exported symbols.
21949 2000-10-02 Akim Demaille <akim@epita.fr>
21951 * src/reader.h: New file.
21952 Propagate its use instead of tedious list of `extern' and
21954 * src/reader.c: Formatting changes, topological sort,
21957 2000-10-02 Akim Demaille <akim@epita.fr>
21959 * src/lex.h: Prototype `lex.c' exported functions.
21960 * src/reader.c: Adjust.
21961 * src/lex.c: Formatting changes.
21962 (safegetc): Rename as...
21965 2000-10-02 Akim Demaille <akim@epita.fr>
21967 * src/lalr.h: New file.
21968 Propagate its inclusion instead of prototypes and `extern'.
21969 * src/lalr.c: Formatting changes, topological sorting etc.
21971 2000-10-02 Akim Demaille <akim@epita.fr>
21973 * src/output.c (token_actions): Introduce a temporary array,
21974 YYDEFACT, that makes it possible for this function to use
21975 output_short_table.
21977 2000-10-02 Akim Demaille <akim@epita.fr>
21979 `user_toknums' is output as a `short[]' in `output.c', while it is
21980 defined as a `int[]' in `reader.c'. For consistency with the
21981 other output tables, `user_toknums' is now defined as a table of
21984 * src/reader.c (user_toknums): Be a short table instead of an int
21986 Adjust dependencies.
21988 Factor the short table outputs.
21990 * src/output.c (output_short_table): New function.
21991 * src/output.c (output_gram, output_stos, output_rule_data)
21992 (output_base, output_table, output_check): Use it.
21994 2000-10-02 Akim Demaille <akim@epita.fr>
21996 * src/output.c (output): Topological sort of the functions, in
21997 order to get rid of the `static' prototypes.
21998 No longer use `register'.
21999 * src/output.h: New file.
22000 Propagate its inclusion in files explicitly prototyping functions
22003 2000-09-21 Akim Demaille <akim@epita.fr>
22005 * src/atgeneral.m4: Update from Autoconf.
22007 2000-09-21 Akim Demaille <akim@epita.fr>
22009 * src/closure.h: New file.
22010 * src/closure.c: Formatting changes, topological sort over the
22011 functions, use of closure.h.
22012 (initialize_closure, finalize_closure): Rename as...
22013 (new_closure, free_closure): these. Adjust dependencies.
22014 * src/LR0.c: Formatting changes, topological sort, use of
22016 (initialize_states): Rename as...
22017 (new_states): this.
22018 * src/Makefile.am (noinst_HEADERS): Adjust.
22020 2000-09-20 Akim Demaille <akim@epita.fr>
22022 * src/acconfig.h: Don't protect config.h against multiple
22024 Don't define PARAMS.
22025 * src/system.h: Define PARAMS.
22026 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
22027 purpose of config.h. system.h must not try to fix wrong
22028 definitions in config.h.
22030 2000-09-20 Akim Demaille <akim@epita.fr>
22032 * src/derives.h: New file.
22033 * src/main.c, src/derives.h: Use it.
22034 Formatting changes.
22035 * src/Makefile.am (noinst_HEADERS): Adjust.
22037 2000-09-20 Akim Demaille <akim@epita.fr>
22039 * tests/atgeneral.m4: Update from Autoconf.
22040 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
22041 (AT_CHECK_CALC): New macros.
22042 Use these macros to test bison with options `', `--raw',
22043 `--debug', `--yacc', `--yacc --debug'.
22045 2000-09-19 Akim Demaille <akim@epita.fr>
22047 * src/output.c: Formatting changes.
22048 * src/machine.h: Remove, leaving its contents in...
22049 * src/system.h: here.
22051 Adjust all dependencies on stdio.h and machine.h.
22052 * src/getargs.h: New file.
22053 Let all `extern' declarations about getargs.c be replaced with
22054 inclusion of `getargs.h'.
22055 * src/Makefile.am (noinst_HEADERS): Adjust.
22057 * tests/calc.m4 (yyin): Be initialized in main, not on the global
22059 (yyerror): Returns void, not int.
22060 * doc/bison.texinfo: Formatting changes.
22062 2000-09-19 Akim Demaille <akim@epita.fr>
22064 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
22067 2000-09-18 Akim Demaille <akim@epita.fr>
22069 * configure.in: Append WARNING_CFLAGS to CFLAGS.
22070 * src/Makefile.am (INCLUDES): Don't.
22071 Be ready to fetch headers in lib/.
22073 2000-09-18 Akim Demaille <akim@epita.fr>
22075 * doc/bison.texinfo: Update the copyright.
22076 ANSIfy and GNUify the examples.
22077 Remove the old menu.
22079 2000-09-18 Akim Demaille <akim@epita.fr>
22081 First set of tests: use the `calc' example from the documentation.
22083 * src/bison.s1 (yyparse): Condition the code using `yytname' which
22084 is defined only when YYDEBUG is.
22085 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
22086 * src/files.c (tryopen, tryclose): Formatting changes.
22087 Move to the top and be static.
22088 * src/reader.c (read_signed_integer): Likewise.
22089 * tests/calc.m4: New file.
22090 * Makefile.am, suite.m4: Adjust.
22091 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
22093 2000-09-18 Akim Demaille <akim@epita.fr>
22095 Add support for an Autotest test suite for Bison.
22097 * m4/m4.m4, m4/atconfig.m4: New files.
22098 * m4/Makefile.am (EXTRA_DIST): Adjust.
22099 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
22101 * src/getargs.c: Display a more standard --version message.
22102 * src/reader.c (reader): Formatting changes.
22103 No longer depend upon VERSION_STRING.
22104 * configure.in: No longer use `dnl'.
22105 Set up the test suite and the new directory `tests/.
22106 (VERSION_STRING): Remove.
22108 2000-04-14 Akim Demaille <akim@epita.fr>
22110 * src/reader.c (copy_comment2): New function, same as former
22111 `copy_comment', but outputs into two FILE *.
22112 (copy_comment): Use it.
22113 (parse_union_decl): Use it.
22114 (get_type, parse_start_decl): Use the same `invalid' message.
22115 (parse_start_decl, parse_union_decl): Use the same `multiple'
22117 (parse_union_decl, copy_guard, copy_action): Use the same
22118 `unmatched' message.
22119 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
22121 2000-03-31 Akim Demaille <akim@epita.fr>
22123 * src/files.c (tryopen, tryclose): Move to the top.
22126 2000-03-31 Akim Demaille <akim@epita.fr>
22128 * src/main.c (main): Don't call `done', exit does it.
22130 2000-03-31 Akim Demaille <akim@epita.fr>
22132 * allocate.c: s/return (foo)/return foo/.
22133 * lalr.c: Likewise.
22135 * output.c: Likewise.
22136 * reader.c: Likewise.
22137 * symtab.c: Likewise.
22138 * vmsgetargs.c: Likewise.
22140 2000-03-31 Akim Demaille <akim@epita.fr>
22142 Clean up the error reporting functions.
22144 * src/report.c: New file.
22145 * src/report.h: Likewise.
22146 * src/Makefile.am: Adjust.
22147 * m4/error.m4: New file.
22148 * m4/Makefile.am: Adjust.
22149 * configure.in (jm_PREREQ_ERROR): Call it.
22150 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
22152 (fatal, fatals): Remove. All callers use complain.c::fatal.
22153 (warn, warni, warns, warnss, warnss): Remove. All callers use
22154 complain.c::complain.
22155 (toomany): Remove, use fatal instead.
22156 * src/files.c (done): No argument, use complain_message_count.
22157 * src/main.c (main): Register `done' to `atexit'.
22159 * src/getargs.c (usage): More `fputs', less `fprintf'.
22161 2000-03-28 Akim Demaille <akim@epita.fr>
22163 * lib/: New directory.
22164 * Makefile.am (SUBDIRS): Adjust.
22165 * configure.in: Adjust.
22166 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
22168 * src/alloca.c: Moved to lib/.
22169 * src/getopt.c: Likewise.
22170 * src/getopt1.c: Likewise.
22171 * src/getopt.h: Likewise.
22172 * src/ansi2knr.c: Likewise.
22173 * src/ansi2knr.1: Likewise.
22174 * src/Makefile.am: Adjust.
22175 * lib/Makefile.am: New file.
22177 2000-03-28 Akim Demaille <akim@epita.fr>
22179 * src/getargs.c (usage): Refresh the help message.
22181 2000-03-17 Akim Demaille <akim@epita.fr>
22183 * src/getopt1.c: Updated from textutils 2.0e
22184 * src/getopt.c: Likewise.
22185 * src/getopt.h: Likewise.
22187 2000-03-17 Akim Demaille <akim@epita.fr>
22189 * src/Makefile.am (bison.simple): Fix the awk program: quote only
22190 the file name, not the whole `#line LINE FILE'.
22192 2000-03-17 Akim Demaille <akim@epita.fr>
22194 On syntax errors, report the token on which we choked.
22196 * src/bison.s1 (yyparse): In the label yyerrlab, when
22197 YYERROR_VERBOSE, add yychar in msg.
22199 2000-03-17 Akim Demaille <akim@epita.fr>
22201 * src/reader.c (copy_at): New function.
22202 (copy_guard): Use it.
22203 (copy_action): Use it.
22205 2000-03-17 Akim Demaille <akim@epita.fr>
22207 Be kind to translators, save some useless translations.
22209 * src/main.c (banner): New function.
22210 (fatal_banner): Use it.
22211 (warn_banner): Use it.
22213 2000-03-17 Akim Demaille <akim@epita.fr>
22215 * src/reader.c (copy_definition): Use copy_string and
22216 copy_comment. Removed now unused `match', `ended',
22218 (copy_comment, copy_string): Moved, to be visible from
22221 2000-03-17 Akim Demaille <akim@epita.fr>
22223 * src/reader.c (copy_string): Declare `static inline'. No
22224 problems with inline, since it is checked by configure.
22225 (copy_comment): Likewise.
22227 2000-03-17 Akim Demaille <akim@epita.fr>
22229 * src/reader.c (packsymbols): Formatting changes.
22231 2000-03-17 Akim Demaille <akim@epita.fr>
22233 * src/reader.c (copy_comment): New function, factored out from:
22234 (copy_action): Use it. Removed now unused `match', `ended',
22236 (copy_guard): Likewise.
22238 2000-03-17 Akim Demaille <akim@epita.fr>
22240 * src/reader.c (copy_string): New function, factored out from:
22241 (copy_action): Use it.
22242 (copy_guard): Likewise.
22244 2000-03-17 Akim Demaille <akim@epita.fr>
22246 Change the handling of @s so that they behave exactly like $s.
22247 There is now a pseudo variable @$ (readble and writable), location
22248 of the lhs of the rule (by default ranging from the location of
22249 the first symbol of the rhs, to the location of the last symbol,
22250 or, if the rhs is empty, YYLLOC).
22252 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
22254 (yyparse): When providing a default semantic action, provide a
22255 default location action.
22256 (after the $): No longer change `*YYLSP', just stack YYLOC the
22257 same way you stack YYVAL.
22258 * src/reader.c (read_declarations): Use warns.
22259 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
22260 (copy_action, case '@'): Likewise.
22261 Use a standard error message, to save useless work from
22264 2000-03-17 Akim Demaille <akim@epita.fr>
22266 * src/bison.s1: Formatting and cosmetics changes.
22267 * src/reader.c: Likewise.
22268 Update the Copyright notice.
22270 2000-03-17 Akim Demaille <akim@epita.fr>
22272 * src/bison.s1 (#line): All set to `#line' only, since the
22273 Makefile now handles them.
22275 2000-03-16 Akim Demaille <akim@epita.fr>
22277 * src/output.c (output_rule_data): Output the documentation of
22278 some of the tables.
22279 (Copyright notice): Update.
22280 Formatting changes.
22282 2000-03-16 Akim Demaille <akim@epita.fr>
22284 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
22285 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
22286 One `#if YYDEBUG' remains, since it uses variables which are
22287 defined only if `YYDEBUG != 0'.
22289 2000-03-16 Akim Demaille <akim@epita.fr>
22291 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
22292 and related variables so that the similarities are highlighted.
22294 2000-03-16 Akim Demaille <akim@epita.fr>
22296 * src/bison.s1: Properly indent CPP directives.
22298 2000-03-16 Akim Demaille <akim@epita.fr>
22300 * src/bison.s1: Properly indent the `alloca' CPP section.
22302 2000-03-16 Akim Demaille <akim@epita.fr>
22304 Do not hard code values of directories in `configure.in'.
22305 Update the `configure' tool chain.
22307 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
22309 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
22310 (AC_OUTPUT): Add m4/Makefile.
22311 Bump to bison 1.28a, 1.29 has never been released.
22312 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
22313 handled via src/Makefile.am.
22314 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
22315 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
22317 * Makefile.am (SUBDIRS): Add m4.
22318 (ACLOCAL_AM_FLAGS): New variable.
22319 (AUTOMAKE_OPTIONS): Add check-news.
22320 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
22321 the proper line number and file name.
22322 (DEFS): Propagate the location of bison library files and of the
22324 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
22326 * acinclude.m4: Remove, replaced by the directory m4.
22327 * m4/Makefile.am (EXTRA_DIST): New variable.
22328 * m4/gettext.m4: New file, from the fileutils.
22329 * m4/lcmessage.m4: Likewise
22330 * m4/progtest.m4: Likewise.
22331 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
22333 2000-03-10 Akim Demaille <akim@epita.fr>
22336 Formatting changes of various comments.
22337 Respect the GNU coding standards at various places.
22338 Don't use `_()' when no translation is needed.
22340 1999-12-13 Jesse Thilo <jthilo@gnu.org>
22343 OS/2 honors TMPDIR environment variable.
22345 1999-12-13 Jesse Thilo <jthilo@gnu.org>
22347 * doc/bison.texinfo: Tweaked spelling and grammar.
22349 Removed reference to price of printed copy.
22350 Mention BISON_SIMPLE and BISON_HAIRY.
22352 1999-12-13 Jesse Thilo <jthilo@gnu.org>
22354 * configure.in, NEWS:
22355 Bison 1.29 released.
22357 1999-10-27 Jesse Thilo <jthilo@gnu.org>
22359 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
22360 Added reference card.
22362 1999-07-26 Jesse Thilo <jthilo@gnu.org>
22364 * po/ru.po: Added Russian translation.
22366 1999-07-26 Jesse Thilo <jthilo@gnu.org>
22368 * configure.in: Added Russian translation.
22370 1999-07-06 Jesse Thilo <jthilo@gnu.org>
22372 * configure.in, NEWS, README:
22373 Released version 1.28.
22375 1999-06-14 Jesse Thilo <jthilo@gnu.org>
22378 Squashed redefinition warning on some systems.
22380 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
22381 Have configure build version string instead of relying on ANSI string
22384 1999-06-14 Jesse Thilo <jthilo@gnu.org>
22386 * po/POTFILES.in: Got rid of version.c.
22388 1999-06-14 Jesse Thilo <jthilo@gnu.org>
22390 * acconfig.h, configure.in:
22391 Have configure build version string instead of relying on ANSI string
22394 1999-06-08 Jesse Thilo <jthilo@gnu.org>
22397 Dropped mention of `+' for long-named options.
22399 1999-05-30 Jesse Thilo <jthilo@gnu.org>
22401 * src/files.c: Added <unistd.h> for unlink().
22403 * src/Makefile.am, src/system.h:
22406 1999-05-30 Jesse Thilo <jthilo@gnu.org>
22408 * README: Added a FAQ list.
22410 * configure.in, acconfig.h:
22413 1999-05-30 Jesse Thilo <jthilo@gnu.org>
22415 * doc/FAQ, doc/Makefile.am:
22418 1999-05-19 Jesse Thilo <jthilo@gnu.org>
22420 * src/alloc.h, src/symtab.h, src/version.c:
22421 Protected inclusion of "config.h" with HAVE_CONFIG_H.
22423 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22425 * src/.cvsignore, src/Makefile.am:
22426 Reorganized: sources in `src', documentation in `doc'.
22428 * src/lex.c (literalchar):
22429 fixed the code for escaping double quotes (thanks
22432 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22434 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
22435 Adjusted paths to reflect directory reorganization.
22437 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22439 * doc/.cvsignore, doc/Makefile.am:
22440 Reorganized: sources in `src', documentation in `doc'.
22442 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22445 Updated AC_INIT file to reflect directory reorganization.
22447 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
22448 Reorganized: sources in `src', documentation in `doc'.
22450 1999-04-13 Jesse Thilo <jthilo@gnu.org>
22453 Don't declare calloc() and realloc() if not necessary.
22455 1999-04-13 Jesse Thilo <jthilo@gnu.org>
22457 * configure.in, acconfig.h, acinclude.m4:
22458 Don't declare calloc() and realloc() if not necessary.
22460 1999-03-23 Jesse Thilo <jthilo@gnu.org>
22462 * po/.cvsignore: Added i18n support.
22464 1999-03-23 Jesse Thilo <jthilo@gnu.org>
22466 * acconfig.h, configure.in, Makefile.am:
22467 Added i18n support.
22469 1999-03-22 Jesse Thilo <jthilo@gnu.org>
22471 * src/bison.s1: Fixed #line numbers.
22473 1999-03-15 Jesse Thilo <jthilo@gnu.org>
22475 * po/es.po, po/fr.po, po/nl.po, po/de.po:
22476 Added PO files from Translation Project.
22478 1999-03-03 Jesse Thilo <jthilo@gnu.org>
22481 Added support for non-ANSI compilers (ansi2knr).
22483 1999-02-16 Jesse Thilo <jthilo@gnu.org>
22485 * configure.in: Bumped version number to 1.27.
22488 Added `bison.simple' to list of files removed by `make distclean'.
22490 1999-02-12 Jesse Thilo <jthilo@gnu.org>
22492 * src/files.c, src/files.h:
22493 Defined locations of parser files in config.h instead of Makefile.
22495 1999-02-12 Jesse Thilo <jthilo@gnu.org>
22497 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
22498 Defined locations of parser files in config.h instead of Makefile.
22500 1999-02-09 Jesse Thilo <jthilo@gnu.org>
22503 Removed inappropriate use of $< macro.
22505 1999-02-05 Jesse Thilo <jthilo@gnu.org>
22507 * po/Makefile.in.in, po/POTFILES.in:
22508 Add `po' directory skeleton.
22510 1999-01-27 Jesse Thilo <jthilo@gnu.org>
22512 * README: Document help-bison list.
22514 * configure.in: Add check for mkstemp().
22516 1999-01-20 Jesse Thilo <jthilo@gnu.org>
22518 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
22519 Hush a few compiler warnings.
22522 Add tryclose(), which verifies that fclose was successful.
22523 Hush a couple of compiler warnings.
22525 1999-01-20 Jesse Thilo <jthilo@gnu.org>
22527 * Makefile.am, OChangeLog:
22528 ChangeLog is now automatically generated. Include the old version as
22531 1999-01-14 Jesse Thilo <jthilo@gnu.org>
22533 * 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:
22534 Update FSF address.
22536 1999-01-14 Jesse Thilo <jthilo@gnu.org>
22538 * doc/bison.texinfo: Fix formatting glitch.
22540 * doc/bison.texinfo: Update FSF address.
22542 1999-01-14 Jesse Thilo <jthilo@gnu.org>
22544 * acconfig.h: Update FSF address.
22546 1999-01-08 Jesse Thilo <jthilo@gnu.org>
22549 Don't define PACKAGE here, since config.h defines it.
22551 1998-12-30 Jesse Thilo <jthilo@gnu.org>
22553 * src/reader.c: Update copyright date.
22556 Ditch sprintf to statically-sized buffers in fatal/warn functions in
22557 favor of output directly to stderr (avoids buffer overruns).
22559 * src/reader.c: Some checks for premature EOF.
22561 * 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:
22562 Use prototypes if the compiler understands them.
22564 * src/files.c: Honor TMPDIR on Unix hosts.
22565 Use prototypes if the compiler understands them.
22568 Fix a couple of buffer overrun bugs.
22569 Use prototypes if the compiler understands them.
22571 * src/system.h: Include unistd.h and ctype.h.
22572 Use #ifdef instead of #if for NLS symbols.
22574 1998-12-30 Jesse Thilo <jthilo@gnu.org>
22576 * doc/bison.texinfo:
22577 Delete comment "consider using @set for edition number, etc..." since
22578 we now are doing so.
22580 1998-12-30 Jesse Thilo <jthilo@gnu.org>
22583 Use prototypes if the compiler understands them.
22585 * NEWS: Document 1.26 highlights.
22587 * Makefile.am: Require Automake 1.3 or later.
22590 Use prototypes if the compiler understands them.
22592 1998-12-29 Jesse Thilo <jthilo@gnu.org>
22595 Use VERSION symbol from automake for version number.
22597 1998-12-29 Jesse Thilo <jthilo@gnu.org>
22599 * acconfig.h, configure.in, version.cin:
22600 Use VERSION symbol from automake for version number.
22602 1998-11-28 Jesse Thilo <jthilo@gnu.org>
22605 Distribute original version of simple parser (bison.s1), not built
22606 version (bison.simple).
22608 1998-11-28 Jesse Thilo <jthilo@gnu.org>
22610 * doc/bison.texinfo: Add info dir entry.
22612 * doc/bison.texinfo:
22613 Let automake put version number into documentation.
22615 1998-11-26 Jesse Thilo <jthilo@gnu.org>
22617 * src/bison.cld, src/build.com, src/vmshlp.mar:
22618 Add non-RCS files from /gd/gnu/bison.
22620 1998-11-26 Jesse Thilo <jthilo@gnu.org>
22623 Document the BISON_HAIRY and BISON_SIMPLE variables.
22625 1998-11-25 Jesse Thilo <jthilo@gnu.org>
22627 * src/version.c: Build version.c automatically.
22630 Fix token numbering (used to start at 258, not 257).
22632 * src/system.h: Include config.h.
22634 * src/getargs.c: Update bug report address.
22636 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
22637 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
22639 1998-11-25 Jesse Thilo <jthilo@gnu.org>
22642 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
22644 * configure.in, version.cin:
22645 Build version.c automatically.
22647 * AUTHORS: Add AUTHORS file.
22649 * README: Update bug report address.
22652 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
22654 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
22655 Add automake stuff.
22657 1998-11-25 Jesse Thilo <jthilo@gnu.org>
22659 * doc/bison.texinfo: Clean up some formatting.
22661 1998-05-05 Richard Stallman <rms@gnu.org>
22663 * doc/bison.texinfo:
22664 Explain better why to make a pure parser.
22666 1998-01-05 Richard Stallman <rms@gnu.org>
22668 * src/files.c (openfiles):
22669 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
22670 find a temporary directory, if possible. Do not unlink files while
22673 1997-08-25 Richard Stallman <rms@gnu.org>
22675 * src/reader.c (stack_offset;):
22676 Change some warni to warns.
22678 * src/lex.c (literalchar): Use warns, not warni.
22680 1997-06-28 Richard Stallman <rms@gnu.org>
22682 * src/bison.s1: Add a Bison version comment.
22684 * src/main.c (fatal, warn, berror):
22687 1997-06-28 Richard Stallman <rms@gnu.org>
22689 * Makefile.in (bison_version): New variable.
22690 (dist): Use that variable.
22691 (bison.s1): Substitute the Bison version into bison.simple.
22693 * bison.simple: Add a Bison version comment.
22695 1997-06-18 Richard Stallman <rms@gnu.org>
22697 * src/main.c (fatal, warn, berror):
22698 Make error messages standard.
22699 (toomany): Improve error message text.
22701 * 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:
22702 new.h renamed to alloc.h.
22704 1997-06-18 Richard Stallman <rms@gnu.org>
22706 * Makefile.in: new.h renamed to alloc.h.
22708 1997-05-24 Richard Stallman <rms@gnu.org>
22710 * src/lex.c (literalchar):
22711 Fix the code for escaping \, " and '.
22713 (lex): Avoid trouble when there are many chars
22714 to discard in a char literal with just several chars in it.
22716 1997-05-17 Richard Stallman <rms@gnu.org>
22719 Use malloc, if using alloca is troublesome.
22720 (YYSTACK_USE_ALLOCA): New flag macro.
22721 Define it for some systems and compilers.
22722 (YYSTACK_ALLOC): New macro.
22723 (yyparse): Use YYSTACK_ALLOC to allocate stack.
22724 If it was malloc'd, free it.
22726 1997-05-17 Richard Stallman <rms@gnu.org>
22729 Use malloc, if using alloca is troublesome.
22730 (YYSTACK_USE_ALLOCA): New flag macro.
22731 Define it for some systems and compilers.
22732 (YYSTACK_ALLOC): New macro.
22733 (yyparse): Use YYSTACK_ALLOC to allocate stack.
22734 If it was malloc'd, free it.
22736 1997-04-23 Richard Stallman <rms@gnu.org>
22739 (alloca) [__hpux]: Always define as __builtin_alloca.
22741 1997-04-23 Richard Stallman <rms@gnu.org>
22744 (alloca) [__hpux]: Always define as __builtin_alloca.
22746 1997-04-22 Richard Stallman <rms@gnu.org>
22749 [__hpux]: Include alloca.h (right for HPUX 10)
22750 instead of declaring alloca (right for HPUX 9).
22752 * src/bison.s1 (__yy_memcpy):
22753 Declare arg `count' as unsigned int.
22754 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
22756 1997-04-22 Richard Stallman <rms@gnu.org>
22759 [__hpux]: Include alloca.h (right for HPUX 10)
22760 instead of declaring alloca (right for HPUX 9).
22762 * bison.simple (__yy_memcpy):
22763 Declare arg `count' as unsigned int.
22764 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
22766 1997-01-03 Richard Stallman <rms@gnu.org>
22768 * src/allocate.c: [__STDC__ or _MSC_VER]:
22769 Declare calloc and realloc to return void *.
22771 1997-01-02 Richard Stallman <rms@gnu.org>
22774 [_MSC_VER]: Include stdlib.h and process.h.
22775 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
22777 * src/main.c (main): Return FAILURE as a value.
22778 (printable_version): Declare arg as int, not char.
22780 1997-01-02 Richard Stallman <rms@gnu.org>
22782 * Makefile.in (dist):
22783 Explicitly check for symlinks, and copy them.
22785 1996-12-19 Richard Stallman <rms@gnu.org>
22788 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
22790 1996-12-18 Paul Eggert <eggert@gnu.org>
22792 * src/bison.s1 (yyparse):
22793 If __GNUC__ and YYPARSE_PARAM are both defined,
22794 declare yyparse to have a void * argument.
22796 1996-12-18 Paul Eggert <eggert@gnu.org>
22798 * bison.simple (yyparse):
22799 If __GNUC__ and YYPARSE_PARAM are both defined,
22800 declare yyparse to have a void * argument.
22802 1996-12-17 Richard Stallman <rms@gnu.org>
22804 * src/reduce.c (nbits): Add some casts.
22806 1996-08-12 Richard Stallman <rms@gnu.org>
22808 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
22810 1996-08-12 Richard Stallman <rms@gnu.org>
22812 * bison.simple: Test _MSDOS as well as _MSDOS_.
22814 1996-07-31 Richard Stallman <rms@gnu.org>
22817 [__sun && __i386]: Include alloca.h.
22819 1996-07-31 Richard Stallman <rms@gnu.org>
22822 [__sun && __i386]: Include alloca.h.
22824 1996-07-30 Richard Stallman <rms@gnu.org>
22826 * src/bison.s1: Comment change.
22828 * src/bison.s1: Test _MSDOS_, not MSDOS.
22830 1996-07-30 Richard Stallman <rms@gnu.org>
22832 * bison.simple: Comment change.
22834 * bison.simple: Test _MSDOS_, not MSDOS.
22836 1996-06-01 Richard Stallman <rms@gnu.org>
22838 * 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:
22839 Insert `_' macro around many string constants.
22842 Insert `_' macro around many string constants.
22844 (main): Call setlocale, bindtextdomain and textdomain.
22846 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
22847 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
22848 [ENABLE_NLS]: Include libintl.h.
22849 [ENABLE_NLS] (gettext): Define.
22850 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
22851 (N_, PACKAGE, LOCALEDIR): New macros.
22853 1996-06-01 Richard Stallman <rms@gnu.org>
22855 * POTFILES.in: New file.
22857 * Makefile.in (allocate.o):
22858 Define target explicitly.
22860 * Makefile.in (CFLAGS): Set to @CFLAGS@.
22861 (LDFLAGS): Set to @LDFLAGS@.
22862 (configure): Run autoconf only if preceding `cd' succeeds.
22863 (bison.s1): Redirect output to temporary file then move the
22864 temporary to the target, rather than redirecting directly to bison.s1.
22865 (clean): Remove config.status and config.log.
22866 (distclean): Don't remove config.status here.
22868 1996-05-12 Richard Stallman <rms@gnu.org>
22871 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
22873 1996-05-12 Richard Stallman <rms@gnu.org>
22876 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
22878 1996-05-11 Richard Stallman <rms@gnu.org>
22880 * src/bison.s1 (__yy_memcpy):
22881 Really reorder the args, as was supposedly done on Feb 14 1995.
22882 (yyparse): Calls changed accordingly.
22884 1996-05-11 Richard Stallman <rms@gnu.org>
22886 * Makefile.in (dist): Don't use $(srcdir).
22888 * bison.simple (__yy_memcpy):
22889 Really reorder the args, as was supposedly done on Feb 14 1995.
22890 (yyparse): Calls changed accordingly.
22892 1996-01-27 Richard Stallman <rms@gnu.org>
22894 * src/output.c (output_rule_data):
22895 Test YYERROR_VERBOSE in the conditional
22896 around the definition of ttyname.
22898 1995-12-29 Richard Stallman <rms@gnu.org>
22901 Fix line numbers in #line commands.
22903 1995-12-29 Richard Stallman <rms@gnu.org>
22906 Fix line numbers in #line commands.
22908 1995-12-27 Richard Stallman <rms@gnu.org>
22910 * src/bison.s1 (YYPARSE_PARAM_DECL):
22911 In C++, make it always null.
22912 (YYPARSE_PARAM_ARG): New macro.
22913 (yyparse): Use YYPARSE_PARAM_ARG.
22915 1995-12-27 Richard Stallman <rms@gnu.org>
22917 * bison.simple (YYPARSE_PARAM_DECL):
22918 In C++, make it always null.
22919 (YYPARSE_PARAM_ARG): New macro.
22920 (yyparse): Use YYPARSE_PARAM_ARG.
22922 1995-11-29 Richard Stallman <rms@gnu.org>
22924 * doc/bison.texinfo:
22925 Describe literal string tokens, %raw, %no_lines, %token_table.
22927 1995-11-29 Daniel Hagerty <hag@gnu.org>
22929 * doc/bison.texinfo: Fixed update date
22931 1995-10-16 Richard Stallman <rms@gnu.org>
22933 * src/version.c: Version 1.25.
22935 1995-10-16 Richard Stallman <rms@gnu.org>
22937 * NEWS: *** empty log message ***
22939 1995-10-16 Richard Stallman <rms@gnu.org>
22941 * doc/bison.1, doc/bison.rnh:
22944 1995-10-15 Richard Stallman <rms@gnu.org>
22946 * src/vmsgetargs.c, src/getargs.c:
22947 Added -n, -k, and -raw switches.
22948 (noparserflag, toknumflag, rawtoknumflag): New variables.
22950 * src/symtab.h (SALIAS):
22951 New #define for adding aliases to %token.
22952 (struct bucket): Added `alias' field.
22954 * src/reduce.c (reduce_grammar):
22955 Revise error message.
22956 (print_notices): Remove final `.' from error message.
22958 * src/reader.c (reader_output_yylsp):
22960 (readgram): Use `#if 0' around code that accepted %command
22961 inside grammar rules: The documentation doesn't allow it,
22962 and it will fail since the %command processors scan for the next %.
22963 (parse_token_decl): Extended the %token
22964 declaration to allow a multi-character symbol as an alias.
22965 (parse_thong_decl): New function.
22966 (read_declarations): Added %thong declarations.
22967 (read_declarations): Handle NOOP to deal with allowing
22968 % declarations as another means to specify the flags.
22969 (readgram): Allow %prec prior to semantics embedded in a rule.
22970 (skip_to_char, read_declarations, copy_definition)
22971 (parse_token_decl, parse_start_decl, parse_type_decl)
22972 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
22973 (get_type_name, copy_guard, copy_action, readgram)
22974 (get_type, packsymbols): Revised most error messages.
22975 Changed `fatal' to `warnxxx' to avoid aborting for error.
22976 Revised and use multiple warnxxx functions to avoid using VARARGS1.
22977 (read_declarations): Improve the error message for
22978 an invalid character. Do not abort.
22979 (read_declarations, copy_guard, copy_action): Use
22980 printable_version to avoid unprintable characters in printed output.
22981 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
22982 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
22983 Allow the type of a non-terminal can be given
22984 more than once, as long as all specifications give the same type.
22987 (output_headers, output_trailers, output, output_gram)
22988 (output_rule_data): Implement noparserflag variable.
22989 Implement toknumflag variable.
22990 (output): Call reader_output_yylsp to output LTYPESTR.
22992 * src/main.c (main):
22993 If reader sees an error, don't process the grammar.
22994 (fatals): Updated to not use VARARGS1.
22995 (printable_version, int_to_string, warn, warni, warns, warnss)
22996 (warnsss): New error reporting functions. Avoid abort for error.
22999 Added THONG and NOOP for alias processing.
23000 Added SETOPT for the new code that allows setting options with %flags.
23003 Include getopt.h. Add some extern decls.
23004 (safegetc): New function to deal with EOF gracefully.
23005 (literalchar); new function to deal with reading \ escapes.
23006 (lex): Use literalchar.
23007 (lex): Implemented "..." tokens.
23008 (literalchar, lex, parse_percent_token): Made tokenbuffer
23009 always contain the token. This includes growing the token
23010 buffer while reading an integer.
23011 (parse_percent_token): Replaced if-else statement with percent_table.
23012 (parse_percent_token): Added % declarations as another
23013 way to specify the flags -n, -l, and -r. Also added hooks for
23014 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
23015 major changes to files.c.
23016 (lex) Retain in the incoming stream a character following
23018 (skip_white_space, lex): Revised most error messages
23019 and changed fatal to warn to avoid aborting.
23020 (percent_table): Added %thong declarations.
23022 * src/gram.h: Comment changes.
23024 * src/files.c (openfiles, open_extra_files, done):
23026 and actfile file. Handle noparserflag. Both for -n switch.
23028 * src/conflicts.c (resolve_sr_conflict):
23029 Remove use of alloca.
23031 1995-06-01 Jim Meyering <meyering@gnu.org>
23033 * doc/bison.texinfo: *** empty log message ***
23035 1995-05-06 Richard Stallman <rms@gnu.org>
23037 * src/bison.s1: Comment change.
23039 1995-05-06 Richard Stallman <rms@gnu.org>
23041 * bison.simple: Comment change.
23043 1995-05-03 Richard Stallman <rms@gnu.org>
23045 * src/version.c: Version now 1.24.
23047 * src/bison.s1: Change distribution terms.
23049 * src/version.c: Version now 1.23.
23051 1995-05-03 Richard Stallman <rms@gnu.org>
23053 * doc/bison.texinfo:
23054 Rewrite "Conditions for Using Bison".
23055 Update version to 1.24.
23057 1995-05-03 Richard Stallman <rms@gnu.org>
23059 * bison.simple: Change distribution terms.
23061 1995-02-23 Richard Stallman <rms@gnu.org>
23063 * src/files.c: Test __VMS_POSIX as well as VMS.
23065 1995-02-14 Jim Meyering <meyering@gnu.org>
23067 * src/bison.s1 (__yy_memcpy):
23068 Renamed from __yy_bcopy to avoid
23069 confusion. Reverse FROM and TO arguments to be consistent with
23072 1995-02-14 Jim Meyering <meyering@gnu.org>
23074 * bison.simple (__yy_memcpy):
23075 Renamed from __yy_bcopy to avoid
23076 confusion. Reverse FROM and TO arguments to be consistent with
23079 1994-11-10 David J. MacKenzie <djm@gnu.org>
23085 * Makefile.in (DISTFILES): Include NEWS.
23087 * Makefile.in (DISTFILES):
23088 Include install-sh, not install.sh.
23090 * configure.in: Update to Autoconf v2 macro names.
23092 1994-10-05 David J. MacKenzie <djm@gnu.org>
23094 * Makefile.in: fix typo
23096 * Makefile.in (prefix, exec_prefix):
23097 Let configure set them.
23099 1994-09-28 David J. MacKenzie <djm@gnu.org>
23101 * Makefile.in: Set datadir to $(prefix)/share.
23103 1994-09-15 Richard Stallman <rms@gnu.org>
23106 Update copyright notice and GPL version.
23108 1994-09-15 Richard Stallman <rms@gnu.org>
23111 Update copyright notice and GPL version.
23113 1994-07-12 Richard Stallman <rms@gnu.org>
23115 * src/reduce.c, src/reader.c:
23118 1994-05-05 David J. MacKenzie <djm@gnu.org>
23120 * Makefile.in: entered into RCS
23122 1994-03-26 Richard Stallman <rms@gnu.org>
23124 * src/bison.s1: entered into RCS
23126 1994-03-26 Richard Stallman <rms@gnu.org>
23128 * bison.simple: entered into RCS
23130 1994-03-25 Richard Stallman <rms@gnu.org>
23132 * src/main.c: entered into RCS
23134 1994-03-24 Richard Stallman <rms@gnu.org>
23136 * src/conflicts.c: entered into RCS
23138 1994-01-02 Richard Stallman <rms@gnu.org>
23140 * Makefile.in: *** empty log message ***
23142 1993-11-21 Richard Stallman <rms@gnu.org>
23144 * src/bison.s1: *** empty log message ***
23146 1993-11-21 Richard Stallman <rms@gnu.org>
23148 * doc/bison.texinfo: entered into RCS
23150 * doc/bison.texinfo: *** empty log message ***
23152 1993-11-21 Richard Stallman <rms@gnu.org>
23154 * bison.simple: *** empty log message ***
23156 1993-10-25 David J. MacKenzie <djm@gnu.org>
23158 * doc/bison.texinfo: *** empty log message ***
23160 1993-10-19 Richard Stallman <rms@gnu.org>
23162 * src/bison.s1: *** empty log message ***
23164 1993-10-19 Richard Stallman <rms@gnu.org>
23166 * bison.simple: *** empty log message ***
23168 1993-10-14 Richard Stallman <rms@gnu.org>
23170 * src/bison.s1: *** empty log message ***
23172 1993-10-14 Richard Stallman <rms@gnu.org>
23174 * bison.simple: *** empty log message ***
23176 1993-09-14 David J. MacKenzie <djm@gnu.org>
23178 * doc/bison.texinfo: *** empty log message ***
23180 1993-09-13 Noah Friedman <friedman@gnu.org>
23182 * Makefile.in: *** empty log message ***
23184 1993-09-10 Richard Stallman <rms@gnu.org>
23186 * src/conflicts.c: *** empty log message ***
23188 * src/system.h: entered into RCS
23190 1993-09-10 Richard Stallman <rms@gnu.org>
23192 * doc/bison.1: entered into RCS
23194 1993-09-06 Noah Friedman <friedman@gnu.org>
23196 * src/version.c: entered into RCS
23198 1993-09-06 Noah Friedman <friedman@gnu.org>
23200 * Makefile.in: *** empty log message ***
23202 1993-07-30 David J. MacKenzie <djm@gnu.org>
23204 * Makefile.in: *** empty log message ***
23206 1993-07-24 Richard Stallman <rms@gnu.org>
23208 * src/bison.s1: *** empty log message ***
23210 1993-07-24 Richard Stallman <rms@gnu.org>
23212 * bison.simple: *** empty log message ***
23214 1993-07-08 David J. MacKenzie <djm@gnu.org>
23216 * Makefile.in: *** empty log message ***
23218 1993-07-04 Richard Stallman <rms@gnu.org>
23220 * src/bison.s1: *** empty log message ***
23222 1993-07-04 Richard Stallman <rms@gnu.org>
23224 * bison.simple: *** empty log message ***
23226 1993-06-26 David J. MacKenzie <djm@gnu.org>
23228 * src/getargs.c: entered into RCS
23230 1993-06-26 David J. MacKenzie <djm@gnu.org>
23232 * doc/bison.texinfo: *** empty log message ***
23234 * doc/bison.1: New file.
23236 1993-06-25 Richard Stallman <rms@gnu.org>
23238 * src/getargs.c: New file.
23240 1993-06-16 Richard Stallman <rms@gnu.org>
23242 * src/bison.s1: *** empty log message ***
23244 1993-06-16 Richard Stallman <rms@gnu.org>
23246 * bison.simple: *** empty log message ***
23248 1993-06-03 Richard Stallman <rms@gnu.org>
23250 * src/bison.s1: New file.
23252 1993-06-03 Richard Stallman <rms@gnu.org>
23254 * doc/bison.texinfo: *** empty log message ***
23256 1993-06-03 Richard Stallman <rms@gnu.org>
23258 * bison.simple: New file.
23260 1993-05-19 Richard Stallman <rms@gnu.org>
23262 * doc/bison.texinfo: New file.
23264 1993-05-07 Noah Friedman <friedman@gnu.org>
23266 * Makefile.in: *** empty log message ***
23268 1993-04-28 Noah Friedman <friedman@gnu.org>
23270 * src/reader.c: *** empty log message ***
23272 1993-04-23 Noah Friedman <friedman@gnu.org>
23274 * src/alloc.h: entered into RCS
23276 1993-04-20 David J. MacKenzie <djm@gnu.org>
23278 * src/version.c: *** empty log message ***
23280 * src/files.c, src/allocate.c:
23283 * src/reader.c: *** empty log message ***
23285 * src/lex.c: entered into RCS
23287 * src/conflicts.c: New file.
23289 * src/symtab.c: entered into RCS
23291 * src/alloc.h: New file.
23293 * src/LR0.c: entered into RCS
23295 1993-04-18 Noah Friedman <friedman@gnu.org>
23297 * src/reader.c: New file.
23299 * src/version.c: *** empty log message ***
23301 1993-04-18 Noah Friedman <friedman@gnu.org>
23303 * Makefile.in: *** empty log message ***
23305 1993-04-17 Noah Friedman <friedman@gnu.org>
23307 * Makefile.in: *** empty log message ***
23309 1993-04-15 Richard Stallman <rms@gnu.org>
23311 * src/main.c, src/files.c:
23314 1993-04-15 Noah Friedman <friedman@gnu.org>
23316 * configure.in: entered into RCS
23318 * configure.in: *** empty log message ***
23320 * configure.in: New file.
23322 1993-04-14 Richard Stallman <rms@gnu.org>
23324 * Makefile.in: New file.
23326 1993-04-13 Richard Stallman <rms@gnu.org>
23328 * src/version.c: New file.
23330 1993-03-25 Richard Stallman <rms@gnu.org>
23332 * src/output.c: entered into RCS
23334 1992-09-25 Richard Stallman <rms@gnu.org>
23336 * configure.bat: entered into RCS
23338 1992-06-22 Richard Stallman <rms@gnu.org>
23340 * src/vmsgetargs.c: entered into RCS
23342 1992-06-22 Richard Stallman <rms@gnu.org>
23344 * doc/bison.rnh: entered into RCS
23346 1992-04-20 David J. MacKenzie <djm@gnu.org>
23348 * README: entered into RCS
23350 1992-01-22 Richard Stallman <rms@gnu.org>
23352 * src/machine.h: entered into RCS
23354 1991-12-21 Richard Stallman <rms@gnu.org>
23356 * src/lalr.c, src/closure.c:
23359 1991-12-20 Richard Stallman <rms@gnu.org>
23361 * src/state.h: entered into RCS
23363 1991-12-18 Richard Stallman <rms@gnu.org>
23365 * src/print.c, src/nullable.c, src/derives.c:
23368 1991-11-03 David J. MacKenzie <djm@gnu.org>
23370 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
23373 1988-09-09 Richard Stallman <rms@gnu.org>
23375 * src/bison.hairy: entered into RCS
23377 1987-12-16 Richard Stallman <rms@gnu.org>
23379 * REFERENCES: entered into RCS
23384 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
23385 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
23386 2008, 2009 Free Software Foundation, Inc.
23388 Copying and distribution of this file, with or without
23389 modification, are permitted provided the copyright notice and this
23390 notice are preserved.