1 2008-12-08 Akim Demaille <demaille@gostai.com>
3 Fix regeneration of atconfig.
4 * tests/local.mk (tests/atconfig): The rule was incorrect, but
5 remove it: now that there is no tests/Makefile.am, the top-level
6 Makefile properly updates atconfig when needed.
8 2008-12-07 Di-an Jan <dianj@freeshell.org>
10 Implement the FIXME that ends an user action with a semicolon
11 if it seems necessary.
12 * src/scan-code.l (flex rules section): Flag cpp directive from
13 any `#' to the first unescaped end-of-line. Semicolon is not
14 needed after `;', `{', '}', or cpp directives and is needed after
15 any other token (whitespaces and comments have no effect).
16 * tests/actions.at (Fix user actions without a trailing semicolon):
18 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
19 to make user actions complete statements.
20 Adjust column numbers in error messages.
21 * tests/regression.at (Fix user actions without a trailing semicolon):
22 Remove. Covered by new test.
24 2008-12-07 Akim Demaille <demaille@gostai.com>
27 * gnulib: Update from master.
29 2008-12-05 Eric Blake <ebb9@byu.net>
31 Avoid compiler warning.
32 * src/output.c (muscle_insert_item_number_table): Delete unused
35 2008-12-02 Eric Blake <ebb9@byu.net>
37 Build testsuite with newer autoconf.
38 * tests/output.at (m4_expand): Don't override in newer autoconf,
39 where the underlying implementation changed.
40 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
41 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
42 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
43 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
44 since some of them contain unbalanced ')'.
46 2008-12-01 Akim Demaille <demaille@gostai.com>
48 Use b4_symbol for printers and destructors everywhere.
49 * data/bison.m4 (b4_symbol_action_location): New.
50 * data/c.m4 (b4_symbol_actions): Remove.
51 Adjust all callers to use by b4_symbol_foreach and the corresponding
52 b4_symbol_printer/destructor macro.
53 * data/glr.cc: Adjust.
54 * data/lalr1.java: Adjust the %destructor sanity check.
55 * src/output.c (symbol_code_props_output): Remove, we no longer
56 need the b4_symbol_printers/destructors tables.
58 2008-12-01 Akim Demaille <demaille@gostai.com>
61 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
64 2008-12-01 Akim Demaille <demaille@gostai.com>
66 Move b4_symbol based macro to bison.m4.
67 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
68 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
69 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
70 (b4_type_foreach): Move to...
71 * data/bison.m4: Here.
72 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
73 b4_symbol_value_template instead of b4_symbol_value.
75 2008-12-01 Akim Demaille <demaille@gostai.com>
77 b4_symbol/type_foreach.
78 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
81 2008-12-01 Akim Demaille <demaille@gostai.com>
83 Use the symbol properties to output the printer/destructor for lalr1.cc.
84 Instead of defining complex list of tuples to define various
85 properties of the symbols, we now prefer to define symbols as
86 "structs" in m4: using the symbol key (its number), and the
87 property name, b4_symbol gives it value. Use this to handle
88 destructors and printers.
90 * src/output.c (CODE_PROP): New.
91 (prepare_symbol_definitions): Use it to define the printer and
92 destructor related attributes of the symbols.
93 * data/lalr1.cc (b4_symbol_actions): Rename as...
94 (b4_symbol_action): this.
95 Use b4_symbol instead of 6 arguments.
96 (b4_symbol_printer, b4_symbol_destructor): New.
97 Use them instead of b4_symbol_actions.
99 2008-12-01 Akim Demaille <demaille@gostai.com>
101 Avoid capturing variables too easily.
102 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
103 v__ and p__ instead of v and p.
105 2008-12-01 Akim Demaille <demaille@gostai.com>
107 Remove spurious empty line before syncline.
108 * data/bison.m4 (b4_syncline): Don't output an empty line before
111 2008-11-26 Akim Demaille <demaille@gostai.com>
113 Convert lib/Makefile.am into lib/local.mk.
114 The real problem is rather gnulib.mk, which itself is extracted
115 from a Makefile.am that gnulib expects to the "recursive". The
116 tool prefix-gnulib-mk converts such a gnulib.mk to be
117 non-recursive. Also, some AC_SUBST variables need to be adjusted.
119 * etc/prefix-gnulib-mk: New.
120 * bootstrap (slurp): Use it to convert further gnulib.mk.
121 No longer try to avoid re-creation of lib/gnulib.mk as the changes
123 * lib/Makefile.am: Rename as...
124 * lib/local.mk: this.
125 Adjust to be prefixed.
126 * Makefile.am, configure.ac: Adjust.
127 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
129 2008-11-26 Akim Demaille <demaille@gostai.com>
132 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
133 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
134 Reported by Eric Blake.
136 2008-11-26 Akim Demaille <demaille@gostai.com>
138 Use b4_parser_tables_define in glr.cc.
139 * data/glr.c: Use b4_parser_tables_define instead of defining the
140 (deterministic integral) tables by hand.
142 2008-11-26 Akim Demaille <demaille@gostai.com>
144 Use b4_parser_tables_define in Java.
145 * data/java.m4 (b4_typed_parser_table): Rename as...
146 (b4_typed_parser_table_define): this, for consistency.
147 Accept a comment as $4.
149 (b4_integral_parser_table): Rename as...
150 (b4_integral_parser_table_define): this.
151 * data/lalr1.java: Adjust all uses.
152 Use b4_parser_tables_define instead of generation by hand.
154 2008-11-26 Akim Demaille <demaille@gostai.com>
156 Prepare the convergence bw C style and Java table generation.
157 * data/bison.m4 (b4_tables_map, b4_tables_declare)
158 (b4_tables_define): Rename as...
159 (b4_integral_parser_tables_map, b4_parser_tables_declare)
160 (b4_parser_tables_define): these.
161 * data/c.m4 (b4_table_define): Rename as...
162 (b4_integral_parser_table_define): this.
163 * data/lalr1.cc: Adjust.
164 (b4_table_define, b4_table_declare): Rename as...
165 (b4_integral_parser_table_define)
166 (b4_integral_parser_table_declare): these.
167 (yyrline_): Move the comment where it is actually used.
168 * data/yacc.c: Adjust.
169 (yyrline): Use b4_integral_parser_table_define.
171 2008-11-26 Akim Demaille <demaille@gostai.com>
174 * src/parse-gram.h, src/parse-gram.c: Regen.
176 2008-11-26 Akim Demaille <demaille@gostai.com>
178 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
179 * data/lalr1.cc (b4_tables_map): Move to...
180 * data/bison.m4: here.
181 Update the comment for yytable during the flight.
182 (b4_tables_declare, b4_tables_define): New.
183 * data/lalr1.cc: Use them.
184 * data/c.m4 (b4_table_define): New.
185 * data/yacc.c: Use b4_tables_define instead of output the tables
187 * tests/regression.at (Web2c Actions): Adjust the expected output,
188 the order of the tables changed.
190 2008-11-26 Akim Demaille <demaille@gostai.com>
192 Get rid of (yy)rhs and (yy)prhs.
193 These tables are no longer needed in the parsers, and they don't seem to
194 be useful. They are not documented either.
196 * src/output.c (prepare_rules): Get rid of rhs and prhs.
197 Adjust the computation of (yy)r2.
199 2008-11-26 Akim Demaille <demaille@gostai.com>
201 Rule length is unsigned.
202 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
204 2008-11-26 Akim Demaille <demaille@gostai.com>
206 Get rid of lalr1-split.cc.
207 It was no longer maintainer.
209 * data/lalr1-split.cc: Remove.
210 * etc/bench.pl.in (bench_fusion_parser): Remove.
213 2008-11-26 Akim Demaille <demaille@gostai.com>
215 Use yy* consistently.
216 * data/glr.c: Now that yyrhs no longer exists as a global
217 variable, rename local "rhs" variables into "yyrhs" for
220 2008-11-25 Akim Demaille <demaille@gostai.com>
222 Get rid of yyrhs and yyprhs in glr.c.
223 * data/glr.c (yyrhs, yyprhs): Remove.
224 Instead, use the state stack and yystos.
226 2008-11-25 Akim Demaille <demaille@gostai.com>
229 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
230 as an Autotest keyword.
232 2008-11-25 Akim Demaille <demaille@gostai.com>
234 Prefer TESTSUITE_FLAGS.
235 TESTSUITEFLAGS is barely readable.
237 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
238 for backward compatibility.
239 Use the former instead of the latter.
241 2008-11-25 Akim Demaille <demaille@gostai.com>
243 Get rid of yyrhs and yyprhs in larl1.java.
244 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
245 (yy_reduce_print): Rather, use yystos_ and the state stack.
247 2008-11-25 Akim Demaille <demaille@gostai.com>
251 2008-11-25 Akim Demaille <demaille@gostai.com>
253 Get rid of yyrhs and yyprhs in yacc.c.
254 They were used to get the symbol types, given a rule number, when
255 displaying the top of the stack before a reduction. But the
256 symbol type is available from the state stack. This has two be
257 benefits: two tables less in the parser (making it smaller), and a
258 more consistent use of the three stacks which will help to fuse
261 * data/yacc.c (yyprhs, yyrhs): Remove.
262 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
263 (yy_reduce_print): Take yyssp as argument.
264 Use it, together with yystos, to get the symbol type.
265 * tests/regression.at (Web2c Report): Remove these tables from the
268 2008-11-25 Akim Demaille <demaille@gostai.com>
271 The point is to factor the generation of the tables across skeletons.
272 This is language dependant.
274 * data/c.m4 (b4_comment_): New.
275 Should be usable to define how to generate tables independently of
278 (b4_comment): Bounce to b4_c_comment.
279 Now support $2 = [PREFIX] for indentation.
280 * data/lalr1.cc (b4_table_declare): Don't output a comment if
282 Indent it properly when there is one.
283 Output the ending semicolon.
284 (b4_table_define): Space changes.
285 Output the ending semicolon.
286 (b4_tables_map): New.
287 Use it twice instead of declaring and defining the (integral)
290 2008-11-25 Akim Demaille <demaille@gostai.com>
293 * data/lalr1.cc (b4_table_declare): New.
294 Use it to declare the tables defined with b4_table_define.
295 (b4_table_define): Declare a third arg to match b4_table_declare
297 Move all the comments around invocations of b4_table_define into
298 the invocations itselves.
299 Move things around to have the order for declarations and
302 2008-11-25 Akim Demaille <demaille@gostai.com>
305 * data/lalr1.java: here.
307 2008-11-25 Akim Demaille <demaille@gostai.com>
309 b4_args is more general than only C++.
310 * data/lalr1.cc (b4_args, _b4_args): Move to...
311 * data/bison.m4: here.
313 2008-11-21 Di-an Jan <dianj@freeshell.org>
315 Implement no-XXX arguments for --warnings, --report, --trace.
316 * src/getargs.c (flags_argmatch): Handles no-XXX.
317 Fix typo in doxygen comment.
319 2008-11-21 Akim Demaille <demaille@gostai.com>
321 Display the changes in cross-options.texi.
322 * build-aux/cross-options.pl ($sep): New, to separate items.
323 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
326 2008-11-20 Di-an Jan <dianj@freeshell.org>
328 Improves options in the manual.
329 * doc/bison.texinfo (-g, -x): Add space before argument.
330 (Option Cross Key): Implement FIXME: listing directives also.
331 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
332 (Short Option): Special case -d. Put arguments inside @option.
333 (Bison Directive): Add column, automatically extracted from
334 src/scan-gram.l (actual name passed as the first argument)
335 with special case for %define.
336 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
337 to build-aux/cross-options.pl.
338 * src/getargs.c (usage): Document limitations of cross-options.pl.
339 * src/scan-gram.l: Likewise.
341 2008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
343 Fix unexpanded macros in GLR defines file.
344 Reported by Csaba Raduly at
345 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
346 * THANKS (Csaba Raduly): Add.
347 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
348 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
349 lexer in a separate module that includes the defines file.
350 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
352 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
353 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
354 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
355 (AT_DATA_SOURCE_PROLOGUE): New.
356 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
357 (AT_DATA_SOURCE): New.
358 (AT_FULL_COMPILE): Extend to support an additional source file.
360 2008-11-18 Akim Demaille <demaille@gostai.com>
363 * TODO: More short term issues.
365 2008-11-18 Akim Demaille <demaille@gostai.com>
368 * src/parse-gram.h, src/parse-gram.c: Regen.
370 2008-11-18 Akim Demaille <demaille@gostai.com>
372 Use b4_subtract where possible.
373 * data/lalr1.cc (b4_subtract): Move to...
374 * data/bison.m4: here.
375 * data/glr.c (b4_rhs_data): Use it.
376 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
378 2008-11-18 Akim Demaille <demaille@gostai.com>
380 Remove incorrect mode specification.
381 * data/glr.cc: Don't pretend it's C code.
383 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
385 Simplify last patch slightly.
386 * src/getargs.c (getargs): Here.
388 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
390 Fix last warning from --enable-gcc-warnings.
391 * src/getargs.c (getargs): Don't assign const address to non-const
394 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
396 Don't let maintainer-*-check targets force a version update.
397 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
400 2008-11-17 Di-an Jan <dianj@freeshell.org>
402 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
403 Align menus. Adjust word wrapping. Use node names for menu names.
404 (Examples): Don't abbreviate node names.
405 (LocalWords): Remove abbreviations.
406 (Copying): Make description a sentence.
407 (Java Action Features): Remove period to match the rest of menu.
409 2008-11-17 Di-an Jan <dianj@freeshell.org>
411 Handles several --enable-gcc-warnings.
412 * src/getargs.c (command_line_location): Set parameters to void.
413 * src/output.c (symbol_type_name_cmp): Make static.
414 (symbols_by_type_name): Set parameters to void.
415 (symbol_definitions_output): Remove unused parameter. Rename as...
416 (prepare_symbol_definitions): this.
417 (muscles_output): Move symbol_definitions_output to...
418 (output): here as prepare_symbol_definitions.
419 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
420 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
422 2008-11-17 Di-an Jan <dianj@freeshell.org>
424 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
425 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
427 2008-11-16 Akim Demaille <demaille@gostai.com>
429 Add missing $(EXEEXT).
430 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
431 "src/bison$(EXEEXT)".
432 Reported by Di-an Jan.
434 2008-11-15 Akim Demaille <demaille@gostai.com>
438 2008-11-15 Akim Demaille <demaille@gostai.com>
441 * tests/input.at: here.
443 2008-11-15 Akim Demaille <demaille@gostai.com>
445 Remove duplicate header inclusion.
448 2008-11-15 Akim Demaille <demaille@gostai.com>
450 * src/parse-gram.h, src/parse-gram.c: Regen.
452 2008-11-15 Akim Demaille <demaille@gostai.com>
454 Support parametric types.
456 There are two issues to handle: first scanning nested angle
457 bracket pairs to support types such as std::pair< std::string,
458 std::list<std::string> > >.
460 Another issue is to address idiosyncracies of C++: do not glue two
461 closing angle brackets together (otherwise it's operator>>), and
462 avoid sticking blindly a TYPE to the opening <, as it can result
463 in '<:' which is a digraph for '['.
465 * src/scan-gram.l (brace_level): Rename as...
468 Implement support for complex tags.
471 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
472 (b4_symbol_variant): Leave space around types as parameters.
473 * examples/variant.yy: Use nested template types and leading ::.
474 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
476 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
477 * tests/c++.at: Test parametric types.
479 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
482 This is not sufficient, but we test at least that the make_SYMBOL
483 interface is not affected by token.prefix. A more general test
484 will be implemented when the support of token.prefix is generalized
487 * tests/c++.at: One more variant test, using token.prefix.
489 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
491 Test the make_TOKEN interface.
492 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
493 Factor the common code in yylex.
494 Use it to test "%define lex_symbol".
496 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
500 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
502 Simplify code for variants bench marks.
503 * etc/bench.pl.in (&generate_grammar_list): Define and use
505 Factor the common code in yylex.
507 2008-11-15 Akim Demaille <demaille@gostai.com>
509 Better error message.
510 * bootstrap (find_tool): Fix the error message.
512 2008-11-15 Akim Demaille <demaille@gostai.com>
514 Update variant.yy to newest interface.
515 * examples/variant.yy: Define lex_symbol.
518 2008-11-15 Akim Demaille <demaille@gostai.com>
520 Don't use locations in variant.yy.
521 * examples/variant.yy: Adjust to not using locations.
523 2008-11-15 Akim Demaille <demaille@gostai.com>
526 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
527 comments for the license.
529 2008-11-15 Akim Demaille <demaille@gostai.com>
531 Remove tests/Makefile.am.
532 * tests/Makefile.am: Rename as...
533 * tests/local.mk: this.
534 * Makefile.am, configure.ac: Adjust.
535 * Makefile.am (DISTCLEANFILES): Define.
536 (maintainer-check, maintainer-xml-check, maintainer-push-check):
537 Remove, we no longer need to bounce to the real targets.
539 2008-11-15 Akim Demaille <demaille@gostai.com>
543 2008-11-15 Akim Demaille <demaille@gostai.com>
546 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
547 * djgpp/local.mk: this new file.
549 2008-11-15 Akim Demaille <demaille@gostai.com>
551 Remove doc/Makefile.am.
552 * doc/Makefile.am: Rename as...
553 * doc/local.mk: this.
555 * Makefile.am, configure.ac: Adjust.
556 * Makefile.am (MOSTLYCLEANFILES): New.
557 * src/local.mk: Adjust.
559 2008-11-15 Akim Demaille <demaille@gostai.com>
561 Move sc_tight_scope into maint.mk.
562 It does not work, and I don't know how it was supposed to work: it
563 seems to be looking for sources in the build tree. I just moved
564 it at a better place, fixing it is still required.
566 * src/local.mk (echo): Remove.
567 (sc_tight_scope): Move to...
570 2008-11-15 Akim Demaille <demaille@gostai.com>
573 * src/parse-gram.h, src/parse-gram.h: Regen.
575 2008-11-15 Akim Demaille <demaille@gostai.com>
577 Remove src/Makefile.am.
578 * src/Makefile.am: Rename as...
579 * src/local.mk: this.
580 Prefix all the paths with src/.
581 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
582 (AM_CPPFLAGS): Find find in builddir/src.
583 (YACC): Move the flags into...
585 * maint.mk (sc_tight_scope): Disable.
586 It used to bounce to the version in src/Makefile.am which is now
587 part of this very Makefile.
588 * Makefile.am, configure.ac: Adjust.
589 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
590 include "..." to find files "here": we are no longer in src/, so
591 qualify the includes with src/.
592 * doc/Makefile.am (PREPATH): No longer include the top_builddir
594 (.x.1): Adjust to be able to create src/foo from the top level
595 Makefile, instead of going bounce to src/Makefile the creation of
598 2008-11-15 Akim Demaille <demaille@gostai.com>
600 Remove useless variable.
601 * doc/Makefile.am (srcsrcdir): Remove.
603 2008-11-15 Akim Demaille <demaille@gostai.com>
605 Remove data/Makefile.am.
606 * data/Makefile.am: Rename as...
607 * data/local.mk: this.
609 * Makefile.am, configure.ac: Adjust.
611 2008-11-15 Akim Demaille <demaille@gostai.com>
613 Remove etc/Makefile.am.
614 * etc/Makefile.am: Rename as...
615 * etc/local.mk: this.
617 * Makefile.am, configure.ac: Adjust.
619 2008-11-15 Akim Demaille <demaille@gostai.com>
621 Remove examples/local.mk.
622 examples/calc++/Makefile.am might be interesting to keep as is, since
623 it is an example in itself.
625 * examples/Makefile.am: Rename as...
626 * examples/local.mk: this.
628 * Makefile.am, configure.ac: Adjust.
630 2008-11-15 Akim Demaille <demaille@gostai.com>
632 Remove build-aux/Makefile.am.
633 Recursive Makefiles are really way too slow, let's get rid of some of
636 * build-aux/Makefile.am: Rename as...
637 * build-aux/local.mk: this.
639 * Makefile.am, configure.ac: Adjust.
641 2008-11-15 Akim Demaille <demaille@gostai.com>
643 Provide convenience constructors for locations and positions.
644 * data/location.cc (position::position): Accept file, line and
645 column as arguments with default values.
646 Always qualify initial line and column literals as unsigned.
647 (location::location): Provide convenience constructors.
649 2008-11-15 Akim Demaille <demaille@gostai.com>
651 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
653 Using template buys us nothing, and makes it uselessly complex to
654 construct a symbol. Besides, it could not be generalized to other
655 languages, while make_FOO would work in C/Java etc.
657 * data/lalr1.cc (b4_symbol_): New.
659 (b4_symbol_constructor_declaration_)
660 (b4_symbol_constructor_definition_): Instead of generating
661 specializations of an overloaded template function, just generate
662 several functions whose names are forged from the token names
663 without the token.prefix.
664 (b4_symbol_constructor_declarations): Generate them for all the
665 symbols, not just by class of symbol type, now that instead of
666 specializing a function template by the token, we generate a
667 function named after the token.
668 (b4_symbol_constructor_specialization_)
669 (b4_symbol_constructor_specializations): Remove.
670 * etc/bench.pl.in: Adjust to this new API.
672 2008-11-13 Akim Demaille <demaille@gostai.com>
674 %define token.prefix.
675 Provide a means to add a prefix to the name of the tokens as
676 output in the generated files. Because of name clashes, it is
677 good to have such a prefix such as TOK_ that protects from names
678 such as EOF, FILE etc. But it clutters the grammar itself.
680 * data/bison.m4 (token.prefix): Empty by default.
681 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
682 * data/lalr1.cc (b4_symbol): Ditto.
684 2008-11-13 Akim Demaille <demaille@gostai.com>
686 Compute at M4 time some of the subtractions.
687 * data/lalr1.cc (b4_subtract): New.
688 (b4_rhs_data): Use it.
690 2008-11-13 Akim Demaille <demaille@gostai.com>
693 This allows the user to get the type of a token returned by yylex.
695 * data/lalr1.cc (symbol::token): New.
696 (yytoknum_): Define when %define lex_symbol, independently of
698 (yytoken_number_): Move into...
699 (symbol::token): here, since that's the only use.
700 The other one is YYPRINT which was not officially supported
701 by lalr1.cc, and anyway it did not work since YYPRINT uses this
702 array under a different name (yytoknum).
704 2008-11-13 Akim Demaille <demaille@gostai.com>
707 * TODO (YYERRCODE): Mention the case of $undef.
709 2008-11-13 Akim Demaille <demaille@gostai.com>
712 * TODO (YYPRINT): New.
714 2008-11-13 Akim Demaille <demaille@gostai.com>
717 * data/lalr1.cc, data/yacc.c: Fix the description of the
718 yytranslate and yytoknum tables.
720 2008-11-13 Akim Demaille <demaille@gostai.com>
722 Define make_symbol in the header.
723 To reach good performances these functions should be inlined (yet
724 this is to measure precisely). To this end they must be available
727 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
728 location_type with the class name.
729 Since will now be output in the header, declare "inline".
730 No longer use b4_symbol_constructor_specializations, but
731 b4_symbol_constructor_definitions in the header.
732 Don't call it in the *.cc file.
734 2008-11-13 Akim Demaille <demaille@gostai.com>
736 Define yytranslate in the header for lex_symbol.
737 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
738 into the header file when using %define lex_symbol.
739 (yytranslate_): Declare inline.
741 2008-11-13 Akim Demaille <demaille@gostai.com>
743 Define the constructors of symbol_type in
744 b4_symbol_constructor_definitions.
745 The constructors are called by the make_symbol functions, which a
746 forthcoming patch will move elsewhere. Hence the interest of
747 putting them together.
749 The stack_symbol_type does not need to be moved, it is used only
752 * data/lalr1.cc: Move symbol_type and symbol_base_type
754 (b4_symbol_constructor_definitions): here.
757 2008-11-13 Akim Demaille <demaille@gostai.com>
759 Make it easier to move the definition of yytranslate_.
760 Forthcoming changes will make it possible to use yytranslate_
761 from outside the parser implementation file.
763 * data/lalr1.cc (b4_yytranslate_definition): New.
766 2008-11-13 Akim Demaille <demaille@gostai.com>
768 Remove useless class specification.
769 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
770 to refer to the class name to use a type defined by the class for
771 arguments of member functions.
773 2008-11-13 Akim Demaille <demaille@gostai.com>
775 Finer input type for yytranslate.
776 This patch is debatable: the tradition expects yylex to return an int
777 which happens to correspond to token_number (which is an enum). This
778 allows for instance to return characters (such as '*' etc.). But this
779 goes against the stronger typing I am trying to have with the new
780 lex interface which return a symbol_type. So in this case, feed
781 yytranslate_ with a token_type.
783 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
786 2008-11-13 Akim Demaille <demaille@gostai.com>
788 Honor lex-params in %define lex_symbol mode.
789 * data/lalr1.cc: Use b4_lex_param.
791 2008-11-13 Akim Demaille <demaille@gostai.com>
794 * src/output.c (symbol_definitions_output): Rename symbol
795 attributes type_name and has_type_name as type and has_type.
796 * data/lalr1.cc: Adjust uses.
798 2008-11-13 Akim Demaille <demaille@gostai.com>
800 Use b4_type_names for the union type.
801 The union used to compute the size of the variant used to iterate
802 over the type of all the symbols, with a lot of redundancy. Now
803 iterate over the lists of symbols having the same type-name.
805 * data/lalr1.cc (b4_char_sizeof_): New.
806 (b4_char_sizeof): Use it.
807 Adjust to be called with a list of numbers instead of a single
809 Adjust its caller for new-line issues.
811 2008-11-13 Akim Demaille <demaille@gostai.com>
813 Define the "identifier" of a symbol.
814 Symbols may have several string representations, for instance if
815 they have an alias. What I call its "id" is a string that can be
816 used as an identifier. May not exist.
818 Currently the symbols which have the "tag_is_id" flag set are
819 those that don't have an alias. Look harder for the id.
821 * src/output.c (is_identifier): Move to...
822 * src/symtab.c (is_identifier): here.
823 * src/symtab.h, src/symtab.c (symbol_id_get): New.
824 * src/output.c (symbol_definitions_output): Use it to define "id"
826 Remove the definition of "tag_is_id".
827 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
828 "tag_is_id" were used to produce code.
829 We still use "tag" for documentation.
831 2008-11-11 Akim Demaille <demaille@gostai.com>
833 Locations are no longer required by lalr1.cc.
834 * data/lalr1.cc (_b4_args, b4_args): New.
835 Adjust all uses of locations to make them optional.
836 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
837 (AT_CHECK_NAMESPACE): Check the use of locations.
838 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
839 without locations with lalr1.cc.
841 * tests/output.at: Check lalr1.cc with and without location
843 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
846 2008-11-11 Akim Demaille <demaille@gostai.com>
849 * tests/local.at (AT_FULL_COMPILE): New.
850 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
852 2008-11-11 Akim Demaille <demaille@gostai.com>
854 Support parens in calc++.
855 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
856 * examples/calc++/test (run): Check the expected output.
860 2008-11-11 Akim Demaille <demaille@gostai.com>
862 Simplify lalr1.cc since %defines is mandatory.
863 * data/lalr1.cc: Remove useless calls to b4_defines_if.
865 2008-11-11 Akim Demaille <demaille@gostai.com>
868 * TODO (yysyntax_error): New item.
870 2008-11-11 Akim Demaille <demaille@gostai.com>
873 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
876 2008-11-11 Akim Demaille <demaille@gostai.com>
878 Support i18n of the parse error messages.
879 * TODO (lalr1.cc/I18n): Remove.
880 * data/lalr1.cc (yysyntax_error_): Support the translation of the
881 error messages, as done in yacc.c.
882 Stay within the yy* pseudo namespace.
884 2008-11-11 Akim Demaille <demaille@gostai.com>
887 * TODO (single stack, yysyntax_error): New.
889 2008-11-11 Akim Demaille <demaille@gostai.com>
891 Make it possible to return a symbol_type from yylex.
892 * data/lalr1.cc (b4_lex_symbol_if): New.
893 (parse): When lex_symbol is defined, expected yylex to return the
895 * etc/bench.pl.in (generate_grammar_list): Extend to support this
897 (bench_variant_parser): Exercise it.
899 2008-11-11 Akim Demaille <demaille@gostai.com>
901 Remove useless bench case.
902 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
905 2008-11-11 Akim Demaille <demaille@gostai.com>
907 Improve display of directives.
908 * etc/bench.pl.in (parse_term): Don't add useless eol.
910 2008-11-11 Akim Demaille <demaille@gostai.com>
912 Use string_cast in the bench.
913 * etc/bench.pl.in (generate_grammar_list): Define and use
916 2008-11-11 Akim Demaille <demaille@gostai.com>
918 Replace yychar with a Boolean.
919 * data/lalr1.cc (parse::yychar): Replace by...
920 (parse::yyempty): this.
922 2008-11-11 Akim Demaille <demaille@gostai.com>
927 2008-11-11 Akim Demaille <demaille@gostai.com>
929 Let yytranslate handle the eof case.
930 * data/lalr1.cc (yytranslate_): Handle the EOF case.
932 No longer expect yychar to be equal to yyeof_, rather, test the
933 lookahead's (translated) kind.
935 2008-11-11 Akim Demaille <demaille@gostai.com>
937 yychar cannot be empty in yyerrlab.
938 * TODO (yychar == yyempty_): New.
939 * data/lalr1.cc: Remove the handling of this case.
940 This eases forthcoming changes related to yychar and yytranslate.
942 2008-11-11 Akim Demaille <demaille@gostai.com>
944 Bench: syntactic sugar for %define/#define.
945 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
946 (&bench_push_parser, bench_variant_parser): Use this feature.
950 2008-11-11 Akim Demaille <demaille@gostai.com>
952 Less memory pressure on the "list" bench.
953 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
954 the values, to limit memory pressure.
956 2008-11-11 Akim Demaille <demaille@gostai.com>
958 Introduce make_symbol.
959 make_symbol provides a means to construct a full symbol (kind,
960 value, location) in a single shot. It is meant to be a Symbol
961 constructor, parameterized by the symbol kind so that overloading
962 would prevent incorrect kind/value pairs. Unfortunately
963 parameterized constructors do not work well in C++ (unless the
964 parameter also appears as an argument, which is not acceptable),
965 hence the use of a function instead of a constructor.
967 * data/lalr1.cc (b4_symbol_constructor_declaration_)
968 (b4_symbol_constructor_declarations)
969 (b4_symbol_constructor_specialization_)
970 (b4_symbol_constructor_specializations)
971 (b4_symbol_constructor_definition_)
972 (b4_symbol_constructor_definitions): New.
973 Use them where appropriate to generate declaration, declaration of
974 the specializations, and implementations of the templated
975 overloaded function "make_symbol".
976 (variant::variant): Always define a default ctor.
977 Also provide a copy ctor.
978 (symbol_base_type, symbol_type): New ctor overloads for value-less
980 (symbol_type): Now public, so that functions such as yylex can use
983 2008-11-11 Akim Demaille <demaille@gostai.com>
985 Inform m4 whether a tag is a valid id.
986 * src/output.c (is_identifier): New.
987 (symbol_definitions_output): Use it to define tag_is_id.
988 But maybe this should be done at m4 level?
990 2008-11-11 Akim Demaille <demaille@gostai.com>
992 Test 214 was failing: it greps with a pattern containing [ ]*
993 which obviously meant to catch spaces and tabs, but contained only
994 spaces. Tabulations in sources are a nuisance, so to simplify the
995 matter, get rid of all the tabulations in the Java sources. The
996 other skeletons will be treated equally later.
998 * data/java.m4, data/lalr1.java: Untabify.
999 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
1000 tabulations are no longer generated.
1002 2008-11-11 Paolo Bonzini <bonzini@gnu.org>
1004 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
1005 * configure.ac: Adjust usage.
1006 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1007 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1008 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
1010 2008-11-10 Di-an Jan <dianj@freeshell.org>
1012 Workaround Java's ``code too large'' problem for parser tables
1013 in most cases, by using one function per initialization.
1014 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
1015 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
1016 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
1017 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
1018 (yytname_): Use b4_typed_parser_table.
1019 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
1020 ``code too large'' error.
1022 2008-11-10 Di-an Jan <dianj@freeshell.org>
1024 * NEWS: Document them.
1026 General Java skeleton improvements.
1027 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
1028 using gcj < 4.3 in the testsuite, according to comments in
1029 gnulib/m4/javacomp.m4.
1030 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
1031 location_type, position_type): Remove extraneous brackets from
1032 b4_percent_define_default.
1033 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
1034 m4_define and m4_define_default.
1035 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
1036 which marks the end of user code with appropriate syncline, like all
1037 the other skeletons.
1038 (b4_user_post_prologue): Add. Don't silently drop.
1040 (parse): Inline yylex.
1041 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
1042 (%{...%}): Fix typo of %code imports.
1043 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
1045 Support annotations on parser class with %define annotations.
1046 * data/lalr1.java (annotations): Add to parser class modifier.
1047 * doc/bison.texinfo (Java Parser Interface): Document
1048 %define annotations.
1049 (Java Declarations Summary): Document %define annotations.
1050 * tests/java.at (Java parser class modifiers): Test annotations.
1052 Do not generate code for %error-verbose unless requested.
1053 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
1054 Make private. Make conditional on %error-verbose.
1055 (getErrorVerbose, setErrorVerbose): New.
1056 (yytnamerr_): Make conditional on %error-verbose.
1057 (yysyntax_error): Make some code conditional on %error-verbose.
1058 * doc/bison.texinfo (Java Bison Interface): Remove the parts
1059 about %error-verbose having no effect.
1060 (getErrorVerbose, setErrorVerbose): Document.
1062 Move constants for token names to Lexer interface.
1063 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
1064 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
1065 (parse): Qualify EOF to Lexer.EOF.
1066 * doc/bison.texinfo (Java Parser Interface): Move documentation of
1067 EOF and token names to Java Lexer Interface.
1068 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
1070 Make yyerror public.
1071 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
1072 (yyerror): Change to public. Add Javadoc comments. Use longer
1073 parameter names. Make the body rather than the declarator
1074 conditional on %locations.
1075 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
1077 Allow user to add code to the constructor with %code init.
1078 * data/java.m4 (b4_init_throws): New, for %define init_throws.
1079 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
1080 Add %code init to the front of the constructor body.
1081 * doc/bison.texinfo (YYParser.YYParser): Document %code init
1082 and %define init_throws.
1083 (Java Declarations Summary): Document %code init and
1084 %define init_throws.
1085 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
1086 (Java constructor init and init_throws): Add tests.
1088 2008-11-10 Akim Demaille <demaille@gostai.com>
1091 * TODO (-D): is implemented.
1092 (associativity): Same precedence must have the same associativity.
1093 For instance, how can a * b / c be parsed if * is %left and / is
1095 (YYERRORCODE, YYFAIL, YYBACKUP): New.
1097 2008-11-10 Akim Demaille <demaille@gostai.com>
1101 2008-11-10 Akim Demaille <demaille@gostai.com>
1103 More information about the symbols.
1104 * src/output.c (type_names_output): Document all the symbols,
1105 including those that don't have a type-name.
1106 (symbol_definitions_output): Define "is_token" and
1108 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
1109 type-name, now that they are defined too in b4_type_names.
1111 2008-11-10 Akim Demaille <demaille@gostai.com>
1115 2008-11-10 Akim Demaille <demaille@gostai.com>
1117 Make parser::yytranslate static.
1118 Small speedup (1%) on the list grammar. And makes yytranslate_
1119 available in non member functions.
1121 * data/lalr1.cc (yytranslate_): Does not need to be a instance
1124 2008-11-10 Akim Demaille <demaille@gostai.com>
1126 Avoid trailing spaces.
1127 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
1128 * data/lalr1.cc: Don't indent before rule and symbol actions, as
1129 they can be empty, and anyway this incorrectly indents the first
1132 2008-11-10 Akim Demaille <demaille@gostai.com>
1136 2008-11-10 Akim Demaille <demaille@gostai.com>
1138 Use "enum" for integral constants.
1139 This is just nicer to read, I observed no speedup.
1141 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
1142 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
1143 (yyuser_token_number_max_, yyundef_token_): Move into...
1144 (yytranslate_): here.
1146 2008-11-10 Akim Demaille <demaille@gostai.com>
1148 Shortcuts in bench directives.
1149 * etc/bench.pl.in (parse_dirs): New.
1151 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
1152 Create the benches in "benches/".
1154 2008-11-10 Akim Demaille <demaille@gostai.com>
1157 * data/lalr1.cc: here.
1159 2008-11-10 Akim Demaille <demaille@gostai.com>
1161 Adjust verbose message to using emacs.
1162 * etc/bench.pl.in: Inform compilation-mode when we change the
1164 (generate_grammar_list): Recognize %define "variant" in addition
1167 2008-11-10 Akim Demaille <demaille@gostai.com>
1169 Classify symbols by type-name.
1170 * src/uniqstr.h (UNIQSTR_CMP): New.
1171 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
1172 (type_names_output): New.
1173 (muscles_output): Use it.
1174 * data/lalr1.cc (b4_symbol_action_): Remove.
1175 (b4_symbol_case_, b4_type_action_): New.
1176 Adjust uses of b4_symbol_action_ to use b4_type_action_.
1178 2008-11-10 Akim Demaille <demaille@gostai.com>
1180 Change the handling of the symbols in the skeletons.
1181 Before we were using tables which lines were the symbols and which
1182 columns were things like number, tag, type-name etc. It is was
1183 difficult to extend: each time a column was added, all the numbers had
1184 to be updated (you asked for colon $2, not for "tag"). Also, it was
1185 hard to filter these tables when only a subset of the symbols (say the
1186 tokens, or the nterms, or the tokens that have and external number
1187 *and* a type-name) was of interest.
1189 Now instead of monolithic tables, we define one macro per cell. For
1190 instance "b4_symbol(0, tag)" is a macro name which contents is
1191 self-decriptive. The macro "b4_symbol" provides easier access to
1194 * src/output.c (type_names_output): Remove.
1195 (symbol_numbers_output, symbol_definitions_output): New.
1196 (muscles_output): Call them.
1197 (prepare_symbols): Define b4_symbols_number.
1199 2008-11-10 Akim Demaille <demaille@gostai.com>
1202 * src/getargs.h, src/getargs.c (trace_muscle): New.
1203 (trace_types, trace_args): Support it.
1204 * src/output.c (output_skeleton): Use it.
1206 2008-11-10 Akim Demaille <demaille@gostai.com>
1209 * src/output.c (muscles_output): New, extracted from...
1210 (output_skeleton): here.
1213 2008-11-10 Akim Demaille <demaille@gostai.com>
1217 2008-11-10 Akim Demaille <demaille@gostai.com>
1219 Update the variant example.
1220 * examples/variant.yy: Formatting changes.
1223 2008-11-10 Akim Demaille <demaille@gostai.com>
1225 Support constructor with an argument.
1226 This improves the "list" bench by 2%.
1228 * data/lalr1.cc (variant::build): Add an overloaded version with
1230 * tests/c++.at (AT_CHECK_VARIANT): Check it.
1232 2008-11-10 Akim Demaille <demaille@gostai.com>
1235 * tests/c++.at (AT_CHECK_VARIANTS): New.
1236 Use it with and without %define assert.
1238 2008-11-10 Akim Demaille <demaille@gostai.com>
1240 Add %precedence support.
1241 Unfortunately it is not possible to reuse the %prec directive. This
1242 is because to please POSIX, we do not require to end the rules with a
1243 semicolon. As a result,
1247 is ambiguous: either a rule which precedence is that of baz, or a rule,
1248 and then a declaration of the precedence of the token baz.
1250 * doc/bison.texinfo: Document %precedence.
1251 (Precedence Only): New.
1252 * src/assoc.h, src/assoc.c (precedence_assoc): New.
1253 * src/conflicts.c (resolve_sr_conflict): Support it.
1254 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
1256 * tests/calc.at: Use %precedence for NEG.
1257 * tests/conflicts.at (%precedence does not suffice)
1258 (%precedence suffices): New tests.
1260 2008-11-09 Akim Demaille <demaille@gostai.com>
1262 Make benches in a sub dirs.
1263 * etc/bench.pl.in ($dir): New.
1265 Check the use of constructors with an argument.
1266 (bench_variant_parser): Fix.
1268 2008-11-09 Akim Demaille <demaille@gostai.com>
1272 2008-11-09 Akim Demaille <demaille@gostai.com>
1276 2008-11-09 Akim Demaille <demaille@gostai.com>
1278 Require the generation of parse-gram.output.
1279 * src/Makefile.am (YACC): Pass --report=all.
1281 2008-11-09 Akim Demaille <demaille@gostai.com>
1285 2008-11-09 Akim Demaille <demaille@gostai.com>
1288 * TODO: Remove obsolete items.
1291 2008-11-09 Akim Demaille <demaille@gostai.com>
1294 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
1295 (@token, $grammar, $bench): New.
1296 (generate_grammar_variant): Rename as...
1297 (generate_grammar_list): this.
1298 (generate_grammar): Adjust.
1299 (bench_grammar): Rename as...
1301 Use it in the various bench-marking routines.
1302 (-b, -g): New options.
1304 2008-11-09 Akim Demaille <demaille@gostai.com>
1306 Use a static hierarchy for symbols in the C++ parser.
1307 * data/lalr1.cc (symbol_base_type, symbol_type)
1308 (stack_symbol_type): Make it a static hierarchy.
1309 Adjust dependencies.
1311 2008-11-09 Akim Demaille <demaille@gostai.com>
1313 bench.pl -d, --directive.
1314 * etc/bench.pl.in (@directive): New.
1315 (&bench_grammar): Use it.
1316 (&bench_list_grammar): New, to provide access to the "variant"
1319 (getopts): Support -d, --directive.
1321 2008-11-09 Akim Demaille <demaille@gostai.com>
1323 Use inline for small operations.
1324 * data/lalr1.cc (symbol_base_type, symbol_type)
1325 (stack_symbol_type): Declare constructor and other operations as
1327 (yy_destroy_): Inline.
1329 2008-11-09 Akim Demaille <demaille@gostai.com>
1331 Introduce a hierarchy for symbols.
1332 * data/lalr1.cc (symbol_base_type, symbol_type): New.
1333 (data_type): Rename as...
1334 (stack_symbol_type): this.
1335 Derive from symbol_base_type.
1336 (yy_symbol_value_print_): Merge into...
1337 (yy_symbol_print_): this.
1340 (yydestruct_): Rename as...
1341 (yy_destroy_): this.
1342 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
1343 (parser::parse): yyla is now of symbol_type.
1344 Use its type member instead of yytoken.
1346 2008-11-09 Akim Demaille <demaille@gostai.com>
1348 Rename data_type and stack_symbol_type.
1349 * data/lalr1.cc (data_type): Rename as...
1350 (stack_symbol_type): this.
1352 2008-11-09 Akim Demaille <demaille@gostai.com>
1354 Handle semantic value and location together.
1355 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
1356 yydata.value and yydata.location.
1357 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
1358 (YY_SYMBOL_PRINT): Now take semantic value and location as a
1361 (yydestruct_): New overload for a stack symbol.
1363 2008-11-09 Akim Demaille <demaille@gostai.com>
1365 Push a complete symbol, not connected parts.
1366 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
1367 state, value and location.
1370 2008-11-09 Akim Demaille <demaille@gostai.com>
1372 Agregate yylval and yylloc.
1373 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
1374 (parser::yyla): this.
1376 2008-11-09 Akim Demaille <demaille@gostai.com>
1378 Rely on the state stack to display reduction traces.
1379 To display rhs symbols before a reduction, we used information
1380 about the rule reduced, which required the tables yyrhs and
1381 yyprhs. Now use rely only on the state stack to get the same
1384 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
1386 (parser::yyrhs_, parser::yyprhs_): Remove.
1387 (parser::yy_reduce_print_): Use the state stack.
1389 2008-11-09 Akim Demaille <demaille@gostai.com>
1391 Fuse yyval and yyloc into yylhs.
1392 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
1394 (parse): Replace yyval and yyloc with yylhs.value and
1396 After a user action, compute yylhs.state earlier.
1397 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
1400 2008-11-09 Di-an Jan <dianj@freeshell.org>
1402 Remove unused variable.
1403 * src/output.c (type_names_output): Remove unused variable sep.
1405 2008-11-09 Paolo Bonzini <bonzini@gnu.org>
1407 Change tests/output.at quoting.
1408 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
1409 expanding arguments.
1411 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1413 Don't add a semicolon to actions for %skeleton or %language.
1414 It breaks Java test cases as reported by Akim Demaille.
1415 * src/scan-code.l: Implement.
1417 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1419 Clean up %skeleton and %language priority implementation.
1420 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
1421 remove static qualifier because others will soon need to see it.
1422 (language_prio): Likewise.
1423 (getargs): Use command_line_prio rather than 0.
1424 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
1426 (skeleton_prio): Extern it.
1427 (language_prio): Extern it.
1428 * src/parse-gram.y: Use grammar_prio rather than 1.
1430 2008-11-07 Akim Demaille <demaille@gostai.com>
1432 Moving push traces into yypush_.
1433 * data/lalr1.cc (yypush_): Now takes a optional trace message.
1436 2008-11-07 Akim Demaille <demaille@gostai.com>
1438 The single-stack C++ parser is now the standard one.
1439 * data/lalr1.cc: Rename as...
1440 * data/lalr1-split.cc: this.
1441 * data/lalr1-fusion.cc: Rename as...
1442 * data/lalr1.cc: this.
1443 * etc/bench.pl.in: Adjust.
1445 2008-11-07 Akim Demaille <demaille@gostai.com>
1447 Avoid empty-if warnings.
1448 Reported by Quentin Hocquet.
1450 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
1451 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
1453 2008-11-07 Akim Demaille <demaille@gostai.com>
1455 Pass command line location to skeleton_arg and language_argmatch.
1456 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
1457 The location argument is now mandatory.
1458 Adjust all dependencies.
1459 (getargs): Use command_line_location.
1461 2008-11-07 Akim Demaille <demaille@gostai.com>
1464 * src/getargs.c (usage): Document -D.
1465 Fix help string for --locations.
1466 (command_line_location): New.
1467 (short_options, long_options, getargs): Support -D, --define.
1468 (getargs): Move -d support at the right place.
1469 * doc/bison.texinfo (Bison Options): Update.
1470 * tests/input.at (%define, --define): New.
1472 2008-11-07 Akim Demaille <demaille@gostai.com>
1474 Initialize the muscle table before parsing the command line.
1475 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
1476 (getargs): Define file_name.
1477 * src/main.c (main): Initialize muscle_tab before calling
1479 * src/muscle_tab.c (muscle_init): No longer define file_name, as
1480 its value is not available yet.
1482 2008-11-07 Akim Demaille <demaille@gostai.com>
1484 Locations without columns for command line arguments.
1485 * src/location.c (location_print): Don't display negative columns.
1486 * src/location.h: Document this.
1488 2008-11-07 Akim Demaille <demaille@gostai.com>
1491 * src/getargs.c (usage): Fix help string for -W.
1493 2008-11-07 Akim Demaille <demaille@gostai.com>
1495 Handle more general types of option arguments.
1496 * build-aux/cross-options.pl: The argument ends at the first
1497 space, not the first non-symbol character.
1498 Use @var for each word appearing the argument description.
1500 2008-11-07 Akim Demaille <demaille@gostai.com>
1502 Destroy the variants that remain on the stack in case of error.
1503 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
1505 Display the value only if yymsg is nonnull.
1506 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
1508 2008-11-07 Akim Demaille <demaille@gostai.com>
1510 Add "%define assert" to variants.
1511 This is used to help the user catch cases where some value gets
1512 ovewritten by a new one. This should not happen, as this will
1515 Unfortunately this uncovered a bug in the C++ parser itself: the
1516 lookahead value was not destroyed between two calls to yylex. For
1517 instance if the previous lookahead was a std::string, and then an int,
1518 then the value of the std::string was correctly taken (i.e., the
1519 lookahead was now an empty string), but std::string structure itself
1522 This is now done in variant::build(other&) (which is used to take the
1523 value of the lookahead): other is not only stolen from its value, it
1524 is also destroyed. This incurs a new performance penalty of a few
1525 percent, and union becomes faster again.
1527 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
1528 (b4_variant_if): New.
1529 (variant::built): New.
1530 Use it whereever the status of the variant changes.
1531 * etc/bench.pl.in: Check the penalty of %define assert.
1533 2008-11-07 Akim Demaille <demaille@gostai.com>
1535 Use "%define variant" in bench.pl.
1536 * etc/bench.pl.in: No longer use the pseudo directive %variants,
1537 just use %define variants.
1539 2008-11-07 Akim Demaille <demaille@gostai.com>
1542 * src/parse-gram.h, src/parse-gram.c: Regen.
1544 2008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
1546 Fix user actions without a trailing semicolon.
1547 Reported by Sergei Steshenko at
1548 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
1549 * THANKS (Sergei Steshenko): Add.
1550 * src/scan-code.l (SC_RULE_ACTION): Fix it.
1551 * tests/regression.at (Fix user actions without a trailing semicolon):
1554 2008-11-04 Akim Demaille <demaille@gostai.com>
1556 Use b4_copyright_years.
1557 * data/yacc.c (b4_copyright_years): New.
1558 Fix its value according to the comments in the file.
1559 Use it and undefine it.
1561 2008-11-04 Akim Demaille <demaille@gostai.com>
1564 * data/lalr1-fusion.cc, src/parse-gram.y: here.
1566 2008-11-04 Akim Demaille <demaille@gostai.com>
1569 * data/lalr1-fusion.cc: here.
1571 2008-11-04 Akim Demaille <demaille@gostai.com>
1573 Use strict on bench.pl.
1574 * etc/bench.pl.in (&run, &generate_grammar): New.
1575 Rename the grammar generating functions for consistency.
1576 Change the interface so that the list of benches to run is passed
1577 as (optionless) arguments.
1578 (&compile): Use &run.
1580 2008-11-04 Akim Demaille <demaille@gostai.com>
1582 Remove spurious initial empty lines.
1583 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1584 * data/yacc.c: End the @output lines with an @.
1586 2008-11-04 Akim Demaille <demaille@gostai.com>
1588 Improve the display of sizes.
1589 * etc/bench.p.in: Higher precision.
1590 Sort by decreasing size.
1592 2008-11-04 Akim Demaille <demaille@gostai.com>
1594 Don't memcpy C++ structures.
1595 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
1597 (variant::build): New overload for
1598 copy-construction-that-destroys.
1599 (variant::swap): New.
1600 (parser::yypush_): Use it in variant mode.
1602 2008-11-04 Akim Demaille <demaille@gostai.com>
1604 Better defaults for bench.pl.
1605 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
1607 Adjust &verbose uses.
1610 2008-11-04 Akim Demaille <demaille@gostai.com>
1612 Make variant.yy more complex.
1613 std::list cannot be copied via memcpy, they are more demanding than
1614 std::string. Use one std::list to strengthen the test.
1616 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
1618 Create a list of strings, instead of a single large string.
1620 2008-11-04 Akim Demaille <demaille@gostai.com>
1623 * etc/bench.pl.in (--bench, $bench): New.
1625 2008-11-04 Akim Demaille <demaille@gostai.com>
1628 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
1629 Define it after as().
1631 2008-11-04 Akim Demaille <demaille@gostai.com>
1634 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
1636 2008-11-04 Akim Demaille <demaille@gostai.com>
1638 Issue missing synclines after user actions.
1639 * data/c.m4 (b4_case): Issue synclines on the output file.
1641 2008-11-04 Akim Demaille <demaille@gostai.com>
1643 Remove trailing empty line.
1644 * data/lalr1-fusion.cc: Don't add an empty line after the user's
1647 2008-11-04 Akim Demaille <demaille@gostai.com>
1649 Fix output of copyright years.
1650 * data/bison.m4 (b4_copyright): Fix the indentation of the
1651 copyright year paragraph.
1652 Use b4_copyright_years when no years are given.
1653 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
1654 (b4_copyright_years): New.
1657 2008-11-04 Akim Demaille <demaille@gostai.com>
1659 Avoid the spurious initial empty line.
1660 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
1661 the end of @output request to suppress the empty line that
1664 2008-11-04 Akim Demaille <demaille@gostai.com>
1666 Remove parser::rhs_number_type.
1667 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
1668 (yyrhs_): Use b4_table_define.
1670 2008-11-04 Akim Demaille <demaille@gostai.com>
1673 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
1675 2008-11-04 Akim Demaille <demaille@gostai.com>
1677 Factor the declaration of the integer tables.
1678 * data/lalr1-fusion.cc (b4_table_define): New.
1681 2008-11-03 Akim Demaille <demaille@gostai.com>
1683 Fix indentation of tables in lalr1.cc
1684 * data/lalr1-fusion.cc: Fix the indentation.
1686 2008-11-03 Akim Demaille <demaille@gostai.com>
1688 Destroy the lhs symbols after reduction.
1689 * data/lalr1-fusion.cc (parse): After the user action, when in
1690 variant mode, destroy the lhs symbols.
1692 2008-11-03 Akim Demaille <demaille@gostai.com>
1694 Simplify yysyntax_error_ use.
1695 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
1696 type, but make it unnamed in the declaration when it is not used.
1698 2008-11-03 Akim Demaille <demaille@gostai.com>
1700 Let yy::variant::build return an lvalue.
1701 * data/lalr1-fusion.cc (variant::build): Return a reference to the
1704 2008-11-03 Akim Demaille <demaille@gostai.com>
1706 Define yy::variant only when needed.
1707 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
1710 2008-11-03 Akim Demaille <demaille@gostai.com>
1712 Bench the three-stack lalr1.cc.
1713 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
1716 2008-11-03 Akim Demaille <demaille@gostai.com>
1718 Fail on parse error in calc++.
1719 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
1721 * examples/calc++/test ($me, $number, $exit, run): New.
1722 Use them to propagate errors to the exit status.
1724 2008-11-03 Akim Demaille <demaille@gostai.com>
1726 Don't specify the skeleton twice in the example.
1727 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
1728 file does what is needed.
1730 2008-11-03 Akim Demaille <demaille@gostai.com>
1732 bench: Improve output.
1733 * etc/bench.pl.in (bench_grammar): Tune the printf format.
1735 2008-11-03 Akim Demaille <demaille@gostai.com>
1737 bench: check impact of %debug on variants.
1738 * etc/bench.pl.in (variant_grammar): Fix the computation of
1740 Generate a grammar file that can work with or without %debug.
1741 Do use the @directive.
1742 (bench_variant_parser): Check impact of %debug.
1743 (@directives): Rename all the occurrences to...
1744 (@directive): this, for consistency.
1746 2008-11-03 Akim Demaille <demaille@gostai.com>
1748 bench: report the size too.
1749 * etc/bench.pl.in ($iterations): Defaults to -3.
1750 (&bench_grammar): Require hireswallclock.
1751 Compute and display the size of the result.
1754 2008-11-03 Akim Demaille <demaille@gostai.com>
1756 bench: More use of the verbosity level.
1757 * etc/bench.pl.in ($verbose, &verbose): New.
1759 More POD documentation.
1761 2008-11-03 Akim Demaille <demaille@gostai.com>
1763 bench.pl: a command line interface
1764 * etc/bench.pl.in: More doc.
1765 Some fixes in the documentation.
1766 ($cflags, $iterations, &help, &getopt): New.
1768 (&variant_grammar): Let the number of stages be 10 times what is
1771 2008-11-03 Akim Demaille <demaille@gostai.com>
1773 Bench the use of Boost.Variants.
1774 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
1776 (&compile): Be ready to compile C++ parsers.
1777 (&bench_push_parser): Move debug information to the outermost
1779 * THANKS: Add Michiel De Wilde.
1781 2008-11-03 Akim Demaille <demaille@gostai.com>
1783 bench.pl: Pass directives as a list instead of as a string.
1784 * etc/bench.pl.in (&directives): New.
1785 (&triangular_grammar, &calc_grammar): Use it to format the Bison
1787 (&triangular_grammar): Do use the directives (were ignored).
1788 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
1791 2008-11-03 Akim Demaille <demaille@gostai.com>
1793 Improve genericity of bench.pl.
1794 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
1796 (&bench_push_parser): New.
1799 2008-11-03 Akim Demaille <demaille@gostai.com>
1801 Add documentation to bench.pl.
1802 * etc/bench.pl.in: Comment changes.
1804 2008-11-03 Akim Demaille <demaille@gostai.com>
1806 Fuse the three stacks into a single one.
1808 In order to make it easy to perform benchmarks to ensure that
1809 there are no performance loss, lalr1.cc is forked into
1810 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
1813 Meanwhile, to make sure that lalr1-fusion.cc is correctly
1814 exercized by the test suite, the user must install a symbolic link
1815 from lalr1.cc to it.
1817 Instead of having three stacks (state, value, location), use a
1818 stack of triples. This considerably simplifies the code (and it
1819 will be easier not to require locations as currently does the C++
1820 parser), and also gives a 10% speedup according to
1821 etc/bench (probably mainly since memory allocation is done once
1822 instead of three times).
1824 Another motivation is to make it easier to destruct properly
1825 semantic values: now that they are bound to their state (hence
1826 symbol type) it will be easier to call the appropriate destructor.
1828 These changes should probably benefit the C parser too.
1830 * data/lalr1.cc: Copy as...
1831 * data/lalr1-fusion.cc: this new file.
1832 (b4_rhs_value, b4_rhs_location): New definitions overriding those
1834 (state_stack_type, semantic_stack_type, location_stack_type)
1835 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
1836 (data_type, stack_type, yystack_): New.
1837 (YYLLOC_DEFAULT, yypush_): Adjust.
1838 (yyerror_range): Now based on data_type, not location_type.
1840 2008-11-03 Akim Demaille <demaille@gostai.com>
1842 Push the state, value, and location at the same time.
1843 This is needed to prepare a forthcoming patch that fuses the three
1846 * data/lalr1.cc (parser::yypush_): New.
1847 (parser::yynewstate): Change the semantics: instead of arriving to
1848 this label when value and location have been pushed, but yystate
1849 is to be pushed on the state stack, now the three of them must
1850 have been pushed before. yystate still must be the new state.
1851 This allows to use yypush_ everywhere instead of individual
1852 handling of the stacks.
1854 2008-11-03 Akim Demaille <demaille@gostai.com>
1856 Prefer references to pointers.
1857 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
1858 definition to use references instead of pointers.
1859 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
1860 Take the value and location as references.
1863 2008-11-03 Akim Demaille <demaille@gostai.com>
1865 stack::size instead of stack::height.
1866 * data/lalr1.cc (stack::height): Rename as...
1867 (stack::size): this.
1868 Fix the output type.
1871 2008-11-03 Akim Demaille <demaille@gostai.com>
1873 Use variants to support objects as semantic values.
1874 This patch was inspired by work by Michiel De Wilde. But he used
1875 Boost variants which (i) requires Boost on the user side, (ii) is
1876 slow, and (iii) has useless overhead (the parser knows the type of
1877 the semantic value there is no reason to duplicate this
1878 information as Boost.Variants do).
1880 This implementation reserves a buffer large enough to store the
1881 largest objects. yy::variant implements this buffer. It was
1882 implemented with Quentin Hocquet.
1884 * src/output.c (type_names_output): New.
1885 (output_skeleton): Invoke it.
1886 * data/c++.m4 (b4_variant_if): New.
1887 (b4_symbol_value): If needed, provide a definition for variants.
1888 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
1889 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
1890 (b4_char_sizeof, yy::variant): New.
1891 (parser::parse): If variants are requested, define
1892 parser::union_type, parser::variant, change the definition of
1893 semantic_type, construct $$ before running the user action instead
1894 of performing a default $$ = $1.
1895 * examples/variant.yy: New.
1896 Based on an example by Michiel De Wilde.
1898 2008-11-03 Akim Demaille <demaille@gostai.com>
1900 Parameterize the extraction of semantic values.
1901 To make future changes easier, no longer rely on ".TYPE" being the
1902 way to get a semantic value.
1904 * data/c.m4 (b4_symbol_value): New.
1906 * data/c++.m4, data/yacc.c: Use it.
1907 * data/glr.c: Use b4_symbol_value.
1911 2008-11-03 Akim Demaille <demaille@gostai.com>
1913 Prepare easier M4 changes.
1914 * data/lalr1.cc: Use escaped [] instead of literals to prepare
1917 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1919 Initiate further development.
1920 * NEWS: Create an empty section for new entries.
1921 * gnulib: Update submodule to HEAD.
1923 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1925 * NEWS: Version 2.4.
1927 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1929 Prepare for next release.
1930 * NEWS: Briefly mention changes since 2.3b.
1931 * README: Say GNU m4 1.4.6, which we've been requiring in release
1932 announcements already, not 1.4.3, which breaks the build.
1934 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1936 Say %language is experimental.
1937 We're thinking of extending it's effect on output file naming. See the
1939 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
1940 * NEWS: Say it's experimental.
1941 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
1942 recommend it over %skeleton for now.
1943 (Bison Options): Likewise.
1944 (C++ Bison Interface): Use %skeleton not %language.
1945 (Calc++ Parser): Use %skeleton not %language.
1946 * src/getargs.c (usage): Say it's experimental.
1948 2008-11-01 Di-an Jan <dianj@freeshell.org>
1949 Paolo Bonzini <bonzini@gnu.org>
1951 Support all Java parser class modifiers.
1952 * data/java.m4 (b4_percent_define_get3): New.
1953 (b4_final_if, b4_strictfp_if): New.
1954 * data/lalr1.java (final, strictfp, extends, implements): Support.
1955 * doc/bison.texinfo (final, strictfp, extends, implements): Add
1957 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
1958 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
1959 (AT_CHECK_JAVA_GREP): New.
1960 (Java parser class modifiers): New test.
1961 (Java parser class extends and implements): New test.
1963 Model exception propagation better with throws and lex_throws.
1964 * data/java.m4 (b4_list2): New.
1965 (throws): Change default.
1966 * data/lalr1.java (yyaction): Add throws.
1967 (parse): Add lex_throws in addition to throws.
1968 * doc/bison.texinfo (throws, lex_throws): Add documentation.
1969 * tests/java.at (Java throws specifications): New test.
1971 Improve documentation for Java parsers.
1972 * doc/bison.texinfo (Java Parsers): Add subsections.
1973 Don't quote first argument of %define.
1974 (Java Bison Interface): Document output files. Move documentation
1975 of parser class and merge into Java Parser Interface. Document
1976 features that error out. Document directives with no effect.
1977 Move note about Javadoc higher.
1978 (Java Semantic Values): Explicitly mention stype.
1979 Document that generic types cannot be used.
1980 (Java Location Values): Use @deftypeivar. Document constructors.
1981 Correct return value for toString.
1982 (Java Parser Interface): List undocumented constants/fields.
1983 Move documentation of fields added by %parse-param closer to list
1984 of members. Document that token names are added as fields.
1985 Document constructors accurately. Remove error method.
1986 (Java Scanner Interface): Move note on %pure-parser to Java Bison
1987 Interface. Describe %code lexer and yylex accutately.
1988 Remove documentation that does not match the code.
1989 (Java Action Features): New.
1990 (Java Differences): Add reference. Add item on semantic values.
1991 Add note about @{ ... @}. Clarify %% epilogue placement.
1992 (Java Declarations Summary): New.
1995 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
1996 (b4_remove_comma): Quote test argument.
1997 (b4_identification): Remove "bison" field.
1998 * tests/java.at (Java parser class and package names): New test.
1999 (Java %parse-param and %lex-param): New test.
2000 (Java stype, position_class and location_class): New test.
2002 2008-10-31 Di-an Jan <dianj@freeshell.org>
2004 * data/lalr1.jave: Update copyright years.
2005 (YYParser): Correct name of "generated from" file in Javadoc:
2006 use b4_file_name instead of @ofile@.
2007 (Location constructor): Correct Javadoc parameter name.
2008 (yylloc): Add missing opening m4 quote after b4_location_if.
2009 This removes a stray [ in the Javadoc of Lexer.getStartPos.
2010 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
2011 (YYParser constructor): Correct Javadoc parameter name.
2013 2008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
2015 Always put auxiliary code files in the same dir as other output files.
2016 * src/files.c (compute_file_name_parts): When the user specifies
2017 --output but not --file-prefix, extract the directory prefix from the
2018 file prefix not from the grammar file name. This affects the location
2019 of files like location.hh generated by the C++ skeleton. The includes
2020 in the other output files require this fix.
2021 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
2022 for expected output files.
2023 (Output files): Add a test for the above.
2025 2008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
2027 * gnulib: Update submodule to HEAD.
2029 2008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2031 Update copyright year.
2032 * src/files.c: Here.
2034 2008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
2036 Don't overwrite the input file.
2037 * src/files.c (output_file_name_check): Fatal error if using input file
2039 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
2041 (Conflicting output files): Add test.
2043 2008-10-28 Akim Demaille <demaille@gostai.com>
2046 * data/lalr1.cc: Formatting changes.
2048 2008-10-28 Akim Demaille <demaille@gostai.com>
2050 Don't define debugging functions when !YYDEBUG.
2051 * data/lalr1.cc (debug_stream, set_debug_stream)
2052 (debug_level_type, debug_level, set_debug_level): Don't
2053 declare them when YYDEBUG is not defined.
2054 The implementation are already YYDEBUG-aware.
2056 2008-10-28 Akim Demaille <demaille@gostai.com>
2058 Prefer "continue" for empty loop bodies.
2059 * etc/bench.pl.in: Use "continue" instead of {}.
2061 2008-10-28 Akim Demaille <demaille@gostai.com>
2063 Space and comments changes.
2064 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
2065 * data/c.m4, data/lalr1.cc: Space changes.
2067 2008-10-28 Akim Demaille <demaille@gostai.com>
2069 Make gnulib a submodule.
2071 * .gitmodules (gnulib): New.
2073 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
2075 Fix yyerror_range for user-defined location type in C++. Reported by
2077 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
2078 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
2079 * THANKS (Georg Sauthoff): Add.
2081 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
2083 Update several administrative files mainly to facilitate releasing.
2084 * HACKING (Administrivia): Make the git-merge-changelog notes more
2086 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
2087 (Release Procedure): Update for git and add numerous details that were
2089 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
2090 * maint.mk (announcement): Don't list bison as a bootstrap tool so
2091 that announcements don't claim we bootstrapped with whatever bison
2092 happened to be in PATH. Add flex as a bootstrap tool.
2093 * Makefile.maint: Remove, previously replaced by maint.mk.
2094 * Makefile.cfg: Remove, and migrate settings to...
2095 * cfg.mk: ... here for the sake of `make announcement'.
2096 * bootstrap.conf (gnulib_modules): Add announce-gen.
2097 * README: Say GNU Bison instead of just Bison. Suggested by Karl
2100 2008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
2102 Small but important bugfixes for the Java skeleton.
2103 * data/lalr1.java (yyerror): Change Location to b4_location_type.
2104 (yy_symbol_print): Call toString on yyvaluep.
2106 2008-08-29 Akim Demaille <demaille@gostai.com>
2108 Clarify UPDATED use.
2109 * doc/bison.texinfo: It refers to the last edition of this file,
2110 not to the release date of Bison.
2111 Reported by Joel E. Denny.
2113 2008-08-29 Akim Demaille <demaille@gostai.com>
2115 * README: Update FAQ pointer.
2116 Reported by Joel E. Denny.
2118 2008-08-27 Eric Blake <ebb9@byu.net>
2120 Resync m4sugar from autoconf.
2121 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
2122 (m4_init): Adjust to latest m4.git changes.
2123 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
2125 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
2126 (_m4_list_cmp): Reduce side effects.
2128 2008-08-27 Akim Demaille <demaille@gostai.com>
2130 Check yyerrok in calc.at.
2131 * tests/calc.at (calc.y): Use yyerrok on "( error )".
2132 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
2135 2008-08-27 Akim Demaille <demaille@gostai.com>
2137 Support yyerrok in lalr1.cc.
2138 YYBACKUP is still to import back into lalr1.cc.
2139 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
2141 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
2143 For maintainer-check*, don't recompile for a $(VERSION) update.
2145 (_is-dist-target): Override the one in GNUmakefile.
2146 * Makefile.am (EXTRA_DIST): Add cfg.mk.
2148 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
2150 Update for recent change to gnulib.
2151 * src/parse-gram.y: Don't include strverscmp.h. It comes from
2154 2008-08-15 Eric Blake <ebb9@byu.net>
2156 Remaining m4sugar merge from autoconf.
2157 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
2158 * data/m4sugar/foreach.m4: New file, copied from autoconf.
2159 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
2160 * src/output.c (output_skeleton): Tell m4 how to find it.
2162 Partial m4sugar merge from autoconf: m4_map.
2163 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
2164 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
2165 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
2166 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
2168 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
2170 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
2173 2008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
2175 Keep .version and PACKAGE_VERSION in sync.
2176 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
2177 dependency, and add comments justifying this in more detail. Discussed
2179 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
2181 2008-08-06 Eric Blake <ebb9@byu.net>
2183 Partial m4sugar merge from autoconf: m4_shiftn.
2184 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
2185 (m4_shift2, m4_shift3): New macros.
2186 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
2187 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
2188 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
2189 * data/java.m4 (b4_remove_comma): Likewise.
2191 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
2192 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
2193 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
2194 (m4_init): Consolidate wrapped text into single m4_wrap.
2195 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
2198 2008-08-05 Eric Blake <ebb9@byu.net>
2200 Partial m4sugar merge from autoconf: builtins, version.m4.
2201 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
2202 (m4_prepend): Remove, as it is unused and inherently quadratic,
2203 whereas m4_append is linear in newer m4.
2204 (m4_mkstemp): New builtin.
2205 (m4_symbols): Make rename conditional.
2206 (m4_version_prereq): Ensure fatal error if used in bison, which
2207 intentionally lacks version.m4.
2209 Fix comments in m4sugar.
2210 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
2212 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
2214 Update for recent .gitignore fix in Gnulib.
2215 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
2216 anchored .gitignore entries.
2218 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
2220 Set gnu or gnits strictness.
2221 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
2222 development and gnits strictness for releases. Based on Eric Blake's
2224 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
2226 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
2228 * NEWS: Clarify documentation of %language.
2230 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
2232 Support usage of git-merge-changelog.
2233 * .gitattributes: New.
2234 * HACKING: Document usage of git-merge-changelog.
2235 * bootstrap: Install git-merge-changelog entries in .git/config
2238 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2240 Remove remaining dependence on CVS Id keyword.
2241 * ChangeLog: For the sake of people still using CVS, don't use dollars
2243 * data/xslt/bison.xsl: Remove Id from header comments, where it was
2245 * data/xslt/xml2dot.xsl: Likewise.
2246 * data/xslt/xml2text.xsl: Likewise.
2247 * data/xslt/xml2xhtml.xsl: Likewise.
2248 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
2249 * doc/Makefile.am (neutralize): Remove, no longer needed.
2250 (.x.1): Don't use neutralize.
2251 (edit): Don't substitute for ID.
2252 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
2254 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2256 Fix dependence on computed configure variables.
2257 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
2258 $(top_srcdir)/configure.ac so that changes to computed variables, such
2259 as PACKAGE_VERSION, are seen.
2260 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
2262 2008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
2264 Update copyright dates for recent changes.
2265 * Makefile.am: Here.
2266 * src/Makefile.am: Here.
2267 * src/reduce.c: Here.
2268 * tests/reduce.at: Here.
2270 2008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
2272 Use git-version-gen for version names between releases.
2273 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
2274 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
2275 * .prev-version: New.
2276 * .version.in: Remove.
2277 * ChangeLog: Remove the Id previously used for capturing the CVS
2279 * GNUmakefile: Remove, now copied from Gnulib.
2280 * Makefile.am: Add code suggested by comments in
2281 build-aux/git-version-gen.
2282 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
2283 .prev-version, and .version.
2284 * NEWS (2.3b+): Rename to...
2285 (?.?): ... this because we're dropping the "+" version naming scheme,
2286 but, in general, we still can't be sure of our next release name.
2287 * bootstrap: Add a quick hack to remove from .gitignore the
2288 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
2289 entry. This should really be fixed in gnulib instead.
2290 * bootstrap.conf (gnulib_modules): Add gnumakefile.
2291 * configure.ac (AC_INIT): Set version name by invoking
2292 build-aux/git-version-gen.
2293 (AC_CONFIG_FILES): Remove .version, now generated by
2294 build-aux/git-version-gen.
2295 * maint.mk: New, copied from coreutils.
2296 * doc/.cvsignore (bison.1): Add.
2297 * doc/.gitignore (/bison.1): Add.
2298 * doc/bison.1: Remove, generated.
2299 * src/.cvsignore (revision.c): Remove.
2300 * src/.gitignore (/revision.c): Remove.
2301 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
2302 (BUILT_SOURCES): Remove revision.c.
2303 (revision.c): Remove.
2304 * src/getargs.c (version): Don't print revision after the VERSION.
2305 * src/revision.h: Remove.
2307 2008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
2309 Fix untranslatable composition of sentences. Reported by Goran
2311 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
2312 * THANKS (Goran Uddeborg): Add.
2313 * src/reduce.c (reduce_print): Report the number of nonterminals and
2314 rules useless in the grammar in separate sentences.
2315 * tests/reduce.at (Useless Rules): Update output.
2316 (Reduced Automaton): Likewise.
2317 (Underivable Rules): Likewise.
2318 (Empty Language): Likewise.
2320 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2322 Fix some .gitignore and .cvsignore problems.
2323 * bootstrap (insert_sorted_if_absent): Replace all uses with...
2324 (insert_vc_ignore): ... this new function, which prepends `/' to all
2325 .gitignore entries before passing them to insert_sorted_if_absent.
2326 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
2327 .cvsignore files are maintained even though Bison developers run
2328 bootstrap while using Git.
2329 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
2332 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
2333 unneeded. Reported by Eric Blake.
2334 * lib/.gitignore (/*~): Add.
2335 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
2336 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
2338 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
2340 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2342 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
2343 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
2344 * bootstrap.conf (gnulib_modules): Add unsetenv.
2345 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
2346 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
2348 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
2349 the first argument because it may become position-dependent, and unset
2350 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
2351 Add comments explaining these issues in more detail.
2353 2008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
2355 Add .gitignore everywhere based on .cvsignore.
2357 * build-aux/.gitignore: New.
2358 * data/.gitignore: New.
2359 * doc/.gitignore: New.
2360 * etc/.gitignore: New.
2361 * examples/.gitignore: New.
2362 * examples/calc++/.gitignore: New.
2363 * lib/.gitignore: New.
2364 * m4/.gitignore: New.
2365 * po/.gitignore: New.
2366 * runtime-po/.gitignore: New.
2367 * src/.gitignore: New.
2368 * tests/.gitignore: New.
2370 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2372 * NEWS (2.3b+): New section, empty for now.
2373 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
2375 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2377 * NEWS (2.3b): Update release date since there has been a delay in
2378 getting the announcements and tarballs out.
2380 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
2382 * NEWS: Version 2.3b.
2383 * configure.ac (AC_INIT): Likewise.
2384 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
2386 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
2388 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
2389 been doing it for years.
2390 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
2391 (Release Procedure): Add FIXME about make alpha being unmaintained.
2393 2008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
2395 * data/yacc.c: Reformat m4 a little for readability.
2396 * src/lalr.c (build_relations): Correct comment.
2398 2008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2400 DJGPP specific issue.
2401 * djgpp/config.sed: Fixes required to run configure scripts generated
2404 2008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
2406 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
2407 coordinator@translationproject.org.
2409 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2411 * THANKS: Add Eric Blake.
2413 2008-04-23 Eric Blake <ebb9@byu.net>
2415 Revert prior patch, by working around autoconf regression.
2416 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
2417 ("Output file name: ("): Uncomment test.
2418 ("Output file name: )"): Likewise.
2419 Based on an idea from Noah Misch.
2421 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2423 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
2424 2.61. Reported by Juan Manuel Guerrero at
2425 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
2426 * tests/output.at ("Output file name: ("): Comment out test case for
2428 ("Output file name: )"): Likewise.
2430 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2432 * GNUmakefile: Update git-version-gen invocation so make dist
2435 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2437 Update to the current gnulib CVS repository, and fix trigraph handling
2439 * bootstrap: Update gnulib CVS repository URL.
2440 (symlink_to_dir): Encapsulate the code that guarantees the destination
2441 directory exists into...
2442 (check_dst_dir): ... this new function, and...
2443 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
2444 fail when copying files into lib/uniwidth/.
2445 * src/output.c (prepare_symbols): When writing yytname muscles, where
2446 symbol names will be encoded in C-string literals, tell quotearg to
2447 escape trigraphs. This used to be the default in gnulib.
2448 * tests/regression.at (Token definitions): Because of the change in
2449 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
2450 escapes trigraphs in symbol names. Thus, yytname no longer has
2451 trigraphs unnecessarily doubly escaped. Update test case output.
2452 Extend test case to be sure Bison's own error messages will no longer
2453 have trigraphs in symbol names unnecessarily escaped once.
2455 2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2457 Fix make dist infinite loop reported by Juan Manuel Guerrero at
2458 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
2459 * .cvsignore: Add .version.
2461 * bootstrap.conf (gnulib_modules): Add git-version-gen.
2462 * configure.ac (AC_CONFIG_FILES): Add .version.
2463 * build-aux/.cvsignore: Add git-version-gen.
2465 2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2467 * NEWS (2.3a+): Mention that -g now takes an argument.
2468 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
2469 consistency. Update the -g and -x entries now that they take
2470 arguments. Use brackets to indicate optional arguments.
2471 * src/getargs.c (usage): Explain the relationship between arguments of
2472 long and short options more completely. Document --defines and -d
2473 separately since the former takes an argument but, for POSIX Yacc, the
2475 (short_options): Let -W take an optional argument like --warnings.
2476 (getargs): Sort cases.
2478 2008-02-28 Akim Demaille <demaille@gostai.com>
2480 * doc/bison.texinfo: Fix a few typos.
2482 2008-02-28 Akim Demaille <akim@epita.fr>
2484 * doc/bison.texinfo (Bison Options): Document -W.
2485 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
2487 2008-02-28 Akim Demaille <akim@epita.fr>
2489 * src/getargs.c (short_options): Split and sort for readability.
2490 -g and -x take optional arguments, just like their long options.
2491 * build-aux/cross-options.pl: Use /x to make the regexp easier to
2493 Fix the handling of $opt which resulted in all the argument to be
2494 considered as optional.
2496 2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
2498 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
2499 say its interface is experimental.
2500 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
2502 (Bison Options): In the -L and --language entry, mention Java.
2503 (Java Bison Interface): Say the interface is experimental.
2504 * src/getargs.c (usage): Mention -L and --language.
2506 * NEWS (2.3a+): Say the push parsing interface is experimental.
2507 * doc/bison.texinfo (Push Decl): Likewise.
2508 (Decl Summary): Likewise in the "%define api.push_pull" entry.
2509 (Push Parser Function): Likewise.
2510 (Pull Parser Function): Likewise.
2511 (Parser Create Function): Likewise.
2512 (Parser Delete Function): Likewise.
2513 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
2514 yypull_parse, and yypush_parse entries.
2516 * NEWS (2.3a+): Mention XML support, and say the schema is
2518 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
2519 * src/getargs.c (usage): Say the XML schema is experimental.
2521 * NEWS (2.3a+): Say option instead of flag.
2523 2008-02-21 Wojciech Polak <polak@gnu.org>
2525 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
2528 2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
2530 Fix impure push parser compile error reported by Bob Rossi at
2531 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
2532 * data/yacc.c: Clean up whitespace in the output a little.
2533 (yypstate_allocated): Define for impure push parsers regardless of
2534 whether the pull interface is also requested.
2535 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
2536 check impure push parsers without the pull interface.
2538 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
2539 yyerror takes arguments specified by %parse-param while yypstate_new
2541 * doc/bison.texinfo (Parser Create Function): Document that
2542 yypstate_new returns 0 for multiple impure parser instances.
2543 * tests/push.at (Push Parsing: Multiple impure instances): Update
2544 expected stderr output.
2546 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
2548 * runtime-po/POTFILES.in (push.c): Remove.
2550 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
2552 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
2553 * data/push.c: Rename to...
2554 * data/yacc.c: ... this, overwriting it.
2555 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
2556 `%push-pull-parser' -> `%define api.push_pull "both"'.
2557 Remove old yacc.c tests, and update push.c tests to yacc.c.
2559 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
2561 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
2562 `"%code top" blocks' instead of `%code "top" blocks'.
2563 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
2564 Clean up whitespace in the output a little.
2566 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
2568 Fix documentation problems reported by Tim Josling at
2569 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
2570 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
2571 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
2572 integers. Explain the effect of literal string aliases on error
2573 messages. Copy token 0 documentation from the C++ skeleton
2576 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
2578 Accept a token number in a %left, %right, or %nonassoc for POSIX
2579 conformance. Reported by Tim Josling at
2580 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
2581 * NEWS (2.3a+): Mention.
2582 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
2583 and code numbers are treated by precedence declarations.
2584 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
2586 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
2588 (symbol.prec): New, just like symbol but allows INT.
2589 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
2591 * tests/regression.at (Token number in precedence declaration): New
2594 2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2596 DJGPP specific issues.
2597 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
2598 be changed. Copyright timestamp adjusted.
2599 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
2600 be changed. Copyright timestamp adjusted.
2601 * djgpp/config.site: Copyright timestamp adjusted.
2602 * djgpp/config_h.sed: Copyright timestamp adjusted.
2603 * djgpp/djunpack.bat: Copyright timestamp adjusted.
2604 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
2605 filename translation list.
2606 * djgpp/subpipe.c (init_subpipe): Check the environment variables
2607 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
2608 files shall be created. Before trying to use the temp dir where the
2609 environment variable points to check that the dir really exists. If
2610 not default to the cwd as temp dir. Copyright timestamp adjusted.
2611 * djgpp/subpipe.h: Copyright timestamp adjusted.
2612 * djgpp/testsuite.sed: Copyright timestamp adjusted.
2614 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
2616 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
2618 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
2620 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
2621 Problem reported by Claudio Saavedra in
2622 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
2624 2008-01-05 Wojciech Polak <polak@gnu.org>
2626 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
2627 document's title with the input grammar file name.
2629 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
2631 Automate regression testing of the XML/XSLT implementation. Discussed
2633 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
2634 * configure.ac (XSLTPROC): New substitution.
2635 * Makefile.am (maintainer-xml-check): New phony target invoking...
2636 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
2637 invoking make maintainer-check with BISON_TEST_XML=1.
2638 * tests/atlocal.in (XSLTPROC): New.
2639 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
2640 not to report reachable memory when Bison is expected to have a
2641 non-zero exit status and (2) to compare XML/XSLT output with --graph
2642 and --report=all output for every working grammar when
2644 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
2645 (AT_BISON_CHECK_XML): New.
2646 (AT_QUELL_VALGRIND): New.
2647 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
2648 (AT_CHECK): ... don't redefine this since this was the old way to
2650 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
2651 AT_BISON_CHECK invocations.
2652 * tests/c++.at: Likewise.
2653 * tests/calc.at: Likewise.
2654 * tests/conflicts.at: Likewise.
2655 * tests/cxx-type.at: Likewise.
2656 * tests/existing.at: Likewise.
2657 * tests/glr-regression.at: Likewise.
2658 * tests/headers.at: Likewise.
2659 * tests/input.at: Likewise.
2660 * tests/java.at: Likewise.
2661 * tests/output.at: Likewise.
2662 * tests/push.at: Likewise.
2663 * tests/reduce.at: Likewise.
2664 * tests/regression.at: Likewise.
2665 * tests/sets.at: Likewise.
2666 * tests/skeletons.at: Likewise.
2667 * tests/synclines.at: Likewise.
2668 * tests/torture.at: Likewise.
2669 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
2670 tends to hang xsltproc.
2671 (Big horizontal): Likewise.
2673 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2675 In XML output, remove redundant class attribute on symbol element.
2676 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
2677 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
2678 look up a symbol to determine whether it's a nonterminal or terminal.
2679 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
2680 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
2682 Add prec/assoc information to XML output.
2683 * src/gram.c (grammar_rules_print_xml): For each rule that has a
2684 %prec, add a percent_prec attribute.
2685 * src/print-xml.c (print_grammar): For each terminal that has a
2686 precedence or associativity, add a prec or assoc attribute.
2688 (xml_puts): Use xml_indent.
2689 (xml_printf): Use xml_indent.
2690 * src/print-xml.h (xml_indent): Prototype.
2692 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
2693 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
2695 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2697 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
2698 (bison:ruleByNumber): ... this for clarity.
2699 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
2700 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
2701 (xsl:template match="reduction"): Update.
2702 (xsl:template match="item"): Update.
2703 (xsl:template match="reduction"): Update.
2705 In the XML output, don't print the list of rules where symbols appear.
2706 Compute it in XSLT instead. Discussed at
2707 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
2708 * data/xslt/bison.xsl (bison:ruleByLhs): New.
2709 (bison:ruleByRhs): New.
2710 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
2712 (xsl:template match="terminal/rule"): Remove.
2713 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2715 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2717 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
2718 bison:ruleByRhs and mode="number-link" for rule template.
2719 (xsl:template match="terminal/rule"): Remove.
2720 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2721 bison:ruleByRhs and mode="number-link" for rule template.
2722 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2724 (xsl:template match="rule" mode="number-link"): ... this.
2725 * src/print-xml.c (print_grammar): Don't print the list of rules.
2727 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2729 Don't let --report affect XML output; always print all information.
2731 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
2732 * src/conflicts.c (log_resolution): Implement.
2733 * src/print-xml.c (print_core): Implement.
2734 (print_state): Implement.
2735 (print_xml): Implement.
2737 * NEWS (2.3a+): Fix quotes.
2738 * src/parse-gram.y (prologue_declaration): For consistency with -v,
2739 don't let %verbose clear the list specified by --report.
2741 2007-11-26 Akim Demaille <akim@epita.fr>
2743 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
2745 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
2747 In the XML output, list useless and unused symbols and rules with the
2748 useful ones and add a "usefulness" attribute. Discussed starting at
2749 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
2750 * src/gram.c (grammar_rules_partial_print_xml): Remove.
2751 (grammar_rules_print_xml): Print all rules instead of just those
2752 useful in the grammar, and add a "usefulness" attribute.
2753 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
2754 * src/print-xml.c (print_rules_useless_in_parser): Remove.
2755 (print_grammar): Print all nonterminals instead of just useful ones,
2756 and add a "usefulness" attribute to nonterminals and terminals.
2757 (print_xml): Don't print a separate "reductions" or
2758 "rules-useless-in-parser" element.
2759 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
2760 (reduce_xml): Remove.
2761 (reduce_token_unused_in_grammar): New.
2762 (reduce_nonterminal_useless_in_grammar): New.
2763 * src/reduce.h (reduce_xml): Remove prototype.
2764 (reduce_token_unused_in_grammar): Add prototype.
2765 (reduce_nonterminal_useless_in_grammar): Add prototype.
2766 * data/xslt/xml2text.xsl: Update for XML changes.
2767 * data/xslt/xml2xhtml.xsl: Update for XML changes.
2768 * tests/reduce.at (Useless Terminals): Update output.
2769 (Useless Rules): Update output.
2770 (Reduced Automaton): Update output.
2772 Say "Terminals unused in grammar" instead of "Unused terminals".
2773 * NEWS (2.3a+): Update.
2774 * doc/bison.texinfo (Understanding): Update example output.
2775 * src/reduce.c (reduce_output): Implement.
2776 * data/xslt/xml2text.xsl: Implement.
2777 * data/xslt/xml2xhtml.xsl: Implement.
2779 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2781 Accept --report-file=FILE to override the default `.output' filename.
2782 * NEWS (2.3a+): Mention.
2783 * doc/bison.texinfo (Bison Options): Add an entry.
2784 * src/files.c (compute_output_file_names): Don't override
2785 spec_verbose_file if already set.
2786 * src/getargs.c (usage): Document --report-file.
2787 (REPORT_FILE_OPTION): New anonymous enum member.
2788 (long_options): Add entry for it.
2789 (getargs): Add case for it setting spec_verbose_file.
2791 * build-aux/cross-options.pl: Don't record a short option just because
2793 * doc/.cvsignore: Add yacc.1.
2795 2007-11-14 Akim Demaille <akim@epita.fr>
2797 * doc/yacc.1.in: New.
2798 * configure.ac, doc/Makefile.am: Adjust.
2799 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
2801 Use AC_SUBST for assignments too.
2802 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
2804 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2806 * src/gram.c: Remove comments that duplicate comments in gram.h.
2808 When reporting useless rules and nonterminals, say "useless in grammar"
2809 instead of "useless", and say "useless in parser" instead of "never
2810 reduced". Discussed starting at
2811 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
2812 * NEWS (2.3a+): Mention this change.
2813 * data/xslt/xml2text.xsl: Update output text and expected input XML
2814 element names to match changes below.
2815 * data/xslt/xml2xhtml.xsl: Likewise.
2816 (xsl:template match="bison-xml-report"): Add missing entry in Table of
2817 Contents: "Rules useless in parser due to conflicts".
2818 * doc/bison.texinfo (Decl Summary): Reword a little.
2819 (Understanding): Update example output for changes below.
2820 * src/gram.c: (rule_useful_p): Rename to...
2821 (rule_useful_in_grammar_p): ... this.
2822 (rule_useless_p): Rename to...
2823 (rule_useless_in_grammar_p): ... this.
2824 (rule_never_reduced_p): Rename to...
2825 (rule_useless_in_parser_p): ... this.
2826 (grammar_rules_print): Update for renames.
2827 (grammar_rules_print_xml): Update for renames.
2828 (grammar_rules_never_reduced_report): Rename to...
2829 (grammar_rules_useless_report): ... this since it is used for either
2830 kind of useless rule.
2831 * src/gram.h: Reword comments and update function names in prototypes.
2832 * src/main.c (main): Say "rule useless in parser due to conflicts".
2833 * src/print-xml.c (print_rules_never_reduced): Rename to...
2834 (print_rules_useless_in_parser): ... this, and rename output XML
2835 element "rules-never-reduced" to "rules-useless-in-parser".
2836 (print_xml): Update for rename.
2837 * src/print.c (print_results): Say "Rules useless in parser due to
2839 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
2840 (nonterminals_reduce): Say "nonterminal useless in grammar".
2841 (reduce_output): Say "Nonterminals useless in grammar".
2842 Say "Rules useless in grammar".
2843 (reduce_xml): Rename output XML element "useless" to
2844 "useless-in-grammar".
2845 (reduce_print): Don't report the count of grammatically useless rules
2846 as "rules never reduced" just because %yacc is specified.
2847 In the correct report of this count, say nonterminal(s) and rule(s)
2848 "useless in grammar".
2849 * tests/conflicts.at (S/R in initial): Update expected output.
2850 (Defaulted Conflicted Reduction): Likewise.
2851 (Unreachable States After Conflict Resolution): Likewise.
2852 * tests/existing.at (GNU pic Grammar): Likewise.
2853 * tests/reduce.at (Useless Nonterminals): Likewise.
2854 (Useless Rules): Likewise.
2855 (Reduced Automaton): Likewise.
2856 (Underivable Rules): Likewise.
2857 (Empty Language): Likewise.
2859 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2861 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
2862 here document and before the EOF so that BSD's implementation of Bourne
2863 shell doesn't parse the delimiter as part of the here document.
2864 * doc/.cvsignore: Add cross-options.texi.
2865 * src/getargs.c (usage): Add a blank line after the warning categories.
2867 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
2869 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
2871 2007-11-05 Akim Demaille <akim@epita.fr>
2873 Remove Id: from bison.1.
2874 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
2875 (perl -0777 -pi -e 's/\.PP\nId): New.
2876 (.x.1): Use it to ignore the version control revision.
2878 2007-11-05 Akim Demaille <demaille@gostai.com>
2880 * build-aux/Makefile.am: Ship cross-options.pl.
2881 * doc/Makefile.am: Always refer to cross-options.texi with
2883 (MAINTAINERCLEANFILES): Add it.
2885 2007-11-04 Akim Demaille <demaille@gostai.com>
2887 Generate the long/short option cross-table.
2888 * build-aux/cross-options.pl: New.
2889 * doc/Makefile.am (cross-options.texi): New.
2890 * doc/bison.texinfo: Use it.
2892 2007-11-04 Akim Demaille <demaille@gostai.com>
2894 Generate bison.1 using help2man.
2895 * doc/common.x, doc/bison.x: New.
2896 * doc/Makefile.am (bison.1, .x.1): New.
2897 The code is taken from autoconf-2.61/man/Makefile.am.
2898 * configure.ac: Look for help2man.
2900 2007-11-04 Akim Demaille <demaille@gostai.com>
2903 * src/getargs.c (usage): Document -W, make it clear that -d,
2904 -g and -x have optional arguments.
2906 2007-11-04 Akim Demaille <demaille@gostai.com>
2908 Find sha1sum when named gsha1sum.
2909 * bootstrap (find_tool): New.
2912 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2914 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
2916 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
2917 * NEWS (2.3a+): Mention.
2918 * data/bison.m4 (b4_pure_if): Don't define it here.
2919 * data/c.m4 (b4_identification): Depend on individual skeletons to
2920 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
2921 values of the %define variables api.pure or api.push_pull. Define
2922 YYPURE, YYPUSH, and YYPULL accordingly.
2923 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
2924 glr.cc has already defined b4_pure_flag.
2925 * data/push.c: Define b4_pure_if based on `%define api.pure'.
2926 Remove YYPUSH and YYPULL since they're back in b4_identification again.
2927 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
2928 * doc/bison.texinfo (Pure Decl): Update.
2929 (Push Decl): Update.
2930 (Decl Summary): Add api.pure to %define entry.
2931 In %pure-parser entry, say it's deprecated and reference %define.
2932 (Pure Calling): Update.
2933 (Error Reporting): Update.
2934 (C++ Scanner Interface): Update.
2935 (How Can I Reset the Parser): Update.
2936 (Table of Symbols): In %pure-parser entry, say it's deprecated and
2938 * src/getargs.c (pure_parser): Remove global variable.
2939 * src/getargs.h (pure_parser): Remove extern.
2940 * src/output.c (prepare): Don't define pure_flag muscle.
2941 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
2942 wrapper around `%define api.pure'.
2943 * tests/calc.at (Simple LALR Calculator): Update.
2944 (Simple GLR Calculator): Update.
2945 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
2947 (GLR: Resolve ambiguity, pure, locations): Update.
2948 (GLR: Merge conflicting parses, pure, no locations): Update.
2949 (GLR: Merge conflicting parses, pure, locations): Update.
2950 * tests/glr-regression.at (Uninitialized location when reporting
2952 * tests/input.at (Unused %define api.pure): New test case.
2953 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
2954 AT_PURE_IF and AT_PURE_AND_LOC_IF.
2955 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2957 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2959 %define push_pull -> %define api.push_pull. Discussed starting at
2960 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
2961 * data/push.c: Expect the new name.
2962 * data/yacc.c: Likewise.
2963 * doc/bison.texinfo (Push Decl): Update.
2964 (Decl Summary): Update %define entry.
2965 (Push Parser Function): Update.
2966 (Pull Parser Function): Update.
2967 (Parser Create Function): Update.
2968 (Parser Delete Function): Update.
2969 * tests/calc.at (Simple LALR Calculator): Update.
2970 * tests/input.at (%define enum variables): Update.
2971 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2972 (Push Parsing: Multiple impure instances): Update.
2973 (Push Parsing: Unsupported Skeletons): Update.
2974 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
2975 (Exploding the Stack Size with Malloc): Update.
2977 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
2980 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
2982 For the XML output's terminal element, rename @number to @token-number,
2983 and add @symbol-number. In the nonterminal element, rename @number to
2984 @symbol-number. Discussed starting at
2985 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
2986 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
2988 (xsl:template match="nonterminal"): Likewise.
2989 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
2990 (xsl:template match="nonterminal"): Likewise.
2991 * src/print-xml.c (print_grammar): Implement.
2993 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2995 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
2996 2007-10-11 change, the child elements here are items not rules.
2997 (xsl:template match="item"): New.
2998 (xsl:template match="rule"): Update for new reduced itemset.
2999 (xsl:template match="point"): Remove.
3000 (xsl:template match="empty"): For consistency with --graph, don't
3001 output "/* empty */".
3002 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
3003 line-wrap, don't pass a negative value as first-line-length since this
3004 won't work with the following changes.
3005 (xsl:template name="line-wrap"): Simplify slightly.
3006 (xsl:template name="ws-search"): Eliminate recursion.
3007 * src/print_graph.c (print_core): Don't print a reduction's lookahead
3008 set next to an item whose dot is not at the end of the RHS even if it
3009 happens to be associated with the same rule.
3011 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
3013 Add %define lr.keep_unreachable_states.
3014 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
3015 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
3016 * src/main.c (main): Implement it.
3017 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3018 Extend to test it, and fix a typo.
3020 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
3022 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
3023 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
3024 the example .output text.
3025 * tests/regression.at (Extra lookahead sets in report): Improve wording
3028 2007-10-17 Wojciech Polak <polak@gnu.org>
3030 * src/print-xml.c (print_grammar): Renamed
3031 <terminal> and <nonterminal> attributes:
3032 "type" to "number" and "symbol" to "name".
3033 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
3034 Use new attribute names.
3035 (xsl:template match="nonterminal"): Likewise.
3036 * data/xslt/xml2xhtml.xsl: Likewise.
3038 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
3040 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
3041 (Option Cross Key): Likewise.
3043 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
3044 next to an item whose dot is not at the end of the RHS even if it
3045 happens to be associated with the same rule.
3046 * src/print.c (print_core): Likewise.
3047 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
3048 (Resolved SR Conflicts): Update output.
3049 * tests/regression.at (Extra lookahead sets in report): New test case.
3051 2007-10-11 Wojciech Polak <polak@gnu.org>
3053 * src/print-xml.c (print_core): Remove item set
3055 * data/xslt/bison.xsl (bison:ruleNumber): New key.
3056 Improve processing time. Suggested by Joel E. Denny.
3057 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
3058 Write xsl:param "required" attribute as comment.
3059 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
3060 (xsl:template match="rule"): Support new reduced itemset.
3061 (xsl:template match="point"): Remove.
3062 * data/xslt/xml2xhtml.xsl: Likewise.
3064 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
3066 * src/getargs.c (version): Update copyright year.
3068 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
3070 Make xml2dot.xsl and --graph produce the same output.
3071 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a ` '
3072 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
3074 (xsl:template name="output-node"): Use the new escape template instead
3075 of the string-replace template directly.
3076 (xsl:template name="output-edge"): Likewise.
3077 (xsl:template name="escape"): New, escapes backslashes and newlines in
3078 addition to quotation marks.
3079 * src/graphviz.c (start_graph, output_node, output_edge): Add
3080 whitespace to output for legibility.
3082 Make xml2text.xsl and --report produce the same output, and remove the
3083 XML "conflicts" element since a conflict summary is easily extracted
3085 * data/xslt/bison.xsl: New.
3086 (xsl:template match="state" mode="bison:count-conflicts): New.
3087 * data/xslt/xml2text.xsl: Import bison.xsl.
3088 (xsl:template match="bison-xml-report"): Instead of styling the
3089 "conflicts" element, style the "automaton" element with mode
3090 "conflicts". Unlike the former, the latter lists S/R and R/R
3091 conflicts for a state on the same line.
3092 (xsl:template match="conflicts"): Remove.
3093 (xsl:template match="conflict"): Remove.
3094 (xsl:template match="terminal"): Line-wrap the list of rules in which
3095 the terminal is used.
3096 (xsl:template match="nonterminal"): Likewise for nonterminals.
3097 (xsl:template match="automaton" mode="conflicts"): New.
3098 (xsl:template match="state" mode="conflicts"): New.
3099 (xsl:template name="line-wrap"): New.
3100 (xsl:template name="ws-search"): New.
3101 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
3102 (xsl:template match="bison-xml-report"): Instead of styling the
3103 "conflicts" element, style the "automaton" element with mode
3105 (xsl:template match="conflicts"): Remove.
3106 (xsl:template match="conflict"): Remove.
3107 (xsl:template match="automaton" mode="conflicts"): New.
3108 (xsl:template match="state" mode="conflicts): New.
3109 * src/conflicts.c (conflicts_output_xml): Remove.
3110 * src/conflicts.h (conflicts_output_xml): Remove prototype.
3111 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
3112 * src/print.c (print_grammar): Consistently wrap at the 66th column so
3113 the corresponding XSLT is easier. Also, never wrap between a word and
3114 the comma that follows it.
3116 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
3118 Improve C++ namespace support. Discussed starting at
3119 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
3120 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
3121 b4_namespace_close): New macros that interpret the %define variable
3122 "namespace" so its value can contain "::" to indicate nested
3124 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
3126 * data/lalr1.cc (b4_namespace): Likewise.
3127 * data/location.cc (b4_namespace): Likewise.
3128 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
3129 inside a new table in the general %define entry. Document `%define
3130 namespace' there as well. Point the %name-prefix entry to it since it
3131 explains it more completely in the case of C++.
3132 (C++ Bison Interface): Mention `%define namespace' instead of
3134 (Table of Symbols): Remove the `%define push_pull' entry. The %define
3136 * tests/c++.at (Relative namespace references): New test case.
3137 (Absolute namespace references): New test case.
3138 (Syntactically invalid namespace references): New test case.
3139 * tests/input.at (C++ namespace reference errors): New test case.
3141 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
3143 Add syncline support and location accessor to internal %define
3145 * data/bison.m4 (b4_percent_define_get_loc): New.
3146 (b4_percent_define_get_syncline): New.
3147 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
3148 (b4_percent_define_default): Record defining location as line 1 rather
3149 than 0 for the sake of synchronizing #line's, and define
3150 b4_percent_define_syncline(VARIABLE).
3151 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
3152 * src/muscle_tab.c (muscle_syncline_grow): New.
3153 (muscle_code_grow): Use muscle_syncline_grow.
3154 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
3155 define b4_percent_define_syncline(VARIABLE).
3156 (muscle_percent_define_get_loc): New.
3157 (muscle_percent_define_get_syncline): New.
3158 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
3159 remove some unused variables.
3160 (muscle_percent_define_default): Record defining location as line 1
3161 rather than 0 for the sake of synchronizing #line's, and define
3162 b4_percent_define_syncline(VARIABLE).
3163 (muscle_percent_define_check_values): Use
3164 muscle_percent_define_get_loc.
3165 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
3166 (muscle_percent_define_get_syncline): Prototype.
3167 * tests/skeletons.at (%define Boolean variables: invalid skeleton
3168 defaults): Update output for location change.
3169 (Complaining during macro argument expansion): Extend to test
3170 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
3172 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
3174 Fix some error-reporting macro bugs.
3175 * data/bison.m4 (b4_cat): New.
3176 (b4_error, b4_error_at): Use b4_cat to send error directives directly
3177 to stdout so they don't become arguments to other macros. Update
3178 comments and add examples.
3179 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
3181 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
3182 after printing the error directive so that M4 doesn't report subsequent
3183 problems that are induced by this problem.
3184 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
3185 instead of just in them. Recognize @\n in both places. Both expand to
3186 the empty string. Needed by b4_cat.
3187 * tests/skeletons.at (Complaining during macro argument expansion):
3189 (Fatal errors make M4 exit immediately): New test case.
3191 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
3193 Implement --print-datadir.
3194 * src/getargs.c (usage): Mention.
3195 (PRINT_DATADIR_OPTION): New anonymous enum member.
3196 (long_options): Add entry for it.
3197 (getargs): Add case for it calling compute_pkgdatadir.
3198 * src/output.c (output_skeleton): Encapsulate data directory
3199 computation from here...
3200 (prepare): ... and from here...
3201 (compute_pkgdatadir): ... into this new function.
3202 * src/output.h (compute_pkgdatadir): Prototype.
3204 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
3206 * src/print-xml.c (escape_bufs): New static global variable
3208 (xml_escape_n): ... the static local variable buf here.
3209 (print_xml): Free memory for escape_bufs.
3210 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
3212 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
3214 Replace `%push-parser' and `%push-pull-parser' with
3215 `%define push_pull "push"' and `%define push_pull "both"'.
3216 `%define push_pull "pull"' is the default.
3217 * doc/bison.texinfo (Push Decl, Push Parser Function,
3218 Pull Parser Function, Parser Create Function, Parser Delete Function):
3219 Update declarations.
3220 (Decl Summary, Table of Symbols): Replace %push-parser and
3221 %push-pull-parser entries with a %define push_pull entry.
3222 * data/bison.m4 (b4_percent_define_check_values): New macro.
3223 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
3225 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
3227 * data/push.c: ... to here and compute them from the value of the
3228 %define variable push_pull.
3229 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
3230 parsing requests here...
3231 * data/yacc.c: ... hack this to switch to push.c any time
3232 b4_use_push_pull_flag or the %define variable push_pull is set. This
3233 will go away when we mv push.c yacc.c.
3234 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
3235 push parsing is not supported since unused %define variables are
3237 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
3238 * src/muscle_tab.h (muscle_percent_define_check_values): Update
3239 comments for consistency with b4_percent_define_check_values.
3240 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
3242 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
3244 (prologue_declaration): Remove %push-parser and %push-pull-parser
3246 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
3247 * tests/calc.at: Update declarations.
3248 * tests/input.at (%define enum variables): New test case.
3249 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
3251 (Push Parsing: Multiple impure instances): Update declaration.
3252 (Push Parsing: Unsupported Skeletons): New test case.
3253 * tests/torture.at (Exploding the Stack Size with Alloca): Update
3255 (Exploding the Stack Size with Malloc): Update declaration.
3257 2007-09-24 Wojciech Polak <polak@gnu.org>
3259 Add XSLT transformations.
3261 * data/xslt/xml2dot.xsl: Transform XML into DOT.
3262 * data/xslt/xml2text.xsl: Transform XML into plain text.
3263 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
3264 * data/Makefile.am (xsltdir): New variable.
3265 (dist_xslt_DATA): Add xslt/*.xsl files.
3267 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
3269 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
3270 Problem reported by Wojciech Polak.
3271 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
3272 (xml_printf): Undo change I made on 21 September; that is,
3273 indent 2 spaces, not 1.
3275 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
3277 Pacify ./configure --enable-gcc-warnings.
3278 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
3279 `char const *' instead of `char *'.
3280 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
3281 local variable `sep'.
3283 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
3285 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
3287 * src/print-xml.c: Prefer "const" after types; that's more consistent.
3288 (xml_printf): Indent just 1 space for level.
3289 (e_char, xlate_char): Remove.
3290 (xml_escape_string): Rewrite to avoid undefined behavior (used
3291 storage that was freed from the stack).
3292 (xml_escape_n): Don't bother checking for subscript error.
3294 2007-09-21 Wojciech Polak <polak@gnu.org>
3296 Add Bison XML Automaton Report.
3298 Add support for an -x option to generate an XML report.
3299 It is not documented yet.
3300 * src/print-xml.c: New file.
3301 * src/print-xml.h: Likewise.
3302 * lib/timevar.def (TV_XML): New var.
3303 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
3304 * src/conflicts.c: Include print-xml.h.
3305 (solved_conflicts_xml_obstack): New var.
3306 (log_resolution, conflicts_solve, conflicts_free):
3307 Add support for XML report.
3308 (conflicts_output_val): New function.
3309 * src/conflicts.h (conflicts_output_val): New decl.
3310 * src/files.c (spec_xml_file): New var.
3311 (compute_output_file_names, output_file_names_free): Add XML support.
3312 * src/files.h (spec_xml_file): New decl.
3313 * src/getargs.c (xml_flag): New var.
3314 (usage, short_options, long_options, getargs): Add XML support.
3315 * src/getargs.h (xml_flag): New decl.
3316 * src/gram.c: Include print-xml.h.
3317 (rule_lhs_print_xml, rule_rhs_print_xml):
3318 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
3320 * src/gram.h: Declare external ones.
3321 * src/main.c: Include print-xml.h.
3322 (main): Add XML support.
3323 * src/reduce.c: Include print-xml.h.
3324 (reduce_xml): New function.
3325 * src/reduce.h: Declare it.
3326 * src/state.c: Include print-xml.h.
3327 (state_new): Add XML support.
3328 (state_rule_lookahead_tokens_print_xml): New function.
3329 * src/state.h: Declare it.
3330 (struct state): New member solved_conflicts_xml.
3331 * src/symtab.c (symbol_class_get_string): New function.
3332 * src/symtab.h: Declare it.
3334 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
3336 * GNUmakefile: Switch to coreutils's version.
3337 * bootstrap: Likewise.
3338 * Makefile.cfg: Adjust to new GNUmakefile.
3339 * README-hacking: Likewise.
3343 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
3344 Bruno Haible <bruno@clisp.org>
3346 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
3347 and is a script that invokes bison. Tighten the code. Add comments.
3349 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
3351 Spell "boolean" as "Boolean". Reported by Akim Demaille.
3352 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
3353 * doc/bison.texinfo (Decl Summary): Fix.
3354 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
3355 * tests/input.at (Boolean %define variables): Update output.
3356 * tests/skeletons.at (%define boolean variables: invalid skeleton
3357 defaults): Rename to...
3358 (%define Boolean variables: invalid skeleton defaults): ... this and
3361 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
3363 In impure push mode, don't allow more than one yypstate to be allocated
3364 since multiple impure parsers would corrupt yynerrs.
3365 * data/push.c (yypstate_allocated): New static global variable
3367 (yypull_parse): If yypstate_new returns 0, don't report it as memory
3368 exhaustion if yypstate_allocated is 1, but still return 2.
3369 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
3370 already 1. Otherwise, set it to 1.
3371 (yypstate_delete): Set it to 0.
3372 * tests/push.at (Push Parsing: Multiple impure instances): New test
3375 2007-08-17 Bob Rossi <bob@brasko.net>
3377 * doc/bison.texinfo (Push Decl): Document the push parser.
3378 (Table of Symbols): Ditto.
3380 (Decl Summary): Ditto.
3381 (Multiple Parsers, Push Parser Function, Pull Parser Function,
3382 Parser Create Function, Parser Delete Function):
3383 Add new push parser symbols.
3384 (Table of Symbols): Document push-parser, push-pull-parser,
3385 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
3387 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
3390 * doc/gpl-3.0.texi: New file.
3391 * doc/gpl.texi: Remove.
3392 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
3393 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
3394 * README-hacking, TODO, bootstrap, bootstrap.conf:
3395 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
3396 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
3397 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
3398 * data/lalr1.cc, data/lalr1.java, data/location.cc:
3399 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
3400 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
3401 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
3402 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
3403 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
3404 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
3405 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
3406 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
3407 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
3408 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
3409 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
3410 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
3411 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
3412 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
3413 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
3414 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
3415 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
3416 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
3417 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
3418 * src/complain.c, src/complain.h, src/conflicts.c:
3419 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
3420 * src/files.h, src/flex-scanner.h, src/getargs.c:
3421 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
3422 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
3423 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
3424 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
3425 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
3426 * src/print.c, src/print.h, src/print_graph.c:
3427 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
3428 * src/reduce.h, src/relation.c, src/relation.h:
3429 * src/revision.h, src/scan-code.h, src/scan-code.l:
3430 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
3431 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
3432 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
3433 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
3434 * tests/Makefile.am, tests/actions.at, tests/c++.at:
3435 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
3436 * tests/existing.at, tests/glr-regression.at:
3437 * tests/headers.at, tests/input.at, tests/java.at:
3438 * tests/local.at, tests/output.at, tests/push.at:
3439 * tests/reduce.at, tests/regression.at, tests/sets.at:
3440 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
3444 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
3446 Get rid of broken %no-parser, -n, and --no-parser implementation and
3448 * TODO: Don't mention them.
3449 * doc/bison.1: Likewise.
3450 * doc/bison.texinfo (Decl Summary): Likewise.
3451 (Bison Options): Likewise.
3452 (Option Cross Key): Likewise.
3453 * src/getargs.c (no_parser_flag): Remove global variable.
3454 (usage): Don't print description of -n and --no-parser.
3455 (long_options): Remove --no-parser entry here.
3456 (getargs): Remove -n case in the switch here.
3457 * src/getargs.h (no_parser_flag): Remove extern.
3458 * tests/regression.at (Web2c Actions): Remove comment that mentions
3461 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
3463 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
3464 name user variables starting with `yy'. Just pass NULL instead of a
3465 dummy local &yylval to yypush_parse.
3466 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
3469 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
3471 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
3472 true since it's then always used regardless of whether yyoverflow is
3473 defined. Reported by Christian Burger at
3474 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
3475 * THANKS: Add Christian Burger.
3477 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3478 node names: say "Decl Summary" not "Bison Declaration Summary".
3480 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
3482 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
3483 determine whether this function has already complained about an invalid
3484 value for a %define boolean variable, don't check whether Bison has
3485 ever examined the value. As written, the check was a tautology.
3486 Instead, record and check for this complaint using a separate muscle.
3488 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3490 Fix push parsing memory leak reported by Brandon Lucia at
3491 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
3492 * THANKS: Add Brandon Lucia.
3493 * data/push.c (yypstate_delete): Free the stack if it was reallocated
3494 but the parse never completed and thus freed it.
3495 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
3496 * tests/testsuite.at: Include push.at.
3497 * test/push.at: New.
3498 (Push Parsing: Memory Leak for Early Deletion): New test case.
3500 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
3502 Improve handling of multiple S/R conflicts in the same state and of S/R
3503 conflicts involving multiple reductions.
3504 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
3505 set for a state here or Bison will abort if it is reassigned on a
3506 later conflicted reduction in the same state.
3507 Similarly, don't finalize and assign the solved conflicts report here
3508 or it will be lost if it is reassigned on a later conflicted reduction
3510 (set_conflicts): Instead, assign them both here after all S/R conflicts
3511 in the state have been fully examined.
3512 * src/print.c (shift_set): Rename to...
3513 (no_reduce_set): ... this.
3514 (print_reductions): Update for rename, and add %nonassoc error action
3515 tokens to no_reduce_set so that, when printing the first remaining
3516 reduction on an error action token, the reduction is enclosed in
3518 (print_results): Update for rename.
3519 * tests/conflicts.at (Solved conflicts report for multiple reductions
3520 in a state): New test case.
3521 (%nonassoc error actions for multiple reductions in a state): New test
3524 * src/main.c (main): Don't depend on C99 features.
3526 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
3528 * build-aux/.cvsignore: Add compile.
3529 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
3532 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
3534 * bootstrap (slurp): Create target directories that don't exist.
3535 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
3537 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3539 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
3541 * closure.c (closure): Likewise.
3542 * state.h (reductions): Comment sorting of rules.
3543 (state): Comment sorting of items.
3545 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
3547 Fix C++ test cases after recent Gnulib changes. Discussed starting at
3548 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
3549 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
3550 definition in order to avoid Gnulib headers since we don't use config.h
3552 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
3553 rather than AT_DATA so that config.h is included.
3555 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
3557 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
3558 instead of fprintf. Guard these functions with #if YYDEBUG instead of
3559 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
3560 and so that YYFPRINTF is guaranteed to be defined here.
3562 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
3564 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
3566 (muscle_percent_define_check_values): ... this more helpful function.
3567 Again, it's not used yet, but it will be.
3568 * src/muscle_tab.h: Likewise.
3570 Improve some comments in parser table construction.
3571 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
3572 (generate_states): Don't mention ruleset, which is internal to closure.
3573 * src/closure.c (closure): Explain sorting of core and itemset, which
3574 is required for this function to behave correctly.
3575 * src/closure.h (closure): Mention sorting.
3577 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
3579 * src/lalr.c (state_lookahead_tokens_count): For code readability,
3580 move the check for disabled transitions to an aver since conflict
3581 resolution hasn't happened yet.
3583 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
3584 labels a state as inconsistent just because it has error transitions.
3585 The original form of this check appeared in revision 1.1 of lalr.c,
3586 which was committed on 1991-12-21. Now (at least), changing the
3587 consistency label on such a state appears to have no useful effect in
3588 any of the places it is examined, which I enumerate below. The key
3589 point to understanding each item in this enumeration is that a state
3590 with an error transition is labelled consistent in the first place only
3591 if it has no rules, so the check cannot matter for states that have
3592 rules. (1) Labelling a state as inconsistent will cause set_conflicts
3593 to try to identify its conflicts, and a state must have *rules* to have
3594 conflicts. (2) Labelling a state as inconsistent will affect how
3595 action_row sets the default *rule* for the state. (3) Labelling a
3596 state as inconsistent will cause build_relations to add lookback edges
3597 to *rules* in that state.
3598 * src/state.h (struct state): Word the comment for member consistent
3601 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3603 Don't depend on C99 features.
3604 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
3605 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
3606 * src/reader.c (check_and_convert_grammar): Fix for-loop.
3607 * src/state.c (state_mark_reachable_states): Fix for-loop.
3608 (state_remove_unreachable_states): Fix for-loop.
3610 Don't widen struct state with member reachable just to temporarily
3611 record reachability. Instead, use a local bitset.
3612 * src/state.h (struct state): Remove member.
3613 * src/state.c (state_new): Don't initialize it.
3614 (state_mark_reachable_states): Rename to...
3615 (state_record_reachable_states): ... this, and use bitset.
3616 (state_remove_unreachable_states): Use bitset.
3618 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
3620 * src/Makefile.am (yacc): Quote target action commands properly so
3621 that the yacc script isn't corrupt. Reported by Hans Aberg at
3622 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
3624 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
3625 the case of pure parsers. Reported by Frans Englich at
3626 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
3627 * THANKS: Add Frans Englich.
3629 * NEWS (2.3a+): In the %code entry, reference section `Bison
3630 Declaration Summary' from the manual now since the %code summary has
3632 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
3633 in the rules section must be terminated by semicolons.
3635 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
3637 Extend the front-end API for %define variables to more completely
3638 mirror the back-end. This will be useful in the future.
3639 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
3640 Update comments to mention the new front-end counterparts of these
3642 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
3643 for muscle_string_decode and muscle_location_decode.
3644 (muscle_string_decode): New static function.
3645 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
3646 (muscle_percent_define_get, muscle_percent_define_ifdef): New
3648 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
3649 muscle_percent_define_get to mimic the b4_percent_define_flag_if
3650 implementation more closely.
3651 (muscle_percent_define_invalid_value): New function.
3652 * src/muscle_tab.h (muscle_percent_define_get,
3653 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
3656 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
3658 * NEWS (2.3a+): Mention yesterday's state-removal change.
3659 (2.3a): Remove the %language entry, which was added after 2.3a.
3660 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
3661 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
3662 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
3663 tests/existing.at: Update copyright date.
3665 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3667 If conflict resolution makes states unreachable, remove those states,
3668 report rules that are then unused, and don't report conflicts in those
3670 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
3671 New global function.
3672 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
3674 * src/main.c (main): After conflict resolution, remove the unreachable
3675 states and update all data structures that reference states by number.
3676 * src/state.c (state_new): Initialize each state's reachable member to
3678 (state_mark_reachable_states): New static function.
3679 (state_remove_unreachable_states): New global function.
3680 * src/state.h (struct state): Add member bool reachable.
3681 (state_remove_unreachable_states): Prototype.
3682 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3684 * tests/existing.at (GNU pic Grammar): Update test case output now that
3685 an unused rule is discovered.
3687 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3689 Minor code cleanup in parser table construction.
3690 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
3691 (new_itemsets, save_reductions): Update for rename to nitemset.
3692 * src/closure.c (nritemset): Rename to...
3693 (nitemset): ... this since the "r" appears to meaningless and isn't
3694 used in the comments.
3695 (closure): Update for rename.
3696 * src/closure.h (nritemset): Update extern to...
3697 (nitemset): ... this.
3698 * src/lalr.c (LA): Fix a typo in comments.
3699 * src/print.c (print_core): Update for rename to nitemset.
3700 * src/print_graph.c (print_graph): Likewise.
3701 * src/state.h: Fix some typos in header comments.
3703 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
3705 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
3706 still sticks to ASCII. Sorry!
3708 * README-hacking: New file, taken mostly from coreutils, with changes
3709 for Bison. Contains much of the contents of:
3710 * README-cvs: Remove.
3711 * bootstrap: Sync from gnulib.
3712 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
3713 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
3715 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
3717 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
3719 (Java Differences): Fix some typos.
3720 * THANKS: Add Sebastian Setzer.
3722 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
3724 * data/java.m4 (b4_single_class_if): Remove.
3725 (b4_abstract_if): Look at "%define abstract".
3727 (b4_union_name): Rename...
3728 (b4_yystype): ... to this. Map to "%define stype".
3729 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
3730 b4_maybe_throws): Fix quoting.
3731 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
3732 * data/lalr1.java (Lexer interface): Always define.
3733 (Lexer interface within parser class): Remove.
3734 (YYLexer class): New, used when "%code lexer" is present.
3735 (constructor): When "%code lexer" is used, pass %lex-param
3736 to the lexer constructor.
3737 (yylex, yyparse): Remove %lex-param from method invocations
3738 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
3740 * doc/bison.texinfo (Java Bison Interface): Mention "%define
3741 abstract". Rename "%define union_name" to "%define stype".
3742 Rename method names according to previous patch.
3743 (Java Scanner Interface): Describe "%code lexer" instead of
3744 "%pure-parser" and "%define single_class".
3745 (Java Differences): Mention "%code lexer".
3747 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
3748 Include scanner here, using macros from tests/local.at.
3749 (AT_DATA_CALC_Y): Remove final argument.
3750 (_AT_CHECK_JAVA_CALC): Likewise.
3751 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
3752 of %locations and %error-verbose.
3753 (main): Test with and without %lex-param.
3754 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
3755 (AT_BISON_OPTION_POPDEFS): Pop it.
3757 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3759 DJGPP spefic issue. Inhibit the use of disallowed characters for
3760 file name genertion on Win98, WinXP, etc. These are |<>":?*\
3761 and concern testsuite case 46.
3762 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
3763 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
3764 * djgpp/config.bat: Inhibit the use of disallowed characters.
3766 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3768 Miscellaneous %define and %code cleanup.
3769 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
3770 values are interpreted.
3771 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
3772 documentation a little more.
3773 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
3774 muscle_percent_define_insert, muscle_percent_code_grow): New
3776 * src/muscle_tab.h (muscle_percent_define_insert,
3777 muscle_percent_code_grow): Prototype.
3778 * src/parse-gram.y (prologue_declaration): Use
3779 muscle_percent_define_insert and muscle_percent_code_grow when parsing
3780 %define and %code directives.
3782 Make it easy to share %define boolean variables between the front-end
3783 and back-end. Though not used yet, this will be useful in the future.
3784 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
3785 Bison uses of names rather than just skeleton uses of names.
3786 (b4_percent_define_get, b4_percent_define_ifdef): Rename
3787 b4_percent_define_skeleton_variables(VARIABLE) to
3788 b4_percent_define_bison_variables(VARIABLE).
3789 (b4_percent_code_get, b4_percent_code_ifdef): Rename
3790 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
3791 b4_percent_code_bison_qualifiers(QUALIFIER).
3792 (b4_check_user_names_wrap): Update for renames.
3793 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
3794 muscle_percent_define_default): New functions mimicking
3795 b4_percent_define_flag_if and b4_percent_define_default.
3797 For %define variables, report locations for invalid values and
3799 * data/bison.m4 (b4_percent_define_flag_if): Read
3800 b4_percent_define_loc(VARIABLE) to report the location of an invalid
3802 (b4_percent_define_default): Save a special location in
3803 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
3804 must later be reported as invalid.
3805 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
3807 (muscle_percent_define_insert): Record the location of VARIABLE in
3808 muscle percent_define_loc(VARIABLE), and use it to report the previous
3809 location for a redefinition.
3810 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
3811 (muscle_percent_define_default): Update like b4_percent_define_default.
3812 (muscle_grow_user_name_list): Rename to...
3813 (muscle_user_name_list_grow): ... this for consistency and use
3814 muscle_location_grow.
3815 * src/muscle_tab.h (muscle_location_grow): Prototype.
3816 * tests/input.at (%define errors): Update expected output.
3817 * tests/skeletons.at (%define boolean variables: invalid skeleton
3818 defaults): New test case.
3820 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
3822 * src/print.c (lookahead_set, state_default_rule): Remove.
3823 (print_reductions): Replace state_default_rule invocation with
3824 equivalent use of yydefact, which was computed in token_actions in
3826 (print_results): Don't allocate lookahead_set.
3828 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
3830 * data/lalr1.java: Prefix all private members with yy.
3832 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
3834 Use YYFPRINTF instead of fprintf where appropriate. Reported by
3835 Sebastien Fricker at
3836 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
3837 * THANKS: Add Sebastien Fricker.
3838 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
3839 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
3840 accept a variable number of arguments.
3842 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3844 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
3846 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3848 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
3849 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
3850 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
3852 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
3854 Undo my 2007-02-07 change, switching back to the c-strcase module
3855 introduced in the 2007-02-03 change. Bruno Haible reported that
3856 the 2007-02-07 change would be dangerous in Turkish if we add a
3857 language whose name contains "i", since "i" is not lowercase "I"
3859 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
3860 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
3861 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
3862 * m4/.cvsignore: Remove strcase.m4.
3863 * src/getargs.c: Revert 2007-02-07 change, as follows.
3864 Include c-strcase.h.
3865 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
3867 2007-02-11 Bruno Haible <bruno@clisp.org>
3869 Enable the Java related testsuite tests when the only Java compiler
3870 found is a gcj < 4.3. Discussed at
3871 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
3872 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
3874 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
3876 * data/Makefile.am: Update copyright date.
3877 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
3878 yypstate_new returns NULL.
3879 (yypstate_new): Return NULL if malloc does.
3880 * src/reader.c (packgram): Move translation of rule actions from the
3881 beginning of packgram to...
3882 (check_and_convert_grammar): ... here right before packgram is invoked
3883 so it's easier to write more complete comments, and remove redundant
3886 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
3888 As in semantic actions, make @$ in %initial-action, %destructor, and
3889 %printer imply %locations.
3890 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
3892 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
3893 (@$ in %initial-action implies %locations,
3894 @$ in %destructor implies %locations,
3895 @$ in %printer implies %locations): ... these new test cases.
3897 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
3899 Undo most of the 2007-02-03 change, switching to the strcase module
3900 now that gnulib strcase has been fixed.
3901 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
3902 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
3903 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
3904 * m4/.cvsignore: Add strcase.m4.
3905 * src/getargs.c: Revert 2007-02-03 change, as follows.
3906 Don't include c-strcase.h.
3907 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
3908 strcasecmp has "unspecified behavior" outside the POSIX locale,
3909 but it works fine in practice if at least one argument is ASCII,
3910 as is the case in Bison.
3912 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
3914 * tests/java.at: Skip tests if only one of javac/java is present.
3915 Reported by Joel E. Denny.
3916 * tests/atlocal.in: Adjust copyright years.
3918 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
3920 * data/lalr1.java (Stack): Work around old verifiers that disallow
3921 access to the private fields of an inner class, from the outer class.
3922 We can make Stack's fields public because user code doesn't have access
3923 to the instance of Stack used by parse(). Reported by Paul Eggert.
3925 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
3927 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
3928 the right spot for these files?
3929 * bootstrap.conf (gnulib_modules): Add c-strcase.
3930 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
3932 * src/getargs.c: Include c-strcase.h.
3933 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
3934 to avoid unspecified behavior.
3936 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
3938 * doc/bison.texinfo (Decl Summary): Correct typo.
3940 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
3942 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
3943 Complain if the value does not match empty, "true" or "false".
3944 * data/c++.m4: Adjust default definitions of %define variables.
3945 * data/java.m4: Adjust default definitions of %define variables.
3946 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
3948 * tests/input.at (Boolean %define variables): Test new behavior.
3950 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
3952 * NEWS: Mention java.
3953 * TODO: Remove things that are done.
3954 * bootstrap.conf: Add javacomp-script and javaexec-script.
3955 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
3957 * data/Makefile.am: Add new files.
3958 * data/java-skel.m4: New.
3959 * data/java.m4: New.
3960 * data/lalr1.java: New.
3962 * doc/bison.texinfo: Put "A Complete C++ Example" under
3963 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
3964 under Other Languages.
3966 * src/getargs.c (valid_languages): Add Java.
3967 * src/getargs.h (struct bison_language): Update size of string fields.
3969 * tests/Makefile.am: Add java.at.
3970 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
3971 * tests/java.at: New.
3972 * tests/testsuite.at: Include it.
3974 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
3977 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
3978 at_directive_argv arguments so these no longer have to be global
3979 variables. Also, update the implementation for the following changes.
3980 (fail_for_at_directive_too_many_args,
3981 fail_for_at_directive_too_few_args): Add at_directive_name argument.
3982 (at_directive_name): Remove as at_directive_argv[0] will be used for
3984 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
3985 for the directive name.
3986 (at_directive_argc, at_directive_argv): Make these local within
3987 skel_lex instead of global.
3988 (INITIAL): Update directive start action for above changes.
3989 (SC_AT_DIRECTIVE_ARG): Rename to...
3990 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
3991 (SC_AT_DIRECTIVE_SKIP_WS): Update.
3992 (scan_skel): Move yylex_destroy to...
3993 (skel_scanner_free): ... here.
3994 * tests/skeletons.at (installed skeleton file name): Rename to...
3995 (installed skeleton file names): ... this.
3997 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
3999 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
4000 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
4001 Summary" not "Directives".
4002 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
4003 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
4004 since the former is now the more complete one.
4005 (Prologue Alternatives): Likewise and do the same for %defines.
4006 (Table of Symbols): Add summary of %code, add summary of %define, and
4007 move full %code documentation to...
4008 (Decl Summary): ... here for consistency with other entries in these
4010 Move %define entry in order to keep this list alphabetized.
4011 Reword %define entry a little to put less emphasis on the skeleton
4012 concept, which most users shouldn't have to think about.
4014 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
4016 Adjust to recent gnulib changes.
4017 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
4018 Add string.h, string_.h, unistd_.h, wchar_.h.
4019 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
4020 * src/system.h: Don't include <stpcpy.h>; this is now done by
4023 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
4025 Simplify implementation of unqualified %code, implement macros for
4026 uniform treatment of boolean %define flags. Document %define.
4027 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
4028 b4_percent_code_ifdef): New.
4029 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
4030 * data/c++.m4: Define default value for global_tokens_and_yystype.
4031 * data/glr.cc: Likewise.
4032 * data/location.cc: Use b4_percent_define_flag_if.
4034 * doc/bison.texinfo (Decl Summary): Document %define.
4036 * src/parse-gram.y (Unqualified %code): Change muscle name to
4038 (content.opt): Default to empty.
4040 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
4042 Implement support for relative and absolute skeleton file names.
4043 Discussed starting at
4044 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
4045 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
4046 (Bison Options): Document in --skeleton entry.
4047 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
4048 full_skeleton can't necessarily hold all of pkgdatadir.
4049 If the specified skeleton file name contains a `/', don't prepend
4051 * src/parse-gram.y (prologue_declaration): If the specified skeleton
4052 file name contains a `/', prepend the grammar file directory.
4053 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
4054 * skeletons.at: New file.
4055 (relative skeleton file names): New test case.
4056 (installed skeleton file names): New test case.
4057 * tests/testsuite.at: Include skeletons.at.
4059 * bootstrap: Update copyright to 2007.
4061 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
4063 * bootstrap: Remove occurrences of .#bootmp from the files.
4065 2007-01-17 Akim Demaille <akim@epita.fr>
4067 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
4069 Use per-type %printer.
4071 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
4073 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
4074 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4075 djgpp/config.site, src/files.c, src/files.h, src/main.c,
4076 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
4077 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
4078 tests/glr-regression.at, tests/input.at, tests/local.at,
4079 tests/output.at, tests/torture.at: Update copyright to 2007.
4081 2007-01-16 Akim Demaille <akim@epita.fr>
4083 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
4085 (Calc++ Scanner): Exit with failure if we can't open the input
4087 Accept "-" standing for stdin.
4088 (Calc++ Top Level): Print the result only if the parsing was
4091 2007-01-16 Akim Demaille <akim@epita.fr>
4093 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
4095 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
4096 and Joel E. Denny <jdenny@ces.clemson.edu>
4098 Clean up %define and %code implementation in M4 some. Most
4099 importantly, rename all related macros to be in the b4_percent_define
4100 and b4_percent_code namespaces. Also, complete support for `.' in
4101 %define variable names and %code qualifiers.
4102 * data/bison.m4 (b4_check_user_names): Check for special
4103 "SKELETON-NAMESPACE(name)" macros instead of using two nested
4105 (b4_get_percent_define, b4_get_percent_code): Rename to...
4106 (b4_percent_define_get, b4_percent_code_get): ... these.
4107 Extend documentation with examples.
4108 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
4109 b4_percent_define_skeleton_variables and
4110 b4_percent_code_skeleton_qualifiers.
4111 Expect any value for the %define variable `foo' to be stored in the
4112 macro named `b4_percent_define(foo)'; expect any %code blocks for the
4113 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
4114 expect any unqualified %code blocks to be stored in a macro named
4115 `b4_percent_code_unqualified'.
4116 Use m4_indir so that %define variable names and %code qualifiers can
4117 contain `.', which is allowed by the grammar parser.
4118 (b4_percent_define_default): New macro to set a default value for a
4120 (m4_wrap): Update wrapped code, and fix some underquoting.
4121 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
4122 Expect grammar uses of %define variables and %code qualifiers to be
4123 defined in b4_percent_define_user_variables and
4124 b4_percent_code_user_qualifiers.
4125 * data/c++.m4: Use b4_percent_define_default rather than
4126 m4_define_default. Fix some underquoting. Skeleton usage of %define
4127 variable define_location_comparison now implies skeleton usage of
4128 %define variable filename_type.
4129 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4130 data/push.c, data/yacc.c: Update macro names.
4131 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
4134 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4136 DJGPP specific issues.
4138 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
4139 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
4141 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4143 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
4144 run parsers in all tests so that Valgrind is invoked during
4145 maintainer-check-valgrind.
4146 (Duplicate representation of merged trees): Free all semantic values.
4147 (Duplicated user destructor for lookahead): Likewise.
4149 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4151 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
4152 command-line prefix.
4153 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
4154 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
4155 miss Valgrind messages.
4156 (Exploding the Stack Size with Malloc): Likewise.
4158 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4160 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
4161 locals. Reported by Juan Manuel Guerrero at
4162 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
4163 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
4164 Fix some indentation also.
4165 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
4166 explaining this issue.
4168 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
4169 and Joel E. Denny <jdenny@ces.clemson.edu>
4171 Simplify union and prologue handling, and escape union and lex/parse
4172 params with digraphs.
4173 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
4174 values to the empty string since these are no longer guaranteed
4175 initialized by the front-end.
4176 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
4177 braces around b4_user_stype since this is no longer done by the
4179 * src/files.c, src/files.h (pre_prologue_obstack,
4180 post_prologue_obstack): Remove.
4181 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
4182 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
4183 with digraphs. This fixes lex params and parse params.
4184 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
4185 * src/output.c (prepare): Remove muscle insertion of the prologues.
4186 (output): Remove freeing of pre_prologue_obstack and
4187 post_prologue_obstack.
4188 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
4189 than prologue_augment for prologue parsing so you don't need prologue
4191 (grammar_declaration): For %union RHS, use `braceless' instead of
4192 "{...}" so that braces are already stripped and code is escaped with
4194 * src/reader.c (prologue_augment): Remove.
4195 (reader): Remove initialization of pre_prologue_obstack and
4196 post_prologue_obstack.
4197 * src/reader.h (prologue_augment): Remove.
4199 * data/c.m4: Remove stray parenthesis.
4201 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4203 Remove quotes from variables names in %define directives and from
4204 qualifiers in %code directives, and restrict the characters that are
4205 allowed in them to M4-friendly ones. For %define, continue to support
4206 the quoted form as a deprecated feature. Discussed starting at
4207 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
4208 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
4210 * doc/bison.texinfo (Prologue Alternatives): Update.
4211 (Decl Summary): In %defines entry, update mention of `%code requires'
4212 and `%code provides'.
4213 (C++ Location Values): Update %define uses.
4214 (Calc++ Parser Interface): Likewise.
4215 (Calc++ Parser): Likewise, and update `%code requires' uses.
4216 (Table of Symbols): Update %code documentation.
4217 * src/parse-gram.y (prologue_declaration): For %define variables, use
4218 `variable' instead of `STRING'.
4219 (grammar_declaration): For %code qualifiers, use `ID' instead of
4221 (variable): New nonterminal that takes an `ID' or a `STRING'.
4222 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
4224 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
4225 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
4226 (%define errors): Update %define uses.
4228 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4230 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
4231 instead of muscle_insert for %define values so that M4-special
4232 characters are replaced with digraphs.
4233 * tests/input.at (%define errors): Extend to check weird values.
4235 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4237 Instead of having skeletons declare all valid %define variables and
4238 %code qualifiers, provide macros that retrieve the associated values
4239 and build these lists automatically. Thus Bison will now warn when a
4240 variable or qualifier is not used by the skeleton in the current
4241 invocation regardless of whether it might sometimes be used by that
4242 skeleton in other invocations. Also, move all %define value macros to
4243 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
4244 form, which is replaced by %code.
4245 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
4246 (b4_check_user_names): ... this, and change the series of valid name
4247 arguments to a single list argument for names used in the skeleton
4248 similar to the existing list argument for names used in the grammar.
4249 Warn instead of complaining.
4250 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
4251 values and %code code, to format %code code properly, and to build
4252 lists of all %define variables and %code qualifiers used in the
4253 skeleton: b4_skeleton_percent_define_variables and
4254 b4_skeleton_percent_code_qualifiers.
4255 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
4257 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
4258 the skeleton names lists can finish building first. In place of
4259 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
4260 expect the lists b4_user_percent_define_variables and
4261 b4_user_percent_code_qualifiers.
4262 * data/c++.m4: Where setting default values for b4_parser_class_name,
4263 b4_location_type, b4_filename_type, b4_namespace, and
4264 b4_define_location_comparison, update their names to the
4265 b4_percent_define_ namespace.
4266 * data/glr.c: Don't use b4_check_percent_define_variables and
4267 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
4268 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
4269 (b4_parser_class_name, b4_namespace): Define these using
4270 b4_get_percent_define for parser_class_name and namespace.
4271 * data/location.cc: Use b4_get_percent_define.
4272 * data/push.c: Don't use b4_check_percent_define_variables and
4273 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
4274 * data/yacc.c: Likewise, and don't call m4_exit in
4275 b4_use_push_for_pull_if or m4_wrap code will never execute.
4276 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
4278 (muscle_grow_user_name_list): ... this for consistency with the
4279 terminology used in bison.m4.
4280 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
4281 %define variable names, and rename muscle used_percent_define_variables
4282 to user_percent_define_variables.
4283 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
4284 user_percent_code_qualifiers.
4286 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
4287 {CODE} form is no longer accepted.
4288 * tests/input.at (Reject bad %code qualifiers): Rename to...
4289 (Reject unused %code qualifiers): ... this, and update test output.
4290 (%define error): Update test output.
4292 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
4294 Check for unrecognized %define variables similar to checking for
4295 unrecognized %code qualifiers. Check for redefined %define variables.
4296 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
4298 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
4299 (b4_check_percent_define_variables): New, also wraps it.
4300 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
4301 variables using b4_check_percent_define_variables.
4302 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
4303 all those exercised in the test suite and all those listed in the
4304 `Default values' section of c++.m4. Are there others?
4305 * data/push.c, data/yacc.c: Declare no valid %define variables.
4306 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
4307 similar to muscle_find, but it works even when the muscle stores a
4309 (muscle_grow_used_name_list): New function for constructing the used
4310 name list muscles that b4_check_for_unrecognized_names requires.
4311 * src/parse-gram.y (prologue_declaration): Warn if a variable is
4312 %define'd more than once. Define the b4_used_percent_define_variables
4313 muscle with muscle_grow_used_name_list.
4314 (grammar_declaration): Abbreviate %code code with
4315 muscle_grow_used_name_list.
4316 * tests/input.at (%define errors): New.
4318 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4320 Provide warn_at, complain_at, and fatal_at function callbacks to the
4321 skeletons, and use this for %code qualifier complaints.
4322 * data/bison.m4 (b4_error_at): New, invoked by...
4323 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
4324 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
4325 @fatal_at(...@) directives.
4326 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
4327 qualifiers in b4_used_percent_code_qualifiers and to use
4329 * src/location.c, src/location.h (boundary_set_from_string): New global
4331 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
4333 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
4334 to b4_used_percent_code_qualifiers.
4335 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
4337 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
4338 (lineno): Rename to...
4339 (out_lineno): ... this so I don't misunderstand it again.
4340 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
4341 here; these newlines are in the input but not the output file.
4342 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
4343 (at_directive_perform): ... this new static function, and add handling
4344 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
4346 * tests/input.at (Reject bad %code qualifiers): Update test output with
4347 locations and extend.
4349 * tests/output.at (Output file name: [, Output file name: ]): Remove
4350 bogus comment about these tests failing.
4352 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4354 Clean up b4_check_percent_code_qualifiers a little.
4355 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
4356 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
4357 documentation and add examples.
4358 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
4361 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
4363 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
4364 unreliable -- especially when they're hidden inside another macro.
4365 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
4366 data/c.m4: Remove m4_divert(-1).
4367 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4368 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
4369 m4_divert_push(0) and m4_divert_pop(0).
4370 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
4371 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
4372 pushed and popped by m4sugar, should be first on the stack.
4374 Provide warn, complain, and fatal function callbacks to the skeletons.
4375 This provides more flexibility than m4_fatal, improves the error
4376 message format, and captures messages for translation. Discussed
4378 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
4379 * data/bison.m4 (b4_error): New, invoked by...
4380 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
4381 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
4382 directives. Because these M4 macros might be called when the current
4383 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
4384 the previous removal of uses of m4_divert, which caused trouble.
4385 (b4_check_percent_code_qualifiers): Use b4_complain instead of
4386 m4_fatal to report unrecognized %code qualifiers.
4387 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
4388 push parser requests.
4389 * data/glr.c: Use b4_complain instead of m4_fatal to report
4390 non-deterministic push parser requests.
4391 Update @output usage to @output(...@) form.
4392 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
4393 report missing %defines. Update @output usage to @output(...@) form.
4394 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
4396 * src/main.c (main): Invoke skel_scanner_free.
4397 * src/scan-skel.h (skel_scanner_free): Prototype new function.
4398 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
4399 obstack_for_string from flex-scanner.h.
4400 (YY_DECL): Use to declare skel_lex static.
4401 (decode_at_digraphs): Remove; now handled in the new
4402 SC_AT_DIRECTIVE_ARG start condition.
4403 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
4405 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
4406 at_directive_argv): New static globals.
4407 (INITIAL): Use fail_for_invalid_at.
4408 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
4409 recognize the start of a generalized `@directive(...@)' form and
4411 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
4412 directive args (using the new obstack_for_string), to decode the
4413 contained @ diagraphs, and to perform the directive. It recognizes
4414 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
4416 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
4417 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
4419 (scan_skel): Initialize obstack_for_string on the first call.
4420 (skel_scanner_free): New function to free obstack_for_string.
4421 * tests/input.at (Reject bad %code qualifiers): Update test output.
4423 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
4425 Consolidate the 4 prologue alternative directives (%code, %requires,
4426 %provides, and %code-top) into a single %code directive with an
4427 optional qualifier field. Discussed at
4428 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
4429 * NEWS (2.3a+): Rewrite the existing entry for the prologue
4431 * doc/bison.texinfo (Prologue Alternatives): Update.
4432 (Decl Summary): Update to %code "requires" and %code "provides".
4433 (Calc++ Parser): Update to %code "requires".
4434 (Table of Symbols): Remove entries for %requires, %provides, and
4435 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
4436 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
4437 are replaced by b4_percent_code_provides and b4_percent_code_requires,
4438 which are skeleton-specific.
4439 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
4440 declare what %code qualifiers it supports and to complain if any other
4441 qualifiers were used in the grammar.
4442 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
4443 and b4_user_code([b4_percent_code_provides]) in place of
4444 b4_user_requires and b4_user_provides.
4445 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
4446 Add b4_user_code([b4_percent_code_top]) and
4447 b4_user_code([b4_percent_code]).
4448 Invoke b4_check_percent_code_qualifiers.
4449 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
4450 PERCENT_REQUIRES): Remove.
4451 (grammar_declaration): Remove RHS's for %code-top, %provides, and
4452 %requires. Rewrite the %code RHS as the unqualified form defining the
4453 muscle b4_percent_code. Add another RHS for the qualified %code form,
4454 which defines muscles of the form b4_percent_code_QUALIFIER and the
4455 b4_used_percent_code_qualifiers muscle.
4456 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
4457 PERCENT_REQUIRES): Remove.
4458 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
4459 %code "requires" and %code "provides".
4460 * tests/input.at (Reject bad %code qualifiers): New.
4462 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
4464 Use the new code_props interface for destructors and printers.
4465 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
4466 printer_location members, and change the type of the destructor and
4467 printer members to code_props.
4468 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
4469 symbol_printer_get, semantic_type_destructor_set,
4470 semantic_type_printer_set, default_tagged_destructor_set,
4471 default_tagless_destructor_set, default_tagged_printer_set,
4472 default_tagless_printer_set): Use code_props in arguments and return
4473 types in place of char const * and location.
4474 (symbol_destructor_location_get, symbol_printer_location_get): Remove
4475 since the locations are now contained in the return of
4476 symbol_destructor_get and symbol_printer_get.
4477 * src/output.c (symbol_destructors_output, symbol_printers_output):
4479 (symbol_code_props_output): ... this to eliminate duplicate code.
4480 (output_skeleton): Update to use symbol_code_props_output.
4481 * src/reader.c (symbol_should_be_used): Update use of
4482 symbol_destructor_get.
4483 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
4484 Update uses of the various _destructor_set and _printer_set functions.
4485 * src/symtab.c: (default_tagged_destructor_location,
4486 default_tagless_destructor_location, default_tagged_printer_location,
4487 default_tagless_printer_location): Remove since we...
4488 (default_tagged_destructor, default_tagless_destructor,
4489 default_tagged_printer, default_tagless_printer): ... change the type
4490 of these to code_props.
4491 (symbol_new, semantic_type_new, symbol_destructor_set,
4492 semantic_type_destructor_set, symbol_destructor_get,
4493 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
4494 symbol_check_alias_consistency, default_tagged_destructor_set,
4495 default_tagless_destructor_set, default_tagged_printer_set,
4496 default_tagless_printer_set): Update.
4497 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
4498 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
4500 (symbol_print): Use SYMBOL_CODE_PRINT.
4502 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
4504 Use the new code_props interface for rule actions.
4505 * src/symlist.h (symbol_list): Replace action, action_location, and
4506 used members with a code_props action_props member.
4507 * src/reader.c (symbol_should_be_used, grammar_rule_check,
4508 grammar_midrule_action, grammar_current_rule_merge_set,
4509 grammar_current_rule_symbol_append, packgram): Update.
4510 * src/scan-code.h (translate_rule_action): Remove, no longer used.
4511 * src/scan-code.l (handle_action_dollar): Update.
4512 (translate_rule_action): Remove, no longer used.
4513 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
4515 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4517 Use the new code_props interface in parse-gram.y.
4518 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
4519 Update all uses of translate_* functions to use the new code_props
4520 interface and to use gram_scanner_last_string_free and
4521 code_scanner_last_string_free where possible.
4522 (grammar_declaration): symbol_list_destructor_set and
4523 symbol_list_printer_set now perform the translation, so don't do it
4524 here. Use gram_scanner_last_string_free where possible.
4525 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
4526 translate_code): Remove, no longer used.
4527 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
4528 symbol_list_printer_set): Perform code translation here rather than
4529 depending on the caller to do so.
4531 * src/symlist.h (struct symbol_list): Correct some documentation typos.
4532 * src/scan-gram.h (gram_last_string): Remove declaration.
4533 * src/scan-gram.l (last_string): Declare it static.
4535 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4537 Encapsulate code properties and related functionality for the various
4538 destructors, printers, and actions into a code_props structure and
4539 interface. This patch merely implements code_props in scan-code.h and
4540 scan-code.l. Future patches will rewrite other modules to use it.
4541 Discussed starting at
4542 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
4543 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
4544 consistently initialize const structs that have an empty location
4546 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
4547 to ensure consistency.
4548 * src/scan-code.h (code_props): New structure.
4549 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
4550 function, macro, and const global variable for initializing a
4551 code_props with no code.
4552 (code_props_plain_init, code_props_symbol_action_init,
4553 code_props_rule_action_init, code_props_translate_code): The rest of
4554 the new code_props functional interface. Among other things, the init
4555 functions set the code_props kind field so that
4556 code_props_translate_code will know whether to behave like
4557 translate_symbol_action, translate_rule_action, or translate_code.
4558 These old translate functions must remain until all other modules are
4559 updated to use the new code_props interface.
4560 (code_scanner_last_string_free): New function similar to
4561 gram_scanner_last_string_free.
4562 (code_scanner_free): Add documentation.
4563 * src/scan-code.l: Implement the new interface.
4564 (code_lex): Make it static, add a code_props* argument, and remove the
4566 (last_string): New static global similar to the one in scan-gram.l.
4567 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
4569 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
4570 code_props since Bison may one day use this information for destructors
4572 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
4573 (handle_action_dollar): Use symbol_list_n_get and set used flag
4574 directly since symbol_list_n_used_set is removed.
4575 (translate_action): Add a code_props* argument and remove the rule,
4576 action, and location arguments. Pass the code_props* on to code_lex.
4577 (translate_rule_action, translate_symbol_action, translate_code):
4578 Rewrite as wrappers around the new code_props interface.
4579 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
4580 it would eventually need to break the encapsulation of code_props.
4582 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
4584 * etc/.cvsignore: New.
4586 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
4588 Add maintainer-push-check to run maintainer-check using push parsing in
4589 place of pull parsing where available.
4590 * Makefile.am (maintainer-push-check): New.
4591 * data/bison.m4 (b4_use_push_for_pull_if): New.
4592 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
4593 appropriately based on their existing values.
4594 (yypush_parse): Don't print push-parser-specific diagnostics if push
4595 parsing is being used in place of pull parsing.
4596 * data/yacc.c: If push parsing should replace pull parsing, redirect to
4598 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
4599 variable, and insert b4_use_push_for_pull_flag into muscles.
4600 * tests/Makefile.am (maintainer-push-check): New.
4602 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
4604 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
4605 (whether successful or failed) so that yypush_parse can be invoked
4606 again to start a new parse using the same yypstate.
4607 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
4608 check multiple yypull_parse invocations on the same yypstate. For pull
4609 mode, extend to check multiple yyparse invocations.
4610 (Exploding the Stack Size with Alloca): Extend to try with
4612 (Exploding the Stack Size with Malloc): Likewise.
4614 * tests/calc.at (Simple LALR Calculator): Don't specify
4615 %skeleton "push.c" since %push-pull-parser implies that now.
4616 * tests/headers.at (export YYLTYPE): Don't check for the push
4617 declarations. Otherwise, this test case can't be used to see if push
4618 mode can truly emulate pull mode.
4619 * tests/input.at (Torturing the Scanner): Likewise.
4620 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
4621 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
4622 AT_YACC_IF, which now includes the case of push mode since %skeleton
4623 need not be used for push mode. This will be more intuitive once
4624 push.c is renamed to yacc.c.
4626 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
4628 For push mode, convert yyparse from a macro to a function, invoke yylex
4629 instead of passing a yylexp argument to yypull_parse, and don't
4630 generate yypull_parse or yyparse unless %push-pull-parser is declared.
4631 Discussed starting at
4632 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
4633 * data/bison.m4 (b4_pull_if): New.
4634 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
4635 * data/push.c: Improve M4 quoting a little.
4636 (b4_generate_macro_args, b4_parenthesize): Remove.
4637 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
4638 any time a pull parser is requested.
4639 Don't #define this as a wrapper around yypull_parse. Instead, when
4640 both push and pull are requested, make it a function that does that
4642 (yypull_parse): If there's a b4_prefix, #define this to
4643 b4_prefix[pull_parse] when both push and pull are requested.
4644 Don't define this as a function unless both push and pull are
4646 Remove the yylexp argument and hard-code yylex invocation instead.
4647 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
4649 * src/getargs.c (pull_parser): New global initialized to true.
4650 * getargs.h (pull_parser): extern it.
4651 * src/output.c (prepare): Insert pull_flag muscle.
4652 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
4653 (prologue_declaration): Set both push_parser and pull_parser = true for
4654 %push-pull-parser. Set push_parser = true and pull_parser = false for
4656 * src/scan-gram.l: Don't accept %push_parser as an alternative to
4657 %push-parser since there's no backward-compatibility concern here.
4658 Scan %push-pull-parser.
4659 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
4660 instead of %push-parser.
4661 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
4662 prototype it in the module that calls yyparse.
4663 * tests/input.at (Torturing the Scanner): Likewise.
4664 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
4666 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
4668 Update etc/bench.pl. Optimize push mode a little (the yyn change
4669 deserves most of the credit).
4670 * Makefile.am (SUBDIRS): Add etc subdirectory.
4671 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
4672 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
4673 yytoken, yyval, and yyloc declarations to...
4674 (yyparse or yypush_parse): ... here to improve performance. For
4675 yypush_parse invocations after the first, be sure to assign yyn its old
4677 (yypstate_new): Don't bother initializing the yyresult field since the
4678 initial value isn't used.
4679 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
4680 remove the #define that, in push mode, set it to yyps->NAME.
4681 * etc/Makefile.am: New.
4682 * etc/bench.pl: Remove and build it instead from...
4683 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
4684 "tests/bison" from the build directory by default rather than just
4685 invoking "bison" from $PATH.
4686 (calc_grammar): Update push parser code: don't declare yylval globally,
4687 don't define yyparse_wrapper, and don't #define yyparse.
4688 (bench_grammar): Update to check all working combinations of yacc.c,
4689 push.c, impure, pure, pull, and push.
4691 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4693 For push mode, add pull wrappers around yypush_parse.
4694 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
4695 (yypull_parse): New function wrapping yypush_parse.
4696 (yyparse): New #define wrapping yypull_parse.
4697 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
4699 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
4700 prototype yylex in the module that calls yyparse, and don't prototype
4701 yyparse there. Otherwise, the yyparse expansion won't compile.
4702 * tests/input.at (Torturing the Scanner): Likewise.
4704 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4706 Enable push parsers to operate in impure mode. Thus, %push-parser no
4707 longer implies %pure-parser. The point of this change is to move
4708 towards being able to test the push parser code by running the entire
4709 test suite as if %push-parser had been declared.
4710 * data/push.c (yypush_parse): For impure mode, remove the
4711 yypushed_char, yypushed_val, and yypushed_loc arguments.
4712 Instead, declare these as local variables initialized to the global
4713 yychar, yylval, and yylloc.
4714 For the first yypush_parse invocation only, restore the initial values
4715 of these global variables when it's time to read a token since they
4716 have been overwritten.
4717 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
4719 * tests/calc.at (Simple LALR(1) Calculator): Always declare
4720 %pure-parser along with %push-parser since this test case was designed
4721 for pure push parsers.
4722 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
4723 (AT_YACC_OR_PUSH_IF): New.
4724 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
4725 add a note that it's still wrong for some cases (as it has been for a
4727 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
4728 %push-parser no longer implies %pure-parser.
4730 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4732 Remove some unnecessary differences between the pull parser code and
4733 the push parser code. This patch enables yynerrs in push mode.
4734 * data/push.c: Reformat M4 a little.
4735 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
4736 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
4737 because push mode is on. Instead, if pure mode is on, move yynerrs
4739 (b4_declare_parser_state_variables): ... here.
4740 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
4741 to yyps->NAME so it can be used in yypush_parse.
4742 (yypush_parse): Don't omit uses of yynerrs in push mode.
4744 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4746 Fix bug such that the first pushed token's value and location are
4747 sometimes overwritten (sometimes by %initial-action) before being used.
4748 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
4749 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
4750 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
4751 more closely mimic the pull parser logic.
4752 Don't copy the pushed token to yychar, yylval, and yylloc until it's
4753 time to read a token, which is after any initialization of yylval and
4755 (gottoken): Rename label to...
4756 (yyread_pushed_token): ... for clarity and to avoid infringing on the
4759 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4761 Rearrange initialization of the parser state variables so that the
4762 skeleton doesn't have to have a copy for pull mode and another for push
4763 mode. This patch also fixes at least a bug such that yylloc was not
4764 initialized (with b4_location_initial_line and
4765 b4_location_initial_column) upon calling yypush_parse. However, that
4766 initialization now overwrites the first token's location;
4767 %initial-action assigning @$ already did the same thing, and both bugs
4768 will be fixed in a later patch.
4769 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
4770 (b4_declare_parser_state_variables): Remove initialization of yytoken,
4771 yyss, yyvs, yyls, and yystacksize.
4772 (yypstate_new): Remove initialization of some yypstate fields: yystate,
4773 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
4775 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
4776 yyps->NAME so it can be used in yypush_parse.
4777 (yyparse or yypush_parse): For yypush_parse, don't print the
4778 "Starting parse" diagnostic for invocations after the first.
4779 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
4780 yypush_parse, only do it for the first invocation.
4781 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
4782 initialization to occur in yypush_parse but only on the first
4785 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4787 * data/push.c: Add CPP guards around push parser declarations in both
4788 the header and the code file.
4789 In the code file, move the push parser declarations to the same place
4790 they appear in the header file.
4791 Clean up the M4 some, especially the inconsistent underquoting in
4792 some b4_c_function_def and b4_c_function_decl uses.
4794 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4796 Encapsulate the push parser state variables into an M4 macro so the
4797 push skeleton doesn't have to list them again for pull mode's yyparse.
4798 For push mode, remove yypush_parse's local equivalents of these
4799 variables to eliminate unnecessary copying between the two sets at
4800 run-time. This patch also fixes at least a bug related to multiple
4801 %initial-action invocations in push mode.
4802 * data/push.c (b4_declare_parser_variables): Rename to...
4803 (b4_declare_scanner_communication_variables): ... this for clarity and
4805 (b4_declare_yyparse_variables): Remove and move its contents to the one
4806 spot where it was invoked.
4807 (b4_declare_parser_state_variables): New macro containing the parser
4808 state variables required by push mode.
4809 (struct yypstate): Replace all fields but yynew with
4810 b4_declare_parser_state_variables.
4811 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
4812 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
4813 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
4814 (yyparse or yypush_parse): For yyparse in pull mode, replace local
4815 parser state variable declarations with
4816 b4_declare_parser_state_variables.
4817 Don't initialize parser state variables when calling yypush_parse since
4818 yypstate_new already does that.
4819 Invoke the user's initial action only upon the first yypush_parse
4821 Remove all code that copies between the local parser state variables
4824 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4826 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
4827 prevent a name collision in a future patch where these names will
4828 sometimes be #define'd.
4829 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
4830 since it no longer has the same name as the existing argument.
4831 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
4833 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
4834 and Joel E. Denny <jdenny@ces.clemson.edu>
4836 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4837 that the argument is case-insensitive, and there's no `=' here.
4838 For the %skeleton entry, mention that %language is better.
4839 (Bison Options): Likewise for --language and --skeleton. Move the
4840 --skeleton entry so that the `Tuning the parser' section is sorted
4841 alphabetically on long options.
4842 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
4843 %language directive in detail here; cross-reference the %language
4844 documentation instead.
4845 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
4846 `%require "2.3b"' so that the example is always up-to-date.
4847 (Table of Symbols): Add entries for %language and %skeleton.
4848 * examples/extexi (normalize): Instead of replacing every %require
4849 argument with the current Bison version, just substitute for
4850 `@value{VERSION}'. This guarantees that we're testing what actually
4851 appears in the documentation.
4852 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
4853 rather than `@VERSION@'.
4855 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4857 * NEWS: Reword the %language news a bit, and put it earlier.
4859 * src/getargs.c (skeleton_arg): Last arg is now location const *.
4860 Rewrite to simplify the logic.
4861 (language_argmatch): Likewise.
4862 (program_name): We now own this var.
4863 * src/getargs.h (struct bison_language): Use char[] rather than
4866 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
4868 * src/complain.c (program_name): Remove decl; no longer needed.
4869 * src/main.c (program_name): Remove; now belongs to getargs.
4871 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
4873 * NEWS: Document %language.
4875 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
4877 * data/c-skel.m4, data/c++-skel.m4: New files.
4878 * data/glr.c: Complain on push parsers.
4880 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
4882 (Decl Summary): Document %language and %skeleton.
4883 (Command line): Document -L.
4885 * examples/extexi: Rewrite %require directive.
4886 * examples/calc++/Makefile.am: Pass VERSION to extexi.
4888 * src/files.c (compute_exts_from_gc): Look in language structure
4890 (compute_file_name_parts): Check whether .tab should be added.
4891 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
4892 (language, skeleton_arg, language_argmatch): New.
4893 (long_options): Add --language.
4894 (getargs): Use skeleton_arg, add -L/--language.
4895 * src/getargs.h: Include location.h.
4896 (struct bison_language, language, skeleton_arg, language_argmatch): New.
4897 * src/output.c (prepare): Pick default skeleton from struct language.
4898 Don't dispatch C skeletons here.
4899 * src/parse-gram.y (PERCENT_LANGUAGE): New.
4900 (prologue_declaration): Add "%language" rule, use skeleton_arg.
4901 * src/scan-gram.l ("%language"): New rule.
4903 * tests/calc.at: Test %skeleton and %language.
4904 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
4905 (AT_GLR_IF): Look for %skeleton "glr.cc".
4906 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
4907 (AT_YACC_IF): Reject %language.
4909 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4911 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
4912 since it wasn't used; only the typedef name 'semantic_type' is needed.
4913 Also, omit trailing white space.
4915 * bootstrap: Sync from coreutils.
4916 (gnulib_extra_files): Add build-aux/announce.gen.
4917 (slurp): Adjust .gitignore files like .cvsignore files.
4918 * build-aux/announce-gen: Remove from CVS, since bootstrap
4921 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
4923 Make %push-parser imply %pure-parser. This fixes several bugs; see
4924 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
4925 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
4927 * data/push.c: Don't bother testing b4_push_if when deciding whether
4928 to expand b4_declare_parser_variables globally.
4929 (yypush_parse): Likewise in here.
4931 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
4932 (yy_reduce_print): Reformat M4 for readability.
4934 2006-12-15 Bob Rossi <bob@brasko.net>
4935 and Joel Denny <jdenny@ces.clemson.edu>
4937 * data/push.c (yypstate): Add typedef, and update all uses of
4938 struct yypstate to just yypstate.
4939 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
4941 2006-12-14 Bob Rossi <bob@brasko.net>
4943 * data/push.c (yypush_parse): Declare prototype regardless of
4946 2006-12-14 Bob Rossi <bob@brasko.net>
4948 * data/push.c (yyparse): Remove the prototype and the #define when in
4951 2006-12-13 Bob Rossi <bob@brasko.net>
4953 * data/push.c (yypstate_init): Rename to...
4954 (yypstate_new): ... this and use b4_c_function_def.
4955 (yypstate_delete): New.
4956 (yypush_parse): Change parameters yynval and yynlloc to be const.
4957 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
4958 yypstate_delete functions.
4960 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
4962 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
4963 strange test case titles. Reported by Bob Rossi.
4965 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
4967 * TODO: Add pointer to Sylvain Schmitz's work on static detection
4968 of potential ambiguities in GLR grammers.
4970 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
4972 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
4973 `bison ', use m4_index instead of m4_substr since chopping up a string
4974 containing M4-special characters causes problems here.
4976 Fix a couple of bugs related to special characters in user-specified
4977 file names, and make it easier for skeletons to compute output file
4978 names with the same file name prefix as Bison-computed output file
4980 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
4981 b4_parser_file_name and b4_spec_defines_file instead of
4982 @output_parser_name@ and @output_header_name@, which are now redundant.
4983 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
4984 b4_parser_file_name, b4_spec_defines_file, and the new
4985 @basename(FILENAME@) instead of @output_parser_name@ and
4986 @output_header_name@, which inappropriately escaped the file names as
4988 * src/files.c (all_but_ext): Remove static qualifier.
4989 (compute_output_file_names): Move `free (all_but_ext)' to...
4990 (output_file_names_free): ... here since all_but_ext is needed later.
4991 * src/files.h (all_but_ext): Extern.
4992 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
4993 exactly what MUSCLE_INSERT_STRING used to do.
4994 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
4995 characters are escaped properly.
4996 * src/output.c (prepare): Define muscle file_name_all_but_ext as
4998 For pkgdatadir muscle, maintain previous functionality by using
4999 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
5000 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
5001 digraphs would never be expanded. Hopefully no one has M4-special
5002 characters in his Bison installation path.
5003 * src/scan-skel.l: Don't parse @output_header_name@ and
5004 @output_parser_name@ anymore since they're now redundant.
5005 In @output, use decode_at_digraphs.
5006 Parse a new @basename command that invokes last_component.
5007 (decode_at_digraphs): New.
5008 (BASE_QPUTS): Remove unused.
5009 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
5010 (Output file name): New tests.
5012 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
5014 Warn about output files that are generated by the skeletons and that
5015 conflict with other output files.
5016 * data/glr.c: Don't generate the header file here when glr.cc does.
5017 * src/files.c (file_names, file_names_count): New static globals.
5018 (compute_output_file_names): Invoke output_file_name_check for files
5019 not generated by the skeletons and remove existing checks.
5020 (output_file_name_check): New function that warns about conflicting
5022 (output_file_names_free): Free file_names.
5023 * src/files.h (output_file_name_check): Declare.
5024 * src/scan-skel.l: Invoke output_file_name_check for files generated by
5026 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
5027 (Conflicting output files): New tests.
5029 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5031 * doc/bison.texinfo: Fix a couple of typos.
5033 2006-12-08 Bob Rossi <bob@brasko.net>
5035 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
5037 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
5039 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
5040 (yypush_parse): Rename yypvars argument to yyps and remove redundant
5042 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
5043 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
5045 2006-12-07 Bob Rossi <bob@brasko.net>
5046 and Joel Denny <jdenny@ces.clemson.edu>
5048 * data/push.c (yypvarsinit): Change return type from void* to struct
5049 yypvars*. No longer cast to void* on return.
5050 (struct yypvars): Remove yylen since it need not be remembered between
5051 yypushparse invocations.
5052 (yypushparse): Don't copy between yylen and pv->yylen.
5054 2006-12-05 Bob Rossi <bob@brasko.net>
5056 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
5057 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
5058 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
5059 (struct yypvars): Remove b4_declare_parser_variables.
5060 (yypvarsinit): Remove init code for removed variables.
5061 (global scope): Do not declare b4_declare_parser_variables if
5063 (yypushparse): Add b4_declare_parser_variables.
5064 Init new local variables, and remove init code for removed
5067 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
5068 and yyparse for other modes.
5069 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
5070 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
5071 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
5072 (AT_PURE_LEX_IF): True if pure or push parser.
5074 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
5076 Document Yacc prologue alternatives and default %destructor's and
5077 %printer's as experimental. Don't mention Java yet. Discussed at
5078 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
5079 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
5080 (2.3a): Annotate this entry to say the old forms of these features were
5082 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
5083 Table of Symbols): Say they're experimental. Comment out any mention
5084 of Java (we'll want this back eventually).
5086 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
5088 Support a file name argument to %defines. Deprecate `=' in
5089 %file-prefix, %name-prefix, and %output. Discussed at
5090 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
5091 * NEWS (2.3a+): Mention.
5092 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
5093 form of %defines, and remove `=' from entries for %file-prefix,
5094 %name-prefix, and %output.
5095 * src/parse-gram.y (prologue_declaration): Implement.
5096 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
5097 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
5098 all but one occurrence of %name-prefix.
5099 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
5100 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
5101 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
5102 occurrence of each of %file-prefix and %output. Add check for %defines
5104 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
5105 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
5106 Remove the `=' from %output.
5108 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
5110 Don't escape $ in test case titles since Autoconf 2.61 now does that
5112 * tests/actions.at (Default %printer and %destructor are not for error
5113 or $undefined): Here.
5114 (Default %printer and %destructor are not for $accept): Here.
5115 * tests/input.at (Invalid $n and @n): Here.
5117 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
5119 Rename <!> to <>. Discussed starting at
5120 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
5121 * NEWS (2.3a+): Update.
5122 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
5124 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
5125 * src/scan-gram.l (INITIAL): Implement.
5126 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
5127 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
5129 * tests/actions.at (Default tagless %printer and %destructor,
5130 Default tagged and per-type %printer and %destructor,
5131 Default %printer and %destructor are not for error or $undefined,
5132 Default %printer and %destructor are not for $accept,
5133 Default %printer and %destructor for mid-rule values): Update.
5134 * tests/input.at (Default %printer and %destructor redeclared,
5135 Unused values with default %destructor): Update.
5137 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
5139 Don't let %prec take a nonterminal.
5140 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
5142 * tests/input.at (%prec takes a token): New test checking that %prec
5143 won't take a nonterminal.
5145 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5147 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
5148 it was double-quoted.
5149 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
5150 grammar is maintained with Bison's highest standards.
5151 * src/getargs.c: Fix some typos in Doxygen comments.
5153 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5155 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
5156 later. Reported by Paul Eggert in
5157 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
5158 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
5159 * src/scan-code.l (translate_action): Don't bother invoking
5160 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
5161 (code_scanner_free): Instead of invoking
5162 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
5164 * src/scan-gram.l (gram_scanner_free): Likewise.
5165 * src/scan-skel.l (scan_skel): Likewise.
5167 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
5169 * src/files.c (tr): Change return type to void.
5170 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
5171 has been called previously for the same key.
5172 (muscle_find): Return storage instead of value so that
5173 --enable-gcc-warnings doesn't produce warnings that the return discards
5174 const. aver that the value and storage are the same since storage
5175 could potentially be NULL when value is not.
5176 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
5179 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
5181 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
5182 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
5183 us a slightly cleaner distribution, and also works.
5184 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
5187 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
5188 and Paul Eggert <eggert@cs.ucla.edu>
5190 Don't let Bison leak memory except when it complains.
5191 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
5192 (spec_defines_file, dir_prefix): Now char *, not const char *,
5193 since they are freed.
5194 * src/files.c: Likewise.
5195 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
5197 (tr): Now operates in-place. All uses changed.
5198 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
5200 (compute_file_name_parts, compute_output_file_names): Don't store
5201 read-only data in variables that will be freed.
5202 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
5203 src_extension, and header_extension.
5204 (output_file_names_free): New public function to free
5205 spec_verbose_file, spec_graph_file, spec_defines_file,
5206 parser_file_name, and dir_prefix.
5207 * src/getargs.c (getargs): Don't store read-only data in variables that
5209 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
5210 (which previously existed but was unused), and quotearg_free.
5211 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
5212 * src/muscle_tab.c: Likewise.
5213 (muscle_entry): Make the value char const *,
5214 and add a new storage member that is char * and can be freed.
5215 (muscle_entry_free): New private function.
5216 (muscle_init): Use it instead of free.
5217 (muscle_insert, muscle_grow): Update and use new storage member.
5218 (muscle_code_grow): Free the string passed to muscle_grow
5219 since it's not needed anymore.
5220 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
5221 add a new `char *code' member.
5222 ("{...}"): Declare semantic type as code.
5223 * src/scan-code.h (translate_rule_action):
5224 (translate_symbol_action, translate_code, translate_action): Return
5225 `char const *' rather than `char *' since external code should not free
5227 * src/scan-code.l: Likewise.
5228 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
5229 which is "{...}" in the parser.
5230 * tests/Makefile.am (maintainer-check-valgrind): Set
5231 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
5233 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
5235 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
5236 expecting a non-zero exit status sets --leak-check=summary and
5237 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
5238 this case, and we don't want to hear about it.
5240 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
5242 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
5243 instead of from the template, to simplify configuration a bit.
5244 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
5245 and m4/wint_t.m4, as they are needed with the latest gnulib.
5247 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5249 Disable unset/unused mid-rule value warnings by default, and recognize
5250 --warnings=midrule-values to enable them. Discussed starting at
5251 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
5252 * NEWS (2.3a+): Mention.
5253 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
5254 warnings): Add entry for midrule-values subargument.
5255 * src/reader.c (symbol_should_be_used): Don't return true just because
5256 the value is a set/used mid-rule value unless
5257 --warnings=midrule-values was specified.
5258 * tests/input.at (Unused values, Unused values before symbol
5259 declarations): Run tests with and without --warnings=midrule-values.
5261 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
5262 than LIST_FREE directly.
5264 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5266 Finish implementing --warnings=error, which should not be implied by
5267 --warnings=all (or by its synonyms -W and --warnings without
5269 * src/complain.c (set_warning_issued): New function to report that
5270 warnings are being treated as errors and to record an error if so.
5272 (warn_at, warn): ... here.
5273 * src/getargs.c (warnings_args, warnings_types): Reorder so that
5274 "error - warnings are errors" does not appear above "all - all of the
5276 (getargs): For -W and --warnings without subarguments, don't let
5277 FLAGS_ARGMATCH set warnings_error in warnings_flag.
5278 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
5280 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5282 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
5283 empty subargument list. For example: `bison --warnings= parser.y'.
5285 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5287 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
5288 the parser header file so that gcc doesn't warn.
5290 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5292 Split the default %destructor/%printer into two kinds: <*> and <!>.
5293 Discussed starting at
5294 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
5295 * NEWS (2.3a+): Mention.
5296 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
5297 previous change today related to mid-rules.
5298 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
5299 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
5300 (TYPE_TAG_ANY): Add as <*>.
5301 (TYPE_TAG_NONE): Add as <!>.
5302 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
5304 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
5305 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
5306 * src/symlist.c (symbol_list_default_new): Split into tagged and
5308 (symbol_list_destructor_set, symbol_list_printer_set): Split
5309 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
5310 SYMLIST_DEFAULT_TAGLESS.
5311 * src/symlist.h: Update symbol_list_default*_new prototypes.
5312 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
5313 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
5314 * src/symtab.c (default_destructor, default_destructor_location,
5315 default_printer, default_printer_location): Split each into tagged and
5317 (symbol_destructor_get, symbol_destructor_location_get,
5318 symbol_printer_get, symbol_printer_location_get): Implement tagged
5319 default and tagless default cases.
5320 (default_destructor_set, default_printer_set): Split each into tagged
5321 and tagless versions.
5322 * src/symtab.h: Update prototypes.
5323 * tests/actions.at (Default %printer and %destructor): Rename to...
5324 (Default tagless %printer and %destructor): ... this, and extend.
5325 (Per-type %printer and %destructor): Rename to...
5326 (Default tagged and per-type %printer and %destructor): ... this, and
5328 (Default %printer and %destructor for user-defined end token): Extend.
5329 (Default %printer and %destructor are not for error or $undefined):
5331 (Default %printer and %destructor are not for $accept): Update.
5332 (Default %printer and %destructor for mid-rule values): Extend.
5333 * tests/input.at (Default %printer and %destructor redeclared): Extend.
5334 (Unused values with default %destructor): Extend.
5336 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5338 Don't apply the default %destructor/%printer to an unreferenced midrule
5340 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
5341 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
5342 like $@n instead of just @n so that the default %destructor/%printer
5343 logic doesn't see them as user-defined symbols.
5344 (symbol_is_dummy): Check for both forms of the name.
5345 * src/reader.c (packgram): Remove the `$' from each midrule symbol
5346 name for which the midrule value is referenced in any action.
5347 * tests/actions.at (Default %printer and %destructor for mid-rule
5349 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
5350 for change to dummy symbol names.
5352 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
5354 Warn about unset midrule $$ if the corresponding $n is used.
5355 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
5357 (packgram): Before invoking grammar_rule_check on any rule, make sure
5358 all actions have already been scanned in order to set `used' flags.
5359 Otherwise, checking that a midrule's $$ is set will not always work
5360 properly because the midrule check must forward-reference the midrule's
5362 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
5365 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
5367 More improvements to the documentation of the prologue alternatives:
5368 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
5370 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
5371 some text to clarify the relative importance of the new directives and
5372 to show how these directives may be viewed as code labels.
5374 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
5376 Similar to the recently removed %before-header, add %code-top as the
5377 alternative to the pre-prologue. Mentioned at
5378 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
5379 Also, let the prologue alternatives appear in the grammar section.
5380 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
5381 (prologue_declaration): Move the existing prologue alternatives to...
5382 (grammar_declaration): ... here and add %code-top.
5383 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
5385 Clean up and extend documentation for the prologue alternatives.
5386 * NEWS (2.3a+): Describe prologue alternatives.
5387 * doc/bison.texinfo (Prologue): Move discussion of prologue
5389 (Prologue Alternatives): ... this new section, and extend it to discuss
5390 all 4 directives in detail.
5391 (Table of Symbols): Clean up discussion of prologue alternatives and
5394 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5396 DJGPP specific issues.
5398 * djgpp/config.bat: config.hin has been moved to lib. Adjust
5399 config.bat accordingly.
5400 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
5401 * djgpp/config.site: Likewise.
5403 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
5405 Replace %*-header with %provides, %requires, %code. See discussion at
5406 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
5408 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
5409 (b4_user_start_header): Remove.
5410 * data/glr.c: Use new macros instead of b4_*start_header
5412 * data/glr.cc: Likewise.
5413 * data/lalr1.cc: Likewise.
5414 * data/push.c: Likewise.
5415 * data/yacc.c: Likewise.
5417 * doc/bison.texinfo: Remove %before-header, rename
5418 %{start,end,after}-header to %requires, %provides, %code.
5420 * src/parse-gram.y: Likewise (also rename token names accordingly).
5421 * src/scan-gram.l: Likewise.
5422 * tests/actions.at: Likewise.
5424 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
5426 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
5427 Problem reported by Joel E. Denny.
5429 2006-10-14 Jim Meyering <jim@meyering.net>
5431 (Sync from coreutils.)
5432 Work also when the working directory (with e.g. coreutils sources)
5433 is version controlled with git, rather than CVS.
5434 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
5436 In messages and comments, say e.g., "checked-out sources",
5437 rather than "CVS sources".
5438 (version_controlled_file): New function. Work for git as well as
5439 for CVS. Don't use grep's -q option.
5440 (slurp): Call it here, in place of CVS-specific code.
5442 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
5444 Fix testsuite for ./configure --enable-gcc-warnings:
5445 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
5446 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
5447 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
5448 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
5449 * test/regression.at (Diagnostic that expects two alternatives):
5452 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
5454 * bootstrap.conf (gnulib_modules): Add config-h.
5455 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
5456 worry about HAVE_CONFIG_H.
5457 * lib/abitset.c: Likewise.
5458 * lib/bitset.c: Likewise.
5459 * lib/bitset_stats.c: Likewise.
5460 * lib/bitsetv-print.c: Likewise.
5461 * lib/bitsetv.c: Likewise.
5462 * lib/ebitset.c: Likewise.
5463 * lib/get-errno.c: Likewise.
5464 * lib/lbitset.c: Likewise.
5465 * lib/subpipe.c: Likewise.
5466 * lib/timevar.c: Likewise.
5467 * lib/vbitset.c: Likewise.
5468 * lib/bitset.c: Include "bitset.h" first, to test interface.
5469 * lib/bitset_stats.c: Include "bitset_stats.h" first.
5470 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
5471 * lib/bitsetv.c: Include "bitsetv.h" first.
5472 * lib/get-errno.c: Include "get-errno.h" first.
5473 * m4/.cvsignore: Add config-h.m4.
5474 * tests/actions.at (Default %printer and %destructor for ...):
5475 Adjust expected line numbers in output to reflect removal of #if
5476 HAVE_CONFIG_H lines.
5477 * tests/glr-regression.at (Missed %merge type warnings when ...):
5479 * tests/regression.at (Braced code in declaration in rules section):
5481 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
5482 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
5483 Include <config.h> unconditionally.
5485 * bootstrap: Sync from coreutils, as follows:
5487 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
5489 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
5490 variable was sometimes used without being initialized. This
5491 messed up the installation of the INSTALL file in some cases.
5493 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
5495 * bootstrap (usage, main program, symlink_to_gnulib): Add option
5496 --copy. Inspired by a suggestion from Bruno Haible.
5498 2006-10-03 Jim Meyering <jim@meyering.net>
5500 * bootstrap: Undo last change to this file, since now gnulib-tool
5501 sticks with the automake default in generating dependencies.
5503 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
5505 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
5506 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
5508 * doc/bison.1: Add copyright notice.
5510 * data/glr.c: Don't include <stdarg.h>; not used.
5512 * NEWS: The -g and --graph options now output graphs in Graphviz
5513 DOT format, not VCG format.
5514 * doc/bison.1: Likewise.
5515 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
5516 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
5518 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
5519 * TODO: Remove Graphviz entry.
5520 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
5521 remove vcg.c, vcg.h, vcg_defaults.h.
5522 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
5523 * src/graphviz.c, src/graphviz.h: New files.
5524 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
5525 * src/files.h: Make comment more generic.
5526 * src/main.c (main): Likewise.
5527 * src/print_graph.h: Likewise.
5528 * src/getargs.c (usage): Make usage description more generic.
5529 * src/print_graph.c: Include graphviz.h rather than vcg.h.
5530 (static_graph, fgraph): Remove. All uses changed to pass
5531 arguments instead of sharing a static var.
5532 (print_core, print_actions, print_state, print_graph):
5533 Output graphviz format rather than VCG format.
5534 * tests/.cvsignore: Remove *.vcg; add *.dot.
5535 * tests/output.at: Expect *.dot files, not *.vcg files.
5537 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
5538 accommodates the 2006-10-08 change.
5540 2006-10-11 Bob Rossi <bob@brasko.net>
5542 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
5543 (b4_yyssa, b4_yyerror_range): New macros.
5544 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
5545 (yypvarsinit): Remove init of removed fields.
5546 (yypushparse): Remove use of removed fields; use new macros instead.
5548 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
5550 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
5551 in a push parser. Reindent slightly to match yacc.c better.
5553 2006-10-11 Bob Rossi <bob@brasko.net>
5555 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
5557 (yypvarsinit, yypushparse): Remove init of removed fields.
5558 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
5560 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
5562 * THANKS: Add Paolo Bonzini and Bob Rossi.
5564 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
5566 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
5567 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
5568 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
5569 b4_define_user_cde and uses): Remove.
5570 (b4_comment, b4_prefix, b4_sync_start): New.
5571 * data/bison.m4: New file, with most of the content removed from c.m4.
5572 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
5573 * src/output.c (output_skeleton): Pass bison.m4.
5574 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
5577 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
5579 Fix test failure reported by Tom Lane in
5580 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
5581 and try to make such failures easier to catch in the future.
5582 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
5583 that's now the caller's responsibility.
5584 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
5585 Set yychar = YYEOF if it's negative.
5586 * tests/actions.at (yylex): Abort if asked to read past EOF.
5587 * tests/conflicts.at (yylex): Likewise.
5588 * tests/cxx-type.at (yylex): Likewise.
5589 * tests/glr-regression.at (yylex): Likewise.
5590 * tests/input.at (yylex): Likewise.
5591 * tests/regression.at (yylex): Likewise.
5592 * tests/torture.at (yylex): Likewise.
5594 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
5596 Fix problems with translating English-language diagnostics.
5597 * bootstrap: Fix bug introduced in recent bootstrap changes, with
5598 respect to bison-runtime pot generation. The YY_ stuff
5599 wasn't being captured.
5600 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
5601 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
5602 * runtime-po/POTFILES.in: Add data/push.c.
5604 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
5606 Merge bootstrap changes from coreutils.
5608 2006-09-28 Jim Meyering <jim@meyering.net>
5610 Automatically generated dependencies are important even
5611 when all of the sources in a directory come from gnulib.
5612 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
5613 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
5615 2006-09-23 Jim Meyering <jim@meyering.net>
5617 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
5619 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5621 * bootstrap: Add support for --force.
5622 (usage): New function. Describe usage less tersely.
5623 (CVS_only_file): New var.
5625 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
5627 * data/push.c (YYPUSH_MORE): Make it an enum instead.
5628 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
5629 Adjust white space and comments to match GNU style better.
5631 2006-09-20 Bob Rossi <bob@brasko.net>
5633 * data/push.c (yyresult_get): Remove function.
5634 (YYPUSH_MORE): Add #define.
5635 (yypushparse): Modify return value.
5637 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5639 * stamp-h.in: Remove; no longer needed.
5640 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
5641 Remove config.h, config.hin, intl (no longer created).
5642 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
5645 Sync bootstrap from coreutils, as follows:
5647 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
5649 * bootstrap (symlink_to_gnulib): New function.
5650 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
5651 to copies-of-gnulib.
5652 (cp_mark_as_generated, slurp, gnulib_files):
5653 Avoid making a copy if it's the same as the old version.
5654 (gnulib_files): Add support for this variable (used by Bison).
5656 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5658 * src/getargs.c (usage): Rework to use conventions similar to
5659 coreutils, to make translation a bit easier and the code a bit
5660 smaller. Problem reported by Tim Van Holder.
5662 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
5664 Use some of gnulib's new modules, taken from coreutils.
5666 * bootstrap: Sync from coreutils, except add support for gnulib_files.
5667 * bootstrap.conf: New file.
5668 (gnulib_modules): Add configmake, inttypes, unistd.
5669 (XGETTEXT_OPTIONS): Add complain, complain_at,
5670 fatal, fatal_at, warn, warn_at, unexpected_end.
5671 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
5672 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
5674 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
5676 (GNULIB_AUTOCONF_SNIPPET): Remove.
5677 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
5679 * lib/.cvsignore: Add inttypes_.h.
5680 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
5681 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
5682 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
5683 no-longer-necessary initializations.
5684 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
5685 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
5686 use the unistd module.
5687 * src/system.h: Likewise.
5688 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
5689 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
5690 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
5691 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
5692 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
5693 * src/system.h: Include inttypes.h unconditionally, now that we
5694 use the inttypes module. Don't bother to include stdint.h, since
5695 inttypes.h now does that for us.
5696 (LOCALEDIR): Remove, now that we use the configmake module.
5697 * src/getargs.c: Include configmake.h.
5698 * src/main.c: Likewise.
5699 * src/output.c: Likewise.
5700 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
5701 not from $abs_top_builddir, since config.h moved.
5704 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
5705 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
5707 * src/parse-gram.y (symbol_declaration): Don't put statements
5708 before declarations; it's not portable to C89.
5709 * src/scan-code.l (handle_action_at): Likewise.
5711 * src/scan-code.l: Always initialize braces_level; the old code
5712 left it uninitialized and therefore had undefined behavior.
5714 Don't attempt to redefine 'assert', since it runs afoul of
5715 systems where standard headers (mistakenly) include <assert.h>.
5716 Instead, define and use our own alternative, called 'aver'.
5717 * src/reader.c: Don't include assert.h, since we no longer
5719 * src/scan-code.l: Likewise.
5720 * src/system.h (assert): Remove, replacing with....
5721 (aver): New function, taking a bool arg. All uses changed.
5722 * src/tables.c (pack_vector): Ensure that aver arg is bool,
5723 not merely an integer.
5725 2006-09-15 Bob Rossi <bob@brasko.net>
5727 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
5728 * data/c.m4 (YYPUSH): New.
5729 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
5730 * src/getargs.c (push_parser): New var.
5731 * src/getargs.h (push_parser): New declaration.
5732 * src/output.c (prepare): Add macro insertion of `push_flag'.
5733 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
5734 (prologue_declaration): Parse %push-parser.
5735 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
5736 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
5737 list of removed lines from the traces observed.
5738 (AT_CHECK_CALC_LALR): Added push parser tests.
5740 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
5742 * NEWS: Version 2.3a.
5743 * configure.ac (AC_INIT): Likewise.
5745 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
5746 "#define YYSTYPE int" that caused "make maintainer-check" to fail
5747 due to header ordering dependencies. I don't know why the #define
5750 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
5751 runtime cost when YYDEBUG is not defined, and so that some tests
5752 that used to fail now work. Problem and initial suggestion by
5754 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
5755 * data/glr.cc (b4_parser_class_name):
5756 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
5757 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
5758 (yydebug_) [YYDEBUG]: New member.
5759 (yycdebug_): Now defined only if YYDEBUG.
5760 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
5761 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
5762 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
5764 (debug_stream, set_debug_stream, debug_level, set_debug_level):
5765 Define only if YYDEBUG.
5766 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
5768 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
5769 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
5770 AT_CHECK_CALC_GLR_CC that are working now.
5772 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
5774 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
5775 We don't need them in glr.cc, and glr.c defines them.
5776 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
5777 assumes that defining it to anything is the same as defining
5778 it to 1. Problem reported by Paolo Bonzini.
5780 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
5782 * data/c.m4 (b4_null, b4_case): Define.
5783 * src/output.c (prepare_symbols): Use b4_null.
5784 (user_actions_output): Use b4_case.
5786 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
5788 * data/glr.c (b4_shared_declarations): Put start-header first,
5789 before any #includes that we generate, so that feature-test
5790 macros work. Problem reported by Michael Deutschmann in
5791 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
5792 * data/lalr1.cc: Likewise.
5793 * doc/bison.texinfo (Prologue): Document that feature-test macros
5794 should be defined before any Bison declarations.
5795 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
5796 that depend on location.hh after, not before, Bison decls, since
5797 we now include location.hh after the first user prologue.
5799 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
5800 Sander Brandenburg in
5801 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
5802 Also, fix minor white space and comment issues.
5803 (Prologue): Mention that it's better to define feature-test macros
5804 before Bison declarations. Problem reported by Michael Deutschmann.
5806 * README-cvs: Fix typo: "&" should be "&&". Problem reported
5808 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
5809 This adjusts to recent gnulib changes.
5811 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5813 Finish implementation of per-type %destructor/%printer. Discussed
5815 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
5817 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
5818 * NEWS (2.3+): Add a description of this feature to the default
5819 %destructor/%printer description.
5820 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
5821 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5822 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
5823 list node contains a semantic type.
5824 * src/symtab.c, src/symtab.h: Extend with a table that associates
5825 semantic types with their %destructor's and %printer's.
5826 (semantic_type_from_uniqstr, semantic_type_get,
5827 semantic_type_destructor_set, semantic_type_printer_set): New functions
5828 composing the public interface of that table.
5829 (symbol_destructor_get, symbol_destructor_location_get,
5830 symbol_printer_get, symbol_printer_location_get): If there's no
5831 per-symbol %destructor/%printer, look up the per-type before trying
5833 * tests/actions.at (Per-type %printer and %destructor): New test case.
5834 * tests/input.at (Default %printer and %destructor redeclared):
5835 Extend to check that multiple occurrences of %symbol-default in a
5836 single %destructor/%printer declaration is an error.
5837 (Per-type %printer and %destructor redeclared, Unused values with
5838 per-type %destructor): New test cases.
5840 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5842 Require default %destructor/%printer to be declared using
5843 %symbol-default instead of an empty symbol list, and start working on
5844 new per-type %destructor/%printer. Discussed at
5845 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
5846 * NEWS (2.3+): Add %symbol-default to example.
5847 * bison.texinfo (Freeing Discarded Symbols): Likewise.
5848 (Table of Symbols): Add entry for %symbol-default.
5849 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
5850 (generic_symlist, generic_symlist_item): New nonterminals for creating
5851 a list in which each item is a symbol, semantic type, or
5853 (grammar_declaration): Use generic_symlist in %destructor and %printer
5854 declarations instead of symbols.1 or an empty list.
5855 (symbol_declaration, precedence_declaration, symbols.1): Update actions
5856 for changes to symbol_list.
5857 * src/reader.c: Update for changes to symbol_list.
5858 * src/scan-code.l: Likewise.
5859 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
5860 * src/symlist.c, src/symlist.h: Extend such that a list node may
5861 represent a semantic type or a %symbol-default in addition to just an
5862 ordinary symbol. Add switched functions for setting %destructor's and
5864 * tests/actions.at, tests/input.at: Add %symbol-default to all default
5865 %destructor/%printer declarations.
5867 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
5869 Whether the default %destructor/%printer applies to a particular symbol
5870 isn't a question of whether the user *declares* that symbol (in %token,
5871 for example). It's a question of whether the user by any means
5872 *defines* the symbol at all (by simply using a char token, for
5873 example). $end is defined by Bison whereas any other token with token
5874 number 0 is defined by the user. The error token is always defined by
5875 Bison regardless of whether the user declares it with %token, but we
5876 may one day let the user define error as a nonterminal instead.
5877 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
5878 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
5879 the meaning of "user-defined".
5880 * tests/actions.at (Default %printer and %destructor for user-declared
5881 end token): Rename to...
5882 (Default %printer and %destructor for user-defined end token): ...
5885 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
5886 computation of whether to apply the default, don't maintain a list of
5887 every Bison-defined symbol. Instead, just check for a first character
5888 of '$', which a user symbol cannot have, and check for the error token.
5890 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
5892 Don't apply the default %destructor or %printer to the error token,
5893 $undefined, or $accept. This change fits the general rule that the
5894 default %destructor and %printer are only for user-declared symbols,
5895 and it solves several difficulties that are described in the new test
5897 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
5898 * tests/actions.at (Default %printer and %destructor are not for error
5899 or $undefined, Default %printer and %destructor are not for $accept):
5902 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
5904 Allow %start after the first rule.
5905 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
5906 when parsing the first rule.
5907 (check_and_convert_grammar): Search for it here after all grammar
5908 declarations have been parsed. Skip midrules, which have dummy LHS
5910 * src/symtab.c (symbol_is_dummy): New function.
5911 * src/symtab.h (symbol_is_dummy): Declare it.
5912 * tests/input.at (%start after first rule): New test.
5914 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5916 Redo some of the previous commit: add back the ability to use
5917 non-aliased/undeclared string literals since it might be useful to
5918 those declaring %token-table.
5919 * src/reader.c (check_and_convert_grammar): Undo changes in previous
5920 commit: don't worry about complaints from symbols_pack.
5921 * src/symtab.c (symbol_new, symbol_class_set,
5922 symbol_check_alias_consistency): Undo changes in previous commit: count
5923 each string literal as a new symbol and token, assign it a symbol
5924 number, and don't complain about non-aliased string literals.
5925 (symbols_pack): Since symbol_make_alias still does not decrement symbol
5926 and token counts but does still set aliased tokens to the same number,
5927 symbol_pack_processor now leaves empty slots in the symbols array.
5929 * tests/regression.at (Undeclared string literal): Remove test case
5930 added in previous commit since non-aliased string literals are allowed
5932 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
5933 remove unnecessary string literal declarations.
5934 * tests/sets.at (Firsts): Likewise.
5936 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5938 Don't allow an undeclared string literal, but allow a string literal to
5939 be used before its declaration.
5940 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
5941 symbols_pack complained.
5942 * src/symtab.c (symbol_new): Don't count a string literal as a new
5944 (symbol_class_set): Don't count a string literal as a new token, and
5945 don't assign it a symbol number since symbol_make_alias does that.
5946 (symbol_make_alias): It's not necessary to decrement the symbol and
5947 token counts anymore. Don't assume that an alias declaration occurs
5948 before any uses of the identifier or string, and thus don't assert that
5949 one of them has the highest symbol number so far.
5950 (symbol_check_alias_consistency): Complain if there's a string literal
5951 that wasn't declared as an alias.
5952 (symbols_pack): Bail if symbol_check_alias_consistency failed since
5953 symbol_pack asserts that every token has been assigned a symbol number
5954 although undeclared string literals have not.
5955 * tests/regression.at (String alias declared after use, Undeclared
5956 string literal): New test cases.
5957 (Characters Escapes, Web2c Actions): Declare string literals as
5959 * tests/sets.at (Firsts): Likewise.
5961 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
5963 In the grammar scanner, STRING_FINISH unclosed constructs and return
5964 them to the parser in order to improve error messages.
5965 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
5966 SC_BRACED_CODE, SC_PROLOGUE): Implement.
5967 * tests/input.at (Unclosed constructs): New test case.
5968 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
5971 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
5974 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
5976 Handle string aliases for character tokens correctly.
5977 * src/symtab.c (symbol_user_token_number_set): If the token has an
5978 alias, check and set its alias's user token number instead of its own,
5979 which is set to indicate the alias. Previously, every occurrence of
5980 the character token in the grammar overwrote that alias indicator with
5982 * tests/input.at (String aliases for character tokens): New test.
5984 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
5986 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
5988 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
5990 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
5991 to prevent failures when building on older platforms.
5992 Check for autopoint failure.
5993 Set XGETTEXT_OPTIONS to values that check for C format strings,
5994 so that translators are warned about them (this also helps
5995 prevent core dumps).
5997 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
5998 function, since it simplifies our code a bit.
6000 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
6001 rather than -W, so we don't get bogus warnings about sign comparisons.
6002 Add -Wpointer-arith, since that warning is useful (it reports code
6003 that does not conform to C89 and that some compilers reject).
6004 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
6005 since it's no longer needed.
6007 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
6009 Clean up scanners a bit.
6010 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
6011 definitions so gcc won't warn when obstack_for_string is unused.
6012 * src/scan-code.l: config.h and system.h are already #include'd by
6013 scan-code-c.c, so get rid of them here.
6014 * src/scan-gram.l: Likewise.
6015 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
6016 definitions rather than duplicating the rest of it.
6017 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
6019 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
6021 Suppress signed/unsigned comparison warnings for yycheck.
6022 * data/c.m4 (b4_safest_int_type): New macro.
6023 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
6024 a signed int type, cast it to b4_safest_int_type first.
6025 * data/yacc.c: Likewise.
6026 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
6029 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
6031 * doc/bison.texinfo: Fix some typos.
6033 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
6035 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
6036 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
6038 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
6039 the latest gnulib does this a different way.
6040 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
6041 translation was patched, so stop omitting it.
6043 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
6045 Enable declaration of default %printer/%destructor. Make the parser
6046 use these for all user-declared grammar symbols for which the user does
6047 not declare a specific %printer/%destructor. Thus, the parser uses it
6048 for token 0 if the user declares it but not if Bison generates it as
6049 $end. Discussed starting at
6050 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
6051 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
6053 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
6054 * NEWS (2.3+): Mention.
6055 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
6056 declare a %destructor for a mid-rule's semantic value. It's just
6057 impossible to declare one specific to it.
6058 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
6059 code. Describe default %destructor form.
6060 * src/parse-gram.y (grammar_declaration): Parse default
6061 %printer/%destructor declarations.
6062 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
6063 and symbol_destructor_location_get rather than accessing the destructor
6064 and destructor_location members of struct symbol.
6065 (symbol_printers_output): Likewise but for %printer's.
6066 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
6068 * src/symtab.c (default_destructor, default_destructor_location,
6069 default_printer, default_printer_location): New static global
6070 variables to record the default %destructor and %printer.
6071 (symbol_destructor_get, symbol_destructor_location_get,
6072 symbol_printer_get, symbol_printer_location_get): New functions to
6073 compute the appropriate %destructor and %printer for a symbol.
6074 (default_destructor_set, default_printer_set): New functions to set the
6075 default %destructor and %printer.
6076 * src/symtab.h: Prototype all those new functions.
6077 * tests/actions.at (Default %printer and %destructor): New test to
6078 check that the right %printer and %destructor are called, that they're
6079 not called for $end, and that $$ and @$ work correctly.
6080 (Default %printer and %destructor for user-declared end token): New
6081 test to check that the default %printer and %destructor are called for
6082 a user-declared end token.
6083 * tests/input.at (Default %printer and %destructor redeclared, Unused
6084 values with default %destructor): New tests to check related grammar
6085 warnings and errors.
6087 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
6089 Clean up handling of %destructor for the end token (token 0).
6090 Discussed starting at
6091 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
6093 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
6095 Make the skeletons consistent in how they pop the end token and invoke
6097 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
6098 state, which has token number 0, since this would invoke the
6099 %destructor for the end token.
6100 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
6101 until after shifting the end token, or else it won't be popped.
6102 * data/yacc.c (yyparse): Likewise.
6104 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
6105 it's the end token. Upon termination, destroy an unshifted lookahead
6106 even when it's the end token.
6107 * data/lalr1.cc (yy::parser::parse): Likewise.
6108 * data/yacc.c (yyparse): Likewise.
6110 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
6111 value warnings for the end token when the user gives the end token a
6114 * tests/actions.at (Printers and Destructors): Test all the above.
6116 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
6118 Update to latest gnulib and gettext versions.
6119 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
6121 (gnulib_files): Add m4/warning.m4. Don't worry about files
6122 overwritten by autopoint.
6123 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
6124 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
6126 Don't use autoreconf; instead, invoke autopoint etc. by hand,
6127 so that we can remove the intl files at a better time.
6128 (intl_files_to_remove): Remove aclocal.m4, since it gets
6129 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
6130 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
6131 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
6132 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
6133 Remove datarootdir hack; no longer needed.
6134 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
6135 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
6136 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
6138 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
6139 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
6141 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
6143 * bootstrap: Adjust to today's change to gnulib-tool by invoking
6144 it with --assume-autoconf='latest-stable'.
6146 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
6148 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
6149 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
6151 * src/muscle_tab.h (muscle_grow): Replace the header comments with
6152 those from muscle_tab.c since the old ones are misleading.
6154 2006-07-13 Akim Demaille <akim@epita.fr>
6156 Support %define "KEY" {VALUE}.
6157 * src/scan-code.h, src/scan-code.l (translate_action)
6158 (translate_rule_action, translate_symbol_action, translate_code):
6159 Return char *, not const char *.
6160 * src/parse-gram.y (declaration): Rename as...
6161 (prologue_declaration): this.
6162 (string_content): Remove this nonterminal, use STRING.
6163 (braceless, content, content.opt): New nonterminal.
6165 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
6167 * src/scan-gram.l (getargs.h): Don't include it.
6169 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
6171 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
6172 rather than a for-loop that declares a local bool variable. This
6173 should work around a compatibility problem with a Cray x1e C++
6174 compiler reported by Hung Nguyen in
6175 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
6176 The for-loop was introduced in the 2004-11-17 change but I don't
6177 know why it was needed.
6179 2006-07-12 Akim Demaille <akim@epita.fr>
6181 * data/c.m4: Comment changes.
6183 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
6185 * src/complain.c (error_message, ERROR_MESSAGE): New.
6187 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
6188 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
6190 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
6192 * NEWS: Instead of %union, you can define and use your own union type
6193 YYSTYPE if your grammar contains at least one <type> tag.
6194 Your YYSTYPE need not be a macro; it can be a typedef.
6195 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
6196 (Union Decl, Decl Summary): Document this.
6197 * data/glr.c (YYSTYPE): Implement this.
6198 * data/glr.cc (YYSTYPE): Likewise.
6199 * data/lalr1.cc (YYSTYPE): Likewise.
6200 * data/yacc.c (YYSTYPE): Likewise.
6201 * src/output.c (prepare): Output tag_seen_flag.
6202 * src/parse-gram.y (declaration, grammar_declaration):
6203 Use 'union_seen' rather than 'typed' to determine whether
6204 %union has been seen, since grammars can now be typed without
6206 (symbol_declaration, type.opt, symbol_def):
6207 Keep track of whether a tag has been seen.
6208 * src/reader.c (union_seen, tag_seen): New vars.
6210 * src/reader.h (union_seen, tag_seen, typed): Likewise.
6211 * src/scan-code.l (untyped_var_seen): New variable.
6212 (handle_action_dollar): Adjust to above changes.
6213 (handle_action_dollar, handle_action_at):
6214 Improve overflow checking for outlandish numbers.
6215 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
6216 avoid new diagnostics generated by above changes.
6217 * tests/regression.at (YYSTYPE typedef): Add test to check
6218 for type tags without %union.
6220 * src/symlist.c (symbol_list_length): Return int, not unsigned
6221 int, since callers expect int. This may need to get revisited
6222 once we have proper integer overflow checking.
6224 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
6225 object is now static.
6227 * src/getargs.c (flags_argmatch): Return void, not int,
6228 to pacify ./configure --enable-gcc-warnings.
6230 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
6231 since last_string is already defined to FLEX_PREFIX (last_string).
6233 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
6235 Implement --warnings/-W.
6236 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
6238 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
6240 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
6241 (warnings_args, warnings_types): New.
6242 (getargs, short_options, long_options): Accept -W/--warnings.
6243 Sort the options by alphabetical order, upper case letter right
6244 before its lower case.
6246 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
6248 Change %merge result type clash warnings to errors. Discussed at
6249 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
6250 * src/reader.c (record_merge_function_type): Use complain_at.
6251 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6252 declared later): Update test case results.
6254 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
6256 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
6257 to be in alphabetical order.
6258 (trace_args): Spelling fixes.
6260 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
6262 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
6263 so they don't collide with user-defined macros.
6264 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
6265 this was never guaranteed, and now that we're using gnulib stdint,
6266 which defines int_fast16_t to long int, the problem is exposed.
6268 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
6270 * data/c.m4 (b4_basename): Simplify a bit, since we don't
6271 need the full POSIX semantics (and weren't implementing them
6274 Adjust to Autoconf 2.60 and today's gnulib.
6275 * bootstrap (gnulib_modules): Add stdint.
6276 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
6277 no longer copies it.
6278 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
6279 since stdint needs the former and wcwidth (which is now required
6280 by mbswidth) needs the latter.
6281 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
6282 work around a compatibility glitch between gettext 0.14.6 and
6284 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
6285 Do not check for uintptr_t, since new stdint module does the right
6287 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
6288 Add stdint.h, stdint_.h, wcwidth.h.
6289 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
6290 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
6291 stdint.m4, wchar_t.m4, wcwidth.m4.
6292 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
6293 usual order for ../lib/*.h files.
6294 (file_name_split): Use last_component, not base_name, to adjust
6296 * src/parse-gram.h: Include <strverscmp.h> in the usual order
6297 for ../lib/*.h files.
6298 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
6299 Define unconditionally, since we now assume the stdint module.
6300 * src/scan-skel.l: Include <dirname.h>.
6301 (BASE_QPUTS): Use last_component, not base_name.
6302 * src/system.h: Include <unlocked-io.h> in the usual order
6303 for ../lib/*.h files. Include <stdint.h> unconditionally,
6304 since we now use the stdint module.
6305 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
6306 HAVE_UINTPTR_T, since we now use the stdint module.
6307 (base_name): Remove decl, since files now include <dirname.h>
6310 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
6312 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
6314 * data/yacc.c, data/glr.c, data/location.cc: Use them.
6315 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
6317 * tests/calc.at: Adjust.
6319 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
6321 * data/c.m4 (b4_basename): New.
6322 (b4_syncline): Also output the location of its invocation (from
6324 (b4_user_action, b4_define_user_action, b4_user_actions)
6325 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
6326 (b4_user_stype): New.
6327 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
6329 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
6331 In the grammar file, the first column is 1 not 0 on the first line as
6332 on every other line.
6333 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
6334 * tests/input.at (Torturing the Scanner): Update output.
6336 * src/scan-gram.l (scanner_cursor): Declare it static.
6338 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
6340 In warnings, say "previous declaration" rather than "first
6342 * src/symtab.c (redeclaration): Do that here.
6343 * src/reader.c (record_merge_function_type): In the case of a result
6344 type clash, report the previous declaration rather than the very first
6345 one in the grammar file.
6346 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6347 declared later): Add a third declaration to check this behavior.
6348 * tests/input.at (Incompatible Aliases): Update output.
6350 2006-06-27 Akim Demaille <akim@epita.fr>
6352 * doc/Doxyfile.in: New.
6353 * doc/Makefile.am: Use it.
6354 * src/lalr.h, src/symtab.h: Initial doxygenation.
6356 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6358 Don't miss %merge result type warnings just because the LHS types are
6359 declared after the %merge. This continues the effort of the previous
6361 * src/reader.c (get_merge_function): Don't set the merger type yet.
6362 (record_merge_function_type): New function for setting the merger type
6363 and checking for clashes.
6364 (grammar_current_rule_merge_set): Set the location of the %merge for
6366 (packgram): Invoke record_merge_function_type for each rule now that
6367 all symbol type declarations have been parsed.
6368 * src/reader.h (merger_list.type_declaration_location): New member
6369 storing the location of the first %merge from which the type for this
6370 merging function was derived.
6371 * src/symlist.h (symbol_list.merger_declaration_location): New member
6372 storing the location of a rule's %merge, if any.
6373 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6374 declared later): New test to catch the error fixed by the above patch.
6376 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6378 Get action warnings (grammar_rule_check) right even when symbol
6379 declarations appear after the rules. Discussed at
6380 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
6382 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
6383 Don't mistake the type of $$ in a midrule to be that of its parent
6385 * src/reader.c (grammar_current_rule_end): Don't invoke
6386 grammar_rule_check yet since not all symbol declarations may have been
6388 (grammar_midrule_action): Likewise.
6389 Don't record whether the midrule's $$ has been used yet since actions
6390 haven't been translated yet.
6391 Record the midrule's parent rule and its RHS index within the parent
6393 (grammar_current_rule_action_append): Don't translate the action yet
6394 since not all symbol declarations may have been parsed yet and, thus,
6395 warnings about types for $$, $n, @$, and @n can't be reported yet.
6396 (packgram): Translate the action and invoke grammar_rule_check now that
6397 all symbol declarations have been parsed.
6398 * src/scan-code.l (handle_action_dollar): Now that this is invoked
6399 after parsing the entire grammar file, the symbol list here in the case
6400 of a midrule is actually the midrule's empty RHS, so reference its
6401 parent rule's RHS where necessary.
6402 On the other hand, now that you can already know it's a midrule, you
6403 aren't forced to think $$ has the same type as its parent rule's $$.
6404 (handle_action_at): In the case of a midrule, reference the parent rule
6406 * src/symlist.c (symbol_list_new): Initialize new midrule-related
6408 (symbol_list_length): Now that this is invoked after all rules have
6409 been parsed, a NULL symbol (rather than a NULL symbol list node)
6410 terminates a rule. symbol_list_print already does this correctly.
6411 * src/symlist.h (symbol_list.midrule_parent_rule,
6412 symbol_list.midrule_parent_rhs_index): New members so that midrules can
6413 remember their relationships with their parents.
6414 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
6415 fixed by the above patch.
6416 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
6418 (Unused values): ... this old test case and...
6419 (Unused values before symbol declarations): ... this new test case.
6420 This one is the same as `Unused values' except that all symbol
6421 declarations appear after the rules in order to catch the rest of the
6422 errors fixed by the above patch.
6424 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6427 * src/reader.c (current_rule): Declare it static since it's no longer
6428 used outside this file.
6429 (grammar_current_rule_action_append): Remove redundant arguments from
6430 translate_rule_action invocation.
6431 * src/reader.h (current_rule): Remove this unused extern.
6432 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
6433 * src/scan-code.l (translate_rule_action): Likewise.
6435 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
6437 Clean up yesterday's patch.
6438 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
6440 * src/reader.c (grammar_current_rule_action_append): ... here for
6441 consistency with grammar_current_rule_symbol_append.
6442 * tests/regression.at (Braced code in declaration in rules section):
6443 Make yyerror and yylex static as usual.
6445 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
6447 Fix bug that mistakes braced code in a declaration in the rules section
6448 to be a rule action. Mentioned at
6449 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
6450 * src/scan-gram.l: Move midrule action detection from the start of the
6451 scanning of any braced code to...
6452 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
6453 action. For readability, use $2 and @2 rather than the equivalent
6455 * tests/regression.at (Braced code in declaration in rules section):
6456 New test to catch the error fixed by the above patch.
6458 Work on code readability some.
6459 * src/scan-code.l (current_rule): Get rid of this misleading and
6460 redundant declaration: it's actually extern'ed in reader.h.
6461 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
6462 translate_action): Add a rule argument and use it instead of the global
6464 (translate_rule_action): This already receives current_rule through an
6465 argument, so pass it on to translate_action instead of assigning
6466 current_rule to current_rule.
6467 (translate_symbol_action, translate_code): Pass rule = NULL to
6470 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
6472 Rename %before-definitions to %start-header and %after-definitions to
6473 %end-header. Don't use these declarations to separate pre-prologue
6474 blocks from post-prologue blocks. Add new order-independent
6475 declarations %before-header and %after-header as alternatives to the
6476 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
6477 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
6478 * NEWS (2.3+): Update for these changes.
6479 * data/glr.c (b4_before_definitions): Update to...
6480 (b4_start_header): ... this.
6481 (b4_after_definitions): Update to...
6482 (b4_end_header): ... this.
6483 * data/glr.cc: Likewise.
6484 * data/lalr1.cc: Likewise.
6485 * data/yacc.c: Likewise.
6486 * doc/bison.texinfo (The prologue): Update names, and replace remaining
6487 prologue blocks with %*-header declarations.
6488 (Calc++ Parser): Likewise.
6489 (Decl Summary): Update names.
6490 (Table of Symbols): Update description.
6491 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
6492 (PERCENT_END_HEADER): ... this.
6493 (PERCENT_BEFORE_DEFINITIONS): Update to...
6494 (PERCENT_START_HEADER): ... this.
6495 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
6496 (declaration): Update token names and m4 macro names.
6497 When parsing %end-header and %start-header, invoke translate_code
6498 before muscle_code_grow, and no longer set global booleans to remember
6499 whether these declarations have been seen.
6500 Parse new %after-header and %before-header.
6501 * src/reader.c (before_definitions, after_definitions): Remove.
6502 (prologue_augment): Accept a new bool argument to specify whether to
6503 augment the pre-prologue or post-prologue.
6504 * src/reader.h (before_definitions, after_definitions): Remove these
6506 (prologue_augment): Add new bool argument.
6507 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
6508 (PERCENT_END_HEADER): ... this.
6509 (PERCENT_BEFORE_DEFINITIONS): Update to...
6510 (PERCENT_START_HEADER): ... this.
6511 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
6512 * tests/actions.at (Printers and Destructors): Update names.
6514 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
6516 Add comparison operators for C++ location classes. Discussed at
6517 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
6518 * data/c++.m4 (b4_define_location_comparison): New boolean %define
6519 declaration indicating whether filename_type has an operator==. If
6520 filename_type is `std::string', it defaults to `1', `0' otherwise.
6521 * data/location.cc: Iff b4_define_location_comparison is `1', add
6522 operator== and operator!= for class position and for class location.
6525 * src/scan-action.l: Remove unused file.
6526 * src/symtab.c (symbol_printer_set): Use printer_location not
6527 destructor_location.
6528 * src/symtab.h (struct symbol): Replace incorrect source comment for
6530 * tests/input.at (Incompatible Aliases): Update output with correct
6533 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
6535 Don't put the pre-prologue in the header file. For the yacc.c code
6536 file and the glr.c header and code files, move the pre-prologue before
6537 the token definitions. Add new %before-definitions and
6538 %after-definitions to declare code that will go in both the header file
6539 and code file. Discussed at
6540 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
6541 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
6543 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
6544 * NEWS (2.3+): Describe these changes.
6545 * data/glr.c (b4_pre_prologue): Move from within to before...
6546 (b4_shared_declarations): ... this.
6547 Add new b4_before_definitions before b4_token_enums.
6548 Add new b4_after_definitions at the end.
6549 * data/glr.cc (b4_pre_prologue): Replace with...
6550 (b4_before_definitions): ... this in the header file.
6551 (b4_after_definitions): New near the end of the header file.
6552 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
6553 code file right before including the header file.
6554 (b4_before_definitions): New in the previous position of
6555 b4_pre_prologue in the header file.
6556 (b4_after_definitions): New near the end of the header file.
6557 * data/yacc.c: Clean up some m4 quoting especially in the header file.
6558 (b4_token_enums_defines): In the code file, move to right before
6559 YYSTYPE for consistency with the header file.
6560 (b4_before_definitions): New right before b4_token_enums_defines in
6561 both the header and code file.
6562 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
6563 header and code file.
6564 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
6565 of prologues for %union dependencies.
6566 (Decl Summary): In %defines description, mention the effect of
6567 %before-definitions and %after-definitions on the header file.
6568 (Calc++ Parser): Forward declare driver in a %before-definitions rather
6569 than in the pre-prologue so that make check succeeds.
6570 (Table of Symbols): Add entries for %before-definitions and
6572 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
6573 %before-definitions.
6574 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
6575 (declaration): Parse those declarations and append to
6576 b4_before_definitions and b4_after_definitions, respectively.
6577 * src/reader.c (before_definitions, after_definitions): New bools to
6578 track whether those declarations have been seen.
6579 (prologue_augment): Add to the post-prologue if %union,
6580 %before-definitions, or %after-definitions has been seen.
6581 * src/reader.h (before_definitions, after_definitions): New extern's.
6582 * src/scan-gram.l: Scan the new declarations.
6583 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
6584 prologue block in a %before-definitions or a %after-definitions based
6585 on whether the %union is declared.
6586 * tests/regression.at (Early token definitions with --yacc, Early token
6587 definitions without --yacc): Move tests for token definitions into the
6588 post-prologue since token names are no longer defined in the
6591 2006-06-20 Akim Demaille <akim@epita.fr>
6593 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
6594 (symbol_get): Use it.
6595 * src/parse-gram.y: Use it.
6597 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
6599 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
6600 build succeeds when configured with --enable-gcc-warnings.
6602 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
6604 * src/parse-gram.y (char_name): New function.
6605 (CHAR, STRING, string_content): For %printer, properly escape.
6606 (ID): Prefer fputs to fprintf.
6607 (id): Reindent to be consistent with other rules.
6608 Properly quote char.
6610 The Translation Project changed its way of publishing translations
6611 to maintainers. I haven't received any responses to my request
6612 for supporting the old way, or for documenting the new way. I
6613 have modified 'bootstrap' to use screen scraping
6614 (in this case, HTML scraping). This is unreliable and inelegant,
6615 but I don't see any better way. Yuck.
6616 * bootstrap (TP_URL, WGET_COMMAND): New vars.
6617 (get_translations): New function, which uses HTML scraping to
6618 deduce locations of latest translations.
6619 Use this function to grab both bison and bison-runtime .po files.
6620 Don't bother priming the pump for the runtime-po domain any more,
6621 as it's now translated better than bison is.
6623 2006-06-19 Akim Demaille <akim@epita.fr>
6625 * src/scan-gram.l: No longer "parse" things after `%union' until
6626 `{'. Rather, return a single "%union" token.
6627 No longer make symbols: return strings, and leave the conversion
6628 to symbols to the parser.
6629 (SC_PRE_CODE, token_type): Remove.
6630 * src/parse-gram.y (%union): New field `character'.
6633 (ID, ID_COLON): Now that the scanner no longer makes them
6634 identifiers, adjust all uses to invoke symbol_get.
6635 (id_colon): New, wraps the conversion from string to symbol.
6636 (%union): Accept a possible union_name.
6637 (symbol): Now can be a char.
6638 * data/c.m4 (b4_union_name): Leave a default value.
6639 * data/glr.c, data/yacc.c: Use it.
6641 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
6643 For associating token numbers with token names for "yacc.c", don't use
6644 #define statements unless `--yacc' is specified; always use enum
6645 yytokentype. Most important discussions start at:
6646 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
6647 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
6649 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
6650 * NEWS (2.3+): Mention.
6651 * data/c.m4 (b4_yacc_if): New.
6652 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
6654 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
6655 on token name definitions.
6656 * src/getargs.c (usage): Capitalize `Yacc' in English.
6657 * src/output.c (prepare): Define b4_yacc_flag.
6658 * tests/regression.at (Early token definitions): Test that tokens names
6659 are defined before the pre-prologue not just before the post-prologue.
6660 Remove this test case and copy to...
6661 (Early token definitions with --yacc): ... this to test #define's.
6662 (Early token definitions without --yacc): ... and this to test enums.
6664 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
6666 * NEWS: Reword the post-2.3 change to not be so optimistic about
6667 removing the old "look-ahead" spelling.
6668 Update previous look-ahead/lookahead change reports.
6669 * REFERENCES: look-ahead -> lookahead (since that's
6670 what he actually wrote).
6671 * doc/refcard.tex: look ahead -> lookahead,
6672 look-ahead -> lookahead
6674 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
6676 For consistency, use `lookahead' instead of `look-ahead' or
6677 `look_ahead'. Discussed starting at
6678 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
6680 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
6681 * NEWS: For the next release, note the change to `--report'.
6682 * TODO, doc/bison.1: Update English.
6683 * doc/bison.texinfo: Update English.
6684 (Understanding Your Parser, Bison Options): Document as
6685 `--report=lookahead' rather than `--report=look-ahead'.
6686 * src/conflicts.c: Update English in comments.
6687 (lookahead_set): Rename from look_ahead_set.
6688 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
6689 (resolve_sr_conflict): Rename local look_ahead_tokens to
6690 lookahead_tokens, and update other uses.
6691 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
6692 count_rr_conflicts, conflicts_free): Update uses.
6693 * src/getargs.c (report_args): Move "lookahead" before alternate
6695 (report_types): Update uses.
6696 (usage): For `--report' usage description, state `lookahead' spelling
6697 rather than `look-ahead'.
6698 * src/getargs.h (report.report_lookahead_tokens): Rename from
6699 report_look_ahead_tokens.
6700 * src/lalr.c: Update English in comments.
6701 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
6702 (state_lookahead_tokens_count): Rename from
6703 state_look_ahead_tokens_count.
6704 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6705 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
6706 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6708 Update English in output.
6709 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
6710 * src/print.c: Update English in comments.
6711 (lookahead_set): Rename from look_ahead_set.
6712 (print_reduction): Rename argument lookahead_token from
6714 (print_core, state_default_rule, print_reductions, print_results):
6716 * src/print_graph.c: Update English in comments.
6717 (print_core): Update uses.
6718 * src/state.c: Update English in comments.
6719 (reductions_new): Update uses.
6720 (state_rule_lookahead_tokens_print): Rename from
6721 state_rule_look_ahead_tokens_print, and update other uses.
6722 * src/state.h: Update English in comments.
6723 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
6724 (state_rule_lookahead_tokens_print): Rename from
6725 state_rule_look_ahead_tokens_print.
6726 * src/tables.c: Update English in comments.
6727 (conflict_row, action_row): Update uses.
6728 * tests/glr-regression.at
6729 (Incorrect lookahead during deterministic GLR,
6730 Incorrect lookahead during nondeterministic GLR): Rename
6731 print_look_ahead to print_lookahead.
6732 * tests/torture.at: Update English in comments.
6733 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
6734 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
6735 (Many lookahead tokens): Update uses.
6736 * data/glr.c: Update English in comments.
6737 * lalr1.cc: Likewise.
6739 * src/conflicts.h: Likewise.
6740 * src/lalr.h: Likewise.
6741 * src/main.c: Likewise.
6742 * src/output.c: Likewise.
6743 * src/parse-gram.c: Likewise.
6744 * src/tables.h: Likewise.
6745 * tests/calc.at: Likewise.
6747 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
6749 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
6751 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
6753 * TODO: Add request from Nelson H. F. Beebe to be able to install
6754 Bison without installing the yacc script.
6756 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6758 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
6759 and yytext if they're already #define'd.
6760 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
6761 * src/scan-code-c.c: ... here.
6762 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
6765 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6767 Get Bison to build again when configured with --enable-gcc-warnings.
6768 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
6770 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
6771 loc argument as it shadows a global.
6772 * src/scan-gram.l: Remove stray comma that prevents boundary_set
6775 * src/.cvsignore: Add scan-code.c.
6777 2006-06-07 Akim Demaille <akim@epita.fr>
6779 * src/scan-gram.l: Move the "add a trailing ; to actions" code
6781 * src/scan-code.l: here.
6782 * tests/input.at (Torturing the Scanner): Fix another location
6785 2006-06-07 Akim Demaille <akim@epita.fr>
6787 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
6789 2006-06-06 Akim Demaille <akim@epita.fr>
6791 Extract the parsing of user actions from the grammar scanner.
6792 As a consequence, the relation between the grammar scanner and
6793 parser is much simpler. We can also split "composite tokens" back
6795 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
6796 * src/scan-gram.l (add_column_width, adjust_location): Move to and
6798 * src/location.h, src/location.c (add_column_width)
6799 (location_compute): these.
6800 Fix the column count: the initial column is 0.
6801 (location_print): Be robust to ending column being 0.
6802 * src/location.h (boundary_set): New.
6803 * src/main.c: Adjust to scanner_free being renamed as
6805 * src/output.c: Include scan-code.h.
6806 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
6808 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
6809 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
6810 which is now, again, a separate token.
6811 Adjust all dependencies.
6812 Whereever actions with $ and @ are used, use translate_code.
6813 (action): Remove this nonterminal which is now useless.
6814 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
6815 (grammar_current_rule_action_append): Use translate_code.
6816 (packgram): Bound check ruleno, itemno, and rule_length.
6817 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
6818 (last_string, last_braced_code_loc, max_left_semantic_context)
6819 (scanner_initialize, scanner_free, scanner_last_string_free)
6820 (gram_out, gram_lineno, YY_DECL_): Move to...
6821 * src/scan-gram.h: this new file.
6822 (YY_DECL): Rename as...
6824 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
6825 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6826 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6827 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6828 Move these declarations, and...
6829 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
6831 * src/flex-scanner.h: this new file.
6832 * src/scan-gram.l (rule_length, rule_length_overflow)
6833 (increment_rule_length): Remove.
6834 (last_braced_code_loc): Rename as...
6835 (gram_last_braced_code_loc): this.
6836 Adjust to the changes of the parser.
6837 Move all the handling of $ and @ into...
6838 * src/scan-code.l: here.
6839 * src/scan-gram.l (handle_dollar, handle_at): Remove.
6840 (handle_action_dollar, handle_action_at): Move to...
6841 * src/scan-code.l: here.
6842 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
6843 scan-code.h, scan-code-c.c, scan-gram.h.
6844 (EXTRA_bison_SOURCES): Add scan-code.l.
6845 (BUILT_SOURCES): Add scan-code.c.
6846 (yacc): Be robust to white spaces.
6848 * tests/conflicts.at, tests/input.at, tests/reduce.at,
6849 * tests/regression.at: Adjust the column numbers.
6850 * tests/regression.at: Adjust the error message.
6852 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6854 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6855 Use Akim's wording from
6856 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
6858 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6860 Between Bison releases, manually append `+' to the previous Bison
6861 release number, and use that as a signal to automatically print the
6862 ChangeLog's CVS Id keyword from --version. Discussed starting at
6863 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
6864 * ChangeLog: Add Id header.
6865 * configure.ac (AC_INIT): Append `+' to `2.3'.
6866 * src/.cvsignore: Add revision.c.
6867 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
6868 (BUILT_SOURCES): Add revision.c.
6869 (revision.c): New target rule. This file defines a new global variable
6870 named revision. It initializes it with either the Id from ChangeLog
6871 or, if VERSION doesn't contain `+', with the empty string.
6872 * src/getargs.c (version): Print the value of revision.
6873 * src/revision.h: Extern revision.
6875 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
6877 * NEWS: Version 2.3.
6878 * configure.ac (AC_INIT): Likewise.
6880 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
6882 * data/glr.c (YYRECOVERING): Define to be a function-like macro
6883 with no arguments, not as an object-like macro. This is for
6884 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
6885 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
6886 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
6889 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
6891 * src/getargs.c (usage): Back out yesterday's modification of the
6892 --help output so that we don't have to wait for translation before
6895 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
6897 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
6898 Problem reported by Akim Demaille.
6900 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6902 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6904 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
6906 * data/yacc.c (yy_reduce_print): Omit trailing white space in
6907 generated source code. Problem reported by Frans Englich in
6908 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
6910 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
6912 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
6913 shell, not within 'make', so that 'make' by an ordinary builder
6914 (using GNU make) does not worry about configuring gzip. This also
6915 works around a bug reported independently by Keith Thompson and by
6916 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
6917 stderr rather than stdout, messing up the build logs.
6919 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6921 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
6922 to make sure that YYID will never be unused. This fixes a 'make
6923 maintainer-check' failure caused by the recent changes to the 'Trivial
6924 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
6926 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
6928 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6930 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
6931 state before an empty RHS is always resolved here. Only the location
6932 of that state is guaranteed to be resolved, and that's enough. This
6933 fixes the remaining bug reported by Derek M. Jones in
6934 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6935 * tests/glr-regression.at (Uninitialized location when reporting
6936 ambiguity): Test the above case.
6937 Also, the embedded comments in this test case claim it checks the case
6938 of an empty RHS that has inherited the initial location. However, the
6939 corresponding LHS was already resolved, so yyresolveLocations didn't
6940 actually have reason to modify it. Fix this by forcing
6941 nondeterministic operation at the beginning of the parse.
6943 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
6945 * data/c.m4 (b4_yy_symbol_print_generate):
6946 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
6947 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
6948 of the bugs reported today by Derek M Jones in
6949 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6950 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
6951 defined to be a type name without parens or brackets.
6952 (Location Type): Similarly for YYLTYPE.
6953 * tests/regression.at (Trivial grammars): Put in a test for this
6954 bug that will be caught by 'make maintainer-check' (though not,
6955 alas, by 'make check' unless your compiler is picky).
6957 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
6959 * NEWS: Version 2.2.
6960 * configure.ac (AC_INIT): Likewise.
6962 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
6964 * data/glr.c (yyreportTree): Make room in yystates for the state
6965 preceding the RHS. This fixes the segmentation fault reported by Derek
6967 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
6968 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
6969 to the user. Reported for yyreportTree by Derek M. Jones later in the
6971 * THANKS: Add Derek M. Jones.
6972 Update my email address.
6973 Fix typo in Steve Murphy's name.
6975 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
6977 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
6978 checking against YYLAST that caused the parser to miss a potential
6979 alternative in its diagnostic.
6980 Problem reported by Maria Jose Moron Fernandez in
6981 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
6982 * data/lalr1.cc (yysyntax_error_): Likewise.
6983 * data/yacc.c (yysyntax_error): Likewise.
6984 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
6985 tokens, in case we run into an older C compiler.
6986 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
6987 Use them to check for the off-by-one error fixed above.
6989 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
6990 YYSIZE_T, not size_t.
6991 * tests/regression.at (Trivial grammars): New test, to catch
6992 the error fixed by the above patch.
6994 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6996 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
6998 Reported by Steve Murphy.
7000 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7002 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
7003 * data/glr.cc: b4_location_flag is now b4_locations_flag.
7005 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7007 Implement --trace=m4.
7008 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
7009 * src/output.c (output_skeleton): When set, pass -dV to m4.
7011 Factor the handling of flags in m4.
7012 * src/output.c (prepare): Rename the muscle names debug, defines,
7013 error_verbose to debug_flag, defines_flag, error_verbose_flag.
7014 * data/c.m4: Adjust.
7015 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
7016 Use b4_define_flag_if to define other b4_FLAG_if macros.
7017 (b4_location_if): As a consequence, rename as...
7018 (b4_locations_if): this, for consistency.
7019 Adjust all the skeletons.
7021 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7023 * etc/bench.pm: Shorten bench names.
7025 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7027 * src/output.h, src/output.c (error_verbose): Move to...
7028 * src/getargs.h, src/getargs.c: here.
7030 Adjust dependencies.
7032 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
7034 * data/c.m4 (b4_copyright): Put the special exception for Bison
7035 skeletons here, so we don't have to put it in each skeleton. All
7036 uses changed. Suggested by Akim Demaille. Also, wrap the
7037 copyright notice, in case it is longer than 80 columns. Replace
7038 comma by newline after title.
7040 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
7042 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
7043 incompatibility, not a bug. Mention that it wasn't fixed as of
7046 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
7048 * examples/extexi: Enforce the precedence of concatenation over
7050 Reported by Tommy Nordgren.
7052 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
7054 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
7055 with the member "token".
7056 Reported by Martin Nylin.
7058 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
7060 * data/glr.c: Switch to Bison 2.2 special-exception language in
7061 the copyright notice. Use more-regular format for titles and
7063 * data/glr.cc: Likewise.
7064 * data/location.cc: Likewise.
7065 * data/yacc.cc: Likewise.
7066 * doc/bison.texinfo (Conditions): Document this.
7067 * NEWS: likewise. Upgrade version to 2.2.
7069 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
7071 * data/glr.cc: Remove dead code.
7073 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
7075 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
7076 that variable and the line breaks the bootstrap. Problem reported
7077 by Juan M. Guerrero.
7079 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
7081 * doc/bison.texinfo (Multiple start-symbols): New.
7083 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
7085 * etc/README, etc/bench.pl: New.
7087 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
7089 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
7091 Reported by Mickael Labau.
7092 * tests/input.at (Torturing the Scanner): Test it.
7094 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
7096 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
7097 Problem reported by Bob Rossi.
7099 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
7101 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
7102 and didn't really work.
7103 For the index, use @ifnotinfo, not @iftex.
7104 Minor cleanups of spacing and terminology.
7106 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
7108 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
7109 of AT_NAME_PREFIX when %name-prefix is not used.
7111 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
7113 Apply --prefix to C++ skeletons too: they change the namespace.
7114 The test suite already exercize these cases.
7115 * data/c++.m4 (b4_namespace): New.
7116 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
7117 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
7118 * data/yacc.c, data/glr.c: Remove a useless `[]'.
7119 * doc/bison.texinfo: Document it.
7120 (Option Cross Key): Use @multitable in all formats. It looks
7121 nicer, even in TeX outputs.
7122 (Rules): Use the same code whatever the output type is.
7123 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
7124 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
7125 * tests/calc.at: Use it, instead of hard coding `yy'.
7127 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
7129 * TODO: Remove dead items.
7131 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
7133 * doc/FAQ: Remove, merged into...
7134 * doc/bison.texinfo (FAQ): this.
7135 * doc/Makefile.am (EXTRA_DIST): Adjust.
7137 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
7139 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
7141 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
7142 * doc/bison.texinfo (Calc++ Scanner): Use it.
7144 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
7146 Fix two nits reported by twlevo, plus one more that I discovered.
7148 * src/assoc.h (assoc_to_string): Give a name to the arg, as
7149 this is the usual Bison style.
7150 * src/location.h (location_print): Likewise.
7152 * src/reader.h (token_name): Likewise.
7154 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
7156 Fix some nits reported by twlevo.
7157 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
7158 and "POSIX". Use more-modern syntax for URLs. Mention C++
7159 and ask for Java. Don't hardwire OS version numbers. Add
7161 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
7162 * src/conflicts.c (solved_conflicts_obstack): Now static.
7164 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
7166 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
7167 page. Say "you can use it" not "you may use it" as on the web page;
7168 we're describing capabilities not granting permission.
7170 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
7172 * data/glr.c (yyresolveLocations): Rename local variables to avoid
7173 shadowing warnings. Use usual patter for iterating through RHS.
7174 * tests/glr-regression.at
7175 (Uninitialized location when reporting ambiguity):
7176 Modify yylex so that it uses its argument, rather than trying
7177 to rely on ARGSUSED (which doesn't work for gcc with warnings).
7178 const char -> char const.
7180 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
7181 Don't use tabs inside commands; it messes up 'ps'.
7182 Problem reported by twlevo.
7184 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
7186 * tests/glr-regression.at (Uninitialized location when reporting
7187 ambiguity): New test case.
7188 * data/glr.c (yyresolveLocations): New function, which uses
7190 (yyresolveValue): Invoke yyresolveLocations before reporting an
7192 * doc/bison.texinfo (Default Action for Locations): Note
7193 YYLLOC_DEFAULT's usage for ambiguity locations.
7194 (GLR Semantic Actions): Cross-reference those notes.
7196 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
7198 * tests/glr-regression.at (Leaked semantic values when reporting
7199 ambiguity): Remove unnecessary union and type declarations.
7200 (Leaked lookahead after nondeterministic parse syntax error): New test
7202 * data/glr.c (yyparse): Check for zero stacks remaining before
7203 attempting to shift the lookahead so that you don't lose it.
7205 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
7207 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
7208 * tests/glr-regression.at (Leaked semantic values when reporting
7209 ambiguity): New test case.
7210 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
7211 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
7212 now unnecessary yystackp parameter.
7213 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
7214 destructors can be called.
7216 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
7217 in existing testcases.
7219 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
7221 Don't leak semantic values for parent RHS when a user action cuts the
7222 parser, and clean up related code a bit.
7223 * tests/glr-regression.at (Leaked merged semantic value if user action
7224 cuts parse): Rename to...
7225 (Leaked semantic values if user action cuts parse): ... this. Add check
7226 for leaked parent RHS values.
7227 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
7228 between an unresolved state (non-empty chain of semantic options) and
7229 an incomplete one (signaled by an empty chain).
7230 (yyresolveStates): Document the interface. Move all manipulation of a
7231 successfully or unsuccessfully resolved yyGLRState to...
7232 (yyresolveValue): ... here so that yyresolveValue always leaves a
7233 yyGLRState with consistent data and thus is easier to understand.
7234 Remove the yyvalp and yylocp parameters since they are always just
7235 taken from the yys parameter. When reporting a discarded merged value
7236 in debugging output, note that it is incompletely merged. Document the
7238 (yyresolveAction): If resolving any of the RHS states fails, destroy
7239 them all rather than leaking them. Thus, as long as user actions are
7240 written to clean up the RHS correctly, yyresolveAction always cleans up
7241 the RHS of a semantic option. Document the interface.
7243 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
7245 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
7246 led to a segmentation fault in GNU Pascal. Problem reported
7249 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
7251 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
7252 mid-rule action inside a nonterminal symbol in order to declare a
7253 destructor for its semantic value.
7255 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
7257 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
7258 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
7259 __cplusplus && ! defined _STDLIB_H && !
7260 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
7261 defined free))]: Include <stdlib.h> rather than rolling our own
7262 declarations of malloc and free, to avoid problems with
7263 incompatible declarations (using 'throw') C++'s stdlib.h. This
7264 should fix Debian bug 340012
7265 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
7266 reported by Guillaume Melquiond.
7268 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
7270 * NEWS: Clarify symbols versus types in unused-value warnings.
7272 * configure.ac (AC_INIT): Bump version number.
7274 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
7276 * NEWS: Version 2.1a.
7277 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
7278 since C99 requires this.
7280 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
7282 * m4/c-working.m4: New file.
7283 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
7285 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
7287 * Makefile.maint: Merge from coreutils.
7289 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
7291 More portability fixes for problems summarized by Nelson H. F. Beebe.
7293 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
7294 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
7295 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
7296 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
7297 messes up because C++ code is compiled in 32-bit mode but linked
7300 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
7302 More portability fixes for problems summarized by Nelson H. F. Beebe.
7304 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
7305 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
7307 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
7308 nodist_PROGRAMS, since we don't need to actually compile the
7309 example if we're just doing a plain 'make'. This avoids bothering
7310 the installer unnecessarily about problems due to weird C++
7313 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
7315 More portability fixes for problems summarized by Nelson H. F. Beebe.
7317 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
7318 than #include "...", and compile with -I'.'. The old method was
7319 not portable, according to Posix and the C standard, and it does
7320 not work with Sun C 5.7, where previous #line directives affect
7321 the working directory used in later #include "..." directives.
7323 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7325 Various DJGGP specific issues in /djgpp
7327 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
7329 More portability fixes for problems summarized by Nelson H. F. Beebe.
7331 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
7332 '#include <map>' works and that you can apply ++ to iterators.
7334 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
7336 Work around portability problems summarized by Nelson H. F. Beebe in
7337 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
7339 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
7340 that '#include <string>' works.
7342 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
7343 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
7344 "warning: sorry: semantics of inline function static data `const
7345 unsigned char translate_table[262]' are wrong (you'll wind up with
7348 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
7349 or, xor to not_, and_, or_, and xor_, respectively. This works
7350 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
7351 random system header somewhere that includes the equivalent of
7354 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
7355 -E" works; it apparently doesn't work with PathScale EKO Compiler
7358 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
7360 During deterministic GLR operation, user actions should be able to
7361 influence the parse by changing yychar. To make this easier to fix and
7362 to make glr.c easier to evolve in general, don't maintain yytoken in
7363 parallel with yychar; just compute yytoken when needed.
7364 * tests/glr-regression.at (Incorrect lookahead during deterministic
7365 GLR): Check that setting yychar in a user action has the intended
7367 * data/glr.c (yyGLRStack): Remove yytokenp member.
7368 (yyclearin): Don't set *yytokenp.
7369 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
7370 yychar rather than *yytokenp to determine the current lookahead.
7371 Compute yytoken locally when needed.
7372 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
7375 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
7376 after `--report' documentation.
7378 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
7380 * src/parse-gram.y (grammar_declaration): Location of printer
7381 symbol is @1, not list->location. Bug reported by twlevo.
7382 * tests/input.at (Incompatible Aliases): Adjust to above change.
7384 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
7386 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
7387 all the test at once. This makes the output easier to read in the
7390 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
7391 got from <http://bro-ids.org/download.html>. The bug is that
7392 when two actions appeared in succession, the second one was
7393 scanned before the first one was added to the grammar rule
7394 as a midrule action. Bison then output the incorrect warning
7395 "parse.y:905.17-906.36: warning: unused value: $3".
7396 * src/parse-gram.y (BRACED_CODE, action): These are no longer
7397 associated with a value.
7398 (rhs): Don't invoke grammar_current_rule_action_append.
7399 (action): Invoke it here instead.
7400 * src/reader.c (grammar_midrule_action): Now extern.
7401 (grammar_current_rule_action_append): Don't invoke
7402 grammar_midrule_action; that is now the scanner's job.
7403 * src/reader.h (last_string, last_braced_code_loc):
7404 (grammar_midrule_action): New decls.
7405 * src/scan-gram.l (last_string): Now extern, sigh.
7406 (last_braced_code_loc): New extern variable.
7407 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
7408 rule already has an action.
7409 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
7410 * tests/input.at (AT_CHECK_UNUSED_VALUES):
7411 Add some tests to check that the above changes fixed the bug.
7413 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
7415 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
7416 All used changed. Check whether the symbol has a destructor,
7417 not whether it is typed.
7418 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
7419 that the values are still reported as unused. All line numbers
7422 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
7424 Work around a bug in bro 0.8, which underparenthesizes its
7425 definition of YYLLOC_DEFAULT.
7426 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
7428 * data/lalr1.cc: Likewise.
7429 * data/yacc.cc: Likewise.
7431 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
7433 Work around a bug in Pike 7.0, and give the Pike folks a
7434 better way to override the usual int widths.
7435 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
7436 user can override the types.
7437 (short): #undef, to work around a bug in Pike 7.0.
7438 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
7439 (union yyalloc.yyss): Use yytype_int16 rather than short.
7441 (yysigned_char): Remove.
7442 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
7443 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
7444 * tests/regression.at (Web2c Actions): Adjust to above changes.
7446 * src/reader.c (check_and_convert_grammar): New function.
7447 (reader): Close the input file even if something went wrong during
7448 parsing. Minor file descriptor leak reported by twlevo.
7450 * src/assoc.c (assoc_to_string): Use a default: abort (); case
7451 to pacify gcc -Wswitch-default.
7452 * src/scan-gram.l (adjust_location): Use a default: break; case
7453 to pacify gcc -Wswitch-default.
7454 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
7455 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
7456 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
7457 Move these decls to scan-skel.l, since they don't need to be
7459 * src/scan-skel.l: Accept the above decls.
7460 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
7463 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
7465 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
7466 since we don't want to insist on a version number at the start
7467 of the changelog every time.
7468 * Makefile.maint: Sync from coreutils a bit better.
7469 (sc_trailing_blank): Renamed from sc_trailing_space.
7471 (sc_no_if_have_config_h, sc_require_config_h):
7472 (sc_prohibit_assert_without_use): New rules.
7473 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
7474 (sc_dd_max_sym_length): Fix leading spaces in rule.
7475 (sc_system_h_headers): Prefix with @.
7476 (sc_useless_cpp_parens, m4-check): Output line numbers.
7477 (changelog-check): Allow version only in head.
7478 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
7479 satisfy new Makefile.maint rule.
7480 * data/glr.c: Likewise.
7481 * data/glr.cc: Likewise.
7482 * data/lalr1.cc: Likewise.
7483 * data/yacc.c: Likewise.
7484 * lib/ebitsetv.c: Likewise.
7485 * lib/lbitset.c: Likewise.
7486 * lib/subpipe.c: Likewise.
7487 * lib/timevar.c: Likewise.
7488 * src/system.h: Likewise.
7489 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
7490 * djgpp/Makefile.maint: Add copyright notice.
7491 * djgpp/README.in: Likewise.
7492 * djgpp/config.bat: Likewise.
7493 * djgpp/config.site: Likewise.
7494 * djgpp/config_h.sed: Likewise.
7495 * djgpp/djunpack.bat: Likewise.
7496 * djgpp/config.sed: Fix copyright notice to match standard format.
7497 * djgpp/subpipe.h: Likewise.
7498 * lib/bitsetv-print.c: Likewise.
7499 * lib/bitsetv.c: Likewise.
7500 * lib/subpipe.h: Likewise.
7501 * lib/timevar.c: Likewise.
7502 * lib/timevar.h: Likewise.
7503 * djgpp/subpipe.c: Use standard recipe for config.h.
7504 * lib/abitset.c: Likewise.
7505 * lib/bitset.c: Likewise.
7506 * lib/bitset_stats.c: Likewise.
7507 * lib/bitsetv-print.c: Likewise.
7508 * lib/bitsetv.c: Likewise.
7509 * lib/ebitsetv.c: Likewise.
7510 * lib/get-errno.c: Likewise.
7511 * lib/lbitset.c: Likewise.
7512 * lib/subpipe.c: Likewise.
7513 * lib/timevar.c: Likewise.
7514 * lib/vbitset.c: Likewise.
7515 * tests/local.at: Likewise.
7516 * src/scan-gram.l: Don't include verify.h, since system.h does
7518 * .x-sc_require_config_h: New file.
7519 * .x-sc_unmarked_diagnostics: New file.
7521 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
7523 Be a bit more systematic about using 'abort'.
7524 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
7525 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
7526 Put 'default: abort ();' before some other case, to satisfy older
7528 * lib/bitset_stats.c (bitset_stats_init): Likewise.
7529 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
7530 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
7531 * src/conflicts.c (resolve_sr_conflict): Likewise.
7532 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
7533 (get_decision_str, get_orientation_str, get_node_alignment_str):
7534 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
7535 (get_linestyle_str, get_arrowstyle_str): Likewise.
7536 * src/conflicts.c (resolve_sr_conflict):
7537 Use a default case rather than one for the one remaining enum
7538 value, to catch invalid enum values as well.
7539 * src/lalr.c (set_goto_map, map_goto):
7540 Prefer "assert (FOO);" to "if (!FOO) abort ();".
7541 * src/nullable.c (nullable_compute, token_definitions_output):
7543 * src/reader.c (packgram, reader): Likewise.
7544 * src/state.c (transitions_to, state_new, state_reduction_find):
7546 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
7547 (symbol_pack): Likewise.
7548 * src/tables.c (conflict_row, pack_vector): Likewise.
7549 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
7550 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
7551 * src/system.h: Don't include <assert.h>.
7552 (assert): New macro.
7554 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
7555 (Destructor Decl, Parser Function, Pure Calling):
7556 Describe rules for braces inside C code more carefully.
7558 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
7560 Fix some porting glitches found by Nelson H. F. Beebe.
7561 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
7562 compilers that don't understand that abort () does not return.
7563 * src/state.c (transitions_to): Likewise.
7564 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
7565 that '#include <cstdlib>' works.
7566 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
7567 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
7568 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
7569 for the benefit of some pre-C99 compilers.
7571 * bootstrap: Undo changes to gnulib files that autoreconf made.
7573 Minor fixups to get 'make maintainer-check' to work.
7574 * configure.ac: Don't use -Wnested-externs, as it's incompatible
7575 with the new verify.h implementation.
7576 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
7577 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
7578 * data/yacc.c (YYUSE): Likewise.
7579 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
7580 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
7581 * src/parse-gram.y (declaration): Don't pass a string constant
7582 to a function that expects char *, since GCC might complain
7583 about the constant value.
7584 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
7585 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
7586 before #defining them.
7587 * tests/glr-regression.at
7588 (Incorrectly initialized location for empty right-hand side in GLR):
7589 In yyerror, use the msg arg.
7590 (Corrupted semantic options if user action cuts parse):
7591 (Incorrect lookahead during deterministic GLR):
7592 (Incorrect lookahead during nondeterministic GLR):
7593 Don't name a local var 'index'; it shadows string.h's 'index'.
7595 2006-01-19 Akim Demaille <akim@epita.fr>
7597 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
7598 location, not just parts of it.
7600 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
7602 * NEWS: Document the fact that multiple %unions are now allowed.
7603 * doc/bison.texinfo (Union Decl): Likewise.
7604 * TODO: This feature is now implemented, so remove it from
7607 * Makefile.maint: Merge with coreutils Makefile.maint.
7608 (CVS_LIST): Use build-aux version if available.
7609 (VERSION_REGEXP): New macro.
7610 (syntax-check-rules): Add sc_no_if_have_config_h,
7611 sc_prohibit_assert_without_use, sc_require_config_h,
7612 sc_useless_cpp_parens.
7613 (sc_obsolete_symbols): Check for O_NDELAY.
7614 (sc_dd_max_sym_length): Track coreutils.
7615 (sc_unmarked_diagnostics): Look in all files, not just *.c.
7616 (sc_useless_cpp_parens): New rule.
7617 (news-date-check): Look for version or today's date.
7618 (changelog-check): Don't require version number near head.
7619 (copyright-check): Use current year instead of hardwiring 2005.
7620 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
7621 (announcement): Add --gpg-key-ID.
7623 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
7626 Avoid undefined behavior that addressed just before the start of an
7627 array. Problem reported by twlevo.
7628 * src/reader.c (packgram): Prepend a new sentinel before ritem.
7629 * src/lalr.c (build_relations): Rely on new sentinel.
7630 * src/gram.c (gram_free): Adjust to new sentinel.
7632 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
7634 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
7635 yylookaheadNeeds. All uses updated.
7636 (yysplitStack): Rename local yynewLookaheadStatuses to
7637 yynewLookaheadNeeds.
7638 * data/glr-regression.at (Incorrect lookahead during nondeterministic
7639 GLR): In comments, change `lookahead status' to `lookahead need'.
7641 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7643 * data/glr.c (yysplitStack): A little stylistic rewrite.
7645 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7647 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
7649 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
7651 * doc/bison.texinfo: Fix some typos.
7652 (GLR Semantic Actions): New subsection discussing special
7653 considerations because GLR semantic actions might be deferred.
7654 (Actions): Mention look-ahead usage of yylval.
7655 (Actions and Locations): Mention look-ahead usage of yylloc.
7656 (Special Features for Use in Actions): Add YYEOF entry and mention it
7657 in the yychar entry.
7658 In the yychar entry, remove mention of the local yychar case (pure
7659 parser) since this is irrelevant information when writing semantic
7660 actions and since it's already discussed in `Table of Symbols' where
7661 yychar is otherwise described as an external variable.
7662 In the yychar entry, don't call it the `current' look-ahead since it
7663 isn't when semantic actions are deferred.
7664 In the yychar and yyclearin entries, add note about deferred semantic
7666 Add yylloc and yylval entries discussing look-ahead usage.
7667 (Look-Ahead Tokens): When discussing yychar, don't call it the
7668 `current' look-ahead, and do mention yylval and yylloc.
7669 (Error Recovery): Cross-reference `Action Features' when mentioning
7671 (Table of Symbols): In the yychar entry, don't call it the `current'
7673 In the yylloc and yylval entries, mention look-ahead usage.
7675 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7677 * tests/glr-regression.at: Update copyright year to 2006.
7679 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7681 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
7682 use during nondeterministic operation to track which stacks have
7683 actually needed the current lookahead.
7684 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
7685 Allocate, deallocate, resize, and otherwise shuffle space for
7686 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
7687 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
7688 appropriately during nondeterministic operation.
7689 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
7690 members to store the current lookahead to be used by the deferred
7692 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
7693 from which the RHS is taken. Set the lookahead members of the new
7694 yySemanticOption according to the lookahead status for stack yyk.
7695 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
7696 yyaddDeferredAction.
7697 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
7698 members of yySemanticOption before invoking yyuserAction, and then set
7699 them back to their current values afterward.
7700 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
7701 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
7702 * tests/glr-regression.at: Remove `.' from the ends of recent test case
7703 titles for consistency.
7704 (Leaked merged semantic value if user action cuts parse): In order to
7705 suppress lint warnings, use arguments in merge function, and assign
7706 char value < 128 in main.
7707 (Incorrect lookahead during deterministic GLR): New test case.
7708 (Incorrect lookahead during nondeterministic GLR): New test case.
7710 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7712 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
7713 !yyvaluep as signal that no semantic value is available to print.
7714 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
7715 to print a semantic value.
7717 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7719 * tests/glr-regression.at: For consistency with my newer test cases,
7722 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
7724 * data/glr.c (yyresolveValue): When merging semantic options, if at
7725 least one user action succeeds but a later one cuts the parse, then
7726 destroy the semantic value before returning rather than leaking it.
7727 (yyresolveStates): If a user action cuts the parse and thus
7728 yyresolveValue fails, ignore the (unset) semantic value rather than
7729 corrupting the yyGLRState, and empty the semantic options list since
7730 the user actions should have called all necessary destructors.
7731 Simplify code with YYCHK.
7732 * tests/glr-regression.at (Corrupted semantic options if user action
7733 cuts parse): New test case.
7734 (Undesirable destructors if user action cuts parse): New test case.
7735 Before applying any of this patch, this test case never actually failed
7736 for me... but only because the corrupted semantic options usually
7738 (Leaked merged semantic value if user action cuts parse): New test
7741 2006-01-05 Akim Demaille <akim@epita.fr>
7743 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
7745 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
7747 * data/c.m4 (b4_c_modern): New macro, with a new provision for
7748 _MSC_VER. Problem reported by Cenzato Marco.
7749 (b4_c_function_def): Use it.
7750 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
7752 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
7753 than rolling our own.
7755 2006-01-04 Akim Demaille <akim@epita.fr>
7757 Also warn about non-used mid-rule values.
7758 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
7760 (symbol_list_new): Adjust.
7761 * src/reader.c (symbol_typed_p): New.
7762 (grammar_rule_check): Use it.
7763 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
7765 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
7767 * tests/actions.at (Exotic Dollars): Adjust.
7769 2006-01-04 Akim Demaille <akim@epita.fr>
7771 * src/reader.c (grammar_midrule_action): If $$ is set in a
7772 mid-rule, move the `used' bit to its lhs.
7773 * tests/input.at (Unused values): New.
7774 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
7776 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
7778 * doc/bison.texinfo (Bison Options): Say more accurately what
7780 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
7781 about declarations in the grammar when in Yacc mode, as POSIX does
7782 not require a diagnostic when the grammar uses extensions.
7784 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
7786 Warn about dubious constructions like "%token T T".
7788 * src/symtab.h (struct symbol.declared): New member.
7789 * src/symtab.c (symbol_new): Initialize it to false.
7790 (symbol_class_set): New arg DECLARING, specifying whether
7791 this is a declaration that we want to warn about, if there
7792 is more than one of them. All uses changed.
7794 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
7795 Allow multiple %union directives, whose contents concatenate.
7796 * src/parse-gram.y (grammar_declaration): Likewise.
7797 Use muscle_code_grow, so that we don't need stype_line any more.
7800 * src/muscle_tab.c (muscle_grow): Fix comment.
7802 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
7803 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
7804 Update copyright year to 2006.
7806 2006-01-03 Akim Demaille <akim@epita.fr>
7808 Have glr.cc pass (some of) the calc.at tests.
7809 * data/glr.cc (b4_parse_param_orig): New.
7810 (b4_parse_param): Improve its definition, and bound it more
7811 clearly in the skeleton.
7812 (b4_epilogue): Append, instead of prepending, in order to keep
7814 Simplify the generation of auxiliary functions: locations and
7815 purity are mandated.
7816 (b4_global_tokens_and_yystype): Honor it.
7817 * data/location.cc (c++.m4): Don't include it.
7818 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
7820 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
7822 Be sure to initialize the first position's filename.
7823 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
7825 (AT_CHECK_CALC_GLR_CC): New.
7826 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
7828 2006-01-02 Akim Demaille <akim@epita.fr>
7830 * src/output.c (output_skeleton): Don't hard wire the inclusion of
7832 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
7833 * data/glr.cc: Do not include stack.hh.
7835 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7837 * data/glr.c: Reformat whitespace with tabs.
7838 (b4_lpure_formals): Remove this unused m4 macro.
7839 * tests/cxx-type.at: Reformat whitespace with tabs.
7840 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
7841 since it's a member. Rename type to isNterm for clarity.
7843 2005-12-29 Akim <akim@sulaco.local>
7845 Let glr.cc catch up with symbol_value_print.
7846 * data/glr.cc (b4_yysymprint_generate): Replace by...
7847 (b4_yy_symbol_print_generate): this.
7848 (yy_symbol_print, yy_symbol_value_print): Declare them.
7850 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
7852 * src/location.h (boundary): Note that a line or column equal
7853 to INT_MAX indicates an overflow.
7854 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
7855 (rule_length_overflow, increment_rule_length, add_column_width):
7857 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
7858 (<SC_BRACED_CODE>"}"):
7859 Use increment_rule_length rather than incrementing it by hand.
7860 (adjust_location, handle_syncline): Diagnose overflow.
7861 (handle_action_dollar, handle_action_at):
7862 Fix bug with monstrosities like $-2147483648.
7863 Remove now-unnecessary checks.
7864 (scan_integer): Verify assumptions and remove now-unnecessary checks.
7865 (convert_ucn_to_byte): Verify assumptions.
7866 (handle_syncline): New arg LOC. All callers changed.
7867 Don't store through a value derived from char const * pointer.
7869 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
7872 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
7874 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
7875 Remove unnecessary forward static decls.
7877 2005-12-27 Akim Demaille <akim@epita.fr>
7879 * src/reader.c (grammar_current_rule_check): Also check that $$
7881 Take the rule to check as argument, hence rename as...
7882 (grammar_rule_check): this.
7883 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
7885 (grammar_rule_begin, grammar_rule_end): these, for consistency.
7886 (grammar_midrule_action, grammar_symbol_append): Now static.
7887 * tests/torture.at (input): Don't rely on the default action
7888 being always performed.
7889 * tests/calc.at: "Set" $$ even when the action is "cut" with
7891 * tests/actions.at (Exotic Dollars): Instead of using unused
7892 values, check that the warning is issued.
7894 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
7896 * NEWS: Improve wording for unused-value warnings.
7898 2005-12-22 Akim Demaille <akim@epita.fr>
7900 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
7901 (b4_yysymprint_generate): Rename as...
7902 (b4_yy_symbol_print_generate): this.
7903 Generate yy_symbol_print instead of yysymprint.
7904 Generate also yy_symbol_value_print, and use it.
7906 2005-12-22 Akim Demaille <akim@epita.fr>
7908 * NEWS: Warn about unused values.
7909 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
7911 (symbol_list_n_get, symbol_list_n_used_set): New.
7912 (symbol_list_n_type_name_get): Use symbol_list_n_get.
7913 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
7914 * src/reader.c (grammar_current_rule_check): Check that values are
7916 * src/symtab.c (symbol_print): Accept 0.
7917 * tests/existing.at: Remove the type information.
7919 Remove useless actions (beware of mid-rule actions: perl -000
7920 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
7921 * tests/actions.at (Exotic Dollars): Use unused values.
7922 * tests/calc.at: Likewise.
7923 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7926 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
7929 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
7931 Undo 2005-12-01 tentative license wording change. The wording is
7932 still being reviewed by the lawyers, and we don't want to wait for
7933 them before publishing a test release. For now, revert to the
7935 * NEWS: Undo 2005-12-01 change.
7936 * data/glr.c: Revert to previous license wording.
7937 * data/glr.cc: Likewise.
7938 * data/lalr1.cc: Likewise.
7939 * data/location.cc: Likewise.
7940 * data/yacc.c: Likewise.
7942 * NEWS: Reword %destructor vs YYABORT etc.
7943 * data/glr.c: Use American spacing, for consistency.
7944 * data/glr.cc: Likewise.
7945 * data/lalr1.cc: Likewise.
7946 * data/yacc.c: Likewise.
7947 * data/yacc.c: Reformat comments slightly.
7948 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
7949 for consistency. Fix some spelling errors and reword recently-included
7951 * tests/cxx-type.at: Cast results of malloc, for C++.
7953 2005-12-21 Joel E. Denny <address@hidden>
7955 * tests/cxx-type.at: Construct a tree, count the parents of shared
7956 nodes, and free each node once and only once. Previously, the memory
7957 for semantic values was leaked instead.
7959 2005-12-21 Joel E. Denny <address@hidden>
7961 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
7962 (yylval, yylloc): If pure, #define to yystackp->yyval and
7963 yystackp->yyloc similar to yychar and yynerrs.
7964 (yyparse): If pure, remove local yylval and yylloc. Add local
7965 yystackp to accommodate pure definitions of yylval and yylloc.
7966 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
7967 yylvalp and yyllocp to &yylval and &yylloc.
7968 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
7969 namespace. Previously, nerrs and char were missing, but lval and lloc
7971 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
7972 yylvalp and yyllocp parameters since, if pure, these are now always
7973 accessible through yystackp. If not pure, they are still accessible
7975 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
7976 `if (YYID (N))' to pacify lint.
7978 2005-12-21 Akim Demaille <akim@epita.fr>
7980 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
7981 destroy the RHS symbols of a rule.
7982 * data/yacc.c (yylen): Initialize to 0.
7983 Keep its value to the number of items to possibly shift.
7984 In particular, a regular successful parse that ends on YYFINAL by
7985 a (internal) YYACCEPT must not have yylen != 0.
7986 (yyerrorlab, yyreturn): Pop the RHS.
7987 Reorder a bit to emphasize the `shifting' bits of code.
7988 (YYPOPSTACK): Now accept a number of items to pop.
7989 * data/lalr1.cc: Likewise.
7990 * data/glr.c: Formatting changes.
7991 Use goto instead of fall through.
7992 * doc/bison.texinfo (Destructor Decl): Complete.
7994 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7996 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7997 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
7998 * djgpp/config.bat: Replace every occurence of the file name
7999 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
8000 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
8001 * djgpp/config.sed: Replace every occurence of the file name
8002 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
8003 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
8004 * djgpp/djunpack.bat: DJGPP specific file.
8005 * djgpp/fnchange.lst: DJGPP specific file.
8006 * djgpp/README.in: Add new information about how to unpack the bison
8007 source on MSDOS and other systems which have 8.3 file name restrictions
8008 using djunpack.bat and fnchange.lst.
8010 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
8012 * bootstrap (build_cvs_prefix): Remove; unused.
8013 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
8014 when getting gnulib.
8016 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
8018 * data/glr.c: Reorder typedef declarations for structs to match order
8019 of struct declarations.
8020 Rename yystack everywhere to yystackp except in yyparse where it's not
8022 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
8024 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
8025 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
8026 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
8029 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
8031 * tests/sets.at (Accept): Fix typos in regular expression used to
8032 sed out the final state number.
8034 Work around portability problem on Solaris 10: flex-generated
8035 files include <stdio.h> before <config.h>, which messes up
8036 because the latter defines __EXTENSIONS__. Address the problem
8037 by creating two new little files that include <config.h> first,
8038 then include the flex-generated files. Rewrite everyone else
8039 to include <config.h> first, as well.
8040 * lib/timevar.c: Always include "config.h".
8041 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
8042 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
8043 (EXTRA_bison_SOURCES): New macro.
8044 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
8045 * src/system.h: Don't include config.h.
8046 * src/LR0.c: Include <config.h> first.
8047 * src/assoc.c: Likewise.
8048 * src/closure.c: Likewise.
8049 * src/complain.c: Likewise.
8050 * src/conflicts.c: Likewise.
8051 * src/derives.c: Likewise.
8052 * src/files.c: Likewise.
8053 * src/getargs.c: Likewise.
8054 * src/gram.c: Likewise.
8055 * src/lalr.c: Likewise.
8056 * src/location.c: Likewise.
8057 * src/main.c: Likewise.
8058 * src/muscle_tab.c: Likewise.
8059 * src/nullable.c: Likewise.
8060 * src/output.c: Likewise.
8061 * src/parse-gram.y: Likewise.
8062 * src/print.c: Likewise.
8063 * src/print_graph.c: Likewise.
8064 * src/reader.c: Likewise.
8065 * src/reduce.c: Likewise.
8066 * src/relation.c: Likewise.
8067 * src/state.c: Likewise.
8068 * src/symlist.c: Likewise.
8069 * src/symtab.c: Likewise.
8070 * src/tables.c: Likewise.
8071 * src/uniqstr.c: Likewise.
8072 * src/vcg.c: Likewise.
8074 * src/parse-gram.y: Fix minor problems uncovered by lint.
8075 (current_lhs, current_lhs_location): Now static.
8076 (current_assoc): Remove unused variable.
8078 Cleanups so that Bison-generated parsers have less lint.
8079 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
8080 Prepend /*ARGSUSED*/, for lint's sake.
8081 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
8082 definition if 'lint' is defined.
8083 (YYID): New macro (or function, if lint).
8084 All uses of /*CONSTCOND*/0 replaced by YYID(0).
8085 * data/yacc.c: Likewise.
8086 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
8087 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
8088 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
8090 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
8091 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
8092 Use YYID(0) rather than 0, for lint.
8093 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
8094 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
8096 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
8098 * tests/glr-regression.at
8099 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8100 Close memory leak reported by twlevo.
8102 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
8104 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
8106 (yyparse): Iterate another stack in order to call user destructors.
8107 * tests/glr-regression.at (No users destructors if stack 0 deleted):
8109 (Duplicated user destructor for lookahead): This test now is expected
8112 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
8114 * NEWS: Document the following change.
8115 * data/yacc.c: Say "parser skeleton" rather than "file", since
8116 it's no longer just a file.
8117 * data/glr.c: Grant a special exception for C GLR parsers, that
8118 reads like the already-existing exception for C LALR(1) parsers.
8119 * data/glr.cc: Likewise.
8120 * data/lalr1.cc: Likewise.
8121 * data/location.cc: Likewise.
8122 * data/yacc.c: Reword the "written by" statement to clarify that
8123 it was the parser skeleton, not the entire output file.
8124 * data/glr.c: Written by Paul Hilfinger.
8125 * data/glr.cc: Written by Akim Demaille.
8126 * data/lalr1.cc: Likewise.
8128 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
8130 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
8131 Fix typos in previous change that broke 'make check'.
8132 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
8134 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
8135 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
8136 We can revert this once things settle down.
8138 * src/conflicts.c (conflicts_print): Don't print file name twice
8139 when %expect fails because there were no conflicts.
8140 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
8142 * tests/conflicts.at (%expect not enough, %expect too much):
8143 (%expect with reduce conflicts): Adjust to new behavior.
8145 2005-11-18 Akim Demaille <akim@epita.fr>
8147 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
8149 * NEWS: Document this.
8150 * doc/bison.texinfo (Expect Decl): Likewise.
8152 2005-11-16 Akim Demaille <akim@epita.fr>
8154 Generalize the display of semantic values and locations in traces.
8155 * data/glr.c (yy_reduce_print): Fix indices (again).
8156 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
8158 * data/lalr1.cc (yyreduce_print): Rename as...
8159 (yy_reduce_print): this.
8160 Display values and locations.
8161 * data/yacc.c (yy_reduce_print): Likewise.
8162 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
8163 (yysymprint): Move higher to be visible from yy_reduce_print).
8165 * tests/calc.at: Adjust the expected length of the traces.
8167 2005-11-14 Akim Demaille <akim@epita.fr>
8169 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
8170 from 1 to N, while values and location start at 0.
8171 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
8173 2005-11-14 Akim Demaille <akim@epita.fr>
8175 * data/glr.c (yy_reduce_print): Fix the $ number.
8177 2005-11-14 Akim Demaille <akim@epita.fr>
8179 "Use" parse parameters.
8180 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
8181 * data/glr.c, data/glr.cc: Use them.
8182 * data/glr.c (YYUSE): Have a C++ definition that supports
8185 2005-11-14 Akim Demaille <akim@epita.fr>
8187 * data/glr.c (yyexpandGLRStack): Declare only if defined.
8189 2005-11-14 Akim Demaille <akim@epita.fr>
8192 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
8194 2005-11-12 Akim Demaille <akim@epita.fr>
8196 Let position and location be PODs.
8197 * data/location.cc (position::initialize, location::initialize): New.
8198 (position::position, location::location): Define only if
8199 b4_location_constructors is defined.
8200 * data/lalr1.cc (b4_location_constructors): Define it for backward
8202 * doc/bison.texinfo (Initial Action Decl): Use initialize.
8204 2005-11-12 Akim Demaille <akim@epita.fr>
8206 * data/lalr1.cc: Move the body of the ctor and dtor into the
8207 parser file (instead of the header).
8208 Wrap the implementations in a "namespace yy".
8210 2005-11-12 Akim Demaille <akim@epita.fr>
8212 Have glr.c include its header file when created.
8213 * data/glr.c (b4_shared_declarations): New.
8214 Output them verbatim in the parser if !%defines, otherwise
8215 output then in the header file, and include it instead.
8217 2005-11-11 Akim Demaille <akim@epita.fr>
8219 * data/glr.c: Comment changes.
8221 2005-11-11 Akim Demaille <akim@epita.fr>
8223 When yydebug, report semantic and location values for reductions.
8224 * data/glr.c (yy_reduce_print): Report the semantic values and the
8226 (YY_REDUCE_PRINT): Adjust.
8227 (yyglrReduce): Use them.
8228 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
8229 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
8230 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
8233 2005-11-10 Akim Demaille <akim@epita.fr>
8235 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
8236 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
8237 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
8239 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
8241 * m4/cxx.m4, examples/Makefile.am: Don't build
8242 examples/calc++ if no C++ compiler is available. (trivial change)
8244 2005-11-09 Akim Demaille <akim@epita.fr>
8246 * src/scan-skel.l: Use a couple of asserts.
8248 2005-11-03 Akim Demaille <akim@epita.fr>
8250 In some (weird) cases, the final state number is incorrect.
8251 Reported by Alexandre Duret-Lutz.
8252 * src/LR0.c (state_list_append): Remove the computation of
8254 (save_reductions): Do it here.
8255 (get_state): Alpha conversion.
8256 (generate_states): Use a for loop.
8257 * src/gram.h (item_number_is_rule_number)
8258 (item_number_is_symbol_number): New.
8259 * src/state.c: Use assert.
8260 * src/system.h: Include assert.h.
8261 * tests/sets.at (Accept): New.
8263 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8265 * data/glr.c (yyfill): Adjust comment.
8266 (yyresolveAction): Initialize default location properly
8267 for empty right-hand sides.
8268 (yydoAction): Ditto.
8269 Add comment explaining apparently dead code.
8270 * tests/glr-regression.at
8271 (Incorrectly initialized location for empty right-hand side in GLR):
8274 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
8276 * bootstrap (cleanup_gnulib): New function. Use it to clean up
8277 gnulib when interrupted. This fixes some race conditions and
8278 works around some portability problems (one noted by Paul
8281 2005-10-22 Akim <akim@epita.fr>
8283 * Makefile.cfg: Adjust to config -> build-aux.
8286 2005-10-21 Akim Demaille <akim@epita.fr>
8288 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
8290 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
8291 * data/yacc.c (b4_Pure_if): Rename as...
8292 (b4_yacc_pure_if): this.
8293 (YY_SYMBOL_PRINT, yyparse): Adjust.
8294 * doc/bison.texinfo: Formatting changes.
8296 2005-10-21 Akim Demaille <akim@epita.fr>
8298 Finish the transition config -> build-aux.
8299 * configure.ac, Makefile.am: Use build-aux.
8300 * config/prev-version, config/announce-gen, config/Makefile.am:
8302 * build-aux/prev-version, build-aux/announce-gen,
8303 * build-aux/Makefile.am: here.
8305 2005-10-14 Akim Demaille <akim@epita.fr>
8307 * examples/calc++/test: Use set -x only when VERBOSE.
8309 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
8311 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
8312 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
8314 2005-10-13 Akim Demaille <akim@epita.fr>
8316 * src/scan-skel.l: Output the base name parts of the parser and
8318 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
8320 Use this to exercise C++ outputs in subdirs.
8321 Reported by Oleg Smolsky.
8323 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
8325 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
8326 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
8327 Problem reported by John P. Hartmann.
8328 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
8331 2005-10-12 Akim Demaille <akim@epita.fr>
8333 * src/parse-gram.y (version_check): Exit 63 to please missing
8334 (stands for "version mismatch).
8335 * tests/input.at, doc/bison.texinfo: Adjust.
8337 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
8339 Work around portability problems with Visual Age C compiler
8340 (xlc and xlC_r) reported by John P. Hartmann.
8341 * data/location.cc (initial_column, initial_line): Remove.
8342 All uses replaced by 0 and 1.
8343 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
8344 that xlc complains about.
8345 * src/scan-skel.l (skel_wrap): Likewise.
8346 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
8348 * data/yacc.c (YYMODERN_C): New macro, which also looks at
8349 __STDC_VERSION__. Use it everywhere instead of looking at
8350 __STDC__ and __cplusplus.
8352 2005-10-10 Akim Demaille <akim@epita.fr>
8354 * examples/calc++/test: Be quiet unless VERBOSE.
8356 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
8358 * data/c.m4 (yydestruct, yysymprint):
8359 Use YYUSE instead of casting to void.
8360 * data/glr.c (YYUSE): New macro.
8361 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
8362 Use it instead of rolling our own.
8363 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
8365 Use /*CONSTCOND*/ to suppress lint warnings.
8366 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
8367 (YY_STACK_PRINT): Use 'false' not '0'.
8369 (yysymprint_, yydestruct_): Use it instead of rolling our own.
8370 * data/yacc.c (YYUSE): New macro.
8371 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
8372 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
8373 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
8376 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
8377 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
8379 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
8381 Undo the parts of the unlocked-I/O change that substituted
8382 putc or puts for printf. This might hurt performance a bit,
8383 but some people prefer the printf style.
8384 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
8385 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
8386 All uses replaced by YYFPRINTF and YYDPRINTF.
8387 * data/yacc.c: Likewise.
8388 * lib/bitset.c (bitset_print): Likewise.
8389 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
8391 * lib/lbitset.c (debug_lbitset): Likewise.
8392 * src/closure.c (print_firsts, print_fderives): Likewise.
8393 * src/gram.c (grammar_dump): Likewise.
8394 * src/lalr.c (look_ahead_tokens_print): Likewise.
8395 * src/output.c (escaped_output): Likewise.
8396 (user_actions_output): Break apart two printfs.
8397 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
8398 * src/reduce.c (reduce_print): Likewise.
8399 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
8400 * src/system.h: Include unlocked-io.h rathe than stdio.h.
8402 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
8403 Use assignments rather than casts-to-void to suppress
8404 unused-variable warnings. This pacifies 'lint'.
8405 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
8406 unused-variable warnings.
8408 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8410 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
8412 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
8414 Use unlocked I/O for a minor performance improvement on hosts like
8415 GNU/Linux and Solaris that support unlocked I/O. The basic idea
8416 is to use the gnlib unlocked-io module, and to prefer putc and
8417 puts to printf when either will work (since the latter doesn't
8418 come in an unlocked flavor).
8419 * bootstrap (gnulib_modules): Add unlocked-io.
8420 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
8421 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
8422 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
8423 and similarly for puts and putc and printf.
8424 * data/yacc.c: Likewise.
8425 * lib/bitset.c (bitset_print): Likewise.
8426 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
8427 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
8429 * lib/lbitset.c (debug_lbitset): Likewise.
8430 * src/closure.c (print_firsts, print_fderives): Likewise.
8431 * src/gram.c (grammar_dump): Likewise.
8432 * src/lalr.c (look_ahead_tokens_print): Likewise.
8433 * src/output.c (escaped_output): Likewise.
8434 (user_actions_output): Coalesce two printfs.
8435 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
8436 * src/reduce.c (reduce_print): Likewise.
8437 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
8438 * src/system.h: Include unlocked-io.h rather than stdio.h.
8440 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
8441 this confuses xgettext.
8443 2005-10-02 Akim Demaille <akim@epita.fr>
8445 * bootstrap (gnulib_modules): Add strverscmp.
8446 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
8447 * m4/.cvsignore: Add strverscmp.m4.
8448 * src/parse-gram.y (%require): New token, new rule.
8449 (version_check): New.
8450 * src/scan-gram.l (%require): Adjust.
8451 * tests/input.at (AT_REQUIRE): New.
8453 * doc/bison.texinfo (Require Decl): New.
8454 (Calc++ Parser): Use %require.
8456 2005-10-02 Akim Demaille <akim@epita.fr>
8458 * data/location.cc: New.
8460 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
8461 Akim Demaille <akim@epita.fr>
8463 Make sure -odir/foo.cc creates dir/location.hh etc.
8464 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
8465 (spec_file_prefix, spec_verbose_file, spec_graph_file)
8466 (spec_defines_file): Now const.
8468 (short_base_name): Remove.
8469 * src/files.c: Adjust.
8470 (dirname.h): Include.
8471 (base_name): Don't prototype it.
8472 (finput): Remove, duplicates gram_in.
8473 (full_base_name, short_base_name): Replace by...
8474 (all_but_ext, all_but_tab_ext): these.
8475 (compute_base_names): Rename as...
8476 (compute_file_name_parts): this.
8477 Update to compute the new variables, including dir_prefix.
8478 Adjust dependencies.
8479 * src/output.c (prepare): Output them.
8480 * src/reader.c: Adjust to use gram_in, not finput.
8481 * src/scan-skel.l (@dir_prefix@): New.
8483 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8485 * lib/subpipe.c: New function end_of_output_subpipe() added
8486 to allow support for non-posix systems. This is a no-op function
8489 * lib/subpipe.h: New function end_of_output_subpipe() added
8490 to allow support for non-posix systems. This is a no-op function
8493 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
8494 handle the lack of pipe/fork functionality on non-posix systems.
8496 * djgpp/Makefile.maint: DJGPP specific file.
8498 * djgpp/README.in: DJGPP specific file.
8500 * djgpp/config.bat: DJGPP specific configuration file.
8502 * djgpp/config.sed: DJGPP specific configuration file.
8504 * djgpp/config.site: DJGPP specific configuration file.
8506 * djgpp/config_h.sed: DJGPP specific configuration file.
8508 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
8510 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
8512 2005-10-02 Akim Demaille <akim@epita.fr>
8514 * data/location.cc: New, extract from...
8515 * data/lalr1.cc: here.
8516 (location.hh): Include it after the user prologue, in case the
8517 filename type is defined by the user.
8518 Forward declation location and position before the pre-prologue.
8519 (yyresult_): Rename as...
8520 (yyresult): this, it's a local variable, not an attribute.
8521 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
8523 2005-10-01 Akim Demaille <akim@epita.fr>
8525 * examples/extexi: Restore the #line generation.
8527 2005-09-30 Akim Demaille <akim@epita.fr>,
8528 Alexandre Duret-Lutz <adl@gnu.org>
8530 Move the token type and YYSTYPE in the parser class.
8531 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
8532 (parser::token): New, from the moved free definition of tokens.
8533 (parser::semantic_value): Now a full definition instead of an
8534 indirection to YYSTYPE.
8535 (b4_post_prologue): No longer included in the header file, but
8536 in the implementation file.
8537 * doc/bison.texi (C+ Language Interface): Update.
8538 * src/parse-gram.y: Support unary %define.
8539 * tests/actions.at: Define global_tokens_and_yystype for backward
8540 compatibility until we update the tests.
8541 * tests/calc.at: Idem.
8542 (first_line, first_column, last_line, last_column): Define for lalr1.cc
8543 to simplify the code.
8545 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
8547 Port to SunOS 4.1.4, which lacks strtoul and strerror.
8548 Ah, the good old days! Problem reported by Peter Klein.
8549 * bootstrap (gnulib_modules): Add strerror, strtoul.
8550 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
8551 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
8553 2005-09-29 Akim Demaille <akim@epita.fr>
8555 * data/c.m4 (b4_error_verbose_if): New.
8556 * data/lalr1.cc: Use it.
8557 (YYERROR_VERBOSE_IF): Remove.
8558 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
8559 parser members, replaced by...
8560 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
8562 (yysyntax_error_): Takes the state number as argument.
8563 (yyreduce_print_): Use the argument yyrule, not the former
8566 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
8568 * bootstrap (gnulib_modules): Add verify.
8569 * lib/.cvsignore: Add verify.h.
8570 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
8571 * src/system.h (verify): Remove.
8572 Include verify.h instead.
8573 * src/tables.c (tables_generate): Use new API for 'verify'.
8575 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
8577 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
8578 local variables whose names begin with 'yy'.
8579 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8580 Trivial changes from Joel E. Denny.
8582 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
8584 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
8585 don't use alloca any more.
8587 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
8588 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
8589 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
8590 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
8591 to match yacc.c, to test more hosts.
8593 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
8595 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
8596 doesn't affect behavior.
8597 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
8599 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
8600 This works a bit better with glibc, if user code has already included
8602 * doc/bison.texinfo (Bison Parser): Document that users can't
8603 arbitrarily use malloc and free for other purposes. Document
8604 that <alloca.h> and <malloc.h> might be included.
8605 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
8606 user must declare alloca.
8608 * HACKING (release): Forwarn the Translation Project about
8611 2005-09-20 Akim Demaille <akim@epita.fr>
8613 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
8615 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
8617 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
8618 (YYSTACK_ALLOC_MAXIMUM): Use it.
8619 (yysyntax_error): New function.
8620 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
8621 multiple syntax errors are reported, and alloca is being used.
8622 Instead, reallocate buffers twice as big each time, so that
8623 we waste at most half the allocated memory. Start with a small
8624 (128-byte) buffer that will suffice in most cases anyway.
8625 Use yysyntax_error to do most of the work.
8627 * doc/bison.texinfo (Error Reporting, Table of Symbols):
8628 yynerrs is the number of errors reported, not the number of
8631 * tests/glr-regression.at (Duplicated user destructor for lookahead):
8632 Mark it as expected to fail.
8633 Cast result of malloc; problem reported by twlevo@xs4all.nl.
8634 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
8635 Don't start user-code symbols with "yy", to avoid name space problems.
8637 2005-09-19 Akim Demaille <akim@epita.fr>
8639 Remove the traits, failed experiment.
8640 It never proved useful, and anyway because of the current
8641 definition, it was not possible to have several specialization of
8642 this traits, making it useless.
8643 * data/lalr1.cc (yy:traits): Remove.
8644 Inline its definitions in the parser class.
8646 2005-09-19 Akim Demaille <akim@epita.fr>
8648 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
8649 least Mac OSX with a /usr/local install of gettext.
8651 2005-09-19 Akim Demaille <akim@epita.fr>
8653 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
8654 and yytoken for similarity with the other skeletons.
8656 2005-09-19 Akim Demaille <akim@epita.fr>
8658 * NEWS, configure.ac: update version number to 2.1a.
8660 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
8662 * NEWS: Version 2.1.
8664 * NEWS: Remove notice of yytname change, since it was never in an
8666 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
8668 * src/output.c (prepare): Likewise.
8669 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
8670 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
8671 is not defined. This is an awful hack, but it's enough for now.
8672 All callers changed.
8673 * tests/glr-regression-at (make_value): Args are const pointers now,
8674 to avoid GCC warning.
8675 (Duplicated user destructor for lookahead): New test. Currently
8676 skipped. It fails on my host but I'm not sure it'll always fail.
8678 2005-09-16 Akim Demaille <akim@epita.fr>
8680 * src/symtab.h (struct symbol): Declare the printer and destructor
8681 as const, to avoid accidental calls to free.
8682 (symbol_destructor_set, symbol_printer_set): Adjust.
8683 * src/symtab.c: Adjust.
8685 2005-09-16 Akim Demaille <akim@epita.fr>
8687 * data/c.m4 (b4_token_enums): New.
8688 (b4_token_defines): Rename as...
8689 (b4_token_enums_defines): this.
8690 (b4_token_defines): New, output only the #defines.
8691 * data/yacc.c, data/glr.c: Adjust.
8692 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
8693 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
8696 2005-09-16 Akim Demaille <akim@epita.fr>
8698 * data/lalr1.cc (yylex_): Remove, inline its code.
8699 (yyreport_syntax_error_): Remove, replaced by...
8700 (yysyntax_error_): this which returns a string and leaves to the
8701 caller the call to the users' error function.
8702 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
8703 Move from members of the parser object...
8704 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
8705 to local variables of the parse function.
8707 2005-09-16 Akim Demaille <akim@epita.fr>
8709 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
8710 since it's in Bison's name space.
8712 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
8714 * data/glr.c (yyresolveValue): Add default case to pacify
8715 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
8717 * NEWS: Document when yyparse started to return 2.
8718 * doc/bison.texinfo (Parser Function): Document when yyparse
8721 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
8722 (b4_filename_type): Renamed back from b4_file_name_type. All uses
8724 (class position): file_name -> filename (reverting). All uses changed.
8726 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
8728 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
8729 do anything if $@ exists. This reverts part of the 2005-07-07
8732 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
8734 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
8735 contains obsolete information and isn't worth distributing as a
8736 separate file anyway.
8737 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
8738 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
8739 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
8740 (yyparse): Abort if user code uses longjmp to throw an unexpected
8743 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
8745 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
8746 Suggested by twlevo@xs4all.nl.
8748 * data/glr.c (YYCHK1): Do not assume YYE is in range.
8749 This avoids a diagnostic from gcc -Wswitch-enum.
8750 Problem reported by twlevo@xs4all.nl.
8752 * doc/bison.texinfo: Don't use "filename", as per GNU coding
8753 standards. Use "file name" or "file" or "name", depending on
8755 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
8756 not to hack/foo.tab.c.
8757 (Calc++ Top Level): 2nd arg of main is not const.
8758 * data/glr.c: b4_filename -> b4_file_name.
8759 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
8761 (class position): filename -> file_name. All uses changed.
8762 * data/yacc.c: b4_filename -> b4_file_name.
8763 * lib/bitset.h: filename -> file_name in local vars.
8764 * lib/bitset_stats.c: Likewise.
8765 * src/files.c: Likewise.
8766 * src/scan-skel.l ("@output ".*\n): Likewise.
8767 * src/files.c (file_name_split): Renamed from filename_split.
8768 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
8770 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
8772 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
8773 to accommodate latest gnulib.
8775 * tests/glr-regression.at (Duplicate representation of merged trees):
8776 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
8778 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
8781 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
8783 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
8784 All uses changed. Invoke user destructor after an error during a
8785 split parse (trivial change from Joel E. Denny).
8787 * tests/glr-regression.at
8788 (User destructor after an error during a split parse): New test case.
8789 Problem reported by Joel E. Denny in:
8790 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
8792 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
8794 * README-cvs: Give URLs for recommended tools.
8795 Mention Gzip version problem, and bootstrapping issues.
8796 Remove troubleshooting section, as it's somewhat obsolete.
8798 * bootstrap (no_cache): New var, to accommodate different wget
8799 variants. Use it instead of '-C off'. Problem reported by
8802 * data/glr.c (yydestroyStackItem): New function.
8803 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
8804 debugging information. Problem reported by Joel E. Denny.
8806 2005-08-25 Akim Demaille <akim@epita.fr>
8808 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
8810 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
8812 * data/glr.c (yyrecoverSyntaxError, yyreturn):
8813 Don't invoke destructor on unresolved entries.
8814 * tests/glr-regression.at
8815 (User destructor for unresolved GLR semantic value): New test case.
8816 Problem reported by Joel E. Denny in:
8817 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
8819 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
8821 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
8823 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
8824 lib-prefix.m4, po.m4.
8826 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
8827 in yydestruct diagnostic, since it might not be an error.
8828 Problem reported by Joel Denny near end of
8829 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8830 * data/lalr1.cc (yyerturn): Likewise.
8831 * data/yacc.c (yyreturn): Likewise.
8832 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
8834 * src/files.c: Remove obsolete FIXME comment.
8836 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
8837 with the other templates, and to fix bogus run-on messages such
8838 as the one reported at the end of
8839 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8840 All callers changed to avoid the newline.
8841 (yyprocessOneStack): Output two lines rather than one, to accommodate
8842 the above change. This changes the debug output format slightly.
8844 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
8845 reported by Joel E. Denny in
8846 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
8848 * tests/glr-regression.at (Duplicate representation of merged trees):
8849 New test, from Joel E. Denny in:
8850 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
8851 * THANKS: Add Joel E. Denny.
8853 * configure.ac (AC_INIT): Bump to 2.0c.
8855 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
8857 * NEWS: Version 2.0b.
8859 * Makefile.am (SUBDIRS): Put examples before tests, so that
8860 "make check" doesn't finish with "All 1 tests passed".
8862 * tests/regression.at (Token definitions): Don't rely on
8863 AT_PARSER_CHECK for data that contains backslashes. It currently
8864 uses 'echo', and 'echo' isn't portable if its argument contains
8865 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
8866 that the byte '\0xff' is not printable in the C locale; it is,
8867 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
8868 not printable, so use '\0x81' to test.
8870 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
8871 version of GCC, since the macro is used with non-GCC compilers.
8873 Fix core dump reported by Pablo De Napoli in
8874 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
8875 * tests/regression.at (Invalid inputs with {}): New test.
8876 * src/parse-gram.y (token_name): Translate type before using
8879 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
8880 the user's name space. All uses changed to __attribute__
8882 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
8883 Add __attribute__ ((__noreturn__)).
8885 * etc/clcommit: Remove. We weren't using it, and it failed
8886 "make maintainer-distcheck".
8887 * Makefile.maint: Merge from coreutils.
8888 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
8889 (syntax-check-rules): Change list of rules as described below.
8890 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
8891 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
8892 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
8893 (sc_trailing_space): New rules.
8894 (sc_xalloc_h_in_src): Remove.
8895 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
8896 (sc_space_tab, sc_error_exit_success, sc_changelog):
8897 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
8898 (makefile-check, po-check, author_mark_check):
8899 (makefile_path_separator_check, copyright-check):
8900 Use grep -n, to make it easier to find violations.
8901 Use CVS_LIST and CVS_LIST_EXCEPT.
8902 (header_regexp, h_re): Remove.
8904 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
8905 (my-distcheck): Use more-modern GCC flags.
8906 (signatures, %.asc): Remove.
8907 (rel-files, announcement): Remove signatures.
8908 Restore old updating code, even though we don't use it, so
8909 that we're the same as coreutils.
8910 (alpha, beta, major): Depend on news-date-check.
8911 Make the upload commands.
8913 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
8914 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
8915 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
8916 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
8917 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
8918 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
8919 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
8920 * tests/sets.at: Likewise.
8922 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
8923 we comment out the Autoconf version number.
8924 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
8925 it's error-prone and "make maintainer-distcheck" rejects it.
8927 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
8928 Indent calls to "error" to pacify "make maintainer-distcheck",
8929 when the calls are not intended to be translated.
8930 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
8932 * src/Makefile.am (DEFS): Use +=, to pacify
8933 "make maintainer-distcheck".
8934 (bison_SOURCES): Add scan-skel.h.
8935 (sc_tight_scope): New rule, from coreutils.
8937 * src/files.c (src_extension, header_extension):
8938 Now static, not extern.
8939 * src/getargs.c (short_options): Likewise.
8940 * src/muscle_tab.c (muscle_table): Likewise.
8941 * src/parse-gram.y (current_class, current_type, current_prec):
8943 * src/reader.c (grammar_end, previous_rule_end): Likewise.
8944 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
8945 * src/main.c (main): Cast bindtextdomain and textdomain calls to
8946 void, to avoid warning when NLS is disabled.
8947 * src/output.c: Include scan-skel.h.
8948 (scan_skel): Remove decl, since scan-skel.h does this.
8950 Indent calls to "error" to pacify "make maintainer-distcheck".
8951 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
8952 * src/reader.h (gram_end, gram_lineno): New decls to pacify
8953 "make maintainer-distcheck".
8954 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
8955 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
8956 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
8957 (skel_lex_destroy, scan_skel): Move these decls to...
8958 * src/scan-skel.h: New file.
8959 * src/uniqstr.c (uniqstr_assert):
8960 Indent calls to "error" to pacify "make maintainer-distcheck".
8962 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
8965 * tests/torture.at: Revamp to avoid misuse of atoi that
8966 "make maintainer-distcheck" complained about.
8968 * examples/extexi (message): Don't print a message more than once,
8969 and omit line-number decoration that makes Emacs compile think
8970 that informative messages are worth worrying about.
8972 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
8974 * configure.ac: Update version number.
8976 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
8978 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
8979 autogenerated by the maintainer.
8980 * examples/calc++/.cvsignore: Add *.yy.
8982 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
8983 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8984 * lib/bitsetv.c (bitsetv_alloc): Likewise.
8986 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
8988 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
8989 from maintainer-distcheck about casting the argument of 'free'.
8991 * NEWS: Mention recent yytname changes.
8992 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
8994 * bootstrap: For translations that have not yet been upgraded to
8995 the new runtime-po domain, prime the pump by extracting the
8996 relevant strings from the obsolete translations. This code can be
8997 removed once the bison-runtime domain has been translated by each
9000 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
9001 now that token names are already quoted.
9003 Fix problem reported by Anthony Heading.
9004 * data/glr.c (YYTOKEN_TABLE): New macro.
9005 (yytname): Define if YYTOKEN_TABLE.
9006 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
9007 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
9008 (YYERROR_VERBOSE): Define the same way the other skeletons do.
9009 * src/output.c (prepare_symbols): Output token_table_flag.
9011 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
9013 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
9014 again if the first call fails.
9016 * data/glr.c (yytnamerr): New function.
9017 (yyreportSyntaxError): Use it to dequote most string literals.
9018 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
9019 with other skeletons. All uses changed.
9020 (yytnameerr_): New function.
9021 (yyreport_syntax_error): Use it to dequote most string literals.
9022 * data/yacc.c (yytnamerr): New function.
9023 (yyerrlab): Use it to decode most string literals.
9024 * doc/bison.texinfo (Decl Summary, Calling Convention):
9025 Clarify quoting convention of yytname.
9026 * src/output.c (prepare_symbols): Quote all names. This undoes
9027 the 2005-04-17 change, which is now accomplished (mostly) via
9028 changes in the parsers as described above.
9029 * tests/regression.at (Token definitions, Web2c Actions):
9030 Undo most 2005-04-17 change here, too.
9032 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
9034 Fix more problems reported by twlevo@xs4all.nl.
9035 * tests/cxx-type.at: Don't pipe output of ./types through sed to
9036 remove trailing spaces. This loses the exit status of ./types,
9037 and isn't needed since ./types shouldn't be emitting trailing
9039 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
9040 as the stack isn't valid in that case.
9042 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
9043 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
9044 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
9045 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
9047 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
9048 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
9049 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
9052 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
9053 overly-picky compilers that reject 'char *foo = "bar";'.
9055 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
9056 to FILE * parameter, not to stderr. This fixes a typo introduced
9057 in the 2005-07-12 change.
9059 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
9060 warnings from GCC 4.
9062 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
9063 (yyglrShiftDefer, yysplitStack):
9064 Remove unused parameters b4_pure_formals. All uses changed.
9065 (yyglrShift): Remove unused parameters b4_user_formals.
9067 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
9069 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
9071 Destructor cleanups and regularization among the three skeletons.
9072 * NEWS: Document the behavior changes.
9073 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
9074 stack before failing, as the cleanup code will do it for us now.
9075 * data/lalr1.cc (yyerrlab): Likewise.
9076 * data/glr.c (yyparse): Pop everything off the stack before
9077 freeing it, so that destructors get called properly.
9078 * data/lalr1.cc (yyreturn): Likewise.
9079 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
9080 This is more consistent.
9081 * doc/bison.texinfo (Destructor Decl): Mention more reasons
9082 why destructors might be called. 1.875 -> 2.1.
9083 (Destructor Decl, Decl Summary, Table of Symbols):
9084 Some English-language cleanups for %destructor.
9085 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9086 Add output line for destructor of start symbol.
9087 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
9088 because of that same extra output line.
9090 * NEWS: Document minor wording changes in diagnostics of
9091 Bison-generated parsers.
9092 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
9093 Remove unused formals. All uses changed.
9094 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
9095 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
9096 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
9097 Rename yyoverflowab to yyexhaustedlab.
9098 When memory exhaustion occurs during syntax-error reporting,
9099 report it separately rather than in a single diagnostic; this
9101 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
9102 (Memory Exhausted): Renamed from Parser Stack Overflow.
9103 Revamp wording slightly to prefer "memory exhaustion".
9104 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
9106 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
9108 Add i18n support to the GLR skeleton. Partially fix the C++
9109 skeleton; a C++ expert needs to finish this. Remove debugging
9110 msgids; there's little point to having them translated, since they
9111 can be understood only by someone who can read the
9112 (English-language) source code.
9114 Generate runtime-po/bison-runtime.pot automatically, so that we
9115 don't have to worry about garbage getting in that file. We'll
9116 make sure after the next official release that old msgids don't
9118 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
9120 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
9122 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
9123 Fix typos in explanations of the runtime file.
9124 * bootstrap: Change gettext keyword from YYI18N to YY_.
9125 Use standard Makefile.in.in in runtime-po, since we'll arrange
9126 for backward-compatible bison-runtime.po files in a different way.
9127 * data/glr.c (YY_): New macro, from yacc.c.
9128 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
9129 Translate messages intended for users.
9130 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
9131 the wording in the other skeletons. We don't know that the memory
9133 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
9134 Use same method that yacc.c uses.
9135 Don't translate debugging messages.
9136 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
9137 it doesn't work (yet), and requires C++ expertise to fix.
9138 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
9139 Move defn to a more logical place, to be consistent with other
9141 Don't translate debugging messages.
9142 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
9143 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
9144 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
9145 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
9147 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
9148 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
9150 * tests/glr-regression.at (Badly Collapsed GLR States):
9152 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9153 yylex should return 0 at EOF rather than aborting.
9155 Improve tests for stack overflow in GLR parser.
9156 Problem reported by twlevo@xs4all.nl.
9157 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
9159 (yyStackOverflow): Just longjmp, but with value 2 so that caller
9160 can handle the problem.
9161 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
9162 (yyparse): New local variable yyresult to record the result.
9163 Use result of setjmp to set it, rather than storing itinto
9165 (yyDone): Remove label.
9166 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
9167 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
9168 if YYABORT is used).
9169 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
9170 yyparse status; put status > 1 into diagnostic.
9171 Check that status==2 works.
9172 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
9173 Use exit status 3 for failure to open (which shouldn't happen).
9175 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
9177 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
9178 1 on syntax error; just let yyparse do its thing.
9179 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
9180 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
9181 (Exploding the Stack Size with Alloca):
9182 (Exploding the Stack Size with Malloc):
9183 Expect exit status 2, not 1, since the parser is supposed to blow
9184 its stack. Problem reported by twlevo@xs4all.nl.
9186 * data/glr.c (yyparse): Don't assume that the initial calls
9187 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
9188 Print a stack-overflow message and fail instead.
9189 Initialize the line-number information before creating the stack,
9190 so that the stack-overflow message can report line zero safely.
9192 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
9194 Fix problems reported by twlevo@xs4all.nl.
9195 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
9196 (yyuserMerge): Provide a default case if b4_mergers is empty.
9197 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
9198 * tests/glr-regression.at
9199 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9200 Add casts to pacify C++ compilers.
9201 * tests/glr-regression.at (Improper merging of GLR delayed action
9202 sets): Declare yylex before using it.
9203 * tests/Makefile.am (maintainer-check-g++): Fix a stray
9204 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
9205 test for valgrind; valgrind is independent of g++.
9206 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
9207 for compatibility with POSIX 1003.1-2001 (if running coreutils).
9208 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
9209 Use a destructor, so that we can expand the stack. Change
9210 YYSTYPE to char * so that we can free it. Cast result of malloc.
9212 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9214 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
9215 a valgrind failure. Problem reported by twlevo@xs4all.nl.
9217 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
9219 * PACKAGING: New file, suggested by Bruno Haible and taken from
9220 similar wording in gettext's PACKAGING file.
9221 * NEWS: Mention PACKAGING.
9222 * Makefile.am (EXTRA_DIST): Add PACKAGING.
9224 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
9226 * NEWS: Document recent i18n improvements.
9227 * bootstrap: Get runtime translations into runtime-po.
9228 Create runtime-po files automatically, if possible.
9229 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
9230 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
9231 does not infringe on the user's name space.
9232 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
9233 * doc/bison.texinfo (Internationalization): Revamp the English
9234 and Texinfo syntax a bit, to try to make it clearer.
9235 (Bison Options, Option Cross Key): Mention --print-localedir.
9236 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
9237 YYENABLE_NLS. Quote a bit more.
9238 * runtime-po/.cvsignore: New file.
9239 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
9240 * runtime-po/Rules-quot: Remove; now created by bootstrap.
9241 * runtime-po/quot.sed: Likewise.
9242 * runtime-po/boldquot.sed: Likewise.
9243 * runtime-po/en@quot.header: Likewise.
9244 * runtime-po/en@boldquot.header: Likewise.
9245 * runtime-po/insert-header.sin: Likewise.
9246 * runtime-po/remove-potcdate.sin: Likewise.
9247 * runtime-po/Makevars: Likewise.
9248 * runtime-po/LINGUAS: Likewise.
9249 * runtime-po/de.po: Likewise; we will rely on the translation project
9250 to maintain this, so "bootstrap" should get it.
9251 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
9253 * src/main.c (main): Bind the bison-runtime domain, too.
9255 2005-07-12 Bruno Haible <bruno@clisp.org>
9257 * data/yacc.c: Include <libintl.h> when NLS is enabled.
9258 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
9259 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
9260 * runtime-po: New directory.
9261 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
9262 $(DOMAIN).pot-update rule, so that old messages are never dropped.
9263 * runtime-po/Rules-quot: New file, copied from po/.
9264 * runtime-po/quot.sed: Likewise.
9265 * runtime-po/boldquot.sed: Likewise.
9266 * runtime-po/en@quot.header: Likewise.
9267 * runtime-po/en@boldquot.header: Likewise.
9268 * runtime-po/insert-header.sin: Likewise.
9269 * runtime-po/remove-potcdate.sin: Likewise.
9270 * runtime-po/Makevars: New file.
9271 * runtime-po/POTFILES.in: New file.
9272 * runtime-po/LINGUAS: New file.
9273 * runtime-po/bison-runtime.pot: New file.
9274 * runtime-po/de.po: New file.
9275 * m4/bison.m4: New file.
9276 * Makefile.am (SUBDIRS): Add runtime-po.
9277 (aclocaldir, aclocal_DATA): New variables.
9278 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
9280 * src/getargs.c (usage): Document --print-localedir option.
9281 (PRINT_LOCALEDIR_OPTION): New enum item.
9282 (long_options): Add --print-localedir option.
9283 (getargs): Handle --print-localedir option.
9284 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
9285 (Internationalization): New section.
9287 2005-07-12 Akim Demaille <akim@epita.fr>
9289 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
9290 for consistency with the rest of the code.
9291 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
9294 2005-07-12 Akim Demaille <akim@epita.fr>
9296 * src/parse-gram.y: Use %printer instead of YYPRINT.
9298 2005-07-12 Akim Demaille <akim@epita.fr>
9300 * src/symtab.h, src/symtab.c (symbol_print): New.
9301 * src/symlist.h, src/symlist.c (symbol_list_print): New.
9302 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
9304 2005-07-12 Akim Demaille <akim@epita.fr>
9306 * data/glr.c (b4_syncline): Fix (swap) the definitions of
9307 b4_at_dollar and b4_dollar_dollar.
9309 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
9311 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
9312 and Pennello's paper.
9314 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
9316 * data/yacc.c (yyparse): Undo previous patch. Instead,
9317 set yylsp[0] and yyvsp[0] only if the initial action
9318 sets yylloc and yylval, respectively.
9320 * data/yacc.c (yyparse): In the initial action, set
9321 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
9322 This avoids the use of undefined variables if the initial
9323 action does not set yylloc and/or yylval.
9325 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
9327 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
9328 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
9329 Remove from CVS. These files are automatically generated.
9330 * examples/extexi: Clarify that this file is now part of Bison,
9331 not GNU M4, and that it works with any POSIX-compatible Awk.
9332 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
9333 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
9334 so that we also get calc++-parser.yy. Geneate it.
9335 Use $(AWK), not gawk, since any conforming Awk will do.
9336 Put comment before action, since older 'make' can't handle comment
9338 $(BUILT_SOURCES): List all built sources, not just some of them.
9339 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
9340 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
9341 $($(calc_sources_generated)): Remove unnecessary test for existence
9342 of target. (This had a shell syntax error anyway; a stray "x".)
9343 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
9345 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
9347 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
9348 implied by the other modules.
9350 2005-07-06 Akim Demaille <akim@epita.fr>
9352 Bind examples/calc++ to the package.
9353 * examples/calc++/Makefile: Remove, replaced by...
9354 * examples/calc++/Makefile.am: ... this new file.
9355 * examples/calc++/test: Remove input.
9356 * examples/calc++/compile: Remove.
9357 * examples/Makefile.am: New.
9358 * configure.ac, Makefile.am: Adjust.
9359 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
9361 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
9363 * data/glr.c (yyFail): Drastically simplify; since the format argument
9364 never had any % directives, we can simply pass it to yyerror.
9365 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
9366 be modified later, as that is the usual style in glr.c.
9367 Problems reported by Paul Hilfinger.
9369 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
9370 and size overflow errors.
9371 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
9372 in case the user prolog sets feature-test macros like _GNU_SOURCE.
9373 (YYSIZEMAX): New macro.
9374 (yystpcpy): New function, taken from yacc.c.
9375 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
9376 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
9377 so that we don't have to maintain their signatures.
9378 (yyFail): Check for buffer overflow, by using vsnprintf rather
9379 than vsprintf. Allocate a bigger buffer if possible.
9380 Report an error if buffer allocation fails.
9381 (yyStackOverflow): New function.
9382 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
9383 the initialization was successful. It might fail if storage was
9385 (yyexpandGLRStack): Add more checks for storage allocation failure.
9386 Use yyStackOverflow to report failures.
9387 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
9388 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
9389 Don't assume stack number fits in int.
9390 (yysplitStack): Check for storage allocation failure.
9391 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
9392 can print diagnostics on storage allocation failure. All callers
9394 (yyresolveValue): Use yybool for boolean.
9395 (yyreportSyntaxError): Check for size-calculation overflow.
9396 This code is taken from yacc.c.
9397 (yyparse): Check for storage allocation errors when allocating
9400 2005-07-05 Akim Demaille <akim@epita.fr>
9402 Extract calc++ from the documentation.
9403 * doc/bison.texinfo (Calc++): Add the extraction marks.
9404 * examples/extexi: New, from the aborted GNU Programming 2E.
9405 Separate the different paragraph of a file with empty lines.
9406 * examples/Makefile: Use it to extract the whole calc++ example.
9408 2005-06-24 Akim Demaille <akim@epita.fr>
9410 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
9413 2005-06-22 Akim Demaille <akim@epita.fr>
9415 * doc/bison.texinfo (C++ Language Interface): First stab.
9416 (C++ Parsers): Remove.
9418 2005-06-22 Akim Demaille <akim@epita.fr>
9420 * data/lalr1.cc (yylex_): Honor %lex-param.
9422 2005-06-22 Akim Demaille <akim@epita.fr>
9424 Start a set of simple examples.
9425 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
9426 * examples/calc++/calc++-driver.hh,
9427 * examples/calc++/calc++-parser.yy,
9428 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
9429 * examples/calc++/compile, examples/calc++/test: New.
9431 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
9433 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
9434 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
9435 which stems from the 2005-05-27 patch.
9437 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9439 * data/glr.c: Modify treatment of unused parameters to permit use
9440 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
9442 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
9444 Fix infringement on user name space reported by Janos Zoltan Szabo.
9445 * data/yacc.c (yyparse): strlen -> yystrlen.
9447 2005-05-30 Akim Demaille <akim@epita.fr>
9449 * data/lalr1.cc (_): New.
9450 Translate the various messages.
9452 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
9454 Fix infringement on user name space reported by Bruno Haible.
9455 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
9456 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
9457 the user's name space.
9458 (alloca): Include <stdlib.h> to get it, if it's not built in.
9459 (YYMALLOC, YYFREE): Define only if needed.
9460 (malloc, free): Declare, but only if needed, as this infringes on
9461 the user name space.
9463 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
9465 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
9466 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
9468 * lib/ebitset.c (min, max): Undef before defining.
9469 * lib/vbitset.c (min, max): Likewise.
9470 * lib/subpipe.c (create_subpipe): Save local variables in case
9471 vfork clobbers them.
9473 2005-05-24 Bruno Haible <bruno@clisp.org>
9475 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
9476 error message syntax used by gcc-4.0.
9478 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
9480 * README: Mention m4 1.4.3. Remove obsolete advice about
9481 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
9483 * bootstrap: Remove workaround for problem I encountered with
9484 gettext 0.14.1; it seems to be fixed now.
9486 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
9488 * NEWS: Version 2.0a.
9490 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
9491 the previous change.
9493 Various maintainer cleanups.
9494 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
9495 conftest*, for benefit of CVS commands run at the same time as
9496 "configure". Add build-aux, since "bootstrap" now creates it and
9498 * Makefile.cfg (move_if_change): Remove.
9499 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
9500 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
9501 (po_repo, do-po-update, po-update, wget_files, get-targets):
9502 (config.guess-url_prefix, config.sub-url_prefix):
9503 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
9504 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
9505 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
9507 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
9508 this is now the recommended name.
9509 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
9510 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
9511 ylwrap. These files now go into build-aux.
9512 * config/move-if-change: Remove.
9513 * config/prev-version.txt: Bump from 1.75 to 2.0.
9515 * bootstrap: Add stdio-safer, unistd-safer modules.
9516 Remove m4/glibc2.m4 (introduced by latest gnulib, but
9518 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
9519 fopen-safer.c, stdio-safer.h, unistd-safer.h.
9520 * lib/subpipe.c: Include "unistd-safer.h".
9521 (create_subpipe): Make sure all the newly-created
9522 file descriptors are > 2, so that diagnostics don't
9523 get sent down them (which might cause Bison to hang, in theory).
9524 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
9525 * src/files.c (xfopen): Use fopen_safer, not fopen.
9527 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
9528 yesterday's yacc.c fix.
9530 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
9532 * data/glr.c, data/lalr1.cc: Update copyright date.
9534 Fix a destructor bug reported by Wolfgang Spraul in
9535 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
9536 * data/yacc.c (yyabortlab): Don't call destructor, and
9537 don't set yychar to EMPTY.
9538 (yyoverflowlab): Don't call destructor.
9539 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
9540 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
9541 since we no longer output the message "discarding lookahead token
9544 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9546 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
9547 fix a small glitch in debugging output.
9548 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
9549 after YY_SYMBOL_PRINT where needed.
9551 (struct yyGLRState): Add some comments.
9552 (struct yySemanticOption): Add some comments.
9553 (union yyGLRStackItem): Add comment.
9555 (yymergeOptionSets): Correct this to properly perform the union,
9556 avoiding infinite reported by Michael Rosien.
9559 * tests/glr-regression.at: Add test for GLR merging error reported
9562 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
9564 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
9565 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
9566 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
9567 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
9568 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
9569 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
9570 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
9571 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
9572 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
9573 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
9574 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
9575 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
9576 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
9577 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
9578 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
9579 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
9580 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
9581 src/derives.h, src/files.c, src/files.h, src/getargs.c,
9582 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
9583 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
9584 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
9585 src/output.h, src/parse-gram.c, src/parse-gram.h,
9586 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
9587 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
9588 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
9589 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
9590 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
9591 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
9592 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
9593 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
9594 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
9595 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
9596 tests/reduce.at, tests/regression.at, tests/sets.at,
9597 tests/synclines.at, tests/testsuite.at, tests/torture.at:
9598 Update FSF postal mail address.
9600 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
9602 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
9603 Problem reported by Ralf Menzel.
9605 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
9607 * tests/actions.at: Test that stack overflow invokes destructors.
9608 From Marcus Holland-Moritz.
9609 * data/yacc.c (yyerrlab): Move the code that destroys the stack
9611 (yyreturn): to here. That way, destructors are called properly
9612 even if the stack overflows, or the user calls YYACCEPT or
9613 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
9614 (yyoverflowlab): Destroy the lookahead.
9616 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
9618 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
9620 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
9622 * NEWS: Bison-generated C parsers no longer quote literal strings
9623 associated with tokens.
9624 * src/output.c (prepare_symbols): Don't escape strings,
9625 since users don't want to see C escapes.
9626 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
9628 * tests/input.at (Torturing the Scanner): Likewise.
9629 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
9631 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
9633 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
9634 the data size is known to be too small and we can't increase it.
9635 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
9637 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
9639 * src/parse-gram.y: Include quotearg.h.
9640 (string_as_id): Quote $1 before using it as a key, since the
9641 lexer no longer quotes it for us.
9642 (string_content): Don't strip quotes, since lexer no longer
9644 * src/scan-gram.l: Include quotearg.h.
9646 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
9647 a key, since the rest of the lexer doesn't quote it.
9648 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
9649 * tests/regression.at (Token definitions): Check for backslashes
9652 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
9653 (YYSIZE_T): Define to unsigned long int when using an older compiler.
9654 (yyparse): Revamp code to generate long syntax error message, to
9655 make it easier to translate, and to avoid problems with arithmetic
9656 overflow. Change "virtual memory" to "memory" in diagnostic, since
9657 we don't know whether the memory is virtual.
9659 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
9661 * NEWS: Bison-generated C parsers now use the _ macro to
9663 * data/yacc.c (_) [!defined _]: New macro.
9664 All English strings wrapped inside this macro.
9665 * doc/bison.texinfo (Bison Parser): Document _.
9666 * po/POTFILES.in: Include src/parse-gram.c, since it now
9667 includes translateable strings that parse-gram.y doesn't.
9669 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
9671 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
9672 reverting the 2004-10-11 change to this function.
9673 (symbol_check_alias_consistency): Don't call symbol_type_set
9674 if the type name is already correct.
9675 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
9677 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
9679 * tests/regression.at (Token definitions): Don't use a token named
9680 c, as that generates a "#define c ..." that runs afoul of buggy
9681 stdlib.h that uses the identifier c as a member of struct
9682 drand48_data. Problem reported by Horst Wente.
9684 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
9686 * bootstrap: Change translation URL from
9687 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
9688 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
9689 redirection glitches. Problem reported by twlevo@xs4all.nl.
9691 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
9693 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
9694 after operands; POSIX says this isn't portable for the c99 command.
9696 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
9698 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
9699 immediately if a data overrun has occurred; this may help us track
9700 down what may be a spurious failure on MacOS.
9702 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
9704 Respond to problems reported by twlevo@xs4all.nl.
9706 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
9708 * src/vcg.h: Comment fix.
9709 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
9710 (G_CMAX): Change to -1 instead of INT_MAX.
9712 * data/yacc.c (yyparse): Omit spaces before #line.
9714 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
9716 * src/tables.c (state_number_to_vector_number): Put it inside an
9717 "#if 0", since it's not currently used. Problem reported by
9720 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
9722 * src/output.c (escaped_output): Renamed from
9723 escaped_file_name_output, since we now use it for symbol tags as
9724 well. All uses changed.
9725 (symbol_destructors_output, symbol_printers_output):
9726 Escape symbol tags too.
9727 Problem reported by Matyas Forstner in
9728 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
9730 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
9732 * src/output.c (user_actions_output, token_definitions_output,
9733 symbol_destructors_output, symbol_printers_output): Likewise.
9734 * src/reader.c (prologue_augment): Likewise.
9735 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
9737 * src/vcg.c (output_edge): Don't quote linestyle arg.
9738 Problem reported by twlevo@xs4all.nl.
9740 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
9742 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
9743 example, reported by Derek M Jones. Also, make the example even
9744 more outrageous, to better illustrate how bad the problem is.
9746 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
9748 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
9749 putsym. Typo reported by Sebastian Piping.
9751 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
9753 * doc/bison.texinfo (Language and Grammar): some -> same
9754 (Epilogue): int he -> in the
9755 Typos reported by Sebastian Piping via Justin Pence.
9757 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
9759 * tests/glr-regression.at (Improper handling of embedded actions
9760 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
9761 embedded actions and $-N in GLR parsers", work around an Autoconf bug
9762 with dollar signs in test names.
9763 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
9764 for a similar reason.
9766 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
9768 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
9769 wants to redefine G_VIEW.
9771 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
9773 * src/vcg.c (get_view_str): Remove case for normal_view.
9774 Problem reported by twlevo@xs4all.nl.
9776 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
9778 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
9779 Problem reported by twlevo@xs4all.nl.
9781 * doc/bison.texinfo: Change @dircategory from "GNU programming
9782 tools" to "Software development". Requested by Richard Stallman
9785 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
9787 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
9788 Problem reported by twlevo@xs4all.nl.
9790 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
9792 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
9793 keyword; it's not needed with modern compilers, and it doesn't
9794 affect correctness with older compilers. Suggested by
9797 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
9799 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
9800 gcc -Wswitch-default.
9801 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9802 * data/yacc.c (yyparse): Likewise.
9804 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
9806 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
9807 already. Let config.h define any nonstandard values.
9809 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
9811 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
9812 for the benefit of slower hosts. Problem reported by
9815 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
9817 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
9818 being defined and not used.
9819 * data/lalr1.cc (yyparse): Likewise.
9820 Use "if (false)" rather than "if (0)".
9822 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
9824 * TODO: Mention that we should allow NUL bytes in tokens.
9826 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
9828 * src/scan-skel.l (<<EOF>>): Don't close standard output.
9829 Problem reported by Hans Aberg.
9831 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
9833 * src/getargs.c (version): Happy new year; update overall
9834 program copyright date from 2004 to 2005.
9836 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
9837 Problem reported by Hans Aberg.
9838 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
9839 (Output file names.): Add a test for the case when standard output
9842 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
9844 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
9845 to fix an oversight in the Bison 2.0 manual.
9847 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
9849 * NEWS: Version 2.0. Reformat the existing news items since
9850 1.875, so that related items are grouped together.
9851 * configure.ac (AC_INIT): Bump version to 2.0.
9852 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
9854 * tests/torture.at (Exploding the Stack Size with Alloca): Set
9855 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
9856 otherwise, we're not testing alloca. Unfortunately there's no
9857 simple way to consult HAVE_ALLOCA here.
9859 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
9862 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
9863 hand. This avoids a warning about comparing int to size_t when
9864 GCC warnings are enabled.
9866 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
9868 * NEWS: Bison-generated parsers no longer default to using the
9869 alloca function (when available) to extend the parser stack, due
9870 to widespread problems in unchecked stack-overflow detection.
9871 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
9872 responsibility to set it to a positive value. This lets the user
9873 specify a value that is not a preprocessor constant.
9874 * data/yacc.c (YYMAXDEPTH): Likewise.
9875 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
9876 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
9877 to be a compile-time constant. However, explain the constraints on it.
9878 Also, explain the constraints on YYINITDEPTH.
9879 (Table of Symbols): Explain that alloca is no longer the default.
9880 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
9883 * doc/bison.texinfo (Location Default Action): Mention that n must
9884 be zero when k is zero. Suggested by Frank Heckenbach.
9886 2004-12-22 Akim Demaille <akim@epita.fr>
9888 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
9889 (parser::state_type, parser::semantic_type, parser::location_type):
9890 Private, not public.
9891 (parser::parse): Return ints, not bool.
9892 Returning a bool introduces a problem: 0 corresponds to false, and
9893 it seems weird to return false on success. Returning true changes
9894 the conventions for yyparse.
9895 Alternatively we could return void and send an exception.
9896 There is no clear consensus (yet?).
9897 (state_stack, semantic_stack, location_stack): Rename as...
9898 (state_stack_type, semantic_stack_type, location_stack_type): these.
9899 Private, not public.
9900 * tests/c++.at: New.
9901 * tests/testsuite.at, tests/Makefile.am: Adjust.
9903 2004-12-21 Akim Demaille <akim@epita.fr>
9905 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
9907 2004-12-21 Akim Demaille <akim@epita.fr>
9909 Don't impose std::string for filenames.
9911 * data/lalr1.cc (b4_filename_type): New.
9912 (position::filename): Use it.
9913 (parser.hh): Move the inclusion of stack.hh and location.hh below
9914 the user code, so that needed headers for the filename type can be
9916 Forward declare them before the user code.
9917 * tests/Makefile.am (check-local, installcheck-local): Pass
9918 TESTSUITEFLAGS to the TESTSUITE.
9920 2004-12-20 Akim Demaille <akim@epita.fr>
9922 Use more STL like names: my_class instead of MyClass.
9924 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
9925 (SemanticStack, SemanticType, StateStack, StateType)
9926 (TokenNumberType, Stack, Slice, Traits, Parser::location)
9927 (Parser::value): Rename as...
9928 (location_stack, location_type, rhs_number_type, semantic_stack)
9929 (semantic_type, state_stack, state_type, token_number_type, stack)
9930 (slice, traits, parser::yylloc, parser::yylval): these.
9932 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
9934 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
9936 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
9937 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
9939 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
9941 Remove uses of 'short int' and 'unsigned short int'. This raises
9942 some arbitrary limits. It uses more memory but nowadays that's
9943 not much of an issue.
9945 This change does not affect the generated parsers; that's a different
9946 task, as some users will want to conserve memory there.
9948 Ideally we should use size_t to represent all object counts, and
9949 something like ptrdiff_t to represent signed differences of object
9950 counts; but that will require more code-cleanup than I have the
9951 time to do right now.
9953 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
9954 Use size_t, not int or short int, to count objects.
9955 * src/closure.c (nritemset, closure): Likewise.
9956 * src/closure.h (nritemset, closure): Likewise.
9957 * src/nullable.c (nullable_compute): Likewise.
9958 * src/print.c (print_core): Likewise.
9959 * src/print_graph.c (print_core): Likewise.
9960 * src/state.c (state_compare, state_hash): Likewise.
9961 * src/state.h (struct state): Likewise.
9962 * src/tables.c (default_goto, goto_actions): Likewise.
9964 * src/gram.h (rule_number, rule): Use int, not short int.
9965 * src/output.c (prepare_rules): Likewise.
9966 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
9967 errs, reductions): Likewise.
9968 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
9970 * src/tables.c (vector_number, tally, action_number,
9971 ACTION_NUMBER_MINIMUM): Likewise.
9972 * src/output.c (muscle_insert_short_int_table): Remove.
9974 2004-12-17 Akim Demaille <akim@epita.fr>
9976 * data/lalr1.cc: Extensive Doxygenation.
9977 (error_): Rename as...
9978 (error): this, since it is visible to the user.
9980 (Parser::message): Now an automatic variable from...
9981 (Parser::yyreport_syntax_error_): here.
9982 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
9984 * tests/input.at: Escape $.
9986 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
9988 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
9989 Parenthesize rhs to avoid obscure problems with mistakes like
9990 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
9991 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9992 b4_rhs_location): Likewise.
9993 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9994 b4_rhs_location): Likewise.
9996 2004-12-16 Akim Demaille <akim@epita.fr>
9998 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
9999 yacc.c: be sure to stay within yycheck_.
10000 * tests/actions.at: Re-enable C++ tests.
10002 2004-12-16 Akim Demaille <akim@epita.fr>
10004 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
10007 2004-12-16 Akim Demaille <akim@epita.fr>
10009 Use #define to handle the %name-prefix.
10011 * data/glr.c, data/yacc.c: Comment changes.
10012 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
10013 so that one can refer to yylex in the parser file, and have it
10014 renamed, as is the case with other skeletons.
10016 2004-12-16 Akim Demaille <akim@epita.fr>
10018 Move lalr1.cc internals into yy*.
10020 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
10021 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
10022 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
10023 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
10024 (empty_, final_, terror_, errcode_, ntokens_)
10025 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
10026 (looka_, ilooka_, error_range_, nerrs_):
10028 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
10029 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
10030 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
10031 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
10032 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
10033 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
10034 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
10035 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
10038 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
10040 Fix some problems reported by twlevo at xs4all.
10041 * src/symtab.c (symbol_new): Report an error if the input grammar
10042 contains too many symbols. This is better than calling abort() later.
10043 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
10044 (struct node, struct graph):
10045 Rename member expand to stretch. All uses changed.
10046 (struct graph): Remove member layoutalgorithm. All uses removed.
10047 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
10048 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
10050 (N_STRETCH): Rename from N_EXPAND. All uses changed.
10052 2004-12-15 Akim Demaille <akim@epita.fr>
10054 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
10055 Add more Doxygen comments.
10056 (symprint_, stack_print_, reduce_print_, destruct_, pop)
10057 (report_syntax_error_, translate_): Rename as...
10058 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
10059 (yypop_, yyreport_syntax_error_, yytranslate_): this.
10061 2004-12-15 Akim Demaille <akim@epita.fr>
10063 * data/lalr1.cc (lex_): Rename as...
10065 Move the trace here.
10066 Take the %name-prefix into account.
10067 Reported by Alexandre Duret-Lutz.
10069 2004-12-15 Akim Demaille <akim@epita.fr>
10071 Simplify the C++ parser constructor.
10073 * data/lalr1.cc (debug_): Rename as...
10074 (yydebug_): so that the parser's internals are always in the yy*
10077 (b4_parse_param_decl): Remove the leading comma as it is now only
10078 called as unique argument list.
10079 (Parser::Parser): Remove the constructor accepting a location and
10080 an initial debugging level.
10081 Remove from the other ctor the argument for the debugging level.
10082 (debug_level_type, debug_level, set_debug_level): New.
10084 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
10087 2004-12-15 Akim Demaille <akim@epita.fr>
10089 Remove b4_root related material: failure experiment
10090 (which goal was to allow to derive from a class).
10092 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
10093 definitions and uses.
10095 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
10097 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
10098 not 2, since it's not portable to subtract 1 from the start of an
10099 array. The new item 0 is never set or used. All uses changed.
10101 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
10102 the default definition of YYLLOC_DEFAULT. Problem reported
10103 by Frank Heckenbach.
10105 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
10107 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
10108 the normal case and one for the error case. Just use the
10109 first one uniformly. Problem reported by Frank Heckenbach.
10110 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
10111 use exactly the same macro in both places.
10112 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
10113 so that the normal-case YYRHSLOC works for the error case too.
10115 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
10116 (YYLLOC_DEFAULT): Use the same macro as glr.c.
10117 * doc/bison.texinfo (Location Default Action): Don't claim that
10118 we have an array of locations. Use the same macro for both glr
10119 and lalr parsers. Mention YYRHSLOC. Mention what happens when
10122 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
10124 * HACKING: Update email addresses to send announcements to.
10126 * configure.ac (AC_INIT): Bump version to 1.875f.
10128 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
10130 * NEWS: Version 1.875e.
10131 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
10133 * src/scan-skel.l: Include "complain.h", for "fatal".
10135 * src/relation.h (relation_print, relation_digraph):
10136 Relation sizes are of type relation_node, not size_t (this is
10137 merely a doc fix, since the two types are equivalent).
10138 (relation_transpose): Relation sizes are of type relation_node,
10140 * src/relation.c: Likewise.
10141 (top, infinity): Now of type relation_node, not int.
10142 (traverse, relation_transpose): Use relation_node, not int.
10144 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
10145 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
10146 (yyparse): Remove unused local introduced in 2004-10-25 patch.
10148 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
10149 specifying whether the test should be skipped. Use it tp
10150 specify that the [%defines %skeleton "lalr1.cc"] tests currently
10151 fail on some hosts, and should be skipped.
10153 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
10155 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
10156 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
10157 unless otherwise specified below.
10159 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
10160 to allocate kernel_base, kernel_items, kernel_size, since
10161 they needn't be initialized to 0.
10162 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
10163 * src/closure.c (new_closure): Likewise, for itemset.
10164 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
10165 * src/lalr.c (set_goto_map): Likewise, for temp_map.
10166 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
10167 (build_relations): Likewise for edge, states1, includes.
10168 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
10169 * src/reader.c (packgram): Likewise, for ritem, rules.
10170 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
10171 * src/relation.c (relation_digraph): Likewise for VERTICES.
10172 (relation_transpose): Likewise for new_R, end_R.
10173 * src/symtab.c (symbols_token_translations_init): Likewise for
10174 token_translations.
10175 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
10176 (token_actions): Likewise for yydefact, actrow, conflrow,
10178 (save_column): Likewise for froms[symno], tos[symno].
10179 (goto_actions): Likewise for state_count.
10180 (pack_table): Likewise for base, pos, check.
10181 (tables_generate): Likewise for width.
10183 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
10184 for initial core. Just have a separate core, so we needn't worry
10185 about whether kernel_size and kernel_base are initialized.
10187 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
10188 kernel_size, kernel_items): Remove unnecessary initialization.
10189 * src/conflicts.c (conflicts): Likewise.
10190 * src/derives.c (derives): Likewise.
10191 * src/muscle_tablc (muscle_insert): Likewise.
10192 * src/relation.c (relation_digraph): Likewise.
10193 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
10194 conflrow, conflict_table, conflict_list, table, check):
10197 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
10198 This is because all callers pass unsigned int.
10199 * src/closure.h (new_closure): Likewise.
10201 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
10202 (build_relations): Initialize includes[i] in all cases.
10203 * src/reader.c (packgram): Always initialize rules[ruleno].prec
10204 and rules[ruleno].precsym. Initialize members in order.
10205 * src/relation.c (relation_transpose): Always initialize new_R[i]
10207 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
10209 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
10210 conflict_list[0] was always 0, but now it isn't initialized.
10212 * src/table.c (table_grow): When conflict_table grew, the grown
10213 area wasn't cleared. Fix this.
10215 * lib/.cvsignore: Add strdup.c, strdup.h.
10216 * m4/.cvsignore: Add strdup.m4.
10218 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
10220 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
10221 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
10222 GOTO_NUMBER_MAXIMUM, since we occasionally compute
10223 ngotos + 1 without checking for overflow.
10224 (build_relations): Use END_NODE, not -1, to denote end of edges.
10225 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
10226 build_relations): Use goto_number, not int, for goto numbers.
10227 * src/tables.c (save_column, default_goto): Likewise.
10229 2004-11-23 Akim Demaille <akim@epita.fr>
10231 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
10232 of #defining from yystype.
10233 Don't typedef yystype, C++ does not need it.
10234 This lets it possible to forward declare it as union.
10236 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
10238 * bootstrap (gnulib_modules): Add extensions.
10239 Problem reported by Jim Meyering.
10241 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
10243 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
10244 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
10245 src/system.h, src/tables.c: XFREE -> free, to accommodate
10246 recent change to gnulib xalloc.h.
10247 Problem reported by Jim Meyering.
10249 2004-11-17 Akim Demaille <akim@epita.fr>
10251 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
10253 2004-11-17 Akim Demaille <akim@epita.fr>,
10254 Alexandre Duret-Lutz <adl@gnu.org>
10256 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
10258 (YYCDEBUG): Adjust.
10259 Use it instead of cdebug_.
10260 (Parser::debug_stream, Parser::set_debug_stream): New.
10261 (Parser::symprint_): Define cdebug_ for temporary backward
10263 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
10266 2004-11-17 Akim Demaille <akim@epita.fr>
10268 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
10269 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
10270 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
10271 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
10273 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
10275 * data/glr.c (yyloc_default): Remove; not used.
10276 Problem reported by Frank Heckenbach.
10278 2004-10-25 Akim Demaille <akim@epita.fr>
10280 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
10281 Introduce another definition to address simple location arrays.
10282 (yyGLRStack): New member: yyerror_range.
10283 (yyrecoverSyntaxError, yyparse): Update it.
10284 (yyrecoverSyntaxError): Use it when shifting the error token to
10285 have an accurate range, equivalent to the one computed by both
10286 yacc.c and lalr1.cc.
10287 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
10288 that column numbers start at column 0, as per GNU Coding
10289 Standards, the others tests, and the doc.
10290 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
10291 Adjust to the above change (first column is 0).
10292 And adjust the location of the "<error>", now covering the whole
10295 2004-10-22 Akim Demaille <akim@epita.fr>
10296 and Paul Eggert <eggert@cs.ucla.edu>
10298 Remove some arbitrary limits on goto numbers and relations.
10299 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
10300 initial values, since they're never used.
10301 (set_goto_map): ngotos is now unsigned, so test for overflow
10302 by seeing whether it wraps around to zero.
10303 * src/lalr.h (goto_number): Now size_t, not short int.
10304 (GOTO_NUMBER_MAXIMUM): Remove.
10305 * src/relation.c (relation_print, traverse, relation_transpose):
10306 Check for END_NODE rather than looking at sign.
10307 * src/relation.h (END_NODE): New macro.
10308 (relation_node): Now size_t, not short int.
10310 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
10312 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
10313 keyword, not an identifier. Problem reported by Baron Schwartz in
10314 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
10316 2004-10-11 Akim Demaille <akim@epita.fr>
10318 * src/symtab.c (symbol_check_alias_consistency): Also check
10319 type names, destructors, and printers.
10320 Reported by Alexandre Duret-Lutz.
10321 Recode the handling of associativity and precedence in terms
10322 of symbol_precedence_set.
10323 Accept no redeclaration at all, not even equal to the previous
10325 (redeclaration): New.
10326 Use it to factor redeclaration complaints.
10327 (symbol_make_alias): Don't set the type of the alias, let
10328 symbol_check_alias_consistency do it as for other features.
10329 * src/symtab.h (symbol): Add new member prec_location, and
10331 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
10332 * tests/input.at (Incompatible Aliases): New.
10334 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
10336 .cvsignore fixes to accommodate gnulib changes,
10337 and the practice of naming build directories "_build".
10338 * .cvsignore: Add "_*". Sort.
10339 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
10340 * m4/.cvsignore: Add "*_gl.m4".
10342 2004-10-06 Akim Demaille <akim@epita.fr>
10344 * src/parse-gram.y (add_param): Fix the truncation of trailing
10347 2004-10-05 Akim Demaille <akim@epita.fr>
10349 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
10350 whether the reducion was empty or not. This leaves room to
10351 improve the use of YYLLOC_DEFAULT in such a case.
10352 lalr1.cc is still experimental, so changing this is acceptable.
10353 And finally, there are probably not many users who changed the
10354 handling of locations in GLR, so changing is admissible too.
10356 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
10357 empty reduction, set @$ to an empty location ending the previously
10359 Adjust uses to make sure the code is triggered on empty
10361 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
10362 expected output: empty reductions have empty locations.
10364 2004-09-29 Akim Demaille <akim@epita.fr>
10366 * data/lalr1.cc: Move towards a more standard C++ coding style
10367 for templates: Class < T > -> Class<T>.
10369 2004-09-29 Akim Demaille <akim@epita.fr>
10371 * data/lalr1.cc: Reinstall the former ctor, for sake of
10372 compatibility, but warn it will be removed.
10373 Move towards a more standard C++ coding style (i.e., type *var ->
10376 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
10378 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
10379 since it's less likely to work if NULs are involved in the future.
10381 2004-09-27 Akim Demaille <akim@epita.fr>
10383 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
10385 2004-09-27 Akim Demaille <akim@epita.fr>
10387 * data/lalr1.cc (b4_parse_param_decl_1): New.
10388 (b4_parse_param_decl): Use it to have different names between attribute
10389 and argument names.
10390 (b4_cc_constructor_call): Likewise.
10392 2004-09-24 Akim Demaille <akim@epita.fr>
10394 * src/parse-gram.y (add_param): Strip the leading and trailing
10395 blanks from a formal argument declaration.
10396 (YY_LOCATION_PRINT): New.
10398 2004-09-24 Akim Demaille <akim@epita.fr>
10400 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
10401 after the location.
10403 2004-09-24 Akim Demaille <akim@epita.fr>
10405 * doc/bison.texinfo (Table of Symbols): Sort.
10407 2004-09-21 Akim Demaille <akim@epita.fr>
10409 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
10410 the useless parentheses.
10411 Suggested by Paul Eggert.
10413 2004-09-20 Akim Demaille <akim@epita.fr>
10415 Let the initial-action act on the look-ahead, and use it for the
10416 "initial push" (corresponding to an hypothetical beginning-of-file).
10417 And let lalr1.cc honor %initial-action.
10419 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
10421 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
10422 (Parser::Parser): Remove the ctor that used to initialize it.
10423 (Parser::parse): Like in the other skeletons, issue the "starting
10424 parse" message before any action.
10425 Honor %initial-action.
10426 Initialize the stacks with the lookahead.
10427 * data/yacc.c: Let $$ and @$ in %initial-action designate the
10429 Push them in the stacks.
10430 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
10432 2004-09-20 Akim Demaille <akim@epita.fr>
10434 * doc/bison.texinfo (Initial Action Decl): New.
10436 2004-09-20 Akim Demaille <akim@epita.fr>
10438 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
10439 clearer criterion to define it.
10440 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
10441 When reducing on an empty RHS, use the latest stacked location as
10443 yylloc is not always available.
10444 * data/glr.c: Likewise.
10445 Also, honor initial-actions.
10447 2004-09-20 Akim Demaille <akim@epita.fr>
10449 * data/yacc.c (YY_LOCATION_PRINT): New.
10450 Define when we know YYLTYPE's structure, i.e., when the default
10451 YYLLOC_DEFAULT is used.
10452 * data/c.m4 (b4_yysymprint_generate): Use it.
10453 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
10454 value of the result.
10455 (error_start_): Replace with...
10456 (error_range_): this location array.
10457 This allows to replace code relying on the implementation of
10458 locations by portable code.
10459 * data/yacc.c (yylerrsp): Replace with...
10460 (yyerror_range): this.
10461 Every time a token is popped, update yyerror_range[0], to have an
10462 accurate location for the error token.
10463 * data/glr.c (YY_LOCATION_PRINT): New.
10464 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
10465 deference a pointer.
10466 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
10467 report the location in %printers.
10469 * src/scan-skel.l: Instead of abort, report error messages to ease
10470 understanding skeleton scanning failures.
10472 2004-09-16 Akim Demaille <akim@epita.fr>
10474 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
10475 (iterator, const_iterator): these, to be more in the C++ spirit.
10476 Also, return reverse iterators so that when displaying the stack
10477 we display its bottom first.
10478 (Parser::stack_print_, Parser::reduce_print_): Match the messages
10480 We should probably use vector here though.
10482 2004-09-16 Akim Demaille <akim@epita.fr>
10484 Have more complete shift traces.
10486 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
10487 to report Shifts instead of ad hoc YYDPRINTF invocations,
10488 including for the error token.
10489 * data/lalr1.cc (symprint_): Output the location.
10490 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
10491 output the location within the %printer.
10492 Activate GLR tests, at least to make sure they compile properly.
10493 They still don't pass though.
10494 * tests/calc.at: Adjust expect verbose output, since now "Entering
10495 state..." is on a different line than the "Shifting" message.
10497 2004-09-08 Akim Demaille <akim@epita.fr>
10499 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
10500 Bison directive from the Bison file to the invocation of this
10501 macro, so that these directives are passed to
10502 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
10503 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
10504 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
10505 the extra Bison directives instead of the whole series.
10506 Change the grammar so that there are recoverable errors, and
10507 unrecoverable errors. Now we can have the parser give up before
10508 consuming the whole input. As a result we now can observe that
10509 the lookahead is freed when needed.
10510 Change the parser source to parse argv[1] instead of a hard coded
10512 Simplify yylex, and give a value and location to EOF.
10513 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
10514 passed directives already coded in the file.
10515 Add some tests to check the location of "error".
10516 For some tests, the C++ parser is correct, and not yacc.c.
10517 For other tests, they provide different, but unsatisfying, values,
10518 so keep the C++ value so that at least one parser is "correct"
10519 according to the test suite.
10520 (Actions after errors): Remove, this is subsumed by the
10521 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
10523 2004-09-06 Akim Demaille <akim@epita.fr>
10525 * data/lalr1.cc: Adjust the indentation of the labels.
10526 (Parser::pop): New.
10529 2004-09-06 Akim Demaille <akim@epita.fr>
10531 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
10532 argument, an informative message.
10533 Call YY_SYMBOL_PRINT.
10534 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
10535 * data/lalr1.cc (destruct_): Likewise.
10536 In addition, no longer depend on b4_yysymprint_generate and
10537 b4_yydestruct_generate to generate these functions, do it "by
10540 2004-09-03 Akim Demaille <akim@epita.fr>
10542 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
10543 invoked, yydestruct the lookahead.
10544 * tests/calc.at (Calculator $1): Update the expected lengths of
10545 traces: there is an added line for the discarded lookahead.
10546 * doc/bison.texinfo (Destructor Decl): Some rewording.
10547 Define "discarded" symbols.
10549 2004-09-02 Akim Demaille <akim@epita.fr>
10551 * data/lalr1.cc (translate_, destruct_): No reason to be static.
10553 2004-09-02 Akim Demaille <akim@epita.fr>
10555 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
10556 (YYDSYMPRINTF): Rename as...
10557 (YY_SYMBOL_PRINT): this.
10558 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
10560 Use it instead of direct symprint_ calls.
10561 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
10564 2004-09-02 Akim Demaille <akim@epita.fr>
10566 * data/lalr1.cc (b4_yysymprint_generate): New.
10567 (symprint_): New member function, defined when YYDEBUG.
10568 Use it consistently instead of token/nterm debugging output by
10570 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
10571 %printer calls to use cdebug_ when using lalr1.cc.
10573 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
10575 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
10576 with #ifdef YYDEBUG.
10578 2004-08-26 Akim Demaille <akim@epita.fr>
10580 * doc/bison.texinfo (Implementing Loops): Rename as...
10581 (Implementing Gotos/Loops): this.
10583 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
10585 Adjust to latest gnulib.
10586 * bootstrap (gnulib_modules): Add xalloc-die.
10587 Set LC_ALL=C so that file names sort consistently.
10588 Prefer the gnulib copies of gettext.m4, glibc21.m4,
10589 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
10590 uintmax_t.m4, ulonglong.m4.
10591 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
10592 po.m4 since we are now using _gl.m4 instead.
10594 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
10596 * src/scan-action.l: Remove. Scanning of semantic actions is
10597 handled in scan-gram.l.
10599 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
10601 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
10603 * src/location.h (struct): The file member is a uniqstr.
10604 (equal_boundaries): Use UNIQSTR_EQ for comparison.
10606 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
10608 Fix bug with non-%union parsers that have printers or destructors,
10609 which led to a Bison core dump. Reported by Peter Fales in
10610 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
10612 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
10613 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
10614 not to our own type.
10615 * src/output.c (symbol_destructors_output, symbol_printers_output):
10616 Don't assume %union.
10617 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
10618 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
10619 UNION-FLAG. All callers changed.
10620 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
10621 Use type char, not unsigned int, when declaring an array of char;
10622 this lets us remove a cast.
10623 (Printers and Destructors): Add non-%union test cases.
10625 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10627 * doc/bison.texinfo: Minor editorial changes, mostly to the new
10628 GLR writeups. E.g., avoid frenchspacing and the future tense,
10629 change "lookahead" to "look-ahead", and change "wrt" to "with
10632 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10634 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
10635 New sections, split off from the GLR Parsers section. Put the new
10636 Simple GLR Parser near the start of the GLR section, for clarity.
10637 Rewrite connective text.
10639 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
10641 * doc/bison.texinfo (Simple GLR Parsers): New section.
10643 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10645 * NEWS, TODO, doc/bison.texinfo:
10646 Use "look-ahead" instead of "lookahead", to be consistent.
10647 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
10648 while we're fixing "look-ahead".
10649 * src/conflicts.c (shift_set): Renamed from shiftset.
10650 (look_ahead_set): Renamed from lookaheadset.
10651 * src/print.c: Likewise.
10652 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
10653 name for "lookahead".
10654 (report_types, usage): Likewise.
10655 * src/getargs.h (report_look_ahead_tokens): Renamed from
10657 * src/lalr.c (compute_look_ahead_tokens): Renamed from
10658 compute_lookaheads.
10659 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
10660 (look_ahead_tokens_print): Renamed from lookaheads_print.
10661 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
10662 state_rule_lookaheads_print.
10663 * src/state.h: Likewise.
10664 (reductions.look_ahead_tokens): Renamed from lookaheads.
10665 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
10666 AT_DATA_LOOKAHEADS_GRAMMAR.
10668 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
10670 * README: Update location of patched M4 distribution.
10672 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
10674 Don't assume the C++ compiler takes the same arguments as the C compiler
10676 * configure.ac (O0CXXFLAGS): New var.
10677 * tests/atlocal.in (CXXFLAGS): Use it.
10679 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
10681 Fix some "make check" problems with C++ reported by
10682 Albert Chin-A-Young for Tru64 C++ in this thread:
10683 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
10685 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
10686 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10687 Output to a .cc file for C++, not to a .c file.
10688 * tests/calc.at (AT_CHECK_CALC): Likewise.
10689 * tests/regression.at (AT_CHECK_DANCER): Likewise.
10690 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
10692 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
10694 * tests/calc.at, tests/actions.at: Workaround for SGI
10695 C++ compiler. (trivial change)
10697 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
10699 Spent a few hours checking out which prerequisite versions the
10700 current sources actually require. I went all the way back to
10701 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
10702 a seemingly endless set of combinations of versions more recent
10703 than that. The bottom line is that the current sources require
10704 fairly recent versions of the build tools, and it'll be some work
10706 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
10707 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
10708 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
10709 Add comments explaining why those particular versions are
10712 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
10713 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
10714 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
10716 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
10717 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
10719 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
10721 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
10722 0.11.5. Suggested by Bruno Haible.
10723 * bootstrap: Remove gettext version checking.
10725 * doc/bison.texinfo (Decl Summary): Also mention that %union
10726 can depend on prerequisite types. Problem reported by Tim
10729 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
10731 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
10732 * README-alpha: Don't tell people not to package this.
10734 * bootstrap: Don't assume $(...) works; use `...` instead.
10735 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
10738 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
10739 put into the -d output file, and mention what to do if YYSTYPE is
10740 defined as a macro.
10742 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
10744 Undo change made earlier today: it caused autopoint to not bring
10745 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
10748 * bootstrap: Check that gettext version matches what's in
10749 configure.ac. Warn users to ignore robots.txt ERROR 404.
10750 * bootstrap: Undo today's earlier change (logged below).
10751 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
10753 The gettext version checking is causing more trouble than it's
10754 curing; remove it. Problem reported by Paul Hilfinger.
10756 * bootstrap: Issue a warning that one can expect a message
10757 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
10758 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
10760 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
10762 Ensure that the C++ compiler used for testing actually works on a
10763 simple test program; if not, skip the C++-related tests. Problem
10764 reported by Vin Shelton in:
10765 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
10767 * m4/cxx.m4: New file.
10768 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
10769 * tests/atlocal.in (BISON_CXX_WORKS): Add.
10770 * tests/local.at (AT_COMPILE_CXX): Use it.
10772 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10774 * data/glr.c (yylloc): Output this macro even if locations are not
10775 being generated, as the GLR parser needs it even in that case.
10776 Problem reported by Troy A. Johnson
10777 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
10779 * configure.ac (AC_INIT): Update to 1.875e.
10781 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10783 * NEWS: Version 1.875d.
10784 * configure.ac (AC_INIT): Likewise.
10785 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
10787 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
10788 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
10789 lalr1.cc runs afoul of the first, and the last two are no longer
10790 supported by GCC 3.4.0.
10791 * README: Mention GNU m4 1.4 or later; mention m4 patches.
10792 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
10794 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
10796 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
10797 unsigned int, for compatibility with latest gnulib hash module.
10798 * src/state.c (state_hash, state_hasher): Likewise.
10799 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
10800 * src/uniqstr.c (hash_uniqstr): Likewise.
10802 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
10804 * NEWS: Unescaped newlines are no longer allowed in char & strings.
10806 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
10807 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
10808 character and string literals.
10809 (unexpected_end): New function.
10810 (unexpected_eof): Use it.
10811 (unexpected_newline): New function.
10812 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
10815 * NEWS: Document %expect-rr.
10817 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
10818 Fix typo by replacing $1 with $option.
10819 Remove more 'intl'-related files.
10820 Don't DEFUN AM_INTL_SUBDIR twice.
10822 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
10823 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
10825 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
10826 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
10827 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
10828 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
10829 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
10830 * src/.cvsignore: Add *.output.
10832 * src/parse-gram.y: Put copyright notice inside %{ %} so it
10833 gets copied to the output file.
10835 2004-04-28 Paul Eggert <eggert@twinsun.com>
10837 Get files from the gnulib and po repositories, instead of relying
10838 on them being in our CVS. Upgrade to latest versions of gnulib
10841 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
10842 * bootstrap: Bootstrap from gnulib and po repositories.
10843 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
10844 * README-cvs: Document these changes. Remove version numbers from
10845 mentions of build tools, since they change so often. Mention Flex.
10847 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
10848 (gl_USE_SYSTEM_EXTENSIONS): Add.
10849 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
10850 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
10852 (AC_ISC_POSIX): Remove; we no longer support this
10853 ancient OS, as it gets in the way of latest Autoconf & gnulib.
10854 (AC_HEADER_STDC): Remove: we now assume C89 or better.
10855 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
10856 Do not check for C89 headers, except for locale.h which is used
10857 by the Yacc library and must port to K&R hosts.
10858 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
10859 Do not check for C89 functions, except for setlocale which is
10860 used by the Yacc library.
10861 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
10862 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
10863 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
10864 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
10865 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
10866 AM_GNU_GETTEXT): Remove; now done by:
10867 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
10868 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
10871 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
10872 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
10873 Define to empty, as gnulib.mk will do the rest for us.
10874 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
10876 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
10877 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
10879 * src/files.c: Include gnulib's xstrndup.h.
10881 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
10882 (REALLOC): Use xnrealloc, for likewise.
10883 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
10884 (strnlen, memrchr): Remove decls; functions no longer used.
10885 Include <stpcpy.h>.
10887 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
10888 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10889 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
10890 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
10891 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
10892 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
10893 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
10894 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
10895 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
10896 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
10897 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
10898 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
10899 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
10900 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
10901 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
10902 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
10903 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
10904 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
10905 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
10906 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
10907 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
10908 Remove, as these files are now generated automatically
10909 by bootstrap or automake.
10911 * po/ChangeLog: Remove: all but one entry was a duplicate
10912 of this file, and I moved that 2000-11-02 entry here.
10914 * config/.cvsignore: Add Makefile, depcomp, install-sh.
10915 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
10916 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
10917 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
10918 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
10919 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
10920 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
10921 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
10922 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
10923 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
10924 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
10926 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
10927 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
10928 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
10929 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
10930 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
10931 * src/.cvsignore: Remove *_.c.
10934 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
10935 support it. (The latest stable gzip doesn't.)
10937 2004-04-27 Paul Eggert <eggert@twinsun.com>
10939 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
10940 case, as stos_ is now used by destructors due to the 2004-02-09
10943 Remove more K&R C support.
10944 * lib/libiberty.y (PARAMS): Remove. All uses removed.
10945 * lib/subpipe.c (errno): Remove decl.
10946 Include <stdlib.h> unconditionally.
10947 (EXIT_FAILURE): Remove macro.
10948 * src/complain.c (vfprintf, strerror): Remove.
10949 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
10951 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
10952 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
10953 (strchr, strspn, memchr): Remove decls.
10954 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
10955 unconditionally. Do not declare perror.
10956 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
10959 * src/complain.c (_): Remove useless defn, as system.h defines this.
10961 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
10962 with latest obstack.h.
10963 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
10964 to procedure types, as obstack.h now does that for us.
10965 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
10967 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
10968 so that this include file can stand alone.
10969 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
10970 does this now. Include subpipe.h first after config.h, to
10971 test whether it can stand alone.
10973 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
10974 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
10975 unused declaration.
10977 * tests/synclines.at (%union synch line): Put a dummy member in
10978 the union, because empty unions aren't allowed in C. Caught
10981 2004-04-13 Jim Meyering <jim@meyering.net>
10983 * src/conflicts.c (conflicts_print): Correct format string typo:
10984 use `%%' to produce literal `%'. (trivial change)
10986 2004-03-30 Paul Eggert <eggert@twinsun.com>
10988 * src/getargs.c (version): Update copyright year to 2004.
10990 * data/c.m4 (b4_int_type): Use 'short int' rather than
10991 'short', and similarly for 'long', 'unsigned', etc.
10992 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
10993 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
10994 yy_yypstack, yydumpstack): Likewise.
10995 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
10996 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
10998 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
10999 yy_stack_print, yyparse): Likewise.
11000 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
11001 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
11002 * lib/bitset.c (bitset_print): Likewise.
11003 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
11004 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11005 * lib/bitsetv.c (bitsetv_dump): Likewise.
11006 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
11007 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
11009 * src/LR0.c (allocate_itemsets): Likewise.
11010 * src/gram.h (rule_number, rule): Likewise.
11011 * src/lalr.h (goto_number): Likewise.
11012 * src/nullable.c (nullable_compute): Likewise.
11013 * src/output.c (prepare_rules): Likewise.
11014 * src/relation.c (relation_print, relation_digraph): Likewise.
11015 * src/relation.h (relation_node): Likewise.
11016 * src/state.h (state_number, transitions, errs, reductions,
11017 struct state): Likewise.
11018 * src/symtab.h (symbol_number, struct symbol): Likewise.
11019 * src/tables.c (vector_number, tally, action_number,
11020 default_goto, goto_actions): Likewise.
11021 * tests/existing.at (GNU Cim Grammar): Likewise.
11022 * tests/regression.at (Web2c Actions): Likewise.
11024 * src/output.c (muscle_insert_short_int_table): Renamed from
11025 muscle_insert_short_table. All uses changed.
11027 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11029 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
11030 (declaration): Replace expected_conflicts with expected_sr_conflicts.
11031 Add %expect-rr rule.
11033 * src/scan-gram.l: Recognize %expect-rr.
11035 * src/conflicts.h (expected_sr_conflicts): Rename from
11036 expected_conflicts.
11037 (expected_rr_conflicts): Declare.
11039 * src/conflicts.c (expected_sr_conflicts): Rename from
11040 expected_conflicts.
11041 (expected_rr_conflicts): Define.
11042 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
11044 Use expected_sr_conflicts in place of expected_conflicts.
11045 Warn if expected_rr_conflicts used in non-GLR parser.
11047 * doc/bison.texinfo: Add documentation for %expect-rr.
11049 2004-03-08 Paul Eggert <eggert@gnu.org>
11051 Add support for hex token numbers. Suggested by Odd Arild Olsen in
11052 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
11054 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
11056 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
11057 * src/scan-gram.l (scan_integer): New function.
11059 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
11060 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
11061 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
11062 Say "long int", not "long", for uniformity with GNU style.
11064 2004-02-25 Paul Eggert <eggert@twinsun.com>
11066 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
11067 compilers. This fixes a problem with Intel's C++ compiler being
11068 chatty, reported by Guido Trentalancia in
11069 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
11071 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
11073 Support %destructor and merge error locations in lalr1.cc.
11075 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
11076 (Parser::stos_): Define unconditionally.
11077 (Parser::destruct_): New method. Generate its body with
11078 b4_yydestruct_generate.
11079 (Parser::error_start_): New attribute.
11080 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
11081 token which are discarded.
11082 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
11083 error_start_ when erroneous token are discarded.
11084 (Parser::parse) <yyerrlab1>: Compute the location of the error
11085 token so that it covers all the discarded tokens.
11086 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
11087 it can be called with `%skeleton "lalr1.cc"', and do that.
11089 2004-02-02 Paul Eggert <eggert@twinsun.com>
11091 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
11092 $(top_srcdir)/lib and ../lib. This fixes a bug reported
11093 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
11094 There's no need to mention top_builddir since Automake does that
11096 (INCLUDES): Remove, as Automake says it's obsolescent.
11097 Contents migrated into AM_CPPFLAGS as described above.
11098 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
11100 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11102 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
11103 (yyreportSyntaxError): Handle case where lookahead token is
11106 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11108 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
11109 resulting parsers are compilable with C++.
11111 2003-12-23 Paul Eggert <eggert@twinsun.com>
11113 * config/depcomp, config/install-sh: Sync with Automake 1.8.
11114 * src/output.c (output_skeleton): Rename local var.
11115 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
11116 Bison tokens, as this runs afoul of the 2003-10-07 change that
11117 disallowed NUL bytes in character constants or string literals.
11119 * tests/local.at: Require Autoconf 2.59's Autotest.
11120 * tests/testsuite.at: Don't include local.at, since we now assume
11121 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
11123 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
11124 multiple inclusion warnings.
11126 2003-12-02 Akim Demaille <akim@epita.fr>
11128 * doc/bison.texinfo (How Can I Reset the Parser): More about start
11132 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
11134 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
11136 2003-10-07 Paul Eggert <eggert@twinsun.com>
11138 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
11139 if testsuite doesn't exist.
11141 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
11142 literals, unfortunately.
11143 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
11144 Complain about NUL bytes in character constants or string literals.
11146 2003-10-05 Paul Eggert <eggert@twinsun.com>
11148 * NEWS: Don't document %no-default-prec, as it's still
11150 * doc/bison.texinfo: Document %no-default-prec only if
11151 the defaultprec flag is set. Normally it's not.
11153 2003-10-04 Paul Eggert <eggert@twinsun.com>
11155 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
11156 non-modifiable lvalue, instead of a modifiable one.
11157 * doc/bison.texinfo (Actions): Document that $$ can
11158 be assigned to. Do not claim that $$ and $N are
11159 array element references: user code should not rely on this.
11161 2003-10-01 Paul Eggert <eggert@twinsun.com>
11163 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
11164 (grammar_declaration): Use it.
11165 * src/scan-gram.l: New token %no-default-prec.
11166 * tests/conflicts.at: Revamp tests to use %no-default-prec.
11167 * NEWS, doc/bison.texinfo: Document the above.
11169 2003-10-01 Akim Demaille <akim@epita.fr>
11171 VCG no longer supports long_straight_phase.
11173 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
11174 * src/print_graph.c (print_graph): Adjust.
11176 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
11177 and Paul Eggert <eggert@twinsun.com>
11179 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
11180 Table of Symbols): Document %default-prec.
11181 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
11182 (grammar_declaration): Set default_prec on %default-prec.
11183 * src/scan-gram.l (%default-prec): New token.
11184 * src/reader.h (default_prec): New flag.
11185 * src/reader.c: Likewise.
11186 (packgram): Handle it.
11187 * tests/conflicts.at (%default-prec without %prec,
11188 %default-prec with %prec, %default-prec 1): New tests.
11190 2003-09-30 Paul Eggert <eggert@twinsun.com>
11192 * tests/testsuite.at: Include local.at, not input.at, fixing
11193 a typo in the 2003-08-25 patch.
11195 2003-08-27 Akim Demaille <akim@epita.fr>
11197 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
11200 2003-08-26 Akim Demaille <akim@epita.fr>
11202 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
11203 "<\#" to avoid magic from Gnus when posting parts of this script.
11205 2003-08-26 Akim Demaille <akim@epita.fr>
11207 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
11208 (Parser::parse): here.
11209 Adjust: nerrs and errstatus is now replaced by...
11210 (Parser::nerrs_, Parser::errstatus_): New.
11212 2003-08-25 Akim Demaille <akim@epita.fr>
11214 * config/announce-gen, Makefile.cfg: New.
11215 * Makefile.am: Adjust.
11216 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
11217 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
11219 2003-08-25 Akim Demaille <akim@epita.fr>
11221 When reducing initial empty rules, Bison parser read an initial
11222 location that is not defined. This results in garbage, and that
11223 affects Bison's own parser. Therefore we need (i) to extend Bison
11224 to support a means to initialize this location, and (ii) to use
11225 this CVS Bison to fix CVS Bison's parser.
11227 * src/reader.h, reader.c (epilogue_augment): Remove, replace
11229 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
11230 * src/parse-gram.y: Adjust.
11231 (%initial-action): New.
11232 (%error-verbose): Since we require CVS Bison, there is no reason
11234 * src/scan-gram.l: Adjust.
11235 * src/Makefile.am (YACC): New, to make sure we use our own parser.
11236 * data/yacc.c (yyparse): Use b4_initial_action.
11238 2003-08-25 Akim Demaille <akim@epita.fr>
11240 * doc/bison.texinfo: Don't promote stdout for error messages.
11242 2003-08-25 Akim Demaille <akim@epita.fr>
11244 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
11245 From Alexandre Duret-Lutz.
11247 2003-08-25 Akim Demaille <akim@epita.fr>
11251 2003-08-25 Akim Demaille <akim@epita.fr>
11253 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
11256 2003-08-25 Akim Demaille <akim@epita.fr>
11258 * data/lalr1.cc (Parser::reduce_print_): New.
11261 2003-08-25 Akim Demaille <akim@epita.fr>
11263 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
11264 error recovery loops. This patch is based on
11265 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
11266 Also, augment the similarity between lalr1.cc and yacc.c.
11267 Note: the locations of error recovery rules are not correct yet.
11269 * data/lalr1.cc: Comment changes to augment the similarity between
11270 lalr1.cc and yacc.c.
11271 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
11272 (yyerrlab1): Remove, but where it used to be (now the bottom part of
11273 yyerrlab), when hitting EOF, pop the whole stack here instead of
11274 merely falling thru the default error handling mechanism.
11275 (yyerrorlab): New label, with the old contents of YYERROR,
11276 plus the following change: pop the stack of rhs corresponding
11277 to the production that invoked YYERROR. That is how Yacc
11278 behaves (required by POSIX).
11279 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
11282 2003-08-25 Akim Demaille <akim@epita.fr>
11284 Tune local.at so that people can "autom4te -l autotest calc.at -o
11285 calc" for instance, to extract a sub test suite.
11287 * tests/testsuite.at: Move the initialization, Autotest version
11288 requirement, and AT_TESTED invocation into...
11289 * tests/local.at: here.
11290 * tests/testsuite.at: Include it for compatibility with Autoconf
11292 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
11295 2003-08-04 Paul Eggert <eggert@twinsun.com>
11297 Rework code slightly to avoid gcc -Wtraditional warnings.
11298 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
11299 The returned value is now stored in *YY0. All callers changed.
11300 * src/output.c (merge_output): Adjust to the above change.
11302 2003-07-26 Paul Eggert <eggert@twinsun.com>
11304 * data/glr.c (YYASSERT): New macro.
11305 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
11306 yyresolveStates, yyprocessOneStack):
11307 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
11308 Derived from a suggestion by Frank Heckenbach.
11310 2003-07-25 Paul Eggert <eggert@twinsun.com>
11312 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
11313 for portability to K&R C (after ansi2knr, presumably). See
11314 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
11315 by Frank Heckenbach, though I have omitted the structure-initialization
11316 part of his glr-knr.diff patch since I recall that the Portable
11317 C Compiler didn't require that change.
11319 Let the user specify how to allocate and free memory.
11320 Derived from a suggestion by Frank Heckenbach in
11321 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
11322 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
11323 All uses of free, malloc, realloc changed to use these macros,
11324 and unnecessary casts removed.
11325 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
11327 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
11329 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
11330 use s.empty() rather than s == "" to test for empty string; see
11331 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
11334 2003-06-25 Akim Demaille <akim@epita.fr>
11336 * config/depcomp, config/install-sh: Update from masters.
11338 2003-06-20 Paul Eggert <eggert@twinsun.com>
11340 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
11341 and return properly parenthesized result.
11342 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
11343 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
11344 Remove unnecessary parentheses from uses.
11345 * doc/bison.texinfo (Location Default Action): Describe the
11346 conventions for parentheses.
11348 2003-06-19 Paul Eggert <eggert@twinsun.com>
11350 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
11351 yyreportTree): Do not assume that size_t is the same width as int,
11352 when printing sizes. Print sizes using an unsigned format.
11353 Problem reported by Frank Heckenbach in
11354 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
11356 Port to Forte Developer 7 C compiler.
11357 * data/glr.c (struct YYLTYPE): If locations are not being used,
11358 declare a single dummy member, as empty structs do not conform
11360 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
11361 the Forte Developer 7 C compiler complains that end-of-loop
11362 code is not reached.
11364 2003-06-17 Paul Eggert <eggert@twinsun.com>
11366 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
11367 avoid warnings from picky compilers about redefinition of PARAMS.
11369 2003-06-17 Paul Eggert <eggert@twinsun.com>
11373 * NEWS: Document 1.875b.
11375 * lib/bbitset.h: Do not include config.h; that's the includer's job.
11376 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
11377 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
11378 Don't use 'index' in comments, as it's a builtin fn on some hosts.
11379 * lib/bitset_stats.c: Include gettext.h unconditionally, as
11380 per recent gettext manual's suggestion.
11381 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
11382 Use prototypes, not old-style definitions.
11383 * lib/lbitset.c (lbitset_unused_clear): Likewise.
11384 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
11385 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
11386 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
11387 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
11388 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
11389 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
11390 vbitset_or_and_cmp, vbitset_copy): Likewise.
11392 * lib/libiberty.h: Do not include config.h; that's the includer's job.
11393 Do not include <stdlib.h>.
11394 (PARAMS): Define unconditionally for C89.
11395 (ATTRIBUTE_NORETURN): Remove.
11396 (ATTRIBUTE_UNUSED): Define unconditionally.
11398 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
11399 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
11400 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
11401 * lib/vbitset.c, lib/vbitset.h: New files.
11402 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
11403 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
11406 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
11407 `How Can I Reset @code{yyparse}', since texinfo does not allow
11408 arbitrary @ in node names.
11410 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
11411 shouldn't be needed according to the gettext 0.12.1 documentation
11412 but which seem to be needed anyway: codeset.m4 glibc21.m4
11413 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
11414 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
11415 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
11417 * lib/.cvsignore: Add stdbool.h.
11418 * m4/.cvsignore: Add nls.m4, po.m4.
11420 Upgrade to CVS gnulib.
11421 * stdbool_.h: File renamed from stdbool.h.in.
11422 * configure.ac (AM_STDBOOL_H): Invoke this instead of
11424 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
11425 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
11426 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
11427 (MOSTLYCLEANFILES): New var.
11428 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
11429 (stdbool.h): New rule.
11430 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
11431 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
11432 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
11433 m4/quote.m4: Upgrade to today's gnulib.
11435 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
11436 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
11437 the tests right now.
11438 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
11439 yyerror are declared before use; C99 requires this.
11441 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11443 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
11445 (yyrecoverSyntaxError): Correct the logic for setting and testing
11447 Correct comment on handling EOF.
11448 Allow states with only a default reduction, rather than failing
11449 (I can't quite reconstruct why these were not allowed before).
11451 Fixes to avoid problem that $-N rules in GLR parsers can cause
11452 buffer overruns, corrupting state.
11454 * src/output.c (prepare_rules): Output max_left_semantic_context
11456 * src/reader.h (max_left_semantic_context): New variable declaration.
11457 * src/scan-gram.l (max_left_semantic_context): Define.
11458 (handle_action_dollar): Update max_left_semantic_context.
11459 * data/glr.c (YYMAXLEFT): New definition.
11460 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
11461 (yyresolveAction): Ditto.
11463 Fixes to problems with location handling in GLR parsers reported by
11464 Frank Heckenbach (2003/06/05).
11466 * data/glr.c (YYLTYPE): Make trivial if locations not used.
11467 (YYRHSLOC): Add parentheses, and define only if locations used.
11468 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
11469 locations not used.
11470 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
11471 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
11473 * tests/cxx-type.at: Exercise location information; update tests
11474 to differentiate output with and without locations.
11475 Remove forward declarations of yylex and yyerror---caused errors
11476 because default YYLTYPE not yet defined.
11477 Change semantic actions to compute strings, rather than printing
11478 them directly (to test proper passing of semantics values). Change
11479 output to prefix notation and update test data and expected results.
11480 (yylex): Track locations.
11481 (stmtMerge): Return value rather than printing, and include arguments
11484 2003-06-03 Paul Eggert <eggert@twinsun.com>
11486 Avoid warnings generated by GCC 2.95.4 when Bison is
11487 configured with --enable-gcc-warnings.
11488 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
11489 yy::]b4_parser_class_name[::translate_,
11490 yy::Stack::operator[] (unsigned),
11491 yy::Stack::operator[] (unsigned) const,
11492 yy::Slice::operator[] (unsigned),
11493 yy::Slice::operator[] (unsigned) const):
11494 Rename local vars to avoid warnings.
11495 * tests/glr-regression.at (Improper handling of embedded actions
11496 and $-N in GLR parsers): Remove unused local variable from yylex.
11497 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
11498 (void) as arg when not pure, since we now assume C89 when building
11499 Bison. Pacify GCC by using parameter.
11501 2003-06-02 Paul Eggert <eggert@twinsun.com>
11503 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
11504 yy::Location::lines, yy::Location::columns): Rename arguments
11505 to avoid shadowing; this removes a warning generated by GCC 3.3.
11507 2003-06-01 Paul Eggert <eggert@twinsun.com>
11509 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
11510 to g++, as GCC 3.3 complains if you do it.
11511 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
11512 everything that WARNING_CFLAGS has, except omit warnings
11513 not suitable for C++.
11514 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
11515 * tests/atlocal.in (CXXFLAGS): New var.
11516 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
11518 Fix a GLR parser bug I reported in February; see
11519 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
11520 The problem was that GLR parsers did not conform to the C standard,
11521 because actions like { $1 = $2 + $3; } expanded to expressions
11522 that invoked YYFILL in separate subexpressions, and YYFILL assigned
11523 to a local variable. The C standard says that expressions
11524 like (var = f ()) + (var = f ()) have undefined behavior.
11525 Another problem was that GCC sometimes issues warnings that
11526 yyfill and its parameters are unused.
11528 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
11529 as possibly unused.
11530 (yyfill): New function.
11532 (yyuserAction): Change type of yynormal to bool, so that it matches
11533 the new yyfill signature. Mark it as possibly unused.
11536 Follow up on a bug I reported in February, where a Bison-generated
11537 parser can loop. Provide a test case and a fix for yacc.c. I
11538 don't have a fix for lalr1.cc or for glr.c, unfortunately.
11539 The original bug report is in:
11540 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
11542 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
11543 macro's size was becoming unwieldy.
11544 (yyerrlab): Do not discard an empty lookahead symbol, as this
11545 might destroy garbage.
11546 (yyerrorlab): New label, with the old contents of YYERROR,
11547 plus the following change: pop the stack of rhs corresponding
11548 to the production that invoked YYERROR. That is how Yacc
11549 behaves, and POSIX requires this behavior.
11550 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
11551 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
11552 Define 'alarm' to do nothing if unistd.h is not available.
11553 Add a new rule "exp: '-' error;" to test the above change to
11554 data/yacc.c. Use 'alarm' to abort any test taking longer than
11555 10 seconds, as it's probably looping.
11556 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
11557 Also, the new yacc.c generates two fewer diagnostics for an
11560 2003-05-24 Paul Eggert <eggert@twinsun.com>
11562 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
11563 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
11564 This fixes a problem reported by John Bowman when the Compaq/HP
11565 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
11566 -ansi -Wall -gall).
11567 * data/yacc.c (union yyalloc): Likewise.
11568 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
11570 Switch from 'int' to 'bool' where that makes sense.
11572 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
11573 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
11574 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
11575 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
11576 Return or accept bool, not int. All callers changed.
11577 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
11578 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
11579 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
11580 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
11581 bitset_or_and_cmp_): Likewise.
11582 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
11583 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
11584 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
11585 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
11586 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
11587 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
11588 bitset_stats_or_and_cmp): Likewise.
11589 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
11590 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
11591 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
11592 ebitset_xor_cmp): Likewise.
11593 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
11594 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
11595 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
11596 lbitset_xor_cmp): Likewise.
11597 * lib/bbitset.h: Include <stdbool.h>.
11598 (struct bitset_vtable): The following members now return bool, not
11599 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
11600 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
11602 * src/conflicts.c (count_rr_conflicts): Likewise.
11603 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
11605 * lib/ebitset.c (ebitset_obstack_init): Likewise.
11606 * lib/lbitset.c (lbitset_obstack_init): Likewise.
11607 * src/getargs.c (debug_flag, defines_flag, locations_flag,
11608 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
11609 graph_flag): Likewise.
11610 * src/getargs.h (debug_flag, defines_flag, locations_flag,
11611 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
11612 graph_flag): Likewise.
11613 * src/output.c (error_verbose): Likewise.
11614 * src/output.h (error_verbose): Likewise.
11615 * src/reader.c (start_flag, typed): Likewise.
11616 * src/reader.h (typed): Likewise.
11617 * src/getargs.c (LOCATIONS_OPTION): New constant.
11618 (long_options, getargs): Use it.
11619 * src/lalr.c (build_relations): Use bool, not int.
11620 * src/nullable.c (nullable_compute): Likewise.
11621 * src/print.c (print_reductions): Likewise.
11622 * src/tables.c (action_row, pack_vector): Likewise.
11623 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
11624 * src/output.c (prepare): Use it.
11625 * src/output.c (token_definitions_output,
11626 symbol_destructors_output, symbol_destructors_output): Use string,
11627 not boolean integer, to keep track of whether to output separator.
11628 * src/print_graph.c (print_core): Likewise.
11629 * src/state.c (state_rule_lookaheads_print): Likewise.
11631 * config/install-sh: Sync from automake 1.7.5.
11633 2003-05-14 Paul Eggert <eggert@twinsun.com>
11635 * src/parse-gram.y (rules_or_grammar_declaration): Require a
11636 semicolon after a grammar declaration, in the interest of possible
11637 future changes to the Bison input language.
11638 Do not allow a stray semicolon at the start of the grammar.
11639 (rhses.1): Allow one or more semicolons after any rule, including
11640 just before "|" as required by POSIX.
11641 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
11644 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
11646 %parse-param support for lalr1.cc.
11648 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
11649 b4_cc_constructor_calls, b4_cc_constructor_call,
11650 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
11652 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
11653 parse-param arguments.
11654 (yy::b4_parser_class_name): Declare instance variables to
11655 hold parse-param arguments.
11656 * tests/calc.at: s/value/semantic_value/ because value clashes
11657 with a member of yy::b4_parser_class_name. Adjust C++ code
11658 to handle %parse-param. Enable %parse-param test in C++.
11660 2003-05-12 Paul Eggert <eggert@twinsun.com>
11662 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
11663 English a bit. Fix fclose typo. Change "const char" to "char
11664 const", and use ANSI C rather than K&R for "main". Suggest
11665 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
11666 and suggest yy_switch_to_buffer.
11668 2003-05-05 Paul Eggert <eggert@twinsun.com>
11670 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
11671 C89. This avoids a diagnostic on compilers that define __STDC__
11672 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
11673 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
11675 2003-05-03 Paul Eggert <eggert@twinsun.com>
11677 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
11678 Do not overrun array bounds.
11679 This should fix a bug reported today by Olatunji Oluwabukunmi in
11680 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
11682 2003-04-29 Akim Demaille <akim@epita.fr>
11684 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
11685 * src/getargs.c, src/getargs.h: here, as bool, not int.
11686 (nondeterministic_parser): New.
11687 * src/parse-gram.y, src/scan-gram.l: Support
11688 %nondeterministic-parser.
11689 * src/output.c (prepare): Use nondeterministic_parser instead
11690 of glr_parser where appropriate.
11691 * src/tables.c (conflict_row, action_row, save_row)
11692 (token_actions, token_actions, pack_vector): Ditto.
11694 2003-04-29 Akim Demaille <akim@epita.fr>
11696 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
11698 2003-04-29 Akim Demaille <akim@epita.fr>
11700 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
11701 with %pure-parser and %locations to exercise the patch from Yakov
11704 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
11706 * data/yacc.c: (b4_lex_param): Corrected for the case where
11707 %lex-param is provided and %pure-parser isn't.
11709 2003-04-27 Paul Eggert <eggert@twinsun.com>
11711 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
11712 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
11713 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
11714 if it is not defined.
11715 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
11717 2003-04-26 Paul Eggert <eggert@twinsun.com>
11719 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
11720 Declare to be of type suitable for the ninf value itself, not of
11721 type suitable for the corresponding table, since the latter might
11722 be unsigned but the ninf value might be negative. This fixes a
11723 bug reported by Alexandre Duret-Lutz in
11724 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
11726 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
11727 invokes it. We shouldn't invoke it twice because it will attempt
11728 to put error.o in the archive twice. This fixes a glitch reported
11729 by Martin Mokrejs in
11730 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
11732 2003-04-21 Paul Eggert <eggert@twinsun.com>
11734 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
11737 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
11739 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
11740 Fix obvious typo that results in uncompilable GLR parsers
11741 when both %pure-parser and %locations are used. (trivial change)
11743 2003-04-17 Paul Eggert <eggert@twinsun.com>
11745 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
11746 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
11747 Do not insert the expected token via unput, as this runs afoul
11748 of a POSIX-compatibility bug in flex 2.5.31.
11749 All uses changed to BEGIN the parent state,
11750 since we no longer insert the expected token via unput.
11751 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
11752 that is no longer emitted after the above change.
11754 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
11755 the first one. This change is from Paul Hilfinger, and it fixes
11756 regression reported by Werner Lemberg in
11757 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
11759 (resolve_sr_conflict): Don't invoke state_errs_set
11760 unless one or more tokens have been explicitly made errors.
11761 Otherwise, the above change causes Bison to abort.
11763 * tests/existing.at (GNU pic Grammar): New test case, taken from
11766 2003-03-31 Akim Demaille <akim@epita.fr>
11768 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
11770 2003-03-31 Akim Demaille <akim@epita.fr>
11772 * src/output.c (prepare_symbols): Avoid trailing spaces in the
11775 2003-03-31 Akim Demaille <akim@epita.fr>
11777 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
11778 From Paul Hilfinger.
11780 2003-03-29 Akim Demaille <akim@epita.fr>
11782 * m4/error.m4: Do not put under dynamic conditions some code which
11783 expansion is under static control.
11785 2003-03-29 Akim Demaille <akim@epita.fr>
11787 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
11789 2003-03-29 Akim Demaille <akim@epita.fr>
11791 * doc/bison.texinfo (Strings are Destroyed): New.
11793 2003-03-13 Paul Eggert <eggert@twinsun.com>
11795 * .cvsignore: Add configure.lineno.
11796 * src/.cvsignore: Add yacc.
11797 * tests/.cvsignore: Add testsuite.log.
11798 * doc/fdl.texi: Sync with latest FSF version.
11800 2003-03-12 Paul Eggert <eggert@twinsun.com>
11802 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
11803 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
11804 cursor, instead of leaving it undefined. This fixes a bug
11805 reported by Tim Van Holder in
11806 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
11807 * tests/input.at (Torturing the Scanner): Test the scanner on
11808 an empty input file, which was Tim Van Holder's test case.
11810 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
11811 <sys/resource.h> can be included, include sys/time.h and
11812 sys/times.h first, if available. This works around the SunOS
11813 4.1.4 porting bug reported by Bruce Becker in
11814 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
11816 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
11817 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
11818 AC_HEADER_SYS_WAIT.
11820 Merge changes from gnulib. This was prompted because the CVS
11821 snapshot didn't build on Solaris 7 due to strnlen problems.
11823 These changes need to be merged back into gnulib:
11824 * lib/hash.c: Include <stdbool.h> unconditionally.
11825 * m4/onceonly.m4 (m4_quote): New macro.
11826 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
11827 Quote AC_FOREACH variable-expansions properly.
11828 The 2003-01-03 obstack.h change also needs merging.
11829 {end of changes requiring merging}
11831 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11832 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
11833 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
11834 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
11835 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
11836 New files, imported from gnulib.
11837 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
11840 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
11841 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
11844 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
11846 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
11847 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
11848 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
11849 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
11850 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
11851 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
11852 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
11853 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
11854 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
11855 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
11856 (jm_PREREQ_ARGMATCH): Remove.
11857 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
11858 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
11860 * src/system.h: Include <stdbool.h> unconditionally.
11862 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
11863 assuming at least C89 in the bitset code for some time now.
11865 2003-03-03 Akim Demaille <akim@epita.fr>
11869 2003-03-02 Akim Demaille <akim@epita.fr>
11871 * doc/bison.texinfo (Table of Symbols): Reactivate the
11872 documentation for %lex-param, and %parse-param.
11874 2003-03-02 Akim Demaille <akim@epita.fr>
11876 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
11877 generate verbose error messages.
11878 Use the number of tokens as an upper bound in yytname, as it
11879 cannot be a non terminal.
11881 2003-03-02 Akim Demaille <akim@epita.fr>
11883 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
11886 2003-03-02 Akim Demaille <akim@epita.fr>
11888 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
11889 Use them to exercise yycheck overrun.
11890 Based on Andrew Suffield's grammar.
11892 2003-03-02 Akim Demaille <akim@epita.fr>
11894 Create tests/local.at for Bison generic testing macros.
11896 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
11897 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
11899 * tests/calc.at (AT_CHECK_CALC): Adjust.
11900 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
11901 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
11902 * tests/local.at: here.
11903 (AT_COMPILE_CXX): Tags the tests using it as c++.
11904 Ignore the test if CXX is not functional.
11906 2003-03-01 Paul Eggert <eggert@twinsun.com>
11908 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
11909 not loc->end, since loc->end might contain garbage and this leads
11910 to undefined behavior on some platforms.
11911 (id_loc, token_start): Use (IF_LINTed) initial values that do not
11912 depend on *loc, so that the reader doesn't give the the false
11913 impression that *loc is initialized.
11914 (<INITIAL>"%%"): Do not bother setting code_start, since its value
11915 does not survive the return.
11917 2003-03-01 Akim Demaille <akim@epita.fr>
11919 * src/scan-gram.l (code_start): Always initialize it when entering
11920 into yylex, as SC_EPILOGUE is activated *before* the corresponding
11921 yylex invocation. An alternative would be making it static, but
11922 then it starts with the second %%'s beginning, instead of its end.
11924 2003-02-28 Paul Eggert <eggert@twinsun.com>
11926 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
11927 around a UnixWare 7.1.1 porting bug reported by John Hughes in
11928 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
11930 2003-02-26 Paul Eggert <eggert@twinsun.com>
11932 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
11933 Remove Sequent/Pyramid discussion (nobody uses them any more).
11934 Merge VMS and MS-DOS discussion; these ports may well be dead
11935 but let's keep mentioning them for now. Put <> around email
11936 addresses. Add copyright notice.
11938 2003-02-24 Paul Eggert <eggert@twinsun.com>
11940 * data/glr.c (yy_reduce_print): yylineno -> yylno,
11941 to avoid collision with flex use of yylineno.
11942 Problem reported by Bruce Lilly in
11943 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
11944 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11945 * data/yacc.c (yy_reduce_print): Likewise.
11947 * config/depcomp: Sync with Automake 1.7.3.
11949 2003-02-21 Akim Demaille <akim@epita.fr>
11951 * data/lalr1.cc: Use temporary variables instead of casts to
11952 change integer types.
11953 Suggested by Paul Eggert.
11955 2003-02-21 Akim Demaille <akim@epita.fr>
11957 * doc/bison.texinfo: Use "location" consistently to refer to @n,
11958 to avoid confusions with lalr1.cc's notion of Position.
11959 Suggested by Paul Eggert.
11961 2003-02-20 Akim Demaille <akim@epita.fr>
11963 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
11964 before initial_columns.
11965 (location.hh): Use consistent variable names when defining the
11967 Use "last" so that we subtract from Positions, not from unsigned.
11969 2003-02-20 Akim Demaille <akim@epita.fr>
11971 * data/lalr1.cc (position.hh): New subfile, including the extended
11972 and Doxygen'ed documentation of class Position.
11973 (location.hh): Use it.
11974 Document a` la Doxygen.
11975 With the help of Benoit Perrot.
11977 2003-02-20 Akim Demaille <akim@epita.fr>
11979 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
11981 Redefine AT_YYERROR_SEES_LOC_IF using it.
11982 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
11984 Don't use the location in yy::Parser::error_ and
11985 yy::Parser::print_ when not %locations.
11986 Activate more lalr1.cc tests.
11988 2003-02-19 Akim Demaille <akim@epita.fr>
11990 * data/lalr1.cc: When displaying a line number, be sure to make it
11993 2003-02-19 Akim Demaille <akim@epita.fr>
11995 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
11997 (YYABORT, YYACCEPT, YYERROR): New.
11998 * tests/calc.at: Renable the lalr1.cc test.
12000 2003-02-19 Akim Demaille <akim@epita.fr>
12002 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
12003 error recovery, mixing with/without pops and discarding of the
12006 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
12008 2003-02-17 Paul Eggert <eggert@twinsun.com>
12010 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
12011 * tests/testsuite.at (AT_COMPILE): Use them.
12012 This fixes the testsuite problem reported by Robert Lentz in
12013 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
12015 2003-02-12 Paul Eggert <eggert@twinsun.com>
12017 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
12018 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
12019 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
12020 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
12021 Check for malloc failure, for consistency with yacc.c.
12022 (yytname_size): Remove, for consistency with yacc.c.
12024 The bug still remains in data/lalr1.cc, as I didn't have time
12027 2003-02-06 Akim Demaille <akim@epita.fr>
12029 * configure.ac (GXX): Rename as...
12030 (CXX): this, to keep the original Autoconf semantics.
12032 * data/lalr1.cc: Fix b4_copyright invocations.
12033 If YYDEBUG is not defined, don't depend upon name_ being defined.
12034 (location.hh): Include string and iostream.
12035 (Position::filename): New member.
12036 (Position::Position ()): New.
12037 (operator<< (Position)): New.
12038 (operator- (Position, int)): New.
12039 (Location::first, Location::last): Rename as...
12040 (Location::begin, Location::end): these, to mock the conventional
12042 (operator<< (Location)): New.
12043 * tests/atlocal.in (CXX): New.
12044 * tests/testsuite.at (AT_COMPILE_CXX): New.
12045 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
12046 locations in a more synthetic way.
12047 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
12049 Adjust the C locations to match those from Emacs: first column is
12051 Change all the expected results.
12052 Conform to the GCS: simplify the locations when applicable.
12053 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
12054 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
12055 these CPP macros with the m4 macros new defined by...
12056 (AT_CHECK_PUSHDEFS): this, i.e.:
12057 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
12058 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
12060 (AT_CHECK_POPDEFS): Undefine them.
12061 (AT_CHECK_CALC_LALR1_CC): New.
12062 Use it for the first lalr1.cc test.
12064 2003-02-04 Akim Demaille <akim@epita.fr>
12066 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
12067 Location as is defined.
12069 2003-02-04 Akim Demaille <akim@epita.fr>
12071 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
12072 name_ being defined.
12074 2003-02-03 Paul Eggert <eggert@twinsun.com>
12076 * src/gram.h (start_symbol): Remove unused decl.
12078 Use more-consistent naming conventions for local vars.
12080 * src/derives.c (derives_compute): Change type of local var from
12081 int to rule_number.
12082 * src/gram.c (grammar_rules_partial_print): Likewise.
12083 * src/print.c (print_core): Likewise.
12084 * src/reduce.c (reduce_grammar_tables): Likewise.
12086 * src/gram.c (grammar_dump): Change name of item_number *
12087 local var from r to rp.
12088 * src/nullable.c (nullable_compute): Likewise.
12090 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
12092 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
12093 for symbol or symbol_number var.
12094 * src/reader.c (grammar_start_symbol_set): Likewise.
12095 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
12097 * src/state.c (transitions_to): Likewise.
12098 * src/state.h: Likewise.
12099 * src/tables.c (symbol_number_to_vector_number): Likewise.
12101 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
12104 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
12107 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
12110 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
12111 Use str, not s, for char * var. Use ch, not c, for character var.
12112 Use size for size var.
12114 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
12116 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
12118 * src/uniqstr.h: Likewise.
12120 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12121 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12122 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
12123 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
12124 param to have same name as that of enum, so that we don't use
12125 "s" to stand for a non-state.
12127 2003-02-02 Akim Demaille <akim@epita.fr>
12129 * src/scan-skel.l: Scan more than one inert character per yylex
12132 2003-02-01 Paul Eggert <eggert@twinsun.com>
12136 * po/LINGUAS: Add ms.
12138 2003-01-30 Akim Demaille <akim@epita.fr>
12140 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
12142 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12144 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
12147 Changes in response to error report by S. Eken: GLR mode does not
12148 handle negative $ indices or $ indices in embedded rules correctly.
12149 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
12151 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
12152 (b4_rhs_location): Ditto.
12153 (yyfill): New function to copy from stack tree into array
12155 (yyuserAction): Modify to allow incremental move of semantic values
12156 to rhs array when in GLR mode.
12157 Define YYFILL to use in user-defined actions to fill semantic array
12159 Remove dummy use of yystack, as there is now a guaranteed use.
12160 (yydoAction): Modify to allow incremental move of semantic values
12161 to rhs array when in GLR mode.
12162 (yyresolveAction): Ditto.
12163 (yyglrShiftDefer): Update comment.
12164 (yyresolveStates): Use X == NULL for pointers, not !X.
12165 (yyglrReduce): Ditto.
12166 (yydoAction): Ditto
12168 * tests/glr-regr1.at: Rename to ...
12169 * tests/glr-regression.at: Add new regression test for the problems
12170 described above (adapted from S. Eken).
12171 Update copyright notice.
12172 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
12173 * tests/Makefile.am: Ditto.
12175 2003-01-28 Paul Eggert <eggert@twinsun.com>
12177 * data/lalr1.cc: Do not use @output_header_name@ unless
12178 b4_defines_flag is set. This fixes two bugs reported by
12180 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
12181 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
12183 2003-01-21 Paul Eggert <eggert@twinsun.com>
12185 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
12186 we don't need to worry about yyerrlab1 being reported as an
12187 "unused label" by non-GCC C compilers. The downside is that if
12188 locations are used then a couple of statements are duplicated each
12189 time YYERROR is invoked, but the upside is that the warnings
12191 (yyerrlab1): Move code to YERROR.
12192 (yyerrlab2): Remove. Change uses back to yyerrlab1.
12193 This reverts some of the 2002-12-27 change.
12195 2003-01-17 Paul Eggert <eggert@twinsun.com>
12197 * src/output.c (symbol_printers_output): Fix typo that led
12198 to core dump. Problem reported by Antonio Rus in
12199 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
12201 2003-01-13 Akim Demaille <akim@epita.fr>,
12202 Quoc Peyrot <chojin@lrde.epita.fr>,
12203 Robert Anisko <anisko_r@lrde.epita.fr>
12205 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
12206 when the stacks contain one element, as the loop would otherwise
12207 free the last state, and then use the top state (the one we just
12208 popped). This means that the initial elements will not be freed
12209 explicitly, as is the case in yacc.c; it is not a problem, as
12210 these elements have fake values.
12212 2003-01-11 Paul Eggert <eggert@twinsun.com>
12214 * NEWS: %expect-violations are now just warnings, reverting
12215 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
12216 bootstrapping problem reported by Matthias Klose; see
12217 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
12218 * src/conflicts.c (conflicts_print): Likewise.
12219 * tests/conflicts.at (%expect not enough, %expect too much,
12220 %expect with reduce conflicts): Likewise.
12221 * doc/bison.texinfo (Expect Decl): Document this. Also mention
12222 that the warning is enabled if the number of conflicts changes
12223 (not necessarily increases).
12225 * src/getargs.c (version): Update copyright year.
12227 2003-01-09 Akim Demaille <akim@epita.fr>
12229 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
12231 2003-01-08 Paul Eggert <eggert@twinsun.com>
12233 * Makefile.maint (WGETFLAGS):
12234 New macro, containing "-C off" to disable proxy caches.
12235 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
12236 (rel-check): Use $(WGET) instead of wget.
12238 2003-01-06 Paul Eggert <eggert@twinsun.com>
12240 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
12241 the GLR paper of Scott, Johnstone and Hussain.
12243 2003-01-04 Paul Eggert <eggert@twinsun.com>
12245 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
12246 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
12247 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
12248 (EXTRA_LIBRARIES): New var, for liby.a.
12249 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
12250 (EXTRA_SCRIPTS): New var, for yacc.
12252 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
12253 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
12254 Problem reported by Nelson H. F. Beebe.
12256 2003-01-03 Paul Eggert <eggert@twinsun.com>
12258 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
12259 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
12260 when compiling Bison 1.875's `bitset bset = obstack_alloc
12261 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
12263 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
12264 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
12265 grow to a huge size with typical invocation.
12267 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
12268 Use the pattern recommended by Autoconf 2.57, except also protect
12269 against double-definition.
12270 * src/system.h: Likewise.
12271 Portability issues reported by Nelson H. F. Beebe.
12273 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
12274 All uses changed. Provide a definition in both C and C++.
12275 (yytrue, yyfalse): Define even if defined (__cplusplus).
12277 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
12278 Reported by Nelson H. F. Beebe.
12280 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
12282 2003-01-02 Paul Eggert <eggert@twinsun.com>
12284 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
12285 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
12286 Bug reported by Nelson H. F. Beebe.
12288 2003-01-01 Paul Eggert <eggert@twinsun.com>
12292 2002-12-30 Paul Eggert <eggert@twinsun.com>
12294 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
12296 (<INITIAL>","): Here. This causes stray "," to be treated
12299 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
12300 last brace in braced code when not in Yacc mode, for compatibility
12301 with Bison 1.35. This resurrects the 2001-12-15 patch to
12304 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
12305 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
12307 2002-12-28 Paul Eggert <eggert@twinsun.com>
12309 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
12310 that of SYM's type. This fixes Debian bug 168069, reported by
12313 2002-12-28 Paul Eggert <eggert@twinsun.com>
12317 Switch back to the Yacc style of conflict reports, undoing some
12318 of the 2002-07-30 change.
12319 * doc/bison.texinfo (Understanding): Use Yacc style for
12320 conflict reports. Also, use new way of locating rules.
12321 * src/conflicts.c (conflict_report):
12322 Renamed from conflict_report_yacc, removing the old
12323 'conflict_report'. Translate the entire conflict report at once,
12324 so that we don't assume that "," has the same interpretation in
12326 (conflicts_output): Use Yacc-style conflict report for each state,
12327 instead of our more-complicated style.
12328 (conflicts_print): Use Yacc-style conflict report, except print
12329 the input file name when not emulating Yacc.
12330 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
12331 Conflicted Reduction, %expect not enough, %expect too much,
12332 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
12333 * tests/existing.at (GNU Cim Grammar): Likewise.
12334 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
12336 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
12337 fatal): Don't invoke fflush; it's not needed and it might even be
12338 harmful for stdout, as stdout might not be open.
12339 * src/reduce.c (reduce_print): Likewise.
12341 2002-12-27 Paul Eggert <eggert@twinsun.com>
12343 Fix a bug where error locations were not being recorded correctly.
12344 This problem was originally reported by Paul Hilfinger in
12345 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
12347 * data/yacc.c (yyparse): New local var yylerrsp, to record the
12348 top of the location stack's error locations.
12349 (yyerrlab): Set it. When discarding a token, push its location
12350 onto yylerrsp so that we don't lose track of the error's end.
12351 (yyerrlab1): Now is only the target of YYERROR, so that we can
12352 properly record the location of the action that failed. For GCC
12353 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
12354 GCC warning about yyerrlab1 being unused if YYERROR is unused.
12355 (yyerrlab2): New label, which yyerrlab now falls through to.
12356 Compute the error's location by applying YYLLOC_DEFAULT to
12357 the locations of all the symbols that went into the error.
12358 * doc/bison.texinfo (Location Default Action): Mention that
12359 YYLLOC_DEFAULT is also invoked for syntax errors.
12360 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12361 Error locations include the locations of all the tokens that were
12362 discarded, not just the last token.
12364 2002-12-26 Paul Eggert <eggert@twinsun.com>
12366 * src/files.c: Include quote.h.
12367 (compute_output_file_names): Warn if we detect conflicting
12368 outputs to the same file. This should catch the misunderstanding
12369 exemplified by Debian Bug 165349, reported by Bruce Stephens..
12371 * src/conflicts.c (conflicts_print): If the user specifies
12372 "%expect N", report an error if there are any reduce/reduce
12373 conflicts. This is what the manual says should happen.
12374 This fixes Debian bug 130890, reported by Anthony DeRobertis.
12375 * tests/conflicts.at (%expect with reduce conflicts): New test.
12377 Don't use m4_include on relative file names, as it doesn't work as
12378 desired if there happens to be a file with that name under ".".
12380 * m4sugar/version.m4: Remove; it was included but it wasn't used.
12381 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
12382 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
12383 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
12384 * src/output.c (output_skeleton): Use full path names when
12385 specifying a file to include; don't rely on include path, as
12386 it's unreliable when the working file contains a file with
12389 2002-12-25 Paul Eggert <eggert@twinsun.com>
12391 Remove obsolete references to bison.simple and bison.hairy.
12392 Problem mentioned by Aubin Mahe in
12393 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
12394 * data/glr.c: Comment fix.
12395 * doc/bison.1: Remove references. Also, mention "yacc".
12397 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
12400 * src/parse-gram.y (declaration): Use enum "report_states" rather
12401 than its numeric value 1.
12403 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
12404 opening a new one. This fixes Debian bug 165349, reported by
12407 2002-12-24 Paul Eggert <eggert@twinsun.com>
12411 * Makefile.maint (cvs-update): Don't assume that the shell
12412 supports $(...), as Solaris sh doesn't.
12414 * src/parse-gram.y (lloc_default): Remove test for empty
12415 nonterminals at the end, since it didn't change the result.
12417 2002-12-24 Paul Eggert <eggert@twinsun.com>
12419 If the user does not define YYSTYPE as a macro, Bison now declares it
12420 using typedef instead of defining it as a macro. POSIX requires this.
12421 For consistency, YYLTYPE is also declared instead of defined.
12423 %union directives can now have a tag before the `{', e.g., the
12424 directive `%union foo {...}' now generates the C code
12425 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
12426 The default union tag is `YYSTYPE', for compatibility with Solaris 9
12427 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
12428 instead of `yyltype'.
12430 `yystype' and `yyltype' are now obsolescent macros instead of being
12431 typedefs or tags; they are no longer documented and will be
12432 withdrawn in a future release.
12434 * data/glr.c (b4_location_type): Remove.
12435 (YYSTYPE): Renamed from yystype.
12436 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
12437 (struct YYLTYPE): Renamed from struct yyltype.
12438 (YYLTYPE): Renamed from yyltype.
12439 (yyltype, yystype): New (and obsolescent) macros,
12440 for backward compatibility.
12441 * data/yacc.c: Likewise.
12443 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
12444 does not specify a union tag. This is for compatibility with
12447 * src/parse-gram.y (add_param): 2nd arg is now char * not char
12448 const *, since it is now modified by stripping surrounding { }.
12449 (current_braced_code): Remove.
12450 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
12451 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
12452 trailing " {...}". Now of type <chars>.
12453 (grammar_declaration): Adjust to bundled tokens.
12454 (code_content): Remove; stripping is now done by add_param.
12455 (print_token_value): Print contents of bundled tokens.
12456 (token_name): New function.
12458 * src/reader.h (braced_code, current_braced_code): Remove.
12459 (token_name): New decl.
12461 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
12462 token_type, not braced_code code_kind. All uses changed.
12463 (SC_PRE_CODE): New state, for scanning after a keyword that
12464 has (or usually has) an immediately-following braced code.
12465 (token_type): New local var, to keep track of which token type
12466 to return when scanning braced code.
12467 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
12468 <INITIAL>"%parse-param", <INITIAL>"%printer",
12469 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
12470 instead of returning a token type immediately.
12471 (<INITIAL>"{"): Set token type.
12472 (<SC_BRACED_CODE>"}"): Use it.
12473 (handle_action_dollar, handle_action_at): Now returns bool
12474 indicating success. Fail if ! current_rule; this prevents a core dump.
12475 (handle_symbol_code_dollar, handle_symbol_code_at):
12476 Remove; merge body into caller.
12477 (handle_dollar, handle_at): Complain in invalid contexts.
12479 * NEWS, doc/bison.texinfo: Document the above.
12480 * NEWS: Fix years and program names in copyright notice.
12482 2002-12-17 Paul Eggert <eggert@twinsun.com>
12484 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
12485 Reporting, Table of Symbols): Omit mentions of %lex-param and
12486 %parse-param from the documentation for now.
12488 2002-12-15 Paul Eggert <eggert@twinsun.com>
12490 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
12491 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
12492 lookahead symbol, and which sets yychar in parser actions) and it
12493 disagreed with the Bison documentation. Bug
12494 reported by Andrew Walrond.
12496 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
12497 as the caller now does that.
12498 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
12499 (YYEMPTY): Parenthesize right hand side, since others use it.
12500 (yyparse): Don't assume that our generated code is the only code
12503 2002-12-13 Paul Eggert <eggert@twinsun.com>
12507 POSIX requires a "yacc" command.
12508 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
12509 (MOSTLYCLEANFILES): Add yacc.
12511 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
12512 as an alias for bison y.
12514 * po/LINGUAS: Add da.
12516 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
12517 problem with latest <getopt.h>.
12518 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
12520 * doc/fdl.texi: Upgrade to 1.2.
12521 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
12522 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
12523 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
12525 * config/install-sh: Sync with autotools.
12527 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
12528 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
12529 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
12530 locations are requested.
12531 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
12532 locations are requested.
12534 2002-12-12 Paul Eggert <eggert@twinsun.com>
12536 Remove unportable casts and storage allocation tricks.
12537 While we're at it, remove almost all casts, since they
12538 usually aren't needed and are a sign of trouble.
12540 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
12542 * src/derives.c (derives_compute): Do not subtract NTOKENS from
12543 the pointer DSET returned by malloc; this isn't portable.
12544 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
12545 Similarly for DERIVES.
12546 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
12547 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
12548 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
12550 * src/derives.c (derives_compute): Do not bother invoking
12551 int_of_rule_number, since rule numbers are integers.
12553 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
12554 rather than XMALLOC (char, N).
12556 * src/files.c (filename_split): Rewrite to avoid cast.
12558 * src/gram.h (symbol_number_as_item_number,
12559 item_number_as_symbol_number, rule_number_as_item_number,
12560 item_number_as_rule_number):
12561 Now inline functions rather than macros, to avoid casts.
12562 * src/state.h (state_number_as_int): Likewise.
12563 * src/tables.c (state_number_to_vector_number,
12564 symbol_number_to_vector_number): Likewise.
12566 * src/gram.h (int_of_rule_number): Remove; no longer used.
12568 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
12569 since the resulting storage is always stored into.
12571 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
12574 * src/muscle_tab.c (muscle_m4_output):
12575 Now inline. Return bool, not int.
12576 * src/state.c (state_compare): Likewise.
12577 * src/symtab.c (symbol_check_defined,
12578 symbol_check_alias_consistency, symbol_pack, symbol_translation,
12579 hash_compare_symbol, hash_symbol):
12581 * src/uniqstr.c (uniqstr_print): Likewise.
12582 * src/muscle_tab.c (muscle_m4_output_processor):
12583 New function, to avoid casts.
12584 * src/state.c (state_comparator, stage_hasher): Likewise.
12585 * src/symtab.c (symbol_check_defined_processor,
12586 symbol_check_alias_consistency_processor, symbol_pack_processor,
12587 symbol_translation_processor, hash_symbol_comparator,
12588 hash_symbol_hasher): Likewise.
12589 * src/uniqstr.c (uniqstr_print_processor): Likewise.
12590 * src/muscle_tab.c (muscles_m4_output):
12591 Use new functions instead of casting old functions unportably.
12592 * src/state.c (state_hash_new): Likewise.
12593 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
12594 symbols_token_translations_init):
12596 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
12598 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
12599 var instead of casting to long, to avoid casts.
12600 (prepare_states): Use MALLOC rather than alloca, so that we don't
12601 have to worry about alloca.
12602 * src/state.c (state_hash_lookup): Likewise.
12604 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
12605 local var instead of casting to unsigned char, to avoid casts.
12607 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
12608 STATE_ALLOC): Remove.
12609 (transitions_new, errs_new, reductions_new, state_new): Use malloc
12610 rather than calloc, and use offsetof to avoid allocating slightly
12612 (state_new): Initialize all members.
12614 * src/state.c (state_hash): Use unsigned accumulator, not signed.
12616 * src/symtab.c (symbol_free): Remove; unused.
12617 (symbol_get): Remove cast in lhs of assignment.
12618 (symbols_do): Now static. Accept generic arguments, not
12619 hashing-related ones.
12621 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
12622 (symbol_processor): Remove.
12623 (symbols_do): Remove decl; now static.
12625 * src/system.h (alloca): Remove; decl no longer needed.
12626 (<stddef.h>): Include, for offsetof.
12627 (<inttypes.>, <stdint.h>): Include if available.
12628 (uintptr_t): New type, if system lacks it.
12629 (CALLOC, MALLOC, REALLOC): New macros.
12630 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
12633 * src/tables.c (table_size): Now int, to pacify GCC.
12634 (table_grow, table_ninf_remap): Use signed table size.
12635 (save_row): Don't bother initializing locals when not needed.
12636 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
12637 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
12639 * src/vcg.h: Correct misspellings.
12641 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
12644 * src/getargs.c (getargs): Don't assume EOF == -1.
12646 2002-12-09 Paul Eggert <eggert@twinsun.com>
12648 Change identifier spellings to avoid collisions with names
12649 that are reserved by POSIX.
12651 Don't use names ending in _t, since POSIX reserves them.
12652 For consistency, remove _e and _s endings -- they're weren't
12653 needed to remove ambiguity. All uses changed.
12654 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
12655 turn was just renamed from struniq_t.
12656 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
12657 which in turn was just renamed from struniq_processor_t.
12658 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
12659 in turn was renamed from hash_compare_struniq_t.
12660 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
12661 (state_list): Renamed from state_list_t.
12662 * src/assoc.h (assoc): Renamed from assoc_t.
12663 * src/conflicts.c (enum conflict_resolution): Renamed from
12664 enum conflict_resolution_e.
12665 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
12666 (rule_list): Renamed from rule_list_t.
12667 * src/getargs.h (enum trace): Renamed from enum trace_e.
12668 (enum report): Renamed from enum report_e.
12669 * src/gram.h (item_number): Renamed from item_number_t.
12670 (rule_number): Renamed from rule_number_t.
12671 (struct rule_s): Remove the "rule_s" part; not used.
12672 (rule): Renamed from rule_t.
12673 (rule_filter): Renamed from rule_filter_t.
12674 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
12675 (goto_list): Renamed from goto_list_t.
12676 * src/lalr.h (goto_number): Renamed from goto_number_t.
12677 * src/location.h (location): Renamed from location_t.
12678 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
12679 and moved here from:
12680 * src/muscle_tab.h (muscle_entry_t): here.
12681 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
12682 (rule_list): Renamed from rule_list_t.
12683 * src/print_graph.c (static_graph): Renamed from graph.
12684 * src/reader.h (braced_code): Renamed from braced_code_t.
12685 Remove brace_code_e tag.
12686 * src/relation.h (relation_node): Renamed from relation_node_t.
12687 (relation_nodes): Renamed from relation_nodes_t.
12688 (relation): Renamed from relation_t.
12689 * src/state.h (state_number): Renamed from state_number_t.
12690 (struct state): Renamed from struct state_s.
12691 (state): Renamed from state_t.
12692 (transitions): Renamed from transitions_t. Unused (and
12693 misspelled) transtion_s tag removed.
12694 (errs): Renamed from errs_t. Unused errs_s tag removed.
12695 (reductions): Renamed from reductions_t. Unused tag
12696 reductions_s removed.
12697 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
12698 (struct symbol_list): Renamed from struct symbol_list_s.
12699 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
12700 (struct symbol): Renamed from struct symbol_s.
12701 (symbol): Renamed from symbol_t.
12702 * src/tables.c (vector_number): Renamed from vector_number_t.
12703 (action_number): Renamed from action_t.
12704 * src/tables.h (base_number): Renamed from base_t.
12705 * src/vcg.h (enum color): Renamed from enum color_e.
12706 (enum textmode): Renamed from enum textmode_e.
12707 (enum shape): Renamed from enum shape_e.
12708 (struct colorentry): Renamed from struct colorentry_s.
12709 (struct classname): Renamed from struct classname_s.
12710 (struct infoname): Renamed from struct infoname_s.
12711 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
12712 (enum decision): Renamed from enum decision_e.
12713 (enum orientation): Renamed from enum orientation_e.
12714 (enum alignment): Renamed from enum alignment_e.
12715 (enum arrow_mode): Renamed from enum arrow_mode_e.
12716 (enum crossing_type): Renamed from enum crossing_type_e.
12717 (enum view): Renamed from enum view_e.
12718 (struct node): Renamed from struct node_s.
12719 (node): Renamed from node_t.
12720 (enum linestyle): Renamed from enum linestyle_e.
12721 (enum arrowstyle): Renamed from enum arrowstyle_e.
12722 (struct edge): Renamed from struct edge.
12723 (edge): Renamed from edge_t.
12724 (struct graph): Renamed from struct graph_s.
12725 (graph): Renamed from graph_t.
12726 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
12727 Rename value_t -> value.
12728 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
12729 value_t_as_yystype -> value_as_yystype.
12731 Don't include <errno.h> in the mainstream code, since it
12732 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
12733 * lib/get-errno.c, lib/get-errno.h: New files.
12734 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
12736 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
12737 * src/output.c (output_skeleton): Likewise.
12738 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
12740 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
12742 (handle_action_dollar, handle_action_at): Likewise.
12743 * src/system.h: Do not include <errno.h>.
12744 (TAB_EXT): Renamed from EXT_TAB.
12745 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
12747 Avoid str[a-z]*, since <string.h> reserves that name space.
12748 Change all instances of "struniq" in names to "uniqstr", and
12749 likewise for "STRUNIQ" and "UNIQSTR".
12750 * src/uniqstr.c: Renamed from src/struniq.c.
12751 * src/uniqstr.h: Renamed from src/struniq.h.
12752 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
12753 * src/files.c (strsuffix): Remove; unused.
12754 (concat2): Renamed from stringappend. Now static.
12755 * src/files.h (strsuffix, stringappend): Remove; unused.
12756 * src/parse-gram.y (<chars>): Renamed from <string>.
12757 (<uniqstr>): Renamed from <struniq>.
12758 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
12759 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
12760 (struct graph_s.expand): Renamed from struct graph_s.stretch.
12761 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
12762 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
12763 (N_EXPAND): Renamed from N_STRETCH.
12765 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
12766 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
12767 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
12769 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
12770 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
12771 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
12772 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
12773 (BASE_MAXIMUM): Renamed from BASE_MAX.
12774 (BASE_MINIMUM): Renamed from BASE_MIN.
12775 (ACTION_MAX): Remove; unused.
12776 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
12777 Unnecessary casts removed from above defines.
12780 Fix misspelling in names.
12781 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
12782 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
12786 * lib/timevar.c (timevar_report): Renamed from time_report,
12787 for consistency with other names.
12788 * lib/timevar.h (timevar_report): New decl.
12789 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
12792 Sort include-file uses.
12794 Reorder all include files under src to be in the order "system.h".
12795 then the ../lib include files in angle brackets (alphabetized),
12796 then the . include files in double-quotes (alphabetized). Fix
12797 dependency breakages encountered in this process, as follows:
12798 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
12799 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
12800 * src/state.h: Include "symtab.h".
12802 2002-12-08 Paul Eggert <eggert@twinsun.com>
12804 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
12805 since this causes problems when __file__ contains character
12806 sequences like "@" that are treated specially by src/scan-skel.l.
12807 Instead, just use the file's basename. This fixes the bug
12808 reported by Martin Mokrejs in
12809 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
12811 2002-12-06 Paul Eggert <eggert@twinsun.com>
12813 Add support for rules that do not have trailing semicolons, as
12814 POSIX requires. Improve the quality of locations in Bison
12817 * src/location.c: Include <quotearg.h>.
12818 (empty_location): Now const.
12819 (location_print): New function. Follow the recommendation of the
12820 GNU Coding Standards for locations that span file boundaries.
12821 * src/location.h: Do not include <quotearg.h>; no longer needed.
12822 (boundary): New type.
12823 (location_t): Use it. This allows locations to span file boundaries.
12824 All member uses changed: file -> start.file or end.file (as needed),
12825 first_line -> start.line, first_column -> start.column,
12826 last_line -> end.line, last_column -> end.column.
12827 (equal_boundaries): New function.
12828 (LOCATION_RESET, LOCATION_STEP): Remove.
12829 (LOCATION_PRINT): Remove. All callers changed to use location_print.
12830 (empty_location): Now const.
12831 (location_print): New decl.
12832 * src/parse-gram.y (lloc_default): New function, which handles
12833 empty locations more accurately.
12834 (YYLLOC_DEFAULT): Use it.
12835 (%token COLON): Remove.
12836 (%token ID_COLON): New token.
12838 (declarations, rules): Remove trailing semicolon.
12839 (declaration, rules_or_grammar_declaration):
12840 Allow empty (";") declaration.
12841 (symbol_def): Remove empty actions; no longer needed.
12842 (rules_or_grammar_declaration): Remove trailing semicolon.
12843 (semi_colon.opt): Remove.
12844 * src/reader.h: Include location.h.
12845 (scanner_cursor): New decl.
12846 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
12848 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
12850 (STEP): Remove. No longer needed, now that adjust_location does
12851 the work. All uses removed.
12852 (scanner_cursor): New var.
12853 (adjust_location): Renamed from extend_location. It now sets
12854 *loc and adjusts the scanner cursor. All uses changed.
12855 Don't bother testing for CR.
12856 (handle_syncline): Remove location arg; now updates scanner cursor.
12857 All callers changed.
12858 (unexpected_end_of_file): Now accepts start boundary of token or
12859 comment, not location. All callers changed. Update scanner cursor,
12861 (SC_AFTER_IDENTIFIER): New state.
12862 (context_state): Renamed from c_context. All uses changed.
12863 (id_loc, code_start, token_start): New local vars.
12864 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
12865 processing of Yacc white space and equivalents here.
12866 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
12867 instead of returning ID immediately, since we need to search for
12868 a subsequent colon.
12869 (<INITIAL>"'", "\""): Save token_start.
12870 (<INITIAL>"%{", "{", "%%"): Save code_start.
12871 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
12872 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
12873 BEGIN context_state at end, not INITIAL.
12874 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
12875 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
12876 Return correct token start.
12877 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
12878 the start of a character, string or multiline comment is found.
12879 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
12880 Reduction): Adjust reported locations to match the more-precise
12881 results now expected.
12882 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
12883 * tests/reduce.at (Useless Rules, Reduced Automaton,
12884 Underivable Rules): Likewise.
12885 * tests/regression.at (Invalid inputs): No longer `expecting ";"
12886 or "|"' now that so many other tokens are allowed by the new grammar.
12888 * src/complain.h (current_file): Remove duplicate decl;
12889 current_file is now owned by files.h.
12890 * src/complain.c, src/scan-gram.l: Include files.h.
12892 2002-12-06 Paul Eggert <eggert@twinsun.com>
12894 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
12895 promotes to int; it might be unsigned int.
12896 * data/yacc.c (yy_reduce_print): Likewise.
12898 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
12899 be #defined in the prologue, not in the Bison declarations.
12900 This fixes Debian Bug 102878, reported by Shaul Karl.
12902 2002-12-02 Paul Eggert <eggert@twinsun.com>
12904 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
12905 * lib/strtoul.c: New file, from gnulib.
12906 This fixes a porting bug reported by Peter Klein in
12907 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
12909 2002-11-30 Paul Eggert <eggert@twinsun.com>
12911 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
12912 and put only a forward declaration in the prologue. This is for
12913 consistency with the other scanner helper functions.
12915 Type clashes now generate warnings, not errors, since it
12916 appears that POSIX may allow some grammars with type clashes.
12917 * src/reader.c (grammar_current_rule_check): Warn about
12918 type clashes instead of complaining.
12919 * tests/input.at (Type Clashes): Expect warnings, not complaints.
12921 Add Yacc library, since POSIX requires it.
12922 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
12923 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
12924 * lib/main.c, lib/yyerror.c: New files.
12926 gram_error can be static; it need not be extern.
12927 * src/reader.h (gram_error): Remove decl.
12928 * src/parse-gram.y (gram_error): Now static. Add static decl.
12929 (print_token_value): Omit parameter names from forward decl,
12932 2002-11-29 Paul Eggert <eggert@twinsun.com>
12934 * doc/bison.texinfo: Emphasize that yylex and yyerror must
12935 be declared before being used. E.g., one should typically
12936 declare them in the prologue. Use GNU coding style in examples.
12937 Put "const" consistently after the type it modifies. Mention
12938 that C99 supports "inline". Mention that yyerror traditionally
12941 %parse-param and %lex-param now take just one argument, the
12942 declaration; the argument name is deduced from the declaration.
12944 * doc/bison.texinfo (Parser Function, Pure Calling, Error
12945 Reporting, Table of Symbols): Document this.
12946 * src/parse-gram.y (add_param): New function.
12948 (declaration): Implement new rule for %parse-param and %lex-param.
12949 * src/scan-gram.l: "," now elicits a warning, rather than being
12950 a token; this is more compatible with byacc.
12951 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
12953 2002-11-27 Paul Eggert <eggert@twinsun.com>
12955 Rename identifiers to avoid real and potential collisions.
12957 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
12958 to avoid collision with lex macro described by Bruce Lilly in
12959 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
12960 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12961 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
12962 * src/parse-gram.y (print_token_value): Renamed from yyprint.
12964 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
12965 The name "yycontrol" violates the name space rules, and this stuff
12966 wasn't being used anyway.
12967 (input): Remove action; this stuff wasn't being used.
12968 (gram_error): Rename local variable yylloc -> loc.
12969 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
12970 (YY_DECL): Don't use "yy" at start of local variables.
12971 All uses changed, e.g., yylloc -> loc.
12972 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
12973 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
12974 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
12975 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
12977 * src/parse-gram.y (gram_error): loc is now const *.
12978 * src/reader.h (gram_error): Likewise.
12980 2002-11-24 Paul Eggert <eggert@twinsun.com>
12984 * tests/actions.at (Actions after errors): Use an output format
12985 more similar to that of the Printers and Destructors test.
12986 Test the position of the ';' token too.
12987 (Printers and Destructors): Likewise.
12988 (Printers and Destructors: %glr-parser): Remove for now, to avoid
12989 unnecessarily alarming people when the test fails.
12991 * data/yacc.c (yyerrlab1): Move this label down, so that the
12992 parser does not discard the lookahead token if the user code
12993 invokes YYERROR. This change is required for POSIX conformance.
12995 * lib/error.c: Sync with gnulib.
12997 2002-11-22 Paul Eggert <eggert@twinsun.com>
12999 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
13000 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
13001 * lib/xmalloc.c: Likewise.
13003 2002-11-20 Paul Eggert <eggert@twinsun.com>
13005 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
13007 2002-11-20 Paul Eggert <eggert@twinsun.com>
13009 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
13010 should use `if (! x) abort ();' rather than `assert (x);', and
13011 anyway it's one less thing to worry about configuring.
13013 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
13014 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
13015 and replace all instances of assert with abort.
13016 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
13017 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
13019 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
13020 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
13021 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
13022 hash_find_entry, hash_rehash, hash_insert): Likewise.
13023 * src/conflicts.c (resolve_sr_conflict): Likewise.
13024 * src/lalr.c (set_goto_map, map_goto): Likewise.
13025 * src/nullable.c (nullable_compute): Likewise.
13026 * src/output.c (prepare_rules, token_definitions_output): Likewise.
13027 * src/reader.c (packgram, reader): Likewise.
13028 * src/state.c (state_new, state_free, state_transitions_set,
13029 state_reduction_find): Likewise.
13030 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
13031 symbol_pack): Likewise.
13032 * src/tables.c (conflict_row, pack_vector): Likewise.
13033 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
13034 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
13035 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
13036 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
13038 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
13039 (ARGMATCH_CONSTRAINT): New macro.
13040 (ARGMATCH_ASSERT): Use it.
13042 * src/system.h (verify): New macro.
13043 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
13044 rather than assert.
13045 * src/tables.c (tables_generate): Likewise.
13047 * src/struniq.c (struniq_assert): Now returns void, and aborts
13048 if the assertion is false.
13049 (struniq_assert_p): Remove.
13050 * src/struniq.h: Likewise.
13052 2002-11-18 Paul Eggert <eggert@twinsun.com>
13054 * data/glr.c (yygetLRActions): Replace `yyindex' with
13055 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
13056 This fixes the regression with Sun ONE Studio 7 cc that I reported in
13057 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
13059 2002-11-18 Akim Demaille <akim@epita.fr>
13061 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
13063 From Tim Van Holder.
13065 2002-11-17 Paul Eggert <eggert@twinsun.com>
13067 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
13068 to "SyntaxError" for consistency with my 2002-11-15 change.
13070 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
13071 not define to {}, since this breaks the common use of `YYDPRINTF
13072 ((...));' if a single statement is desired (e.g. before `else').
13073 Work around GCC warnings by surrounding corresponding calls with
13075 (yyhasResolvedValue): Remove unused function.
13076 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
13078 (yyreportSyntaxError): Renamed from yyreportParseError.
13079 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
13081 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
13082 extern when possible. Remove unused initializations.
13084 2002-11-16 Akim Demaille <akim@epita.fr>
13086 Augment the similarity between GLR and LALR traces.
13088 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
13089 (YY_REDUCE_PRINT): New.
13090 (yyparse): Use them.
13091 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
13093 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
13094 state reached after the reduction/recovery, since...
13095 (yyparse, yyprocessOneStack): Report the state we are entering in.
13097 2002-11-16 Akim Demaille <akim@epita.fr>
13099 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
13100 Add support for --trace=skeleton.
13101 * src/scan-skel.l: %option debug.
13102 Scan strings of non-@ or \n instead of character by character.
13103 (scan_skel): Handle trace_skeleton.
13105 (@output_parser_name@, @output_header_name@): ``Restore'' their
13106 support (used to be M4 macros).
13107 * data/yacc.c: Quote larger chunks, a la glr.c.
13108 * data/lalr1.cc: Likewise.
13109 The header guards are no longer available, so use some other
13110 string than `YYLSP_NEEDED'.
13112 2002-11-16 Akim Demaille <akim@epita.fr>
13114 Make the ``Printers and Destructors'' test more verbose, taking
13115 `yacc.c''s behavior as (possibly wrong) reference.
13117 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
13118 instead of fprint on stdout.
13119 Set and report the last_line of the symbols.
13120 Consistently display values and locations.
13122 2002-11-16 Paul Eggert <eggert@twinsun.com>
13124 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
13126 2002-11-15 Paul Eggert <eggert@twinsun.com>
13128 * tests/actions.at (Actions after errors): New test case.
13130 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
13131 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
13132 tests/action.at, tests/calc.at, tests/conflicts.at,
13133 tests/cxx-type.at, tests/regression.at:
13134 "parse error" -> "syntax error" for POSIX compatibility.
13135 "parsing stack overflow..." -> "parser stack overflow" so
13136 that code matches Bison documentation.
13138 2002-11-15 Akim Demaille <akim@epita.fr>
13140 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
13141 take two BRACED_CODE, not two string_content.
13142 Free the scanner's obstack when we are done.
13143 (code_content): New.
13144 * tests/calc.at: Adjust.
13145 * doc/bison.texinfo: Adjust.
13146 Also, make sure to include the `,' for these declarations.
13148 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
13150 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
13151 definition; avoids potential autoreconf problems.
13153 2002-11-15 Akim Demaille <akim@epita.fr>
13155 Always check the value returned by yyparse.
13157 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
13158 returned by yyparse.
13159 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
13161 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
13162 returned by yyparse.
13164 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13166 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
13169 2002-11-14 Paul Eggert <eggert@twinsun.com>
13171 * src/output.c (output_skeleton): Call xfopen instead of
13172 duplicating xfopen's body.
13174 Fix bugs reported by Nelson H. F. Beebe in
13175 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
13177 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
13178 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
13179 Group compiler. Instead, use "$CC -E bar.c". Include the .h
13180 file twice in the grammar, as an extra check.
13182 * tests/input.at (Torturing the Scanner): Surround the
13183 backslash-newline tests with "#if 0", to make it less likely that
13184 we'll run into compiler bugs. Bring back solitary \ inside
13185 comment, but add a closing comment to work around HP C bug. Don't
13186 test backslash-newline in C character constant.
13188 2002-11-14 Akim Demaille <akim@epita.fr>
13190 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
13191 status of the compiler.
13192 Calling `exit 1' is no longer needed.
13193 Reported by Nelson H. F. Beebe.
13195 2002-11-14 Akim Demaille <akim@epita.fr>
13197 * tests/atlocal.in (CPPFLAGS): We have config.h.
13198 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
13200 * tests/actions.at, tests/calc.at, tests/conflicts.at,
13201 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
13202 * tests/regression.at, tests/torture.at: Use them for all the
13203 grammars that are to be compiled.
13204 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
13205 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
13206 * doc/bison.texinfo (GLR Parsers): Document `inline'.
13208 2002-11-14 Akim Demaille <akim@epita.fr>
13210 * doc/bison.texinfo: Various formatting changes (alignments in
13211 samples, additional @group/@end group, GCS in samples.
13212 Use @deffn instead of simple @table to define the directives,
13213 macros, variables etc.
13215 2002-11-13 Paul Eggert <eggert@twinsun.com>
13217 Fix some bugs reported by Albert Chin-A-Young in
13218 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
13220 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
13221 -o c"; the HP C compiler chatters during compilation.
13222 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
13223 * tests/headers.at (export YYLTYPE): Likewise.
13225 * tests/input.at (Torturing the Scanner): Remove lines containing
13226 solitary backslashes, as they tickle a bug in the HP C compiler.
13228 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
13229 comments, since they're not portable. Use GNU coding style.
13231 2002-11-13 Akim Demaille <akim@epita.fr>
13233 * data/yacc.c: Leave bigger chunks of quoted text.
13234 (YYDSYMPRINTF): New.
13235 Use it to report symbol activities.
13236 * data/glr.c (YYDSYMPRINTF): New.
13239 2002-11-12 Paul Eggert <eggert@twinsun.com>
13243 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
13244 (yyglrReduce): Return yyok, not 0.
13245 This should avoid the enumerated-type warnings reported
13246 by Nelson H. F. Beebe in
13247 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
13249 * lib/bbitset.h (BITSET_INLINE): Remove.
13250 * lib/bitset.h [! BITSET_INLINE]: Remove.
13251 (bitset_set, bitset_reset, bitset_test): Rename local vars
13252 to avoid shadowing warnings by GCC.
13254 * data/glr.c (inline): Remove #define. It's the user's
13255 responsibility to #define it away, just like 'const'.
13256 This fixes one of the bugs reported by Nelson H. F. Beebe in
13257 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
13259 * Makefile.maint (po-check): Scan .l and .y files instead of the
13260 .c and the .h files that they generate. This fixes the bug
13261 reported by Tim Van Holder in:
13262 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
13263 Look for N_ as well as for _. Try to avoid matching #define for
13265 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
13266 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
13267 * src/scan-gram.l: Revamp regular expressions so that " and '
13268 do not confuse xgettext.
13270 * src/struniq.h (struniq_new): Do not declare the return type
13271 to be 'const'; this violates the C standard.
13272 * src/struniq.c (struniq_new): Likewise.
13274 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
13276 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
13277 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
13280 2002-11-12 Akim Demaille <akim@epita.fr>
13282 * Makefile.maint: Sync with Autoconf:
13283 (local_updates): New.
13285 2002-11-12 Akim Demaille <akim@epita.fr>
13287 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
13289 2002-11-12 Akim Demaille <akim@epita.fr>
13291 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
13294 2002-11-12 Akim Demaille <akim@epita.fr>
13296 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
13299 2002-11-12 Akim Demaille <akim@epita.fr>
13301 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
13302 Use it to test the GLR parser.
13304 2002-11-12 Akim Demaille <akim@epita.fr>
13306 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
13308 * data/glr.c (yystos): New.
13309 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
13310 (YYDSYMPRINT): New.
13311 (yyval): Don't define it, it is handled via M4.
13312 (yyrecoverParseError): Free verbosely the discarded symbols.
13313 * data/yacc.c (yysymprint): Remove, rather...
13314 (b4_yysymprint_generate): invoke.
13315 * data/c.m4 (b4_yysymprint_generate): New.
13316 Accept pointers as arguments, as opposed to the version from
13318 (b4_yydestruct_generate): Likewise.
13319 * tests/cations.at (Printers and Destructors): Use Bison directives
13320 instead of CPP macros.
13321 Don't rely on internal details.
13323 2002-11-12 Akim Demaille <akim@epita.fr>
13325 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
13326 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
13327 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
13328 it against YYEMPTY and so forth), work on yytoken (i.e., set
13329 it to YYEMPTY etc.).
13330 (yydestruct): Replace with a b4_yydestruct_generate invocation.
13331 (b4_symbol_actions): Remove.
13332 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
13333 for 0, end-of-input.
13335 2002-11-12 Akim Demaille <akim@epita.fr>
13337 * doc/bison.texinfo (Destructor Decl): New.
13339 2002-11-12 Akim Demaille <akim@epita.fr>
13341 * src/tables.c (tables_generate): Use free for pointers that
13342 cannot be NULL, not XFREE.
13343 (pack_vector): Use assert, not fatal, for bound violations.
13344 * src/state.c (state_new): Likewise.
13345 * src/reader.c (reader): Likewise.
13346 * src/lalr.c (set_goto_map): Likewise.
13347 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
13350 2002-11-12 Akim Demaille <akim@epita.fr>
13352 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
13354 * src/scan-gram.l (last_string): Is global to the file, not to
13356 * src/parse-gram.y (input): Don't append the epilogue here,
13357 (epilogue.opt): do it here, and free the scanner's obstack.
13358 * src/reader.c (epilogue_set): Rename as...
13359 (epilogue_augment): this.
13360 * data/c.m4 (b4_epilogue): Defaults to empty.
13362 2002-11-12 Akim Demaille <akim@epita.fr>
13364 * src/getargs.c (long_options): Remove duplicates.
13365 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
13367 * doc/bison.rnh: Remove.
13368 * doc/bison.texinfo (VMS Invocation): Remove.
13370 2002-11-12 Akim Demaille <akim@epita.fr>
13372 * src/struniq.h, src/struniq.c (struniq_t): Is const.
13373 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
13375 Use struniq for symbols.
13377 * src/symtab.h (symbol_t): The tag member is a struniq.
13378 (symbol_type_set): Adjust.
13379 * src/symtab.c (symbol_new): Takes a struniq.
13380 (symbol_free): Don't free the tag member.
13381 (hash_compare_symbol_t, hash_symbol_t): Rename as...
13382 (hash_compare_symbol, hash_symbol): these.
13383 Use the fact that tags as struniqs.
13384 (symbol_get): Use struniq_new.
13385 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
13387 * src/reader.h (merger_list, grammar_currentmerge_set): The name
13388 and type members are struniqs.
13389 * src/reader.c (get_merge_function)
13390 (grammar_current_rule_merge_set): Adjust.
13391 (TYPE, current_type): Are struniq.
13393 Use struniq for file names.
13395 * src/files.h, src/files.c (infile): Split into...
13396 (grammar_file, current_file): these.
13397 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
13398 * src/reduce.c (reduce_print): Likewise.
13399 * src/getargs.c (getargs): Likewise.
13400 * src/complain.h, src/complain.c: Likewise.
13401 * src/main.c (main): Call struniqs_new early enough to use it for
13403 Don't free the input file name.
13405 2002-11-12 Akim Demaille <akim@epita.fr>
13407 * src/symtab.c (symbol_free): Remove dead deactivated code:
13408 type_name are properly removed.
13409 Don't use XFREE to free items that cannot be NULL.
13410 * src/struniq.h, src/struniq.c: New.
13411 * src/main.c (main): Initialize/free struniqs.
13412 * src/parse-gram.y (%union): Add astruniq member.
13414 * src/scan-gram.l (<{tag}>): Return a struniq.
13415 Free the obstack bit that used to store it.
13416 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
13418 2002-11-11 Paul Eggert <eggert@twinsun.com>
13420 Revamp to fix many (but not all) of the C- and M4-related quoting
13421 problems. Among other things, this fixes the Bison bug reported
13422 by Jan Hubicka when processing the Bash grammar; see:
13423 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
13425 Use new @ escapes consistently. Represent brackets with @{ and @}
13426 rather than @<:@ and @:>@, since this works a bit better with dumb
13427 editors like vi. Represent @ with @@, since @ is now consistently
13428 an escape. Use @oline@ and @ofile@ rather than __oline__ and
13429 __ofile__, to avoid unexpected expansions. Similarly, use @output
13430 rather than #output.
13432 * data/c.m4 (b4_copyright): Omit file name from comment, since
13433 the file name could contain "*/".
13434 (b4_synclines_flag): Don't quote the 2nd argument; it should already
13435 be quoted. All uses changed.
13437 * data/glr.c: Use new @ escapes consistently.
13438 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
13439 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
13440 Remove, since they couldn't handle arbitrary characters in file
13442 * data/lalr1.cc: Likewise.
13443 * data/yacc.c: Likewise.
13445 * src/files.c (output_infix): Remove; all uses removed.
13446 * src/files.h: Likewise.
13448 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
13449 mishandled funny characters in file names, and anyway it isn't
13451 * data/yacc.c: Likewise.
13452 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
13454 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
13455 * data/yacc.c: Likewise.
13457 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
13459 (muscle_init): Quote filename as a C string.
13460 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
13461 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
13462 * src/output.c (escaped_file_name_output): New function.
13463 (prepare_symbols): Quote tokens for M4.
13464 (prepare): Don't insert output_infix, output_prefix,
13465 output_parser_name, output_header_name; this is now down by scan-skel.
13466 Insert skeleton as a C string.
13468 * src/output.c (user_actions_output, symbol_destructors_output,
13469 symbol_printers_output): Quote filenames for C and M4.
13470 * src/reader.c (prologue_augment, epilogue_set): Likewise.
13472 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
13473 escapes other than \\ and \'; this simplifies the code.
13474 (<SC_STRING>): Likewise, for \\ and \".
13475 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
13476 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
13477 Use new escapes @{ and @} for [ and ].
13479 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
13480 them with auto vars.
13481 Switch to new escape scheme, where @ is the escape character uniformly.
13482 Abort if a stray escape character is found. Avoid unbounded input
13483 buffer when parsing non-escaped text.
13485 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
13486 __oline__, #output, $@, and @{ do not have unintended meanings.
13488 2002-11-09 Paul Eggert <eggert@twinsun.com>
13490 Fix the test failure due to GCC warnings described in
13491 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
13492 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
13493 evaluate to 0 if it's impossible for NINF to be in the respective
13495 (yygetLRActions, yyrecoverParseError): Use them.
13497 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
13498 counted in the token inserted at end of file. Now takes
13499 location_t *, not location_t, so that the location can be
13500 adjusted. All uses changed.
13502 * tests/regression.at (Invalid inputs): Adjust wording in
13503 diagnostic to match the new behavior.
13505 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
13506 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
13507 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
13508 abort ();'. This reduces the runtime of the "Many lookaheads"
13509 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
13512 2002-11-07 Paul Eggert <eggert@twinsun.com>
13514 * src/parse-gram.y (CHARACTER): Remove unused token.
13517 * src/scan-gram.l: Remove stack option. We no longer use the
13518 stack, since the stack was never deeper than 1; instead, use the
13519 new auto var c_context to record the stacked value.
13521 Remove nounput option. At an unexpected end of file, we now unput
13522 the minimal input necessary to end cleanly; this simplifies the
13525 Avoid unbounded token sizes where this is easy.
13527 (unexpected_end_of_file): New function.
13528 Use it to systematize the error message on unexpected EOF.
13529 (last-string): Now auto, not static.
13530 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
13531 (scanner_last_string_free): Remove; not used.
13532 (percent_percent_count): Move decl to just before use.
13533 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
13534 not the (never otherwised-used) CHARACTER.
13536 2002-11-07 Akim Demaille <akim@epita.fr>
13538 Let yyerror always receive the msg as last argument, so that
13539 yyerror can be variadic.
13541 * data/yacc.c (b4_yyerror_args): New.
13542 Use it when calling yyerror.
13543 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
13544 Use it when calling yyerror.
13545 * doc/bison.texinfo (Error Reporting): Adjust.
13546 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
13547 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
13549 2002-11-06 Akim Demaille <akim@epita.fr>
13551 #line should have quoted strings.
13552 Ideally, this should be done by m4_quotearg.
13554 * src/scan-skel.l: Include quotearg.h.
13556 * src/output.c (symbol_printers_output)
13557 (symbol_destructors_output): Quote the file name.
13559 2002-11-06 Akim Demaille <akim@epita.fr>
13561 * tests/regression.at (Invalid inputs): Adjust to the recent
13564 2002-11-06 Akim Demaille <akim@epita.fr>
13566 Restore --no-lines.
13567 Reported by Jim Kent.
13569 * data/c.m4 (b4_syncline): New.
13570 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
13571 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
13572 * src/output.c (user_actions_output): Likewise.
13573 (prepare): Define 'b4_synclines_flag'.
13574 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
13576 2002-11-06 Akim Demaille <akim@epita.fr>
13578 * src/main.c (main): Free `infile'.
13579 * src/scan-gram.l (handle_syncline): New.
13581 * src/output.c (user_actions_output, symbol_destructors_output)
13582 (symbol_printers_output): Use the location's file name, not
13584 * src/reader.c (prologue_augment, epilogue_set): Likewise.
13586 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13588 * src/tables.c (matching_state): Don't allow states to match if
13589 either has GLR conflict entries.
13591 2002-11-05 Paul Eggert <eggert@twinsun.com>
13593 * src/scan-gram.l: Use more accurate diagnostics, e.g.
13594 "integer out of range" rather than "invalid value".
13595 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
13598 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
13599 Also, remove one static variable in the scanner.
13601 * src/scan-gram.l (braces_level): Now auto, not static.
13602 Initialize to zero if the compiler is being picky.
13603 (INITIAL): Clear braces_level instead of incrementing it.
13604 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
13605 as POSIX 1003.1-2001 requires.
13606 * src/system.h (IF_LINT): New macro, taken from coreutils.
13607 * configure.ac: Define "lint" if --enable-gcc-warnings.
13609 2002-11-05 Akim Demaille <akim@epita.fr>
13611 * src/scan-gram.l: When it starts with `%', complain about the
13612 whole directive, not just that `invalid character: %'.
13614 2002-11-04 Akim Demaille <akim@epita.fr>
13616 * Makefile.maint: Update from Autoconf.
13617 (update, cvs-update, po-update, do-po-update): New.
13619 2002-11-04 Akim Demaille <akim@epita.fr>
13621 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
13623 Have yyerror `use' its arguments.
13624 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
13625 returns true when location & yacc & pure & parse-param.
13626 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
13628 2002-11-04 Akim Demaille <akim@epita.fr>
13630 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
13632 * src/scan-gram.l: Use [\'] instead of ['] to pacify
13635 Use quote, not quote_n since LOCATION_PRINT no longer uses the
13638 2002-11-03 Paul Eggert <eggert@twinsun.com>
13640 * src/reader.c (get_merge_function, grammar_current_rule_check):
13641 Use consistent diagnostics for reporting type name clashes.
13642 Quote the types with <>, for consistency with Yacc.
13643 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
13645 2002-11-03 Akim Demaille <akim@epita.fr>
13647 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
13649 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
13650 (b4_parse_param): Remove.
13651 Use b4_identification.
13652 Propagate b4_pure_args where needed to pass them to yyerror.
13653 * data/glr.m4 (b4_parse_param): Remove.
13654 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
13655 (b4_lpure_formals): New.
13656 Use b4_identification.
13657 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
13658 b4_user_formals and b4_user_args.
13659 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
13660 (yyreportAmbiguity): When using a pure parser, also need
13661 the location, and the parse-params.
13663 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
13664 When using a pure parser, also need the parse-params.
13666 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
13667 (%pure-parser + %parse-param) LALR and GLR parsers.
13668 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
13669 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
13670 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
13671 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
13672 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
13673 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
13674 * doc/bison.texinfo: Untabify the whole file.
13675 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
13676 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
13677 (Error Reporting): Adjust to these new directives.
13678 Document %error-verbose, deprecate YYERROR_VERBOSE.
13680 2002-11-03 Akim Demaille <akim@epita.fr>
13682 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
13683 AT_CHECK_CALC_GLR invocations to use % directives, instead of
13684 command line options.
13685 * tests/cxx-type.at: Formatting changes.
13687 2002-11-03 Paul Eggert <eggert@twinsun.com>
13689 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
13690 to count columns correctly, and to check for invalid inputs.
13692 Use mbsnwidth to count columns correctly. Account for tabs, too.
13693 Include mbswidth.h.
13694 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
13695 (extend_location): New function.
13696 (YY_LINES): Remove.
13698 Handle CRLF in C code rather than in Lex code.
13699 (YY_INPUT): New macro.
13700 (no_cr_read): New function.
13702 Scan UCNs, even though we don't fully handle them yet.
13703 (convert_ucn_to_byte): New function.
13705 Handle backslash-newline correctly in C code.
13706 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
13707 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
13709 (tag, splice): New EREs. Do not allow NUL or newline in tags.
13710 Use {splice} wherever C allows backslash-newline.
13711 YY_STEP after space, newline, vertical-tab.
13712 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
13714 (letter, id): Don't assume ASCII; e.g., spell out a-z.
13716 ({int}, handle_action_dollar, handle_action_at): Check for integer
13719 (YY_STEP): Omit trailing semicolon, so that it's more like C.
13721 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
13722 as well as \000. Check for UCHAR_MAX, not 255.
13723 Allow \x with an arbitrary positive number of digits, as in C.
13724 Check for overflow here.
13725 Allow \? and UCNs, for compatibility with C.
13727 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
13728 with quote slot used by complain_at.
13730 * tests/input.at: Add tests for backslash-newline, m4 quotes
13731 in symbols, long literals, and funny escapes in strings.
13733 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
13734 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
13735 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
13736 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
13737 * m4/mbswidth.m4: New file, from GNU coreutils.
13739 * doc/bison.texinfo (Grammar Outline): Document // comments.
13740 (Symbols): Document that trigraphs have no special meaning in Bison,
13741 nor is backslash-newline allowed.
13742 (Actions): Document that trigraphs have no special meaning.
13744 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
13747 2002-11-02 Paul Eggert <eggert@twinsun.com>
13749 * src/reader.c: Don't include quote.h; not needed.
13750 (get_merge_function): Reword warning to be consistent with
13751 type clash diagnostic in grammar_current_rule_check.
13753 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
13754 bug in trigraph handling.
13756 * src/output.c (prepare_symbols): When printing token names,
13757 escape "[" as "@<:@" and likewise for "]".
13759 * src/system.h (errno): Remove declaration, as we are now
13760 assuming C89 or better, and C89 guarantees errno.
13762 2002-10-30 Paul Eggert <eggert@twinsun.com>
13764 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
13765 Check for close failures.
13766 * src/files.h (xfclose): Return void, not int, since it always
13768 * src/files.c (xfclose): Likewise. Report I/O error if ferror
13770 * src/output.c (output_skeleton): Use xfclose rather than fclose
13771 and ferror. xfclose now checks ferror.
13773 * data/glr.c (YYLEFTMOST_STATE): Remove.
13774 (yyreportTree): Use a stack-based leftmost state. This avoids
13775 our continuing battles with bogus warnings about initializers.
13777 2002-10-30 Akim Demaille <akim@epita.fr>
13779 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
13782 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13784 * tests/glr-regr1.at: New test for reported regressions.
13785 * tests/testsuite.at: Add glr-regr1.at test.
13786 * tests/Makefile.am: Add glr-regr1.at test.
13788 2002-10-24 Paul Eggert <eggert@twinsun.com>
13792 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
13793 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
13794 we use malloc. Don't assume 'A' through 'Z' are contiguous.
13795 Don't assume strdup exists; POSIX says its an XSI extension.
13796 Check for buffer overflow on input.
13798 2002-10-24 Akim Demaille <akim@epita.fr>
13800 * src/output.c (output_skeleton): Don't disable M4sugar comments
13801 too soon: it results in comments being expanded.
13802 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
13805 2002-10-24 Akim Demaille <akim@epita.fr>
13807 * data/yacc.c (m4_int_type): New.
13808 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
13809 char' as only yacc.c wants K&R portability.
13810 * data/glr.c (yysigned_char): Remove.
13811 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
13812 Reported by Quoc Peyrot.
13814 2002-10-23 Paul Eggert <eggert@twinsun.com>
13816 * src/main.c (main): With --trace=time, report times even if a
13817 non-fatal error occurs. Formerly, the times were reported in some
13818 such cases but not in others.
13819 * src/reader.c (reader): Just return if a complaint has been issued,
13820 instead of exiting, so that 'main' can report times.
13822 2002-10-22 Akim Demaille <akim@epita.fr>
13824 * src/system.h: Include sys/types.
13825 Reported by Bert Deknuydt.
13827 2002-10-23 Paul Eggert <eggert@twinsun.com>
13829 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
13830 Suggested by Art Haas.
13832 2002-10-22 Paul Eggert <eggert@twinsun.com>
13834 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
13835 decl; not needed any more.
13836 * src/main.c (main): Use return to exit, undoing yesterday's change.
13837 The last OS that we could find where this wouldn't work is
13838 SunOS 3.5, and that's too old to worry about now.
13840 * data/glr.c (struct yyltype): Define members even when not
13841 doing locations. This is more consistent with yacc.c, and it
13842 works around the following bug reports:
13843 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
13844 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
13846 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
13847 @acronym consistently. Standardize on "Yacc" instead of "YACC",
13848 "Algol" instead of "ALGOL". Give a bit more history about BNF.
13850 2002-10-22 Akim Demaille <akim@epita.fr>
13852 * data/README: New.
13854 2002-10-21 Paul Eggert <eggert@twinsun.com>
13856 Be consistent about 'bool'; the old code used an enum in one
13857 module and an int in another, and this violates the C standard.
13858 * m4/stdbool.m4: New file, from coreutils 4.5.3.
13859 * configure.ac (AC_HEADER_STDBOOL): Add.
13860 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
13861 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
13862 * src/symtab.c (hash_compare_symbol_t): Likewise.
13863 * src/system.h (bool, false, true): Use a definition consistent
13864 with ../lib/hash.c. All uses changed.
13866 * src/complain.c (warning_issued): Renamed from warn_message_count,
13867 so that we needn't worry about integer overflow (!).
13868 Now of type bool. All uses changed.
13869 (complaint_issued): Renamed from complain_message_count; likewise.
13871 * src/main.c (main): Use exit to exit with failure.
13873 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
13874 rather than 1 and 0.
13875 * src/main.c (main): Likewise.
13876 * src/getargs.c (getargs): Likewise.
13877 * src/reader.c (reader): Likewise.
13879 * src/getarg.c (getargs): Remove duplicate code for
13880 "Try `bison --help'".
13882 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
13883 What was that "2" for?
13885 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
13886 * src/getargs.c (usage): Likewise.
13888 * src/getargs.c (getargs): When there are too few operands, report
13889 the last one. When there are too many, report the first extra
13890 one. This is how diffutils does it.
13892 2002-10-20 Paul Eggert <eggert@twinsun.com>
13894 Remove K&R vestiges.
13895 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
13896 * src/complain.c (VA_START): Remove. Assume prototypes.
13897 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
13898 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
13899 fatal): Assume prototypes.
13900 * src/complain.h: Assume prototypes.
13901 * src/system.h (PARAMS): Remove.
13902 Include <limits.h> unconditionally, since it's guaranteeed even
13903 for a freestanding C89 compiler.
13904 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
13905 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
13907 2002-10-20 Akim Demaille <akim@epita.fr>
13909 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
13910 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
13911 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
13912 (yyresolveStates, yyresolveAction, yyresolveStack)
13913 (yyprocessOneStack): Use them.
13914 (yy_reduce_print): New.
13915 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
13917 2002-10-20 Akim Demaille <akim@epita.fr>
13919 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
13920 arguments and output `void'.
13921 (b4_c_function): Rename as...
13922 (b4_c_function_def): this.
13923 (b4_c_function_decl, b4_c_ansi_function_def)
13924 (b4_c_ansi_function_decl): New.
13925 Change the interpretation of the arguments: before `int, foo', now
13927 * data/yacc.c (yyparse): Prototype and define thanks to these.
13928 Adjust b4_c_function_def uses.
13929 * data/glr.c (yyparse): Likewise, but ANSI only.
13931 2002-10-20 Akim Demaille <akim@epita.fr>
13933 * src/output.c (prepare): Move the definition of `tokens_number',
13934 `nterms_number', `undef_token_number', `user_token_number_max'
13936 (prepare_tokens): Here.
13937 (prepare_tokens): Rename as...
13938 (prepare_symbols): this.
13939 (prepare): Move the definition of `rules_number' to...
13940 (prepare_rules): here.
13941 (prepare): Move the definition of `last', `final_state_number',
13942 `states_number' to...
13943 (prepare_states): here.
13944 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
13946 2002-10-20 Akim Demaille <akim@epita.fr>
13948 * src/tables.h, src/tables.c, src/output.c: Comment changes.
13950 2002-10-20 Akim Demaille <akim@epita.fr>
13952 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
13955 2002-10-20 Akim Demaille <akim@epita.fr>
13957 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
13958 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
13960 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
13962 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
13963 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
13966 2002-10-19 Paul Eggert <eggert@twinsun.com>
13968 Do not create a temporary file, as that involves security and
13969 cleanup headaches. Instead, use a pair of pipes.
13970 Derived from a suggestion by Florian Krohm.
13971 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
13972 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
13973 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
13974 (BISON_PREREQ_SUBPIPE): Add.
13975 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
13976 Add subpipe.h, subpipe.c.
13977 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
13978 * po/POTFILES.in: Add lib/subpipe.c.
13979 * src/output.c: Include "subpipe.h".
13980 (m4_invoke): Remove decl.
13981 (scan_skel): New decl.
13982 (output_skeleton): Use pipe rather than temporary file for m4 input.
13983 Check that m4sugar.m4 is readable, to avoid deadlock.
13984 Check for pipe I/O error.
13985 * src/scan-skel.l (readpipe): Remove decl.
13986 (scan_skel): New function, to be used in place of m4_invoke.
13987 Read from stream rather than file.
13989 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
13990 float, as this generates a warning on Solaris 8 + GCC 3.2 with
13991 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
13992 this generates a more-accurate value anyway.
13994 * lib/timevar.c (timervar_accumulate): Rename locals to
13995 avoid confusion with similarly-named more-global.
13996 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
13998 * src/output.c (prepare): Use xstrdup to convert char const *
13999 to char *, to avoid GCC warning.
14001 2002-10-19 Akim Demaille <akim@epita.fr>
14003 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
14004 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
14005 Use them to have `calc.y' ready for %pure-parser.
14006 * data/yacc.c (YYLEX): Pass a yylex return type to
14007 b4_c_function_call.
14009 2002-10-19 Akim Demaille <akim@epita.fr>
14011 Prototype support of %lex-param and %parse-param.
14013 * src/parse-gram.y: Add the definition of the %lex-param and
14014 %parse-param tokens, plus their rules.
14015 Drop the `_' version of %glr-parser.
14017 * src/scan-gram.l (INITIAL): Scan them.
14018 * src/muscle_tab.c: Comment changes.
14019 (muscle_insert, muscle_find): Rename `pair' as `probe'.
14020 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
14021 (muscle_entry_s): The `value' member is no longer const.
14022 Adjust all dependencies.
14023 * src/muscle_tab.c (muscle_init): Adjust: use
14024 MUSCLE_INSERT_STRING.
14025 Initialize the obstack earlier.
14026 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
14027 (muscle_pair_list_grow): New.
14028 * data/c.m4 (b4_c_function_call, b4_c_args): New.
14029 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
14030 * tests/calc.at: Use %locations, not --locations.
14031 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
14033 2002-10-19 Akim Demaille <akim@epita.fr>
14035 * src/getargs.c (usage): Take status as argument and exit
14037 Report the traditional `Try ... --help' message when status != 0.
14038 (usage, version): Don't take a FILE * as arg, it is pointless.
14039 (getargs): When there is an incorrect number of arguments, make it
14040 an error, and report it GNUlically thanks to `usage ()'.
14042 2002-10-18 Paul Eggert <eggert@twinsun.com>
14044 * data/glr.c (yyreportParseError): Don't assume that sprintf
14045 yields the length of the printed string, as this is not true
14046 on SunOS 4.1.4. Reported by Peter Klein.
14048 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
14049 * tests/conflicts.at (%nonassoc and eof): Likewise.
14050 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
14052 2002-10-17 Akim Demaille <akim@epita.fr>
14054 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
14055 * src/getargs.c (trace_types, trace_args): Adjust.
14056 * src/reader.c (grammar_current_rule_prec_set)
14057 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
14058 Standardize error messages.
14059 And s/@prec/%prec/!
14060 (reader): Use trace_flag to enable scanner/parser debugging,
14061 instead of an adhoc scheme.
14062 * src/scan-gram.l: Remove trailing debugging code.
14064 2002-10-16 Paul Eggert <eggert@twinsun.com>
14066 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
14069 * NEWS: Officially drop support for building Bison with K&R C,
14070 since it didn't work anyway and it's not worth worrying about.
14071 * Makefile.maint (wget_files): Remove ansi2knr.c.
14072 (ansi2knr.c-url_prefix): Remove.
14073 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
14074 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14075 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14077 2002-10-15 Paul Eggert <eggert@twinsun.com>
14079 Stop using the "enum_" trick for K&R-style function definitions;
14080 it confused me, and I was the author! Instead, assume that people
14081 who want to use K&R C compilers (when using these modules in GCC,
14082 perhaps?) will run ansi2knr.
14084 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
14085 All uses of "enum_" changed to "enum ".
14086 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
14087 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
14089 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
14090 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
14091 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
14092 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
14093 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
14094 abitset_not, abitset_ones, abitset_or, abitset_or_and,
14095 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
14096 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
14097 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
14098 Use function prototypes; this removes the need for declaring
14099 static functions simply to provide their prototypes.
14100 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
14101 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
14102 bitset_count_, bitset_create, bitset_dump, bitset_first,
14103 bitset_free, bitset_init, bitset_last, bitset_next,
14104 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
14105 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
14106 bitset_print, bitset_release_memory, bitset_toggle_,
14107 bitset_type_choose, bitset_type_get, bitset_type_name_get,
14108 debug_bitset): Likewise.
14109 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
14110 * lib/bitset_stats.c (bitset_log_histogram_print,
14111 bitset_percent_histogram_print, bitset_stats_and,
14112 bitset_stats_and_cmp, bitset_stats_and_or,
14113 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
14114 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
14115 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
14116 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
14117 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
14118 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
14119 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
14120 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
14121 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
14122 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
14123 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
14124 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
14125 bitset_stats_zero): Likewise.
14126 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
14127 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
14128 bitsetv_dump, debug_bitsetv): Likewise.
14129 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
14130 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
14131 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
14132 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
14133 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
14134 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
14135 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
14136 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
14137 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
14138 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
14139 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
14141 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
14142 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
14143 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
14144 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
14145 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
14146 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
14147 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
14148 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
14149 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
14150 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
14151 lbitset_xor_cmp, lbitset_zero): Likewise.
14153 2002-10-14 Akim Demaille <akim@epita.fr>
14157 2002-10-14 Akim Demaille <akim@epita.fr>
14159 * tests/Makefile.am (maintainer-check-posix): New.
14161 2002-10-14 Akim Demaille <akim@epita.fr>
14163 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
14166 2002-10-14 Akim Demaille <akim@epita.fr>
14168 * src/tables.c (table_ninf_remap): base -> tab.
14169 Reported by Matt Rosing.
14171 2002-10-14 Paul Eggert <eggert@twinsun.com>
14173 * tests/action.at, tests/calc.at, tests/conflicts.at,
14174 tests/cxx-type.at, tests/headers.at, tests/input.at,
14175 tests/regression.at, tests/synclines.at, tests/torture.at:
14176 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
14177 so that the tests still work even if POSIXLY_CORRECT is set.
14178 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
14180 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
14181 for portability to K&R hosts. Fix typo: signed char is guaranteed
14182 only to 127, not to 128.
14183 * data/glr.c (yysigned_char): New type.
14184 * data/yacc.c (yysigned_char): Likewise.
14185 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
14187 2002-10-13 Paul Eggert <eggert@twinsun.com>
14189 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
14190 true due to limited range of data type" warning from GCC.
14192 * data/c.m4 (b4_token_defines): Protect against double-inclusion
14193 by wrapping enum yytokentype's definition inside #ifndef
14194 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
14196 2002-10-13 Akim Demaille <akim@epita.fr>
14198 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
14199 Un yy- yyrhs to avoid the name clash with the global YYRHS.
14201 2002-10-13 Akim Demaille <akim@epita.fr>
14203 * Makefile.maint: Update from Autoconf 2.54.
14204 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
14206 2002-10-13 Akim Demaille <akim@epita.fr>
14208 * src/print.c (print_state): Separate the list of solved conflicts
14209 from the other items.
14210 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
14212 2002-10-13 Akim Demaille <akim@epita.fr>
14214 Let nondeterministic skeletons be usable with deterministic
14217 With the patch, GAWK compiled by GCC without -O2 passes its test
14218 suite using a GLR parser driven by LALR tables. It fails with -O2
14219 because `struct stat' gives two different answers on my machine:
14220 88 (definition of an auto var) and later 96 (memset on this var).
14221 Hence the stack is badly corrumpted. The headers inclusion is to
14222 blame: if I move the awk.h inclusion before GLR's system header
14223 inclusion, the two struct stat have the same size.
14225 * src/tables.c (pack_table): Always create conflict_table.
14226 (token_actions): Always create conflict_list.
14227 * data/glr.c (YYFLAG): Remove, unused.
14229 2002-10-13 Akim Demaille <akim@epita.fr>
14231 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
14233 (VALGRIND, GXX): New.
14234 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
14235 * tests/bison.in: Run $PREBISON a pre-command.
14236 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
14237 (maintainer-check-g++): New.
14238 * Makefile.am (maintainer-check): New.
14240 2002-10-13 Akim Demaille <akim@epita.fr>
14242 * data/glr.c: Formatting changes.
14243 Tweak some trace messages to match yacc.c's.
14245 2002-10-13 Akim Demaille <akim@epita.fr>
14247 GLR parsers sometimes raise parse errors instead of performing the
14249 Reported by Charles-Henry de Boysson.
14251 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
14252 check the length of the traces when %glr.
14253 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
14255 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
14257 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
14258 (yyltype): Remove the yy prefix from the member names.
14259 (yytable): Complete its comment.
14260 (yygetLRActions): Map error action number from YYTABLE from
14262 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
14263 (which was a bug: it should have been YYTABEL_NINF, and yet it was
14264 not satisfying as we could compare an YYACTION computed from
14265 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
14266 only value for error actions.
14267 (yyreportParseError): In verbose parse error messages, don't issue
14268 `error' in the list of expected tokens.
14269 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
14270 next action to perform to match glr.c's decoding.
14271 (yytable): Complete its comment.
14273 2002-10-13 Paul Eggert <eggert@twinsun.com>
14275 Fix problem reported by Henrik Grubbstroem in
14276 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
14277 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
14278 because the Bison parser reads the second action before reducing
14280 * src/scan-gram.l (rule_length): New static var.
14281 Use it to keep track of the rule length in the scanner, since
14282 we can't expect the parser to be in lock-step sync with the scanner.
14283 (handle_action_dollar, handle_action_at): Use this var.
14284 * tests/actions.at (Exotic Dollars): Test for the problem.
14286 2002-10-12 Paul Eggert <eggert@twinsun.com>
14288 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
14289 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
14290 Include <sys/time.h> when checking for clock_t and struct tms.
14291 Use same include order as source.
14292 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
14293 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
14295 * lib/timevar.c: Update copyright date and clarify comments.
14296 (get_time) [IN_GCC]: Keep the GCC version for reference.
14298 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
14299 GCC version as of today, then merge Bison's changes.
14300 Change "GCC" to "Bison" in copyright notice. timevar.def's
14301 author is Akim, so change that too.
14303 * src/reader.c (grammar_current_rule_check):
14304 Don't worry about the default action if $$ is untyped.
14305 Prevents bogus warnings reported by Jim Gifford in
14306 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
14308 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
14309 * data/glr.c, data/lalr1.cc, data/yacc.c:
14310 Output token definitions before the first part of user declarations.
14311 Fixes compatibility problem reported by Jim Gifford for kbd in
14312 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14314 2002-10-11 Paul Eggert <eggert@twinsun.com>
14316 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
14317 (yyparse): here. This undoes some of the 2002-07-25 change.
14318 Compatibility problem reported by Ralf S. Engelschall with
14319 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
14321 2002-10-11 Akim Demaille <akim@epita.fr>
14323 * tests/regression.at Characters Escapes): New.
14324 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
14326 Reported by Jan Nieuwenhuizen.
14328 2002-10-11 Akim Demaille <akim@epita.fr>
14332 2002-10-10 Paul Eggert <eggert@twinsun.com>
14334 Portability fixes for bitsets; this also avoids several GCC
14337 * lib/abitset.c: Include <stddef.h>, for offsetof.
14338 * lib/lbitset.c: Likewise.
14340 * lib/abitset.c (abitset_bytes): Return a size that is aligned
14341 properly for vectors of objects. Do not assume that adding a
14342 header size to a multiple of a word size yields a value that is
14343 properly aligned for the whole union.
14344 * lib/bitsetv.c (bitsetv_alloc): Likewise.
14346 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
14347 unique names for structures.
14348 * lib/ebitset.c (ebitset_bytes): Likewise.
14349 * lib/lbitset.c (lbitset_bytes): Likewise.
14351 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
14352 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
14353 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
14354 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
14355 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
14356 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
14357 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
14358 to improve the type-checking that GCC can do.
14359 * lib/bitset.c (bitset_op4_cmp): Likewise.
14360 * lib/bitset_stats.c (bitset_stats_count,
14361 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
14362 bitset_stats_copy, bitset_stats_disjoint_p,
14363 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
14364 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
14365 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
14366 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
14367 bitset_stats_and_or_cmp, bitset_stats_andn_or,
14368 bitset_stats_andn_or_cmp, bitset_stats_or_and,
14369 bitset_stats_or_and_cmp): Likewise.
14370 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
14371 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
14372 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
14373 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
14375 * lib/abitset.h: Include bitset.h, not bbitset.h.
14376 * lib/ebitset.h: Likewise.
14377 * lib/lbitset.h: Likewise.
14379 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
14380 All instances of parameters of type enum bitset_opts are now of
14381 type enum_bitset_opts, to conform to the C Standard, and similarly
14382 for enum_bitset_type.
14383 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
14384 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
14386 Do not use "struct bitset_struct" to mean different things in
14387 different modules. Not only is this confusing, it violates
14388 the C Standard, which requires that structure types in different
14389 modules must be compatible if one is to be passed to the other.
14390 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
14391 All instances of "struct bitset_struct *" replaced with "bitset".
14392 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
14393 (union bitset_union, struct abitset_struct, struct ebitset_struct,
14394 struct lbitset_struct, struct bitset_stats_struct): New types.
14395 All uses of struct bitset_struct changed to union bitset_union,
14397 * lib/abitset.c (struct abitset_struct, abitset,
14398 struct bitset_struct): Remove.
14399 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
14400 struct bitset_struct): Remove.
14401 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
14402 bitset_struct): Remove.
14403 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
14406 Do not call a function of type T using a call that assumes the
14407 function is of a different type U. Standard C requires that a
14408 function must be called with a type that is compatible with its
14410 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
14412 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
14414 * lib/ebitset.c (PFV): Remove.
14415 * lib/lbitset.c (PFV): Likewise.
14416 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
14417 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
14419 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
14420 (ebitset_vtable): Use them.
14421 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
14422 lbitset_xor): New functions.
14423 (lbitset_vtable): Use them.
14425 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
14428 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
14430 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
14431 Use offsetof, for simplicity.
14433 2002-10-06 Paul Eggert <eggert@twinsun.com>
14435 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
14436 the same width as int. This reapplies a hunk of the 2002-08-12 patch
14437 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
14438 which was inadvertently undone by the 2002-09-30 patch.
14439 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
14440 the same width as int.
14442 2002-10-04 Paul Eggert <eggert@twinsun.com>
14446 * configure.ac (AC_INIT), NEWS: Increment version number.
14448 * doc/bison.texinfo: Minor spelling, grammar, and white space
14450 (Symbols): Mention that any negative value returned from yylex
14451 signifies end-of-input. Warn about negative chars. Mention
14452 the portable Standard C character set.
14454 The GNU coding standard says CFLAGS and YFLAGS are reserved
14455 for the installer to set.
14456 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
14457 * src/Makefile.am (AM_CFLAGS): Likewise.
14458 (AM_YFLAGS): Renamed from YFLAGS.
14460 Fix some MAX and MIN problems.
14461 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
14462 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
14463 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
14464 * src/reader.c (reader): Use it.
14466 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
14467 POSIX 1003.1-2001 has removed fgrep.
14469 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
14471 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
14472 interpreted as signed.
14473 * lib/ebitset.c (ebitset_list): Fix bug.
14475 2002-10-01 Paul Eggert <eggert@twinsun.com>
14477 More fixes for 64-bit hosts and large bitsets.
14479 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
14480 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
14481 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
14482 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
14483 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
14484 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
14485 bitset_count_): Likewise.
14486 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
14487 bitset_first, bitset_last): Likewise.
14488 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
14489 bitset_stats_list_reverse, bitset_stats_size,
14490 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
14492 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14493 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
14494 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
14495 bitsetv_reflexive_transitive_closure): Likewise.
14496 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
14497 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
14499 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
14502 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
14503 Use size_t, not unsigned int, to count bytes.
14504 * lib/abitset.h (abitset_bytes): Likewise.
14505 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
14507 * lib/bitset.h (bitset_bytes): Likewise.
14508 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
14509 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
14510 * lib/bitsetv.c (bitsetv_alloc): Likewise.
14511 * lib/ebitset.c (ebitset_bytes): Likewise.
14512 * lib/ebitset.h (ebitset_bytes): Likewise.
14513 * lib/lbitset.c (lbitset_bytes): Likewise.
14514 * lib/lbitset.h (lbitset_bytes): Likewise.
14516 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
14517 abitset_subset_p, abitset_disjoint_p, abitset_and,
14518 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
14519 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
14520 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
14521 abitset_or_and, abitset_or_and_cmp):
14522 Use bitset_windex instead of unsigned int.
14523 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
14524 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
14525 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
14526 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
14528 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
14530 * lib/bitset.c (bitset_print):
14531 Use proper printf formats for widths of integer types.
14532 * lib/bitset_stats.c (bitset_percent_histogram_print,
14533 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
14534 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14535 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
14536 * lib/lbitset.c (lbitset_bytes): Likewise.
14538 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
14539 BITSET_SIZE_MAX): New macros.
14540 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
14541 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
14542 to BITSET_WINDEX_MAX.
14544 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
14545 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
14546 since we now return the bitset_bindex type (not int).
14548 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
14549 when computing sizes.
14550 * lib/ebitset.c (ebitset_elts_grow): Likewise.
14552 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
14553 and avoid cast to unsigned.
14555 2002-09-30 Akim Demaille <akim@epita.fr>
14557 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
14558 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
14559 Updates from Michael Hayes.
14561 2002-09-30 Art Haas <ahaas@neosoft.com>
14563 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
14565 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
14568 2002-09-27 Akim Demaille <akim@epita.fr>
14572 2002-09-27 Akim Demaille <akim@epita.fr>
14574 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
14575 (Because of AC_LIBSOURCE).
14577 2002-09-27 Akim Demaille <akim@epita.fr>
14579 Playing with Autoscan.
14581 * configure.ac: Remove the old LIBOBJ tweaks.
14582 (AC_REPLACE_FUNCS): Add strrchr and strtol.
14583 * lib/strrchr.c: New.
14584 * lib/strtol.c: New, from the Coreutils 4.5.1.
14586 2002-09-27 Akim Demaille <akim@epita.fr>
14588 Playing with Autoscan.
14590 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
14591 * lib/Makefile.am (libbison_a_SOURCES): No longer include
14592 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
14593 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
14596 2002-09-24 Akim Demaille <akim@epita.fr>
14598 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
14599 (Frequently Asked Questions, Parser Stack Overflow): New.
14601 2002-09-13 Akim Demaille <akim@epita.fr>
14603 Playing with autoscan.
14605 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
14606 * src/files.c (skeleton_find): Remove, unused.
14607 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
14608 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
14610 2002-09-13 Akim Demaille <akim@epita.fr>
14612 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
14613 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
14615 2002-09-13 Akim Demaille <akim@epita.fr>
14617 * configure.ac: Require 2.54.
14618 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
14619 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
14620 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
14621 Remove, provided by Autoconf macros.
14623 2002-09-12 Akim Demaille <akim@epita.fr>
14625 * m4/prereq.m4: Update, from Coreutils 4.5.1.
14627 2002-09-12 Akim Demaille <akim@epita.fr>
14629 * m4/prereq.m4: Update, from Fileutils 4.1.5.
14630 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
14631 Reported by Martin Mokrejs.
14633 2002-09-10 Akim Demaille <akim@epita.fr>
14635 * src/parse-gram.y: Associate a human readable string to each
14637 * tests/regression.at (Invalid inputs): Adjust.
14639 2002-09-10 Gary V. Vaughan <gary@gnu.org>
14641 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
14642 with an Autoconf-2.5x style configure.ac.
14644 2002-09-06 Paul Eggert <eggert@twinsun.com>
14646 * doc/bison.texinfo (Conditions): Make explicit that the GPL
14647 exception applies only to yacc.c. This is a modification of a
14648 patch originally suggested by Akim Demaille.
14650 2002-09-06 Akim Demaille <akim@epita.fr>
14652 * data/c.m4 (b4_copyright): Move the GPL exception comment from
14654 * data/yacc.c: here.
14656 * data/lalr1.cc (struct yyltype): Don't define it, since we use
14658 (b4_ltype): Default to yy::Location from location.hh.
14660 2002-09-04 Jim Meyering <jim@meyering.net>
14662 * data/yacc.c: Guard the declaration of yytoknum also with
14663 `#ifdef YYPRINT', so it is declared only when used.
14665 2002-09-04 Akim Demaille <akim@epita.fr>
14667 * configure.in: Rename as...
14668 * configure.ac: this.
14671 2002-09-04 Akim Demaille <akim@epita.fr>
14673 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
14674 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
14675 translate maintainer only messages.
14677 2002-08-12 Paul Eggert <eggert@twinsun.com>
14681 * Makefile.am (SUBDIRS): Remove intl.
14682 (DISTCLEANFILES): Remove.
14683 * NEWS: Mention that GNU M4 is now required. Clarify what is
14684 meant by "larger grammars". Mention the pt_BR translation.
14685 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
14686 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
14687 Bump version from 0.11.2 to 0.11.5.
14688 (BISON_PREREQ_STAGE): Remove.
14689 (AM_GNU_GETTEXT): Use external gettext.
14690 (AC_OUTPUT): Remove intl/Makefile.
14692 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
14694 * data/glr.c: Include string.h, for strlen.
14695 (yyreportParseError): Use size_t for yysize.
14696 (yy_yypstack): No longer nested inside yypstates, as nested
14697 functions are not portable. Do not assume size_t is the
14699 (yypstates): Do not assume that ptrdiff_t is the same width
14700 as int, and similarly for yyposn and YYINDEX.
14702 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
14704 * lib/Makefile.am (INCLUDES): Do not include from the intl
14705 directory, which has been removed.
14706 * src/Makefile.am (INCLUDES): Likewise.
14708 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
14709 (bitsets_sources, additional_bitsets_sources, timevars_sources):
14712 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
14713 * tests/Makefile.am (EXTRA_DIST): Likewise.
14715 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
14716 Do not assume that bitset_windex is the same width as unsigned.
14718 * lib/abitset.c (abitset_unused_clear): Do not assume that
14719 bitset_word is the same width as int.
14720 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
14721 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
14722 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
14723 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
14724 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
14726 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
14727 portability to one's complement hosts!).
14728 * lib/ebitset.c (ebitset_op1): Likewise.
14729 * lib/lbitset.c (lbitset_op1): Likewise.
14731 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
14732 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
14733 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
14734 Sync with fileutils.
14735 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
14736 lib/gettext.h: Sync with diffutils.
14738 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
14739 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
14741 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
14742 PROTOTYPES to check for prototypes, and "defined __STDC__" to
14745 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
14746 size_t; the old version tried to do this but casted improperly.
14747 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
14748 (bitset_test): Now returns int, not unsigned long.
14750 * lib/bitset_stats.c: Include "gettext.h".
14752 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
14753 name locals "index", as it generates unnecessary warnings on some
14754 hosts that have an "index" function.
14756 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
14757 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
14758 they need translation.
14759 * src/LR0.c (state_list_append, new_itemsets, get_state,
14760 append_states, generate_states): Likewise.
14761 * src/assoc.c (assoc_to_string): Likewise.
14762 * src/closure.c (print_closure, set_firsts, closure): Likewise.
14763 * src/gram.c (grammar_dump): Likewise.
14764 * src/injections.c (injections_compute): Likewise.
14765 * src/lalr.c (lookaheads_print): Likewise.
14766 * src/relation.c (relation_transpose): Likewise.
14767 * src/scan-gram.l: Likewise.
14768 * src/tables.c (table_grow, pack_vector): Likewise.
14770 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
14771 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
14772 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
14773 * m4/mbstate_t.m4: Sync with fileutils.
14774 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
14776 * po/LINGUAS: Add pt_BR.
14777 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
14778 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
14780 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
14782 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
14784 * src/complain.c (strerror_r): Remove decl; not needed.
14785 (strerror): Use same pattern as ../lib/error.c.
14787 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
14789 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
14791 * src/main.c (main): Cast result of bindtextdomain and textdomain
14792 to void, to avoid a GCC warning when --disable-nls is in effect.
14794 * src/scan-gram.l: Use strings rather than escapes when possible,
14795 to minimize the number of warnings from xgettext.
14796 (handle_action_dollar, handle_action_at): Don't use isdigit,
14797 as it mishandles negative chars and it may not work as expected
14798 outside the C locale.
14800 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
14801 this is a GCC extension and is not portable to other compilers.
14803 * src/system.h (alloca): Use same pattern as ../lib/error.c.
14804 Do not include <ctype.h>; no longer needed.
14805 Do not include <malloc.h>; no longer needed (and generates
14806 warnings on OpenBSD 3.0).
14808 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
14811 * tests/regression.at: Do not use 'cc -c input.c -o input';
14812 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
14814 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
14815 exit status as failure, not just exit status 1. Sun C exits
14816 with status 2 sometimes.
14818 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
14819 Use it for the two large tests.
14821 2002-08-02 Akim Demaille <akim@epita.fr>
14823 * src/conflicts.c (conflicts_output): Don't output rules never
14824 reduced here, since anyway that computation doesn't work.
14825 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
14826 (rule_useless_p, rule_never_reduced_p): New.
14827 (grammar_rules_partial_print): Use a filter instead of a range.
14828 Display the title only if needed.
14829 (grammar_rules_print): Adjust.
14830 (grammar_rules_never_reduced_report): New.
14831 * src/tables.c (action_row): Move the computation of rules never
14833 (token_actions): here.
14834 * src/main.c (main): Make the parser before making the report, so
14835 that rules never reduced are computed.
14836 Call grammar_rules_never_reduced_report.
14837 * src/print.c (print_results): Report rules never reduced.
14838 * tests/conflicts.at, tests/reduce.at: Adjust.
14840 2002-08-01 Akim Demaille <akim@epita.fr>
14842 Instead of attaching lookaheads and duplicating the rules being
14843 reduced by a state, attach the lookaheads to the reductions.
14845 * src/state.h (state_t): Remove the `lookaheads',
14846 `lookaheads_rule' member.
14847 (reductions_t): Add a `lookaheads' member.
14848 Use a regular array for the `rules'.
14849 * src/state.c (reductions_new): Initialize the lookaheads member
14851 (state_rule_lookaheads_print): Adjust.
14852 * src/state.h, src/state.c (state_reductions_find): New.
14853 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
14854 (count_rr_conflicts): Adjust.
14855 * src/lalr.c (LArule): Remove.
14856 (add_lookback_edge): Adjust.
14857 (state_lookaheads_count): New.
14858 (states_lookaheads_initialize): Merge into...
14859 (initialize_LA): this.
14860 (lalr_free): Adjust.
14861 * src/main.c (main): Don't free nullable and derives too early: it
14862 is used by --verbose.
14863 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
14865 2002-08-01 Akim Demaille <akim@epita.fr>
14867 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
14869 (set_derives, free_derives): Rename as...
14870 (derives_compute, derives_free): this.
14871 Adjust all dependencies.
14872 * src/nullable.c (set_nullable, free_nullable): Rename as...
14873 (nullable_compute, nullable_free): these.
14874 (rule_list_t): Store rule_t *, not rule_number_t.
14875 * src/state.c (state_rule_lookaheads_print): Directly compare rule
14876 pointers, instead of their numbers.
14877 * src/main.c (main): Call nullable_free, and derives_free earlier,
14878 as they were lo longer used.
14880 2002-08-01 Akim Demaille <akim@epita.fr>
14882 * lib/timevar.c (get_time): Include children time.
14883 * src/lalr.h (LA, LArule): Don't export them: used with the
14885 * src/lalr.c (LA, LArule): Static.
14886 * src/lalr.h, src/lalr.c (lalr_free): New.
14887 * src/main.c (main): Call it.
14888 * src/tables.c (pack_vector): Check whether loc is >= to the
14890 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
14891 (tables_generate): do it, since that's also it which allocates
14893 Don't free LA and LArule, main does.
14895 2002-07-31 Akim Demaille <akim@epita.fr>
14897 Separate parser tables computation and output.
14899 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
14900 (conflict_list, conflict_list_cnt, table, check, table_ninf)
14901 (yydefgoto, yydefact, high): Move to...
14902 * src/tables.h, src/tables.c: here.
14903 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14904 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14905 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
14906 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
14907 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
14908 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
14909 (action_row, save_row, token_actions, save_column, default_goto)
14910 (goto_actions, sort_actions, matching_state, pack_vector)
14911 (table_ninf_remap, pack_table, prepare_actions): Move to...
14912 * src/tables.c: here.
14913 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
14914 * src/output.c (token_actions, output_base, output_conflicts)
14915 (output_check): Merge into...
14916 (prepare_actions): this.
14917 (actions_output): Rename as...
14918 (user_actions_output): this.
14919 * src/main.c (main): Call tables_generate and tables_free.
14921 2002-07-31 Akim Demaille <akim@epita.fr>
14923 Steal GCC's --time-report support.
14925 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
14926 stolen/adjusted from GCC.
14927 * m4/stage.m4: Remove time related checks.
14928 * m4/timevar.m4: New.
14929 * configure.in: Adjust.
14930 * src/system.h: Adjust to using timevar.h.
14931 * src/getargs.h, src/getargs.c: Support trace_time for
14933 * src/main.c (stage): Remove.
14934 (main): Replace `stage' invocations with timevar calls.
14935 * src/output.c: Insert pertinent timevar calls.
14937 2002-07-31 Akim Demaille <akim@epita.fr>
14939 Let --trace have arguments.
14941 * src/getargs.h (enum trace_e): New.
14942 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
14943 (long_options, short_options): --trace/-T takes an optional
14945 Change all the uses of trace_flag to reflect the new flags.
14946 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
14948 Strengthen `stage' portability.
14950 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
14951 * configure.in: Use it.
14952 Don't check for malloc.h and sys/times.h.
14953 * src/system.h: Include them when appropriate.
14954 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
14955 times and struct tms are available.
14957 2002-07-30 Akim Demaille <akim@epita.fr>
14959 In verbose parse error message, don't report `error' as an
14961 * tests/actions.at (Printers and Destructors): Adjust.
14962 * tests/calc.at (Calculator $1): Adjust.
14963 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
14964 error message, do not report the parser accepts the error token in
14967 2002-07-30 Akim Demaille <akim@epita.fr>
14969 Normalize conflict related messages.
14971 * src/complain.h, src/complain.c (warn, complain): New.
14972 * src/conflicts.c (conflicts_print): Use them.
14973 (conflict_report_yacc): New, extracted from...
14974 (conflicts_print): here.
14975 * tests/conflicts.at, tests/existing.at: Adjust.
14977 2002-07-30 Akim Demaille <akim@epita.fr>
14979 Report rules which are never reduced by the parser: those hidden
14982 * src/LR0.c (save_reductions): Don't make the final state too
14983 different: save its reduction (accept) instead of having a state
14984 without any action (no shift or goto, no reduce).
14985 Note: the final state is now a ``regular'' state, i.e., the
14986 parsers now contain `reduce 0' as default reduction.
14987 Nevertheless, since they decide to `accept' when yystate =
14988 final_state, they still will not reduce rule 0.
14989 * src/print.c (print_actions, print_reduction): Adjust.
14990 * src/output.c (action_row): Track reduced rules.
14991 (token_actions): Report rules never reduced.
14992 * tests/conflicts.at, tests/regression.at: Adjust.
14994 2002-07-30 Akim Demaille <akim@epita.fr>
14996 `stage' was accidently included in a previous patch.
14997 Initiate its autoconfiscation.
14999 * configure.in: Look for malloc.h and sys/times.h.
15000 * src/main.c (stage): Adjust.
15001 Report only when trace_flag.
15003 2002-07-29 Akim Demaille <akim@epita.fr>
15005 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
15007 (errs_t): symbol_t*, not symbol_number_t.
15008 (reductions_t): rule_t*, not rule_number_t.
15009 (FOR_EACH_SHIFT): New.
15010 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
15011 * src/print.c, src/print_graph.c: Adjust.
15013 2002-07-29 Akim Demaille <akim@epita.fr>
15015 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
15017 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
15018 (endtoken, accept): these.
15019 * src/reader.c (reader): Set endtoken's default tag to "$end".
15020 Set undeftoken's tag to "$undefined" instead of "$undefined.".
15021 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
15024 2002-07-29 Akim Demaille <akim@epita.fr>
15026 * src/reduce.c (reduce_grammar): When the language is empty,
15027 complain about the start symbol, not the axiom.
15029 * tests/reduce.at (Empty Language): New.
15031 2002-07-26 Akim Demaille <akim@epita.fr>
15033 * src/reader.h, src/reader.c (gram_error): ... can't get
15034 yycontrol without making too strong assumptions on the parser
15036 * src/output.c (prepare_tokens): Use the real 0th value of
15037 token_translations instead of `0'.
15038 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
15040 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
15041 for the time being: %locations ought to provide it to yyerror.
15043 2002-07-25 Akim Demaille <akim@epita.fr>
15045 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
15046 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
15047 * tests/regression.at (Web2c Actions): Adjust.
15049 2002-07-25 Akim Demaille <akim@epita.fr>
15051 Stop storing rules from 1 to nrules + 1.
15053 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
15054 * src/nullable.c, src/output.c, src/print.c, src/reader.c
15055 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
15056 Iterate from 0 to nrules.
15057 Use rule_number_as_item_number and item_number_as_rule_number.
15058 Adjust to `derive' now containing possibly 0.
15059 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
15060 Handle the `- 1' part in rule numbers from/to item numbers.
15061 * src/conflicts.c (log_resolution): Fix the message which reversed
15063 * src/output.c (action_row): Initialize default_rule to -1.
15064 (token_actions): Adjust.
15065 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
15067 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
15069 2002-07-25 Akim Demaille <akim@epita.fr>
15071 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
15072 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
15073 (b4_c_knr_arg_decl): New.
15074 * data/yacc.c: Use it to define yysymprint, yydestruct, and
15075 yyreport_parse_error.
15077 2002-07-25 Akim Demaille <akim@epita.fr>
15079 * data/yacc.c (yyreport_parse_error): New, extracted from...
15081 (yydestruct, yysymprint): Move above yyparse.
15084 2002-07-25 Akim Demaille <akim@epita.fr>
15086 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
15088 (b4_sint_type, b4_uint_type): these.
15089 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
15090 * tests/regression.at (Web2c Actions): Adjust.
15092 2002-07-25 Akim Demaille <akim@epita.fr>
15094 * src/gram.h (TIEM_NUMBER_MAX): New.
15095 (item_number_of_rule_number, rule_number_of_item_number): Rename
15097 (rule_number_as_item_number, item_number_as_rule_number): these.
15098 Adjust dependencies.
15099 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
15100 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
15101 (symbol_number_to_vector_number): New.
15102 (order): Of vector_number_t* type.
15103 (base_t, BASE_MAX, BASE_MIN): New.
15104 (froms, tos, width, pos, check): Of base_t type.
15105 (action_number_t, ACTION_MIN, ACTION_MAX): New.
15106 (actrow): Of action_number_t type.
15107 (conflrow): Of unsigned int type.
15108 (table_ninf, base_ninf): New.
15109 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
15110 (muscle_insert_int_table, muscle_insert_base_table)
15111 (muscle_insert_rule_number_table): New.
15112 (prepare_tokens): Output `toknum' as int_table.
15113 (action_row): Returns a rule_number_t.
15114 Use ACTION_MIN, not SHRT_MIN.
15115 (token_actions): yydefact is rule_number_t*.
15116 (table_ninf_remap): New.
15117 (pack_table): Use it for `base' and `table'.
15118 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
15120 (YYPACT_NINF, YYTABLE_NINF): these.
15121 (yypact, yytable): Compute their types instead of hard-coded
15123 * tests/regression.at (Web2c Actions): Adjust.
15125 2002-07-19 Akim Demaille <akim@epita.fr>
15127 * src/scan-gram.l (id): Can start with an underscore.
15129 2002-07-16 Akim Demaille <akim@epita.fr>
15131 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
15132 Adjust all former `associativity' dependencies.
15133 * src/symtab.c (symbol_new): Default associativity is `undef', not
15135 (symbol_check_alias_consistence): Adjust.
15137 2002-07-09 Akim Demaille <akim@epita.fr>
15139 * doc/bison.texinfo: Properly set the ``header'' part.
15140 Use @dircategory ``GNU programming tools'' as per Texinfo's
15144 2002-07-09 Akim Demaille <akim@epita.fr>
15146 * lib/quotearg.h: Protect against multiple inclusions.
15147 * src/location.h (location_t): Add a `file' member.
15148 (LOCATION_RESET, LOCATION_PRINT): Adjust.
15149 * src/complain.c (warn_at, complain_at, fatal_at): Drop
15150 `error_one_per_line' support.
15152 2002-07-09 Akim Demaille <akim@epita.fr>
15154 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
15155 * src/reader.c (lineno): Remove.
15156 Adjust all dependencies.
15157 (get_merge_function): Take a location and use complain_at.
15158 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
15159 * tests/regression.at (Invalid inputs, Mixing %token styles):
15162 2002-07-09 Akim Demaille <akim@epita.fr>
15164 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
15165 recovery rule, and forbid extensions when --yacc.
15166 (gram_error): Use complain_at.
15167 * src/reader.c (reader): Exit if there were parse errors.
15169 2002-07-09 Akim Demaille <akim@epita.fr>
15171 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
15172 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
15173 Reported by R Blake <blakers@mac.com>.
15175 2002-07-09 Akim Demaille <akim@epita.fr>
15177 * data/yacc.c: Output the copyright notive in the header.
15179 2002-07-03 Akim Demaille <akim@epita.fr>
15181 * src/output.c (froms, tos): Are state_number_t.
15182 (save_column): sp, sp1, and sp2 are state_number_t.
15183 (prepare): Rename `final' as `final_state_number', `nnts' as
15184 `nterms_number', `nrules' as `rules_number', `nstates' as
15185 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
15187 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
15188 * data/lalr1.cc (nsym_): Remove, unused.
15190 2002-07-03 Akim Demaille <akim@epita.fr>
15192 * src/lalr.h, src/lalr.c (goto_number_t): New.
15193 * src/lalr.c (goto_list_t): New.
15195 * src/nullable.c (rule_list_t): New.
15197 * src/types.h: Remove.
15199 2002-07-03 Akim Demaille <akim@epita.fr>
15201 * src/closure.c (print_fderives): Use rule_rhs_print.
15202 * src/derives.c (print_derives): Use rule_rhs_print.
15203 (rule_list_t): New, replaces `shorts'.
15204 (set_derives): Add comments.
15205 * tests/sets.at (Nullable, Firsts): Adjust.
15207 2002-07-03 Akim Demaille <akim@epita.fr>
15209 * src/output.c (prepare_actions): Free `tally' and `width'.
15210 (prepare_actions): Allocate and free `order'.
15211 * src/symtab.c (symbols_free): Free `symbols'.
15212 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
15213 * src/output.c (m4_invoke): Move to...
15214 * src/scan-skel.l: here.
15215 (<<EOF>>): Close yyout, and free its name.
15217 2002-07-03 Akim Demaille <akim@epita.fr>
15219 Fix some memory leaks, and fix a bug: state 0 was examined twice.
15221 * src/LR0.c (new_state): Merge into...
15222 (state_list_append): this.
15223 (new_states): Merge into...
15224 (generate_states): here.
15225 (set_states): Don't ensure a proper `errs' state member here, do it...
15226 * src/conflicts.c (conflicts_solve): here.
15227 * src/state.h, src/state.c: Comment changes.
15228 (state_t): Rename member `shifts' as `transitions'.
15229 Adjust all dependencies.
15230 (errs_new): For consistency, also take the values as argument.
15231 (errs_dup): Remove.
15232 (state_errs_set): New.
15233 (state_reductions_set, state_transitions_set): Assert that no
15234 previous value was assigned.
15236 (states_free): Use it.
15237 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
15238 temporary storage: use `errs' and `nerrs' as elsewhere.
15239 (set_conflicts): Allocate and free this `errs'.
15241 2002-07-02 Akim Demaille <akim@epita.fr>
15243 * lib/libiberty.h: New.
15244 * lib: Update the bitset implementation from upstream.
15245 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
15246 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
15247 * src/main.c: Adjust bitset stats calls.
15249 2002-07-01 Paul Eggert <eggert@twinsun.com>
15251 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
15252 char, so that negative chars don't collide with $.
15254 2002-06-30 Akim Demaille <akim@epita.fr>
15256 Have the GLR tests be `warning' checked, and fix the warnings.
15258 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
15259 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
15260 (yyremoveDeletes): `yyi' and `yyj' are size_t.
15261 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
15262 (yyaddDeferredAction): static.
15263 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
15264 (yyreportParseError): yyprefix is const.
15265 yytokenp is used only when verbose.
15266 (yy__GNUC__): Replace with __GNUC__.
15267 (yypdumpstack): yyi is size_t.
15268 (yypreference): Un-yy local variables and arguments, to avoid
15269 clashes with `yyr1'. Anyway, we are not in the user name space.
15270 (yytname_size): be an int, as is compared with ints.
15271 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
15273 * tests/cxx-gram.at: Use quotation to protect $1.
15274 Use AT_COMPILE to enable warnings hunts.
15275 Prototype yylex and yyerror.
15277 Include `string.h', not `strings.h'.
15278 Produce and prototype stmtMerge only when used.
15279 yylex takes a location.
15281 2002-06-30 Akim Demaille <akim@epita.fr>
15283 We spend a lot of time in quotearg, in particular when --verbose.
15285 * src/symtab.c (symbol_get): Store a quoted version of the key.
15286 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
15287 Adjust all callers.
15289 2002-06-30 Akim Demaille <akim@epita.fr>
15291 * src/state.h (reductions_t): Rename member `nreds' as num.
15292 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
15293 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
15295 2002-06-30 Akim Demaille <akim@epita.fr>
15297 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
15298 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
15299 (shifts_to): Rename as...
15300 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
15301 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
15302 (TRANSITION_IS_DISABLED, transitions_to): these.
15304 2002-06-30 Akim Demaille <akim@epita.fr>
15306 * src/print.c (print_shifts, print_gotos): Merge into...
15307 (print_transitions): this.
15308 (print_transitions, print_errs, print_reductions): Align the
15309 lookaheads columns.
15310 (print_core, print_transitions, print_errs, print_state,
15311 print_grammar): Output empty lines separator before, not after.
15312 (state_default_rule_compute): Rename as...
15313 (state_default_rule): this.
15314 * tests/conflicts.at (Defaulted Conflicted Reduction),
15315 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
15316 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
15318 2002-06-30 Akim Demaille <akim@epita.fr>
15320 Display items as we display rules.
15322 * src/gram.h, src/gram.c (rule_lhs_print): New.
15323 * src/gram.c (grammar_rules_partial_print): Use it.
15324 * src/print.c (print_core): Likewise.
15325 * tests/conflicts.at (Defaulted Conflicted Reduction),
15326 (Unresolved SR Conflicts): Adjust.
15327 (Unresolved SR Conflicts): Adjust and rename as...
15328 (Resolved SR Conflicts): this, as was meant.
15329 * tests/regression.at (Web2c Report): Adjust.
15331 2002-06-30 Akim Demaille <akim@epita.fr>
15333 * src/print.c (state_default_rule_compute): New, extracted from...
15334 (print_reductions): here.
15335 Pessimize, but clarify the code.
15336 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
15338 2002-06-30 Akim Demaille <akim@epita.fr>
15340 * src/output.c (action_row): Let default_rule be always a rule
15343 2002-06-30 Akim Demaille <akim@epita.fr>
15345 * src/closure.c (print_firsts, print_fderives, closure):
15346 Use BITSET_EXECUTE.
15347 * src/lalr.c (lookaheads_print): Likewise.
15348 * src/state.c (state_rule_lookaheads_print): Likewise.
15349 * src/print_graph.c (print_core): Likewise.
15350 * src/print.c (print_reductions): Likewise.
15351 * src/output.c (action_row): Likewise.
15352 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
15354 2002-06-30 Akim Demaille <akim@epita.fr>
15356 * src/print_graph.c: Use report_flag.
15358 2002-06-30 Akim Demaille <akim@epita.fr>
15360 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
15362 * src/relation.h, src/relation.c (traverse, relation_digraph)
15363 (relation_print, relation_transpose): New.
15365 2002-06-30 Akim Demaille <akim@epita.fr>
15367 * src/state.h, src/state.c (shifts_to): New.
15368 * src/lalr.c (build_relations): Use it.
15370 2002-06-30 Akim Demaille <akim@epita.fr>
15372 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
15373 (item_number_of_rule_number, rule_number_of_item_number): New.
15374 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
15375 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
15376 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
15377 Propagate their use.
15378 Much remains to be done, in particular wrt `shorts' from types.h.
15380 2002-06-30 Akim Demaille <akim@epita.fr>
15382 * src/symtab.c (symbol_new): Initialize the `printer' member.
15384 2002-06-30 Akim Demaille <akim@epita.fr>
15386 * src/LR0.c (save_reductions): Remove, replaced by...
15387 * src/state.h, src/state.c (state_reductions_set): New.
15388 (reductions, errs): Rename as...
15389 (reductions_t, errs_t): these.
15390 Adjust all dependencies.
15392 2002-06-30 Akim Demaille <akim@epita.fr>
15394 * src/LR0.c (state_list_t, state_list_append): New.
15395 (first_state, last_state): Now symbol_list_t.
15396 (this_state): Remove.
15397 (new_itemsets, append_states, save_reductions): Take a state_t as
15399 (set_states, generate_states): Adjust.
15400 (save_shifts): Remove, replaced by...
15401 * src/state.h, src/state.c (state_shifts_set): New.
15402 (shifts): Rename as...
15404 Adjust all dependencies.
15405 * src/state.h (state_t): Remove the `next' member.
15407 2002-06-30 Akim Demaille <akim@epita.fr>
15409 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
15412 2002-06-30 Akim Demaille <akim@epita.fr>
15414 Use hash.h for the state hash table.
15416 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
15417 (allocate_storage): Use state_hash_new.
15418 (free_storage): Use state_hash_free.
15419 (new_state, get_state): Adjust.
15420 * src/lalr.h, src/lalr.c (states): Move to...
15421 * src/states.h (state_t): Remove the `link' member, no longer
15423 * src/states.h, src/states.c: here.
15424 (state_hash_new, state_hash_free, state_hash_lookup)
15425 (state_hash_insert, states_free): New.
15426 * src/states.c (state_table, state_compare, state_hash): New.
15427 * src/output.c (output_actions): Do not free states now, since we
15428 still need to know the final_state number in `prepare', called
15429 afterwards. Do it...
15430 * src/main.c (main): here: call states_free after `output'.
15432 2002-06-30 Akim Demaille <akim@epita.fr>
15434 * src/state.h, src/state.c (state_new): New, extracted from...
15435 * src/LR0.c (new_state): here.
15436 * src/state.h (STATE_ALLOC): Move to...
15437 * src/state.c: here.
15438 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
15439 * src/state.h, src/state.c: here.
15441 2002-06-30 Akim Demaille <akim@epita.fr>
15443 * src/reader.c (gensym): Rename as...
15444 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
15445 (getsym): Rename as...
15446 (symbol_get): this.
15448 2002-06-30 Akim Demaille <akim@epita.fr>
15450 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
15451 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
15452 * src/output.c, src/print.c, src/print_graph.c: Propagate.
15453 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
15455 2002-06-30 Akim Demaille <akim@epita.fr>
15457 Make the test suite pass with warnings checked.
15459 * tests/actions.at (Printers and Destructors): Improve.
15460 Avoid unsigned vs. signed issues.
15461 * tests/calc.at: Don't exercise the scanner here, do it...
15462 * tests/input.at (Torturing the Scanner): here.
15464 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15466 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
15467 reorganize first lines parallel to yacc.c.
15469 2002-06-28 Akim Demaille <akim@epita.fr>
15471 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
15472 (b4_token_enum, b4_token_defines): New, factored from...
15473 * data/lalr1.cc, data/yacc.c, glr.c: here.
15475 2002-06-28 Akim Demaille <akim@epita.fr>
15477 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
15479 * src/output.c (merger_output): static.
15481 2002-06-28 Akim Demaille <akim@epita.fr>
15483 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
15484 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
15486 * src/output.c (save_row): Initialize all the variables to pacify GCC.
15488 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15490 Accumulated changelog for new GLR parsing features.
15492 * src/conflicts.c (count_total_conflicts): Change name to
15493 conflicts_total_count.
15494 * src/conflicts.h: Ditto.
15495 * src/output.c (token_actions): Use the new name.
15496 (output_conflicts): Change conflp => conflict_list_heads, and
15497 confl => conflict_list for better readability.
15498 * data/glr.c: Use the new names.
15499 * NEWS: Add self to GLR announcement.
15501 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
15503 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
15506 * data/bison.glr: Change name to glr.c
15507 * data/glr.c: Renamed from bison.glr.
15508 * data/Makefile.am: Add glr.c
15512 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
15513 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
15515 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15517 * data/bison.glr: Be sure to restore the
15518 current #line when returning to the skeleton contents after having
15519 exposed the input file's #line.
15521 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15523 * data/bison.glr: Bring up to date with changes to bison.simple.
15525 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15527 * data/bison.glr: Correct definitions that use b4_prefix.
15528 Various reformatting.
15529 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
15530 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
15531 yytokenp argument; now part of stack.
15532 (yychar): Define to behave as documented.
15533 (yyclearin): Ditto.
15535 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15537 * src/reader.h: Add declaration for free_merger_functions.
15539 * src/reader.c (merge_functions): New variable.
15540 (get_merge_function): New function.
15541 (free_merger_functions): New function.
15542 (readgram): Check for %prec that is not followed by a symbol.
15543 Handle %dprec and %merge declarations.
15544 (packgram): Initialize dprec and merger fields in rules array.
15546 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
15547 conflict_list_cnt, conflict_list_free): New variables.
15548 (table_grow): Also grow conflict_table.
15549 (prepare_rules): Output dprec and merger tables.
15550 (conflict_row): New function.
15551 (action_row): Output conflict lists for GLR parser. Don't use
15552 default reduction in conflicted states for GLR parser so that there
15553 are spaces for the conflict lists.
15554 (save_row): Also save conflict information.
15555 (token_actions): Allocate conflict list.
15556 (merger_output): New function.
15557 (pack_vector): Pack conflict table, too.
15558 (output_conflicts): New function to output yyconflp and yyconfl.
15559 (output_check): Allocate conflict_tos.
15560 (output_actions): Output conflict tables, also.
15561 (output_skeleton): Output b4_mergers definition.
15562 (prepare): Output b4_max_rhs_length definition.
15563 Use 'bison.glr' as default skeleton for GLR parsers.
15565 * src/gram.c (glr_parser): New flag.
15566 (grammar_free): Call free_merger_functions.
15568 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
15569 all pairs of conflicting reductions, rather than just all tokens
15570 causing conflicts. Needed to size conflict tables.
15571 (conflicts_output): Modify call to count_rr_conflicts for new
15573 (conflicts_print): Ditto.
15574 (count_total_conflicts): New function.
15576 * src/reader.h (merger_list): New type.
15577 (merge_functions): New variable.
15579 * src/lex.h (tok_dprec, tok_merge): New token types.
15581 * src/gram.h (rule_s): Add dprec and merger fields.
15582 (glr_parser): New flag.
15584 * src/conflicts.h (count_total_conflicts): New function.
15586 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
15588 * doc/bison.texinfo (Generalized LR Parsing): New section.
15589 (GLR Parsers): New section.
15590 (Language and Grammar): Mention GLR parsing.
15591 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
15592 Correct typo ("tge" -> "the").
15594 * data/bison.glr: New skeleton for GLR parsing.
15596 * tests/cxx-gram.at: New tests for GLR parsing.
15598 * tests/testsuite.at: Include cxx-gram.at.
15600 * tests/Makefile.am: Add cxx-gram.at.
15602 * src/parse-gram.y:
15604 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
15606 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
15608 2002-06-27 Akim Demaille <akim@epita.fr>
15610 * src/options.h, src/options.c: Remove.
15611 * src/getargs.c (short_options, long_options): New.
15613 2002-06-27 Akim Demaille <akim@epita.fr>
15615 * data/bison.simple, data/bison.c++: Rename as...
15616 * data/yacc.c, data/lalr1.cc: these.
15617 * doc/bison.texinfo (Environment Variables): Remove.
15619 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
15621 * src/getargs.c (report_argmatch): Initialize strtok().
15623 2002-06-20 Akim Demaille <akim@epita.fr>
15625 * data/bison.simple (b4_symbol_actions): New, replaces...
15626 (b4_symbol_destructor, b4_symbol_printer): these.
15627 (yysymprint): Be sure to call YYPRINT only for tokens, and using
15628 user token numbers.
15630 2002-06-20 Akim Demaille <akim@epita.fr>
15632 * data/bison.simple (yydestructor): Rename as...
15633 (yydestruct): this.
15635 2002-06-20 Akim Demaille <akim@epita.fr>
15637 * src/symtab.h, src/symtab.c (symbol_type_set)
15638 (symbol_destructor_set, symbol_precedence_set): The location is
15640 Adjust all callers.
15642 2002-06-20 Akim Demaille <akim@epita.fr>
15644 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
15646 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
15648 * src/symtab.h, src/symtab.c (symbol_class_set)
15649 (symbol_user_token_number_set): Likewise.
15650 Adjust all callers.
15651 Promote complain_at.
15652 * tests/input.at (Type Clashes): Adjust.
15654 2002-06-20 Akim Demaille <akim@epita.fr>
15656 * data/bison.simple (YYLEX): Fix the declaration when
15659 2002-06-20 Akim Demaille <akim@epita.fr>
15661 * data/bison.simple (yysymprint): Don't print the token number,
15663 * tests/actions.at (Destructors): Rename as...
15664 (Printers and Destructors): this.
15665 Also exercise %printer.
15667 2002-06-20 Akim Demaille <akim@epita.fr>
15669 * data/bison.simple (YYDSYMPRINT): New.
15670 Use it to remove many of the #if YYDEBUG/if (yydebug).
15672 2002-06-20 Akim Demaille <akim@epita.fr>
15674 * src/symtab.h, src/symtab.c (symbol_t): printer and
15675 printer_location are new members.
15676 (symbol_printer_set): New.
15677 * src/parse-gram.y (PERCENT_PRINTER): New token.
15678 Handle its associated rule.
15679 * src/scan-gram.l: Adjust.
15680 (handle_destructor_at, handle_destructor_dollar): Rename as...
15681 (handle_symbol_code_at, handle_symbol_code_dollar): these.
15682 * src/output.c (symbol_printers_output): New.
15683 (output_skeleton): Call it.
15684 * data/bison.simple (yysymprint): New. Cannot be named yyprint
15685 since there are already many grammar files with a user `yyprint'.
15686 Replace the calls to YYPRINT to calls to yysymprint.
15687 * tests/calc.at: Adjust.
15688 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
15689 taking advantage of parser very internal details (stack size!).
15691 2002-06-20 Akim Demaille <akim@epita.fr>
15693 * src/scan-gram.l: Complete the scanner with the missing patterns
15695 Use `quote' and `symbol_tag_get' where appropriate.
15697 2002-06-19 Akim Demaille <akim@epita.fr>
15699 * tests/actions.at (Destructors): Augment to test locations.
15700 * data/bison.simple (yydestructor): Pass it the current location
15701 if locations are enabled.
15702 Prototype only when __STDC__ or C++.
15703 Change the argument names to move into the yy name space: there is
15706 2002-06-19 Akim Demaille <akim@epita.fr>
15708 * data/bison.simple (b4_pure_if): New.
15709 Use it instead of #ifdef YYPURE.
15711 2002-06-19 Akim Demaille <akim@epita.fr>
15713 * data/bison.simple (b4_location_if): New.
15714 Use it instead of #ifdef YYLSP_NEEDED.
15716 2002-06-19 Akim Demaille <akim@epita.fr>
15718 Prepare @$ in %destructor, but currently don't bind it in the
15719 skeleton, as %location use is not cleaned up yet.
15721 * src/scan-gram.l (handle_dollar, handle_destructor_at)
15722 (handle_action_at): New.
15723 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
15724 a braced_code_t and a location as additional arguments.
15725 (handle_destructor_dollar): Instead of requiring `b4_eval', just
15726 unquote one when outputting `b4_dollar_dollar'.
15728 * data/bison.simple (b4_eval): Remove.
15729 (b4_symbol_destructor): Adjust.
15730 * tests/input.at (Invalid @n): Adjust.
15732 2002-06-19 Zack Weinberg <zack@codesourcery.com>
15734 * doc/bison.texinfo: Document ability to have multiple
15737 2002-06-18 Akim Demaille <akim@epita.fr>
15739 * src/files.c (compute_base_names): When computing the output file
15740 names from the input file name, strip the directory part.
15742 2002-06-18 Akim Demaille <akim@epita.fr>
15744 * data/bison.simple.new: Comment changes.
15745 Reported by Andreas Schwab.
15747 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
15749 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
15750 there are no `label `yyoverflowlab' defined but not used' warnings
15751 when yyoverflow is defined.
15753 2002-06-18 Akim Demaille <akim@epita.fr>
15755 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
15757 (symbol_destructor_set): Adjust.
15758 * src/output.c (symbol_destructors_output): Output the destructor
15760 Output the symbol name.
15761 * data/bison.simple (b4_symbol_destructor): Adjust.
15763 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
15764 and Akim Demaille <akim@epita.fr>
15766 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
15767 what's left on the stack when the error recovery hits EOF.
15768 * tests/actions.at (Destructors): Complete to exercise this case.
15770 2002-06-17 Akim Demaille <akim@epita.fr>
15772 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
15773 arguments is really empty, not only equal to `[]'.
15774 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
15776 (symbol_destructor_set): New.
15777 * src/output.c (symbol_destructors_output): New.
15778 * src/reader.h (brace_code_t, current_braced_code): New.
15779 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
15780 (handle_dollar): Rename as...
15781 (handle_action_dollar): this.
15782 (handle_destructor_dollar): New.
15783 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
15784 (grammar_declaration): Use it.
15785 * data/bison.simple (yystos): Is always defined.
15786 (yydestructor): New.
15787 * tests/actions.at (Destructors): New.
15788 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
15790 2002-06-17 Akim Demaille <akim@epita.fr>
15792 * src/symlist.h, src/symlist.c (symbol_list_length): New.
15793 * src/scan-gram.l (handle_dollar, handle_at): Compute the
15794 rule_length only when needed.
15795 * src/output.c (actions_output, token_definitions_output): Output
15797 * src/symtab.c: Don't access directly to the symbol tag, use
15799 * src/parse-gram.y: Use symbol_list_free.
15801 2002-06-17 Akim Demaille <akim@epita.fr>
15803 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
15804 (symbol_list_prepend, get_type_name): Move to...
15805 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
15806 (symbol_list_prepend, symbol_list_n_type_name_get): here.
15807 Adjust all callers.
15808 (symbol_list_free): New.
15809 * src/scan-gram.l (handle_dollar): Takes a location.
15810 * tests/input.at (Invalid $n): Adjust.
15812 2002-06-17 Akim Demaille <akim@epita.fr>
15814 * src/reader.h, src/reader.c (symbol_list_new): Export it.
15815 (symbol_list_prepend): New.
15816 * src/parse-gram.y (%union): `list' is a new member.
15817 (symbols.1): New, replaces...
15818 (terms_to_prec.1, nterms_to_type.1): these.
15819 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
15820 Take a location as additional argument.
15821 Adjust all callers.
15823 2002-06-15 Akim Demaille <akim@epita.fr>
15825 * src/parse-gram.y: Move %token in the declaration section so that
15826 we don't depend upon CVS Bison.
15828 2002-06-15 Akim Demaille <akim@epita.fr>
15830 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
15831 * src/print.c (print_core): Use it.
15833 2002-06-15 Akim Demaille <akim@epita.fr>
15835 * src/conflicts.c (log_resolution): Accept the rule involved in
15836 the sr conflicts instead of the lookahead number that points to
15838 (flush_reduce): Accept the current lookahead vector as argument,
15839 instead of the index in LA.
15840 (resolve_sr_conflict): Accept the current number of lookahead
15841 bitset to consider for the STATE, instead of the index in LA.
15842 (set_conflicts): Adjust.
15843 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
15845 2002-06-15 Akim Demaille <akim@epita.fr>
15847 * src/state.h (state_t): Replace the `lookaheadsp' member, a
15848 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
15849 Adjust all dependencies.
15850 * src/lalr.c (initialize_lookaheads): Split into...
15851 (states_lookaheads_count, states_lookaheads_initialize): these.
15854 2002-06-15 Akim Demaille <akim@epita.fr>
15856 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
15858 (grammar_rules_print): here.
15859 * src/reduce.c (reduce_output): Use it.
15860 * tests/reduce.at (Useless Rules, Reduced Automaton)
15861 (Underivable Rules): Adjust.
15863 2002-06-15 Akim Demaille <akim@epita.fr>
15865 Copy BYacc's nice way to report the grammar.
15867 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
15869 Don't print the rules' location, it is confusing and useless.
15870 (rule_print): Use grammar_rhs_print.
15871 * src/print.c (print_grammar): Use grammar_rules_print.
15873 2002-06-15 Akim Demaille <akim@epita.fr>
15875 Complete and rationalize `useless thing' warnings.
15877 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
15878 (symbol_tag_print): New.
15879 Use them everywhere in place of accessing directly the tag member.
15880 * src/gram.h, src/gram.c (rule_print): New.
15881 Use it where a rule used to be printed `by hand'.
15882 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
15883 (reduce_grammar_tables): Report the useless rules.
15884 (reduce_print): Useless things are a warning, not an error.
15886 * tests/reduce.at (Useless Nonterminals, Useless Rules):
15887 (Reduced Automaton, Underivable Rules): Adjust.
15888 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
15889 * tests/conflicts.at (Unresolved SR Conflicts)
15890 (Solved SR Conflicts): Adjust.
15892 2002-06-15 Akim Demaille <akim@epita.fr>
15894 Let symbols have a location.
15896 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
15898 Adjust all callers.
15899 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
15900 Use location_t, not int.
15901 * src/symtab.c (symbol_check_defined): Take advantage of the
15903 * tests/regression.at (Invalid inputs): Adjust.
15905 2002-06-15 Akim Demaille <akim@epita.fr>
15907 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
15908 (input): Don't try to initialize yylloc here, do it in the
15910 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
15911 * src/gram.h (rule_t): Change line and action_line into location
15912 and action_location, of location_t type.
15913 Adjust all dependencies.
15914 * src/location.h, src/location.c (empty_location): New.
15915 * src/reader.h, src/reader.c (grammar_start_symbol_set)
15916 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
15917 (grammar_current_rule_symbol_append)
15918 (grammar_current_rule_action_append): Expect a location as argument.
15919 * src/reader.c (grammar_midrule_action): Adjust to attach an
15920 action's location as dummy symbol location.
15921 * src/symtab.h, src/symtab.c (startsymbol_location): New.
15922 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
15925 2002-06-14 Akim Demaille <akim@epita.fr>
15927 Grammar declarations may be found in the grammar section.
15929 * src/parse-gram.y (rules_or_grammar_declaration): New.
15930 (declarations): Each declaration may end with a semicolon, not
15932 (grammar_declaration): `"%union"'.
15933 (grammar): Branch to rules_or_grammar_declaration.
15935 2002-06-14 Akim Demaille <akim@epita.fr>
15937 * src/main.c (main): Invoke scanner_free.
15939 2002-06-14 Akim Demaille <akim@epita.fr>
15941 * src/output.c (m4_invoke): Extracted from...
15942 (output_skeleton): here.
15945 2002-06-14 Akim Demaille <akim@epita.fr>
15947 * src/parse-gram.y (directives, directive, gram)
15948 (grammar_directives, precedence_directives, precedence_directive):
15950 (declarations, declaration, grammar, grammar_declaration)
15951 (precedence_declaration, precedence_declarator): these.
15952 (symbol_declaration): New.
15954 2002-06-14 Akim Demaille <akim@epita.fr>
15956 * src/files.c (action_obstack): Remove, unused.
15957 (output_obstack): Remove it, and all its dependencies, as it is no
15959 * src/reader.c (epilogue_set): Build the epilogue in the
15961 * src/output.h, src/output.c (muscle_obstack): Move to...
15962 * src/muscle_tab.h, src/muscle_tab.h: here.
15963 (muscle_init): Initialize muscle_obstack.
15964 (muscle_free): New.
15965 * src/main.c (main): Call it.
15967 2002-06-14 Akim Demaille <akim@epita.fr>
15969 * src/location.h: New, extracted from...
15970 * src/reader.h: here.
15971 * src/Makefile.am (noinst_HEADERS): Merge into
15972 (bison_SOURCES): this.
15974 * src/parse-gram.y: Use location_t instead of Bison's.
15975 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
15976 Use location_t instead of ints.
15978 2002-06-14 Akim Demaille <akim@epita.fr>
15980 * data/bison.simple, data/bison.c++: Be sure to restore the
15981 current #line when returning to the skeleton contents after having
15982 exposed the input file's #line.
15984 2002-06-12 Akim Demaille <akim@epita.fr>
15986 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
15988 * tests/actions.at (Exotic Dollars): New.
15990 2002-06-12 Akim Demaille <akim@epita.fr>
15992 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
15994 * tests/input.at (Torturing the Scanner): New.
15996 2002-06-11 Akim Demaille <akim@epita.fr>
15998 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
15999 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
16000 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
16001 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
16002 * src/reader.c (reader): Use it.
16004 2002-06-11 Akim Demaille <akim@epita.fr>
16006 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
16007 Adjust all callers.
16008 (scanner_last_string_free): New.
16010 2002-06-11 Akim Demaille <akim@epita.fr>
16012 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
16013 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
16014 (last_string, YY_OBS_FREE): New.
16015 Use them when returning an ID.
16017 2002-06-11 Akim Demaille <akim@epita.fr>
16019 Have Bison grammars parsed by a Bison grammar.
16021 * src/reader.c, src/reader.h (prologue_augment): New.
16022 * src/reader.c (copy_definition): Remove.
16024 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
16025 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
16026 (grammar_current_rule_prec_set, grammar_current_rule_check)
16027 (grammar_current_rule_symbol_append)
16028 (grammar_current_rule_action_append): Export.
16029 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
16030 (symbol_list_action_append): Remove.
16031 Hook the routines from reader.
16032 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
16033 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
16035 * src/reader.c (read_declarations): Remove, unused.
16037 * src/parse-gram.y: Handle the epilogue.
16038 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
16039 (grammar_start_symbol_set): this.
16040 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
16041 * src/reader.c (readgram): Remove, unused.
16042 (reader): Adjust to insert eoftoken and axiom where appropriate.
16044 * src/reader.c (copy_dollar): Replace with...
16045 * src/scan-gram.h (handle_dollar): this.
16046 * src/parse-gram.y: Remove `%thong'.
16048 * src/reader.c (copy_at): Replace with...
16049 * src/scan-gram.h (handle_at): this.
16051 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
16054 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
16057 * src/reader.h, src/reader.c (grammar_rule_end): New.
16059 * src/parse.y (current_type, current_class): New.
16060 Implement `%nterm', `%token' support.
16061 Merge `%term' into `%token'.
16062 (string_as_id): New.
16063 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
16066 * src/parse-gram.y: Be sure to handle properly the beginning of
16069 * src/parse-gram.y: Handle %type.
16070 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
16072 * src/parse-gram.y: More directives support.
16073 * src/options.c: No longer handle source directives.
16075 * src/parse-gram.y: Fix %output.
16077 * src/parse-gram.y: Handle %union.
16078 Use the prologue locations.
16079 * src/reader.c (parse_union_decl): Remove.
16081 * src/reader.h, src/reader.c (epilogue_set): New.
16082 * src/parse-gram.y: Use it.
16084 * data/bison.simple, data/bison.c++: b4_stype is now either not
16085 defined, then default to int, or to the contents of %union,
16086 without `union' itself.
16088 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
16090 * src/output.c (actions_output): Don't output braces, as they are
16091 already handled by the scanner.
16093 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
16094 characters to themselves.
16096 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
16097 that the epilogue has a proper #line.
16099 * src/parse-gram.y: Handle precedence/associativity.
16101 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
16103 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
16104 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
16105 at all to define terminals that cannot be emitted.
16107 * src/scan-gram.l: Escape M4 characters.
16109 * src/scan-gram.l: Working properly with escapes in user
16110 strings/characters.
16112 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
16113 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
16115 Use more modest sizes, as for the time being the parser does not
16116 release memory, and therefore the process swallows a huge amount
16119 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
16120 stricter %token grammar.
16122 * src/symtab.h (associativity): Add `undef_assoc'.
16123 (symbol_precedence_set): Do nothing when passed an undef_assoc.
16124 * src/symtab.c (symbol_check_alias_consistence): Adjust.
16126 * tests/regression.at (Invalid %directive): Remove, as it is now
16128 (Invalid inputs): Adjust to the new error messages.
16129 (Token definitions): The new grammar doesn't allow too many
16132 * src/lex.h, src/lex.c: Remove.
16133 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
16134 (copy_character, copy_string2, copy_string, copy_identifier)
16135 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
16136 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
16137 (parse_action): Remove.
16138 * po/POTFILES.in: Adjust.
16140 2002-06-11 Akim Demaille <akim@epita.fr>
16142 * src/reader.c (parse_action): Don't store directly into the
16143 rule's action member: return the action as a string.
16144 Don't require `rule_length' as an argument: compute it.
16145 (grammar_current_rule_symbol_append)
16146 (grammar_current_rule_action_append): New, eved out from
16148 Remove `action_flag', `rulelength', unused now.
16150 2002-06-11 Akim Demaille <akim@epita.fr>
16152 * src/reader.c (grammar_current_rule_prec_set).
16153 (grammar_current_rule_check): New, eved out from...
16155 Remove `xaction', `first_rhs': useless.
16156 * tests/input.at (Type clashes): New.
16157 * tests/existing.at (GNU Cim Grammar): Adjust.
16159 2002-06-11 Akim Demaille <akim@epita.fr>
16161 * src/reader.c (grammar_midrule_action): New, Eved out from
16164 2002-06-11 Akim Demaille <akim@epita.fr>
16166 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
16168 (readgram): Use them as replacement of inlined code, crule and
16171 2002-06-11 Akim Demaille <akim@epita.fr>
16173 * src/reader.c (grammar_end, grammar_symbol_append): New.
16174 (readgram): Use them.
16175 Make the use of `p' as local as possible.
16177 2002-06-10 Akim Demaille <akim@epita.fr>
16179 GCJ's parser requires the tokens to be defined before the prologue.
16181 * data/bison.simple: Output the token definition before the user's
16183 * tests/regression.at (Braces parsing, Duplicate string)
16184 (Mixing %token styles): Check the output from bison.
16185 (Early token definitions): New.
16187 2002-06-10 Akim Demaille <akim@epita.fr>
16189 * src/symtab.c (symbol_user_token_number_set): Don't complain when
16190 assigning twice the same user number to a token, so that we can
16192 * src/lex.c (lex): here.
16193 Also use `symbol_class_set' instead of hand written code.
16194 * src/reader.c (parse_assoc_decl): Likewise.
16196 2002-06-10 Akim Demaille <akim@epita.fr>
16198 * src/symtab.c, src/symtab.c (symbol_class_set)
16199 (symbol_user_token_number_set): New.
16200 * src/reader.c (parse_token_decl): Use them.
16201 Use a switch instead of ifs.
16202 Use a single argument.
16204 2002-06-10 Akim Demaille <akim@epita.fr>
16206 Remove `%thong' support as it is undocumented, unused, duplicates
16207 `%token's job, and creates useless e-mail traffic with people who
16208 want to know what it is, why it is undocumented, unused, and
16209 duplicates `%token's job.
16211 * src/reader.c (parse_thong_decl): Remove.
16212 * src/options.c (option_table): Remove "thong".
16213 * src/lex.h (tok_thong): Remove.
16215 2002-06-10 Akim Demaille <akim@epita.fr>
16217 * src/symtab.c, src/symtab.c (symbol_type_set)
16218 (symbol_precedence_set): New.
16219 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
16220 (value_components_used): Remove, unused.
16222 2002-06-09 Akim Demaille <akim@epita.fr>
16224 Move symbols handling code out of the reader.
16226 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
16227 (axiom): Move to...
16228 * src/symtab.h, src/symtab.c: here.
16230 * src/gram.c (start_symbol): Remove: use startsymbol->number.
16231 * src/reader.c (startval): Rename as...
16232 * src/symtab.h, src/symtab.c (startsymbol): this.
16233 * src/reader.c: Adjust.
16235 * src/reader.c (symbol_check_defined, symbol_make_alias)
16236 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16237 (token_translations_init)
16239 * src/symtab.c: here.
16240 * src/reader.c (packsymbols): Move to...
16241 * src/symtab.h, src/symtab.c (symbols_pack): here.
16242 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
16245 2002-06-03 Akim Demaille <akim@epita.fr>
16247 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
16250 2002-06-03 Akim Demaille <akim@epita.fr>
16252 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
16253 structs with non literals.
16254 * src/scan-skel.l: never-interactive.
16255 * src/conflicts.c (enum conflict_resolution_e): No trailing
16257 * src/getargs.c (usage): Split long literal strings.
16258 Reported by Hans Aberg.
16260 2002-05-28 Akim Demaille <akim@epita.fr>
16262 * data/bison.c++: Use C++ ostreams.
16263 (cdebug_): New member.
16265 2002-05-28 Akim Demaille <akim@epita.fr>
16267 * src/output.c (output_skeleton): Be sure to allocate enough room
16268 for `/' _and_ for `\0' in full_skeleton.
16270 2002-05-28 Akim Demaille <akim@epita.fr>
16272 * data/bison.c++: Catch up with bison.simple:
16273 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16274 and Paul Eggert <eggert@twinsun.com>: `error' handing.
16275 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
16276 and popping traces.
16278 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16280 * src/output.c (output_skeleton): Put an explicit path in front of
16281 the skeleton file name, rather than relying on the -I directory,
16282 to partially alleviate effects of having a skeleton file lying around
16283 in the current directory.
16285 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16287 * src/conflicts.c (log_resolution): Correct typo:
16288 obstack_printf should be obstack_fgrow1.
16290 2002-05-26 Akim Demaille <akim@epita.fr>
16292 * src/state.h (state_t): `solved_conflicts' is a new member.
16293 * src/LR0.c (new_state): Set it to 0.
16294 * src/conflicts.h, src/conflicts.c (print_conflicts)
16295 (free_conflicts, solve_conflicts): Rename as...
16296 (conflicts_print, conflicts_free, conflicts_solve): these.
16298 * src/conflicts.c (enum conflict_resolution_e)
16299 (solved_conflicts_obstack): New, used by...
16300 (log_resolution): this.
16301 Adjust to attach the conflict resolution to each state.
16302 Complete the description with the precedence/associativity
16304 (resolve_sr_conflict): Adjust.
16305 * src/print.c (print_state): Output its solved_conflicts.
16306 * tests/conflicts.at (Unresolved SR Conflicts)
16307 (Solved SR Conflicts): Exercise --report=all.
16309 2002-05-26 Akim Demaille <akim@epita.fr>
16311 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
16312 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16313 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
16314 (token_number_t, item_number_as_token_number)
16315 (token_number_as_item_number, muscle_insert_token_number_table):
16317 (symbol_number_t, item_number_as_symbol_number)
16318 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
16319 these, since it is more appropriate.
16321 2002-05-26 Akim Demaille <akim@epita.fr>
16323 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
16325 * data/bison.simple (yystos) [YYDEBUG]: New.
16326 (yyparse) [YYDEBUG]: Display the symbols which are popped during
16328 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
16330 2002-05-25 Akim Demaille <akim@epita.fr>
16332 * doc/bison.texinfo (Debugging): Split into...
16333 (Tracing): this new section, its former contents, and...
16334 (Understanding): this new section.
16335 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
16337 (report_flag): this.
16338 Adjust all dependencies.
16339 (report_args, report_types, report_argmatch): New.
16340 (usage, getargs): Report/support -r, --report.
16342 (struct option_table_struct): Rename as..,
16343 (struct option_table_s): this.
16344 Rename the `set_flag' member to `flag' to match with getopt_long's
16346 * src/options.c (option_table): Split verbose into an entry for
16347 %verbose, and another for --verbose.
16348 Support --report/-r, so remove -r from the obsolete --raw.
16349 * src/print.c: Attach full item sets and lookaheads reports to
16350 report_flag instead of trace_flag.
16351 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
16353 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16354 and Paul Eggert <eggert@twinsun.com>
16356 * data/bison.simple (yyparse): Correct error handling to conform to
16357 POSIX and yacc. Specifically, after syntax error is discovered,
16358 do not reduce further before shifting the error token.
16359 Clean up the code a bit by removing the labels yyerrdefault,
16360 yyerrhandle, yyerrpop.
16361 * NEWS: Document the above.
16363 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16365 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
16366 type; it isn't always big enough, since it doesn't necessarily
16367 include non-terminals.
16368 (yytranslate): Expand definition of yy_token_number_type, so that
16369 the latter can be removed.
16370 (yy_token_number_type): Remove, only one use.
16371 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
16372 don't use TokenNumberType as element type.
16374 * tests/regression.at: Modify expected output to agree with change
16375 to yyr1 and yytranslate.
16377 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
16379 * src/reader.c (parse_action): Use copy_character instead of
16382 2002-05-13 Akim Demaille <akim@epita.fr>
16384 * tests/regression.at (Token definitions): Prototype yylex and
16387 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16389 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
16390 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
16392 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
16394 2002-05-07 Akim Demaille <akim@epita.fr>
16396 * tests/synclines.at: Be sure to prototype yylex and yyerror to
16397 avoid GCC warnings.
16399 2002-05-07 Akim Demaille <akim@epita.fr>
16403 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
16404 over the RHS of each rule.
16405 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
16406 * src/state.h (state_t): Member `nitems' is unsigned short.
16407 * src/LR0.c (get_state): Adjust.
16408 * src/reader.c (packgram): Likewise.
16409 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
16411 (muscle_insert_int_table): Remove, unused.
16412 (prepare_rules): Remove `max'.
16414 2002-05-06 Akim Demaille <akim@epita.fr>
16416 * src/closure.c (print_firsts): Display of the symbol tags.
16417 (bitmatrix_print): Move to...
16418 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
16420 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
16422 2002-05-06 Akim Demaille <akim@epita.fr>
16424 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
16427 2002-05-06 Akim Demaille <akim@epita.fr>
16429 * src/LR0.c (new_state, get_state): Instead of using the global
16430 `kernel_size' and `kernel_base', have two new arguments:
16431 `core_size' and `core'.
16434 2002-05-06 Akim Demaille <akim@epita.fr>
16436 * src/reader.c (packgram): No longer end `ritem' with a 0
16437 sentinel: it is not used.
16439 2002-05-05 Akim Demaille <akim@epita.fr>
16441 New experimental feature: display the lookaheads in the report and
16444 * src/print (print_core): When --trace-flag, display the rules
16446 * src/print_graph.c (print_core): Likewise.
16447 Swap the arguments.
16450 2002-05-05 Akim Demaille <akim@epita.fr>
16452 * tests/torture.at (Many lookaheads): New test.
16454 2002-05-05 Akim Demaille <akim@epita.fr>
16456 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
16457 (GENERATE_MUSCLE_INSERT_TABLE): this.
16458 (output_int_table, output_unsigned_int_table, output_short_table)
16459 (output_token_number_table, output_item_number_table): Replace with...
16460 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
16461 (muscle_insert_short_table, muscle_insert_token_number_table)
16462 (muscle_insert_item_number_table): these.
16463 Adjust all callers.
16464 (prepare_tokens): Don't free `translations', since...
16465 * src/reader.h, src/reader.c (grammar_free): do it.
16467 * src/gram.h, src/gram.c (grammar_free): here.
16468 * data/bison.simple, data/bison.c++: b4_token_number_max is now
16471 2002-05-05 Akim Demaille <akim@epita.fr>
16473 * src/output.c (output_unsigned_int_table): New.
16474 (prepare_rules): `i' is unsigned.
16475 `prhs', `rline', `r2' are unsigned int.
16476 Rename muscle `rhs_number_max' as `rhs_max'.
16477 Output muscles `prhs_max', `rline_max', and `r2_max'.
16479 * data/bison.simple, data/bison.c++: Adjust to use these muscles
16480 to compute types instead of constant types.
16481 * tests/regression.at (Web2c Actions): Adjust.
16483 2002-05-04 Akim Demaille <akim@epita.fr>
16485 * src/symtab.h (SALIAS, SUNDEF): Rename as...
16486 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
16487 Adjust dependencies.
16488 * src/output.c (token_definitions_output): Be sure not to output a
16489 `#define 'a'' when fed with `%token 'a' "a"'.
16490 * tests/regression.at (Token definitions): New.
16492 2002-05-03 Paul Eggert <eggert@twinsun.com>
16494 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
16497 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
16499 * Makefile.am (SUBDIRS): Remove intl.
16500 (EXTRA_DIST): Add config/config.rpath.
16502 2002-05-03 Akim Demaille <akim@epita.fr>
16504 * data/bison.simple (m4_if): Don't output empty enums.
16505 And actually, output valid enum definitions :(.
16507 2002-05-03 Akim Demaille <akim@epita.fr>
16509 * configure.bat: Remove, completely obsolete.
16510 * Makefile.am (EXTRA_DIST): Adjust.
16511 Don't distribute config.rpath...
16512 * config/Makefile.am (EXTRA_DIST): Do it.
16514 2002-05-03 Akim Demaille <akim@epita.fr>
16516 * configure.in (GETTEXT_VERSION): New.
16517 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
16519 2002-05-03 Akim Demaille <akim@epita.fr>
16521 * data/bison.simple (b4_token_enum): New.
16522 (b4_token_defines): Use it to output tokens both as #define and
16524 Suggested by Paul Eggert.
16525 * src/output.c (token_definitions_output): Don't output spurious
16528 2002-05-03 Akim Demaille <akim@epita.fr>
16530 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16532 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
16534 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
16535 Update the stack class, give a try to deque as the default container.
16537 2002-05-02 Akim Demaille <akim@epita.fr>
16539 * data/bison.simple (yyparse): Do not implement @$ = @1.
16540 (YYLLOC_DEFAULT): Adjust to do it.
16541 * doc/bison.texinfo (Location Default Action): Fix.
16543 2002-05-02 Akim Demaille <akim@epita.fr>
16545 * src/reader.c (parse_braces): Merge into...
16546 (parse_action): this.
16548 2002-05-02 Akim Demaille <akim@epita.fr>
16550 * configure.in (ALL_LINGUAS): Remove.
16551 * po/LINGUAS, hr.po: New.
16553 2002-05-02 Akim Demaille <akim@epita.fr>
16555 Remove the so called hairy (semantic) parsers.
16557 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
16558 * src/gram.h, src/gram.c (semantic_parser): Remove.
16559 (rule_t): Remove the guard and guard_line members.
16560 * src/lex.h (token_t): remove tok_guard.
16561 * src/options.c (option_table): Remove %guard and %semantic_parser
16563 * src/output.c, src/output.h (guards_output): Remove.
16565 (token_definitions_output): Don't output the `T'
16567 (output_skeleton): Don't output the guards.
16568 * src/files.c, src/files.c (attrsfile): Remove.
16569 * src/reader.c (symbol_list): Remove the guard and guard_line
16571 Adjust dependencies.
16572 (parse_guard): Remove.
16573 * data/bison.hairy: Remove.
16574 * doc/bison.texinfo (Environment Variables): Remove occurrences of
16577 2002-05-02 Akim Demaille <akim@epita.fr>
16579 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
16580 (parse_guard): Rename the formal argument `stack_offset' as
16581 `rule_length', which is more readable.
16583 (copy_at, copy_dollar): Instead of outputting the hard coded
16584 values of $$, $n and so forth, output invocation to b4_lhs_value,
16585 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
16586 Note: this patch partially drops `semantic-parser' support: it
16587 always does `rule_length - n', where semantic parsers ought to
16589 * data/bison.simple, data/bison.c++ (b4_lhs_value)
16590 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
16592 2002-05-02 Akim Demaille <akim@epita.fr>
16594 * configure.in (AC_INIT): Bump to 1.49b.
16595 (AM_INIT_AUTOMAKE): Short invocation.
16597 2002-05-02 Akim Demaille <akim@epita.fr>
16601 2002-05-01 Akim Demaille <akim@epita.fr>
16603 * src/skeleton.h: Remove.
16605 2002-05-01 Akim Demaille <akim@epita.fr>
16607 * src/skeleton.h: Fix the #endif.
16608 Reported by Magnus Fromreide.
16610 2002-04-26 Paul Eggert <eggert@twinsun.com>
16612 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
16613 Define if we define YYSTYPE and YYLTYPE, respectively.
16614 (YYCOPY): Fix [] quoting problem in the non-GCC case.
16616 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
16618 * src/scan-skel.l: Postprocess quadrigraphs.
16620 * src/reader.c (copy_character): New function, used to output
16621 single characters while replacing `[' and `]' with quadrigraphs, to
16622 avoid troubles with M4 quotes.
16623 (copy_comment): Output characters with copy_character.
16624 (read_additionnal_code): Likewise.
16625 (copy_string2): Likewise.
16626 (copy_definition): Likewise.
16628 * tests/calc.at: Exercise M4 quoting.
16630 2002-04-25 Akim Demaille <akim@epita.fr>
16632 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
16633 between `!' and the command.
16634 Reported by Paul Eggert.
16636 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
16638 * tests/calc.at: Exercise prologue splitting.
16640 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
16641 `b4_post_prologue' instead of `b4_prologue'.
16643 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
16645 (output): Free pre_prologue_obstack and post_prologue_obstack.
16646 * src/files.h, src/files.c (attrs_obstack): Remove.
16647 (pre_prologue_obstack, post_prologue_obstack): New.
16648 * src/reader.c (copy_definition): Add a parameter to specify the
16649 obstack to fill, instead of using attrs_obstack unconditionally.
16650 (read_declarations): Pass pre_prologue_obstack to copy_definition if
16651 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
16653 2002-04-23 Paul Eggert <eggert@twinsun.com>
16655 * data/bison.simple: Remove unnecessary commentary and white
16656 space differences from 1_29-branch.
16657 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
16659 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
16660 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
16661 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
16662 constructors or destructors.
16664 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
16666 2002-04-23 Akim Demaille <akim@epita.fr>
16668 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
16669 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
16670 location with columns.
16671 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
16672 All reported by Paul Eggert.
16674 2002-04-22 Akim Demaille <akim@epita.fr>
16676 * src/reduce.c (dump_grammar): Move to...
16677 * src/gram.h, src/gram.c (grammar_dump): here.
16678 Be sure to separate long item numbers.
16679 Don't read the members of a rule's prec if its nil.
16681 2002-04-22 Akim Demaille <akim@epita.fr>
16683 * src/output.c (table_size, table_grow): New.
16684 (MAXTABLE): Remove, replace uses with table_size.
16685 (pack_vector): Instead of dying when the table is too big, grow it.
16687 2002-04-22 Akim Demaille <akim@epita.fr>
16689 * data/bison.simple (yyr1): Its type is that of a token number.
16690 * data/bison.c++ (r1_): Likewise.
16691 * tests/regression.at (Web2c Actions): Adjust.
16693 2002-04-22 Akim Demaille <akim@epita.fr>
16695 * src/reader.c (token_translations_init): 256 is now the default
16696 value for the error token, i.e., it will be assigned another
16697 number if the user assigned 256 to one of her tokens.
16698 (reader): Don't force 256 to error.
16699 * doc/bison.texinfo (Symbols): Adjust.
16700 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
16701 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
16702 etc. instead of 10, 20, 30 (which was used to `jump' over error
16703 (256) and undefined (2)).
16705 2002-04-22 Akim Demaille <akim@epita.fr>
16707 Propagate more token_number_t.
16709 * src/gram.h (token_number_as_item_number)
16710 (item_number_as_token_number): New.
16711 * src/output.c (GENERATE_OUTPUT_TABLE): New.
16712 Use it to create output_item_number_table and
16713 output_token_number_table.
16714 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
16715 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
16716 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
16717 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
16719 2002-04-22 Akim Demaille <akim@epita.fr>
16721 * src/output.h, src/output.c (get_lines_number): Remove.
16723 2002-04-19 Akim Demaille <akim@epita.fr>
16725 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
16727 (Debugging): More details about enabling the debugging features.
16728 (Table of Symbols): Describe $$, $n, @$, and @n.
16729 Suggested by Tim Josling.
16731 2002-04-19 Akim Demaille <akim@epita.fr>
16733 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
16735 2002-04-10 Akim Demaille <akim@epita.fr>
16737 * src/system.h: Rely on HAVE_LIMITS_H.
16738 Suggested by Paul Eggert.
16740 2002-04-09 Akim Demaille <akim@epita.fr>
16742 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
16743 full stderr, and strip it according to the bison options, instead
16744 of composing the error message from different bits.
16745 This makes it easier to check for several error messages.
16746 Adjust all the invocations.
16747 Add an invocation exercising the error token.
16748 Add an invocation demonstrating a stupid error message.
16749 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
16751 Error message are for stderr, not stdout.
16753 2002-04-09 Akim Demaille <akim@epita.fr>
16755 * src/gram.h, src/gram.c (error_token_number): Remove, use
16757 * src/reader.c (reader): Don't specify the user token number (2)
16758 for $undefined, as it uselessly prevents using it.
16759 * src/gram.h (token_number_t): Move to...
16760 * src/symtab.h: here.
16761 (state_t.number): Is a token_number_t.
16762 * src/print.c, src/reader.c: Use undeftoken->number instead of
16764 (Even though this 2 is not the same as above: the number of the
16765 undeftoken remains being 2, it is its user token number which
16767 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
16768 `user_token_number_max'.
16769 Output `undef_token_number'.
16770 * data/bison.simple, data/bison.c++: Use them.
16771 Be sure to map invalid yylex return values to
16772 `undef_token_number'. This saves us from gratuitous SEGV.
16774 * tests/conflicts.at (Solved SR Conflicts)
16775 (Unresolved SR Conflicts): Adjust.
16776 * tests/regression.at (Web2c Actions): Adjust.
16778 2002-04-08 Akim Demaille <akim@epita.fr>
16780 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
16782 Remove the duplicate `typedefs'.
16783 (RhsNumberType): Fix the declaration and various other typos.
16785 * data/bison.simple: Use __ofile__.
16786 * src/scan-skel.l: Handle __ofile__.
16788 2002-04-08 Akim Demaille <akim@epita.fr>
16790 * src/gram.h (item_number_t): New, the type of item numbers in
16791 RITEM. Note that it must be able to code symbol numbers as
16792 positive number, and the negation of rule numbers as negative
16794 Adjust all dependencies (pretty many).
16795 * src/reduce.c (rule): Remove this `short *' pointer: use
16797 * src/system.h (MINSHORT, MAXSHORT): Remove.
16798 Include `limits.h'.
16799 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
16800 (shortcpy): Remove.
16801 (MAXTABLE): Move to...
16802 * src/output.c (MAXTABLE): here.
16803 (prepare_rules): Use output_int_table to output rhs.
16804 * data/bison.simple, data/bison.c++: Adjust.
16805 * tests/torture.at (Big triangle): Move the limit from 254 to
16807 * tests/regression.at (Web2c Actions): Ajust.
16809 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
16810 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
16811 passes, but produces negative #line number, once fixed, GCC is
16812 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
16814 * src/state.h (state_h): Code input lines on ints, not shorts.
16816 2002-04-08 Akim Demaille <akim@epita.fr>
16818 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
16819 and then the grammar.
16821 2002-04-08 Akim Demaille <akim@epita.fr>
16823 * src/system.h: No longer using strndup.
16825 2002-04-07 Akim Demaille <akim@epita.fr>
16827 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
16828 * src/output.c (output_table_data): Return the longest number.
16829 (prepare_tokens): Output `token_number_max').
16830 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
16832 Use them to define yy_token_number_type/TokenNumberType.
16833 Use this type for yytranslate.
16834 * tests/torture.at (Big triangle): Push the limit from 124 to
16836 * tests/regression.at (Web2c Actions): Adjust.
16838 2002-04-07 Akim Demaille <akim@epita.fr>
16840 * tests/torture.at (Big triangle): New.
16841 (GNU AWK Grammar, GNU Cim Grammar): Move to...
16842 * tests/existing.at: here.
16844 2002-04-07 Akim Demaille <akim@epita.fr>
16846 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
16848 Adjust dependencies.
16850 2002-04-07 Akim Demaille <akim@epita.fr>
16852 * src/reader.c: Normalize increments to prefix form.
16854 2002-04-07 Akim Demaille <akim@epita.fr>
16856 * src/reader.c, symtab.c: Remove debugging code.
16858 2002-04-07 Akim Demaille <akim@epita.fr>
16860 Rename all the `bucket's as `symbol_t'.
16862 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
16863 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
16864 * src/symtab.c, src/symtab.h (bucket): Rename as...
16866 (symbol_list_new, bucket_check_defined, bucket_make_alias)
16867 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
16868 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16869 (buckets_new, buckets_free, buckets_do): Rename as...
16870 (symbol_list_new, symbol_check_defined, symbol_make_alias)
16871 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16872 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
16873 (symbols_new, symbols_free, symbols_do): these.
16875 2002-04-07 Akim Demaille <akim@epita.fr>
16877 Use lib/hash for the symbol table.
16879 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
16881 * src/lex.c (lex): Set the `number' member of new terminals.
16882 * src/reader.c (bucket_check_defined, bucket_make_alias)
16883 (bucket_check_alias_consistence, bucket_translation): New.
16884 (reader, grammar_free, readgram, token_translations_init)
16885 (packsymbols): Adjust.
16886 (reader): Number the predefined tokens.
16887 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
16888 for predefined tokens.
16889 * src/symtab.h (bucket): Remove all the hash table related
16891 * src/symtab.c (symtab): Replace by...
16892 (bucket_table): this.
16893 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16894 (buckets_new, buckets_do): New.
16896 2002-04-07 Akim Demaille <akim@epita.fr>
16898 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
16899 (start_symbol, max_user_token_number, semantic_parser)
16900 (error_token_number): Initialize.
16901 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
16904 (errtoken, eoftoken, undeftoken, axiom): Extern.
16906 2002-04-07 Akim Demaille <akim@epita.fr>
16908 * src/gram.h (rule_s): prec and precsym are now pointers
16909 to the bucket giving the priority/associativity.
16910 Member `associativity' removed: useless.
16911 * src/reduce.c, src/conflicts.c: Adjust.
16913 2002-04-07 Akim Demaille <akim@epita.fr>
16915 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
16916 Properly escape the symbols' TAG when outputting them.
16918 2002-04-07 Akim Demaille <akim@epita.fr>
16920 * src/lalr.h (LA): Is a bitsetv, not bitset*.
16922 2002-04-07 Akim Demaille <akim@epita.fr>
16924 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
16925 (LArule): this, which is an array to rule_t*.
16926 * src/print.c, src/conflicts.c: Adjust.
16928 2002-04-07 Akim Demaille <akim@epita.fr>
16930 * src/gram.h (rule_t): Rename `number' as `user_number'.
16931 `number' is a new member.
16932 Adjust dependencies.
16933 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
16935 2002-04-07 Akim Demaille <akim@epita.fr>
16937 As a result of the previous patch, it is no longer needed
16938 to reorder ritem itself.
16940 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
16942 2002-04-07 Akim Demaille <akim@epita.fr>
16944 Be sure never to walk through RITEMS, but use only data related to
16945 the rules themselves. RITEMS should be banished.
16947 * src/output.c (output_token_translations): Rename as...
16948 (prepare_tokens): this.
16949 In addition to `translate', prepare the muscles `tname' and
16950 `toknum', which were handled by...
16951 (output_rule_data): this.
16952 Remove, and move the remainder of its outputs into...
16953 (prepare_rules): this new routines, which also merges content from
16954 (output_gram): this.
16955 (prepare_rules): Be sure never to walk through RITEMS.
16956 (output_stos): Rename as...
16957 (prepare_stos): this.
16958 (output): Always invoke prepare_states, after all, just don't use it
16959 in the output if you don't need it.
16961 2002-04-07 Akim Demaille <akim@epita.fr>
16963 * src/LR0.c (new_state): Display `nstates' as the name of the
16964 newly created state.
16965 Adjust to initialize first_state and last_state if needed.
16966 Be sure to distinguish the initial from the final state.
16967 (new_states): Create the itemset of the initial state, and use
16969 * src/closure.c (closure): Now that the initial state has its
16970 items properly set, there is no need for a special case when
16971 creating `ruleset'.
16973 As a result, now the rule 0, reducing to $axiom, is visible in the
16974 outputs. Adjust the test suite.
16976 * tests/conflicts.at (Solved SR Conflicts)
16977 (Unresolved SR Conflicts): Adjust.
16978 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
16979 * tests/conflicts.at (S/R in initial): New.
16981 2002-04-07 Akim Demaille <akim@epita.fr>
16983 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
16984 the RHS of the rules.
16985 * src/output.c (output_gram): Likewise.
16987 2002-04-07 Akim Demaille <akim@epita.fr>
16989 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
16991 Adjust all dependencies.
16992 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
16993 `number' of the buckets too.
16994 * src/gram.h: Include `symtab.h'.
16995 (associativity): Move to...
16996 * src/symtab.h: here.
16997 No longer include `gram.h'.
16999 2002-04-07 Akim Demaille <akim@epita.fr>
17001 * src/gram.h, src/gram.c (rules_rhs_length): New.
17002 (ritem_longest_rhs): Use it.
17003 * src/gram.h (rule_t): `number' is a new member.
17004 * src/reader.c (packgram): Set it.
17005 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
17006 the end of `rules', and count them out of `nrules'.
17007 (reduce_output, dump_grammar): Adjust.
17008 * src/print.c (print_grammar): It is no longer needed to check for
17009 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
17010 * tests/reduce.at (Reduced Automaton): New test.
17012 2002-04-07 Akim Demaille <akim@epita.fr>
17014 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
17015 lacking `+ 1' to nrules, Bison reported as useless a token if it
17016 was used solely to set the precedence of the last rule...
17018 2002-04-07 Akim Demaille <akim@epita.fr>
17020 * data/bison.c++, data/bison.simple: Don't output the current file
17021 name in #line, to avoid useless diffs between two identical
17022 outputs under different names.
17024 2002-04-07 Akim Demaille <akim@epita.fr>
17026 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
17027 Normalize loops to using `< nrules + 1', not `<= nrules'.
17029 2002-04-07 Akim Demaille <akim@epita.fr>
17033 2002-04-07 Akim Demaille <akim@epita.fr>
17035 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
17036 bucket.value as bucket.number.
17038 2002-04-07 Akim Demaille <akim@epita.fr>
17040 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
17041 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
17042 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
17043 RHS, instead of being an index in RITEMS.
17045 2002-04-04 Paul Eggert <eggert@twinsun.com>
17047 * doc/bison.texinfo: Update copyright date.
17048 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
17049 (Symbols): Warn about running Bison in one character set,
17050 but compiling and/or running in an incompatible one.
17051 Warn about character code 256, too.
17053 2002-04-03 Paul Eggert <eggert@twinsun.com>
17055 * src/bison.data (YYSTACK_ALLOC): Depend on whether
17056 YYERROR_VERBOSE is nonzero, not whether it is defined.
17058 Merge changes from bison-1_29-branch.
17060 2002-03-20 Paul Eggert <eggert@twinsun.com>
17062 Merge fixes from Debian bison_1.34-1.diff.
17064 * configure.in (AC_PREREQ): 2.53.
17066 2002-03-20 Akim Demaille <akim@epita.fr>
17068 * src/conflicts.c (log_resolution): Argument `resolution' is const.
17070 2002-03-19 Paul Eggert <eggert@twinsun.com>
17072 * src/bison.simple (YYCOPY): New macro.
17073 (YYSTACK_RELOCATE): Use it.
17074 Remove Type arg; no longer needed. All callers changed.
17075 (yymemcpy): Remove; no longer needed.
17077 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
17078 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
17080 2002-03-19 Akim Demaille <akim@epita.fr>
17082 Test and fix the #line outputs.
17084 * tests/atlocal.at (GCC): New.
17085 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
17086 (Prologue synch line, %union synch line, Postprologue synch line)
17087 (Action synch line, Epilogue synch line): New tests.
17088 * src/reader.c (parse_union_decl): Define the muscle stype_line.
17089 * data/bison.simple, data/bison.c++: Use it.
17091 2002-03-19 Akim Demaille <akim@epita.fr>
17093 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
17094 (Solved SR Conflicts, %expect not enough, %expect right)
17095 (%expect too much): Move to...
17096 * tests/conflicts.at: this new file.
17098 2002-03-19 Akim Demaille <akim@epita.fr>
17100 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
17101 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
17102 that we can move to enums for instance.
17103 * src/output.c (token_definitions_output): Output a list of
17104 `token-name, token-number' instead of the #define.
17105 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
17107 2002-03-14 Akim Demaille <akim@epita.fr>
17109 Use Gettext 0.11.1.
17111 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
17113 * data/bison.c++: Make the user able to add members to the generated
17114 parser by subclassing.
17116 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
17118 * src/reader.c (read_additionnal_code): `c' should be an integer, not
17120 Reported by Nicolas Tisserand and Nicolas Burrus.
17122 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
17124 * src/reader.c: Warn about lacking semi-colons, do not complain.
17126 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
17128 * data/bison.c++: Remove a debug line.
17130 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
17132 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
17133 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
17134 provide a default implementation.
17136 2002-03-04 Akim Demaille <akim@epita.fr>
17138 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
17139 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
17140 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
17141 * tests/semantic.at (Parsing Guards): Similarly.
17142 * src/reader.at (readgram): Complain if the last rule is not ended
17145 2002-03-04 Akim Demaille <akim@epita.fr>
17147 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
17148 * src/closure.c: here.
17149 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
17151 * src/warshall.h, src/warshall.c: Remove.
17152 * tests/sets.at (Broken Closure): Adjust.
17154 2002-03-04 Akim Demaille <akim@epita.fr>
17156 * src/output.c (output_skeleton): tempdir is const.
17157 bytes_read is unused.
17159 2002-03-04 Akim Demaille <akim@epita.fr>
17161 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
17162 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
17164 From Michael Hayes.
17166 2002-03-04 Akim Demaille <akim@epita.fr>
17168 * src/closure.c (closure): `r' is unused.
17170 2002-03-04 Akim Demaille <akim@epita.fr>
17172 * tests/sets.at (Broken Closure): Add the ending `;'.
17173 * src/reader.at (readgram): Complain if a rule is not ended with a
17176 2002-03-04 Akim Demaille <akim@epita.fr>
17178 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
17179 (count_sr_conflicts): Use bitset_count.
17180 * src/reduce.c (inaccessable_symbols): Ditto.
17181 (bits_size): Remove.
17182 * src/warshall.h, src/warshall.c: Convert to bitsetv.
17184 2002-03-04 Akim Demaille <akim@epita.fr>
17186 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
17187 * src/reduce.c: Remove the `bitset_zero's following the
17188 `bitset_create's, as now it is performed by the latter.
17190 2002-03-04 Akim Demaille <akim@epita.fr>
17192 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
17193 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
17194 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
17195 latest sources from Michael.
17197 2002-03-04 Akim Demaille <akim@epita.fr>
17199 * src/output.c (output): Don't free the grammar.
17200 * src/reader.c (grammar_free): New.
17201 * src/main.c (main): Call it and don't free symtab here.
17203 2002-03-04 Akim Demaille <akim@epita.fr>
17205 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
17207 Reported by Benoit Perrot.
17209 2002-03-04 Akim Demaille <akim@epita.fr>
17211 Use bitset operations when possible, not loops over bits.
17213 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
17215 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
17216 * src/reduce.c (useless_nonterminals): Formatting changes.
17217 * src/warshall.c (TC): Use bitset_or.
17219 2002-03-04 Akim Demaille <akim@epita.fr>
17221 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
17222 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
17225 2002-03-04 Akim Demaille <akim@epita.fr>
17227 * src/lalr.c (F): Now a bitset*.
17228 Adjust all dependencies.
17230 2002-03-04 Akim Demaille <akim@epita.fr>
17232 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
17233 Adjust all dependencies.
17235 2002-03-04 Akim Demaille <akim@epita.fr>
17237 * src/L0.c, src/LR0.h (nstates): Be size_t.
17238 Adjust comparisons (signed vs unsigned).
17239 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
17241 Adjust all dependencies.
17243 2002-03-04 Akim Demaille <akim@epita.fr>
17245 * src/closure.c (firsts): Now, also a bitset.
17246 Adjust all dependencies.
17247 (varsetsize): Remove, now unused.
17248 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
17250 2002-03-04 Akim Demaille <akim@epita.fr>
17252 * src/print.c: Convert to use bitset.h, not hand coded iterations
17255 2002-03-04 Akim Demaille <akim@epita.fr>
17257 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
17259 2002-03-04 Akim Demaille <akim@epita.fr>
17261 * src/closure.c (ruleset): Be a bitset.
17262 (rulesetsize): Remove.
17264 2002-03-04 Akim Demaille <akim@epita.fr>
17266 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
17267 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
17268 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
17269 * src/closure.c (fderives): Be an array of bitsets.
17271 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
17273 * data/bison.c++: Merge the two generated headers. Insert a copyright
17274 notice in each output file.
17276 2002-02-28 Akim Demaille <akim@epita.fr>
17278 * data/bison.c++: Copy the prologue of bison.simple to fetch
17279 useful M4 definitions, such as b4_header_guard.
17281 2002-02-25 Akim Demaille <akim@epita.fr>
17283 * src/getargs.c (version): Give the name of the authors, and use a
17284 translator friendly scheme for the bgr
17287 2002-02-25 Akim Demaille <akim@epita.fr>
17289 * src/output.c (header_output): Remove, now handled completely via
17292 2002-02-25 Akim Demaille <akim@epita.fr>
17294 * m4/m4.m4: New, from CVS Autoconf.
17295 * configure.in: Invoke it.
17296 * src/output.c (output_skeleton): Use its result instead of the
17299 2002-02-25 Akim Demaille <akim@epita.fr>
17301 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
17303 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
17304 * src/output.c (output_skeleton): Use mkstemp to create a real
17306 Move the filling of `skeleton' and its muscle to...
17308 (output): Move the definition of the prologue muscle to...
17310 * src/system.h (DEFAULT_TMPDIR): New.
17312 2002-02-14 Paul Eggert <eggert@twinsun.com>
17314 Remove the support for C++ namespace cleanliness; it was
17315 causing more problems than it was curing, since it didn't work
17316 properly on some nonstandard C++ compilers. This can wait
17317 for a proper C++ parser.
17319 * NEWS: Document this.
17320 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
17321 of C++, as it's treated like C now.
17322 * src/bison.simple (YYSTD): Remove.
17323 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
17324 Treat C++ just like Standard C instead of trying to support
17325 namespace cleanliness.
17327 2002-02-14 Akim Demaille <akim@epita.fr>
17329 * tests/regression.at (else): Adjust to Andreas' change.
17331 2002-02-14 Akim Demaille <akim@epita.fr>
17333 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
17335 2002-02-13 Andreas Schwab <schwab@suse.de>
17337 * src/output.c (output_rule_data): Don't output NULL, it might
17338 not be defined yet.
17340 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
17342 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
17343 (Copyright notice): Update.
17345 2002-02-11 Akim Demaille <akim@epita.fr>
17347 * tests/regression.at (%nonassoc and eof): Don't include
17348 nonportable headers.
17350 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
17352 * data/bison.c++: Correct error recovery. Make the user able to
17353 initialize the starting location.
17355 2002-02-07 Akim Demaille <akim@epita.fr>
17357 * tests/input.at: New.
17359 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17361 * data/bison.c++: Replace some direct m4 expansions by constants. Be
17362 more consistent when naming methods and variables. Put preprocessor
17363 directives around tables only needed for debugging.
17365 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17367 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
17369 (yy::b4_name::parse): Use print_.
17371 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17373 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
17375 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17377 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
17379 (yy::b4_name::parse): Build verbose error messages, and use error_.
17381 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
17383 * data/bison.c++: Fix m4 quoting in comments.
17385 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
17387 * data/bison.c++: Adjust the parser code. Fix some muscles that were
17388 not expanded by m4.
17390 2002-02-05 Akim Demaille <akim@epita.fr>
17392 * data/bison.c++: Adjust to the M4 back end.
17393 More is certainly needed.
17395 2002-02-05 Akim Demaille <akim@epita.fr>
17397 Give a try to M4 as a back end.
17399 * lib/readpipe.c: New, from wdiff.
17400 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
17402 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
17403 specific values. Now it is m4 that performs the lookup.
17404 * src/parse-skel.y: Remove.
17405 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
17406 * src/output.c (actions_output, guards_output)
17407 (token_definitions_output): No longer keeps track of the output
17408 line number, hence remove the second argument.
17409 (guards_output): Check against the guard member of a rule, not the
17412 (output_skeleton): Don't look for the skeleton location, let m4 do
17414 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
17416 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
17417 (prepare): Given that for the time being changesyntax is not
17418 usable in M4, rename the muscles using `-' to `_'.
17419 Define `defines_flag', `output_parser_name' and `output_header_name'.
17420 * src/output.h (actions_output, guards_output)
17421 (token_definitions_output): Adjust prototypes.
17422 * src/scan-skel.l: Instead of scanning the skeletons, it now
17423 processes the output of m4: `__oline__' and `#output'.
17424 * data/bison.simple: Adjust to be used by M4(sugar).
17425 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
17427 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
17428 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
17429 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
17430 shamelessly stolen from CVS Autoconf.
17432 2002-02-05 Akim Demaille <akim@epita.fr>
17434 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
17435 * configure.in: Check for the declarations of free and malloc.
17436 * src/muscle_tab.c: Adjust.
17438 2002-02-05 Akim Demaille <akim@epita.fr>
17440 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
17441 which have no values.
17443 2002-02-05 Akim Demaille <akim@epita.fr>
17445 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
17448 2002-01-29 Paul Eggert <eggert@twinsun.com>
17450 * src/bison.simple (YYSIZE_T): Do not define merely because
17451 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
17452 On some platforms, <alloca.h> does not declare YYSTD (size_t).
17454 2002-01-27 Akim Demaille <akim@epita.fr>
17456 Fix `%nonassoc and eof'.
17458 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
17459 which were not properly copied! Replace
17460 memcpy (res->errs, src->errs, src->nerrs);
17462 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
17464 * tests/regression.at (%nonassoc and eof): Adjust to newest
17465 Autotest: `.' is not in the PATH.
17467 2002-01-27 Akim Demaille <akim@epita.fr>
17469 * tests/sets.at (AT_EXTRACT_SETS): New.
17470 (Nullable): Use it.
17473 2002-01-26 Akim Demaille <akim@epita.fr>
17475 * tests/actions.at, tests/calc.at, tests/headers.at,
17476 * tests/torture.at: Adjust to the newest Autotest which no longer
17477 forces `.' in the PATH.
17479 2002-01-25 Akim Demaille <akim@epita.fr>
17481 * tests/regression.at (%nonassoc and eof): New.
17482 Suggested by Robert Anisko.
17484 2002-01-24 Akim Demaille <akim@epita.fr>
17486 Bison dumps core when trying to complain about broken input files.
17487 Reported by Cris van Pelt.
17489 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
17490 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
17492 (Invalid inputs): Strengthen: exercise parse_percent_token.
17494 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
17496 * src/Makefile.am: Add bison.c++.
17497 * src/bison.c++: New skeleton.
17499 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
17503 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
17505 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
17507 2002-01-20 Marc Autret <marc@gnu.org>
17509 * src/files.c (compute_output_file_names): Fix
17511 2002-01-20 Marc Autret <marc@gnu.org>
17513 * tests/output.at: New test.
17514 * src/files.c (compute_base_names): Don't map extensions when
17515 the YACC flag is set, use defaults.
17516 Reported by Evgeny Stambulchik.
17518 2002-01-20 Marc Autret <marc@gnu.org>
17520 * src/system.h: Need to define __attribute__ away for non-GCC
17521 compilers as well (i.e., the vendor C compiler).
17522 Suggested by Albert Chin-A-Young.
17524 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
17526 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
17527 canonical definition.
17528 * src/system.h: Use the canonical definition for PARAMS (avoids
17529 a conflict with the macro from lib/hash.h).
17531 2002-01-11 Akim Demaille <akim@epita.fr>
17533 * configure.in: Use AC_FUNC_STRNLEN.
17534 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
17536 2002-01-09 Akim Demaille <akim@epita.fr>
17538 * src/files.c, src/files.h (output_infix): New.
17539 (tab_extension): Remove.
17540 (compute_base_names): Compute the former, drop the latter.
17541 * src/output.c (prepare): Insert the muscles `output-infix', and
17543 * src/parse-skel.y (string, string.1): New.
17544 (section.header): Use it.
17545 (section.yacc): Remove.
17546 (prefix): Remove too.
17547 * src/scan-skel.l: Adjust.
17548 * src/bison.simple, src/bison.hairy: Adjust.
17550 2002-01-09 Akim Demaille <akim@epita.fr>
17552 * configure.in (WERROR_CFLAGS): Compute it.
17553 * src/Makefile.am (CFLAGS): Pass it.
17554 * tests/atlocal.in (CFLAGS): Idem.
17555 * src/files.c: Fix a few warnings.
17556 (get_extension_index): Remove, unused.
17558 2002-01-08 Akim Demaille <akim@epita.fr>
17560 * src/getargs.c (AS_FILE_NAME): New.
17561 (getargs): Use it to convert DOSish file names.
17562 * src/files.c (base_name): Rename as full_base_name to avoid
17563 clashes with `base_name ()'.
17564 (filename_split): New.
17565 (compute_base_names): N-th rewrite, using filename_split.
17567 2002-01-08 Akim Demaille <akim@epita.fr>
17569 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
17570 New, stolen from the Fileutils 4.1.
17571 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
17572 * configure.in: Check for the presence of memrchr, and of its
17575 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
17577 * lib/hash.h (__P): Added definition for this macro.
17578 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
17579 BUILT_SOURCES, to ensure they are generated first.
17580 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
17581 %error-verbose to allow bootstrapping with bison 1.30x.
17583 2002-01-06 Akim Demaille <akim@epita.fr>
17585 * src/reader.c (parse_braces): Don't fetch the next char, the
17586 convention is to fetch on entry.
17587 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
17588 'switch' without a following semicolon.
17589 * tests/regression.at (braces parsing): New.
17591 2002-01-06 Akim Demaille <akim@epita.fr>
17593 Bison is dead wrong in its RR conflict reports.
17595 * tests/torture.at (GNU Cim Grammar): New.
17596 * src/conflicts.c (count_rr_conflicts): Fix.
17598 2002-01-06 Akim Demaille <akim@epita.fr>
17600 Creating package.m4 from configure.ac causes too many problems.
17602 * tests/Makefile.am (package.m4): Create it by hand,
17603 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
17605 2002-01-06 Akim Demaille <akim@epita.fr>
17607 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
17610 2002-01-04 Paul Eggert <eggert@twinsun.com>
17612 * doc/bison.texinfo (Debugging):
17613 Remove YYSTDERR; it's no longer defined or used.
17614 Also, s/cstdio.h/cstdio/.
17616 2002-01-03 Akim Demaille <akim@epita.fr>
17618 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
17620 2002-01-03 Akim Demaille <akim@epita.fr>
17622 * src/parse-skel.y (process_skeleton): Don't bind the parser's
17623 tracing code to --trace, wait for a better --trace option, with
17626 2002-01-03 Akim Demaille <akim@epita.fr>
17628 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
17629 The ISO C++ standard is extremely clear about it: stderr is
17630 considered a macro, not a regular symbol (see table 94 `Header
17631 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
17632 Therefore std:: does not apply to it. It still does with fprintf.
17633 Also, s/cstdio.h/cstdio/.
17635 2002-01-03 Akim Demaille <akim@epita.fr>
17637 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
17638 for non system headers.
17640 2002-01-02 Akim Demaille <akim@epita.fr>
17642 Equip the skeleton chain with location tracking, runtime trace,
17643 pure parser and scanner.
17645 * src/parse-skel.y: Request a pure parser, locations, and prefix
17647 (%union): Having several members with the same type does not help
17648 type mismatches, simplify.
17649 (YYPRINT, yyprint): New.
17650 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
17651 (skel_error): this.
17653 * src/scan-skel.l: Adjust to these changes.
17654 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
17655 (LOCATION_PRINT, skel_control_t): New.
17657 2001-12-30 Akim Demaille <akim@epita.fr>
17659 * src/parse-skel.y: Get rid of the shift/reduce conflict:
17660 replace `gb' with BLANKS.
17661 * src/scan-skel.l: Adjust.
17663 2001-12-30 Akim Demaille <akim@epita.fr>
17665 * src/system.h: We don't need nor want bcopy.
17666 Throw away MS-DOS crap: we don't need getpid.
17667 * configure.in: We don't need strndup. It was even causing
17668 problems: because Flex includes the headers *before* us,
17669 _GNU_SOURCE is not defined by config.h, and therefore strndup was
17671 * lib/xstrndup.c: New.
17672 * src/scan-skel.l: Use it.
17673 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
17674 * src/parse-skel.y: Use %directives instead of #defines.
17676 2001-12-30 Akim Demaille <akim@epita.fr>
17678 * src/skeleton.h: New.
17679 * src/output.c (output_parser, output_master_parser): Remove, dead
17681 * src/output.h (get_lines_number, actions_output, guards_output)
17682 (token_definitions_output): Prototype them.
17683 * src/parse-skel.y: Add the license notice.
17684 Include output.h and skeleton.h.
17685 (process_skeleton): Returns void, and takes a single parameter.
17686 * src/scan-skel.l: Add the license notice.
17687 Include skeleton.h.
17688 Don't use %option yylineno: it seems that then Flex imagines
17689 REJECT has been used, and therefore it won't reallocate its
17690 buffers (which makes no other sense to me than a bug). It results
17691 in warnings for `unused: yy_flex_realloc'.
17693 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
17695 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17696 (MUSCLE_INSERT_PREFIX): ...to there.
17697 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17698 (MUSCLE_INSERT_PREFIX): Move from here...
17700 * src/bison.hairy: Add a section directive. Put braces around muscle
17701 names. This parser skeleton is still broken, but Bison should not
17702 choke on a bad muscle 'syntax'.
17703 * src/bison.simple: Add a section directive. Put braces around muscle
17706 * src/files.h (strsuffix, stringappend): Add declarations.
17707 (tab_extension): Add declaration.
17708 (short_base_name): Add declaration.
17710 * src/files.c (strsuffix, stringappend): No longer static. These
17711 functions are used in the skeleton parser.
17712 (tab_extension): New.
17713 (compute_base_names): Use the computations done in this function
17714 to guess if the generated parsers should have '.tab' in their
17716 (short_base_name): No longer static.
17718 * src/output.c (output_skeleton): New.
17719 (output): Disable call to output_master_parser, and give a try to
17720 a new skeleton handling system.
17721 (guards_output, actions_output): No longer static.
17722 (token_definitions_output, get_lines_number): No longer static.
17724 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
17726 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
17729 * src/parse-skel.y: New file.
17730 * src/scan-skel.l: New file.
17732 2001-12-29 Akim Demaille <akim@epita.fr>
17734 %name-prefix is broken.
17736 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
17737 Adjust all dependencies.
17738 * tests/headers.at (export YYLTYPE): Strengthen this test: use
17741 Renaming yylval but not yylloc is not consistent. Now we do.
17743 * src/bison.simple: Prefix yylloc if used.
17744 * doc/bison.texinfo (Decl Summary): Document that.
17746 2001-12-29 Akim Demaille <akim@epita.fr>
17748 * doc/bison.texinfo: Promote `%long-directive' over
17750 Remove all references to fixed-output-files, yacc is enough.
17752 2001-12-29 Akim Demaille <akim@epita.fr>
17754 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
17755 user prologue. These are defaults.
17756 * tests/actions.at (Mid-rule actions): Make sure the user can
17757 define YYDEBUG and YYERROR_VERBOSE.
17759 2001-12-29 Akim Demaille <akim@epita.fr>
17761 * src/output.c (header_output): Don't forget to export YYLTYPE and
17763 * tests/headers.at (export YYLTYPE): New, make sure it does.
17764 * tests/regression.at (%union and --defines, Invalid CPP headers):
17766 * tests/headers.at: here.
17768 2001-12-29 Akim Demaille <akim@epita.fr>
17770 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
17772 2001-12-29 Akim Demaille <akim@epita.fr>
17774 * tests/actions.at (Mid-rule actions): Output on a single line
17775 instead of several.
17777 2001-12-29 Akim Demaille <akim@epita.fr>
17779 * doc/bison.texinfo: Formatting changes.
17781 2001-12-29 Akim Demaille <akim@epita.fr>
17783 Don't store the token defs in a muscle, just be ready to output it
17784 on command. Now possible via `symbols'. Fixes a memory leak.
17786 * src/output.c (token_definitions_output): New.
17787 (output_parser, header_output): Use it.
17788 * src/reader.c (symbols_save): Remove.
17790 2001-12-29 Akim Demaille <akim@epita.fr>
17792 * src/bison.simple: Do not provide a default for YYSTYPE and
17793 YYLTYPE before the user's prologue. Otherwise it's hardly... a
17796 2001-12-29 Akim Demaille <akim@epita.fr>
17798 Mid-rule actions are simply... ignored!
17800 * src/reader.c (readgram): Be sure to attach mid-rule actions to
17801 the empty-rule associated to the dummy symbol, not to the host
17803 * tests/actions.at (Mid-rule actions): New.
17805 2001-12-29 Akim Demaille <akim@epita.fr>
17809 * src/reader.c (reader): Free grammar.
17811 2001-12-29 Akim Demaille <akim@epita.fr>
17815 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
17816 since it allocates it for each state, although only one is needed.
17817 (allocate_storage): Do it here.
17819 2001-12-29 Akim Demaille <akim@epita.fr>
17821 * src/options.h, src/options.c (create_long_option_table): Rename
17823 (long_option_table_new): this, with a clearer prototype.
17824 (percent_table): Remove, unused,
17825 * src/getargs.c (getargs): Adjust.
17827 2001-12-29 Akim Demaille <akim@epita.fr>
17829 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
17830 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
17833 2001-12-29 Akim Demaille <akim@epita.fr>
17835 * src/lalr.c (build_relations): Rename `states' as `states1'.
17836 Sorry, I don't understand exactly what it is, no better name...
17838 2001-12-29 Akim Demaille <akim@epita.fr>
17840 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
17841 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
17842 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
17845 2001-12-29 Akim Demaille <akim@epita.fr>
17847 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
17850 2001-12-29 Akim Demaille <akim@epita.fr>
17852 * src/reader.c, src/reader.h (user_toknums): Remove.
17853 Adjust all users to use symbols[i]->user_token_number.
17855 2001-12-29 Akim Demaille <akim@epita.fr>
17857 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
17858 Adjust all users to use symbols[i]->prec or ->assoc.
17860 2001-12-29 Akim Demaille <akim@epita.fr>
17862 * src/reader.c, src/reader.h (tags): Remove.
17863 Adjust all users to use symbols[i]->tag.
17865 2001-12-29 Akim Demaille <akim@epita.fr>
17867 * src/gram.h, src/gram.c (symbols): New, similar to state_table
17869 * src/reader.c (packsymbols): Fill this table.
17871 * src/conflicts.c (resolve_sr_conflict): Adjust.
17872 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
17874 Use symbols[i]->tag instead of tags[i].
17876 2001-12-29 Akim Demaille <akim@epita.fr>
17878 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
17879 In addition, put a comment in there, to replace...
17880 * tests/regression.at (%union and C comments): Remove.
17882 2001-12-29 Akim Demaille <akim@epita.fr>
17884 * tests/regression.at (Web2c Actions): Blindly move the actual
17885 output as expected output. The contents *seem* right to me, but I
17886 can't pretend reading perfectly parser tables... Nonetheless, all
17887 the other tests pass correctly, the table look OK, even though the
17888 presence of `$axiom' is to be noted: AFAICS it is useless (but
17891 2001-12-29 Akim Demaille <akim@epita.fr>
17893 * src/reader.c (readgram): Don't add the rule 0 if there were no
17894 rules read. In other words, add it _after_ having performed
17895 grammar sanity checks.
17896 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
17898 2001-12-29 Akim Demaille <akim@epita.fr>
17900 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
17901 visible, and some states have now a different number.
17903 2001-12-29 Akim Demaille <akim@epita.fr>
17905 * src/reader.c (readgram): Bind the initial rule's lineno to that
17907 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
17908 (Solved SR Conflicts): Adjust rule 0's line number.
17910 2001-12-29 Akim Demaille <akim@epita.fr>
17912 Fix the `GAWK Grammar' failure.
17914 * src/LR0.c (final_state): Initialize to -1 so that we do compute
17915 the reductions of the first state which was mistakenly confused
17916 with the final state because precisely final_state was initialized
17918 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
17919 now noticed by Bison.
17920 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
17921 have a reduction on $default.
17923 2001-12-29 Akim Demaille <akim@epita.fr>
17925 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
17927 * src/closure.c (print_closure): Likewise.
17928 * src/derives.c (print_derives): Likewise.
17929 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
17932 2001-12-29 Akim Demaille <akim@epita.fr>
17934 * src/lalr.c (lookaheads_print): New.
17935 (lalr): Call it when --trace-flag.
17936 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
17939 2001-12-29 Akim Demaille <akim@epita.fr>
17941 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
17942 when walking through ritem, even via rule->rhs.
17943 * src/reduce.c (dump_grammar, useful_production, reduce_output)
17944 (useful_production, useless_nonterminals): Likewise.
17945 (reduce_grammar_tables): Likewise, plus update nritems.
17946 * src/nullable.c (set_nullable): Likewise.
17947 * src/lalr.c (build_relations): Likewise.
17948 * tests/sets.at (Nullable): Adjust.
17949 Fortunately, now, the $axiom is no longer nullable.
17951 2001-12-29 Akim Demaille <akim@epita.fr>
17953 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
17955 * src/gram.c (ritem_longest_rhs): Likewise.
17956 * src/reduce.c (nonterminals_reduce): Likewise.
17957 * src/print_graph.c (print_graph): Likewise.
17958 * src/output.c (output_rule_data): Likewise.
17959 * src/nullable.c (set_nullable): Likewise.
17961 2001-12-29 Akim Demaille <akim@epita.fr>
17963 * src/output.c: Comment changes.
17965 2001-12-27 Paul Eggert <eggert@twinsun.com>
17967 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
17968 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
17969 Sparc, as they were causing more porting problems than the
17970 (minor) performance improvement was worth.
17972 Also, catch up with 1.31's YYSTD.
17974 2001-12-27 Akim Demaille <akim@epita.fr>
17976 * src/output.c (output_gram): Rely on nritems, not the
17977 0-sentinel. See below.
17978 Use -1 as separator, not 0.
17979 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
17980 Rely on -1 as separator in yyrhs, instead of 0.
17981 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
17982 twice `Now at end of input', therefore there are two lines less to
17985 2001-12-27 Akim Demaille <akim@epita.fr>
17987 * tests/regression.at (Unresolved SR Conflicts):
17988 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
17991 2001-12-27 Akim Demaille <akim@epita.fr>
17993 * src/LR0.c (new_state): Recognize the final state by the fact it
17994 is reached by eoftoken.
17995 (insert_start_shifting_state, insert_eof_shifting_state)
17996 (insert_accepting_state, augment_automaton): Remove, since now
17997 these states are automatically computed from the initial state.
17998 (generate_states): Adjust.
17999 * src/print.c: When reporting a rule number to the user, substract
18000 1, so that the axiom rule is rule 0, and the first user rule is 1.
18001 * src/reduce.c: Likewise.
18002 * src/print_graph.c (print_core): For the time being, just as for
18003 the report, depend upon --trace-flags to dump the full set of
18005 * src/reader.c (readgram): Once the grammar read, insert the rule
18006 0: `$axiom: START-SYMBOL $'.
18007 * tests/set.at: Adjust: rule 0 is now displayed, and since the
18008 number of the states has changed (the final state is no longer
18009 necessarily the last), catch up.
18011 2001-12-27 Akim Demaille <akim@epita.fr>
18013 Try to make the use of the eoftoken valid. Given that its value
18014 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
18015 is used instead of > 0 where appropriate, (ii), depend upon nritems
18016 instead of the 0-sentinel.
18018 * src/gram.h, src/gram.c (nritems): New.
18019 Expected to be duplication of nitems, but for the time being...
18020 * src/reader.c (packgram): Assert nritems and nitems are equal.
18021 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
18022 * src/closure.c (print_closure, print_fderives): Likewise.
18023 * src/gram.c (ritem_print): Likewise.
18024 * src/print.c (print_core, print_grammar): Likewise.
18025 * src/print_graph.c: Likewise.
18027 2001-12-27 Akim Demaille <akim@epita.fr>
18029 * src/main.c (main): If there are complains after grammar
18030 reductions, then output the report anyway if requested, then die.
18031 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
18032 * src/reader.c (eoftoken): New.
18033 (parse_token_decl): If the token being defined has value `0', it
18035 (packsymbols): No longer hack `tags' to insert `$' by hand.
18036 Be sure to preserve the value of the eoftoken.
18037 (reader): Make sure eoftoken is defined.
18038 Initialize nsyms to 0: now eoftoken is created just like the others.
18039 * src/print.c (print_grammar): Don't special case the eof token.
18040 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
18041 lie anyway, albeit pleasant.
18042 * tests/calc.at: Exercise error messages with eoftoken.
18043 Change the grammar so that empty input is invalid.
18044 Adjust expectations.
18045 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
18047 2001-12-27 Akim Demaille <akim@epita.fr>
18049 * configure.in: Check the protos of strchr ans strspn.
18050 Replace strchr if needed.
18051 * src/system.h: Provide the protos of strchr, strspn and memchr if
18053 * lib/strchr.c: New.
18054 * src/reader.c (symbols_save): Use strchr.
18056 2001-12-27 Akim Demaille <akim@epita.fr>
18058 * src/print.c, src/print_graph.c (escape): New.
18059 Use it to quote the TAGS outputs.
18060 * src/print_graph.c (print_state): Now errors are in red, and
18061 reductions in green.
18062 Prefer high to wide: output the state number on a line of its own.
18064 2001-12-27 Akim Demaille <akim@epita.fr>
18066 * src/state.h, src/state.c (reductions_new): New.
18067 * src/LR0.c (set_state_table): Let all the states have a
18068 `reductions', even if reduced to 0.
18069 (save_reductions): Adjust.
18070 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
18071 * src/print.c (print_reductions, print_actions): Adjust.
18072 * src/output.c (action_row): Adjust.
18074 2001-12-27 Akim Demaille <akim@epita.fr>
18076 * src/state.h, src/state.c (errs_new, errs_dup): New.
18077 * src/LR0.c (set_state_table): Let all the states have an errs,
18078 even if reduced to 0.
18079 * src/print.c (print_errs, print_reductions): Adjust.
18080 * src/output.c (output_actions, action_row): Adjust.
18081 * src/conflicts.c (resolve_sr_conflict): Adjust.
18083 2001-12-27 Akim Demaille <akim@epita.fr>
18085 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
18087 2001-12-27 Akim Demaille <akim@epita.fr>
18089 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
18090 * src/print.c: here.
18091 (lookaheadset, shiftset): New, used as additional storage by
18093 (print_results): Adjust.
18094 (print_shifts, print_gotos, print_errs): New, extracted from...
18095 (print_actions): here.
18096 * src/print_graph.c (print_actions): Remove dead code.
18098 2001-12-27 Akim Demaille <akim@epita.fr>
18100 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
18103 2001-12-27 Akim Demaille <akim@epita.fr>
18105 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
18106 (build_relations): Adjust.
18108 2001-12-27 Akim Demaille <akim@epita.fr>
18110 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
18113 2001-12-27 Akim Demaille <akim@epita.fr>
18115 * src/reader.c (packgram): Catch nitems overflows.
18117 2001-12-27 Akim Demaille <akim@epita.fr>
18119 * src/files.c, src/files.h (guard_obstack): Remove.
18120 * src/output.c (output): Adjust.
18121 * src/reader.c (parse_braces): New, factoring...
18122 (copy_action, copy_guard): these two which are renamed as...
18123 (parse_action, parse_guard): these.
18124 As a voluntary consequence, using braces around guards is now
18127 2001-12-27 Akim Demaille <akim@epita.fr>
18129 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
18130 * src/reader.c (symbol_list): `guard' and `guard_line' are new
18132 (symbol_list_new): Adjust.
18133 (copy_action): action_line is the first line, not the last.
18134 (copy_guard): Just as for actions, store the `action' only, not
18135 the switch/case/break flesh.
18136 Don't parse the user action that might follow the guard, let...
18137 (readgram): do it, i.e., now, there can be an action after a
18139 In other words the guard is just explicitly optional.
18140 (packgram): Adjust.
18141 * src/output.c (guards_output): New.
18142 (output_parser): Call it when needed.
18143 (output): Also free the guard and attrs obstacks.
18144 * src/files.c, src/files.h (obstack_save): Remove.
18145 (output_files): Remove.
18146 As a result, if one needs the former `.act' file, using an
18147 appropriate skeleton which requires actions and guards is now
18149 * src/main.c (main): Adjust.
18150 * tests/semantic.at: New.
18151 * tests/regression.at: Use `input.y' as input file name.
18152 Avoid 8+3 problems by requiring input.c when the test needs the
18155 2001-12-27 Akim Demaille <akim@epita.fr>
18157 * src/reader.c (symbol_list_new): Be sure to initialize all the
18160 2001-12-27 Akim Demaille <akim@epita.fr>
18162 All the hacks using a final pseudo state are now useless.
18164 * src/LR0.c (set_state_table): state_table holds exactly nstates.
18165 * src/lalr.c (nLA): New.
18166 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
18167 instead of lookaheadsp from the pseudo state (nstate + 1).
18169 2001-12-27 Akim Demaille <akim@epita.fr>
18171 * src/output.c (action_row, token_actions): Use a state_t instead
18172 of a integer, and nlookaheads instead of the following state's
18175 2001-12-27 Akim Demaille <akim@epita.fr>
18177 * src/conflicts.c (log_resolution, flush_shift)
18178 (resolve_sr_conflict, set_conflicts, solve_conflicts)
18179 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
18180 (conflicts_print, print_reductions): Use a state_t instead of an
18181 integer when referring to a state.
18182 As much as possible, depend upon nlookaheads, instead of the
18183 `lookaheadsp' member of the following state (since lookaheads of
18184 successive states are successive, the difference between state n + 1
18185 and n served as the number of lookaheads for state n).
18186 * src/lalr.c (add_lookback_edge): Likewise.
18187 * src/print.c (print_core, print_actions, print_state)
18188 (print_results): Likewise.
18189 * src/print_graph.c (print_core, print_actions, print_state)
18190 (print_graph): Likewise.
18191 * src/conflicts.h: Adjust.
18193 2001-12-27 Akim Demaille <akim@epita.fr>
18195 * src/bison.hairy: Formatting/comment changes.
18197 Remove `register' indications.
18198 Add plenty of `static'.
18200 2001-12-27 Akim Demaille <akim@epita.fr>
18202 * src/output.c (prepare): Drop the muscle `ntbase' which
18203 duplicates ntokens.
18204 * src/bison.simple: Formatting/comment changes.
18205 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
18206 is an undocumented synonym.
18208 2001-12-22 Akim Demaille <akim@epita.fr>
18210 * src/output.c (output_table_data): Change the prototype to use
18211 `int' for array ranges: some invocations do pass an int, not a
18213 Reported by Wayne Green.
18215 2001-12-22 Akim Demaille <akim@epita.fr>
18217 Some actions of web2c.y are improperly triggered.
18218 Reported by Mike Castle.
18220 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
18221 * tests/regression.at (Web2c): Rename as...
18222 (Web2c Report): this.
18223 (Web2c Actions): New.
18225 2001-12-22 Akim Demaille <akim@epita.fr>
18227 Reductions in web2c.y are improperly reported.
18228 Reported by Mike Castle.
18230 * src/conflicts.c (print_reductions): Fix.
18231 * tests/regression.at (Web2c): New.
18233 2001-12-18 Akim Demaille <akim@epita.fr>
18235 Some host fail on `assert (!"foo")', which expands to
18236 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
18237 Reported by Nelson Beebee.
18239 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
18240 `#define it_succeeded 0' and `assert (it_succeeded)'.
18242 2001-12-17 Marc Autret <autret_m@epita.fr>
18244 * src/bison.simple: Don't hard code the skeleton line and filename.
18245 * src/output.c (output_parser): Rename 'line' as 'output_line'.
18246 New line counter 'skeleton_line' (skeleton-line muscle).
18248 2001-12-17 Paul Eggert <eggert@twinsun.com>
18250 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
18251 YYDEBUG must be defined to a nonzero value.
18253 * src/bison.simple (yytname): Do not assume that the user defines
18254 YYDEBUG to a properly parenthesized expression.
18256 2001-12-17 Akim Demaille <akim@epita.fr>
18258 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
18259 nlookaheads is a new member.
18261 * src/lalr.h (nlookaheads): Remove this orphan declaration.
18262 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
18265 2001-12-17 Akim Demaille <akim@epita.fr>
18267 * src/files.h, src/files.c (open_files, close_files): Remove.
18268 * src/main.c (main): Don't open/close files, nor invoke lex_free,
18270 * src/reader.c (reader): Do it.
18272 2001-12-17 Akim Demaille <akim@epita.fr>
18274 * src/conflicts.c (print_reductions): Formatting changes.
18276 2001-12-17 Akim Demaille <akim@epita.fr>
18278 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
18279 (flush_reduce): New.
18280 (resolve_sr_conflict): Adjust.
18282 2001-12-17 Akim Demaille <akim@epita.fr>
18284 * src/output.c (output_obstack): Be static and rename as...
18285 (format_obstack): this, to avoid any confusion with files.c's
18287 * src/reader.h (muscle_obstack): Move to...
18288 * src/output.h: here, since it's defined in output.c.
18290 2001-12-17 Akim Demaille <akim@epita.fr>
18292 * src/output.c (action_row, save_column, default_goto)
18293 (sort_actions, matching_state, pack_vector): Better variable
18296 2001-12-17 Akim Demaille <akim@epita.fr>
18298 * src/output.c: Various formatting changes.
18300 2001-12-17 Akim Demaille <akim@epita.fr>
18302 * src/files.c (output_files): Free the output_obstack.
18303 * src/main.c (main): Call print and print_graph conditionally.
18304 * src/print.c (print): Work unconditionally.
18305 * src/print_graph.c (print_graph): Work unconditionally.
18306 * src/conflicts.c (log_resolution): Output only if verbose_flag.
18308 2001-12-16 Marc Autret <autret_m@epita.fr>
18310 * src/output.c (actions_output): Fix. When we use %no-lines,
18311 there is one less line per action.
18313 2001-12-16 Marc Autret <autret_m@epita.fr>
18315 * src/bison.simple: Remove a useless #line directive.
18316 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
18317 * src/output.c (get_lines_number): New.
18318 (output_parser): Adjust, now takes care about the lines of a
18320 Fix line numbering.
18321 (actions_output): Computes the number of lines taken by actions.
18322 (output_master_parser): Insert new skeleton which is the name of
18323 the output parser file name.
18325 2001-12-15 Marc Autret <autret_m@epita.fr>
18327 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
18329 2001-12-15 Marc Autret <autret_m@epita.fr>
18331 * src/output.c (output_gram): Keep track of the hairy one.
18333 2001-12-15 Akim Demaille <akim@epita.fr>
18335 Make `make distcheck' work.
18337 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
18338 system.h which uses libgettext.h.
18340 2001-12-15 Akim Demaille <akim@epita.fr>
18342 * src/nullable.c (set_nullable): Useless rules must be skipped,
18343 otherwise, since we range over their symbols, we might look at a
18344 nonterminal which no longer ``exists'', i.e., it is not counted in
18345 `nvars', hence we overflow our arrays.
18347 2001-12-15 Akim Demaille <akim@epita.fr>
18349 The header can also be produced directly, without any obstack!
18352 * src/files.c, src/files.h (defines_obstack): Remove.
18353 (compute_header_macro): Global.
18354 (defines_obstack_save): Remove.
18355 * src/reader.c (parse_union_decl): No longer output to
18356 defines_obstack: its content can be found in the `stype' muscle
18358 (output_token_translations): Merge into...
18359 (symbols_output): this.
18361 (symbols_save): this.
18363 * src/output.c (header_output): New.
18366 2001-12-15 Akim Demaille <akim@epita.fr>
18368 * src/reader.c (parse_union_decl): Instead of handling two obstack
18369 simultaneously, use one to define the `stype' muscle, and use the
18370 value of the latter to fill defines_obstack.
18371 (copy_comment): Remove.
18372 (copy_comment2): Work for a single obstack.
18374 (copy_comment): this.
18376 2001-12-15 Akim Demaille <akim@epita.fr>
18378 * src/lex.c, src/lex.h (xgetc): No longer static.
18379 * src/reader.c (parse_union_decl): Revamp.
18381 2001-12-15 Akim Demaille <akim@epita.fr>
18383 Still making progress in separating Bison into (i) input, (ii)
18384 process, (iii) output: now we can directly output the parser file
18385 without using table_obstack at all.
18387 * src/files.c, src/files.h (table_obstack): Bye bye.
18388 (parser_file_name): New.
18389 * src/files.c (compute_output_file_names): Compute it.
18390 * src/output.c (actions_output, output_parser)
18391 (output_master_parser): To a file instead of an obstack.
18393 2001-12-15 Akim Demaille <akim@epita.fr>
18395 Attach actions to rules, instead of pre-outputting them to
18398 * src/gram.h (rule_t): action and action_line are new members.
18399 * src/reader.c (symbol_list): Likewise.
18400 (copy_action): Save the actions within the rule.
18401 (packgram): Save them in rule_table.
18402 * src/output.c (actions_output): New.
18403 (output_parser): Use it on `%%actions'.
18404 (output_rule_data): Don't free rule_table.
18406 (prepare): Don't save the `action' muscle.
18407 * src/bison.simple: s/%%action/%%actions/.
18409 2001-12-15 Akim Demaille <akim@epita.fr>
18411 * src/reader.c (copy_action): When --yacc, don't append a `;'
18412 to the user action: let it fail if lacking.
18413 Suggested by Arnold Robbins and Tom Tromey.
18415 2001-12-14 Akim Demaille <akim@epita.fr>
18417 * src/lex.c (literalchar): Simply return the char you decoded, non
18418 longer mess around with obstacks and int pointers.
18419 Adjust all callers.
18421 2001-12-14 Akim Demaille <akim@epita.fr>
18423 * src/lex.c (literalchar): Don't escape the special characters,
18424 just decode them, and keep them as char (before, eol was output as
18425 the 2 char string `\n' etc.).
18426 * src/output.c (output_rule_data): Use quotearg to output the
18429 2001-12-13 Paul Eggert <eggert@twinsun.com>
18431 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
18432 Do not infringe on the global user namespace when using C++.
18433 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
18434 All uses of `fprintf' and `stderr' changed.
18436 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
18438 2001-12-13 Akim Demaille <akim@epita.fr>
18440 The computation of nullable is broken: it doesn't handle empty
18443 * tests/torture.at (GNU AWK Grammar): New.
18444 * tests/sets.at (Nullable): New.
18445 * src/nullable.c (set_nullable): Instead of blindly looping over
18446 `ritems', loop over the rules, and then over their rhs's.
18448 Work around Autotest bugs.
18450 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
18451 frame, because Autotest understand lines starting with a `+' as
18452 traces from the shell. Then, they are not processed properly.
18453 Admittedly an Autotest bug, but we don't have time to wait for
18454 Autotest to catch up.
18455 * tests/regression.at (Broken Closure): Adjust to the new table
18458 * tests/sets.at: here.
18460 2001-12-13 Akim Demaille <akim@epita.fr>
18462 * src/closure.c (closure): Use nrules instead of playing tricks
18463 with BITS_PER_WORD.
18465 2001-12-13 Akim Demaille <akim@epita.fr>
18467 * src/print.c (print_actions): Output the handling of `$' as the
18468 traces do: shifting the token EOF. Before EOF was treated as a
18470 * tests/regression.at: Adjust some tests.
18471 * src/print_graph.c (print_core): Complete the set of items via
18472 closure. The next-to-final and final states are still unsatisfying,
18473 but that's to be addressed elsewhere.
18474 No longer output the rule numbers, but do output the state number.
18475 A single loop for the shifts + gotos is enough, but picked a
18476 distinct color for each.
18477 (print_graph): Initialize and finalize closure.
18479 2001-12-13 Akim Demaille <akim@epita.fr>
18481 * src/reader.c (readgram): Remove dead code, an strip useless
18483 (get_type): Remove, unused.
18485 2001-12-12 Akim Demaille <akim@epita.fr>
18487 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
18488 on that of lib/error.c.
18490 2001-12-12 Akim Demaille <akim@epita.fr>
18492 Some hosts don't like `/' in includes.
18494 * src/system.h: Include libgettext.h without qualifying the path.
18495 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
18498 2001-12-11 Marc Autret <autret_m@epita.fr>
18500 * src/output.c (output_parser): Remove useless muscle.
18502 2001-12-11 Marc Autret <autret_m@epita.fr>
18504 * src/bison.simple: Remove #line just before %%epilogue. It
18505 is now handled in ...
18506 * src/reader.c (read_additionnal_code): Add the output of a
18507 #line for the epilogue.
18509 2001-12-10 Marc Autret <autret_m@epita.fr>
18511 * src/reader.c (copy_definition): Re-use CPP-outed code which
18512 replace precedent remove.
18513 * src/bison.simple: Remove #line before %%prologue because
18514 %%input-line is wrong at this time.
18516 2001-12-10 Marc Autret <autret_m@epita.fr>
18518 * src/reader.c (symbols_output): Clean up.
18519 * src/output.c (output_gram, output): Clean up.
18521 2001-12-10 Akim Demaille <akim@epita.fr>
18523 * src/lalr.c (initialize_lookaheads): New. Extracted from...
18524 * src/LR0.c (set_state_table): here.
18525 * src/lalr.c (lalr): Call it.
18527 2001-12-10 Akim Demaille <akim@epita.fr>
18529 * src/state.h (shifts): Remove the `number' member: shifts are
18530 attached to state, hence no longer need to be labelled with a
18533 2001-12-10 Akim Demaille <akim@epita.fr>
18535 Now that states have a complete set of members, the linked list of
18536 shifts is useless: just fill directly the state's shifts member.
18538 * src/state.h (shifts): Remove the `next' member.
18539 * src/LR0.c (first_state, last_state): Remove.
18540 Adjust the callers.
18541 (augment_automaton): Don't look for the shifts that must be added
18542 a shift on EOF: it is those of the state we looked for! But now,
18543 since shifts are attached, it is no longer needed to looking
18544 merely by its id: its number.
18546 2001-12-10 Akim Demaille <akim@epita.fr>
18548 * src/LR0.c (augment_automaton): Better variable locality.
18549 Remove an impossible branch: if there is a state corresponding to
18550 the start symbol being shifted, then there is shift for the start
18551 symbol from the initial state.
18553 2001-12-10 Akim Demaille <akim@epita.fr>
18555 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
18556 only when appropriate: when insert_start_shifting_state' is not
18558 * tests/regression.at (Rule Line Numbers): Adjust.
18560 2001-12-10 Akim Demaille <akim@epita.fr>
18562 * src/LR0.c (augment_automaton): Now that all states have shifts,
18563 merge the two cases addition shifts to the initial state.
18565 2001-12-10 Akim Demaille <akim@epita.fr>
18567 * src/lalr.c (set_state_table): Move to...
18569 * src/lalr.c (lalr): Don't call it...
18570 * src/LR0.c (generate_states): do it.
18571 * src/LR0.h (first_state): Remove, only the table is used.
18573 2001-12-10 Akim Demaille <akim@epita.fr>
18575 * src/LR0.h (first_shift, first_reduction): Remove.
18576 * src/lalr.c: Don't use first_shift: find shifts through the
18579 2001-12-10 Akim Demaille <akim@epita.fr>
18581 * src/LR0.c: Attach shifts to states as soon as they are
18583 * src/lalr.c (set_state_table): Instead of assigning shifts to
18584 state, just assert that the mapping was properly done.
18586 2001-12-10 Akim Demaille <akim@epita.fr>
18588 * src/LR0.c (insert_start_shift): Rename as...
18589 (insert_start_shifting_state): this.
18590 (insert_eof_shifting_state, insert_accepting_state): New.
18591 (augment_automaton): Adjust.
18592 Better locality of the variables.
18593 When looking if the start_symbol is shifted from the initial
18594 state, using `while (... symbol != start_symbol ...)' sounds
18595 better than `while (... symbol < start_symbol ...)': If fail
18596 to see how the order between symbols could be relevant!
18598 2001-12-10 Akim Demaille <akim@epita.fr>
18600 * src/getargs.h: Don't declare `spec_name_prefix' and
18601 `spec_file_prefix', declared by src/files.h.
18602 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
18603 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
18604 * src/output.c (prepare): Adjust.
18605 * src/reader.c (symbols_output): Likewise.
18606 * src/vmsgetargs.c: Vaguely adjust, but who cares?
18608 2001-12-10 Akim Demaille <akim@epita.fr>
18610 * src/muscle_tab.c (muscle_init): NULL is a better default than
18613 2001-12-10 Akim Demaille <akim@epita.fr>
18615 * src/reader.c (reader): Calling symbols_output once is enough.
18617 2001-12-10 Akim Demaille <akim@epita.fr>
18619 Now that states have a complete set of members, the linked list of
18620 reductions is useless: just fill directly the state's reductions
18623 * src/state.h (struct reductions): Remove member `number' and
18625 * src/LR0.c (first_reduction, last_reduction): Remove.
18626 (save_reductions): Don't link the new reductions, store them in
18628 * src/lalr.c (set_state_table): No need to attach reductions to
18629 states, it's already done.
18630 * src/output.c (output_actions): No longer free the shifts, then
18631 the reductions, then the states: free all the states and their
18634 2001-12-10 Akim Demaille <akim@epita.fr>
18636 * src/options.c (OPTN, DRTV, BOTH): New.
18637 (option_table): Use them.
18639 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
18640 the job of system.h.
18641 * src/options.c: Don't include stdio.h and xalloc.h for the same
18644 2001-12-10 Akim Demaille <akim@epita.fr>
18646 * src/output.c (output, prepare): Make sure the values of the
18647 muscles `action' and `prologue' are 0-terminated.
18649 2001-12-10 Akim Demaille <akim@epita.fr>
18651 Clean up GCC warnings.
18653 * src/reader.c (copy_action): `buf' is not used.
18654 (parse_skel_decl): Be static.
18655 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
18656 * src/options.h (create_long_option_table): Have a real prototype.
18657 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
18658 (hash_delete_at): Return const void *.
18659 Adjust casts to preserve the const.
18661 2001-12-10 Akim Demaille <akim@epita.fr>
18663 * configure.in: Require 2.52g.
18664 M4 is not needed, but AUTOM4TE is.
18665 * m4/m4.m4: Remove.
18666 * tests/Makefile.am: Adjust.
18668 2001-12-10 Akim Demaille <akim@epita.fr>
18670 One structure for states is enough, even though theoretically
18671 there are LR(0) states and LALR(1) states.
18673 * src/lalr.h (state_t): Remove.
18674 (state_table): Be state_t **, not state_t *.
18675 * src/state.h (core, CORE_ALLOC): Rename as...
18676 (state_t, STATE_ALLOC): this.
18677 Add the LALR(1) members: shifts, reductions, errs.
18678 * src/LR0.c (state_table): Rename as...
18679 (state_hash): this, to avoid name clashes with the global
18681 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
18682 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
18684 2001-12-10 Akim Demaille <akim@epita.fr>
18686 Bison dumps core on bash.y.
18687 Reported by Pascal Bart.
18689 * src/warshall.c (bitmatrix_print): New.
18691 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
18692 j must be the outer loop.
18693 * tests/regression.at (Broken Closure): New.
18695 2001-12-05 Akim Demaille <akim@epita.fr>
18697 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
18699 Reported by Peter Hamorsky.
18701 2001-12-05 Akim Demaille <akim@epita.fr>
18703 * src/conflicts.c (err_table): Remove.
18704 (resolve_sr_conflict): Adjust.
18705 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
18707 (state_t.reductions, state_t.shifts): this.
18709 2001-12-05 Akim Demaille <akim@epita.fr>
18711 * src/reduce.c (reduce_grammar_tables): No longer disable the
18712 removal of useless rules via CPP but via `if (0)', so that the
18713 compiler still check the code is valid.
18714 For instance, it should have noticed `rline' no longer exists: use
18715 the `line' member of rule_t.
18716 * src/gram.c (dummy, rline): Remove, unused.
18718 2001-12-05 Akim Demaille <akim@epita.fr>
18720 * src/output.c (pack_vector): Use assert, not berror.
18721 * src/main.c (berror): Remove, unused.
18723 2001-12-05 Akim Demaille <akim@epita.fr>
18725 New experimental feature: if --verbose --trace output all the
18726 items of a state, not only its kernel.
18728 * src/print.c (print_core): If `trace_flag', then invoke closure
18729 before outputting the items of the state (print_core is no longer
18730 a correct name them).
18731 (print_results): Invoke new_closure/free_closure if needed.
18733 2001-12-05 Akim Demaille <akim@epita.fr>
18735 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
18736 * src/closure.c, src/closure.h (itemsetsize): Rename as...
18737 (nitemset): for consistency with the rest of the project.
18739 2001-12-05 Akim Demaille <akim@epita.fr>
18741 * src/closure.c (print_closure): Improve.
18742 (closure): Use it for printing input and output.
18744 2001-12-05 Akim Demaille <akim@epita.fr>
18746 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
18747 indexed by nonterminals.
18749 2001-12-05 Akim Demaille <akim@epita.fr>
18751 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
18753 * src/warshall.h: Remove accidental duplication of the content.
18755 2001-12-05 Akim Demaille <akim@epita.fr>
18757 * src/closure.c (set_fderives): De-obfuscate.
18759 2001-12-05 Akim Demaille <akim@epita.fr>
18761 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
18763 2001-12-05 Akim Demaille <akim@epita.fr>
18765 * src/closure.c (set_firsts): De-obfuscate.
18767 2001-12-05 Akim Demaille <akim@epita.fr>
18769 * src/output.c (action_row): De-obfuscate
18770 using the good o' techniques: arrays not pointers, variable
18771 locality, BITISSET, RESETBIT etc.
18773 2001-12-05 Akim Demaille <akim@epita.fr>
18775 Pessimize the code to simplify it: from now on, all the states
18776 have a valid SHIFTS, which NSHIFTS is possibly 0.
18778 * src/LR0.c (shifts_new): Be global and move to..
18779 * src/state.c, src/state.h: here.
18780 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
18781 * src/print_graph: Adjust.
18783 2001-12-05 Akim Demaille <akim@epita.fr>
18785 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
18786 * src/conflicts.c: Use it.
18787 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
18788 incorrectly ``simplified''.
18790 2001-12-05 Akim Demaille <akim@epita.fr>
18792 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
18793 using the good o' techniques: arrays not pointers, variable
18794 locality, BITISSET, RESETBIT etc.
18796 2001-12-05 Akim Demaille <akim@epita.fr>
18798 * src/state.h (SHIFT_SYMBOL): New.
18799 * src/conflicts.c: Use it to deobfuscate.
18801 2001-12-05 Akim Demaille <akim@epita.fr>
18803 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
18804 (print_reductions): De-obfuscate using the good o' techniques:
18805 arrays not pointers, variable locality, BITISSET.
18807 2001-12-05 Akim Demaille <akim@epita.fr>
18809 * src/conflicts.c (print_reductions): Arrays, not pointers.
18812 2001-12-05 Akim Demaille <akim@epita.fr>
18814 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18816 2001-12-05 Akim Demaille <akim@epita.fr>
18818 * src/conflicts.c (print_reductions): Improve variable locality.
18820 2001-12-05 Akim Demaille <akim@epita.fr>
18822 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18824 2001-12-05 Akim Demaille <akim@epita.fr>
18826 * src/conflicts.c (print_reductions): Improve variable locality.
18828 2001-12-05 Akim Demaille <akim@epita.fr>
18830 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
18831 * src/lalr.c: Use them.
18833 2001-12-05 Akim Demaille <akim@epita.fr>
18835 * src/LR0.c (augment_automaton): Formatting changes.
18836 Better variable locality.
18838 2001-12-05 Akim Demaille <akim@epita.fr>
18840 * src/lalr.c (matrix_print): New.
18841 (transpose): Use it.
18842 Use arrays instead of pointers.
18844 2001-12-05 Akim Demaille <akim@epita.fr>
18846 * src/lalr.c (maxrhs): Move to...
18847 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
18848 * src/lalr.c (build_relations): Adjust.
18850 2001-12-05 Akim Demaille <akim@epita.fr>
18852 * src/lalr.c (transpose): Free the memory allocated to the
18853 argument, as it is replaced by the results by the unique caller.
18854 (build_relations): Merely invoke transpose: it handles the memory
18856 Improve variable locality.
18857 Avoid variables used as mere abbreviations.
18858 (compute_lookaheads): Use arrays instead of pointers.
18860 2001-12-05 Akim Demaille <akim@epita.fr>
18862 * src/lalr.c (initialize_F): Improve variable locality.
18863 Avoid variables used as mere abbreviations.
18865 2001-12-05 Akim Demaille <akim@epita.fr>
18867 * src/derives.c (print_derives): Display the ruleno.
18868 * src/lalr.c (initialize_F, transpose): Better variable locality
18869 to improve readability.
18870 Avoid variables used as mere abbreviations.
18872 2001-12-05 Akim Demaille <akim@epita.fr>
18874 * src/lalr.c (traverse): Use arrays instead of pointers.
18876 2001-12-05 Akim Demaille <akim@epita.fr>
18878 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
18879 the handling of squeue.
18880 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18882 2001-12-05 Akim Demaille <akim@epita.fr>
18884 Because useless nonterminals are now kept alive (instead of being
18885 `destroyed'), we now sometimes examine them, and store information
18886 related to them. Hence we need to know their number, and adjust
18887 memory allocations.
18889 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
18891 * src/LR0.c (allocate_itemsets): The memory allocated to
18892 `symbol_count' was used for two different purpose: once to count
18893 the number of occurrences of each symbol, and later reassigned to
18894 `shift_symbol', containing the symbol that can be shifted from a
18896 Deobfuscate, i.e., allocate, use and free `symbol_count' here
18898 (new_itemsets): Allocate `shift_symbol' here.
18899 (allocate_itemsets): symbol_count includes useless nonterminals.
18900 Make room for them.
18901 (free_storage): Use `free', not `XFREE', for pointers that cannot
18904 2001-12-05 Akim Demaille <akim@epita.fr>
18906 * src/nullable.c (set_nullable): Deobfuscate the handling of
18908 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18910 2001-12-05 Akim Demaille <akim@epita.fr>
18912 * src/gram.c, src/gram.h (ritem_print): New.
18913 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
18914 (This useless function was defined only to work around VMS linkers
18915 that can't handle compilation units with variables only).
18916 * src/reduce.c (dump_grammar): Use it to trace the construction of
18919 2001-12-04 Paul Eggert <eggert@twinsun.com>
18921 * src/bison.simple (union yyalloc): Change member names
18922 to be the same as the stack names.
18923 (yyparse): yyptr is now union yyalloc *, not char *.
18924 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
18925 and may generate better code on some machines.
18926 (yystpcpy): Use prototype if __STDC__ is defined, not just
18927 if __cplusplus is defined.
18929 2001-11-30 Akim Demaille <akim@epita.fr>
18931 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
18932 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
18933 Gettext doesn't compile cleanly, and dies with -Werror.
18934 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
18935 Include WARNING_CFLAGS here.
18936 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
18937 before being defined.
18939 2001-11-27 Paul Eggert <eggert@twinsun.com>
18941 * lib/quotearg.h (quotearg_n, quotearg_n_style):
18942 First arg is int, not unsigned.
18943 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
18944 (SIZE_MAX, UINT_MAX): New macros.
18945 (quotearg_n_options): Abort if N is negative.
18946 Avoid overflow check on hosts where size_t is 64 bits and int
18947 is 32 bits, as overflow is impossible there.
18948 Fix off-by-one typo that caused unnecessary reallocation.
18950 2001-11-29 Paul Eggert <eggert@twinsun.com>
18952 Name space cleanup in generated parser.
18954 * doc/bison.texinfo (Bison Parser): Discuss system headers
18955 and their effect on the user name space.
18957 * src/bison.simple:
18958 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
18959 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
18960 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
18962 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
18963 on user names when possible.
18965 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
18966 Simplify test for whather <alloca.h> exists.
18968 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
18970 (<stdio.h>): Include if YYDEBUG.
18972 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
18973 ! defined (yyoverflow) && ! defined (yymemcpy).
18975 (yymemcpy, yyparse): Rename local variables as needed so that
18976 they all begin with 'yy'.
18978 (yystrlen, yystpcpy): New functions.
18980 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
18983 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
18984 instead of relying on string.h functions. Use YYSTACK_ALLOC
18985 and YYSTACK_FREE instead of malloc and free.
18987 2001-11-30 Akim Demaille <akim@epita.fr>
18989 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
18990 before their first uses.
18991 (YYBISON, YYPURE): Move to the top of the output.
18993 2001-11-30 Akim Demaille <akim@epita.fr>
18995 * tests/reduce.at (Useless Nonterminals): Fix.
18997 2001-11-30 Akim Demaille <akim@epita.fr>
18999 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
19000 if body instead of `;' to pacify GCC's warnings.
19002 2001-11-30 Akim Demaille <akim@epita.fr>
19004 Instead of mapping the LHS of unused rules to -1, keep the LHS
19005 valid, but flag the rules as invalid.
19007 * src/gram.h (rule_t): `useful' is a new member.
19008 * src/print.c (print_grammar): Adjust.
19009 * src/derives.c (set_derives): Likewise.
19010 * src/reader.c (packgram, reduce_output): Likewise.
19011 * src/reduce.c (reduce_grammar_tables): Likewise.
19012 * tests/reduce.at (Underivable Rules, Useless Rules): New.
19014 2001-11-30 Akim Demaille <akim@epita.fr>
19016 * src/reduce.c (reduce_output): Formatting changes.
19017 * src/print.c (print_results, print_grammar): Likewise.
19018 * tests/regression.at (Rule Line Numbers)
19019 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
19021 2001-11-30 Akim Demaille <akim@epita.fr>
19023 * src/reduce.c (nonterminals_reduce): Instead of throwing away
19024 useless nonterminals, move them at the end of the symbol arrays.
19025 (reduce_output): Adjust.
19026 * tests/reduce.at (Useless Nonterminals): Adjust.
19028 2001-11-30 Akim Demaille <akim@epita.fr>
19030 * src/reduce.c: Various comment/formatting changes.
19031 (nonterminals_reduce): New, extracted from...
19032 (reduce_grammar_tables): here.
19033 (reduce_grammar): Call nonterminals_reduce.
19035 2001-11-29 Paul Eggert <eggert@twinsun.com>
19037 * src/bison.simple (YYSTACK_REALLOC): Remove.
19038 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
19039 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
19041 (union yyalloc): New type.
19042 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
19043 an arbitrary restriction on hosts where size_t is wider than int.
19045 (yyparse): Don't dump core if alloca or malloc fails; instead, report
19046 a parser stack overflow. Allocate just one block of memory for all
19047 three stacks, instead of allocating three blocks; this typically is
19048 faster and reduces fragmentation.
19050 Do not limit the number of items in the stack to a value that fits
19051 in 'int', as this is an arbitrary limit on hosts with 64-bit
19052 size_t and 32-bit int.
19054 2001-11-29 Marc Autret <autret_m@epita.fr>
19056 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
19057 of defining YYERROR_VERBOSE.
19058 [AT_DATA]: $4 is now out of C declarations in the prologue.
19060 2001-11-28 Marc Autret <autret_m@epita.fr>
19062 * src/reader.c (parse_dquoted_param): New.
19063 (parse_skel_decl): Use it.
19064 * src/lex.h: Add its prototype.
19065 * src/lex.c (literalchar): Become not static.
19067 2001-11-28 Marc Autret <autret_m@epita.fr>
19069 * src/output.h: And put its extern declaration here.
19070 * src/output.c (error_verbose): Define here.
19071 (prepare): Echo name modification.
19072 * src/getargs.h: Clean its extern declaration.
19073 * src/getargs.c (error_verbose_flag): Remove.
19074 (getargs): Remove case 'e'.
19075 * src/options.c (option_table): 'error-verbose' is now seen as simple
19079 * src/reader.c (read_declarations): Remove case tok_include.
19080 (parse_include_decl): Remove.
19081 * src/lex.h (token_t): Remove tok_include.
19082 * src/options.c (option_table): 'include' is now a simple command line
19085 2001-11-28 Marc Autret <autret_m@epita.fr>
19087 * src/bison.simple: Adjust muscle names.
19088 * src/muscle_tab.c (muscle_init): Also rename the muscles.
19089 * src/output.c (prepare): s/_/-/ for the muscles names.
19090 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
19092 2001-11-28 Marc Autret <autret_m@epita.fr>
19094 * src/bison.simple: Fix debug.
19095 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
19097 2001-11-28 Akim Demaille <akim@epita.fr>
19099 * src/LR0.c (shifts_new): New.
19100 (save_shifts, insert_start_shift, augment_automaton): Use it.
19102 2001-11-28 Akim Demaille <akim@epita.fr>
19104 * src/closure.c (closure): `b' and `ruleno' denote the same value:
19107 2001-11-28 Akim Demaille <akim@epita.fr>
19109 * src/closure.c (closure): Instead of looping over word in array
19110 then bits in words, loop over bits in array.
19112 2001-11-28 Akim Demaille <akim@epita.fr>
19114 * src/closure.c (closure): No longer optimize the special case
19115 where all the bits of `ruleset[r]' are set to 0, to make the code
19118 2001-11-28 Akim Demaille <akim@epita.fr>
19120 * src/closure.c (closure): `r' and `c' are new variables, used to
19121 de-obfuscate accesses to RULESET and CORE.
19123 2001-11-28 Akim Demaille <akim@epita.fr>
19125 * src/reduce.c (reduce_print): Use ngettext.
19126 (dump_grammar): Improve the trace accuracy.
19128 2001-11-28 Akim Demaille <akim@epita.fr>
19130 * src/reduce.c (dump_grammar): Don't translate trace messages.
19132 2001-11-28 Akim Demaille <akim@epita.fr>
19134 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
19135 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
19136 as all tags are free'ed afterwards.
19137 From Enrico Scholz.
19139 2001-11-27 Paul Eggert <eggert@twinsun.com>
19141 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
19142 use alloca when we didn't want to, and vice versa.
19144 2001-11-27 Marc Autret <autret_m@epita.fr>
19146 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
19148 * src/output.c (prepare): Remove its update.
19150 2001-11-27 Marc Autret <autret_m@epita.fr>
19152 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
19153 Use %error-verbose.
19155 2001-11-27 Marc Autret <autret_m@epita.fr>
19157 * src/bison.simple: Remove YYERROR_VERBOSE using.
19158 Use %%error_verbose.
19159 (yyparse): Likewise.
19160 * src/output.c (prepare): Give its final value.
19161 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
19162 * src/getargs.h: Add its extern declaration.
19163 * src/getargs.c (error_verbose_flag): New int.
19164 (getargs): Update to catch new case.
19165 * src/options.c (option_table): 'error-verbose' is a new option.
19166 (shortopts): Update.
19168 2001-11-27 Akim Demaille <akim@epita.fr>
19170 * src/system.h: Use intl/libgettext.h.
19171 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
19173 2001-11-27 Akim Demaille <akim@epita.fr>
19175 * tests/torture.at (Exploding the Stack Size with Malloc):
19176 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
19178 2001-11-27 Akim Demaille <akim@epita.fr>
19180 * src/files.c: Include error.h.
19181 Reported by Hans Aberg.
19183 2001-11-26 Marc Autret <autret_m@epita.fr>
19185 * src/reader.c (parse_include_decl): New, not yet implemented.
19186 (read_declarations): Add case tok_include.
19187 * src/getargs.h (include): Add its extern definition.
19188 * src/getargs.c (include): New const char *.
19189 (getargs): Add case '-I'.
19190 * src/options.c (option_table): Add include as command line and
19192 * src/lex.h (token_t): Add tok_include.
19194 2001-11-26 Akim Demaille <akim@epita.fr>
19196 * src/reader.c (readgram): Make sure rules for mid-rule actions
19197 have a lineno equal to that of their host rule.
19198 Reported by Hans Aberg.
19199 * tests/regression.at (Rule Line Numbers): New.
19201 2001-11-26 Akim Demaille <akim@epita.fr>
19203 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
19206 2001-11-26 Akim Demaille <akim@epita.fr>
19208 * src/complain.c, src/complain.h (error): Remove, provided by
19211 2001-11-26 Akim Demaille <akim@epita.fr>
19213 * src/reader.c (read_declarations): Don't abort on tok_illegal,
19214 issue an error message.
19215 * tests/regression.at (Invalid %directive): New.
19216 Reported by Hans Aberg.
19218 2001-11-26 Akim Demaille <akim@epita.fr>
19220 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
19221 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
19223 2001-11-26 Akim Demaille <akim@epita.fr>
19225 * src/conflicts.c (conflicts_print): Don't complain at all when
19226 there are no reduce/reduce conflicts, and as many shift/reduce
19227 conflicts as expected.
19228 * tests/regression.at (%expect right): Adjust.
19230 2001-11-23 Akim Demaille <akim@epita.fr>
19232 * lib/alloca.c: Update, from fileutils.
19234 2001-11-23 Akim Demaille <akim@epita.fr>
19236 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
19238 2001-11-23 Akim Demaille <akim@epita.fr>
19240 * src/system.h: Include alloca.h.
19241 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
19243 2001-11-23 Akim Demaille <akim@epita.fr>
19245 * src/print_graph.c (print_actions): Remove `rule', unused.
19246 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
19247 pacify GCC's signed < unsigned warnings.
19248 * src/closure.c (itemsetsize): Likewise.
19249 * src/reader.c (symbol_list_new): Static.
19251 2001-11-23 Akim Demaille <akim@epita.fr>
19253 Attaching lineno to buckets is stupid, since only one copy of each
19254 symbol is kept, only the line of the first occurrence is kept too.
19256 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
19257 * src/reader.c (rline_allocated): Remove, unused.
19258 (symbol_list): Have a `line' member.
19259 (symbol_list_new): New.
19260 (readgram): Use it.
19261 * src/print.c (print_grammar): Output the rule line numbers.
19262 * tests/regression.at (Solved SR Conflicts)
19263 (Unresolved SR Conflicts): Adjust.
19264 Reported by Hans Aberg.
19266 2001-11-22 Marc Autret <autret_m@epita.fr>
19268 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
19270 2001-11-22 Marc Autret <autret_m@epita.fr>
19272 * src/muscle_tab.c (muscle_init): Remove initialization of
19274 * src/output.c (output_master_parser): Do it here.
19276 2001-11-20 Akim Demaille <akim@epita.fr>
19279 * configure.in (ALL_LINGUAS): Adjust.
19280 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
19281 longer contains strings to translate.
19283 2001-11-19 Akim Demaille <akim@epita.fr>
19285 * src/conflicts.c (conflicts_print): Add a missing \n.
19287 2001-11-19 Akim Demaille <akim@epita.fr>
19289 * src/nullable.c (nullable_print): New.
19290 (set_nullable): Call it when tracing.
19291 Better locality of variables.
19293 2001-11-19 Akim Demaille <akim@epita.fr>
19295 * src/print.c (print_actions): Better locality of variables.
19297 2001-11-19 Akim Demaille <akim@epita.fr>
19299 * src/derives.c (print_derives): Fix and enrich.
19300 * src/closure.c (print_fderives): Likewise.
19302 2001-11-19 Akim Demaille <akim@epita.fr>
19304 * src/closure.c (itemsetend): Remove, replaced with...
19305 (itemsetsize): new.
19307 2001-11-19 Akim Demaille <akim@epita.fr>
19309 * src/LR0.c (kernel_end): Remove, replaced with...
19310 (kernel_size): new.
19312 2001-11-19 Akim Demaille <akim@epita.fr>
19314 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
19317 2001-11-19 Akim Demaille <akim@epita.fr>
19319 * src/closure.c (closure): Use arrays instead of pointers to clarify.
19321 2001-11-19 Akim Demaille <akim@epita.fr>
19323 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
19325 * src/LR0.c: Likewise.
19326 (allocate_itemsets): Use arrays instead of pointers to clarify.
19328 2001-11-19 Akim Demaille <akim@epita.fr>
19330 * src/getargs.c (statistics_flag): Replace with...
19332 (longopts): Accept --trace instead of --statistics.
19333 * src/getargs.h, src/options.c: Adjust.
19334 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
19335 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
19337 2001-11-19 Akim Demaille <akim@epita.fr>
19339 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
19340 pointers to clarify the code.
19341 (save_reductions, save_shifts): Factor common parts of alternatives.
19343 2001-11-19 Akim Demaille <akim@epita.fr>
19345 * src/LR0.c (new_state, get_state): Complete TRACE code.
19346 * src/closure.c: Include `reader.h' to get `tags', needed by the
19348 Rename the conditional DEBUG as TRACE.
19349 Output consistently TRACEs to stderr, not stdout.
19350 * src/derives.c: Likewise.
19351 * src/reduce.c: (inaccessable_symbols): Using if is better style
19353 Use `#if TRACE' instead of `#if 0' for tracing code.
19355 2001-11-19 Akim Demaille <akim@epita.fr>
19357 * src/system.h (LIST_FREE, shortcpy): New.
19358 * src/LR0.c: Use them.
19359 * src/output.c (free_itemsets, free_reductions, free_shifts):
19360 Remove, replaced by LIST_FREE.
19362 2001-11-19 Akim Demaille <akim@epita.fr>
19364 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
19365 (REDUCTIONS_ALLOC): New.
19366 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
19369 2001-11-19 Akim Demaille <akim@epita.fr>
19371 * src/LR0.c (new_state): Complete trace code.
19372 * src/nullable.c (set_nullable): Don't translate traces.
19374 2001-11-19 Akim Demaille <akim@epita.fr>
19376 * src/print_graph.c (print_core): Better locality of variables.
19377 * src/print.c (print_core): Likewise.
19379 2001-11-19 Akim Demaille <akim@epita.fr>
19381 * src/vcg.c: You do the output, so you are responsible of the
19382 handling of VCG syntax, in particular: use quotearg.
19383 * src/print_graph.c: Don't.
19384 (print_actions): Don't output the actions as part of the nodes,
19385 since that's the job of the edges.
19386 (print_state): Don't output by hand: fill the node description,
19387 and ask for its output.
19389 2001-11-19 Akim Demaille <akim@epita.fr>
19391 * src/bison.simple (yyparse): When verbosely reporting an error,
19392 no longer put additional quotes around token names.
19393 * tests/calc.at: Adjust.
19395 2001-11-19 Akim Demaille <akim@epita.fr>
19397 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
19398 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
19399 * src/output.c: Adjust.
19401 2001-11-19 Akim Demaille <akim@epita.fr>
19403 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
19405 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
19407 2001-11-19 Akim Demaille <akim@epita.fr>
19409 * src/gram.h (rule_t): New.
19411 (rrhs, rlhs): Remove, part of state_t.
19412 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
19413 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
19414 * src/reader.c, src/reduce.c: Adjust.
19416 2001-11-19 Akim Demaille <akim@epita.fr>
19418 * src/reader.c (symbols_output): New, extracted from...
19419 (packsymbols): Here.
19422 2001-11-19 Akim Demaille <akim@epita.fr>
19424 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
19425 (maxrhs): this new function.
19427 2001-11-19 Akim Demaille <akim@epita.fr>
19429 * src/lalr.c (F): New macro to access the variable F.
19432 2001-11-19 Akim Demaille <akim@epita.fr>
19434 * src/lalr.h (LA): New macro to access the variable LA.
19435 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19436 * src/lalr.c: Adjust.
19438 2001-11-19 Akim Demaille <akim@epita.fr>
19440 * src/lalr.c (initialize_LA): Only initialize LA. Let...
19441 (set_state_table): handle the `lookaheads' members.
19443 2001-11-19 Akim Demaille <akim@epita.fr>
19445 * src/lalr.h (lookaheads): Removed array, whose contents is now
19447 (state_t): this structure.
19448 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19451 2001-11-19 Akim Demaille <akim@epita.fr>
19453 * src/lalr.h (consistent): Removed array, whose contents is now
19455 (state_t): this structure.
19456 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19459 2001-11-19 Akim Demaille <akim@epita.fr>
19461 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
19462 contents are now members of...
19463 (state_t): this structure.
19464 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19467 2001-11-19 Akim Demaille <akim@epita.fr>
19469 * src/lalr.h (state_t): New.
19470 (state_table): Be a state_t * instead of a core **.
19471 (accessing_symbol): Remove, part of state_t.
19472 * src/lalr.c: Adjust.
19473 (set_accessing_symbol): Merge into...
19474 (set_state_table): this.
19475 * src/print_graph.c, src/conflicts.c: Adjust.
19477 2001-11-14 Akim Demaille <akim@epita.fr>
19479 * tests/calc.at, tests/output.at, tests/regression.at,
19480 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
19481 now the tests are run in private dirs, therefore AC_CLEANUP and
19482 family can be simplified to 0-ary.
19483 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
19484 use abs. path to find config.h.
19485 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
19486 stderr, there can be way too much random noise.
19487 Instead pass -Werror to GCC and rely on the exit status.
19488 Reported by Wolfram Wagner.
19490 2001-11-14 Akim Demaille <akim@epita.fr>
19492 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
19493 defined only if yyoverflow is defined, to avoid `warning: unused
19495 Reported by The Test Suite.
19497 2001-11-14 Akim Demaille <akim@epita.fr>
19499 * src/print.c: Include reduce.h.
19500 Reported by Hans Aberg.
19502 2001-11-14 Akim Demaille <akim@epita.fr>
19504 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
19505 Revert a previous patch: these are really const.
19506 * src/conflicts.c (conflict_report): Additional useless pair of
19507 braces to pacify GCC's warnings for `if () if () {} else {}'.
19508 * src/lex.c (parse_percent_token): Replace equal_offset with
19511 Be sure to strdup `arg' when used, since there is no reason for
19512 token_buffer not to change.
19514 2001-11-14 Akim Demaille <akim@epita.fr>
19516 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
19518 * src/main.c (main): Use them.
19519 Suggested by Hans Aberg.
19521 2001-11-12 Akim Demaille <akim@epita.fr>
19523 * src/system.h (ngettext): Now that we use ngettext, be sure to
19524 provide a default definition when NLS are not used.
19526 2001-11-12 Akim Demaille <akim@epita.fr>
19528 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
19529 Use @kbd to denote user input.
19530 (Language and Grammar): ANSIfy the example.
19531 Adjust its layout for info/notinfo.
19532 (Location Tracking Calc): Output error messages to stderr.
19533 Output locations in a more GNUtically correct way.
19534 Fix a couple of Englishos.
19535 Adjust @group/@end group pairs.
19537 2001-11-12 Akim Demaille <akim@epita.fr>
19539 %expect was not functioning at all.
19541 * src/conflicts.c (expected_conflicts): Set to -1.
19542 (conflict_report): Use ngettext.
19543 (conflicts_print): Check %expect and make its violation an error.
19544 * doc/bison.texinfo (Expect Decl): Adjust.
19545 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
19546 * tests/regression.at (%expect not enough, %expect right)
19547 (%expect too much): New.
19549 2001-11-12 Akim Demaille <akim@epita.fr>
19551 * tests/regression.at (Conflicts): Rename as...
19552 (Unresolved SR Conflicts): this.
19553 (Solved SR Conflicts): New.
19555 2001-11-12 Akim Demaille <akim@epita.fr>
19557 * src/reduce.c (print_results): Rename as...
19558 (reduce_output): This.
19559 Output to OUT, passed as argument, instead of output_obstack.
19560 (dump_grammar): Likewise.
19561 (reduce_free): New.
19563 (reduce_grammar): No longer call reduce_output, since...
19564 * src/print.c (print_results): do it.
19565 * src/main.c (main): Call reduce_free;
19567 2001-11-12 Akim Demaille <akim@epita.fr>
19569 * src/conflicts.c (print_reductions): Accept OUT as argument.
19570 Output to it, not to output_obstack.
19571 * src/print.c (print_actions): Adjust.
19573 2001-11-12 Akim Demaille <akim@epita.fr>
19575 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
19576 the result instead of using...
19577 (src_total, rrc_total, src_count, rrc_count): Remove.
19578 (any_conflicts): Remove.
19579 (print_conflicts): Split into...
19580 (conflicts_print, conflicts_output): New.
19581 * src/conflicts.h: Adjust.
19582 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
19583 * src/print.c (print_grammar): Issue `\n' between two rules.
19584 * tests/regression.at (Conflicts): New.
19585 Reported by Tom Lane.
19587 2001-11-12 Akim Demaille <akim@epita.fr>
19589 * tests/regression.at (Invalid input): Remove, duplicate with
19590 ``Invalid input: 1''.
19592 2001-11-12 Akim Demaille <akim@epita.fr>
19594 * tests/torture.at (AT_DATA_STACK_TORTURE)
19595 (Exploding the Stack Size with Alloca)
19596 (Exploding the Stack Size with Malloc): New.
19598 2001-11-12 Akim Demaille <akim@epita.fr>
19600 * src/bison.simple (YYSTACK_REALLOC): New.
19601 (yyparse) [!yyoverflow]: Use it and free the old stack.
19602 Reported by Per Allansson.
19604 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
19606 * src/bison.simple: Define type yystype instead of YYSTYPE, and
19607 define CPP macro, which substitute YYSTYPE by yystype.
19608 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
19609 with yyltype/YYLTYPE. This allows inclusion of the generated
19610 header within the parser if the compiler, such as GGC, accepts
19611 multiple equivalent #defines.
19614 2001-11-05 Akim Demaille <akim@epita.fr>
19616 * src/reader.c (symbols_output): New, extracted from...
19617 (packsymbols): here.
19620 2001-11-05 Akim Demaille <akim@epita.fr>
19622 * src/lex.c (parse_percent_token): s/quotearg/quote/.
19624 2001-11-05 Akim Demaille <akim@epita.fr>
19626 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
19629 2001-11-05 Akim Demaille <akim@epita.fr>
19631 * src/options.h (struct option_table_struct): set_flags is void*.
19632 * src/options.c (longopts): Support `--output' and `%output'.
19634 * src/lex.h (tok_setopt): Remove, replaced with...
19635 (tok_intopt, tok_stropt): these new guys.
19636 * src/lex.c (getopt.h): Not needed.
19637 (token_buffer, unlexed_token_buffer): Not const.
19638 (percent_table): Promote `-' over `_' in directive names.
19639 Active `%name-prefix', `file-prefix', and `output'.
19640 (parse_percent_token): Accept possible arguments to directives.
19641 Promote `-' over `_' in directive names.
19643 2001-11-04 Akim Demaille <akim@epita.fr>
19645 * doc/bison.texinfo (Decl Summary): Split the list into
19646 `directives for grammars' and `directives for bison'.
19648 Add description of `%name-prefix', `file-prefix', and `output'.
19649 Promote `-' over `_' in directive names.
19650 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
19651 Simplify the description of `--name-prefix'.
19652 Promote `-' over `_' in directive names.
19653 Promote `--output' over `--output-file'.
19654 Fix the description of `--defines'.
19655 * tests/output.at: Exercise %file-prefix and %output.
19657 2001-11-02 Akim Demaille <akim@epita.fr>
19659 * doc/refcard.tex: Update.
19661 2001-11-02 Akim Demaille <akim@epita.fr>
19663 * src/symtab.h (SUNDEF): New.
19664 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
19665 stand for `uninitialized', instead of 0.
19666 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
19667 * src/lex.c (lex): Adjust.
19669 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
19671 Let yylex return it instead of a plain 0.
19672 Reported by Dick Streefland.
19674 2001-11-02 Akim Demaille <akim@epita.fr>
19676 * tests/regression.at (Mixing %token styles): New test.
19678 2001-11-02 Akim Demaille <akim@epita.fr>
19680 * src/reader.c (parse_thong_decl): Formatting changes.
19681 (token_translations_init): New, extracted from...
19682 (packsymbols): Here.
19685 2001-11-01 Akim Demaille <akim@epita.fr>
19687 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
19688 Check that `9foo.y' produces correct cpp guards.
19689 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
19693 2001-11-01 Akim Demaille <akim@epita.fr>
19695 * tests/regression.at (Invalid input: 2): New.
19696 * src/lex.c (unlexed_token_buffer): New.
19697 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
19701 2001-11-01 Akim Demaille <akim@epita.fr>
19703 * tests/calc.at: Catch up with 1.30.
19704 * configure.in: Bump to 1.49a.
19705 Adjust to newer Autotest.
19707 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
19709 * src/conflicts.c: Move global variables rrc_total and src_total ...
19710 (print_conflicts): here.
19711 * src/output.c (output): Free global variable user_toknums.
19712 * src/lex.c (token_obstack): Become static.
19714 2001-10-18 Akim Demaille <akim@epita.fr>
19716 * tests/atlocal.in (GCC): Add.
19717 * tests/calc.at: s/m4_match/m4_bmatch/.
19718 s/m4_patsubst/m4_bpatsubst/.
19719 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
19720 * configure.in: AC_SUBST(GCC).
19722 2001-10-14 Marc Autret <autret_m@epita.fr>
19724 * src/options.c (create_long_option_table): Fix.
19726 2001-10-10 Akim Demaille <akim@epita.fr>
19728 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
19730 2001-10-04 Akim Demaille <akim@epita.fr>
19732 * src/reader.c (parse_union_decl): Push the caracters in
19733 union_obstack, not attrs_obstack.
19735 2001-10-04 Akim Demaille <akim@epita.fr>
19737 Merge in the branch 1.29.
19739 * src/reader.c (packsymbols): Use a temporary obstack for
19740 `%%tokendef', since output_stack is already used elsewhere.
19742 2001-10-02 Akim Demaille <akim@epita.fr>
19746 2001-10-02 Akim Demaille <akim@epita.fr>
19750 2001-10-02 Akim Demaille <akim@epita.fr>
19752 * tests/regression.at (Invalid CPP headers): New.
19753 From Alexander Belopolsky.
19754 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
19756 2001-10-02 Akim Demaille <akim@epita.fr>
19758 * tests/regression.at (Invalid input): New.
19759 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
19762 2001-10-02 Akim Demaille <akim@epita.fr>
19764 * tests/calc.at: Now that --debug works, the tests must be adjusted.
19766 2001-10-02 Akim Demaille <akim@epita.fr>
19768 * src/output.c (output_parser): Assert `skeleton'.
19769 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
19773 2001-10-01 Marc Autret <autret_m@epita.fr>
19775 * src/lex.h: Echo modifications.
19776 * src/lex.c (unlex): Parameter is now token_t.
19779 2001-10-01 Marc Autret <autret_m@epita.fr>
19781 * src/main.c: Include lex.h.
19784 2001-09-29 Akim Demaille <akim@epita.fr>
19786 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
19788 2001-09-28 Akim Demaille <akim@epita.fr>
19790 * tests/testsuite.at: Update to newer Autotest.
19791 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
19793 2001-09-27 Akim Demaille <akim@epita.fr>
19795 Position independent wrapper.
19797 * tests/bison: Remove.
19798 * tests/bison.in: New.
19799 * configure.in: Adjust.
19801 2001-09-27 Paul Eggert <eggert@twinsun.com>
19803 Port quotearg fixes from tar 1.13.24.
19805 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
19807 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
19808 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
19810 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
19811 * m4/mbrtowc.m4: New file.
19812 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
19813 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
19815 2001-09-27 Akim Demaille <akim@epita.fr>
19819 2001-09-27 Akim Demaille <akim@epita.fr>
19823 2001-09-25 Akim Demaille <akim@epita.fr>
19825 * src/system.h: Include `xalloc.h'.
19826 Remove it from the C files.
19827 * src/files.c (output_files): Free the obstacks.
19828 * src/lex.c (init_lex): Rename as...
19831 * src/main.c (main): Use it.
19833 2001-09-24 Marc Autret <autret_m@epita.fr>
19835 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
19836 to output informations in fout (FILE*).
19837 (open_graph, close_graph): Likewise.
19838 (output_graph, output_edge, output_node): Likewise.
19839 * src/vcg.h: Update function prototypes.
19840 * src/print_graph.c (print_graph): Open output graph file.
19841 (print_actions): Adjust.
19842 * src/files.h: Remove extern declaration.
19843 * src/files.c: Remove graph_obstack declaration.
19844 (open_files): Remove graph_obstack initialization.
19845 (output_files): Remove graph_obstack saving.
19847 2001-09-24 Marc Autret <autret_m@epita.fr>
19849 * src/files.c (compute_output_file_names): Fix.
19851 2001-09-24 Marc Autret <autret_m@epita.fr>,
19852 Akim Demaille <akim@epita.fr>
19854 * src/reader.c (reader): Remove call to free_symtab ().
19855 * src/main.c (main): Call it here.
19857 * src/conflicts.c (initialize_conflicts): Rename as...
19858 (solve_conflicts): this.
19859 * src/print.c (print_core, print_actions, print_state)
19860 (print_grammar): Dump to a file instead a `output_obstack'.
19861 (print_results): Dump `output_obstack', and then proceed with the
19863 * src/files.c (compute_output_file_names, close_files): New.
19864 (output_files): Adjust.
19865 * src/main.c (main): Adjust.
19867 2001-09-23 Marc Autret <autret_m@epita.fr>
19869 * src/files.c (compute_header_macro): Computes header macro name
19870 from spec_defines_file when given.
19872 2001-09-23 Marc Autret <autret_m@epita.fr>
19874 * src/files.c (output_files): Add default extensions.
19876 2001-09-22 Akim Demaille <akim@epita.fr>
19878 * src/conflicts.c (finalize_conflicts): Rename as...
19879 (free_conflicts): this.
19881 2001-09-22 Akim Demaille <akim@epita.fr>
19883 * src/gram.c (gram_free): Rename back as...
19885 (output_token_translations): Free `token_translations'.
19886 * src/symtab.c (free_symtab): Free the tag field.
19888 2001-09-22 Akim Demaille <akim@epita.fr>
19890 Remove `translations' as it is always set to true.
19892 * src/gram.h: Adjust.
19893 * src/reader.c (packsymbols, parse_token_decl): Adjust
19894 * src/print.c (print_grammar): Adjust.
19895 * src/output.c (output_token_translations): Adjust.
19896 * src/lex.c (lex): Adjust.
19897 * src/gram.c: Be sure the set pointers to NULL.
19898 (dummy): Rename as...
19901 2001-09-22 Akim Demaille <akim@epita.fr>
19903 * configure.in: Invoke AM_LIB_DMALLOC.
19904 * src/system.h: Use dmalloc.
19905 * src/LR0.c: Be sure to have pointers initialized to NULL.
19906 (allocate_itemsets): Allocate kernel_items only if needed.
19908 2001-09-22 Akim Demaille <akim@epita.fr>
19910 * configure.in: Bump to 1.29b.
19911 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
19912 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
19913 need xmalloc.c in calc.y.
19916 2001-09-21 Akim Demaille <akim@epita.fr>
19919 * Makefile.maint, config/config.guess, config/config.sub,
19920 * config/missing: Update from masters.
19921 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
19923 * configure.in (ALL_LINGUAS): Add `tr'.
19925 2001-09-21 Akim Demaille <akim@epita.fr>
19927 * tests/Makefile.am (package.m4): Move to...
19928 ($(srcdir)/$(TESTSUITE)): here.
19930 2001-09-20 Akim Demaille <akim@epita.fr>
19932 * src/complain.c: No longer try to be standalone: use system.h.
19933 Don't assume __STDC__ is defined to 1. Just test if it is defined.
19934 * src/complain.h: Likewise.
19935 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
19936 Remove the unused variable `n'.
19937 From Albert Chin-A-Young.
19939 2001-09-18 Marc Autret <autret_m@epita.fr>
19941 * doc/bison.1: Update.
19942 * doc/bison.texinfo (Bison Options): Update --defines and --graph
19944 (Option Cross Key): Update.
19947 2001-09-18 Marc Autret <autret_m@epita.fr>
19949 * tests/regression.at: New test (comment in %union).
19951 2001-09-18 Marc Autret <autret_m@epita.fr>
19953 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
19955 Reported by Keith Browne.
19957 2001-09-18 Marc Autret <autret_m@epita.fr>
19959 * tests/output.at: Add tests for --defines and --graph.
19961 2001-09-18 Marc Autret <autret_m@epita.fr>
19963 * tests/output.at: Removes tests of %{header,src}_extension features.
19965 2001-09-18 Akim Demaille <akim@epita.fr>
19967 * tests/Makefile.am (package.m4): New.
19968 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
19969 (_AT_CHECK_CALC_ERROR): Likewise.
19970 Factor the `, ' part of verbose error messages.
19972 2001-09-18 Marc Autret <autret_m@epita.fr>
19974 * src/getargs.c (longopts): Declare --defines and --graph as options
19975 with optional arguments.
19976 * src/files.h: Add extern declarations.
19977 * src/files.c (spec_graph_file, spec_defines_file): New.
19978 (output_files): Update.
19979 Remove CPP-outed code.
19981 2001-09-18 Marc Autret <autret_m@epita.fr>
19983 Turn off %{source,header}_extension feature.
19985 * src/files.c (compute_exts_from_gf): Update.
19986 (compute_exts_from_src): Update.
19987 (output_files): CPP-out useless code.
19988 * src/files.h: Remove {header,source}_extension extern declarations.
19989 * src/reader.c (parse_dquoted_param): CPP-out.
19990 (parse_header_extension_decl): Remove.
19991 (parse_source_extension_decl): Remove.
19992 (read_declarations): Remove cases tok_{hdrext,srcext}.
19993 * src/lex.c (percent_table): Remove {header,source}_extension entries.
19994 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
19996 2001-09-10 Akim Demaille <akim@epita.fr>
19998 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
19999 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
20000 (AT_CHECK_OUTPUT): this.
20001 Merely check ls' exit status, its output is useless.
20003 2001-09-10 Akim Demaille <akim@epita.fr>
20005 * tests/calc.at: Use m4_match.
20006 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
20008 2001-09-10 Marc Autret <autret_m@epita.fr>,
20009 Akim Demaille <akim@epita.fr>
20011 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
20013 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
20015 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
20016 * src/lex.h: Adjust prototype.
20017 (token_t): Add `tok_undef'.
20018 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
20019 (parse_percent_token): Now returns token_t.
20020 Add default statement in switch.
20021 (lex): Separate `c' as an input variable, from the token_t result
20023 (unlexed): Is a token_t.
20025 2001-09-10 Akim Demaille <akim@epita.fr>
20027 * configure.in: Bump to 1.29a.
20029 2001-09-07 Akim Demaille <akim@epita.fr>
20033 2001-08-30 Akim Demaille <akim@epita.fr>
20035 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
20036 * m4/atconfig.m4: Remove.
20037 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
20038 * tests/bison: New.
20039 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
20040 m4_if, m4_patsubst, and m4_regexp.
20041 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
20042 `input' file instead of echo.
20044 2001-08-29 Akim Demaille <akim@epita.fr>
20048 2001-08-29 Akim Demaille <akim@epita.fr>
20052 2001-08-29 Paul Eggert <eggert@twinsun.com>
20054 * src/bison.simple (yyparse): Don't take the address of an
20055 item before the start of an array, as that doesn't conform to
20058 2001-08-29 Robert Anisko <anisko_r@epita.fr>
20060 * doc/bison.texinfo (Location Tracking Calc): New node.
20062 2001-08-29 Paul Eggert <eggert@twinsun.com>
20064 * src/output.c (output): Do not define const, as this now
20065 causes more problems than it cures.
20067 2001-08-29 Akim Demaille <akim@epita.fr>
20069 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
20071 Be sure to tag the `detailmenu'.
20073 2001-08-29 Akim Demaille <akim@epita.fr>
20075 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
20076 download in a tmp dir.
20078 2001-08-28 Marc Autret <autret_m@epita.fr>
20080 * config/depcomp: New file.
20082 2001-08-28 Marc Autret <autret_m@epita.fr>
20084 * doc/bison.1 (mandoc): Adjust.
20085 From Juan Manuel Guerrero.
20087 2001-08-28 Marc Autret <autret_m@epita.fr>
20089 * src/print_graph.c (print_state): Fix.
20091 2001-08-27 Marc Autret <autret_m@epita.fr>
20093 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
20095 Echo modifications to the functions prototypes.
20096 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
20098 2001-08-27 Marc Autret <autret_m@epita.fr>
20100 * src/vcg.c: Include `xalloc.h'.
20101 (add_colorentry): New.
20102 (add_classname): New.
20103 (add_infoname): New.
20104 * src/vcg.h: Add new prototypes.
20106 2001-08-27 Akim Demaille <akim@epita.fr>
20108 * Makefile.maint: Sync. again with CVS Autoconf.
20110 2001-08-27 Akim Demaille <akim@epita.fr>
20112 * Makefile.maint: Formatting changes.
20113 (po-update, cvs-update, update): New targets.
20116 2001-08-27 Akim Demaille <akim@epita.fr>
20118 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
20119 * Makefile.maint: Sync. with CVS Autoconf.
20121 2001-08-27 Marc Autret <autret_m@epita.fr>
20123 * src/vcg.h (struct infoname_s): New.
20124 (struct colorentry_s): New.
20125 (graph_s): New fields {vertical,horizontal}_order in structure.
20126 Add `infoname' field.
20127 Add `colorentry' field;
20128 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
20129 (G_HORIZONTAL_ORDER): New.
20131 (G_COLORENTRY): New.
20132 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
20133 Add output of `infoname'.
20134 Add output of `colorentry'.
20136 2001-08-27 Marc Autret <autret_m@epita.fr>
20138 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
20139 This one shadowed a global parameter.
20141 2001-08-24 Marc Autret <autret_m@epita.fr>
20143 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
20144 instead of `unsigned'.
20145 (print_state): Do not call obstack_object_size () in obstack_grow ()
20146 to avoid macro variables shadowing.
20148 2001-08-23 Marc Autret <autret_m@epita.fr>
20150 * src/lex.c (percent_table): Typo: s/naem/name/.
20152 Normalize new options declarations.
20154 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
20156 * tests/suite.at: Exercise %header_extension and %source_extension.
20158 2001-08-16 Marc Autret <autret_m@epita.fr>
20160 * src/reader.c (parse_dquoted_param): New.
20161 (parse_header_extension_decl): Use it.
20162 (parse_source_extension_decl): Likewise.
20164 2001-08-16 Marc Autret <autret_m@epita.fr>
20166 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
20167 (get_xxxx_str): Use assert () instead of complain ().
20168 Remove return invokations in default cases.
20169 (get_decision_str): Modify default behaviour. Remove second argument.
20170 Echo modifications on calls.
20171 (output_graph): Fix.
20173 2001-08-16 Marc Autret <autret_m@epita.fr>
20175 * src/getargs.c (usage): Update with ``-g, --graph''.
20177 2001-08-16 Marc Autret <autret_m@epita.fr>
20179 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
20180 (Option Cross Key): Likewise.
20181 * doc/bison.1: Update.
20183 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
20185 * src/output.c (output_master_parser): Don't finish action_obstack.
20186 (output_parser): Don't care about the muscle action, here.
20187 (prepare): Copy the action_obstack in the action muscle.
20188 (output): Free action_obstack.
20190 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
20192 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
20193 will contain `%union' declaration.
20194 (parse_union_decl): Delete #line directive output.
20195 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
20196 informations about %union.
20197 (parse_union_decl): Copy the union_obstack in the muscle stype.
20198 * src/bison.simple: Add new #line directive.
20199 Add typdef %%stype YYSTYPE.
20201 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
20203 * src/bison.simple: Add new `#line' directive.
20205 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
20207 * src/bison.simple: New `#line' directive.
20208 * src/output.c (output_parser): Support new dynamic muscle input_line.
20210 2001-09-22 Marc Autret <autret_m@epita.fr>
20212 * src/output.c (output_master_parser): New.
20213 (output_parser): Be more re-entrant.
20215 2001-09-21 Marc Autret <autret_m@epita.fr>
20217 * src/reader.c (copy_definition, parse_union_decl): Update and use
20219 (copy_action): Likewise.
20220 Use obstack_1grow ().
20221 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
20223 2001-09-21 Marc Autret <autret_m@epita.fr>
20225 * src/options.c (option_table): Adjust.
20226 * src/lex.c (parse_percent_token): Fix.
20228 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
20230 * src/options.c (symtab.h): Include it, need by lex.h.
20232 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
20234 * src/lex.c (parse_percent_token): Change type of variable `tx', which
20235 is now an option_table_struct*.
20236 (option_strcmp): New function option_strcmp.
20237 (parse_percent_token): Call option_strcmp.
20238 * src/getargs.c (xalloc.h, options.h): Include it.
20239 (getargs): Call create_long_option_table.
20240 (getargs): Free longopts at the end of the function.
20241 (shortopts): Move in options.c.
20242 * src/options.c (create_long_option_table): New function. Convert
20243 information from option_table to option structure.
20244 * src/reader.c (options.h): Include it.
20246 * src/Makefile.am: Adjust.
20247 * src/options.c (option_table): Create from longopts and percent_table.
20248 * src/getargs.c (longopts): Delete.
20249 * src/lex.c (struct percent_table_struct): Delete.
20250 (percent_table): Delete.
20251 (options.h): Include it.
20252 * src/options.c: Create.
20253 * src/options.h: Create.
20254 Declare enum opt_access_e.
20255 Define struct option_table_struct.
20257 2001-09-20 Marc Autret <autret_m@epita.fr>
20259 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
20262 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
20264 * src/bison.simple: s/%%filename/%%skeleton.
20265 * src/muscle_tab.c (getargs.h): Include it.
20266 (muscle_init): Insert new muscle skeleton.
20268 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
20270 * src/output.c (output_parser): Delete unused variable actions_dumped.
20272 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
20274 * src/output.c (output): Delete call to reader_output_yylsp.
20275 * src/reader.c (reader): Likewise.
20276 * src/reader.h: Delete declaration of reader_output_yylsp.
20278 2001-09-02 Marc Autret <autret_m@epita.fr>
20280 * src/reader.c: Include muscle_tab.h.
20281 (parse_union_decl): Update.
20282 (parse_macro_decl): Rename parse_muscle_decl.
20283 Update to use renamed functions and variable.
20284 (read_declarations, copy_action, read_additionnal_code, : Updated
20285 with correct variables and functions names.
20286 (packsymbols, reader): Likewise.
20288 * src/reader.h (muscle_obstack): Extern declaration update.
20290 * src/output.c: Include muscle_tab.h
20291 In all functions using macro_insert, change by using muscle_insert ().
20292 (macro_obstack): Rename muscle_obstack.
20293 Echo modifications in the whole file.
20294 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
20295 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
20296 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
20298 * src/muscle_tab.h: Update double inclusion macros.
20299 (macro_entry_s): Rename muscle_entry_s.
20302 * src/muscle_tab.c: Include muscle_tab.h.
20303 Rename macro_tabble to muscle_table.
20304 (mhash1, mhash2, mcmp): Use muscle_entry.
20305 (macro_init): Rename muscle_init. Update.
20306 (macro_insert): Rename muscle_insert. Update.
20307 (macro_find): Rename muscle_find. Update.
20309 * src/main.c: Include muscle_tab.h.
20310 (main): Call muscle_init ().
20311 * src/Makefile.am (bison_SOURCES): Echo modifications.
20313 2001-09-02 Marc Autret <autret_m@epita.fr>
20315 Now the files macro_tab.[ch] are named muscle_tab.[ch].
20317 * src/muscle_tab.c, src/muscle_tab.h: Add files.
20319 2001-09-02 Marc Autret <autret_m@epita.fr>
20321 * src/macrotab.c, src/macrotab.h: Remove.
20323 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
20325 * src/reader.c (copy_guard): Use muscle to specify the `#line'
20328 2001-09-01 Marc Autret <autret_m@epita.fr>
20330 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
20331 to an explicit value to activate the feature. We do it here.
20333 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20335 * src/output.c (prepare): Delete the `filename' muscule insertion.
20336 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
20337 (parse_union_decl): Likewise.
20338 * src/macrotab.c (macro_init): Initialize filename by infile.
20340 2001-08-31 Marc Autret <autret_m@epita.fr>
20342 * src/bison.simple (YYLSP_NEEDED): New definition.
20343 * src/output.c (prepare): Add macro insertion of `locations_flag'
20345 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20347 * src/output.c (prepare): Delete insertion of previous muscles,
20348 and insert the `prefix' muscles.
20349 * src/macrotab.c (macro_init): Likewise.
20350 (macro_init): Initialization prefix directive by `yy'.
20351 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
20352 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
20353 yylval, yydebug, yyerror, yynerrs and yyparse.
20354 New directive `#define' to substitute yydebug, ... with option
20357 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20359 * src/main.c (main): Standardize.
20360 * src/output.c (output_table_data, output_parser): Likewise.
20361 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
20363 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
20365 * src/reader.c (read_additionnal_code): Rename %%user_code to
20367 * src/output.c (output): Rename %%declarations to %%prologue.
20368 * src/bison.simple: Echo modifications.
20370 2001-08-31 Marc Autret <autret_m@epita.fr>
20372 * src/reader.c (readgram): CleanUp.
20373 (output_token_defines): Likewise.
20374 (packsymbols): Likewise.
20375 (reader): Likewise.
20376 * src/output.c (output): CPP-out useless code.
20378 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20380 * src/reader.c (reader): Delete obsolete call to function
20381 output_trailers and output_headers.
20382 * src/output.h: Remove obsolete functions prototypes of output_headers
20383 and output_trailers.
20385 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
20387 * src/main.c: Include macrotab.h.
20388 * src/macrotab.h (macro_entry_s): Constify fields.
20389 Adjust functions prototypes.
20390 * src/macrotab.c (macro_insert): Constify key and value.
20391 (macro_find): Constify key.
20392 (macro_insert): Include 'xalloc.h'
20393 (macro_insert): Use XMALLOC.
20394 (macro_find): Constify return value.
20395 * src/output.c (output_table_data): Rename table to table_data.
20396 (output_parser): Constify macro_key, macro_value.
20398 2001-08-30 Marc Autret <autret_m@epita.fr>
20400 * src/reader.c (parse_skel_decl): New.
20401 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
20402 * src/lex.h (token_t): New token `tok_skel'.
20403 * src/lex.c (percent_table): Add skeleton option entry.
20406 2001-08-29 Marc Autret <autret_m@epita.fr>
20408 * src/bison.simple: Add %%user_code directive at the end.
20409 * src/reader.c (read_additionnal_code): New.
20411 * src/output.c (output_program): Remove.
20414 2001-08-28 Marc Autret <autret_m@epita.fr>
20416 * src/output.c (output_actions): Clean up.
20417 (output_gram): CPP-out useless code.
20418 * src/reader.c (reader): Clean up, CPP-out useless code.
20420 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
20422 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
20424 * src/bison.simple: Add `%%definitions'.
20426 2001-08-28 Marc Autret <autret_m@epita.fr>
20428 * config/depcomp: New file.
20430 2001-08-27 Paul Eggert <eggert@twinsun.com>
20432 * src/bison.simple (yyparse): Don't take the address of an
20433 item before the start of an array, as that doesn't conform to
20436 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
20438 * src/output.c (output): Remove the initialization of the macro
20439 obstack. It was done too late here.
20441 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
20443 (reader): Initialize the macro obstack here, since we need it to grow
20444 '%define' directives.
20446 * src/reader.h: Declare the macro obstack as extern.
20448 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
20450 * src/output.c (output_parser): Fix. Store single '%' characters in
20451 the output obstack instead of throwing them away.
20453 2001-08-27 Akim Demaille <akim@epita.fr>
20455 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
20457 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20459 * lib/Makefile.am: Adjust.
20461 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20463 * src/bison.simple: Update and add '%%' directives.
20465 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20467 * src/reader.c (reader): Remove calls to 'output_headers' and
20468 'output_trailers'. Remove some C output.
20469 (readgram): Disable a piece of code that was writing a default
20470 definition for 'YYSTYPE'.
20471 (reader_output_yylsp): Remove.
20472 (packsymbols): Output token defintions to a macro.
20473 (copy_definition): Disable C output.
20475 * src/reader.c (parse_macro_decl): New function used to parse macro
20477 (copy_string2): Put the body of copy_string into this new function.
20478 Add a parameter to let the caller choose whether he wants to copy the
20479 string delimiters or not.
20480 (copy_string): Be a simple call to copy_string2 with the last argument
20482 (read_declarations): Add case for macro definition.
20483 (copy_identifier): New.
20484 (parse_macro_decl): Read macro identifiers using copy_identifier
20487 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20489 * src/output.c (prepare): Add prefixed names.
20490 (output_parser): Output semantic actions.
20491 (output_parser): Fix bug on '%%line' directives.
20493 * src/output.c (output_headers): Remove. The C code printed by this
20494 function should now be in the skeletons.
20495 (output_trailers): Remove.
20496 (output): Disable call to 'reader_output_yylsp'.
20497 (output_rule_data): Do not output tables to the table obstack.
20499 * src/output.c: Remove some C dedicated output.
20500 Improve the use of macro and output obstacks.
20501 (output_defines): Remove.
20503 * src/output.c (output_token_translations): Associate 'translate'
20504 table with a macro. No output to the table obstack.
20505 (output_gram): Same for 'rhs' and 'prhs'.
20506 (output_stos): Same for 'stos'.
20507 (output_rule_data): Same for 'r1' and 'r2'.
20508 (token_actions): Same for 'defact'.
20509 (goto_actions): Same for 'defgoto'.
20510 (output_base): Same for 'pact' and 'pgoto'.
20511 (output_table): Same for 'table'.
20512 (output_check): Same for 'check'.
20514 * src/output.c (output_table_data): New function.
20515 (output_short_table): Remove.
20516 (output_short_or_char_table): Remove.
20518 * src/output.c (output_parser): Replace most of the skeleton copy code
20519 with something new. Skeletons are now processed character by character
20520 rather than line by line, and Bison looks for '%%' macros. This is the
20521 first step in making Bison's output process (a lot) more flexible.
20522 (output_parser): Use the macro table.
20524 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20526 * src/main.c (main): Initialize the macro table.
20528 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20530 * src/lex.c (percent_table): Add tok_define.
20531 * src/lex.h: Add tok_define.
20533 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20535 * src/macrotab.c: New file.
20536 * src/macrotab.h: New file.
20537 * src/Makefile.am: Update.
20539 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20541 * lib/hash.c: New file.
20542 * lib/hash.h: New file.
20543 * lib/Makefile.am: Update.
20545 2001-08-15 Akim Demaille <akim@epita.fr>
20549 2001-08-15 Marc Autret <autret_m@epita.fr>
20551 * src/reader.c (readgram): Indent output macro YYSTYPE.
20552 (packsymbols): Likewise.
20553 (output_token_defines): Likewise.
20554 * src/files.c: Standardize.
20555 (compute_header_macro): New.
20556 (defines_obstack_save): New. Use compute_header_macro.
20557 (output_files): Update. Use defines_obstack_save.
20559 2001-08-15 Akim Demaille <akim@epita.fr>
20561 * doc/bison.texinfo (Table of Symbols): Document
20562 YYSTACK_USE_ALLOCA.
20564 2001-08-15 Akim Demaille <akim@epita.fr>
20566 * missing: Update from CVS Automake.
20567 * config/config.guess, config/config.sub, config/texinfo.tex:
20568 Update from gnu.org.
20570 2001-08-15 Akim Demaille <akim@epita.fr>
20572 * Makefile.maint: Sync with CVS Autoconf.
20574 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
20576 * doc/bison.texinfo: Include GNU Free Documentation License from
20578 * doc/fdl.texi: Add to package.
20580 2001-08-14 Marc Autret <autret_m@epita.fr>
20582 Turn on %{source,header}_extension features.
20584 * src/lex.c (percent_table): Un-CPP out header_extension and
20586 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
20587 (compute_exts_from_src): Remove conditions. It restores priorities
20590 2001-08-14 Marc Autret <autret_m@epita.fr>
20592 * src/files.c (compute_base_names): Add extensions computing when
20593 `--file-prefix' used.
20594 Standardize function calls.
20596 2001-08-13 Marc Autret <autret_m@epita.fr>
20598 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
20599 defining it (defined but null disables alloca).
20601 2001-08-13 Marc Autret <autret_m@epita.fr>
20603 * src/bison.simple (_yy_memcpy): CPP reformat.
20605 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
20607 * tests/atconfig.in (CPPFLAGS): Fix.
20609 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
20611 * doc/bison.texinfo: Include GNU General Public License from
20613 * doc/gpl.texi: Add to package.
20615 2001-08-10 Marc Autret <autret_m@epita.fr>
20617 * src/print_graph.h: Fix.
20618 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
20620 2001-08-10 Akim Demaille <akim@epita.fr>
20622 * src/system.h: Provide default declarations for stpcpy, strndup,
20625 2001-08-10 Robert Anisko <anisko_r@epita.fr>
20627 * doc/bison.texinfo (Locations): Update @$ stuff.
20629 2001-08-09 Robert Anisko <anisko_r@epita.fr>
20631 * src/bison.simple (YYLLOC_DEFAULT): Update.
20634 2001-08-08 Marc Autret <autret_m@epita.fr>
20636 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
20637 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
20638 Reported by Fabrice Bauzac.
20640 2001-08-08 Marc Autret <autret_m@epita.fr>
20642 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
20643 * src/vcg.c (output_node): Fix.
20644 * src/vcg.h: Cleanup.
20645 * src/print_graph.c: Add comments.
20646 (node_output_size): New global variable. Simplify the formatting of
20647 the VCG graph output.
20648 (print_actions): Unused code is now used. It notifies the final state
20649 and no action states in the VCG graph. It also give the reduce actions.
20650 The `shift and goto' edges are red and the `go to state' edges are
20652 Get the current node name and node_obstack by argument.
20653 (node_obstack): New variable.
20654 (print_state): Manage node_obstack.
20655 (print_core): Use node_obstack given by argument.
20656 A node is not only computed here but in print_actions also.
20657 (print_graph): CPP out useless code instead of commenting it.
20659 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
20661 * tests/atconfig.in (CPPFLAGS): Fix.
20663 2001-08-07 Akim Demaille <akim@epita.fr>
20665 * src/print_graph.c (quote): New.
20666 (print_core): Use it.
20668 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
20670 * src/vcg.c (complain.h): Include it.
20671 Unepitaize `return' invocations.
20672 [NDEBUG] (main): Remove.
20673 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
20674 * src/files.c (open_files): Initialize graph_obstack.
20675 * src/print_graph.c (print_actions): CPP out useless code.
20676 (print_core): Don't output the last `\n' in labels.
20678 * src/files.c (output_files): Output the VCG file.
20679 * src/main.c (main): Invoke print_graph ();
20681 2001-08-06 Marc Autret <autret_m@epita.fr>
20683 Automaton VCG graph output.
20684 Using option ``-g'' or long option ``--graph'', you can generate
20685 a gram_filename.vcg file containing a VCG description of the LALR (1)
20686 automaton of your grammar.
20688 * src/main.c: Call to print_graph() function.
20689 * src/getargs.h: Update.
20690 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
20691 (graph_flag): New flag.
20692 (longopts): Update.
20693 (getargs): Add case `g'.
20694 * src/files.c (graph_obstack): New obstack struct.
20695 (open_files): Initialize new obstack.
20696 (output_files): Saves graph_obstack if required.
20697 * src/files.h (graph_obstack): New extern declaration.
20698 * src/Makefile.am: Add new source files.
20700 2001-08-06 Marc Autret <autret_m@epita.fr>
20702 * src/print_graph.c, src/print_graph.h (graph): New.
20703 * src/vcg.h: New file.
20704 * src/vcg.c: New file, VCG graph handling.
20706 2001-08-06 Marc Autret <autret_m@epita.fr>
20708 Add of %source_extension and %header_extension which specify
20709 the source or/and the header output file extension.
20711 * src/files.c (compute_base_names): Remove initialisation of
20712 src_extension and header_extension.
20713 (compute_exts_from_gf): Update.
20714 (compute_exts_from_src): Update.
20715 (output_files): Update.
20716 * src/reader.c (parse_header_extension_decl): New.
20717 (parse_source_extension_decl): New.
20718 (read_declarations): New case statements for the new tokens.
20719 * src/lex.c (percent_table): Add entries for %source_extension
20720 and %header_extension.
20721 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
20723 2001-08-06 Marc Autret <autret_m@epita.fr>
20725 * configure.in: Bump to 1.28c.
20726 * doc/bison.texinfo: Texinfo thingies.
20728 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
20730 * tests/atconfig.in (CPPFLAGS): Add.
20731 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
20733 2001-08-03 Akim Demaille <akim@epita.fr>
20737 2001-08-03 Akim Demaille <akim@epita.fr>
20739 * tests/Makefile.am (check-local): Ship testsuite.
20740 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
20741 Include `string.h'.
20743 2001-08-03 Akim Demaille <akim@epita.fr>
20745 * configure.in: Try using -Wformat when compiling.
20747 2001-08-03 Akim Demaille <akim@epita.fr>
20749 * configure.in: Bump to 1.28b.
20751 2001-08-03 Akim Demaille <akim@epita.fr>
20753 * src/complain.c: Adjust strerror_r portability issues.
20755 2001-08-03 Akim Demaille <akim@epita.fr>
20759 2001-08-03 Akim Demaille <akim@epita.fr>
20761 * src/getargs.c, src/getarg.h (skeleton)): Constify.
20762 * src/lex.c (literalchar): Avoid name clashes on `buf'.
20763 * src/getargs.c: Include complain.h.
20764 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
20765 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
20767 2001-08-03 Akim Demaille <akim@epita.fr>
20769 * src/reader.c (readgram): Display hidden chars in error messages.
20771 2001-08-03 Akim Demaille <akim@epita.fr>
20773 Update to gettext 0.10.39.
20775 2001-08-03 Akim Demaille <akim@epita.fr>
20777 * lib/strspn.c: New.
20779 2001-08-01 Marc Autret <autret_m@epita.fr>
20781 * doc/bison.texinfo: Update.
20782 * doc/bison.1 (mandoc): Update.
20783 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
20784 * src/files.c: Support output files extensions computing.
20785 (src_extension): New static variable.
20786 (header_extension): New static variable.
20787 (tr): New function.
20788 (get_extension_index): New function, gets the index of an extension
20789 filename in a string.
20790 (compute_exts_from_gf): New function, computes extensions from the
20791 grammar file extension.
20792 (compute_exts_from_src): New functions, computes extensions from the
20793 C source file extension, file given by ``-o'' option.
20794 (compute_base_names): Update.
20795 (output_files): Update.
20797 2001-08-01 Robert Anisko <anisko_r@epita.fr>
20799 * doc/bison.texi: Document @$.
20800 (Locations): New section.
20802 2001-07-18 Akim Demaille <akim@epita.fr>
20804 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
20805 * config/prev-version.txt, config/move-if-change: New.
20806 * Makefile.am: Adjust.
20808 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
20810 * src/bison.simple (yyparse): Suppress warning `comparaison
20811 between signed and unsigned'.
20813 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
20815 * src/getargs.h (raw_flag): Remove.
20816 * src/getargs.c: Die on `-r'/`--raw'.
20817 * src/lex.c (parse_percent_token): Die on `%raw'.
20818 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
20819 * tests/calc.at: Suppress test with option `--raw'.
20821 2001-07-14 Akim Demaille <akim@epita.fr>
20824 * configure.in: Require Autoconf 2.50.
20825 Update to gettext 0.10.38.
20827 2001-03-16 Akim Demaille <akim@epita.fr>
20829 * doc/bison.texinfo: ANSIfy the examples.
20831 2001-03-16 Akim Demaille <akim@epita.fr>
20833 * getargs.c (skeleton): New variable.
20834 (longopts): --skeleton is a new option.
20835 (shortopts, getargs): -S is a new option.
20836 * getargs.h: Declare skeleton.
20837 * output.c (output_parser): Use it.
20839 2001-03-16 Akim Demaille <akim@epita.fr>
20841 * m4/strerror_r.m4: New.
20842 * m4/error.m4: Run AC_FUNC_STRERROR_R.
20843 * lib/error.h, lib/error.c: Update.
20845 2001-03-16 Akim Demaille <akim@epita.fr>
20847 * src/getargs.c (longopts): Clean up.
20849 2001-02-21 Akim Demaille <akim@epita.fr>
20851 * src/reader.c (gensym): `gensym_count' is your own.
20852 Use a static buf to create the symbol name, as token_buffer is no
20855 2001-02-08 Akim Demaille <akim@epita.fr>
20857 * src/conflicts.c (conflict_report): Be sure not to append to res
20858 between two calls, which could happen if both first sprintf were
20859 skipped, but not the first cp += strlen.
20861 2001-02-08 Akim Demaille <akim@epita.fr>
20863 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
20864 New, from fileutils 4.0.37.
20865 * configure.in: Require Autoconf 2.49c. I took some time before
20866 making this decision. This is the only way out for portability
20867 issues in Bison, it would mean way too much duplicate effort to
20868 import in Bison features implemented in 2.49c since 2.13.
20869 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
20871 2001-02-02 Akim Demaille <akim@epita.fr>
20873 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
20874 * lib/xalloc.h, lib/xmalloc.c: Update.
20876 2001-01-19 Akim Demaille <akim@epita.fr>
20878 Get rid of the ad hoc handling of token_buffer in the scanner: use
20881 * src/lex.c (token_obstack): New.
20882 (init_lex): Initialize it. No longer call...
20883 (grow_token_buffer): this. Remove it.
20884 Adjust all the places which used it to use the obstack.
20886 2001-01-19 Akim Demaille <akim@epita.fr>
20888 * src/lex.h: Rename all the tokens:
20889 s/\bENDFILE\b/tok_eof/g;
20890 s/\bIDENTIFIER\b/tok_identifier/g;
20892 Let them be enums, not #define, to ease debugging.
20893 Adjust all the code.
20895 2001-01-18 Akim Demaille <akim@epita.fr>
20897 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
20898 * src/lex.c (maxtoken, grow_token_buffer): Static.
20900 2001-01-18 Akim Demaille <akim@epita.fr>
20902 Since we now use obstacks, more % directives can be enabled.
20904 * src/lex.c (percent_table): Also accept `%yacc',
20905 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
20907 Handle the actions for `%semantic_parser' and `%pure_parser' here,
20908 instead of returning a token.
20909 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
20910 * src/reader.c (read_declarations): Adjust.
20911 * src/files.c (open_files): Don't call `compute_base_names', don't
20912 compute `attrsfile' since they depend upon data which might be
20913 *in* the input file now.
20914 (output_files): Do it here.
20915 * src/output.c (output_headers): Document the fact that this patch
20916 introduces a guaranteed SEGV for semantic parsers.
20917 * doc/bison.texinfo: Document them.
20918 * tests/suite.at: Exercise these %options.
20920 2000-12-20 Akim Demaille <akim@epita.fr>
20922 Also handle the output file (--verbose) with obstacks.
20924 * files.c (foutput): Remove.
20925 (output_obstack): New.
20926 Adjust all dependencies.
20927 * src/conflicts.c: Return a string.
20928 * src/system.h (obstack_grow_string): Rename as...
20929 (obstack_sgrow): this. Be ready to work with non literals.
20930 (obstack_fgrow4): New.
20932 2000-12-20 Akim Demaille <akim@epita.fr>
20934 * src/files.c (open_files): Fix the computation of short_base_name
20935 in the case of `-o foo.tab.c'.
20937 2000-12-20 Akim Demaille <akim@epita.fr>
20939 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
20940 (copy_dollar): Now that everything uses obstacks, get rid of the
20943 2000-12-20 Akim Demaille <akim@epita.fr>
20945 * src/files.c (open_files): Actually the `.output' file is based
20946 on the short_base_name, not base_name.
20947 * tests/suite.at (Checking output file names): Adjust.
20949 2000-12-20 Akim Demaille <akim@epita.fr>
20951 * src/bison.s1: Remove, we now use directly...
20952 * src/bison.simple: this.
20953 * src/Makefile.am: Use pkgdata instead of data.
20955 2000-12-20 Akim Demaille <akim@epita.fr>
20957 * src/files.c (guard_obstack): New.
20958 (open_files): Initialize it.
20959 (output_files): Dump it...
20960 * src/files.h: Export it.
20961 * src/reader.c (copy_guard): Use it.
20963 2000-12-19 Akim Demaille <akim@epita.fr>
20965 * src/files.c (outfile, defsfile, actfile): Removed as global
20967 (open_files): Don't compute them.
20968 (output_files): Adjust.
20969 (base_name, short_base_name): Be global.
20970 Adjust dependencies.
20972 2000-12-19 Akim Demaille <akim@epita.fr>
20974 * src/files.c (strsuffix): New.
20975 (stringappend): Be just like strcat but allocate.
20976 (base_names): Eve out from open_files.
20977 Try to simplify the rather hairy computation of base_name and
20979 (open_files): Use it.
20980 * tests/suite.at (Checking output file names): New test.
20982 2000-12-19 Akim Demaille <akim@epita.fr>
20984 * src/system.h (obstack_grow_literal_string): Rename as...
20985 (obstack_grow_string): this.
20986 * src/output.c (output_parser): Recognize `%% actions' instead of
20988 * src/bison.s1: s/$/%% actions/.
20989 * src/bison.hairy: Likewise.
20991 2000-12-19 Akim Demaille <akim@epita.fr>
20993 * src/output.c (output_parser): Compute the `#line' lines when
20995 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
20996 Suggested by Hans Aberg.
20998 2000-12-19 Akim Demaille <akim@epita.fr>
21000 Let the handling of the skeleton files be local to the procedures
21003 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
21005 (fparser, open_extra_files): Remove.
21006 (open_files, output_files): Don't take care of fparser.
21007 * src/files.h: Adjust.
21008 * src/output.c (output_parser): Open and close the file to the
21010 * src/reader.c (read_declarations): When %semantic_parser, open
21013 2000-12-19 Akim Demaille <akim@epita.fr>
21015 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
21016 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
21018 2000-12-19 Akim Demaille <akim@epita.fr>
21020 * src/files.c (open_files): Yipee! We no longer need all the code
21021 looking for `/tmp' since we have no tmp file.
21023 2000-12-19 Akim Demaille <akim@epita.fr>
21025 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
21027 * src/files.c (open_files): Less dependency on MSDOS etc.
21029 2000-12-14 Akim Demaille <akim@epita.fr>
21031 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
21032 Provide a default definition.
21033 Use it when executing the default @ action.
21034 * src/reader.c (reader_output_yylsp): No longer include
21035 `timestamp' and `text' in the default YYLTYPE.
21037 2000-12-12 Akim Demaille <akim@epita.fr>
21039 * src/reader.c (copy_definition, parse_union_decl, copy_action)
21040 (copy_guard): Quote the file names.
21041 Reported by Laurent Mascherpa.
21043 2000-12-12 Akim Demaille <akim@epita.fr>
21045 * src/output.c (output_headers, output_program, output): Be sure
21046 to escape special characters when outputting filenames.
21047 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
21048 (output_headers): Don't depend on them, Use ACTSTR.
21050 2000-11-17 Akim Demaille <akim@epita.fr>
21052 * lib/obstack.h: Formatting changes.
21053 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
21054 prevents type checking.
21055 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
21056 cast the value to (void *): assigning a `foo *' to a `void *'
21058 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
21059 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
21062 2000-11-17 Akim Demaille <akim@epita.fr>
21064 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
21066 (suite.m4, regression.m4, calc.m4): these.
21067 * tests/atgeneral.m4: Update from CVS Autoconf.
21069 2000-11-17 Akim Demaille <akim@epita.fr>
21071 * tests/regression.m4 (%union and --defines): New test,
21072 demonstrating a current bug in the obstack implementation.
21074 2000-11-17 Akim Demaille <akim@epita.fr>
21076 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
21078 Use them to declare the variables which are global or local to
21081 2000-11-17 Akim Demaille <akim@epita.fr>
21083 * acconfig.h: Remove, no longer used.
21085 2000-11-07 Akim Demaille <akim@epita.fr>
21087 * src: s/Copyright (C)/Copyright/g.
21089 2000-11-07 Akim Demaille <akim@epita.fr>
21091 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
21093 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
21095 2000-11-07 Akim Demaille <akim@epita.fr>
21097 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
21098 Merge in a single CPP if/else.
21100 2000-11-07 Akim Demaille <akim@epita.fr>
21102 * src/output.c (output): Remove useless variables.
21103 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
21104 argument `data' for consistency with the prototypes.
21105 Qualify it `const'.
21106 (obstack_copy, obstack_copy0): Rename the second argument as
21107 `address' for consistency. Qualify it `const'.
21108 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
21109 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
21110 `const' their input argument (`data' or `address').
21111 Adjust the corresponding macros to include `const' in casts.
21113 2000-11-03 Akim Demaille <akim@epita.fr>
21115 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
21116 s/PFILE1/BISON_HAIRY/.
21117 Adjust dependencies.
21119 2000-11-03 Akim Demaille <akim@epita.fr>
21121 For some reason, this was not applied.
21123 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
21124 `unlink': it's no longer used.
21126 2000-11-03 Akim Demaille <akim@epita.fr>
21128 * src/files.c (skeleton_find): New function, eved out of...
21129 (open_files, open_extra_files): here.
21131 2000-11-03 Akim Demaille <akim@epita.fr>
21133 Don't use `atexit'.
21135 * src/files.c (obstack_save): New function.
21136 (done): Rename as...
21137 (output_files): this.
21138 Use `obstack_save'.
21139 * src/main.c (main): Don't use `atexit' to register `done', since
21140 it no longer has to remove tmp files, just call `output_files'
21141 when there are no errors.
21143 2000-11-02 Akim Demaille <akim@epita.fr>
21145 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
21146 `unlink': it's no longer used.
21147 * src/files.h: Formatting changes.
21149 2000-11-02 Akim Demaille <akim@epita.fr>
21151 Remove the last uses of mktemp and unlink/delete.
21153 * src/files.c (fdefines, ftable): Removed.
21154 (defines_ostack, table_obstack): New.
21155 Adjust dependencies of the former into uses of the latter.
21156 * src/output.c (output_short_or_char_table, output_short_table):
21157 Convert to using obstacks.
21158 * src/reader.c (copy_comment2): Accept one FILE * and two
21160 (output_token_defines, reader_output_yylsp): Use obstacks.
21161 * src/system.h (obstack_fgrow3): New.
21162 * po/POTFILES.in: Adjust.
21164 2000-11-01 Akim Demaille <akim@epita.fr>
21166 Change each use of `fattrs' into a use of `attrs_obstack'.
21168 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
21169 * src/files.c (fattrs): Remove.
21170 (attrs_obstack): New.
21171 Adjust all dependencies.
21172 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
21174 2000-11-01 Akim Demaille <akim@epita.fr>
21176 Introduce obstacks.
21177 Change each use of `faction' into a use of `action_obstack'.
21179 * lib/obstack.h, lib/obstack.c: New files.
21180 * src/files.c (faction): Remove.
21181 (action_obstack): New.
21182 Adjust all dependencies.
21184 2000-10-20 Akim Demaille <akim@epita.fr>
21186 * lib/quote.h (PARAMS): New macro. Use it.
21188 2000-10-16 Akim Demaille <akim@epita.fr>
21190 * src/output.c (output_short_or_char_table): New function.
21191 (output_short_table, output_token_translations): Use it.
21192 (goto_actions): Use output_short_table.
21194 2000-10-16 Akim Demaille <akim@epita.fr>
21196 * src/symtab.c (bucket_new): New function.
21199 * src/output.c (output_short_table): New argument to display the
21200 comment associated with the table.
21201 Adjust dependencies.
21202 (output_gram): Use it.
21203 (output_rule_data): Nicer output layout for YYTNAME.
21205 2000-10-16 Akim Demaille <akim@epita.fr>
21207 * src/lex.c (read_typename): New function.
21209 * src/reader.c (copy_dollar): Likewise.
21211 2000-10-16 Akim Demaille <akim@epita.fr>
21213 * src/reader.c (copy_comment2): Expect the input stream to be on
21214 the `/' which is suspected to open a comment, instead of being
21215 called after `//' or `/*' was read.
21216 (copy_comment, copy_definition, parse_union_decl, copy_action)
21217 (copy_guard): Adjust.
21219 2000-10-16 Akim Demaille <akim@epita.fr>
21221 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
21222 `read_signed_integer'.
21224 2000-10-16 Akim Demaille <akim@epita.fr>
21226 * src/reader.c (copy_dollar): New function.
21227 (copy_guard, copy_action): Use it.
21229 2000-10-16 Akim Demaille <akim@epita.fr>
21231 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
21232 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
21233 New files, from Fileutils 4.0.27.
21234 * src/main.c (printable_version): Remove.
21235 * src/lex.c, src/reader.c: Use `quote'.
21237 2000-10-04 Akim Demaille <akim@epita.fr>
21239 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
21241 2000-10-04 Akim Demaille <akim@epita.fr>
21243 * doc/bison.texinfo: Various typos spotted by Neil Booth.
21245 2000-10-04 Akim Demaille <akim@epita.fr>
21247 When a literal string is used to define two different tokens,
21248 `bison -v' segfaults.
21249 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
21251 * tests/regression.m4: New file.
21252 Include the core of the sample provided by Piotr Gackiewicz.
21253 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
21256 2000-10-04 Akim Demaille <akim@epita.fr>
21258 * src/reader.c (parse_expect_decl): Keep `count' within the size
21262 2000-10-02 Paul Eggert <eggert@twinsun.com>
21264 * bison.s1 (yyparse): Assign the default value
21265 unconditionally, to avoid a GCC warning and make the parser a
21268 2000-10-02 Akim Demaille <akim@epita.fr>
21270 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
21273 2000-10-02 Akim Demaille <akim@epita.fr>
21275 * src/derives.c, src/print.c, src/reduce.c: To ease the
21276 translation, move some `\n' out of the translated strings.
21278 2000-10-02 Akim Demaille <akim@epita.fr>
21280 The location tracking mechanism is precious for parse error
21281 messages. Nevertheless, it is enabled only when `@n' is used in
21282 the grammar, which is a different issue (you can use it in error
21283 message, but not in the grammar per se). Therefore, there should
21284 be another means to enable it.
21286 * src/getargs.c (getargs): Support `--locations'.
21287 (usage): Report it.
21288 * src/getargs.h (locationsflag): Export it.
21289 * src/lex.c (percent_table): Support `%locations'.
21290 * src/reader.c (yylsp_needed): Remove this variable, now replaced
21291 with `locationsflag'.
21292 * doc/bison.texinfo: Document `--locations' and `%locations'.
21294 * tests/calc.m4: Test it.
21296 For regularity of the names, replace each
21297 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
21298 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
21299 In addition replace each `flag' with `_flag'.
21301 2000-10-02 Akim Demaille <akim@epita.fr>
21303 Also test parse error messages, including with YYERROR_VERBOSE.
21305 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
21307 Use it to check the computations.
21308 Use it to check `nonassoc' is honored.
21309 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
21310 `--yyerror-verbose'.
21311 (_AT_CHECK_CALC): Adjust to this option.
21312 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
21314 2000-10-02 Akim Demaille <akim@epita.fr>
21316 Test also `--verbose', `--defines' and `--name-prefix'. Testing
21317 the latter demonstrates a flaw in the handling of non debugging
21318 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
21319 was used in order to simplify:
21335 unfortunately this leads to a CPP conflict when
21336 `--name-prefix=foo' is used since it produces `#define yydebug
21339 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
21340 (YYDPRINTF): New macro.
21342 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
21344 Also test `--verbose', `--defines' and `--name-prefix'.
21346 2000-10-02 Akim Demaille <akim@epita.fr>
21348 Improve the readability of the produced parsers.
21350 * src/bison.s1: Formatting changes.
21351 Improve the comment related to the `$' mark.
21352 (yydefault): Don't fall through to `yyresume': `goto' there.
21353 * src/output.c (output_parser): When the `$' is met, skip the end
21355 New variable, `number_of_dollar_signs', to check there's exactly
21356 one `$' in the parser skeleton.
21358 2000-10-02 Akim Demaille <akim@epita.fr>
21360 * lib/xstrdup.c: New file, from the fileutils.
21361 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
21362 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
21363 instead of strlen + xmalloc + strcpy.
21364 * src/symtab.c (copys): Remove, use xstrdup instead.
21366 2000-10-02 Akim Demaille <akim@epita.fr>
21368 * src/gram.h (associativity): New enum type which replaces the
21369 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
21370 `right_assoc', `left_assoc' and `non_assoc'.
21371 Adjust all dependencies.
21372 * src/reader.c: Formatting changes.
21373 (LTYPESTR): Don't define it, use it as a literal in
21374 `reader_output_yylsp'.
21375 * src/symtab.h (symbol_class): New enum type which replaces the
21376 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
21377 `sunknown', `stoken and `snterm'.
21379 2000-10-02 Akim Demaille <akim@epita.fr>
21381 * src/getargs.c (fixed_outfiles): Rename as...
21382 (yaccflag): for consistency and accuracy.
21383 Adjust dependencies.
21385 2000-10-02 Akim Demaille <akim@epita.fr>
21387 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
21388 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
21389 difficult and introduced a lot of core dump. It turns out that
21390 Bison used an implementation of `xmalloc' based on `calloc', and
21391 at various places it does depend upon the initialization to 0. I
21392 have not tried to isolate the pertinent places, and all the former
21393 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
21394 someone should address this issue.
21396 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
21397 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
21399 Adjust dependencies.
21400 * src/warshall.h: New file.
21403 2000-10-02 Akim Demaille <akim@epita.fr>
21405 Various anti-`extern in *.c' changes.
21407 * src/system.h: Include `assert.h'.
21409 2000-10-02 Akim Demaille <akim@epita.fr>
21411 * src/state.h (nstates, final_state, first_state, first_shift)
21412 (first_reduction): Move their exportation from here...
21413 * src/LR0.h: to here.
21414 Adjust dependencies.
21415 * src/getargs.c (statisticsflag): New variable.
21416 Add support for `--statistics'.
21417 Adjust dependencies.
21419 Remove a lot of now useless `extern' statements in most files.
21421 2000-10-02 Akim Demaille <akim@epita.fr>
21423 * src/LR0.h: New file.
21426 2000-10-02 Akim Demaille <akim@epita.fr>
21428 * src/print.h: New file.
21430 * src/print.c: Formatting and ordering changes.
21431 (verbose, terse): Replace with...
21432 (print_results): this new function.
21433 Adjust dependencies.
21435 2000-10-02 Akim Demaille <akim@epita.fr>
21437 * src/conflicts.c (conflict_report): New function.
21438 (conflict_log, verbose_conflict_log): Replace with...
21439 (print_conflicts): this function.
21440 Adjust dependencies.
21441 * src/conflicts.h: New file.
21442 Propagate its inclusion.
21444 2000-10-02 Akim Demaille <akim@epita.fr>
21446 * src/nullable.h: New file.
21447 Propagate its inclusion.
21448 * src/nullable.c: Formatting changes.
21450 2000-10-02 Akim Demaille <akim@epita.fr>
21452 * src/reduce.h: New file.
21453 Propagate its inclusion.
21454 * src/reduce.c: Topological sort and other formatting changes.
21455 (bool, TRUE, FALSE): Move their definition to...
21456 * src/system.h: here.
21458 2000-10-02 Akim Demaille <akim@epita.fr>
21460 * src/files.c: Formatting changes.
21461 (tryopen, tryclose, openfiles): Rename as...
21462 (xfopen, xfclose, open_files): this.
21463 (stringappend): static.
21464 * src/files.h: Complete the list of exported symbols.
21467 2000-10-02 Akim Demaille <akim@epita.fr>
21469 * src/reader.h: New file.
21470 Propagate its use instead of tedious list of `extern' and
21472 * src/reader.c: Formatting changes, topological sort,
21475 2000-10-02 Akim Demaille <akim@epita.fr>
21477 * src/lex.h: Prototype `lex.c' exported functions.
21478 * src/reader.c: Adjust.
21479 * src/lex.c: Formatting changes.
21480 (safegetc): Rename as...
21483 2000-10-02 Akim Demaille <akim@epita.fr>
21485 * src/lalr.h: New file.
21486 Propagate its inclusion instead of prototypes and `extern'.
21487 * src/lalr.c: Formatting changes, topological sorting etc.
21489 2000-10-02 Akim Demaille <akim@epita.fr>
21491 * src/output.c (token_actions): Introduce a temporary array,
21492 YYDEFACT, that makes it possible for this function to use
21493 output_short_table.
21495 2000-10-02 Akim Demaille <akim@epita.fr>
21497 `user_toknums' is output as a `short[]' in `output.c', while it is
21498 defined as a `int[]' in `reader.c'. For consistency with the
21499 other output tables, `user_toknums' is now defined as a table of
21502 * src/reader.c (user_toknums): Be a short table instead of an int
21504 Adjust dependencies.
21506 Factor the short table outputs.
21508 * src/output.c (output_short_table): New function.
21509 * src/output.c (output_gram, output_stos, output_rule_data)
21510 (output_base, output_table, output_check): Use it.
21512 2000-10-02 Akim Demaille <akim@epita.fr>
21514 * src/output.c (output): Topological sort of the functions, in
21515 order to get rid of the `static' prototypes.
21516 No longer use `register'.
21517 * src/output.h: New file.
21518 Propagate its inclusion in files explicitly prototyping functions
21521 2000-09-21 Akim Demaille <akim@epita.fr>
21523 * src/atgeneral.m4: Update from Autoconf.
21525 2000-09-21 Akim Demaille <akim@epita.fr>
21527 * src/closure.h: New file.
21528 * src/closure.c: Formatting changes, topological sort over the
21529 functions, use of closure.h.
21530 (initialize_closure, finalize_closure): Rename as...
21531 (new_closure, free_closure): these. Adjust dependencies.
21532 * src/LR0.c: Formatting changes, topological sort, use of
21534 (initialize_states): Rename as...
21535 (new_states): this.
21536 * src/Makefile.am (noinst_HEADERS): Adjust.
21538 2000-09-20 Akim Demaille <akim@epita.fr>
21540 * src/acconfig.h: Don't protect config.h against multiple
21542 Don't define PARAMS.
21543 * src/system.h: Define PARAMS.
21544 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
21545 purpose of config.h. system.h must not try to fix wrong
21546 definitions in config.h.
21548 2000-09-20 Akim Demaille <akim@epita.fr>
21550 * src/derives.h: New file.
21551 * src/main.c, src/derives.h: Use it.
21552 Formatting changes.
21553 * src/Makefile.am (noinst_HEADERS): Adjust.
21555 2000-09-20 Akim Demaille <akim@epita.fr>
21557 * tests/atgeneral.m4: Update from Autoconf.
21558 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
21559 (AT_CHECK_CALC): New macros.
21560 Use these macros to test bison with options `', `--raw',
21561 `--debug', `--yacc', `--yacc --debug'.
21563 2000-09-19 Akim Demaille <akim@epita.fr>
21565 * src/output.c: Formatting changes.
21566 * src/machine.h: Remove, leaving its contents in...
21567 * src/system.h: here.
21569 Adjust all dependencies on stdio.h and machine.h.
21570 * src/getargs.h: New file.
21571 Let all `extern' declarations about getargs.c be replaced with
21572 inclusion of `getargs.h'.
21573 * src/Makefile.am (noinst_HEADERS): Adjust.
21575 * tests/calc.m4 (yyin): Be initialized in main, not on the global
21577 (yyerror): Returns void, not int.
21578 * doc/bison.texinfo: Formatting changes.
21580 2000-09-19 Akim Demaille <akim@epita.fr>
21582 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
21585 2000-09-18 Akim Demaille <akim@epita.fr>
21587 * configure.in: Append WARNING_CFLAGS to CFLAGS.
21588 * src/Makefile.am (INCLUDES): Don't.
21589 Be ready to fetch headers in lib/.
21591 2000-09-18 Akim Demaille <akim@epita.fr>
21593 * doc/bison.texinfo: Update the copyright.
21594 ANSIfy and GNUify the examples.
21595 Remove the old menu.
21597 2000-09-18 Akim Demaille <akim@epita.fr>
21599 First set of tests: use the `calc' example from the documentation.
21601 * src/bison.s1 (yyparse): Condition the code using `yytname' which
21602 is defined only when YYDEBUG is.
21603 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
21604 * src/files.c (tryopen, tryclose): Formatting changes.
21605 Move to the top and be static.
21606 * src/reader.c (read_signed_integer): Likewise.
21607 * tests/calc.m4: New file.
21608 * Makefile.am, suite.m4: Adjust.
21609 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
21611 2000-09-18 Akim Demaille <akim@epita.fr>
21613 Add support for an Autotest test suite for Bison.
21615 * m4/m4.m4, m4/atconfig.m4: New files.
21616 * m4/Makefile.am (EXTRA_DIST): Adjust.
21617 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
21619 * src/getargs.c: Display a more standard --version message.
21620 * src/reader.c (reader): Formatting changes.
21621 No longer depend upon VERSION_STRING.
21622 * configure.in: No longer use `dnl'.
21623 Set up the test suite and the new directory `tests/.
21624 (VERSION_STRING): Remove.
21626 2000-04-14 Akim Demaille <akim@epita.fr>
21628 * src/reader.c (copy_comment2): New function, same as former
21629 `copy_comment', but outputs into two FILE *.
21630 (copy_comment): Use it.
21631 (parse_union_decl): Use it.
21632 (get_type, parse_start_decl): Use the same `invalid' message.
21633 (parse_start_decl, parse_union_decl): Use the same `multiple'
21635 (parse_union_decl, copy_guard, copy_action): Use the same
21636 `unmatched' message.
21637 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
21639 2000-03-31 Akim Demaille <akim@epita.fr>
21641 * src/files.c (tryopen, tryclose): Move to the top.
21644 2000-03-31 Akim Demaille <akim@epita.fr>
21646 * src/main.c (main): Don't call `done', exit does it.
21648 2000-03-31 Akim Demaille <akim@epita.fr>
21650 * allocate.c: s/return (foo)/return foo/.
21651 * lalr.c: Likewise.
21653 * output.c: Likewise.
21654 * reader.c: Likewise.
21655 * symtab.c: Likewise.
21656 * vmsgetargs.c: Likewise.
21658 2000-03-31 Akim Demaille <akim@epita.fr>
21660 Clean up the error reporting functions.
21662 * src/report.c: New file.
21663 * src/report.h: Likewise.
21664 * src/Makefile.am: Adjust.
21665 * m4/error.m4: New file.
21666 * m4/Makefile.am: Adjust.
21667 * configure.in (jm_PREREQ_ERROR): Call it.
21668 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
21670 (fatal, fatals): Remove. All callers use complain.c::fatal.
21671 (warn, warni, warns, warnss, warnss): Remove. All callers use
21672 complain.c::complain.
21673 (toomany): Remove, use fatal instead.
21674 * src/files.c (done): No argument, use complain_message_count.
21675 * src/main.c (main): Register `done' to `atexit'.
21677 * src/getargs.c (usage): More `fputs', less `fprintf'.
21679 2000-03-28 Akim Demaille <akim@epita.fr>
21681 * lib/: New directory.
21682 * Makefile.am (SUBDIRS): Adjust.
21683 * configure.in: Adjust.
21684 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
21686 * src/alloca.c: Moved to lib/.
21687 * src/getopt.c: Likewise.
21688 * src/getopt1.c: Likewise.
21689 * src/getopt.h: Likewise.
21690 * src/ansi2knr.c: Likewise.
21691 * src/ansi2knr.1: Likewise.
21692 * src/Makefile.am: Adjust.
21693 * lib/Makefile.am: New file.
21695 2000-03-28 Akim Demaille <akim@epita.fr>
21697 * src/getargs.c (usage): Refresh the help message.
21699 2000-03-17 Akim Demaille <akim@epita.fr>
21701 * src/getopt1.c: Updated from textutils 2.0e
21702 * src/getopt.c: Likewise.
21703 * src/getopt.h: Likewise.
21705 2000-03-17 Akim Demaille <akim@epita.fr>
21707 * src/Makefile.am (bison.simple): Fix the awk program: quote only
21708 the file name, not the whole `#line LINE FILE'.
21710 2000-03-17 Akim Demaille <akim@epita.fr>
21712 On syntax errors, report the token on which we choked.
21714 * src/bison.s1 (yyparse): In the label yyerrlab, when
21715 YYERROR_VERBOSE, add yychar in msg.
21717 2000-03-17 Akim Demaille <akim@epita.fr>
21719 * src/reader.c (copy_at): New function.
21720 (copy_guard): Use it.
21721 (copy_action): Use it.
21723 2000-03-17 Akim Demaille <akim@epita.fr>
21725 Be kind to translators, save some useless translations.
21727 * src/main.c (banner): New function.
21728 (fatal_banner): Use it.
21729 (warn_banner): Use it.
21731 2000-03-17 Akim Demaille <akim@epita.fr>
21733 * src/reader.c (copy_definition): Use copy_string and
21734 copy_comment. Removed now unused `match', `ended',
21736 (copy_comment, copy_string): Moved, to be visible from
21739 2000-03-17 Akim Demaille <akim@epita.fr>
21741 * src/reader.c (copy_string): Declare `static inline'. No
21742 problems with inline, since it is checked by configure.
21743 (copy_comment): Likewise.
21745 2000-03-17 Akim Demaille <akim@epita.fr>
21747 * src/reader.c (packsymbols): Formatting changes.
21749 2000-03-17 Akim Demaille <akim@epita.fr>
21751 * src/reader.c (copy_comment): New function, factored out from:
21752 (copy_action): Use it. Removed now unused `match', `ended',
21754 (copy_guard): Likewise.
21756 2000-03-17 Akim Demaille <akim@epita.fr>
21758 * src/reader.c (copy_string): New function, factored out from:
21759 (copy_action): Use it.
21760 (copy_guard): Likewise.
21762 2000-03-17 Akim Demaille <akim@epita.fr>
21764 Change the handling of @s so that they behave exactly like $s.
21765 There is now a pseudo variable @$ (readble and writable), location
21766 of the lhs of the rule (by default ranging from the location of
21767 the first symbol of the rhs, to the location of the last symbol,
21768 or, if the rhs is empty, YYLLOC).
21770 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
21772 (yyparse): When providing a default semantic action, provide a
21773 default location action.
21774 (after the $): No longer change `*YYLSP', just stack YYLOC the
21775 same way you stack YYVAL.
21776 * src/reader.c (read_declarations): Use warns.
21777 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
21778 (copy_action, case '@'): Likewise.
21779 Use a standard error message, to save useless work from
21782 2000-03-17 Akim Demaille <akim@epita.fr>
21784 * src/bison.s1: Formatting and cosmetics changes.
21785 * src/reader.c: Likewise.
21786 Update the Copyright notice.
21788 2000-03-17 Akim Demaille <akim@epita.fr>
21790 * src/bison.s1 (#line): All set to `#line' only, since the
21791 Makefile now handles them.
21793 2000-03-16 Akim Demaille <akim@epita.fr>
21795 * src/output.c (output_rule_data): Output the documentation of
21796 some of the tables.
21797 (Copyright notice): Update.
21798 Formatting changes.
21800 2000-03-16 Akim Demaille <akim@epita.fr>
21802 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
21803 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
21804 One `#if YYDEBUG' remains, since it uses variables which are
21805 defined only if `YYDEBUG != 0'.
21807 2000-03-16 Akim Demaille <akim@epita.fr>
21809 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
21810 and related variables so that the similarities are highlighted.
21812 2000-03-16 Akim Demaille <akim@epita.fr>
21814 * src/bison.s1: Properly indent CPP directives.
21816 2000-03-16 Akim Demaille <akim@epita.fr>
21818 * src/bison.s1: Properly indent the `alloca' CPP section.
21820 2000-03-16 Akim Demaille <akim@epita.fr>
21822 Do not hard code values of directories in `configure.in'.
21823 Update the `configure' tool chain.
21825 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
21827 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
21828 (AC_OUTPUT): Add m4/Makefile.
21829 Bump to bison 1.28a, 1.29 has never been released.
21830 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
21831 handled via src/Makefile.am.
21832 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
21833 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
21835 * Makefile.am (SUBDIRS): Add m4.
21836 (ACLOCAL_AM_FLAGS): New variable.
21837 (AUTOMAKE_OPTIONS): Add check-news.
21838 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
21839 the proper line number and file name.
21840 (DEFS): Propagate the location of bison library files and of the
21842 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
21844 * acinclude.m4: Remove, replaced by the directory m4.
21845 * m4/Makefile.am (EXTRA_DIST): New variable.
21846 * m4/gettext.m4: New file, from the fileutils.
21847 * m4/lcmessage.m4: Likewise
21848 * m4/progtest.m4: Likewise.
21849 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
21851 2000-03-10 Akim Demaille <akim@epita.fr>
21854 Formatting changes of various comments.
21855 Respect the GNU coding standards at various places.
21856 Don't use `_()' when no translation is needed.
21858 1999-12-13 Jesse Thilo <jthilo@gnu.org>
21861 OS/2 honors TMPDIR environment variable.
21863 1999-12-13 Jesse Thilo <jthilo@gnu.org>
21865 * doc/bison.texinfo: Tweaked spelling and grammar.
21867 Removed reference to price of printed copy.
21868 Mention BISON_SIMPLE and BISON_HAIRY.
21870 1999-12-13 Jesse Thilo <jthilo@gnu.org>
21872 * configure.in, NEWS:
21873 Bison 1.29 released.
21875 1999-10-27 Jesse Thilo <jthilo@gnu.org>
21877 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
21878 Added reference card.
21880 1999-07-26 Jesse Thilo <jthilo@gnu.org>
21882 * po/ru.po: Added Russian translation.
21884 1999-07-26 Jesse Thilo <jthilo@gnu.org>
21886 * configure.in: Added Russian translation.
21888 1999-07-06 Jesse Thilo <jthilo@gnu.org>
21890 * configure.in, NEWS, README:
21891 Released version 1.28.
21893 1999-06-14 Jesse Thilo <jthilo@gnu.org>
21896 Squashed redefinition warning on some systems.
21898 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
21899 Have configure build version string instead of relying on ANSI string
21902 1999-06-14 Jesse Thilo <jthilo@gnu.org>
21904 * po/POTFILES.in: Got rid of version.c.
21906 1999-06-14 Jesse Thilo <jthilo@gnu.org>
21908 * acconfig.h, configure.in:
21909 Have configure build version string instead of relying on ANSI string
21912 1999-06-08 Jesse Thilo <jthilo@gnu.org>
21915 Dropped mention of `+' for long-named options.
21917 1999-05-30 Jesse Thilo <jthilo@gnu.org>
21919 * src/files.c: Added <unistd.h> for unlink().
21921 * src/Makefile.am, src/system.h:
21924 1999-05-30 Jesse Thilo <jthilo@gnu.org>
21926 * README: Added a FAQ list.
21928 * configure.in, acconfig.h:
21931 1999-05-30 Jesse Thilo <jthilo@gnu.org>
21933 * doc/FAQ, doc/Makefile.am:
21936 1999-05-19 Jesse Thilo <jthilo@gnu.org>
21938 * src/alloc.h, src/symtab.h, src/version.c:
21939 Protected inclusion of "config.h" with HAVE_CONFIG_H.
21941 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21943 * src/.cvsignore, src/Makefile.am:
21944 Reorganized: sources in `src', documentation in `doc'.
21946 * src/lex.c (literalchar):
21947 fixed the code for escaping double quotes (thanks
21950 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21952 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
21953 Adjusted paths to reflect directory reorganization.
21955 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21957 * doc/.cvsignore, doc/Makefile.am:
21958 Reorganized: sources in `src', documentation in `doc'.
21960 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21963 Updated AC_INIT file to reflect directory reorganization.
21965 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
21966 Reorganized: sources in `src', documentation in `doc'.
21968 1999-04-13 Jesse Thilo <jthilo@gnu.org>
21971 Don't declare calloc() and realloc() if not necessary.
21973 1999-04-13 Jesse Thilo <jthilo@gnu.org>
21975 * configure.in, acconfig.h, acinclude.m4:
21976 Don't declare calloc() and realloc() if not necessary.
21978 1999-03-23 Jesse Thilo <jthilo@gnu.org>
21980 * po/.cvsignore: Added i18n support.
21982 1999-03-23 Jesse Thilo <jthilo@gnu.org>
21984 * acconfig.h, configure.in, Makefile.am:
21985 Added i18n support.
21987 1999-03-22 Jesse Thilo <jthilo@gnu.org>
21989 * src/bison.s1: Fixed #line numbers.
21991 1999-03-15 Jesse Thilo <jthilo@gnu.org>
21993 * po/es.po, po/fr.po, po/nl.po, po/de.po:
21994 Added PO files from Translation Project.
21996 1999-03-03 Jesse Thilo <jthilo@gnu.org>
21999 Added support for non-ANSI compilers (ansi2knr).
22001 1999-02-16 Jesse Thilo <jthilo@gnu.org>
22003 * configure.in: Bumped version number to 1.27.
22006 Added `bison.simple' to list of files removed by `make distclean'.
22008 1999-02-12 Jesse Thilo <jthilo@gnu.org>
22010 * src/files.c, src/files.h:
22011 Defined locations of parser files in config.h instead of Makefile.
22013 1999-02-12 Jesse Thilo <jthilo@gnu.org>
22015 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
22016 Defined locations of parser files in config.h instead of Makefile.
22018 1999-02-09 Jesse Thilo <jthilo@gnu.org>
22021 Removed inappropriate use of $< macro.
22023 1999-02-05 Jesse Thilo <jthilo@gnu.org>
22025 * po/Makefile.in.in, po/POTFILES.in:
22026 Add `po' directory skeleton.
22028 1999-01-27 Jesse Thilo <jthilo@gnu.org>
22030 * README: Document help-bison list.
22032 * configure.in: Add check for mkstemp().
22034 1999-01-20 Jesse Thilo <jthilo@gnu.org>
22036 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
22037 Hush a few compiler warnings.
22040 Add tryclose(), which verifies that fclose was successful.
22041 Hush a couple of compiler warnings.
22043 1999-01-20 Jesse Thilo <jthilo@gnu.org>
22045 * Makefile.am, OChangeLog:
22046 ChangeLog is now automatically generated. Include the old version as
22049 1999-01-14 Jesse Thilo <jthilo@gnu.org>
22051 * 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:
22052 Update FSF address.
22054 1999-01-14 Jesse Thilo <jthilo@gnu.org>
22056 * doc/bison.texinfo: Fix formatting glitch.
22058 * doc/bison.texinfo: Update FSF address.
22060 1999-01-14 Jesse Thilo <jthilo@gnu.org>
22062 * acconfig.h: Update FSF address.
22064 1999-01-08 Jesse Thilo <jthilo@gnu.org>
22067 Don't define PACKAGE here, since config.h defines it.
22069 1998-12-30 Jesse Thilo <jthilo@gnu.org>
22071 * src/reader.c: Update copyright date.
22074 Ditch sprintf to statically-sized buffers in fatal/warn functions in
22075 favor of output directly to stderr (avoids buffer overruns).
22077 * src/reader.c: Some checks for premature EOF.
22079 * 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:
22080 Use prototypes if the compiler understands them.
22082 * src/files.c: Honor TMPDIR on Unix hosts.
22083 Use prototypes if the compiler understands them.
22086 Fix a couple of buffer overrun bugs.
22087 Use prototypes if the compiler understands them.
22089 * src/system.h: Include unistd.h and ctype.h.
22090 Use #ifdef instead of #if for NLS symbols.
22092 1998-12-30 Jesse Thilo <jthilo@gnu.org>
22094 * doc/bison.texinfo:
22095 Delete comment "consider using @set for edition number, etc..." since
22096 we now are doing so.
22098 1998-12-30 Jesse Thilo <jthilo@gnu.org>
22101 Use prototypes if the compiler understands them.
22103 * NEWS: Document 1.26 highlights.
22105 * Makefile.am: Require Automake 1.3 or later.
22108 Use prototypes if the compiler understands them.
22110 1998-12-29 Jesse Thilo <jthilo@gnu.org>
22113 Use VERSION symbol from automake for version number.
22115 1998-12-29 Jesse Thilo <jthilo@gnu.org>
22117 * acconfig.h, configure.in, version.cin:
22118 Use VERSION symbol from automake for version number.
22120 1998-11-28 Jesse Thilo <jthilo@gnu.org>
22123 Distribute original version of simple parser (bison.s1), not built
22124 version (bison.simple).
22126 1998-11-28 Jesse Thilo <jthilo@gnu.org>
22128 * doc/bison.texinfo: Add info dir entry.
22130 * doc/bison.texinfo:
22131 Let automake put version number into documentation.
22133 1998-11-26 Jesse Thilo <jthilo@gnu.org>
22135 * src/bison.cld, src/build.com, src/vmshlp.mar:
22136 Add non-RCS files from /gd/gnu/bison.
22138 1998-11-26 Jesse Thilo <jthilo@gnu.org>
22141 Document the BISON_HAIRY and BISON_SIMPLE variables.
22143 1998-11-25 Jesse Thilo <jthilo@gnu.org>
22145 * src/version.c: Build version.c automatically.
22148 Fix token numbering (used to start at 258, not 257).
22150 * src/system.h: Include config.h.
22152 * src/getargs.c: Update bug report address.
22154 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
22155 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
22157 1998-11-25 Jesse Thilo <jthilo@gnu.org>
22160 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
22162 * configure.in, version.cin:
22163 Build version.c automatically.
22165 * AUTHORS: Add AUTHORS file.
22167 * README: Update bug report address.
22170 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
22172 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
22173 Add automake stuff.
22175 1998-11-25 Jesse Thilo <jthilo@gnu.org>
22177 * doc/bison.texinfo: Clean up some formatting.
22179 1998-05-05 Richard Stallman <rms@gnu.org>
22181 * doc/bison.texinfo:
22182 Explain better why to make a pure parser.
22184 1998-01-05 Richard Stallman <rms@gnu.org>
22186 * src/files.c (openfiles):
22187 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
22188 find a temporary directory, if possible. Do not unlink files while
22191 1997-08-25 Richard Stallman <rms@gnu.org>
22193 * src/reader.c (stack_offset;):
22194 Change some warni to warns.
22196 * src/lex.c (literalchar): Use warns, not warni.
22198 1997-06-28 Richard Stallman <rms@gnu.org>
22200 * src/bison.s1: Add a Bison version comment.
22202 * src/main.c (fatal, warn, berror):
22205 1997-06-28 Richard Stallman <rms@gnu.org>
22207 * Makefile.in (bison_version): New variable.
22208 (dist): Use that variable.
22209 (bison.s1): Substitute the Bison version into bison.simple.
22211 * bison.simple: Add a Bison version comment.
22213 1997-06-18 Richard Stallman <rms@gnu.org>
22215 * src/main.c (fatal, warn, berror):
22216 Make error messages standard.
22217 (toomany): Improve error message text.
22219 * 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:
22220 new.h renamed to alloc.h.
22222 1997-06-18 Richard Stallman <rms@gnu.org>
22224 * Makefile.in: new.h renamed to alloc.h.
22226 1997-05-24 Richard Stallman <rms@gnu.org>
22228 * src/lex.c (literalchar):
22229 Fix the code for escaping \, " and '.
22231 (lex): Avoid trouble when there are many chars
22232 to discard in a char literal with just several chars in it.
22234 1997-05-17 Richard Stallman <rms@gnu.org>
22237 Use malloc, if using alloca is troublesome.
22238 (YYSTACK_USE_ALLOCA): New flag macro.
22239 Define it for some systems and compilers.
22240 (YYSTACK_ALLOC): New macro.
22241 (yyparse): Use YYSTACK_ALLOC to allocate stack.
22242 If it was malloc'd, free it.
22244 1997-05-17 Richard Stallman <rms@gnu.org>
22247 Use malloc, if using alloca is troublesome.
22248 (YYSTACK_USE_ALLOCA): New flag macro.
22249 Define it for some systems and compilers.
22250 (YYSTACK_ALLOC): New macro.
22251 (yyparse): Use YYSTACK_ALLOC to allocate stack.
22252 If it was malloc'd, free it.
22254 1997-04-23 Richard Stallman <rms@gnu.org>
22257 (alloca) [__hpux]: Always define as __builtin_alloca.
22259 1997-04-23 Richard Stallman <rms@gnu.org>
22262 (alloca) [__hpux]: Always define as __builtin_alloca.
22264 1997-04-22 Richard Stallman <rms@gnu.org>
22267 [__hpux]: Include alloca.h (right for HPUX 10)
22268 instead of declaring alloca (right for HPUX 9).
22270 * src/bison.s1 (__yy_memcpy):
22271 Declare arg `count' as unsigned int.
22272 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
22274 1997-04-22 Richard Stallman <rms@gnu.org>
22277 [__hpux]: Include alloca.h (right for HPUX 10)
22278 instead of declaring alloca (right for HPUX 9).
22280 * bison.simple (__yy_memcpy):
22281 Declare arg `count' as unsigned int.
22282 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
22284 1997-01-03 Richard Stallman <rms@gnu.org>
22286 * src/allocate.c: [__STDC__ or _MSC_VER]:
22287 Declare calloc and realloc to return void *.
22289 1997-01-02 Richard Stallman <rms@gnu.org>
22292 [_MSC_VER]: Include stdlib.h and process.h.
22293 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
22295 * src/main.c (main): Return FAILURE as a value.
22296 (printable_version): Declare arg as int, not char.
22298 1997-01-02 Richard Stallman <rms@gnu.org>
22300 * Makefile.in (dist):
22301 Explicitly check for symlinks, and copy them.
22303 1996-12-19 Richard Stallman <rms@gnu.org>
22306 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
22308 1996-12-18 Paul Eggert <eggert@gnu.org>
22310 * src/bison.s1 (yyparse):
22311 If __GNUC__ and YYPARSE_PARAM are both defined,
22312 declare yyparse to have a void * argument.
22314 1996-12-18 Paul Eggert <eggert@gnu.org>
22316 * bison.simple (yyparse):
22317 If __GNUC__ and YYPARSE_PARAM are both defined,
22318 declare yyparse to have a void * argument.
22320 1996-12-17 Richard Stallman <rms@gnu.org>
22322 * src/reduce.c (nbits): Add some casts.
22324 1996-08-12 Richard Stallman <rms@gnu.org>
22326 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
22328 1996-08-12 Richard Stallman <rms@gnu.org>
22330 * bison.simple: Test _MSDOS as well as _MSDOS_.
22332 1996-07-31 Richard Stallman <rms@gnu.org>
22335 [__sun && __i386]: Include alloca.h.
22337 1996-07-31 Richard Stallman <rms@gnu.org>
22340 [__sun && __i386]: Include alloca.h.
22342 1996-07-30 Richard Stallman <rms@gnu.org>
22344 * src/bison.s1: Comment change.
22346 * src/bison.s1: Test _MSDOS_, not MSDOS.
22348 1996-07-30 Richard Stallman <rms@gnu.org>
22350 * bison.simple: Comment change.
22352 * bison.simple: Test _MSDOS_, not MSDOS.
22354 1996-06-01 Richard Stallman <rms@gnu.org>
22356 * 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:
22357 Insert `_' macro around many string constants.
22360 Insert `_' macro around many string constants.
22362 (main): Call setlocale, bindtextdomain and textdomain.
22364 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
22365 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
22366 [ENABLE_NLS]: Include libintl.h.
22367 [ENABLE_NLS] (gettext): Define.
22368 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
22369 (N_, PACKAGE, LOCALEDIR): New macros.
22371 1996-06-01 Richard Stallman <rms@gnu.org>
22373 * POTFILES.in: New file.
22375 * Makefile.in (allocate.o):
22376 Define target explicitly.
22378 * Makefile.in (CFLAGS): Set to @CFLAGS@.
22379 (LDFLAGS): Set to @LDFLAGS@.
22380 (configure): Run autoconf only if preceding `cd' succeeds.
22381 (bison.s1): Redirect output to temporary file then move the
22382 temporary to the target, rather than redirecting directly to bison.s1.
22383 (clean): Remove config.status and config.log.
22384 (distclean): Don't remove config.status here.
22386 1996-05-12 Richard Stallman <rms@gnu.org>
22389 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
22391 1996-05-12 Richard Stallman <rms@gnu.org>
22394 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
22396 1996-05-11 Richard Stallman <rms@gnu.org>
22398 * src/bison.s1 (__yy_memcpy):
22399 Really reorder the args, as was supposedly done on Feb 14 1995.
22400 (yyparse): Calls changed accordingly.
22402 1996-05-11 Richard Stallman <rms@gnu.org>
22404 * Makefile.in (dist): Don't use $(srcdir).
22406 * bison.simple (__yy_memcpy):
22407 Really reorder the args, as was supposedly done on Feb 14 1995.
22408 (yyparse): Calls changed accordingly.
22410 1996-01-27 Richard Stallman <rms@gnu.org>
22412 * src/output.c (output_rule_data):
22413 Test YYERROR_VERBOSE in the conditional
22414 around the definition of ttyname.
22416 1995-12-29 Richard Stallman <rms@gnu.org>
22419 Fix line numbers in #line commands.
22421 1995-12-29 Richard Stallman <rms@gnu.org>
22424 Fix line numbers in #line commands.
22426 1995-12-27 Richard Stallman <rms@gnu.org>
22428 * src/bison.s1 (YYPARSE_PARAM_DECL):
22429 In C++, make it always null.
22430 (YYPARSE_PARAM_ARG): New macro.
22431 (yyparse): Use YYPARSE_PARAM_ARG.
22433 1995-12-27 Richard Stallman <rms@gnu.org>
22435 * bison.simple (YYPARSE_PARAM_DECL):
22436 In C++, make it always null.
22437 (YYPARSE_PARAM_ARG): New macro.
22438 (yyparse): Use YYPARSE_PARAM_ARG.
22440 1995-11-29 Richard Stallman <rms@gnu.org>
22442 * doc/bison.texinfo:
22443 Describe literal string tokens, %raw, %no_lines, %token_table.
22445 1995-11-29 Daniel Hagerty <hag@gnu.org>
22447 * doc/bison.texinfo: Fixed update date
22449 1995-10-16 Richard Stallman <rms@gnu.org>
22451 * src/version.c: Version 1.25.
22453 1995-10-16 Richard Stallman <rms@gnu.org>
22455 * NEWS: *** empty log message ***
22457 1995-10-16 Richard Stallman <rms@gnu.org>
22459 * doc/bison.1, doc/bison.rnh:
22462 1995-10-15 Richard Stallman <rms@gnu.org>
22464 * src/vmsgetargs.c, src/getargs.c:
22465 Added -n, -k, and -raw switches.
22466 (noparserflag, toknumflag, rawtoknumflag): New variables.
22468 * src/symtab.h (SALIAS):
22469 New #define for adding aliases to %token.
22470 (struct bucket): Added `alias' field.
22472 * src/reduce.c (reduce_grammar):
22473 Revise error message.
22474 (print_notices): Remove final `.' from error message.
22476 * src/reader.c (reader_output_yylsp):
22478 (readgram): Use `#if 0' around code that accepted %command
22479 inside grammar rules: The documentation doesn't allow it,
22480 and it will fail since the %command processors scan for the next %.
22481 (parse_token_decl): Extended the %token
22482 declaration to allow a multi-character symbol as an alias.
22483 (parse_thong_decl): New function.
22484 (read_declarations): Added %thong declarations.
22485 (read_declarations): Handle NOOP to deal with allowing
22486 % declarations as another means to specify the flags.
22487 (readgram): Allow %prec prior to semantics embedded in a rule.
22488 (skip_to_char, read_declarations, copy_definition)
22489 (parse_token_decl, parse_start_decl, parse_type_decl)
22490 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
22491 (get_type_name, copy_guard, copy_action, readgram)
22492 (get_type, packsymbols): Revised most error messages.
22493 Changed `fatal' to `warnxxx' to avoid aborting for error.
22494 Revised and use multiple warnxxx functions to avoid using VARARGS1.
22495 (read_declarations): Improve the error message for
22496 an invalid character. Do not abort.
22497 (read_declarations, copy_guard, copy_action): Use
22498 printable_version to avoid unprintable characters in printed output.
22499 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
22500 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
22501 Allow the type of a non-terminal can be given
22502 more than once, as long as all specifications give the same type.
22505 (output_headers, output_trailers, output, output_gram)
22506 (output_rule_data): Implement noparserflag variable.
22507 Implement toknumflag variable.
22508 (output): Call reader_output_yylsp to output LTYPESTR.
22510 * src/main.c (main):
22511 If reader sees an error, don't process the grammar.
22512 (fatals): Updated to not use VARARGS1.
22513 (printable_version, int_to_string, warn, warni, warns, warnss)
22514 (warnsss): New error reporting functions. Avoid abort for error.
22517 Added THONG and NOOP for alias processing.
22518 Added SETOPT for the new code that allows setting options with %flags.
22521 Include getopt.h. Add some extern decls.
22522 (safegetc): New function to deal with EOF gracefully.
22523 (literalchar); new function to deal with reading \ escapes.
22524 (lex): Use literalchar.
22525 (lex): Implemented "..." tokens.
22526 (literalchar, lex, parse_percent_token): Made tokenbuffer
22527 always contain the token. This includes growing the token
22528 buffer while reading an integer.
22529 (parse_percent_token): Replaced if-else statement with percent_table.
22530 (parse_percent_token): Added % declarations as another
22531 way to specify the flags -n, -l, and -r. Also added hooks for
22532 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
22533 major changes to files.c.
22534 (lex) Retain in the incoming stream a character following
22536 (skip_white_space, lex): Revised most error messages
22537 and changed fatal to warn to avoid aborting.
22538 (percent_table): Added %thong declarations.
22540 * src/gram.h: Comment changes.
22542 * src/files.c (openfiles, open_extra_files, done):
22544 and actfile file. Handle noparserflag. Both for -n switch.
22546 * src/conflicts.c (resolve_sr_conflict):
22547 Remove use of alloca.
22549 1995-06-01 Jim Meyering <meyering@gnu.org>
22551 * doc/bison.texinfo: *** empty log message ***
22553 1995-05-06 Richard Stallman <rms@gnu.org>
22555 * src/bison.s1: Comment change.
22557 1995-05-06 Richard Stallman <rms@gnu.org>
22559 * bison.simple: Comment change.
22561 1995-05-03 Richard Stallman <rms@gnu.org>
22563 * src/version.c: Version now 1.24.
22565 * src/bison.s1: Change distribution terms.
22567 * src/version.c: Version now 1.23.
22569 1995-05-03 Richard Stallman <rms@gnu.org>
22571 * doc/bison.texinfo:
22572 Rewrite "Conditions for Using Bison".
22573 Update version to 1.24.
22575 1995-05-03 Richard Stallman <rms@gnu.org>
22577 * bison.simple: Change distribution terms.
22579 1995-02-23 Richard Stallman <rms@gnu.org>
22581 * src/files.c: Test __VMS_POSIX as well as VMS.
22583 1995-02-14 Jim Meyering <meyering@gnu.org>
22585 * src/bison.s1 (__yy_memcpy):
22586 Renamed from __yy_bcopy to avoid
22587 confusion. Reverse FROM and TO arguments to be consistent with
22590 1995-02-14 Jim Meyering <meyering@gnu.org>
22592 * bison.simple (__yy_memcpy):
22593 Renamed from __yy_bcopy to avoid
22594 confusion. Reverse FROM and TO arguments to be consistent with
22597 1994-11-10 David J. MacKenzie <djm@gnu.org>
22603 * Makefile.in (DISTFILES): Include NEWS.
22605 * Makefile.in (DISTFILES):
22606 Include install-sh, not install.sh.
22608 * configure.in: Update to Autoconf v2 macro names.
22610 1994-10-05 David J. MacKenzie <djm@gnu.org>
22612 * Makefile.in: fix typo
22614 * Makefile.in (prefix, exec_prefix):
22615 Let configure set them.
22617 1994-09-28 David J. MacKenzie <djm@gnu.org>
22619 * Makefile.in: Set datadir to $(prefix)/share.
22621 1994-09-15 Richard Stallman <rms@gnu.org>
22624 Update copyright notice and GPL version.
22626 1994-09-15 Richard Stallman <rms@gnu.org>
22629 Update copyright notice and GPL version.
22631 1994-07-12 Richard Stallman <rms@gnu.org>
22633 * src/reduce.c, src/reader.c:
22636 1994-05-05 David J. MacKenzie <djm@gnu.org>
22638 * Makefile.in: entered into RCS
22640 1994-03-26 Richard Stallman <rms@gnu.org>
22642 * src/bison.s1: entered into RCS
22644 1994-03-26 Richard Stallman <rms@gnu.org>
22646 * bison.simple: entered into RCS
22648 1994-03-25 Richard Stallman <rms@gnu.org>
22650 * src/main.c: entered into RCS
22652 1994-03-24 Richard Stallman <rms@gnu.org>
22654 * src/conflicts.c: entered into RCS
22656 1994-01-02 Richard Stallman <rms@gnu.org>
22658 * Makefile.in: *** empty log message ***
22660 1993-11-21 Richard Stallman <rms@gnu.org>
22662 * src/bison.s1: *** empty log message ***
22664 1993-11-21 Richard Stallman <rms@gnu.org>
22666 * doc/bison.texinfo: entered into RCS
22668 * doc/bison.texinfo: *** empty log message ***
22670 1993-11-21 Richard Stallman <rms@gnu.org>
22672 * bison.simple: *** empty log message ***
22674 1993-10-25 David J. MacKenzie <djm@gnu.org>
22676 * doc/bison.texinfo: *** empty log message ***
22678 1993-10-19 Richard Stallman <rms@gnu.org>
22680 * src/bison.s1: *** empty log message ***
22682 1993-10-19 Richard Stallman <rms@gnu.org>
22684 * bison.simple: *** empty log message ***
22686 1993-10-14 Richard Stallman <rms@gnu.org>
22688 * src/bison.s1: *** empty log message ***
22690 1993-10-14 Richard Stallman <rms@gnu.org>
22692 * bison.simple: *** empty log message ***
22694 1993-09-14 David J. MacKenzie <djm@gnu.org>
22696 * doc/bison.texinfo: *** empty log message ***
22698 1993-09-13 Noah Friedman <friedman@gnu.org>
22700 * Makefile.in: *** empty log message ***
22702 1993-09-10 Richard Stallman <rms@gnu.org>
22704 * src/conflicts.c: *** empty log message ***
22706 * src/system.h: entered into RCS
22708 1993-09-10 Richard Stallman <rms@gnu.org>
22710 * doc/bison.1: entered into RCS
22712 1993-09-06 Noah Friedman <friedman@gnu.org>
22714 * src/version.c: entered into RCS
22716 1993-09-06 Noah Friedman <friedman@gnu.org>
22718 * Makefile.in: *** empty log message ***
22720 1993-07-30 David J. MacKenzie <djm@gnu.org>
22722 * Makefile.in: *** empty log message ***
22724 1993-07-24 Richard Stallman <rms@gnu.org>
22726 * src/bison.s1: *** empty log message ***
22728 1993-07-24 Richard Stallman <rms@gnu.org>
22730 * bison.simple: *** empty log message ***
22732 1993-07-08 David J. MacKenzie <djm@gnu.org>
22734 * Makefile.in: *** empty log message ***
22736 1993-07-04 Richard Stallman <rms@gnu.org>
22738 * src/bison.s1: *** empty log message ***
22740 1993-07-04 Richard Stallman <rms@gnu.org>
22742 * bison.simple: *** empty log message ***
22744 1993-06-26 David J. MacKenzie <djm@gnu.org>
22746 * src/getargs.c: entered into RCS
22748 1993-06-26 David J. MacKenzie <djm@gnu.org>
22750 * doc/bison.texinfo: *** empty log message ***
22752 * doc/bison.1: New file.
22754 1993-06-25 Richard Stallman <rms@gnu.org>
22756 * src/getargs.c: New file.
22758 1993-06-16 Richard Stallman <rms@gnu.org>
22760 * src/bison.s1: *** empty log message ***
22762 1993-06-16 Richard Stallman <rms@gnu.org>
22764 * bison.simple: *** empty log message ***
22766 1993-06-03 Richard Stallman <rms@gnu.org>
22768 * src/bison.s1: New file.
22770 1993-06-03 Richard Stallman <rms@gnu.org>
22772 * doc/bison.texinfo: *** empty log message ***
22774 1993-06-03 Richard Stallman <rms@gnu.org>
22776 * bison.simple: New file.
22778 1993-05-19 Richard Stallman <rms@gnu.org>
22780 * doc/bison.texinfo: New file.
22782 1993-05-07 Noah Friedman <friedman@gnu.org>
22784 * Makefile.in: *** empty log message ***
22786 1993-04-28 Noah Friedman <friedman@gnu.org>
22788 * src/reader.c: *** empty log message ***
22790 1993-04-23 Noah Friedman <friedman@gnu.org>
22792 * src/alloc.h: entered into RCS
22794 1993-04-20 David J. MacKenzie <djm@gnu.org>
22796 * src/version.c: *** empty log message ***
22798 * src/files.c, src/allocate.c:
22801 * src/reader.c: *** empty log message ***
22803 * src/lex.c: entered into RCS
22805 * src/conflicts.c: New file.
22807 * src/symtab.c: entered into RCS
22809 * src/alloc.h: New file.
22811 * src/LR0.c: entered into RCS
22813 1993-04-18 Noah Friedman <friedman@gnu.org>
22815 * src/reader.c: New file.
22817 * src/version.c: *** empty log message ***
22819 1993-04-18 Noah Friedman <friedman@gnu.org>
22821 * Makefile.in: *** empty log message ***
22823 1993-04-17 Noah Friedman <friedman@gnu.org>
22825 * Makefile.in: *** empty log message ***
22827 1993-04-15 Richard Stallman <rms@gnu.org>
22829 * src/main.c, src/files.c:
22832 1993-04-15 Noah Friedman <friedman@gnu.org>
22834 * configure.in: entered into RCS
22836 * configure.in: *** empty log message ***
22838 * configure.in: New file.
22840 1993-04-14 Richard Stallman <rms@gnu.org>
22842 * Makefile.in: New file.
22844 1993-04-13 Richard Stallman <rms@gnu.org>
22846 * src/version.c: New file.
22848 1993-03-25 Richard Stallman <rms@gnu.org>
22850 * src/output.c: entered into RCS
22852 1992-09-25 Richard Stallman <rms@gnu.org>
22854 * configure.bat: entered into RCS
22856 1992-06-22 Richard Stallman <rms@gnu.org>
22858 * src/vmsgetargs.c: entered into RCS
22860 1992-06-22 Richard Stallman <rms@gnu.org>
22862 * doc/bison.rnh: entered into RCS
22864 1992-04-20 David J. MacKenzie <djm@gnu.org>
22866 * README: entered into RCS
22868 1992-01-22 Richard Stallman <rms@gnu.org>
22870 * src/machine.h: entered into RCS
22872 1991-12-21 Richard Stallman <rms@gnu.org>
22874 * src/lalr.c, src/closure.c:
22877 1991-12-20 Richard Stallman <rms@gnu.org>
22879 * src/state.h: entered into RCS
22881 1991-12-18 Richard Stallman <rms@gnu.org>
22883 * src/print.c, src/nullable.c, src/derives.c:
22886 1991-11-03 David J. MacKenzie <djm@gnu.org>
22888 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
22891 1988-09-09 Richard Stallman <rms@gnu.org>
22893 * src/bison.hairy: entered into RCS
22895 1987-12-16 Richard Stallman <rms@gnu.org>
22897 * REFERENCES: entered into RCS
22902 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
22903 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
22904 Free Software Foundation, Inc.
22906 Copying and distribution of this file, with or without
22907 modification, are permitted provided the copyright notice and this
22908 notice are preserved.