1 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
3 Fix options documentation.
4 * build-aux/cross-options.pl: As in --help output, write optional
5 arguments as [=ARG] not =[ARG].
6 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
8 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
10 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
11 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
12 requirements for a correct m4 are stricter.
13 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
14 * configure.ac: Update to use AC_PROG_GNU_M4.
15 Reported by Eric Blake.
17 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
19 Help with updating web manual.
20 * HACKING: Incorporate instructions from gnulib/doc/README.
21 * bootstrap.conf (gnulib_modules): Add gendocs.
23 2009-04-03 Akim Demaille <demaille@gostai.com>
26 * src/parse-gram.h, src/parse-gram.c: Regen.
28 2009-04-03 Akim Demaille <demaille@gostai.com>
30 Factor %FLAG at scan level.
31 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
32 definitions and associated rules, replaced by....
33 (PERCENT_FLAG): this new token type, and rule.
34 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
35 Use it for %debug and %error-verbose.
37 2009-04-03 Akim Demaille <demaille@gostai.com>
40 * src/parse-gram.h, src/parse-gram.c: Regen.
42 2009-04-03 Akim Demaille <demaille@gostai.com>
44 Treat %debug as %define debug.
45 * data/bison.m4 (b4_debug_if): New.
46 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
47 * data/lalr1.java: Use it instead of b4_debug_flag.
48 * src/getargs.h, src/getargs.c (debug_flag): Remove.
49 * src/output.c (prepare): Don't output it.
50 * src/parse-gram.y: Treat %debug as %define debug.
52 2009-04-03 Akim Demaille <demaille@gostai.com>
54 Treat %error-verbose as %define error_verbose.
55 This allows to pass -Derror_verbose on the command line. Better
56 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
57 ERROR_VERBOSE being defined as false or true.
58 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
59 on b4_percent_define_ifdef, for does not check the defined value,
60 but only whether the symbol is defined, rely on
61 b4_percent_define_flag_if, so that a value of "false" is processed
63 If not defined, define the flag to "false".
64 (b4_error_verbose_if): New.
65 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
66 b4_error_verbose_flag.
67 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
68 * src/output.c (prepare): Don't output it.
69 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
71 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
73 Fix strange %define locations for default values.
74 Reported by Akim Demaille at
75 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
76 and discussed again starting at
77 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
78 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
79 because location information is bogus.
80 Use angle brackets to delimit fake file name because square brackets
81 look like underexpanded m4. Choose a better fake file name.
82 Use negative line numbers.
83 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
84 * src/location.c (location_print): If line for a boundary is negative,
85 only print that boundary's file name.
86 * src/location.h: Document that.
87 * tests/skeletons.at (%define Boolean variables: invalid skeleton
88 defaults): Update output.
90 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
92 Pacify ./configure --enable-gcc-warnings.
93 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
94 in lib won't compile with it.
95 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
97 2009-03-31 Akim Demaille <demaille@gostai.com>
99 bootstrap: --help to stdout.
100 * bootstrap (usage): Don't send --help to stderr.
101 Use a here doc instead of a long string.
103 2009-03-31 Akim Demaille <demaille@gostai.com>
105 bootstrap: README-hacking no longer exists
106 * bootstrap (checkout_only_file): Set to HACKING.
108 2009-03-26 Akim Demaille <demaille@gostai.com>
110 doc: merge HACKING and README-hacking.
111 Two files is confusing.
112 Reported by Alexandre Duret-Lutz.
114 * README-hacking: Merge into...
115 * HACKING (Working from the repository): here.
117 2009-03-26 Akim Demaille <demaille@gostai.com>
119 doc: update README-hacking.
120 * README-hacking: We now use git and git submodules.
121 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
123 2009-03-26 Akim Demaille <demaille@gostai.com>
125 lalr1.cc: avoid GCC 4.3 warnings.
126 GCC 4.3 now warns about "a || b && c" and asks for explicit
128 Reported by Alexandre Duret-Lutz.
129 * data/location.cc: Update copyright years.
130 (Position::operator==): Use parens to make precedence explicit.
131 Compare lines and columns first, as they are more likely to be
132 different, and they are faster to compare.
134 2009-03-26 Akim Demaille <demaille@gostai.com>
137 * gnulib: Update to latest.
138 * src/local.mk (AM_CFLAGS): Move to...
140 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
143 2009-03-02 Akim Demaille <demaille@gostai.com>
147 2009-03-02 Akim Demaille <demaille@gostai.com>
149 Share b4_yytranslate_define.
150 * data/lalr1.cc (b4_yytranslate_define): Move to...
153 2009-03-02 Akim Demaille <demaille@gostai.com>
155 Use locations in the variant example.
156 Yes, this obfuscates the point of this example, variants only.
157 But glr.cc cannot work (yet?) without locations. This change
158 makes it easier to use this example with glr.cc.
160 * examples/variant.yy (assert): %define it.
161 (locations): Request them.
162 (yylex): Bind the location to the stage.
164 2009-03-02 Akim Demaille <demaille@gostai.com>
166 Dub make_TOKEN as a public type interface.
167 * data/c++.m4 (b4_symbol_constructor_declare)
168 (b4_symbol_constructor_define): New empty stubs.
169 (b4_public_types_declare, b4_public_types_define): Use them.
170 * data/lalr1.cc (b4_symbol_constructor_declare)
171 (b4_symbol_constructor_declare_)
172 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
174 * data/variant.hh: here.
175 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
177 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
178 b4_symbol_constructor_declare, as it is now done by
179 b4_public_types_define and b4_public_types_declare.
181 2009-03-02 Akim Demaille <demaille@gostai.com>
183 Coding style changes.
184 * data/lalr1.cc (b4_symbol_constructor_declaration_)
185 (b4_symbol_constructor_declarations)
186 (b4_symbol_constructor_definition_)
187 (b4_symbol_constructor_definitions)
188 (b4_yytranslate_definition): Rename as...
189 (b4_symbol_constructor_declare_)
190 (b4_symbol_constructor_declare)
191 (b4_symbol_constructor_define_)
192 (b4_symbol_constructor_define)
193 (b4_yytranslate_define): these.
194 * data/variant.hh (b4_variant_definition): Rename as...
195 (b4_variant_define): this.
197 2009-03-02 Akim Demaille <demaille@gostai.com>
199 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
200 * data/bison.m4 (b4_percent_define_if_define): New.
201 * data/c++.m4 (b4_variant_if): Move to...
202 * data/bison.m4: Here, using b4_percent_define_if_define.
203 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
204 * data/bison.m4: Here, using b4_percent_define_if_define.
206 2009-03-02 Akim Demaille <demaille@gostai.com>
208 Dub symbol_type_base as a public type.
209 * data/c++.m4 (b4_public_types_declare): Now define
210 symbol_type_base and symbol_type.
211 (b4_public_types_define): New.
212 In both cases, the definitions are taken verbatim from lalr1.cc.
213 * data/lalr1.cc: Adjust.
215 2009-03-02 Akim Demaille <demaille@gostai.com>
217 b4_public_types_declare.
218 * data/c++.m4 (b4_public_types_declare): New.
219 * data/glr.cc, data/lalr1.cc: Use it.
221 2009-03-02 Akim Demaille <demaille@gostai.com>
223 b4_semantic_type_declare.
224 * data/c++.m4 (b4_semantic_type_declare): New.
225 Factors and generalizes what was in glr.cc and lalr1.cc.
226 * data/variant.hh (b4_semantic_type_declare): Redefine it for
228 * data/lalr1.cc, data/glr.cc: Use it.
230 2009-02-26 Akim Demaille <demaille@gostai.com>
233 * gnulib: Upgrade from master.
234 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
237 2009-02-25 Akim Demaille <demaille@gostai.com>
239 Remove useless arguments.
240 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
243 2009-02-25 Akim Demaille <demaille@gostai.com>
246 * data/lalr1.cc: here.
248 2009-02-25 Akim Demaille <demaille@gostai.com>
250 Fix glr.cc's debug level handling.
251 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
253 (debug_level, set_debug_level): Adjust.
255 2009-02-25 Akim Demaille <demaille@gostai.com>
258 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
260 2009-02-25 Akim Demaille <demaille@gostai.com>
263 * etc/bench.pl.in (generate_grammar_list): Consitently use
264 location_type, not yy::location.
266 2009-02-25 Akim Demaille <demaille@gostai.com>
269 * data/lalr1.cc: here.
271 2009-02-19 Akim Demaille <demaille@gostai.com>
273 Make yyparser::error public.
274 * data/lalr1.cc: here.
275 There is no good reason to keep it private (and it is convenient
276 to use it from the scanner for instance). It is already public in
279 2009-02-19 Akim Demaille <demaille@gostai.com>
284 2009-02-19 Akim Demaille <demaille@gostai.com>
286 Remove trailing blanks.
287 The epilogue has its own ending \n, no need to add another.
289 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
291 * data/glr.cc: dnl when extending the epilogue.
292 Remove stray "private:".
294 2009-02-19 Akim Demaille <demaille@gostai.com>
297 * data/c.m4 (b4_c_function_decl): Here.
299 2009-02-19 Akim Demaille <demaille@gostai.com>
302 * data/lalr1.cc: here.
304 2009-02-19 Akim Demaille <demaille@gostai.com>
307 * data/variant.hh: New, extracted from...
308 * data/lalr1.cc: here.
310 * data/local.mk: Adjust.
312 2009-02-19 Akim Demaille <demaille@gostai.com>
314 Extract stack.hh from lalr1.cc.
315 * data/stack.hh: New.
316 * data/lalr1.cc: Extract from here.
317 * data/local.mk: Adjust.
319 2009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
321 Add reminder about uploading public key to keys.gnupg.net.
322 * HACKING (Release Procedure): Here.
324 2009-01-28 Akim Demaille <demaille@gostai.com>
326 * NEWS: Update information about 2.4.1 and 2.4.2.
328 2008-11-04 Akim Demaille <demaille@gostai.com>
331 * NEWS: Use more outline-mode markup.
332 Suggested by Jim Meyering.
334 2009-01-08 Akim Demaille <demaille@gostai.com>
336 Fix grep portability issues.
337 Grep on Solaris does not support -q.
338 Reported by Summum Bonum.
340 * NEWS: Add a stub for 2.4.2.
341 * THANKS: Add Summum Bonum.
342 * tests/atlocal.in (EGREP): New.
343 (CC, CXX, XSLTPROC): Make it possible to override them via
345 * tests/java.at: Use $EGREP instead of egrep.
346 Use AT_CHECK's ignore instead of grep's -q.
348 2008-12-11 Akim Demaille <demaille@gostai.com>
350 Pass the token type to yysyntax_error.
351 * data/yacc.c (yysyntax_error): Take the transated token instead
356 2008-12-11 Akim Demaille <demaille@gostai.com>
359 * data/glr.c: Formatting changes.
361 2008-12-11 Akim Demaille <demaille@gostai.com>
363 Propagate i18n changes into glr.c.
365 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
366 building the error message format dynamically.
367 * data/lalr1.java: Formatting changes.
369 2008-12-11 Akim Demaille <demaille@gostai.com>
372 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
373 Solves problems when top_srcdir is an absolute path.
374 Suggested by Eric Blake.
375 * configure.ac: Require Autoconf 2.62.
377 2008-12-11 Akim Demaille <demaille@gostai.com>
379 Simplify the i18n of the error messages.
380 * data/lalr1.cc: Comment changes.
381 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
382 lalr1.cc instead of building dynamically the format string.
384 2008-12-08 Akim Demaille <demaille@gostai.com>
386 Fix portability issue in the test suite.
387 * tests/local.at (AT_MATCHES_CHECK): New.
388 Based on Perl instead of Sed. Sed has too many portability
389 pitfalls, not ever Sed is GNU Sed.
390 * tests/actions.at (Fix user actions without a trailing semicolon):
393 2008-12-08 Akim Demaille <demaille@gostai.com>
396 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
398 2008-12-08 Akim Demaille <demaille@gostai.com>
400 Install autoconf as a submodule to get m4sugar.
401 * .gitmodules: Add submodules/autoconf.
402 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
405 2008-12-08 Akim Demaille <demaille@gostai.com>
407 Test token.prefix in all the skeletons.
408 * data/java.m4 (b4_token_enum): Use the token.prefix.
409 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
410 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
411 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
412 * tests/java.at: Comment changes.
413 (AT_CHECK_JAVA_MINIMAL): Define the END token.
414 (Java parser class and package names): Add token.prefix check.
416 2008-12-08 Akim Demaille <demaille@gostai.com>
418 Fix regeneration of atconfig.
419 * tests/local.mk (tests/atconfig): The rule was incorrect, but
420 remove it: now that there is no tests/Makefile.am, the top-level
421 Makefile properly updates atconfig when needed.
423 2008-12-07 Di-an Jan <dianj@freeshell.org>
425 Implement the FIXME that ends an user action with a semicolon
426 if it seems necessary.
427 * src/scan-code.l (flex rules section): Flag cpp directive from
428 any `#' to the first unescaped end-of-line. Semicolon is not
429 needed after `;', `{', '}', or cpp directives and is needed after
430 any other token (whitespaces and comments have no effect).
431 * tests/actions.at (Fix user actions without a trailing semicolon):
433 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
434 to make user actions complete statements.
435 Adjust column numbers in error messages.
436 * tests/regression.at (Fix user actions without a trailing semicolon):
437 Remove. Covered by new test.
439 2008-12-07 Akim Demaille <demaille@gostai.com>
442 * gnulib: Update from master.
444 2008-12-05 Eric Blake <ebb9@byu.net>
446 Avoid compiler warning.
447 * src/output.c (muscle_insert_item_number_table): Delete unused
450 2008-12-02 Eric Blake <ebb9@byu.net>
452 Build testsuite with newer autoconf.
453 * tests/output.at (m4_expand): Don't override in newer autoconf,
454 where the underlying implementation changed.
455 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
456 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
457 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
458 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
459 since some of them contain unbalanced ')'.
461 2008-12-01 Akim Demaille <demaille@gostai.com>
463 Use b4_symbol for printers and destructors everywhere.
464 * data/bison.m4 (b4_symbol_action_location): New.
465 * data/c.m4 (b4_symbol_actions): Remove.
466 Adjust all callers to use by b4_symbol_foreach and the corresponding
467 b4_symbol_printer/destructor macro.
468 * data/glr.cc: Adjust.
469 * data/lalr1.java: Adjust the %destructor sanity check.
470 * src/output.c (symbol_code_props_output): Remove, we no longer
471 need the b4_symbol_printers/destructors tables.
473 2008-12-01 Akim Demaille <demaille@gostai.com>
476 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
479 2008-12-01 Akim Demaille <demaille@gostai.com>
481 Move b4_symbol based macro to bison.m4.
482 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
483 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
484 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
485 (b4_type_foreach): Move to...
486 * data/bison.m4: Here.
487 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
488 b4_symbol_value_template instead of b4_symbol_value.
490 2008-12-01 Akim Demaille <demaille@gostai.com>
492 b4_symbol/type_foreach.
493 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
496 2008-12-01 Akim Demaille <demaille@gostai.com>
498 Use the symbol properties to output the printer/destructor for lalr1.cc.
499 Instead of defining complex list of tuples to define various
500 properties of the symbols, we now prefer to define symbols as
501 "structs" in m4: using the symbol key (its number), and the
502 property name, b4_symbol gives it value. Use this to handle
503 destructors and printers.
505 * src/output.c (CODE_PROP): New.
506 (prepare_symbol_definitions): Use it to define the printer and
507 destructor related attributes of the symbols.
508 * data/lalr1.cc (b4_symbol_actions): Rename as...
509 (b4_symbol_action): this.
510 Use b4_symbol instead of 6 arguments.
511 (b4_symbol_printer, b4_symbol_destructor): New.
512 Use them instead of b4_symbol_actions.
514 2008-12-01 Akim Demaille <demaille@gostai.com>
516 Avoid capturing variables too easily.
517 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
518 v__ and p__ instead of v and p.
520 2008-12-01 Akim Demaille <demaille@gostai.com>
522 Remove spurious empty line before syncline.
523 * data/bison.m4 (b4_syncline): Don't output an empty line before
526 2008-11-26 Akim Demaille <demaille@gostai.com>
528 Convert lib/Makefile.am into lib/local.mk.
529 The real problem is rather gnulib.mk, which itself is extracted
530 from a Makefile.am that gnulib expects to the "recursive". The
531 tool prefix-gnulib-mk converts such a gnulib.mk to be
532 non-recursive. Also, some AC_SUBST variables need to be adjusted.
534 * etc/prefix-gnulib-mk: New.
535 * bootstrap (slurp): Use it to convert further gnulib.mk.
536 No longer try to avoid re-creation of lib/gnulib.mk as the changes
538 * lib/Makefile.am: Rename as...
539 * lib/local.mk: this.
540 Adjust to be prefixed.
541 * Makefile.am, configure.ac: Adjust.
542 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
544 2008-11-26 Akim Demaille <demaille@gostai.com>
547 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
548 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
549 Reported by Eric Blake.
551 2008-11-26 Akim Demaille <demaille@gostai.com>
553 Use b4_parser_tables_define in glr.cc.
554 * data/glr.c: Use b4_parser_tables_define instead of defining the
555 (deterministic integral) tables by hand.
557 2008-11-26 Akim Demaille <demaille@gostai.com>
559 Use b4_parser_tables_define in Java.
560 * data/java.m4 (b4_typed_parser_table): Rename as...
561 (b4_typed_parser_table_define): this, for consistency.
562 Accept a comment as $4.
564 (b4_integral_parser_table): Rename as...
565 (b4_integral_parser_table_define): this.
566 * data/lalr1.java: Adjust all uses.
567 Use b4_parser_tables_define instead of generation by hand.
569 2008-11-26 Akim Demaille <demaille@gostai.com>
571 Prepare the convergence bw C style and Java table generation.
572 * data/bison.m4 (b4_tables_map, b4_tables_declare)
573 (b4_tables_define): Rename as...
574 (b4_integral_parser_tables_map, b4_parser_tables_declare)
575 (b4_parser_tables_define): these.
576 * data/c.m4 (b4_table_define): Rename as...
577 (b4_integral_parser_table_define): this.
578 * data/lalr1.cc: Adjust.
579 (b4_table_define, b4_table_declare): Rename as...
580 (b4_integral_parser_table_define)
581 (b4_integral_parser_table_declare): these.
582 (yyrline_): Move the comment where it is actually used.
583 * data/yacc.c: Adjust.
584 (yyrline): Use b4_integral_parser_table_define.
586 2008-11-26 Akim Demaille <demaille@gostai.com>
589 * src/parse-gram.h, src/parse-gram.c: Regen.
591 2008-11-26 Akim Demaille <demaille@gostai.com>
593 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
594 * data/lalr1.cc (b4_tables_map): Move to...
595 * data/bison.m4: here.
596 Update the comment for yytable during the flight.
597 (b4_tables_declare, b4_tables_define): New.
598 * data/lalr1.cc: Use them.
599 * data/c.m4 (b4_table_define): New.
600 * data/yacc.c: Use b4_tables_define instead of output the tables
602 * tests/regression.at (Web2c Actions): Adjust the expected output,
603 the order of the tables changed.
605 2008-11-26 Akim Demaille <demaille@gostai.com>
607 Get rid of (yy)rhs and (yy)prhs.
608 These tables are no longer needed in the parsers, and they don't seem to
609 be useful. They are not documented either.
611 * src/output.c (prepare_rules): Get rid of rhs and prhs.
612 Adjust the computation of (yy)r2.
614 2008-11-26 Akim Demaille <demaille@gostai.com>
616 Rule length is unsigned.
617 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
619 2008-11-26 Akim Demaille <demaille@gostai.com>
621 Get rid of lalr1-split.cc.
622 It was no longer maintainer.
624 * data/lalr1-split.cc: Remove.
625 * etc/bench.pl.in (bench_fusion_parser): Remove.
628 2008-11-26 Akim Demaille <demaille@gostai.com>
630 Use yy* consistently.
631 * data/glr.c: Now that yyrhs no longer exists as a global
632 variable, rename local "rhs" variables into "yyrhs" for
635 2008-11-25 Akim Demaille <demaille@gostai.com>
637 Get rid of yyrhs and yyprhs in glr.c.
638 * data/glr.c (yyrhs, yyprhs): Remove.
639 Instead, use the state stack and yystos.
641 2008-11-25 Akim Demaille <demaille@gostai.com>
644 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
645 as an Autotest keyword.
647 2008-11-25 Akim Demaille <demaille@gostai.com>
649 Prefer TESTSUITE_FLAGS.
650 TESTSUITEFLAGS is barely readable.
652 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
653 for backward compatibility.
654 Use the former instead of the latter.
656 2008-11-25 Akim Demaille <demaille@gostai.com>
658 Get rid of yyrhs and yyprhs in larl1.java.
659 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
660 (yy_reduce_print): Rather, use yystos_ and the state stack.
662 2008-11-25 Akim Demaille <demaille@gostai.com>
666 2008-11-25 Akim Demaille <demaille@gostai.com>
668 Get rid of yyrhs and yyprhs in yacc.c.
669 They were used to get the symbol types, given a rule number, when
670 displaying the top of the stack before a reduction. But the
671 symbol type is available from the state stack. This has two be
672 benefits: two tables less in the parser (making it smaller), and a
673 more consistent use of the three stacks which will help to fuse
676 * data/yacc.c (yyprhs, yyrhs): Remove.
677 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
678 (yy_reduce_print): Take yyssp as argument.
679 Use it, together with yystos, to get the symbol type.
680 * tests/regression.at (Web2c Report): Remove these tables from the
683 2008-11-25 Akim Demaille <demaille@gostai.com>
686 The point is to factor the generation of the tables across skeletons.
687 This is language dependant.
689 * data/c.m4 (b4_comment_): New.
690 Should be usable to define how to generate tables independently of
693 (b4_comment): Bounce to b4_c_comment.
694 Now support $2 = [PREFIX] for indentation.
695 * data/lalr1.cc (b4_table_declare): Don't output a comment if
697 Indent it properly when there is one.
698 Output the ending semicolon.
699 (b4_table_define): Space changes.
700 Output the ending semicolon.
701 (b4_tables_map): New.
702 Use it twice instead of declaring and defining the (integral)
705 2008-11-25 Akim Demaille <demaille@gostai.com>
708 * data/lalr1.cc (b4_table_declare): New.
709 Use it to declare the tables defined with b4_table_define.
710 (b4_table_define): Declare a third arg to match b4_table_declare
712 Move all the comments around invocations of b4_table_define into
713 the invocations itselves.
714 Move things around to have the order for declarations and
717 2008-11-25 Akim Demaille <demaille@gostai.com>
720 * data/lalr1.java: here.
722 2008-11-25 Akim Demaille <demaille@gostai.com>
724 b4_args is more general than only C++.
725 * data/lalr1.cc (b4_args, _b4_args): Move to...
726 * data/bison.m4: here.
728 2008-11-21 Di-an Jan <dianj@freeshell.org>
730 Implement no-XXX arguments for --warnings, --report, --trace.
731 * src/getargs.c (flags_argmatch): Handles no-XXX.
732 Fix typo in doxygen comment.
734 2008-11-21 Akim Demaille <demaille@gostai.com>
736 Display the changes in cross-options.texi.
737 * build-aux/cross-options.pl ($sep): New, to separate items.
738 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
741 2008-11-20 Di-an Jan <dianj@freeshell.org>
743 Improves options in the manual.
744 * doc/bison.texinfo (-g, -x): Add space before argument.
745 (Option Cross Key): Implement FIXME: listing directives also.
746 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
747 (Short Option): Special case -d. Put arguments inside @option.
748 (Bison Directive): Add column, automatically extracted from
749 src/scan-gram.l (actual name passed as the first argument)
750 with special case for %define.
751 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
752 to build-aux/cross-options.pl.
753 * src/getargs.c (usage): Document limitations of cross-options.pl.
754 * src/scan-gram.l: Likewise.
756 2008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
758 Fix unexpanded macros in GLR defines file.
759 Reported by Csaba Raduly at
760 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
761 * THANKS (Csaba Raduly): Add.
762 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
763 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
764 lexer in a separate module that includes the defines file.
765 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
767 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
768 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
769 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
770 (AT_DATA_SOURCE_PROLOGUE): New.
771 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
772 (AT_DATA_SOURCE): New.
773 (AT_FULL_COMPILE): Extend to support an additional source file.
775 2008-11-18 Akim Demaille <demaille@gostai.com>
778 * TODO: More short term issues.
780 2008-11-18 Akim Demaille <demaille@gostai.com>
783 * src/parse-gram.h, src/parse-gram.c: Regen.
785 2008-11-18 Akim Demaille <demaille@gostai.com>
787 Use b4_subtract where possible.
788 * data/lalr1.cc (b4_subtract): Move to...
789 * data/bison.m4: here.
790 * data/glr.c (b4_rhs_data): Use it.
791 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
793 2008-11-18 Akim Demaille <demaille@gostai.com>
795 Remove incorrect mode specification.
796 * data/glr.cc: Don't pretend it's C code.
798 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
800 Simplify last patch slightly.
801 * src/getargs.c (getargs): Here.
803 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
805 Fix last warning from --enable-gcc-warnings.
806 * src/getargs.c (getargs): Don't assign const address to non-const
809 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
811 Don't let maintainer-*-check targets force a version update.
812 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
815 2008-11-17 Di-an Jan <dianj@freeshell.org>
817 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
818 Align menus. Adjust word wrapping. Use node names for menu names.
819 (Examples): Don't abbreviate node names.
820 (LocalWords): Remove abbreviations.
821 (Copying): Make description a sentence.
822 (Java Action Features): Remove period to match the rest of menu.
824 2008-11-17 Di-an Jan <dianj@freeshell.org>
826 Handles several --enable-gcc-warnings.
827 * src/getargs.c (command_line_location): Set parameters to void.
828 * src/output.c (symbol_type_name_cmp): Make static.
829 (symbols_by_type_name): Set parameters to void.
830 (symbol_definitions_output): Remove unused parameter. Rename as...
831 (prepare_symbol_definitions): this.
832 (muscles_output): Move symbol_definitions_output to...
833 (output): here as prepare_symbol_definitions.
834 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
835 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
837 2008-11-17 Di-an Jan <dianj@freeshell.org>
839 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
840 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
842 2008-11-16 Akim Demaille <demaille@gostai.com>
844 Add missing $(EXEEXT).
845 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
846 "src/bison$(EXEEXT)".
847 Reported by Di-an Jan.
849 2008-11-15 Akim Demaille <demaille@gostai.com>
853 2008-11-15 Akim Demaille <demaille@gostai.com>
856 * tests/input.at: here.
858 2008-11-15 Akim Demaille <demaille@gostai.com>
860 Remove duplicate header inclusion.
863 2008-11-15 Akim Demaille <demaille@gostai.com>
865 * src/parse-gram.h, src/parse-gram.c: Regen.
867 2008-11-15 Akim Demaille <demaille@gostai.com>
869 Support parametric types.
871 There are two issues to handle: first scanning nested angle
872 bracket pairs to support types such as std::pair< std::string,
873 std::list<std::string> > >.
875 Another issue is to address idiosyncracies of C++: do not glue two
876 closing angle brackets together (otherwise it's operator>>), and
877 avoid sticking blindly a TYPE to the opening <, as it can result
878 in '<:' which is a digraph for '['.
880 * src/scan-gram.l (brace_level): Rename as...
883 Implement support for complex tags.
886 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
887 (b4_symbol_variant): Leave space around types as parameters.
888 * examples/variant.yy: Use nested template types and leading ::.
889 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
891 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
892 * tests/c++.at: Test parametric types.
894 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
897 This is not sufficient, but we test at least that the make_SYMBOL
898 interface is not affected by token.prefix. A more general test
899 will be implemented when the support of token.prefix is generalized
902 * tests/c++.at: One more variant test, using token.prefix.
904 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
906 Test the make_TOKEN interface.
907 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
908 Factor the common code in yylex.
909 Use it to test "%define lex_symbol".
911 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
915 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
917 Simplify code for variants bench marks.
918 * etc/bench.pl.in (&generate_grammar_list): Define and use
920 Factor the common code in yylex.
922 2008-11-15 Akim Demaille <demaille@gostai.com>
924 Better error message.
925 * bootstrap (find_tool): Fix the error message.
927 2008-11-15 Akim Demaille <demaille@gostai.com>
929 Update variant.yy to newest interface.
930 * examples/variant.yy: Define lex_symbol.
933 2008-11-15 Akim Demaille <demaille@gostai.com>
935 Don't use locations in variant.yy.
936 * examples/variant.yy: Adjust to not using locations.
938 2008-11-15 Akim Demaille <demaille@gostai.com>
941 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
942 comments for the license.
944 2008-11-15 Akim Demaille <demaille@gostai.com>
946 Remove tests/Makefile.am.
947 * tests/Makefile.am: Rename as...
948 * tests/local.mk: this.
949 * Makefile.am, configure.ac: Adjust.
950 * Makefile.am (DISTCLEANFILES): Define.
951 (maintainer-check, maintainer-xml-check, maintainer-push-check):
952 Remove, we no longer need to bounce to the real targets.
954 2008-11-15 Akim Demaille <demaille@gostai.com>
958 2008-11-15 Akim Demaille <demaille@gostai.com>
961 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
962 * djgpp/local.mk: this new file.
964 2008-11-15 Akim Demaille <demaille@gostai.com>
966 Remove doc/Makefile.am.
967 * doc/Makefile.am: Rename as...
968 * doc/local.mk: this.
970 * Makefile.am, configure.ac: Adjust.
971 * Makefile.am (MOSTLYCLEANFILES): New.
972 * src/local.mk: Adjust.
974 2008-11-15 Akim Demaille <demaille@gostai.com>
976 Move sc_tight_scope into maint.mk.
977 It does not work, and I don't know how it was supposed to work: it
978 seems to be looking for sources in the build tree. I just moved
979 it at a better place, fixing it is still required.
981 * src/local.mk (echo): Remove.
982 (sc_tight_scope): Move to...
985 2008-11-15 Akim Demaille <demaille@gostai.com>
988 * src/parse-gram.h, src/parse-gram.h: Regen.
990 2008-11-15 Akim Demaille <demaille@gostai.com>
992 Remove src/Makefile.am.
993 * src/Makefile.am: Rename as...
994 * src/local.mk: this.
995 Prefix all the paths with src/.
996 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
997 (AM_CPPFLAGS): Find find in builddir/src.
998 (YACC): Move the flags into...
1000 * maint.mk (sc_tight_scope): Disable.
1001 It used to bounce to the version in src/Makefile.am which is now
1002 part of this very Makefile.
1003 * Makefile.am, configure.ac: Adjust.
1004 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
1005 include "..." to find files "here": we are no longer in src/, so
1006 qualify the includes with src/.
1007 * doc/Makefile.am (PREPATH): No longer include the top_builddir
1009 (.x.1): Adjust to be able to create src/foo from the top level
1010 Makefile, instead of going bounce to src/Makefile the creation of
1013 2008-11-15 Akim Demaille <demaille@gostai.com>
1015 Remove useless variable.
1016 * doc/Makefile.am (srcsrcdir): Remove.
1018 2008-11-15 Akim Demaille <demaille@gostai.com>
1020 Remove data/Makefile.am.
1021 * data/Makefile.am: Rename as...
1022 * data/local.mk: this.
1024 * Makefile.am, configure.ac: Adjust.
1026 2008-11-15 Akim Demaille <demaille@gostai.com>
1028 Remove etc/Makefile.am.
1029 * etc/Makefile.am: Rename as...
1030 * etc/local.mk: this.
1032 * Makefile.am, configure.ac: Adjust.
1034 2008-11-15 Akim Demaille <demaille@gostai.com>
1036 Remove examples/local.mk.
1037 examples/calc++/Makefile.am might be interesting to keep as is, since
1038 it is an example in itself.
1040 * examples/Makefile.am: Rename as...
1041 * examples/local.mk: this.
1043 * Makefile.am, configure.ac: Adjust.
1045 2008-11-15 Akim Demaille <demaille@gostai.com>
1047 Remove build-aux/Makefile.am.
1048 Recursive Makefiles are really way too slow, let's get rid of some of
1051 * build-aux/Makefile.am: Rename as...
1052 * build-aux/local.mk: this.
1054 * Makefile.am, configure.ac: Adjust.
1056 2008-11-15 Akim Demaille <demaille@gostai.com>
1058 Provide convenience constructors for locations and positions.
1059 * data/location.cc (position::position): Accept file, line and
1060 column as arguments with default values.
1061 Always qualify initial line and column literals as unsigned.
1062 (location::location): Provide convenience constructors.
1064 2008-11-15 Akim Demaille <demaille@gostai.com>
1066 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
1068 Using template buys us nothing, and makes it uselessly complex to
1069 construct a symbol. Besides, it could not be generalized to other
1070 languages, while make_FOO would work in C/Java etc.
1072 * data/lalr1.cc (b4_symbol_): New.
1073 (b4_symbol): Use it.
1074 (b4_symbol_constructor_declaration_)
1075 (b4_symbol_constructor_definition_): Instead of generating
1076 specializations of an overloaded template function, just generate
1077 several functions whose names are forged from the token names
1078 without the token.prefix.
1079 (b4_symbol_constructor_declarations): Generate them for all the
1080 symbols, not just by class of symbol type, now that instead of
1081 specializing a function template by the token, we generate a
1082 function named after the token.
1083 (b4_symbol_constructor_specialization_)
1084 (b4_symbol_constructor_specializations): Remove.
1085 * etc/bench.pl.in: Adjust to this new API.
1087 2008-11-13 Akim Demaille <demaille@gostai.com>
1089 %define token.prefix.
1090 Provide a means to add a prefix to the name of the tokens as
1091 output in the generated files. Because of name clashes, it is
1092 good to have such a prefix such as TOK_ that protects from names
1093 such as EOF, FILE etc. But it clutters the grammar itself.
1095 * data/bison.m4 (token.prefix): Empty by default.
1096 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
1097 * data/lalr1.cc (b4_symbol): Ditto.
1099 2008-11-13 Akim Demaille <demaille@gostai.com>
1101 Compute at M4 time some of the subtractions.
1102 * data/lalr1.cc (b4_subtract): New.
1103 (b4_rhs_data): Use it.
1105 2008-11-13 Akim Demaille <demaille@gostai.com>
1108 This allows the user to get the type of a token returned by yylex.
1110 * data/lalr1.cc (symbol::token): New.
1111 (yytoknum_): Define when %define lex_symbol, independently of
1113 (yytoken_number_): Move into...
1114 (symbol::token): here, since that's the only use.
1115 The other one is YYPRINT which was not officially supported
1116 by lalr1.cc, and anyway it did not work since YYPRINT uses this
1117 array under a different name (yytoknum).
1119 2008-11-13 Akim Demaille <demaille@gostai.com>
1122 * TODO (YYERRCODE): Mention the case of $undef.
1124 2008-11-13 Akim Demaille <demaille@gostai.com>
1127 * TODO (YYPRINT): New.
1129 2008-11-13 Akim Demaille <demaille@gostai.com>
1132 * data/lalr1.cc, data/yacc.c: Fix the description of the
1133 yytranslate and yytoknum tables.
1135 2008-11-13 Akim Demaille <demaille@gostai.com>
1137 Define make_symbol in the header.
1138 To reach good performances these functions should be inlined (yet
1139 this is to measure precisely). To this end they must be available
1142 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
1143 location_type with the class name.
1144 Since will now be output in the header, declare "inline".
1145 No longer use b4_symbol_constructor_specializations, but
1146 b4_symbol_constructor_definitions in the header.
1147 Don't call it in the *.cc file.
1149 2008-11-13 Akim Demaille <demaille@gostai.com>
1151 Define yytranslate in the header for lex_symbol.
1152 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
1153 into the header file when using %define lex_symbol.
1154 (yytranslate_): Declare inline.
1156 2008-11-13 Akim Demaille <demaille@gostai.com>
1158 Define the constructors of symbol_type in
1159 b4_symbol_constructor_definitions.
1160 The constructors are called by the make_symbol functions, which a
1161 forthcoming patch will move elsewhere. Hence the interest of
1162 putting them together.
1164 The stack_symbol_type does not need to be moved, it is used only
1167 * data/lalr1.cc: Move symbol_type and symbol_base_type
1168 constructors into...
1169 (b4_symbol_constructor_definitions): here.
1172 2008-11-13 Akim Demaille <demaille@gostai.com>
1174 Make it easier to move the definition of yytranslate_.
1175 Forthcoming changes will make it possible to use yytranslate_
1176 from outside the parser implementation file.
1178 * data/lalr1.cc (b4_yytranslate_definition): New.
1181 2008-11-13 Akim Demaille <demaille@gostai.com>
1183 Remove useless class specification.
1184 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
1185 to refer to the class name to use a type defined by the class for
1186 arguments of member functions.
1188 2008-11-13 Akim Demaille <demaille@gostai.com>
1190 Finer input type for yytranslate.
1191 This patch is debatable: the tradition expects yylex to return an int
1192 which happens to correspond to token_number (which is an enum). This
1193 allows for instance to return characters (such as '*' etc.). But this
1194 goes against the stronger typing I am trying to have with the new
1195 lex interface which return a symbol_type. So in this case, feed
1196 yytranslate_ with a token_type.
1198 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
1199 expect a token_type.
1201 2008-11-13 Akim Demaille <demaille@gostai.com>
1203 Honor lex-params in %define lex_symbol mode.
1204 * data/lalr1.cc: Use b4_lex_param.
1206 2008-11-13 Akim Demaille <demaille@gostai.com>
1209 * src/output.c (symbol_definitions_output): Rename symbol
1210 attributes type_name and has_type_name as type and has_type.
1211 * data/lalr1.cc: Adjust uses.
1213 2008-11-13 Akim Demaille <demaille@gostai.com>
1215 Use b4_type_names for the union type.
1216 The union used to compute the size of the variant used to iterate
1217 over the type of all the symbols, with a lot of redundancy. Now
1218 iterate over the lists of symbols having the same type-name.
1220 * data/lalr1.cc (b4_char_sizeof_): New.
1221 (b4_char_sizeof): Use it.
1222 Adjust to be called with a list of numbers instead of a single
1224 Adjust its caller for new-line issues.
1226 2008-11-13 Akim Demaille <demaille@gostai.com>
1228 Define the "identifier" of a symbol.
1229 Symbols may have several string representations, for instance if
1230 they have an alias. What I call its "id" is a string that can be
1231 used as an identifier. May not exist.
1233 Currently the symbols which have the "tag_is_id" flag set are
1234 those that don't have an alias. Look harder for the id.
1236 * src/output.c (is_identifier): Move to...
1237 * src/symtab.c (is_identifier): here.
1238 * src/symtab.h, src/symtab.c (symbol_id_get): New.
1239 * src/output.c (symbol_definitions_output): Use it to define "id"
1241 Remove the definition of "tag_is_id".
1242 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
1243 "tag_is_id" were used to produce code.
1244 We still use "tag" for documentation.
1246 2008-11-11 Akim Demaille <demaille@gostai.com>
1248 Locations are no longer required by lalr1.cc.
1249 * data/lalr1.cc (_b4_args, b4_args): New.
1250 Adjust all uses of locations to make them optional.
1251 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
1252 (AT_CHECK_NAMESPACE): Check the use of locations.
1253 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
1254 without locations with lalr1.cc.
1256 * tests/output.at: Check lalr1.cc with and without location
1258 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
1259 Don't use locations.
1261 2008-11-11 Akim Demaille <demaille@gostai.com>
1264 * tests/local.at (AT_FULL_COMPILE): New.
1265 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
1267 2008-11-11 Akim Demaille <demaille@gostai.com>
1269 Support parens in calc++.
1270 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
1271 * examples/calc++/test (run): Check the expected output.
1275 2008-11-11 Akim Demaille <demaille@gostai.com>
1277 Simplify lalr1.cc since %defines is mandatory.
1278 * data/lalr1.cc: Remove useless calls to b4_defines_if.
1280 2008-11-11 Akim Demaille <demaille@gostai.com>
1283 * TODO (yysyntax_error): New item.
1285 2008-11-11 Akim Demaille <demaille@gostai.com>
1288 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
1291 2008-11-11 Akim Demaille <demaille@gostai.com>
1293 Support i18n of the parse error messages.
1294 * TODO (lalr1.cc/I18n): Remove.
1295 * data/lalr1.cc (yysyntax_error_): Support the translation of the
1296 error messages, as done in yacc.c.
1297 Stay within the yy* pseudo namespace.
1299 2008-11-11 Akim Demaille <demaille@gostai.com>
1302 * TODO (single stack, yysyntax_error): New.
1304 2008-11-11 Akim Demaille <demaille@gostai.com>
1306 Make it possible to return a symbol_type from yylex.
1307 * data/lalr1.cc (b4_lex_symbol_if): New.
1308 (parse): When lex_symbol is defined, expected yylex to return the
1310 * etc/bench.pl.in (generate_grammar_list): Extend to support this
1312 (bench_variant_parser): Exercise it.
1314 2008-11-11 Akim Demaille <demaille@gostai.com>
1316 Remove useless bench case.
1317 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
1320 2008-11-11 Akim Demaille <demaille@gostai.com>
1322 Improve display of directives.
1323 * etc/bench.pl.in (parse_term): Don't add useless eol.
1325 2008-11-11 Akim Demaille <demaille@gostai.com>
1327 Use string_cast in the bench.
1328 * etc/bench.pl.in (generate_grammar_list): Define and use
1331 2008-11-11 Akim Demaille <demaille@gostai.com>
1333 Replace yychar with a Boolean.
1334 * data/lalr1.cc (parse::yychar): Replace by...
1335 (parse::yyempty): this.
1337 2008-11-11 Akim Demaille <demaille@gostai.com>
1342 2008-11-11 Akim Demaille <demaille@gostai.com>
1344 Let yytranslate handle the eof case.
1345 * data/lalr1.cc (yytranslate_): Handle the EOF case.
1347 No longer expect yychar to be equal to yyeof_, rather, test the
1348 lookahead's (translated) kind.
1350 2008-11-11 Akim Demaille <demaille@gostai.com>
1352 yychar cannot be empty in yyerrlab.
1353 * TODO (yychar == yyempty_): New.
1354 * data/lalr1.cc: Remove the handling of this case.
1355 This eases forthcoming changes related to yychar and yytranslate.
1357 2008-11-11 Akim Demaille <demaille@gostai.com>
1359 Bench: syntactic sugar for %define/#define.
1360 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
1361 (&bench_push_parser, bench_variant_parser): Use this feature.
1365 2008-11-11 Akim Demaille <demaille@gostai.com>
1367 Less memory pressure on the "list" bench.
1368 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
1369 the values, to limit memory pressure.
1371 2008-11-11 Akim Demaille <demaille@gostai.com>
1373 Introduce make_symbol.
1374 make_symbol provides a means to construct a full symbol (kind,
1375 value, location) in a single shot. It is meant to be a Symbol
1376 constructor, parameterized by the symbol kind so that overloading
1377 would prevent incorrect kind/value pairs. Unfortunately
1378 parameterized constructors do not work well in C++ (unless the
1379 parameter also appears as an argument, which is not acceptable),
1380 hence the use of a function instead of a constructor.
1382 * data/lalr1.cc (b4_symbol_constructor_declaration_)
1383 (b4_symbol_constructor_declarations)
1384 (b4_symbol_constructor_specialization_)
1385 (b4_symbol_constructor_specializations)
1386 (b4_symbol_constructor_definition_)
1387 (b4_symbol_constructor_definitions): New.
1388 Use them where appropriate to generate declaration, declaration of
1389 the specializations, and implementations of the templated
1390 overloaded function "make_symbol".
1391 (variant::variant): Always define a default ctor.
1392 Also provide a copy ctor.
1393 (symbol_base_type, symbol_type): New ctor overloads for value-less
1395 (symbol_type): Now public, so that functions such as yylex can use
1398 2008-11-11 Akim Demaille <demaille@gostai.com>
1400 Inform m4 whether a tag is a valid id.
1401 * src/output.c (is_identifier): New.
1402 (symbol_definitions_output): Use it to define tag_is_id.
1403 But maybe this should be done at m4 level?
1405 2008-11-11 Akim Demaille <demaille@gostai.com>
1407 Test 214 was failing: it greps with a pattern containing [ ]*
1408 which obviously meant to catch spaces and tabs, but contained only
1409 spaces. Tabulations in sources are a nuisance, so to simplify the
1410 matter, get rid of all the tabulations in the Java sources. The
1411 other skeletons will be treated equally later.
1413 * data/java.m4, data/lalr1.java: Untabify.
1414 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
1415 tabulations are no longer generated.
1417 2008-11-11 Paolo Bonzini <bonzini@gnu.org>
1419 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
1420 * configure.ac: Adjust usage.
1421 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1422 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1423 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
1425 2008-11-10 Di-an Jan <dianj@freeshell.org>
1427 Workaround Java's ``code too large'' problem for parser tables
1428 in most cases, by using one function per initialization.
1429 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
1430 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
1431 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
1432 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
1433 (yytname_): Use b4_typed_parser_table.
1434 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
1435 ``code too large'' error.
1437 2008-11-10 Di-an Jan <dianj@freeshell.org>
1439 * NEWS: Document them.
1441 General Java skeleton improvements.
1442 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
1443 using gcj < 4.3 in the testsuite, according to comments in
1444 gnulib/m4/javacomp.m4.
1445 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
1446 location_type, position_type): Remove extraneous brackets from
1447 b4_percent_define_default.
1448 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
1449 m4_define and m4_define_default.
1450 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
1451 which marks the end of user code with appropriate syncline, like all
1452 the other skeletons.
1453 (b4_user_post_prologue): Add. Don't silently drop.
1455 (parse): Inline yylex.
1456 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
1457 (%{...%}): Fix typo of %code imports.
1458 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
1460 Support annotations on parser class with %define annotations.
1461 * data/lalr1.java (annotations): Add to parser class modifier.
1462 * doc/bison.texinfo (Java Parser Interface): Document
1463 %define annotations.
1464 (Java Declarations Summary): Document %define annotations.
1465 * tests/java.at (Java parser class modifiers): Test annotations.
1467 Do not generate code for %error-verbose unless requested.
1468 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
1469 Make private. Make conditional on %error-verbose.
1470 (getErrorVerbose, setErrorVerbose): New.
1471 (yytnamerr_): Make conditional on %error-verbose.
1472 (yysyntax_error): Make some code conditional on %error-verbose.
1473 * doc/bison.texinfo (Java Bison Interface): Remove the parts
1474 about %error-verbose having no effect.
1475 (getErrorVerbose, setErrorVerbose): Document.
1477 Move constants for token names to Lexer interface.
1478 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
1479 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
1480 (parse): Qualify EOF to Lexer.EOF.
1481 * doc/bison.texinfo (Java Parser Interface): Move documentation of
1482 EOF and token names to Java Lexer Interface.
1483 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
1485 Make yyerror public.
1486 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
1487 (yyerror): Change to public. Add Javadoc comments. Use longer
1488 parameter names. Make the body rather than the declarator
1489 conditional on %locations.
1490 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
1492 Allow user to add code to the constructor with %code init.
1493 * data/java.m4 (b4_init_throws): New, for %define init_throws.
1494 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
1495 Add %code init to the front of the constructor body.
1496 * doc/bison.texinfo (YYParser.YYParser): Document %code init
1497 and %define init_throws.
1498 (Java Declarations Summary): Document %code init and
1499 %define init_throws.
1500 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
1501 (Java constructor init and init_throws): Add tests.
1503 2008-11-10 Akim Demaille <demaille@gostai.com>
1506 * TODO (-D): is implemented.
1507 (associativity): Same precedence must have the same associativity.
1508 For instance, how can a * b / c be parsed if * is %left and / is
1510 (YYERRORCODE, YYFAIL, YYBACKUP): New.
1512 2008-11-10 Akim Demaille <demaille@gostai.com>
1516 2008-11-10 Akim Demaille <demaille@gostai.com>
1518 More information about the symbols.
1519 * src/output.c (type_names_output): Document all the symbols,
1520 including those that don't have a type-name.
1521 (symbol_definitions_output): Define "is_token" and
1523 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
1524 type-name, now that they are defined too in b4_type_names.
1526 2008-11-10 Akim Demaille <demaille@gostai.com>
1530 2008-11-10 Akim Demaille <demaille@gostai.com>
1532 Make parser::yytranslate static.
1533 Small speedup (1%) on the list grammar. And makes yytranslate_
1534 available in non member functions.
1536 * data/lalr1.cc (yytranslate_): Does not need to be a instance
1539 2008-11-10 Akim Demaille <demaille@gostai.com>
1541 Avoid trailing spaces.
1542 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
1543 * data/lalr1.cc: Don't indent before rule and symbol actions, as
1544 they can be empty, and anyway this incorrectly indents the first
1547 2008-11-10 Akim Demaille <demaille@gostai.com>
1551 2008-11-10 Akim Demaille <demaille@gostai.com>
1553 Use "enum" for integral constants.
1554 This is just nicer to read, I observed no speedup.
1556 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
1557 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
1558 (yyuser_token_number_max_, yyundef_token_): Move into...
1559 (yytranslate_): here.
1561 2008-11-10 Akim Demaille <demaille@gostai.com>
1563 Shortcuts in bench directives.
1564 * etc/bench.pl.in (parse_dirs): New.
1566 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
1567 Create the benches in "benches/".
1569 2008-11-10 Akim Demaille <demaille@gostai.com>
1572 * data/lalr1.cc: here.
1574 2008-11-10 Akim Demaille <demaille@gostai.com>
1576 Adjust verbose message to using emacs.
1577 * etc/bench.pl.in: Inform compilation-mode when we change the
1579 (generate_grammar_list): Recognize %define "variant" in addition
1582 2008-11-10 Akim Demaille <demaille@gostai.com>
1584 Classify symbols by type-name.
1585 * src/uniqstr.h (UNIQSTR_CMP): New.
1586 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
1587 (type_names_output): New.
1588 (muscles_output): Use it.
1589 * data/lalr1.cc (b4_symbol_action_): Remove.
1590 (b4_symbol_case_, b4_type_action_): New.
1591 Adjust uses of b4_symbol_action_ to use b4_type_action_.
1593 2008-11-10 Akim Demaille <demaille@gostai.com>
1595 Change the handling of the symbols in the skeletons.
1596 Before we were using tables which lines were the symbols and which
1597 columns were things like number, tag, type-name etc. It is was
1598 difficult to extend: each time a column was added, all the numbers had
1599 to be updated (you asked for colon $2, not for "tag"). Also, it was
1600 hard to filter these tables when only a subset of the symbols (say the
1601 tokens, or the nterms, or the tokens that have and external number
1602 *and* a type-name) was of interest.
1604 Now instead of monolithic tables, we define one macro per cell. For
1605 instance "b4_symbol(0, tag)" is a macro name which contents is
1606 self-decriptive. The macro "b4_symbol" provides easier access to
1609 * src/output.c (type_names_output): Remove.
1610 (symbol_numbers_output, symbol_definitions_output): New.
1611 (muscles_output): Call them.
1612 (prepare_symbols): Define b4_symbols_number.
1614 2008-11-10 Akim Demaille <demaille@gostai.com>
1617 * src/getargs.h, src/getargs.c (trace_muscle): New.
1618 (trace_types, trace_args): Support it.
1619 * src/output.c (output_skeleton): Use it.
1621 2008-11-10 Akim Demaille <demaille@gostai.com>
1624 * src/output.c (muscles_output): New, extracted from...
1625 (output_skeleton): here.
1628 2008-11-10 Akim Demaille <demaille@gostai.com>
1632 2008-11-10 Akim Demaille <demaille@gostai.com>
1634 Update the variant example.
1635 * examples/variant.yy: Formatting changes.
1638 2008-11-10 Akim Demaille <demaille@gostai.com>
1640 Support constructor with an argument.
1641 This improves the "list" bench by 2%.
1643 * data/lalr1.cc (variant::build): Add an overloaded version with
1645 * tests/c++.at (AT_CHECK_VARIANT): Check it.
1647 2008-11-10 Akim Demaille <demaille@gostai.com>
1650 * tests/c++.at (AT_CHECK_VARIANTS): New.
1651 Use it with and without %define assert.
1653 2008-11-10 Akim Demaille <demaille@gostai.com>
1655 Add %precedence support.
1656 Unfortunately it is not possible to reuse the %prec directive. This
1657 is because to please POSIX, we do not require to end the rules with a
1658 semicolon. As a result,
1662 is ambiguous: either a rule which precedence is that of baz, or a rule,
1663 and then a declaration of the precedence of the token baz.
1665 * doc/bison.texinfo: Document %precedence.
1666 (Precedence Only): New.
1667 * src/assoc.h, src/assoc.c (precedence_assoc): New.
1668 * src/conflicts.c (resolve_sr_conflict): Support it.
1669 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
1671 * tests/calc.at: Use %precedence for NEG.
1672 * tests/conflicts.at (%precedence does not suffice)
1673 (%precedence suffices): New tests.
1675 2008-11-09 Akim Demaille <demaille@gostai.com>
1677 Make benches in a sub dirs.
1678 * etc/bench.pl.in ($dir): New.
1680 Check the use of constructors with an argument.
1681 (bench_variant_parser): Fix.
1683 2008-11-09 Akim Demaille <demaille@gostai.com>
1687 2008-11-09 Akim Demaille <demaille@gostai.com>
1691 2008-11-09 Akim Demaille <demaille@gostai.com>
1693 Require the generation of parse-gram.output.
1694 * src/Makefile.am (YACC): Pass --report=all.
1696 2008-11-09 Akim Demaille <demaille@gostai.com>
1700 2008-11-09 Akim Demaille <demaille@gostai.com>
1703 * TODO: Remove obsolete items.
1706 2008-11-09 Akim Demaille <demaille@gostai.com>
1709 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
1710 (@token, $grammar, $bench): New.
1711 (generate_grammar_variant): Rename as...
1712 (generate_grammar_list): this.
1713 (generate_grammar): Adjust.
1714 (bench_grammar): Rename as...
1716 Use it in the various bench-marking routines.
1717 (-b, -g): New options.
1719 2008-11-09 Akim Demaille <demaille@gostai.com>
1721 Use a static hierarchy for symbols in the C++ parser.
1722 * data/lalr1.cc (symbol_base_type, symbol_type)
1723 (stack_symbol_type): Make it a static hierarchy.
1724 Adjust dependencies.
1726 2008-11-09 Akim Demaille <demaille@gostai.com>
1728 bench.pl -d, --directive.
1729 * etc/bench.pl.in (@directive): New.
1730 (&bench_grammar): Use it.
1731 (&bench_list_grammar): New, to provide access to the "variant"
1734 (getopts): Support -d, --directive.
1736 2008-11-09 Akim Demaille <demaille@gostai.com>
1738 Use inline for small operations.
1739 * data/lalr1.cc (symbol_base_type, symbol_type)
1740 (stack_symbol_type): Declare constructor and other operations as
1742 (yy_destroy_): Inline.
1744 2008-11-09 Akim Demaille <demaille@gostai.com>
1746 Introduce a hierarchy for symbols.
1747 * data/lalr1.cc (symbol_base_type, symbol_type): New.
1748 (data_type): Rename as...
1749 (stack_symbol_type): this.
1750 Derive from symbol_base_type.
1751 (yy_symbol_value_print_): Merge into...
1752 (yy_symbol_print_): this.
1755 (yydestruct_): Rename as...
1756 (yy_destroy_): this.
1757 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
1758 (parser::parse): yyla is now of symbol_type.
1759 Use its type member instead of yytoken.
1761 2008-11-09 Akim Demaille <demaille@gostai.com>
1763 Rename data_type and stack_symbol_type.
1764 * data/lalr1.cc (data_type): Rename as...
1765 (stack_symbol_type): this.
1767 2008-11-09 Akim Demaille <demaille@gostai.com>
1769 Handle semantic value and location together.
1770 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
1771 yydata.value and yydata.location.
1772 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
1773 (YY_SYMBOL_PRINT): Now take semantic value and location as a
1776 (yydestruct_): New overload for a stack symbol.
1778 2008-11-09 Akim Demaille <demaille@gostai.com>
1780 Push a complete symbol, not connected parts.
1781 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
1782 state, value and location.
1785 2008-11-09 Akim Demaille <demaille@gostai.com>
1787 Agregate yylval and yylloc.
1788 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
1789 (parser::yyla): this.
1791 2008-11-09 Akim Demaille <demaille@gostai.com>
1793 Rely on the state stack to display reduction traces.
1794 To display rhs symbols before a reduction, we used information
1795 about the rule reduced, which required the tables yyrhs and
1796 yyprhs. Now use rely only on the state stack to get the same
1799 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
1801 (parser::yyrhs_, parser::yyprhs_): Remove.
1802 (parser::yy_reduce_print_): Use the state stack.
1804 2008-11-09 Akim Demaille <demaille@gostai.com>
1806 Fuse yyval and yyloc into yylhs.
1807 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
1809 (parse): Replace yyval and yyloc with yylhs.value and
1811 After a user action, compute yylhs.state earlier.
1812 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
1815 2008-11-09 Di-an Jan <dianj@freeshell.org>
1817 Remove unused variable.
1818 * src/output.c (type_names_output): Remove unused variable sep.
1820 2008-11-09 Paolo Bonzini <bonzini@gnu.org>
1822 Change tests/output.at quoting.
1823 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
1824 expanding arguments.
1826 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1828 Don't add a semicolon to actions for %skeleton or %language.
1829 It breaks Java test cases as reported by Akim Demaille.
1830 * src/scan-code.l: Implement.
1832 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1834 Clean up %skeleton and %language priority implementation.
1835 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
1836 remove static qualifier because others will soon need to see it.
1837 (language_prio): Likewise.
1838 (getargs): Use command_line_prio rather than 0.
1839 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
1841 (skeleton_prio): Extern it.
1842 (language_prio): Extern it.
1843 * src/parse-gram.y: Use grammar_prio rather than 1.
1845 2008-11-07 Akim Demaille <demaille@gostai.com>
1847 Moving push traces into yypush_.
1848 * data/lalr1.cc (yypush_): Now takes a optional trace message.
1851 2008-11-07 Akim Demaille <demaille@gostai.com>
1853 The single-stack C++ parser is now the standard one.
1854 * data/lalr1.cc: Rename as...
1855 * data/lalr1-split.cc: this.
1856 * data/lalr1-fusion.cc: Rename as...
1857 * data/lalr1.cc: this.
1858 * etc/bench.pl.in: Adjust.
1860 2008-11-07 Akim Demaille <demaille@gostai.com>
1862 Avoid empty-if warnings.
1863 Reported by Quentin Hocquet.
1865 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
1866 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
1868 2008-11-07 Akim Demaille <demaille@gostai.com>
1870 Pass command line location to skeleton_arg and language_argmatch.
1871 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
1872 The location argument is now mandatory.
1873 Adjust all dependencies.
1874 (getargs): Use command_line_location.
1876 2008-11-07 Akim Demaille <demaille@gostai.com>
1879 * src/getargs.c (usage): Document -D.
1880 Fix help string for --locations.
1881 (command_line_location): New.
1882 (short_options, long_options, getargs): Support -D, --define.
1883 (getargs): Move -d support at the right place.
1884 * doc/bison.texinfo (Bison Options): Update.
1885 * tests/input.at (%define, --define): New.
1887 2008-11-07 Akim Demaille <demaille@gostai.com>
1889 Initialize the muscle table before parsing the command line.
1890 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
1891 (getargs): Define file_name.
1892 * src/main.c (main): Initialize muscle_tab before calling
1894 * src/muscle_tab.c (muscle_init): No longer define file_name, as
1895 its value is not available yet.
1897 2008-11-07 Akim Demaille <demaille@gostai.com>
1899 Locations without columns for command line arguments.
1900 * src/location.c (location_print): Don't display negative columns.
1901 * src/location.h: Document this.
1903 2008-11-07 Akim Demaille <demaille@gostai.com>
1906 * src/getargs.c (usage): Fix help string for -W.
1908 2008-11-07 Akim Demaille <demaille@gostai.com>
1910 Handle more general types of option arguments.
1911 * build-aux/cross-options.pl: The argument ends at the first
1912 space, not the first non-symbol character.
1913 Use @var for each word appearing the argument description.
1915 2008-11-07 Akim Demaille <demaille@gostai.com>
1917 Destroy the variants that remain on the stack in case of error.
1918 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
1920 Display the value only if yymsg is nonnull.
1921 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
1923 2008-11-07 Akim Demaille <demaille@gostai.com>
1925 Add "%define assert" to variants.
1926 This is used to help the user catch cases where some value gets
1927 ovewritten by a new one. This should not happen, as this will
1930 Unfortunately this uncovered a bug in the C++ parser itself: the
1931 lookahead value was not destroyed between two calls to yylex. For
1932 instance if the previous lookahead was a std::string, and then an int,
1933 then the value of the std::string was correctly taken (i.e., the
1934 lookahead was now an empty string), but std::string structure itself
1937 This is now done in variant::build(other&) (which is used to take the
1938 value of the lookahead): other is not only stolen from its value, it
1939 is also destroyed. This incurs a new performance penalty of a few
1940 percent, and union becomes faster again.
1942 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
1943 (b4_variant_if): New.
1944 (variant::built): New.
1945 Use it whereever the status of the variant changes.
1946 * etc/bench.pl.in: Check the penalty of %define assert.
1948 2008-11-07 Akim Demaille <demaille@gostai.com>
1950 Use "%define variant" in bench.pl.
1951 * etc/bench.pl.in: No longer use the pseudo directive %variants,
1952 just use %define variants.
1954 2008-11-07 Akim Demaille <demaille@gostai.com>
1957 * src/parse-gram.h, src/parse-gram.c: Regen.
1959 2008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
1961 Fix user actions without a trailing semicolon.
1962 Reported by Sergei Steshenko at
1963 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
1964 * THANKS (Sergei Steshenko): Add.
1965 * src/scan-code.l (SC_RULE_ACTION): Fix it.
1966 * tests/regression.at (Fix user actions without a trailing semicolon):
1969 2008-11-04 Akim Demaille <demaille@gostai.com>
1971 Use b4_copyright_years.
1972 * data/yacc.c (b4_copyright_years): New.
1973 Fix its value according to the comments in the file.
1974 Use it and undefine it.
1976 2008-11-04 Akim Demaille <demaille@gostai.com>
1979 * data/lalr1-fusion.cc, src/parse-gram.y: here.
1981 2008-11-04 Akim Demaille <demaille@gostai.com>
1984 * data/lalr1-fusion.cc: here.
1986 2008-11-04 Akim Demaille <demaille@gostai.com>
1988 Use strict on bench.pl.
1989 * etc/bench.pl.in (&run, &generate_grammar): New.
1990 Rename the grammar generating functions for consistency.
1991 Change the interface so that the list of benches to run is passed
1992 as (optionless) arguments.
1993 (&compile): Use &run.
1995 2008-11-04 Akim Demaille <demaille@gostai.com>
1997 Remove spurious initial empty lines.
1998 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1999 * data/yacc.c: End the @output lines with an @.
2001 2008-11-04 Akim Demaille <demaille@gostai.com>
2003 Improve the display of sizes.
2004 * etc/bench.p.in: Higher precision.
2005 Sort by decreasing size.
2007 2008-11-04 Akim Demaille <demaille@gostai.com>
2009 Don't memcpy C++ structures.
2010 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
2012 (variant::build): New overload for
2013 copy-construction-that-destroys.
2014 (variant::swap): New.
2015 (parser::yypush_): Use it in variant mode.
2017 2008-11-04 Akim Demaille <demaille@gostai.com>
2019 Better defaults for bench.pl.
2020 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
2022 Adjust &verbose uses.
2025 2008-11-04 Akim Demaille <demaille@gostai.com>
2027 Make variant.yy more complex.
2028 std::list cannot be copied via memcpy, they are more demanding than
2029 std::string. Use one std::list to strengthen the test.
2031 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
2033 Create a list of strings, instead of a single large string.
2035 2008-11-04 Akim Demaille <demaille@gostai.com>
2038 * etc/bench.pl.in (--bench, $bench): New.
2040 2008-11-04 Akim Demaille <demaille@gostai.com>
2043 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
2044 Define it after as().
2046 2008-11-04 Akim Demaille <demaille@gostai.com>
2049 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
2051 2008-11-04 Akim Demaille <demaille@gostai.com>
2053 Issue missing synclines after user actions.
2054 * data/c.m4 (b4_case): Issue synclines on the output file.
2056 2008-11-04 Akim Demaille <demaille@gostai.com>
2058 Remove trailing empty line.
2059 * data/lalr1-fusion.cc: Don't add an empty line after the user's
2062 2008-11-04 Akim Demaille <demaille@gostai.com>
2064 Fix output of copyright years.
2065 * data/bison.m4 (b4_copyright): Fix the indentation of the
2066 copyright year paragraph.
2067 Use b4_copyright_years when no years are given.
2068 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
2069 (b4_copyright_years): New.
2072 2008-11-04 Akim Demaille <demaille@gostai.com>
2074 Avoid the spurious initial empty line.
2075 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
2076 the end of @output request to suppress the empty line that
2079 2008-11-04 Akim Demaille <demaille@gostai.com>
2081 Remove parser::rhs_number_type.
2082 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
2083 (yyrhs_): Use b4_table_define.
2085 2008-11-04 Akim Demaille <demaille@gostai.com>
2088 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
2090 2008-11-04 Akim Demaille <demaille@gostai.com>
2092 Factor the declaration of the integer tables.
2093 * data/lalr1-fusion.cc (b4_table_define): New.
2096 2008-11-03 Akim Demaille <demaille@gostai.com>
2098 Fix indentation of tables in lalr1.cc
2099 * data/lalr1-fusion.cc: Fix the indentation.
2101 2008-11-03 Akim Demaille <demaille@gostai.com>
2103 Destroy the lhs symbols after reduction.
2104 * data/lalr1-fusion.cc (parse): After the user action, when in
2105 variant mode, destroy the lhs symbols.
2107 2008-11-03 Akim Demaille <demaille@gostai.com>
2109 Simplify yysyntax_error_ use.
2110 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
2111 type, but make it unnamed in the declaration when it is not used.
2113 2008-11-03 Akim Demaille <demaille@gostai.com>
2115 Let yy::variant::build return an lvalue.
2116 * data/lalr1-fusion.cc (variant::build): Return a reference to the
2119 2008-11-03 Akim Demaille <demaille@gostai.com>
2121 Define yy::variant only when needed.
2122 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
2125 2008-11-03 Akim Demaille <demaille@gostai.com>
2127 Bench the three-stack lalr1.cc.
2128 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
2131 2008-11-03 Akim Demaille <demaille@gostai.com>
2133 Fail on parse error in calc++.
2134 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
2136 * examples/calc++/test ($me, $number, $exit, run): New.
2137 Use them to propagate errors to the exit status.
2139 2008-11-03 Akim Demaille <demaille@gostai.com>
2141 Don't specify the skeleton twice in the example.
2142 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
2143 file does what is needed.
2145 2008-11-03 Akim Demaille <demaille@gostai.com>
2147 bench: Improve output.
2148 * etc/bench.pl.in (bench_grammar): Tune the printf format.
2150 2008-11-03 Akim Demaille <demaille@gostai.com>
2152 bench: check impact of %debug on variants.
2153 * etc/bench.pl.in (variant_grammar): Fix the computation of
2155 Generate a grammar file that can work with or without %debug.
2156 Do use the @directive.
2157 (bench_variant_parser): Check impact of %debug.
2158 (@directives): Rename all the occurrences to...
2159 (@directive): this, for consistency.
2161 2008-11-03 Akim Demaille <demaille@gostai.com>
2163 bench: report the size too.
2164 * etc/bench.pl.in ($iterations): Defaults to -3.
2165 (&bench_grammar): Require hireswallclock.
2166 Compute and display the size of the result.
2169 2008-11-03 Akim Demaille <demaille@gostai.com>
2171 bench: More use of the verbosity level.
2172 * etc/bench.pl.in ($verbose, &verbose): New.
2174 More POD documentation.
2176 2008-11-03 Akim Demaille <demaille@gostai.com>
2178 bench.pl: a command line interface
2179 * etc/bench.pl.in: More doc.
2180 Some fixes in the documentation.
2181 ($cflags, $iterations, &help, &getopt): New.
2183 (&variant_grammar): Let the number of stages be 10 times what is
2186 2008-11-03 Akim Demaille <demaille@gostai.com>
2188 Bench the use of Boost.Variants.
2189 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
2191 (&compile): Be ready to compile C++ parsers.
2192 (&bench_push_parser): Move debug information to the outermost
2194 * THANKS: Add Michiel De Wilde.
2196 2008-11-03 Akim Demaille <demaille@gostai.com>
2198 bench.pl: Pass directives as a list instead of as a string.
2199 * etc/bench.pl.in (&directives): New.
2200 (&triangular_grammar, &calc_grammar): Use it to format the Bison
2202 (&triangular_grammar): Do use the directives (were ignored).
2203 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
2206 2008-11-03 Akim Demaille <demaille@gostai.com>
2208 Improve genericity of bench.pl.
2209 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
2211 (&bench_push_parser): New.
2214 2008-11-03 Akim Demaille <demaille@gostai.com>
2216 Add documentation to bench.pl.
2217 * etc/bench.pl.in: Comment changes.
2219 2008-11-03 Akim Demaille <demaille@gostai.com>
2221 Fuse the three stacks into a single one.
2223 In order to make it easy to perform benchmarks to ensure that
2224 there are no performance loss, lalr1.cc is forked into
2225 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
2228 Meanwhile, to make sure that lalr1-fusion.cc is correctly
2229 exercized by the test suite, the user must install a symbolic link
2230 from lalr1.cc to it.
2232 Instead of having three stacks (state, value, location), use a
2233 stack of triples. This considerably simplifies the code (and it
2234 will be easier not to require locations as currently does the C++
2235 parser), and also gives a 10% speedup according to
2236 etc/bench (probably mainly since memory allocation is done once
2237 instead of three times).
2239 Another motivation is to make it easier to destruct properly
2240 semantic values: now that they are bound to their state (hence
2241 symbol type) it will be easier to call the appropriate destructor.
2243 These changes should probably benefit the C parser too.
2245 * data/lalr1.cc: Copy as...
2246 * data/lalr1-fusion.cc: this new file.
2247 (b4_rhs_value, b4_rhs_location): New definitions overriding those
2249 (state_stack_type, semantic_stack_type, location_stack_type)
2250 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
2251 (data_type, stack_type, yystack_): New.
2252 (YYLLOC_DEFAULT, yypush_): Adjust.
2253 (yyerror_range): Now based on data_type, not location_type.
2255 2008-11-03 Akim Demaille <demaille@gostai.com>
2257 Push the state, value, and location at the same time.
2258 This is needed to prepare a forthcoming patch that fuses the three
2261 * data/lalr1.cc (parser::yypush_): New.
2262 (parser::yynewstate): Change the semantics: instead of arriving to
2263 this label when value and location have been pushed, but yystate
2264 is to be pushed on the state stack, now the three of them must
2265 have been pushed before. yystate still must be the new state.
2266 This allows to use yypush_ everywhere instead of individual
2267 handling of the stacks.
2269 2008-11-03 Akim Demaille <demaille@gostai.com>
2271 Prefer references to pointers.
2272 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
2273 definition to use references instead of pointers.
2274 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
2275 Take the value and location as references.
2278 2008-11-03 Akim Demaille <demaille@gostai.com>
2280 stack::size instead of stack::height.
2281 * data/lalr1.cc (stack::height): Rename as...
2282 (stack::size): this.
2283 Fix the output type.
2286 2008-11-03 Akim Demaille <demaille@gostai.com>
2288 Use variants to support objects as semantic values.
2289 This patch was inspired by work by Michiel De Wilde. But he used
2290 Boost variants which (i) requires Boost on the user side, (ii) is
2291 slow, and (iii) has useless overhead (the parser knows the type of
2292 the semantic value there is no reason to duplicate this
2293 information as Boost.Variants do).
2295 This implementation reserves a buffer large enough to store the
2296 largest objects. yy::variant implements this buffer. It was
2297 implemented with Quentin Hocquet.
2299 * src/output.c (type_names_output): New.
2300 (output_skeleton): Invoke it.
2301 * data/c++.m4 (b4_variant_if): New.
2302 (b4_symbol_value): If needed, provide a definition for variants.
2303 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
2304 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
2305 (b4_char_sizeof, yy::variant): New.
2306 (parser::parse): If variants are requested, define
2307 parser::union_type, parser::variant, change the definition of
2308 semantic_type, construct $$ before running the user action instead
2309 of performing a default $$ = $1.
2310 * examples/variant.yy: New.
2311 Based on an example by Michiel De Wilde.
2313 2008-11-03 Akim Demaille <demaille@gostai.com>
2315 Parameterize the extraction of semantic values.
2316 To make future changes easier, no longer rely on ".TYPE" being the
2317 way to get a semantic value.
2319 * data/c.m4 (b4_symbol_value): New.
2321 * data/c++.m4, data/yacc.c: Use it.
2322 * data/glr.c: Use b4_symbol_value.
2326 2008-11-03 Akim Demaille <demaille@gostai.com>
2328 Prepare easier M4 changes.
2329 * data/lalr1.cc: Use escaped [] instead of literals to prepare
2332 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2334 Initiate further development.
2335 * NEWS: Create an empty section for new entries.
2336 * gnulib: Update submodule to HEAD.
2338 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2340 * NEWS: Version 2.4.
2342 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2344 Prepare for next release.
2345 * NEWS: Briefly mention changes since 2.3b.
2346 * README: Say GNU m4 1.4.6, which we've been requiring in release
2347 announcements already, not 1.4.3, which breaks the build.
2349 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2351 Say %language is experimental.
2352 We're thinking of extending it's effect on output file naming. See the
2354 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
2355 * NEWS: Say it's experimental.
2356 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
2357 recommend it over %skeleton for now.
2358 (Bison Options): Likewise.
2359 (C++ Bison Interface): Use %skeleton not %language.
2360 (Calc++ Parser): Use %skeleton not %language.
2361 * src/getargs.c (usage): Say it's experimental.
2363 2008-11-01 Di-an Jan <dianj@freeshell.org>
2364 Paolo Bonzini <bonzini@gnu.org>
2366 Support all Java parser class modifiers.
2367 * data/java.m4 (b4_percent_define_get3): New.
2368 (b4_final_if, b4_strictfp_if): New.
2369 * data/lalr1.java (final, strictfp, extends, implements): Support.
2370 * doc/bison.texinfo (final, strictfp, extends, implements): Add
2372 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
2373 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
2374 (AT_CHECK_JAVA_GREP): New.
2375 (Java parser class modifiers): New test.
2376 (Java parser class extends and implements): New test.
2378 Model exception propagation better with throws and lex_throws.
2379 * data/java.m4 (b4_list2): New.
2380 (throws): Change default.
2381 * data/lalr1.java (yyaction): Add throws.
2382 (parse): Add lex_throws in addition to throws.
2383 * doc/bison.texinfo (throws, lex_throws): Add documentation.
2384 * tests/java.at (Java throws specifications): New test.
2386 Improve documentation for Java parsers.
2387 * doc/bison.texinfo (Java Parsers): Add subsections.
2388 Don't quote first argument of %define.
2389 (Java Bison Interface): Document output files. Move documentation
2390 of parser class and merge into Java Parser Interface. Document
2391 features that error out. Document directives with no effect.
2392 Move note about Javadoc higher.
2393 (Java Semantic Values): Explicitly mention stype.
2394 Document that generic types cannot be used.
2395 (Java Location Values): Use @deftypeivar. Document constructors.
2396 Correct return value for toString.
2397 (Java Parser Interface): List undocumented constants/fields.
2398 Move documentation of fields added by %parse-param closer to list
2399 of members. Document that token names are added as fields.
2400 Document constructors accurately. Remove error method.
2401 (Java Scanner Interface): Move note on %pure-parser to Java Bison
2402 Interface. Describe %code lexer and yylex accutately.
2403 Remove documentation that does not match the code.
2404 (Java Action Features): New.
2405 (Java Differences): Add reference. Add item on semantic values.
2406 Add note about @{ ... @}. Clarify %% epilogue placement.
2407 (Java Declarations Summary): New.
2410 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
2411 (b4_remove_comma): Quote test argument.
2412 (b4_identification): Remove "bison" field.
2413 * tests/java.at (Java parser class and package names): New test.
2414 (Java %parse-param and %lex-param): New test.
2415 (Java stype, position_class and location_class): New test.
2417 2008-10-31 Di-an Jan <dianj@freeshell.org>
2419 * data/lalr1.jave: Update copyright years.
2420 (YYParser): Correct name of "generated from" file in Javadoc:
2421 use b4_file_name instead of @ofile@.
2422 (Location constructor): Correct Javadoc parameter name.
2423 (yylloc): Add missing opening m4 quote after b4_location_if.
2424 This removes a stray [ in the Javadoc of Lexer.getStartPos.
2425 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
2426 (YYParser constructor): Correct Javadoc parameter name.
2428 2008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
2430 Always put auxiliary code files in the same dir as other output files.
2431 * src/files.c (compute_file_name_parts): When the user specifies
2432 --output but not --file-prefix, extract the directory prefix from the
2433 file prefix not from the grammar file name. This affects the location
2434 of files like location.hh generated by the C++ skeleton. The includes
2435 in the other output files require this fix.
2436 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
2437 for expected output files.
2438 (Output files): Add a test for the above.
2440 2008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
2442 * gnulib: Update submodule to HEAD.
2444 2008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2446 Update copyright year.
2447 * src/files.c: Here.
2449 2008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
2451 Don't overwrite the input file.
2452 * src/files.c (output_file_name_check): Fatal error if using input file
2454 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
2456 (Conflicting output files): Add test.
2458 2008-10-28 Akim Demaille <demaille@gostai.com>
2461 * data/lalr1.cc: Formatting changes.
2463 2008-10-28 Akim Demaille <demaille@gostai.com>
2465 Don't define debugging functions when !YYDEBUG.
2466 * data/lalr1.cc (debug_stream, set_debug_stream)
2467 (debug_level_type, debug_level, set_debug_level): Don't
2468 declare them when YYDEBUG is not defined.
2469 The implementation are already YYDEBUG-aware.
2471 2008-10-28 Akim Demaille <demaille@gostai.com>
2473 Prefer "continue" for empty loop bodies.
2474 * etc/bench.pl.in: Use "continue" instead of {}.
2476 2008-10-28 Akim Demaille <demaille@gostai.com>
2478 Space and comments changes.
2479 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
2480 * data/c.m4, data/lalr1.cc: Space changes.
2482 2008-10-28 Akim Demaille <demaille@gostai.com>
2484 Make gnulib a submodule.
2486 * .gitmodules (gnulib): New.
2488 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
2490 Fix yyerror_range for user-defined location type in C++. Reported by
2492 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
2493 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
2494 * THANKS (Georg Sauthoff): Add.
2496 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
2498 Update several administrative files mainly to facilitate releasing.
2499 * HACKING (Administrivia): Make the git-merge-changelog notes more
2501 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
2502 (Release Procedure): Update for git and add numerous details that were
2504 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
2505 * maint.mk (announcement): Don't list bison as a bootstrap tool so
2506 that announcements don't claim we bootstrapped with whatever bison
2507 happened to be in PATH. Add flex as a bootstrap tool.
2508 * Makefile.maint: Remove, previously replaced by maint.mk.
2509 * Makefile.cfg: Remove, and migrate settings to...
2510 * cfg.mk: ... here for the sake of `make announcement'.
2511 * bootstrap.conf (gnulib_modules): Add announce-gen.
2512 * README: Say GNU Bison instead of just Bison. Suggested by Karl
2515 2008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
2517 Small but important bugfixes for the Java skeleton.
2518 * data/lalr1.java (yyerror): Change Location to b4_location_type.
2519 (yy_symbol_print): Call toString on yyvaluep.
2521 2008-08-29 Akim Demaille <demaille@gostai.com>
2523 Clarify UPDATED use.
2524 * doc/bison.texinfo: It refers to the last edition of this file,
2525 not to the release date of Bison.
2526 Reported by Joel E. Denny.
2528 2008-08-29 Akim Demaille <demaille@gostai.com>
2530 * README: Update FAQ pointer.
2531 Reported by Joel E. Denny.
2533 2008-08-27 Eric Blake <ebb9@byu.net>
2535 Resync m4sugar from autoconf.
2536 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
2537 (m4_init): Adjust to latest m4.git changes.
2538 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
2540 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
2541 (_m4_list_cmp): Reduce side effects.
2543 2008-08-27 Akim Demaille <demaille@gostai.com>
2545 Check yyerrok in calc.at.
2546 * tests/calc.at (calc.y): Use yyerrok on "( error )".
2547 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
2550 2008-08-27 Akim Demaille <demaille@gostai.com>
2552 Support yyerrok in lalr1.cc.
2553 YYBACKUP is still to import back into lalr1.cc.
2554 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
2556 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
2558 For maintainer-check*, don't recompile for a $(VERSION) update.
2560 (_is-dist-target): Override the one in GNUmakefile.
2561 * Makefile.am (EXTRA_DIST): Add cfg.mk.
2563 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
2565 Update for recent change to gnulib.
2566 * src/parse-gram.y: Don't include strverscmp.h. It comes from
2569 2008-08-15 Eric Blake <ebb9@byu.net>
2571 Remaining m4sugar merge from autoconf.
2572 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
2573 * data/m4sugar/foreach.m4: New file, copied from autoconf.
2574 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
2575 * src/output.c (output_skeleton): Tell m4 how to find it.
2577 Partial m4sugar merge from autoconf: m4_map.
2578 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
2579 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
2580 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
2581 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
2583 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
2585 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
2588 2008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
2590 Keep .version and PACKAGE_VERSION in sync.
2591 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
2592 dependency, and add comments justifying this in more detail. Discussed
2594 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
2596 2008-08-06 Eric Blake <ebb9@byu.net>
2598 Partial m4sugar merge from autoconf: m4_shiftn.
2599 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
2600 (m4_shift2, m4_shift3): New macros.
2601 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
2602 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
2603 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
2604 * data/java.m4 (b4_remove_comma): Likewise.
2606 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
2607 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
2608 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
2609 (m4_init): Consolidate wrapped text into single m4_wrap.
2610 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
2613 2008-08-05 Eric Blake <ebb9@byu.net>
2615 Partial m4sugar merge from autoconf: builtins, version.m4.
2616 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
2617 (m4_prepend): Remove, as it is unused and inherently quadratic,
2618 whereas m4_append is linear in newer m4.
2619 (m4_mkstemp): New builtin.
2620 (m4_symbols): Make rename conditional.
2621 (m4_version_prereq): Ensure fatal error if used in bison, which
2622 intentionally lacks version.m4.
2624 Fix comments in m4sugar.
2625 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
2627 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
2629 Update for recent .gitignore fix in Gnulib.
2630 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
2631 anchored .gitignore entries.
2633 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
2635 Set gnu or gnits strictness.
2636 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
2637 development and gnits strictness for releases. Based on Eric Blake's
2639 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
2641 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
2643 * NEWS: Clarify documentation of %language.
2645 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
2647 Support usage of git-merge-changelog.
2648 * .gitattributes: New.
2649 * HACKING: Document usage of git-merge-changelog.
2650 * bootstrap: Install git-merge-changelog entries in .git/config
2653 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2655 Remove remaining dependence on CVS Id keyword.
2656 * ChangeLog: For the sake of people still using CVS, don't use dollars
2658 * data/xslt/bison.xsl: Remove Id from header comments, where it was
2660 * data/xslt/xml2dot.xsl: Likewise.
2661 * data/xslt/xml2text.xsl: Likewise.
2662 * data/xslt/xml2xhtml.xsl: Likewise.
2663 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
2664 * doc/Makefile.am (neutralize): Remove, no longer needed.
2665 (.x.1): Don't use neutralize.
2666 (edit): Don't substitute for ID.
2667 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
2669 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2671 Fix dependence on computed configure variables.
2672 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
2673 $(top_srcdir)/configure.ac so that changes to computed variables, such
2674 as PACKAGE_VERSION, are seen.
2675 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
2677 2008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
2679 Update copyright dates for recent changes.
2680 * Makefile.am: Here.
2681 * src/Makefile.am: Here.
2682 * src/reduce.c: Here.
2683 * tests/reduce.at: Here.
2685 2008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
2687 Use git-version-gen for version names between releases.
2688 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
2689 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
2690 * .prev-version: New.
2691 * .version.in: Remove.
2692 * ChangeLog: Remove the Id previously used for capturing the CVS
2694 * GNUmakefile: Remove, now copied from Gnulib.
2695 * Makefile.am: Add code suggested by comments in
2696 build-aux/git-version-gen.
2697 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
2698 .prev-version, and .version.
2699 * NEWS (2.3b+): Rename to...
2700 (?.?): ... this because we're dropping the "+" version naming scheme,
2701 but, in general, we still can't be sure of our next release name.
2702 * bootstrap: Add a quick hack to remove from .gitignore the
2703 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
2704 entry. This should really be fixed in gnulib instead.
2705 * bootstrap.conf (gnulib_modules): Add gnumakefile.
2706 * configure.ac (AC_INIT): Set version name by invoking
2707 build-aux/git-version-gen.
2708 (AC_CONFIG_FILES): Remove .version, now generated by
2709 build-aux/git-version-gen.
2710 * maint.mk: New, copied from coreutils.
2711 * doc/.cvsignore (bison.1): Add.
2712 * doc/.gitignore (/bison.1): Add.
2713 * doc/bison.1: Remove, generated.
2714 * src/.cvsignore (revision.c): Remove.
2715 * src/.gitignore (/revision.c): Remove.
2716 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
2717 (BUILT_SOURCES): Remove revision.c.
2718 (revision.c): Remove.
2719 * src/getargs.c (version): Don't print revision after the VERSION.
2720 * src/revision.h: Remove.
2722 2008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
2724 Fix untranslatable composition of sentences. Reported by Goran
2726 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
2727 * THANKS (Goran Uddeborg): Add.
2728 * src/reduce.c (reduce_print): Report the number of nonterminals and
2729 rules useless in the grammar in separate sentences.
2730 * tests/reduce.at (Useless Rules): Update output.
2731 (Reduced Automaton): Likewise.
2732 (Underivable Rules): Likewise.
2733 (Empty Language): Likewise.
2735 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2737 Fix some .gitignore and .cvsignore problems.
2738 * bootstrap (insert_sorted_if_absent): Replace all uses with...
2739 (insert_vc_ignore): ... this new function, which prepends `/' to all
2740 .gitignore entries before passing them to insert_sorted_if_absent.
2741 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
2742 .cvsignore files are maintained even though Bison developers run
2743 bootstrap while using Git.
2744 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
2747 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
2748 unneeded. Reported by Eric Blake.
2749 * lib/.gitignore (/*~): Add.
2750 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
2751 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
2753 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
2755 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2757 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
2758 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
2759 * bootstrap.conf (gnulib_modules): Add unsetenv.
2760 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
2761 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
2763 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
2764 the first argument because it may become position-dependent, and unset
2765 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
2766 Add comments explaining these issues in more detail.
2768 2008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
2770 Add .gitignore everywhere based on .cvsignore.
2772 * build-aux/.gitignore: New.
2773 * data/.gitignore: New.
2774 * doc/.gitignore: New.
2775 * etc/.gitignore: New.
2776 * examples/.gitignore: New.
2777 * examples/calc++/.gitignore: New.
2778 * lib/.gitignore: New.
2779 * m4/.gitignore: New.
2780 * po/.gitignore: New.
2781 * runtime-po/.gitignore: New.
2782 * src/.gitignore: New.
2783 * tests/.gitignore: New.
2785 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2787 * NEWS (2.3b+): New section, empty for now.
2788 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
2790 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2792 * NEWS (2.3b): Update release date since there has been a delay in
2793 getting the announcements and tarballs out.
2795 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
2797 * NEWS: Version 2.3b.
2798 * configure.ac (AC_INIT): Likewise.
2799 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
2801 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
2803 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
2804 been doing it for years.
2805 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
2806 (Release Procedure): Add FIXME about make alpha being unmaintained.
2808 2008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
2810 * data/yacc.c: Reformat m4 a little for readability.
2811 * src/lalr.c (build_relations): Correct comment.
2813 2008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2815 DJGPP specific issue.
2816 * djgpp/config.sed: Fixes required to run configure scripts generated
2819 2008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
2821 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
2822 coordinator@translationproject.org.
2824 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2826 * THANKS: Add Eric Blake.
2828 2008-04-23 Eric Blake <ebb9@byu.net>
2830 Revert prior patch, by working around autoconf regression.
2831 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
2832 ("Output file name: ("): Uncomment test.
2833 ("Output file name: )"): Likewise.
2834 Based on an idea from Noah Misch.
2836 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2838 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
2839 2.61. Reported by Juan Manuel Guerrero at
2840 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
2841 * tests/output.at ("Output file name: ("): Comment out test case for
2843 ("Output file name: )"): Likewise.
2845 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2847 * GNUmakefile: Update git-version-gen invocation so make dist
2850 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2852 Update to the current gnulib CVS repository, and fix trigraph handling
2854 * bootstrap: Update gnulib CVS repository URL.
2855 (symlink_to_dir): Encapsulate the code that guarantees the destination
2856 directory exists into...
2857 (check_dst_dir): ... this new function, and...
2858 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
2859 fail when copying files into lib/uniwidth/.
2860 * src/output.c (prepare_symbols): When writing yytname muscles, where
2861 symbol names will be encoded in C-string literals, tell quotearg to
2862 escape trigraphs. This used to be the default in gnulib.
2863 * tests/regression.at (Token definitions): Because of the change in
2864 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
2865 escapes trigraphs in symbol names. Thus, yytname no longer has
2866 trigraphs unnecessarily doubly escaped. Update test case output.
2867 Extend test case to be sure Bison's own error messages will no longer
2868 have trigraphs in symbol names unnecessarily escaped once.
2870 2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2872 Fix make dist infinite loop reported by Juan Manuel Guerrero at
2873 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
2874 * .cvsignore: Add .version.
2876 * bootstrap.conf (gnulib_modules): Add git-version-gen.
2877 * configure.ac (AC_CONFIG_FILES): Add .version.
2878 * build-aux/.cvsignore: Add git-version-gen.
2880 2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2882 * NEWS (2.3a+): Mention that -g now takes an argument.
2883 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
2884 consistency. Update the -g and -x entries now that they take
2885 arguments. Use brackets to indicate optional arguments.
2886 * src/getargs.c (usage): Explain the relationship between arguments of
2887 long and short options more completely. Document --defines and -d
2888 separately since the former takes an argument but, for POSIX Yacc, the
2890 (short_options): Let -W take an optional argument like --warnings.
2891 (getargs): Sort cases.
2893 2008-02-28 Akim Demaille <demaille@gostai.com>
2895 * doc/bison.texinfo: Fix a few typos.
2897 2008-02-28 Akim Demaille <akim@epita.fr>
2899 * doc/bison.texinfo (Bison Options): Document -W.
2900 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
2902 2008-02-28 Akim Demaille <akim@epita.fr>
2904 * src/getargs.c (short_options): Split and sort for readability.
2905 -g and -x take optional arguments, just like their long options.
2906 * build-aux/cross-options.pl: Use /x to make the regexp easier to
2908 Fix the handling of $opt which resulted in all the argument to be
2909 considered as optional.
2911 2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
2913 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
2914 say its interface is experimental.
2915 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
2917 (Bison Options): In the -L and --language entry, mention Java.
2918 (Java Bison Interface): Say the interface is experimental.
2919 * src/getargs.c (usage): Mention -L and --language.
2921 * NEWS (2.3a+): Say the push parsing interface is experimental.
2922 * doc/bison.texinfo (Push Decl): Likewise.
2923 (Decl Summary): Likewise in the "%define api.push_pull" entry.
2924 (Push Parser Function): Likewise.
2925 (Pull Parser Function): Likewise.
2926 (Parser Create Function): Likewise.
2927 (Parser Delete Function): Likewise.
2928 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
2929 yypull_parse, and yypush_parse entries.
2931 * NEWS (2.3a+): Mention XML support, and say the schema is
2933 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
2934 * src/getargs.c (usage): Say the XML schema is experimental.
2936 * NEWS (2.3a+): Say option instead of flag.
2938 2008-02-21 Wojciech Polak <polak@gnu.org>
2940 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
2943 2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
2945 Fix impure push parser compile error reported by Bob Rossi at
2946 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
2947 * data/yacc.c: Clean up whitespace in the output a little.
2948 (yypstate_allocated): Define for impure push parsers regardless of
2949 whether the pull interface is also requested.
2950 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
2951 check impure push parsers without the pull interface.
2953 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
2954 yyerror takes arguments specified by %parse-param while yypstate_new
2956 * doc/bison.texinfo (Parser Create Function): Document that
2957 yypstate_new returns 0 for multiple impure parser instances.
2958 * tests/push.at (Push Parsing: Multiple impure instances): Update
2959 expected stderr output.
2961 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
2963 * runtime-po/POTFILES.in (push.c): Remove.
2965 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
2967 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
2968 * data/push.c: Rename to...
2969 * data/yacc.c: ... this, overwriting it.
2970 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
2971 `%push-pull-parser' -> `%define api.push_pull "both"'.
2972 Remove old yacc.c tests, and update push.c tests to yacc.c.
2974 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
2976 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
2977 `"%code top" blocks' instead of `%code "top" blocks'.
2978 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
2979 Clean up whitespace in the output a little.
2981 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
2983 Fix documentation problems reported by Tim Josling at
2984 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
2985 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
2986 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
2987 integers. Explain the effect of literal string aliases on error
2988 messages. Copy token 0 documentation from the C++ skeleton
2991 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
2993 Accept a token number in a %left, %right, or %nonassoc for POSIX
2994 conformance. Reported by Tim Josling at
2995 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
2996 * NEWS (2.3a+): Mention.
2997 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
2998 and code numbers are treated by precedence declarations.
2999 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
3001 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
3003 (symbol.prec): New, just like symbol but allows INT.
3004 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
3006 * tests/regression.at (Token number in precedence declaration): New
3009 2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3011 DJGPP specific issues.
3012 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
3013 be changed. Copyright timestamp adjusted.
3014 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
3015 be changed. Copyright timestamp adjusted.
3016 * djgpp/config.site: Copyright timestamp adjusted.
3017 * djgpp/config_h.sed: Copyright timestamp adjusted.
3018 * djgpp/djunpack.bat: Copyright timestamp adjusted.
3019 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
3020 filename translation list.
3021 * djgpp/subpipe.c (init_subpipe): Check the environment variables
3022 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
3023 files shall be created. Before trying to use the temp dir where the
3024 environment variable points to check that the dir really exists. If
3025 not default to the cwd as temp dir. Copyright timestamp adjusted.
3026 * djgpp/subpipe.h: Copyright timestamp adjusted.
3027 * djgpp/testsuite.sed: Copyright timestamp adjusted.
3029 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
3031 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
3033 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
3035 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
3036 Problem reported by Claudio Saavedra in
3037 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
3039 2008-01-05 Wojciech Polak <polak@gnu.org>
3041 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
3042 document's title with the input grammar file name.
3044 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
3046 Automate regression testing of the XML/XSLT implementation. Discussed
3048 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
3049 * configure.ac (XSLTPROC): New substitution.
3050 * Makefile.am (maintainer-xml-check): New phony target invoking...
3051 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
3052 invoking make maintainer-check with BISON_TEST_XML=1.
3053 * tests/atlocal.in (XSLTPROC): New.
3054 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
3055 not to report reachable memory when Bison is expected to have a
3056 non-zero exit status and (2) to compare XML/XSLT output with --graph
3057 and --report=all output for every working grammar when
3059 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
3060 (AT_BISON_CHECK_XML): New.
3061 (AT_QUELL_VALGRIND): New.
3062 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
3063 (AT_CHECK): ... don't redefine this since this was the old way to
3065 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
3066 AT_BISON_CHECK invocations.
3067 * tests/c++.at: Likewise.
3068 * tests/calc.at: Likewise.
3069 * tests/conflicts.at: Likewise.
3070 * tests/cxx-type.at: Likewise.
3071 * tests/existing.at: Likewise.
3072 * tests/glr-regression.at: Likewise.
3073 * tests/headers.at: Likewise.
3074 * tests/input.at: Likewise.
3075 * tests/java.at: Likewise.
3076 * tests/output.at: Likewise.
3077 * tests/push.at: Likewise.
3078 * tests/reduce.at: Likewise.
3079 * tests/regression.at: Likewise.
3080 * tests/sets.at: Likewise.
3081 * tests/skeletons.at: Likewise.
3082 * tests/synclines.at: Likewise.
3083 * tests/torture.at: Likewise.
3084 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
3085 tends to hang xsltproc.
3086 (Big horizontal): Likewise.
3088 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3090 In XML output, remove redundant class attribute on symbol element.
3091 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
3092 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
3093 look up a symbol to determine whether it's a nonterminal or terminal.
3094 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
3095 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
3097 Add prec/assoc information to XML output.
3098 * src/gram.c (grammar_rules_print_xml): For each rule that has a
3099 %prec, add a percent_prec attribute.
3100 * src/print-xml.c (print_grammar): For each terminal that has a
3101 precedence or associativity, add a prec or assoc attribute.
3103 (xml_puts): Use xml_indent.
3104 (xml_printf): Use xml_indent.
3105 * src/print-xml.h (xml_indent): Prototype.
3107 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
3108 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
3110 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3112 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
3113 (bison:ruleByNumber): ... this for clarity.
3114 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
3115 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
3116 (xsl:template match="reduction"): Update.
3117 (xsl:template match="item"): Update.
3118 (xsl:template match="reduction"): Update.
3120 In the XML output, don't print the list of rules where symbols appear.
3121 Compute it in XSLT instead. Discussed at
3122 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
3123 * data/xslt/bison.xsl (bison:ruleByLhs): New.
3124 (bison:ruleByRhs): New.
3125 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
3127 (xsl:template match="terminal/rule"): Remove.
3128 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3130 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3132 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
3133 bison:ruleByRhs and mode="number-link" for rule template.
3134 (xsl:template match="terminal/rule"): Remove.
3135 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3136 bison:ruleByRhs and mode="number-link" for rule template.
3137 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3139 (xsl:template match="rule" mode="number-link"): ... this.
3140 * src/print-xml.c (print_grammar): Don't print the list of rules.
3142 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
3144 Don't let --report affect XML output; always print all information.
3146 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
3147 * src/conflicts.c (log_resolution): Implement.
3148 * src/print-xml.c (print_core): Implement.
3149 (print_state): Implement.
3150 (print_xml): Implement.
3152 * NEWS (2.3a+): Fix quotes.
3153 * src/parse-gram.y (prologue_declaration): For consistency with -v,
3154 don't let %verbose clear the list specified by --report.
3156 2007-11-26 Akim Demaille <akim@epita.fr>
3158 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
3160 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
3162 In the XML output, list useless and unused symbols and rules with the
3163 useful ones and add a "usefulness" attribute. Discussed starting at
3164 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
3165 * src/gram.c (grammar_rules_partial_print_xml): Remove.
3166 (grammar_rules_print_xml): Print all rules instead of just those
3167 useful in the grammar, and add a "usefulness" attribute.
3168 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
3169 * src/print-xml.c (print_rules_useless_in_parser): Remove.
3170 (print_grammar): Print all nonterminals instead of just useful ones,
3171 and add a "usefulness" attribute to nonterminals and terminals.
3172 (print_xml): Don't print a separate "reductions" or
3173 "rules-useless-in-parser" element.
3174 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
3175 (reduce_xml): Remove.
3176 (reduce_token_unused_in_grammar): New.
3177 (reduce_nonterminal_useless_in_grammar): New.
3178 * src/reduce.h (reduce_xml): Remove prototype.
3179 (reduce_token_unused_in_grammar): Add prototype.
3180 (reduce_nonterminal_useless_in_grammar): Add prototype.
3181 * data/xslt/xml2text.xsl: Update for XML changes.
3182 * data/xslt/xml2xhtml.xsl: Update for XML changes.
3183 * tests/reduce.at (Useless Terminals): Update output.
3184 (Useless Rules): Update output.
3185 (Reduced Automaton): Update output.
3187 Say "Terminals unused in grammar" instead of "Unused terminals".
3188 * NEWS (2.3a+): Update.
3189 * doc/bison.texinfo (Understanding): Update example output.
3190 * src/reduce.c (reduce_output): Implement.
3191 * data/xslt/xml2text.xsl: Implement.
3192 * data/xslt/xml2xhtml.xsl: Implement.
3194 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
3196 Accept --report-file=FILE to override the default `.output' filename.
3197 * NEWS (2.3a+): Mention.
3198 * doc/bison.texinfo (Bison Options): Add an entry.
3199 * src/files.c (compute_output_file_names): Don't override
3200 spec_verbose_file if already set.
3201 * src/getargs.c (usage): Document --report-file.
3202 (REPORT_FILE_OPTION): New anonymous enum member.
3203 (long_options): Add entry for it.
3204 (getargs): Add case for it setting spec_verbose_file.
3206 * build-aux/cross-options.pl: Don't record a short option just because
3208 * doc/.cvsignore: Add yacc.1.
3210 2007-11-14 Akim Demaille <akim@epita.fr>
3212 * doc/yacc.1.in: New.
3213 * configure.ac, doc/Makefile.am: Adjust.
3214 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
3216 Use AC_SUBST for assignments too.
3217 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
3219 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
3221 * src/gram.c: Remove comments that duplicate comments in gram.h.
3223 When reporting useless rules and nonterminals, say "useless in grammar"
3224 instead of "useless", and say "useless in parser" instead of "never
3225 reduced". Discussed starting at
3226 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
3227 * NEWS (2.3a+): Mention this change.
3228 * data/xslt/xml2text.xsl: Update output text and expected input XML
3229 element names to match changes below.
3230 * data/xslt/xml2xhtml.xsl: Likewise.
3231 (xsl:template match="bison-xml-report"): Add missing entry in Table of
3232 Contents: "Rules useless in parser due to conflicts".
3233 * doc/bison.texinfo (Decl Summary): Reword a little.
3234 (Understanding): Update example output for changes below.
3235 * src/gram.c: (rule_useful_p): Rename to...
3236 (rule_useful_in_grammar_p): ... this.
3237 (rule_useless_p): Rename to...
3238 (rule_useless_in_grammar_p): ... this.
3239 (rule_never_reduced_p): Rename to...
3240 (rule_useless_in_parser_p): ... this.
3241 (grammar_rules_print): Update for renames.
3242 (grammar_rules_print_xml): Update for renames.
3243 (grammar_rules_never_reduced_report): Rename to...
3244 (grammar_rules_useless_report): ... this since it is used for either
3245 kind of useless rule.
3246 * src/gram.h: Reword comments and update function names in prototypes.
3247 * src/main.c (main): Say "rule useless in parser due to conflicts".
3248 * src/print-xml.c (print_rules_never_reduced): Rename to...
3249 (print_rules_useless_in_parser): ... this, and rename output XML
3250 element "rules-never-reduced" to "rules-useless-in-parser".
3251 (print_xml): Update for rename.
3252 * src/print.c (print_results): Say "Rules useless in parser due to
3254 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
3255 (nonterminals_reduce): Say "nonterminal useless in grammar".
3256 (reduce_output): Say "Nonterminals useless in grammar".
3257 Say "Rules useless in grammar".
3258 (reduce_xml): Rename output XML element "useless" to
3259 "useless-in-grammar".
3260 (reduce_print): Don't report the count of grammatically useless rules
3261 as "rules never reduced" just because %yacc is specified.
3262 In the correct report of this count, say nonterminal(s) and rule(s)
3263 "useless in grammar".
3264 * tests/conflicts.at (S/R in initial): Update expected output.
3265 (Defaulted Conflicted Reduction): Likewise.
3266 (Unreachable States After Conflict Resolution): Likewise.
3267 * tests/existing.at (GNU pic Grammar): Likewise.
3268 * tests/reduce.at (Useless Nonterminals): Likewise.
3269 (Useless Rules): Likewise.
3270 (Reduced Automaton): Likewise.
3271 (Underivable Rules): Likewise.
3272 (Empty Language): Likewise.
3274 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
3276 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
3277 here document and before the EOF so that BSD's implementation of Bourne
3278 shell doesn't parse the delimiter as part of the here document.
3279 * doc/.cvsignore: Add cross-options.texi.
3280 * src/getargs.c (usage): Add a blank line after the warning categories.
3282 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
3284 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
3286 2007-11-05 Akim Demaille <akim@epita.fr>
3288 Remove Id: from bison.1.
3289 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
3290 (perl -0777 -pi -e 's/\.PP\nId): New.
3291 (.x.1): Use it to ignore the version control revision.
3293 2007-11-05 Akim Demaille <demaille@gostai.com>
3295 * build-aux/Makefile.am: Ship cross-options.pl.
3296 * doc/Makefile.am: Always refer to cross-options.texi with
3298 (MAINTAINERCLEANFILES): Add it.
3300 2007-11-04 Akim Demaille <demaille@gostai.com>
3302 Generate the long/short option cross-table.
3303 * build-aux/cross-options.pl: New.
3304 * doc/Makefile.am (cross-options.texi): New.
3305 * doc/bison.texinfo: Use it.
3307 2007-11-04 Akim Demaille <demaille@gostai.com>
3309 Generate bison.1 using help2man.
3310 * doc/common.x, doc/bison.x: New.
3311 * doc/Makefile.am (bison.1, .x.1): New.
3312 The code is taken from autoconf-2.61/man/Makefile.am.
3313 * configure.ac: Look for help2man.
3315 2007-11-04 Akim Demaille <demaille@gostai.com>
3318 * src/getargs.c (usage): Document -W, make it clear that -d,
3319 -g and -x have optional arguments.
3321 2007-11-04 Akim Demaille <demaille@gostai.com>
3323 Find sha1sum when named gsha1sum.
3324 * bootstrap (find_tool): New.
3327 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3329 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
3331 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
3332 * NEWS (2.3a+): Mention.
3333 * data/bison.m4 (b4_pure_if): Don't define it here.
3334 * data/c.m4 (b4_identification): Depend on individual skeletons to
3335 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
3336 values of the %define variables api.pure or api.push_pull. Define
3337 YYPURE, YYPUSH, and YYPULL accordingly.
3338 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
3339 glr.cc has already defined b4_pure_flag.
3340 * data/push.c: Define b4_pure_if based on `%define api.pure'.
3341 Remove YYPUSH and YYPULL since they're back in b4_identification again.
3342 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
3343 * doc/bison.texinfo (Pure Decl): Update.
3344 (Push Decl): Update.
3345 (Decl Summary): Add api.pure to %define entry.
3346 In %pure-parser entry, say it's deprecated and reference %define.
3347 (Pure Calling): Update.
3348 (Error Reporting): Update.
3349 (C++ Scanner Interface): Update.
3350 (How Can I Reset the Parser): Update.
3351 (Table of Symbols): In %pure-parser entry, say it's deprecated and
3353 * src/getargs.c (pure_parser): Remove global variable.
3354 * src/getargs.h (pure_parser): Remove extern.
3355 * src/output.c (prepare): Don't define pure_flag muscle.
3356 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
3357 wrapper around `%define api.pure'.
3358 * tests/calc.at (Simple LALR Calculator): Update.
3359 (Simple GLR Calculator): Update.
3360 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
3362 (GLR: Resolve ambiguity, pure, locations): Update.
3363 (GLR: Merge conflicting parses, pure, no locations): Update.
3364 (GLR: Merge conflicting parses, pure, locations): Update.
3365 * tests/glr-regression.at (Uninitialized location when reporting
3367 * tests/input.at (Unused %define api.pure): New test case.
3368 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
3369 AT_PURE_IF and AT_PURE_AND_LOC_IF.
3370 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
3372 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3374 %define push_pull -> %define api.push_pull. Discussed starting at
3375 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
3376 * data/push.c: Expect the new name.
3377 * data/yacc.c: Likewise.
3378 * doc/bison.texinfo (Push Decl): Update.
3379 (Decl Summary): Update %define entry.
3380 (Push Parser Function): Update.
3381 (Pull Parser Function): Update.
3382 (Parser Create Function): Update.
3383 (Parser Delete Function): Update.
3384 * tests/calc.at (Simple LALR Calculator): Update.
3385 * tests/input.at (%define enum variables): Update.
3386 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
3387 (Push Parsing: Multiple impure instances): Update.
3388 (Push Parsing: Unsupported Skeletons): Update.
3389 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
3390 (Exploding the Stack Size with Malloc): Update.
3392 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
3395 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
3397 For the XML output's terminal element, rename @number to @token-number,
3398 and add @symbol-number. In the nonterminal element, rename @number to
3399 @symbol-number. Discussed starting at
3400 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
3401 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
3403 (xsl:template match="nonterminal"): Likewise.
3404 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
3405 (xsl:template match="nonterminal"): Likewise.
3406 * src/print-xml.c (print_grammar): Implement.
3408 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3410 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
3411 2007-10-11 change, the child elements here are items not rules.
3412 (xsl:template match="item"): New.
3413 (xsl:template match="rule"): Update for new reduced itemset.
3414 (xsl:template match="point"): Remove.
3415 (xsl:template match="empty"): For consistency with --graph, don't
3416 output "/* empty */".
3417 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
3418 line-wrap, don't pass a negative value as first-line-length since this
3419 won't work with the following changes.
3420 (xsl:template name="line-wrap"): Simplify slightly.
3421 (xsl:template name="ws-search"): Eliminate recursion.
3422 * src/print_graph.c (print_core): Don't print a reduction's lookahead
3423 set next to an item whose dot is not at the end of the RHS even if it
3424 happens to be associated with the same rule.
3426 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
3428 Add %define lr.keep_unreachable_states.
3429 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
3430 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
3431 * src/main.c (main): Implement it.
3432 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3433 Extend to test it, and fix a typo.
3435 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
3437 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
3438 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
3439 the example .output text.
3440 * tests/regression.at (Extra lookahead sets in report): Improve wording
3443 2007-10-17 Wojciech Polak <polak@gnu.org>
3445 * src/print-xml.c (print_grammar): Renamed
3446 <terminal> and <nonterminal> attributes:
3447 "type" to "number" and "symbol" to "name".
3448 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
3449 Use new attribute names.
3450 (xsl:template match="nonterminal"): Likewise.
3451 * data/xslt/xml2xhtml.xsl: Likewise.
3453 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
3455 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
3456 (Option Cross Key): Likewise.
3458 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
3459 next to an item whose dot is not at the end of the RHS even if it
3460 happens to be associated with the same rule.
3461 * src/print.c (print_core): Likewise.
3462 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
3463 (Resolved SR Conflicts): Update output.
3464 * tests/regression.at (Extra lookahead sets in report): New test case.
3466 2007-10-11 Wojciech Polak <polak@gnu.org>
3468 * src/print-xml.c (print_core): Remove item set
3470 * data/xslt/bison.xsl (bison:ruleNumber): New key.
3471 Improve processing time. Suggested by Joel E. Denny.
3472 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
3473 Write xsl:param "required" attribute as comment.
3474 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
3475 (xsl:template match="rule"): Support new reduced itemset.
3476 (xsl:template match="point"): Remove.
3477 * data/xslt/xml2xhtml.xsl: Likewise.
3479 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
3481 * src/getargs.c (version): Update copyright year.
3483 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
3485 Make xml2dot.xsl and --graph produce the same output.
3486 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a ` '
3487 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
3489 (xsl:template name="output-node"): Use the new escape template instead
3490 of the string-replace template directly.
3491 (xsl:template name="output-edge"): Likewise.
3492 (xsl:template name="escape"): New, escapes backslashes and newlines in
3493 addition to quotation marks.
3494 * src/graphviz.c (start_graph, output_node, output_edge): Add
3495 whitespace to output for legibility.
3497 Make xml2text.xsl and --report produce the same output, and remove the
3498 XML "conflicts" element since a conflict summary is easily extracted
3500 * data/xslt/bison.xsl: New.
3501 (xsl:template match="state" mode="bison:count-conflicts): New.
3502 * data/xslt/xml2text.xsl: Import bison.xsl.
3503 (xsl:template match="bison-xml-report"): Instead of styling the
3504 "conflicts" element, style the "automaton" element with mode
3505 "conflicts". Unlike the former, the latter lists S/R and R/R
3506 conflicts for a state on the same line.
3507 (xsl:template match="conflicts"): Remove.
3508 (xsl:template match="conflict"): Remove.
3509 (xsl:template match="terminal"): Line-wrap the list of rules in which
3510 the terminal is used.
3511 (xsl:template match="nonterminal"): Likewise for nonterminals.
3512 (xsl:template match="automaton" mode="conflicts"): New.
3513 (xsl:template match="state" mode="conflicts"): New.
3514 (xsl:template name="line-wrap"): New.
3515 (xsl:template name="ws-search"): New.
3516 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
3517 (xsl:template match="bison-xml-report"): Instead of styling the
3518 "conflicts" element, style the "automaton" element with mode
3520 (xsl:template match="conflicts"): Remove.
3521 (xsl:template match="conflict"): Remove.
3522 (xsl:template match="automaton" mode="conflicts"): New.
3523 (xsl:template match="state" mode="conflicts): New.
3524 * src/conflicts.c (conflicts_output_xml): Remove.
3525 * src/conflicts.h (conflicts_output_xml): Remove prototype.
3526 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
3527 * src/print.c (print_grammar): Consistently wrap at the 66th column so
3528 the corresponding XSLT is easier. Also, never wrap between a word and
3529 the comma that follows it.
3531 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
3533 Improve C++ namespace support. Discussed starting at
3534 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
3535 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
3536 b4_namespace_close): New macros that interpret the %define variable
3537 "namespace" so its value can contain "::" to indicate nested
3539 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
3541 * data/lalr1.cc (b4_namespace): Likewise.
3542 * data/location.cc (b4_namespace): Likewise.
3543 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
3544 inside a new table in the general %define entry. Document `%define
3545 namespace' there as well. Point the %name-prefix entry to it since it
3546 explains it more completely in the case of C++.
3547 (C++ Bison Interface): Mention `%define namespace' instead of
3549 (Table of Symbols): Remove the `%define push_pull' entry. The %define
3551 * tests/c++.at (Relative namespace references): New test case.
3552 (Absolute namespace references): New test case.
3553 (Syntactically invalid namespace references): New test case.
3554 * tests/input.at (C++ namespace reference errors): New test case.
3556 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
3558 Add syncline support and location accessor to internal %define
3560 * data/bison.m4 (b4_percent_define_get_loc): New.
3561 (b4_percent_define_get_syncline): New.
3562 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
3563 (b4_percent_define_default): Record defining location as line 1 rather
3564 than 0 for the sake of synchronizing #line's, and define
3565 b4_percent_define_syncline(VARIABLE).
3566 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
3567 * src/muscle_tab.c (muscle_syncline_grow): New.
3568 (muscle_code_grow): Use muscle_syncline_grow.
3569 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
3570 define b4_percent_define_syncline(VARIABLE).
3571 (muscle_percent_define_get_loc): New.
3572 (muscle_percent_define_get_syncline): New.
3573 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
3574 remove some unused variables.
3575 (muscle_percent_define_default): Record defining location as line 1
3576 rather than 0 for the sake of synchronizing #line's, and define
3577 b4_percent_define_syncline(VARIABLE).
3578 (muscle_percent_define_check_values): Use
3579 muscle_percent_define_get_loc.
3580 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
3581 (muscle_percent_define_get_syncline): Prototype.
3582 * tests/skeletons.at (%define Boolean variables: invalid skeleton
3583 defaults): Update output for location change.
3584 (Complaining during macro argument expansion): Extend to test
3585 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
3587 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
3589 Fix some error-reporting macro bugs.
3590 * data/bison.m4 (b4_cat): New.
3591 (b4_error, b4_error_at): Use b4_cat to send error directives directly
3592 to stdout so they don't become arguments to other macros. Update
3593 comments and add examples.
3594 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
3596 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
3597 after printing the error directive so that M4 doesn't report subsequent
3598 problems that are induced by this problem.
3599 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
3600 instead of just in them. Recognize @\n in both places. Both expand to
3601 the empty string. Needed by b4_cat.
3602 * tests/skeletons.at (Complaining during macro argument expansion):
3604 (Fatal errors make M4 exit immediately): New test case.
3606 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
3608 Implement --print-datadir.
3609 * src/getargs.c (usage): Mention.
3610 (PRINT_DATADIR_OPTION): New anonymous enum member.
3611 (long_options): Add entry for it.
3612 (getargs): Add case for it calling compute_pkgdatadir.
3613 * src/output.c (output_skeleton): Encapsulate data directory
3614 computation from here...
3615 (prepare): ... and from here...
3616 (compute_pkgdatadir): ... into this new function.
3617 * src/output.h (compute_pkgdatadir): Prototype.
3619 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
3621 * src/print-xml.c (escape_bufs): New static global variable
3623 (xml_escape_n): ... the static local variable buf here.
3624 (print_xml): Free memory for escape_bufs.
3625 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
3627 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
3629 Replace `%push-parser' and `%push-pull-parser' with
3630 `%define push_pull "push"' and `%define push_pull "both"'.
3631 `%define push_pull "pull"' is the default.
3632 * doc/bison.texinfo (Push Decl, Push Parser Function,
3633 Pull Parser Function, Parser Create Function, Parser Delete Function):
3634 Update declarations.
3635 (Decl Summary, Table of Symbols): Replace %push-parser and
3636 %push-pull-parser entries with a %define push_pull entry.
3637 * data/bison.m4 (b4_percent_define_check_values): New macro.
3638 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
3640 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
3642 * data/push.c: ... to here and compute them from the value of the
3643 %define variable push_pull.
3644 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
3645 parsing requests here...
3646 * data/yacc.c: ... hack this to switch to push.c any time
3647 b4_use_push_pull_flag or the %define variable push_pull is set. This
3648 will go away when we mv push.c yacc.c.
3649 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
3650 push parsing is not supported since unused %define variables are
3652 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
3653 * src/muscle_tab.h (muscle_percent_define_check_values): Update
3654 comments for consistency with b4_percent_define_check_values.
3655 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
3657 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
3659 (prologue_declaration): Remove %push-parser and %push-pull-parser
3661 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
3662 * tests/calc.at: Update declarations.
3663 * tests/input.at (%define enum variables): New test case.
3664 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
3666 (Push Parsing: Multiple impure instances): Update declaration.
3667 (Push Parsing: Unsupported Skeletons): New test case.
3668 * tests/torture.at (Exploding the Stack Size with Alloca): Update
3670 (Exploding the Stack Size with Malloc): Update declaration.
3672 2007-09-24 Wojciech Polak <polak@gnu.org>
3674 Add XSLT transformations.
3676 * data/xslt/xml2dot.xsl: Transform XML into DOT.
3677 * data/xslt/xml2text.xsl: Transform XML into plain text.
3678 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
3679 * data/Makefile.am (xsltdir): New variable.
3680 (dist_xslt_DATA): Add xslt/*.xsl files.
3682 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
3684 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
3685 Problem reported by Wojciech Polak.
3686 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
3687 (xml_printf): Undo change I made on 21 September; that is,
3688 indent 2 spaces, not 1.
3690 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
3692 Pacify ./configure --enable-gcc-warnings.
3693 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
3694 `char const *' instead of `char *'.
3695 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
3696 local variable `sep'.
3698 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
3700 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
3702 * src/print-xml.c: Prefer "const" after types; that's more consistent.
3703 (xml_printf): Indent just 1 space for level.
3704 (e_char, xlate_char): Remove.
3705 (xml_escape_string): Rewrite to avoid undefined behavior (used
3706 storage that was freed from the stack).
3707 (xml_escape_n): Don't bother checking for subscript error.
3709 2007-09-21 Wojciech Polak <polak@gnu.org>
3711 Add Bison XML Automaton Report.
3713 Add support for an -x option to generate an XML report.
3714 It is not documented yet.
3715 * src/print-xml.c: New file.
3716 * src/print-xml.h: Likewise.
3717 * lib/timevar.def (TV_XML): New var.
3718 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
3719 * src/conflicts.c: Include print-xml.h.
3720 (solved_conflicts_xml_obstack): New var.
3721 (log_resolution, conflicts_solve, conflicts_free):
3722 Add support for XML report.
3723 (conflicts_output_val): New function.
3724 * src/conflicts.h (conflicts_output_val): New decl.
3725 * src/files.c (spec_xml_file): New var.
3726 (compute_output_file_names, output_file_names_free): Add XML support.
3727 * src/files.h (spec_xml_file): New decl.
3728 * src/getargs.c (xml_flag): New var.
3729 (usage, short_options, long_options, getargs): Add XML support.
3730 * src/getargs.h (xml_flag): New decl.
3731 * src/gram.c: Include print-xml.h.
3732 (rule_lhs_print_xml, rule_rhs_print_xml):
3733 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
3735 * src/gram.h: Declare external ones.
3736 * src/main.c: Include print-xml.h.
3737 (main): Add XML support.
3738 * src/reduce.c: Include print-xml.h.
3739 (reduce_xml): New function.
3740 * src/reduce.h: Declare it.
3741 * src/state.c: Include print-xml.h.
3742 (state_new): Add XML support.
3743 (state_rule_lookahead_tokens_print_xml): New function.
3744 * src/state.h: Declare it.
3745 (struct state): New member solved_conflicts_xml.
3746 * src/symtab.c (symbol_class_get_string): New function.
3747 * src/symtab.h: Declare it.
3749 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
3751 * GNUmakefile: Switch to coreutils's version.
3752 * bootstrap: Likewise.
3753 * Makefile.cfg: Adjust to new GNUmakefile.
3754 * README-hacking: Likewise.
3758 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
3759 Bruno Haible <bruno@clisp.org>
3761 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
3762 and is a script that invokes bison. Tighten the code. Add comments.
3764 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
3766 Spell "boolean" as "Boolean". Reported by Akim Demaille.
3767 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
3768 * doc/bison.texinfo (Decl Summary): Fix.
3769 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
3770 * tests/input.at (Boolean %define variables): Update output.
3771 * tests/skeletons.at (%define boolean variables: invalid skeleton
3772 defaults): Rename to...
3773 (%define Boolean variables: invalid skeleton defaults): ... this and
3776 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
3778 In impure push mode, don't allow more than one yypstate to be allocated
3779 since multiple impure parsers would corrupt yynerrs.
3780 * data/push.c (yypstate_allocated): New static global variable
3782 (yypull_parse): If yypstate_new returns 0, don't report it as memory
3783 exhaustion if yypstate_allocated is 1, but still return 2.
3784 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
3785 already 1. Otherwise, set it to 1.
3786 (yypstate_delete): Set it to 0.
3787 * tests/push.at (Push Parsing: Multiple impure instances): New test
3790 2007-08-17 Bob Rossi <bob@brasko.net>
3792 * doc/bison.texinfo (Push Decl): Document the push parser.
3793 (Table of Symbols): Ditto.
3795 (Decl Summary): Ditto.
3796 (Multiple Parsers, Push Parser Function, Pull Parser Function,
3797 Parser Create Function, Parser Delete Function):
3798 Add new push parser symbols.
3799 (Table of Symbols): Document push-parser, push-pull-parser,
3800 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
3802 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
3805 * doc/gpl-3.0.texi: New file.
3806 * doc/gpl.texi: Remove.
3807 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
3808 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
3809 * README-hacking, TODO, bootstrap, bootstrap.conf:
3810 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
3811 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
3812 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
3813 * data/lalr1.cc, data/lalr1.java, data/location.cc:
3814 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
3815 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
3816 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
3817 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
3818 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
3819 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
3820 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
3821 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
3822 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
3823 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
3824 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
3825 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
3826 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
3827 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
3828 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
3829 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
3830 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
3831 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
3832 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
3833 * src/complain.c, src/complain.h, src/conflicts.c:
3834 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
3835 * src/files.h, src/flex-scanner.h, src/getargs.c:
3836 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
3837 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
3838 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
3839 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
3840 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
3841 * src/print.c, src/print.h, src/print_graph.c:
3842 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
3843 * src/reduce.h, src/relation.c, src/relation.h:
3844 * src/revision.h, src/scan-code.h, src/scan-code.l:
3845 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
3846 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
3847 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
3848 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
3849 * tests/Makefile.am, tests/actions.at, tests/c++.at:
3850 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
3851 * tests/existing.at, tests/glr-regression.at:
3852 * tests/headers.at, tests/input.at, tests/java.at:
3853 * tests/local.at, tests/output.at, tests/push.at:
3854 * tests/reduce.at, tests/regression.at, tests/sets.at:
3855 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
3859 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
3861 Get rid of broken %no-parser, -n, and --no-parser implementation and
3863 * TODO: Don't mention them.
3864 * doc/bison.1: Likewise.
3865 * doc/bison.texinfo (Decl Summary): Likewise.
3866 (Bison Options): Likewise.
3867 (Option Cross Key): Likewise.
3868 * src/getargs.c (no_parser_flag): Remove global variable.
3869 (usage): Don't print description of -n and --no-parser.
3870 (long_options): Remove --no-parser entry here.
3871 (getargs): Remove -n case in the switch here.
3872 * src/getargs.h (no_parser_flag): Remove extern.
3873 * tests/regression.at (Web2c Actions): Remove comment that mentions
3876 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
3878 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
3879 name user variables starting with `yy'. Just pass NULL instead of a
3880 dummy local &yylval to yypush_parse.
3881 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
3884 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
3886 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
3887 true since it's then always used regardless of whether yyoverflow is
3888 defined. Reported by Christian Burger at
3889 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
3890 * THANKS: Add Christian Burger.
3892 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3893 node names: say "Decl Summary" not "Bison Declaration Summary".
3895 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
3897 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
3898 determine whether this function has already complained about an invalid
3899 value for a %define boolean variable, don't check whether Bison has
3900 ever examined the value. As written, the check was a tautology.
3901 Instead, record and check for this complaint using a separate muscle.
3903 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3905 Fix push parsing memory leak reported by Brandon Lucia at
3906 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
3907 * THANKS: Add Brandon Lucia.
3908 * data/push.c (yypstate_delete): Free the stack if it was reallocated
3909 but the parse never completed and thus freed it.
3910 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
3911 * tests/testsuite.at: Include push.at.
3912 * test/push.at: New.
3913 (Push Parsing: Memory Leak for Early Deletion): New test case.
3915 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
3917 Improve handling of multiple S/R conflicts in the same state and of S/R
3918 conflicts involving multiple reductions.
3919 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
3920 set for a state here or Bison will abort if it is reassigned on a
3921 later conflicted reduction in the same state.
3922 Similarly, don't finalize and assign the solved conflicts report here
3923 or it will be lost if it is reassigned on a later conflicted reduction
3925 (set_conflicts): Instead, assign them both here after all S/R conflicts
3926 in the state have been fully examined.
3927 * src/print.c (shift_set): Rename to...
3928 (no_reduce_set): ... this.
3929 (print_reductions): Update for rename, and add %nonassoc error action
3930 tokens to no_reduce_set so that, when printing the first remaining
3931 reduction on an error action token, the reduction is enclosed in
3933 (print_results): Update for rename.
3934 * tests/conflicts.at (Solved conflicts report for multiple reductions
3935 in a state): New test case.
3936 (%nonassoc error actions for multiple reductions in a state): New test
3939 * src/main.c (main): Don't depend on C99 features.
3941 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
3943 * build-aux/.cvsignore: Add compile.
3944 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
3947 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
3949 * bootstrap (slurp): Create target directories that don't exist.
3950 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
3952 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3954 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
3956 * closure.c (closure): Likewise.
3957 * state.h (reductions): Comment sorting of rules.
3958 (state): Comment sorting of items.
3960 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
3962 Fix C++ test cases after recent Gnulib changes. Discussed starting at
3963 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
3964 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
3965 definition in order to avoid Gnulib headers since we don't use config.h
3967 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
3968 rather than AT_DATA so that config.h is included.
3970 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
3972 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
3973 instead of fprintf. Guard these functions with #if YYDEBUG instead of
3974 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
3975 and so that YYFPRINTF is guaranteed to be defined here.
3977 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
3979 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
3981 (muscle_percent_define_check_values): ... this more helpful function.
3982 Again, it's not used yet, but it will be.
3983 * src/muscle_tab.h: Likewise.
3985 Improve some comments in parser table construction.
3986 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
3987 (generate_states): Don't mention ruleset, which is internal to closure.
3988 * src/closure.c (closure): Explain sorting of core and itemset, which
3989 is required for this function to behave correctly.
3990 * src/closure.h (closure): Mention sorting.
3992 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
3994 * src/lalr.c (state_lookahead_tokens_count): For code readability,
3995 move the check for disabled transitions to an aver since conflict
3996 resolution hasn't happened yet.
3998 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
3999 labels a state as inconsistent just because it has error transitions.
4000 The original form of this check appeared in revision 1.1 of lalr.c,
4001 which was committed on 1991-12-21. Now (at least), changing the
4002 consistency label on such a state appears to have no useful effect in
4003 any of the places it is examined, which I enumerate below. The key
4004 point to understanding each item in this enumeration is that a state
4005 with an error transition is labelled consistent in the first place only
4006 if it has no rules, so the check cannot matter for states that have
4007 rules. (1) Labelling a state as inconsistent will cause set_conflicts
4008 to try to identify its conflicts, and a state must have *rules* to have
4009 conflicts. (2) Labelling a state as inconsistent will affect how
4010 action_row sets the default *rule* for the state. (3) Labelling a
4011 state as inconsistent will cause build_relations to add lookback edges
4012 to *rules* in that state.
4013 * src/state.h (struct state): Word the comment for member consistent
4016 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4018 Don't depend on C99 features.
4019 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
4020 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
4021 * src/reader.c (check_and_convert_grammar): Fix for-loop.
4022 * src/state.c (state_mark_reachable_states): Fix for-loop.
4023 (state_remove_unreachable_states): Fix for-loop.
4025 Don't widen struct state with member reachable just to temporarily
4026 record reachability. Instead, use a local bitset.
4027 * src/state.h (struct state): Remove member.
4028 * src/state.c (state_new): Don't initialize it.
4029 (state_mark_reachable_states): Rename to...
4030 (state_record_reachable_states): ... this, and use bitset.
4031 (state_remove_unreachable_states): Use bitset.
4033 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
4035 * src/Makefile.am (yacc): Quote target action commands properly so
4036 that the yacc script isn't corrupt. Reported by Hans Aberg at
4037 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
4039 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
4040 the case of pure parsers. Reported by Frans Englich at
4041 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
4042 * THANKS: Add Frans Englich.
4044 * NEWS (2.3a+): In the %code entry, reference section `Bison
4045 Declaration Summary' from the manual now since the %code summary has
4047 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
4048 in the rules section must be terminated by semicolons.
4050 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
4052 Extend the front-end API for %define variables to more completely
4053 mirror the back-end. This will be useful in the future.
4054 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
4055 Update comments to mention the new front-end counterparts of these
4057 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
4058 for muscle_string_decode and muscle_location_decode.
4059 (muscle_string_decode): New static function.
4060 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
4061 (muscle_percent_define_get, muscle_percent_define_ifdef): New
4063 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
4064 muscle_percent_define_get to mimic the b4_percent_define_flag_if
4065 implementation more closely.
4066 (muscle_percent_define_invalid_value): New function.
4067 * src/muscle_tab.h (muscle_percent_define_get,
4068 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
4071 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4073 * NEWS (2.3a+): Mention yesterday's state-removal change.
4074 (2.3a): Remove the %language entry, which was added after 2.3a.
4075 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
4076 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
4077 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
4078 tests/existing.at: Update copyright date.
4080 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4082 If conflict resolution makes states unreachable, remove those states,
4083 report rules that are then unused, and don't report conflicts in those
4085 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
4086 New global function.
4087 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
4089 * src/main.c (main): After conflict resolution, remove the unreachable
4090 states and update all data structures that reference states by number.
4091 * src/state.c (state_new): Initialize each state's reachable member to
4093 (state_mark_reachable_states): New static function.
4094 (state_remove_unreachable_states): New global function.
4095 * src/state.h (struct state): Add member bool reachable.
4096 (state_remove_unreachable_states): Prototype.
4097 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4099 * tests/existing.at (GNU pic Grammar): Update test case output now that
4100 an unused rule is discovered.
4102 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4104 Minor code cleanup in parser table construction.
4105 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
4106 (new_itemsets, save_reductions): Update for rename to nitemset.
4107 * src/closure.c (nritemset): Rename to...
4108 (nitemset): ... this since the "r" appears to meaningless and isn't
4109 used in the comments.
4110 (closure): Update for rename.
4111 * src/closure.h (nritemset): Update extern to...
4112 (nitemset): ... this.
4113 * src/lalr.c (LA): Fix a typo in comments.
4114 * src/print.c (print_core): Update for rename to nitemset.
4115 * src/print_graph.c (print_graph): Likewise.
4116 * src/state.h: Fix some typos in header comments.
4118 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
4120 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
4121 still sticks to ASCII. Sorry!
4123 * README-hacking: New file, taken mostly from coreutils, with changes
4124 for Bison. Contains much of the contents of:
4125 * README-cvs: Remove.
4126 * bootstrap: Sync from gnulib.
4127 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
4128 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
4130 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
4132 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
4134 (Java Differences): Fix some typos.
4135 * THANKS: Add Sebastian Setzer.
4137 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
4139 * data/java.m4 (b4_single_class_if): Remove.
4140 (b4_abstract_if): Look at "%define abstract".
4142 (b4_union_name): Rename...
4143 (b4_yystype): ... to this. Map to "%define stype".
4144 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
4145 b4_maybe_throws): Fix quoting.
4146 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
4147 * data/lalr1.java (Lexer interface): Always define.
4148 (Lexer interface within parser class): Remove.
4149 (YYLexer class): New, used when "%code lexer" is present.
4150 (constructor): When "%code lexer" is used, pass %lex-param
4151 to the lexer constructor.
4152 (yylex, yyparse): Remove %lex-param from method invocations
4153 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
4155 * doc/bison.texinfo (Java Bison Interface): Mention "%define
4156 abstract". Rename "%define union_name" to "%define stype".
4157 Rename method names according to previous patch.
4158 (Java Scanner Interface): Describe "%code lexer" instead of
4159 "%pure-parser" and "%define single_class".
4160 (Java Differences): Mention "%code lexer".
4162 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
4163 Include scanner here, using macros from tests/local.at.
4164 (AT_DATA_CALC_Y): Remove final argument.
4165 (_AT_CHECK_JAVA_CALC): Likewise.
4166 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
4167 of %locations and %error-verbose.
4168 (main): Test with and without %lex-param.
4169 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
4170 (AT_BISON_OPTION_POPDEFS): Pop it.
4172 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4174 DJGPP spefic issue. Inhibit the use of disallowed characters for
4175 file name genertion on Win98, WinXP, etc. These are |<>":?*\
4176 and concern testsuite case 46.
4177 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
4178 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
4179 * djgpp/config.bat: Inhibit the use of disallowed characters.
4181 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4183 Miscellaneous %define and %code cleanup.
4184 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
4185 values are interpreted.
4186 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
4187 documentation a little more.
4188 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
4189 muscle_percent_define_insert, muscle_percent_code_grow): New
4191 * src/muscle_tab.h (muscle_percent_define_insert,
4192 muscle_percent_code_grow): Prototype.
4193 * src/parse-gram.y (prologue_declaration): Use
4194 muscle_percent_define_insert and muscle_percent_code_grow when parsing
4195 %define and %code directives.
4197 Make it easy to share %define boolean variables between the front-end
4198 and back-end. Though not used yet, this will be useful in the future.
4199 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
4200 Bison uses of names rather than just skeleton uses of names.
4201 (b4_percent_define_get, b4_percent_define_ifdef): Rename
4202 b4_percent_define_skeleton_variables(VARIABLE) to
4203 b4_percent_define_bison_variables(VARIABLE).
4204 (b4_percent_code_get, b4_percent_code_ifdef): Rename
4205 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
4206 b4_percent_code_bison_qualifiers(QUALIFIER).
4207 (b4_check_user_names_wrap): Update for renames.
4208 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
4209 muscle_percent_define_default): New functions mimicking
4210 b4_percent_define_flag_if and b4_percent_define_default.
4212 For %define variables, report locations for invalid values and
4214 * data/bison.m4 (b4_percent_define_flag_if): Read
4215 b4_percent_define_loc(VARIABLE) to report the location of an invalid
4217 (b4_percent_define_default): Save a special location in
4218 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
4219 must later be reported as invalid.
4220 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
4222 (muscle_percent_define_insert): Record the location of VARIABLE in
4223 muscle percent_define_loc(VARIABLE), and use it to report the previous
4224 location for a redefinition.
4225 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
4226 (muscle_percent_define_default): Update like b4_percent_define_default.
4227 (muscle_grow_user_name_list): Rename to...
4228 (muscle_user_name_list_grow): ... this for consistency and use
4229 muscle_location_grow.
4230 * src/muscle_tab.h (muscle_location_grow): Prototype.
4231 * tests/input.at (%define errors): Update expected output.
4232 * tests/skeletons.at (%define boolean variables: invalid skeleton
4233 defaults): New test case.
4235 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
4237 * src/print.c (lookahead_set, state_default_rule): Remove.
4238 (print_reductions): Replace state_default_rule invocation with
4239 equivalent use of yydefact, which was computed in token_actions in
4241 (print_results): Don't allocate lookahead_set.
4243 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
4245 * data/lalr1.java: Prefix all private members with yy.
4247 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
4249 Use YYFPRINTF instead of fprintf where appropriate. Reported by
4250 Sebastien Fricker at
4251 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
4252 * THANKS: Add Sebastien Fricker.
4253 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
4254 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
4255 accept a variable number of arguments.
4257 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
4259 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
4261 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4263 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
4264 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
4265 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
4267 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
4269 Undo my 2007-02-07 change, switching back to the c-strcase module
4270 introduced in the 2007-02-03 change. Bruno Haible reported that
4271 the 2007-02-07 change would be dangerous in Turkish if we add a
4272 language whose name contains "i", since "i" is not lowercase "I"
4274 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
4275 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
4276 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
4277 * m4/.cvsignore: Remove strcase.m4.
4278 * src/getargs.c: Revert 2007-02-07 change, as follows.
4279 Include c-strcase.h.
4280 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
4282 2007-02-11 Bruno Haible <bruno@clisp.org>
4284 Enable the Java related testsuite tests when the only Java compiler
4285 found is a gcj < 4.3. Discussed at
4286 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
4287 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
4289 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
4291 * data/Makefile.am: Update copyright date.
4292 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
4293 yypstate_new returns NULL.
4294 (yypstate_new): Return NULL if malloc does.
4295 * src/reader.c (packgram): Move translation of rule actions from the
4296 beginning of packgram to...
4297 (check_and_convert_grammar): ... here right before packgram is invoked
4298 so it's easier to write more complete comments, and remove redundant
4301 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
4303 As in semantic actions, make @$ in %initial-action, %destructor, and
4304 %printer imply %locations.
4305 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
4307 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
4308 (@$ in %initial-action implies %locations,
4309 @$ in %destructor implies %locations,
4310 @$ in %printer implies %locations): ... these new test cases.
4312 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
4314 Undo most of the 2007-02-03 change, switching to the strcase module
4315 now that gnulib strcase has been fixed.
4316 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
4317 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
4318 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
4319 * m4/.cvsignore: Add strcase.m4.
4320 * src/getargs.c: Revert 2007-02-03 change, as follows.
4321 Don't include c-strcase.h.
4322 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
4323 strcasecmp has "unspecified behavior" outside the POSIX locale,
4324 but it works fine in practice if at least one argument is ASCII,
4325 as is the case in Bison.
4327 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
4329 * tests/java.at: Skip tests if only one of javac/java is present.
4330 Reported by Joel E. Denny.
4331 * tests/atlocal.in: Adjust copyright years.
4333 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
4335 * data/lalr1.java (Stack): Work around old verifiers that disallow
4336 access to the private fields of an inner class, from the outer class.
4337 We can make Stack's fields public because user code doesn't have access
4338 to the instance of Stack used by parse(). Reported by Paul Eggert.
4340 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
4342 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
4343 the right spot for these files?
4344 * bootstrap.conf (gnulib_modules): Add c-strcase.
4345 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
4347 * src/getargs.c: Include c-strcase.h.
4348 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
4349 to avoid unspecified behavior.
4351 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
4353 * doc/bison.texinfo (Decl Summary): Correct typo.
4355 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
4357 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
4358 Complain if the value does not match empty, "true" or "false".
4359 * data/c++.m4: Adjust default definitions of %define variables.
4360 * data/java.m4: Adjust default definitions of %define variables.
4361 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
4363 * tests/input.at (Boolean %define variables): Test new behavior.
4365 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
4367 * NEWS: Mention java.
4368 * TODO: Remove things that are done.
4369 * bootstrap.conf: Add javacomp-script and javaexec-script.
4370 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
4372 * data/Makefile.am: Add new files.
4373 * data/java-skel.m4: New.
4374 * data/java.m4: New.
4375 * data/lalr1.java: New.
4377 * doc/bison.texinfo: Put "A Complete C++ Example" under
4378 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
4379 under Other Languages.
4381 * src/getargs.c (valid_languages): Add Java.
4382 * src/getargs.h (struct bison_language): Update size of string fields.
4384 * tests/Makefile.am: Add java.at.
4385 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
4386 * tests/java.at: New.
4387 * tests/testsuite.at: Include it.
4389 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
4392 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
4393 at_directive_argv arguments so these no longer have to be global
4394 variables. Also, update the implementation for the following changes.
4395 (fail_for_at_directive_too_many_args,
4396 fail_for_at_directive_too_few_args): Add at_directive_name argument.
4397 (at_directive_name): Remove as at_directive_argv[0] will be used for
4399 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
4400 for the directive name.
4401 (at_directive_argc, at_directive_argv): Make these local within
4402 skel_lex instead of global.
4403 (INITIAL): Update directive start action for above changes.
4404 (SC_AT_DIRECTIVE_ARG): Rename to...
4405 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
4406 (SC_AT_DIRECTIVE_SKIP_WS): Update.
4407 (scan_skel): Move yylex_destroy to...
4408 (skel_scanner_free): ... here.
4409 * tests/skeletons.at (installed skeleton file name): Rename to...
4410 (installed skeleton file names): ... this.
4412 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
4414 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
4415 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
4416 Summary" not "Directives".
4417 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
4418 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
4419 since the former is now the more complete one.
4420 (Prologue Alternatives): Likewise and do the same for %defines.
4421 (Table of Symbols): Add summary of %code, add summary of %define, and
4422 move full %code documentation to...
4423 (Decl Summary): ... here for consistency with other entries in these
4425 Move %define entry in order to keep this list alphabetized.
4426 Reword %define entry a little to put less emphasis on the skeleton
4427 concept, which most users shouldn't have to think about.
4429 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
4431 Adjust to recent gnulib changes.
4432 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
4433 Add string.h, string_.h, unistd_.h, wchar_.h.
4434 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
4435 * src/system.h: Don't include <stpcpy.h>; this is now done by
4438 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
4440 Simplify implementation of unqualified %code, implement macros for
4441 uniform treatment of boolean %define flags. Document %define.
4442 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
4443 b4_percent_code_ifdef): New.
4444 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
4445 * data/c++.m4: Define default value for global_tokens_and_yystype.
4446 * data/glr.cc: Likewise.
4447 * data/location.cc: Use b4_percent_define_flag_if.
4449 * doc/bison.texinfo (Decl Summary): Document %define.
4451 * src/parse-gram.y (Unqualified %code): Change muscle name to
4453 (content.opt): Default to empty.
4455 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
4457 Implement support for relative and absolute skeleton file names.
4458 Discussed starting at
4459 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
4460 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
4461 (Bison Options): Document in --skeleton entry.
4462 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
4463 full_skeleton can't necessarily hold all of pkgdatadir.
4464 If the specified skeleton file name contains a `/', don't prepend
4466 * src/parse-gram.y (prologue_declaration): If the specified skeleton
4467 file name contains a `/', prepend the grammar file directory.
4468 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
4469 * skeletons.at: New file.
4470 (relative skeleton file names): New test case.
4471 (installed skeleton file names): New test case.
4472 * tests/testsuite.at: Include skeletons.at.
4474 * bootstrap: Update copyright to 2007.
4476 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
4478 * bootstrap: Remove occurrences of .#bootmp from the files.
4480 2007-01-17 Akim Demaille <akim@epita.fr>
4482 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
4484 Use per-type %printer.
4486 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
4488 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
4489 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4490 djgpp/config.site, src/files.c, src/files.h, src/main.c,
4491 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
4492 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
4493 tests/glr-regression.at, tests/input.at, tests/local.at,
4494 tests/output.at, tests/torture.at: Update copyright to 2007.
4496 2007-01-16 Akim Demaille <akim@epita.fr>
4498 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
4500 (Calc++ Scanner): Exit with failure if we can't open the input
4502 Accept "-" standing for stdin.
4503 (Calc++ Top Level): Print the result only if the parsing was
4506 2007-01-16 Akim Demaille <akim@epita.fr>
4508 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
4510 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
4511 and Joel E. Denny <jdenny@ces.clemson.edu>
4513 Clean up %define and %code implementation in M4 some. Most
4514 importantly, rename all related macros to be in the b4_percent_define
4515 and b4_percent_code namespaces. Also, complete support for `.' in
4516 %define variable names and %code qualifiers.
4517 * data/bison.m4 (b4_check_user_names): Check for special
4518 "SKELETON-NAMESPACE(name)" macros instead of using two nested
4520 (b4_get_percent_define, b4_get_percent_code): Rename to...
4521 (b4_percent_define_get, b4_percent_code_get): ... these.
4522 Extend documentation with examples.
4523 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
4524 b4_percent_define_skeleton_variables and
4525 b4_percent_code_skeleton_qualifiers.
4526 Expect any value for the %define variable `foo' to be stored in the
4527 macro named `b4_percent_define(foo)'; expect any %code blocks for the
4528 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
4529 expect any unqualified %code blocks to be stored in a macro named
4530 `b4_percent_code_unqualified'.
4531 Use m4_indir so that %define variable names and %code qualifiers can
4532 contain `.', which is allowed by the grammar parser.
4533 (b4_percent_define_default): New macro to set a default value for a
4535 (m4_wrap): Update wrapped code, and fix some underquoting.
4536 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
4537 Expect grammar uses of %define variables and %code qualifiers to be
4538 defined in b4_percent_define_user_variables and
4539 b4_percent_code_user_qualifiers.
4540 * data/c++.m4: Use b4_percent_define_default rather than
4541 m4_define_default. Fix some underquoting. Skeleton usage of %define
4542 variable define_location_comparison now implies skeleton usage of
4543 %define variable filename_type.
4544 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4545 data/push.c, data/yacc.c: Update macro names.
4546 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
4549 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4551 DJGPP specific issues.
4553 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
4554 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
4556 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4558 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
4559 run parsers in all tests so that Valgrind is invoked during
4560 maintainer-check-valgrind.
4561 (Duplicate representation of merged trees): Free all semantic values.
4562 (Duplicated user destructor for lookahead): Likewise.
4564 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4566 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
4567 command-line prefix.
4568 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
4569 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
4570 miss Valgrind messages.
4571 (Exploding the Stack Size with Malloc): Likewise.
4573 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4575 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
4576 locals. Reported by Juan Manuel Guerrero at
4577 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
4578 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
4579 Fix some indentation also.
4580 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
4581 explaining this issue.
4583 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
4584 and Joel E. Denny <jdenny@ces.clemson.edu>
4586 Simplify union and prologue handling, and escape union and lex/parse
4587 params with digraphs.
4588 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
4589 values to the empty string since these are no longer guaranteed
4590 initialized by the front-end.
4591 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
4592 braces around b4_user_stype since this is no longer done by the
4594 * src/files.c, src/files.h (pre_prologue_obstack,
4595 post_prologue_obstack): Remove.
4596 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
4597 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
4598 with digraphs. This fixes lex params and parse params.
4599 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
4600 * src/output.c (prepare): Remove muscle insertion of the prologues.
4601 (output): Remove freeing of pre_prologue_obstack and
4602 post_prologue_obstack.
4603 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
4604 than prologue_augment for prologue parsing so you don't need prologue
4606 (grammar_declaration): For %union RHS, use `braceless' instead of
4607 "{...}" so that braces are already stripped and code is escaped with
4609 * src/reader.c (prologue_augment): Remove.
4610 (reader): Remove initialization of pre_prologue_obstack and
4611 post_prologue_obstack.
4612 * src/reader.h (prologue_augment): Remove.
4614 * data/c.m4: Remove stray parenthesis.
4616 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4618 Remove quotes from variables names in %define directives and from
4619 qualifiers in %code directives, and restrict the characters that are
4620 allowed in them to M4-friendly ones. For %define, continue to support
4621 the quoted form as a deprecated feature. Discussed starting at
4622 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
4623 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
4625 * doc/bison.texinfo (Prologue Alternatives): Update.
4626 (Decl Summary): In %defines entry, update mention of `%code requires'
4627 and `%code provides'.
4628 (C++ Location Values): Update %define uses.
4629 (Calc++ Parser Interface): Likewise.
4630 (Calc++ Parser): Likewise, and update `%code requires' uses.
4631 (Table of Symbols): Update %code documentation.
4632 * src/parse-gram.y (prologue_declaration): For %define variables, use
4633 `variable' instead of `STRING'.
4634 (grammar_declaration): For %code qualifiers, use `ID' instead of
4636 (variable): New nonterminal that takes an `ID' or a `STRING'.
4637 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
4639 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
4640 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
4641 (%define errors): Update %define uses.
4643 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4645 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
4646 instead of muscle_insert for %define values so that M4-special
4647 characters are replaced with digraphs.
4648 * tests/input.at (%define errors): Extend to check weird values.
4650 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4652 Instead of having skeletons declare all valid %define variables and
4653 %code qualifiers, provide macros that retrieve the associated values
4654 and build these lists automatically. Thus Bison will now warn when a
4655 variable or qualifier is not used by the skeleton in the current
4656 invocation regardless of whether it might sometimes be used by that
4657 skeleton in other invocations. Also, move all %define value macros to
4658 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
4659 form, which is replaced by %code.
4660 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
4661 (b4_check_user_names): ... this, and change the series of valid name
4662 arguments to a single list argument for names used in the skeleton
4663 similar to the existing list argument for names used in the grammar.
4664 Warn instead of complaining.
4665 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
4666 values and %code code, to format %code code properly, and to build
4667 lists of all %define variables and %code qualifiers used in the
4668 skeleton: b4_skeleton_percent_define_variables and
4669 b4_skeleton_percent_code_qualifiers.
4670 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
4672 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
4673 the skeleton names lists can finish building first. In place of
4674 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
4675 expect the lists b4_user_percent_define_variables and
4676 b4_user_percent_code_qualifiers.
4677 * data/c++.m4: Where setting default values for b4_parser_class_name,
4678 b4_location_type, b4_filename_type, b4_namespace, and
4679 b4_define_location_comparison, update their names to the
4680 b4_percent_define_ namespace.
4681 * data/glr.c: Don't use b4_check_percent_define_variables and
4682 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
4683 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
4684 (b4_parser_class_name, b4_namespace): Define these using
4685 b4_get_percent_define for parser_class_name and namespace.
4686 * data/location.cc: Use b4_get_percent_define.
4687 * data/push.c: Don't use b4_check_percent_define_variables and
4688 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
4689 * data/yacc.c: Likewise, and don't call m4_exit in
4690 b4_use_push_for_pull_if or m4_wrap code will never execute.
4691 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
4693 (muscle_grow_user_name_list): ... this for consistency with the
4694 terminology used in bison.m4.
4695 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
4696 %define variable names, and rename muscle used_percent_define_variables
4697 to user_percent_define_variables.
4698 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
4699 user_percent_code_qualifiers.
4701 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
4702 {CODE} form is no longer accepted.
4703 * tests/input.at (Reject bad %code qualifiers): Rename to...
4704 (Reject unused %code qualifiers): ... this, and update test output.
4705 (%define error): Update test output.
4707 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
4709 Check for unrecognized %define variables similar to checking for
4710 unrecognized %code qualifiers. Check for redefined %define variables.
4711 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
4713 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
4714 (b4_check_percent_define_variables): New, also wraps it.
4715 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
4716 variables using b4_check_percent_define_variables.
4717 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
4718 all those exercised in the test suite and all those listed in the
4719 `Default values' section of c++.m4. Are there others?
4720 * data/push.c, data/yacc.c: Declare no valid %define variables.
4721 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
4722 similar to muscle_find, but it works even when the muscle stores a
4724 (muscle_grow_used_name_list): New function for constructing the used
4725 name list muscles that b4_check_for_unrecognized_names requires.
4726 * src/parse-gram.y (prologue_declaration): Warn if a variable is
4727 %define'd more than once. Define the b4_used_percent_define_variables
4728 muscle with muscle_grow_used_name_list.
4729 (grammar_declaration): Abbreviate %code code with
4730 muscle_grow_used_name_list.
4731 * tests/input.at (%define errors): New.
4733 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4735 Provide warn_at, complain_at, and fatal_at function callbacks to the
4736 skeletons, and use this for %code qualifier complaints.
4737 * data/bison.m4 (b4_error_at): New, invoked by...
4738 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
4739 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
4740 @fatal_at(...@) directives.
4741 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
4742 qualifiers in b4_used_percent_code_qualifiers and to use
4744 * src/location.c, src/location.h (boundary_set_from_string): New global
4746 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
4748 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
4749 to b4_used_percent_code_qualifiers.
4750 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
4752 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
4753 (lineno): Rename to...
4754 (out_lineno): ... this so I don't misunderstand it again.
4755 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
4756 here; these newlines are in the input but not the output file.
4757 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
4758 (at_directive_perform): ... this new static function, and add handling
4759 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
4761 * tests/input.at (Reject bad %code qualifiers): Update test output with
4762 locations and extend.
4764 * tests/output.at (Output file name: [, Output file name: ]): Remove
4765 bogus comment about these tests failing.
4767 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4769 Clean up b4_check_percent_code_qualifiers a little.
4770 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
4771 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
4772 documentation and add examples.
4773 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
4776 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
4778 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
4779 unreliable -- especially when they're hidden inside another macro.
4780 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
4781 data/c.m4: Remove m4_divert(-1).
4782 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4783 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
4784 m4_divert_push(0) and m4_divert_pop(0).
4785 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
4786 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
4787 pushed and popped by m4sugar, should be first on the stack.
4789 Provide warn, complain, and fatal function callbacks to the skeletons.
4790 This provides more flexibility than m4_fatal, improves the error
4791 message format, and captures messages for translation. Discussed
4793 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
4794 * data/bison.m4 (b4_error): New, invoked by...
4795 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
4796 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
4797 directives. Because these M4 macros might be called when the current
4798 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
4799 the previous removal of uses of m4_divert, which caused trouble.
4800 (b4_check_percent_code_qualifiers): Use b4_complain instead of
4801 m4_fatal to report unrecognized %code qualifiers.
4802 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
4803 push parser requests.
4804 * data/glr.c: Use b4_complain instead of m4_fatal to report
4805 non-deterministic push parser requests.
4806 Update @output usage to @output(...@) form.
4807 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
4808 report missing %defines. Update @output usage to @output(...@) form.
4809 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
4811 * src/main.c (main): Invoke skel_scanner_free.
4812 * src/scan-skel.h (skel_scanner_free): Prototype new function.
4813 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
4814 obstack_for_string from flex-scanner.h.
4815 (YY_DECL): Use to declare skel_lex static.
4816 (decode_at_digraphs): Remove; now handled in the new
4817 SC_AT_DIRECTIVE_ARG start condition.
4818 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
4820 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
4821 at_directive_argv): New static globals.
4822 (INITIAL): Use fail_for_invalid_at.
4823 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
4824 recognize the start of a generalized `@directive(...@)' form and
4826 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
4827 directive args (using the new obstack_for_string), to decode the
4828 contained @ diagraphs, and to perform the directive. It recognizes
4829 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
4831 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
4832 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
4834 (scan_skel): Initialize obstack_for_string on the first call.
4835 (skel_scanner_free): New function to free obstack_for_string.
4836 * tests/input.at (Reject bad %code qualifiers): Update test output.
4838 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
4840 Consolidate the 4 prologue alternative directives (%code, %requires,
4841 %provides, and %code-top) into a single %code directive with an
4842 optional qualifier field. Discussed at
4843 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
4844 * NEWS (2.3a+): Rewrite the existing entry for the prologue
4846 * doc/bison.texinfo (Prologue Alternatives): Update.
4847 (Decl Summary): Update to %code "requires" and %code "provides".
4848 (Calc++ Parser): Update to %code "requires".
4849 (Table of Symbols): Remove entries for %requires, %provides, and
4850 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
4851 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
4852 are replaced by b4_percent_code_provides and b4_percent_code_requires,
4853 which are skeleton-specific.
4854 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
4855 declare what %code qualifiers it supports and to complain if any other
4856 qualifiers were used in the grammar.
4857 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
4858 and b4_user_code([b4_percent_code_provides]) in place of
4859 b4_user_requires and b4_user_provides.
4860 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
4861 Add b4_user_code([b4_percent_code_top]) and
4862 b4_user_code([b4_percent_code]).
4863 Invoke b4_check_percent_code_qualifiers.
4864 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
4865 PERCENT_REQUIRES): Remove.
4866 (grammar_declaration): Remove RHS's for %code-top, %provides, and
4867 %requires. Rewrite the %code RHS as the unqualified form defining the
4868 muscle b4_percent_code. Add another RHS for the qualified %code form,
4869 which defines muscles of the form b4_percent_code_QUALIFIER and the
4870 b4_used_percent_code_qualifiers muscle.
4871 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
4872 PERCENT_REQUIRES): Remove.
4873 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
4874 %code "requires" and %code "provides".
4875 * tests/input.at (Reject bad %code qualifiers): New.
4877 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
4879 Use the new code_props interface for destructors and printers.
4880 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
4881 printer_location members, and change the type of the destructor and
4882 printer members to code_props.
4883 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
4884 symbol_printer_get, semantic_type_destructor_set,
4885 semantic_type_printer_set, default_tagged_destructor_set,
4886 default_tagless_destructor_set, default_tagged_printer_set,
4887 default_tagless_printer_set): Use code_props in arguments and return
4888 types in place of char const * and location.
4889 (symbol_destructor_location_get, symbol_printer_location_get): Remove
4890 since the locations are now contained in the return of
4891 symbol_destructor_get and symbol_printer_get.
4892 * src/output.c (symbol_destructors_output, symbol_printers_output):
4894 (symbol_code_props_output): ... this to eliminate duplicate code.
4895 (output_skeleton): Update to use symbol_code_props_output.
4896 * src/reader.c (symbol_should_be_used): Update use of
4897 symbol_destructor_get.
4898 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
4899 Update uses of the various _destructor_set and _printer_set functions.
4900 * src/symtab.c: (default_tagged_destructor_location,
4901 default_tagless_destructor_location, default_tagged_printer_location,
4902 default_tagless_printer_location): Remove since we...
4903 (default_tagged_destructor, default_tagless_destructor,
4904 default_tagged_printer, default_tagless_printer): ... change the type
4905 of these to code_props.
4906 (symbol_new, semantic_type_new, symbol_destructor_set,
4907 semantic_type_destructor_set, symbol_destructor_get,
4908 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
4909 symbol_check_alias_consistency, default_tagged_destructor_set,
4910 default_tagless_destructor_set, default_tagged_printer_set,
4911 default_tagless_printer_set): Update.
4912 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
4913 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
4915 (symbol_print): Use SYMBOL_CODE_PRINT.
4917 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
4919 Use the new code_props interface for rule actions.
4920 * src/symlist.h (symbol_list): Replace action, action_location, and
4921 used members with a code_props action_props member.
4922 * src/reader.c (symbol_should_be_used, grammar_rule_check,
4923 grammar_midrule_action, grammar_current_rule_merge_set,
4924 grammar_current_rule_symbol_append, packgram): Update.
4925 * src/scan-code.h (translate_rule_action): Remove, no longer used.
4926 * src/scan-code.l (handle_action_dollar): Update.
4927 (translate_rule_action): Remove, no longer used.
4928 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
4930 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4932 Use the new code_props interface in parse-gram.y.
4933 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
4934 Update all uses of translate_* functions to use the new code_props
4935 interface and to use gram_scanner_last_string_free and
4936 code_scanner_last_string_free where possible.
4937 (grammar_declaration): symbol_list_destructor_set and
4938 symbol_list_printer_set now perform the translation, so don't do it
4939 here. Use gram_scanner_last_string_free where possible.
4940 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
4941 translate_code): Remove, no longer used.
4942 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
4943 symbol_list_printer_set): Perform code translation here rather than
4944 depending on the caller to do so.
4946 * src/symlist.h (struct symbol_list): Correct some documentation typos.
4947 * src/scan-gram.h (gram_last_string): Remove declaration.
4948 * src/scan-gram.l (last_string): Declare it static.
4950 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4952 Encapsulate code properties and related functionality for the various
4953 destructors, printers, and actions into a code_props structure and
4954 interface. This patch merely implements code_props in scan-code.h and
4955 scan-code.l. Future patches will rewrite other modules to use it.
4956 Discussed starting at
4957 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
4958 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
4959 consistently initialize const structs that have an empty location
4961 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
4962 to ensure consistency.
4963 * src/scan-code.h (code_props): New structure.
4964 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
4965 function, macro, and const global variable for initializing a
4966 code_props with no code.
4967 (code_props_plain_init, code_props_symbol_action_init,
4968 code_props_rule_action_init, code_props_translate_code): The rest of
4969 the new code_props functional interface. Among other things, the init
4970 functions set the code_props kind field so that
4971 code_props_translate_code will know whether to behave like
4972 translate_symbol_action, translate_rule_action, or translate_code.
4973 These old translate functions must remain until all other modules are
4974 updated to use the new code_props interface.
4975 (code_scanner_last_string_free): New function similar to
4976 gram_scanner_last_string_free.
4977 (code_scanner_free): Add documentation.
4978 * src/scan-code.l: Implement the new interface.
4979 (code_lex): Make it static, add a code_props* argument, and remove the
4981 (last_string): New static global similar to the one in scan-gram.l.
4982 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
4984 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
4985 code_props since Bison may one day use this information for destructors
4987 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
4988 (handle_action_dollar): Use symbol_list_n_get and set used flag
4989 directly since symbol_list_n_used_set is removed.
4990 (translate_action): Add a code_props* argument and remove the rule,
4991 action, and location arguments. Pass the code_props* on to code_lex.
4992 (translate_rule_action, translate_symbol_action, translate_code):
4993 Rewrite as wrappers around the new code_props interface.
4994 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
4995 it would eventually need to break the encapsulation of code_props.
4997 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
4999 * etc/.cvsignore: New.
5001 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5003 Add maintainer-push-check to run maintainer-check using push parsing in
5004 place of pull parsing where available.
5005 * Makefile.am (maintainer-push-check): New.
5006 * data/bison.m4 (b4_use_push_for_pull_if): New.
5007 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
5008 appropriately based on their existing values.
5009 (yypush_parse): Don't print push-parser-specific diagnostics if push
5010 parsing is being used in place of pull parsing.
5011 * data/yacc.c: If push parsing should replace pull parsing, redirect to
5013 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
5014 variable, and insert b4_use_push_for_pull_flag into muscles.
5015 * tests/Makefile.am (maintainer-push-check): New.
5017 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5019 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
5020 (whether successful or failed) so that yypush_parse can be invoked
5021 again to start a new parse using the same yypstate.
5022 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
5023 check multiple yypull_parse invocations on the same yypstate. For pull
5024 mode, extend to check multiple yyparse invocations.
5025 (Exploding the Stack Size with Alloca): Extend to try with
5027 (Exploding the Stack Size with Malloc): Likewise.
5029 * tests/calc.at (Simple LALR Calculator): Don't specify
5030 %skeleton "push.c" since %push-pull-parser implies that now.
5031 * tests/headers.at (export YYLTYPE): Don't check for the push
5032 declarations. Otherwise, this test case can't be used to see if push
5033 mode can truly emulate pull mode.
5034 * tests/input.at (Torturing the Scanner): Likewise.
5035 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
5036 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
5037 AT_YACC_IF, which now includes the case of push mode since %skeleton
5038 need not be used for push mode. This will be more intuitive once
5039 push.c is renamed to yacc.c.
5041 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5043 For push mode, convert yyparse from a macro to a function, invoke yylex
5044 instead of passing a yylexp argument to yypull_parse, and don't
5045 generate yypull_parse or yyparse unless %push-pull-parser is declared.
5046 Discussed starting at
5047 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
5048 * data/bison.m4 (b4_pull_if): New.
5049 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
5050 * data/push.c: Improve M4 quoting a little.
5051 (b4_generate_macro_args, b4_parenthesize): Remove.
5052 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
5053 any time a pull parser is requested.
5054 Don't #define this as a wrapper around yypull_parse. Instead, when
5055 both push and pull are requested, make it a function that does that
5057 (yypull_parse): If there's a b4_prefix, #define this to
5058 b4_prefix[pull_parse] when both push and pull are requested.
5059 Don't define this as a function unless both push and pull are
5061 Remove the yylexp argument and hard-code yylex invocation instead.
5062 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
5064 * src/getargs.c (pull_parser): New global initialized to true.
5065 * getargs.h (pull_parser): extern it.
5066 * src/output.c (prepare): Insert pull_flag muscle.
5067 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
5068 (prologue_declaration): Set both push_parser and pull_parser = true for
5069 %push-pull-parser. Set push_parser = true and pull_parser = false for
5071 * src/scan-gram.l: Don't accept %push_parser as an alternative to
5072 %push-parser since there's no backward-compatibility concern here.
5073 Scan %push-pull-parser.
5074 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
5075 instead of %push-parser.
5076 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
5077 prototype it in the module that calls yyparse.
5078 * tests/input.at (Torturing the Scanner): Likewise.
5079 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
5081 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
5083 Update etc/bench.pl. Optimize push mode a little (the yyn change
5084 deserves most of the credit).
5085 * Makefile.am (SUBDIRS): Add etc subdirectory.
5086 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
5087 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
5088 yytoken, yyval, and yyloc declarations to...
5089 (yyparse or yypush_parse): ... here to improve performance. For
5090 yypush_parse invocations after the first, be sure to assign yyn its old
5092 (yypstate_new): Don't bother initializing the yyresult field since the
5093 initial value isn't used.
5094 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
5095 remove the #define that, in push mode, set it to yyps->NAME.
5096 * etc/Makefile.am: New.
5097 * etc/bench.pl: Remove and build it instead from...
5098 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
5099 "tests/bison" from the build directory by default rather than just
5100 invoking "bison" from $PATH.
5101 (calc_grammar): Update push parser code: don't declare yylval globally,
5102 don't define yyparse_wrapper, and don't #define yyparse.
5103 (bench_grammar): Update to check all working combinations of yacc.c,
5104 push.c, impure, pure, pull, and push.
5106 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5108 For push mode, add pull wrappers around yypush_parse.
5109 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
5110 (yypull_parse): New function wrapping yypush_parse.
5111 (yyparse): New #define wrapping yypull_parse.
5112 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
5114 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
5115 prototype yylex in the module that calls yyparse, and don't prototype
5116 yyparse there. Otherwise, the yyparse expansion won't compile.
5117 * tests/input.at (Torturing the Scanner): Likewise.
5119 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5121 Enable push parsers to operate in impure mode. Thus, %push-parser no
5122 longer implies %pure-parser. The point of this change is to move
5123 towards being able to test the push parser code by running the entire
5124 test suite as if %push-parser had been declared.
5125 * data/push.c (yypush_parse): For impure mode, remove the
5126 yypushed_char, yypushed_val, and yypushed_loc arguments.
5127 Instead, declare these as local variables initialized to the global
5128 yychar, yylval, and yylloc.
5129 For the first yypush_parse invocation only, restore the initial values
5130 of these global variables when it's time to read a token since they
5131 have been overwritten.
5132 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
5134 * tests/calc.at (Simple LALR(1) Calculator): Always declare
5135 %pure-parser along with %push-parser since this test case was designed
5136 for pure push parsers.
5137 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
5138 (AT_YACC_OR_PUSH_IF): New.
5139 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
5140 add a note that it's still wrong for some cases (as it has been for a
5142 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
5143 %push-parser no longer implies %pure-parser.
5145 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5147 Remove some unnecessary differences between the pull parser code and
5148 the push parser code. This patch enables yynerrs in push mode.
5149 * data/push.c: Reformat M4 a little.
5150 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
5151 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
5152 because push mode is on. Instead, if pure mode is on, move yynerrs
5154 (b4_declare_parser_state_variables): ... here.
5155 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
5156 to yyps->NAME so it can be used in yypush_parse.
5157 (yypush_parse): Don't omit uses of yynerrs in push mode.
5159 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5161 Fix bug such that the first pushed token's value and location are
5162 sometimes overwritten (sometimes by %initial-action) before being used.
5163 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
5164 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
5165 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
5166 more closely mimic the pull parser logic.
5167 Don't copy the pushed token to yychar, yylval, and yylloc until it's
5168 time to read a token, which is after any initialization of yylval and
5170 (gottoken): Rename label to...
5171 (yyread_pushed_token): ... for clarity and to avoid infringing on the
5174 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5176 Rearrange initialization of the parser state variables so that the
5177 skeleton doesn't have to have a copy for pull mode and another for push
5178 mode. This patch also fixes at least a bug such that yylloc was not
5179 initialized (with b4_location_initial_line and
5180 b4_location_initial_column) upon calling yypush_parse. However, that
5181 initialization now overwrites the first token's location;
5182 %initial-action assigning @$ already did the same thing, and both bugs
5183 will be fixed in a later patch.
5184 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
5185 (b4_declare_parser_state_variables): Remove initialization of yytoken,
5186 yyss, yyvs, yyls, and yystacksize.
5187 (yypstate_new): Remove initialization of some yypstate fields: yystate,
5188 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
5190 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
5191 yyps->NAME so it can be used in yypush_parse.
5192 (yyparse or yypush_parse): For yypush_parse, don't print the
5193 "Starting parse" diagnostic for invocations after the first.
5194 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
5195 yypush_parse, only do it for the first invocation.
5196 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
5197 initialization to occur in yypush_parse but only on the first
5200 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5202 * data/push.c: Add CPP guards around push parser declarations in both
5203 the header and the code file.
5204 In the code file, move the push parser declarations to the same place
5205 they appear in the header file.
5206 Clean up the M4 some, especially the inconsistent underquoting in
5207 some b4_c_function_def and b4_c_function_decl uses.
5209 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5211 Encapsulate the push parser state variables into an M4 macro so the
5212 push skeleton doesn't have to list them again for pull mode's yyparse.
5213 For push mode, remove yypush_parse's local equivalents of these
5214 variables to eliminate unnecessary copying between the two sets at
5215 run-time. This patch also fixes at least a bug related to multiple
5216 %initial-action invocations in push mode.
5217 * data/push.c (b4_declare_parser_variables): Rename to...
5218 (b4_declare_scanner_communication_variables): ... this for clarity and
5220 (b4_declare_yyparse_variables): Remove and move its contents to the one
5221 spot where it was invoked.
5222 (b4_declare_parser_state_variables): New macro containing the parser
5223 state variables required by push mode.
5224 (struct yypstate): Replace all fields but yynew with
5225 b4_declare_parser_state_variables.
5226 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
5227 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
5228 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
5229 (yyparse or yypush_parse): For yyparse in pull mode, replace local
5230 parser state variable declarations with
5231 b4_declare_parser_state_variables.
5232 Don't initialize parser state variables when calling yypush_parse since
5233 yypstate_new already does that.
5234 Invoke the user's initial action only upon the first yypush_parse
5236 Remove all code that copies between the local parser state variables
5239 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5241 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
5242 prevent a name collision in a future patch where these names will
5243 sometimes be #define'd.
5244 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
5245 since it no longer has the same name as the existing argument.
5246 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
5248 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
5249 and Joel E. Denny <jdenny@ces.clemson.edu>
5251 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
5252 that the argument is case-insensitive, and there's no `=' here.
5253 For the %skeleton entry, mention that %language is better.
5254 (Bison Options): Likewise for --language and --skeleton. Move the
5255 --skeleton entry so that the `Tuning the parser' section is sorted
5256 alphabetically on long options.
5257 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
5258 %language directive in detail here; cross-reference the %language
5259 documentation instead.
5260 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
5261 `%require "2.3b"' so that the example is always up-to-date.
5262 (Table of Symbols): Add entries for %language and %skeleton.
5263 * examples/extexi (normalize): Instead of replacing every %require
5264 argument with the current Bison version, just substitute for
5265 `@value{VERSION}'. This guarantees that we're testing what actually
5266 appears in the documentation.
5267 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
5268 rather than `@VERSION@'.
5270 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5272 * NEWS: Reword the %language news a bit, and put it earlier.
5274 * src/getargs.c (skeleton_arg): Last arg is now location const *.
5275 Rewrite to simplify the logic.
5276 (language_argmatch): Likewise.
5277 (program_name): We now own this var.
5278 * src/getargs.h (struct bison_language): Use char[] rather than
5281 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
5283 * src/complain.c (program_name): Remove decl; no longer needed.
5284 * src/main.c (program_name): Remove; now belongs to getargs.
5286 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
5288 * NEWS: Document %language.
5290 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
5292 * data/c-skel.m4, data/c++-skel.m4: New files.
5293 * data/glr.c: Complain on push parsers.
5295 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
5297 (Decl Summary): Document %language and %skeleton.
5298 (Command line): Document -L.
5300 * examples/extexi: Rewrite %require directive.
5301 * examples/calc++/Makefile.am: Pass VERSION to extexi.
5303 * src/files.c (compute_exts_from_gc): Look in language structure
5305 (compute_file_name_parts): Check whether .tab should be added.
5306 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
5307 (language, skeleton_arg, language_argmatch): New.
5308 (long_options): Add --language.
5309 (getargs): Use skeleton_arg, add -L/--language.
5310 * src/getargs.h: Include location.h.
5311 (struct bison_language, language, skeleton_arg, language_argmatch): New.
5312 * src/output.c (prepare): Pick default skeleton from struct language.
5313 Don't dispatch C skeletons here.
5314 * src/parse-gram.y (PERCENT_LANGUAGE): New.
5315 (prologue_declaration): Add "%language" rule, use skeleton_arg.
5316 * src/scan-gram.l ("%language"): New rule.
5318 * tests/calc.at: Test %skeleton and %language.
5319 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
5320 (AT_GLR_IF): Look for %skeleton "glr.cc".
5321 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
5322 (AT_YACC_IF): Reject %language.
5324 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5326 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
5327 since it wasn't used; only the typedef name 'semantic_type' is needed.
5328 Also, omit trailing white space.
5330 * bootstrap: Sync from coreutils.
5331 (gnulib_extra_files): Add build-aux/announce.gen.
5332 (slurp): Adjust .gitignore files like .cvsignore files.
5333 * build-aux/announce-gen: Remove from CVS, since bootstrap
5336 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
5338 Make %push-parser imply %pure-parser. This fixes several bugs; see
5339 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
5340 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
5342 * data/push.c: Don't bother testing b4_push_if when deciding whether
5343 to expand b4_declare_parser_variables globally.
5344 (yypush_parse): Likewise in here.
5346 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
5347 (yy_reduce_print): Reformat M4 for readability.
5349 2006-12-15 Bob Rossi <bob@brasko.net>
5350 and Joel Denny <jdenny@ces.clemson.edu>
5352 * data/push.c (yypstate): Add typedef, and update all uses of
5353 struct yypstate to just yypstate.
5354 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
5356 2006-12-14 Bob Rossi <bob@brasko.net>
5358 * data/push.c (yypush_parse): Declare prototype regardless of
5361 2006-12-14 Bob Rossi <bob@brasko.net>
5363 * data/push.c (yyparse): Remove the prototype and the #define when in
5366 2006-12-13 Bob Rossi <bob@brasko.net>
5368 * data/push.c (yypstate_init): Rename to...
5369 (yypstate_new): ... this and use b4_c_function_def.
5370 (yypstate_delete): New.
5371 (yypush_parse): Change parameters yynval and yynlloc to be const.
5372 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
5373 yypstate_delete functions.
5375 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
5377 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
5378 strange test case titles. Reported by Bob Rossi.
5380 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
5382 * TODO: Add pointer to Sylvain Schmitz's work on static detection
5383 of potential ambiguities in GLR grammers.
5385 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
5387 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
5388 `bison ', use m4_index instead of m4_substr since chopping up a string
5389 containing M4-special characters causes problems here.
5391 Fix a couple of bugs related to special characters in user-specified
5392 file names, and make it easier for skeletons to compute output file
5393 names with the same file name prefix as Bison-computed output file
5395 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
5396 b4_parser_file_name and b4_spec_defines_file instead of
5397 @output_parser_name@ and @output_header_name@, which are now redundant.
5398 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
5399 b4_parser_file_name, b4_spec_defines_file, and the new
5400 @basename(FILENAME@) instead of @output_parser_name@ and
5401 @output_header_name@, which inappropriately escaped the file names as
5403 * src/files.c (all_but_ext): Remove static qualifier.
5404 (compute_output_file_names): Move `free (all_but_ext)' to...
5405 (output_file_names_free): ... here since all_but_ext is needed later.
5406 * src/files.h (all_but_ext): Extern.
5407 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
5408 exactly what MUSCLE_INSERT_STRING used to do.
5409 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
5410 characters are escaped properly.
5411 * src/output.c (prepare): Define muscle file_name_all_but_ext as
5413 For pkgdatadir muscle, maintain previous functionality by using
5414 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
5415 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
5416 digraphs would never be expanded. Hopefully no one has M4-special
5417 characters in his Bison installation path.
5418 * src/scan-skel.l: Don't parse @output_header_name@ and
5419 @output_parser_name@ anymore since they're now redundant.
5420 In @output, use decode_at_digraphs.
5421 Parse a new @basename command that invokes last_component.
5422 (decode_at_digraphs): New.
5423 (BASE_QPUTS): Remove unused.
5424 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
5425 (Output file name): New tests.
5427 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
5429 Warn about output files that are generated by the skeletons and that
5430 conflict with other output files.
5431 * data/glr.c: Don't generate the header file here when glr.cc does.
5432 * src/files.c (file_names, file_names_count): New static globals.
5433 (compute_output_file_names): Invoke output_file_name_check for files
5434 not generated by the skeletons and remove existing checks.
5435 (output_file_name_check): New function that warns about conflicting
5437 (output_file_names_free): Free file_names.
5438 * src/files.h (output_file_name_check): Declare.
5439 * src/scan-skel.l: Invoke output_file_name_check for files generated by
5441 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
5442 (Conflicting output files): New tests.
5444 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5446 * doc/bison.texinfo: Fix a couple of typos.
5448 2006-12-08 Bob Rossi <bob@brasko.net>
5450 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
5452 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
5454 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
5455 (yypush_parse): Rename yypvars argument to yyps and remove redundant
5457 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
5458 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
5460 2006-12-07 Bob Rossi <bob@brasko.net>
5461 and Joel Denny <jdenny@ces.clemson.edu>
5463 * data/push.c (yypvarsinit): Change return type from void* to struct
5464 yypvars*. No longer cast to void* on return.
5465 (struct yypvars): Remove yylen since it need not be remembered between
5466 yypushparse invocations.
5467 (yypushparse): Don't copy between yylen and pv->yylen.
5469 2006-12-05 Bob Rossi <bob@brasko.net>
5471 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
5472 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
5473 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
5474 (struct yypvars): Remove b4_declare_parser_variables.
5475 (yypvarsinit): Remove init code for removed variables.
5476 (global scope): Do not declare b4_declare_parser_variables if
5478 (yypushparse): Add b4_declare_parser_variables.
5479 Init new local variables, and remove init code for removed
5482 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
5483 and yyparse for other modes.
5484 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
5485 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
5486 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
5487 (AT_PURE_LEX_IF): True if pure or push parser.
5489 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
5491 Document Yacc prologue alternatives and default %destructor's and
5492 %printer's as experimental. Don't mention Java yet. Discussed at
5493 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
5494 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
5495 (2.3a): Annotate this entry to say the old forms of these features were
5497 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
5498 Table of Symbols): Say they're experimental. Comment out any mention
5499 of Java (we'll want this back eventually).
5501 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
5503 Support a file name argument to %defines. Deprecate `=' in
5504 %file-prefix, %name-prefix, and %output. Discussed at
5505 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
5506 * NEWS (2.3a+): Mention.
5507 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
5508 form of %defines, and remove `=' from entries for %file-prefix,
5509 %name-prefix, and %output.
5510 * src/parse-gram.y (prologue_declaration): Implement.
5511 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
5512 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
5513 all but one occurrence of %name-prefix.
5514 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
5515 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
5516 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
5517 occurrence of each of %file-prefix and %output. Add check for %defines
5519 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
5520 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
5521 Remove the `=' from %output.
5523 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
5525 Don't escape $ in test case titles since Autoconf 2.61 now does that
5527 * tests/actions.at (Default %printer and %destructor are not for error
5528 or $undefined): Here.
5529 (Default %printer and %destructor are not for $accept): Here.
5530 * tests/input.at (Invalid $n and @n): Here.
5532 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
5534 Rename <!> to <>. Discussed starting at
5535 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
5536 * NEWS (2.3a+): Update.
5537 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
5539 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
5540 * src/scan-gram.l (INITIAL): Implement.
5541 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
5542 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
5544 * tests/actions.at (Default tagless %printer and %destructor,
5545 Default tagged and per-type %printer and %destructor,
5546 Default %printer and %destructor are not for error or $undefined,
5547 Default %printer and %destructor are not for $accept,
5548 Default %printer and %destructor for mid-rule values): Update.
5549 * tests/input.at (Default %printer and %destructor redeclared,
5550 Unused values with default %destructor): Update.
5552 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
5554 Don't let %prec take a nonterminal.
5555 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
5557 * tests/input.at (%prec takes a token): New test checking that %prec
5558 won't take a nonterminal.
5560 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5562 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
5563 it was double-quoted.
5564 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
5565 grammar is maintained with Bison's highest standards.
5566 * src/getargs.c: Fix some typos in Doxygen comments.
5568 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5570 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
5571 later. Reported by Paul Eggert in
5572 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
5573 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
5574 * src/scan-code.l (translate_action): Don't bother invoking
5575 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
5576 (code_scanner_free): Instead of invoking
5577 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
5579 * src/scan-gram.l (gram_scanner_free): Likewise.
5580 * src/scan-skel.l (scan_skel): Likewise.
5582 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
5584 * src/files.c (tr): Change return type to void.
5585 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
5586 has been called previously for the same key.
5587 (muscle_find): Return storage instead of value so that
5588 --enable-gcc-warnings doesn't produce warnings that the return discards
5589 const. aver that the value and storage are the same since storage
5590 could potentially be NULL when value is not.
5591 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
5594 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
5596 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
5597 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
5598 us a slightly cleaner distribution, and also works.
5599 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
5602 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
5603 and Paul Eggert <eggert@cs.ucla.edu>
5605 Don't let Bison leak memory except when it complains.
5606 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
5607 (spec_defines_file, dir_prefix): Now char *, not const char *,
5608 since they are freed.
5609 * src/files.c: Likewise.
5610 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
5612 (tr): Now operates in-place. All uses changed.
5613 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
5615 (compute_file_name_parts, compute_output_file_names): Don't store
5616 read-only data in variables that will be freed.
5617 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
5618 src_extension, and header_extension.
5619 (output_file_names_free): New public function to free
5620 spec_verbose_file, spec_graph_file, spec_defines_file,
5621 parser_file_name, and dir_prefix.
5622 * src/getargs.c (getargs): Don't store read-only data in variables that
5624 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
5625 (which previously existed but was unused), and quotearg_free.
5626 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
5627 * src/muscle_tab.c: Likewise.
5628 (muscle_entry): Make the value char const *,
5629 and add a new storage member that is char * and can be freed.
5630 (muscle_entry_free): New private function.
5631 (muscle_init): Use it instead of free.
5632 (muscle_insert, muscle_grow): Update and use new storage member.
5633 (muscle_code_grow): Free the string passed to muscle_grow
5634 since it's not needed anymore.
5635 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
5636 add a new `char *code' member.
5637 ("{...}"): Declare semantic type as code.
5638 * src/scan-code.h (translate_rule_action):
5639 (translate_symbol_action, translate_code, translate_action): Return
5640 `char const *' rather than `char *' since external code should not free
5642 * src/scan-code.l: Likewise.
5643 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
5644 which is "{...}" in the parser.
5645 * tests/Makefile.am (maintainer-check-valgrind): Set
5646 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
5648 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
5650 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
5651 expecting a non-zero exit status sets --leak-check=summary and
5652 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
5653 this case, and we don't want to hear about it.
5655 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
5657 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
5658 instead of from the template, to simplify configuration a bit.
5659 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
5660 and m4/wint_t.m4, as they are needed with the latest gnulib.
5662 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5664 Disable unset/unused mid-rule value warnings by default, and recognize
5665 --warnings=midrule-values to enable them. Discussed starting at
5666 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
5667 * NEWS (2.3a+): Mention.
5668 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
5669 warnings): Add entry for midrule-values subargument.
5670 * src/reader.c (symbol_should_be_used): Don't return true just because
5671 the value is a set/used mid-rule value unless
5672 --warnings=midrule-values was specified.
5673 * tests/input.at (Unused values, Unused values before symbol
5674 declarations): Run tests with and without --warnings=midrule-values.
5676 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
5677 than LIST_FREE directly.
5679 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5681 Finish implementing --warnings=error, which should not be implied by
5682 --warnings=all (or by its synonyms -W and --warnings without
5684 * src/complain.c (set_warning_issued): New function to report that
5685 warnings are being treated as errors and to record an error if so.
5687 (warn_at, warn): ... here.
5688 * src/getargs.c (warnings_args, warnings_types): Reorder so that
5689 "error - warnings are errors" does not appear above "all - all of the
5691 (getargs): For -W and --warnings without subarguments, don't let
5692 FLAGS_ARGMATCH set warnings_error in warnings_flag.
5693 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
5695 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5697 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
5698 empty subargument list. For example: `bison --warnings= parser.y'.
5700 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5702 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
5703 the parser header file so that gcc doesn't warn.
5705 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5707 Split the default %destructor/%printer into two kinds: <*> and <!>.
5708 Discussed starting at
5709 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
5710 * NEWS (2.3a+): Mention.
5711 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
5712 previous change today related to mid-rules.
5713 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
5714 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
5715 (TYPE_TAG_ANY): Add as <*>.
5716 (TYPE_TAG_NONE): Add as <!>.
5717 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
5719 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
5720 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
5721 * src/symlist.c (symbol_list_default_new): Split into tagged and
5723 (symbol_list_destructor_set, symbol_list_printer_set): Split
5724 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
5725 SYMLIST_DEFAULT_TAGLESS.
5726 * src/symlist.h: Update symbol_list_default*_new prototypes.
5727 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
5728 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
5729 * src/symtab.c (default_destructor, default_destructor_location,
5730 default_printer, default_printer_location): Split each into tagged and
5732 (symbol_destructor_get, symbol_destructor_location_get,
5733 symbol_printer_get, symbol_printer_location_get): Implement tagged
5734 default and tagless default cases.
5735 (default_destructor_set, default_printer_set): Split each into tagged
5736 and tagless versions.
5737 * src/symtab.h: Update prototypes.
5738 * tests/actions.at (Default %printer and %destructor): Rename to...
5739 (Default tagless %printer and %destructor): ... this, and extend.
5740 (Per-type %printer and %destructor): Rename to...
5741 (Default tagged and per-type %printer and %destructor): ... this, and
5743 (Default %printer and %destructor for user-defined end token): Extend.
5744 (Default %printer and %destructor are not for error or $undefined):
5746 (Default %printer and %destructor are not for $accept): Update.
5747 (Default %printer and %destructor for mid-rule values): Extend.
5748 * tests/input.at (Default %printer and %destructor redeclared): Extend.
5749 (Unused values with default %destructor): Extend.
5751 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5753 Don't apply the default %destructor/%printer to an unreferenced midrule
5755 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
5756 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
5757 like $@n instead of just @n so that the default %destructor/%printer
5758 logic doesn't see them as user-defined symbols.
5759 (symbol_is_dummy): Check for both forms of the name.
5760 * src/reader.c (packgram): Remove the `$' from each midrule symbol
5761 name for which the midrule value is referenced in any action.
5762 * tests/actions.at (Default %printer and %destructor for mid-rule
5764 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
5765 for change to dummy symbol names.
5767 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
5769 Warn about unset midrule $$ if the corresponding $n is used.
5770 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
5772 (packgram): Before invoking grammar_rule_check on any rule, make sure
5773 all actions have already been scanned in order to set `used' flags.
5774 Otherwise, checking that a midrule's $$ is set will not always work
5775 properly because the midrule check must forward-reference the midrule's
5777 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
5780 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
5782 More improvements to the documentation of the prologue alternatives:
5783 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
5785 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
5786 some text to clarify the relative importance of the new directives and
5787 to show how these directives may be viewed as code labels.
5789 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
5791 Similar to the recently removed %before-header, add %code-top as the
5792 alternative to the pre-prologue. Mentioned at
5793 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
5794 Also, let the prologue alternatives appear in the grammar section.
5795 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
5796 (prologue_declaration): Move the existing prologue alternatives to...
5797 (grammar_declaration): ... here and add %code-top.
5798 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
5800 Clean up and extend documentation for the prologue alternatives.
5801 * NEWS (2.3a+): Describe prologue alternatives.
5802 * doc/bison.texinfo (Prologue): Move discussion of prologue
5804 (Prologue Alternatives): ... this new section, and extend it to discuss
5805 all 4 directives in detail.
5806 (Table of Symbols): Clean up discussion of prologue alternatives and
5809 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5811 DJGPP specific issues.
5813 * djgpp/config.bat: config.hin has been moved to lib. Adjust
5814 config.bat accordingly.
5815 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
5816 * djgpp/config.site: Likewise.
5818 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
5820 Replace %*-header with %provides, %requires, %code. See discussion at
5821 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
5823 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
5824 (b4_user_start_header): Remove.
5825 * data/glr.c: Use new macros instead of b4_*start_header
5827 * data/glr.cc: Likewise.
5828 * data/lalr1.cc: Likewise.
5829 * data/push.c: Likewise.
5830 * data/yacc.c: Likewise.
5832 * doc/bison.texinfo: Remove %before-header, rename
5833 %{start,end,after}-header to %requires, %provides, %code.
5835 * src/parse-gram.y: Likewise (also rename token names accordingly).
5836 * src/scan-gram.l: Likewise.
5837 * tests/actions.at: Likewise.
5839 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
5841 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
5842 Problem reported by Joel E. Denny.
5844 2006-10-14 Jim Meyering <jim@meyering.net>
5846 (Sync from coreutils.)
5847 Work also when the working directory (with e.g. coreutils sources)
5848 is version controlled with git, rather than CVS.
5849 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
5851 In messages and comments, say e.g., "checked-out sources",
5852 rather than "CVS sources".
5853 (version_controlled_file): New function. Work for git as well as
5854 for CVS. Don't use grep's -q option.
5855 (slurp): Call it here, in place of CVS-specific code.
5857 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
5859 Fix testsuite for ./configure --enable-gcc-warnings:
5860 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
5861 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
5862 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
5863 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
5864 * test/regression.at (Diagnostic that expects two alternatives):
5867 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
5869 * bootstrap.conf (gnulib_modules): Add config-h.
5870 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
5871 worry about HAVE_CONFIG_H.
5872 * lib/abitset.c: Likewise.
5873 * lib/bitset.c: Likewise.
5874 * lib/bitset_stats.c: Likewise.
5875 * lib/bitsetv-print.c: Likewise.
5876 * lib/bitsetv.c: Likewise.
5877 * lib/ebitset.c: Likewise.
5878 * lib/get-errno.c: Likewise.
5879 * lib/lbitset.c: Likewise.
5880 * lib/subpipe.c: Likewise.
5881 * lib/timevar.c: Likewise.
5882 * lib/vbitset.c: Likewise.
5883 * lib/bitset.c: Include "bitset.h" first, to test interface.
5884 * lib/bitset_stats.c: Include "bitset_stats.h" first.
5885 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
5886 * lib/bitsetv.c: Include "bitsetv.h" first.
5887 * lib/get-errno.c: Include "get-errno.h" first.
5888 * m4/.cvsignore: Add config-h.m4.
5889 * tests/actions.at (Default %printer and %destructor for ...):
5890 Adjust expected line numbers in output to reflect removal of #if
5891 HAVE_CONFIG_H lines.
5892 * tests/glr-regression.at (Missed %merge type warnings when ...):
5894 * tests/regression.at (Braced code in declaration in rules section):
5896 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
5897 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
5898 Include <config.h> unconditionally.
5900 * bootstrap: Sync from coreutils, as follows:
5902 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
5904 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
5905 variable was sometimes used without being initialized. This
5906 messed up the installation of the INSTALL file in some cases.
5908 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
5910 * bootstrap (usage, main program, symlink_to_gnulib): Add option
5911 --copy. Inspired by a suggestion from Bruno Haible.
5913 2006-10-03 Jim Meyering <jim@meyering.net>
5915 * bootstrap: Undo last change to this file, since now gnulib-tool
5916 sticks with the automake default in generating dependencies.
5918 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
5920 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
5921 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
5923 * doc/bison.1: Add copyright notice.
5925 * data/glr.c: Don't include <stdarg.h>; not used.
5927 * NEWS: The -g and --graph options now output graphs in Graphviz
5928 DOT format, not VCG format.
5929 * doc/bison.1: Likewise.
5930 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
5931 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
5933 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
5934 * TODO: Remove Graphviz entry.
5935 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
5936 remove vcg.c, vcg.h, vcg_defaults.h.
5937 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
5938 * src/graphviz.c, src/graphviz.h: New files.
5939 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
5940 * src/files.h: Make comment more generic.
5941 * src/main.c (main): Likewise.
5942 * src/print_graph.h: Likewise.
5943 * src/getargs.c (usage): Make usage description more generic.
5944 * src/print_graph.c: Include graphviz.h rather than vcg.h.
5945 (static_graph, fgraph): Remove. All uses changed to pass
5946 arguments instead of sharing a static var.
5947 (print_core, print_actions, print_state, print_graph):
5948 Output graphviz format rather than VCG format.
5949 * tests/.cvsignore: Remove *.vcg; add *.dot.
5950 * tests/output.at: Expect *.dot files, not *.vcg files.
5952 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
5953 accommodates the 2006-10-08 change.
5955 2006-10-11 Bob Rossi <bob@brasko.net>
5957 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
5958 (b4_yyssa, b4_yyerror_range): New macros.
5959 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
5960 (yypvarsinit): Remove init of removed fields.
5961 (yypushparse): Remove use of removed fields; use new macros instead.
5963 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
5965 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
5966 in a push parser. Reindent slightly to match yacc.c better.
5968 2006-10-11 Bob Rossi <bob@brasko.net>
5970 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
5972 (yypvarsinit, yypushparse): Remove init of removed fields.
5973 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
5975 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
5977 * THANKS: Add Paolo Bonzini and Bob Rossi.
5979 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
5981 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
5982 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
5983 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
5984 b4_define_user_cde and uses): Remove.
5985 (b4_comment, b4_prefix, b4_sync_start): New.
5986 * data/bison.m4: New file, with most of the content removed from c.m4.
5987 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
5988 * src/output.c (output_skeleton): Pass bison.m4.
5989 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
5992 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
5994 Fix test failure reported by Tom Lane in
5995 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
5996 and try to make such failures easier to catch in the future.
5997 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
5998 that's now the caller's responsibility.
5999 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
6000 Set yychar = YYEOF if it's negative.
6001 * tests/actions.at (yylex): Abort if asked to read past EOF.
6002 * tests/conflicts.at (yylex): Likewise.
6003 * tests/cxx-type.at (yylex): Likewise.
6004 * tests/glr-regression.at (yylex): Likewise.
6005 * tests/input.at (yylex): Likewise.
6006 * tests/regression.at (yylex): Likewise.
6007 * tests/torture.at (yylex): Likewise.
6009 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
6011 Fix problems with translating English-language diagnostics.
6012 * bootstrap: Fix bug introduced in recent bootstrap changes, with
6013 respect to bison-runtime pot generation. The YY_ stuff
6014 wasn't being captured.
6015 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
6016 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
6017 * runtime-po/POTFILES.in: Add data/push.c.
6019 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
6021 Merge bootstrap changes from coreutils.
6023 2006-09-28 Jim Meyering <jim@meyering.net>
6025 Automatically generated dependencies are important even
6026 when all of the sources in a directory come from gnulib.
6027 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
6028 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
6030 2006-09-23 Jim Meyering <jim@meyering.net>
6032 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
6034 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6036 * bootstrap: Add support for --force.
6037 (usage): New function. Describe usage less tersely.
6038 (CVS_only_file): New var.
6040 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
6042 * data/push.c (YYPUSH_MORE): Make it an enum instead.
6043 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
6044 Adjust white space and comments to match GNU style better.
6046 2006-09-20 Bob Rossi <bob@brasko.net>
6048 * data/push.c (yyresult_get): Remove function.
6049 (YYPUSH_MORE): Add #define.
6050 (yypushparse): Modify return value.
6052 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6054 * stamp-h.in: Remove; no longer needed.
6055 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
6056 Remove config.h, config.hin, intl (no longer created).
6057 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
6060 Sync bootstrap from coreutils, as follows:
6062 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
6064 * bootstrap (symlink_to_gnulib): New function.
6065 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
6066 to copies-of-gnulib.
6067 (cp_mark_as_generated, slurp, gnulib_files):
6068 Avoid making a copy if it's the same as the old version.
6069 (gnulib_files): Add support for this variable (used by Bison).
6071 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6073 * src/getargs.c (usage): Rework to use conventions similar to
6074 coreutils, to make translation a bit easier and the code a bit
6075 smaller. Problem reported by Tim Van Holder.
6077 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
6079 Use some of gnulib's new modules, taken from coreutils.
6081 * bootstrap: Sync from coreutils, except add support for gnulib_files.
6082 * bootstrap.conf: New file.
6083 (gnulib_modules): Add configmake, inttypes, unistd.
6084 (XGETTEXT_OPTIONS): Add complain, complain_at,
6085 fatal, fatal_at, warn, warn_at, unexpected_end.
6086 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
6087 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
6089 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
6091 (GNULIB_AUTOCONF_SNIPPET): Remove.
6092 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
6094 * lib/.cvsignore: Add inttypes_.h.
6095 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
6096 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
6097 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
6098 no-longer-necessary initializations.
6099 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
6100 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
6101 use the unistd module.
6102 * src/system.h: Likewise.
6103 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
6104 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
6105 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
6106 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
6107 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
6108 * src/system.h: Include inttypes.h unconditionally, now that we
6109 use the inttypes module. Don't bother to include stdint.h, since
6110 inttypes.h now does that for us.
6111 (LOCALEDIR): Remove, now that we use the configmake module.
6112 * src/getargs.c: Include configmake.h.
6113 * src/main.c: Likewise.
6114 * src/output.c: Likewise.
6115 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
6116 not from $abs_top_builddir, since config.h moved.
6119 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
6120 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
6122 * src/parse-gram.y (symbol_declaration): Don't put statements
6123 before declarations; it's not portable to C89.
6124 * src/scan-code.l (handle_action_at): Likewise.
6126 * src/scan-code.l: Always initialize braces_level; the old code
6127 left it uninitialized and therefore had undefined behavior.
6129 Don't attempt to redefine 'assert', since it runs afoul of
6130 systems where standard headers (mistakenly) include <assert.h>.
6131 Instead, define and use our own alternative, called 'aver'.
6132 * src/reader.c: Don't include assert.h, since we no longer
6134 * src/scan-code.l: Likewise.
6135 * src/system.h (assert): Remove, replacing with....
6136 (aver): New function, taking a bool arg. All uses changed.
6137 * src/tables.c (pack_vector): Ensure that aver arg is bool,
6138 not merely an integer.
6140 2006-09-15 Bob Rossi <bob@brasko.net>
6142 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
6143 * data/c.m4 (YYPUSH): New.
6144 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
6145 * src/getargs.c (push_parser): New var.
6146 * src/getargs.h (push_parser): New declaration.
6147 * src/output.c (prepare): Add macro insertion of `push_flag'.
6148 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
6149 (prologue_declaration): Parse %push-parser.
6150 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
6151 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
6152 list of removed lines from the traces observed.
6153 (AT_CHECK_CALC_LALR): Added push parser tests.
6155 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
6157 * NEWS: Version 2.3a.
6158 * configure.ac (AC_INIT): Likewise.
6160 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
6161 "#define YYSTYPE int" that caused "make maintainer-check" to fail
6162 due to header ordering dependencies. I don't know why the #define
6165 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
6166 runtime cost when YYDEBUG is not defined, and so that some tests
6167 that used to fail now work. Problem and initial suggestion by
6169 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
6170 * data/glr.cc (b4_parser_class_name):
6171 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
6172 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
6173 (yydebug_) [YYDEBUG]: New member.
6174 (yycdebug_): Now defined only if YYDEBUG.
6175 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
6176 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
6177 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
6179 (debug_stream, set_debug_stream, debug_level, set_debug_level):
6180 Define only if YYDEBUG.
6181 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
6183 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
6184 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
6185 AT_CHECK_CALC_GLR_CC that are working now.
6187 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
6189 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
6190 We don't need them in glr.cc, and glr.c defines them.
6191 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
6192 assumes that defining it to anything is the same as defining
6193 it to 1. Problem reported by Paolo Bonzini.
6195 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
6197 * data/c.m4 (b4_null, b4_case): Define.
6198 * src/output.c (prepare_symbols): Use b4_null.
6199 (user_actions_output): Use b4_case.
6201 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
6203 * data/glr.c (b4_shared_declarations): Put start-header first,
6204 before any #includes that we generate, so that feature-test
6205 macros work. Problem reported by Michael Deutschmann in
6206 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
6207 * data/lalr1.cc: Likewise.
6208 * doc/bison.texinfo (Prologue): Document that feature-test macros
6209 should be defined before any Bison declarations.
6210 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
6211 that depend on location.hh after, not before, Bison decls, since
6212 we now include location.hh after the first user prologue.
6214 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
6215 Sander Brandenburg in
6216 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
6217 Also, fix minor white space and comment issues.
6218 (Prologue): Mention that it's better to define feature-test macros
6219 before Bison declarations. Problem reported by Michael Deutschmann.
6221 * README-cvs: Fix typo: "&" should be "&&". Problem reported
6223 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
6224 This adjusts to recent gnulib changes.
6226 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
6228 Finish implementation of per-type %destructor/%printer. Discussed
6230 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
6232 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
6233 * NEWS (2.3+): Add a description of this feature to the default
6234 %destructor/%printer description.
6235 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
6236 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
6237 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
6238 list node contains a semantic type.
6239 * src/symtab.c, src/symtab.h: Extend with a table that associates
6240 semantic types with their %destructor's and %printer's.
6241 (semantic_type_from_uniqstr, semantic_type_get,
6242 semantic_type_destructor_set, semantic_type_printer_set): New functions
6243 composing the public interface of that table.
6244 (symbol_destructor_get, symbol_destructor_location_get,
6245 symbol_printer_get, symbol_printer_location_get): If there's no
6246 per-symbol %destructor/%printer, look up the per-type before trying
6248 * tests/actions.at (Per-type %printer and %destructor): New test case.
6249 * tests/input.at (Default %printer and %destructor redeclared):
6250 Extend to check that multiple occurrences of %symbol-default in a
6251 single %destructor/%printer declaration is an error.
6252 (Per-type %printer and %destructor redeclared, Unused values with
6253 per-type %destructor): New test cases.
6255 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
6257 Require default %destructor/%printer to be declared using
6258 %symbol-default instead of an empty symbol list, and start working on
6259 new per-type %destructor/%printer. Discussed at
6260 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
6261 * NEWS (2.3+): Add %symbol-default to example.
6262 * bison.texinfo (Freeing Discarded Symbols): Likewise.
6263 (Table of Symbols): Add entry for %symbol-default.
6264 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
6265 (generic_symlist, generic_symlist_item): New nonterminals for creating
6266 a list in which each item is a symbol, semantic type, or
6268 (grammar_declaration): Use generic_symlist in %destructor and %printer
6269 declarations instead of symbols.1 or an empty list.
6270 (symbol_declaration, precedence_declaration, symbols.1): Update actions
6271 for changes to symbol_list.
6272 * src/reader.c: Update for changes to symbol_list.
6273 * src/scan-code.l: Likewise.
6274 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
6275 * src/symlist.c, src/symlist.h: Extend such that a list node may
6276 represent a semantic type or a %symbol-default in addition to just an
6277 ordinary symbol. Add switched functions for setting %destructor's and
6279 * tests/actions.at, tests/input.at: Add %symbol-default to all default
6280 %destructor/%printer declarations.
6282 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
6284 Whether the default %destructor/%printer applies to a particular symbol
6285 isn't a question of whether the user *declares* that symbol (in %token,
6286 for example). It's a question of whether the user by any means
6287 *defines* the symbol at all (by simply using a char token, for
6288 example). $end is defined by Bison whereas any other token with token
6289 number 0 is defined by the user. The error token is always defined by
6290 Bison regardless of whether the user declares it with %token, but we
6291 may one day let the user define error as a nonterminal instead.
6292 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
6293 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
6294 the meaning of "user-defined".
6295 * tests/actions.at (Default %printer and %destructor for user-declared
6296 end token): Rename to...
6297 (Default %printer and %destructor for user-defined end token): ...
6300 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
6301 computation of whether to apply the default, don't maintain a list of
6302 every Bison-defined symbol. Instead, just check for a first character
6303 of '$', which a user symbol cannot have, and check for the error token.
6305 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
6307 Don't apply the default %destructor or %printer to the error token,
6308 $undefined, or $accept. This change fits the general rule that the
6309 default %destructor and %printer are only for user-declared symbols,
6310 and it solves several difficulties that are described in the new test
6312 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
6313 * tests/actions.at (Default %printer and %destructor are not for error
6314 or $undefined, Default %printer and %destructor are not for $accept):
6317 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
6319 Allow %start after the first rule.
6320 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
6321 when parsing the first rule.
6322 (check_and_convert_grammar): Search for it here after all grammar
6323 declarations have been parsed. Skip midrules, which have dummy LHS
6325 * src/symtab.c (symbol_is_dummy): New function.
6326 * src/symtab.h (symbol_is_dummy): Declare it.
6327 * tests/input.at (%start after first rule): New test.
6329 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
6331 Redo some of the previous commit: add back the ability to use
6332 non-aliased/undeclared string literals since it might be useful to
6333 those declaring %token-table.
6334 * src/reader.c (check_and_convert_grammar): Undo changes in previous
6335 commit: don't worry about complaints from symbols_pack.
6336 * src/symtab.c (symbol_new, symbol_class_set,
6337 symbol_check_alias_consistency): Undo changes in previous commit: count
6338 each string literal as a new symbol and token, assign it a symbol
6339 number, and don't complain about non-aliased string literals.
6340 (symbols_pack): Since symbol_make_alias still does not decrement symbol
6341 and token counts but does still set aliased tokens to the same number,
6342 symbol_pack_processor now leaves empty slots in the symbols array.
6344 * tests/regression.at (Undeclared string literal): Remove test case
6345 added in previous commit since non-aliased string literals are allowed
6347 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
6348 remove unnecessary string literal declarations.
6349 * tests/sets.at (Firsts): Likewise.
6351 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
6353 Don't allow an undeclared string literal, but allow a string literal to
6354 be used before its declaration.
6355 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
6356 symbols_pack complained.
6357 * src/symtab.c (symbol_new): Don't count a string literal as a new
6359 (symbol_class_set): Don't count a string literal as a new token, and
6360 don't assign it a symbol number since symbol_make_alias does that.
6361 (symbol_make_alias): It's not necessary to decrement the symbol and
6362 token counts anymore. Don't assume that an alias declaration occurs
6363 before any uses of the identifier or string, and thus don't assert that
6364 one of them has the highest symbol number so far.
6365 (symbol_check_alias_consistency): Complain if there's a string literal
6366 that wasn't declared as an alias.
6367 (symbols_pack): Bail if symbol_check_alias_consistency failed since
6368 symbol_pack asserts that every token has been assigned a symbol number
6369 although undeclared string literals have not.
6370 * tests/regression.at (String alias declared after use, Undeclared
6371 string literal): New test cases.
6372 (Characters Escapes, Web2c Actions): Declare string literals as
6374 * tests/sets.at (Firsts): Likewise.
6376 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
6378 In the grammar scanner, STRING_FINISH unclosed constructs and return
6379 them to the parser in order to improve error messages.
6380 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
6381 SC_BRACED_CODE, SC_PROLOGUE): Implement.
6382 * tests/input.at (Unclosed constructs): New test case.
6383 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
6386 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
6389 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
6391 Handle string aliases for character tokens correctly.
6392 * src/symtab.c (symbol_user_token_number_set): If the token has an
6393 alias, check and set its alias's user token number instead of its own,
6394 which is set to indicate the alias. Previously, every occurrence of
6395 the character token in the grammar overwrote that alias indicator with
6397 * tests/input.at (String aliases for character tokens): New test.
6399 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
6401 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
6403 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
6405 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
6406 to prevent failures when building on older platforms.
6407 Check for autopoint failure.
6408 Set XGETTEXT_OPTIONS to values that check for C format strings,
6409 so that translators are warned about them (this also helps
6410 prevent core dumps).
6412 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
6413 function, since it simplifies our code a bit.
6415 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
6416 rather than -W, so we don't get bogus warnings about sign comparisons.
6417 Add -Wpointer-arith, since that warning is useful (it reports code
6418 that does not conform to C89 and that some compilers reject).
6419 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
6420 since it's no longer needed.
6422 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
6424 Clean up scanners a bit.
6425 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
6426 definitions so gcc won't warn when obstack_for_string is unused.
6427 * src/scan-code.l: config.h and system.h are already #include'd by
6428 scan-code-c.c, so get rid of them here.
6429 * src/scan-gram.l: Likewise.
6430 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
6431 definitions rather than duplicating the rest of it.
6432 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
6434 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
6436 Suppress signed/unsigned comparison warnings for yycheck.
6437 * data/c.m4 (b4_safest_int_type): New macro.
6438 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
6439 a signed int type, cast it to b4_safest_int_type first.
6440 * data/yacc.c: Likewise.
6441 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
6444 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
6446 * doc/bison.texinfo: Fix some typos.
6448 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
6450 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
6451 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
6453 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
6454 the latest gnulib does this a different way.
6455 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
6456 translation was patched, so stop omitting it.
6458 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
6460 Enable declaration of default %printer/%destructor. Make the parser
6461 use these for all user-declared grammar symbols for which the user does
6462 not declare a specific %printer/%destructor. Thus, the parser uses it
6463 for token 0 if the user declares it but not if Bison generates it as
6464 $end. Discussed starting at
6465 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
6466 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
6468 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
6469 * NEWS (2.3+): Mention.
6470 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
6471 declare a %destructor for a mid-rule's semantic value. It's just
6472 impossible to declare one specific to it.
6473 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
6474 code. Describe default %destructor form.
6475 * src/parse-gram.y (grammar_declaration): Parse default
6476 %printer/%destructor declarations.
6477 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
6478 and symbol_destructor_location_get rather than accessing the destructor
6479 and destructor_location members of struct symbol.
6480 (symbol_printers_output): Likewise but for %printer's.
6481 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
6483 * src/symtab.c (default_destructor, default_destructor_location,
6484 default_printer, default_printer_location): New static global
6485 variables to record the default %destructor and %printer.
6486 (symbol_destructor_get, symbol_destructor_location_get,
6487 symbol_printer_get, symbol_printer_location_get): New functions to
6488 compute the appropriate %destructor and %printer for a symbol.
6489 (default_destructor_set, default_printer_set): New functions to set the
6490 default %destructor and %printer.
6491 * src/symtab.h: Prototype all those new functions.
6492 * tests/actions.at (Default %printer and %destructor): New test to
6493 check that the right %printer and %destructor are called, that they're
6494 not called for $end, and that $$ and @$ work correctly.
6495 (Default %printer and %destructor for user-declared end token): New
6496 test to check that the default %printer and %destructor are called for
6497 a user-declared end token.
6498 * tests/input.at (Default %printer and %destructor redeclared, Unused
6499 values with default %destructor): New tests to check related grammar
6500 warnings and errors.
6502 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
6504 Clean up handling of %destructor for the end token (token 0).
6505 Discussed starting at
6506 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
6508 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
6510 Make the skeletons consistent in how they pop the end token and invoke
6512 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
6513 state, which has token number 0, since this would invoke the
6514 %destructor for the end token.
6515 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
6516 until after shifting the end token, or else it won't be popped.
6517 * data/yacc.c (yyparse): Likewise.
6519 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
6520 it's the end token. Upon termination, destroy an unshifted lookahead
6521 even when it's the end token.
6522 * data/lalr1.cc (yy::parser::parse): Likewise.
6523 * data/yacc.c (yyparse): Likewise.
6525 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
6526 value warnings for the end token when the user gives the end token a
6529 * tests/actions.at (Printers and Destructors): Test all the above.
6531 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
6533 Update to latest gnulib and gettext versions.
6534 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
6536 (gnulib_files): Add m4/warning.m4. Don't worry about files
6537 overwritten by autopoint.
6538 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
6539 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
6541 Don't use autoreconf; instead, invoke autopoint etc. by hand,
6542 so that we can remove the intl files at a better time.
6543 (intl_files_to_remove): Remove aclocal.m4, since it gets
6544 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
6545 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
6546 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
6547 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
6548 Remove datarootdir hack; no longer needed.
6549 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
6550 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
6551 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
6553 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
6554 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
6556 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
6558 * bootstrap: Adjust to today's change to gnulib-tool by invoking
6559 it with --assume-autoconf='latest-stable'.
6561 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
6563 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
6564 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
6566 * src/muscle_tab.h (muscle_grow): Replace the header comments with
6567 those from muscle_tab.c since the old ones are misleading.
6569 2006-07-13 Akim Demaille <akim@epita.fr>
6571 Support %define "KEY" {VALUE}.
6572 * src/scan-code.h, src/scan-code.l (translate_action)
6573 (translate_rule_action, translate_symbol_action, translate_code):
6574 Return char *, not const char *.
6575 * src/parse-gram.y (declaration): Rename as...
6576 (prologue_declaration): this.
6577 (string_content): Remove this nonterminal, use STRING.
6578 (braceless, content, content.opt): New nonterminal.
6580 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
6582 * src/scan-gram.l (getargs.h): Don't include it.
6584 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
6586 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
6587 rather than a for-loop that declares a local bool variable. This
6588 should work around a compatibility problem with a Cray x1e C++
6589 compiler reported by Hung Nguyen in
6590 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
6591 The for-loop was introduced in the 2004-11-17 change but I don't
6592 know why it was needed.
6594 2006-07-12 Akim Demaille <akim@epita.fr>
6596 * data/c.m4: Comment changes.
6598 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
6600 * src/complain.c (error_message, ERROR_MESSAGE): New.
6602 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
6603 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
6605 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
6607 * NEWS: Instead of %union, you can define and use your own union type
6608 YYSTYPE if your grammar contains at least one <type> tag.
6609 Your YYSTYPE need not be a macro; it can be a typedef.
6610 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
6611 (Union Decl, Decl Summary): Document this.
6612 * data/glr.c (YYSTYPE): Implement this.
6613 * data/glr.cc (YYSTYPE): Likewise.
6614 * data/lalr1.cc (YYSTYPE): Likewise.
6615 * data/yacc.c (YYSTYPE): Likewise.
6616 * src/output.c (prepare): Output tag_seen_flag.
6617 * src/parse-gram.y (declaration, grammar_declaration):
6618 Use 'union_seen' rather than 'typed' to determine whether
6619 %union has been seen, since grammars can now be typed without
6621 (symbol_declaration, type.opt, symbol_def):
6622 Keep track of whether a tag has been seen.
6623 * src/reader.c (union_seen, tag_seen): New vars.
6625 * src/reader.h (union_seen, tag_seen, typed): Likewise.
6626 * src/scan-code.l (untyped_var_seen): New variable.
6627 (handle_action_dollar): Adjust to above changes.
6628 (handle_action_dollar, handle_action_at):
6629 Improve overflow checking for outlandish numbers.
6630 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
6631 avoid new diagnostics generated by above changes.
6632 * tests/regression.at (YYSTYPE typedef): Add test to check
6633 for type tags without %union.
6635 * src/symlist.c (symbol_list_length): Return int, not unsigned
6636 int, since callers expect int. This may need to get revisited
6637 once we have proper integer overflow checking.
6639 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
6640 object is now static.
6642 * src/getargs.c (flags_argmatch): Return void, not int,
6643 to pacify ./configure --enable-gcc-warnings.
6645 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
6646 since last_string is already defined to FLEX_PREFIX (last_string).
6648 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
6650 Implement --warnings/-W.
6651 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
6653 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
6655 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
6656 (warnings_args, warnings_types): New.
6657 (getargs, short_options, long_options): Accept -W/--warnings.
6658 Sort the options by alphabetical order, upper case letter right
6659 before its lower case.
6661 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
6663 Change %merge result type clash warnings to errors. Discussed at
6664 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
6665 * src/reader.c (record_merge_function_type): Use complain_at.
6666 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6667 declared later): Update test case results.
6669 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
6671 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
6672 to be in alphabetical order.
6673 (trace_args): Spelling fixes.
6675 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
6677 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
6678 so they don't collide with user-defined macros.
6679 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
6680 this was never guaranteed, and now that we're using gnulib stdint,
6681 which defines int_fast16_t to long int, the problem is exposed.
6683 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
6685 * data/c.m4 (b4_basename): Simplify a bit, since we don't
6686 need the full POSIX semantics (and weren't implementing them
6689 Adjust to Autoconf 2.60 and today's gnulib.
6690 * bootstrap (gnulib_modules): Add stdint.
6691 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
6692 no longer copies it.
6693 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
6694 since stdint needs the former and wcwidth (which is now required
6695 by mbswidth) needs the latter.
6696 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
6697 work around a compatibility glitch between gettext 0.14.6 and
6699 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
6700 Do not check for uintptr_t, since new stdint module does the right
6702 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
6703 Add stdint.h, stdint_.h, wcwidth.h.
6704 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
6705 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
6706 stdint.m4, wchar_t.m4, wcwidth.m4.
6707 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
6708 usual order for ../lib/*.h files.
6709 (file_name_split): Use last_component, not base_name, to adjust
6711 * src/parse-gram.h: Include <strverscmp.h> in the usual order
6712 for ../lib/*.h files.
6713 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
6714 Define unconditionally, since we now assume the stdint module.
6715 * src/scan-skel.l: Include <dirname.h>.
6716 (BASE_QPUTS): Use last_component, not base_name.
6717 * src/system.h: Include <unlocked-io.h> in the usual order
6718 for ../lib/*.h files. Include <stdint.h> unconditionally,
6719 since we now use the stdint module.
6720 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
6721 HAVE_UINTPTR_T, since we now use the stdint module.
6722 (base_name): Remove decl, since files now include <dirname.h>
6725 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
6727 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
6729 * data/yacc.c, data/glr.c, data/location.cc: Use them.
6730 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
6732 * tests/calc.at: Adjust.
6734 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
6736 * data/c.m4 (b4_basename): New.
6737 (b4_syncline): Also output the location of its invocation (from
6739 (b4_user_action, b4_define_user_action, b4_user_actions)
6740 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
6741 (b4_user_stype): New.
6742 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
6744 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
6746 In the grammar file, the first column is 1 not 0 on the first line as
6747 on every other line.
6748 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
6749 * tests/input.at (Torturing the Scanner): Update output.
6751 * src/scan-gram.l (scanner_cursor): Declare it static.
6753 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
6755 In warnings, say "previous declaration" rather than "first
6757 * src/symtab.c (redeclaration): Do that here.
6758 * src/reader.c (record_merge_function_type): In the case of a result
6759 type clash, report the previous declaration rather than the very first
6760 one in the grammar file.
6761 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6762 declared later): Add a third declaration to check this behavior.
6763 * tests/input.at (Incompatible Aliases): Update output.
6765 2006-06-27 Akim Demaille <akim@epita.fr>
6767 * doc/Doxyfile.in: New.
6768 * doc/Makefile.am: Use it.
6769 * src/lalr.h, src/symtab.h: Initial doxygenation.
6771 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6773 Don't miss %merge result type warnings just because the LHS types are
6774 declared after the %merge. This continues the effort of the previous
6776 * src/reader.c (get_merge_function): Don't set the merger type yet.
6777 (record_merge_function_type): New function for setting the merger type
6778 and checking for clashes.
6779 (grammar_current_rule_merge_set): Set the location of the %merge for
6781 (packgram): Invoke record_merge_function_type for each rule now that
6782 all symbol type declarations have been parsed.
6783 * src/reader.h (merger_list.type_declaration_location): New member
6784 storing the location of the first %merge from which the type for this
6785 merging function was derived.
6786 * src/symlist.h (symbol_list.merger_declaration_location): New member
6787 storing the location of a rule's %merge, if any.
6788 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6789 declared later): New test to catch the error fixed by the above patch.
6791 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6793 Get action warnings (grammar_rule_check) right even when symbol
6794 declarations appear after the rules. Discussed at
6795 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
6797 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
6798 Don't mistake the type of $$ in a midrule to be that of its parent
6800 * src/reader.c (grammar_current_rule_end): Don't invoke
6801 grammar_rule_check yet since not all symbol declarations may have been
6803 (grammar_midrule_action): Likewise.
6804 Don't record whether the midrule's $$ has been used yet since actions
6805 haven't been translated yet.
6806 Record the midrule's parent rule and its RHS index within the parent
6808 (grammar_current_rule_action_append): Don't translate the action yet
6809 since not all symbol declarations may have been parsed yet and, thus,
6810 warnings about types for $$, $n, @$, and @n can't be reported yet.
6811 (packgram): Translate the action and invoke grammar_rule_check now that
6812 all symbol declarations have been parsed.
6813 * src/scan-code.l (handle_action_dollar): Now that this is invoked
6814 after parsing the entire grammar file, the symbol list here in the case
6815 of a midrule is actually the midrule's empty RHS, so reference its
6816 parent rule's RHS where necessary.
6817 On the other hand, now that you can already know it's a midrule, you
6818 aren't forced to think $$ has the same type as its parent rule's $$.
6819 (handle_action_at): In the case of a midrule, reference the parent rule
6821 * src/symlist.c (symbol_list_new): Initialize new midrule-related
6823 (symbol_list_length): Now that this is invoked after all rules have
6824 been parsed, a NULL symbol (rather than a NULL symbol list node)
6825 terminates a rule. symbol_list_print already does this correctly.
6826 * src/symlist.h (symbol_list.midrule_parent_rule,
6827 symbol_list.midrule_parent_rhs_index): New members so that midrules can
6828 remember their relationships with their parents.
6829 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
6830 fixed by the above patch.
6831 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
6833 (Unused values): ... this old test case and...
6834 (Unused values before symbol declarations): ... this new test case.
6835 This one is the same as `Unused values' except that all symbol
6836 declarations appear after the rules in order to catch the rest of the
6837 errors fixed by the above patch.
6839 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6842 * src/reader.c (current_rule): Declare it static since it's no longer
6843 used outside this file.
6844 (grammar_current_rule_action_append): Remove redundant arguments from
6845 translate_rule_action invocation.
6846 * src/reader.h (current_rule): Remove this unused extern.
6847 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
6848 * src/scan-code.l (translate_rule_action): Likewise.
6850 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
6852 Clean up yesterday's patch.
6853 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
6855 * src/reader.c (grammar_current_rule_action_append): ... here for
6856 consistency with grammar_current_rule_symbol_append.
6857 * tests/regression.at (Braced code in declaration in rules section):
6858 Make yyerror and yylex static as usual.
6860 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
6862 Fix bug that mistakes braced code in a declaration in the rules section
6863 to be a rule action. Mentioned at
6864 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
6865 * src/scan-gram.l: Move midrule action detection from the start of the
6866 scanning of any braced code to...
6867 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
6868 action. For readability, use $2 and @2 rather than the equivalent
6870 * tests/regression.at (Braced code in declaration in rules section):
6871 New test to catch the error fixed by the above patch.
6873 Work on code readability some.
6874 * src/scan-code.l (current_rule): Get rid of this misleading and
6875 redundant declaration: it's actually extern'ed in reader.h.
6876 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
6877 translate_action): Add a rule argument and use it instead of the global
6879 (translate_rule_action): This already receives current_rule through an
6880 argument, so pass it on to translate_action instead of assigning
6881 current_rule to current_rule.
6882 (translate_symbol_action, translate_code): Pass rule = NULL to
6885 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
6887 Rename %before-definitions to %start-header and %after-definitions to
6888 %end-header. Don't use these declarations to separate pre-prologue
6889 blocks from post-prologue blocks. Add new order-independent
6890 declarations %before-header and %after-header as alternatives to the
6891 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
6892 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
6893 * NEWS (2.3+): Update for these changes.
6894 * data/glr.c (b4_before_definitions): Update to...
6895 (b4_start_header): ... this.
6896 (b4_after_definitions): Update to...
6897 (b4_end_header): ... this.
6898 * data/glr.cc: Likewise.
6899 * data/lalr1.cc: Likewise.
6900 * data/yacc.c: Likewise.
6901 * doc/bison.texinfo (The prologue): Update names, and replace remaining
6902 prologue blocks with %*-header declarations.
6903 (Calc++ Parser): Likewise.
6904 (Decl Summary): Update names.
6905 (Table of Symbols): Update description.
6906 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
6907 (PERCENT_END_HEADER): ... this.
6908 (PERCENT_BEFORE_DEFINITIONS): Update to...
6909 (PERCENT_START_HEADER): ... this.
6910 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
6911 (declaration): Update token names and m4 macro names.
6912 When parsing %end-header and %start-header, invoke translate_code
6913 before muscle_code_grow, and no longer set global booleans to remember
6914 whether these declarations have been seen.
6915 Parse new %after-header and %before-header.
6916 * src/reader.c (before_definitions, after_definitions): Remove.
6917 (prologue_augment): Accept a new bool argument to specify whether to
6918 augment the pre-prologue or post-prologue.
6919 * src/reader.h (before_definitions, after_definitions): Remove these
6921 (prologue_augment): Add new bool argument.
6922 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
6923 (PERCENT_END_HEADER): ... this.
6924 (PERCENT_BEFORE_DEFINITIONS): Update to...
6925 (PERCENT_START_HEADER): ... this.
6926 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
6927 * tests/actions.at (Printers and Destructors): Update names.
6929 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
6931 Add comparison operators for C++ location classes. Discussed at
6932 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
6933 * data/c++.m4 (b4_define_location_comparison): New boolean %define
6934 declaration indicating whether filename_type has an operator==. If
6935 filename_type is `std::string', it defaults to `1', `0' otherwise.
6936 * data/location.cc: Iff b4_define_location_comparison is `1', add
6937 operator== and operator!= for class position and for class location.
6940 * src/scan-action.l: Remove unused file.
6941 * src/symtab.c (symbol_printer_set): Use printer_location not
6942 destructor_location.
6943 * src/symtab.h (struct symbol): Replace incorrect source comment for
6945 * tests/input.at (Incompatible Aliases): Update output with correct
6948 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
6950 Don't put the pre-prologue in the header file. For the yacc.c code
6951 file and the glr.c header and code files, move the pre-prologue before
6952 the token definitions. Add new %before-definitions and
6953 %after-definitions to declare code that will go in both the header file
6954 and code file. Discussed at
6955 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
6956 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
6958 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
6959 * NEWS (2.3+): Describe these changes.
6960 * data/glr.c (b4_pre_prologue): Move from within to before...
6961 (b4_shared_declarations): ... this.
6962 Add new b4_before_definitions before b4_token_enums.
6963 Add new b4_after_definitions at the end.
6964 * data/glr.cc (b4_pre_prologue): Replace with...
6965 (b4_before_definitions): ... this in the header file.
6966 (b4_after_definitions): New near the end of the header file.
6967 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
6968 code file right before including the header file.
6969 (b4_before_definitions): New in the previous position of
6970 b4_pre_prologue in the header file.
6971 (b4_after_definitions): New near the end of the header file.
6972 * data/yacc.c: Clean up some m4 quoting especially in the header file.
6973 (b4_token_enums_defines): In the code file, move to right before
6974 YYSTYPE for consistency with the header file.
6975 (b4_before_definitions): New right before b4_token_enums_defines in
6976 both the header and code file.
6977 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
6978 header and code file.
6979 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
6980 of prologues for %union dependencies.
6981 (Decl Summary): In %defines description, mention the effect of
6982 %before-definitions and %after-definitions on the header file.
6983 (Calc++ Parser): Forward declare driver in a %before-definitions rather
6984 than in the pre-prologue so that make check succeeds.
6985 (Table of Symbols): Add entries for %before-definitions and
6987 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
6988 %before-definitions.
6989 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
6990 (declaration): Parse those declarations and append to
6991 b4_before_definitions and b4_after_definitions, respectively.
6992 * src/reader.c (before_definitions, after_definitions): New bools to
6993 track whether those declarations have been seen.
6994 (prologue_augment): Add to the post-prologue if %union,
6995 %before-definitions, or %after-definitions has been seen.
6996 * src/reader.h (before_definitions, after_definitions): New extern's.
6997 * src/scan-gram.l: Scan the new declarations.
6998 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
6999 prologue block in a %before-definitions or a %after-definitions based
7000 on whether the %union is declared.
7001 * tests/regression.at (Early token definitions with --yacc, Early token
7002 definitions without --yacc): Move tests for token definitions into the
7003 post-prologue since token names are no longer defined in the
7006 2006-06-20 Akim Demaille <akim@epita.fr>
7008 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
7009 (symbol_get): Use it.
7010 * src/parse-gram.y: Use it.
7012 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
7014 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
7015 build succeeds when configured with --enable-gcc-warnings.
7017 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
7019 * src/parse-gram.y (char_name): New function.
7020 (CHAR, STRING, string_content): For %printer, properly escape.
7021 (ID): Prefer fputs to fprintf.
7022 (id): Reindent to be consistent with other rules.
7023 Properly quote char.
7025 The Translation Project changed its way of publishing translations
7026 to maintainers. I haven't received any responses to my request
7027 for supporting the old way, or for documenting the new way. I
7028 have modified 'bootstrap' to use screen scraping
7029 (in this case, HTML scraping). This is unreliable and inelegant,
7030 but I don't see any better way. Yuck.
7031 * bootstrap (TP_URL, WGET_COMMAND): New vars.
7032 (get_translations): New function, which uses HTML scraping to
7033 deduce locations of latest translations.
7034 Use this function to grab both bison and bison-runtime .po files.
7035 Don't bother priming the pump for the runtime-po domain any more,
7036 as it's now translated better than bison is.
7038 2006-06-19 Akim Demaille <akim@epita.fr>
7040 * src/scan-gram.l: No longer "parse" things after `%union' until
7041 `{'. Rather, return a single "%union" token.
7042 No longer make symbols: return strings, and leave the conversion
7043 to symbols to the parser.
7044 (SC_PRE_CODE, token_type): Remove.
7045 * src/parse-gram.y (%union): New field `character'.
7048 (ID, ID_COLON): Now that the scanner no longer makes them
7049 identifiers, adjust all uses to invoke symbol_get.
7050 (id_colon): New, wraps the conversion from string to symbol.
7051 (%union): Accept a possible union_name.
7052 (symbol): Now can be a char.
7053 * data/c.m4 (b4_union_name): Leave a default value.
7054 * data/glr.c, data/yacc.c: Use it.
7056 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
7058 For associating token numbers with token names for "yacc.c", don't use
7059 #define statements unless `--yacc' is specified; always use enum
7060 yytokentype. Most important discussions start at:
7061 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
7062 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
7064 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
7065 * NEWS (2.3+): Mention.
7066 * data/c.m4 (b4_yacc_if): New.
7067 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
7069 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
7070 on token name definitions.
7071 * src/getargs.c (usage): Capitalize `Yacc' in English.
7072 * src/output.c (prepare): Define b4_yacc_flag.
7073 * tests/regression.at (Early token definitions): Test that tokens names
7074 are defined before the pre-prologue not just before the post-prologue.
7075 Remove this test case and copy to...
7076 (Early token definitions with --yacc): ... this to test #define's.
7077 (Early token definitions without --yacc): ... and this to test enums.
7079 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
7081 * NEWS: Reword the post-2.3 change to not be so optimistic about
7082 removing the old "look-ahead" spelling.
7083 Update previous look-ahead/lookahead change reports.
7084 * REFERENCES: look-ahead -> lookahead (since that's
7085 what he actually wrote).
7086 * doc/refcard.tex: look ahead -> lookahead,
7087 look-ahead -> lookahead
7089 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
7091 For consistency, use `lookahead' instead of `look-ahead' or
7092 `look_ahead'. Discussed starting at
7093 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
7095 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
7096 * NEWS: For the next release, note the change to `--report'.
7097 * TODO, doc/bison.1: Update English.
7098 * doc/bison.texinfo: Update English.
7099 (Understanding Your Parser, Bison Options): Document as
7100 `--report=lookahead' rather than `--report=look-ahead'.
7101 * src/conflicts.c: Update English in comments.
7102 (lookahead_set): Rename from look_ahead_set.
7103 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
7104 (resolve_sr_conflict): Rename local look_ahead_tokens to
7105 lookahead_tokens, and update other uses.
7106 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
7107 count_rr_conflicts, conflicts_free): Update uses.
7108 * src/getargs.c (report_args): Move "lookahead" before alternate
7110 (report_types): Update uses.
7111 (usage): For `--report' usage description, state `lookahead' spelling
7112 rather than `look-ahead'.
7113 * src/getargs.h (report.report_lookahead_tokens): Rename from
7114 report_look_ahead_tokens.
7115 * src/lalr.c: Update English in comments.
7116 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
7117 (state_lookahead_tokens_count): Rename from
7118 state_look_ahead_tokens_count.
7119 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7120 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
7121 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7123 Update English in output.
7124 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
7125 * src/print.c: Update English in comments.
7126 (lookahead_set): Rename from look_ahead_set.
7127 (print_reduction): Rename argument lookahead_token from
7129 (print_core, state_default_rule, print_reductions, print_results):
7131 * src/print_graph.c: Update English in comments.
7132 (print_core): Update uses.
7133 * src/state.c: Update English in comments.
7134 (reductions_new): Update uses.
7135 (state_rule_lookahead_tokens_print): Rename from
7136 state_rule_look_ahead_tokens_print, and update other uses.
7137 * src/state.h: Update English in comments.
7138 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
7139 (state_rule_lookahead_tokens_print): Rename from
7140 state_rule_look_ahead_tokens_print.
7141 * src/tables.c: Update English in comments.
7142 (conflict_row, action_row): Update uses.
7143 * tests/glr-regression.at
7144 (Incorrect lookahead during deterministic GLR,
7145 Incorrect lookahead during nondeterministic GLR): Rename
7146 print_look_ahead to print_lookahead.
7147 * tests/torture.at: Update English in comments.
7148 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
7149 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
7150 (Many lookahead tokens): Update uses.
7151 * data/glr.c: Update English in comments.
7152 * lalr1.cc: Likewise.
7154 * src/conflicts.h: Likewise.
7155 * src/lalr.h: Likewise.
7156 * src/main.c: Likewise.
7157 * src/output.c: Likewise.
7158 * src/parse-gram.c: Likewise.
7159 * src/tables.h: Likewise.
7160 * tests/calc.at: Likewise.
7162 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
7164 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
7166 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
7168 * TODO: Add request from Nelson H. F. Beebe to be able to install
7169 Bison without installing the yacc script.
7171 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7173 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
7174 and yytext if they're already #define'd.
7175 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
7176 * src/scan-code-c.c: ... here.
7177 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
7180 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7182 Get Bison to build again when configured with --enable-gcc-warnings.
7183 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
7185 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
7186 loc argument as it shadows a global.
7187 * src/scan-gram.l: Remove stray comma that prevents boundary_set
7190 * src/.cvsignore: Add scan-code.c.
7192 2006-06-07 Akim Demaille <akim@epita.fr>
7194 * src/scan-gram.l: Move the "add a trailing ; to actions" code
7196 * src/scan-code.l: here.
7197 * tests/input.at (Torturing the Scanner): Fix another location
7200 2006-06-07 Akim Demaille <akim@epita.fr>
7202 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
7204 2006-06-06 Akim Demaille <akim@epita.fr>
7206 Extract the parsing of user actions from the grammar scanner.
7207 As a consequence, the relation between the grammar scanner and
7208 parser is much simpler. We can also split "composite tokens" back
7210 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
7211 * src/scan-gram.l (add_column_width, adjust_location): Move to and
7213 * src/location.h, src/location.c (add_column_width)
7214 (location_compute): these.
7215 Fix the column count: the initial column is 0.
7216 (location_print): Be robust to ending column being 0.
7217 * src/location.h (boundary_set): New.
7218 * src/main.c: Adjust to scanner_free being renamed as
7220 * src/output.c: Include scan-code.h.
7221 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
7223 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
7224 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
7225 which is now, again, a separate token.
7226 Adjust all dependencies.
7227 Whereever actions with $ and @ are used, use translate_code.
7228 (action): Remove this nonterminal which is now useless.
7229 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
7230 (grammar_current_rule_action_append): Use translate_code.
7231 (packgram): Bound check ruleno, itemno, and rule_length.
7232 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
7233 (last_string, last_braced_code_loc, max_left_semantic_context)
7234 (scanner_initialize, scanner_free, scanner_last_string_free)
7235 (gram_out, gram_lineno, YY_DECL_): Move to...
7236 * src/scan-gram.h: this new file.
7237 (YY_DECL): Rename as...
7239 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
7240 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
7241 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
7242 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
7243 Move these declarations, and...
7244 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
7246 * src/flex-scanner.h: this new file.
7247 * src/scan-gram.l (rule_length, rule_length_overflow)
7248 (increment_rule_length): Remove.
7249 (last_braced_code_loc): Rename as...
7250 (gram_last_braced_code_loc): this.
7251 Adjust to the changes of the parser.
7252 Move all the handling of $ and @ into...
7253 * src/scan-code.l: here.
7254 * src/scan-gram.l (handle_dollar, handle_at): Remove.
7255 (handle_action_dollar, handle_action_at): Move to...
7256 * src/scan-code.l: here.
7257 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
7258 scan-code.h, scan-code-c.c, scan-gram.h.
7259 (EXTRA_bison_SOURCES): Add scan-code.l.
7260 (BUILT_SOURCES): Add scan-code.c.
7261 (yacc): Be robust to white spaces.
7263 * tests/conflicts.at, tests/input.at, tests/reduce.at,
7264 * tests/regression.at: Adjust the column numbers.
7265 * tests/regression.at: Adjust the error message.
7267 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
7269 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
7270 Use Akim's wording from
7271 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
7273 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
7275 Between Bison releases, manually append `+' to the previous Bison
7276 release number, and use that as a signal to automatically print the
7277 ChangeLog's CVS Id keyword from --version. Discussed starting at
7278 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
7279 * ChangeLog: Add Id header.
7280 * configure.ac (AC_INIT): Append `+' to `2.3'.
7281 * src/.cvsignore: Add revision.c.
7282 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
7283 (BUILT_SOURCES): Add revision.c.
7284 (revision.c): New target rule. This file defines a new global variable
7285 named revision. It initializes it with either the Id from ChangeLog
7286 or, if VERSION doesn't contain `+', with the empty string.
7287 * src/getargs.c (version): Print the value of revision.
7288 * src/revision.h: Extern revision.
7290 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
7292 * NEWS: Version 2.3.
7293 * configure.ac (AC_INIT): Likewise.
7295 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
7297 * data/glr.c (YYRECOVERING): Define to be a function-like macro
7298 with no arguments, not as an object-like macro. This is for
7299 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
7300 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
7301 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
7304 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
7306 * src/getargs.c (usage): Back out yesterday's modification of the
7307 --help output so that we don't have to wait for translation before
7310 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
7312 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
7313 Problem reported by Akim Demaille.
7315 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
7317 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
7319 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
7321 * data/yacc.c (yy_reduce_print): Omit trailing white space in
7322 generated source code. Problem reported by Frans Englich in
7323 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
7325 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
7327 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
7328 shell, not within 'make', so that 'make' by an ordinary builder
7329 (using GNU make) does not worry about configuring gzip. This also
7330 works around a bug reported independently by Keith Thompson and by
7331 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
7332 stderr rather than stdout, messing up the build logs.
7334 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
7336 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
7337 to make sure that YYID will never be unused. This fixes a 'make
7338 maintainer-check' failure caused by the recent changes to the 'Trivial
7339 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
7341 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
7343 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
7345 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
7346 state before an empty RHS is always resolved here. Only the location
7347 of that state is guaranteed to be resolved, and that's enough. This
7348 fixes the remaining bug reported by Derek M. Jones in
7349 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
7350 * tests/glr-regression.at (Uninitialized location when reporting
7351 ambiguity): Test the above case.
7352 Also, the embedded comments in this test case claim it checks the case
7353 of an empty RHS that has inherited the initial location. However, the
7354 corresponding LHS was already resolved, so yyresolveLocations didn't
7355 actually have reason to modify it. Fix this by forcing
7356 nondeterministic operation at the beginning of the parse.
7358 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
7360 * data/c.m4 (b4_yy_symbol_print_generate):
7361 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
7362 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
7363 of the bugs reported today by Derek M Jones in
7364 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
7365 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
7366 defined to be a type name without parens or brackets.
7367 (Location Type): Similarly for YYLTYPE.
7368 * tests/regression.at (Trivial grammars): Put in a test for this
7369 bug that will be caught by 'make maintainer-check' (though not,
7370 alas, by 'make check' unless your compiler is picky).
7372 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
7374 * NEWS: Version 2.2.
7375 * configure.ac (AC_INIT): Likewise.
7377 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
7379 * data/glr.c (yyreportTree): Make room in yystates for the state
7380 preceding the RHS. This fixes the segmentation fault reported by Derek
7382 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
7383 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
7384 to the user. Reported for yyreportTree by Derek M. Jones later in the
7386 * THANKS: Add Derek M. Jones.
7387 Update my email address.
7388 Fix typo in Steve Murphy's name.
7390 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
7392 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
7393 checking against YYLAST that caused the parser to miss a potential
7394 alternative in its diagnostic.
7395 Problem reported by Maria Jose Moron Fernandez in
7396 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
7397 * data/lalr1.cc (yysyntax_error_): Likewise.
7398 * data/yacc.c (yysyntax_error): Likewise.
7399 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
7400 tokens, in case we run into an older C compiler.
7401 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
7402 Use them to check for the off-by-one error fixed above.
7404 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
7405 YYSIZE_T, not size_t.
7406 * tests/regression.at (Trivial grammars): New test, to catch
7407 the error fixed by the above patch.
7409 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7411 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
7413 Reported by Steve Murphy.
7415 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7417 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
7418 * data/glr.cc: b4_location_flag is now b4_locations_flag.
7420 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7422 Implement --trace=m4.
7423 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
7424 * src/output.c (output_skeleton): When set, pass -dV to m4.
7426 Factor the handling of flags in m4.
7427 * src/output.c (prepare): Rename the muscle names debug, defines,
7428 error_verbose to debug_flag, defines_flag, error_verbose_flag.
7429 * data/c.m4: Adjust.
7430 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
7431 Use b4_define_flag_if to define other b4_FLAG_if macros.
7432 (b4_location_if): As a consequence, rename as...
7433 (b4_locations_if): this, for consistency.
7434 Adjust all the skeletons.
7436 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7438 * etc/bench.pm: Shorten bench names.
7440 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7442 * src/output.h, src/output.c (error_verbose): Move to...
7443 * src/getargs.h, src/getargs.c: here.
7445 Adjust dependencies.
7447 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
7449 * data/c.m4 (b4_copyright): Put the special exception for Bison
7450 skeletons here, so we don't have to put it in each skeleton. All
7451 uses changed. Suggested by Akim Demaille. Also, wrap the
7452 copyright notice, in case it is longer than 80 columns. Replace
7453 comma by newline after title.
7455 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
7457 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
7458 incompatibility, not a bug. Mention that it wasn't fixed as of
7461 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
7463 * examples/extexi: Enforce the precedence of concatenation over
7465 Reported by Tommy Nordgren.
7467 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
7469 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
7470 with the member "token".
7471 Reported by Martin Nylin.
7473 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
7475 * data/glr.c: Switch to Bison 2.2 special-exception language in
7476 the copyright notice. Use more-regular format for titles and
7478 * data/glr.cc: Likewise.
7479 * data/location.cc: Likewise.
7480 * data/yacc.cc: Likewise.
7481 * doc/bison.texinfo (Conditions): Document this.
7482 * NEWS: likewise. Upgrade version to 2.2.
7484 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
7486 * data/glr.cc: Remove dead code.
7488 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
7490 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
7491 that variable and the line breaks the bootstrap. Problem reported
7492 by Juan M. Guerrero.
7494 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
7496 * doc/bison.texinfo (Multiple start-symbols): New.
7498 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
7500 * etc/README, etc/bench.pl: New.
7502 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
7504 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
7506 Reported by Mickael Labau.
7507 * tests/input.at (Torturing the Scanner): Test it.
7509 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
7511 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
7512 Problem reported by Bob Rossi.
7514 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
7516 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
7517 and didn't really work.
7518 For the index, use @ifnotinfo, not @iftex.
7519 Minor cleanups of spacing and terminology.
7521 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
7523 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
7524 of AT_NAME_PREFIX when %name-prefix is not used.
7526 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
7528 Apply --prefix to C++ skeletons too: they change the namespace.
7529 The test suite already exercize these cases.
7530 * data/c++.m4 (b4_namespace): New.
7531 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
7532 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
7533 * data/yacc.c, data/glr.c: Remove a useless `[]'.
7534 * doc/bison.texinfo: Document it.
7535 (Option Cross Key): Use @multitable in all formats. It looks
7536 nicer, even in TeX outputs.
7537 (Rules): Use the same code whatever the output type is.
7538 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
7539 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
7540 * tests/calc.at: Use it, instead of hard coding `yy'.
7542 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
7544 * TODO: Remove dead items.
7546 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
7548 * doc/FAQ: Remove, merged into...
7549 * doc/bison.texinfo (FAQ): this.
7550 * doc/Makefile.am (EXTRA_DIST): Adjust.
7552 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
7554 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
7556 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
7557 * doc/bison.texinfo (Calc++ Scanner): Use it.
7559 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
7561 Fix two nits reported by twlevo, plus one more that I discovered.
7563 * src/assoc.h (assoc_to_string): Give a name to the arg, as
7564 this is the usual Bison style.
7565 * src/location.h (location_print): Likewise.
7567 * src/reader.h (token_name): Likewise.
7569 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
7571 Fix some nits reported by twlevo.
7572 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
7573 and "POSIX". Use more-modern syntax for URLs. Mention C++
7574 and ask for Java. Don't hardwire OS version numbers. Add
7576 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
7577 * src/conflicts.c (solved_conflicts_obstack): Now static.
7579 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
7581 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
7582 page. Say "you can use it" not "you may use it" as on the web page;
7583 we're describing capabilities not granting permission.
7585 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
7587 * data/glr.c (yyresolveLocations): Rename local variables to avoid
7588 shadowing warnings. Use usual patter for iterating through RHS.
7589 * tests/glr-regression.at
7590 (Uninitialized location when reporting ambiguity):
7591 Modify yylex so that it uses its argument, rather than trying
7592 to rely on ARGSUSED (which doesn't work for gcc with warnings).
7593 const char -> char const.
7595 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
7596 Don't use tabs inside commands; it messes up 'ps'.
7597 Problem reported by twlevo.
7599 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
7601 * tests/glr-regression.at (Uninitialized location when reporting
7602 ambiguity): New test case.
7603 * data/glr.c (yyresolveLocations): New function, which uses
7605 (yyresolveValue): Invoke yyresolveLocations before reporting an
7607 * doc/bison.texinfo (Default Action for Locations): Note
7608 YYLLOC_DEFAULT's usage for ambiguity locations.
7609 (GLR Semantic Actions): Cross-reference those notes.
7611 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
7613 * tests/glr-regression.at (Leaked semantic values when reporting
7614 ambiguity): Remove unnecessary union and type declarations.
7615 (Leaked lookahead after nondeterministic parse syntax error): New test
7617 * data/glr.c (yyparse): Check for zero stacks remaining before
7618 attempting to shift the lookahead so that you don't lose it.
7620 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
7622 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
7623 * tests/glr-regression.at (Leaked semantic values when reporting
7624 ambiguity): New test case.
7625 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
7626 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
7627 now unnecessary yystackp parameter.
7628 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
7629 destructors can be called.
7631 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
7632 in existing testcases.
7634 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
7636 Don't leak semantic values for parent RHS when a user action cuts the
7637 parser, and clean up related code a bit.
7638 * tests/glr-regression.at (Leaked merged semantic value if user action
7639 cuts parse): Rename to...
7640 (Leaked semantic values if user action cuts parse): ... this. Add check
7641 for leaked parent RHS values.
7642 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
7643 between an unresolved state (non-empty chain of semantic options) and
7644 an incomplete one (signaled by an empty chain).
7645 (yyresolveStates): Document the interface. Move all manipulation of a
7646 successfully or unsuccessfully resolved yyGLRState to...
7647 (yyresolveValue): ... here so that yyresolveValue always leaves a
7648 yyGLRState with consistent data and thus is easier to understand.
7649 Remove the yyvalp and yylocp parameters since they are always just
7650 taken from the yys parameter. When reporting a discarded merged value
7651 in debugging output, note that it is incompletely merged. Document the
7653 (yyresolveAction): If resolving any of the RHS states fails, destroy
7654 them all rather than leaking them. Thus, as long as user actions are
7655 written to clean up the RHS correctly, yyresolveAction always cleans up
7656 the RHS of a semantic option. Document the interface.
7658 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
7660 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
7661 led to a segmentation fault in GNU Pascal. Problem reported
7664 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
7666 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
7667 mid-rule action inside a nonterminal symbol in order to declare a
7668 destructor for its semantic value.
7670 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
7672 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
7673 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
7674 __cplusplus && ! defined _STDLIB_H && !
7675 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
7676 defined free))]: Include <stdlib.h> rather than rolling our own
7677 declarations of malloc and free, to avoid problems with
7678 incompatible declarations (using 'throw') C++'s stdlib.h. This
7679 should fix Debian bug 340012
7680 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
7681 reported by Guillaume Melquiond.
7683 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
7685 * NEWS: Clarify symbols versus types in unused-value warnings.
7687 * configure.ac (AC_INIT): Bump version number.
7689 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
7691 * NEWS: Version 2.1a.
7692 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
7693 since C99 requires this.
7695 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
7697 * m4/c-working.m4: New file.
7698 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
7700 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
7702 * Makefile.maint: Merge from coreutils.
7704 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
7706 More portability fixes for problems summarized by Nelson H. F. Beebe.
7708 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
7709 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
7710 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
7711 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
7712 messes up because C++ code is compiled in 32-bit mode but linked
7715 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
7717 More portability fixes for problems summarized by Nelson H. F. Beebe.
7719 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
7720 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
7722 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
7723 nodist_PROGRAMS, since we don't need to actually compile the
7724 example if we're just doing a plain 'make'. This avoids bothering
7725 the installer unnecessarily about problems due to weird C++
7728 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
7730 More portability fixes for problems summarized by Nelson H. F. Beebe.
7732 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
7733 than #include "...", and compile with -I'.'. The old method was
7734 not portable, according to Posix and the C standard, and it does
7735 not work with Sun C 5.7, where previous #line directives affect
7736 the working directory used in later #include "..." directives.
7738 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7740 Various DJGGP specific issues in /djgpp
7742 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
7744 More portability fixes for problems summarized by Nelson H. F. Beebe.
7746 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
7747 '#include <map>' works and that you can apply ++ to iterators.
7749 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
7751 Work around portability problems summarized by Nelson H. F. Beebe in
7752 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
7754 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
7755 that '#include <string>' works.
7757 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
7758 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
7759 "warning: sorry: semantics of inline function static data `const
7760 unsigned char translate_table[262]' are wrong (you'll wind up with
7763 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
7764 or, xor to not_, and_, or_, and xor_, respectively. This works
7765 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
7766 random system header somewhere that includes the equivalent of
7769 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
7770 -E" works; it apparently doesn't work with PathScale EKO Compiler
7773 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
7775 During deterministic GLR operation, user actions should be able to
7776 influence the parse by changing yychar. To make this easier to fix and
7777 to make glr.c easier to evolve in general, don't maintain yytoken in
7778 parallel with yychar; just compute yytoken when needed.
7779 * tests/glr-regression.at (Incorrect lookahead during deterministic
7780 GLR): Check that setting yychar in a user action has the intended
7782 * data/glr.c (yyGLRStack): Remove yytokenp member.
7783 (yyclearin): Don't set *yytokenp.
7784 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
7785 yychar rather than *yytokenp to determine the current lookahead.
7786 Compute yytoken locally when needed.
7787 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
7790 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
7791 after `--report' documentation.
7793 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
7795 * src/parse-gram.y (grammar_declaration): Location of printer
7796 symbol is @1, not list->location. Bug reported by twlevo.
7797 * tests/input.at (Incompatible Aliases): Adjust to above change.
7799 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
7801 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
7802 all the test at once. This makes the output easier to read in the
7805 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
7806 got from <http://bro-ids.org/download.html>. The bug is that
7807 when two actions appeared in succession, the second one was
7808 scanned before the first one was added to the grammar rule
7809 as a midrule action. Bison then output the incorrect warning
7810 "parse.y:905.17-906.36: warning: unused value: $3".
7811 * src/parse-gram.y (BRACED_CODE, action): These are no longer
7812 associated with a value.
7813 (rhs): Don't invoke grammar_current_rule_action_append.
7814 (action): Invoke it here instead.
7815 * src/reader.c (grammar_midrule_action): Now extern.
7816 (grammar_current_rule_action_append): Don't invoke
7817 grammar_midrule_action; that is now the scanner's job.
7818 * src/reader.h (last_string, last_braced_code_loc):
7819 (grammar_midrule_action): New decls.
7820 * src/scan-gram.l (last_string): Now extern, sigh.
7821 (last_braced_code_loc): New extern variable.
7822 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
7823 rule already has an action.
7824 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
7825 * tests/input.at (AT_CHECK_UNUSED_VALUES):
7826 Add some tests to check that the above changes fixed the bug.
7828 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
7830 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
7831 All used changed. Check whether the symbol has a destructor,
7832 not whether it is typed.
7833 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
7834 that the values are still reported as unused. All line numbers
7837 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
7839 Work around a bug in bro 0.8, which underparenthesizes its
7840 definition of YYLLOC_DEFAULT.
7841 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
7843 * data/lalr1.cc: Likewise.
7844 * data/yacc.cc: Likewise.
7846 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
7848 Work around a bug in Pike 7.0, and give the Pike folks a
7849 better way to override the usual int widths.
7850 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
7851 user can override the types.
7852 (short): #undef, to work around a bug in Pike 7.0.
7853 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
7854 (union yyalloc.yyss): Use yytype_int16 rather than short.
7856 (yysigned_char): Remove.
7857 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
7858 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
7859 * tests/regression.at (Web2c Actions): Adjust to above changes.
7861 * src/reader.c (check_and_convert_grammar): New function.
7862 (reader): Close the input file even if something went wrong during
7863 parsing. Minor file descriptor leak reported by twlevo.
7865 * src/assoc.c (assoc_to_string): Use a default: abort (); case
7866 to pacify gcc -Wswitch-default.
7867 * src/scan-gram.l (adjust_location): Use a default: break; case
7868 to pacify gcc -Wswitch-default.
7869 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
7870 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
7871 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
7872 Move these decls to scan-skel.l, since they don't need to be
7874 * src/scan-skel.l: Accept the above decls.
7875 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
7878 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
7880 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
7881 since we don't want to insist on a version number at the start
7882 of the changelog every time.
7883 * Makefile.maint: Sync from coreutils a bit better.
7884 (sc_trailing_blank): Renamed from sc_trailing_space.
7886 (sc_no_if_have_config_h, sc_require_config_h):
7887 (sc_prohibit_assert_without_use): New rules.
7888 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
7889 (sc_dd_max_sym_length): Fix leading spaces in rule.
7890 (sc_system_h_headers): Prefix with @.
7891 (sc_useless_cpp_parens, m4-check): Output line numbers.
7892 (changelog-check): Allow version only in head.
7893 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
7894 satisfy new Makefile.maint rule.
7895 * data/glr.c: Likewise.
7896 * data/glr.cc: Likewise.
7897 * data/lalr1.cc: Likewise.
7898 * data/yacc.c: Likewise.
7899 * lib/ebitsetv.c: Likewise.
7900 * lib/lbitset.c: Likewise.
7901 * lib/subpipe.c: Likewise.
7902 * lib/timevar.c: Likewise.
7903 * src/system.h: Likewise.
7904 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
7905 * djgpp/Makefile.maint: Add copyright notice.
7906 * djgpp/README.in: Likewise.
7907 * djgpp/config.bat: Likewise.
7908 * djgpp/config.site: Likewise.
7909 * djgpp/config_h.sed: Likewise.
7910 * djgpp/djunpack.bat: Likewise.
7911 * djgpp/config.sed: Fix copyright notice to match standard format.
7912 * djgpp/subpipe.h: Likewise.
7913 * lib/bitsetv-print.c: Likewise.
7914 * lib/bitsetv.c: Likewise.
7915 * lib/subpipe.h: Likewise.
7916 * lib/timevar.c: Likewise.
7917 * lib/timevar.h: Likewise.
7918 * djgpp/subpipe.c: Use standard recipe for config.h.
7919 * lib/abitset.c: Likewise.
7920 * lib/bitset.c: Likewise.
7921 * lib/bitset_stats.c: Likewise.
7922 * lib/bitsetv-print.c: Likewise.
7923 * lib/bitsetv.c: Likewise.
7924 * lib/ebitsetv.c: Likewise.
7925 * lib/get-errno.c: Likewise.
7926 * lib/lbitset.c: Likewise.
7927 * lib/subpipe.c: Likewise.
7928 * lib/timevar.c: Likewise.
7929 * lib/vbitset.c: Likewise.
7930 * tests/local.at: Likewise.
7931 * src/scan-gram.l: Don't include verify.h, since system.h does
7933 * .x-sc_require_config_h: New file.
7934 * .x-sc_unmarked_diagnostics: New file.
7936 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
7938 Be a bit more systematic about using 'abort'.
7939 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
7940 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
7941 Put 'default: abort ();' before some other case, to satisfy older
7943 * lib/bitset_stats.c (bitset_stats_init): Likewise.
7944 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
7945 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
7946 * src/conflicts.c (resolve_sr_conflict): Likewise.
7947 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
7948 (get_decision_str, get_orientation_str, get_node_alignment_str):
7949 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
7950 (get_linestyle_str, get_arrowstyle_str): Likewise.
7951 * src/conflicts.c (resolve_sr_conflict):
7952 Use a default case rather than one for the one remaining enum
7953 value, to catch invalid enum values as well.
7954 * src/lalr.c (set_goto_map, map_goto):
7955 Prefer "assert (FOO);" to "if (!FOO) abort ();".
7956 * src/nullable.c (nullable_compute, token_definitions_output):
7958 * src/reader.c (packgram, reader): Likewise.
7959 * src/state.c (transitions_to, state_new, state_reduction_find):
7961 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
7962 (symbol_pack): Likewise.
7963 * src/tables.c (conflict_row, pack_vector): Likewise.
7964 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
7965 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
7966 * src/system.h: Don't include <assert.h>.
7967 (assert): New macro.
7969 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
7970 (Destructor Decl, Parser Function, Pure Calling):
7971 Describe rules for braces inside C code more carefully.
7973 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
7975 Fix some porting glitches found by Nelson H. F. Beebe.
7976 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
7977 compilers that don't understand that abort () does not return.
7978 * src/state.c (transitions_to): Likewise.
7979 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
7980 that '#include <cstdlib>' works.
7981 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
7982 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
7983 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
7984 for the benefit of some pre-C99 compilers.
7986 * bootstrap: Undo changes to gnulib files that autoreconf made.
7988 Minor fixups to get 'make maintainer-check' to work.
7989 * configure.ac: Don't use -Wnested-externs, as it's incompatible
7990 with the new verify.h implementation.
7991 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
7992 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
7993 * data/yacc.c (YYUSE): Likewise.
7994 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
7995 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
7996 * src/parse-gram.y (declaration): Don't pass a string constant
7997 to a function that expects char *, since GCC might complain
7998 about the constant value.
7999 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
8000 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
8001 before #defining them.
8002 * tests/glr-regression.at
8003 (Incorrectly initialized location for empty right-hand side in GLR):
8004 In yyerror, use the msg arg.
8005 (Corrupted semantic options if user action cuts parse):
8006 (Incorrect lookahead during deterministic GLR):
8007 (Incorrect lookahead during nondeterministic GLR):
8008 Don't name a local var 'index'; it shadows string.h's 'index'.
8010 2006-01-19 Akim Demaille <akim@epita.fr>
8012 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
8013 location, not just parts of it.
8015 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
8017 * NEWS: Document the fact that multiple %unions are now allowed.
8018 * doc/bison.texinfo (Union Decl): Likewise.
8019 * TODO: This feature is now implemented, so remove it from
8022 * Makefile.maint: Merge with coreutils Makefile.maint.
8023 (CVS_LIST): Use build-aux version if available.
8024 (VERSION_REGEXP): New macro.
8025 (syntax-check-rules): Add sc_no_if_have_config_h,
8026 sc_prohibit_assert_without_use, sc_require_config_h,
8027 sc_useless_cpp_parens.
8028 (sc_obsolete_symbols): Check for O_NDELAY.
8029 (sc_dd_max_sym_length): Track coreutils.
8030 (sc_unmarked_diagnostics): Look in all files, not just *.c.
8031 (sc_useless_cpp_parens): New rule.
8032 (news-date-check): Look for version or today's date.
8033 (changelog-check): Don't require version number near head.
8034 (copyright-check): Use current year instead of hardwiring 2005.
8035 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
8036 (announcement): Add --gpg-key-ID.
8038 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
8041 Avoid undefined behavior that addressed just before the start of an
8042 array. Problem reported by twlevo.
8043 * src/reader.c (packgram): Prepend a new sentinel before ritem.
8044 * src/lalr.c (build_relations): Rely on new sentinel.
8045 * src/gram.c (gram_free): Adjust to new sentinel.
8047 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
8049 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
8050 yylookaheadNeeds. All uses updated.
8051 (yysplitStack): Rename local yynewLookaheadStatuses to
8052 yynewLookaheadNeeds.
8053 * data/glr-regression.at (Incorrect lookahead during nondeterministic
8054 GLR): In comments, change `lookahead status' to `lookahead need'.
8056 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8058 * data/glr.c (yysplitStack): A little stylistic rewrite.
8060 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8062 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
8064 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
8066 * doc/bison.texinfo: Fix some typos.
8067 (GLR Semantic Actions): New subsection discussing special
8068 considerations because GLR semantic actions might be deferred.
8069 (Actions): Mention look-ahead usage of yylval.
8070 (Actions and Locations): Mention look-ahead usage of yylloc.
8071 (Special Features for Use in Actions): Add YYEOF entry and mention it
8072 in the yychar entry.
8073 In the yychar entry, remove mention of the local yychar case (pure
8074 parser) since this is irrelevant information when writing semantic
8075 actions and since it's already discussed in `Table of Symbols' where
8076 yychar is otherwise described as an external variable.
8077 In the yychar entry, don't call it the `current' look-ahead since it
8078 isn't when semantic actions are deferred.
8079 In the yychar and yyclearin entries, add note about deferred semantic
8081 Add yylloc and yylval entries discussing look-ahead usage.
8082 (Look-Ahead Tokens): When discussing yychar, don't call it the
8083 `current' look-ahead, and do mention yylval and yylloc.
8084 (Error Recovery): Cross-reference `Action Features' when mentioning
8086 (Table of Symbols): In the yychar entry, don't call it the `current'
8088 In the yylloc and yylval entries, mention look-ahead usage.
8090 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
8092 * tests/glr-regression.at: Update copyright year to 2006.
8094 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8096 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
8097 use during nondeterministic operation to track which stacks have
8098 actually needed the current lookahead.
8099 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
8100 Allocate, deallocate, resize, and otherwise shuffle space for
8101 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
8102 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
8103 appropriately during nondeterministic operation.
8104 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
8105 members to store the current lookahead to be used by the deferred
8107 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
8108 from which the RHS is taken. Set the lookahead members of the new
8109 yySemanticOption according to the lookahead status for stack yyk.
8110 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
8111 yyaddDeferredAction.
8112 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
8113 members of yySemanticOption before invoking yyuserAction, and then set
8114 them back to their current values afterward.
8115 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
8116 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
8117 * tests/glr-regression.at: Remove `.' from the ends of recent test case
8118 titles for consistency.
8119 (Leaked merged semantic value if user action cuts parse): In order to
8120 suppress lint warnings, use arguments in merge function, and assign
8121 char value < 128 in main.
8122 (Incorrect lookahead during deterministic GLR): New test case.
8123 (Incorrect lookahead during nondeterministic GLR): New test case.
8125 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8127 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
8128 !yyvaluep as signal that no semantic value is available to print.
8129 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
8130 to print a semantic value.
8132 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8134 * tests/glr-regression.at: For consistency with my newer test cases,
8137 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
8139 * data/glr.c (yyresolveValue): When merging semantic options, if at
8140 least one user action succeeds but a later one cuts the parse, then
8141 destroy the semantic value before returning rather than leaking it.
8142 (yyresolveStates): If a user action cuts the parse and thus
8143 yyresolveValue fails, ignore the (unset) semantic value rather than
8144 corrupting the yyGLRState, and empty the semantic options list since
8145 the user actions should have called all necessary destructors.
8146 Simplify code with YYCHK.
8147 * tests/glr-regression.at (Corrupted semantic options if user action
8148 cuts parse): New test case.
8149 (Undesirable destructors if user action cuts parse): New test case.
8150 Before applying any of this patch, this test case never actually failed
8151 for me... but only because the corrupted semantic options usually
8153 (Leaked merged semantic value if user action cuts parse): New test
8156 2006-01-05 Akim Demaille <akim@epita.fr>
8158 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
8160 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
8162 * data/c.m4 (b4_c_modern): New macro, with a new provision for
8163 _MSC_VER. Problem reported by Cenzato Marco.
8164 (b4_c_function_def): Use it.
8165 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
8167 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
8168 than rolling our own.
8170 2006-01-04 Akim Demaille <akim@epita.fr>
8172 Also warn about non-used mid-rule values.
8173 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
8175 (symbol_list_new): Adjust.
8176 * src/reader.c (symbol_typed_p): New.
8177 (grammar_rule_check): Use it.
8178 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
8180 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
8182 * tests/actions.at (Exotic Dollars): Adjust.
8184 2006-01-04 Akim Demaille <akim@epita.fr>
8186 * src/reader.c (grammar_midrule_action): If $$ is set in a
8187 mid-rule, move the `used' bit to its lhs.
8188 * tests/input.at (Unused values): New.
8189 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
8191 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
8193 * doc/bison.texinfo (Bison Options): Say more accurately what
8195 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
8196 about declarations in the grammar when in Yacc mode, as POSIX does
8197 not require a diagnostic when the grammar uses extensions.
8199 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
8201 Warn about dubious constructions like "%token T T".
8203 * src/symtab.h (struct symbol.declared): New member.
8204 * src/symtab.c (symbol_new): Initialize it to false.
8205 (symbol_class_set): New arg DECLARING, specifying whether
8206 this is a declaration that we want to warn about, if there
8207 is more than one of them. All uses changed.
8209 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
8210 Allow multiple %union directives, whose contents concatenate.
8211 * src/parse-gram.y (grammar_declaration): Likewise.
8212 Use muscle_code_grow, so that we don't need stype_line any more.
8215 * src/muscle_tab.c (muscle_grow): Fix comment.
8217 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
8218 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
8219 Update copyright year to 2006.
8221 2006-01-03 Akim Demaille <akim@epita.fr>
8223 Have glr.cc pass (some of) the calc.at tests.
8224 * data/glr.cc (b4_parse_param_orig): New.
8225 (b4_parse_param): Improve its definition, and bound it more
8226 clearly in the skeleton.
8227 (b4_epilogue): Append, instead of prepending, in order to keep
8229 Simplify the generation of auxiliary functions: locations and
8230 purity are mandated.
8231 (b4_global_tokens_and_yystype): Honor it.
8232 * data/location.cc (c++.m4): Don't include it.
8233 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
8235 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
8237 Be sure to initialize the first position's filename.
8238 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
8240 (AT_CHECK_CALC_GLR_CC): New.
8241 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
8243 2006-01-02 Akim Demaille <akim@epita.fr>
8245 * src/output.c (output_skeleton): Don't hard wire the inclusion of
8247 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
8248 * data/glr.cc: Do not include stack.hh.
8250 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
8252 * data/glr.c: Reformat whitespace with tabs.
8253 (b4_lpure_formals): Remove this unused m4 macro.
8254 * tests/cxx-type.at: Reformat whitespace with tabs.
8255 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
8256 since it's a member. Rename type to isNterm for clarity.
8258 2005-12-29 Akim <akim@sulaco.local>
8260 Let glr.cc catch up with symbol_value_print.
8261 * data/glr.cc (b4_yysymprint_generate): Replace by...
8262 (b4_yy_symbol_print_generate): this.
8263 (yy_symbol_print, yy_symbol_value_print): Declare them.
8265 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
8267 * src/location.h (boundary): Note that a line or column equal
8268 to INT_MAX indicates an overflow.
8269 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
8270 (rule_length_overflow, increment_rule_length, add_column_width):
8272 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
8273 (<SC_BRACED_CODE>"}"):
8274 Use increment_rule_length rather than incrementing it by hand.
8275 (adjust_location, handle_syncline): Diagnose overflow.
8276 (handle_action_dollar, handle_action_at):
8277 Fix bug with monstrosities like $-2147483648.
8278 Remove now-unnecessary checks.
8279 (scan_integer): Verify assumptions and remove now-unnecessary checks.
8280 (convert_ucn_to_byte): Verify assumptions.
8281 (handle_syncline): New arg LOC. All callers changed.
8282 Don't store through a value derived from char const * pointer.
8284 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
8287 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
8289 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
8290 Remove unnecessary forward static decls.
8292 2005-12-27 Akim Demaille <akim@epita.fr>
8294 * src/reader.c (grammar_current_rule_check): Also check that $$
8296 Take the rule to check as argument, hence rename as...
8297 (grammar_rule_check): this.
8298 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
8300 (grammar_rule_begin, grammar_rule_end): these, for consistency.
8301 (grammar_midrule_action, grammar_symbol_append): Now static.
8302 * tests/torture.at (input): Don't rely on the default action
8303 being always performed.
8304 * tests/calc.at: "Set" $$ even when the action is "cut" with
8306 * tests/actions.at (Exotic Dollars): Instead of using unused
8307 values, check that the warning is issued.
8309 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
8311 * NEWS: Improve wording for unused-value warnings.
8313 2005-12-22 Akim Demaille <akim@epita.fr>
8315 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
8316 (b4_yysymprint_generate): Rename as...
8317 (b4_yy_symbol_print_generate): this.
8318 Generate yy_symbol_print instead of yysymprint.
8319 Generate also yy_symbol_value_print, and use it.
8321 2005-12-22 Akim Demaille <akim@epita.fr>
8323 * NEWS: Warn about unused values.
8324 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
8326 (symbol_list_n_get, symbol_list_n_used_set): New.
8327 (symbol_list_n_type_name_get): Use symbol_list_n_get.
8328 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
8329 * src/reader.c (grammar_current_rule_check): Check that values are
8331 * src/symtab.c (symbol_print): Accept 0.
8332 * tests/existing.at: Remove the type information.
8334 Remove useless actions (beware of mid-rule actions: perl -000
8335 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
8336 * tests/actions.at (Exotic Dollars): Use unused values.
8337 * tests/calc.at: Likewise.
8338 * tests/glr-regression.at (No users destructors if stack 0 deleted):
8341 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
8344 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
8346 Undo 2005-12-01 tentative license wording change. The wording is
8347 still being reviewed by the lawyers, and we don't want to wait for
8348 them before publishing a test release. For now, revert to the
8350 * NEWS: Undo 2005-12-01 change.
8351 * data/glr.c: Revert to previous license wording.
8352 * data/glr.cc: Likewise.
8353 * data/lalr1.cc: Likewise.
8354 * data/location.cc: Likewise.
8355 * data/yacc.c: Likewise.
8357 * NEWS: Reword %destructor vs YYABORT etc.
8358 * data/glr.c: Use American spacing, for consistency.
8359 * data/glr.cc: Likewise.
8360 * data/lalr1.cc: Likewise.
8361 * data/yacc.c: Likewise.
8362 * data/yacc.c: Reformat comments slightly.
8363 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
8364 for consistency. Fix some spelling errors and reword recently-included
8366 * tests/cxx-type.at: Cast results of malloc, for C++.
8368 2005-12-21 Joel E. Denny <address@hidden>
8370 * tests/cxx-type.at: Construct a tree, count the parents of shared
8371 nodes, and free each node once and only once. Previously, the memory
8372 for semantic values was leaked instead.
8374 2005-12-21 Joel E. Denny <address@hidden>
8376 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
8377 (yylval, yylloc): If pure, #define to yystackp->yyval and
8378 yystackp->yyloc similar to yychar and yynerrs.
8379 (yyparse): If pure, remove local yylval and yylloc. Add local
8380 yystackp to accommodate pure definitions of yylval and yylloc.
8381 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
8382 yylvalp and yyllocp to &yylval and &yylloc.
8383 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
8384 namespace. Previously, nerrs and char were missing, but lval and lloc
8386 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
8387 yylvalp and yyllocp parameters since, if pure, these are now always
8388 accessible through yystackp. If not pure, they are still accessible
8390 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
8391 `if (YYID (N))' to pacify lint.
8393 2005-12-21 Akim Demaille <akim@epita.fr>
8395 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
8396 destroy the RHS symbols of a rule.
8397 * data/yacc.c (yylen): Initialize to 0.
8398 Keep its value to the number of items to possibly shift.
8399 In particular, a regular successful parse that ends on YYFINAL by
8400 a (internal) YYACCEPT must not have yylen != 0.
8401 (yyerrorlab, yyreturn): Pop the RHS.
8402 Reorder a bit to emphasize the `shifting' bits of code.
8403 (YYPOPSTACK): Now accept a number of items to pop.
8404 * data/lalr1.cc: Likewise.
8405 * data/glr.c: Formatting changes.
8406 Use goto instead of fall through.
8407 * doc/bison.texinfo (Destructor Decl): Complete.
8409 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8411 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
8412 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
8413 * djgpp/config.bat: Replace every occurence of the file name
8414 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
8415 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
8416 * djgpp/config.sed: Replace every occurence of the file name
8417 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
8418 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
8419 * djgpp/djunpack.bat: DJGPP specific file.
8420 * djgpp/fnchange.lst: DJGPP specific file.
8421 * djgpp/README.in: Add new information about how to unpack the bison
8422 source on MSDOS and other systems which have 8.3 file name restrictions
8423 using djunpack.bat and fnchange.lst.
8425 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
8427 * bootstrap (build_cvs_prefix): Remove; unused.
8428 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
8429 when getting gnulib.
8431 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
8433 * data/glr.c: Reorder typedef declarations for structs to match order
8434 of struct declarations.
8435 Rename yystack everywhere to yystackp except in yyparse where it's not
8437 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
8439 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
8440 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
8441 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
8444 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
8446 * tests/sets.at (Accept): Fix typos in regular expression used to
8447 sed out the final state number.
8449 Work around portability problem on Solaris 10: flex-generated
8450 files include <stdio.h> before <config.h>, which messes up
8451 because the latter defines __EXTENSIONS__. Address the problem
8452 by creating two new little files that include <config.h> first,
8453 then include the flex-generated files. Rewrite everyone else
8454 to include <config.h> first, as well.
8455 * lib/timevar.c: Always include "config.h".
8456 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
8457 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
8458 (EXTRA_bison_SOURCES): New macro.
8459 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
8460 * src/system.h: Don't include config.h.
8461 * src/LR0.c: Include <config.h> first.
8462 * src/assoc.c: Likewise.
8463 * src/closure.c: Likewise.
8464 * src/complain.c: Likewise.
8465 * src/conflicts.c: Likewise.
8466 * src/derives.c: Likewise.
8467 * src/files.c: Likewise.
8468 * src/getargs.c: Likewise.
8469 * src/gram.c: Likewise.
8470 * src/lalr.c: Likewise.
8471 * src/location.c: Likewise.
8472 * src/main.c: Likewise.
8473 * src/muscle_tab.c: Likewise.
8474 * src/nullable.c: Likewise.
8475 * src/output.c: Likewise.
8476 * src/parse-gram.y: Likewise.
8477 * src/print.c: Likewise.
8478 * src/print_graph.c: Likewise.
8479 * src/reader.c: Likewise.
8480 * src/reduce.c: Likewise.
8481 * src/relation.c: Likewise.
8482 * src/state.c: Likewise.
8483 * src/symlist.c: Likewise.
8484 * src/symtab.c: Likewise.
8485 * src/tables.c: Likewise.
8486 * src/uniqstr.c: Likewise.
8487 * src/vcg.c: Likewise.
8489 * src/parse-gram.y: Fix minor problems uncovered by lint.
8490 (current_lhs, current_lhs_location): Now static.
8491 (current_assoc): Remove unused variable.
8493 Cleanups so that Bison-generated parsers have less lint.
8494 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
8495 Prepend /*ARGSUSED*/, for lint's sake.
8496 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
8497 definition if 'lint' is defined.
8498 (YYID): New macro (or function, if lint).
8499 All uses of /*CONSTCOND*/0 replaced by YYID(0).
8500 * data/yacc.c: Likewise.
8501 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
8502 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
8503 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
8505 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
8506 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
8507 Use YYID(0) rather than 0, for lint.
8508 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
8509 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
8511 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
8513 * tests/glr-regression.at
8514 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8515 Close memory leak reported by twlevo.
8517 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
8519 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
8521 (yyparse): Iterate another stack in order to call user destructors.
8522 * tests/glr-regression.at (No users destructors if stack 0 deleted):
8524 (Duplicated user destructor for lookahead): This test now is expected
8527 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
8529 * NEWS: Document the following change.
8530 * data/yacc.c: Say "parser skeleton" rather than "file", since
8531 it's no longer just a file.
8532 * data/glr.c: Grant a special exception for C GLR parsers, that
8533 reads like the already-existing exception for C LALR(1) parsers.
8534 * data/glr.cc: Likewise.
8535 * data/lalr1.cc: Likewise.
8536 * data/location.cc: Likewise.
8537 * data/yacc.c: Reword the "written by" statement to clarify that
8538 it was the parser skeleton, not the entire output file.
8539 * data/glr.c: Written by Paul Hilfinger.
8540 * data/glr.cc: Written by Akim Demaille.
8541 * data/lalr1.cc: Likewise.
8543 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
8545 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
8546 Fix typos in previous change that broke 'make check'.
8547 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
8549 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
8550 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
8551 We can revert this once things settle down.
8553 * src/conflicts.c (conflicts_print): Don't print file name twice
8554 when %expect fails because there were no conflicts.
8555 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
8557 * tests/conflicts.at (%expect not enough, %expect too much):
8558 (%expect with reduce conflicts): Adjust to new behavior.
8560 2005-11-18 Akim Demaille <akim@epita.fr>
8562 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
8564 * NEWS: Document this.
8565 * doc/bison.texinfo (Expect Decl): Likewise.
8567 2005-11-16 Akim Demaille <akim@epita.fr>
8569 Generalize the display of semantic values and locations in traces.
8570 * data/glr.c (yy_reduce_print): Fix indices (again).
8571 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
8573 * data/lalr1.cc (yyreduce_print): Rename as...
8574 (yy_reduce_print): this.
8575 Display values and locations.
8576 * data/yacc.c (yy_reduce_print): Likewise.
8577 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
8578 (yysymprint): Move higher to be visible from yy_reduce_print).
8580 * tests/calc.at: Adjust the expected length of the traces.
8582 2005-11-14 Akim Demaille <akim@epita.fr>
8584 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
8585 from 1 to N, while values and location start at 0.
8586 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
8588 2005-11-14 Akim Demaille <akim@epita.fr>
8590 * data/glr.c (yy_reduce_print): Fix the $ number.
8592 2005-11-14 Akim Demaille <akim@epita.fr>
8594 "Use" parse parameters.
8595 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
8596 * data/glr.c, data/glr.cc: Use them.
8597 * data/glr.c (YYUSE): Have a C++ definition that supports
8600 2005-11-14 Akim Demaille <akim@epita.fr>
8602 * data/glr.c (yyexpandGLRStack): Declare only if defined.
8604 2005-11-14 Akim Demaille <akim@epita.fr>
8607 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
8609 2005-11-12 Akim Demaille <akim@epita.fr>
8611 Let position and location be PODs.
8612 * data/location.cc (position::initialize, location::initialize): New.
8613 (position::position, location::location): Define only if
8614 b4_location_constructors is defined.
8615 * data/lalr1.cc (b4_location_constructors): Define it for backward
8617 * doc/bison.texinfo (Initial Action Decl): Use initialize.
8619 2005-11-12 Akim Demaille <akim@epita.fr>
8621 * data/lalr1.cc: Move the body of the ctor and dtor into the
8622 parser file (instead of the header).
8623 Wrap the implementations in a "namespace yy".
8625 2005-11-12 Akim Demaille <akim@epita.fr>
8627 Have glr.c include its header file when created.
8628 * data/glr.c (b4_shared_declarations): New.
8629 Output them verbatim in the parser if !%defines, otherwise
8630 output then in the header file, and include it instead.
8632 2005-11-11 Akim Demaille <akim@epita.fr>
8634 * data/glr.c: Comment changes.
8636 2005-11-11 Akim Demaille <akim@epita.fr>
8638 When yydebug, report semantic and location values for reductions.
8639 * data/glr.c (yy_reduce_print): Report the semantic values and the
8641 (YY_REDUCE_PRINT): Adjust.
8642 (yyglrReduce): Use them.
8643 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
8644 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
8645 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
8648 2005-11-10 Akim Demaille <akim@epita.fr>
8650 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
8651 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
8652 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
8654 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
8656 * m4/cxx.m4, examples/Makefile.am: Don't build
8657 examples/calc++ if no C++ compiler is available. (trivial change)
8659 2005-11-09 Akim Demaille <akim@epita.fr>
8661 * src/scan-skel.l: Use a couple of asserts.
8663 2005-11-03 Akim Demaille <akim@epita.fr>
8665 In some (weird) cases, the final state number is incorrect.
8666 Reported by Alexandre Duret-Lutz.
8667 * src/LR0.c (state_list_append): Remove the computation of
8669 (save_reductions): Do it here.
8670 (get_state): Alpha conversion.
8671 (generate_states): Use a for loop.
8672 * src/gram.h (item_number_is_rule_number)
8673 (item_number_is_symbol_number): New.
8674 * src/state.c: Use assert.
8675 * src/system.h: Include assert.h.
8676 * tests/sets.at (Accept): New.
8678 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8680 * data/glr.c (yyfill): Adjust comment.
8681 (yyresolveAction): Initialize default location properly
8682 for empty right-hand sides.
8683 (yydoAction): Ditto.
8684 Add comment explaining apparently dead code.
8685 * tests/glr-regression.at
8686 (Incorrectly initialized location for empty right-hand side in GLR):
8689 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
8691 * bootstrap (cleanup_gnulib): New function. Use it to clean up
8692 gnulib when interrupted. This fixes some race conditions and
8693 works around some portability problems (one noted by Paul
8696 2005-10-22 Akim <akim@epita.fr>
8698 * Makefile.cfg: Adjust to config -> build-aux.
8701 2005-10-21 Akim Demaille <akim@epita.fr>
8703 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
8705 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
8706 * data/yacc.c (b4_Pure_if): Rename as...
8707 (b4_yacc_pure_if): this.
8708 (YY_SYMBOL_PRINT, yyparse): Adjust.
8709 * doc/bison.texinfo: Formatting changes.
8711 2005-10-21 Akim Demaille <akim@epita.fr>
8713 Finish the transition config -> build-aux.
8714 * configure.ac, Makefile.am: Use build-aux.
8715 * config/prev-version, config/announce-gen, config/Makefile.am:
8717 * build-aux/prev-version, build-aux/announce-gen,
8718 * build-aux/Makefile.am: here.
8720 2005-10-14 Akim Demaille <akim@epita.fr>
8722 * examples/calc++/test: Use set -x only when VERBOSE.
8724 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
8726 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
8727 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
8729 2005-10-13 Akim Demaille <akim@epita.fr>
8731 * src/scan-skel.l: Output the base name parts of the parser and
8733 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
8735 Use this to exercise C++ outputs in subdirs.
8736 Reported by Oleg Smolsky.
8738 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
8740 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
8741 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
8742 Problem reported by John P. Hartmann.
8743 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
8746 2005-10-12 Akim Demaille <akim@epita.fr>
8748 * src/parse-gram.y (version_check): Exit 63 to please missing
8749 (stands for "version mismatch).
8750 * tests/input.at, doc/bison.texinfo: Adjust.
8752 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
8754 Work around portability problems with Visual Age C compiler
8755 (xlc and xlC_r) reported by John P. Hartmann.
8756 * data/location.cc (initial_column, initial_line): Remove.
8757 All uses replaced by 0 and 1.
8758 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
8759 that xlc complains about.
8760 * src/scan-skel.l (skel_wrap): Likewise.
8761 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
8763 * data/yacc.c (YYMODERN_C): New macro, which also looks at
8764 __STDC_VERSION__. Use it everywhere instead of looking at
8765 __STDC__ and __cplusplus.
8767 2005-10-10 Akim Demaille <akim@epita.fr>
8769 * examples/calc++/test: Be quiet unless VERBOSE.
8771 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
8773 * data/c.m4 (yydestruct, yysymprint):
8774 Use YYUSE instead of casting to void.
8775 * data/glr.c (YYUSE): New macro.
8776 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
8777 Use it instead of rolling our own.
8778 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
8780 Use /*CONSTCOND*/ to suppress lint warnings.
8781 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
8782 (YY_STACK_PRINT): Use 'false' not '0'.
8784 (yysymprint_, yydestruct_): Use it instead of rolling our own.
8785 * data/yacc.c (YYUSE): New macro.
8786 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
8787 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
8788 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
8791 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
8792 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
8794 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
8796 Undo the parts of the unlocked-I/O change that substituted
8797 putc or puts for printf. This might hurt performance a bit,
8798 but some people prefer the printf style.
8799 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
8800 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
8801 All uses replaced by YYFPRINTF and YYDPRINTF.
8802 * data/yacc.c: Likewise.
8803 * lib/bitset.c (bitset_print): Likewise.
8804 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
8806 * lib/lbitset.c (debug_lbitset): Likewise.
8807 * src/closure.c (print_firsts, print_fderives): Likewise.
8808 * src/gram.c (grammar_dump): Likewise.
8809 * src/lalr.c (look_ahead_tokens_print): Likewise.
8810 * src/output.c (escaped_output): Likewise.
8811 (user_actions_output): Break apart two printfs.
8812 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
8813 * src/reduce.c (reduce_print): Likewise.
8814 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
8815 * src/system.h: Include unlocked-io.h rathe than stdio.h.
8817 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
8818 Use assignments rather than casts-to-void to suppress
8819 unused-variable warnings. This pacifies 'lint'.
8820 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
8821 unused-variable warnings.
8823 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8825 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
8827 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
8829 Use unlocked I/O for a minor performance improvement on hosts like
8830 GNU/Linux and Solaris that support unlocked I/O. The basic idea
8831 is to use the gnlib unlocked-io module, and to prefer putc and
8832 puts to printf when either will work (since the latter doesn't
8833 come in an unlocked flavor).
8834 * bootstrap (gnulib_modules): Add unlocked-io.
8835 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
8836 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
8837 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
8838 and similarly for puts and putc and printf.
8839 * data/yacc.c: Likewise.
8840 * lib/bitset.c (bitset_print): Likewise.
8841 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
8842 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
8844 * lib/lbitset.c (debug_lbitset): Likewise.
8845 * src/closure.c (print_firsts, print_fderives): Likewise.
8846 * src/gram.c (grammar_dump): Likewise.
8847 * src/lalr.c (look_ahead_tokens_print): Likewise.
8848 * src/output.c (escaped_output): Likewise.
8849 (user_actions_output): Coalesce two printfs.
8850 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
8851 * src/reduce.c (reduce_print): Likewise.
8852 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
8853 * src/system.h: Include unlocked-io.h rather than stdio.h.
8855 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
8856 this confuses xgettext.
8858 2005-10-02 Akim Demaille <akim@epita.fr>
8860 * bootstrap (gnulib_modules): Add strverscmp.
8861 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
8862 * m4/.cvsignore: Add strverscmp.m4.
8863 * src/parse-gram.y (%require): New token, new rule.
8864 (version_check): New.
8865 * src/scan-gram.l (%require): Adjust.
8866 * tests/input.at (AT_REQUIRE): New.
8868 * doc/bison.texinfo (Require Decl): New.
8869 (Calc++ Parser): Use %require.
8871 2005-10-02 Akim Demaille <akim@epita.fr>
8873 * data/location.cc: New.
8875 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
8876 Akim Demaille <akim@epita.fr>
8878 Make sure -odir/foo.cc creates dir/location.hh etc.
8879 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
8880 (spec_file_prefix, spec_verbose_file, spec_graph_file)
8881 (spec_defines_file): Now const.
8883 (short_base_name): Remove.
8884 * src/files.c: Adjust.
8885 (dirname.h): Include.
8886 (base_name): Don't prototype it.
8887 (finput): Remove, duplicates gram_in.
8888 (full_base_name, short_base_name): Replace by...
8889 (all_but_ext, all_but_tab_ext): these.
8890 (compute_base_names): Rename as...
8891 (compute_file_name_parts): this.
8892 Update to compute the new variables, including dir_prefix.
8893 Adjust dependencies.
8894 * src/output.c (prepare): Output them.
8895 * src/reader.c: Adjust to use gram_in, not finput.
8896 * src/scan-skel.l (@dir_prefix@): New.
8898 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8900 * lib/subpipe.c: New function end_of_output_subpipe() added
8901 to allow support for non-posix systems. This is a no-op function
8904 * lib/subpipe.h: New function end_of_output_subpipe() added
8905 to allow support for non-posix systems. This is a no-op function
8908 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
8909 handle the lack of pipe/fork functionality on non-posix systems.
8911 * djgpp/Makefile.maint: DJGPP specific file.
8913 * djgpp/README.in: DJGPP specific file.
8915 * djgpp/config.bat: DJGPP specific configuration file.
8917 * djgpp/config.sed: DJGPP specific configuration file.
8919 * djgpp/config.site: DJGPP specific configuration file.
8921 * djgpp/config_h.sed: DJGPP specific configuration file.
8923 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
8925 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
8927 2005-10-02 Akim Demaille <akim@epita.fr>
8929 * data/location.cc: New, extract from...
8930 * data/lalr1.cc: here.
8931 (location.hh): Include it after the user prologue, in case the
8932 filename type is defined by the user.
8933 Forward declation location and position before the pre-prologue.
8934 (yyresult_): Rename as...
8935 (yyresult): this, it's a local variable, not an attribute.
8936 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
8938 2005-10-01 Akim Demaille <akim@epita.fr>
8940 * examples/extexi: Restore the #line generation.
8942 2005-09-30 Akim Demaille <akim@epita.fr>,
8943 Alexandre Duret-Lutz <adl@gnu.org>
8945 Move the token type and YYSTYPE in the parser class.
8946 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
8947 (parser::token): New, from the moved free definition of tokens.
8948 (parser::semantic_value): Now a full definition instead of an
8949 indirection to YYSTYPE.
8950 (b4_post_prologue): No longer included in the header file, but
8951 in the implementation file.
8952 * doc/bison.texi (C+ Language Interface): Update.
8953 * src/parse-gram.y: Support unary %define.
8954 * tests/actions.at: Define global_tokens_and_yystype for backward
8955 compatibility until we update the tests.
8956 * tests/calc.at: Idem.
8957 (first_line, first_column, last_line, last_column): Define for lalr1.cc
8958 to simplify the code.
8960 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
8962 Port to SunOS 4.1.4, which lacks strtoul and strerror.
8963 Ah, the good old days! Problem reported by Peter Klein.
8964 * bootstrap (gnulib_modules): Add strerror, strtoul.
8965 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
8966 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
8968 2005-09-29 Akim Demaille <akim@epita.fr>
8970 * data/c.m4 (b4_error_verbose_if): New.
8971 * data/lalr1.cc: Use it.
8972 (YYERROR_VERBOSE_IF): Remove.
8973 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
8974 parser members, replaced by...
8975 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
8977 (yysyntax_error_): Takes the state number as argument.
8978 (yyreduce_print_): Use the argument yyrule, not the former
8981 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
8983 * bootstrap (gnulib_modules): Add verify.
8984 * lib/.cvsignore: Add verify.h.
8985 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
8986 * src/system.h (verify): Remove.
8987 Include verify.h instead.
8988 * src/tables.c (tables_generate): Use new API for 'verify'.
8990 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
8992 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
8993 local variables whose names begin with 'yy'.
8994 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8995 Trivial changes from Joel E. Denny.
8997 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
8999 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
9000 don't use alloca any more.
9002 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
9003 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
9004 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
9005 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
9006 to match yacc.c, to test more hosts.
9008 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
9010 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
9011 doesn't affect behavior.
9012 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
9014 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
9015 This works a bit better with glibc, if user code has already included
9017 * doc/bison.texinfo (Bison Parser): Document that users can't
9018 arbitrarily use malloc and free for other purposes. Document
9019 that <alloca.h> and <malloc.h> might be included.
9020 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
9021 user must declare alloca.
9023 * HACKING (release): Forwarn the Translation Project about
9026 2005-09-20 Akim Demaille <akim@epita.fr>
9028 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
9030 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
9032 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
9033 (YYSTACK_ALLOC_MAXIMUM): Use it.
9034 (yysyntax_error): New function.
9035 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
9036 multiple syntax errors are reported, and alloca is being used.
9037 Instead, reallocate buffers twice as big each time, so that
9038 we waste at most half the allocated memory. Start with a small
9039 (128-byte) buffer that will suffice in most cases anyway.
9040 Use yysyntax_error to do most of the work.
9042 * doc/bison.texinfo (Error Reporting, Table of Symbols):
9043 yynerrs is the number of errors reported, not the number of
9046 * tests/glr-regression.at (Duplicated user destructor for lookahead):
9047 Mark it as expected to fail.
9048 Cast result of malloc; problem reported by twlevo@xs4all.nl.
9049 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
9050 Don't start user-code symbols with "yy", to avoid name space problems.
9052 2005-09-19 Akim Demaille <akim@epita.fr>
9054 Remove the traits, failed experiment.
9055 It never proved useful, and anyway because of the current
9056 definition, it was not possible to have several specialization of
9057 this traits, making it useless.
9058 * data/lalr1.cc (yy:traits): Remove.
9059 Inline its definitions in the parser class.
9061 2005-09-19 Akim Demaille <akim@epita.fr>
9063 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
9064 least Mac OSX with a /usr/local install of gettext.
9066 2005-09-19 Akim Demaille <akim@epita.fr>
9068 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
9069 and yytoken for similarity with the other skeletons.
9071 2005-09-19 Akim Demaille <akim@epita.fr>
9073 * NEWS, configure.ac: update version number to 2.1a.
9075 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
9077 * NEWS: Version 2.1.
9079 * NEWS: Remove notice of yytname change, since it was never in an
9081 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
9083 * src/output.c (prepare): Likewise.
9084 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
9085 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
9086 is not defined. This is an awful hack, but it's enough for now.
9087 All callers changed.
9088 * tests/glr-regression-at (make_value): Args are const pointers now,
9089 to avoid GCC warning.
9090 (Duplicated user destructor for lookahead): New test. Currently
9091 skipped. It fails on my host but I'm not sure it'll always fail.
9093 2005-09-16 Akim Demaille <akim@epita.fr>
9095 * src/symtab.h (struct symbol): Declare the printer and destructor
9096 as const, to avoid accidental calls to free.
9097 (symbol_destructor_set, symbol_printer_set): Adjust.
9098 * src/symtab.c: Adjust.
9100 2005-09-16 Akim Demaille <akim@epita.fr>
9102 * data/c.m4 (b4_token_enums): New.
9103 (b4_token_defines): Rename as...
9104 (b4_token_enums_defines): this.
9105 (b4_token_defines): New, output only the #defines.
9106 * data/yacc.c, data/glr.c: Adjust.
9107 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
9108 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
9111 2005-09-16 Akim Demaille <akim@epita.fr>
9113 * data/lalr1.cc (yylex_): Remove, inline its code.
9114 (yyreport_syntax_error_): Remove, replaced by...
9115 (yysyntax_error_): this which returns a string and leaves to the
9116 caller the call to the users' error function.
9117 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
9118 Move from members of the parser object...
9119 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
9120 to local variables of the parse function.
9122 2005-09-16 Akim Demaille <akim@epita.fr>
9124 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
9125 since it's in Bison's name space.
9127 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
9129 * data/glr.c (yyresolveValue): Add default case to pacify
9130 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
9132 * NEWS: Document when yyparse started to return 2.
9133 * doc/bison.texinfo (Parser Function): Document when yyparse
9136 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
9137 (b4_filename_type): Renamed back from b4_file_name_type. All uses
9139 (class position): file_name -> filename (reverting). All uses changed.
9141 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
9143 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
9144 do anything if $@ exists. This reverts part of the 2005-07-07
9147 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
9149 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
9150 contains obsolete information and isn't worth distributing as a
9151 separate file anyway.
9152 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
9153 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
9154 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
9155 (yyparse): Abort if user code uses longjmp to throw an unexpected
9158 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
9160 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
9161 Suggested by twlevo@xs4all.nl.
9163 * data/glr.c (YYCHK1): Do not assume YYE is in range.
9164 This avoids a diagnostic from gcc -Wswitch-enum.
9165 Problem reported by twlevo@xs4all.nl.
9167 * doc/bison.texinfo: Don't use "filename", as per GNU coding
9168 standards. Use "file name" or "file" or "name", depending on
9170 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
9171 not to hack/foo.tab.c.
9172 (Calc++ Top Level): 2nd arg of main is not const.
9173 * data/glr.c: b4_filename -> b4_file_name.
9174 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
9176 (class position): filename -> file_name. All uses changed.
9177 * data/yacc.c: b4_filename -> b4_file_name.
9178 * lib/bitset.h: filename -> file_name in local vars.
9179 * lib/bitset_stats.c: Likewise.
9180 * src/files.c: Likewise.
9181 * src/scan-skel.l ("@output ".*\n): Likewise.
9182 * src/files.c (file_name_split): Renamed from filename_split.
9183 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
9185 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
9187 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
9188 to accommodate latest gnulib.
9190 * tests/glr-regression.at (Duplicate representation of merged trees):
9191 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
9193 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
9196 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
9198 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
9199 All uses changed. Invoke user destructor after an error during a
9200 split parse (trivial change from Joel E. Denny).
9202 * tests/glr-regression.at
9203 (User destructor after an error during a split parse): New test case.
9204 Problem reported by Joel E. Denny in:
9205 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
9207 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
9209 * README-cvs: Give URLs for recommended tools.
9210 Mention Gzip version problem, and bootstrapping issues.
9211 Remove troubleshooting section, as it's somewhat obsolete.
9213 * bootstrap (no_cache): New var, to accommodate different wget
9214 variants. Use it instead of '-C off'. Problem reported by
9217 * data/glr.c (yydestroyStackItem): New function.
9218 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
9219 debugging information. Problem reported by Joel E. Denny.
9221 2005-08-25 Akim Demaille <akim@epita.fr>
9223 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
9225 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
9227 * data/glr.c (yyrecoverSyntaxError, yyreturn):
9228 Don't invoke destructor on unresolved entries.
9229 * tests/glr-regression.at
9230 (User destructor for unresolved GLR semantic value): New test case.
9231 Problem reported by Joel E. Denny in:
9232 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
9234 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
9236 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
9238 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
9239 lib-prefix.m4, po.m4.
9241 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
9242 in yydestruct diagnostic, since it might not be an error.
9243 Problem reported by Joel Denny near end of
9244 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
9245 * data/lalr1.cc (yyerturn): Likewise.
9246 * data/yacc.c (yyreturn): Likewise.
9247 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
9249 * src/files.c: Remove obsolete FIXME comment.
9251 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
9252 with the other templates, and to fix bogus run-on messages such
9253 as the one reported at the end of
9254 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
9255 All callers changed to avoid the newline.
9256 (yyprocessOneStack): Output two lines rather than one, to accommodate
9257 the above change. This changes the debug output format slightly.
9259 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
9260 reported by Joel E. Denny in
9261 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
9263 * tests/glr-regression.at (Duplicate representation of merged trees):
9264 New test, from Joel E. Denny in:
9265 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
9266 * THANKS: Add Joel E. Denny.
9268 * configure.ac (AC_INIT): Bump to 2.0c.
9270 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
9272 * NEWS: Version 2.0b.
9274 * Makefile.am (SUBDIRS): Put examples before tests, so that
9275 "make check" doesn't finish with "All 1 tests passed".
9277 * tests/regression.at (Token definitions): Don't rely on
9278 AT_PARSER_CHECK for data that contains backslashes. It currently
9279 uses 'echo', and 'echo' isn't portable if its argument contains
9280 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
9281 that the byte '\0xff' is not printable in the C locale; it is,
9282 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
9283 not printable, so use '\0x81' to test.
9285 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
9286 version of GCC, since the macro is used with non-GCC compilers.
9288 Fix core dump reported by Pablo De Napoli in
9289 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
9290 * tests/regression.at (Invalid inputs with {}): New test.
9291 * src/parse-gram.y (token_name): Translate type before using
9294 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
9295 the user's name space. All uses changed to __attribute__
9297 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
9298 Add __attribute__ ((__noreturn__)).
9300 * etc/clcommit: Remove. We weren't using it, and it failed
9301 "make maintainer-distcheck".
9302 * Makefile.maint: Merge from coreutils.
9303 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
9304 (syntax-check-rules): Change list of rules as described below.
9305 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
9306 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
9307 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
9308 (sc_trailing_space): New rules.
9309 (sc_xalloc_h_in_src): Remove.
9310 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
9311 (sc_space_tab, sc_error_exit_success, sc_changelog):
9312 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
9313 (makefile-check, po-check, author_mark_check):
9314 (makefile_path_separator_check, copyright-check):
9315 Use grep -n, to make it easier to find violations.
9316 Use CVS_LIST and CVS_LIST_EXCEPT.
9317 (header_regexp, h_re): Remove.
9319 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
9320 (my-distcheck): Use more-modern GCC flags.
9321 (signatures, %.asc): Remove.
9322 (rel-files, announcement): Remove signatures.
9323 Restore old updating code, even though we don't use it, so
9324 that we're the same as coreutils.
9325 (alpha, beta, major): Depend on news-date-check.
9326 Make the upload commands.
9328 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
9329 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
9330 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
9331 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
9332 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
9333 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
9334 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
9335 * tests/sets.at: Likewise.
9337 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
9338 we comment out the Autoconf version number.
9339 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
9340 it's error-prone and "make maintainer-distcheck" rejects it.
9342 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
9343 Indent calls to "error" to pacify "make maintainer-distcheck",
9344 when the calls are not intended to be translated.
9345 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
9347 * src/Makefile.am (DEFS): Use +=, to pacify
9348 "make maintainer-distcheck".
9349 (bison_SOURCES): Add scan-skel.h.
9350 (sc_tight_scope): New rule, from coreutils.
9352 * src/files.c (src_extension, header_extension):
9353 Now static, not extern.
9354 * src/getargs.c (short_options): Likewise.
9355 * src/muscle_tab.c (muscle_table): Likewise.
9356 * src/parse-gram.y (current_class, current_type, current_prec):
9358 * src/reader.c (grammar_end, previous_rule_end): Likewise.
9359 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
9360 * src/main.c (main): Cast bindtextdomain and textdomain calls to
9361 void, to avoid warning when NLS is disabled.
9362 * src/output.c: Include scan-skel.h.
9363 (scan_skel): Remove decl, since scan-skel.h does this.
9365 Indent calls to "error" to pacify "make maintainer-distcheck".
9366 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
9367 * src/reader.h (gram_end, gram_lineno): New decls to pacify
9368 "make maintainer-distcheck".
9369 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
9370 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
9371 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
9372 (skel_lex_destroy, scan_skel): Move these decls to...
9373 * src/scan-skel.h: New file.
9374 * src/uniqstr.c (uniqstr_assert):
9375 Indent calls to "error" to pacify "make maintainer-distcheck".
9377 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
9380 * tests/torture.at: Revamp to avoid misuse of atoi that
9381 "make maintainer-distcheck" complained about.
9383 * examples/extexi (message): Don't print a message more than once,
9384 and omit line-number decoration that makes Emacs compile think
9385 that informative messages are worth worrying about.
9387 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
9389 * configure.ac: Update version number.
9391 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
9393 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
9394 autogenerated by the maintainer.
9395 * examples/calc++/.cvsignore: Add *.yy.
9397 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
9398 * lib/bitset_stats.c (bitset_stats_init): Likewise.
9399 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9401 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
9403 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
9404 from maintainer-distcheck about casting the argument of 'free'.
9406 * NEWS: Mention recent yytname changes.
9407 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
9409 * bootstrap: For translations that have not yet been upgraded to
9410 the new runtime-po domain, prime the pump by extracting the
9411 relevant strings from the obsolete translations. This code can be
9412 removed once the bison-runtime domain has been translated by each
9415 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
9416 now that token names are already quoted.
9418 Fix problem reported by Anthony Heading.
9419 * data/glr.c (YYTOKEN_TABLE): New macro.
9420 (yytname): Define if YYTOKEN_TABLE.
9421 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
9422 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
9423 (YYERROR_VERBOSE): Define the same way the other skeletons do.
9424 * src/output.c (prepare_symbols): Output token_table_flag.
9426 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
9428 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
9429 again if the first call fails.
9431 * data/glr.c (yytnamerr): New function.
9432 (yyreportSyntaxError): Use it to dequote most string literals.
9433 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
9434 with other skeletons. All uses changed.
9435 (yytnameerr_): New function.
9436 (yyreport_syntax_error): Use it to dequote most string literals.
9437 * data/yacc.c (yytnamerr): New function.
9438 (yyerrlab): Use it to decode most string literals.
9439 * doc/bison.texinfo (Decl Summary, Calling Convention):
9440 Clarify quoting convention of yytname.
9441 * src/output.c (prepare_symbols): Quote all names. This undoes
9442 the 2005-04-17 change, which is now accomplished (mostly) via
9443 changes in the parsers as described above.
9444 * tests/regression.at (Token definitions, Web2c Actions):
9445 Undo most 2005-04-17 change here, too.
9447 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
9449 Fix more problems reported by twlevo@xs4all.nl.
9450 * tests/cxx-type.at: Don't pipe output of ./types through sed to
9451 remove trailing spaces. This loses the exit status of ./types,
9452 and isn't needed since ./types shouldn't be emitting trailing
9454 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
9455 as the stack isn't valid in that case.
9457 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
9458 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
9459 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
9460 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
9462 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
9463 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
9464 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
9467 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
9468 overly-picky compilers that reject 'char *foo = "bar";'.
9470 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
9471 to FILE * parameter, not to stderr. This fixes a typo introduced
9472 in the 2005-07-12 change.
9474 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
9475 warnings from GCC 4.
9477 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
9478 (yyglrShiftDefer, yysplitStack):
9479 Remove unused parameters b4_pure_formals. All uses changed.
9480 (yyglrShift): Remove unused parameters b4_user_formals.
9482 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
9484 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
9486 Destructor cleanups and regularization among the three skeletons.
9487 * NEWS: Document the behavior changes.
9488 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
9489 stack before failing, as the cleanup code will do it for us now.
9490 * data/lalr1.cc (yyerrlab): Likewise.
9491 * data/glr.c (yyparse): Pop everything off the stack before
9492 freeing it, so that destructors get called properly.
9493 * data/lalr1.cc (yyreturn): Likewise.
9494 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
9495 This is more consistent.
9496 * doc/bison.texinfo (Destructor Decl): Mention more reasons
9497 why destructors might be called. 1.875 -> 2.1.
9498 (Destructor Decl, Decl Summary, Table of Symbols):
9499 Some English-language cleanups for %destructor.
9500 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9501 Add output line for destructor of start symbol.
9502 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
9503 because of that same extra output line.
9505 * NEWS: Document minor wording changes in diagnostics of
9506 Bison-generated parsers.
9507 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
9508 Remove unused formals. All uses changed.
9509 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
9510 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
9511 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
9512 Rename yyoverflowab to yyexhaustedlab.
9513 When memory exhaustion occurs during syntax-error reporting,
9514 report it separately rather than in a single diagnostic; this
9516 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
9517 (Memory Exhausted): Renamed from Parser Stack Overflow.
9518 Revamp wording slightly to prefer "memory exhaustion".
9519 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
9521 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
9523 Add i18n support to the GLR skeleton. Partially fix the C++
9524 skeleton; a C++ expert needs to finish this. Remove debugging
9525 msgids; there's little point to having them translated, since they
9526 can be understood only by someone who can read the
9527 (English-language) source code.
9529 Generate runtime-po/bison-runtime.pot automatically, so that we
9530 don't have to worry about garbage getting in that file. We'll
9531 make sure after the next official release that old msgids don't
9533 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
9535 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
9537 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
9538 Fix typos in explanations of the runtime file.
9539 * bootstrap: Change gettext keyword from YYI18N to YY_.
9540 Use standard Makefile.in.in in runtime-po, since we'll arrange
9541 for backward-compatible bison-runtime.po files in a different way.
9542 * data/glr.c (YY_): New macro, from yacc.c.
9543 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
9544 Translate messages intended for users.
9545 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
9546 the wording in the other skeletons. We don't know that the memory
9548 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
9549 Use same method that yacc.c uses.
9550 Don't translate debugging messages.
9551 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
9552 it doesn't work (yet), and requires C++ expertise to fix.
9553 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
9554 Move defn to a more logical place, to be consistent with other
9556 Don't translate debugging messages.
9557 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
9558 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
9559 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
9560 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
9562 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
9563 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
9565 * tests/glr-regression.at (Badly Collapsed GLR States):
9567 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9568 yylex should return 0 at EOF rather than aborting.
9570 Improve tests for stack overflow in GLR parser.
9571 Problem reported by twlevo@xs4all.nl.
9572 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
9574 (yyStackOverflow): Just longjmp, but with value 2 so that caller
9575 can handle the problem.
9576 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
9577 (yyparse): New local variable yyresult to record the result.
9578 Use result of setjmp to set it, rather than storing itinto
9580 (yyDone): Remove label.
9581 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
9582 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
9583 if YYABORT is used).
9584 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
9585 yyparse status; put status > 1 into diagnostic.
9586 Check that status==2 works.
9587 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
9588 Use exit status 3 for failure to open (which shouldn't happen).
9590 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
9592 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
9593 1 on syntax error; just let yyparse do its thing.
9594 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
9595 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
9596 (Exploding the Stack Size with Alloca):
9597 (Exploding the Stack Size with Malloc):
9598 Expect exit status 2, not 1, since the parser is supposed to blow
9599 its stack. Problem reported by twlevo@xs4all.nl.
9601 * data/glr.c (yyparse): Don't assume that the initial calls
9602 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
9603 Print a stack-overflow message and fail instead.
9604 Initialize the line-number information before creating the stack,
9605 so that the stack-overflow message can report line zero safely.
9607 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
9609 Fix problems reported by twlevo@xs4all.nl.
9610 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
9611 (yyuserMerge): Provide a default case if b4_mergers is empty.
9612 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
9613 * tests/glr-regression.at
9614 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9615 Add casts to pacify C++ compilers.
9616 * tests/glr-regression.at (Improper merging of GLR delayed action
9617 sets): Declare yylex before using it.
9618 * tests/Makefile.am (maintainer-check-g++): Fix a stray
9619 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
9620 test for valgrind; valgrind is independent of g++.
9621 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
9622 for compatibility with POSIX 1003.1-2001 (if running coreutils).
9623 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
9624 Use a destructor, so that we can expand the stack. Change
9625 YYSTYPE to char * so that we can free it. Cast result of malloc.
9627 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9629 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
9630 a valgrind failure. Problem reported by twlevo@xs4all.nl.
9632 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
9634 * PACKAGING: New file, suggested by Bruno Haible and taken from
9635 similar wording in gettext's PACKAGING file.
9636 * NEWS: Mention PACKAGING.
9637 * Makefile.am (EXTRA_DIST): Add PACKAGING.
9639 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
9641 * NEWS: Document recent i18n improvements.
9642 * bootstrap: Get runtime translations into runtime-po.
9643 Create runtime-po files automatically, if possible.
9644 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
9645 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
9646 does not infringe on the user's name space.
9647 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
9648 * doc/bison.texinfo (Internationalization): Revamp the English
9649 and Texinfo syntax a bit, to try to make it clearer.
9650 (Bison Options, Option Cross Key): Mention --print-localedir.
9651 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
9652 YYENABLE_NLS. Quote a bit more.
9653 * runtime-po/.cvsignore: New file.
9654 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
9655 * runtime-po/Rules-quot: Remove; now created by bootstrap.
9656 * runtime-po/quot.sed: Likewise.
9657 * runtime-po/boldquot.sed: Likewise.
9658 * runtime-po/en@quot.header: Likewise.
9659 * runtime-po/en@boldquot.header: Likewise.
9660 * runtime-po/insert-header.sin: Likewise.
9661 * runtime-po/remove-potcdate.sin: Likewise.
9662 * runtime-po/Makevars: Likewise.
9663 * runtime-po/LINGUAS: Likewise.
9664 * runtime-po/de.po: Likewise; we will rely on the translation project
9665 to maintain this, so "bootstrap" should get it.
9666 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
9668 * src/main.c (main): Bind the bison-runtime domain, too.
9670 2005-07-12 Bruno Haible <bruno@clisp.org>
9672 * data/yacc.c: Include <libintl.h> when NLS is enabled.
9673 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
9674 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
9675 * runtime-po: New directory.
9676 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
9677 $(DOMAIN).pot-update rule, so that old messages are never dropped.
9678 * runtime-po/Rules-quot: New file, copied from po/.
9679 * runtime-po/quot.sed: Likewise.
9680 * runtime-po/boldquot.sed: Likewise.
9681 * runtime-po/en@quot.header: Likewise.
9682 * runtime-po/en@boldquot.header: Likewise.
9683 * runtime-po/insert-header.sin: Likewise.
9684 * runtime-po/remove-potcdate.sin: Likewise.
9685 * runtime-po/Makevars: New file.
9686 * runtime-po/POTFILES.in: New file.
9687 * runtime-po/LINGUAS: New file.
9688 * runtime-po/bison-runtime.pot: New file.
9689 * runtime-po/de.po: New file.
9690 * m4/bison.m4: New file.
9691 * Makefile.am (SUBDIRS): Add runtime-po.
9692 (aclocaldir, aclocal_DATA): New variables.
9693 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
9695 * src/getargs.c (usage): Document --print-localedir option.
9696 (PRINT_LOCALEDIR_OPTION): New enum item.
9697 (long_options): Add --print-localedir option.
9698 (getargs): Handle --print-localedir option.
9699 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
9700 (Internationalization): New section.
9702 2005-07-12 Akim Demaille <akim@epita.fr>
9704 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
9705 for consistency with the rest of the code.
9706 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
9709 2005-07-12 Akim Demaille <akim@epita.fr>
9711 * src/parse-gram.y: Use %printer instead of YYPRINT.
9713 2005-07-12 Akim Demaille <akim@epita.fr>
9715 * src/symtab.h, src/symtab.c (symbol_print): New.
9716 * src/symlist.h, src/symlist.c (symbol_list_print): New.
9717 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
9719 2005-07-12 Akim Demaille <akim@epita.fr>
9721 * data/glr.c (b4_syncline): Fix (swap) the definitions of
9722 b4_at_dollar and b4_dollar_dollar.
9724 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
9726 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
9727 and Pennello's paper.
9729 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
9731 * data/yacc.c (yyparse): Undo previous patch. Instead,
9732 set yylsp[0] and yyvsp[0] only if the initial action
9733 sets yylloc and yylval, respectively.
9735 * data/yacc.c (yyparse): In the initial action, set
9736 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
9737 This avoids the use of undefined variables if the initial
9738 action does not set yylloc and/or yylval.
9740 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
9742 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
9743 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
9744 Remove from CVS. These files are automatically generated.
9745 * examples/extexi: Clarify that this file is now part of Bison,
9746 not GNU M4, and that it works with any POSIX-compatible Awk.
9747 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
9748 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
9749 so that we also get calc++-parser.yy. Geneate it.
9750 Use $(AWK), not gawk, since any conforming Awk will do.
9751 Put comment before action, since older 'make' can't handle comment
9753 $(BUILT_SOURCES): List all built sources, not just some of them.
9754 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
9755 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
9756 $($(calc_sources_generated)): Remove unnecessary test for existence
9757 of target. (This had a shell syntax error anyway; a stray "x".)
9758 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
9760 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
9762 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
9763 implied by the other modules.
9765 2005-07-06 Akim Demaille <akim@epita.fr>
9767 Bind examples/calc++ to the package.
9768 * examples/calc++/Makefile: Remove, replaced by...
9769 * examples/calc++/Makefile.am: ... this new file.
9770 * examples/calc++/test: Remove input.
9771 * examples/calc++/compile: Remove.
9772 * examples/Makefile.am: New.
9773 * configure.ac, Makefile.am: Adjust.
9774 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
9776 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
9778 * data/glr.c (yyFail): Drastically simplify; since the format argument
9779 never had any % directives, we can simply pass it to yyerror.
9780 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
9781 be modified later, as that is the usual style in glr.c.
9782 Problems reported by Paul Hilfinger.
9784 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
9785 and size overflow errors.
9786 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
9787 in case the user prolog sets feature-test macros like _GNU_SOURCE.
9788 (YYSIZEMAX): New macro.
9789 (yystpcpy): New function, taken from yacc.c.
9790 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
9791 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
9792 so that we don't have to maintain their signatures.
9793 (yyFail): Check for buffer overflow, by using vsnprintf rather
9794 than vsprintf. Allocate a bigger buffer if possible.
9795 Report an error if buffer allocation fails.
9796 (yyStackOverflow): New function.
9797 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
9798 the initialization was successful. It might fail if storage was
9800 (yyexpandGLRStack): Add more checks for storage allocation failure.
9801 Use yyStackOverflow to report failures.
9802 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
9803 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
9804 Don't assume stack number fits in int.
9805 (yysplitStack): Check for storage allocation failure.
9806 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
9807 can print diagnostics on storage allocation failure. All callers
9809 (yyresolveValue): Use yybool for boolean.
9810 (yyreportSyntaxError): Check for size-calculation overflow.
9811 This code is taken from yacc.c.
9812 (yyparse): Check for storage allocation errors when allocating
9815 2005-07-05 Akim Demaille <akim@epita.fr>
9817 Extract calc++ from the documentation.
9818 * doc/bison.texinfo (Calc++): Add the extraction marks.
9819 * examples/extexi: New, from the aborted GNU Programming 2E.
9820 Separate the different paragraph of a file with empty lines.
9821 * examples/Makefile: Use it to extract the whole calc++ example.
9823 2005-06-24 Akim Demaille <akim@epita.fr>
9825 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
9828 2005-06-22 Akim Demaille <akim@epita.fr>
9830 * doc/bison.texinfo (C++ Language Interface): First stab.
9831 (C++ Parsers): Remove.
9833 2005-06-22 Akim Demaille <akim@epita.fr>
9835 * data/lalr1.cc (yylex_): Honor %lex-param.
9837 2005-06-22 Akim Demaille <akim@epita.fr>
9839 Start a set of simple examples.
9840 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
9841 * examples/calc++/calc++-driver.hh,
9842 * examples/calc++/calc++-parser.yy,
9843 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
9844 * examples/calc++/compile, examples/calc++/test: New.
9846 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
9848 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
9849 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
9850 which stems from the 2005-05-27 patch.
9852 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9854 * data/glr.c: Modify treatment of unused parameters to permit use
9855 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
9857 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
9859 Fix infringement on user name space reported by Janos Zoltan Szabo.
9860 * data/yacc.c (yyparse): strlen -> yystrlen.
9862 2005-05-30 Akim Demaille <akim@epita.fr>
9864 * data/lalr1.cc (_): New.
9865 Translate the various messages.
9867 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
9869 Fix infringement on user name space reported by Bruno Haible.
9870 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
9871 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
9872 the user's name space.
9873 (alloca): Include <stdlib.h> to get it, if it's not built in.
9874 (YYMALLOC, YYFREE): Define only if needed.
9875 (malloc, free): Declare, but only if needed, as this infringes on
9876 the user name space.
9878 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
9880 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
9881 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
9883 * lib/ebitset.c (min, max): Undef before defining.
9884 * lib/vbitset.c (min, max): Likewise.
9885 * lib/subpipe.c (create_subpipe): Save local variables in case
9886 vfork clobbers them.
9888 2005-05-24 Bruno Haible <bruno@clisp.org>
9890 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
9891 error message syntax used by gcc-4.0.
9893 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
9895 * README: Mention m4 1.4.3. Remove obsolete advice about
9896 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
9898 * bootstrap: Remove workaround for problem I encountered with
9899 gettext 0.14.1; it seems to be fixed now.
9901 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
9903 * NEWS: Version 2.0a.
9905 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
9906 the previous change.
9908 Various maintainer cleanups.
9909 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
9910 conftest*, for benefit of CVS commands run at the same time as
9911 "configure". Add build-aux, since "bootstrap" now creates it and
9913 * Makefile.cfg (move_if_change): Remove.
9914 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
9915 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
9916 (po_repo, do-po-update, po-update, wget_files, get-targets):
9917 (config.guess-url_prefix, config.sub-url_prefix):
9918 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
9919 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
9920 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
9922 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
9923 this is now the recommended name.
9924 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
9925 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
9926 ylwrap. These files now go into build-aux.
9927 * config/move-if-change: Remove.
9928 * config/prev-version.txt: Bump from 1.75 to 2.0.
9930 * bootstrap: Add stdio-safer, unistd-safer modules.
9931 Remove m4/glibc2.m4 (introduced by latest gnulib, but
9933 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
9934 fopen-safer.c, stdio-safer.h, unistd-safer.h.
9935 * lib/subpipe.c: Include "unistd-safer.h".
9936 (create_subpipe): Make sure all the newly-created
9937 file descriptors are > 2, so that diagnostics don't
9938 get sent down them (which might cause Bison to hang, in theory).
9939 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
9940 * src/files.c (xfopen): Use fopen_safer, not fopen.
9942 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
9943 yesterday's yacc.c fix.
9945 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
9947 * data/glr.c, data/lalr1.cc: Update copyright date.
9949 Fix a destructor bug reported by Wolfgang Spraul in
9950 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
9951 * data/yacc.c (yyabortlab): Don't call destructor, and
9952 don't set yychar to EMPTY.
9953 (yyoverflowlab): Don't call destructor.
9954 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
9955 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
9956 since we no longer output the message "discarding lookahead token
9959 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9961 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
9962 fix a small glitch in debugging output.
9963 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
9964 after YY_SYMBOL_PRINT where needed.
9966 (struct yyGLRState): Add some comments.
9967 (struct yySemanticOption): Add some comments.
9968 (union yyGLRStackItem): Add comment.
9970 (yymergeOptionSets): Correct this to properly perform the union,
9971 avoiding infinite reported by Michael Rosien.
9974 * tests/glr-regression.at: Add test for GLR merging error reported
9977 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
9979 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
9980 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
9981 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
9982 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
9983 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
9984 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
9985 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
9986 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
9987 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
9988 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
9989 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
9990 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
9991 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
9992 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
9993 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
9994 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
9995 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
9996 src/derives.h, src/files.c, src/files.h, src/getargs.c,
9997 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
9998 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
9999 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
10000 src/output.h, src/parse-gram.c, src/parse-gram.h,
10001 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
10002 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
10003 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
10004 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
10005 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
10006 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
10007 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
10008 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
10009 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
10010 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
10011 tests/reduce.at, tests/regression.at, tests/sets.at,
10012 tests/synclines.at, tests/testsuite.at, tests/torture.at:
10013 Update FSF postal mail address.
10015 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
10017 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
10018 Problem reported by Ralf Menzel.
10020 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
10022 * tests/actions.at: Test that stack overflow invokes destructors.
10023 From Marcus Holland-Moritz.
10024 * data/yacc.c (yyerrlab): Move the code that destroys the stack
10026 (yyreturn): to here. That way, destructors are called properly
10027 even if the stack overflows, or the user calls YYACCEPT or
10028 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
10029 (yyoverflowlab): Destroy the lookahead.
10031 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
10033 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
10035 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
10037 * NEWS: Bison-generated C parsers no longer quote literal strings
10038 associated with tokens.
10039 * src/output.c (prepare_symbols): Don't escape strings,
10040 since users don't want to see C escapes.
10041 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
10043 * tests/input.at (Torturing the Scanner): Likewise.
10044 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
10046 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
10048 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
10049 the data size is known to be too small and we can't increase it.
10050 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
10052 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
10054 * src/parse-gram.y: Include quotearg.h.
10055 (string_as_id): Quote $1 before using it as a key, since the
10056 lexer no longer quotes it for us.
10057 (string_content): Don't strip quotes, since lexer no longer
10059 * src/scan-gram.l: Include quotearg.h.
10060 ("\""): Omit quote.
10061 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
10062 a key, since the rest of the lexer doesn't quote it.
10063 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
10064 * tests/regression.at (Token definitions): Check for backslashes
10067 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
10068 (YYSIZE_T): Define to unsigned long int when using an older compiler.
10069 (yyparse): Revamp code to generate long syntax error message, to
10070 make it easier to translate, and to avoid problems with arithmetic
10071 overflow. Change "virtual memory" to "memory" in diagnostic, since
10072 we don't know whether the memory is virtual.
10074 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
10076 * NEWS: Bison-generated C parsers now use the _ macro to
10078 * data/yacc.c (_) [!defined _]: New macro.
10079 All English strings wrapped inside this macro.
10080 * doc/bison.texinfo (Bison Parser): Document _.
10081 * po/POTFILES.in: Include src/parse-gram.c, since it now
10082 includes translateable strings that parse-gram.y doesn't.
10084 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
10086 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
10087 reverting the 2004-10-11 change to this function.
10088 (symbol_check_alias_consistency): Don't call symbol_type_set
10089 if the type name is already correct.
10090 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
10092 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
10094 * tests/regression.at (Token definitions): Don't use a token named
10095 c, as that generates a "#define c ..." that runs afoul of buggy
10096 stdlib.h that uses the identifier c as a member of struct
10097 drand48_data. Problem reported by Horst Wente.
10099 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
10101 * bootstrap: Change translation URL from
10102 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
10103 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
10104 redirection glitches. Problem reported by twlevo@xs4all.nl.
10106 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
10108 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
10109 after operands; POSIX says this isn't portable for the c99 command.
10111 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
10113 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
10114 immediately if a data overrun has occurred; this may help us track
10115 down what may be a spurious failure on MacOS.
10117 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
10119 Respond to problems reported by twlevo@xs4all.nl.
10121 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
10123 * src/vcg.h: Comment fix.
10124 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
10125 (G_CMAX): Change to -1 instead of INT_MAX.
10127 * data/yacc.c (yyparse): Omit spaces before #line.
10129 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
10131 * src/tables.c (state_number_to_vector_number): Put it inside an
10132 "#if 0", since it's not currently used. Problem reported by
10135 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
10137 * src/output.c (escaped_output): Renamed from
10138 escaped_file_name_output, since we now use it for symbol tags as
10139 well. All uses changed.
10140 (symbol_destructors_output, symbol_printers_output):
10141 Escape symbol tags too.
10142 Problem reported by Matyas Forstner in
10143 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
10145 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
10147 * src/output.c (user_actions_output, token_definitions_output,
10148 symbol_destructors_output, symbol_printers_output): Likewise.
10149 * src/reader.c (prologue_augment): Likewise.
10150 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
10152 * src/vcg.c (output_edge): Don't quote linestyle arg.
10153 Problem reported by twlevo@xs4all.nl.
10155 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
10157 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
10158 example, reported by Derek M Jones. Also, make the example even
10159 more outrageous, to better illustrate how bad the problem is.
10161 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
10163 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
10164 putsym. Typo reported by Sebastian Piping.
10166 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
10168 * doc/bison.texinfo (Language and Grammar): some -> same
10169 (Epilogue): int he -> in the
10170 Typos reported by Sebastian Piping via Justin Pence.
10172 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
10174 * tests/glr-regression.at (Improper handling of embedded actions
10175 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
10176 embedded actions and $-N in GLR parsers", work around an Autoconf bug
10177 with dollar signs in test names.
10178 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
10179 for a similar reason.
10181 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
10183 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
10184 wants to redefine G_VIEW.
10186 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
10188 * src/vcg.c (get_view_str): Remove case for normal_view.
10189 Problem reported by twlevo@xs4all.nl.
10191 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
10193 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
10194 Problem reported by twlevo@xs4all.nl.
10196 * doc/bison.texinfo: Change @dircategory from "GNU programming
10197 tools" to "Software development". Requested by Richard Stallman
10200 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
10202 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
10203 Problem reported by twlevo@xs4all.nl.
10205 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
10207 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
10208 keyword; it's not needed with modern compilers, and it doesn't
10209 affect correctness with older compilers. Suggested by
10212 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
10214 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
10215 gcc -Wswitch-default.
10216 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
10217 * data/yacc.c (yyparse): Likewise.
10219 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
10221 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
10222 already. Let config.h define any nonstandard values.
10224 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
10226 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
10227 for the benefit of slower hosts. Problem reported by
10228 Nelson H. F. Beebe.
10230 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
10232 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
10233 being defined and not used.
10234 * data/lalr1.cc (yyparse): Likewise.
10235 Use "if (false)" rather than "if (0)".
10237 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
10239 * TODO: Mention that we should allow NUL bytes in tokens.
10241 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
10243 * src/scan-skel.l (<<EOF>>): Don't close standard output.
10244 Problem reported by Hans Aberg.
10246 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
10248 * src/getargs.c (version): Happy new year; update overall
10249 program copyright date from 2004 to 2005.
10251 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
10252 Problem reported by Hans Aberg.
10253 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
10254 (Output file names.): Add a test for the case when standard output
10257 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
10259 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
10260 to fix an oversight in the Bison 2.0 manual.
10262 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
10264 * NEWS: Version 2.0. Reformat the existing news items since
10265 1.875, so that related items are grouped together.
10266 * configure.ac (AC_INIT): Bump version to 2.0.
10267 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
10269 * tests/torture.at (Exploding the Stack Size with Alloca): Set
10270 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
10271 otherwise, we're not testing alloca. Unfortunately there's no
10272 simple way to consult HAVE_ALLOCA here.
10274 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
10277 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
10278 hand. This avoids a warning about comparing int to size_t when
10279 GCC warnings are enabled.
10281 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
10283 * NEWS: Bison-generated parsers no longer default to using the
10284 alloca function (when available) to extend the parser stack, due
10285 to widespread problems in unchecked stack-overflow detection.
10286 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
10287 responsibility to set it to a positive value. This lets the user
10288 specify a value that is not a preprocessor constant.
10289 * data/yacc.c (YYMAXDEPTH): Likewise.
10290 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
10291 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
10292 to be a compile-time constant. However, explain the constraints on it.
10293 Also, explain the constraints on YYINITDEPTH.
10294 (Table of Symbols): Explain that alloca is no longer the default.
10295 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
10298 * doc/bison.texinfo (Location Default Action): Mention that n must
10299 be zero when k is zero. Suggested by Frank Heckenbach.
10301 2004-12-22 Akim Demaille <akim@epita.fr>
10303 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
10304 (parser::state_type, parser::semantic_type, parser::location_type):
10305 Private, not public.
10306 (parser::parse): Return ints, not bool.
10307 Returning a bool introduces a problem: 0 corresponds to false, and
10308 it seems weird to return false on success. Returning true changes
10309 the conventions for yyparse.
10310 Alternatively we could return void and send an exception.
10311 There is no clear consensus (yet?).
10312 (state_stack, semantic_stack, location_stack): Rename as...
10313 (state_stack_type, semantic_stack_type, location_stack_type): these.
10314 Private, not public.
10315 * tests/c++.at: New.
10316 * tests/testsuite.at, tests/Makefile.am: Adjust.
10318 2004-12-21 Akim Demaille <akim@epita.fr>
10320 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
10322 2004-12-21 Akim Demaille <akim@epita.fr>
10324 Don't impose std::string for filenames.
10326 * data/lalr1.cc (b4_filename_type): New.
10327 (position::filename): Use it.
10328 (parser.hh): Move the inclusion of stack.hh and location.hh below
10329 the user code, so that needed headers for the filename type can be
10331 Forward declare them before the user code.
10332 * tests/Makefile.am (check-local, installcheck-local): Pass
10333 TESTSUITEFLAGS to the TESTSUITE.
10335 2004-12-20 Akim Demaille <akim@epita.fr>
10337 Use more STL like names: my_class instead of MyClass.
10339 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
10340 (SemanticStack, SemanticType, StateStack, StateType)
10341 (TokenNumberType, Stack, Slice, Traits, Parser::location)
10342 (Parser::value): Rename as...
10343 (location_stack, location_type, rhs_number_type, semantic_stack)
10344 (semantic_type, state_stack, state_type, token_number_type, stack)
10345 (slice, traits, parser::yylloc, parser::yylval): these.
10347 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
10349 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
10351 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
10352 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10354 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
10356 Remove uses of 'short int' and 'unsigned short int'. This raises
10357 some arbitrary limits. It uses more memory but nowadays that's
10358 not much of an issue.
10360 This change does not affect the generated parsers; that's a different
10361 task, as some users will want to conserve memory there.
10363 Ideally we should use size_t to represent all object counts, and
10364 something like ptrdiff_t to represent signed differences of object
10365 counts; but that will require more code-cleanup than I have the
10366 time to do right now.
10368 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
10369 Use size_t, not int or short int, to count objects.
10370 * src/closure.c (nritemset, closure): Likewise.
10371 * src/closure.h (nritemset, closure): Likewise.
10372 * src/nullable.c (nullable_compute): Likewise.
10373 * src/print.c (print_core): Likewise.
10374 * src/print_graph.c (print_core): Likewise.
10375 * src/state.c (state_compare, state_hash): Likewise.
10376 * src/state.h (struct state): Likewise.
10377 * src/tables.c (default_goto, goto_actions): Likewise.
10379 * src/gram.h (rule_number, rule): Use int, not short int.
10380 * src/output.c (prepare_rules): Likewise.
10381 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
10382 errs, reductions): Likewise.
10383 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
10385 * src/tables.c (vector_number, tally, action_number,
10386 ACTION_NUMBER_MINIMUM): Likewise.
10387 * src/output.c (muscle_insert_short_int_table): Remove.
10389 2004-12-17 Akim Demaille <akim@epita.fr>
10391 * data/lalr1.cc: Extensive Doxygenation.
10392 (error_): Rename as...
10393 (error): this, since it is visible to the user.
10395 (Parser::message): Now an automatic variable from...
10396 (Parser::yyreport_syntax_error_): here.
10397 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
10399 * tests/input.at: Escape $.
10401 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
10403 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
10404 Parenthesize rhs to avoid obscure problems with mistakes like
10405 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
10406 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
10407 b4_rhs_location): Likewise.
10408 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
10409 b4_rhs_location): Likewise.
10411 2004-12-16 Akim Demaille <akim@epita.fr>
10413 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
10414 yacc.c: be sure to stay within yycheck_.
10415 * tests/actions.at: Re-enable C++ tests.
10417 2004-12-16 Akim Demaille <akim@epita.fr>
10419 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
10422 2004-12-16 Akim Demaille <akim@epita.fr>
10424 Use #define to handle the %name-prefix.
10426 * data/glr.c, data/yacc.c: Comment changes.
10427 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
10428 so that one can refer to yylex in the parser file, and have it
10429 renamed, as is the case with other skeletons.
10431 2004-12-16 Akim Demaille <akim@epita.fr>
10433 Move lalr1.cc internals into yy*.
10435 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
10436 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
10437 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
10438 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
10439 (empty_, final_, terror_, errcode_, ntokens_)
10440 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
10441 (looka_, ilooka_, error_range_, nerrs_):
10443 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
10444 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
10445 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
10446 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
10447 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
10448 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
10449 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
10450 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
10453 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
10455 Fix some problems reported by twlevo at xs4all.
10456 * src/symtab.c (symbol_new): Report an error if the input grammar
10457 contains too many symbols. This is better than calling abort() later.
10458 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
10459 (struct node, struct graph):
10460 Rename member expand to stretch. All uses changed.
10461 (struct graph): Remove member layoutalgorithm. All uses removed.
10462 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
10463 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
10465 (N_STRETCH): Rename from N_EXPAND. All uses changed.
10467 2004-12-15 Akim Demaille <akim@epita.fr>
10469 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
10470 Add more Doxygen comments.
10471 (symprint_, stack_print_, reduce_print_, destruct_, pop)
10472 (report_syntax_error_, translate_): Rename as...
10473 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
10474 (yypop_, yyreport_syntax_error_, yytranslate_): this.
10476 2004-12-15 Akim Demaille <akim@epita.fr>
10478 * data/lalr1.cc (lex_): Rename as...
10480 Move the trace here.
10481 Take the %name-prefix into account.
10482 Reported by Alexandre Duret-Lutz.
10484 2004-12-15 Akim Demaille <akim@epita.fr>
10486 Simplify the C++ parser constructor.
10488 * data/lalr1.cc (debug_): Rename as...
10489 (yydebug_): so that the parser's internals are always in the yy*
10492 (b4_parse_param_decl): Remove the leading comma as it is now only
10493 called as unique argument list.
10494 (Parser::Parser): Remove the constructor accepting a location and
10495 an initial debugging level.
10496 Remove from the other ctor the argument for the debugging level.
10497 (debug_level_type, debug_level, set_debug_level): New.
10499 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
10502 2004-12-15 Akim Demaille <akim@epita.fr>
10504 Remove b4_root related material: failure experiment
10505 (which goal was to allow to derive from a class).
10507 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
10508 definitions and uses.
10510 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
10512 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
10513 not 2, since it's not portable to subtract 1 from the start of an
10514 array. The new item 0 is never set or used. All uses changed.
10516 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
10517 the default definition of YYLLOC_DEFAULT. Problem reported
10518 by Frank Heckenbach.
10520 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
10522 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
10523 the normal case and one for the error case. Just use the
10524 first one uniformly. Problem reported by Frank Heckenbach.
10525 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
10526 use exactly the same macro in both places.
10527 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
10528 so that the normal-case YYRHSLOC works for the error case too.
10530 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
10531 (YYLLOC_DEFAULT): Use the same macro as glr.c.
10532 * doc/bison.texinfo (Location Default Action): Don't claim that
10533 we have an array of locations. Use the same macro for both glr
10534 and lalr parsers. Mention YYRHSLOC. Mention what happens when
10537 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
10539 * HACKING: Update email addresses to send announcements to.
10541 * configure.ac (AC_INIT): Bump version to 1.875f.
10543 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
10545 * NEWS: Version 1.875e.
10546 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
10548 * src/scan-skel.l: Include "complain.h", for "fatal".
10550 * src/relation.h (relation_print, relation_digraph):
10551 Relation sizes are of type relation_node, not size_t (this is
10552 merely a doc fix, since the two types are equivalent).
10553 (relation_transpose): Relation sizes are of type relation_node,
10555 * src/relation.c: Likewise.
10556 (top, infinity): Now of type relation_node, not int.
10557 (traverse, relation_transpose): Use relation_node, not int.
10559 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
10560 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
10561 (yyparse): Remove unused local introduced in 2004-10-25 patch.
10563 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
10564 specifying whether the test should be skipped. Use it tp
10565 specify that the [%defines %skeleton "lalr1.cc"] tests currently
10566 fail on some hosts, and should be skipped.
10568 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
10570 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
10571 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
10572 unless otherwise specified below.
10574 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
10575 to allocate kernel_base, kernel_items, kernel_size, since
10576 they needn't be initialized to 0.
10577 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
10578 * src/closure.c (new_closure): Likewise, for itemset.
10579 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
10580 * src/lalr.c (set_goto_map): Likewise, for temp_map.
10581 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
10582 (build_relations): Likewise for edge, states1, includes.
10583 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
10584 * src/reader.c (packgram): Likewise, for ritem, rules.
10585 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
10586 * src/relation.c (relation_digraph): Likewise for VERTICES.
10587 (relation_transpose): Likewise for new_R, end_R.
10588 * src/symtab.c (symbols_token_translations_init): Likewise for
10589 token_translations.
10590 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
10591 (token_actions): Likewise for yydefact, actrow, conflrow,
10593 (save_column): Likewise for froms[symno], tos[symno].
10594 (goto_actions): Likewise for state_count.
10595 (pack_table): Likewise for base, pos, check.
10596 (tables_generate): Likewise for width.
10598 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
10599 for initial core. Just have a separate core, so we needn't worry
10600 about whether kernel_size and kernel_base are initialized.
10602 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
10603 kernel_size, kernel_items): Remove unnecessary initialization.
10604 * src/conflicts.c (conflicts): Likewise.
10605 * src/derives.c (derives): Likewise.
10606 * src/muscle_tablc (muscle_insert): Likewise.
10607 * src/relation.c (relation_digraph): Likewise.
10608 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
10609 conflrow, conflict_table, conflict_list, table, check):
10612 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
10613 This is because all callers pass unsigned int.
10614 * src/closure.h (new_closure): Likewise.
10616 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
10617 (build_relations): Initialize includes[i] in all cases.
10618 * src/reader.c (packgram): Always initialize rules[ruleno].prec
10619 and rules[ruleno].precsym. Initialize members in order.
10620 * src/relation.c (relation_transpose): Always initialize new_R[i]
10622 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
10624 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
10625 conflict_list[0] was always 0, but now it isn't initialized.
10627 * src/table.c (table_grow): When conflict_table grew, the grown
10628 area wasn't cleared. Fix this.
10630 * lib/.cvsignore: Add strdup.c, strdup.h.
10631 * m4/.cvsignore: Add strdup.m4.
10633 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
10635 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
10636 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
10637 GOTO_NUMBER_MAXIMUM, since we occasionally compute
10638 ngotos + 1 without checking for overflow.
10639 (build_relations): Use END_NODE, not -1, to denote end of edges.
10640 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
10641 build_relations): Use goto_number, not int, for goto numbers.
10642 * src/tables.c (save_column, default_goto): Likewise.
10644 2004-11-23 Akim Demaille <akim@epita.fr>
10646 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
10647 of #defining from yystype.
10648 Don't typedef yystype, C++ does not need it.
10649 This lets it possible to forward declare it as union.
10651 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
10653 * bootstrap (gnulib_modules): Add extensions.
10654 Problem reported by Jim Meyering.
10656 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
10658 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
10659 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
10660 src/system.h, src/tables.c: XFREE -> free, to accommodate
10661 recent change to gnulib xalloc.h.
10662 Problem reported by Jim Meyering.
10664 2004-11-17 Akim Demaille <akim@epita.fr>
10666 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
10668 2004-11-17 Akim Demaille <akim@epita.fr>,
10669 Alexandre Duret-Lutz <adl@gnu.org>
10671 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
10673 (YYCDEBUG): Adjust.
10674 Use it instead of cdebug_.
10675 (Parser::debug_stream, Parser::set_debug_stream): New.
10676 (Parser::symprint_): Define cdebug_ for temporary backward
10678 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
10681 2004-11-17 Akim Demaille <akim@epita.fr>
10683 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
10684 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
10685 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
10686 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
10688 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
10690 * data/glr.c (yyloc_default): Remove; not used.
10691 Problem reported by Frank Heckenbach.
10693 2004-10-25 Akim Demaille <akim@epita.fr>
10695 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
10696 Introduce another definition to address simple location arrays.
10697 (yyGLRStack): New member: yyerror_range.
10698 (yyrecoverSyntaxError, yyparse): Update it.
10699 (yyrecoverSyntaxError): Use it when shifting the error token to
10700 have an accurate range, equivalent to the one computed by both
10701 yacc.c and lalr1.cc.
10702 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
10703 that column numbers start at column 0, as per GNU Coding
10704 Standards, the others tests, and the doc.
10705 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
10706 Adjust to the above change (first column is 0).
10707 And adjust the location of the "<error>", now covering the whole
10710 2004-10-22 Akim Demaille <akim@epita.fr>
10711 and Paul Eggert <eggert@cs.ucla.edu>
10713 Remove some arbitrary limits on goto numbers and relations.
10714 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
10715 initial values, since they're never used.
10716 (set_goto_map): ngotos is now unsigned, so test for overflow
10717 by seeing whether it wraps around to zero.
10718 * src/lalr.h (goto_number): Now size_t, not short int.
10719 (GOTO_NUMBER_MAXIMUM): Remove.
10720 * src/relation.c (relation_print, traverse, relation_transpose):
10721 Check for END_NODE rather than looking at sign.
10722 * src/relation.h (END_NODE): New macro.
10723 (relation_node): Now size_t, not short int.
10725 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
10727 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
10728 keyword, not an identifier. Problem reported by Baron Schwartz in
10729 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
10731 2004-10-11 Akim Demaille <akim@epita.fr>
10733 * src/symtab.c (symbol_check_alias_consistency): Also check
10734 type names, destructors, and printers.
10735 Reported by Alexandre Duret-Lutz.
10736 Recode the handling of associativity and precedence in terms
10737 of symbol_precedence_set.
10738 Accept no redeclaration at all, not even equal to the previous
10740 (redeclaration): New.
10741 Use it to factor redeclaration complaints.
10742 (symbol_make_alias): Don't set the type of the alias, let
10743 symbol_check_alias_consistency do it as for other features.
10744 * src/symtab.h (symbol): Add new member prec_location, and
10746 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
10747 * tests/input.at (Incompatible Aliases): New.
10749 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
10751 .cvsignore fixes to accommodate gnulib changes,
10752 and the practice of naming build directories "_build".
10753 * .cvsignore: Add "_*". Sort.
10754 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
10755 * m4/.cvsignore: Add "*_gl.m4".
10757 2004-10-06 Akim Demaille <akim@epita.fr>
10759 * src/parse-gram.y (add_param): Fix the truncation of trailing
10762 2004-10-05 Akim Demaille <akim@epita.fr>
10764 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
10765 whether the reducion was empty or not. This leaves room to
10766 improve the use of YYLLOC_DEFAULT in such a case.
10767 lalr1.cc is still experimental, so changing this is acceptable.
10768 And finally, there are probably not many users who changed the
10769 handling of locations in GLR, so changing is admissible too.
10771 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
10772 empty reduction, set @$ to an empty location ending the previously
10774 Adjust uses to make sure the code is triggered on empty
10776 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
10777 expected output: empty reductions have empty locations.
10779 2004-09-29 Akim Demaille <akim@epita.fr>
10781 * data/lalr1.cc: Move towards a more standard C++ coding style
10782 for templates: Class < T > -> Class<T>.
10784 2004-09-29 Akim Demaille <akim@epita.fr>
10786 * data/lalr1.cc: Reinstall the former ctor, for sake of
10787 compatibility, but warn it will be removed.
10788 Move towards a more standard C++ coding style (i.e., type *var ->
10791 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
10793 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
10794 since it's less likely to work if NULs are involved in the future.
10796 2004-09-27 Akim Demaille <akim@epita.fr>
10798 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
10800 2004-09-27 Akim Demaille <akim@epita.fr>
10802 * data/lalr1.cc (b4_parse_param_decl_1): New.
10803 (b4_parse_param_decl): Use it to have different names between attribute
10804 and argument names.
10805 (b4_cc_constructor_call): Likewise.
10807 2004-09-24 Akim Demaille <akim@epita.fr>
10809 * src/parse-gram.y (add_param): Strip the leading and trailing
10810 blanks from a formal argument declaration.
10811 (YY_LOCATION_PRINT): New.
10813 2004-09-24 Akim Demaille <akim@epita.fr>
10815 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
10816 after the location.
10818 2004-09-24 Akim Demaille <akim@epita.fr>
10820 * doc/bison.texinfo (Table of Symbols): Sort.
10822 2004-09-21 Akim Demaille <akim@epita.fr>
10824 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
10825 the useless parentheses.
10826 Suggested by Paul Eggert.
10828 2004-09-20 Akim Demaille <akim@epita.fr>
10830 Let the initial-action act on the look-ahead, and use it for the
10831 "initial push" (corresponding to an hypothetical beginning-of-file).
10832 And let lalr1.cc honor %initial-action.
10834 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
10836 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
10837 (Parser::Parser): Remove the ctor that used to initialize it.
10838 (Parser::parse): Like in the other skeletons, issue the "starting
10839 parse" message before any action.
10840 Honor %initial-action.
10841 Initialize the stacks with the lookahead.
10842 * data/yacc.c: Let $$ and @$ in %initial-action designate the
10844 Push them in the stacks.
10845 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
10847 2004-09-20 Akim Demaille <akim@epita.fr>
10849 * doc/bison.texinfo (Initial Action Decl): New.
10851 2004-09-20 Akim Demaille <akim@epita.fr>
10853 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
10854 clearer criterion to define it.
10855 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
10856 When reducing on an empty RHS, use the latest stacked location as
10858 yylloc is not always available.
10859 * data/glr.c: Likewise.
10860 Also, honor initial-actions.
10862 2004-09-20 Akim Demaille <akim@epita.fr>
10864 * data/yacc.c (YY_LOCATION_PRINT): New.
10865 Define when we know YYLTYPE's structure, i.e., when the default
10866 YYLLOC_DEFAULT is used.
10867 * data/c.m4 (b4_yysymprint_generate): Use it.
10868 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
10869 value of the result.
10870 (error_start_): Replace with...
10871 (error_range_): this location array.
10872 This allows to replace code relying on the implementation of
10873 locations by portable code.
10874 * data/yacc.c (yylerrsp): Replace with...
10875 (yyerror_range): this.
10876 Every time a token is popped, update yyerror_range[0], to have an
10877 accurate location for the error token.
10878 * data/glr.c (YY_LOCATION_PRINT): New.
10879 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
10880 deference a pointer.
10881 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
10882 report the location in %printers.
10884 * src/scan-skel.l: Instead of abort, report error messages to ease
10885 understanding skeleton scanning failures.
10887 2004-09-16 Akim Demaille <akim@epita.fr>
10889 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
10890 (iterator, const_iterator): these, to be more in the C++ spirit.
10891 Also, return reverse iterators so that when displaying the stack
10892 we display its bottom first.
10893 (Parser::stack_print_, Parser::reduce_print_): Match the messages
10895 We should probably use vector here though.
10897 2004-09-16 Akim Demaille <akim@epita.fr>
10899 Have more complete shift traces.
10901 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
10902 to report Shifts instead of ad hoc YYDPRINTF invocations,
10903 including for the error token.
10904 * data/lalr1.cc (symprint_): Output the location.
10905 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
10906 output the location within the %printer.
10907 Activate GLR tests, at least to make sure they compile properly.
10908 They still don't pass though.
10909 * tests/calc.at: Adjust expect verbose output, since now "Entering
10910 state..." is on a different line than the "Shifting" message.
10912 2004-09-08 Akim Demaille <akim@epita.fr>
10914 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
10915 Bison directive from the Bison file to the invocation of this
10916 macro, so that these directives are passed to
10917 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
10918 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
10919 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
10920 the extra Bison directives instead of the whole series.
10921 Change the grammar so that there are recoverable errors, and
10922 unrecoverable errors. Now we can have the parser give up before
10923 consuming the whole input. As a result we now can observe that
10924 the lookahead is freed when needed.
10925 Change the parser source to parse argv[1] instead of a hard coded
10927 Simplify yylex, and give a value and location to EOF.
10928 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
10929 passed directives already coded in the file.
10930 Add some tests to check the location of "error".
10931 For some tests, the C++ parser is correct, and not yacc.c.
10932 For other tests, they provide different, but unsatisfying, values,
10933 so keep the C++ value so that at least one parser is "correct"
10934 according to the test suite.
10935 (Actions after errors): Remove, this is subsumed by the
10936 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
10938 2004-09-06 Akim Demaille <akim@epita.fr>
10940 * data/lalr1.cc: Adjust the indentation of the labels.
10941 (Parser::pop): New.
10944 2004-09-06 Akim Demaille <akim@epita.fr>
10946 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
10947 argument, an informative message.
10948 Call YY_SYMBOL_PRINT.
10949 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
10950 * data/lalr1.cc (destruct_): Likewise.
10951 In addition, no longer depend on b4_yysymprint_generate and
10952 b4_yydestruct_generate to generate these functions, do it "by
10955 2004-09-03 Akim Demaille <akim@epita.fr>
10957 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
10958 invoked, yydestruct the lookahead.
10959 * tests/calc.at (Calculator $1): Update the expected lengths of
10960 traces: there is an added line for the discarded lookahead.
10961 * doc/bison.texinfo (Destructor Decl): Some rewording.
10962 Define "discarded" symbols.
10964 2004-09-02 Akim Demaille <akim@epita.fr>
10966 * data/lalr1.cc (translate_, destruct_): No reason to be static.
10968 2004-09-02 Akim Demaille <akim@epita.fr>
10970 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
10971 (YYDSYMPRINTF): Rename as...
10972 (YY_SYMBOL_PRINT): this.
10973 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
10975 Use it instead of direct symprint_ calls.
10976 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
10979 2004-09-02 Akim Demaille <akim@epita.fr>
10981 * data/lalr1.cc (b4_yysymprint_generate): New.
10982 (symprint_): New member function, defined when YYDEBUG.
10983 Use it consistently instead of token/nterm debugging output by
10985 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
10986 %printer calls to use cdebug_ when using lalr1.cc.
10988 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
10990 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
10991 with #ifdef YYDEBUG.
10993 2004-08-26 Akim Demaille <akim@epita.fr>
10995 * doc/bison.texinfo (Implementing Loops): Rename as...
10996 (Implementing Gotos/Loops): this.
10998 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
11000 Adjust to latest gnulib.
11001 * bootstrap (gnulib_modules): Add xalloc-die.
11002 Set LC_ALL=C so that file names sort consistently.
11003 Prefer the gnulib copies of gettext.m4, glibc21.m4,
11004 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
11005 uintmax_t.m4, ulonglong.m4.
11006 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
11007 po.m4 since we are now using _gl.m4 instead.
11009 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
11011 * src/scan-action.l: Remove. Scanning of semantic actions is
11012 handled in scan-gram.l.
11014 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
11016 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
11018 * src/location.h (struct): The file member is a uniqstr.
11019 (equal_boundaries): Use UNIQSTR_EQ for comparison.
11021 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
11023 Fix bug with non-%union parsers that have printers or destructors,
11024 which led to a Bison core dump. Reported by Peter Fales in
11025 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
11027 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
11028 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
11029 not to our own type.
11030 * src/output.c (symbol_destructors_output, symbol_printers_output):
11031 Don't assume %union.
11032 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
11033 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
11034 UNION-FLAG. All callers changed.
11035 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
11036 Use type char, not unsigned int, when declaring an array of char;
11037 this lets us remove a cast.
11038 (Printers and Destructors): Add non-%union test cases.
11040 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11042 * doc/bison.texinfo: Minor editorial changes, mostly to the new
11043 GLR writeups. E.g., avoid frenchspacing and the future tense,
11044 change "lookahead" to "look-ahead", and change "wrt" to "with
11047 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11049 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
11050 New sections, split off from the GLR Parsers section. Put the new
11051 Simple GLR Parser near the start of the GLR section, for clarity.
11052 Rewrite connective text.
11054 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
11056 * doc/bison.texinfo (Simple GLR Parsers): New section.
11058 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11060 * NEWS, TODO, doc/bison.texinfo:
11061 Use "look-ahead" instead of "lookahead", to be consistent.
11062 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
11063 while we're fixing "look-ahead".
11064 * src/conflicts.c (shift_set): Renamed from shiftset.
11065 (look_ahead_set): Renamed from lookaheadset.
11066 * src/print.c: Likewise.
11067 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
11068 name for "lookahead".
11069 (report_types, usage): Likewise.
11070 * src/getargs.h (report_look_ahead_tokens): Renamed from
11072 * src/lalr.c (compute_look_ahead_tokens): Renamed from
11073 compute_lookaheads.
11074 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
11075 (look_ahead_tokens_print): Renamed from lookaheads_print.
11076 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
11077 state_rule_lookaheads_print.
11078 * src/state.h: Likewise.
11079 (reductions.look_ahead_tokens): Renamed from lookaheads.
11080 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
11081 AT_DATA_LOOKAHEADS_GRAMMAR.
11083 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
11085 * README: Update location of patched M4 distribution.
11087 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
11089 Don't assume the C++ compiler takes the same arguments as the C compiler
11091 * configure.ac (O0CXXFLAGS): New var.
11092 * tests/atlocal.in (CXXFLAGS): Use it.
11094 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
11096 Fix some "make check" problems with C++ reported by
11097 Albert Chin-A-Young for Tru64 C++ in this thread:
11098 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
11100 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
11101 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11102 Output to a .cc file for C++, not to a .c file.
11103 * tests/calc.at (AT_CHECK_CALC): Likewise.
11104 * tests/regression.at (AT_CHECK_DANCER): Likewise.
11105 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
11107 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
11109 * tests/calc.at, tests/actions.at: Workaround for SGI
11110 C++ compiler. (trivial change)
11112 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
11114 Spent a few hours checking out which prerequisite versions the
11115 current sources actually require. I went all the way back to
11116 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
11117 a seemingly endless set of combinations of versions more recent
11118 than that. The bottom line is that the current sources require
11119 fairly recent versions of the build tools, and it'll be some work
11121 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
11122 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
11123 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
11124 Add comments explaining why those particular versions are
11127 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
11128 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
11129 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
11131 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
11132 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
11134 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
11136 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
11137 0.11.5. Suggested by Bruno Haible.
11138 * bootstrap: Remove gettext version checking.
11140 * doc/bison.texinfo (Decl Summary): Also mention that %union
11141 can depend on prerequisite types. Problem reported by Tim
11144 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
11146 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
11147 * README-alpha: Don't tell people not to package this.
11149 * bootstrap: Don't assume $(...) works; use `...` instead.
11150 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
11153 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
11154 put into the -d output file, and mention what to do if YYSTYPE is
11155 defined as a macro.
11157 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
11159 Undo change made earlier today: it caused autopoint to not bring
11160 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
11163 * bootstrap: Check that gettext version matches what's in
11164 configure.ac. Warn users to ignore robots.txt ERROR 404.
11165 * bootstrap: Undo today's earlier change (logged below).
11166 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
11168 The gettext version checking is causing more trouble than it's
11169 curing; remove it. Problem reported by Paul Hilfinger.
11171 * bootstrap: Issue a warning that one can expect a message
11172 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
11173 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
11175 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
11177 Ensure that the C++ compiler used for testing actually works on a
11178 simple test program; if not, skip the C++-related tests. Problem
11179 reported by Vin Shelton in:
11180 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
11182 * m4/cxx.m4: New file.
11183 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
11184 * tests/atlocal.in (BISON_CXX_WORKS): Add.
11185 * tests/local.at (AT_COMPILE_CXX): Use it.
11187 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11189 * data/glr.c (yylloc): Output this macro even if locations are not
11190 being generated, as the GLR parser needs it even in that case.
11191 Problem reported by Troy A. Johnson
11192 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
11194 * configure.ac (AC_INIT): Update to 1.875e.
11196 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11198 * NEWS: Version 1.875d.
11199 * configure.ac (AC_INIT): Likewise.
11200 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
11202 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
11203 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
11204 lalr1.cc runs afoul of the first, and the last two are no longer
11205 supported by GCC 3.4.0.
11206 * README: Mention GNU m4 1.4 or later; mention m4 patches.
11207 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
11209 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
11211 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
11212 unsigned int, for compatibility with latest gnulib hash module.
11213 * src/state.c (state_hash, state_hasher): Likewise.
11214 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
11215 * src/uniqstr.c (hash_uniqstr): Likewise.
11217 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
11219 * NEWS: Unescaped newlines are no longer allowed in char & strings.
11221 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
11222 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
11223 character and string literals.
11224 (unexpected_end): New function.
11225 (unexpected_eof): Use it.
11226 (unexpected_newline): New function.
11227 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
11230 * NEWS: Document %expect-rr.
11232 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
11233 Fix typo by replacing $1 with $option.
11234 Remove more 'intl'-related files.
11235 Don't DEFUN AM_INTL_SUBDIR twice.
11237 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
11238 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
11240 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
11241 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
11242 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
11243 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
11244 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
11245 * src/.cvsignore: Add *.output.
11247 * src/parse-gram.y: Put copyright notice inside %{ %} so it
11248 gets copied to the output file.
11250 2004-04-28 Paul Eggert <eggert@twinsun.com>
11252 Get files from the gnulib and po repositories, instead of relying
11253 on them being in our CVS. Upgrade to latest versions of gnulib
11256 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
11257 * bootstrap: Bootstrap from gnulib and po repositories.
11258 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
11259 * README-cvs: Document these changes. Remove version numbers from
11260 mentions of build tools, since they change so often. Mention Flex.
11262 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
11263 (gl_USE_SYSTEM_EXTENSIONS): Add.
11264 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
11265 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
11267 (AC_ISC_POSIX): Remove; we no longer support this
11268 ancient OS, as it gets in the way of latest Autoconf & gnulib.
11269 (AC_HEADER_STDC): Remove: we now assume C89 or better.
11270 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
11271 Do not check for C89 headers, except for locale.h which is used
11272 by the Yacc library and must port to K&R hosts.
11273 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
11274 Do not check for C89 functions, except for setlocale which is
11275 used by the Yacc library.
11276 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
11277 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
11278 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
11279 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
11280 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
11281 AM_GNU_GETTEXT): Remove; now done by:
11282 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
11283 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
11286 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
11287 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
11288 Define to empty, as gnulib.mk will do the rest for us.
11289 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
11291 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
11292 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
11294 * src/files.c: Include gnulib's xstrndup.h.
11296 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
11297 (REALLOC): Use xnrealloc, for likewise.
11298 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
11299 (strnlen, memrchr): Remove decls; functions no longer used.
11300 Include <stpcpy.h>.
11302 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
11303 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
11304 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
11305 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
11306 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
11307 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
11308 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
11309 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
11310 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
11311 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
11312 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
11313 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11314 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
11315 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
11316 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
11317 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
11318 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
11319 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
11320 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
11321 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
11322 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
11323 Remove, as these files are now generated automatically
11324 by bootstrap or automake.
11326 * po/ChangeLog: Remove: all but one entry was a duplicate
11327 of this file, and I moved that 2000-11-02 entry here.
11329 * config/.cvsignore: Add Makefile, depcomp, install-sh.
11330 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
11331 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
11332 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
11333 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
11334 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
11335 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
11336 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
11337 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
11338 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
11339 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
11341 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
11342 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
11343 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
11344 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
11345 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
11346 * src/.cvsignore: Remove *_.c.
11349 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
11350 support it. (The latest stable gzip doesn't.)
11352 2004-04-27 Paul Eggert <eggert@twinsun.com>
11354 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
11355 case, as stos_ is now used by destructors due to the 2004-02-09
11358 Remove more K&R C support.
11359 * lib/libiberty.y (PARAMS): Remove. All uses removed.
11360 * lib/subpipe.c (errno): Remove decl.
11361 Include <stdlib.h> unconditionally.
11362 (EXIT_FAILURE): Remove macro.
11363 * src/complain.c (vfprintf, strerror): Remove.
11364 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
11366 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
11367 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
11368 (strchr, strspn, memchr): Remove decls.
11369 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
11370 unconditionally. Do not declare perror.
11371 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
11374 * src/complain.c (_): Remove useless defn, as system.h defines this.
11376 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
11377 with latest obstack.h.
11378 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
11379 to procedure types, as obstack.h now does that for us.
11380 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
11382 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
11383 so that this include file can stand alone.
11384 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
11385 does this now. Include subpipe.h first after config.h, to
11386 test whether it can stand alone.
11388 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
11389 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
11390 unused declaration.
11392 * tests/synclines.at (%union synch line): Put a dummy member in
11393 the union, because empty unions aren't allowed in C. Caught
11396 2004-04-13 Jim Meyering <jim@meyering.net>
11398 * src/conflicts.c (conflicts_print): Correct format string typo:
11399 use `%%' to produce literal `%'. (trivial change)
11401 2004-03-30 Paul Eggert <eggert@twinsun.com>
11403 * src/getargs.c (version): Update copyright year to 2004.
11405 * data/c.m4 (b4_int_type): Use 'short int' rather than
11406 'short', and similarly for 'long', 'unsigned', etc.
11407 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
11408 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
11409 yy_yypstack, yydumpstack): Likewise.
11410 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
11411 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
11413 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
11414 yy_stack_print, yyparse): Likewise.
11415 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
11416 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
11417 * lib/bitset.c (bitset_print): Likewise.
11418 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
11419 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11420 * lib/bitsetv.c (bitsetv_dump): Likewise.
11421 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
11422 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
11424 * src/LR0.c (allocate_itemsets): Likewise.
11425 * src/gram.h (rule_number, rule): Likewise.
11426 * src/lalr.h (goto_number): Likewise.
11427 * src/nullable.c (nullable_compute): Likewise.
11428 * src/output.c (prepare_rules): Likewise.
11429 * src/relation.c (relation_print, relation_digraph): Likewise.
11430 * src/relation.h (relation_node): Likewise.
11431 * src/state.h (state_number, transitions, errs, reductions,
11432 struct state): Likewise.
11433 * src/symtab.h (symbol_number, struct symbol): Likewise.
11434 * src/tables.c (vector_number, tally, action_number,
11435 default_goto, goto_actions): Likewise.
11436 * tests/existing.at (GNU Cim Grammar): Likewise.
11437 * tests/regression.at (Web2c Actions): Likewise.
11439 * src/output.c (muscle_insert_short_int_table): Renamed from
11440 muscle_insert_short_table. All uses changed.
11442 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11444 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
11445 (declaration): Replace expected_conflicts with expected_sr_conflicts.
11446 Add %expect-rr rule.
11448 * src/scan-gram.l: Recognize %expect-rr.
11450 * src/conflicts.h (expected_sr_conflicts): Rename from
11451 expected_conflicts.
11452 (expected_rr_conflicts): Declare.
11454 * src/conflicts.c (expected_sr_conflicts): Rename from
11455 expected_conflicts.
11456 (expected_rr_conflicts): Define.
11457 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
11459 Use expected_sr_conflicts in place of expected_conflicts.
11460 Warn if expected_rr_conflicts used in non-GLR parser.
11462 * doc/bison.texinfo: Add documentation for %expect-rr.
11464 2004-03-08 Paul Eggert <eggert@gnu.org>
11466 Add support for hex token numbers. Suggested by Odd Arild Olsen in
11467 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
11469 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
11471 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
11472 * src/scan-gram.l (scan_integer): New function.
11474 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
11475 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
11476 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
11477 Say "long int", not "long", for uniformity with GNU style.
11479 2004-02-25 Paul Eggert <eggert@twinsun.com>
11481 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
11482 compilers. This fixes a problem with Intel's C++ compiler being
11483 chatty, reported by Guido Trentalancia in
11484 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
11486 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
11488 Support %destructor and merge error locations in lalr1.cc.
11490 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
11491 (Parser::stos_): Define unconditionally.
11492 (Parser::destruct_): New method. Generate its body with
11493 b4_yydestruct_generate.
11494 (Parser::error_start_): New attribute.
11495 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
11496 token which are discarded.
11497 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
11498 error_start_ when erroneous token are discarded.
11499 (Parser::parse) <yyerrlab1>: Compute the location of the error
11500 token so that it covers all the discarded tokens.
11501 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
11502 it can be called with `%skeleton "lalr1.cc"', and do that.
11504 2004-02-02 Paul Eggert <eggert@twinsun.com>
11506 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
11507 $(top_srcdir)/lib and ../lib. This fixes a bug reported
11508 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
11509 There's no need to mention top_builddir since Automake does that
11511 (INCLUDES): Remove, as Automake says it's obsolescent.
11512 Contents migrated into AM_CPPFLAGS as described above.
11513 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
11515 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11517 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
11518 (yyreportSyntaxError): Handle case where lookahead token is
11521 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11523 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
11524 resulting parsers are compilable with C++.
11526 2003-12-23 Paul Eggert <eggert@twinsun.com>
11528 * config/depcomp, config/install-sh: Sync with Automake 1.8.
11529 * src/output.c (output_skeleton): Rename local var.
11530 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
11531 Bison tokens, as this runs afoul of the 2003-10-07 change that
11532 disallowed NUL bytes in character constants or string literals.
11534 * tests/local.at: Require Autoconf 2.59's Autotest.
11535 * tests/testsuite.at: Don't include local.at, since we now assume
11536 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
11538 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
11539 multiple inclusion warnings.
11541 2003-12-02 Akim Demaille <akim@epita.fr>
11543 * doc/bison.texinfo (How Can I Reset the Parser): More about start
11547 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
11549 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
11551 2003-10-07 Paul Eggert <eggert@twinsun.com>
11553 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
11554 if testsuite doesn't exist.
11556 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
11557 literals, unfortunately.
11558 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
11559 Complain about NUL bytes in character constants or string literals.
11561 2003-10-05 Paul Eggert <eggert@twinsun.com>
11563 * NEWS: Don't document %no-default-prec, as it's still
11565 * doc/bison.texinfo: Document %no-default-prec only if
11566 the defaultprec flag is set. Normally it's not.
11568 2003-10-04 Paul Eggert <eggert@twinsun.com>
11570 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
11571 non-modifiable lvalue, instead of a modifiable one.
11572 * doc/bison.texinfo (Actions): Document that $$ can
11573 be assigned to. Do not claim that $$ and $N are
11574 array element references: user code should not rely on this.
11576 2003-10-01 Paul Eggert <eggert@twinsun.com>
11578 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
11579 (grammar_declaration): Use it.
11580 * src/scan-gram.l: New token %no-default-prec.
11581 * tests/conflicts.at: Revamp tests to use %no-default-prec.
11582 * NEWS, doc/bison.texinfo: Document the above.
11584 2003-10-01 Akim Demaille <akim@epita.fr>
11586 VCG no longer supports long_straight_phase.
11588 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
11589 * src/print_graph.c (print_graph): Adjust.
11591 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
11592 and Paul Eggert <eggert@twinsun.com>
11594 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
11595 Table of Symbols): Document %default-prec.
11596 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
11597 (grammar_declaration): Set default_prec on %default-prec.
11598 * src/scan-gram.l (%default-prec): New token.
11599 * src/reader.h (default_prec): New flag.
11600 * src/reader.c: Likewise.
11601 (packgram): Handle it.
11602 * tests/conflicts.at (%default-prec without %prec,
11603 %default-prec with %prec, %default-prec 1): New tests.
11605 2003-09-30 Paul Eggert <eggert@twinsun.com>
11607 * tests/testsuite.at: Include local.at, not input.at, fixing
11608 a typo in the 2003-08-25 patch.
11610 2003-08-27 Akim Demaille <akim@epita.fr>
11612 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
11615 2003-08-26 Akim Demaille <akim@epita.fr>
11617 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
11618 "<\#" to avoid magic from Gnus when posting parts of this script.
11620 2003-08-26 Akim Demaille <akim@epita.fr>
11622 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
11623 (Parser::parse): here.
11624 Adjust: nerrs and errstatus is now replaced by...
11625 (Parser::nerrs_, Parser::errstatus_): New.
11627 2003-08-25 Akim Demaille <akim@epita.fr>
11629 * config/announce-gen, Makefile.cfg: New.
11630 * Makefile.am: Adjust.
11631 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
11632 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
11634 2003-08-25 Akim Demaille <akim@epita.fr>
11636 When reducing initial empty rules, Bison parser read an initial
11637 location that is not defined. This results in garbage, and that
11638 affects Bison's own parser. Therefore we need (i) to extend Bison
11639 to support a means to initialize this location, and (ii) to use
11640 this CVS Bison to fix CVS Bison's parser.
11642 * src/reader.h, reader.c (epilogue_augment): Remove, replace
11644 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
11645 * src/parse-gram.y: Adjust.
11646 (%initial-action): New.
11647 (%error-verbose): Since we require CVS Bison, there is no reason
11649 * src/scan-gram.l: Adjust.
11650 * src/Makefile.am (YACC): New, to make sure we use our own parser.
11651 * data/yacc.c (yyparse): Use b4_initial_action.
11653 2003-08-25 Akim Demaille <akim@epita.fr>
11655 * doc/bison.texinfo: Don't promote stdout for error messages.
11657 2003-08-25 Akim Demaille <akim@epita.fr>
11659 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
11660 From Alexandre Duret-Lutz.
11662 2003-08-25 Akim Demaille <akim@epita.fr>
11666 2003-08-25 Akim Demaille <akim@epita.fr>
11668 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
11671 2003-08-25 Akim Demaille <akim@epita.fr>
11673 * data/lalr1.cc (Parser::reduce_print_): New.
11676 2003-08-25 Akim Demaille <akim@epita.fr>
11678 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
11679 error recovery loops. This patch is based on
11680 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
11681 Also, augment the similarity between lalr1.cc and yacc.c.
11682 Note: the locations of error recovery rules are not correct yet.
11684 * data/lalr1.cc: Comment changes to augment the similarity between
11685 lalr1.cc and yacc.c.
11686 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
11687 (yyerrlab1): Remove, but where it used to be (now the bottom part of
11688 yyerrlab), when hitting EOF, pop the whole stack here instead of
11689 merely falling thru the default error handling mechanism.
11690 (yyerrorlab): New label, with the old contents of YYERROR,
11691 plus the following change: pop the stack of rhs corresponding
11692 to the production that invoked YYERROR. That is how Yacc
11693 behaves (required by POSIX).
11694 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
11697 2003-08-25 Akim Demaille <akim@epita.fr>
11699 Tune local.at so that people can "autom4te -l autotest calc.at -o
11700 calc" for instance, to extract a sub test suite.
11702 * tests/testsuite.at: Move the initialization, Autotest version
11703 requirement, and AT_TESTED invocation into...
11704 * tests/local.at: here.
11705 * tests/testsuite.at: Include it for compatibility with Autoconf
11707 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
11710 2003-08-04 Paul Eggert <eggert@twinsun.com>
11712 Rework code slightly to avoid gcc -Wtraditional warnings.
11713 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
11714 The returned value is now stored in *YY0. All callers changed.
11715 * src/output.c (merge_output): Adjust to the above change.
11717 2003-07-26 Paul Eggert <eggert@twinsun.com>
11719 * data/glr.c (YYASSERT): New macro.
11720 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
11721 yyresolveStates, yyprocessOneStack):
11722 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
11723 Derived from a suggestion by Frank Heckenbach.
11725 2003-07-25 Paul Eggert <eggert@twinsun.com>
11727 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
11728 for portability to K&R C (after ansi2knr, presumably). See
11729 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
11730 by Frank Heckenbach, though I have omitted the structure-initialization
11731 part of his glr-knr.diff patch since I recall that the Portable
11732 C Compiler didn't require that change.
11734 Let the user specify how to allocate and free memory.
11735 Derived from a suggestion by Frank Heckenbach in
11736 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
11737 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
11738 All uses of free, malloc, realloc changed to use these macros,
11739 and unnecessary casts removed.
11740 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
11742 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
11744 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
11745 use s.empty() rather than s == "" to test for empty string; see
11746 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
11749 2003-06-25 Akim Demaille <akim@epita.fr>
11751 * config/depcomp, config/install-sh: Update from masters.
11753 2003-06-20 Paul Eggert <eggert@twinsun.com>
11755 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
11756 and return properly parenthesized result.
11757 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
11758 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
11759 Remove unnecessary parentheses from uses.
11760 * doc/bison.texinfo (Location Default Action): Describe the
11761 conventions for parentheses.
11763 2003-06-19 Paul Eggert <eggert@twinsun.com>
11765 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
11766 yyreportTree): Do not assume that size_t is the same width as int,
11767 when printing sizes. Print sizes using an unsigned format.
11768 Problem reported by Frank Heckenbach in
11769 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
11771 Port to Forte Developer 7 C compiler.
11772 * data/glr.c (struct YYLTYPE): If locations are not being used,
11773 declare a single dummy member, as empty structs do not conform
11775 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
11776 the Forte Developer 7 C compiler complains that end-of-loop
11777 code is not reached.
11779 2003-06-17 Paul Eggert <eggert@twinsun.com>
11781 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
11782 avoid warnings from picky compilers about redefinition of PARAMS.
11784 2003-06-17 Paul Eggert <eggert@twinsun.com>
11788 * NEWS: Document 1.875b.
11790 * lib/bbitset.h: Do not include config.h; that's the includer's job.
11791 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
11792 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
11793 Don't use 'index' in comments, as it's a builtin fn on some hosts.
11794 * lib/bitset_stats.c: Include gettext.h unconditionally, as
11795 per recent gettext manual's suggestion.
11796 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
11797 Use prototypes, not old-style definitions.
11798 * lib/lbitset.c (lbitset_unused_clear): Likewise.
11799 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
11800 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
11801 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
11802 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
11803 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
11804 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
11805 vbitset_or_and_cmp, vbitset_copy): Likewise.
11807 * lib/libiberty.h: Do not include config.h; that's the includer's job.
11808 Do not include <stdlib.h>.
11809 (PARAMS): Define unconditionally for C89.
11810 (ATTRIBUTE_NORETURN): Remove.
11811 (ATTRIBUTE_UNUSED): Define unconditionally.
11813 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
11814 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
11815 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
11816 * lib/vbitset.c, lib/vbitset.h: New files.
11817 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
11818 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
11821 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
11822 `How Can I Reset @code{yyparse}', since texinfo does not allow
11823 arbitrary @ in node names.
11825 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
11826 shouldn't be needed according to the gettext 0.12.1 documentation
11827 but which seem to be needed anyway: codeset.m4 glibc21.m4
11828 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
11829 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
11830 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
11832 * lib/.cvsignore: Add stdbool.h.
11833 * m4/.cvsignore: Add nls.m4, po.m4.
11835 Upgrade to CVS gnulib.
11836 * stdbool_.h: File renamed from stdbool.h.in.
11837 * configure.ac (AM_STDBOOL_H): Invoke this instead of
11839 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
11840 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
11841 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
11842 (MOSTLYCLEANFILES): New var.
11843 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
11844 (stdbool.h): New rule.
11845 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
11846 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
11847 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
11848 m4/quote.m4: Upgrade to today's gnulib.
11850 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
11851 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
11852 the tests right now.
11853 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
11854 yyerror are declared before use; C99 requires this.
11856 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11858 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
11860 (yyrecoverSyntaxError): Correct the logic for setting and testing
11862 Correct comment on handling EOF.
11863 Allow states with only a default reduction, rather than failing
11864 (I can't quite reconstruct why these were not allowed before).
11866 Fixes to avoid problem that $-N rules in GLR parsers can cause
11867 buffer overruns, corrupting state.
11869 * src/output.c (prepare_rules): Output max_left_semantic_context
11871 * src/reader.h (max_left_semantic_context): New variable declaration.
11872 * src/scan-gram.l (max_left_semantic_context): Define.
11873 (handle_action_dollar): Update max_left_semantic_context.
11874 * data/glr.c (YYMAXLEFT): New definition.
11875 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
11876 (yyresolveAction): Ditto.
11878 Fixes to problems with location handling in GLR parsers reported by
11879 Frank Heckenbach (2003/06/05).
11881 * data/glr.c (YYLTYPE): Make trivial if locations not used.
11882 (YYRHSLOC): Add parentheses, and define only if locations used.
11883 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
11884 locations not used.
11885 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
11886 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
11888 * tests/cxx-type.at: Exercise location information; update tests
11889 to differentiate output with and without locations.
11890 Remove forward declarations of yylex and yyerror---caused errors
11891 because default YYLTYPE not yet defined.
11892 Change semantic actions to compute strings, rather than printing
11893 them directly (to test proper passing of semantics values). Change
11894 output to prefix notation and update test data and expected results.
11895 (yylex): Track locations.
11896 (stmtMerge): Return value rather than printing, and include arguments
11899 2003-06-03 Paul Eggert <eggert@twinsun.com>
11901 Avoid warnings generated by GCC 2.95.4 when Bison is
11902 configured with --enable-gcc-warnings.
11903 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
11904 yy::]b4_parser_class_name[::translate_,
11905 yy::Stack::operator[] (unsigned),
11906 yy::Stack::operator[] (unsigned) const,
11907 yy::Slice::operator[] (unsigned),
11908 yy::Slice::operator[] (unsigned) const):
11909 Rename local vars to avoid warnings.
11910 * tests/glr-regression.at (Improper handling of embedded actions
11911 and $-N in GLR parsers): Remove unused local variable from yylex.
11912 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
11913 (void) as arg when not pure, since we now assume C89 when building
11914 Bison. Pacify GCC by using parameter.
11916 2003-06-02 Paul Eggert <eggert@twinsun.com>
11918 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
11919 yy::Location::lines, yy::Location::columns): Rename arguments
11920 to avoid shadowing; this removes a warning generated by GCC 3.3.
11922 2003-06-01 Paul Eggert <eggert@twinsun.com>
11924 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
11925 to g++, as GCC 3.3 complains if you do it.
11926 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
11927 everything that WARNING_CFLAGS has, except omit warnings
11928 not suitable for C++.
11929 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
11930 * tests/atlocal.in (CXXFLAGS): New var.
11931 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
11933 Fix a GLR parser bug I reported in February; see
11934 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
11935 The problem was that GLR parsers did not conform to the C standard,
11936 because actions like { $1 = $2 + $3; } expanded to expressions
11937 that invoked YYFILL in separate subexpressions, and YYFILL assigned
11938 to a local variable. The C standard says that expressions
11939 like (var = f ()) + (var = f ()) have undefined behavior.
11940 Another problem was that GCC sometimes issues warnings that
11941 yyfill and its parameters are unused.
11943 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
11944 as possibly unused.
11945 (yyfill): New function.
11947 (yyuserAction): Change type of yynormal to bool, so that it matches
11948 the new yyfill signature. Mark it as possibly unused.
11951 Follow up on a bug I reported in February, where a Bison-generated
11952 parser can loop. Provide a test case and a fix for yacc.c. I
11953 don't have a fix for lalr1.cc or for glr.c, unfortunately.
11954 The original bug report is in:
11955 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
11957 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
11958 macro's size was becoming unwieldy.
11959 (yyerrlab): Do not discard an empty lookahead symbol, as this
11960 might destroy garbage.
11961 (yyerrorlab): New label, with the old contents of YYERROR,
11962 plus the following change: pop the stack of rhs corresponding
11963 to the production that invoked YYERROR. That is how Yacc
11964 behaves, and POSIX requires this behavior.
11965 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
11966 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
11967 Define 'alarm' to do nothing if unistd.h is not available.
11968 Add a new rule "exp: '-' error;" to test the above change to
11969 data/yacc.c. Use 'alarm' to abort any test taking longer than
11970 10 seconds, as it's probably looping.
11971 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
11972 Also, the new yacc.c generates two fewer diagnostics for an
11975 2003-05-24 Paul Eggert <eggert@twinsun.com>
11977 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
11978 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
11979 This fixes a problem reported by John Bowman when the Compaq/HP
11980 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
11981 -ansi -Wall -gall).
11982 * data/yacc.c (union yyalloc): Likewise.
11983 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
11985 Switch from 'int' to 'bool' where that makes sense.
11987 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
11988 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
11989 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
11990 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
11991 Return or accept bool, not int. All callers changed.
11992 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
11993 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
11994 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
11995 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
11996 bitset_or_and_cmp_): Likewise.
11997 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
11998 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
11999 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
12000 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
12001 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
12002 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
12003 bitset_stats_or_and_cmp): Likewise.
12004 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
12005 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
12006 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
12007 ebitset_xor_cmp): Likewise.
12008 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
12009 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
12010 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
12011 lbitset_xor_cmp): Likewise.
12012 * lib/bbitset.h: Include <stdbool.h>.
12013 (struct bitset_vtable): The following members now return bool, not
12014 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
12015 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
12017 * src/conflicts.c (count_rr_conflicts): Likewise.
12018 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
12020 * lib/ebitset.c (ebitset_obstack_init): Likewise.
12021 * lib/lbitset.c (lbitset_obstack_init): Likewise.
12022 * src/getargs.c (debug_flag, defines_flag, locations_flag,
12023 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12024 graph_flag): Likewise.
12025 * src/getargs.h (debug_flag, defines_flag, locations_flag,
12026 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12027 graph_flag): Likewise.
12028 * src/output.c (error_verbose): Likewise.
12029 * src/output.h (error_verbose): Likewise.
12030 * src/reader.c (start_flag, typed): Likewise.
12031 * src/reader.h (typed): Likewise.
12032 * src/getargs.c (LOCATIONS_OPTION): New constant.
12033 (long_options, getargs): Use it.
12034 * src/lalr.c (build_relations): Use bool, not int.
12035 * src/nullable.c (nullable_compute): Likewise.
12036 * src/print.c (print_reductions): Likewise.
12037 * src/tables.c (action_row, pack_vector): Likewise.
12038 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
12039 * src/output.c (prepare): Use it.
12040 * src/output.c (token_definitions_output,
12041 symbol_destructors_output, symbol_destructors_output): Use string,
12042 not boolean integer, to keep track of whether to output separator.
12043 * src/print_graph.c (print_core): Likewise.
12044 * src/state.c (state_rule_lookaheads_print): Likewise.
12046 * config/install-sh: Sync from automake 1.7.5.
12048 2003-05-14 Paul Eggert <eggert@twinsun.com>
12050 * src/parse-gram.y (rules_or_grammar_declaration): Require a
12051 semicolon after a grammar declaration, in the interest of possible
12052 future changes to the Bison input language.
12053 Do not allow a stray semicolon at the start of the grammar.
12054 (rhses.1): Allow one or more semicolons after any rule, including
12055 just before "|" as required by POSIX.
12056 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
12059 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
12061 %parse-param support for lalr1.cc.
12063 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
12064 b4_cc_constructor_calls, b4_cc_constructor_call,
12065 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
12067 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
12068 parse-param arguments.
12069 (yy::b4_parser_class_name): Declare instance variables to
12070 hold parse-param arguments.
12071 * tests/calc.at: s/value/semantic_value/ because value clashes
12072 with a member of yy::b4_parser_class_name. Adjust C++ code
12073 to handle %parse-param. Enable %parse-param test in C++.
12075 2003-05-12 Paul Eggert <eggert@twinsun.com>
12077 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
12078 English a bit. Fix fclose typo. Change "const char" to "char
12079 const", and use ANSI C rather than K&R for "main". Suggest
12080 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
12081 and suggest yy_switch_to_buffer.
12083 2003-05-05 Paul Eggert <eggert@twinsun.com>
12085 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
12086 C89. This avoids a diagnostic on compilers that define __STDC__
12087 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
12088 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
12090 2003-05-03 Paul Eggert <eggert@twinsun.com>
12092 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
12093 Do not overrun array bounds.
12094 This should fix a bug reported today by Olatunji Oluwabukunmi in
12095 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
12097 2003-04-29 Akim Demaille <akim@epita.fr>
12099 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
12100 * src/getargs.c, src/getargs.h: here, as bool, not int.
12101 (nondeterministic_parser): New.
12102 * src/parse-gram.y, src/scan-gram.l: Support
12103 %nondeterministic-parser.
12104 * src/output.c (prepare): Use nondeterministic_parser instead
12105 of glr_parser where appropriate.
12106 * src/tables.c (conflict_row, action_row, save_row)
12107 (token_actions, token_actions, pack_vector): Ditto.
12109 2003-04-29 Akim Demaille <akim@epita.fr>
12111 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
12113 2003-04-29 Akim Demaille <akim@epita.fr>
12115 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
12116 with %pure-parser and %locations to exercise the patch from Yakov
12119 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
12121 * data/yacc.c: (b4_lex_param): Corrected for the case where
12122 %lex-param is provided and %pure-parser isn't.
12124 2003-04-27 Paul Eggert <eggert@twinsun.com>
12126 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
12127 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
12128 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
12129 if it is not defined.
12130 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
12132 2003-04-26 Paul Eggert <eggert@twinsun.com>
12134 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
12135 Declare to be of type suitable for the ninf value itself, not of
12136 type suitable for the corresponding table, since the latter might
12137 be unsigned but the ninf value might be negative. This fixes a
12138 bug reported by Alexandre Duret-Lutz in
12139 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
12141 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
12142 invokes it. We shouldn't invoke it twice because it will attempt
12143 to put error.o in the archive twice. This fixes a glitch reported
12144 by Martin Mokrejs in
12145 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
12147 2003-04-21 Paul Eggert <eggert@twinsun.com>
12149 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
12152 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
12154 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
12155 Fix obvious typo that results in uncompilable GLR parsers
12156 when both %pure-parser and %locations are used. (trivial change)
12158 2003-04-17 Paul Eggert <eggert@twinsun.com>
12160 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
12161 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
12162 Do not insert the expected token via unput, as this runs afoul
12163 of a POSIX-compatibility bug in flex 2.5.31.
12164 All uses changed to BEGIN the parent state,
12165 since we no longer insert the expected token via unput.
12166 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
12167 that is no longer emitted after the above change.
12169 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
12170 the first one. This change is from Paul Hilfinger, and it fixes
12171 regression reported by Werner Lemberg in
12172 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
12174 (resolve_sr_conflict): Don't invoke state_errs_set
12175 unless one or more tokens have been explicitly made errors.
12176 Otherwise, the above change causes Bison to abort.
12178 * tests/existing.at (GNU pic Grammar): New test case, taken from
12181 2003-03-31 Akim Demaille <akim@epita.fr>
12183 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
12185 2003-03-31 Akim Demaille <akim@epita.fr>
12187 * src/output.c (prepare_symbols): Avoid trailing spaces in the
12190 2003-03-31 Akim Demaille <akim@epita.fr>
12192 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
12193 From Paul Hilfinger.
12195 2003-03-29 Akim Demaille <akim@epita.fr>
12197 * m4/error.m4: Do not put under dynamic conditions some code which
12198 expansion is under static control.
12200 2003-03-29 Akim Demaille <akim@epita.fr>
12202 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
12204 2003-03-29 Akim Demaille <akim@epita.fr>
12206 * doc/bison.texinfo (Strings are Destroyed): New.
12208 2003-03-13 Paul Eggert <eggert@twinsun.com>
12210 * .cvsignore: Add configure.lineno.
12211 * src/.cvsignore: Add yacc.
12212 * tests/.cvsignore: Add testsuite.log.
12213 * doc/fdl.texi: Sync with latest FSF version.
12215 2003-03-12 Paul Eggert <eggert@twinsun.com>
12217 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
12218 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
12219 cursor, instead of leaving it undefined. This fixes a bug
12220 reported by Tim Van Holder in
12221 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
12222 * tests/input.at (Torturing the Scanner): Test the scanner on
12223 an empty input file, which was Tim Van Holder's test case.
12225 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
12226 <sys/resource.h> can be included, include sys/time.h and
12227 sys/times.h first, if available. This works around the SunOS
12228 4.1.4 porting bug reported by Bruce Becker in
12229 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
12231 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
12232 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
12233 AC_HEADER_SYS_WAIT.
12235 Merge changes from gnulib. This was prompted because the CVS
12236 snapshot didn't build on Solaris 7 due to strnlen problems.
12238 These changes need to be merged back into gnulib:
12239 * lib/hash.c: Include <stdbool.h> unconditionally.
12240 * m4/onceonly.m4 (m4_quote): New macro.
12241 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
12242 Quote AC_FOREACH variable-expansions properly.
12243 The 2003-01-03 obstack.h change also needs merging.
12244 {end of changes requiring merging}
12246 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
12247 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
12248 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
12249 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
12250 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
12251 New files, imported from gnulib.
12252 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
12255 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
12256 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
12259 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
12261 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
12262 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
12263 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
12264 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
12265 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
12266 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
12267 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
12268 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
12269 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
12270 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
12271 (jm_PREREQ_ARGMATCH): Remove.
12272 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
12273 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
12275 * src/system.h: Include <stdbool.h> unconditionally.
12277 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
12278 assuming at least C89 in the bitset code for some time now.
12280 2003-03-03 Akim Demaille <akim@epita.fr>
12284 2003-03-02 Akim Demaille <akim@epita.fr>
12286 * doc/bison.texinfo (Table of Symbols): Reactivate the
12287 documentation for %lex-param, and %parse-param.
12289 2003-03-02 Akim Demaille <akim@epita.fr>
12291 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
12292 generate verbose error messages.
12293 Use the number of tokens as an upper bound in yytname, as it
12294 cannot be a non terminal.
12296 2003-03-02 Akim Demaille <akim@epita.fr>
12298 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
12301 2003-03-02 Akim Demaille <akim@epita.fr>
12303 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
12304 Use them to exercise yycheck overrun.
12305 Based on Andrew Suffield's grammar.
12307 2003-03-02 Akim Demaille <akim@epita.fr>
12309 Create tests/local.at for Bison generic testing macros.
12311 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
12312 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
12314 * tests/calc.at (AT_CHECK_CALC): Adjust.
12315 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
12316 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
12317 * tests/local.at: here.
12318 (AT_COMPILE_CXX): Tags the tests using it as c++.
12319 Ignore the test if CXX is not functional.
12321 2003-03-01 Paul Eggert <eggert@twinsun.com>
12323 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
12324 not loc->end, since loc->end might contain garbage and this leads
12325 to undefined behavior on some platforms.
12326 (id_loc, token_start): Use (IF_LINTed) initial values that do not
12327 depend on *loc, so that the reader doesn't give the the false
12328 impression that *loc is initialized.
12329 (<INITIAL>"%%"): Do not bother setting code_start, since its value
12330 does not survive the return.
12332 2003-03-01 Akim Demaille <akim@epita.fr>
12334 * src/scan-gram.l (code_start): Always initialize it when entering
12335 into yylex, as SC_EPILOGUE is activated *before* the corresponding
12336 yylex invocation. An alternative would be making it static, but
12337 then it starts with the second %%'s beginning, instead of its end.
12339 2003-02-28 Paul Eggert <eggert@twinsun.com>
12341 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
12342 around a UnixWare 7.1.1 porting bug reported by John Hughes in
12343 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
12345 2003-02-26 Paul Eggert <eggert@twinsun.com>
12347 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
12348 Remove Sequent/Pyramid discussion (nobody uses them any more).
12349 Merge VMS and MS-DOS discussion; these ports may well be dead
12350 but let's keep mentioning them for now. Put <> around email
12351 addresses. Add copyright notice.
12353 2003-02-24 Paul Eggert <eggert@twinsun.com>
12355 * data/glr.c (yy_reduce_print): yylineno -> yylno,
12356 to avoid collision with flex use of yylineno.
12357 Problem reported by Bruce Lilly in
12358 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
12359 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
12360 * data/yacc.c (yy_reduce_print): Likewise.
12362 * config/depcomp: Sync with Automake 1.7.3.
12364 2003-02-21 Akim Demaille <akim@epita.fr>
12366 * data/lalr1.cc: Use temporary variables instead of casts to
12367 change integer types.
12368 Suggested by Paul Eggert.
12370 2003-02-21 Akim Demaille <akim@epita.fr>
12372 * doc/bison.texinfo: Use "location" consistently to refer to @n,
12373 to avoid confusions with lalr1.cc's notion of Position.
12374 Suggested by Paul Eggert.
12376 2003-02-20 Akim Demaille <akim@epita.fr>
12378 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
12379 before initial_columns.
12380 (location.hh): Use consistent variable names when defining the
12382 Use "last" so that we subtract from Positions, not from unsigned.
12384 2003-02-20 Akim Demaille <akim@epita.fr>
12386 * data/lalr1.cc (position.hh): New subfile, including the extended
12387 and Doxygen'ed documentation of class Position.
12388 (location.hh): Use it.
12389 Document a` la Doxygen.
12390 With the help of Benoit Perrot.
12392 2003-02-20 Akim Demaille <akim@epita.fr>
12394 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
12396 Redefine AT_YYERROR_SEES_LOC_IF using it.
12397 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
12399 Don't use the location in yy::Parser::error_ and
12400 yy::Parser::print_ when not %locations.
12401 Activate more lalr1.cc tests.
12403 2003-02-19 Akim Demaille <akim@epita.fr>
12405 * data/lalr1.cc: When displaying a line number, be sure to make it
12408 2003-02-19 Akim Demaille <akim@epita.fr>
12410 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
12412 (YYABORT, YYACCEPT, YYERROR): New.
12413 * tests/calc.at: Renable the lalr1.cc test.
12415 2003-02-19 Akim Demaille <akim@epita.fr>
12417 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
12418 error recovery, mixing with/without pops and discarding of the
12421 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
12423 2003-02-17 Paul Eggert <eggert@twinsun.com>
12425 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
12426 * tests/testsuite.at (AT_COMPILE): Use them.
12427 This fixes the testsuite problem reported by Robert Lentz in
12428 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
12430 2003-02-12 Paul Eggert <eggert@twinsun.com>
12432 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
12433 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
12434 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
12435 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
12436 Check for malloc failure, for consistency with yacc.c.
12437 (yytname_size): Remove, for consistency with yacc.c.
12439 The bug still remains in data/lalr1.cc, as I didn't have time
12442 2003-02-06 Akim Demaille <akim@epita.fr>
12444 * configure.ac (GXX): Rename as...
12445 (CXX): this, to keep the original Autoconf semantics.
12447 * data/lalr1.cc: Fix b4_copyright invocations.
12448 If YYDEBUG is not defined, don't depend upon name_ being defined.
12449 (location.hh): Include string and iostream.
12450 (Position::filename): New member.
12451 (Position::Position ()): New.
12452 (operator<< (Position)): New.
12453 (operator- (Position, int)): New.
12454 (Location::first, Location::last): Rename as...
12455 (Location::begin, Location::end): these, to mock the conventional
12457 (operator<< (Location)): New.
12458 * tests/atlocal.in (CXX): New.
12459 * tests/testsuite.at (AT_COMPILE_CXX): New.
12460 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
12461 locations in a more synthetic way.
12462 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
12464 Adjust the C locations to match those from Emacs: first column is
12466 Change all the expected results.
12467 Conform to the GCS: simplify the locations when applicable.
12468 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
12469 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
12470 these CPP macros with the m4 macros new defined by...
12471 (AT_CHECK_PUSHDEFS): this, i.e.:
12472 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
12473 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
12475 (AT_CHECK_POPDEFS): Undefine them.
12476 (AT_CHECK_CALC_LALR1_CC): New.
12477 Use it for the first lalr1.cc test.
12479 2003-02-04 Akim Demaille <akim@epita.fr>
12481 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
12482 Location as is defined.
12484 2003-02-04 Akim Demaille <akim@epita.fr>
12486 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
12487 name_ being defined.
12489 2003-02-03 Paul Eggert <eggert@twinsun.com>
12491 * src/gram.h (start_symbol): Remove unused decl.
12493 Use more-consistent naming conventions for local vars.
12495 * src/derives.c (derives_compute): Change type of local var from
12496 int to rule_number.
12497 * src/gram.c (grammar_rules_partial_print): Likewise.
12498 * src/print.c (print_core): Likewise.
12499 * src/reduce.c (reduce_grammar_tables): Likewise.
12501 * src/gram.c (grammar_dump): Change name of item_number *
12502 local var from r to rp.
12503 * src/nullable.c (nullable_compute): Likewise.
12505 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
12507 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
12508 for symbol or symbol_number var.
12509 * src/reader.c (grammar_start_symbol_set): Likewise.
12510 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
12512 * src/state.c (transitions_to): Likewise.
12513 * src/state.h: Likewise.
12514 * src/tables.c (symbol_number_to_vector_number): Likewise.
12516 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
12519 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
12522 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
12525 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
12526 Use str, not s, for char * var. Use ch, not c, for character var.
12527 Use size for size var.
12529 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
12531 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
12533 * src/uniqstr.h: Likewise.
12535 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12536 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12537 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
12538 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
12539 param to have same name as that of enum, so that we don't use
12540 "s" to stand for a non-state.
12542 2003-02-02 Akim Demaille <akim@epita.fr>
12544 * src/scan-skel.l: Scan more than one inert character per yylex
12547 2003-02-01 Paul Eggert <eggert@twinsun.com>
12551 * po/LINGUAS: Add ms.
12553 2003-01-30 Akim Demaille <akim@epita.fr>
12555 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
12557 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12559 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
12562 Changes in response to error report by S. Eken: GLR mode does not
12563 handle negative $ indices or $ indices in embedded rules correctly.
12564 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
12566 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
12567 (b4_rhs_location): Ditto.
12568 (yyfill): New function to copy from stack tree into array
12570 (yyuserAction): Modify to allow incremental move of semantic values
12571 to rhs array when in GLR mode.
12572 Define YYFILL to use in user-defined actions to fill semantic array
12574 Remove dummy use of yystack, as there is now a guaranteed use.
12575 (yydoAction): Modify to allow incremental move of semantic values
12576 to rhs array when in GLR mode.
12577 (yyresolveAction): Ditto.
12578 (yyglrShiftDefer): Update comment.
12579 (yyresolveStates): Use X == NULL for pointers, not !X.
12580 (yyglrReduce): Ditto.
12581 (yydoAction): Ditto
12583 * tests/glr-regr1.at: Rename to ...
12584 * tests/glr-regression.at: Add new regression test for the problems
12585 described above (adapted from S. Eken).
12586 Update copyright notice.
12587 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
12588 * tests/Makefile.am: Ditto.
12590 2003-01-28 Paul Eggert <eggert@twinsun.com>
12592 * data/lalr1.cc: Do not use @output_header_name@ unless
12593 b4_defines_flag is set. This fixes two bugs reported by
12595 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
12596 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
12598 2003-01-21 Paul Eggert <eggert@twinsun.com>
12600 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
12601 we don't need to worry about yyerrlab1 being reported as an
12602 "unused label" by non-GCC C compilers. The downside is that if
12603 locations are used then a couple of statements are duplicated each
12604 time YYERROR is invoked, but the upside is that the warnings
12606 (yyerrlab1): Move code to YERROR.
12607 (yyerrlab2): Remove. Change uses back to yyerrlab1.
12608 This reverts some of the 2002-12-27 change.
12610 2003-01-17 Paul Eggert <eggert@twinsun.com>
12612 * src/output.c (symbol_printers_output): Fix typo that led
12613 to core dump. Problem reported by Antonio Rus in
12614 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
12616 2003-01-13 Akim Demaille <akim@epita.fr>,
12617 Quoc Peyrot <chojin@lrde.epita.fr>,
12618 Robert Anisko <anisko_r@lrde.epita.fr>
12620 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
12621 when the stacks contain one element, as the loop would otherwise
12622 free the last state, and then use the top state (the one we just
12623 popped). This means that the initial elements will not be freed
12624 explicitly, as is the case in yacc.c; it is not a problem, as
12625 these elements have fake values.
12627 2003-01-11 Paul Eggert <eggert@twinsun.com>
12629 * NEWS: %expect-violations are now just warnings, reverting
12630 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
12631 bootstrapping problem reported by Matthias Klose; see
12632 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
12633 * src/conflicts.c (conflicts_print): Likewise.
12634 * tests/conflicts.at (%expect not enough, %expect too much,
12635 %expect with reduce conflicts): Likewise.
12636 * doc/bison.texinfo (Expect Decl): Document this. Also mention
12637 that the warning is enabled if the number of conflicts changes
12638 (not necessarily increases).
12640 * src/getargs.c (version): Update copyright year.
12642 2003-01-09 Akim Demaille <akim@epita.fr>
12644 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
12646 2003-01-08 Paul Eggert <eggert@twinsun.com>
12648 * Makefile.maint (WGETFLAGS):
12649 New macro, containing "-C off" to disable proxy caches.
12650 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
12651 (rel-check): Use $(WGET) instead of wget.
12653 2003-01-06 Paul Eggert <eggert@twinsun.com>
12655 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
12656 the GLR paper of Scott, Johnstone and Hussain.
12658 2003-01-04 Paul Eggert <eggert@twinsun.com>
12660 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
12661 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
12662 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
12663 (EXTRA_LIBRARIES): New var, for liby.a.
12664 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
12665 (EXTRA_SCRIPTS): New var, for yacc.
12667 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
12668 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
12669 Problem reported by Nelson H. F. Beebe.
12671 2003-01-03 Paul Eggert <eggert@twinsun.com>
12673 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
12674 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
12675 when compiling Bison 1.875's `bitset bset = obstack_alloc
12676 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
12678 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
12679 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
12680 grow to a huge size with typical invocation.
12682 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
12683 Use the pattern recommended by Autoconf 2.57, except also protect
12684 against double-definition.
12685 * src/system.h: Likewise.
12686 Portability issues reported by Nelson H. F. Beebe.
12688 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
12689 All uses changed. Provide a definition in both C and C++.
12690 (yytrue, yyfalse): Define even if defined (__cplusplus).
12692 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
12693 Reported by Nelson H. F. Beebe.
12695 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
12697 2003-01-02 Paul Eggert <eggert@twinsun.com>
12699 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
12700 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
12701 Bug reported by Nelson H. F. Beebe.
12703 2003-01-01 Paul Eggert <eggert@twinsun.com>
12707 2002-12-30 Paul Eggert <eggert@twinsun.com>
12709 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
12711 (<INITIAL>","): Here. This causes stray "," to be treated
12714 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
12715 last brace in braced code when not in Yacc mode, for compatibility
12716 with Bison 1.35. This resurrects the 2001-12-15 patch to
12719 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
12720 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
12722 2002-12-28 Paul Eggert <eggert@twinsun.com>
12724 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
12725 that of SYM's type. This fixes Debian bug 168069, reported by
12728 2002-12-28 Paul Eggert <eggert@twinsun.com>
12732 Switch back to the Yacc style of conflict reports, undoing some
12733 of the 2002-07-30 change.
12734 * doc/bison.texinfo (Understanding): Use Yacc style for
12735 conflict reports. Also, use new way of locating rules.
12736 * src/conflicts.c (conflict_report):
12737 Renamed from conflict_report_yacc, removing the old
12738 'conflict_report'. Translate the entire conflict report at once,
12739 so that we don't assume that "," has the same interpretation in
12741 (conflicts_output): Use Yacc-style conflict report for each state,
12742 instead of our more-complicated style.
12743 (conflicts_print): Use Yacc-style conflict report, except print
12744 the input file name when not emulating Yacc.
12745 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
12746 Conflicted Reduction, %expect not enough, %expect too much,
12747 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
12748 * tests/existing.at (GNU Cim Grammar): Likewise.
12749 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
12751 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
12752 fatal): Don't invoke fflush; it's not needed and it might even be
12753 harmful for stdout, as stdout might not be open.
12754 * src/reduce.c (reduce_print): Likewise.
12756 2002-12-27 Paul Eggert <eggert@twinsun.com>
12758 Fix a bug where error locations were not being recorded correctly.
12759 This problem was originally reported by Paul Hilfinger in
12760 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
12762 * data/yacc.c (yyparse): New local var yylerrsp, to record the
12763 top of the location stack's error locations.
12764 (yyerrlab): Set it. When discarding a token, push its location
12765 onto yylerrsp so that we don't lose track of the error's end.
12766 (yyerrlab1): Now is only the target of YYERROR, so that we can
12767 properly record the location of the action that failed. For GCC
12768 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
12769 GCC warning about yyerrlab1 being unused if YYERROR is unused.
12770 (yyerrlab2): New label, which yyerrlab now falls through to.
12771 Compute the error's location by applying YYLLOC_DEFAULT to
12772 the locations of all the symbols that went into the error.
12773 * doc/bison.texinfo (Location Default Action): Mention that
12774 YYLLOC_DEFAULT is also invoked for syntax errors.
12775 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12776 Error locations include the locations of all the tokens that were
12777 discarded, not just the last token.
12779 2002-12-26 Paul Eggert <eggert@twinsun.com>
12781 * src/files.c: Include quote.h.
12782 (compute_output_file_names): Warn if we detect conflicting
12783 outputs to the same file. This should catch the misunderstanding
12784 exemplified by Debian Bug 165349, reported by Bruce Stephens..
12786 * src/conflicts.c (conflicts_print): If the user specifies
12787 "%expect N", report an error if there are any reduce/reduce
12788 conflicts. This is what the manual says should happen.
12789 This fixes Debian bug 130890, reported by Anthony DeRobertis.
12790 * tests/conflicts.at (%expect with reduce conflicts): New test.
12792 Don't use m4_include on relative file names, as it doesn't work as
12793 desired if there happens to be a file with that name under ".".
12795 * m4sugar/version.m4: Remove; it was included but it wasn't used.
12796 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
12797 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
12798 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
12799 * src/output.c (output_skeleton): Use full path names when
12800 specifying a file to include; don't rely on include path, as
12801 it's unreliable when the working file contains a file with
12804 2002-12-25 Paul Eggert <eggert@twinsun.com>
12806 Remove obsolete references to bison.simple and bison.hairy.
12807 Problem mentioned by Aubin Mahe in
12808 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
12809 * data/glr.c: Comment fix.
12810 * doc/bison.1: Remove references. Also, mention "yacc".
12812 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
12815 * src/parse-gram.y (declaration): Use enum "report_states" rather
12816 than its numeric value 1.
12818 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
12819 opening a new one. This fixes Debian bug 165349, reported by
12822 2002-12-24 Paul Eggert <eggert@twinsun.com>
12826 * Makefile.maint (cvs-update): Don't assume that the shell
12827 supports $(...), as Solaris sh doesn't.
12829 * src/parse-gram.y (lloc_default): Remove test for empty
12830 nonterminals at the end, since it didn't change the result.
12832 2002-12-24 Paul Eggert <eggert@twinsun.com>
12834 If the user does not define YYSTYPE as a macro, Bison now declares it
12835 using typedef instead of defining it as a macro. POSIX requires this.
12836 For consistency, YYLTYPE is also declared instead of defined.
12838 %union directives can now have a tag before the `{', e.g., the
12839 directive `%union foo {...}' now generates the C code
12840 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
12841 The default union tag is `YYSTYPE', for compatibility with Solaris 9
12842 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
12843 instead of `yyltype'.
12845 `yystype' and `yyltype' are now obsolescent macros instead of being
12846 typedefs or tags; they are no longer documented and will be
12847 withdrawn in a future release.
12849 * data/glr.c (b4_location_type): Remove.
12850 (YYSTYPE): Renamed from yystype.
12851 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
12852 (struct YYLTYPE): Renamed from struct yyltype.
12853 (YYLTYPE): Renamed from yyltype.
12854 (yyltype, yystype): New (and obsolescent) macros,
12855 for backward compatibility.
12856 * data/yacc.c: Likewise.
12858 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
12859 does not specify a union tag. This is for compatibility with
12862 * src/parse-gram.y (add_param): 2nd arg is now char * not char
12863 const *, since it is now modified by stripping surrounding { }.
12864 (current_braced_code): Remove.
12865 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
12866 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
12867 trailing " {...}". Now of type <chars>.
12868 (grammar_declaration): Adjust to bundled tokens.
12869 (code_content): Remove; stripping is now done by add_param.
12870 (print_token_value): Print contents of bundled tokens.
12871 (token_name): New function.
12873 * src/reader.h (braced_code, current_braced_code): Remove.
12874 (token_name): New decl.
12876 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
12877 token_type, not braced_code code_kind. All uses changed.
12878 (SC_PRE_CODE): New state, for scanning after a keyword that
12879 has (or usually has) an immediately-following braced code.
12880 (token_type): New local var, to keep track of which token type
12881 to return when scanning braced code.
12882 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
12883 <INITIAL>"%parse-param", <INITIAL>"%printer",
12884 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
12885 instead of returning a token type immediately.
12886 (<INITIAL>"{"): Set token type.
12887 (<SC_BRACED_CODE>"}"): Use it.
12888 (handle_action_dollar, handle_action_at): Now returns bool
12889 indicating success. Fail if ! current_rule; this prevents a core dump.
12890 (handle_symbol_code_dollar, handle_symbol_code_at):
12891 Remove; merge body into caller.
12892 (handle_dollar, handle_at): Complain in invalid contexts.
12894 * NEWS, doc/bison.texinfo: Document the above.
12895 * NEWS: Fix years and program names in copyright notice.
12897 2002-12-17 Paul Eggert <eggert@twinsun.com>
12899 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
12900 Reporting, Table of Symbols): Omit mentions of %lex-param and
12901 %parse-param from the documentation for now.
12903 2002-12-15 Paul Eggert <eggert@twinsun.com>
12905 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
12906 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
12907 lookahead symbol, and which sets yychar in parser actions) and it
12908 disagreed with the Bison documentation. Bug
12909 reported by Andrew Walrond.
12911 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
12912 as the caller now does that.
12913 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
12914 (YYEMPTY): Parenthesize right hand side, since others use it.
12915 (yyparse): Don't assume that our generated code is the only code
12918 2002-12-13 Paul Eggert <eggert@twinsun.com>
12922 POSIX requires a "yacc" command.
12923 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
12924 (MOSTLYCLEANFILES): Add yacc.
12926 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
12927 as an alias for bison y.
12929 * po/LINGUAS: Add da.
12931 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
12932 problem with latest <getopt.h>.
12933 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
12935 * doc/fdl.texi: Upgrade to 1.2.
12936 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
12937 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
12938 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
12940 * config/install-sh: Sync with autotools.
12942 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
12943 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
12944 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
12945 locations are requested.
12946 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
12947 locations are requested.
12949 2002-12-12 Paul Eggert <eggert@twinsun.com>
12951 Remove unportable casts and storage allocation tricks.
12952 While we're at it, remove almost all casts, since they
12953 usually aren't needed and are a sign of trouble.
12955 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
12957 * src/derives.c (derives_compute): Do not subtract NTOKENS from
12958 the pointer DSET returned by malloc; this isn't portable.
12959 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
12960 Similarly for DERIVES.
12961 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
12962 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
12963 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
12965 * src/derives.c (derives_compute): Do not bother invoking
12966 int_of_rule_number, since rule numbers are integers.
12968 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
12969 rather than XMALLOC (char, N).
12971 * src/files.c (filename_split): Rewrite to avoid cast.
12973 * src/gram.h (symbol_number_as_item_number,
12974 item_number_as_symbol_number, rule_number_as_item_number,
12975 item_number_as_rule_number):
12976 Now inline functions rather than macros, to avoid casts.
12977 * src/state.h (state_number_as_int): Likewise.
12978 * src/tables.c (state_number_to_vector_number,
12979 symbol_number_to_vector_number): Likewise.
12981 * src/gram.h (int_of_rule_number): Remove; no longer used.
12983 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
12984 since the resulting storage is always stored into.
12986 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
12989 * src/muscle_tab.c (muscle_m4_output):
12990 Now inline. Return bool, not int.
12991 * src/state.c (state_compare): Likewise.
12992 * src/symtab.c (symbol_check_defined,
12993 symbol_check_alias_consistency, symbol_pack, symbol_translation,
12994 hash_compare_symbol, hash_symbol):
12996 * src/uniqstr.c (uniqstr_print): Likewise.
12997 * src/muscle_tab.c (muscle_m4_output_processor):
12998 New function, to avoid casts.
12999 * src/state.c (state_comparator, stage_hasher): Likewise.
13000 * src/symtab.c (symbol_check_defined_processor,
13001 symbol_check_alias_consistency_processor, symbol_pack_processor,
13002 symbol_translation_processor, hash_symbol_comparator,
13003 hash_symbol_hasher): Likewise.
13004 * src/uniqstr.c (uniqstr_print_processor): Likewise.
13005 * src/muscle_tab.c (muscles_m4_output):
13006 Use new functions instead of casting old functions unportably.
13007 * src/state.c (state_hash_new): Likewise.
13008 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
13009 symbols_token_translations_init):
13011 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
13013 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
13014 var instead of casting to long, to avoid casts.
13015 (prepare_states): Use MALLOC rather than alloca, so that we don't
13016 have to worry about alloca.
13017 * src/state.c (state_hash_lookup): Likewise.
13019 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
13020 local var instead of casting to unsigned char, to avoid casts.
13022 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
13023 STATE_ALLOC): Remove.
13024 (transitions_new, errs_new, reductions_new, state_new): Use malloc
13025 rather than calloc, and use offsetof to avoid allocating slightly
13027 (state_new): Initialize all members.
13029 * src/state.c (state_hash): Use unsigned accumulator, not signed.
13031 * src/symtab.c (symbol_free): Remove; unused.
13032 (symbol_get): Remove cast in lhs of assignment.
13033 (symbols_do): Now static. Accept generic arguments, not
13034 hashing-related ones.
13036 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
13037 (symbol_processor): Remove.
13038 (symbols_do): Remove decl; now static.
13040 * src/system.h (alloca): Remove; decl no longer needed.
13041 (<stddef.h>): Include, for offsetof.
13042 (<inttypes.>, <stdint.h>): Include if available.
13043 (uintptr_t): New type, if system lacks it.
13044 (CALLOC, MALLOC, REALLOC): New macros.
13045 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
13048 * src/tables.c (table_size): Now int, to pacify GCC.
13049 (table_grow, table_ninf_remap): Use signed table size.
13050 (save_row): Don't bother initializing locals when not needed.
13051 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
13052 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
13054 * src/vcg.h: Correct misspellings.
13056 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
13059 * src/getargs.c (getargs): Don't assume EOF == -1.
13061 2002-12-09 Paul Eggert <eggert@twinsun.com>
13063 Change identifier spellings to avoid collisions with names
13064 that are reserved by POSIX.
13066 Don't use names ending in _t, since POSIX reserves them.
13067 For consistency, remove _e and _s endings -- they're weren't
13068 needed to remove ambiguity. All uses changed.
13069 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
13070 turn was just renamed from struniq_t.
13071 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
13072 which in turn was just renamed from struniq_processor_t.
13073 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
13074 in turn was renamed from hash_compare_struniq_t.
13075 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
13076 (state_list): Renamed from state_list_t.
13077 * src/assoc.h (assoc): Renamed from assoc_t.
13078 * src/conflicts.c (enum conflict_resolution): Renamed from
13079 enum conflict_resolution_e.
13080 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
13081 (rule_list): Renamed from rule_list_t.
13082 * src/getargs.h (enum trace): Renamed from enum trace_e.
13083 (enum report): Renamed from enum report_e.
13084 * src/gram.h (item_number): Renamed from item_number_t.
13085 (rule_number): Renamed from rule_number_t.
13086 (struct rule_s): Remove the "rule_s" part; not used.
13087 (rule): Renamed from rule_t.
13088 (rule_filter): Renamed from rule_filter_t.
13089 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
13090 (goto_list): Renamed from goto_list_t.
13091 * src/lalr.h (goto_number): Renamed from goto_number_t.
13092 * src/location.h (location): Renamed from location_t.
13093 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
13094 and moved here from:
13095 * src/muscle_tab.h (muscle_entry_t): here.
13096 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
13097 (rule_list): Renamed from rule_list_t.
13098 * src/print_graph.c (static_graph): Renamed from graph.
13099 * src/reader.h (braced_code): Renamed from braced_code_t.
13100 Remove brace_code_e tag.
13101 * src/relation.h (relation_node): Renamed from relation_node_t.
13102 (relation_nodes): Renamed from relation_nodes_t.
13103 (relation): Renamed from relation_t.
13104 * src/state.h (state_number): Renamed from state_number_t.
13105 (struct state): Renamed from struct state_s.
13106 (state): Renamed from state_t.
13107 (transitions): Renamed from transitions_t. Unused (and
13108 misspelled) transtion_s tag removed.
13109 (errs): Renamed from errs_t. Unused errs_s tag removed.
13110 (reductions): Renamed from reductions_t. Unused tag
13111 reductions_s removed.
13112 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
13113 (struct symbol_list): Renamed from struct symbol_list_s.
13114 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
13115 (struct symbol): Renamed from struct symbol_s.
13116 (symbol): Renamed from symbol_t.
13117 * src/tables.c (vector_number): Renamed from vector_number_t.
13118 (action_number): Renamed from action_t.
13119 * src/tables.h (base_number): Renamed from base_t.
13120 * src/vcg.h (enum color): Renamed from enum color_e.
13121 (enum textmode): Renamed from enum textmode_e.
13122 (enum shape): Renamed from enum shape_e.
13123 (struct colorentry): Renamed from struct colorentry_s.
13124 (struct classname): Renamed from struct classname_s.
13125 (struct infoname): Renamed from struct infoname_s.
13126 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
13127 (enum decision): Renamed from enum decision_e.
13128 (enum orientation): Renamed from enum orientation_e.
13129 (enum alignment): Renamed from enum alignment_e.
13130 (enum arrow_mode): Renamed from enum arrow_mode_e.
13131 (enum crossing_type): Renamed from enum crossing_type_e.
13132 (enum view): Renamed from enum view_e.
13133 (struct node): Renamed from struct node_s.
13134 (node): Renamed from node_t.
13135 (enum linestyle): Renamed from enum linestyle_e.
13136 (enum arrowstyle): Renamed from enum arrowstyle_e.
13137 (struct edge): Renamed from struct edge.
13138 (edge): Renamed from edge_t.
13139 (struct graph): Renamed from struct graph_s.
13140 (graph): Renamed from graph_t.
13141 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
13142 Rename value_t -> value.
13143 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
13144 value_t_as_yystype -> value_as_yystype.
13146 Don't include <errno.h> in the mainstream code, since it
13147 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
13148 * lib/get-errno.c, lib/get-errno.h: New files.
13149 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
13151 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
13152 * src/output.c (output_skeleton): Likewise.
13153 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
13155 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
13157 (handle_action_dollar, handle_action_at): Likewise.
13158 * src/system.h: Do not include <errno.h>.
13159 (TAB_EXT): Renamed from EXT_TAB.
13160 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
13162 Avoid str[a-z]*, since <string.h> reserves that name space.
13163 Change all instances of "struniq" in names to "uniqstr", and
13164 likewise for "STRUNIQ" and "UNIQSTR".
13165 * src/uniqstr.c: Renamed from src/struniq.c.
13166 * src/uniqstr.h: Renamed from src/struniq.h.
13167 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
13168 * src/files.c (strsuffix): Remove; unused.
13169 (concat2): Renamed from stringappend. Now static.
13170 * src/files.h (strsuffix, stringappend): Remove; unused.
13171 * src/parse-gram.y (<chars>): Renamed from <string>.
13172 (<uniqstr>): Renamed from <struniq>.
13173 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
13174 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
13175 (struct graph_s.expand): Renamed from struct graph_s.stretch.
13176 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
13177 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
13178 (N_EXPAND): Renamed from N_STRETCH.
13180 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
13181 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
13182 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
13184 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
13185 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
13186 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
13187 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
13188 (BASE_MAXIMUM): Renamed from BASE_MAX.
13189 (BASE_MINIMUM): Renamed from BASE_MIN.
13190 (ACTION_MAX): Remove; unused.
13191 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
13192 Unnecessary casts removed from above defines.
13195 Fix misspelling in names.
13196 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
13197 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
13201 * lib/timevar.c (timevar_report): Renamed from time_report,
13202 for consistency with other names.
13203 * lib/timevar.h (timevar_report): New decl.
13204 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
13207 Sort include-file uses.
13209 Reorder all include files under src to be in the order "system.h".
13210 then the ../lib include files in angle brackets (alphabetized),
13211 then the . include files in double-quotes (alphabetized). Fix
13212 dependency breakages encountered in this process, as follows:
13213 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
13214 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
13215 * src/state.h: Include "symtab.h".
13217 2002-12-08 Paul Eggert <eggert@twinsun.com>
13219 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
13220 since this causes problems when __file__ contains character
13221 sequences like "@" that are treated specially by src/scan-skel.l.
13222 Instead, just use the file's basename. This fixes the bug
13223 reported by Martin Mokrejs in
13224 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
13226 2002-12-06 Paul Eggert <eggert@twinsun.com>
13228 Add support for rules that do not have trailing semicolons, as
13229 POSIX requires. Improve the quality of locations in Bison
13232 * src/location.c: Include <quotearg.h>.
13233 (empty_location): Now const.
13234 (location_print): New function. Follow the recommendation of the
13235 GNU Coding Standards for locations that span file boundaries.
13236 * src/location.h: Do not include <quotearg.h>; no longer needed.
13237 (boundary): New type.
13238 (location_t): Use it. This allows locations to span file boundaries.
13239 All member uses changed: file -> start.file or end.file (as needed),
13240 first_line -> start.line, first_column -> start.column,
13241 last_line -> end.line, last_column -> end.column.
13242 (equal_boundaries): New function.
13243 (LOCATION_RESET, LOCATION_STEP): Remove.
13244 (LOCATION_PRINT): Remove. All callers changed to use location_print.
13245 (empty_location): Now const.
13246 (location_print): New decl.
13247 * src/parse-gram.y (lloc_default): New function, which handles
13248 empty locations more accurately.
13249 (YYLLOC_DEFAULT): Use it.
13250 (%token COLON): Remove.
13251 (%token ID_COLON): New token.
13253 (declarations, rules): Remove trailing semicolon.
13254 (declaration, rules_or_grammar_declaration):
13255 Allow empty (";") declaration.
13256 (symbol_def): Remove empty actions; no longer needed.
13257 (rules_or_grammar_declaration): Remove trailing semicolon.
13258 (semi_colon.opt): Remove.
13259 * src/reader.h: Include location.h.
13260 (scanner_cursor): New decl.
13261 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
13263 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
13265 (STEP): Remove. No longer needed, now that adjust_location does
13266 the work. All uses removed.
13267 (scanner_cursor): New var.
13268 (adjust_location): Renamed from extend_location. It now sets
13269 *loc and adjusts the scanner cursor. All uses changed.
13270 Don't bother testing for CR.
13271 (handle_syncline): Remove location arg; now updates scanner cursor.
13272 All callers changed.
13273 (unexpected_end_of_file): Now accepts start boundary of token or
13274 comment, not location. All callers changed. Update scanner cursor,
13276 (SC_AFTER_IDENTIFIER): New state.
13277 (context_state): Renamed from c_context. All uses changed.
13278 (id_loc, code_start, token_start): New local vars.
13279 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
13280 processing of Yacc white space and equivalents here.
13281 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
13282 instead of returning ID immediately, since we need to search for
13283 a subsequent colon.
13284 (<INITIAL>"'", "\""): Save token_start.
13285 (<INITIAL>"%{", "{", "%%"): Save code_start.
13286 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
13287 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
13288 BEGIN context_state at end, not INITIAL.
13289 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
13290 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
13291 Return correct token start.
13292 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
13293 the start of a character, string or multiline comment is found.
13294 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
13295 Reduction): Adjust reported locations to match the more-precise
13296 results now expected.
13297 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
13298 * tests/reduce.at (Useless Rules, Reduced Automaton,
13299 Underivable Rules): Likewise.
13300 * tests/regression.at (Invalid inputs): No longer `expecting ";"
13301 or "|"' now that so many other tokens are allowed by the new grammar.
13303 * src/complain.h (current_file): Remove duplicate decl;
13304 current_file is now owned by files.h.
13305 * src/complain.c, src/scan-gram.l: Include files.h.
13307 2002-12-06 Paul Eggert <eggert@twinsun.com>
13309 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
13310 promotes to int; it might be unsigned int.
13311 * data/yacc.c (yy_reduce_print): Likewise.
13313 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
13314 be #defined in the prologue, not in the Bison declarations.
13315 This fixes Debian Bug 102878, reported by Shaul Karl.
13317 2002-12-02 Paul Eggert <eggert@twinsun.com>
13319 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
13320 * lib/strtoul.c: New file, from gnulib.
13321 This fixes a porting bug reported by Peter Klein in
13322 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
13324 2002-11-30 Paul Eggert <eggert@twinsun.com>
13326 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
13327 and put only a forward declaration in the prologue. This is for
13328 consistency with the other scanner helper functions.
13330 Type clashes now generate warnings, not errors, since it
13331 appears that POSIX may allow some grammars with type clashes.
13332 * src/reader.c (grammar_current_rule_check): Warn about
13333 type clashes instead of complaining.
13334 * tests/input.at (Type Clashes): Expect warnings, not complaints.
13336 Add Yacc library, since POSIX requires it.
13337 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
13338 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
13339 * lib/main.c, lib/yyerror.c: New files.
13341 gram_error can be static; it need not be extern.
13342 * src/reader.h (gram_error): Remove decl.
13343 * src/parse-gram.y (gram_error): Now static. Add static decl.
13344 (print_token_value): Omit parameter names from forward decl,
13347 2002-11-29 Paul Eggert <eggert@twinsun.com>
13349 * doc/bison.texinfo: Emphasize that yylex and yyerror must
13350 be declared before being used. E.g., one should typically
13351 declare them in the prologue. Use GNU coding style in examples.
13352 Put "const" consistently after the type it modifies. Mention
13353 that C99 supports "inline". Mention that yyerror traditionally
13356 %parse-param and %lex-param now take just one argument, the
13357 declaration; the argument name is deduced from the declaration.
13359 * doc/bison.texinfo (Parser Function, Pure Calling, Error
13360 Reporting, Table of Symbols): Document this.
13361 * src/parse-gram.y (add_param): New function.
13363 (declaration): Implement new rule for %parse-param and %lex-param.
13364 * src/scan-gram.l: "," now elicits a warning, rather than being
13365 a token; this is more compatible with byacc.
13366 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
13368 2002-11-27 Paul Eggert <eggert@twinsun.com>
13370 Rename identifiers to avoid real and potential collisions.
13372 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
13373 to avoid collision with lex macro described by Bruce Lilly in
13374 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
13375 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
13376 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
13377 * src/parse-gram.y (print_token_value): Renamed from yyprint.
13379 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
13380 The name "yycontrol" violates the name space rules, and this stuff
13381 wasn't being used anyway.
13382 (input): Remove action; this stuff wasn't being used.
13383 (gram_error): Rename local variable yylloc -> loc.
13384 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
13385 (YY_DECL): Don't use "yy" at start of local variables.
13386 All uses changed, e.g., yylloc -> loc.
13387 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
13388 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
13389 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
13390 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
13392 * src/parse-gram.y (gram_error): loc is now const *.
13393 * src/reader.h (gram_error): Likewise.
13395 2002-11-24 Paul Eggert <eggert@twinsun.com>
13399 * tests/actions.at (Actions after errors): Use an output format
13400 more similar to that of the Printers and Destructors test.
13401 Test the position of the ';' token too.
13402 (Printers and Destructors): Likewise.
13403 (Printers and Destructors: %glr-parser): Remove for now, to avoid
13404 unnecessarily alarming people when the test fails.
13406 * data/yacc.c (yyerrlab1): Move this label down, so that the
13407 parser does not discard the lookahead token if the user code
13408 invokes YYERROR. This change is required for POSIX conformance.
13410 * lib/error.c: Sync with gnulib.
13412 2002-11-22 Paul Eggert <eggert@twinsun.com>
13414 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
13415 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
13416 * lib/xmalloc.c: Likewise.
13418 2002-11-20 Paul Eggert <eggert@twinsun.com>
13420 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
13422 2002-11-20 Paul Eggert <eggert@twinsun.com>
13424 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
13425 should use `if (! x) abort ();' rather than `assert (x);', and
13426 anyway it's one less thing to worry about configuring.
13428 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
13429 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
13430 and replace all instances of assert with abort.
13431 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
13432 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
13434 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
13435 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
13436 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
13437 hash_find_entry, hash_rehash, hash_insert): Likewise.
13438 * src/conflicts.c (resolve_sr_conflict): Likewise.
13439 * src/lalr.c (set_goto_map, map_goto): Likewise.
13440 * src/nullable.c (nullable_compute): Likewise.
13441 * src/output.c (prepare_rules, token_definitions_output): Likewise.
13442 * src/reader.c (packgram, reader): Likewise.
13443 * src/state.c (state_new, state_free, state_transitions_set,
13444 state_reduction_find): Likewise.
13445 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
13446 symbol_pack): Likewise.
13447 * src/tables.c (conflict_row, pack_vector): Likewise.
13448 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
13449 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
13450 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
13451 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
13453 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
13454 (ARGMATCH_CONSTRAINT): New macro.
13455 (ARGMATCH_ASSERT): Use it.
13457 * src/system.h (verify): New macro.
13458 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
13459 rather than assert.
13460 * src/tables.c (tables_generate): Likewise.
13462 * src/struniq.c (struniq_assert): Now returns void, and aborts
13463 if the assertion is false.
13464 (struniq_assert_p): Remove.
13465 * src/struniq.h: Likewise.
13467 2002-11-18 Paul Eggert <eggert@twinsun.com>
13469 * data/glr.c (yygetLRActions): Replace `yyindex' with
13470 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
13471 This fixes the regression with Sun ONE Studio 7 cc that I reported in
13472 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
13474 2002-11-18 Akim Demaille <akim@epita.fr>
13476 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
13478 From Tim Van Holder.
13480 2002-11-17 Paul Eggert <eggert@twinsun.com>
13482 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
13483 to "SyntaxError" for consistency with my 2002-11-15 change.
13485 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
13486 not define to {}, since this breaks the common use of `YYDPRINTF
13487 ((...));' if a single statement is desired (e.g. before `else').
13488 Work around GCC warnings by surrounding corresponding calls with
13490 (yyhasResolvedValue): Remove unused function.
13491 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
13493 (yyreportSyntaxError): Renamed from yyreportParseError.
13494 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
13496 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
13497 extern when possible. Remove unused initializations.
13499 2002-11-16 Akim Demaille <akim@epita.fr>
13501 Augment the similarity between GLR and LALR traces.
13503 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
13504 (YY_REDUCE_PRINT): New.
13505 (yyparse): Use them.
13506 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
13508 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
13509 state reached after the reduction/recovery, since...
13510 (yyparse, yyprocessOneStack): Report the state we are entering in.
13512 2002-11-16 Akim Demaille <akim@epita.fr>
13514 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
13515 Add support for --trace=skeleton.
13516 * src/scan-skel.l: %option debug.
13517 Scan strings of non-@ or \n instead of character by character.
13518 (scan_skel): Handle trace_skeleton.
13520 (@output_parser_name@, @output_header_name@): ``Restore'' their
13521 support (used to be M4 macros).
13522 * data/yacc.c: Quote larger chunks, a la glr.c.
13523 * data/lalr1.cc: Likewise.
13524 The header guards are no longer available, so use some other
13525 string than `YYLSP_NEEDED'.
13527 2002-11-16 Akim Demaille <akim@epita.fr>
13529 Make the ``Printers and Destructors'' test more verbose, taking
13530 `yacc.c''s behavior as (possibly wrong) reference.
13532 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
13533 instead of fprint on stdout.
13534 Set and report the last_line of the symbols.
13535 Consistently display values and locations.
13537 2002-11-16 Paul Eggert <eggert@twinsun.com>
13539 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
13541 2002-11-15 Paul Eggert <eggert@twinsun.com>
13543 * tests/actions.at (Actions after errors): New test case.
13545 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
13546 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
13547 tests/action.at, tests/calc.at, tests/conflicts.at,
13548 tests/cxx-type.at, tests/regression.at:
13549 "parse error" -> "syntax error" for POSIX compatibility.
13550 "parsing stack overflow..." -> "parser stack overflow" so
13551 that code matches Bison documentation.
13553 2002-11-15 Akim Demaille <akim@epita.fr>
13555 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
13556 take two BRACED_CODE, not two string_content.
13557 Free the scanner's obstack when we are done.
13558 (code_content): New.
13559 * tests/calc.at: Adjust.
13560 * doc/bison.texinfo: Adjust.
13561 Also, make sure to include the `,' for these declarations.
13563 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
13565 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
13566 definition; avoids potential autoreconf problems.
13568 2002-11-15 Akim Demaille <akim@epita.fr>
13570 Always check the value returned by yyparse.
13572 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
13573 returned by yyparse.
13574 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
13576 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
13577 returned by yyparse.
13579 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13581 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
13584 2002-11-14 Paul Eggert <eggert@twinsun.com>
13586 * src/output.c (output_skeleton): Call xfopen instead of
13587 duplicating xfopen's body.
13589 Fix bugs reported by Nelson H. F. Beebe in
13590 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
13592 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
13593 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
13594 Group compiler. Instead, use "$CC -E bar.c". Include the .h
13595 file twice in the grammar, as an extra check.
13597 * tests/input.at (Torturing the Scanner): Surround the
13598 backslash-newline tests with "#if 0", to make it less likely that
13599 we'll run into compiler bugs. Bring back solitary \ inside
13600 comment, but add a closing comment to work around HP C bug. Don't
13601 test backslash-newline in C character constant.
13603 2002-11-14 Akim Demaille <akim@epita.fr>
13605 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
13606 status of the compiler.
13607 Calling `exit 1' is no longer needed.
13608 Reported by Nelson H. F. Beebe.
13610 2002-11-14 Akim Demaille <akim@epita.fr>
13612 * tests/atlocal.in (CPPFLAGS): We have config.h.
13613 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
13615 * tests/actions.at, tests/calc.at, tests/conflicts.at,
13616 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
13617 * tests/regression.at, tests/torture.at: Use them for all the
13618 grammars that are to be compiled.
13619 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
13620 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
13621 * doc/bison.texinfo (GLR Parsers): Document `inline'.
13623 2002-11-14 Akim Demaille <akim@epita.fr>
13625 * doc/bison.texinfo: Various formatting changes (alignments in
13626 samples, additional @group/@end group, GCS in samples.
13627 Use @deffn instead of simple @table to define the directives,
13628 macros, variables etc.
13630 2002-11-13 Paul Eggert <eggert@twinsun.com>
13632 Fix some bugs reported by Albert Chin-A-Young in
13633 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
13635 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
13636 -o c"; the HP C compiler chatters during compilation.
13637 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
13638 * tests/headers.at (export YYLTYPE): Likewise.
13640 * tests/input.at (Torturing the Scanner): Remove lines containing
13641 solitary backslashes, as they tickle a bug in the HP C compiler.
13643 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
13644 comments, since they're not portable. Use GNU coding style.
13646 2002-11-13 Akim Demaille <akim@epita.fr>
13648 * data/yacc.c: Leave bigger chunks of quoted text.
13649 (YYDSYMPRINTF): New.
13650 Use it to report symbol activities.
13651 * data/glr.c (YYDSYMPRINTF): New.
13654 2002-11-12 Paul Eggert <eggert@twinsun.com>
13658 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
13659 (yyglrReduce): Return yyok, not 0.
13660 This should avoid the enumerated-type warnings reported
13661 by Nelson H. F. Beebe in
13662 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
13664 * lib/bbitset.h (BITSET_INLINE): Remove.
13665 * lib/bitset.h [! BITSET_INLINE]: Remove.
13666 (bitset_set, bitset_reset, bitset_test): Rename local vars
13667 to avoid shadowing warnings by GCC.
13669 * data/glr.c (inline): Remove #define. It's the user's
13670 responsibility to #define it away, just like 'const'.
13671 This fixes one of the bugs reported by Nelson H. F. Beebe in
13672 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
13674 * Makefile.maint (po-check): Scan .l and .y files instead of the
13675 .c and the .h files that they generate. This fixes the bug
13676 reported by Tim Van Holder in:
13677 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
13678 Look for N_ as well as for _. Try to avoid matching #define for
13680 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
13681 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
13682 * src/scan-gram.l: Revamp regular expressions so that " and '
13683 do not confuse xgettext.
13685 * src/struniq.h (struniq_new): Do not declare the return type
13686 to be 'const'; this violates the C standard.
13687 * src/struniq.c (struniq_new): Likewise.
13689 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
13691 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
13692 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
13695 2002-11-12 Akim Demaille <akim@epita.fr>
13697 * Makefile.maint: Sync with Autoconf:
13698 (local_updates): New.
13700 2002-11-12 Akim Demaille <akim@epita.fr>
13702 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
13704 2002-11-12 Akim Demaille <akim@epita.fr>
13706 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
13709 2002-11-12 Akim Demaille <akim@epita.fr>
13711 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
13714 2002-11-12 Akim Demaille <akim@epita.fr>
13716 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
13717 Use it to test the GLR parser.
13719 2002-11-12 Akim Demaille <akim@epita.fr>
13721 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
13723 * data/glr.c (yystos): New.
13724 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
13725 (YYDSYMPRINT): New.
13726 (yyval): Don't define it, it is handled via M4.
13727 (yyrecoverParseError): Free verbosely the discarded symbols.
13728 * data/yacc.c (yysymprint): Remove, rather...
13729 (b4_yysymprint_generate): invoke.
13730 * data/c.m4 (b4_yysymprint_generate): New.
13731 Accept pointers as arguments, as opposed to the version from
13733 (b4_yydestruct_generate): Likewise.
13734 * tests/cations.at (Printers and Destructors): Use Bison directives
13735 instead of CPP macros.
13736 Don't rely on internal details.
13738 2002-11-12 Akim Demaille <akim@epita.fr>
13740 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
13741 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
13742 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
13743 it against YYEMPTY and so forth), work on yytoken (i.e., set
13744 it to YYEMPTY etc.).
13745 (yydestruct): Replace with a b4_yydestruct_generate invocation.
13746 (b4_symbol_actions): Remove.
13747 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
13748 for 0, end-of-input.
13750 2002-11-12 Akim Demaille <akim@epita.fr>
13752 * doc/bison.texinfo (Destructor Decl): New.
13754 2002-11-12 Akim Demaille <akim@epita.fr>
13756 * src/tables.c (tables_generate): Use free for pointers that
13757 cannot be NULL, not XFREE.
13758 (pack_vector): Use assert, not fatal, for bound violations.
13759 * src/state.c (state_new): Likewise.
13760 * src/reader.c (reader): Likewise.
13761 * src/lalr.c (set_goto_map): Likewise.
13762 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
13765 2002-11-12 Akim Demaille <akim@epita.fr>
13767 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
13769 * src/scan-gram.l (last_string): Is global to the file, not to
13771 * src/parse-gram.y (input): Don't append the epilogue here,
13772 (epilogue.opt): do it here, and free the scanner's obstack.
13773 * src/reader.c (epilogue_set): Rename as...
13774 (epilogue_augment): this.
13775 * data/c.m4 (b4_epilogue): Defaults to empty.
13777 2002-11-12 Akim Demaille <akim@epita.fr>
13779 * src/getargs.c (long_options): Remove duplicates.
13780 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
13782 * doc/bison.rnh: Remove.
13783 * doc/bison.texinfo (VMS Invocation): Remove.
13785 2002-11-12 Akim Demaille <akim@epita.fr>
13787 * src/struniq.h, src/struniq.c (struniq_t): Is const.
13788 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
13790 Use struniq for symbols.
13792 * src/symtab.h (symbol_t): The tag member is a struniq.
13793 (symbol_type_set): Adjust.
13794 * src/symtab.c (symbol_new): Takes a struniq.
13795 (symbol_free): Don't free the tag member.
13796 (hash_compare_symbol_t, hash_symbol_t): Rename as...
13797 (hash_compare_symbol, hash_symbol): these.
13798 Use the fact that tags as struniqs.
13799 (symbol_get): Use struniq_new.
13800 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
13802 * src/reader.h (merger_list, grammar_currentmerge_set): The name
13803 and type members are struniqs.
13804 * src/reader.c (get_merge_function)
13805 (grammar_current_rule_merge_set): Adjust.
13806 (TYPE, current_type): Are struniq.
13808 Use struniq for file names.
13810 * src/files.h, src/files.c (infile): Split into...
13811 (grammar_file, current_file): these.
13812 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
13813 * src/reduce.c (reduce_print): Likewise.
13814 * src/getargs.c (getargs): Likewise.
13815 * src/complain.h, src/complain.c: Likewise.
13816 * src/main.c (main): Call struniqs_new early enough to use it for
13818 Don't free the input file name.
13820 2002-11-12 Akim Demaille <akim@epita.fr>
13822 * src/symtab.c (symbol_free): Remove dead deactivated code:
13823 type_name are properly removed.
13824 Don't use XFREE to free items that cannot be NULL.
13825 * src/struniq.h, src/struniq.c: New.
13826 * src/main.c (main): Initialize/free struniqs.
13827 * src/parse-gram.y (%union): Add astruniq member.
13829 * src/scan-gram.l (<{tag}>): Return a struniq.
13830 Free the obstack bit that used to store it.
13831 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
13833 2002-11-11 Paul Eggert <eggert@twinsun.com>
13835 Revamp to fix many (but not all) of the C- and M4-related quoting
13836 problems. Among other things, this fixes the Bison bug reported
13837 by Jan Hubicka when processing the Bash grammar; see:
13838 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
13840 Use new @ escapes consistently. Represent brackets with @{ and @}
13841 rather than @<:@ and @:>@, since this works a bit better with dumb
13842 editors like vi. Represent @ with @@, since @ is now consistently
13843 an escape. Use @oline@ and @ofile@ rather than __oline__ and
13844 __ofile__, to avoid unexpected expansions. Similarly, use @output
13845 rather than #output.
13847 * data/c.m4 (b4_copyright): Omit file name from comment, since
13848 the file name could contain "*/".
13849 (b4_synclines_flag): Don't quote the 2nd argument; it should already
13850 be quoted. All uses changed.
13852 * data/glr.c: Use new @ escapes consistently.
13853 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
13854 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
13855 Remove, since they couldn't handle arbitrary characters in file
13857 * data/lalr1.cc: Likewise.
13858 * data/yacc.c: Likewise.
13860 * src/files.c (output_infix): Remove; all uses removed.
13861 * src/files.h: Likewise.
13863 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
13864 mishandled funny characters in file names, and anyway it isn't
13866 * data/yacc.c: Likewise.
13867 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
13869 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
13870 * data/yacc.c: Likewise.
13872 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
13874 (muscle_init): Quote filename as a C string.
13875 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
13876 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
13877 * src/output.c (escaped_file_name_output): New function.
13878 (prepare_symbols): Quote tokens for M4.
13879 (prepare): Don't insert output_infix, output_prefix,
13880 output_parser_name, output_header_name; this is now down by scan-skel.
13881 Insert skeleton as a C string.
13883 * src/output.c (user_actions_output, symbol_destructors_output,
13884 symbol_printers_output): Quote filenames for C and M4.
13885 * src/reader.c (prologue_augment, epilogue_set): Likewise.
13887 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
13888 escapes other than \\ and \'; this simplifies the code.
13889 (<SC_STRING>): Likewise, for \\ and \".
13890 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
13891 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
13892 Use new escapes @{ and @} for [ and ].
13894 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
13895 them with auto vars.
13896 Switch to new escape scheme, where @ is the escape character uniformly.
13897 Abort if a stray escape character is found. Avoid unbounded input
13898 buffer when parsing non-escaped text.
13900 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
13901 __oline__, #output, $@, and @{ do not have unintended meanings.
13903 2002-11-09 Paul Eggert <eggert@twinsun.com>
13905 Fix the test failure due to GCC warnings described in
13906 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
13907 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
13908 evaluate to 0 if it's impossible for NINF to be in the respective
13910 (yygetLRActions, yyrecoverParseError): Use them.
13912 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
13913 counted in the token inserted at end of file. Now takes
13914 location_t *, not location_t, so that the location can be
13915 adjusted. All uses changed.
13917 * tests/regression.at (Invalid inputs): Adjust wording in
13918 diagnostic to match the new behavior.
13920 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
13921 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
13922 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
13923 abort ();'. This reduces the runtime of the "Many lookaheads"
13924 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
13927 2002-11-07 Paul Eggert <eggert@twinsun.com>
13929 * src/parse-gram.y (CHARACTER): Remove unused token.
13932 * src/scan-gram.l: Remove stack option. We no longer use the
13933 stack, since the stack was never deeper than 1; instead, use the
13934 new auto var c_context to record the stacked value.
13936 Remove nounput option. At an unexpected end of file, we now unput
13937 the minimal input necessary to end cleanly; this simplifies the
13940 Avoid unbounded token sizes where this is easy.
13942 (unexpected_end_of_file): New function.
13943 Use it to systematize the error message on unexpected EOF.
13944 (last-string): Now auto, not static.
13945 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
13946 (scanner_last_string_free): Remove; not used.
13947 (percent_percent_count): Move decl to just before use.
13948 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
13949 not the (never otherwised-used) CHARACTER.
13951 2002-11-07 Akim Demaille <akim@epita.fr>
13953 Let yyerror always receive the msg as last argument, so that
13954 yyerror can be variadic.
13956 * data/yacc.c (b4_yyerror_args): New.
13957 Use it when calling yyerror.
13958 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
13959 Use it when calling yyerror.
13960 * doc/bison.texinfo (Error Reporting): Adjust.
13961 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
13962 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
13964 2002-11-06 Akim Demaille <akim@epita.fr>
13966 #line should have quoted strings.
13967 Ideally, this should be done by m4_quotearg.
13969 * src/scan-skel.l: Include quotearg.h.
13971 * src/output.c (symbol_printers_output)
13972 (symbol_destructors_output): Quote the file name.
13974 2002-11-06 Akim Demaille <akim@epita.fr>
13976 * tests/regression.at (Invalid inputs): Adjust to the recent
13979 2002-11-06 Akim Demaille <akim@epita.fr>
13981 Restore --no-lines.
13982 Reported by Jim Kent.
13984 * data/c.m4 (b4_syncline): New.
13985 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
13986 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
13987 * src/output.c (user_actions_output): Likewise.
13988 (prepare): Define 'b4_synclines_flag'.
13989 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
13991 2002-11-06 Akim Demaille <akim@epita.fr>
13993 * src/main.c (main): Free `infile'.
13994 * src/scan-gram.l (handle_syncline): New.
13996 * src/output.c (user_actions_output, symbol_destructors_output)
13997 (symbol_printers_output): Use the location's file name, not
13999 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14001 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14003 * src/tables.c (matching_state): Don't allow states to match if
14004 either has GLR conflict entries.
14006 2002-11-05 Paul Eggert <eggert@twinsun.com>
14008 * src/scan-gram.l: Use more accurate diagnostics, e.g.
14009 "integer out of range" rather than "invalid value".
14010 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
14013 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
14014 Also, remove one static variable in the scanner.
14016 * src/scan-gram.l (braces_level): Now auto, not static.
14017 Initialize to zero if the compiler is being picky.
14018 (INITIAL): Clear braces_level instead of incrementing it.
14019 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
14020 as POSIX 1003.1-2001 requires.
14021 * src/system.h (IF_LINT): New macro, taken from coreutils.
14022 * configure.ac: Define "lint" if --enable-gcc-warnings.
14024 2002-11-05 Akim Demaille <akim@epita.fr>
14026 * src/scan-gram.l: When it starts with `%', complain about the
14027 whole directive, not just that `invalid character: %'.
14029 2002-11-04 Akim Demaille <akim@epita.fr>
14031 * Makefile.maint: Update from Autoconf.
14032 (update, cvs-update, po-update, do-po-update): New.
14034 2002-11-04 Akim Demaille <akim@epita.fr>
14036 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
14038 Have yyerror `use' its arguments.
14039 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
14040 returns true when location & yacc & pure & parse-param.
14041 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
14043 2002-11-04 Akim Demaille <akim@epita.fr>
14045 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
14047 * src/scan-gram.l: Use [\'] instead of ['] to pacify
14050 Use quote, not quote_n since LOCATION_PRINT no longer uses the
14053 2002-11-03 Paul Eggert <eggert@twinsun.com>
14055 * src/reader.c (get_merge_function, grammar_current_rule_check):
14056 Use consistent diagnostics for reporting type name clashes.
14057 Quote the types with <>, for consistency with Yacc.
14058 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
14060 2002-11-03 Akim Demaille <akim@epita.fr>
14062 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
14064 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
14065 (b4_parse_param): Remove.
14066 Use b4_identification.
14067 Propagate b4_pure_args where needed to pass them to yyerror.
14068 * data/glr.m4 (b4_parse_param): Remove.
14069 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
14070 (b4_lpure_formals): New.
14071 Use b4_identification.
14072 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
14073 b4_user_formals and b4_user_args.
14074 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
14075 (yyreportAmbiguity): When using a pure parser, also need
14076 the location, and the parse-params.
14078 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
14079 When using a pure parser, also need the parse-params.
14081 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
14082 (%pure-parser + %parse-param) LALR and GLR parsers.
14083 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
14084 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
14085 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
14086 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
14087 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
14088 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
14089 * doc/bison.texinfo: Untabify the whole file.
14090 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
14091 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
14092 (Error Reporting): Adjust to these new directives.
14093 Document %error-verbose, deprecate YYERROR_VERBOSE.
14095 2002-11-03 Akim Demaille <akim@epita.fr>
14097 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
14098 AT_CHECK_CALC_GLR invocations to use % directives, instead of
14099 command line options.
14100 * tests/cxx-type.at: Formatting changes.
14102 2002-11-03 Paul Eggert <eggert@twinsun.com>
14104 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
14105 to count columns correctly, and to check for invalid inputs.
14107 Use mbsnwidth to count columns correctly. Account for tabs, too.
14108 Include mbswidth.h.
14109 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
14110 (extend_location): New function.
14111 (YY_LINES): Remove.
14113 Handle CRLF in C code rather than in Lex code.
14114 (YY_INPUT): New macro.
14115 (no_cr_read): New function.
14117 Scan UCNs, even though we don't fully handle them yet.
14118 (convert_ucn_to_byte): New function.
14120 Handle backslash-newline correctly in C code.
14121 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
14122 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
14124 (tag, splice): New EREs. Do not allow NUL or newline in tags.
14125 Use {splice} wherever C allows backslash-newline.
14126 YY_STEP after space, newline, vertical-tab.
14127 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
14129 (letter, id): Don't assume ASCII; e.g., spell out a-z.
14131 ({int}, handle_action_dollar, handle_action_at): Check for integer
14134 (YY_STEP): Omit trailing semicolon, so that it's more like C.
14136 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
14137 as well as \000. Check for UCHAR_MAX, not 255.
14138 Allow \x with an arbitrary positive number of digits, as in C.
14139 Check for overflow here.
14140 Allow \? and UCNs, for compatibility with C.
14142 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
14143 with quote slot used by complain_at.
14145 * tests/input.at: Add tests for backslash-newline, m4 quotes
14146 in symbols, long literals, and funny escapes in strings.
14148 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
14149 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
14150 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
14151 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
14152 * m4/mbswidth.m4: New file, from GNU coreutils.
14154 * doc/bison.texinfo (Grammar Outline): Document // comments.
14155 (Symbols): Document that trigraphs have no special meaning in Bison,
14156 nor is backslash-newline allowed.
14157 (Actions): Document that trigraphs have no special meaning.
14159 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
14162 2002-11-02 Paul Eggert <eggert@twinsun.com>
14164 * src/reader.c: Don't include quote.h; not needed.
14165 (get_merge_function): Reword warning to be consistent with
14166 type clash diagnostic in grammar_current_rule_check.
14168 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
14169 bug in trigraph handling.
14171 * src/output.c (prepare_symbols): When printing token names,
14172 escape "[" as "@<:@" and likewise for "]".
14174 * src/system.h (errno): Remove declaration, as we are now
14175 assuming C89 or better, and C89 guarantees errno.
14177 2002-10-30 Paul Eggert <eggert@twinsun.com>
14179 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
14180 Check for close failures.
14181 * src/files.h (xfclose): Return void, not int, since it always
14183 * src/files.c (xfclose): Likewise. Report I/O error if ferror
14185 * src/output.c (output_skeleton): Use xfclose rather than fclose
14186 and ferror. xfclose now checks ferror.
14188 * data/glr.c (YYLEFTMOST_STATE): Remove.
14189 (yyreportTree): Use a stack-based leftmost state. This avoids
14190 our continuing battles with bogus warnings about initializers.
14192 2002-10-30 Akim Demaille <akim@epita.fr>
14194 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
14197 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14199 * tests/glr-regr1.at: New test for reported regressions.
14200 * tests/testsuite.at: Add glr-regr1.at test.
14201 * tests/Makefile.am: Add glr-regr1.at test.
14203 2002-10-24 Paul Eggert <eggert@twinsun.com>
14207 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
14208 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
14209 we use malloc. Don't assume 'A' through 'Z' are contiguous.
14210 Don't assume strdup exists; POSIX says its an XSI extension.
14211 Check for buffer overflow on input.
14213 2002-10-24 Akim Demaille <akim@epita.fr>
14215 * src/output.c (output_skeleton): Don't disable M4sugar comments
14216 too soon: it results in comments being expanded.
14217 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
14220 2002-10-24 Akim Demaille <akim@epita.fr>
14222 * data/yacc.c (m4_int_type): New.
14223 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
14224 char' as only yacc.c wants K&R portability.
14225 * data/glr.c (yysigned_char): Remove.
14226 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
14227 Reported by Quoc Peyrot.
14229 2002-10-23 Paul Eggert <eggert@twinsun.com>
14231 * src/main.c (main): With --trace=time, report times even if a
14232 non-fatal error occurs. Formerly, the times were reported in some
14233 such cases but not in others.
14234 * src/reader.c (reader): Just return if a complaint has been issued,
14235 instead of exiting, so that 'main' can report times.
14237 2002-10-22 Akim Demaille <akim@epita.fr>
14239 * src/system.h: Include sys/types.
14240 Reported by Bert Deknuydt.
14242 2002-10-23 Paul Eggert <eggert@twinsun.com>
14244 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
14245 Suggested by Art Haas.
14247 2002-10-22 Paul Eggert <eggert@twinsun.com>
14249 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
14250 decl; not needed any more.
14251 * src/main.c (main): Use return to exit, undoing yesterday's change.
14252 The last OS that we could find where this wouldn't work is
14253 SunOS 3.5, and that's too old to worry about now.
14255 * data/glr.c (struct yyltype): Define members even when not
14256 doing locations. This is more consistent with yacc.c, and it
14257 works around the following bug reports:
14258 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
14259 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
14261 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
14262 @acronym consistently. Standardize on "Yacc" instead of "YACC",
14263 "Algol" instead of "ALGOL". Give a bit more history about BNF.
14265 2002-10-22 Akim Demaille <akim@epita.fr>
14267 * data/README: New.
14269 2002-10-21 Paul Eggert <eggert@twinsun.com>
14271 Be consistent about 'bool'; the old code used an enum in one
14272 module and an int in another, and this violates the C standard.
14273 * m4/stdbool.m4: New file, from coreutils 4.5.3.
14274 * configure.ac (AC_HEADER_STDBOOL): Add.
14275 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
14276 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
14277 * src/symtab.c (hash_compare_symbol_t): Likewise.
14278 * src/system.h (bool, false, true): Use a definition consistent
14279 with ../lib/hash.c. All uses changed.
14281 * src/complain.c (warning_issued): Renamed from warn_message_count,
14282 so that we needn't worry about integer overflow (!).
14283 Now of type bool. All uses changed.
14284 (complaint_issued): Renamed from complain_message_count; likewise.
14286 * src/main.c (main): Use exit to exit with failure.
14288 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
14289 rather than 1 and 0.
14290 * src/main.c (main): Likewise.
14291 * src/getargs.c (getargs): Likewise.
14292 * src/reader.c (reader): Likewise.
14294 * src/getarg.c (getargs): Remove duplicate code for
14295 "Try `bison --help'".
14297 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
14298 What was that "2" for?
14300 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
14301 * src/getargs.c (usage): Likewise.
14303 * src/getargs.c (getargs): When there are too few operands, report
14304 the last one. When there are too many, report the first extra
14305 one. This is how diffutils does it.
14307 2002-10-20 Paul Eggert <eggert@twinsun.com>
14309 Remove K&R vestiges.
14310 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
14311 * src/complain.c (VA_START): Remove. Assume prototypes.
14312 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
14313 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
14314 fatal): Assume prototypes.
14315 * src/complain.h: Assume prototypes.
14316 * src/system.h (PARAMS): Remove.
14317 Include <limits.h> unconditionally, since it's guaranteeed even
14318 for a freestanding C89 compiler.
14319 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
14320 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
14322 2002-10-20 Akim Demaille <akim@epita.fr>
14324 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
14325 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
14326 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
14327 (yyresolveStates, yyresolveAction, yyresolveStack)
14328 (yyprocessOneStack): Use them.
14329 (yy_reduce_print): New.
14330 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
14332 2002-10-20 Akim Demaille <akim@epita.fr>
14334 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
14335 arguments and output `void'.
14336 (b4_c_function): Rename as...
14337 (b4_c_function_def): this.
14338 (b4_c_function_decl, b4_c_ansi_function_def)
14339 (b4_c_ansi_function_decl): New.
14340 Change the interpretation of the arguments: before `int, foo', now
14342 * data/yacc.c (yyparse): Prototype and define thanks to these.
14343 Adjust b4_c_function_def uses.
14344 * data/glr.c (yyparse): Likewise, but ANSI only.
14346 2002-10-20 Akim Demaille <akim@epita.fr>
14348 * src/output.c (prepare): Move the definition of `tokens_number',
14349 `nterms_number', `undef_token_number', `user_token_number_max'
14351 (prepare_tokens): Here.
14352 (prepare_tokens): Rename as...
14353 (prepare_symbols): this.
14354 (prepare): Move the definition of `rules_number' to...
14355 (prepare_rules): here.
14356 (prepare): Move the definition of `last', `final_state_number',
14357 `states_number' to...
14358 (prepare_states): here.
14359 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
14361 2002-10-20 Akim Demaille <akim@epita.fr>
14363 * src/tables.h, src/tables.c, src/output.c: Comment changes.
14365 2002-10-20 Akim Demaille <akim@epita.fr>
14367 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
14370 2002-10-20 Akim Demaille <akim@epita.fr>
14372 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
14373 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
14375 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
14377 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
14378 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
14381 2002-10-19 Paul Eggert <eggert@twinsun.com>
14383 Do not create a temporary file, as that involves security and
14384 cleanup headaches. Instead, use a pair of pipes.
14385 Derived from a suggestion by Florian Krohm.
14386 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
14387 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
14388 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
14389 (BISON_PREREQ_SUBPIPE): Add.
14390 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
14391 Add subpipe.h, subpipe.c.
14392 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
14393 * po/POTFILES.in: Add lib/subpipe.c.
14394 * src/output.c: Include "subpipe.h".
14395 (m4_invoke): Remove decl.
14396 (scan_skel): New decl.
14397 (output_skeleton): Use pipe rather than temporary file for m4 input.
14398 Check that m4sugar.m4 is readable, to avoid deadlock.
14399 Check for pipe I/O error.
14400 * src/scan-skel.l (readpipe): Remove decl.
14401 (scan_skel): New function, to be used in place of m4_invoke.
14402 Read from stream rather than file.
14404 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
14405 float, as this generates a warning on Solaris 8 + GCC 3.2 with
14406 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
14407 this generates a more-accurate value anyway.
14409 * lib/timevar.c (timervar_accumulate): Rename locals to
14410 avoid confusion with similarly-named more-global.
14411 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
14413 * src/output.c (prepare): Use xstrdup to convert char const *
14414 to char *, to avoid GCC warning.
14416 2002-10-19 Akim Demaille <akim@epita.fr>
14418 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
14419 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
14420 Use them to have `calc.y' ready for %pure-parser.
14421 * data/yacc.c (YYLEX): Pass a yylex return type to
14422 b4_c_function_call.
14424 2002-10-19 Akim Demaille <akim@epita.fr>
14426 Prototype support of %lex-param and %parse-param.
14428 * src/parse-gram.y: Add the definition of the %lex-param and
14429 %parse-param tokens, plus their rules.
14430 Drop the `_' version of %glr-parser.
14432 * src/scan-gram.l (INITIAL): Scan them.
14433 * src/muscle_tab.c: Comment changes.
14434 (muscle_insert, muscle_find): Rename `pair' as `probe'.
14435 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
14436 (muscle_entry_s): The `value' member is no longer const.
14437 Adjust all dependencies.
14438 * src/muscle_tab.c (muscle_init): Adjust: use
14439 MUSCLE_INSERT_STRING.
14440 Initialize the obstack earlier.
14441 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
14442 (muscle_pair_list_grow): New.
14443 * data/c.m4 (b4_c_function_call, b4_c_args): New.
14444 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
14445 * tests/calc.at: Use %locations, not --locations.
14446 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
14448 2002-10-19 Akim Demaille <akim@epita.fr>
14450 * src/getargs.c (usage): Take status as argument and exit
14452 Report the traditional `Try ... --help' message when status != 0.
14453 (usage, version): Don't take a FILE * as arg, it is pointless.
14454 (getargs): When there is an incorrect number of arguments, make it
14455 an error, and report it GNUlically thanks to `usage ()'.
14457 2002-10-18 Paul Eggert <eggert@twinsun.com>
14459 * data/glr.c (yyreportParseError): Don't assume that sprintf
14460 yields the length of the printed string, as this is not true
14461 on SunOS 4.1.4. Reported by Peter Klein.
14463 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
14464 * tests/conflicts.at (%nonassoc and eof): Likewise.
14465 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
14467 2002-10-17 Akim Demaille <akim@epita.fr>
14469 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
14470 * src/getargs.c (trace_types, trace_args): Adjust.
14471 * src/reader.c (grammar_current_rule_prec_set)
14472 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
14473 Standardize error messages.
14474 And s/@prec/%prec/!
14475 (reader): Use trace_flag to enable scanner/parser debugging,
14476 instead of an adhoc scheme.
14477 * src/scan-gram.l: Remove trailing debugging code.
14479 2002-10-16 Paul Eggert <eggert@twinsun.com>
14481 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
14484 * NEWS: Officially drop support for building Bison with K&R C,
14485 since it didn't work anyway and it's not worth worrying about.
14486 * Makefile.maint (wget_files): Remove ansi2knr.c.
14487 (ansi2knr.c-url_prefix): Remove.
14488 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
14489 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14490 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14492 2002-10-15 Paul Eggert <eggert@twinsun.com>
14494 Stop using the "enum_" trick for K&R-style function definitions;
14495 it confused me, and I was the author! Instead, assume that people
14496 who want to use K&R C compilers (when using these modules in GCC,
14497 perhaps?) will run ansi2knr.
14499 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
14500 All uses of "enum_" changed to "enum ".
14501 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
14502 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
14504 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
14505 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
14506 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
14507 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
14508 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
14509 abitset_not, abitset_ones, abitset_or, abitset_or_and,
14510 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
14511 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
14512 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
14513 Use function prototypes; this removes the need for declaring
14514 static functions simply to provide their prototypes.
14515 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
14516 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
14517 bitset_count_, bitset_create, bitset_dump, bitset_first,
14518 bitset_free, bitset_init, bitset_last, bitset_next,
14519 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
14520 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
14521 bitset_print, bitset_release_memory, bitset_toggle_,
14522 bitset_type_choose, bitset_type_get, bitset_type_name_get,
14523 debug_bitset): Likewise.
14524 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
14525 * lib/bitset_stats.c (bitset_log_histogram_print,
14526 bitset_percent_histogram_print, bitset_stats_and,
14527 bitset_stats_and_cmp, bitset_stats_and_or,
14528 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
14529 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
14530 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
14531 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
14532 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
14533 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
14534 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
14535 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
14536 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
14537 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
14538 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
14539 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
14540 bitset_stats_zero): Likewise.
14541 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
14542 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
14543 bitsetv_dump, debug_bitsetv): Likewise.
14544 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
14545 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
14546 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
14547 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
14548 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
14549 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
14550 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
14551 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
14552 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
14553 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
14554 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
14556 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
14557 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
14558 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
14559 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
14560 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
14561 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
14562 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
14563 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
14564 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
14565 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
14566 lbitset_xor_cmp, lbitset_zero): Likewise.
14568 2002-10-14 Akim Demaille <akim@epita.fr>
14572 2002-10-14 Akim Demaille <akim@epita.fr>
14574 * tests/Makefile.am (maintainer-check-posix): New.
14576 2002-10-14 Akim Demaille <akim@epita.fr>
14578 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
14581 2002-10-14 Akim Demaille <akim@epita.fr>
14583 * src/tables.c (table_ninf_remap): base -> tab.
14584 Reported by Matt Rosing.
14586 2002-10-14 Paul Eggert <eggert@twinsun.com>
14588 * tests/action.at, tests/calc.at, tests/conflicts.at,
14589 tests/cxx-type.at, tests/headers.at, tests/input.at,
14590 tests/regression.at, tests/synclines.at, tests/torture.at:
14591 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
14592 so that the tests still work even if POSIXLY_CORRECT is set.
14593 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
14595 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
14596 for portability to K&R hosts. Fix typo: signed char is guaranteed
14597 only to 127, not to 128.
14598 * data/glr.c (yysigned_char): New type.
14599 * data/yacc.c (yysigned_char): Likewise.
14600 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
14602 2002-10-13 Paul Eggert <eggert@twinsun.com>
14604 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
14605 true due to limited range of data type" warning from GCC.
14607 * data/c.m4 (b4_token_defines): Protect against double-inclusion
14608 by wrapping enum yytokentype's definition inside #ifndef
14609 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
14611 2002-10-13 Akim Demaille <akim@epita.fr>
14613 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
14614 Un yy- yyrhs to avoid the name clash with the global YYRHS.
14616 2002-10-13 Akim Demaille <akim@epita.fr>
14618 * Makefile.maint: Update from Autoconf 2.54.
14619 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
14621 2002-10-13 Akim Demaille <akim@epita.fr>
14623 * src/print.c (print_state): Separate the list of solved conflicts
14624 from the other items.
14625 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
14627 2002-10-13 Akim Demaille <akim@epita.fr>
14629 Let nondeterministic skeletons be usable with deterministic
14632 With the patch, GAWK compiled by GCC without -O2 passes its test
14633 suite using a GLR parser driven by LALR tables. It fails with -O2
14634 because `struct stat' gives two different answers on my machine:
14635 88 (definition of an auto var) and later 96 (memset on this var).
14636 Hence the stack is badly corrumpted. The headers inclusion is to
14637 blame: if I move the awk.h inclusion before GLR's system header
14638 inclusion, the two struct stat have the same size.
14640 * src/tables.c (pack_table): Always create conflict_table.
14641 (token_actions): Always create conflict_list.
14642 * data/glr.c (YYFLAG): Remove, unused.
14644 2002-10-13 Akim Demaille <akim@epita.fr>
14646 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
14648 (VALGRIND, GXX): New.
14649 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
14650 * tests/bison.in: Run $PREBISON a pre-command.
14651 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
14652 (maintainer-check-g++): New.
14653 * Makefile.am (maintainer-check): New.
14655 2002-10-13 Akim Demaille <akim@epita.fr>
14657 * data/glr.c: Formatting changes.
14658 Tweak some trace messages to match yacc.c's.
14660 2002-10-13 Akim Demaille <akim@epita.fr>
14662 GLR parsers sometimes raise parse errors instead of performing the
14664 Reported by Charles-Henry de Boysson.
14666 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
14667 check the length of the traces when %glr.
14668 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
14670 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
14672 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
14673 (yyltype): Remove the yy prefix from the member names.
14674 (yytable): Complete its comment.
14675 (yygetLRActions): Map error action number from YYTABLE from
14677 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
14678 (which was a bug: it should have been YYTABEL_NINF, and yet it was
14679 not satisfying as we could compare an YYACTION computed from
14680 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
14681 only value for error actions.
14682 (yyreportParseError): In verbose parse error messages, don't issue
14683 `error' in the list of expected tokens.
14684 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
14685 next action to perform to match glr.c's decoding.
14686 (yytable): Complete its comment.
14688 2002-10-13 Paul Eggert <eggert@twinsun.com>
14690 Fix problem reported by Henrik Grubbstroem in
14691 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
14692 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
14693 because the Bison parser reads the second action before reducing
14695 * src/scan-gram.l (rule_length): New static var.
14696 Use it to keep track of the rule length in the scanner, since
14697 we can't expect the parser to be in lock-step sync with the scanner.
14698 (handle_action_dollar, handle_action_at): Use this var.
14699 * tests/actions.at (Exotic Dollars): Test for the problem.
14701 2002-10-12 Paul Eggert <eggert@twinsun.com>
14703 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
14704 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
14705 Include <sys/time.h> when checking for clock_t and struct tms.
14706 Use same include order as source.
14707 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
14708 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
14710 * lib/timevar.c: Update copyright date and clarify comments.
14711 (get_time) [IN_GCC]: Keep the GCC version for reference.
14713 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
14714 GCC version as of today, then merge Bison's changes.
14715 Change "GCC" to "Bison" in copyright notice. timevar.def's
14716 author is Akim, so change that too.
14718 * src/reader.c (grammar_current_rule_check):
14719 Don't worry about the default action if $$ is untyped.
14720 Prevents bogus warnings reported by Jim Gifford in
14721 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
14723 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
14724 * data/glr.c, data/lalr1.cc, data/yacc.c:
14725 Output token definitions before the first part of user declarations.
14726 Fixes compatibility problem reported by Jim Gifford for kbd in
14727 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14729 2002-10-11 Paul Eggert <eggert@twinsun.com>
14731 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
14732 (yyparse): here. This undoes some of the 2002-07-25 change.
14733 Compatibility problem reported by Ralf S. Engelschall with
14734 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
14736 2002-10-11 Akim Demaille <akim@epita.fr>
14738 * tests/regression.at Characters Escapes): New.
14739 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
14741 Reported by Jan Nieuwenhuizen.
14743 2002-10-11 Akim Demaille <akim@epita.fr>
14747 2002-10-10 Paul Eggert <eggert@twinsun.com>
14749 Portability fixes for bitsets; this also avoids several GCC
14752 * lib/abitset.c: Include <stddef.h>, for offsetof.
14753 * lib/lbitset.c: Likewise.
14755 * lib/abitset.c (abitset_bytes): Return a size that is aligned
14756 properly for vectors of objects. Do not assume that adding a
14757 header size to a multiple of a word size yields a value that is
14758 properly aligned for the whole union.
14759 * lib/bitsetv.c (bitsetv_alloc): Likewise.
14761 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
14762 unique names for structures.
14763 * lib/ebitset.c (ebitset_bytes): Likewise.
14764 * lib/lbitset.c (lbitset_bytes): Likewise.
14766 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
14767 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
14768 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
14769 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
14770 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
14771 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
14772 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
14773 to improve the type-checking that GCC can do.
14774 * lib/bitset.c (bitset_op4_cmp): Likewise.
14775 * lib/bitset_stats.c (bitset_stats_count,
14776 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
14777 bitset_stats_copy, bitset_stats_disjoint_p,
14778 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
14779 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
14780 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
14781 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
14782 bitset_stats_and_or_cmp, bitset_stats_andn_or,
14783 bitset_stats_andn_or_cmp, bitset_stats_or_and,
14784 bitset_stats_or_and_cmp): Likewise.
14785 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
14786 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
14787 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
14788 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
14790 * lib/abitset.h: Include bitset.h, not bbitset.h.
14791 * lib/ebitset.h: Likewise.
14792 * lib/lbitset.h: Likewise.
14794 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
14795 All instances of parameters of type enum bitset_opts are now of
14796 type enum_bitset_opts, to conform to the C Standard, and similarly
14797 for enum_bitset_type.
14798 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
14799 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
14801 Do not use "struct bitset_struct" to mean different things in
14802 different modules. Not only is this confusing, it violates
14803 the C Standard, which requires that structure types in different
14804 modules must be compatible if one is to be passed to the other.
14805 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
14806 All instances of "struct bitset_struct *" replaced with "bitset".
14807 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
14808 (union bitset_union, struct abitset_struct, struct ebitset_struct,
14809 struct lbitset_struct, struct bitset_stats_struct): New types.
14810 All uses of struct bitset_struct changed to union bitset_union,
14812 * lib/abitset.c (struct abitset_struct, abitset,
14813 struct bitset_struct): Remove.
14814 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
14815 struct bitset_struct): Remove.
14816 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
14817 bitset_struct): Remove.
14818 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
14821 Do not call a function of type T using a call that assumes the
14822 function is of a different type U. Standard C requires that a
14823 function must be called with a type that is compatible with its
14825 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
14827 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
14829 * lib/ebitset.c (PFV): Remove.
14830 * lib/lbitset.c (PFV): Likewise.
14831 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
14832 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
14834 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
14835 (ebitset_vtable): Use them.
14836 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
14837 lbitset_xor): New functions.
14838 (lbitset_vtable): Use them.
14840 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
14843 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
14845 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
14846 Use offsetof, for simplicity.
14848 2002-10-06 Paul Eggert <eggert@twinsun.com>
14850 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
14851 the same width as int. This reapplies a hunk of the 2002-08-12 patch
14852 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
14853 which was inadvertently undone by the 2002-09-30 patch.
14854 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
14855 the same width as int.
14857 2002-10-04 Paul Eggert <eggert@twinsun.com>
14861 * configure.ac (AC_INIT), NEWS: Increment version number.
14863 * doc/bison.texinfo: Minor spelling, grammar, and white space
14865 (Symbols): Mention that any negative value returned from yylex
14866 signifies end-of-input. Warn about negative chars. Mention
14867 the portable Standard C character set.
14869 The GNU coding standard says CFLAGS and YFLAGS are reserved
14870 for the installer to set.
14871 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
14872 * src/Makefile.am (AM_CFLAGS): Likewise.
14873 (AM_YFLAGS): Renamed from YFLAGS.
14875 Fix some MAX and MIN problems.
14876 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
14877 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
14878 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
14879 * src/reader.c (reader): Use it.
14881 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
14882 POSIX 1003.1-2001 has removed fgrep.
14884 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
14886 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
14887 interpreted as signed.
14888 * lib/ebitset.c (ebitset_list): Fix bug.
14890 2002-10-01 Paul Eggert <eggert@twinsun.com>
14892 More fixes for 64-bit hosts and large bitsets.
14894 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
14895 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
14896 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
14897 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
14898 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
14899 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
14900 bitset_count_): Likewise.
14901 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
14902 bitset_first, bitset_last): Likewise.
14903 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
14904 bitset_stats_list_reverse, bitset_stats_size,
14905 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
14907 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14908 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
14909 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
14910 bitsetv_reflexive_transitive_closure): Likewise.
14911 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
14912 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
14914 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
14917 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
14918 Use size_t, not unsigned int, to count bytes.
14919 * lib/abitset.h (abitset_bytes): Likewise.
14920 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
14922 * lib/bitset.h (bitset_bytes): Likewise.
14923 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
14924 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
14925 * lib/bitsetv.c (bitsetv_alloc): Likewise.
14926 * lib/ebitset.c (ebitset_bytes): Likewise.
14927 * lib/ebitset.h (ebitset_bytes): Likewise.
14928 * lib/lbitset.c (lbitset_bytes): Likewise.
14929 * lib/lbitset.h (lbitset_bytes): Likewise.
14931 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
14932 abitset_subset_p, abitset_disjoint_p, abitset_and,
14933 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
14934 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
14935 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
14936 abitset_or_and, abitset_or_and_cmp):
14937 Use bitset_windex instead of unsigned int.
14938 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
14939 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
14940 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
14941 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
14943 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
14945 * lib/bitset.c (bitset_print):
14946 Use proper printf formats for widths of integer types.
14947 * lib/bitset_stats.c (bitset_percent_histogram_print,
14948 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
14949 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14950 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
14951 * lib/lbitset.c (lbitset_bytes): Likewise.
14953 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
14954 BITSET_SIZE_MAX): New macros.
14955 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
14956 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
14957 to BITSET_WINDEX_MAX.
14959 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
14960 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
14961 since we now return the bitset_bindex type (not int).
14963 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
14964 when computing sizes.
14965 * lib/ebitset.c (ebitset_elts_grow): Likewise.
14967 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
14968 and avoid cast to unsigned.
14970 2002-09-30 Akim Demaille <akim@epita.fr>
14972 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
14973 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
14974 Updates from Michael Hayes.
14976 2002-09-30 Art Haas <ahaas@neosoft.com>
14978 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
14980 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
14983 2002-09-27 Akim Demaille <akim@epita.fr>
14987 2002-09-27 Akim Demaille <akim@epita.fr>
14989 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
14990 (Because of AC_LIBSOURCE).
14992 2002-09-27 Akim Demaille <akim@epita.fr>
14994 Playing with Autoscan.
14996 * configure.ac: Remove the old LIBOBJ tweaks.
14997 (AC_REPLACE_FUNCS): Add strrchr and strtol.
14998 * lib/strrchr.c: New.
14999 * lib/strtol.c: New, from the Coreutils 4.5.1.
15001 2002-09-27 Akim Demaille <akim@epita.fr>
15003 Playing with Autoscan.
15005 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
15006 * lib/Makefile.am (libbison_a_SOURCES): No longer include
15007 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
15008 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
15011 2002-09-24 Akim Demaille <akim@epita.fr>
15013 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
15014 (Frequently Asked Questions, Parser Stack Overflow): New.
15016 2002-09-13 Akim Demaille <akim@epita.fr>
15018 Playing with autoscan.
15020 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
15021 * src/files.c (skeleton_find): Remove, unused.
15022 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
15023 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
15025 2002-09-13 Akim Demaille <akim@epita.fr>
15027 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
15028 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
15030 2002-09-13 Akim Demaille <akim@epita.fr>
15032 * configure.ac: Require 2.54.
15033 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
15034 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
15035 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
15036 Remove, provided by Autoconf macros.
15038 2002-09-12 Akim Demaille <akim@epita.fr>
15040 * m4/prereq.m4: Update, from Coreutils 4.5.1.
15042 2002-09-12 Akim Demaille <akim@epita.fr>
15044 * m4/prereq.m4: Update, from Fileutils 4.1.5.
15045 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
15046 Reported by Martin Mokrejs.
15048 2002-09-10 Akim Demaille <akim@epita.fr>
15050 * src/parse-gram.y: Associate a human readable string to each
15052 * tests/regression.at (Invalid inputs): Adjust.
15054 2002-09-10 Gary V. Vaughan <gary@gnu.org>
15056 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
15057 with an Autoconf-2.5x style configure.ac.
15059 2002-09-06 Paul Eggert <eggert@twinsun.com>
15061 * doc/bison.texinfo (Conditions): Make explicit that the GPL
15062 exception applies only to yacc.c. This is a modification of a
15063 patch originally suggested by Akim Demaille.
15065 2002-09-06 Akim Demaille <akim@epita.fr>
15067 * data/c.m4 (b4_copyright): Move the GPL exception comment from
15069 * data/yacc.c: here.
15071 * data/lalr1.cc (struct yyltype): Don't define it, since we use
15073 (b4_ltype): Default to yy::Location from location.hh.
15075 2002-09-04 Jim Meyering <jim@meyering.net>
15077 * data/yacc.c: Guard the declaration of yytoknum also with
15078 `#ifdef YYPRINT', so it is declared only when used.
15080 2002-09-04 Akim Demaille <akim@epita.fr>
15082 * configure.in: Rename as...
15083 * configure.ac: this.
15086 2002-09-04 Akim Demaille <akim@epita.fr>
15088 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
15089 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
15090 translate maintainer only messages.
15092 2002-08-12 Paul Eggert <eggert@twinsun.com>
15096 * Makefile.am (SUBDIRS): Remove intl.
15097 (DISTCLEANFILES): Remove.
15098 * NEWS: Mention that GNU M4 is now required. Clarify what is
15099 meant by "larger grammars". Mention the pt_BR translation.
15100 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
15101 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
15102 Bump version from 0.11.2 to 0.11.5.
15103 (BISON_PREREQ_STAGE): Remove.
15104 (AM_GNU_GETTEXT): Use external gettext.
15105 (AC_OUTPUT): Remove intl/Makefile.
15107 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
15109 * data/glr.c: Include string.h, for strlen.
15110 (yyreportParseError): Use size_t for yysize.
15111 (yy_yypstack): No longer nested inside yypstates, as nested
15112 functions are not portable. Do not assume size_t is the
15114 (yypstates): Do not assume that ptrdiff_t is the same width
15115 as int, and similarly for yyposn and YYINDEX.
15117 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
15119 * lib/Makefile.am (INCLUDES): Do not include from the intl
15120 directory, which has been removed.
15121 * src/Makefile.am (INCLUDES): Likewise.
15123 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
15124 (bitsets_sources, additional_bitsets_sources, timevars_sources):
15127 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
15128 * tests/Makefile.am (EXTRA_DIST): Likewise.
15130 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
15131 Do not assume that bitset_windex is the same width as unsigned.
15133 * lib/abitset.c (abitset_unused_clear): Do not assume that
15134 bitset_word is the same width as int.
15135 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
15136 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
15137 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
15138 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
15139 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
15141 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
15142 portability to one's complement hosts!).
15143 * lib/ebitset.c (ebitset_op1): Likewise.
15144 * lib/lbitset.c (lbitset_op1): Likewise.
15146 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
15147 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
15148 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
15149 Sync with fileutils.
15150 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
15151 lib/gettext.h: Sync with diffutils.
15153 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
15154 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
15156 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
15157 PROTOTYPES to check for prototypes, and "defined __STDC__" to
15160 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
15161 size_t; the old version tried to do this but casted improperly.
15162 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
15163 (bitset_test): Now returns int, not unsigned long.
15165 * lib/bitset_stats.c: Include "gettext.h".
15167 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
15168 name locals "index", as it generates unnecessary warnings on some
15169 hosts that have an "index" function.
15171 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
15172 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
15173 they need translation.
15174 * src/LR0.c (state_list_append, new_itemsets, get_state,
15175 append_states, generate_states): Likewise.
15176 * src/assoc.c (assoc_to_string): Likewise.
15177 * src/closure.c (print_closure, set_firsts, closure): Likewise.
15178 * src/gram.c (grammar_dump): Likewise.
15179 * src/injections.c (injections_compute): Likewise.
15180 * src/lalr.c (lookaheads_print): Likewise.
15181 * src/relation.c (relation_transpose): Likewise.
15182 * src/scan-gram.l: Likewise.
15183 * src/tables.c (table_grow, pack_vector): Likewise.
15185 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
15186 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
15187 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
15188 * m4/mbstate_t.m4: Sync with fileutils.
15189 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
15191 * po/LINGUAS: Add pt_BR.
15192 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
15193 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
15195 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
15197 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
15199 * src/complain.c (strerror_r): Remove decl; not needed.
15200 (strerror): Use same pattern as ../lib/error.c.
15202 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
15204 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
15206 * src/main.c (main): Cast result of bindtextdomain and textdomain
15207 to void, to avoid a GCC warning when --disable-nls is in effect.
15209 * src/scan-gram.l: Use strings rather than escapes when possible,
15210 to minimize the number of warnings from xgettext.
15211 (handle_action_dollar, handle_action_at): Don't use isdigit,
15212 as it mishandles negative chars and it may not work as expected
15213 outside the C locale.
15215 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
15216 this is a GCC extension and is not portable to other compilers.
15218 * src/system.h (alloca): Use same pattern as ../lib/error.c.
15219 Do not include <ctype.h>; no longer needed.
15220 Do not include <malloc.h>; no longer needed (and generates
15221 warnings on OpenBSD 3.0).
15223 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
15226 * tests/regression.at: Do not use 'cc -c input.c -o input';
15227 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
15229 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
15230 exit status as failure, not just exit status 1. Sun C exits
15231 with status 2 sometimes.
15233 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
15234 Use it for the two large tests.
15236 2002-08-02 Akim Demaille <akim@epita.fr>
15238 * src/conflicts.c (conflicts_output): Don't output rules never
15239 reduced here, since anyway that computation doesn't work.
15240 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
15241 (rule_useless_p, rule_never_reduced_p): New.
15242 (grammar_rules_partial_print): Use a filter instead of a range.
15243 Display the title only if needed.
15244 (grammar_rules_print): Adjust.
15245 (grammar_rules_never_reduced_report): New.
15246 * src/tables.c (action_row): Move the computation of rules never
15248 (token_actions): here.
15249 * src/main.c (main): Make the parser before making the report, so
15250 that rules never reduced are computed.
15251 Call grammar_rules_never_reduced_report.
15252 * src/print.c (print_results): Report rules never reduced.
15253 * tests/conflicts.at, tests/reduce.at: Adjust.
15255 2002-08-01 Akim Demaille <akim@epita.fr>
15257 Instead of attaching lookaheads and duplicating the rules being
15258 reduced by a state, attach the lookaheads to the reductions.
15260 * src/state.h (state_t): Remove the `lookaheads',
15261 `lookaheads_rule' member.
15262 (reductions_t): Add a `lookaheads' member.
15263 Use a regular array for the `rules'.
15264 * src/state.c (reductions_new): Initialize the lookaheads member
15266 (state_rule_lookaheads_print): Adjust.
15267 * src/state.h, src/state.c (state_reductions_find): New.
15268 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
15269 (count_rr_conflicts): Adjust.
15270 * src/lalr.c (LArule): Remove.
15271 (add_lookback_edge): Adjust.
15272 (state_lookaheads_count): New.
15273 (states_lookaheads_initialize): Merge into...
15274 (initialize_LA): this.
15275 (lalr_free): Adjust.
15276 * src/main.c (main): Don't free nullable and derives too early: it
15277 is used by --verbose.
15278 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
15280 2002-08-01 Akim Demaille <akim@epita.fr>
15282 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
15284 (set_derives, free_derives): Rename as...
15285 (derives_compute, derives_free): this.
15286 Adjust all dependencies.
15287 * src/nullable.c (set_nullable, free_nullable): Rename as...
15288 (nullable_compute, nullable_free): these.
15289 (rule_list_t): Store rule_t *, not rule_number_t.
15290 * src/state.c (state_rule_lookaheads_print): Directly compare rule
15291 pointers, instead of their numbers.
15292 * src/main.c (main): Call nullable_free, and derives_free earlier,
15293 as they were lo longer used.
15295 2002-08-01 Akim Demaille <akim@epita.fr>
15297 * lib/timevar.c (get_time): Include children time.
15298 * src/lalr.h (LA, LArule): Don't export them: used with the
15300 * src/lalr.c (LA, LArule): Static.
15301 * src/lalr.h, src/lalr.c (lalr_free): New.
15302 * src/main.c (main): Call it.
15303 * src/tables.c (pack_vector): Check whether loc is >= to the
15305 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
15306 (tables_generate): do it, since that's also it which allocates
15308 Don't free LA and LArule, main does.
15310 2002-07-31 Akim Demaille <akim@epita.fr>
15312 Separate parser tables computation and output.
15314 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
15315 (conflict_list, conflict_list_cnt, table, check, table_ninf)
15316 (yydefgoto, yydefact, high): Move to...
15317 * src/tables.h, src/tables.c: here.
15318 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
15319 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
15320 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
15321 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
15322 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
15323 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
15324 (action_row, save_row, token_actions, save_column, default_goto)
15325 (goto_actions, sort_actions, matching_state, pack_vector)
15326 (table_ninf_remap, pack_table, prepare_actions): Move to...
15327 * src/tables.c: here.
15328 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
15329 * src/output.c (token_actions, output_base, output_conflicts)
15330 (output_check): Merge into...
15331 (prepare_actions): this.
15332 (actions_output): Rename as...
15333 (user_actions_output): this.
15334 * src/main.c (main): Call tables_generate and tables_free.
15336 2002-07-31 Akim Demaille <akim@epita.fr>
15338 Steal GCC's --time-report support.
15340 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
15341 stolen/adjusted from GCC.
15342 * m4/stage.m4: Remove time related checks.
15343 * m4/timevar.m4: New.
15344 * configure.in: Adjust.
15345 * src/system.h: Adjust to using timevar.h.
15346 * src/getargs.h, src/getargs.c: Support trace_time for
15348 * src/main.c (stage): Remove.
15349 (main): Replace `stage' invocations with timevar calls.
15350 * src/output.c: Insert pertinent timevar calls.
15352 2002-07-31 Akim Demaille <akim@epita.fr>
15354 Let --trace have arguments.
15356 * src/getargs.h (enum trace_e): New.
15357 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
15358 (long_options, short_options): --trace/-T takes an optional
15360 Change all the uses of trace_flag to reflect the new flags.
15361 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
15363 Strengthen `stage' portability.
15365 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
15366 * configure.in: Use it.
15367 Don't check for malloc.h and sys/times.h.
15368 * src/system.h: Include them when appropriate.
15369 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
15370 times and struct tms are available.
15372 2002-07-30 Akim Demaille <akim@epita.fr>
15374 In verbose parse error message, don't report `error' as an
15376 * tests/actions.at (Printers and Destructors): Adjust.
15377 * tests/calc.at (Calculator $1): Adjust.
15378 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
15379 error message, do not report the parser accepts the error token in
15382 2002-07-30 Akim Demaille <akim@epita.fr>
15384 Normalize conflict related messages.
15386 * src/complain.h, src/complain.c (warn, complain): New.
15387 * src/conflicts.c (conflicts_print): Use them.
15388 (conflict_report_yacc): New, extracted from...
15389 (conflicts_print): here.
15390 * tests/conflicts.at, tests/existing.at: Adjust.
15392 2002-07-30 Akim Demaille <akim@epita.fr>
15394 Report rules which are never reduced by the parser: those hidden
15397 * src/LR0.c (save_reductions): Don't make the final state too
15398 different: save its reduction (accept) instead of having a state
15399 without any action (no shift or goto, no reduce).
15400 Note: the final state is now a ``regular'' state, i.e., the
15401 parsers now contain `reduce 0' as default reduction.
15402 Nevertheless, since they decide to `accept' when yystate =
15403 final_state, they still will not reduce rule 0.
15404 * src/print.c (print_actions, print_reduction): Adjust.
15405 * src/output.c (action_row): Track reduced rules.
15406 (token_actions): Report rules never reduced.
15407 * tests/conflicts.at, tests/regression.at: Adjust.
15409 2002-07-30 Akim Demaille <akim@epita.fr>
15411 `stage' was accidently included in a previous patch.
15412 Initiate its autoconfiscation.
15414 * configure.in: Look for malloc.h and sys/times.h.
15415 * src/main.c (stage): Adjust.
15416 Report only when trace_flag.
15418 2002-07-29 Akim Demaille <akim@epita.fr>
15420 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
15422 (errs_t): symbol_t*, not symbol_number_t.
15423 (reductions_t): rule_t*, not rule_number_t.
15424 (FOR_EACH_SHIFT): New.
15425 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
15426 * src/print.c, src/print_graph.c: Adjust.
15428 2002-07-29 Akim Demaille <akim@epita.fr>
15430 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
15432 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
15433 (endtoken, accept): these.
15434 * src/reader.c (reader): Set endtoken's default tag to "$end".
15435 Set undeftoken's tag to "$undefined" instead of "$undefined.".
15436 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
15439 2002-07-29 Akim Demaille <akim@epita.fr>
15441 * src/reduce.c (reduce_grammar): When the language is empty,
15442 complain about the start symbol, not the axiom.
15444 * tests/reduce.at (Empty Language): New.
15446 2002-07-26 Akim Demaille <akim@epita.fr>
15448 * src/reader.h, src/reader.c (gram_error): ... can't get
15449 yycontrol without making too strong assumptions on the parser
15451 * src/output.c (prepare_tokens): Use the real 0th value of
15452 token_translations instead of `0'.
15453 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
15455 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
15456 for the time being: %locations ought to provide it to yyerror.
15458 2002-07-25 Akim Demaille <akim@epita.fr>
15460 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
15461 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
15462 * tests/regression.at (Web2c Actions): Adjust.
15464 2002-07-25 Akim Demaille <akim@epita.fr>
15466 Stop storing rules from 1 to nrules + 1.
15468 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
15469 * src/nullable.c, src/output.c, src/print.c, src/reader.c
15470 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
15471 Iterate from 0 to nrules.
15472 Use rule_number_as_item_number and item_number_as_rule_number.
15473 Adjust to `derive' now containing possibly 0.
15474 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
15475 Handle the `- 1' part in rule numbers from/to item numbers.
15476 * src/conflicts.c (log_resolution): Fix the message which reversed
15478 * src/output.c (action_row): Initialize default_rule to -1.
15479 (token_actions): Adjust.
15480 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
15482 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
15484 2002-07-25 Akim Demaille <akim@epita.fr>
15486 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
15487 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
15488 (b4_c_knr_arg_decl): New.
15489 * data/yacc.c: Use it to define yysymprint, yydestruct, and
15490 yyreport_parse_error.
15492 2002-07-25 Akim Demaille <akim@epita.fr>
15494 * data/yacc.c (yyreport_parse_error): New, extracted from...
15496 (yydestruct, yysymprint): Move above yyparse.
15499 2002-07-25 Akim Demaille <akim@epita.fr>
15501 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
15503 (b4_sint_type, b4_uint_type): these.
15504 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
15505 * tests/regression.at (Web2c Actions): Adjust.
15507 2002-07-25 Akim Demaille <akim@epita.fr>
15509 * src/gram.h (TIEM_NUMBER_MAX): New.
15510 (item_number_of_rule_number, rule_number_of_item_number): Rename
15512 (rule_number_as_item_number, item_number_as_rule_number): these.
15513 Adjust dependencies.
15514 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
15515 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
15516 (symbol_number_to_vector_number): New.
15517 (order): Of vector_number_t* type.
15518 (base_t, BASE_MAX, BASE_MIN): New.
15519 (froms, tos, width, pos, check): Of base_t type.
15520 (action_number_t, ACTION_MIN, ACTION_MAX): New.
15521 (actrow): Of action_number_t type.
15522 (conflrow): Of unsigned int type.
15523 (table_ninf, base_ninf): New.
15524 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
15525 (muscle_insert_int_table, muscle_insert_base_table)
15526 (muscle_insert_rule_number_table): New.
15527 (prepare_tokens): Output `toknum' as int_table.
15528 (action_row): Returns a rule_number_t.
15529 Use ACTION_MIN, not SHRT_MIN.
15530 (token_actions): yydefact is rule_number_t*.
15531 (table_ninf_remap): New.
15532 (pack_table): Use it for `base' and `table'.
15533 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
15535 (YYPACT_NINF, YYTABLE_NINF): these.
15536 (yypact, yytable): Compute their types instead of hard-coded
15538 * tests/regression.at (Web2c Actions): Adjust.
15540 2002-07-19 Akim Demaille <akim@epita.fr>
15542 * src/scan-gram.l (id): Can start with an underscore.
15544 2002-07-16 Akim Demaille <akim@epita.fr>
15546 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
15547 Adjust all former `associativity' dependencies.
15548 * src/symtab.c (symbol_new): Default associativity is `undef', not
15550 (symbol_check_alias_consistence): Adjust.
15552 2002-07-09 Akim Demaille <akim@epita.fr>
15554 * doc/bison.texinfo: Properly set the ``header'' part.
15555 Use @dircategory ``GNU programming tools'' as per Texinfo's
15559 2002-07-09 Akim Demaille <akim@epita.fr>
15561 * lib/quotearg.h: Protect against multiple inclusions.
15562 * src/location.h (location_t): Add a `file' member.
15563 (LOCATION_RESET, LOCATION_PRINT): Adjust.
15564 * src/complain.c (warn_at, complain_at, fatal_at): Drop
15565 `error_one_per_line' support.
15567 2002-07-09 Akim Demaille <akim@epita.fr>
15569 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
15570 * src/reader.c (lineno): Remove.
15571 Adjust all dependencies.
15572 (get_merge_function): Take a location and use complain_at.
15573 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
15574 * tests/regression.at (Invalid inputs, Mixing %token styles):
15577 2002-07-09 Akim Demaille <akim@epita.fr>
15579 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
15580 recovery rule, and forbid extensions when --yacc.
15581 (gram_error): Use complain_at.
15582 * src/reader.c (reader): Exit if there were parse errors.
15584 2002-07-09 Akim Demaille <akim@epita.fr>
15586 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
15587 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
15588 Reported by R Blake <blakers@mac.com>.
15590 2002-07-09 Akim Demaille <akim@epita.fr>
15592 * data/yacc.c: Output the copyright notive in the header.
15594 2002-07-03 Akim Demaille <akim@epita.fr>
15596 * src/output.c (froms, tos): Are state_number_t.
15597 (save_column): sp, sp1, and sp2 are state_number_t.
15598 (prepare): Rename `final' as `final_state_number', `nnts' as
15599 `nterms_number', `nrules' as `rules_number', `nstates' as
15600 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
15602 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
15603 * data/lalr1.cc (nsym_): Remove, unused.
15605 2002-07-03 Akim Demaille <akim@epita.fr>
15607 * src/lalr.h, src/lalr.c (goto_number_t): New.
15608 * src/lalr.c (goto_list_t): New.
15610 * src/nullable.c (rule_list_t): New.
15612 * src/types.h: Remove.
15614 2002-07-03 Akim Demaille <akim@epita.fr>
15616 * src/closure.c (print_fderives): Use rule_rhs_print.
15617 * src/derives.c (print_derives): Use rule_rhs_print.
15618 (rule_list_t): New, replaces `shorts'.
15619 (set_derives): Add comments.
15620 * tests/sets.at (Nullable, Firsts): Adjust.
15622 2002-07-03 Akim Demaille <akim@epita.fr>
15624 * src/output.c (prepare_actions): Free `tally' and `width'.
15625 (prepare_actions): Allocate and free `order'.
15626 * src/symtab.c (symbols_free): Free `symbols'.
15627 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
15628 * src/output.c (m4_invoke): Move to...
15629 * src/scan-skel.l: here.
15630 (<<EOF>>): Close yyout, and free its name.
15632 2002-07-03 Akim Demaille <akim@epita.fr>
15634 Fix some memory leaks, and fix a bug: state 0 was examined twice.
15636 * src/LR0.c (new_state): Merge into...
15637 (state_list_append): this.
15638 (new_states): Merge into...
15639 (generate_states): here.
15640 (set_states): Don't ensure a proper `errs' state member here, do it...
15641 * src/conflicts.c (conflicts_solve): here.
15642 * src/state.h, src/state.c: Comment changes.
15643 (state_t): Rename member `shifts' as `transitions'.
15644 Adjust all dependencies.
15645 (errs_new): For consistency, also take the values as argument.
15646 (errs_dup): Remove.
15647 (state_errs_set): New.
15648 (state_reductions_set, state_transitions_set): Assert that no
15649 previous value was assigned.
15651 (states_free): Use it.
15652 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
15653 temporary storage: use `errs' and `nerrs' as elsewhere.
15654 (set_conflicts): Allocate and free this `errs'.
15656 2002-07-02 Akim Demaille <akim@epita.fr>
15658 * lib/libiberty.h: New.
15659 * lib: Update the bitset implementation from upstream.
15660 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
15661 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
15662 * src/main.c: Adjust bitset stats calls.
15664 2002-07-01 Paul Eggert <eggert@twinsun.com>
15666 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
15667 char, so that negative chars don't collide with $.
15669 2002-06-30 Akim Demaille <akim@epita.fr>
15671 Have the GLR tests be `warning' checked, and fix the warnings.
15673 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
15674 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
15675 (yyremoveDeletes): `yyi' and `yyj' are size_t.
15676 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
15677 (yyaddDeferredAction): static.
15678 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
15679 (yyreportParseError): yyprefix is const.
15680 yytokenp is used only when verbose.
15681 (yy__GNUC__): Replace with __GNUC__.
15682 (yypdumpstack): yyi is size_t.
15683 (yypreference): Un-yy local variables and arguments, to avoid
15684 clashes with `yyr1'. Anyway, we are not in the user name space.
15685 (yytname_size): be an int, as is compared with ints.
15686 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
15688 * tests/cxx-gram.at: Use quotation to protect $1.
15689 Use AT_COMPILE to enable warnings hunts.
15690 Prototype yylex and yyerror.
15692 Include `string.h', not `strings.h'.
15693 Produce and prototype stmtMerge only when used.
15694 yylex takes a location.
15696 2002-06-30 Akim Demaille <akim@epita.fr>
15698 We spend a lot of time in quotearg, in particular when --verbose.
15700 * src/symtab.c (symbol_get): Store a quoted version of the key.
15701 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
15702 Adjust all callers.
15704 2002-06-30 Akim Demaille <akim@epita.fr>
15706 * src/state.h (reductions_t): Rename member `nreds' as num.
15707 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
15708 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
15710 2002-06-30 Akim Demaille <akim@epita.fr>
15712 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
15713 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
15714 (shifts_to): Rename as...
15715 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
15716 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
15717 (TRANSITION_IS_DISABLED, transitions_to): these.
15719 2002-06-30 Akim Demaille <akim@epita.fr>
15721 * src/print.c (print_shifts, print_gotos): Merge into...
15722 (print_transitions): this.
15723 (print_transitions, print_errs, print_reductions): Align the
15724 lookaheads columns.
15725 (print_core, print_transitions, print_errs, print_state,
15726 print_grammar): Output empty lines separator before, not after.
15727 (state_default_rule_compute): Rename as...
15728 (state_default_rule): this.
15729 * tests/conflicts.at (Defaulted Conflicted Reduction),
15730 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
15731 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
15733 2002-06-30 Akim Demaille <akim@epita.fr>
15735 Display items as we display rules.
15737 * src/gram.h, src/gram.c (rule_lhs_print): New.
15738 * src/gram.c (grammar_rules_partial_print): Use it.
15739 * src/print.c (print_core): Likewise.
15740 * tests/conflicts.at (Defaulted Conflicted Reduction),
15741 (Unresolved SR Conflicts): Adjust.
15742 (Unresolved SR Conflicts): Adjust and rename as...
15743 (Resolved SR Conflicts): this, as was meant.
15744 * tests/regression.at (Web2c Report): Adjust.
15746 2002-06-30 Akim Demaille <akim@epita.fr>
15748 * src/print.c (state_default_rule_compute): New, extracted from...
15749 (print_reductions): here.
15750 Pessimize, but clarify the code.
15751 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
15753 2002-06-30 Akim Demaille <akim@epita.fr>
15755 * src/output.c (action_row): Let default_rule be always a rule
15758 2002-06-30 Akim Demaille <akim@epita.fr>
15760 * src/closure.c (print_firsts, print_fderives, closure):
15761 Use BITSET_EXECUTE.
15762 * src/lalr.c (lookaheads_print): Likewise.
15763 * src/state.c (state_rule_lookaheads_print): Likewise.
15764 * src/print_graph.c (print_core): Likewise.
15765 * src/print.c (print_reductions): Likewise.
15766 * src/output.c (action_row): Likewise.
15767 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
15769 2002-06-30 Akim Demaille <akim@epita.fr>
15771 * src/print_graph.c: Use report_flag.
15773 2002-06-30 Akim Demaille <akim@epita.fr>
15775 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
15777 * src/relation.h, src/relation.c (traverse, relation_digraph)
15778 (relation_print, relation_transpose): New.
15780 2002-06-30 Akim Demaille <akim@epita.fr>
15782 * src/state.h, src/state.c (shifts_to): New.
15783 * src/lalr.c (build_relations): Use it.
15785 2002-06-30 Akim Demaille <akim@epita.fr>
15787 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
15788 (item_number_of_rule_number, rule_number_of_item_number): New.
15789 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
15790 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
15791 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
15792 Propagate their use.
15793 Much remains to be done, in particular wrt `shorts' from types.h.
15795 2002-06-30 Akim Demaille <akim@epita.fr>
15797 * src/symtab.c (symbol_new): Initialize the `printer' member.
15799 2002-06-30 Akim Demaille <akim@epita.fr>
15801 * src/LR0.c (save_reductions): Remove, replaced by...
15802 * src/state.h, src/state.c (state_reductions_set): New.
15803 (reductions, errs): Rename as...
15804 (reductions_t, errs_t): these.
15805 Adjust all dependencies.
15807 2002-06-30 Akim Demaille <akim@epita.fr>
15809 * src/LR0.c (state_list_t, state_list_append): New.
15810 (first_state, last_state): Now symbol_list_t.
15811 (this_state): Remove.
15812 (new_itemsets, append_states, save_reductions): Take a state_t as
15814 (set_states, generate_states): Adjust.
15815 (save_shifts): Remove, replaced by...
15816 * src/state.h, src/state.c (state_shifts_set): New.
15817 (shifts): Rename as...
15819 Adjust all dependencies.
15820 * src/state.h (state_t): Remove the `next' member.
15822 2002-06-30 Akim Demaille <akim@epita.fr>
15824 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
15827 2002-06-30 Akim Demaille <akim@epita.fr>
15829 Use hash.h for the state hash table.
15831 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
15832 (allocate_storage): Use state_hash_new.
15833 (free_storage): Use state_hash_free.
15834 (new_state, get_state): Adjust.
15835 * src/lalr.h, src/lalr.c (states): Move to...
15836 * src/states.h (state_t): Remove the `link' member, no longer
15838 * src/states.h, src/states.c: here.
15839 (state_hash_new, state_hash_free, state_hash_lookup)
15840 (state_hash_insert, states_free): New.
15841 * src/states.c (state_table, state_compare, state_hash): New.
15842 * src/output.c (output_actions): Do not free states now, since we
15843 still need to know the final_state number in `prepare', called
15844 afterwards. Do it...
15845 * src/main.c (main): here: call states_free after `output'.
15847 2002-06-30 Akim Demaille <akim@epita.fr>
15849 * src/state.h, src/state.c (state_new): New, extracted from...
15850 * src/LR0.c (new_state): here.
15851 * src/state.h (STATE_ALLOC): Move to...
15852 * src/state.c: here.
15853 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
15854 * src/state.h, src/state.c: here.
15856 2002-06-30 Akim Demaille <akim@epita.fr>
15858 * src/reader.c (gensym): Rename as...
15859 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
15860 (getsym): Rename as...
15861 (symbol_get): this.
15863 2002-06-30 Akim Demaille <akim@epita.fr>
15865 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
15866 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
15867 * src/output.c, src/print.c, src/print_graph.c: Propagate.
15868 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
15870 2002-06-30 Akim Demaille <akim@epita.fr>
15872 Make the test suite pass with warnings checked.
15874 * tests/actions.at (Printers and Destructors): Improve.
15875 Avoid unsigned vs. signed issues.
15876 * tests/calc.at: Don't exercise the scanner here, do it...
15877 * tests/input.at (Torturing the Scanner): here.
15879 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15881 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
15882 reorganize first lines parallel to yacc.c.
15884 2002-06-28 Akim Demaille <akim@epita.fr>
15886 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
15887 (b4_token_enum, b4_token_defines): New, factored from...
15888 * data/lalr1.cc, data/yacc.c, glr.c: here.
15890 2002-06-28 Akim Demaille <akim@epita.fr>
15892 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
15894 * src/output.c (merger_output): static.
15896 2002-06-28 Akim Demaille <akim@epita.fr>
15898 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
15899 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
15901 * src/output.c (save_row): Initialize all the variables to pacify GCC.
15903 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15905 Accumulated changelog for new GLR parsing features.
15907 * src/conflicts.c (count_total_conflicts): Change name to
15908 conflicts_total_count.
15909 * src/conflicts.h: Ditto.
15910 * src/output.c (token_actions): Use the new name.
15911 (output_conflicts): Change conflp => conflict_list_heads, and
15912 confl => conflict_list for better readability.
15913 * data/glr.c: Use the new names.
15914 * NEWS: Add self to GLR announcement.
15916 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
15918 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
15921 * data/bison.glr: Change name to glr.c
15922 * data/glr.c: Renamed from bison.glr.
15923 * data/Makefile.am: Add glr.c
15927 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
15928 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
15930 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15932 * data/bison.glr: Be sure to restore the
15933 current #line when returning to the skeleton contents after having
15934 exposed the input file's #line.
15936 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15938 * data/bison.glr: Bring up to date with changes to bison.simple.
15940 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15942 * data/bison.glr: Correct definitions that use b4_prefix.
15943 Various reformatting.
15944 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
15945 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
15946 yytokenp argument; now part of stack.
15947 (yychar): Define to behave as documented.
15948 (yyclearin): Ditto.
15950 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15952 * src/reader.h: Add declaration for free_merger_functions.
15954 * src/reader.c (merge_functions): New variable.
15955 (get_merge_function): New function.
15956 (free_merger_functions): New function.
15957 (readgram): Check for %prec that is not followed by a symbol.
15958 Handle %dprec and %merge declarations.
15959 (packgram): Initialize dprec and merger fields in rules array.
15961 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
15962 conflict_list_cnt, conflict_list_free): New variables.
15963 (table_grow): Also grow conflict_table.
15964 (prepare_rules): Output dprec and merger tables.
15965 (conflict_row): New function.
15966 (action_row): Output conflict lists for GLR parser. Don't use
15967 default reduction in conflicted states for GLR parser so that there
15968 are spaces for the conflict lists.
15969 (save_row): Also save conflict information.
15970 (token_actions): Allocate conflict list.
15971 (merger_output): New function.
15972 (pack_vector): Pack conflict table, too.
15973 (output_conflicts): New function to output yyconflp and yyconfl.
15974 (output_check): Allocate conflict_tos.
15975 (output_actions): Output conflict tables, also.
15976 (output_skeleton): Output b4_mergers definition.
15977 (prepare): Output b4_max_rhs_length definition.
15978 Use 'bison.glr' as default skeleton for GLR parsers.
15980 * src/gram.c (glr_parser): New flag.
15981 (grammar_free): Call free_merger_functions.
15983 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
15984 all pairs of conflicting reductions, rather than just all tokens
15985 causing conflicts. Needed to size conflict tables.
15986 (conflicts_output): Modify call to count_rr_conflicts for new
15988 (conflicts_print): Ditto.
15989 (count_total_conflicts): New function.
15991 * src/reader.h (merger_list): New type.
15992 (merge_functions): New variable.
15994 * src/lex.h (tok_dprec, tok_merge): New token types.
15996 * src/gram.h (rule_s): Add dprec and merger fields.
15997 (glr_parser): New flag.
15999 * src/conflicts.h (count_total_conflicts): New function.
16001 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
16003 * doc/bison.texinfo (Generalized LR Parsing): New section.
16004 (GLR Parsers): New section.
16005 (Language and Grammar): Mention GLR parsing.
16006 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
16007 Correct typo ("tge" -> "the").
16009 * data/bison.glr: New skeleton for GLR parsing.
16011 * tests/cxx-gram.at: New tests for GLR parsing.
16013 * tests/testsuite.at: Include cxx-gram.at.
16015 * tests/Makefile.am: Add cxx-gram.at.
16017 * src/parse-gram.y:
16019 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
16021 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
16023 2002-06-27 Akim Demaille <akim@epita.fr>
16025 * src/options.h, src/options.c: Remove.
16026 * src/getargs.c (short_options, long_options): New.
16028 2002-06-27 Akim Demaille <akim@epita.fr>
16030 * data/bison.simple, data/bison.c++: Rename as...
16031 * data/yacc.c, data/lalr1.cc: these.
16032 * doc/bison.texinfo (Environment Variables): Remove.
16034 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
16036 * src/getargs.c (report_argmatch): Initialize strtok().
16038 2002-06-20 Akim Demaille <akim@epita.fr>
16040 * data/bison.simple (b4_symbol_actions): New, replaces...
16041 (b4_symbol_destructor, b4_symbol_printer): these.
16042 (yysymprint): Be sure to call YYPRINT only for tokens, and using
16043 user token numbers.
16045 2002-06-20 Akim Demaille <akim@epita.fr>
16047 * data/bison.simple (yydestructor): Rename as...
16048 (yydestruct): this.
16050 2002-06-20 Akim Demaille <akim@epita.fr>
16052 * src/symtab.h, src/symtab.c (symbol_type_set)
16053 (symbol_destructor_set, symbol_precedence_set): The location is
16055 Adjust all callers.
16057 2002-06-20 Akim Demaille <akim@epita.fr>
16059 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
16061 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
16063 * src/symtab.h, src/symtab.c (symbol_class_set)
16064 (symbol_user_token_number_set): Likewise.
16065 Adjust all callers.
16066 Promote complain_at.
16067 * tests/input.at (Type Clashes): Adjust.
16069 2002-06-20 Akim Demaille <akim@epita.fr>
16071 * data/bison.simple (YYLEX): Fix the declaration when
16074 2002-06-20 Akim Demaille <akim@epita.fr>
16076 * data/bison.simple (yysymprint): Don't print the token number,
16078 * tests/actions.at (Destructors): Rename as...
16079 (Printers and Destructors): this.
16080 Also exercise %printer.
16082 2002-06-20 Akim Demaille <akim@epita.fr>
16084 * data/bison.simple (YYDSYMPRINT): New.
16085 Use it to remove many of the #if YYDEBUG/if (yydebug).
16087 2002-06-20 Akim Demaille <akim@epita.fr>
16089 * src/symtab.h, src/symtab.c (symbol_t): printer and
16090 printer_location are new members.
16091 (symbol_printer_set): New.
16092 * src/parse-gram.y (PERCENT_PRINTER): New token.
16093 Handle its associated rule.
16094 * src/scan-gram.l: Adjust.
16095 (handle_destructor_at, handle_destructor_dollar): Rename as...
16096 (handle_symbol_code_at, handle_symbol_code_dollar): these.
16097 * src/output.c (symbol_printers_output): New.
16098 (output_skeleton): Call it.
16099 * data/bison.simple (yysymprint): New. Cannot be named yyprint
16100 since there are already many grammar files with a user `yyprint'.
16101 Replace the calls to YYPRINT to calls to yysymprint.
16102 * tests/calc.at: Adjust.
16103 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
16104 taking advantage of parser very internal details (stack size!).
16106 2002-06-20 Akim Demaille <akim@epita.fr>
16108 * src/scan-gram.l: Complete the scanner with the missing patterns
16110 Use `quote' and `symbol_tag_get' where appropriate.
16112 2002-06-19 Akim Demaille <akim@epita.fr>
16114 * tests/actions.at (Destructors): Augment to test locations.
16115 * data/bison.simple (yydestructor): Pass it the current location
16116 if locations are enabled.
16117 Prototype only when __STDC__ or C++.
16118 Change the argument names to move into the yy name space: there is
16121 2002-06-19 Akim Demaille <akim@epita.fr>
16123 * data/bison.simple (b4_pure_if): New.
16124 Use it instead of #ifdef YYPURE.
16126 2002-06-19 Akim Demaille <akim@epita.fr>
16128 * data/bison.simple (b4_location_if): New.
16129 Use it instead of #ifdef YYLSP_NEEDED.
16131 2002-06-19 Akim Demaille <akim@epita.fr>
16133 Prepare @$ in %destructor, but currently don't bind it in the
16134 skeleton, as %location use is not cleaned up yet.
16136 * src/scan-gram.l (handle_dollar, handle_destructor_at)
16137 (handle_action_at): New.
16138 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
16139 a braced_code_t and a location as additional arguments.
16140 (handle_destructor_dollar): Instead of requiring `b4_eval', just
16141 unquote one when outputting `b4_dollar_dollar'.
16143 * data/bison.simple (b4_eval): Remove.
16144 (b4_symbol_destructor): Adjust.
16145 * tests/input.at (Invalid @n): Adjust.
16147 2002-06-19 Zack Weinberg <zack@codesourcery.com>
16149 * doc/bison.texinfo: Document ability to have multiple
16152 2002-06-18 Akim Demaille <akim@epita.fr>
16154 * src/files.c (compute_base_names): When computing the output file
16155 names from the input file name, strip the directory part.
16157 2002-06-18 Akim Demaille <akim@epita.fr>
16159 * data/bison.simple.new: Comment changes.
16160 Reported by Andreas Schwab.
16162 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
16164 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
16165 there are no `label `yyoverflowlab' defined but not used' warnings
16166 when yyoverflow is defined.
16168 2002-06-18 Akim Demaille <akim@epita.fr>
16170 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
16172 (symbol_destructor_set): Adjust.
16173 * src/output.c (symbol_destructors_output): Output the destructor
16175 Output the symbol name.
16176 * data/bison.simple (b4_symbol_destructor): Adjust.
16178 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
16179 and Akim Demaille <akim@epita.fr>
16181 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
16182 what's left on the stack when the error recovery hits EOF.
16183 * tests/actions.at (Destructors): Complete to exercise this case.
16185 2002-06-17 Akim Demaille <akim@epita.fr>
16187 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
16188 arguments is really empty, not only equal to `[]'.
16189 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
16191 (symbol_destructor_set): New.
16192 * src/output.c (symbol_destructors_output): New.
16193 * src/reader.h (brace_code_t, current_braced_code): New.
16194 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
16195 (handle_dollar): Rename as...
16196 (handle_action_dollar): this.
16197 (handle_destructor_dollar): New.
16198 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
16199 (grammar_declaration): Use it.
16200 * data/bison.simple (yystos): Is always defined.
16201 (yydestructor): New.
16202 * tests/actions.at (Destructors): New.
16203 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
16205 2002-06-17 Akim Demaille <akim@epita.fr>
16207 * src/symlist.h, src/symlist.c (symbol_list_length): New.
16208 * src/scan-gram.l (handle_dollar, handle_at): Compute the
16209 rule_length only when needed.
16210 * src/output.c (actions_output, token_definitions_output): Output
16212 * src/symtab.c: Don't access directly to the symbol tag, use
16214 * src/parse-gram.y: Use symbol_list_free.
16216 2002-06-17 Akim Demaille <akim@epita.fr>
16218 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
16219 (symbol_list_prepend, get_type_name): Move to...
16220 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
16221 (symbol_list_prepend, symbol_list_n_type_name_get): here.
16222 Adjust all callers.
16223 (symbol_list_free): New.
16224 * src/scan-gram.l (handle_dollar): Takes a location.
16225 * tests/input.at (Invalid $n): Adjust.
16227 2002-06-17 Akim Demaille <akim@epita.fr>
16229 * src/reader.h, src/reader.c (symbol_list_new): Export it.
16230 (symbol_list_prepend): New.
16231 * src/parse-gram.y (%union): `list' is a new member.
16232 (symbols.1): New, replaces...
16233 (terms_to_prec.1, nterms_to_type.1): these.
16234 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
16235 Take a location as additional argument.
16236 Adjust all callers.
16238 2002-06-15 Akim Demaille <akim@epita.fr>
16240 * src/parse-gram.y: Move %token in the declaration section so that
16241 we don't depend upon CVS Bison.
16243 2002-06-15 Akim Demaille <akim@epita.fr>
16245 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
16246 * src/print.c (print_core): Use it.
16248 2002-06-15 Akim Demaille <akim@epita.fr>
16250 * src/conflicts.c (log_resolution): Accept the rule involved in
16251 the sr conflicts instead of the lookahead number that points to
16253 (flush_reduce): Accept the current lookahead vector as argument,
16254 instead of the index in LA.
16255 (resolve_sr_conflict): Accept the current number of lookahead
16256 bitset to consider for the STATE, instead of the index in LA.
16257 (set_conflicts): Adjust.
16258 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
16260 2002-06-15 Akim Demaille <akim@epita.fr>
16262 * src/state.h (state_t): Replace the `lookaheadsp' member, a
16263 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
16264 Adjust all dependencies.
16265 * src/lalr.c (initialize_lookaheads): Split into...
16266 (states_lookaheads_count, states_lookaheads_initialize): these.
16269 2002-06-15 Akim Demaille <akim@epita.fr>
16271 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
16273 (grammar_rules_print): here.
16274 * src/reduce.c (reduce_output): Use it.
16275 * tests/reduce.at (Useless Rules, Reduced Automaton)
16276 (Underivable Rules): Adjust.
16278 2002-06-15 Akim Demaille <akim@epita.fr>
16280 Copy BYacc's nice way to report the grammar.
16282 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
16284 Don't print the rules' location, it is confusing and useless.
16285 (rule_print): Use grammar_rhs_print.
16286 * src/print.c (print_grammar): Use grammar_rules_print.
16288 2002-06-15 Akim Demaille <akim@epita.fr>
16290 Complete and rationalize `useless thing' warnings.
16292 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
16293 (symbol_tag_print): New.
16294 Use them everywhere in place of accessing directly the tag member.
16295 * src/gram.h, src/gram.c (rule_print): New.
16296 Use it where a rule used to be printed `by hand'.
16297 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
16298 (reduce_grammar_tables): Report the useless rules.
16299 (reduce_print): Useless things are a warning, not an error.
16301 * tests/reduce.at (Useless Nonterminals, Useless Rules):
16302 (Reduced Automaton, Underivable Rules): Adjust.
16303 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
16304 * tests/conflicts.at (Unresolved SR Conflicts)
16305 (Solved SR Conflicts): Adjust.
16307 2002-06-15 Akim Demaille <akim@epita.fr>
16309 Let symbols have a location.
16311 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
16313 Adjust all callers.
16314 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
16315 Use location_t, not int.
16316 * src/symtab.c (symbol_check_defined): Take advantage of the
16318 * tests/regression.at (Invalid inputs): Adjust.
16320 2002-06-15 Akim Demaille <akim@epita.fr>
16322 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
16323 (input): Don't try to initialize yylloc here, do it in the
16325 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
16326 * src/gram.h (rule_t): Change line and action_line into location
16327 and action_location, of location_t type.
16328 Adjust all dependencies.
16329 * src/location.h, src/location.c (empty_location): New.
16330 * src/reader.h, src/reader.c (grammar_start_symbol_set)
16331 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
16332 (grammar_current_rule_symbol_append)
16333 (grammar_current_rule_action_append): Expect a location as argument.
16334 * src/reader.c (grammar_midrule_action): Adjust to attach an
16335 action's location as dummy symbol location.
16336 * src/symtab.h, src/symtab.c (startsymbol_location): New.
16337 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
16340 2002-06-14 Akim Demaille <akim@epita.fr>
16342 Grammar declarations may be found in the grammar section.
16344 * src/parse-gram.y (rules_or_grammar_declaration): New.
16345 (declarations): Each declaration may end with a semicolon, not
16347 (grammar_declaration): `"%union"'.
16348 (grammar): Branch to rules_or_grammar_declaration.
16350 2002-06-14 Akim Demaille <akim@epita.fr>
16352 * src/main.c (main): Invoke scanner_free.
16354 2002-06-14 Akim Demaille <akim@epita.fr>
16356 * src/output.c (m4_invoke): Extracted from...
16357 (output_skeleton): here.
16360 2002-06-14 Akim Demaille <akim@epita.fr>
16362 * src/parse-gram.y (directives, directive, gram)
16363 (grammar_directives, precedence_directives, precedence_directive):
16365 (declarations, declaration, grammar, grammar_declaration)
16366 (precedence_declaration, precedence_declarator): these.
16367 (symbol_declaration): New.
16369 2002-06-14 Akim Demaille <akim@epita.fr>
16371 * src/files.c (action_obstack): Remove, unused.
16372 (output_obstack): Remove it, and all its dependencies, as it is no
16374 * src/reader.c (epilogue_set): Build the epilogue in the
16376 * src/output.h, src/output.c (muscle_obstack): Move to...
16377 * src/muscle_tab.h, src/muscle_tab.h: here.
16378 (muscle_init): Initialize muscle_obstack.
16379 (muscle_free): New.
16380 * src/main.c (main): Call it.
16382 2002-06-14 Akim Demaille <akim@epita.fr>
16384 * src/location.h: New, extracted from...
16385 * src/reader.h: here.
16386 * src/Makefile.am (noinst_HEADERS): Merge into
16387 (bison_SOURCES): this.
16389 * src/parse-gram.y: Use location_t instead of Bison's.
16390 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
16391 Use location_t instead of ints.
16393 2002-06-14 Akim Demaille <akim@epita.fr>
16395 * data/bison.simple, data/bison.c++: Be sure to restore the
16396 current #line when returning to the skeleton contents after having
16397 exposed the input file's #line.
16399 2002-06-12 Akim Demaille <akim@epita.fr>
16401 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
16403 * tests/actions.at (Exotic Dollars): New.
16405 2002-06-12 Akim Demaille <akim@epita.fr>
16407 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
16409 * tests/input.at (Torturing the Scanner): New.
16411 2002-06-11 Akim Demaille <akim@epita.fr>
16413 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
16414 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
16415 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
16416 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
16417 * src/reader.c (reader): Use it.
16419 2002-06-11 Akim Demaille <akim@epita.fr>
16421 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
16422 Adjust all callers.
16423 (scanner_last_string_free): New.
16425 2002-06-11 Akim Demaille <akim@epita.fr>
16427 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
16428 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
16429 (last_string, YY_OBS_FREE): New.
16430 Use them when returning an ID.
16432 2002-06-11 Akim Demaille <akim@epita.fr>
16434 Have Bison grammars parsed by a Bison grammar.
16436 * src/reader.c, src/reader.h (prologue_augment): New.
16437 * src/reader.c (copy_definition): Remove.
16439 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
16440 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
16441 (grammar_current_rule_prec_set, grammar_current_rule_check)
16442 (grammar_current_rule_symbol_append)
16443 (grammar_current_rule_action_append): Export.
16444 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
16445 (symbol_list_action_append): Remove.
16446 Hook the routines from reader.
16447 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
16448 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
16450 * src/reader.c (read_declarations): Remove, unused.
16452 * src/parse-gram.y: Handle the epilogue.
16453 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
16454 (grammar_start_symbol_set): this.
16455 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
16456 * src/reader.c (readgram): Remove, unused.
16457 (reader): Adjust to insert eoftoken and axiom where appropriate.
16459 * src/reader.c (copy_dollar): Replace with...
16460 * src/scan-gram.h (handle_dollar): this.
16461 * src/parse-gram.y: Remove `%thong'.
16463 * src/reader.c (copy_at): Replace with...
16464 * src/scan-gram.h (handle_at): this.
16466 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
16469 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
16472 * src/reader.h, src/reader.c (grammar_rule_end): New.
16474 * src/parse.y (current_type, current_class): New.
16475 Implement `%nterm', `%token' support.
16476 Merge `%term' into `%token'.
16477 (string_as_id): New.
16478 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
16481 * src/parse-gram.y: Be sure to handle properly the beginning of
16484 * src/parse-gram.y: Handle %type.
16485 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
16487 * src/parse-gram.y: More directives support.
16488 * src/options.c: No longer handle source directives.
16490 * src/parse-gram.y: Fix %output.
16492 * src/parse-gram.y: Handle %union.
16493 Use the prologue locations.
16494 * src/reader.c (parse_union_decl): Remove.
16496 * src/reader.h, src/reader.c (epilogue_set): New.
16497 * src/parse-gram.y: Use it.
16499 * data/bison.simple, data/bison.c++: b4_stype is now either not
16500 defined, then default to int, or to the contents of %union,
16501 without `union' itself.
16503 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
16505 * src/output.c (actions_output): Don't output braces, as they are
16506 already handled by the scanner.
16508 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
16509 characters to themselves.
16511 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
16512 that the epilogue has a proper #line.
16514 * src/parse-gram.y: Handle precedence/associativity.
16516 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
16518 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
16519 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
16520 at all to define terminals that cannot be emitted.
16522 * src/scan-gram.l: Escape M4 characters.
16524 * src/scan-gram.l: Working properly with escapes in user
16525 strings/characters.
16527 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
16528 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
16530 Use more modest sizes, as for the time being the parser does not
16531 release memory, and therefore the process swallows a huge amount
16534 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
16535 stricter %token grammar.
16537 * src/symtab.h (associativity): Add `undef_assoc'.
16538 (symbol_precedence_set): Do nothing when passed an undef_assoc.
16539 * src/symtab.c (symbol_check_alias_consistence): Adjust.
16541 * tests/regression.at (Invalid %directive): Remove, as it is now
16543 (Invalid inputs): Adjust to the new error messages.
16544 (Token definitions): The new grammar doesn't allow too many
16547 * src/lex.h, src/lex.c: Remove.
16548 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
16549 (copy_character, copy_string2, copy_string, copy_identifier)
16550 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
16551 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
16552 (parse_action): Remove.
16553 * po/POTFILES.in: Adjust.
16555 2002-06-11 Akim Demaille <akim@epita.fr>
16557 * src/reader.c (parse_action): Don't store directly into the
16558 rule's action member: return the action as a string.
16559 Don't require `rule_length' as an argument: compute it.
16560 (grammar_current_rule_symbol_append)
16561 (grammar_current_rule_action_append): New, eved out from
16563 Remove `action_flag', `rulelength', unused now.
16565 2002-06-11 Akim Demaille <akim@epita.fr>
16567 * src/reader.c (grammar_current_rule_prec_set).
16568 (grammar_current_rule_check): New, eved out from...
16570 Remove `xaction', `first_rhs': useless.
16571 * tests/input.at (Type clashes): New.
16572 * tests/existing.at (GNU Cim Grammar): Adjust.
16574 2002-06-11 Akim Demaille <akim@epita.fr>
16576 * src/reader.c (grammar_midrule_action): New, Eved out from
16579 2002-06-11 Akim Demaille <akim@epita.fr>
16581 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
16583 (readgram): Use them as replacement of inlined code, crule and
16586 2002-06-11 Akim Demaille <akim@epita.fr>
16588 * src/reader.c (grammar_end, grammar_symbol_append): New.
16589 (readgram): Use them.
16590 Make the use of `p' as local as possible.
16592 2002-06-10 Akim Demaille <akim@epita.fr>
16594 GCJ's parser requires the tokens to be defined before the prologue.
16596 * data/bison.simple: Output the token definition before the user's
16598 * tests/regression.at (Braces parsing, Duplicate string)
16599 (Mixing %token styles): Check the output from bison.
16600 (Early token definitions): New.
16602 2002-06-10 Akim Demaille <akim@epita.fr>
16604 * src/symtab.c (symbol_user_token_number_set): Don't complain when
16605 assigning twice the same user number to a token, so that we can
16607 * src/lex.c (lex): here.
16608 Also use `symbol_class_set' instead of hand written code.
16609 * src/reader.c (parse_assoc_decl): Likewise.
16611 2002-06-10 Akim Demaille <akim@epita.fr>
16613 * src/symtab.c, src/symtab.c (symbol_class_set)
16614 (symbol_user_token_number_set): New.
16615 * src/reader.c (parse_token_decl): Use them.
16616 Use a switch instead of ifs.
16617 Use a single argument.
16619 2002-06-10 Akim Demaille <akim@epita.fr>
16621 Remove `%thong' support as it is undocumented, unused, duplicates
16622 `%token's job, and creates useless e-mail traffic with people who
16623 want to know what it is, why it is undocumented, unused, and
16624 duplicates `%token's job.
16626 * src/reader.c (parse_thong_decl): Remove.
16627 * src/options.c (option_table): Remove "thong".
16628 * src/lex.h (tok_thong): Remove.
16630 2002-06-10 Akim Demaille <akim@epita.fr>
16632 * src/symtab.c, src/symtab.c (symbol_type_set)
16633 (symbol_precedence_set): New.
16634 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
16635 (value_components_used): Remove, unused.
16637 2002-06-09 Akim Demaille <akim@epita.fr>
16639 Move symbols handling code out of the reader.
16641 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
16642 (axiom): Move to...
16643 * src/symtab.h, src/symtab.c: here.
16645 * src/gram.c (start_symbol): Remove: use startsymbol->number.
16646 * src/reader.c (startval): Rename as...
16647 * src/symtab.h, src/symtab.c (startsymbol): this.
16648 * src/reader.c: Adjust.
16650 * src/reader.c (symbol_check_defined, symbol_make_alias)
16651 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16652 (token_translations_init)
16654 * src/symtab.c: here.
16655 * src/reader.c (packsymbols): Move to...
16656 * src/symtab.h, src/symtab.c (symbols_pack): here.
16657 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
16660 2002-06-03 Akim Demaille <akim@epita.fr>
16662 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
16665 2002-06-03 Akim Demaille <akim@epita.fr>
16667 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
16668 structs with non literals.
16669 * src/scan-skel.l: never-interactive.
16670 * src/conflicts.c (enum conflict_resolution_e): No trailing
16672 * src/getargs.c (usage): Split long literal strings.
16673 Reported by Hans Aberg.
16675 2002-05-28 Akim Demaille <akim@epita.fr>
16677 * data/bison.c++: Use C++ ostreams.
16678 (cdebug_): New member.
16680 2002-05-28 Akim Demaille <akim@epita.fr>
16682 * src/output.c (output_skeleton): Be sure to allocate enough room
16683 for `/' _and_ for `\0' in full_skeleton.
16685 2002-05-28 Akim Demaille <akim@epita.fr>
16687 * data/bison.c++: Catch up with bison.simple:
16688 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16689 and Paul Eggert <eggert@twinsun.com>: `error' handing.
16690 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
16691 and popping traces.
16693 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16695 * src/output.c (output_skeleton): Put an explicit path in front of
16696 the skeleton file name, rather than relying on the -I directory,
16697 to partially alleviate effects of having a skeleton file lying around
16698 in the current directory.
16700 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16702 * src/conflicts.c (log_resolution): Correct typo:
16703 obstack_printf should be obstack_fgrow1.
16705 2002-05-26 Akim Demaille <akim@epita.fr>
16707 * src/state.h (state_t): `solved_conflicts' is a new member.
16708 * src/LR0.c (new_state): Set it to 0.
16709 * src/conflicts.h, src/conflicts.c (print_conflicts)
16710 (free_conflicts, solve_conflicts): Rename as...
16711 (conflicts_print, conflicts_free, conflicts_solve): these.
16713 * src/conflicts.c (enum conflict_resolution_e)
16714 (solved_conflicts_obstack): New, used by...
16715 (log_resolution): this.
16716 Adjust to attach the conflict resolution to each state.
16717 Complete the description with the precedence/associativity
16719 (resolve_sr_conflict): Adjust.
16720 * src/print.c (print_state): Output its solved_conflicts.
16721 * tests/conflicts.at (Unresolved SR Conflicts)
16722 (Solved SR Conflicts): Exercise --report=all.
16724 2002-05-26 Akim Demaille <akim@epita.fr>
16726 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
16727 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16728 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
16729 (token_number_t, item_number_as_token_number)
16730 (token_number_as_item_number, muscle_insert_token_number_table):
16732 (symbol_number_t, item_number_as_symbol_number)
16733 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
16734 these, since it is more appropriate.
16736 2002-05-26 Akim Demaille <akim@epita.fr>
16738 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
16740 * data/bison.simple (yystos) [YYDEBUG]: New.
16741 (yyparse) [YYDEBUG]: Display the symbols which are popped during
16743 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
16745 2002-05-25 Akim Demaille <akim@epita.fr>
16747 * doc/bison.texinfo (Debugging): Split into...
16748 (Tracing): this new section, its former contents, and...
16749 (Understanding): this new section.
16750 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
16752 (report_flag): this.
16753 Adjust all dependencies.
16754 (report_args, report_types, report_argmatch): New.
16755 (usage, getargs): Report/support -r, --report.
16757 (struct option_table_struct): Rename as..,
16758 (struct option_table_s): this.
16759 Rename the `set_flag' member to `flag' to match with getopt_long's
16761 * src/options.c (option_table): Split verbose into an entry for
16762 %verbose, and another for --verbose.
16763 Support --report/-r, so remove -r from the obsolete --raw.
16764 * src/print.c: Attach full item sets and lookaheads reports to
16765 report_flag instead of trace_flag.
16766 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
16768 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16769 and Paul Eggert <eggert@twinsun.com>
16771 * data/bison.simple (yyparse): Correct error handling to conform to
16772 POSIX and yacc. Specifically, after syntax error is discovered,
16773 do not reduce further before shifting the error token.
16774 Clean up the code a bit by removing the labels yyerrdefault,
16775 yyerrhandle, yyerrpop.
16776 * NEWS: Document the above.
16778 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16780 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
16781 type; it isn't always big enough, since it doesn't necessarily
16782 include non-terminals.
16783 (yytranslate): Expand definition of yy_token_number_type, so that
16784 the latter can be removed.
16785 (yy_token_number_type): Remove, only one use.
16786 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
16787 don't use TokenNumberType as element type.
16789 * tests/regression.at: Modify expected output to agree with change
16790 to yyr1 and yytranslate.
16792 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
16794 * src/reader.c (parse_action): Use copy_character instead of
16797 2002-05-13 Akim Demaille <akim@epita.fr>
16799 * tests/regression.at (Token definitions): Prototype yylex and
16802 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16804 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
16805 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
16807 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
16809 2002-05-07 Akim Demaille <akim@epita.fr>
16811 * tests/synclines.at: Be sure to prototype yylex and yyerror to
16812 avoid GCC warnings.
16814 2002-05-07 Akim Demaille <akim@epita.fr>
16818 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
16819 over the RHS of each rule.
16820 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
16821 * src/state.h (state_t): Member `nitems' is unsigned short.
16822 * src/LR0.c (get_state): Adjust.
16823 * src/reader.c (packgram): Likewise.
16824 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
16826 (muscle_insert_int_table): Remove, unused.
16827 (prepare_rules): Remove `max'.
16829 2002-05-06 Akim Demaille <akim@epita.fr>
16831 * src/closure.c (print_firsts): Display of the symbol tags.
16832 (bitmatrix_print): Move to...
16833 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
16835 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
16837 2002-05-06 Akim Demaille <akim@epita.fr>
16839 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
16842 2002-05-06 Akim Demaille <akim@epita.fr>
16844 * src/LR0.c (new_state, get_state): Instead of using the global
16845 `kernel_size' and `kernel_base', have two new arguments:
16846 `core_size' and `core'.
16849 2002-05-06 Akim Demaille <akim@epita.fr>
16851 * src/reader.c (packgram): No longer end `ritem' with a 0
16852 sentinel: it is not used.
16854 2002-05-05 Akim Demaille <akim@epita.fr>
16856 New experimental feature: display the lookaheads in the report and
16859 * src/print (print_core): When --trace-flag, display the rules
16861 * src/print_graph.c (print_core): Likewise.
16862 Swap the arguments.
16865 2002-05-05 Akim Demaille <akim@epita.fr>
16867 * tests/torture.at (Many lookaheads): New test.
16869 2002-05-05 Akim Demaille <akim@epita.fr>
16871 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
16872 (GENERATE_MUSCLE_INSERT_TABLE): this.
16873 (output_int_table, output_unsigned_int_table, output_short_table)
16874 (output_token_number_table, output_item_number_table): Replace with...
16875 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
16876 (muscle_insert_short_table, muscle_insert_token_number_table)
16877 (muscle_insert_item_number_table): these.
16878 Adjust all callers.
16879 (prepare_tokens): Don't free `translations', since...
16880 * src/reader.h, src/reader.c (grammar_free): do it.
16882 * src/gram.h, src/gram.c (grammar_free): here.
16883 * data/bison.simple, data/bison.c++: b4_token_number_max is now
16886 2002-05-05 Akim Demaille <akim@epita.fr>
16888 * src/output.c (output_unsigned_int_table): New.
16889 (prepare_rules): `i' is unsigned.
16890 `prhs', `rline', `r2' are unsigned int.
16891 Rename muscle `rhs_number_max' as `rhs_max'.
16892 Output muscles `prhs_max', `rline_max', and `r2_max'.
16894 * data/bison.simple, data/bison.c++: Adjust to use these muscles
16895 to compute types instead of constant types.
16896 * tests/regression.at (Web2c Actions): Adjust.
16898 2002-05-04 Akim Demaille <akim@epita.fr>
16900 * src/symtab.h (SALIAS, SUNDEF): Rename as...
16901 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
16902 Adjust dependencies.
16903 * src/output.c (token_definitions_output): Be sure not to output a
16904 `#define 'a'' when fed with `%token 'a' "a"'.
16905 * tests/regression.at (Token definitions): New.
16907 2002-05-03 Paul Eggert <eggert@twinsun.com>
16909 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
16912 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
16914 * Makefile.am (SUBDIRS): Remove intl.
16915 (EXTRA_DIST): Add config/config.rpath.
16917 2002-05-03 Akim Demaille <akim@epita.fr>
16919 * data/bison.simple (m4_if): Don't output empty enums.
16920 And actually, output valid enum definitions :(.
16922 2002-05-03 Akim Demaille <akim@epita.fr>
16924 * configure.bat: Remove, completely obsolete.
16925 * Makefile.am (EXTRA_DIST): Adjust.
16926 Don't distribute config.rpath...
16927 * config/Makefile.am (EXTRA_DIST): Do it.
16929 2002-05-03 Akim Demaille <akim@epita.fr>
16931 * configure.in (GETTEXT_VERSION): New.
16932 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
16934 2002-05-03 Akim Demaille <akim@epita.fr>
16936 * data/bison.simple (b4_token_enum): New.
16937 (b4_token_defines): Use it to output tokens both as #define and
16939 Suggested by Paul Eggert.
16940 * src/output.c (token_definitions_output): Don't output spurious
16943 2002-05-03 Akim Demaille <akim@epita.fr>
16945 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16947 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
16949 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
16950 Update the stack class, give a try to deque as the default container.
16952 2002-05-02 Akim Demaille <akim@epita.fr>
16954 * data/bison.simple (yyparse): Do not implement @$ = @1.
16955 (YYLLOC_DEFAULT): Adjust to do it.
16956 * doc/bison.texinfo (Location Default Action): Fix.
16958 2002-05-02 Akim Demaille <akim@epita.fr>
16960 * src/reader.c (parse_braces): Merge into...
16961 (parse_action): this.
16963 2002-05-02 Akim Demaille <akim@epita.fr>
16965 * configure.in (ALL_LINGUAS): Remove.
16966 * po/LINGUAS, hr.po: New.
16968 2002-05-02 Akim Demaille <akim@epita.fr>
16970 Remove the so called hairy (semantic) parsers.
16972 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
16973 * src/gram.h, src/gram.c (semantic_parser): Remove.
16974 (rule_t): Remove the guard and guard_line members.
16975 * src/lex.h (token_t): remove tok_guard.
16976 * src/options.c (option_table): Remove %guard and %semantic_parser
16978 * src/output.c, src/output.h (guards_output): Remove.
16980 (token_definitions_output): Don't output the `T'
16982 (output_skeleton): Don't output the guards.
16983 * src/files.c, src/files.c (attrsfile): Remove.
16984 * src/reader.c (symbol_list): Remove the guard and guard_line
16986 Adjust dependencies.
16987 (parse_guard): Remove.
16988 * data/bison.hairy: Remove.
16989 * doc/bison.texinfo (Environment Variables): Remove occurrences of
16992 2002-05-02 Akim Demaille <akim@epita.fr>
16994 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
16995 (parse_guard): Rename the formal argument `stack_offset' as
16996 `rule_length', which is more readable.
16998 (copy_at, copy_dollar): Instead of outputting the hard coded
16999 values of $$, $n and so forth, output invocation to b4_lhs_value,
17000 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
17001 Note: this patch partially drops `semantic-parser' support: it
17002 always does `rule_length - n', where semantic parsers ought to
17004 * data/bison.simple, data/bison.c++ (b4_lhs_value)
17005 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
17007 2002-05-02 Akim Demaille <akim@epita.fr>
17009 * configure.in (AC_INIT): Bump to 1.49b.
17010 (AM_INIT_AUTOMAKE): Short invocation.
17012 2002-05-02 Akim Demaille <akim@epita.fr>
17016 2002-05-01 Akim Demaille <akim@epita.fr>
17018 * src/skeleton.h: Remove.
17020 2002-05-01 Akim Demaille <akim@epita.fr>
17022 * src/skeleton.h: Fix the #endif.
17023 Reported by Magnus Fromreide.
17025 2002-04-26 Paul Eggert <eggert@twinsun.com>
17027 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
17028 Define if we define YYSTYPE and YYLTYPE, respectively.
17029 (YYCOPY): Fix [] quoting problem in the non-GCC case.
17031 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
17033 * src/scan-skel.l: Postprocess quadrigraphs.
17035 * src/reader.c (copy_character): New function, used to output
17036 single characters while replacing `[' and `]' with quadrigraphs, to
17037 avoid troubles with M4 quotes.
17038 (copy_comment): Output characters with copy_character.
17039 (read_additionnal_code): Likewise.
17040 (copy_string2): Likewise.
17041 (copy_definition): Likewise.
17043 * tests/calc.at: Exercise M4 quoting.
17045 2002-04-25 Akim Demaille <akim@epita.fr>
17047 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
17048 between `!' and the command.
17049 Reported by Paul Eggert.
17051 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
17053 * tests/calc.at: Exercise prologue splitting.
17055 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
17056 `b4_post_prologue' instead of `b4_prologue'.
17058 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
17060 (output): Free pre_prologue_obstack and post_prologue_obstack.
17061 * src/files.h, src/files.c (attrs_obstack): Remove.
17062 (pre_prologue_obstack, post_prologue_obstack): New.
17063 * src/reader.c (copy_definition): Add a parameter to specify the
17064 obstack to fill, instead of using attrs_obstack unconditionally.
17065 (read_declarations): Pass pre_prologue_obstack to copy_definition if
17066 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
17068 2002-04-23 Paul Eggert <eggert@twinsun.com>
17070 * data/bison.simple: Remove unnecessary commentary and white
17071 space differences from 1_29-branch.
17072 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
17074 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
17075 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
17076 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
17077 constructors or destructors.
17079 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
17081 2002-04-23 Akim Demaille <akim@epita.fr>
17083 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
17084 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
17085 location with columns.
17086 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
17087 All reported by Paul Eggert.
17089 2002-04-22 Akim Demaille <akim@epita.fr>
17091 * src/reduce.c (dump_grammar): Move to...
17092 * src/gram.h, src/gram.c (grammar_dump): here.
17093 Be sure to separate long item numbers.
17094 Don't read the members of a rule's prec if its nil.
17096 2002-04-22 Akim Demaille <akim@epita.fr>
17098 * src/output.c (table_size, table_grow): New.
17099 (MAXTABLE): Remove, replace uses with table_size.
17100 (pack_vector): Instead of dying when the table is too big, grow it.
17102 2002-04-22 Akim Demaille <akim@epita.fr>
17104 * data/bison.simple (yyr1): Its type is that of a token number.
17105 * data/bison.c++ (r1_): Likewise.
17106 * tests/regression.at (Web2c Actions): Adjust.
17108 2002-04-22 Akim Demaille <akim@epita.fr>
17110 * src/reader.c (token_translations_init): 256 is now the default
17111 value for the error token, i.e., it will be assigned another
17112 number if the user assigned 256 to one of her tokens.
17113 (reader): Don't force 256 to error.
17114 * doc/bison.texinfo (Symbols): Adjust.
17115 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
17116 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
17117 etc. instead of 10, 20, 30 (which was used to `jump' over error
17118 (256) and undefined (2)).
17120 2002-04-22 Akim Demaille <akim@epita.fr>
17122 Propagate more token_number_t.
17124 * src/gram.h (token_number_as_item_number)
17125 (item_number_as_token_number): New.
17126 * src/output.c (GENERATE_OUTPUT_TABLE): New.
17127 Use it to create output_item_number_table and
17128 output_token_number_table.
17129 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17130 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
17131 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
17132 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
17134 2002-04-22 Akim Demaille <akim@epita.fr>
17136 * src/output.h, src/output.c (get_lines_number): Remove.
17138 2002-04-19 Akim Demaille <akim@epita.fr>
17140 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
17142 (Debugging): More details about enabling the debugging features.
17143 (Table of Symbols): Describe $$, $n, @$, and @n.
17144 Suggested by Tim Josling.
17146 2002-04-19 Akim Demaille <akim@epita.fr>
17148 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
17150 2002-04-10 Akim Demaille <akim@epita.fr>
17152 * src/system.h: Rely on HAVE_LIMITS_H.
17153 Suggested by Paul Eggert.
17155 2002-04-09 Akim Demaille <akim@epita.fr>
17157 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
17158 full stderr, and strip it according to the bison options, instead
17159 of composing the error message from different bits.
17160 This makes it easier to check for several error messages.
17161 Adjust all the invocations.
17162 Add an invocation exercising the error token.
17163 Add an invocation demonstrating a stupid error message.
17164 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
17166 Error message are for stderr, not stdout.
17168 2002-04-09 Akim Demaille <akim@epita.fr>
17170 * src/gram.h, src/gram.c (error_token_number): Remove, use
17172 * src/reader.c (reader): Don't specify the user token number (2)
17173 for $undefined, as it uselessly prevents using it.
17174 * src/gram.h (token_number_t): Move to...
17175 * src/symtab.h: here.
17176 (state_t.number): Is a token_number_t.
17177 * src/print.c, src/reader.c: Use undeftoken->number instead of
17179 (Even though this 2 is not the same as above: the number of the
17180 undeftoken remains being 2, it is its user token number which
17182 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
17183 `user_token_number_max'.
17184 Output `undef_token_number'.
17185 * data/bison.simple, data/bison.c++: Use them.
17186 Be sure to map invalid yylex return values to
17187 `undef_token_number'. This saves us from gratuitous SEGV.
17189 * tests/conflicts.at (Solved SR Conflicts)
17190 (Unresolved SR Conflicts): Adjust.
17191 * tests/regression.at (Web2c Actions): Adjust.
17193 2002-04-08 Akim Demaille <akim@epita.fr>
17195 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
17197 Remove the duplicate `typedefs'.
17198 (RhsNumberType): Fix the declaration and various other typos.
17200 * data/bison.simple: Use __ofile__.
17201 * src/scan-skel.l: Handle __ofile__.
17203 2002-04-08 Akim Demaille <akim@epita.fr>
17205 * src/gram.h (item_number_t): New, the type of item numbers in
17206 RITEM. Note that it must be able to code symbol numbers as
17207 positive number, and the negation of rule numbers as negative
17209 Adjust all dependencies (pretty many).
17210 * src/reduce.c (rule): Remove this `short *' pointer: use
17212 * src/system.h (MINSHORT, MAXSHORT): Remove.
17213 Include `limits.h'.
17214 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
17215 (shortcpy): Remove.
17216 (MAXTABLE): Move to...
17217 * src/output.c (MAXTABLE): here.
17218 (prepare_rules): Use output_int_table to output rhs.
17219 * data/bison.simple, data/bison.c++: Adjust.
17220 * tests/torture.at (Big triangle): Move the limit from 254 to
17222 * tests/regression.at (Web2c Actions): Ajust.
17224 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
17225 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
17226 passes, but produces negative #line number, once fixed, GCC is
17227 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
17229 * src/state.h (state_h): Code input lines on ints, not shorts.
17231 2002-04-08 Akim Demaille <akim@epita.fr>
17233 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
17234 and then the grammar.
17236 2002-04-08 Akim Demaille <akim@epita.fr>
17238 * src/system.h: No longer using strndup.
17240 2002-04-07 Akim Demaille <akim@epita.fr>
17242 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
17243 * src/output.c (output_table_data): Return the longest number.
17244 (prepare_tokens): Output `token_number_max').
17245 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
17247 Use them to define yy_token_number_type/TokenNumberType.
17248 Use this type for yytranslate.
17249 * tests/torture.at (Big triangle): Push the limit from 124 to
17251 * tests/regression.at (Web2c Actions): Adjust.
17253 2002-04-07 Akim Demaille <akim@epita.fr>
17255 * tests/torture.at (Big triangle): New.
17256 (GNU AWK Grammar, GNU Cim Grammar): Move to...
17257 * tests/existing.at: here.
17259 2002-04-07 Akim Demaille <akim@epita.fr>
17261 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
17263 Adjust dependencies.
17265 2002-04-07 Akim Demaille <akim@epita.fr>
17267 * src/reader.c: Normalize increments to prefix form.
17269 2002-04-07 Akim Demaille <akim@epita.fr>
17271 * src/reader.c, symtab.c: Remove debugging code.
17273 2002-04-07 Akim Demaille <akim@epita.fr>
17275 Rename all the `bucket's as `symbol_t'.
17277 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
17278 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
17279 * src/symtab.c, src/symtab.h (bucket): Rename as...
17281 (symbol_list_new, bucket_check_defined, bucket_make_alias)
17282 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
17283 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
17284 (buckets_new, buckets_free, buckets_do): Rename as...
17285 (symbol_list_new, symbol_check_defined, symbol_make_alias)
17286 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17287 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
17288 (symbols_new, symbols_free, symbols_do): these.
17290 2002-04-07 Akim Demaille <akim@epita.fr>
17292 Use lib/hash for the symbol table.
17294 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
17296 * src/lex.c (lex): Set the `number' member of new terminals.
17297 * src/reader.c (bucket_check_defined, bucket_make_alias)
17298 (bucket_check_alias_consistence, bucket_translation): New.
17299 (reader, grammar_free, readgram, token_translations_init)
17300 (packsymbols): Adjust.
17301 (reader): Number the predefined tokens.
17302 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
17303 for predefined tokens.
17304 * src/symtab.h (bucket): Remove all the hash table related
17306 * src/symtab.c (symtab): Replace by...
17307 (bucket_table): this.
17308 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
17309 (buckets_new, buckets_do): New.
17311 2002-04-07 Akim Demaille <akim@epita.fr>
17313 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
17314 (start_symbol, max_user_token_number, semantic_parser)
17315 (error_token_number): Initialize.
17316 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
17319 (errtoken, eoftoken, undeftoken, axiom): Extern.
17321 2002-04-07 Akim Demaille <akim@epita.fr>
17323 * src/gram.h (rule_s): prec and precsym are now pointers
17324 to the bucket giving the priority/associativity.
17325 Member `associativity' removed: useless.
17326 * src/reduce.c, src/conflicts.c: Adjust.
17328 2002-04-07 Akim Demaille <akim@epita.fr>
17330 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
17331 Properly escape the symbols' TAG when outputting them.
17333 2002-04-07 Akim Demaille <akim@epita.fr>
17335 * src/lalr.h (LA): Is a bitsetv, not bitset*.
17337 2002-04-07 Akim Demaille <akim@epita.fr>
17339 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
17340 (LArule): this, which is an array to rule_t*.
17341 * src/print.c, src/conflicts.c: Adjust.
17343 2002-04-07 Akim Demaille <akim@epita.fr>
17345 * src/gram.h (rule_t): Rename `number' as `user_number'.
17346 `number' is a new member.
17347 Adjust dependencies.
17348 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
17350 2002-04-07 Akim Demaille <akim@epita.fr>
17352 As a result of the previous patch, it is no longer needed
17353 to reorder ritem itself.
17355 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
17357 2002-04-07 Akim Demaille <akim@epita.fr>
17359 Be sure never to walk through RITEMS, but use only data related to
17360 the rules themselves. RITEMS should be banished.
17362 * src/output.c (output_token_translations): Rename as...
17363 (prepare_tokens): this.
17364 In addition to `translate', prepare the muscles `tname' and
17365 `toknum', which were handled by...
17366 (output_rule_data): this.
17367 Remove, and move the remainder of its outputs into...
17368 (prepare_rules): this new routines, which also merges content from
17369 (output_gram): this.
17370 (prepare_rules): Be sure never to walk through RITEMS.
17371 (output_stos): Rename as...
17372 (prepare_stos): this.
17373 (output): Always invoke prepare_states, after all, just don't use it
17374 in the output if you don't need it.
17376 2002-04-07 Akim Demaille <akim@epita.fr>
17378 * src/LR0.c (new_state): Display `nstates' as the name of the
17379 newly created state.
17380 Adjust to initialize first_state and last_state if needed.
17381 Be sure to distinguish the initial from the final state.
17382 (new_states): Create the itemset of the initial state, and use
17384 * src/closure.c (closure): Now that the initial state has its
17385 items properly set, there is no need for a special case when
17386 creating `ruleset'.
17388 As a result, now the rule 0, reducing to $axiom, is visible in the
17389 outputs. Adjust the test suite.
17391 * tests/conflicts.at (Solved SR Conflicts)
17392 (Unresolved SR Conflicts): Adjust.
17393 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
17394 * tests/conflicts.at (S/R in initial): New.
17396 2002-04-07 Akim Demaille <akim@epita.fr>
17398 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
17399 the RHS of the rules.
17400 * src/output.c (output_gram): Likewise.
17402 2002-04-07 Akim Demaille <akim@epita.fr>
17404 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
17406 Adjust all dependencies.
17407 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
17408 `number' of the buckets too.
17409 * src/gram.h: Include `symtab.h'.
17410 (associativity): Move to...
17411 * src/symtab.h: here.
17412 No longer include `gram.h'.
17414 2002-04-07 Akim Demaille <akim@epita.fr>
17416 * src/gram.h, src/gram.c (rules_rhs_length): New.
17417 (ritem_longest_rhs): Use it.
17418 * src/gram.h (rule_t): `number' is a new member.
17419 * src/reader.c (packgram): Set it.
17420 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
17421 the end of `rules', and count them out of `nrules'.
17422 (reduce_output, dump_grammar): Adjust.
17423 * src/print.c (print_grammar): It is no longer needed to check for
17424 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
17425 * tests/reduce.at (Reduced Automaton): New test.
17427 2002-04-07 Akim Demaille <akim@epita.fr>
17429 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
17430 lacking `+ 1' to nrules, Bison reported as useless a token if it
17431 was used solely to set the precedence of the last rule...
17433 2002-04-07 Akim Demaille <akim@epita.fr>
17435 * data/bison.c++, data/bison.simple: Don't output the current file
17436 name in #line, to avoid useless diffs between two identical
17437 outputs under different names.
17439 2002-04-07 Akim Demaille <akim@epita.fr>
17441 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
17442 Normalize loops to using `< nrules + 1', not `<= nrules'.
17444 2002-04-07 Akim Demaille <akim@epita.fr>
17448 2002-04-07 Akim Demaille <akim@epita.fr>
17450 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
17451 bucket.value as bucket.number.
17453 2002-04-07 Akim Demaille <akim@epita.fr>
17455 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
17456 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
17457 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
17458 RHS, instead of being an index in RITEMS.
17460 2002-04-04 Paul Eggert <eggert@twinsun.com>
17462 * doc/bison.texinfo: Update copyright date.
17463 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
17464 (Symbols): Warn about running Bison in one character set,
17465 but compiling and/or running in an incompatible one.
17466 Warn about character code 256, too.
17468 2002-04-03 Paul Eggert <eggert@twinsun.com>
17470 * src/bison.data (YYSTACK_ALLOC): Depend on whether
17471 YYERROR_VERBOSE is nonzero, not whether it is defined.
17473 Merge changes from bison-1_29-branch.
17475 2002-03-20 Paul Eggert <eggert@twinsun.com>
17477 Merge fixes from Debian bison_1.34-1.diff.
17479 * configure.in (AC_PREREQ): 2.53.
17481 2002-03-20 Akim Demaille <akim@epita.fr>
17483 * src/conflicts.c (log_resolution): Argument `resolution' is const.
17485 2002-03-19 Paul Eggert <eggert@twinsun.com>
17487 * src/bison.simple (YYCOPY): New macro.
17488 (YYSTACK_RELOCATE): Use it.
17489 Remove Type arg; no longer needed. All callers changed.
17490 (yymemcpy): Remove; no longer needed.
17492 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
17493 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
17495 2002-03-19 Akim Demaille <akim@epita.fr>
17497 Test and fix the #line outputs.
17499 * tests/atlocal.at (GCC): New.
17500 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
17501 (Prologue synch line, %union synch line, Postprologue synch line)
17502 (Action synch line, Epilogue synch line): New tests.
17503 * src/reader.c (parse_union_decl): Define the muscle stype_line.
17504 * data/bison.simple, data/bison.c++: Use it.
17506 2002-03-19 Akim Demaille <akim@epita.fr>
17508 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
17509 (Solved SR Conflicts, %expect not enough, %expect right)
17510 (%expect too much): Move to...
17511 * tests/conflicts.at: this new file.
17513 2002-03-19 Akim Demaille <akim@epita.fr>
17515 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
17516 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
17517 that we can move to enums for instance.
17518 * src/output.c (token_definitions_output): Output a list of
17519 `token-name, token-number' instead of the #define.
17520 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
17522 2002-03-14 Akim Demaille <akim@epita.fr>
17524 Use Gettext 0.11.1.
17526 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
17528 * data/bison.c++: Make the user able to add members to the generated
17529 parser by subclassing.
17531 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
17533 * src/reader.c (read_additionnal_code): `c' should be an integer, not
17535 Reported by Nicolas Tisserand and Nicolas Burrus.
17537 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
17539 * src/reader.c: Warn about lacking semi-colons, do not complain.
17541 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
17543 * data/bison.c++: Remove a debug line.
17545 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
17547 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
17548 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
17549 provide a default implementation.
17551 2002-03-04 Akim Demaille <akim@epita.fr>
17553 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
17554 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
17555 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
17556 * tests/semantic.at (Parsing Guards): Similarly.
17557 * src/reader.at (readgram): Complain if the last rule is not ended
17560 2002-03-04 Akim Demaille <akim@epita.fr>
17562 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
17563 * src/closure.c: here.
17564 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
17566 * src/warshall.h, src/warshall.c: Remove.
17567 * tests/sets.at (Broken Closure): Adjust.
17569 2002-03-04 Akim Demaille <akim@epita.fr>
17571 * src/output.c (output_skeleton): tempdir is const.
17572 bytes_read is unused.
17574 2002-03-04 Akim Demaille <akim@epita.fr>
17576 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
17577 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
17579 From Michael Hayes.
17581 2002-03-04 Akim Demaille <akim@epita.fr>
17583 * src/closure.c (closure): `r' is unused.
17585 2002-03-04 Akim Demaille <akim@epita.fr>
17587 * tests/sets.at (Broken Closure): Add the ending `;'.
17588 * src/reader.at (readgram): Complain if a rule is not ended with a
17591 2002-03-04 Akim Demaille <akim@epita.fr>
17593 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
17594 (count_sr_conflicts): Use bitset_count.
17595 * src/reduce.c (inaccessable_symbols): Ditto.
17596 (bits_size): Remove.
17597 * src/warshall.h, src/warshall.c: Convert to bitsetv.
17599 2002-03-04 Akim Demaille <akim@epita.fr>
17601 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
17602 * src/reduce.c: Remove the `bitset_zero's following the
17603 `bitset_create's, as now it is performed by the latter.
17605 2002-03-04 Akim Demaille <akim@epita.fr>
17607 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
17608 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
17609 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
17610 latest sources from Michael.
17612 2002-03-04 Akim Demaille <akim@epita.fr>
17614 * src/output.c (output): Don't free the grammar.
17615 * src/reader.c (grammar_free): New.
17616 * src/main.c (main): Call it and don't free symtab here.
17618 2002-03-04 Akim Demaille <akim@epita.fr>
17620 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
17622 Reported by Benoit Perrot.
17624 2002-03-04 Akim Demaille <akim@epita.fr>
17626 Use bitset operations when possible, not loops over bits.
17628 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
17630 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
17631 * src/reduce.c (useless_nonterminals): Formatting changes.
17632 * src/warshall.c (TC): Use bitset_or.
17634 2002-03-04 Akim Demaille <akim@epita.fr>
17636 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
17637 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
17640 2002-03-04 Akim Demaille <akim@epita.fr>
17642 * src/lalr.c (F): Now a bitset*.
17643 Adjust all dependencies.
17645 2002-03-04 Akim Demaille <akim@epita.fr>
17647 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
17648 Adjust all dependencies.
17650 2002-03-04 Akim Demaille <akim@epita.fr>
17652 * src/L0.c, src/LR0.h (nstates): Be size_t.
17653 Adjust comparisons (signed vs unsigned).
17654 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
17656 Adjust all dependencies.
17658 2002-03-04 Akim Demaille <akim@epita.fr>
17660 * src/closure.c (firsts): Now, also a bitset.
17661 Adjust all dependencies.
17662 (varsetsize): Remove, now unused.
17663 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
17665 2002-03-04 Akim Demaille <akim@epita.fr>
17667 * src/print.c: Convert to use bitset.h, not hand coded iterations
17670 2002-03-04 Akim Demaille <akim@epita.fr>
17672 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
17674 2002-03-04 Akim Demaille <akim@epita.fr>
17676 * src/closure.c (ruleset): Be a bitset.
17677 (rulesetsize): Remove.
17679 2002-03-04 Akim Demaille <akim@epita.fr>
17681 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
17682 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
17683 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
17684 * src/closure.c (fderives): Be an array of bitsets.
17686 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
17688 * data/bison.c++: Merge the two generated headers. Insert a copyright
17689 notice in each output file.
17691 2002-02-28 Akim Demaille <akim@epita.fr>
17693 * data/bison.c++: Copy the prologue of bison.simple to fetch
17694 useful M4 definitions, such as b4_header_guard.
17696 2002-02-25 Akim Demaille <akim@epita.fr>
17698 * src/getargs.c (version): Give the name of the authors, and use a
17699 translator friendly scheme for the bgr
17702 2002-02-25 Akim Demaille <akim@epita.fr>
17704 * src/output.c (header_output): Remove, now handled completely via
17707 2002-02-25 Akim Demaille <akim@epita.fr>
17709 * m4/m4.m4: New, from CVS Autoconf.
17710 * configure.in: Invoke it.
17711 * src/output.c (output_skeleton): Use its result instead of the
17714 2002-02-25 Akim Demaille <akim@epita.fr>
17716 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
17718 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
17719 * src/output.c (output_skeleton): Use mkstemp to create a real
17721 Move the filling of `skeleton' and its muscle to...
17723 (output): Move the definition of the prologue muscle to...
17725 * src/system.h (DEFAULT_TMPDIR): New.
17727 2002-02-14 Paul Eggert <eggert@twinsun.com>
17729 Remove the support for C++ namespace cleanliness; it was
17730 causing more problems than it was curing, since it didn't work
17731 properly on some nonstandard C++ compilers. This can wait
17732 for a proper C++ parser.
17734 * NEWS: Document this.
17735 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
17736 of C++, as it's treated like C now.
17737 * src/bison.simple (YYSTD): Remove.
17738 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
17739 Treat C++ just like Standard C instead of trying to support
17740 namespace cleanliness.
17742 2002-02-14 Akim Demaille <akim@epita.fr>
17744 * tests/regression.at (else): Adjust to Andreas' change.
17746 2002-02-14 Akim Demaille <akim@epita.fr>
17748 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
17750 2002-02-13 Andreas Schwab <schwab@suse.de>
17752 * src/output.c (output_rule_data): Don't output NULL, it might
17753 not be defined yet.
17755 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
17757 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
17758 (Copyright notice): Update.
17760 2002-02-11 Akim Demaille <akim@epita.fr>
17762 * tests/regression.at (%nonassoc and eof): Don't include
17763 nonportable headers.
17765 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
17767 * data/bison.c++: Correct error recovery. Make the user able to
17768 initialize the starting location.
17770 2002-02-07 Akim Demaille <akim@epita.fr>
17772 * tests/input.at: New.
17774 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17776 * data/bison.c++: Replace some direct m4 expansions by constants. Be
17777 more consistent when naming methods and variables. Put preprocessor
17778 directives around tables only needed for debugging.
17780 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17782 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
17784 (yy::b4_name::parse): Use print_.
17786 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17788 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
17790 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17792 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
17794 (yy::b4_name::parse): Build verbose error messages, and use error_.
17796 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
17798 * data/bison.c++: Fix m4 quoting in comments.
17800 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
17802 * data/bison.c++: Adjust the parser code. Fix some muscles that were
17803 not expanded by m4.
17805 2002-02-05 Akim Demaille <akim@epita.fr>
17807 * data/bison.c++: Adjust to the M4 back end.
17808 More is certainly needed.
17810 2002-02-05 Akim Demaille <akim@epita.fr>
17812 Give a try to M4 as a back end.
17814 * lib/readpipe.c: New, from wdiff.
17815 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
17817 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
17818 specific values. Now it is m4 that performs the lookup.
17819 * src/parse-skel.y: Remove.
17820 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
17821 * src/output.c (actions_output, guards_output)
17822 (token_definitions_output): No longer keeps track of the output
17823 line number, hence remove the second argument.
17824 (guards_output): Check against the guard member of a rule, not the
17827 (output_skeleton): Don't look for the skeleton location, let m4 do
17829 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
17831 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
17832 (prepare): Given that for the time being changesyntax is not
17833 usable in M4, rename the muscles using `-' to `_'.
17834 Define `defines_flag', `output_parser_name' and `output_header_name'.
17835 * src/output.h (actions_output, guards_output)
17836 (token_definitions_output): Adjust prototypes.
17837 * src/scan-skel.l: Instead of scanning the skeletons, it now
17838 processes the output of m4: `__oline__' and `#output'.
17839 * data/bison.simple: Adjust to be used by M4(sugar).
17840 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
17842 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
17843 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
17844 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
17845 shamelessly stolen from CVS Autoconf.
17847 2002-02-05 Akim Demaille <akim@epita.fr>
17849 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
17850 * configure.in: Check for the declarations of free and malloc.
17851 * src/muscle_tab.c: Adjust.
17853 2002-02-05 Akim Demaille <akim@epita.fr>
17855 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
17856 which have no values.
17858 2002-02-05 Akim Demaille <akim@epita.fr>
17860 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
17863 2002-01-29 Paul Eggert <eggert@twinsun.com>
17865 * src/bison.simple (YYSIZE_T): Do not define merely because
17866 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
17867 On some platforms, <alloca.h> does not declare YYSTD (size_t).
17869 2002-01-27 Akim Demaille <akim@epita.fr>
17871 Fix `%nonassoc and eof'.
17873 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
17874 which were not properly copied! Replace
17875 memcpy (res->errs, src->errs, src->nerrs);
17877 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
17879 * tests/regression.at (%nonassoc and eof): Adjust to newest
17880 Autotest: `.' is not in the PATH.
17882 2002-01-27 Akim Demaille <akim@epita.fr>
17884 * tests/sets.at (AT_EXTRACT_SETS): New.
17885 (Nullable): Use it.
17888 2002-01-26 Akim Demaille <akim@epita.fr>
17890 * tests/actions.at, tests/calc.at, tests/headers.at,
17891 * tests/torture.at: Adjust to the newest Autotest which no longer
17892 forces `.' in the PATH.
17894 2002-01-25 Akim Demaille <akim@epita.fr>
17896 * tests/regression.at (%nonassoc and eof): New.
17897 Suggested by Robert Anisko.
17899 2002-01-24 Akim Demaille <akim@epita.fr>
17901 Bison dumps core when trying to complain about broken input files.
17902 Reported by Cris van Pelt.
17904 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
17905 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
17907 (Invalid inputs): Strengthen: exercise parse_percent_token.
17909 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
17911 * src/Makefile.am: Add bison.c++.
17912 * src/bison.c++: New skeleton.
17914 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
17918 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
17920 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
17922 2002-01-20 Marc Autret <marc@gnu.org>
17924 * src/files.c (compute_output_file_names): Fix
17926 2002-01-20 Marc Autret <marc@gnu.org>
17928 * tests/output.at: New test.
17929 * src/files.c (compute_base_names): Don't map extensions when
17930 the YACC flag is set, use defaults.
17931 Reported by Evgeny Stambulchik.
17933 2002-01-20 Marc Autret <marc@gnu.org>
17935 * src/system.h: Need to define __attribute__ away for non-GCC
17936 compilers as well (i.e., the vendor C compiler).
17937 Suggested by Albert Chin-A-Young.
17939 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
17941 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
17942 canonical definition.
17943 * src/system.h: Use the canonical definition for PARAMS (avoids
17944 a conflict with the macro from lib/hash.h).
17946 2002-01-11 Akim Demaille <akim@epita.fr>
17948 * configure.in: Use AC_FUNC_STRNLEN.
17949 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
17951 2002-01-09 Akim Demaille <akim@epita.fr>
17953 * src/files.c, src/files.h (output_infix): New.
17954 (tab_extension): Remove.
17955 (compute_base_names): Compute the former, drop the latter.
17956 * src/output.c (prepare): Insert the muscles `output-infix', and
17958 * src/parse-skel.y (string, string.1): New.
17959 (section.header): Use it.
17960 (section.yacc): Remove.
17961 (prefix): Remove too.
17962 * src/scan-skel.l: Adjust.
17963 * src/bison.simple, src/bison.hairy: Adjust.
17965 2002-01-09 Akim Demaille <akim@epita.fr>
17967 * configure.in (WERROR_CFLAGS): Compute it.
17968 * src/Makefile.am (CFLAGS): Pass it.
17969 * tests/atlocal.in (CFLAGS): Idem.
17970 * src/files.c: Fix a few warnings.
17971 (get_extension_index): Remove, unused.
17973 2002-01-08 Akim Demaille <akim@epita.fr>
17975 * src/getargs.c (AS_FILE_NAME): New.
17976 (getargs): Use it to convert DOSish file names.
17977 * src/files.c (base_name): Rename as full_base_name to avoid
17978 clashes with `base_name ()'.
17979 (filename_split): New.
17980 (compute_base_names): N-th rewrite, using filename_split.
17982 2002-01-08 Akim Demaille <akim@epita.fr>
17984 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
17985 New, stolen from the Fileutils 4.1.
17986 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
17987 * configure.in: Check for the presence of memrchr, and of its
17990 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
17992 * lib/hash.h (__P): Added definition for this macro.
17993 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
17994 BUILT_SOURCES, to ensure they are generated first.
17995 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
17996 %error-verbose to allow bootstrapping with bison 1.30x.
17998 2002-01-06 Akim Demaille <akim@epita.fr>
18000 * src/reader.c (parse_braces): Don't fetch the next char, the
18001 convention is to fetch on entry.
18002 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
18003 'switch' without a following semicolon.
18004 * tests/regression.at (braces parsing): New.
18006 2002-01-06 Akim Demaille <akim@epita.fr>
18008 Bison is dead wrong in its RR conflict reports.
18010 * tests/torture.at (GNU Cim Grammar): New.
18011 * src/conflicts.c (count_rr_conflicts): Fix.
18013 2002-01-06 Akim Demaille <akim@epita.fr>
18015 Creating package.m4 from configure.ac causes too many problems.
18017 * tests/Makefile.am (package.m4): Create it by hand,
18018 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
18020 2002-01-06 Akim Demaille <akim@epita.fr>
18022 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
18025 2002-01-04 Paul Eggert <eggert@twinsun.com>
18027 * doc/bison.texinfo (Debugging):
18028 Remove YYSTDERR; it's no longer defined or used.
18029 Also, s/cstdio.h/cstdio/.
18031 2002-01-03 Akim Demaille <akim@epita.fr>
18033 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
18035 2002-01-03 Akim Demaille <akim@epita.fr>
18037 * src/parse-skel.y (process_skeleton): Don't bind the parser's
18038 tracing code to --trace, wait for a better --trace option, with
18041 2002-01-03 Akim Demaille <akim@epita.fr>
18043 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
18044 The ISO C++ standard is extremely clear about it: stderr is
18045 considered a macro, not a regular symbol (see table 94 `Header
18046 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
18047 Therefore std:: does not apply to it. It still does with fprintf.
18048 Also, s/cstdio.h/cstdio/.
18050 2002-01-03 Akim Demaille <akim@epita.fr>
18052 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
18053 for non system headers.
18055 2002-01-02 Akim Demaille <akim@epita.fr>
18057 Equip the skeleton chain with location tracking, runtime trace,
18058 pure parser and scanner.
18060 * src/parse-skel.y: Request a pure parser, locations, and prefix
18062 (%union): Having several members with the same type does not help
18063 type mismatches, simplify.
18064 (YYPRINT, yyprint): New.
18065 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
18066 (skel_error): this.
18068 * src/scan-skel.l: Adjust to these changes.
18069 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
18070 (LOCATION_PRINT, skel_control_t): New.
18072 2001-12-30 Akim Demaille <akim@epita.fr>
18074 * src/parse-skel.y: Get rid of the shift/reduce conflict:
18075 replace `gb' with BLANKS.
18076 * src/scan-skel.l: Adjust.
18078 2001-12-30 Akim Demaille <akim@epita.fr>
18080 * src/system.h: We don't need nor want bcopy.
18081 Throw away MS-DOS crap: we don't need getpid.
18082 * configure.in: We don't need strndup. It was even causing
18083 problems: because Flex includes the headers *before* us,
18084 _GNU_SOURCE is not defined by config.h, and therefore strndup was
18086 * lib/xstrndup.c: New.
18087 * src/scan-skel.l: Use it.
18088 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
18089 * src/parse-skel.y: Use %directives instead of #defines.
18091 2001-12-30 Akim Demaille <akim@epita.fr>
18093 * src/skeleton.h: New.
18094 * src/output.c (output_parser, output_master_parser): Remove, dead
18096 * src/output.h (get_lines_number, actions_output, guards_output)
18097 (token_definitions_output): Prototype them.
18098 * src/parse-skel.y: Add the license notice.
18099 Include output.h and skeleton.h.
18100 (process_skeleton): Returns void, and takes a single parameter.
18101 * src/scan-skel.l: Add the license notice.
18102 Include skeleton.h.
18103 Don't use %option yylineno: it seems that then Flex imagines
18104 REJECT has been used, and therefore it won't reallocate its
18105 buffers (which makes no other sense to me than a bug). It results
18106 in warnings for `unused: yy_flex_realloc'.
18108 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
18110 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18111 (MUSCLE_INSERT_PREFIX): ...to there.
18112 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18113 (MUSCLE_INSERT_PREFIX): Move from here...
18115 * src/bison.hairy: Add a section directive. Put braces around muscle
18116 names. This parser skeleton is still broken, but Bison should not
18117 choke on a bad muscle 'syntax'.
18118 * src/bison.simple: Add a section directive. Put braces around muscle
18121 * src/files.h (strsuffix, stringappend): Add declarations.
18122 (tab_extension): Add declaration.
18123 (short_base_name): Add declaration.
18125 * src/files.c (strsuffix, stringappend): No longer static. These
18126 functions are used in the skeleton parser.
18127 (tab_extension): New.
18128 (compute_base_names): Use the computations done in this function
18129 to guess if the generated parsers should have '.tab' in their
18131 (short_base_name): No longer static.
18133 * src/output.c (output_skeleton): New.
18134 (output): Disable call to output_master_parser, and give a try to
18135 a new skeleton handling system.
18136 (guards_output, actions_output): No longer static.
18137 (token_definitions_output, get_lines_number): No longer static.
18139 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
18141 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
18144 * src/parse-skel.y: New file.
18145 * src/scan-skel.l: New file.
18147 2001-12-29 Akim Demaille <akim@epita.fr>
18149 %name-prefix is broken.
18151 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
18152 Adjust all dependencies.
18153 * tests/headers.at (export YYLTYPE): Strengthen this test: use
18156 Renaming yylval but not yylloc is not consistent. Now we do.
18158 * src/bison.simple: Prefix yylloc if used.
18159 * doc/bison.texinfo (Decl Summary): Document that.
18161 2001-12-29 Akim Demaille <akim@epita.fr>
18163 * doc/bison.texinfo: Promote `%long-directive' over
18165 Remove all references to fixed-output-files, yacc is enough.
18167 2001-12-29 Akim Demaille <akim@epita.fr>
18169 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
18170 user prologue. These are defaults.
18171 * tests/actions.at (Mid-rule actions): Make sure the user can
18172 define YYDEBUG and YYERROR_VERBOSE.
18174 2001-12-29 Akim Demaille <akim@epita.fr>
18176 * src/output.c (header_output): Don't forget to export YYLTYPE and
18178 * tests/headers.at (export YYLTYPE): New, make sure it does.
18179 * tests/regression.at (%union and --defines, Invalid CPP headers):
18181 * tests/headers.at: here.
18183 2001-12-29 Akim Demaille <akim@epita.fr>
18185 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
18187 2001-12-29 Akim Demaille <akim@epita.fr>
18189 * tests/actions.at (Mid-rule actions): Output on a single line
18190 instead of several.
18192 2001-12-29 Akim Demaille <akim@epita.fr>
18194 * doc/bison.texinfo: Formatting changes.
18196 2001-12-29 Akim Demaille <akim@epita.fr>
18198 Don't store the token defs in a muscle, just be ready to output it
18199 on command. Now possible via `symbols'. Fixes a memory leak.
18201 * src/output.c (token_definitions_output): New.
18202 (output_parser, header_output): Use it.
18203 * src/reader.c (symbols_save): Remove.
18205 2001-12-29 Akim Demaille <akim@epita.fr>
18207 * src/bison.simple: Do not provide a default for YYSTYPE and
18208 YYLTYPE before the user's prologue. Otherwise it's hardly... a
18211 2001-12-29 Akim Demaille <akim@epita.fr>
18213 Mid-rule actions are simply... ignored!
18215 * src/reader.c (readgram): Be sure to attach mid-rule actions to
18216 the empty-rule associated to the dummy symbol, not to the host
18218 * tests/actions.at (Mid-rule actions): New.
18220 2001-12-29 Akim Demaille <akim@epita.fr>
18224 * src/reader.c (reader): Free grammar.
18226 2001-12-29 Akim Demaille <akim@epita.fr>
18230 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
18231 since it allocates it for each state, although only one is needed.
18232 (allocate_storage): Do it here.
18234 2001-12-29 Akim Demaille <akim@epita.fr>
18236 * src/options.h, src/options.c (create_long_option_table): Rename
18238 (long_option_table_new): this, with a clearer prototype.
18239 (percent_table): Remove, unused,
18240 * src/getargs.c (getargs): Adjust.
18242 2001-12-29 Akim Demaille <akim@epita.fr>
18244 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
18245 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
18248 2001-12-29 Akim Demaille <akim@epita.fr>
18250 * src/lalr.c (build_relations): Rename `states' as `states1'.
18251 Sorry, I don't understand exactly what it is, no better name...
18253 2001-12-29 Akim Demaille <akim@epita.fr>
18255 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
18256 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
18257 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
18260 2001-12-29 Akim Demaille <akim@epita.fr>
18262 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
18265 2001-12-29 Akim Demaille <akim@epita.fr>
18267 * src/reader.c, src/reader.h (user_toknums): Remove.
18268 Adjust all users to use symbols[i]->user_token_number.
18270 2001-12-29 Akim Demaille <akim@epita.fr>
18272 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
18273 Adjust all users to use symbols[i]->prec or ->assoc.
18275 2001-12-29 Akim Demaille <akim@epita.fr>
18277 * src/reader.c, src/reader.h (tags): Remove.
18278 Adjust all users to use symbols[i]->tag.
18280 2001-12-29 Akim Demaille <akim@epita.fr>
18282 * src/gram.h, src/gram.c (symbols): New, similar to state_table
18284 * src/reader.c (packsymbols): Fill this table.
18286 * src/conflicts.c (resolve_sr_conflict): Adjust.
18287 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
18289 Use symbols[i]->tag instead of tags[i].
18291 2001-12-29 Akim Demaille <akim@epita.fr>
18293 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
18294 In addition, put a comment in there, to replace...
18295 * tests/regression.at (%union and C comments): Remove.
18297 2001-12-29 Akim Demaille <akim@epita.fr>
18299 * tests/regression.at (Web2c Actions): Blindly move the actual
18300 output as expected output. The contents *seem* right to me, but I
18301 can't pretend reading perfectly parser tables... Nonetheless, all
18302 the other tests pass correctly, the table look OK, even though the
18303 presence of `$axiom' is to be noted: AFAICS it is useless (but
18306 2001-12-29 Akim Demaille <akim@epita.fr>
18308 * src/reader.c (readgram): Don't add the rule 0 if there were no
18309 rules read. In other words, add it _after_ having performed
18310 grammar sanity checks.
18311 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
18313 2001-12-29 Akim Demaille <akim@epita.fr>
18315 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
18316 visible, and some states have now a different number.
18318 2001-12-29 Akim Demaille <akim@epita.fr>
18320 * src/reader.c (readgram): Bind the initial rule's lineno to that
18322 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
18323 (Solved SR Conflicts): Adjust rule 0's line number.
18325 2001-12-29 Akim Demaille <akim@epita.fr>
18327 Fix the `GAWK Grammar' failure.
18329 * src/LR0.c (final_state): Initialize to -1 so that we do compute
18330 the reductions of the first state which was mistakenly confused
18331 with the final state because precisely final_state was initialized
18333 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
18334 now noticed by Bison.
18335 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
18336 have a reduction on $default.
18338 2001-12-29 Akim Demaille <akim@epita.fr>
18340 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
18342 * src/closure.c (print_closure): Likewise.
18343 * src/derives.c (print_derives): Likewise.
18344 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
18347 2001-12-29 Akim Demaille <akim@epita.fr>
18349 * src/lalr.c (lookaheads_print): New.
18350 (lalr): Call it when --trace-flag.
18351 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
18354 2001-12-29 Akim Demaille <akim@epita.fr>
18356 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
18357 when walking through ritem, even via rule->rhs.
18358 * src/reduce.c (dump_grammar, useful_production, reduce_output)
18359 (useful_production, useless_nonterminals): Likewise.
18360 (reduce_grammar_tables): Likewise, plus update nritems.
18361 * src/nullable.c (set_nullable): Likewise.
18362 * src/lalr.c (build_relations): Likewise.
18363 * tests/sets.at (Nullable): Adjust.
18364 Fortunately, now, the $axiom is no longer nullable.
18366 2001-12-29 Akim Demaille <akim@epita.fr>
18368 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
18370 * src/gram.c (ritem_longest_rhs): Likewise.
18371 * src/reduce.c (nonterminals_reduce): Likewise.
18372 * src/print_graph.c (print_graph): Likewise.
18373 * src/output.c (output_rule_data): Likewise.
18374 * src/nullable.c (set_nullable): Likewise.
18376 2001-12-29 Akim Demaille <akim@epita.fr>
18378 * src/output.c: Comment changes.
18380 2001-12-27 Paul Eggert <eggert@twinsun.com>
18382 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
18383 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
18384 Sparc, as they were causing more porting problems than the
18385 (minor) performance improvement was worth.
18387 Also, catch up with 1.31's YYSTD.
18389 2001-12-27 Akim Demaille <akim@epita.fr>
18391 * src/output.c (output_gram): Rely on nritems, not the
18392 0-sentinel. See below.
18393 Use -1 as separator, not 0.
18394 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
18395 Rely on -1 as separator in yyrhs, instead of 0.
18396 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
18397 twice `Now at end of input', therefore there are two lines less to
18400 2001-12-27 Akim Demaille <akim@epita.fr>
18402 * tests/regression.at (Unresolved SR Conflicts):
18403 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
18406 2001-12-27 Akim Demaille <akim@epita.fr>
18408 * src/LR0.c (new_state): Recognize the final state by the fact it
18409 is reached by eoftoken.
18410 (insert_start_shifting_state, insert_eof_shifting_state)
18411 (insert_accepting_state, augment_automaton): Remove, since now
18412 these states are automatically computed from the initial state.
18413 (generate_states): Adjust.
18414 * src/print.c: When reporting a rule number to the user, substract
18415 1, so that the axiom rule is rule 0, and the first user rule is 1.
18416 * src/reduce.c: Likewise.
18417 * src/print_graph.c (print_core): For the time being, just as for
18418 the report, depend upon --trace-flags to dump the full set of
18420 * src/reader.c (readgram): Once the grammar read, insert the rule
18421 0: `$axiom: START-SYMBOL $'.
18422 * tests/set.at: Adjust: rule 0 is now displayed, and since the
18423 number of the states has changed (the final state is no longer
18424 necessarily the last), catch up.
18426 2001-12-27 Akim Demaille <akim@epita.fr>
18428 Try to make the use of the eoftoken valid. Given that its value
18429 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
18430 is used instead of > 0 where appropriate, (ii), depend upon nritems
18431 instead of the 0-sentinel.
18433 * src/gram.h, src/gram.c (nritems): New.
18434 Expected to be duplication of nitems, but for the time being...
18435 * src/reader.c (packgram): Assert nritems and nitems are equal.
18436 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
18437 * src/closure.c (print_closure, print_fderives): Likewise.
18438 * src/gram.c (ritem_print): Likewise.
18439 * src/print.c (print_core, print_grammar): Likewise.
18440 * src/print_graph.c: Likewise.
18442 2001-12-27 Akim Demaille <akim@epita.fr>
18444 * src/main.c (main): If there are complains after grammar
18445 reductions, then output the report anyway if requested, then die.
18446 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
18447 * src/reader.c (eoftoken): New.
18448 (parse_token_decl): If the token being defined has value `0', it
18450 (packsymbols): No longer hack `tags' to insert `$' by hand.
18451 Be sure to preserve the value of the eoftoken.
18452 (reader): Make sure eoftoken is defined.
18453 Initialize nsyms to 0: now eoftoken is created just like the others.
18454 * src/print.c (print_grammar): Don't special case the eof token.
18455 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
18456 lie anyway, albeit pleasant.
18457 * tests/calc.at: Exercise error messages with eoftoken.
18458 Change the grammar so that empty input is invalid.
18459 Adjust expectations.
18460 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
18462 2001-12-27 Akim Demaille <akim@epita.fr>
18464 * configure.in: Check the protos of strchr ans strspn.
18465 Replace strchr if needed.
18466 * src/system.h: Provide the protos of strchr, strspn and memchr if
18468 * lib/strchr.c: New.
18469 * src/reader.c (symbols_save): Use strchr.
18471 2001-12-27 Akim Demaille <akim@epita.fr>
18473 * src/print.c, src/print_graph.c (escape): New.
18474 Use it to quote the TAGS outputs.
18475 * src/print_graph.c (print_state): Now errors are in red, and
18476 reductions in green.
18477 Prefer high to wide: output the state number on a line of its own.
18479 2001-12-27 Akim Demaille <akim@epita.fr>
18481 * src/state.h, src/state.c (reductions_new): New.
18482 * src/LR0.c (set_state_table): Let all the states have a
18483 `reductions', even if reduced to 0.
18484 (save_reductions): Adjust.
18485 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
18486 * src/print.c (print_reductions, print_actions): Adjust.
18487 * src/output.c (action_row): Adjust.
18489 2001-12-27 Akim Demaille <akim@epita.fr>
18491 * src/state.h, src/state.c (errs_new, errs_dup): New.
18492 * src/LR0.c (set_state_table): Let all the states have an errs,
18493 even if reduced to 0.
18494 * src/print.c (print_errs, print_reductions): Adjust.
18495 * src/output.c (output_actions, action_row): Adjust.
18496 * src/conflicts.c (resolve_sr_conflict): Adjust.
18498 2001-12-27 Akim Demaille <akim@epita.fr>
18500 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
18502 2001-12-27 Akim Demaille <akim@epita.fr>
18504 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
18505 * src/print.c: here.
18506 (lookaheadset, shiftset): New, used as additional storage by
18508 (print_results): Adjust.
18509 (print_shifts, print_gotos, print_errs): New, extracted from...
18510 (print_actions): here.
18511 * src/print_graph.c (print_actions): Remove dead code.
18513 2001-12-27 Akim Demaille <akim@epita.fr>
18515 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
18518 2001-12-27 Akim Demaille <akim@epita.fr>
18520 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
18521 (build_relations): Adjust.
18523 2001-12-27 Akim Demaille <akim@epita.fr>
18525 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
18528 2001-12-27 Akim Demaille <akim@epita.fr>
18530 * src/reader.c (packgram): Catch nitems overflows.
18532 2001-12-27 Akim Demaille <akim@epita.fr>
18534 * src/files.c, src/files.h (guard_obstack): Remove.
18535 * src/output.c (output): Adjust.
18536 * src/reader.c (parse_braces): New, factoring...
18537 (copy_action, copy_guard): these two which are renamed as...
18538 (parse_action, parse_guard): these.
18539 As a voluntary consequence, using braces around guards is now
18542 2001-12-27 Akim Demaille <akim@epita.fr>
18544 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
18545 * src/reader.c (symbol_list): `guard' and `guard_line' are new
18547 (symbol_list_new): Adjust.
18548 (copy_action): action_line is the first line, not the last.
18549 (copy_guard): Just as for actions, store the `action' only, not
18550 the switch/case/break flesh.
18551 Don't parse the user action that might follow the guard, let...
18552 (readgram): do it, i.e., now, there can be an action after a
18554 In other words the guard is just explicitly optional.
18555 (packgram): Adjust.
18556 * src/output.c (guards_output): New.
18557 (output_parser): Call it when needed.
18558 (output): Also free the guard and attrs obstacks.
18559 * src/files.c, src/files.h (obstack_save): Remove.
18560 (output_files): Remove.
18561 As a result, if one needs the former `.act' file, using an
18562 appropriate skeleton which requires actions and guards is now
18564 * src/main.c (main): Adjust.
18565 * tests/semantic.at: New.
18566 * tests/regression.at: Use `input.y' as input file name.
18567 Avoid 8+3 problems by requiring input.c when the test needs the
18570 2001-12-27 Akim Demaille <akim@epita.fr>
18572 * src/reader.c (symbol_list_new): Be sure to initialize all the
18575 2001-12-27 Akim Demaille <akim@epita.fr>
18577 All the hacks using a final pseudo state are now useless.
18579 * src/LR0.c (set_state_table): state_table holds exactly nstates.
18580 * src/lalr.c (nLA): New.
18581 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
18582 instead of lookaheadsp from the pseudo state (nstate + 1).
18584 2001-12-27 Akim Demaille <akim@epita.fr>
18586 * src/output.c (action_row, token_actions): Use a state_t instead
18587 of a integer, and nlookaheads instead of the following state's
18590 2001-12-27 Akim Demaille <akim@epita.fr>
18592 * src/conflicts.c (log_resolution, flush_shift)
18593 (resolve_sr_conflict, set_conflicts, solve_conflicts)
18594 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
18595 (conflicts_print, print_reductions): Use a state_t instead of an
18596 integer when referring to a state.
18597 As much as possible, depend upon nlookaheads, instead of the
18598 `lookaheadsp' member of the following state (since lookaheads of
18599 successive states are successive, the difference between state n + 1
18600 and n served as the number of lookaheads for state n).
18601 * src/lalr.c (add_lookback_edge): Likewise.
18602 * src/print.c (print_core, print_actions, print_state)
18603 (print_results): Likewise.
18604 * src/print_graph.c (print_core, print_actions, print_state)
18605 (print_graph): Likewise.
18606 * src/conflicts.h: Adjust.
18608 2001-12-27 Akim Demaille <akim@epita.fr>
18610 * src/bison.hairy: Formatting/comment changes.
18612 Remove `register' indications.
18613 Add plenty of `static'.
18615 2001-12-27 Akim Demaille <akim@epita.fr>
18617 * src/output.c (prepare): Drop the muscle `ntbase' which
18618 duplicates ntokens.
18619 * src/bison.simple: Formatting/comment changes.
18620 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
18621 is an undocumented synonym.
18623 2001-12-22 Akim Demaille <akim@epita.fr>
18625 * src/output.c (output_table_data): Change the prototype to use
18626 `int' for array ranges: some invocations do pass an int, not a
18628 Reported by Wayne Green.
18630 2001-12-22 Akim Demaille <akim@epita.fr>
18632 Some actions of web2c.y are improperly triggered.
18633 Reported by Mike Castle.
18635 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
18636 * tests/regression.at (Web2c): Rename as...
18637 (Web2c Report): this.
18638 (Web2c Actions): New.
18640 2001-12-22 Akim Demaille <akim@epita.fr>
18642 Reductions in web2c.y are improperly reported.
18643 Reported by Mike Castle.
18645 * src/conflicts.c (print_reductions): Fix.
18646 * tests/regression.at (Web2c): New.
18648 2001-12-18 Akim Demaille <akim@epita.fr>
18650 Some host fail on `assert (!"foo")', which expands to
18651 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
18652 Reported by Nelson Beebee.
18654 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
18655 `#define it_succeeded 0' and `assert (it_succeeded)'.
18657 2001-12-17 Marc Autret <autret_m@epita.fr>
18659 * src/bison.simple: Don't hard code the skeleton line and filename.
18660 * src/output.c (output_parser): Rename 'line' as 'output_line'.
18661 New line counter 'skeleton_line' (skeleton-line muscle).
18663 2001-12-17 Paul Eggert <eggert@twinsun.com>
18665 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
18666 YYDEBUG must be defined to a nonzero value.
18668 * src/bison.simple (yytname): Do not assume that the user defines
18669 YYDEBUG to a properly parenthesized expression.
18671 2001-12-17 Akim Demaille <akim@epita.fr>
18673 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
18674 nlookaheads is a new member.
18676 * src/lalr.h (nlookaheads): Remove this orphan declaration.
18677 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
18680 2001-12-17 Akim Demaille <akim@epita.fr>
18682 * src/files.h, src/files.c (open_files, close_files): Remove.
18683 * src/main.c (main): Don't open/close files, nor invoke lex_free,
18685 * src/reader.c (reader): Do it.
18687 2001-12-17 Akim Demaille <akim@epita.fr>
18689 * src/conflicts.c (print_reductions): Formatting changes.
18691 2001-12-17 Akim Demaille <akim@epita.fr>
18693 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
18694 (flush_reduce): New.
18695 (resolve_sr_conflict): Adjust.
18697 2001-12-17 Akim Demaille <akim@epita.fr>
18699 * src/output.c (output_obstack): Be static and rename as...
18700 (format_obstack): this, to avoid any confusion with files.c's
18702 * src/reader.h (muscle_obstack): Move to...
18703 * src/output.h: here, since it's defined in output.c.
18705 2001-12-17 Akim Demaille <akim@epita.fr>
18707 * src/output.c (action_row, save_column, default_goto)
18708 (sort_actions, matching_state, pack_vector): Better variable
18711 2001-12-17 Akim Demaille <akim@epita.fr>
18713 * src/output.c: Various formatting changes.
18715 2001-12-17 Akim Demaille <akim@epita.fr>
18717 * src/files.c (output_files): Free the output_obstack.
18718 * src/main.c (main): Call print and print_graph conditionally.
18719 * src/print.c (print): Work unconditionally.
18720 * src/print_graph.c (print_graph): Work unconditionally.
18721 * src/conflicts.c (log_resolution): Output only if verbose_flag.
18723 2001-12-16 Marc Autret <autret_m@epita.fr>
18725 * src/output.c (actions_output): Fix. When we use %no-lines,
18726 there is one less line per action.
18728 2001-12-16 Marc Autret <autret_m@epita.fr>
18730 * src/bison.simple: Remove a useless #line directive.
18731 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
18732 * src/output.c (get_lines_number): New.
18733 (output_parser): Adjust, now takes care about the lines of a
18735 Fix line numbering.
18736 (actions_output): Computes the number of lines taken by actions.
18737 (output_master_parser): Insert new skeleton which is the name of
18738 the output parser file name.
18740 2001-12-15 Marc Autret <autret_m@epita.fr>
18742 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
18744 2001-12-15 Marc Autret <autret_m@epita.fr>
18746 * src/output.c (output_gram): Keep track of the hairy one.
18748 2001-12-15 Akim Demaille <akim@epita.fr>
18750 Make `make distcheck' work.
18752 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
18753 system.h which uses libgettext.h.
18755 2001-12-15 Akim Demaille <akim@epita.fr>
18757 * src/nullable.c (set_nullable): Useless rules must be skipped,
18758 otherwise, since we range over their symbols, we might look at a
18759 nonterminal which no longer ``exists'', i.e., it is not counted in
18760 `nvars', hence we overflow our arrays.
18762 2001-12-15 Akim Demaille <akim@epita.fr>
18764 The header can also be produced directly, without any obstack!
18767 * src/files.c, src/files.h (defines_obstack): Remove.
18768 (compute_header_macro): Global.
18769 (defines_obstack_save): Remove.
18770 * src/reader.c (parse_union_decl): No longer output to
18771 defines_obstack: its content can be found in the `stype' muscle
18773 (output_token_translations): Merge into...
18774 (symbols_output): this.
18776 (symbols_save): this.
18778 * src/output.c (header_output): New.
18781 2001-12-15 Akim Demaille <akim@epita.fr>
18783 * src/reader.c (parse_union_decl): Instead of handling two obstack
18784 simultaneously, use one to define the `stype' muscle, and use the
18785 value of the latter to fill defines_obstack.
18786 (copy_comment): Remove.
18787 (copy_comment2): Work for a single obstack.
18789 (copy_comment): this.
18791 2001-12-15 Akim Demaille <akim@epita.fr>
18793 * src/lex.c, src/lex.h (xgetc): No longer static.
18794 * src/reader.c (parse_union_decl): Revamp.
18796 2001-12-15 Akim Demaille <akim@epita.fr>
18798 Still making progress in separating Bison into (i) input, (ii)
18799 process, (iii) output: now we can directly output the parser file
18800 without using table_obstack at all.
18802 * src/files.c, src/files.h (table_obstack): Bye bye.
18803 (parser_file_name): New.
18804 * src/files.c (compute_output_file_names): Compute it.
18805 * src/output.c (actions_output, output_parser)
18806 (output_master_parser): To a file instead of an obstack.
18808 2001-12-15 Akim Demaille <akim@epita.fr>
18810 Attach actions to rules, instead of pre-outputting them to
18813 * src/gram.h (rule_t): action and action_line are new members.
18814 * src/reader.c (symbol_list): Likewise.
18815 (copy_action): Save the actions within the rule.
18816 (packgram): Save them in rule_table.
18817 * src/output.c (actions_output): New.
18818 (output_parser): Use it on `%%actions'.
18819 (output_rule_data): Don't free rule_table.
18821 (prepare): Don't save the `action' muscle.
18822 * src/bison.simple: s/%%action/%%actions/.
18824 2001-12-15 Akim Demaille <akim@epita.fr>
18826 * src/reader.c (copy_action): When --yacc, don't append a `;'
18827 to the user action: let it fail if lacking.
18828 Suggested by Arnold Robbins and Tom Tromey.
18830 2001-12-14 Akim Demaille <akim@epita.fr>
18832 * src/lex.c (literalchar): Simply return the char you decoded, non
18833 longer mess around with obstacks and int pointers.
18834 Adjust all callers.
18836 2001-12-14 Akim Demaille <akim@epita.fr>
18838 * src/lex.c (literalchar): Don't escape the special characters,
18839 just decode them, and keep them as char (before, eol was output as
18840 the 2 char string `\n' etc.).
18841 * src/output.c (output_rule_data): Use quotearg to output the
18844 2001-12-13 Paul Eggert <eggert@twinsun.com>
18846 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
18847 Do not infringe on the global user namespace when using C++.
18848 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
18849 All uses of `fprintf' and `stderr' changed.
18851 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
18853 2001-12-13 Akim Demaille <akim@epita.fr>
18855 The computation of nullable is broken: it doesn't handle empty
18858 * tests/torture.at (GNU AWK Grammar): New.
18859 * tests/sets.at (Nullable): New.
18860 * src/nullable.c (set_nullable): Instead of blindly looping over
18861 `ritems', loop over the rules, and then over their rhs's.
18863 Work around Autotest bugs.
18865 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
18866 frame, because Autotest understand lines starting with a `+' as
18867 traces from the shell. Then, they are not processed properly.
18868 Admittedly an Autotest bug, but we don't have time to wait for
18869 Autotest to catch up.
18870 * tests/regression.at (Broken Closure): Adjust to the new table
18873 * tests/sets.at: here.
18875 2001-12-13 Akim Demaille <akim@epita.fr>
18877 * src/closure.c (closure): Use nrules instead of playing tricks
18878 with BITS_PER_WORD.
18880 2001-12-13 Akim Demaille <akim@epita.fr>
18882 * src/print.c (print_actions): Output the handling of `$' as the
18883 traces do: shifting the token EOF. Before EOF was treated as a
18885 * tests/regression.at: Adjust some tests.
18886 * src/print_graph.c (print_core): Complete the set of items via
18887 closure. The next-to-final and final states are still unsatisfying,
18888 but that's to be addressed elsewhere.
18889 No longer output the rule numbers, but do output the state number.
18890 A single loop for the shifts + gotos is enough, but picked a
18891 distinct color for each.
18892 (print_graph): Initialize and finalize closure.
18894 2001-12-13 Akim Demaille <akim@epita.fr>
18896 * src/reader.c (readgram): Remove dead code, an strip useless
18898 (get_type): Remove, unused.
18900 2001-12-12 Akim Demaille <akim@epita.fr>
18902 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
18903 on that of lib/error.c.
18905 2001-12-12 Akim Demaille <akim@epita.fr>
18907 Some hosts don't like `/' in includes.
18909 * src/system.h: Include libgettext.h without qualifying the path.
18910 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
18913 2001-12-11 Marc Autret <autret_m@epita.fr>
18915 * src/output.c (output_parser): Remove useless muscle.
18917 2001-12-11 Marc Autret <autret_m@epita.fr>
18919 * src/bison.simple: Remove #line just before %%epilogue. It
18920 is now handled in ...
18921 * src/reader.c (read_additionnal_code): Add the output of a
18922 #line for the epilogue.
18924 2001-12-10 Marc Autret <autret_m@epita.fr>
18926 * src/reader.c (copy_definition): Re-use CPP-outed code which
18927 replace precedent remove.
18928 * src/bison.simple: Remove #line before %%prologue because
18929 %%input-line is wrong at this time.
18931 2001-12-10 Marc Autret <autret_m@epita.fr>
18933 * src/reader.c (symbols_output): Clean up.
18934 * src/output.c (output_gram, output): Clean up.
18936 2001-12-10 Akim Demaille <akim@epita.fr>
18938 * src/lalr.c (initialize_lookaheads): New. Extracted from...
18939 * src/LR0.c (set_state_table): here.
18940 * src/lalr.c (lalr): Call it.
18942 2001-12-10 Akim Demaille <akim@epita.fr>
18944 * src/state.h (shifts): Remove the `number' member: shifts are
18945 attached to state, hence no longer need to be labelled with a
18948 2001-12-10 Akim Demaille <akim@epita.fr>
18950 Now that states have a complete set of members, the linked list of
18951 shifts is useless: just fill directly the state's shifts member.
18953 * src/state.h (shifts): Remove the `next' member.
18954 * src/LR0.c (first_state, last_state): Remove.
18955 Adjust the callers.
18956 (augment_automaton): Don't look for the shifts that must be added
18957 a shift on EOF: it is those of the state we looked for! But now,
18958 since shifts are attached, it is no longer needed to looking
18959 merely by its id: its number.
18961 2001-12-10 Akim Demaille <akim@epita.fr>
18963 * src/LR0.c (augment_automaton): Better variable locality.
18964 Remove an impossible branch: if there is a state corresponding to
18965 the start symbol being shifted, then there is shift for the start
18966 symbol from the initial state.
18968 2001-12-10 Akim Demaille <akim@epita.fr>
18970 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
18971 only when appropriate: when insert_start_shifting_state' is not
18973 * tests/regression.at (Rule Line Numbers): Adjust.
18975 2001-12-10 Akim Demaille <akim@epita.fr>
18977 * src/LR0.c (augment_automaton): Now that all states have shifts,
18978 merge the two cases addition shifts to the initial state.
18980 2001-12-10 Akim Demaille <akim@epita.fr>
18982 * src/lalr.c (set_state_table): Move to...
18984 * src/lalr.c (lalr): Don't call it...
18985 * src/LR0.c (generate_states): do it.
18986 * src/LR0.h (first_state): Remove, only the table is used.
18988 2001-12-10 Akim Demaille <akim@epita.fr>
18990 * src/LR0.h (first_shift, first_reduction): Remove.
18991 * src/lalr.c: Don't use first_shift: find shifts through the
18994 2001-12-10 Akim Demaille <akim@epita.fr>
18996 * src/LR0.c: Attach shifts to states as soon as they are
18998 * src/lalr.c (set_state_table): Instead of assigning shifts to
18999 state, just assert that the mapping was properly done.
19001 2001-12-10 Akim Demaille <akim@epita.fr>
19003 * src/LR0.c (insert_start_shift): Rename as...
19004 (insert_start_shifting_state): this.
19005 (insert_eof_shifting_state, insert_accepting_state): New.
19006 (augment_automaton): Adjust.
19007 Better locality of the variables.
19008 When looking if the start_symbol is shifted from the initial
19009 state, using `while (... symbol != start_symbol ...)' sounds
19010 better than `while (... symbol < start_symbol ...)': If fail
19011 to see how the order between symbols could be relevant!
19013 2001-12-10 Akim Demaille <akim@epita.fr>
19015 * src/getargs.h: Don't declare `spec_name_prefix' and
19016 `spec_file_prefix', declared by src/files.h.
19017 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
19018 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
19019 * src/output.c (prepare): Adjust.
19020 * src/reader.c (symbols_output): Likewise.
19021 * src/vmsgetargs.c: Vaguely adjust, but who cares?
19023 2001-12-10 Akim Demaille <akim@epita.fr>
19025 * src/muscle_tab.c (muscle_init): NULL is a better default than
19028 2001-12-10 Akim Demaille <akim@epita.fr>
19030 * src/reader.c (reader): Calling symbols_output once is enough.
19032 2001-12-10 Akim Demaille <akim@epita.fr>
19034 Now that states have a complete set of members, the linked list of
19035 reductions is useless: just fill directly the state's reductions
19038 * src/state.h (struct reductions): Remove member `number' and
19040 * src/LR0.c (first_reduction, last_reduction): Remove.
19041 (save_reductions): Don't link the new reductions, store them in
19043 * src/lalr.c (set_state_table): No need to attach reductions to
19044 states, it's already done.
19045 * src/output.c (output_actions): No longer free the shifts, then
19046 the reductions, then the states: free all the states and their
19049 2001-12-10 Akim Demaille <akim@epita.fr>
19051 * src/options.c (OPTN, DRTV, BOTH): New.
19052 (option_table): Use them.
19054 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
19055 the job of system.h.
19056 * src/options.c: Don't include stdio.h and xalloc.h for the same
19059 2001-12-10 Akim Demaille <akim@epita.fr>
19061 * src/output.c (output, prepare): Make sure the values of the
19062 muscles `action' and `prologue' are 0-terminated.
19064 2001-12-10 Akim Demaille <akim@epita.fr>
19066 Clean up GCC warnings.
19068 * src/reader.c (copy_action): `buf' is not used.
19069 (parse_skel_decl): Be static.
19070 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
19071 * src/options.h (create_long_option_table): Have a real prototype.
19072 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
19073 (hash_delete_at): Return const void *.
19074 Adjust casts to preserve the const.
19076 2001-12-10 Akim Demaille <akim@epita.fr>
19078 * configure.in: Require 2.52g.
19079 M4 is not needed, but AUTOM4TE is.
19080 * m4/m4.m4: Remove.
19081 * tests/Makefile.am: Adjust.
19083 2001-12-10 Akim Demaille <akim@epita.fr>
19085 One structure for states is enough, even though theoretically
19086 there are LR(0) states and LALR(1) states.
19088 * src/lalr.h (state_t): Remove.
19089 (state_table): Be state_t **, not state_t *.
19090 * src/state.h (core, CORE_ALLOC): Rename as...
19091 (state_t, STATE_ALLOC): this.
19092 Add the LALR(1) members: shifts, reductions, errs.
19093 * src/LR0.c (state_table): Rename as...
19094 (state_hash): this, to avoid name clashes with the global
19096 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
19097 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
19099 2001-12-10 Akim Demaille <akim@epita.fr>
19101 Bison dumps core on bash.y.
19102 Reported by Pascal Bart.
19104 * src/warshall.c (bitmatrix_print): New.
19106 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
19107 j must be the outer loop.
19108 * tests/regression.at (Broken Closure): New.
19110 2001-12-05 Akim Demaille <akim@epita.fr>
19112 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
19114 Reported by Peter Hamorsky.
19116 2001-12-05 Akim Demaille <akim@epita.fr>
19118 * src/conflicts.c (err_table): Remove.
19119 (resolve_sr_conflict): Adjust.
19120 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
19122 (state_t.reductions, state_t.shifts): this.
19124 2001-12-05 Akim Demaille <akim@epita.fr>
19126 * src/reduce.c (reduce_grammar_tables): No longer disable the
19127 removal of useless rules via CPP but via `if (0)', so that the
19128 compiler still check the code is valid.
19129 For instance, it should have noticed `rline' no longer exists: use
19130 the `line' member of rule_t.
19131 * src/gram.c (dummy, rline): Remove, unused.
19133 2001-12-05 Akim Demaille <akim@epita.fr>
19135 * src/output.c (pack_vector): Use assert, not berror.
19136 * src/main.c (berror): Remove, unused.
19138 2001-12-05 Akim Demaille <akim@epita.fr>
19140 New experimental feature: if --verbose --trace output all the
19141 items of a state, not only its kernel.
19143 * src/print.c (print_core): If `trace_flag', then invoke closure
19144 before outputting the items of the state (print_core is no longer
19145 a correct name them).
19146 (print_results): Invoke new_closure/free_closure if needed.
19148 2001-12-05 Akim Demaille <akim@epita.fr>
19150 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
19151 * src/closure.c, src/closure.h (itemsetsize): Rename as...
19152 (nitemset): for consistency with the rest of the project.
19154 2001-12-05 Akim Demaille <akim@epita.fr>
19156 * src/closure.c (print_closure): Improve.
19157 (closure): Use it for printing input and output.
19159 2001-12-05 Akim Demaille <akim@epita.fr>
19161 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
19162 indexed by nonterminals.
19164 2001-12-05 Akim Demaille <akim@epita.fr>
19166 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
19168 * src/warshall.h: Remove accidental duplication of the content.
19170 2001-12-05 Akim Demaille <akim@epita.fr>
19172 * src/closure.c (set_fderives): De-obfuscate.
19174 2001-12-05 Akim Demaille <akim@epita.fr>
19176 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
19178 2001-12-05 Akim Demaille <akim@epita.fr>
19180 * src/closure.c (set_firsts): De-obfuscate.
19182 2001-12-05 Akim Demaille <akim@epita.fr>
19184 * src/output.c (action_row): De-obfuscate
19185 using the good o' techniques: arrays not pointers, variable
19186 locality, BITISSET, RESETBIT etc.
19188 2001-12-05 Akim Demaille <akim@epita.fr>
19190 Pessimize the code to simplify it: from now on, all the states
19191 have a valid SHIFTS, which NSHIFTS is possibly 0.
19193 * src/LR0.c (shifts_new): Be global and move to..
19194 * src/state.c, src/state.h: here.
19195 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
19196 * src/print_graph: Adjust.
19198 2001-12-05 Akim Demaille <akim@epita.fr>
19200 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
19201 * src/conflicts.c: Use it.
19202 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
19203 incorrectly ``simplified''.
19205 2001-12-05 Akim Demaille <akim@epita.fr>
19207 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
19208 using the good o' techniques: arrays not pointers, variable
19209 locality, BITISSET, RESETBIT etc.
19211 2001-12-05 Akim Demaille <akim@epita.fr>
19213 * src/state.h (SHIFT_SYMBOL): New.
19214 * src/conflicts.c: Use it to deobfuscate.
19216 2001-12-05 Akim Demaille <akim@epita.fr>
19218 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
19219 (print_reductions): De-obfuscate using the good o' techniques:
19220 arrays not pointers, variable locality, BITISSET.
19222 2001-12-05 Akim Demaille <akim@epita.fr>
19224 * src/conflicts.c (print_reductions): Arrays, not pointers.
19227 2001-12-05 Akim Demaille <akim@epita.fr>
19229 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19231 2001-12-05 Akim Demaille <akim@epita.fr>
19233 * src/conflicts.c (print_reductions): Improve variable locality.
19235 2001-12-05 Akim Demaille <akim@epita.fr>
19237 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19239 2001-12-05 Akim Demaille <akim@epita.fr>
19241 * src/conflicts.c (print_reductions): Improve variable locality.
19243 2001-12-05 Akim Demaille <akim@epita.fr>
19245 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
19246 * src/lalr.c: Use them.
19248 2001-12-05 Akim Demaille <akim@epita.fr>
19250 * src/LR0.c (augment_automaton): Formatting changes.
19251 Better variable locality.
19253 2001-12-05 Akim Demaille <akim@epita.fr>
19255 * src/lalr.c (matrix_print): New.
19256 (transpose): Use it.
19257 Use arrays instead of pointers.
19259 2001-12-05 Akim Demaille <akim@epita.fr>
19261 * src/lalr.c (maxrhs): Move to...
19262 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
19263 * src/lalr.c (build_relations): Adjust.
19265 2001-12-05 Akim Demaille <akim@epita.fr>
19267 * src/lalr.c (transpose): Free the memory allocated to the
19268 argument, as it is replaced by the results by the unique caller.
19269 (build_relations): Merely invoke transpose: it handles the memory
19271 Improve variable locality.
19272 Avoid variables used as mere abbreviations.
19273 (compute_lookaheads): Use arrays instead of pointers.
19275 2001-12-05 Akim Demaille <akim@epita.fr>
19277 * src/lalr.c (initialize_F): Improve variable locality.
19278 Avoid variables used as mere abbreviations.
19280 2001-12-05 Akim Demaille <akim@epita.fr>
19282 * src/derives.c (print_derives): Display the ruleno.
19283 * src/lalr.c (initialize_F, transpose): Better variable locality
19284 to improve readability.
19285 Avoid variables used as mere abbreviations.
19287 2001-12-05 Akim Demaille <akim@epita.fr>
19289 * src/lalr.c (traverse): Use arrays instead of pointers.
19291 2001-12-05 Akim Demaille <akim@epita.fr>
19293 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
19294 the handling of squeue.
19295 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
19297 2001-12-05 Akim Demaille <akim@epita.fr>
19299 Because useless nonterminals are now kept alive (instead of being
19300 `destroyed'), we now sometimes examine them, and store information
19301 related to them. Hence we need to know their number, and adjust
19302 memory allocations.
19304 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
19306 * src/LR0.c (allocate_itemsets): The memory allocated to
19307 `symbol_count' was used for two different purpose: once to count
19308 the number of occurrences of each symbol, and later reassigned to
19309 `shift_symbol', containing the symbol that can be shifted from a
19311 Deobfuscate, i.e., allocate, use and free `symbol_count' here
19313 (new_itemsets): Allocate `shift_symbol' here.
19314 (allocate_itemsets): symbol_count includes useless nonterminals.
19315 Make room for them.
19316 (free_storage): Use `free', not `XFREE', for pointers that cannot
19319 2001-12-05 Akim Demaille <akim@epita.fr>
19321 * src/nullable.c (set_nullable): Deobfuscate the handling of
19323 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
19325 2001-12-05 Akim Demaille <akim@epita.fr>
19327 * src/gram.c, src/gram.h (ritem_print): New.
19328 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
19329 (This useless function was defined only to work around VMS linkers
19330 that can't handle compilation units with variables only).
19331 * src/reduce.c (dump_grammar): Use it to trace the construction of
19334 2001-12-04 Paul Eggert <eggert@twinsun.com>
19336 * src/bison.simple (union yyalloc): Change member names
19337 to be the same as the stack names.
19338 (yyparse): yyptr is now union yyalloc *, not char *.
19339 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
19340 and may generate better code on some machines.
19341 (yystpcpy): Use prototype if __STDC__ is defined, not just
19342 if __cplusplus is defined.
19344 2001-11-30 Akim Demaille <akim@epita.fr>
19346 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
19347 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
19348 Gettext doesn't compile cleanly, and dies with -Werror.
19349 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
19350 Include WARNING_CFLAGS here.
19351 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
19352 before being defined.
19354 2001-11-27 Paul Eggert <eggert@twinsun.com>
19356 * lib/quotearg.h (quotearg_n, quotearg_n_style):
19357 First arg is int, not unsigned.
19358 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
19359 (SIZE_MAX, UINT_MAX): New macros.
19360 (quotearg_n_options): Abort if N is negative.
19361 Avoid overflow check on hosts where size_t is 64 bits and int
19362 is 32 bits, as overflow is impossible there.
19363 Fix off-by-one typo that caused unnecessary reallocation.
19365 2001-11-29 Paul Eggert <eggert@twinsun.com>
19367 Name space cleanup in generated parser.
19369 * doc/bison.texinfo (Bison Parser): Discuss system headers
19370 and their effect on the user name space.
19372 * src/bison.simple:
19373 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
19374 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
19375 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
19377 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
19378 on user names when possible.
19380 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
19381 Simplify test for whather <alloca.h> exists.
19383 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
19385 (<stdio.h>): Include if YYDEBUG.
19387 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
19388 ! defined (yyoverflow) && ! defined (yymemcpy).
19390 (yymemcpy, yyparse): Rename local variables as needed so that
19391 they all begin with 'yy'.
19393 (yystrlen, yystpcpy): New functions.
19395 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
19398 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
19399 instead of relying on string.h functions. Use YYSTACK_ALLOC
19400 and YYSTACK_FREE instead of malloc and free.
19402 2001-11-30 Akim Demaille <akim@epita.fr>
19404 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
19405 before their first uses.
19406 (YYBISON, YYPURE): Move to the top of the output.
19408 2001-11-30 Akim Demaille <akim@epita.fr>
19410 * tests/reduce.at (Useless Nonterminals): Fix.
19412 2001-11-30 Akim Demaille <akim@epita.fr>
19414 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
19415 if body instead of `;' to pacify GCC's warnings.
19417 2001-11-30 Akim Demaille <akim@epita.fr>
19419 Instead of mapping the LHS of unused rules to -1, keep the LHS
19420 valid, but flag the rules as invalid.
19422 * src/gram.h (rule_t): `useful' is a new member.
19423 * src/print.c (print_grammar): Adjust.
19424 * src/derives.c (set_derives): Likewise.
19425 * src/reader.c (packgram, reduce_output): Likewise.
19426 * src/reduce.c (reduce_grammar_tables): Likewise.
19427 * tests/reduce.at (Underivable Rules, Useless Rules): New.
19429 2001-11-30 Akim Demaille <akim@epita.fr>
19431 * src/reduce.c (reduce_output): Formatting changes.
19432 * src/print.c (print_results, print_grammar): Likewise.
19433 * tests/regression.at (Rule Line Numbers)
19434 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
19436 2001-11-30 Akim Demaille <akim@epita.fr>
19438 * src/reduce.c (nonterminals_reduce): Instead of throwing away
19439 useless nonterminals, move them at the end of the symbol arrays.
19440 (reduce_output): Adjust.
19441 * tests/reduce.at (Useless Nonterminals): Adjust.
19443 2001-11-30 Akim Demaille <akim@epita.fr>
19445 * src/reduce.c: Various comment/formatting changes.
19446 (nonterminals_reduce): New, extracted from...
19447 (reduce_grammar_tables): here.
19448 (reduce_grammar): Call nonterminals_reduce.
19450 2001-11-29 Paul Eggert <eggert@twinsun.com>
19452 * src/bison.simple (YYSTACK_REALLOC): Remove.
19453 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
19454 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
19456 (union yyalloc): New type.
19457 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
19458 an arbitrary restriction on hosts where size_t is wider than int.
19460 (yyparse): Don't dump core if alloca or malloc fails; instead, report
19461 a parser stack overflow. Allocate just one block of memory for all
19462 three stacks, instead of allocating three blocks; this typically is
19463 faster and reduces fragmentation.
19465 Do not limit the number of items in the stack to a value that fits
19466 in 'int', as this is an arbitrary limit on hosts with 64-bit
19467 size_t and 32-bit int.
19469 2001-11-29 Marc Autret <autret_m@epita.fr>
19471 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
19472 of defining YYERROR_VERBOSE.
19473 [AT_DATA]: $4 is now out of C declarations in the prologue.
19475 2001-11-28 Marc Autret <autret_m@epita.fr>
19477 * src/reader.c (parse_dquoted_param): New.
19478 (parse_skel_decl): Use it.
19479 * src/lex.h: Add its prototype.
19480 * src/lex.c (literalchar): Become not static.
19482 2001-11-28 Marc Autret <autret_m@epita.fr>
19484 * src/output.h: And put its extern declaration here.
19485 * src/output.c (error_verbose): Define here.
19486 (prepare): Echo name modification.
19487 * src/getargs.h: Clean its extern declaration.
19488 * src/getargs.c (error_verbose_flag): Remove.
19489 (getargs): Remove case 'e'.
19490 * src/options.c (option_table): 'error-verbose' is now seen as simple
19494 * src/reader.c (read_declarations): Remove case tok_include.
19495 (parse_include_decl): Remove.
19496 * src/lex.h (token_t): Remove tok_include.
19497 * src/options.c (option_table): 'include' is now a simple command line
19500 2001-11-28 Marc Autret <autret_m@epita.fr>
19502 * src/bison.simple: Adjust muscle names.
19503 * src/muscle_tab.c (muscle_init): Also rename the muscles.
19504 * src/output.c (prepare): s/_/-/ for the muscles names.
19505 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
19507 2001-11-28 Marc Autret <autret_m@epita.fr>
19509 * src/bison.simple: Fix debug.
19510 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
19512 2001-11-28 Akim Demaille <akim@epita.fr>
19514 * src/LR0.c (shifts_new): New.
19515 (save_shifts, insert_start_shift, augment_automaton): Use it.
19517 2001-11-28 Akim Demaille <akim@epita.fr>
19519 * src/closure.c (closure): `b' and `ruleno' denote the same value:
19522 2001-11-28 Akim Demaille <akim@epita.fr>
19524 * src/closure.c (closure): Instead of looping over word in array
19525 then bits in words, loop over bits in array.
19527 2001-11-28 Akim Demaille <akim@epita.fr>
19529 * src/closure.c (closure): No longer optimize the special case
19530 where all the bits of `ruleset[r]' are set to 0, to make the code
19533 2001-11-28 Akim Demaille <akim@epita.fr>
19535 * src/closure.c (closure): `r' and `c' are new variables, used to
19536 de-obfuscate accesses to RULESET and CORE.
19538 2001-11-28 Akim Demaille <akim@epita.fr>
19540 * src/reduce.c (reduce_print): Use ngettext.
19541 (dump_grammar): Improve the trace accuracy.
19543 2001-11-28 Akim Demaille <akim@epita.fr>
19545 * src/reduce.c (dump_grammar): Don't translate trace messages.
19547 2001-11-28 Akim Demaille <akim@epita.fr>
19549 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
19550 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
19551 as all tags are free'ed afterwards.
19552 From Enrico Scholz.
19554 2001-11-27 Paul Eggert <eggert@twinsun.com>
19556 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
19557 use alloca when we didn't want to, and vice versa.
19559 2001-11-27 Marc Autret <autret_m@epita.fr>
19561 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
19563 * src/output.c (prepare): Remove its update.
19565 2001-11-27 Marc Autret <autret_m@epita.fr>
19567 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
19568 Use %error-verbose.
19570 2001-11-27 Marc Autret <autret_m@epita.fr>
19572 * src/bison.simple: Remove YYERROR_VERBOSE using.
19573 Use %%error_verbose.
19574 (yyparse): Likewise.
19575 * src/output.c (prepare): Give its final value.
19576 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
19577 * src/getargs.h: Add its extern declaration.
19578 * src/getargs.c (error_verbose_flag): New int.
19579 (getargs): Update to catch new case.
19580 * src/options.c (option_table): 'error-verbose' is a new option.
19581 (shortopts): Update.
19583 2001-11-27 Akim Demaille <akim@epita.fr>
19585 * src/system.h: Use intl/libgettext.h.
19586 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
19588 2001-11-27 Akim Demaille <akim@epita.fr>
19590 * tests/torture.at (Exploding the Stack Size with Malloc):
19591 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
19593 2001-11-27 Akim Demaille <akim@epita.fr>
19595 * src/files.c: Include error.h.
19596 Reported by Hans Aberg.
19598 2001-11-26 Marc Autret <autret_m@epita.fr>
19600 * src/reader.c (parse_include_decl): New, not yet implemented.
19601 (read_declarations): Add case tok_include.
19602 * src/getargs.h (include): Add its extern definition.
19603 * src/getargs.c (include): New const char *.
19604 (getargs): Add case '-I'.
19605 * src/options.c (option_table): Add include as command line and
19607 * src/lex.h (token_t): Add tok_include.
19609 2001-11-26 Akim Demaille <akim@epita.fr>
19611 * src/reader.c (readgram): Make sure rules for mid-rule actions
19612 have a lineno equal to that of their host rule.
19613 Reported by Hans Aberg.
19614 * tests/regression.at (Rule Line Numbers): New.
19616 2001-11-26 Akim Demaille <akim@epita.fr>
19618 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
19621 2001-11-26 Akim Demaille <akim@epita.fr>
19623 * src/complain.c, src/complain.h (error): Remove, provided by
19626 2001-11-26 Akim Demaille <akim@epita.fr>
19628 * src/reader.c (read_declarations): Don't abort on tok_illegal,
19629 issue an error message.
19630 * tests/regression.at (Invalid %directive): New.
19631 Reported by Hans Aberg.
19633 2001-11-26 Akim Demaille <akim@epita.fr>
19635 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
19636 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
19638 2001-11-26 Akim Demaille <akim@epita.fr>
19640 * src/conflicts.c (conflicts_print): Don't complain at all when
19641 there are no reduce/reduce conflicts, and as many shift/reduce
19642 conflicts as expected.
19643 * tests/regression.at (%expect right): Adjust.
19645 2001-11-23 Akim Demaille <akim@epita.fr>
19647 * lib/alloca.c: Update, from fileutils.
19649 2001-11-23 Akim Demaille <akim@epita.fr>
19651 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
19653 2001-11-23 Akim Demaille <akim@epita.fr>
19655 * src/system.h: Include alloca.h.
19656 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
19658 2001-11-23 Akim Demaille <akim@epita.fr>
19660 * src/print_graph.c (print_actions): Remove `rule', unused.
19661 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
19662 pacify GCC's signed < unsigned warnings.
19663 * src/closure.c (itemsetsize): Likewise.
19664 * src/reader.c (symbol_list_new): Static.
19666 2001-11-23 Akim Demaille <akim@epita.fr>
19668 Attaching lineno to buckets is stupid, since only one copy of each
19669 symbol is kept, only the line of the first occurrence is kept too.
19671 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
19672 * src/reader.c (rline_allocated): Remove, unused.
19673 (symbol_list): Have a `line' member.
19674 (symbol_list_new): New.
19675 (readgram): Use it.
19676 * src/print.c (print_grammar): Output the rule line numbers.
19677 * tests/regression.at (Solved SR Conflicts)
19678 (Unresolved SR Conflicts): Adjust.
19679 Reported by Hans Aberg.
19681 2001-11-22 Marc Autret <autret_m@epita.fr>
19683 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
19685 2001-11-22 Marc Autret <autret_m@epita.fr>
19687 * src/muscle_tab.c (muscle_init): Remove initialization of
19689 * src/output.c (output_master_parser): Do it here.
19691 2001-11-20 Akim Demaille <akim@epita.fr>
19694 * configure.in (ALL_LINGUAS): Adjust.
19695 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
19696 longer contains strings to translate.
19698 2001-11-19 Akim Demaille <akim@epita.fr>
19700 * src/conflicts.c (conflicts_print): Add a missing \n.
19702 2001-11-19 Akim Demaille <akim@epita.fr>
19704 * src/nullable.c (nullable_print): New.
19705 (set_nullable): Call it when tracing.
19706 Better locality of variables.
19708 2001-11-19 Akim Demaille <akim@epita.fr>
19710 * src/print.c (print_actions): Better locality of variables.
19712 2001-11-19 Akim Demaille <akim@epita.fr>
19714 * src/derives.c (print_derives): Fix and enrich.
19715 * src/closure.c (print_fderives): Likewise.
19717 2001-11-19 Akim Demaille <akim@epita.fr>
19719 * src/closure.c (itemsetend): Remove, replaced with...
19720 (itemsetsize): new.
19722 2001-11-19 Akim Demaille <akim@epita.fr>
19724 * src/LR0.c (kernel_end): Remove, replaced with...
19725 (kernel_size): new.
19727 2001-11-19 Akim Demaille <akim@epita.fr>
19729 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
19732 2001-11-19 Akim Demaille <akim@epita.fr>
19734 * src/closure.c (closure): Use arrays instead of pointers to clarify.
19736 2001-11-19 Akim Demaille <akim@epita.fr>
19738 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
19740 * src/LR0.c: Likewise.
19741 (allocate_itemsets): Use arrays instead of pointers to clarify.
19743 2001-11-19 Akim Demaille <akim@epita.fr>
19745 * src/getargs.c (statistics_flag): Replace with...
19747 (longopts): Accept --trace instead of --statistics.
19748 * src/getargs.h, src/options.c: Adjust.
19749 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
19750 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
19752 2001-11-19 Akim Demaille <akim@epita.fr>
19754 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
19755 pointers to clarify the code.
19756 (save_reductions, save_shifts): Factor common parts of alternatives.
19758 2001-11-19 Akim Demaille <akim@epita.fr>
19760 * src/LR0.c (new_state, get_state): Complete TRACE code.
19761 * src/closure.c: Include `reader.h' to get `tags', needed by the
19763 Rename the conditional DEBUG as TRACE.
19764 Output consistently TRACEs to stderr, not stdout.
19765 * src/derives.c: Likewise.
19766 * src/reduce.c: (inaccessable_symbols): Using if is better style
19768 Use `#if TRACE' instead of `#if 0' for tracing code.
19770 2001-11-19 Akim Demaille <akim@epita.fr>
19772 * src/system.h (LIST_FREE, shortcpy): New.
19773 * src/LR0.c: Use them.
19774 * src/output.c (free_itemsets, free_reductions, free_shifts):
19775 Remove, replaced by LIST_FREE.
19777 2001-11-19 Akim Demaille <akim@epita.fr>
19779 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
19780 (REDUCTIONS_ALLOC): New.
19781 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
19784 2001-11-19 Akim Demaille <akim@epita.fr>
19786 * src/LR0.c (new_state): Complete trace code.
19787 * src/nullable.c (set_nullable): Don't translate traces.
19789 2001-11-19 Akim Demaille <akim@epita.fr>
19791 * src/print_graph.c (print_core): Better locality of variables.
19792 * src/print.c (print_core): Likewise.
19794 2001-11-19 Akim Demaille <akim@epita.fr>
19796 * src/vcg.c: You do the output, so you are responsible of the
19797 handling of VCG syntax, in particular: use quotearg.
19798 * src/print_graph.c: Don't.
19799 (print_actions): Don't output the actions as part of the nodes,
19800 since that's the job of the edges.
19801 (print_state): Don't output by hand: fill the node description,
19802 and ask for its output.
19804 2001-11-19 Akim Demaille <akim@epita.fr>
19806 * src/bison.simple (yyparse): When verbosely reporting an error,
19807 no longer put additional quotes around token names.
19808 * tests/calc.at: Adjust.
19810 2001-11-19 Akim Demaille <akim@epita.fr>
19812 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
19813 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
19814 * src/output.c: Adjust.
19816 2001-11-19 Akim Demaille <akim@epita.fr>
19818 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
19820 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
19822 2001-11-19 Akim Demaille <akim@epita.fr>
19824 * src/gram.h (rule_t): New.
19826 (rrhs, rlhs): Remove, part of state_t.
19827 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
19828 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
19829 * src/reader.c, src/reduce.c: Adjust.
19831 2001-11-19 Akim Demaille <akim@epita.fr>
19833 * src/reader.c (symbols_output): New, extracted from...
19834 (packsymbols): Here.
19837 2001-11-19 Akim Demaille <akim@epita.fr>
19839 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
19840 (maxrhs): this new function.
19842 2001-11-19 Akim Demaille <akim@epita.fr>
19844 * src/lalr.c (F): New macro to access the variable F.
19847 2001-11-19 Akim Demaille <akim@epita.fr>
19849 * src/lalr.h (LA): New macro to access the variable LA.
19850 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19851 * src/lalr.c: Adjust.
19853 2001-11-19 Akim Demaille <akim@epita.fr>
19855 * src/lalr.c (initialize_LA): Only initialize LA. Let...
19856 (set_state_table): handle the `lookaheads' members.
19858 2001-11-19 Akim Demaille <akim@epita.fr>
19860 * src/lalr.h (lookaheads): Removed array, whose contents is now
19862 (state_t): this structure.
19863 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19866 2001-11-19 Akim Demaille <akim@epita.fr>
19868 * src/lalr.h (consistent): Removed array, whose contents is now
19870 (state_t): this structure.
19871 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19874 2001-11-19 Akim Demaille <akim@epita.fr>
19876 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
19877 contents are now members of...
19878 (state_t): this structure.
19879 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19882 2001-11-19 Akim Demaille <akim@epita.fr>
19884 * src/lalr.h (state_t): New.
19885 (state_table): Be a state_t * instead of a core **.
19886 (accessing_symbol): Remove, part of state_t.
19887 * src/lalr.c: Adjust.
19888 (set_accessing_symbol): Merge into...
19889 (set_state_table): this.
19890 * src/print_graph.c, src/conflicts.c: Adjust.
19892 2001-11-14 Akim Demaille <akim@epita.fr>
19894 * tests/calc.at, tests/output.at, tests/regression.at,
19895 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
19896 now the tests are run in private dirs, therefore AC_CLEANUP and
19897 family can be simplified to 0-ary.
19898 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
19899 use abs. path to find config.h.
19900 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
19901 stderr, there can be way too much random noise.
19902 Instead pass -Werror to GCC and rely on the exit status.
19903 Reported by Wolfram Wagner.
19905 2001-11-14 Akim Demaille <akim@epita.fr>
19907 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
19908 defined only if yyoverflow is defined, to avoid `warning: unused
19910 Reported by The Test Suite.
19912 2001-11-14 Akim Demaille <akim@epita.fr>
19914 * src/print.c: Include reduce.h.
19915 Reported by Hans Aberg.
19917 2001-11-14 Akim Demaille <akim@epita.fr>
19919 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
19920 Revert a previous patch: these are really const.
19921 * src/conflicts.c (conflict_report): Additional useless pair of
19922 braces to pacify GCC's warnings for `if () if () {} else {}'.
19923 * src/lex.c (parse_percent_token): Replace equal_offset with
19926 Be sure to strdup `arg' when used, since there is no reason for
19927 token_buffer not to change.
19929 2001-11-14 Akim Demaille <akim@epita.fr>
19931 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
19933 * src/main.c (main): Use them.
19934 Suggested by Hans Aberg.
19936 2001-11-12 Akim Demaille <akim@epita.fr>
19938 * src/system.h (ngettext): Now that we use ngettext, be sure to
19939 provide a default definition when NLS are not used.
19941 2001-11-12 Akim Demaille <akim@epita.fr>
19943 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
19944 Use @kbd to denote user input.
19945 (Language and Grammar): ANSIfy the example.
19946 Adjust its layout for info/notinfo.
19947 (Location Tracking Calc): Output error messages to stderr.
19948 Output locations in a more GNUtically correct way.
19949 Fix a couple of Englishos.
19950 Adjust @group/@end group pairs.
19952 2001-11-12 Akim Demaille <akim@epita.fr>
19954 %expect was not functioning at all.
19956 * src/conflicts.c (expected_conflicts): Set to -1.
19957 (conflict_report): Use ngettext.
19958 (conflicts_print): Check %expect and make its violation an error.
19959 * doc/bison.texinfo (Expect Decl): Adjust.
19960 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
19961 * tests/regression.at (%expect not enough, %expect right)
19962 (%expect too much): New.
19964 2001-11-12 Akim Demaille <akim@epita.fr>
19966 * tests/regression.at (Conflicts): Rename as...
19967 (Unresolved SR Conflicts): this.
19968 (Solved SR Conflicts): New.
19970 2001-11-12 Akim Demaille <akim@epita.fr>
19972 * src/reduce.c (print_results): Rename as...
19973 (reduce_output): This.
19974 Output to OUT, passed as argument, instead of output_obstack.
19975 (dump_grammar): Likewise.
19976 (reduce_free): New.
19978 (reduce_grammar): No longer call reduce_output, since...
19979 * src/print.c (print_results): do it.
19980 * src/main.c (main): Call reduce_free;
19982 2001-11-12 Akim Demaille <akim@epita.fr>
19984 * src/conflicts.c (print_reductions): Accept OUT as argument.
19985 Output to it, not to output_obstack.
19986 * src/print.c (print_actions): Adjust.
19988 2001-11-12 Akim Demaille <akim@epita.fr>
19990 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
19991 the result instead of using...
19992 (src_total, rrc_total, src_count, rrc_count): Remove.
19993 (any_conflicts): Remove.
19994 (print_conflicts): Split into...
19995 (conflicts_print, conflicts_output): New.
19996 * src/conflicts.h: Adjust.
19997 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
19998 * src/print.c (print_grammar): Issue `\n' between two rules.
19999 * tests/regression.at (Conflicts): New.
20000 Reported by Tom Lane.
20002 2001-11-12 Akim Demaille <akim@epita.fr>
20004 * tests/regression.at (Invalid input): Remove, duplicate with
20005 ``Invalid input: 1''.
20007 2001-11-12 Akim Demaille <akim@epita.fr>
20009 * tests/torture.at (AT_DATA_STACK_TORTURE)
20010 (Exploding the Stack Size with Alloca)
20011 (Exploding the Stack Size with Malloc): New.
20013 2001-11-12 Akim Demaille <akim@epita.fr>
20015 * src/bison.simple (YYSTACK_REALLOC): New.
20016 (yyparse) [!yyoverflow]: Use it and free the old stack.
20017 Reported by Per Allansson.
20019 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
20021 * src/bison.simple: Define type yystype instead of YYSTYPE, and
20022 define CPP macro, which substitute YYSTYPE by yystype.
20023 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
20024 with yyltype/YYLTYPE. This allows inclusion of the generated
20025 header within the parser if the compiler, such as GGC, accepts
20026 multiple equivalent #defines.
20029 2001-11-05 Akim Demaille <akim@epita.fr>
20031 * src/reader.c (symbols_output): New, extracted from...
20032 (packsymbols): here.
20035 2001-11-05 Akim Demaille <akim@epita.fr>
20037 * src/lex.c (parse_percent_token): s/quotearg/quote/.
20039 2001-11-05 Akim Demaille <akim@epita.fr>
20041 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
20044 2001-11-05 Akim Demaille <akim@epita.fr>
20046 * src/options.h (struct option_table_struct): set_flags is void*.
20047 * src/options.c (longopts): Support `--output' and `%output'.
20049 * src/lex.h (tok_setopt): Remove, replaced with...
20050 (tok_intopt, tok_stropt): these new guys.
20051 * src/lex.c (getopt.h): Not needed.
20052 (token_buffer, unlexed_token_buffer): Not const.
20053 (percent_table): Promote `-' over `_' in directive names.
20054 Active `%name-prefix', `file-prefix', and `output'.
20055 (parse_percent_token): Accept possible arguments to directives.
20056 Promote `-' over `_' in directive names.
20058 2001-11-04 Akim Demaille <akim@epita.fr>
20060 * doc/bison.texinfo (Decl Summary): Split the list into
20061 `directives for grammars' and `directives for bison'.
20063 Add description of `%name-prefix', `file-prefix', and `output'.
20064 Promote `-' over `_' in directive names.
20065 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
20066 Simplify the description of `--name-prefix'.
20067 Promote `-' over `_' in directive names.
20068 Promote `--output' over `--output-file'.
20069 Fix the description of `--defines'.
20070 * tests/output.at: Exercise %file-prefix and %output.
20072 2001-11-02 Akim Demaille <akim@epita.fr>
20074 * doc/refcard.tex: Update.
20076 2001-11-02 Akim Demaille <akim@epita.fr>
20078 * src/symtab.h (SUNDEF): New.
20079 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
20080 stand for `uninitialized', instead of 0.
20081 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
20082 * src/lex.c (lex): Adjust.
20084 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
20086 Let yylex return it instead of a plain 0.
20087 Reported by Dick Streefland.
20089 2001-11-02 Akim Demaille <akim@epita.fr>
20091 * tests/regression.at (Mixing %token styles): New test.
20093 2001-11-02 Akim Demaille <akim@epita.fr>
20095 * src/reader.c (parse_thong_decl): Formatting changes.
20096 (token_translations_init): New, extracted from...
20097 (packsymbols): Here.
20100 2001-11-01 Akim Demaille <akim@epita.fr>
20102 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
20103 Check that `9foo.y' produces correct cpp guards.
20104 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
20108 2001-11-01 Akim Demaille <akim@epita.fr>
20110 * tests/regression.at (Invalid input: 2): New.
20111 * src/lex.c (unlexed_token_buffer): New.
20112 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
20116 2001-11-01 Akim Demaille <akim@epita.fr>
20118 * tests/calc.at: Catch up with 1.30.
20119 * configure.in: Bump to 1.49a.
20120 Adjust to newer Autotest.
20122 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
20124 * src/conflicts.c: Move global variables rrc_total and src_total ...
20125 (print_conflicts): here.
20126 * src/output.c (output): Free global variable user_toknums.
20127 * src/lex.c (token_obstack): Become static.
20129 2001-10-18 Akim Demaille <akim@epita.fr>
20131 * tests/atlocal.in (GCC): Add.
20132 * tests/calc.at: s/m4_match/m4_bmatch/.
20133 s/m4_patsubst/m4_bpatsubst/.
20134 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
20135 * configure.in: AC_SUBST(GCC).
20137 2001-10-14 Marc Autret <autret_m@epita.fr>
20139 * src/options.c (create_long_option_table): Fix.
20141 2001-10-10 Akim Demaille <akim@epita.fr>
20143 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
20145 2001-10-04 Akim Demaille <akim@epita.fr>
20147 * src/reader.c (parse_union_decl): Push the caracters in
20148 union_obstack, not attrs_obstack.
20150 2001-10-04 Akim Demaille <akim@epita.fr>
20152 Merge in the branch 1.29.
20154 * src/reader.c (packsymbols): Use a temporary obstack for
20155 `%%tokendef', since output_stack is already used elsewhere.
20157 2001-10-02 Akim Demaille <akim@epita.fr>
20161 2001-10-02 Akim Demaille <akim@epita.fr>
20165 2001-10-02 Akim Demaille <akim@epita.fr>
20167 * tests/regression.at (Invalid CPP headers): New.
20168 From Alexander Belopolsky.
20169 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
20171 2001-10-02 Akim Demaille <akim@epita.fr>
20173 * tests/regression.at (Invalid input): New.
20174 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
20177 2001-10-02 Akim Demaille <akim@epita.fr>
20179 * tests/calc.at: Now that --debug works, the tests must be adjusted.
20181 2001-10-02 Akim Demaille <akim@epita.fr>
20183 * src/output.c (output_parser): Assert `skeleton'.
20184 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
20188 2001-10-01 Marc Autret <autret_m@epita.fr>
20190 * src/lex.h: Echo modifications.
20191 * src/lex.c (unlex): Parameter is now token_t.
20194 2001-10-01 Marc Autret <autret_m@epita.fr>
20196 * src/main.c: Include lex.h.
20199 2001-09-29 Akim Demaille <akim@epita.fr>
20201 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
20203 2001-09-28 Akim Demaille <akim@epita.fr>
20205 * tests/testsuite.at: Update to newer Autotest.
20206 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
20208 2001-09-27 Akim Demaille <akim@epita.fr>
20210 Position independent wrapper.
20212 * tests/bison: Remove.
20213 * tests/bison.in: New.
20214 * configure.in: Adjust.
20216 2001-09-27 Paul Eggert <eggert@twinsun.com>
20218 Port quotearg fixes from tar 1.13.24.
20220 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
20222 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
20223 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
20225 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
20226 * m4/mbrtowc.m4: New file.
20227 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
20228 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
20230 2001-09-27 Akim Demaille <akim@epita.fr>
20234 2001-09-27 Akim Demaille <akim@epita.fr>
20238 2001-09-25 Akim Demaille <akim@epita.fr>
20240 * src/system.h: Include `xalloc.h'.
20241 Remove it from the C files.
20242 * src/files.c (output_files): Free the obstacks.
20243 * src/lex.c (init_lex): Rename as...
20246 * src/main.c (main): Use it.
20248 2001-09-24 Marc Autret <autret_m@epita.fr>
20250 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
20251 to output informations in fout (FILE*).
20252 (open_graph, close_graph): Likewise.
20253 (output_graph, output_edge, output_node): Likewise.
20254 * src/vcg.h: Update function prototypes.
20255 * src/print_graph.c (print_graph): Open output graph file.
20256 (print_actions): Adjust.
20257 * src/files.h: Remove extern declaration.
20258 * src/files.c: Remove graph_obstack declaration.
20259 (open_files): Remove graph_obstack initialization.
20260 (output_files): Remove graph_obstack saving.
20262 2001-09-24 Marc Autret <autret_m@epita.fr>
20264 * src/files.c (compute_output_file_names): Fix.
20266 2001-09-24 Marc Autret <autret_m@epita.fr>,
20267 Akim Demaille <akim@epita.fr>
20269 * src/reader.c (reader): Remove call to free_symtab ().
20270 * src/main.c (main): Call it here.
20272 * src/conflicts.c (initialize_conflicts): Rename as...
20273 (solve_conflicts): this.
20274 * src/print.c (print_core, print_actions, print_state)
20275 (print_grammar): Dump to a file instead a `output_obstack'.
20276 (print_results): Dump `output_obstack', and then proceed with the
20278 * src/files.c (compute_output_file_names, close_files): New.
20279 (output_files): Adjust.
20280 * src/main.c (main): Adjust.
20282 2001-09-23 Marc Autret <autret_m@epita.fr>
20284 * src/files.c (compute_header_macro): Computes header macro name
20285 from spec_defines_file when given.
20287 2001-09-23 Marc Autret <autret_m@epita.fr>
20289 * src/files.c (output_files): Add default extensions.
20291 2001-09-22 Akim Demaille <akim@epita.fr>
20293 * src/conflicts.c (finalize_conflicts): Rename as...
20294 (free_conflicts): this.
20296 2001-09-22 Akim Demaille <akim@epita.fr>
20298 * src/gram.c (gram_free): Rename back as...
20300 (output_token_translations): Free `token_translations'.
20301 * src/symtab.c (free_symtab): Free the tag field.
20303 2001-09-22 Akim Demaille <akim@epita.fr>
20305 Remove `translations' as it is always set to true.
20307 * src/gram.h: Adjust.
20308 * src/reader.c (packsymbols, parse_token_decl): Adjust
20309 * src/print.c (print_grammar): Adjust.
20310 * src/output.c (output_token_translations): Adjust.
20311 * src/lex.c (lex): Adjust.
20312 * src/gram.c: Be sure the set pointers to NULL.
20313 (dummy): Rename as...
20316 2001-09-22 Akim Demaille <akim@epita.fr>
20318 * configure.in: Invoke AM_LIB_DMALLOC.
20319 * src/system.h: Use dmalloc.
20320 * src/LR0.c: Be sure to have pointers initialized to NULL.
20321 (allocate_itemsets): Allocate kernel_items only if needed.
20323 2001-09-22 Akim Demaille <akim@epita.fr>
20325 * configure.in: Bump to 1.29b.
20326 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
20327 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
20328 need xmalloc.c in calc.y.
20331 2001-09-21 Akim Demaille <akim@epita.fr>
20334 * Makefile.maint, config/config.guess, config/config.sub,
20335 * config/missing: Update from masters.
20336 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
20338 * configure.in (ALL_LINGUAS): Add `tr'.
20340 2001-09-21 Akim Demaille <akim@epita.fr>
20342 * tests/Makefile.am (package.m4): Move to...
20343 ($(srcdir)/$(TESTSUITE)): here.
20345 2001-09-20 Akim Demaille <akim@epita.fr>
20347 * src/complain.c: No longer try to be standalone: use system.h.
20348 Don't assume __STDC__ is defined to 1. Just test if it is defined.
20349 * src/complain.h: Likewise.
20350 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
20351 Remove the unused variable `n'.
20352 From Albert Chin-A-Young.
20354 2001-09-18 Marc Autret <autret_m@epita.fr>
20356 * doc/bison.1: Update.
20357 * doc/bison.texinfo (Bison Options): Update --defines and --graph
20359 (Option Cross Key): Update.
20362 2001-09-18 Marc Autret <autret_m@epita.fr>
20364 * tests/regression.at: New test (comment in %union).
20366 2001-09-18 Marc Autret <autret_m@epita.fr>
20368 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
20370 Reported by Keith Browne.
20372 2001-09-18 Marc Autret <autret_m@epita.fr>
20374 * tests/output.at: Add tests for --defines and --graph.
20376 2001-09-18 Marc Autret <autret_m@epita.fr>
20378 * tests/output.at: Removes tests of %{header,src}_extension features.
20380 2001-09-18 Akim Demaille <akim@epita.fr>
20382 * tests/Makefile.am (package.m4): New.
20383 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
20384 (_AT_CHECK_CALC_ERROR): Likewise.
20385 Factor the `, ' part of verbose error messages.
20387 2001-09-18 Marc Autret <autret_m@epita.fr>
20389 * src/getargs.c (longopts): Declare --defines and --graph as options
20390 with optional arguments.
20391 * src/files.h: Add extern declarations.
20392 * src/files.c (spec_graph_file, spec_defines_file): New.
20393 (output_files): Update.
20394 Remove CPP-outed code.
20396 2001-09-18 Marc Autret <autret_m@epita.fr>
20398 Turn off %{source,header}_extension feature.
20400 * src/files.c (compute_exts_from_gf): Update.
20401 (compute_exts_from_src): Update.
20402 (output_files): CPP-out useless code.
20403 * src/files.h: Remove {header,source}_extension extern declarations.
20404 * src/reader.c (parse_dquoted_param): CPP-out.
20405 (parse_header_extension_decl): Remove.
20406 (parse_source_extension_decl): Remove.
20407 (read_declarations): Remove cases tok_{hdrext,srcext}.
20408 * src/lex.c (percent_table): Remove {header,source}_extension entries.
20409 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
20411 2001-09-10 Akim Demaille <akim@epita.fr>
20413 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
20414 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
20415 (AT_CHECK_OUTPUT): this.
20416 Merely check ls' exit status, its output is useless.
20418 2001-09-10 Akim Demaille <akim@epita.fr>
20420 * tests/calc.at: Use m4_match.
20421 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
20423 2001-09-10 Marc Autret <autret_m@epita.fr>,
20424 Akim Demaille <akim@epita.fr>
20426 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
20428 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
20430 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
20431 * src/lex.h: Adjust prototype.
20432 (token_t): Add `tok_undef'.
20433 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
20434 (parse_percent_token): Now returns token_t.
20435 Add default statement in switch.
20436 (lex): Separate `c' as an input variable, from the token_t result
20438 (unlexed): Is a token_t.
20440 2001-09-10 Akim Demaille <akim@epita.fr>
20442 * configure.in: Bump to 1.29a.
20444 2001-09-07 Akim Demaille <akim@epita.fr>
20448 2001-08-30 Akim Demaille <akim@epita.fr>
20450 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
20451 * m4/atconfig.m4: Remove.
20452 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
20453 * tests/bison: New.
20454 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
20455 m4_if, m4_patsubst, and m4_regexp.
20456 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
20457 `input' file instead of echo.
20459 2001-08-29 Akim Demaille <akim@epita.fr>
20463 2001-08-29 Akim Demaille <akim@epita.fr>
20467 2001-08-29 Paul Eggert <eggert@twinsun.com>
20469 * src/bison.simple (yyparse): Don't take the address of an
20470 item before the start of an array, as that doesn't conform to
20473 2001-08-29 Robert Anisko <anisko_r@epita.fr>
20475 * doc/bison.texinfo (Location Tracking Calc): New node.
20477 2001-08-29 Paul Eggert <eggert@twinsun.com>
20479 * src/output.c (output): Do not define const, as this now
20480 causes more problems than it cures.
20482 2001-08-29 Akim Demaille <akim@epita.fr>
20484 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
20486 Be sure to tag the `detailmenu'.
20488 2001-08-29 Akim Demaille <akim@epita.fr>
20490 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
20491 download in a tmp dir.
20493 2001-08-28 Marc Autret <autret_m@epita.fr>
20495 * config/depcomp: New file.
20497 2001-08-28 Marc Autret <autret_m@epita.fr>
20499 * doc/bison.1 (mandoc): Adjust.
20500 From Juan Manuel Guerrero.
20502 2001-08-28 Marc Autret <autret_m@epita.fr>
20504 * src/print_graph.c (print_state): Fix.
20506 2001-08-27 Marc Autret <autret_m@epita.fr>
20508 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
20510 Echo modifications to the functions prototypes.
20511 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
20513 2001-08-27 Marc Autret <autret_m@epita.fr>
20515 * src/vcg.c: Include `xalloc.h'.
20516 (add_colorentry): New.
20517 (add_classname): New.
20518 (add_infoname): New.
20519 * src/vcg.h: Add new prototypes.
20521 2001-08-27 Akim Demaille <akim@epita.fr>
20523 * Makefile.maint: Sync. again with CVS Autoconf.
20525 2001-08-27 Akim Demaille <akim@epita.fr>
20527 * Makefile.maint: Formatting changes.
20528 (po-update, cvs-update, update): New targets.
20531 2001-08-27 Akim Demaille <akim@epita.fr>
20533 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
20534 * Makefile.maint: Sync. with CVS Autoconf.
20536 2001-08-27 Marc Autret <autret_m@epita.fr>
20538 * src/vcg.h (struct infoname_s): New.
20539 (struct colorentry_s): New.
20540 (graph_s): New fields {vertical,horizontal}_order in structure.
20541 Add `infoname' field.
20542 Add `colorentry' field;
20543 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
20544 (G_HORIZONTAL_ORDER): New.
20546 (G_COLORENTRY): New.
20547 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
20548 Add output of `infoname'.
20549 Add output of `colorentry'.
20551 2001-08-27 Marc Autret <autret_m@epita.fr>
20553 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
20554 This one shadowed a global parameter.
20556 2001-08-24 Marc Autret <autret_m@epita.fr>
20558 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
20559 instead of `unsigned'.
20560 (print_state): Do not call obstack_object_size () in obstack_grow ()
20561 to avoid macro variables shadowing.
20563 2001-08-23 Marc Autret <autret_m@epita.fr>
20565 * src/lex.c (percent_table): Typo: s/naem/name/.
20567 Normalize new options declarations.
20569 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
20571 * tests/suite.at: Exercise %header_extension and %source_extension.
20573 2001-08-16 Marc Autret <autret_m@epita.fr>
20575 * src/reader.c (parse_dquoted_param): New.
20576 (parse_header_extension_decl): Use it.
20577 (parse_source_extension_decl): Likewise.
20579 2001-08-16 Marc Autret <autret_m@epita.fr>
20581 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
20582 (get_xxxx_str): Use assert () instead of complain ().
20583 Remove return invokations in default cases.
20584 (get_decision_str): Modify default behaviour. Remove second argument.
20585 Echo modifications on calls.
20586 (output_graph): Fix.
20588 2001-08-16 Marc Autret <autret_m@epita.fr>
20590 * src/getargs.c (usage): Update with ``-g, --graph''.
20592 2001-08-16 Marc Autret <autret_m@epita.fr>
20594 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
20595 (Option Cross Key): Likewise.
20596 * doc/bison.1: Update.
20598 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
20600 * src/output.c (output_master_parser): Don't finish action_obstack.
20601 (output_parser): Don't care about the muscle action, here.
20602 (prepare): Copy the action_obstack in the action muscle.
20603 (output): Free action_obstack.
20605 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
20607 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
20608 will contain `%union' declaration.
20609 (parse_union_decl): Delete #line directive output.
20610 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
20611 informations about %union.
20612 (parse_union_decl): Copy the union_obstack in the muscle stype.
20613 * src/bison.simple: Add new #line directive.
20614 Add typdef %%stype YYSTYPE.
20616 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
20618 * src/bison.simple: Add new `#line' directive.
20620 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
20622 * src/bison.simple: New `#line' directive.
20623 * src/output.c (output_parser): Support new dynamic muscle input_line.
20625 2001-09-22 Marc Autret <autret_m@epita.fr>
20627 * src/output.c (output_master_parser): New.
20628 (output_parser): Be more re-entrant.
20630 2001-09-21 Marc Autret <autret_m@epita.fr>
20632 * src/reader.c (copy_definition, parse_union_decl): Update and use
20634 (copy_action): Likewise.
20635 Use obstack_1grow ().
20636 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
20638 2001-09-21 Marc Autret <autret_m@epita.fr>
20640 * src/options.c (option_table): Adjust.
20641 * src/lex.c (parse_percent_token): Fix.
20643 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
20645 * src/options.c (symtab.h): Include it, need by lex.h.
20647 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
20649 * src/lex.c (parse_percent_token): Change type of variable `tx', which
20650 is now an option_table_struct*.
20651 (option_strcmp): New function option_strcmp.
20652 (parse_percent_token): Call option_strcmp.
20653 * src/getargs.c (xalloc.h, options.h): Include it.
20654 (getargs): Call create_long_option_table.
20655 (getargs): Free longopts at the end of the function.
20656 (shortopts): Move in options.c.
20657 * src/options.c (create_long_option_table): New function. Convert
20658 information from option_table to option structure.
20659 * src/reader.c (options.h): Include it.
20661 * src/Makefile.am: Adjust.
20662 * src/options.c (option_table): Create from longopts and percent_table.
20663 * src/getargs.c (longopts): Delete.
20664 * src/lex.c (struct percent_table_struct): Delete.
20665 (percent_table): Delete.
20666 (options.h): Include it.
20667 * src/options.c: Create.
20668 * src/options.h: Create.
20669 Declare enum opt_access_e.
20670 Define struct option_table_struct.
20672 2001-09-20 Marc Autret <autret_m@epita.fr>
20674 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
20677 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
20679 * src/bison.simple: s/%%filename/%%skeleton.
20680 * src/muscle_tab.c (getargs.h): Include it.
20681 (muscle_init): Insert new muscle skeleton.
20683 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
20685 * src/output.c (output_parser): Delete unused variable actions_dumped.
20687 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
20689 * src/output.c (output): Delete call to reader_output_yylsp.
20690 * src/reader.c (reader): Likewise.
20691 * src/reader.h: Delete declaration of reader_output_yylsp.
20693 2001-09-02 Marc Autret <autret_m@epita.fr>
20695 * src/reader.c: Include muscle_tab.h.
20696 (parse_union_decl): Update.
20697 (parse_macro_decl): Rename parse_muscle_decl.
20698 Update to use renamed functions and variable.
20699 (read_declarations, copy_action, read_additionnal_code, : Updated
20700 with correct variables and functions names.
20701 (packsymbols, reader): Likewise.
20703 * src/reader.h (muscle_obstack): Extern declaration update.
20705 * src/output.c: Include muscle_tab.h
20706 In all functions using macro_insert, change by using muscle_insert ().
20707 (macro_obstack): Rename muscle_obstack.
20708 Echo modifications in the whole file.
20709 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
20710 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
20711 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
20713 * src/muscle_tab.h: Update double inclusion macros.
20714 (macro_entry_s): Rename muscle_entry_s.
20717 * src/muscle_tab.c: Include muscle_tab.h.
20718 Rename macro_tabble to muscle_table.
20719 (mhash1, mhash2, mcmp): Use muscle_entry.
20720 (macro_init): Rename muscle_init. Update.
20721 (macro_insert): Rename muscle_insert. Update.
20722 (macro_find): Rename muscle_find. Update.
20724 * src/main.c: Include muscle_tab.h.
20725 (main): Call muscle_init ().
20726 * src/Makefile.am (bison_SOURCES): Echo modifications.
20728 2001-09-02 Marc Autret <autret_m@epita.fr>
20730 Now the files macro_tab.[ch] are named muscle_tab.[ch].
20732 * src/muscle_tab.c, src/muscle_tab.h: Add files.
20734 2001-09-02 Marc Autret <autret_m@epita.fr>
20736 * src/macrotab.c, src/macrotab.h: Remove.
20738 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
20740 * src/reader.c (copy_guard): Use muscle to specify the `#line'
20743 2001-09-01 Marc Autret <autret_m@epita.fr>
20745 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
20746 to an explicit value to activate the feature. We do it here.
20748 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20750 * src/output.c (prepare): Delete the `filename' muscule insertion.
20751 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
20752 (parse_union_decl): Likewise.
20753 * src/macrotab.c (macro_init): Initialize filename by infile.
20755 2001-08-31 Marc Autret <autret_m@epita.fr>
20757 * src/bison.simple (YYLSP_NEEDED): New definition.
20758 * src/output.c (prepare): Add macro insertion of `locations_flag'
20760 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20762 * src/output.c (prepare): Delete insertion of previous muscles,
20763 and insert the `prefix' muscles.
20764 * src/macrotab.c (macro_init): Likewise.
20765 (macro_init): Initialization prefix directive by `yy'.
20766 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
20767 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
20768 yylval, yydebug, yyerror, yynerrs and yyparse.
20769 New directive `#define' to substitute yydebug, ... with option
20772 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20774 * src/main.c (main): Standardize.
20775 * src/output.c (output_table_data, output_parser): Likewise.
20776 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
20778 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
20780 * src/reader.c (read_additionnal_code): Rename %%user_code to
20782 * src/output.c (output): Rename %%declarations to %%prologue.
20783 * src/bison.simple: Echo modifications.
20785 2001-08-31 Marc Autret <autret_m@epita.fr>
20787 * src/reader.c (readgram): CleanUp.
20788 (output_token_defines): Likewise.
20789 (packsymbols): Likewise.
20790 (reader): Likewise.
20791 * src/output.c (output): CPP-out useless code.
20793 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20795 * src/reader.c (reader): Delete obsolete call to function
20796 output_trailers and output_headers.
20797 * src/output.h: Remove obsolete functions prototypes of output_headers
20798 and output_trailers.
20800 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
20802 * src/main.c: Include macrotab.h.
20803 * src/macrotab.h (macro_entry_s): Constify fields.
20804 Adjust functions prototypes.
20805 * src/macrotab.c (macro_insert): Constify key and value.
20806 (macro_find): Constify key.
20807 (macro_insert): Include 'xalloc.h'
20808 (macro_insert): Use XMALLOC.
20809 (macro_find): Constify return value.
20810 * src/output.c (output_table_data): Rename table to table_data.
20811 (output_parser): Constify macro_key, macro_value.
20813 2001-08-30 Marc Autret <autret_m@epita.fr>
20815 * src/reader.c (parse_skel_decl): New.
20816 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
20817 * src/lex.h (token_t): New token `tok_skel'.
20818 * src/lex.c (percent_table): Add skeleton option entry.
20821 2001-08-29 Marc Autret <autret_m@epita.fr>
20823 * src/bison.simple: Add %%user_code directive at the end.
20824 * src/reader.c (read_additionnal_code): New.
20826 * src/output.c (output_program): Remove.
20829 2001-08-28 Marc Autret <autret_m@epita.fr>
20831 * src/output.c (output_actions): Clean up.
20832 (output_gram): CPP-out useless code.
20833 * src/reader.c (reader): Clean up, CPP-out useless code.
20835 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
20837 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
20839 * src/bison.simple: Add `%%definitions'.
20841 2001-08-28 Marc Autret <autret_m@epita.fr>
20843 * config/depcomp: New file.
20845 2001-08-27 Paul Eggert <eggert@twinsun.com>
20847 * src/bison.simple (yyparse): Don't take the address of an
20848 item before the start of an array, as that doesn't conform to
20851 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
20853 * src/output.c (output): Remove the initialization of the macro
20854 obstack. It was done too late here.
20856 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
20858 (reader): Initialize the macro obstack here, since we need it to grow
20859 '%define' directives.
20861 * src/reader.h: Declare the macro obstack as extern.
20863 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
20865 * src/output.c (output_parser): Fix. Store single '%' characters in
20866 the output obstack instead of throwing them away.
20868 2001-08-27 Akim Demaille <akim@epita.fr>
20870 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
20872 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20874 * lib/Makefile.am: Adjust.
20876 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20878 * src/bison.simple: Update and add '%%' directives.
20880 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20882 * src/reader.c (reader): Remove calls to 'output_headers' and
20883 'output_trailers'. Remove some C output.
20884 (readgram): Disable a piece of code that was writing a default
20885 definition for 'YYSTYPE'.
20886 (reader_output_yylsp): Remove.
20887 (packsymbols): Output token defintions to a macro.
20888 (copy_definition): Disable C output.
20890 * src/reader.c (parse_macro_decl): New function used to parse macro
20892 (copy_string2): Put the body of copy_string into this new function.
20893 Add a parameter to let the caller choose whether he wants to copy the
20894 string delimiters or not.
20895 (copy_string): Be a simple call to copy_string2 with the last argument
20897 (read_declarations): Add case for macro definition.
20898 (copy_identifier): New.
20899 (parse_macro_decl): Read macro identifiers using copy_identifier
20902 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20904 * src/output.c (prepare): Add prefixed names.
20905 (output_parser): Output semantic actions.
20906 (output_parser): Fix bug on '%%line' directives.
20908 * src/output.c (output_headers): Remove. The C code printed by this
20909 function should now be in the skeletons.
20910 (output_trailers): Remove.
20911 (output): Disable call to 'reader_output_yylsp'.
20912 (output_rule_data): Do not output tables to the table obstack.
20914 * src/output.c: Remove some C dedicated output.
20915 Improve the use of macro and output obstacks.
20916 (output_defines): Remove.
20918 * src/output.c (output_token_translations): Associate 'translate'
20919 table with a macro. No output to the table obstack.
20920 (output_gram): Same for 'rhs' and 'prhs'.
20921 (output_stos): Same for 'stos'.
20922 (output_rule_data): Same for 'r1' and 'r2'.
20923 (token_actions): Same for 'defact'.
20924 (goto_actions): Same for 'defgoto'.
20925 (output_base): Same for 'pact' and 'pgoto'.
20926 (output_table): Same for 'table'.
20927 (output_check): Same for 'check'.
20929 * src/output.c (output_table_data): New function.
20930 (output_short_table): Remove.
20931 (output_short_or_char_table): Remove.
20933 * src/output.c (output_parser): Replace most of the skeleton copy code
20934 with something new. Skeletons are now processed character by character
20935 rather than line by line, and Bison looks for '%%' macros. This is the
20936 first step in making Bison's output process (a lot) more flexible.
20937 (output_parser): Use the macro table.
20939 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20941 * src/main.c (main): Initialize the macro table.
20943 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20945 * src/lex.c (percent_table): Add tok_define.
20946 * src/lex.h: Add tok_define.
20948 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20950 * src/macrotab.c: New file.
20951 * src/macrotab.h: New file.
20952 * src/Makefile.am: Update.
20954 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20956 * lib/hash.c: New file.
20957 * lib/hash.h: New file.
20958 * lib/Makefile.am: Update.
20960 2001-08-15 Akim Demaille <akim@epita.fr>
20964 2001-08-15 Marc Autret <autret_m@epita.fr>
20966 * src/reader.c (readgram): Indent output macro YYSTYPE.
20967 (packsymbols): Likewise.
20968 (output_token_defines): Likewise.
20969 * src/files.c: Standardize.
20970 (compute_header_macro): New.
20971 (defines_obstack_save): New. Use compute_header_macro.
20972 (output_files): Update. Use defines_obstack_save.
20974 2001-08-15 Akim Demaille <akim@epita.fr>
20976 * doc/bison.texinfo (Table of Symbols): Document
20977 YYSTACK_USE_ALLOCA.
20979 2001-08-15 Akim Demaille <akim@epita.fr>
20981 * missing: Update from CVS Automake.
20982 * config/config.guess, config/config.sub, config/texinfo.tex:
20983 Update from gnu.org.
20985 2001-08-15 Akim Demaille <akim@epita.fr>
20987 * Makefile.maint: Sync with CVS Autoconf.
20989 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
20991 * doc/bison.texinfo: Include GNU Free Documentation License from
20993 * doc/fdl.texi: Add to package.
20995 2001-08-14 Marc Autret <autret_m@epita.fr>
20997 Turn on %{source,header}_extension features.
20999 * src/lex.c (percent_table): Un-CPP out header_extension and
21001 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
21002 (compute_exts_from_src): Remove conditions. It restores priorities
21005 2001-08-14 Marc Autret <autret_m@epita.fr>
21007 * src/files.c (compute_base_names): Add extensions computing when
21008 `--file-prefix' used.
21009 Standardize function calls.
21011 2001-08-13 Marc Autret <autret_m@epita.fr>
21013 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
21014 defining it (defined but null disables alloca).
21016 2001-08-13 Marc Autret <autret_m@epita.fr>
21018 * src/bison.simple (_yy_memcpy): CPP reformat.
21020 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
21022 * tests/atconfig.in (CPPFLAGS): Fix.
21024 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
21026 * doc/bison.texinfo: Include GNU General Public License from
21028 * doc/gpl.texi: Add to package.
21030 2001-08-10 Marc Autret <autret_m@epita.fr>
21032 * src/print_graph.h: Fix.
21033 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
21035 2001-08-10 Akim Demaille <akim@epita.fr>
21037 * src/system.h: Provide default declarations for stpcpy, strndup,
21040 2001-08-10 Robert Anisko <anisko_r@epita.fr>
21042 * doc/bison.texinfo (Locations): Update @$ stuff.
21044 2001-08-09 Robert Anisko <anisko_r@epita.fr>
21046 * src/bison.simple (YYLLOC_DEFAULT): Update.
21049 2001-08-08 Marc Autret <autret_m@epita.fr>
21051 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
21052 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
21053 Reported by Fabrice Bauzac.
21055 2001-08-08 Marc Autret <autret_m@epita.fr>
21057 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
21058 * src/vcg.c (output_node): Fix.
21059 * src/vcg.h: Cleanup.
21060 * src/print_graph.c: Add comments.
21061 (node_output_size): New global variable. Simplify the formatting of
21062 the VCG graph output.
21063 (print_actions): Unused code is now used. It notifies the final state
21064 and no action states in the VCG graph. It also give the reduce actions.
21065 The `shift and goto' edges are red and the `go to state' edges are
21067 Get the current node name and node_obstack by argument.
21068 (node_obstack): New variable.
21069 (print_state): Manage node_obstack.
21070 (print_core): Use node_obstack given by argument.
21071 A node is not only computed here but in print_actions also.
21072 (print_graph): CPP out useless code instead of commenting it.
21074 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
21076 * tests/atconfig.in (CPPFLAGS): Fix.
21078 2001-08-07 Akim Demaille <akim@epita.fr>
21080 * src/print_graph.c (quote): New.
21081 (print_core): Use it.
21083 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
21085 * src/vcg.c (complain.h): Include it.
21086 Unepitaize `return' invocations.
21087 [NDEBUG] (main): Remove.
21088 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
21089 * src/files.c (open_files): Initialize graph_obstack.
21090 * src/print_graph.c (print_actions): CPP out useless code.
21091 (print_core): Don't output the last `\n' in labels.
21093 * src/files.c (output_files): Output the VCG file.
21094 * src/main.c (main): Invoke print_graph ();
21096 2001-08-06 Marc Autret <autret_m@epita.fr>
21098 Automaton VCG graph output.
21099 Using option ``-g'' or long option ``--graph'', you can generate
21100 a gram_filename.vcg file containing a VCG description of the LALR (1)
21101 automaton of your grammar.
21103 * src/main.c: Call to print_graph() function.
21104 * src/getargs.h: Update.
21105 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
21106 (graph_flag): New flag.
21107 (longopts): Update.
21108 (getargs): Add case `g'.
21109 * src/files.c (graph_obstack): New obstack struct.
21110 (open_files): Initialize new obstack.
21111 (output_files): Saves graph_obstack if required.
21112 * src/files.h (graph_obstack): New extern declaration.
21113 * src/Makefile.am: Add new source files.
21115 2001-08-06 Marc Autret <autret_m@epita.fr>
21117 * src/print_graph.c, src/print_graph.h (graph): New.
21118 * src/vcg.h: New file.
21119 * src/vcg.c: New file, VCG graph handling.
21121 2001-08-06 Marc Autret <autret_m@epita.fr>
21123 Add of %source_extension and %header_extension which specify
21124 the source or/and the header output file extension.
21126 * src/files.c (compute_base_names): Remove initialisation of
21127 src_extension and header_extension.
21128 (compute_exts_from_gf): Update.
21129 (compute_exts_from_src): Update.
21130 (output_files): Update.
21131 * src/reader.c (parse_header_extension_decl): New.
21132 (parse_source_extension_decl): New.
21133 (read_declarations): New case statements for the new tokens.
21134 * src/lex.c (percent_table): Add entries for %source_extension
21135 and %header_extension.
21136 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
21138 2001-08-06 Marc Autret <autret_m@epita.fr>
21140 * configure.in: Bump to 1.28c.
21141 * doc/bison.texinfo: Texinfo thingies.
21143 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
21145 * tests/atconfig.in (CPPFLAGS): Add.
21146 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
21148 2001-08-03 Akim Demaille <akim@epita.fr>
21152 2001-08-03 Akim Demaille <akim@epita.fr>
21154 * tests/Makefile.am (check-local): Ship testsuite.
21155 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
21156 Include `string.h'.
21158 2001-08-03 Akim Demaille <akim@epita.fr>
21160 * configure.in: Try using -Wformat when compiling.
21162 2001-08-03 Akim Demaille <akim@epita.fr>
21164 * configure.in: Bump to 1.28b.
21166 2001-08-03 Akim Demaille <akim@epita.fr>
21168 * src/complain.c: Adjust strerror_r portability issues.
21170 2001-08-03 Akim Demaille <akim@epita.fr>
21174 2001-08-03 Akim Demaille <akim@epita.fr>
21176 * src/getargs.c, src/getarg.h (skeleton)): Constify.
21177 * src/lex.c (literalchar): Avoid name clashes on `buf'.
21178 * src/getargs.c: Include complain.h.
21179 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
21180 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
21182 2001-08-03 Akim Demaille <akim@epita.fr>
21184 * src/reader.c (readgram): Display hidden chars in error messages.
21186 2001-08-03 Akim Demaille <akim@epita.fr>
21188 Update to gettext 0.10.39.
21190 2001-08-03 Akim Demaille <akim@epita.fr>
21192 * lib/strspn.c: New.
21194 2001-08-01 Marc Autret <autret_m@epita.fr>
21196 * doc/bison.texinfo: Update.
21197 * doc/bison.1 (mandoc): Update.
21198 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
21199 * src/files.c: Support output files extensions computing.
21200 (src_extension): New static variable.
21201 (header_extension): New static variable.
21202 (tr): New function.
21203 (get_extension_index): New function, gets the index of an extension
21204 filename in a string.
21205 (compute_exts_from_gf): New function, computes extensions from the
21206 grammar file extension.
21207 (compute_exts_from_src): New functions, computes extensions from the
21208 C source file extension, file given by ``-o'' option.
21209 (compute_base_names): Update.
21210 (output_files): Update.
21212 2001-08-01 Robert Anisko <anisko_r@epita.fr>
21214 * doc/bison.texi: Document @$.
21215 (Locations): New section.
21217 2001-07-18 Akim Demaille <akim@epita.fr>
21219 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
21220 * config/prev-version.txt, config/move-if-change: New.
21221 * Makefile.am: Adjust.
21223 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
21225 * src/bison.simple (yyparse): Suppress warning `comparaison
21226 between signed and unsigned'.
21228 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
21230 * src/getargs.h (raw_flag): Remove.
21231 * src/getargs.c: Die on `-r'/`--raw'.
21232 * src/lex.c (parse_percent_token): Die on `%raw'.
21233 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
21234 * tests/calc.at: Suppress test with option `--raw'.
21236 2001-07-14 Akim Demaille <akim@epita.fr>
21239 * configure.in: Require Autoconf 2.50.
21240 Update to gettext 0.10.38.
21242 2001-03-16 Akim Demaille <akim@epita.fr>
21244 * doc/bison.texinfo: ANSIfy the examples.
21246 2001-03-16 Akim Demaille <akim@epita.fr>
21248 * getargs.c (skeleton): New variable.
21249 (longopts): --skeleton is a new option.
21250 (shortopts, getargs): -S is a new option.
21251 * getargs.h: Declare skeleton.
21252 * output.c (output_parser): Use it.
21254 2001-03-16 Akim Demaille <akim@epita.fr>
21256 * m4/strerror_r.m4: New.
21257 * m4/error.m4: Run AC_FUNC_STRERROR_R.
21258 * lib/error.h, lib/error.c: Update.
21260 2001-03-16 Akim Demaille <akim@epita.fr>
21262 * src/getargs.c (longopts): Clean up.
21264 2001-02-21 Akim Demaille <akim@epita.fr>
21266 * src/reader.c (gensym): `gensym_count' is your own.
21267 Use a static buf to create the symbol name, as token_buffer is no
21270 2001-02-08 Akim Demaille <akim@epita.fr>
21272 * src/conflicts.c (conflict_report): Be sure not to append to res
21273 between two calls, which could happen if both first sprintf were
21274 skipped, but not the first cp += strlen.
21276 2001-02-08 Akim Demaille <akim@epita.fr>
21278 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
21279 New, from fileutils 4.0.37.
21280 * configure.in: Require Autoconf 2.49c. I took some time before
21281 making this decision. This is the only way out for portability
21282 issues in Bison, it would mean way too much duplicate effort to
21283 import in Bison features implemented in 2.49c since 2.13.
21284 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
21286 2001-02-02 Akim Demaille <akim@epita.fr>
21288 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
21289 * lib/xalloc.h, lib/xmalloc.c: Update.
21291 2001-01-19 Akim Demaille <akim@epita.fr>
21293 Get rid of the ad hoc handling of token_buffer in the scanner: use
21296 * src/lex.c (token_obstack): New.
21297 (init_lex): Initialize it. No longer call...
21298 (grow_token_buffer): this. Remove it.
21299 Adjust all the places which used it to use the obstack.
21301 2001-01-19 Akim Demaille <akim@epita.fr>
21303 * src/lex.h: Rename all the tokens:
21304 s/\bENDFILE\b/tok_eof/g;
21305 s/\bIDENTIFIER\b/tok_identifier/g;
21307 Let them be enums, not #define, to ease debugging.
21308 Adjust all the code.
21310 2001-01-18 Akim Demaille <akim@epita.fr>
21312 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
21313 * src/lex.c (maxtoken, grow_token_buffer): Static.
21315 2001-01-18 Akim Demaille <akim@epita.fr>
21317 Since we now use obstacks, more % directives can be enabled.
21319 * src/lex.c (percent_table): Also accept `%yacc',
21320 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
21322 Handle the actions for `%semantic_parser' and `%pure_parser' here,
21323 instead of returning a token.
21324 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
21325 * src/reader.c (read_declarations): Adjust.
21326 * src/files.c (open_files): Don't call `compute_base_names', don't
21327 compute `attrsfile' since they depend upon data which might be
21328 *in* the input file now.
21329 (output_files): Do it here.
21330 * src/output.c (output_headers): Document the fact that this patch
21331 introduces a guaranteed SEGV for semantic parsers.
21332 * doc/bison.texinfo: Document them.
21333 * tests/suite.at: Exercise these %options.
21335 2000-12-20 Akim Demaille <akim@epita.fr>
21337 Also handle the output file (--verbose) with obstacks.
21339 * files.c (foutput): Remove.
21340 (output_obstack): New.
21341 Adjust all dependencies.
21342 * src/conflicts.c: Return a string.
21343 * src/system.h (obstack_grow_string): Rename as...
21344 (obstack_sgrow): this. Be ready to work with non literals.
21345 (obstack_fgrow4): New.
21347 2000-12-20 Akim Demaille <akim@epita.fr>
21349 * src/files.c (open_files): Fix the computation of short_base_name
21350 in the case of `-o foo.tab.c'.
21352 2000-12-20 Akim Demaille <akim@epita.fr>
21354 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
21355 (copy_dollar): Now that everything uses obstacks, get rid of the
21358 2000-12-20 Akim Demaille <akim@epita.fr>
21360 * src/files.c (open_files): Actually the `.output' file is based
21361 on the short_base_name, not base_name.
21362 * tests/suite.at (Checking output file names): Adjust.
21364 2000-12-20 Akim Demaille <akim@epita.fr>
21366 * src/bison.s1: Remove, we now use directly...
21367 * src/bison.simple: this.
21368 * src/Makefile.am: Use pkgdata instead of data.
21370 2000-12-20 Akim Demaille <akim@epita.fr>
21372 * src/files.c (guard_obstack): New.
21373 (open_files): Initialize it.
21374 (output_files): Dump it...
21375 * src/files.h: Export it.
21376 * src/reader.c (copy_guard): Use it.
21378 2000-12-19 Akim Demaille <akim@epita.fr>
21380 * src/files.c (outfile, defsfile, actfile): Removed as global
21382 (open_files): Don't compute them.
21383 (output_files): Adjust.
21384 (base_name, short_base_name): Be global.
21385 Adjust dependencies.
21387 2000-12-19 Akim Demaille <akim@epita.fr>
21389 * src/files.c (strsuffix): New.
21390 (stringappend): Be just like strcat but allocate.
21391 (base_names): Eve out from open_files.
21392 Try to simplify the rather hairy computation of base_name and
21394 (open_files): Use it.
21395 * tests/suite.at (Checking output file names): New test.
21397 2000-12-19 Akim Demaille <akim@epita.fr>
21399 * src/system.h (obstack_grow_literal_string): Rename as...
21400 (obstack_grow_string): this.
21401 * src/output.c (output_parser): Recognize `%% actions' instead of
21403 * src/bison.s1: s/$/%% actions/.
21404 * src/bison.hairy: Likewise.
21406 2000-12-19 Akim Demaille <akim@epita.fr>
21408 * src/output.c (output_parser): Compute the `#line' lines when
21410 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
21411 Suggested by Hans Aberg.
21413 2000-12-19 Akim Demaille <akim@epita.fr>
21415 Let the handling of the skeleton files be local to the procedures
21418 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
21420 (fparser, open_extra_files): Remove.
21421 (open_files, output_files): Don't take care of fparser.
21422 * src/files.h: Adjust.
21423 * src/output.c (output_parser): Open and close the file to the
21425 * src/reader.c (read_declarations): When %semantic_parser, open
21428 2000-12-19 Akim Demaille <akim@epita.fr>
21430 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
21431 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
21433 2000-12-19 Akim Demaille <akim@epita.fr>
21435 * src/files.c (open_files): Yipee! We no longer need all the code
21436 looking for `/tmp' since we have no tmp file.
21438 2000-12-19 Akim Demaille <akim@epita.fr>
21440 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
21442 * src/files.c (open_files): Less dependency on MSDOS etc.
21444 2000-12-14 Akim Demaille <akim@epita.fr>
21446 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
21447 Provide a default definition.
21448 Use it when executing the default @ action.
21449 * src/reader.c (reader_output_yylsp): No longer include
21450 `timestamp' and `text' in the default YYLTYPE.
21452 2000-12-12 Akim Demaille <akim@epita.fr>
21454 * src/reader.c (copy_definition, parse_union_decl, copy_action)
21455 (copy_guard): Quote the file names.
21456 Reported by Laurent Mascherpa.
21458 2000-12-12 Akim Demaille <akim@epita.fr>
21460 * src/output.c (output_headers, output_program, output): Be sure
21461 to escape special characters when outputting filenames.
21462 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
21463 (output_headers): Don't depend on them, Use ACTSTR.
21465 2000-11-17 Akim Demaille <akim@epita.fr>
21467 * lib/obstack.h: Formatting changes.
21468 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
21469 prevents type checking.
21470 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
21471 cast the value to (void *): assigning a `foo *' to a `void *'
21473 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
21474 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
21477 2000-11-17 Akim Demaille <akim@epita.fr>
21479 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
21481 (suite.m4, regression.m4, calc.m4): these.
21482 * tests/atgeneral.m4: Update from CVS Autoconf.
21484 2000-11-17 Akim Demaille <akim@epita.fr>
21486 * tests/regression.m4 (%union and --defines): New test,
21487 demonstrating a current bug in the obstack implementation.
21489 2000-11-17 Akim Demaille <akim@epita.fr>
21491 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
21493 Use them to declare the variables which are global or local to
21496 2000-11-17 Akim Demaille <akim@epita.fr>
21498 * acconfig.h: Remove, no longer used.
21500 2000-11-07 Akim Demaille <akim@epita.fr>
21502 * src: s/Copyright (C)/Copyright/g.
21504 2000-11-07 Akim Demaille <akim@epita.fr>
21506 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
21508 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
21510 2000-11-07 Akim Demaille <akim@epita.fr>
21512 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
21513 Merge in a single CPP if/else.
21515 2000-11-07 Akim Demaille <akim@epita.fr>
21517 * src/output.c (output): Remove useless variables.
21518 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
21519 argument `data' for consistency with the prototypes.
21520 Qualify it `const'.
21521 (obstack_copy, obstack_copy0): Rename the second argument as
21522 `address' for consistency. Qualify it `const'.
21523 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
21524 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
21525 `const' their input argument (`data' or `address').
21526 Adjust the corresponding macros to include `const' in casts.
21528 2000-11-03 Akim Demaille <akim@epita.fr>
21530 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
21531 s/PFILE1/BISON_HAIRY/.
21532 Adjust dependencies.
21534 2000-11-03 Akim Demaille <akim@epita.fr>
21536 For some reason, this was not applied.
21538 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
21539 `unlink': it's no longer used.
21541 2000-11-03 Akim Demaille <akim@epita.fr>
21543 * src/files.c (skeleton_find): New function, eved out of...
21544 (open_files, open_extra_files): here.
21546 2000-11-03 Akim Demaille <akim@epita.fr>
21548 Don't use `atexit'.
21550 * src/files.c (obstack_save): New function.
21551 (done): Rename as...
21552 (output_files): this.
21553 Use `obstack_save'.
21554 * src/main.c (main): Don't use `atexit' to register `done', since
21555 it no longer has to remove tmp files, just call `output_files'
21556 when there are no errors.
21558 2000-11-02 Akim Demaille <akim@epita.fr>
21560 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
21561 `unlink': it's no longer used.
21562 * src/files.h: Formatting changes.
21564 2000-11-02 Akim Demaille <akim@epita.fr>
21566 Remove the last uses of mktemp and unlink/delete.
21568 * src/files.c (fdefines, ftable): Removed.
21569 (defines_ostack, table_obstack): New.
21570 Adjust dependencies of the former into uses of the latter.
21571 * src/output.c (output_short_or_char_table, output_short_table):
21572 Convert to using obstacks.
21573 * src/reader.c (copy_comment2): Accept one FILE * and two
21575 (output_token_defines, reader_output_yylsp): Use obstacks.
21576 * src/system.h (obstack_fgrow3): New.
21577 * po/POTFILES.in: Adjust.
21579 2000-11-01 Akim Demaille <akim@epita.fr>
21581 Change each use of `fattrs' into a use of `attrs_obstack'.
21583 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
21584 * src/files.c (fattrs): Remove.
21585 (attrs_obstack): New.
21586 Adjust all dependencies.
21587 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
21589 2000-11-01 Akim Demaille <akim@epita.fr>
21591 Introduce obstacks.
21592 Change each use of `faction' into a use of `action_obstack'.
21594 * lib/obstack.h, lib/obstack.c: New files.
21595 * src/files.c (faction): Remove.
21596 (action_obstack): New.
21597 Adjust all dependencies.
21599 2000-10-20 Akim Demaille <akim@epita.fr>
21601 * lib/quote.h (PARAMS): New macro. Use it.
21603 2000-10-16 Akim Demaille <akim@epita.fr>
21605 * src/output.c (output_short_or_char_table): New function.
21606 (output_short_table, output_token_translations): Use it.
21607 (goto_actions): Use output_short_table.
21609 2000-10-16 Akim Demaille <akim@epita.fr>
21611 * src/symtab.c (bucket_new): New function.
21614 * src/output.c (output_short_table): New argument to display the
21615 comment associated with the table.
21616 Adjust dependencies.
21617 (output_gram): Use it.
21618 (output_rule_data): Nicer output layout for YYTNAME.
21620 2000-10-16 Akim Demaille <akim@epita.fr>
21622 * src/lex.c (read_typename): New function.
21624 * src/reader.c (copy_dollar): Likewise.
21626 2000-10-16 Akim Demaille <akim@epita.fr>
21628 * src/reader.c (copy_comment2): Expect the input stream to be on
21629 the `/' which is suspected to open a comment, instead of being
21630 called after `//' or `/*' was read.
21631 (copy_comment, copy_definition, parse_union_decl, copy_action)
21632 (copy_guard): Adjust.
21634 2000-10-16 Akim Demaille <akim@epita.fr>
21636 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
21637 `read_signed_integer'.
21639 2000-10-16 Akim Demaille <akim@epita.fr>
21641 * src/reader.c (copy_dollar): New function.
21642 (copy_guard, copy_action): Use it.
21644 2000-10-16 Akim Demaille <akim@epita.fr>
21646 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
21647 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
21648 New files, from Fileutils 4.0.27.
21649 * src/main.c (printable_version): Remove.
21650 * src/lex.c, src/reader.c: Use `quote'.
21652 2000-10-04 Akim Demaille <akim@epita.fr>
21654 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
21656 2000-10-04 Akim Demaille <akim@epita.fr>
21658 * doc/bison.texinfo: Various typos spotted by Neil Booth.
21660 2000-10-04 Akim Demaille <akim@epita.fr>
21662 When a literal string is used to define two different tokens,
21663 `bison -v' segfaults.
21664 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
21666 * tests/regression.m4: New file.
21667 Include the core of the sample provided by Piotr Gackiewicz.
21668 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
21671 2000-10-04 Akim Demaille <akim@epita.fr>
21673 * src/reader.c (parse_expect_decl): Keep `count' within the size
21677 2000-10-02 Paul Eggert <eggert@twinsun.com>
21679 * bison.s1 (yyparse): Assign the default value
21680 unconditionally, to avoid a GCC warning and make the parser a
21683 2000-10-02 Akim Demaille <akim@epita.fr>
21685 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
21688 2000-10-02 Akim Demaille <akim@epita.fr>
21690 * src/derives.c, src/print.c, src/reduce.c: To ease the
21691 translation, move some `\n' out of the translated strings.
21693 2000-10-02 Akim Demaille <akim@epita.fr>
21695 The location tracking mechanism is precious for parse error
21696 messages. Nevertheless, it is enabled only when `@n' is used in
21697 the grammar, which is a different issue (you can use it in error
21698 message, but not in the grammar per se). Therefore, there should
21699 be another means to enable it.
21701 * src/getargs.c (getargs): Support `--locations'.
21702 (usage): Report it.
21703 * src/getargs.h (locationsflag): Export it.
21704 * src/lex.c (percent_table): Support `%locations'.
21705 * src/reader.c (yylsp_needed): Remove this variable, now replaced
21706 with `locationsflag'.
21707 * doc/bison.texinfo: Document `--locations' and `%locations'.
21709 * tests/calc.m4: Test it.
21711 For regularity of the names, replace each
21712 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
21713 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
21714 In addition replace each `flag' with `_flag'.
21716 2000-10-02 Akim Demaille <akim@epita.fr>
21718 Also test parse error messages, including with YYERROR_VERBOSE.
21720 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
21722 Use it to check the computations.
21723 Use it to check `nonassoc' is honored.
21724 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
21725 `--yyerror-verbose'.
21726 (_AT_CHECK_CALC): Adjust to this option.
21727 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
21729 2000-10-02 Akim Demaille <akim@epita.fr>
21731 Test also `--verbose', `--defines' and `--name-prefix'. Testing
21732 the latter demonstrates a flaw in the handling of non debugging
21733 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
21734 was used in order to simplify:
21750 unfortunately this leads to a CPP conflict when
21751 `--name-prefix=foo' is used since it produces `#define yydebug
21754 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
21755 (YYDPRINTF): New macro.
21757 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
21759 Also test `--verbose', `--defines' and `--name-prefix'.
21761 2000-10-02 Akim Demaille <akim@epita.fr>
21763 Improve the readability of the produced parsers.
21765 * src/bison.s1: Formatting changes.
21766 Improve the comment related to the `$' mark.
21767 (yydefault): Don't fall through to `yyresume': `goto' there.
21768 * src/output.c (output_parser): When the `$' is met, skip the end
21770 New variable, `number_of_dollar_signs', to check there's exactly
21771 one `$' in the parser skeleton.
21773 2000-10-02 Akim Demaille <akim@epita.fr>
21775 * lib/xstrdup.c: New file, from the fileutils.
21776 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
21777 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
21778 instead of strlen + xmalloc + strcpy.
21779 * src/symtab.c (copys): Remove, use xstrdup instead.
21781 2000-10-02 Akim Demaille <akim@epita.fr>
21783 * src/gram.h (associativity): New enum type which replaces the
21784 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
21785 `right_assoc', `left_assoc' and `non_assoc'.
21786 Adjust all dependencies.
21787 * src/reader.c: Formatting changes.
21788 (LTYPESTR): Don't define it, use it as a literal in
21789 `reader_output_yylsp'.
21790 * src/symtab.h (symbol_class): New enum type which replaces the
21791 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
21792 `sunknown', `stoken and `snterm'.
21794 2000-10-02 Akim Demaille <akim@epita.fr>
21796 * src/getargs.c (fixed_outfiles): Rename as...
21797 (yaccflag): for consistency and accuracy.
21798 Adjust dependencies.
21800 2000-10-02 Akim Demaille <akim@epita.fr>
21802 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
21803 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
21804 difficult and introduced a lot of core dump. It turns out that
21805 Bison used an implementation of `xmalloc' based on `calloc', and
21806 at various places it does depend upon the initialization to 0. I
21807 have not tried to isolate the pertinent places, and all the former
21808 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
21809 someone should address this issue.
21811 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
21812 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
21814 Adjust dependencies.
21815 * src/warshall.h: New file.
21818 2000-10-02 Akim Demaille <akim@epita.fr>
21820 Various anti-`extern in *.c' changes.
21822 * src/system.h: Include `assert.h'.
21824 2000-10-02 Akim Demaille <akim@epita.fr>
21826 * src/state.h (nstates, final_state, first_state, first_shift)
21827 (first_reduction): Move their exportation from here...
21828 * src/LR0.h: to here.
21829 Adjust dependencies.
21830 * src/getargs.c (statisticsflag): New variable.
21831 Add support for `--statistics'.
21832 Adjust dependencies.
21834 Remove a lot of now useless `extern' statements in most files.
21836 2000-10-02 Akim Demaille <akim@epita.fr>
21838 * src/LR0.h: New file.
21841 2000-10-02 Akim Demaille <akim@epita.fr>
21843 * src/print.h: New file.
21845 * src/print.c: Formatting and ordering changes.
21846 (verbose, terse): Replace with...
21847 (print_results): this new function.
21848 Adjust dependencies.
21850 2000-10-02 Akim Demaille <akim@epita.fr>
21852 * src/conflicts.c (conflict_report): New function.
21853 (conflict_log, verbose_conflict_log): Replace with...
21854 (print_conflicts): this function.
21855 Adjust dependencies.
21856 * src/conflicts.h: New file.
21857 Propagate its inclusion.
21859 2000-10-02 Akim Demaille <akim@epita.fr>
21861 * src/nullable.h: New file.
21862 Propagate its inclusion.
21863 * src/nullable.c: Formatting changes.
21865 2000-10-02 Akim Demaille <akim@epita.fr>
21867 * src/reduce.h: New file.
21868 Propagate its inclusion.
21869 * src/reduce.c: Topological sort and other formatting changes.
21870 (bool, TRUE, FALSE): Move their definition to...
21871 * src/system.h: here.
21873 2000-10-02 Akim Demaille <akim@epita.fr>
21875 * src/files.c: Formatting changes.
21876 (tryopen, tryclose, openfiles): Rename as...
21877 (xfopen, xfclose, open_files): this.
21878 (stringappend): static.
21879 * src/files.h: Complete the list of exported symbols.
21882 2000-10-02 Akim Demaille <akim@epita.fr>
21884 * src/reader.h: New file.
21885 Propagate its use instead of tedious list of `extern' and
21887 * src/reader.c: Formatting changes, topological sort,
21890 2000-10-02 Akim Demaille <akim@epita.fr>
21892 * src/lex.h: Prototype `lex.c' exported functions.
21893 * src/reader.c: Adjust.
21894 * src/lex.c: Formatting changes.
21895 (safegetc): Rename as...
21898 2000-10-02 Akim Demaille <akim@epita.fr>
21900 * src/lalr.h: New file.
21901 Propagate its inclusion instead of prototypes and `extern'.
21902 * src/lalr.c: Formatting changes, topological sorting etc.
21904 2000-10-02 Akim Demaille <akim@epita.fr>
21906 * src/output.c (token_actions): Introduce a temporary array,
21907 YYDEFACT, that makes it possible for this function to use
21908 output_short_table.
21910 2000-10-02 Akim Demaille <akim@epita.fr>
21912 `user_toknums' is output as a `short[]' in `output.c', while it is
21913 defined as a `int[]' in `reader.c'. For consistency with the
21914 other output tables, `user_toknums' is now defined as a table of
21917 * src/reader.c (user_toknums): Be a short table instead of an int
21919 Adjust dependencies.
21921 Factor the short table outputs.
21923 * src/output.c (output_short_table): New function.
21924 * src/output.c (output_gram, output_stos, output_rule_data)
21925 (output_base, output_table, output_check): Use it.
21927 2000-10-02 Akim Demaille <akim@epita.fr>
21929 * src/output.c (output): Topological sort of the functions, in
21930 order to get rid of the `static' prototypes.
21931 No longer use `register'.
21932 * src/output.h: New file.
21933 Propagate its inclusion in files explicitly prototyping functions
21936 2000-09-21 Akim Demaille <akim@epita.fr>
21938 * src/atgeneral.m4: Update from Autoconf.
21940 2000-09-21 Akim Demaille <akim@epita.fr>
21942 * src/closure.h: New file.
21943 * src/closure.c: Formatting changes, topological sort over the
21944 functions, use of closure.h.
21945 (initialize_closure, finalize_closure): Rename as...
21946 (new_closure, free_closure): these. Adjust dependencies.
21947 * src/LR0.c: Formatting changes, topological sort, use of
21949 (initialize_states): Rename as...
21950 (new_states): this.
21951 * src/Makefile.am (noinst_HEADERS): Adjust.
21953 2000-09-20 Akim Demaille <akim@epita.fr>
21955 * src/acconfig.h: Don't protect config.h against multiple
21957 Don't define PARAMS.
21958 * src/system.h: Define PARAMS.
21959 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
21960 purpose of config.h. system.h must not try to fix wrong
21961 definitions in config.h.
21963 2000-09-20 Akim Demaille <akim@epita.fr>
21965 * src/derives.h: New file.
21966 * src/main.c, src/derives.h: Use it.
21967 Formatting changes.
21968 * src/Makefile.am (noinst_HEADERS): Adjust.
21970 2000-09-20 Akim Demaille <akim@epita.fr>
21972 * tests/atgeneral.m4: Update from Autoconf.
21973 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
21974 (AT_CHECK_CALC): New macros.
21975 Use these macros to test bison with options `', `--raw',
21976 `--debug', `--yacc', `--yacc --debug'.
21978 2000-09-19 Akim Demaille <akim@epita.fr>
21980 * src/output.c: Formatting changes.
21981 * src/machine.h: Remove, leaving its contents in...
21982 * src/system.h: here.
21984 Adjust all dependencies on stdio.h and machine.h.
21985 * src/getargs.h: New file.
21986 Let all `extern' declarations about getargs.c be replaced with
21987 inclusion of `getargs.h'.
21988 * src/Makefile.am (noinst_HEADERS): Adjust.
21990 * tests/calc.m4 (yyin): Be initialized in main, not on the global
21992 (yyerror): Returns void, not int.
21993 * doc/bison.texinfo: Formatting changes.
21995 2000-09-19 Akim Demaille <akim@epita.fr>
21997 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
22000 2000-09-18 Akim Demaille <akim@epita.fr>
22002 * configure.in: Append WARNING_CFLAGS to CFLAGS.
22003 * src/Makefile.am (INCLUDES): Don't.
22004 Be ready to fetch headers in lib/.
22006 2000-09-18 Akim Demaille <akim@epita.fr>
22008 * doc/bison.texinfo: Update the copyright.
22009 ANSIfy and GNUify the examples.
22010 Remove the old menu.
22012 2000-09-18 Akim Demaille <akim@epita.fr>
22014 First set of tests: use the `calc' example from the documentation.
22016 * src/bison.s1 (yyparse): Condition the code using `yytname' which
22017 is defined only when YYDEBUG is.
22018 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
22019 * src/files.c (tryopen, tryclose): Formatting changes.
22020 Move to the top and be static.
22021 * src/reader.c (read_signed_integer): Likewise.
22022 * tests/calc.m4: New file.
22023 * Makefile.am, suite.m4: Adjust.
22024 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
22026 2000-09-18 Akim Demaille <akim@epita.fr>
22028 Add support for an Autotest test suite for Bison.
22030 * m4/m4.m4, m4/atconfig.m4: New files.
22031 * m4/Makefile.am (EXTRA_DIST): Adjust.
22032 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
22034 * src/getargs.c: Display a more standard --version message.
22035 * src/reader.c (reader): Formatting changes.
22036 No longer depend upon VERSION_STRING.
22037 * configure.in: No longer use `dnl'.
22038 Set up the test suite and the new directory `tests/.
22039 (VERSION_STRING): Remove.
22041 2000-04-14 Akim Demaille <akim@epita.fr>
22043 * src/reader.c (copy_comment2): New function, same as former
22044 `copy_comment', but outputs into two FILE *.
22045 (copy_comment): Use it.
22046 (parse_union_decl): Use it.
22047 (get_type, parse_start_decl): Use the same `invalid' message.
22048 (parse_start_decl, parse_union_decl): Use the same `multiple'
22050 (parse_union_decl, copy_guard, copy_action): Use the same
22051 `unmatched' message.
22052 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
22054 2000-03-31 Akim Demaille <akim@epita.fr>
22056 * src/files.c (tryopen, tryclose): Move to the top.
22059 2000-03-31 Akim Demaille <akim@epita.fr>
22061 * src/main.c (main): Don't call `done', exit does it.
22063 2000-03-31 Akim Demaille <akim@epita.fr>
22065 * allocate.c: s/return (foo)/return foo/.
22066 * lalr.c: Likewise.
22068 * output.c: Likewise.
22069 * reader.c: Likewise.
22070 * symtab.c: Likewise.
22071 * vmsgetargs.c: Likewise.
22073 2000-03-31 Akim Demaille <akim@epita.fr>
22075 Clean up the error reporting functions.
22077 * src/report.c: New file.
22078 * src/report.h: Likewise.
22079 * src/Makefile.am: Adjust.
22080 * m4/error.m4: New file.
22081 * m4/Makefile.am: Adjust.
22082 * configure.in (jm_PREREQ_ERROR): Call it.
22083 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
22085 (fatal, fatals): Remove. All callers use complain.c::fatal.
22086 (warn, warni, warns, warnss, warnss): Remove. All callers use
22087 complain.c::complain.
22088 (toomany): Remove, use fatal instead.
22089 * src/files.c (done): No argument, use complain_message_count.
22090 * src/main.c (main): Register `done' to `atexit'.
22092 * src/getargs.c (usage): More `fputs', less `fprintf'.
22094 2000-03-28 Akim Demaille <akim@epita.fr>
22096 * lib/: New directory.
22097 * Makefile.am (SUBDIRS): Adjust.
22098 * configure.in: Adjust.
22099 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
22101 * src/alloca.c: Moved to lib/.
22102 * src/getopt.c: Likewise.
22103 * src/getopt1.c: Likewise.
22104 * src/getopt.h: Likewise.
22105 * src/ansi2knr.c: Likewise.
22106 * src/ansi2knr.1: Likewise.
22107 * src/Makefile.am: Adjust.
22108 * lib/Makefile.am: New file.
22110 2000-03-28 Akim Demaille <akim@epita.fr>
22112 * src/getargs.c (usage): Refresh the help message.
22114 2000-03-17 Akim Demaille <akim@epita.fr>
22116 * src/getopt1.c: Updated from textutils 2.0e
22117 * src/getopt.c: Likewise.
22118 * src/getopt.h: Likewise.
22120 2000-03-17 Akim Demaille <akim@epita.fr>
22122 * src/Makefile.am (bison.simple): Fix the awk program: quote only
22123 the file name, not the whole `#line LINE FILE'.
22125 2000-03-17 Akim Demaille <akim@epita.fr>
22127 On syntax errors, report the token on which we choked.
22129 * src/bison.s1 (yyparse): In the label yyerrlab, when
22130 YYERROR_VERBOSE, add yychar in msg.
22132 2000-03-17 Akim Demaille <akim@epita.fr>
22134 * src/reader.c (copy_at): New function.
22135 (copy_guard): Use it.
22136 (copy_action): Use it.
22138 2000-03-17 Akim Demaille <akim@epita.fr>
22140 Be kind to translators, save some useless translations.
22142 * src/main.c (banner): New function.
22143 (fatal_banner): Use it.
22144 (warn_banner): Use it.
22146 2000-03-17 Akim Demaille <akim@epita.fr>
22148 * src/reader.c (copy_definition): Use copy_string and
22149 copy_comment. Removed now unused `match', `ended',
22151 (copy_comment, copy_string): Moved, to be visible from
22154 2000-03-17 Akim Demaille <akim@epita.fr>
22156 * src/reader.c (copy_string): Declare `static inline'. No
22157 problems with inline, since it is checked by configure.
22158 (copy_comment): Likewise.
22160 2000-03-17 Akim Demaille <akim@epita.fr>
22162 * src/reader.c (packsymbols): Formatting changes.
22164 2000-03-17 Akim Demaille <akim@epita.fr>
22166 * src/reader.c (copy_comment): New function, factored out from:
22167 (copy_action): Use it. Removed now unused `match', `ended',
22169 (copy_guard): Likewise.
22171 2000-03-17 Akim Demaille <akim@epita.fr>
22173 * src/reader.c (copy_string): New function, factored out from:
22174 (copy_action): Use it.
22175 (copy_guard): Likewise.
22177 2000-03-17 Akim Demaille <akim@epita.fr>
22179 Change the handling of @s so that they behave exactly like $s.
22180 There is now a pseudo variable @$ (readble and writable), location
22181 of the lhs of the rule (by default ranging from the location of
22182 the first symbol of the rhs, to the location of the last symbol,
22183 or, if the rhs is empty, YYLLOC).
22185 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
22187 (yyparse): When providing a default semantic action, provide a
22188 default location action.
22189 (after the $): No longer change `*YYLSP', just stack YYLOC the
22190 same way you stack YYVAL.
22191 * src/reader.c (read_declarations): Use warns.
22192 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
22193 (copy_action, case '@'): Likewise.
22194 Use a standard error message, to save useless work from
22197 2000-03-17 Akim Demaille <akim@epita.fr>
22199 * src/bison.s1: Formatting and cosmetics changes.
22200 * src/reader.c: Likewise.
22201 Update the Copyright notice.
22203 2000-03-17 Akim Demaille <akim@epita.fr>
22205 * src/bison.s1 (#line): All set to `#line' only, since the
22206 Makefile now handles them.
22208 2000-03-16 Akim Demaille <akim@epita.fr>
22210 * src/output.c (output_rule_data): Output the documentation of
22211 some of the tables.
22212 (Copyright notice): Update.
22213 Formatting changes.
22215 2000-03-16 Akim Demaille <akim@epita.fr>
22217 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
22218 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
22219 One `#if YYDEBUG' remains, since it uses variables which are
22220 defined only if `YYDEBUG != 0'.
22222 2000-03-16 Akim Demaille <akim@epita.fr>
22224 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
22225 and related variables so that the similarities are highlighted.
22227 2000-03-16 Akim Demaille <akim@epita.fr>
22229 * src/bison.s1: Properly indent CPP directives.
22231 2000-03-16 Akim Demaille <akim@epita.fr>
22233 * src/bison.s1: Properly indent the `alloca' CPP section.
22235 2000-03-16 Akim Demaille <akim@epita.fr>
22237 Do not hard code values of directories in `configure.in'.
22238 Update the `configure' tool chain.
22240 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
22242 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
22243 (AC_OUTPUT): Add m4/Makefile.
22244 Bump to bison 1.28a, 1.29 has never been released.
22245 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
22246 handled via src/Makefile.am.
22247 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
22248 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
22250 * Makefile.am (SUBDIRS): Add m4.
22251 (ACLOCAL_AM_FLAGS): New variable.
22252 (AUTOMAKE_OPTIONS): Add check-news.
22253 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
22254 the proper line number and file name.
22255 (DEFS): Propagate the location of bison library files and of the
22257 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
22259 * acinclude.m4: Remove, replaced by the directory m4.
22260 * m4/Makefile.am (EXTRA_DIST): New variable.
22261 * m4/gettext.m4: New file, from the fileutils.
22262 * m4/lcmessage.m4: Likewise
22263 * m4/progtest.m4: Likewise.
22264 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
22266 2000-03-10 Akim Demaille <akim@epita.fr>
22269 Formatting changes of various comments.
22270 Respect the GNU coding standards at various places.
22271 Don't use `_()' when no translation is needed.
22273 1999-12-13 Jesse Thilo <jthilo@gnu.org>
22276 OS/2 honors TMPDIR environment variable.
22278 1999-12-13 Jesse Thilo <jthilo@gnu.org>
22280 * doc/bison.texinfo: Tweaked spelling and grammar.
22282 Removed reference to price of printed copy.
22283 Mention BISON_SIMPLE and BISON_HAIRY.
22285 1999-12-13 Jesse Thilo <jthilo@gnu.org>
22287 * configure.in, NEWS:
22288 Bison 1.29 released.
22290 1999-10-27 Jesse Thilo <jthilo@gnu.org>
22292 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
22293 Added reference card.
22295 1999-07-26 Jesse Thilo <jthilo@gnu.org>
22297 * po/ru.po: Added Russian translation.
22299 1999-07-26 Jesse Thilo <jthilo@gnu.org>
22301 * configure.in: Added Russian translation.
22303 1999-07-06 Jesse Thilo <jthilo@gnu.org>
22305 * configure.in, NEWS, README:
22306 Released version 1.28.
22308 1999-06-14 Jesse Thilo <jthilo@gnu.org>
22311 Squashed redefinition warning on some systems.
22313 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
22314 Have configure build version string instead of relying on ANSI string
22317 1999-06-14 Jesse Thilo <jthilo@gnu.org>
22319 * po/POTFILES.in: Got rid of version.c.
22321 1999-06-14 Jesse Thilo <jthilo@gnu.org>
22323 * acconfig.h, configure.in:
22324 Have configure build version string instead of relying on ANSI string
22327 1999-06-08 Jesse Thilo <jthilo@gnu.org>
22330 Dropped mention of `+' for long-named options.
22332 1999-05-30 Jesse Thilo <jthilo@gnu.org>
22334 * src/files.c: Added <unistd.h> for unlink().
22336 * src/Makefile.am, src/system.h:
22339 1999-05-30 Jesse Thilo <jthilo@gnu.org>
22341 * README: Added a FAQ list.
22343 * configure.in, acconfig.h:
22346 1999-05-30 Jesse Thilo <jthilo@gnu.org>
22348 * doc/FAQ, doc/Makefile.am:
22351 1999-05-19 Jesse Thilo <jthilo@gnu.org>
22353 * src/alloc.h, src/symtab.h, src/version.c:
22354 Protected inclusion of "config.h" with HAVE_CONFIG_H.
22356 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22358 * src/.cvsignore, src/Makefile.am:
22359 Reorganized: sources in `src', documentation in `doc'.
22361 * src/lex.c (literalchar):
22362 fixed the code for escaping double quotes (thanks
22365 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22367 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
22368 Adjusted paths to reflect directory reorganization.
22370 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22372 * doc/.cvsignore, doc/Makefile.am:
22373 Reorganized: sources in `src', documentation in `doc'.
22375 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22378 Updated AC_INIT file to reflect directory reorganization.
22380 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
22381 Reorganized: sources in `src', documentation in `doc'.
22383 1999-04-13 Jesse Thilo <jthilo@gnu.org>
22386 Don't declare calloc() and realloc() if not necessary.
22388 1999-04-13 Jesse Thilo <jthilo@gnu.org>
22390 * configure.in, acconfig.h, acinclude.m4:
22391 Don't declare calloc() and realloc() if not necessary.
22393 1999-03-23 Jesse Thilo <jthilo@gnu.org>
22395 * po/.cvsignore: Added i18n support.
22397 1999-03-23 Jesse Thilo <jthilo@gnu.org>
22399 * acconfig.h, configure.in, Makefile.am:
22400 Added i18n support.
22402 1999-03-22 Jesse Thilo <jthilo@gnu.org>
22404 * src/bison.s1: Fixed #line numbers.
22406 1999-03-15 Jesse Thilo <jthilo@gnu.org>
22408 * po/es.po, po/fr.po, po/nl.po, po/de.po:
22409 Added PO files from Translation Project.
22411 1999-03-03 Jesse Thilo <jthilo@gnu.org>
22414 Added support for non-ANSI compilers (ansi2knr).
22416 1999-02-16 Jesse Thilo <jthilo@gnu.org>
22418 * configure.in: Bumped version number to 1.27.
22421 Added `bison.simple' to list of files removed by `make distclean'.
22423 1999-02-12 Jesse Thilo <jthilo@gnu.org>
22425 * src/files.c, src/files.h:
22426 Defined locations of parser files in config.h instead of Makefile.
22428 1999-02-12 Jesse Thilo <jthilo@gnu.org>
22430 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
22431 Defined locations of parser files in config.h instead of Makefile.
22433 1999-02-09 Jesse Thilo <jthilo@gnu.org>
22436 Removed inappropriate use of $< macro.
22438 1999-02-05 Jesse Thilo <jthilo@gnu.org>
22440 * po/Makefile.in.in, po/POTFILES.in:
22441 Add `po' directory skeleton.
22443 1999-01-27 Jesse Thilo <jthilo@gnu.org>
22445 * README: Document help-bison list.
22447 * configure.in: Add check for mkstemp().
22449 1999-01-20 Jesse Thilo <jthilo@gnu.org>
22451 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
22452 Hush a few compiler warnings.
22455 Add tryclose(), which verifies that fclose was successful.
22456 Hush a couple of compiler warnings.
22458 1999-01-20 Jesse Thilo <jthilo@gnu.org>
22460 * Makefile.am, OChangeLog:
22461 ChangeLog is now automatically generated. Include the old version as
22464 1999-01-14 Jesse Thilo <jthilo@gnu.org>
22466 * 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:
22467 Update FSF address.
22469 1999-01-14 Jesse Thilo <jthilo@gnu.org>
22471 * doc/bison.texinfo: Fix formatting glitch.
22473 * doc/bison.texinfo: Update FSF address.
22475 1999-01-14 Jesse Thilo <jthilo@gnu.org>
22477 * acconfig.h: Update FSF address.
22479 1999-01-08 Jesse Thilo <jthilo@gnu.org>
22482 Don't define PACKAGE here, since config.h defines it.
22484 1998-12-30 Jesse Thilo <jthilo@gnu.org>
22486 * src/reader.c: Update copyright date.
22489 Ditch sprintf to statically-sized buffers in fatal/warn functions in
22490 favor of output directly to stderr (avoids buffer overruns).
22492 * src/reader.c: Some checks for premature EOF.
22494 * 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:
22495 Use prototypes if the compiler understands them.
22497 * src/files.c: Honor TMPDIR on Unix hosts.
22498 Use prototypes if the compiler understands them.
22501 Fix a couple of buffer overrun bugs.
22502 Use prototypes if the compiler understands them.
22504 * src/system.h: Include unistd.h and ctype.h.
22505 Use #ifdef instead of #if for NLS symbols.
22507 1998-12-30 Jesse Thilo <jthilo@gnu.org>
22509 * doc/bison.texinfo:
22510 Delete comment "consider using @set for edition number, etc..." since
22511 we now are doing so.
22513 1998-12-30 Jesse Thilo <jthilo@gnu.org>
22516 Use prototypes if the compiler understands them.
22518 * NEWS: Document 1.26 highlights.
22520 * Makefile.am: Require Automake 1.3 or later.
22523 Use prototypes if the compiler understands them.
22525 1998-12-29 Jesse Thilo <jthilo@gnu.org>
22528 Use VERSION symbol from automake for version number.
22530 1998-12-29 Jesse Thilo <jthilo@gnu.org>
22532 * acconfig.h, configure.in, version.cin:
22533 Use VERSION symbol from automake for version number.
22535 1998-11-28 Jesse Thilo <jthilo@gnu.org>
22538 Distribute original version of simple parser (bison.s1), not built
22539 version (bison.simple).
22541 1998-11-28 Jesse Thilo <jthilo@gnu.org>
22543 * doc/bison.texinfo: Add info dir entry.
22545 * doc/bison.texinfo:
22546 Let automake put version number into documentation.
22548 1998-11-26 Jesse Thilo <jthilo@gnu.org>
22550 * src/bison.cld, src/build.com, src/vmshlp.mar:
22551 Add non-RCS files from /gd/gnu/bison.
22553 1998-11-26 Jesse Thilo <jthilo@gnu.org>
22556 Document the BISON_HAIRY and BISON_SIMPLE variables.
22558 1998-11-25 Jesse Thilo <jthilo@gnu.org>
22560 * src/version.c: Build version.c automatically.
22563 Fix token numbering (used to start at 258, not 257).
22565 * src/system.h: Include config.h.
22567 * src/getargs.c: Update bug report address.
22569 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
22570 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
22572 1998-11-25 Jesse Thilo <jthilo@gnu.org>
22575 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
22577 * configure.in, version.cin:
22578 Build version.c automatically.
22580 * AUTHORS: Add AUTHORS file.
22582 * README: Update bug report address.
22585 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
22587 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
22588 Add automake stuff.
22590 1998-11-25 Jesse Thilo <jthilo@gnu.org>
22592 * doc/bison.texinfo: Clean up some formatting.
22594 1998-05-05 Richard Stallman <rms@gnu.org>
22596 * doc/bison.texinfo:
22597 Explain better why to make a pure parser.
22599 1998-01-05 Richard Stallman <rms@gnu.org>
22601 * src/files.c (openfiles):
22602 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
22603 find a temporary directory, if possible. Do not unlink files while
22606 1997-08-25 Richard Stallman <rms@gnu.org>
22608 * src/reader.c (stack_offset;):
22609 Change some warni to warns.
22611 * src/lex.c (literalchar): Use warns, not warni.
22613 1997-06-28 Richard Stallman <rms@gnu.org>
22615 * src/bison.s1: Add a Bison version comment.
22617 * src/main.c (fatal, warn, berror):
22620 1997-06-28 Richard Stallman <rms@gnu.org>
22622 * Makefile.in (bison_version): New variable.
22623 (dist): Use that variable.
22624 (bison.s1): Substitute the Bison version into bison.simple.
22626 * bison.simple: Add a Bison version comment.
22628 1997-06-18 Richard Stallman <rms@gnu.org>
22630 * src/main.c (fatal, warn, berror):
22631 Make error messages standard.
22632 (toomany): Improve error message text.
22634 * 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:
22635 new.h renamed to alloc.h.
22637 1997-06-18 Richard Stallman <rms@gnu.org>
22639 * Makefile.in: new.h renamed to alloc.h.
22641 1997-05-24 Richard Stallman <rms@gnu.org>
22643 * src/lex.c (literalchar):
22644 Fix the code for escaping \, " and '.
22646 (lex): Avoid trouble when there are many chars
22647 to discard in a char literal with just several chars in it.
22649 1997-05-17 Richard Stallman <rms@gnu.org>
22652 Use malloc, if using alloca is troublesome.
22653 (YYSTACK_USE_ALLOCA): New flag macro.
22654 Define it for some systems and compilers.
22655 (YYSTACK_ALLOC): New macro.
22656 (yyparse): Use YYSTACK_ALLOC to allocate stack.
22657 If it was malloc'd, free it.
22659 1997-05-17 Richard Stallman <rms@gnu.org>
22662 Use malloc, if using alloca is troublesome.
22663 (YYSTACK_USE_ALLOCA): New flag macro.
22664 Define it for some systems and compilers.
22665 (YYSTACK_ALLOC): New macro.
22666 (yyparse): Use YYSTACK_ALLOC to allocate stack.
22667 If it was malloc'd, free it.
22669 1997-04-23 Richard Stallman <rms@gnu.org>
22672 (alloca) [__hpux]: Always define as __builtin_alloca.
22674 1997-04-23 Richard Stallman <rms@gnu.org>
22677 (alloca) [__hpux]: Always define as __builtin_alloca.
22679 1997-04-22 Richard Stallman <rms@gnu.org>
22682 [__hpux]: Include alloca.h (right for HPUX 10)
22683 instead of declaring alloca (right for HPUX 9).
22685 * src/bison.s1 (__yy_memcpy):
22686 Declare arg `count' as unsigned int.
22687 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
22689 1997-04-22 Richard Stallman <rms@gnu.org>
22692 [__hpux]: Include alloca.h (right for HPUX 10)
22693 instead of declaring alloca (right for HPUX 9).
22695 * bison.simple (__yy_memcpy):
22696 Declare arg `count' as unsigned int.
22697 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
22699 1997-01-03 Richard Stallman <rms@gnu.org>
22701 * src/allocate.c: [__STDC__ or _MSC_VER]:
22702 Declare calloc and realloc to return void *.
22704 1997-01-02 Richard Stallman <rms@gnu.org>
22707 [_MSC_VER]: Include stdlib.h and process.h.
22708 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
22710 * src/main.c (main): Return FAILURE as a value.
22711 (printable_version): Declare arg as int, not char.
22713 1997-01-02 Richard Stallman <rms@gnu.org>
22715 * Makefile.in (dist):
22716 Explicitly check for symlinks, and copy them.
22718 1996-12-19 Richard Stallman <rms@gnu.org>
22721 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
22723 1996-12-18 Paul Eggert <eggert@gnu.org>
22725 * src/bison.s1 (yyparse):
22726 If __GNUC__ and YYPARSE_PARAM are both defined,
22727 declare yyparse to have a void * argument.
22729 1996-12-18 Paul Eggert <eggert@gnu.org>
22731 * bison.simple (yyparse):
22732 If __GNUC__ and YYPARSE_PARAM are both defined,
22733 declare yyparse to have a void * argument.
22735 1996-12-17 Richard Stallman <rms@gnu.org>
22737 * src/reduce.c (nbits): Add some casts.
22739 1996-08-12 Richard Stallman <rms@gnu.org>
22741 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
22743 1996-08-12 Richard Stallman <rms@gnu.org>
22745 * bison.simple: Test _MSDOS as well as _MSDOS_.
22747 1996-07-31 Richard Stallman <rms@gnu.org>
22750 [__sun && __i386]: Include alloca.h.
22752 1996-07-31 Richard Stallman <rms@gnu.org>
22755 [__sun && __i386]: Include alloca.h.
22757 1996-07-30 Richard Stallman <rms@gnu.org>
22759 * src/bison.s1: Comment change.
22761 * src/bison.s1: Test _MSDOS_, not MSDOS.
22763 1996-07-30 Richard Stallman <rms@gnu.org>
22765 * bison.simple: Comment change.
22767 * bison.simple: Test _MSDOS_, not MSDOS.
22769 1996-06-01 Richard Stallman <rms@gnu.org>
22771 * 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:
22772 Insert `_' macro around many string constants.
22775 Insert `_' macro around many string constants.
22777 (main): Call setlocale, bindtextdomain and textdomain.
22779 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
22780 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
22781 [ENABLE_NLS]: Include libintl.h.
22782 [ENABLE_NLS] (gettext): Define.
22783 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
22784 (N_, PACKAGE, LOCALEDIR): New macros.
22786 1996-06-01 Richard Stallman <rms@gnu.org>
22788 * POTFILES.in: New file.
22790 * Makefile.in (allocate.o):
22791 Define target explicitly.
22793 * Makefile.in (CFLAGS): Set to @CFLAGS@.
22794 (LDFLAGS): Set to @LDFLAGS@.
22795 (configure): Run autoconf only if preceding `cd' succeeds.
22796 (bison.s1): Redirect output to temporary file then move the
22797 temporary to the target, rather than redirecting directly to bison.s1.
22798 (clean): Remove config.status and config.log.
22799 (distclean): Don't remove config.status here.
22801 1996-05-12 Richard Stallman <rms@gnu.org>
22804 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
22806 1996-05-12 Richard Stallman <rms@gnu.org>
22809 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
22811 1996-05-11 Richard Stallman <rms@gnu.org>
22813 * src/bison.s1 (__yy_memcpy):
22814 Really reorder the args, as was supposedly done on Feb 14 1995.
22815 (yyparse): Calls changed accordingly.
22817 1996-05-11 Richard Stallman <rms@gnu.org>
22819 * Makefile.in (dist): Don't use $(srcdir).
22821 * bison.simple (__yy_memcpy):
22822 Really reorder the args, as was supposedly done on Feb 14 1995.
22823 (yyparse): Calls changed accordingly.
22825 1996-01-27 Richard Stallman <rms@gnu.org>
22827 * src/output.c (output_rule_data):
22828 Test YYERROR_VERBOSE in the conditional
22829 around the definition of ttyname.
22831 1995-12-29 Richard Stallman <rms@gnu.org>
22834 Fix line numbers in #line commands.
22836 1995-12-29 Richard Stallman <rms@gnu.org>
22839 Fix line numbers in #line commands.
22841 1995-12-27 Richard Stallman <rms@gnu.org>
22843 * src/bison.s1 (YYPARSE_PARAM_DECL):
22844 In C++, make it always null.
22845 (YYPARSE_PARAM_ARG): New macro.
22846 (yyparse): Use YYPARSE_PARAM_ARG.
22848 1995-12-27 Richard Stallman <rms@gnu.org>
22850 * bison.simple (YYPARSE_PARAM_DECL):
22851 In C++, make it always null.
22852 (YYPARSE_PARAM_ARG): New macro.
22853 (yyparse): Use YYPARSE_PARAM_ARG.
22855 1995-11-29 Richard Stallman <rms@gnu.org>
22857 * doc/bison.texinfo:
22858 Describe literal string tokens, %raw, %no_lines, %token_table.
22860 1995-11-29 Daniel Hagerty <hag@gnu.org>
22862 * doc/bison.texinfo: Fixed update date
22864 1995-10-16 Richard Stallman <rms@gnu.org>
22866 * src/version.c: Version 1.25.
22868 1995-10-16 Richard Stallman <rms@gnu.org>
22870 * NEWS: *** empty log message ***
22872 1995-10-16 Richard Stallman <rms@gnu.org>
22874 * doc/bison.1, doc/bison.rnh:
22877 1995-10-15 Richard Stallman <rms@gnu.org>
22879 * src/vmsgetargs.c, src/getargs.c:
22880 Added -n, -k, and -raw switches.
22881 (noparserflag, toknumflag, rawtoknumflag): New variables.
22883 * src/symtab.h (SALIAS):
22884 New #define for adding aliases to %token.
22885 (struct bucket): Added `alias' field.
22887 * src/reduce.c (reduce_grammar):
22888 Revise error message.
22889 (print_notices): Remove final `.' from error message.
22891 * src/reader.c (reader_output_yylsp):
22893 (readgram): Use `#if 0' around code that accepted %command
22894 inside grammar rules: The documentation doesn't allow it,
22895 and it will fail since the %command processors scan for the next %.
22896 (parse_token_decl): Extended the %token
22897 declaration to allow a multi-character symbol as an alias.
22898 (parse_thong_decl): New function.
22899 (read_declarations): Added %thong declarations.
22900 (read_declarations): Handle NOOP to deal with allowing
22901 % declarations as another means to specify the flags.
22902 (readgram): Allow %prec prior to semantics embedded in a rule.
22903 (skip_to_char, read_declarations, copy_definition)
22904 (parse_token_decl, parse_start_decl, parse_type_decl)
22905 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
22906 (get_type_name, copy_guard, copy_action, readgram)
22907 (get_type, packsymbols): Revised most error messages.
22908 Changed `fatal' to `warnxxx' to avoid aborting for error.
22909 Revised and use multiple warnxxx functions to avoid using VARARGS1.
22910 (read_declarations): Improve the error message for
22911 an invalid character. Do not abort.
22912 (read_declarations, copy_guard, copy_action): Use
22913 printable_version to avoid unprintable characters in printed output.
22914 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
22915 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
22916 Allow the type of a non-terminal can be given
22917 more than once, as long as all specifications give the same type.
22920 (output_headers, output_trailers, output, output_gram)
22921 (output_rule_data): Implement noparserflag variable.
22922 Implement toknumflag variable.
22923 (output): Call reader_output_yylsp to output LTYPESTR.
22925 * src/main.c (main):
22926 If reader sees an error, don't process the grammar.
22927 (fatals): Updated to not use VARARGS1.
22928 (printable_version, int_to_string, warn, warni, warns, warnss)
22929 (warnsss): New error reporting functions. Avoid abort for error.
22932 Added THONG and NOOP for alias processing.
22933 Added SETOPT for the new code that allows setting options with %flags.
22936 Include getopt.h. Add some extern decls.
22937 (safegetc): New function to deal with EOF gracefully.
22938 (literalchar); new function to deal with reading \ escapes.
22939 (lex): Use literalchar.
22940 (lex): Implemented "..." tokens.
22941 (literalchar, lex, parse_percent_token): Made tokenbuffer
22942 always contain the token. This includes growing the token
22943 buffer while reading an integer.
22944 (parse_percent_token): Replaced if-else statement with percent_table.
22945 (parse_percent_token): Added % declarations as another
22946 way to specify the flags -n, -l, and -r. Also added hooks for
22947 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
22948 major changes to files.c.
22949 (lex) Retain in the incoming stream a character following
22951 (skip_white_space, lex): Revised most error messages
22952 and changed fatal to warn to avoid aborting.
22953 (percent_table): Added %thong declarations.
22955 * src/gram.h: Comment changes.
22957 * src/files.c (openfiles, open_extra_files, done):
22959 and actfile file. Handle noparserflag. Both for -n switch.
22961 * src/conflicts.c (resolve_sr_conflict):
22962 Remove use of alloca.
22964 1995-06-01 Jim Meyering <meyering@gnu.org>
22966 * doc/bison.texinfo: *** empty log message ***
22968 1995-05-06 Richard Stallman <rms@gnu.org>
22970 * src/bison.s1: Comment change.
22972 1995-05-06 Richard Stallman <rms@gnu.org>
22974 * bison.simple: Comment change.
22976 1995-05-03 Richard Stallman <rms@gnu.org>
22978 * src/version.c: Version now 1.24.
22980 * src/bison.s1: Change distribution terms.
22982 * src/version.c: Version now 1.23.
22984 1995-05-03 Richard Stallman <rms@gnu.org>
22986 * doc/bison.texinfo:
22987 Rewrite "Conditions for Using Bison".
22988 Update version to 1.24.
22990 1995-05-03 Richard Stallman <rms@gnu.org>
22992 * bison.simple: Change distribution terms.
22994 1995-02-23 Richard Stallman <rms@gnu.org>
22996 * src/files.c: Test __VMS_POSIX as well as VMS.
22998 1995-02-14 Jim Meyering <meyering@gnu.org>
23000 * src/bison.s1 (__yy_memcpy):
23001 Renamed from __yy_bcopy to avoid
23002 confusion. Reverse FROM and TO arguments to be consistent with
23005 1995-02-14 Jim Meyering <meyering@gnu.org>
23007 * bison.simple (__yy_memcpy):
23008 Renamed from __yy_bcopy to avoid
23009 confusion. Reverse FROM and TO arguments to be consistent with
23012 1994-11-10 David J. MacKenzie <djm@gnu.org>
23018 * Makefile.in (DISTFILES): Include NEWS.
23020 * Makefile.in (DISTFILES):
23021 Include install-sh, not install.sh.
23023 * configure.in: Update to Autoconf v2 macro names.
23025 1994-10-05 David J. MacKenzie <djm@gnu.org>
23027 * Makefile.in: fix typo
23029 * Makefile.in (prefix, exec_prefix):
23030 Let configure set them.
23032 1994-09-28 David J. MacKenzie <djm@gnu.org>
23034 * Makefile.in: Set datadir to $(prefix)/share.
23036 1994-09-15 Richard Stallman <rms@gnu.org>
23039 Update copyright notice and GPL version.
23041 1994-09-15 Richard Stallman <rms@gnu.org>
23044 Update copyright notice and GPL version.
23046 1994-07-12 Richard Stallman <rms@gnu.org>
23048 * src/reduce.c, src/reader.c:
23051 1994-05-05 David J. MacKenzie <djm@gnu.org>
23053 * Makefile.in: entered into RCS
23055 1994-03-26 Richard Stallman <rms@gnu.org>
23057 * src/bison.s1: entered into RCS
23059 1994-03-26 Richard Stallman <rms@gnu.org>
23061 * bison.simple: entered into RCS
23063 1994-03-25 Richard Stallman <rms@gnu.org>
23065 * src/main.c: entered into RCS
23067 1994-03-24 Richard Stallman <rms@gnu.org>
23069 * src/conflicts.c: entered into RCS
23071 1994-01-02 Richard Stallman <rms@gnu.org>
23073 * Makefile.in: *** empty log message ***
23075 1993-11-21 Richard Stallman <rms@gnu.org>
23077 * src/bison.s1: *** empty log message ***
23079 1993-11-21 Richard Stallman <rms@gnu.org>
23081 * doc/bison.texinfo: entered into RCS
23083 * doc/bison.texinfo: *** empty log message ***
23085 1993-11-21 Richard Stallman <rms@gnu.org>
23087 * bison.simple: *** empty log message ***
23089 1993-10-25 David J. MacKenzie <djm@gnu.org>
23091 * doc/bison.texinfo: *** empty log message ***
23093 1993-10-19 Richard Stallman <rms@gnu.org>
23095 * src/bison.s1: *** empty log message ***
23097 1993-10-19 Richard Stallman <rms@gnu.org>
23099 * bison.simple: *** empty log message ***
23101 1993-10-14 Richard Stallman <rms@gnu.org>
23103 * src/bison.s1: *** empty log message ***
23105 1993-10-14 Richard Stallman <rms@gnu.org>
23107 * bison.simple: *** empty log message ***
23109 1993-09-14 David J. MacKenzie <djm@gnu.org>
23111 * doc/bison.texinfo: *** empty log message ***
23113 1993-09-13 Noah Friedman <friedman@gnu.org>
23115 * Makefile.in: *** empty log message ***
23117 1993-09-10 Richard Stallman <rms@gnu.org>
23119 * src/conflicts.c: *** empty log message ***
23121 * src/system.h: entered into RCS
23123 1993-09-10 Richard Stallman <rms@gnu.org>
23125 * doc/bison.1: entered into RCS
23127 1993-09-06 Noah Friedman <friedman@gnu.org>
23129 * src/version.c: entered into RCS
23131 1993-09-06 Noah Friedman <friedman@gnu.org>
23133 * Makefile.in: *** empty log message ***
23135 1993-07-30 David J. MacKenzie <djm@gnu.org>
23137 * Makefile.in: *** empty log message ***
23139 1993-07-24 Richard Stallman <rms@gnu.org>
23141 * src/bison.s1: *** empty log message ***
23143 1993-07-24 Richard Stallman <rms@gnu.org>
23145 * bison.simple: *** empty log message ***
23147 1993-07-08 David J. MacKenzie <djm@gnu.org>
23149 * Makefile.in: *** empty log message ***
23151 1993-07-04 Richard Stallman <rms@gnu.org>
23153 * src/bison.s1: *** empty log message ***
23155 1993-07-04 Richard Stallman <rms@gnu.org>
23157 * bison.simple: *** empty log message ***
23159 1993-06-26 David J. MacKenzie <djm@gnu.org>
23161 * src/getargs.c: entered into RCS
23163 1993-06-26 David J. MacKenzie <djm@gnu.org>
23165 * doc/bison.texinfo: *** empty log message ***
23167 * doc/bison.1: New file.
23169 1993-06-25 Richard Stallman <rms@gnu.org>
23171 * src/getargs.c: New file.
23173 1993-06-16 Richard Stallman <rms@gnu.org>
23175 * src/bison.s1: *** empty log message ***
23177 1993-06-16 Richard Stallman <rms@gnu.org>
23179 * bison.simple: *** empty log message ***
23181 1993-06-03 Richard Stallman <rms@gnu.org>
23183 * src/bison.s1: New file.
23185 1993-06-03 Richard Stallman <rms@gnu.org>
23187 * doc/bison.texinfo: *** empty log message ***
23189 1993-06-03 Richard Stallman <rms@gnu.org>
23191 * bison.simple: New file.
23193 1993-05-19 Richard Stallman <rms@gnu.org>
23195 * doc/bison.texinfo: New file.
23197 1993-05-07 Noah Friedman <friedman@gnu.org>
23199 * Makefile.in: *** empty log message ***
23201 1993-04-28 Noah Friedman <friedman@gnu.org>
23203 * src/reader.c: *** empty log message ***
23205 1993-04-23 Noah Friedman <friedman@gnu.org>
23207 * src/alloc.h: entered into RCS
23209 1993-04-20 David J. MacKenzie <djm@gnu.org>
23211 * src/version.c: *** empty log message ***
23213 * src/files.c, src/allocate.c:
23216 * src/reader.c: *** empty log message ***
23218 * src/lex.c: entered into RCS
23220 * src/conflicts.c: New file.
23222 * src/symtab.c: entered into RCS
23224 * src/alloc.h: New file.
23226 * src/LR0.c: entered into RCS
23228 1993-04-18 Noah Friedman <friedman@gnu.org>
23230 * src/reader.c: New file.
23232 * src/version.c: *** empty log message ***
23234 1993-04-18 Noah Friedman <friedman@gnu.org>
23236 * Makefile.in: *** empty log message ***
23238 1993-04-17 Noah Friedman <friedman@gnu.org>
23240 * Makefile.in: *** empty log message ***
23242 1993-04-15 Richard Stallman <rms@gnu.org>
23244 * src/main.c, src/files.c:
23247 1993-04-15 Noah Friedman <friedman@gnu.org>
23249 * configure.in: entered into RCS
23251 * configure.in: *** empty log message ***
23253 * configure.in: New file.
23255 1993-04-14 Richard Stallman <rms@gnu.org>
23257 * Makefile.in: New file.
23259 1993-04-13 Richard Stallman <rms@gnu.org>
23261 * src/version.c: New file.
23263 1993-03-25 Richard Stallman <rms@gnu.org>
23265 * src/output.c: entered into RCS
23267 1992-09-25 Richard Stallman <rms@gnu.org>
23269 * configure.bat: entered into RCS
23271 1992-06-22 Richard Stallman <rms@gnu.org>
23273 * src/vmsgetargs.c: entered into RCS
23275 1992-06-22 Richard Stallman <rms@gnu.org>
23277 * doc/bison.rnh: entered into RCS
23279 1992-04-20 David J. MacKenzie <djm@gnu.org>
23281 * README: entered into RCS
23283 1992-01-22 Richard Stallman <rms@gnu.org>
23285 * src/machine.h: entered into RCS
23287 1991-12-21 Richard Stallman <rms@gnu.org>
23289 * src/lalr.c, src/closure.c:
23292 1991-12-20 Richard Stallman <rms@gnu.org>
23294 * src/state.h: entered into RCS
23296 1991-12-18 Richard Stallman <rms@gnu.org>
23298 * src/print.c, src/nullable.c, src/derives.c:
23301 1991-11-03 David J. MacKenzie <djm@gnu.org>
23303 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
23306 1988-09-09 Richard Stallman <rms@gnu.org>
23308 * src/bison.hairy: entered into RCS
23310 1987-12-16 Richard Stallman <rms@gnu.org>
23312 * REFERENCES: entered into RCS
23317 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
23318 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
23319 2008, 2009 Free Software Foundation, Inc.
23321 Copying and distribution of this file, with or without
23322 modification, are permitted provided the copyright notice and this
23323 notice are preserved.