1 2010-01-19 Joel E. Denny <jdenny@clemson.edu>
3 * bootstrap: Import improvements from latest gnulib.
5 2010-01-19 Joel E. Denny <jdenny@clemson.edu>
7 build: require Automake 1.11.1 to avoid a security flaw.
8 * HACKING (Release Procedure): Don't document Automake security
10 * configure.ac (AM_INIT_AUTOMAKE): Require 1.11.1, and explain
13 2010-01-19 Joel E. Denny <jdenny@clemson.edu>
15 gnulib: update to latest.
17 2010-01-19 Joel E. Denny <jdenny@clemson.edu>
19 ChangeLog (2006-09-15): add Odd Arild Olsen's role for push.c.
21 2010-01-15 Joel E. Denny <jdenny@clemson.edu>
23 Thank the developer of the initial push parser implementation.
24 This unfortunate oversight is several years old.
25 * THANKS (Odd Arild Olsen): Add.
27 2010-01-04 Joel E. Denny <jdenny@clemson.edu>
29 Fix some comments concerning LR(0) versus LALR(1).
31 Stop equating LR(0) with nondeterminism and LALR(1) with
32 determinism. That is, if all states are consistent, then LR(0)
33 tables are deterministic. On the other hand, LALR(1) tables
34 might be nondeterministic before conflict resolution, and GLR
35 permits LALR(1) tables to remain nondeterministic.
36 * src/LR0.c, src/LR0.h: Here.
37 * src/lalr.c, src/lalr.h: Here.
38 * src/main.c (main): Here.
39 * src/state.c, src/state.h: Here.
41 * src/ielr.h (ielr): In preconditions, expect LR(0) not LALR(1)
44 2010-01-04 Joel E. Denny <jdenny@clemson.edu>
46 maint: run "make update-copyright"
48 2009-12-30 Joel E. Denny <jdenny@clemson.edu>
50 POSIX: complain if %prec's token was not defined.
51 * NEWS (2.5): Document.
52 * src/reader.c (grammar_rule_check): Convert warning to
54 * tests/input.at (%prec's token must be defined): Update.
56 2009-12-30 Joel E. Denny <jdenny@clemson.edu>
58 POSIX: warn if %prec's token was not defined.
59 Reported by Florian Krohm at
60 <http://lists.gnu.org/archive/html/bug-bison/2009-12/msg00005.html>.
61 * NEWS (2.4.2): Document.
62 * src/reader.c (grammar_rule_check): Implement.
63 (grammar_current_rule_prec_set): Add comments explaining that we
64 here assume a %prec identifier is a token, but we still manage
66 * tests/input.at (%prec's token must be defined): New test
69 2009-12-31 Joel E. Denny <jdenny@clemson.edu>
71 * HACKING (Release Procedure): Recommend a secure automake.
73 2009-12-29 Joel E. Denny <jdenny@clemson.edu>
75 portability: `<' and `>' are not always defined on addresses.
76 Specifically, don't sort objects by their memory addresses when
77 they're not allocated in the same array or other object. Though
78 I haven't found a test case where that fails on my platform, C
79 says the behavior is undefined.
80 * src/AnnotationList.c (AnnotationList__insertInto): Remove
81 FIXME. Use new id field of InadequacyList nodes rather than
82 their memory addresses when sorting.
83 (AnnotationList__compute_from_inadequacies): Add
84 inadequacy_list_node_count argument to pass to
85 InadequacyList__new_conflict.
86 * src/AnnotationList.h
87 (AnnotationList__compute_from_inadequacies): Update prototype
88 and documentation for new argument.
89 * src/InadequacyList.c (InadequacyList__new_conflict): Add
90 node_count argument and use it to assign a unique ID.
91 * src/InadequacyList.h (InadequacyListNodeCount): New typedef.
92 (InadequacyList): Add id field.
93 (InadequacyList__new_conflict): Update prototype and
94 documentation for new argument.
95 * src/ielr.c (ielr_compute_annotation_lists): Update
96 AnnotationList__compute_from_inadequacies invocation.
98 2009-12-20 Joel E. Denny <jdenny@clemson.edu>
100 Fix handling of yychar manipulation in user semantic actions.
101 The problem was that yacc.c didn't always update the yychar
102 translation afterwards. However, other skeletons appear to be
103 fine. glr.c appears to already translate yychar before every
104 use. lalr1.cc does not define yychar and does not document its
105 replacement, yyla, for users. It does provide yyclearin, but
106 that does not manipulate yyla and thus requires no translation
107 update. In lalr1.java, yychar is out of scope during semantic
109 * NEWS (2.5): Document.
110 * data/yacc.c (YYBACKUP): Don't bother translating yychar into
112 (yyparse, yypush_parse): Instead, translate before every use of
113 yytoken, and add comments explaining this approach.
114 * tests/actions.at (Destroying lookahead assigned by semantic
115 action): New test group checking that translation happens before
116 lookahead destructor calls at parser return. Previously,
117 incorrect destructors were called.
118 * tests/conflicts.at (parse.error=verbose and consistent
119 errors): New test group checking that translation happens at
120 syntax error detection before the associated verbose error
121 message and the associated lookahead destructor calls. While
122 the destructor call is fixed by this patch, the verbose error
123 message is currently incorrect due to another bug (see
124 comments in test group), so this is an expected failure for now.
126 2009-12-21 Joel E. Denny <jdenny@clemson.edu>
128 YYFAIL: warn about uses and remove from lalr1.java.
129 * NEWS (2.5): Document.
130 * data/lalr1.java (parser::YYStack::YYFAIL): Rename to YYERRLAB,
131 and make it private. Update all uses.
132 * src/scan-code.l (SC_RULE_ACTION): Implement warning.
134 2009-12-21 Joel E. Denny <jdenny@clemson.edu>
137 * NEWS (2.4.2): Document deprecation and the phase-out plan.
138 * data/lalr1.java (parser::YYStack::YYFAIL): Add comment about
140 * data/yacc.c (YYFAIL): Likewise, and suppress warnings about
141 YYFAIL from GCC cpp's -Wunused-macros.
142 * doc/bison.texinfo (Java Action Features): Remove YYFAIL
144 (LocalWords): Remove YYFAIL.
146 2009-12-20 Joel E. Denny <jdenny@clemson.edu>
149 * tests/c++.at (Syntax error discarding no lookahead): Don't
150 ignore stderr. Instead, eliminate remaining warnings.
152 2009-12-18 Joel E. Denny <jdenny@clemson.edu>
154 lalr1.cc: don't discard non-existent lookahead on syntax error.
155 * data/lalr1.cc (parser::parse): Check yyempty first.
156 * tests/c++.at (Syntax error discarding no lookahead): New test
159 2009-12-17 Joel E. Denny <jdenny@clemson.edu>
162 * src/symtab.c, src/symtab.h (symbol_class_get_string): Remove
163 function, which is no longer used.
165 2009-12-16 Joel E. Denny <jdenny@clemson.edu>
167 Add gcc's -Wundef to test suite and fix another warning from it.
168 * NEWS (2.4.2): Update description of -Wundef fix.
169 * configure.ac (WARN_CXXFLAGS_TEST): New substitution.
170 (WARN_CFLAGS_TEST): New substitution.
171 * data/glr.c: Avoid warning about __STRICT_ANSI__.
172 * tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
174 (NO_WERROR_CFLAGS): Likewise.
175 (CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
177 2009-12-16 Joel E. Denny <jdenny@clemson.edu>
179 * data/yacc.c: Reformat m4 a little.
181 2009-12-16 Joel E. Denny <jdenny@clemson.edu>
183 Document gcc -Wundef fix.
184 * NEWS (2.4.2): Here.
185 * THANKS (Jonathan Nieder): Add.
187 2009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
189 Simplify y.tab.c when location tracking is disabled.
190 * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location
191 tracking is not enabled. Instead, unconditionally define
192 YY_LOCATION_PRINT as a no-op for backward compatibility.
194 2009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
196 Avoid warnings from gcc -Wundef y.tab.c.
197 * data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
198 defined before using them.
199 * data/lalr1.cc: Likewise.
200 * data/yacc.c: Likewise.
202 2009-12-15 Joel E. Denny <jdenny@clemson.edu>
204 autoconf: update to latest for fix of M4 detection.
205 Reported by Eric Blake.
206 * submodules/autoconf: Update.
208 2009-12-15 Joel E. Denny <jdenny@clemson.edu>
210 portability: use -DGNULIB_POSIXCHECK.
211 Reported by Eric Blake. See discussions at
212 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html>
214 <http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html>.
215 * HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
216 * bootstrap.conf (gnulib_modules): Add all the printf modules
217 suggested by -DGNULIB_POSIXCHECK. Add realloc-posix as
218 suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
219 (excluded_files): Remove m4/printf-posix.m4.
220 * tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
221 lib/libbison.a so gnulib libraries can be linked.
223 2009-12-15 Joel E. Denny <jdenny@clemson.edu>
225 gnulib: update for fix of fprintf-posix, which we'll use soon.
226 * etc/prefix-gnulib-mk (prefix): Adjust regex for make file
227 targets so that gnulib's new arg-nonnull.h and link-warning.h
231 2009-12-14 Joel E. Denny <jdenny@clemson.edu>
233 Enable assertion output and --disable-assert for configure.
234 * bootstrap.conf (gnulib_modules): Add assert module.
235 * src/system.h (aver): Define as assert, and summarize the
236 discussion on this issue.
238 2009-12-14 Joel E. Denny <jdenny@clemson.edu>
240 Expand GLR acronym in summary of Bison.
241 Based on discussion with Akim Demaille starting at
242 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html>.
243 * doc/bison.texinfo (Introduction): Here.
244 * src/getargs.c (usage): Here.
246 2009-10-03 Alex Rozenman <rozenman@gmail.com>
248 Document named references.
249 * doc/bison.texinfo (Actions): Add new example and xref to
250 Using Named References node.
251 (Using Named References): New node.
253 2009-10-16 Joel E. Denny <jdenny@clemson.edu>
256 * src/Sbitset.c (Sbitset__new_on_obstack): Use Sbitset instead
258 (Sbitset__isEmpty): Use Sbitset instead of char*.
259 * src/Sbitset.h (Sbitset): Make it a pointer to unsigned char
260 instead of char. This helps to avoid casting errors.
261 (Sbitset__or): Use Sbitset instead of char*.
263 2009-10-16 Joel E. Denny <jdenny@clemson.edu>
265 portability: don't assume 8-bit bytes.
266 That is, use CHAR_BIT and UCHAR_MAX instead of 8 and 0xff.
267 * src/Sbitset.h (Sbitset__nbytes): Here.
268 (Sbitset__byteAddress): Here.
269 (Sbitset__bit_mask): Here.
270 (Sbitset__last_byte_mask): Here.
271 (Sbitset__ones): Here.
272 (SBITSET__FOR_EACH): Here.
274 2009-10-11 Joel E. Denny <jdenny@clemson.edu>
276 portability: use va_start and va_end in the same function.
277 * src/complain.c (error_message): Move va_end from here...
278 (ERROR_MESSAGE): ... to here.
280 2009-10-08 Joel E. Denny <jdenny@clemson.edu>
282 * data/bison.m4: Update comments for rename to muscle-tab.h.
284 2009-10-07 Joel E. Denny <jdenny@clemson.edu>
287 * src/muscle-tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and
288 replace all uses with UNIQSTR_CONCAT.
289 * src/uniqstr.c (uniqstr_vsprintf): New function.
290 * src/uniqstr.h (uniqstr_vsprintf): Add prototype.
291 (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New
294 2009-10-06 Joel E. Denny <jdenny@clemson.edu>
296 * TODO (Complaint submessage indentation): New.
298 2009-10-04 Joel E. Denny <jdenny@clemson.edu>
301 * src/parse-gram.y: Clean up sorting of declarations.
302 Use types to simplify %printer declarations where possible.
303 Provide %printer for BRACKETED_ID and symbol.prec.
304 * src/symtab.c: Whitespace change.
306 2009-10-04 Joel E. Denny <jdenny@clemson.edu>
308 tests: skip tests of file names that platform does not support.
309 Reported by Michael Raskin at
310 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
311 * THANKS (Michael Raskin): Add.
312 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used
313 to fail at least for file names containing ":" or "\".
315 2009-09-23 Joel E. Denny <jdenny@clemson.edu>
317 yysyntax_error: avoid duplicate lookahead collection.
318 Except when memory reallocation is required, this change
319 eliminates the need to invoke yysyntax_error twice and thus to
320 repeat the collection of lookaheads. It also prepares for
321 future extensions that will make those repetitions more
322 expensive and that will require additional memory management in
323 yysyntax_error. Finally, it fixes an obscure bug already
324 exercised in the test suite.
325 * data/yacc.c (yysyntax_error): Add arguments for message
326 buffer variables stored in the parser. Instead of size, return
327 status similar to yyparse status but indicating success of
328 message creation. Other than the actual reallocation of the
329 message buffer, import and clean up memory management code
331 (yyparse, yypush_parse): ... here.
332 * tests/regression.at (parse.error=verbose overflow): No longer
335 2009-09-23 Joel E. Denny <jdenny@clemson.edu>
337 yysyntax_error: test memory management more.
338 * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro.
339 * tests/regression.at (parse.error=verbose and
340 YYSTACK_USE_ALLOCA): New test group.
341 (parse.error=verbose overflow): New test group that reveals an
342 obscure bug. Expected fail for now.
344 2009-10-04 Joel E. Denny <jdenny@clemson.edu>
346 benchmarks: use %debug consistently among grammars.
347 * etc/bench.pl.in (generate_grammar_triangular): Do not activate
348 %debug by default. It can affect the timings even if yydebug=0.
349 (generate_grammar_calc): For consistency with other grammars,
350 use YYDEBUG environment variable to set yydebug.
352 2009-10-03 Joel E. Denny <jdenny@clemson.edu>
355 * src/symtab.c (symbol_pack): Here because every symbol's number
356 is always defined by this time.
358 2009-10-03 Alex Rozenman <rozenman@gmail.com>
360 Add additional space after periods in NEWS.
363 2009-09-29 Joel E. Denny <jdenny@clemson.edu>
365 Use the correct conversion specifier for size_t.
366 Reported by Jim Meyering.
367 * src/Sbitset.h (SBITSET__INDEX__CONVERSION_SPEC): New, "zu"
368 because Sbitset__Index is size_t.
369 * src/Sbitset.c (Sbitset__fprint): Use it instead of %d.
371 2009-09-27 Joel E. Denny <jdenny@clemson.edu>
373 tests: don't abuse AT_BISON_CHECK.
374 * tests/regression.at (parse-gram.y: LALR = IELR): Move
375 additional shell commands outside of AT_BISON_CHECK.
377 2009-09-26 Joel E. Denny <jdenny@clemson.edu>
379 tests: check that parse-gram.y's IELR and LALR are identical.
380 * tests/atlocal.in (abs_top_srcdir): New shell variable.
381 * tests/regression.at (parse-gram.y: LALR = IELR): New test
384 2009-09-19 Alex Rozenman <rozenman@gmail.com>
386 Keep sub-messages aligned. Fix strings for translation.
387 * src/location.h (location_print): Add return value.
388 * src/location.c (location_print): Return number of printed
390 * src/complain.h (complain_at_indent, warn_at_indent): Prototype
392 * src/complain.cpp (indent_ptr): New static variable.
393 (error_message, complain_at_indent, warn_at_indent): Implement
394 the alignment mechanism.
395 * src/scan-code.l (parse_ref, show_sub_messages): Fix strings
396 for translations. Use new alignment mechanism.
397 * tests/named-ref.at: Adjust test-cases.
398 * NEWS (2.5): Add an announcement about named references.
400 2009-09-17 Akim Demaille <demaille@gostai.com>
403 * doc/bison.texinfo: here.
404 Reported by Alex Rozenman.
406 2009-09-16 Akim Demaille <demaille@gostai.com>
408 doc: lalr1.cc and variants.
409 * doc/bison.texinfo (Decl Summary): Document the "lex_symbol" and
410 "variant" %define variables.
411 (C++ Semantic Values): Split into...
412 (C++ Unions, C++ Variants): these.
414 (C++ Parser Interface): Fix type names.
415 Document parser::syntax_error.
416 Document the fact that locations are not mandatory.
417 (C++ Scanner Interface): Split into...
418 (Split Symbols, Complete Symbols): these.
420 (Calc++ Parsing Driver): Use variants.
423 (Calc++ Parser): Declare all the tokens, no
424 longer accept raw characters.
426 Adjust types and printers.
428 (Calc++ Scanner): Use make_<SYMBOL> functions.
429 Use strerror in error message.
431 2009-09-16 Akim Demaille <demaille@gostai.com>
434 * doc/bison.texinfo: here.
436 2009-09-16 Akim Demaille <demaille@gostai.com>
438 doc: comment changes.
439 * doc/bison.texinfo: Comment changes.
441 2009-09-16 Akim Demaille <demaille@gostai.com>
443 lalr1.cc: factor the yytranslate_ invocation in make_SYMBOLS.
444 * data/c++.m4, data/lalr1.cc (parser::symbol_type): Change the
445 constructor to take a token_type instead of the (internal) symbol
448 * data/variant.hh (b4_symbol_constructor_define_): Therefore,
449 don't call yytranslate_ here.
451 2009-09-16 Akim Demaille <demaille@gostai.com>
454 * TODO (Figures): New.
456 2009-09-13 Joel E. Denny <jdenny@clemson.edu>
458 tests: clean up push.at test group titles.
459 * tests/push.at: Remove "Push Parsing: " from test group titles
460 because these are already under the banner "Push Parsing Tests".
462 2009-09-12 Alex Rozenman <rozenman@gmail.com>
464 Provide an additional sub-message for clarity.
465 Add "symbol not found in production" error message when
466 an "invalid reference" is detected in named references
468 * src/scan-code.l: Update "invalid reference" case.
469 * tests/named-ref.at: Adjust test-cases.
471 2009-09-10 Joel E. Denny <jdenny@clemson.edu>
473 Clean up yacc.c a little.
474 * data/yacc.c: Clean up M4 for readability, and make output
475 whitespace more consistent. For the main parse function
476 comment, instead of saying "yyparse or yypush_parse", say either
477 "yyparse" or "yypush_parse" depending on which it actually is.
479 2009-09-10 Joel E. Denny <jdenny@clemson.edu>
481 Fix --enable-gcc-warnings.
482 * src/parse-gram.y (%printer <param>): Handle param_none.
484 2009-09-09 Akim Demaille <demaille@gostai.com>
486 lalr1.cc: syntax_error as exceptions.
487 It is common to use sort of factories in the user actions. These
488 factories may check some "syntactic" constraints that are not
489 enforced by the grammar itself. This is possible using YYERROR
490 within the action itself. Provide the user with a means to throw
491 a syntax_error exception.
493 * data/c++.m4 (b4_public_types_declare, b4_public_types_define):
494 Declare and define yy::parser::syntax_error.
495 * data/lalr1.cc: Include stdexcept.
496 (yy::parser::parse): Wrap the user action within a try/catch.
497 * data/glr.cc: Include stdexcept.
499 2009-09-09 Akim Demaille <demaille@gostai.com>
501 lalr1.cc: add missing "inline".
502 * data/c++.m4 (b4_public_types_define): Add missing inline to
503 implementations provided in headers.
505 2009-09-09 Akim Demaille <demaille@gostai.com>
507 %param: documentation.
508 * NEWS (2.6): Document %param, %lex-param, and %parse-param
510 * doc/bison.texinfo: Document that %lex-param and %parse-param
512 Changes some examples to demonstrate it.
513 (Calc++ Parser): Use %param.
515 2009-09-09 Akim Demaille <demaille@gostai.com>
519 2009-09-09 Akim Demaille <demaille@gostai.com>
522 * src/parse-gram.y (add_param): Scope changes.
524 2009-09-09 Akim Demaille <demaille@gostai.com>
526 %parse: support several arguments.
527 * src/parse-gram.y (current_param): New.
528 (param_type): Add param_none.
529 (params): New nonterminal.
532 2009-09-09 Akim Demaille <demaille@gostai.com>
536 2009-09-09 Akim Demaille <demaille@gostai.com>
539 Provide a means to factor lex-param and parse-param common
542 * src/parse-gram.y (param_type): New.
543 Define a %printer for it.
545 (%parse-param, %lex-param): Merge into...
546 (%parse): this new token.
547 Adjust the grammar to use it.
548 * src/scan-gram.l (RETURN_VALUE): New.
549 (RETURN_PERCENT_FLAG): Use it.
550 (RETURN_PERCENT_PARAM): New.
551 Use it to support %parse-param, %lex-param and %param.
553 2009-09-03 Joel E. Denny <jdenny@clemson.edu>
556 * src/output.c: Don't include assert.h.
557 (output_skeleton): Use aver not assert.
558 * src/system.h (aver): In documentation of why, add links to
559 Paul Eggert's explanations in the mailing lists.
561 2009-09-05 Alex Rozenman <rozenman@gmail.com>
563 Use "Unresolved reference" error message when no symbols were found
564 in a symbolic reference resolution. Remove .expr and -expr from
565 the shown reference when the reference is unresolved.
566 * src/scan-code.l: Change the error message, adjust location columns,
567 rename variable "exact_mode" to "explicit_bracketing".
568 * tests/named-ref.at: Adjust existing tests and add a new one.
570 2009-09-04 Akim Demaille <demaille@gostai.com>
572 Adjust synclines in src/parse-gram.[ch].
573 * tests/bison.in: Do some magic (including working around issues
574 with ylwrap) when this wrapper is used to compile
577 2009-09-03 Joel E. Denny <jdenny@clemson.edu>
579 Complain about unused %define variables and %code qualifiers.
580 * NEWS (2.5): Document.
581 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
582 * doc/bison.texinfo (Decl Summary): Document complaint, and
583 improve %define documentation a little otherwise.
584 * tests/input.at (Reject unused %code qualifiers): Update.
585 (%define errors): Update.
586 (%define, --define, --force-define): Update.
587 (%define backward compatibility): Update.
588 (Unused %define api.pure): Update.
589 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
591 2009-09-03 Joel E. Denny <jdenny@clemson.edu>
593 Don't suppress warnings about unused parse.error.
594 * data/bison.m4 (b4_error_verbose_flag): Don't examine value of
595 %define variable parse.error unless b4_error_verbose_flag is
596 actually expanded in a skeleton.
598 2009-09-03 Akim Demaille <demaille@gostai.com>
600 * NEWS (2.4.2): Add "Internationalization" item.
602 2009-09-03 Akim Demaille <demaille@gostai.com>
604 bootstrap: fix/improve find_tool.
605 * bootstrap (find_tool): Improve error messages.
606 Fix typo about find_tool_names.
608 2009-08-29 Joel E. Denny <jdenny@clemson.edu>
610 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
612 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
613 * src/scan-code.h (code_props_rule_action_init): Rename
614 named_ref arg to name so it doesn't shadow named_ref type. This
615 makes it consistent with the function definition in scan-code.l
618 2009-08-28 Joel E. Denny <jdenny@clemson.edu>
620 %define: accept unquoted values.
621 * NEWS (2.5): Group all %define changes together, and document
622 this one. Remove quotes in IELR and canonical LR entry.
623 * doc/bison.texinfo: Remove quotes in most examples throughout.
624 (Decl Summary): Update %define documentation.
625 (Table of Symbols): Likewise.
626 * src/ielr.c (LrType): Update documentation.
627 * src/parse-gram.y (content.opt): Add production for ID.
628 * tests/actions.at: Remove quotes in most tests.
629 * tests/calc.at: Likewise.
630 * tests/existing.at: Likewise.
631 * tests/input.at: Likewise.
632 * tests/local.at: Likewise.
633 * tests/push.at: Likewise.
634 * tests/reduce.at: Likewise.
635 * tests/torture.at: Likewise.
637 2009-08-28 Joel E. Denny <jdenny@clemson.edu>
639 %define lr.type: make values lowercase IDs.
640 That is, "LALR" => "lalr", "IELR" => "ielr", and
641 "canonical LR" => "canonical-lr".
642 * NEWS (2.5): Update documentation.
643 * doc/bison.texinfo (Decl Summary): Likewise.
644 * src/ielr.c (ielr): Use new values.
645 * src/ielr.h (ielr): Update documentation.
646 * src/reader.c (prepare_percent_define_front_end_variables): Use
647 and validate new values.
648 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
650 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
652 2009-08-27 Eric Blake <ebb9@byu.net>
654 scan-gram: avoid portability trap with ctype usage.
655 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
656 Avoid compiler warning.
658 2009-08-27 Joel E. Denny <jdenny@clemson.edu>
660 tests: use perl for printing special sequences to files.
661 And skip tests if perl is not available. This is better than
662 playing tricks with shell portability. Suggested by Akim
664 * tests/input.at (Bad character literals): Use it here for
665 omitting final newlines.
666 (Bad escapes in literals): Use it here for special characters.
668 2009-08-26 Joel E. Denny <jdenny@clemson.edu>
670 tests: show a use of %define lr.default-reductions "consistent"
671 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
672 prevents the omission of expected tokens for %error-verbose.
674 2009-08-26 Akim Demaille <demaille@gostai.com>
676 tests: portability fix.
677 * tests/input.at (Bad escapes in literals): Don't expect "echo
678 '\0'" to output \ then 0.
680 2009-08-26 Joel E. Denny <jdenny@clemson.edu>
682 Actually handle the yytable zero value correctly this time.
683 * data/bison.m4 (b4_integral_parser_tables_map): Don't mention
684 zero values in the YYTABLE comments.
685 * data/glr.c (yytable_value_is_error): Don't check for zero
687 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
688 * data/yacc.c (yytable_value_is_error): Likewise.
689 * data/lalr1.java (yy_table_value_is_error_): Likewise.
690 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
691 * src/tables.h: In header comments, explain why it's useless to
692 check for a zero value in yytable.
694 2009-08-25 Joel E. Denny <jdenny@clemson.edu>
696 More fixes related to last two patches.
697 * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE
698 comments: zero indicates syntax error not default action.
699 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
701 * data/glr.c (yyis_pact_ninf): Rename to...
702 (yypact_value_is_default): ... this.
703 (yyisDefaultedState): Update for rename.
704 (yyis_table_ninf): Rename to...
705 (yytable_value_is_error): ... this, and check for value zero
706 besides just YYTABLE_NINF.
707 (yygetLRActions): Check for default value from yypact. It
708 appears that this check is always performed before this function
709 is invoked, and so adding the check here is probably redundant.
710 However, the code may evolve after this subtlety is forgotten.
711 Also, update for rename to yytable_value_is_error. Because that
712 macro now checks for zero, a different but equivalent branch of
713 the if-then-else here is evaluated.
714 (yyreportSyntaxError): Update for rename to
715 yytable_value_is_error. The zero condition was mishandled
717 (yyrecoverSyntaxError): Update for renames. No behavioral
719 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
721 (yy_table_value_is_error_): New function.
722 (parse): Use new functions where possible. No behavioral
724 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
725 The zero condition was mishandled before.
726 * data/yacc.c (yyis_pact_ninf): Rename to...
727 (yypact_value_is_default): ... this.
728 (yyis_table_ninf): Rename to...
729 (yytable_value_is_error): ... this, and check for value zero
730 besides just YYTABLE_NINF.
731 (yysyntax_error): Update for rename to yytable_value_is_error.
732 The zero condition was mishandled before.
733 (yyparse): Update for renames. No behavioral changes.
734 * src/tables.h: Improve comments about yypact, yytable, etc.
735 more. Most importantly, say yytable value of zero means syntax
736 error not default action.
738 2009-08-25 Joel E. Denny <jdenny@clemson.edu>
740 Fix %error-verbose for conflicts resolved by %nonassoc.
741 * NEWS (2.5): Document.
742 * data/glr.c (yyreportSyntaxError): Fix this by checking
744 * data/yacc.c (yysyntax_error): Likewise.
745 * data/lalr1.cc (yysyntax_error_): Fix this by checking
747 * data/lalr1.java (yysyntax_error): Likewise.
748 * tests/conflicts.at (%nonassoc and eof): Update expected output
751 2009-08-25 Joel E. Denny <jdenny@clemson.edu>
753 Some code and documentation improvements.
754 * data/c.m4 (b4_table_value_equals): New macro to capture
756 * data/glr.c (yyis_pact_ninf): Use it here.
757 (yyis_table_ninf): Likewise.
758 (yyreportSyntaxError): Improve internal comments.
759 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
760 Use it everywhere possible.
761 (yyis_table_ninf): Likewise.
762 (yysyntax_error): Improve internal comments.
763 * data/lalr1.cc (yysyntax_error_): Likewise.
764 * data/lalr1.java (yysyntax_error): Likewise.
765 * src/tables.h: Improve comments about yypact, yytable, etc.
767 2009-08-21 Joel E. Denny <jdenny@clemson.edu>
769 Use locale when quoting.
770 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
771 quote rather than implementing quoting here.
773 2009-08-20 Eric Blake <ebb9@byu.net>
775 Make previous patch more robust.
776 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
778 (output_skeleton): Use it.
779 Suggested by Akim Demaille.
781 Import latest m4/m4.m4.
782 * submodules/autoconf: Update to autoconf 2.64.
783 * configure.ac (M4_GNU_OPTION): New define.
784 * src/output.c (output_skeleton): Use it to resolve FIXME.
785 * NEWS: Mention this.
787 2009-08-19 Joel E. Denny <jdenny@clemson.edu>
789 Fix complaints about escape sequences.
790 Discussed starting at
791 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
792 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
793 For a \0 and similar escape sequences meaning the null
794 character, report an invalid escape sequence instead of an
795 invalid null character because the latter does not actually
796 appear in the user's input.
797 In all escape sequence complaints, don't escape the initial
798 backslash, and don't quote when the sequence appears at the end
799 of the complaint line unless there's whitespace that quotearg
801 Consistently say "invalid" not "unrecognized".
802 Consistently prefer "empty character literal" over "extra
803 characters in character literal" warning for invalid escape
804 sequences; that is, consistently discard those sequences.
805 * tests/input.at (Bad escapes in literals): New.
807 2009-08-19 Akim Demaille <demaille@gostai.com>
810 * doc/bison.texinfo: Fix minor Texinfo errors.
812 2009-08-19 Akim Demaille <demaille@gostai.com>
814 tests: distcc compliance.
815 * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's
816 error messages from the output.
818 2009-08-19 Akim Demaille <demaille@gostai.com>
820 variables: simplify the upgrade of namespace into api.namespace.
822 This patch simplifies "variables: rename namespace as
823 api.namespace", commit 67501061076ba46355cfd9f9361c7eed861b389c.
824 Suggested by Joel E. Denny in
825 http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html
827 * src/muscle-tab.c (muscle_percent_variable_update): New.
828 (muscle_percent_define_insert): Use it in replacement of the
829 previous tr invocation.
830 Remove variable_tr, no longer needed.
831 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
833 * data/c++.m4: No longer handle namespace -> api.namespace.
834 * tests/input.at (%define backward compatibility): Check that
835 namespace is treated as api.namespace.
837 2009-08-19 Akim Demaille <demaille@gostai.com>
839 doc: %initial-action to initialize yylloc.
840 Reported by Bill Allombert.
841 * doc/bison.texinfo: Set fill-column to 76.
842 (Location Type): Document the use of %initial-action to initialize
845 2009-08-19 Akim Demaille <demaille@gostai.com>
847 lalr1.cc: use state_type.
848 * data/lalr1.cc (yysyntax_error_): Use state_type.
849 Move argument names into yy*.
851 2009-08-19 Akim Demaille <demaille@gostai.com>
853 lalr1.cc: get rid of yyparse's yystate.
854 yystate and yystack_[0].state are equal, keep only the latter.
855 The former was also used as a temporary variable to compute the
856 post-reduction state. Move this computation into an auxiliary
859 * data/glr.c (yyLRgotoState): Fuse variable definition and first
861 * data/lalr1.cc (yy_lr_goto_state_): New.
863 Replace remaining uses of yystate by yystate_[0].state.
866 2009-08-19 Akim Demaille <demaille@gostai.com>
868 lalr1.cc: destroy $$ when YYERROR is called.
869 * data/lalr1.cc (yyreduce): Compute the resulting state before
870 running the user action so that yylhs is a valid symbol.
871 (yyerrorlab): Since yylhs is complete (it knows its type), we can
872 simply call yy_destroy_ to destroy $$ on YYERROR invocations.
873 * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants.
875 2009-08-18 Joel E. Denny <jdenny@clemson.edu>
877 maint: update for gnulib's recent update-copyright changes
879 * .x-update-copyright (COPYING): Add as it's no longer implied
880 when .x-update-copyright is present.
881 * cfg.mk (update-copyright-local): Remove, now ignored.
882 (update-copyright): Declare update-b4-copyright as a dependency.
884 2009-08-17 Akim Demaille <demaille@gostai.com>
886 build: require gettext 0.17.
888 Suggested by Bruno Haible.
889 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
890 * configure.ac: require gettext 0.17 to ensure compatibility with
893 2009-08-17 Akim Demaille <demaille@gostai.com>
895 build: lower gettext requirements.
897 Bison was uselessly requiring the formatstring macros from
898 gettext, which resulted in mo files not being installed on systems
899 that perfectly supported Bison mo files. Lower the requirement.
900 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
902 * configure.ac: Require need-ngettext instead of
903 need-formatstring-macros.
904 Reported by Martin Jabocs.
905 Suggested by Bruno Haible.
906 * INSTALL: Restructure.
907 (Internationalization): New.
909 2009-08-14 Joel E. Denny <jdenny@clemson.edu>
911 maint: fix use of copyright year intervals.
913 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
914 as now recommended in gnulib/NEWS.
915 * build-aux/update-b4-copyright: Fix.
916 * cfg.mk (update-copyright-env): Configure update-copyright.
918 2009-08-13 Joel E. Denny <jdenny@clemson.edu>
920 Make it easier to write deterministic tests.
921 Continues Akim's work from his 2009-06-10 commits.
922 * src/reader.c (check_and_convert_grammar): Don't add any
923 symbols after the first symbols_do invocation.
924 * src/symtab.c (symbols_sorted): New static global.
925 (user_token_number_redeclaration): Update comments.
926 (symbol_from_uniqstr): If a new symbol is being created, assert
927 that symbols_sorted hasn't been allocated yet.
928 (symbols_free): Free symbols_sorted.
929 (symbols_cmp, symbols_cmp_qsort): New functions.
930 (symbols_do): Sort symbol_table into symbols_sorted on first
932 * tests/input.at (Numbered tokens): Recombine tests now that the
933 output should be deterministic across multiple numbers.
935 2009-08-12 Akim Demaille <demaille@gostai.com>
937 tests: GCC 4.5 compliance.
938 * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's
939 messages about #error.
941 2009-08-12 Akim Demaille <demaille@gostai.com>
943 build: fix the generation of the documentation.
944 Some of our targets use "bison --help", but they can't depend on
945 "bison" itself (to avoid additional requirements on the user), so
946 they used to call "make src/bison" in the commands. Then
947 concurrent builds may fail: one make might be aiming one of its
948 jobs at compiling src/bison, and another job at generating the man
949 page. If the latter is faster than the former, then we have two
950 makes that concurrently try to compile src/bison.
952 This might also be a more convincing explanation for the failure
953 described in the patch "build: fix paths".
955 * Makefile.am (SUFFIXES): Initialize.
956 * build-aux/move-if-change: New, symlink to gnulib's.
957 * build-aux/local.mk: Ship it.
958 * doc/common.x: Remove, merged into...
960 * doc/local.mk (doc/bison.help): New.
961 ($(CROSS_OPTIONS_TEXI)): Depend on it.
963 (.x.1): Replace with...
964 (doc/bison.1): this explicit, simpler, target.
965 (common_dep): Remove, inlined where appropriate.
966 (SUFFIXES, PREPATH): Remove, unused.
968 2009-08-12 Akim Demaille <demaille@gostai.com>
970 gnulib: improve prefixing.
971 * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather,
972 change the value of...
974 Adjust more variables.
975 * etc/prefix-gnulib-mk (prefix_assignment): Don't rename
977 (prefix): Also transform rules whose targets have slashes.
978 Use $prefix liberally.
979 Map @MKDIR_P@ to $(MKDIR_P).
980 Prefix directories that are mkdir'd.
982 2009-08-12 Akim Demaille <demaille@gostai.com>
985 When using $(top_builddir) inconsistently, Make (including GNU
986 Make) is sometimes confused. As a result it may want to build
987 lib/libbison.la and $(top_builddir)/lib/libbison.la (the same
988 file, different names) concurrently, which, amusingly enough,
991 ranlib lib/libbison.a
992 ranlib lib/libbison.a
993 make[2]: *** [lib/libbison.a] Segmentation fault
997 * doc/local.mk, src/local.mk: Do not use $(top_builddir) when not
1000 2009-08-12 Akim Demaille <demaille@gostai.com>
1004 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
1006 2009-08-10 Joel E. Denny <jdenny@clemson.edu>
1008 * tests/local.mk (TESTSUITE_AT): Add named-refs.at.
1010 2009-08-10 Joel E. Denny <jdenny@clemson.edu>
1012 Miscellaneous code readability improvements.
1014 * src/reader.c (reader): Move %define front-end variable
1015 defaults and checking into...
1016 (prepare_percent_define_front_end_variables): ... this new
1019 * src/scan-gram.l (INITIAL): For consistency with string
1020 literals, don't store open quote on character literal. It's
1021 discarded before returning anyway.
1022 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
1023 Make length test more readable, and make the character stored
1024 for an empty literal more obvious while consistent with the
1027 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
1028 USER_NUMBER_HAS_STRING_ALIAS throughout.
1029 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
1030 that is repeated in symtab.h. Improve argument names to make it
1031 clear which side of the symbol-string alias pair is which.
1032 (symbol_check_alias_consistency): Improve local variable names
1033 for the same purpose.
1034 * src/symtab.h (struct symbol): Make comments about aliases
1036 (symbol_make_alias): Improve comments and argument name.
1037 * src/output.c (token_definitions_output): Update for rename to
1038 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
1040 2009-08-08 Alex Rozenman <rozenman@gmail.com>
1042 Convert "misleading reference" messages to warnings.
1043 * src/scan-code.l: New function 'show_sub_messages', more
1045 * tests/named-ref.at: Adjust tests.
1047 2009-08-06 Joel E. Denny <jdenny@clemson.edu>
1049 maint: run "make update-copyright"
1051 2009-08-06 Joel E. Denny <jdenny@clemson.edu>
1053 maint: make update-b4-copyright easier to use
1054 * build-aux/update-b4-copyright: In warnings, report line
1055 numbers rather than character positions.
1056 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
1057 that update-copyright runs it.
1060 2009-08-05 Joel E. Denny <jdenny@clemson.edu>
1062 maint: clean up update-b4-copyright code
1063 * build-aux/update-b4-copyright: Do not accept 2-digit
1064 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
1065 Don't accept a `[' in a b4_copyright argument.
1066 Format code more consistently.
1067 Don't assume b4*copyright never occurs.
1069 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
1071 maint: automate b4_copyright updates.
1072 * Makefile.am (update-b4-copyright): New target rule.
1073 * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright.
1074 * build-aux/update-b4-copyright: New.
1075 * data/yacc.c: Remove stray characters around b4_copyright
1078 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
1080 maint: automate annual package-wide copyright-year update.
1081 * .x-update-copyright: New.
1082 * Makefile.am (EXTRA_DIST): Remove maint.mk.
1083 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
1084 update-copyright. Remove gnumakefile, which is implied by
1085 maintainer-makefile.
1086 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
1088 * maint.mk: Remove, now copied from gnulib.
1089 * examples/extexi: Add missing "(C)" in copyright statement so
1090 update-copyright can recognize it.
1091 * src/LR0.h: Likewise.
1092 * src/print.h: Likewise.
1093 * src/print_graph.h: Likewise.
1094 * src/gram.c: Add missing comma in copyright statement.
1095 * src/gram.h: Likewise.
1097 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
1099 Fix "make distcheck".
1100 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
1103 2009-08-01 Joel E. Denny <jdenny@clemson.edu>
1105 Pacify "gcc -Wunused" for the input function from Flex.
1106 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
1108 * src/scan-code.l: Add "%option noinput", which I cannot find in
1109 the Flex manual, but which Flex has supported since at least as
1110 far back as 2.5.4. However, if any of our developers still use
1111 Flex 2.5.4, they'll need to stop configuring with
1112 --enable-gcc-warnings because "%option noinput" didn't work
1113 correctly until Flex 2.5.6.
1114 * src/scan-gram.l: Likewise.
1115 * src/scan-skel.l: Likewise.
1117 2009-07-31 Alex Rozenman <rozenman@gmail.com>
1119 Fix --enable-gcc-warnings problems.
1120 * src/reader.c: Adjust variable names.
1121 * src/scan-code.l: Fix prototypes and adjust names.
1122 * src/named-ref.c: Remove redundant "if".
1124 2009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1126 Fix a --enable-gcc-warnings problem.
1127 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
1130 2009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1132 Warn about character literals not of length one.
1133 * NEWS (2.5): Document.
1134 * src/scan-gram.l (INITIAL): Remove comment that we don't check
1136 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
1137 * tests/input.at (Bad character literals): New test group.
1139 2009-07-24 Alex Rozenman <rozenman@gmail.com>
1141 Fix some memory leaks.
1142 * src/named-ref.c: Add a pointer check (named_ref_free).
1143 * src/scan-code.l: New function (variant_table_free). Called in
1145 * src/symlist.c: Call to named_ref_free (symbol_list_free).
1147 2009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1149 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
1151 2009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
1153 Some M4 cleanup in the testsuite.
1154 Suggested by Eric Blake at
1155 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
1156 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
1157 complicate the code by distinguishing between a missing value
1158 and an empty string value for an optional argument. This fix is
1159 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
1160 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
1161 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
1162 arguments are not needed because of the following changes.
1164 Bison developers should use GNU M4 and should not use
1165 POSIXLY_CORRECT when building the test suite, so do not
1166 complicate the code by avoiding $10 and above.
1167 Do not quote an empty string value for an optional argument, and
1168 do not distinguish between a missing value and an empty string
1171 2009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1173 Revert unnecessary column realignment in --help output.
1174 Reported by Akim Demaille at
1175 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
1176 * src/getargs.c (usage): Here.
1178 2009-07-04 Alex Rozenman <rozenman@gmail.com>
1180 Alphabetical order in src/local.mk.
1181 * src/local.mk: Adjust.
1183 2009-07-04 Alex Rozenman <rozenman@gmail.com>
1185 Style changes and factoring.
1186 * src/named-ref.h: Add comments.
1187 * src/parse-gram.y: Readability and style changes.
1188 * src/reader.c: Factoring: assign_named_ref function.
1189 * src/scan-code.l: Factoring and style changes. Rename
1190 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
1191 Use "unsigned" type for variant index. Improve readablity.
1192 * src/scan-gram.l: Change error messages and add comments.
1193 * src/symlist.h: symbol_list_null: New function decl.
1194 * src/symlist.c: symbol_list_null: Implement here.
1195 * tests/named-refs.at: Adjust for new error messages.
1197 2009-06-29 Eric Blake <ebb9@byu.net>
1199 scan-code: avoid compiler warnings
1200 * src/scan-code.l (parse_named_ref): Use correct specifiers.
1202 2009-06-29 Akim Demaille <demaille@gostai.com>
1204 build: avoid concurrent extraction of calc++.
1205 * examples/calc++/Makefile.am (calc.stamp): New.
1206 Depend on it to create the sources of calc++ so that concurrent
1207 builds don't launch several "extexi" in parallel.
1208 Not only this is inefficient, this also builds incorrect sources
1209 with several extractions mixed together.
1211 2009-06-29 Akim Demaille <demaille@gostai.com>
1214 * data/bison.m4: Move code related to specific variables after the
1215 definition of the variable-maintaining macros so that we don't
1216 "invoke" b4_percent_define_check_values before it is defined.
1218 2009-06-29 Akim Demaille <demaille@gostai.com>
1220 variables: parse.error
1222 Implement, document, and test the replacement of %error-verbose
1223 by %define parse.error "verbose".
1224 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
1225 values of the parse.error variable.
1226 Make "simple" its default value.
1227 Check the valid values.
1228 * src/parse-gram.y: Use %define parse.error.
1229 (PERCENT_ERROR_VERBOSE): New token.
1231 * src/scan-gram.l: Support %error-verbose.
1233 * doc/bison.texinfo (Decl Summary): Replace the documentation of
1234 %define error-verbose by that of %define parse.error.
1235 * NEWS: Document it.
1237 * tests/actions.at, tests/calc.at: Use parse.error instead of
1240 2009-06-27 Alex Rozenman <rozenman@gmail.com>
1242 Implement support for named symbol references.
1243 * src/parse-gram.y: Add new syntax (named_ref.opt).
1244 * src/reader.c: Store named refs in symbol lists.
1245 * src/reader.h: New argument for symbol_append and
1246 action_append functions.
1247 * src/scan-code.h: Add new field (named_ref) into
1248 code_props data structure. Keeps named ref of midrule
1250 * src/scan-code.l: Support for named refs in semantic
1251 action code. New function 'parse_named_ref'.
1252 * src/scan-gram.l: Support bracketed id.
1253 * src/symlist.c: Store named refs in symbol lists.
1254 * src/symlist.h: New field in symbol list: named_ref.
1255 * src/named-ref.h: New file, a struct for named_ref.
1256 * src/named-ref.cp: New file, named_ref_new function.
1257 * src/local.mk: Add two new files.
1258 * tests/testsuite.at: Include new test group:
1259 * tests/named-refs.at: this new file.
1261 2009-06-25 Akim Demaille <demaille@gostai.com>
1263 hash: check insertion for memory exhaustion.
1264 * src/uniqstr.c (uniqstr_new): New.
1266 2009-06-24 Akim Demaille <demaille@gostai.com>
1268 variables: rename namespace as api.namespace.
1270 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
1272 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
1274 (b4_percent_define_use): New.
1275 Use it where applicable.
1276 * data/c++.m4: Replace uses of the variable "namespace" by
1278 Default the latter to the former.
1279 * doc/bison.texinfo (Decl Summary): Document "namespace" as
1281 Document api.namespace.
1282 Use @samp to document %define uses, keep @code for identifiers.
1284 * tests/c++.at, tests/input.at: Test api.namespace instead of
1285 namespace. (The tests passed with namespace.)
1287 2009-06-11 Akim Demaille <demaille@gostai.com>
1290 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
1291 * src/print-xml.c: Style changes.
1292 * tests/conflicts.at: Comment changes.
1294 2009-06-11 Akim Demaille <demaille@gostai.com>
1296 xml: beware of user strings used to give a %prec to rules.
1297 * tests/conflicts.at (%prec with user strings): New.
1298 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
1301 2009-06-11 Akim Demaille <demaille@gostai.com>
1303 hash: check insertion for memory exhaustion.
1304 * src/muscle-tab.c (muscle_insert, muscle_grow)
1305 * src/state.c (state_hash_insert): Check the return value of
1308 2009-06-11 Akim Demaille <demaille@gostai.com>
1310 tests: honor TESTSUITEFLAGS in every check target.
1311 * tests/local.mk (RUN_TESTSUITE): New.
1312 (check-local, installcheck-local, maintainer-check-g++)
1313 (maintainer-check-posix, maintainer-check-valgrind): Use it.
1315 2009-06-10 Akim Demaille <demaille@gostai.com>
1317 deterministic test suite.
1318 Some consistency checks on symbols are performed after all the
1319 symbols were read, by an iteration over the symbol table. This
1320 traversal is nondeterministic, which can be a problem for test
1323 Addresses another form of nondeterminism reported by Joel E. Denny.
1324 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1326 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
1328 Use different file names for the three tests to make the
1331 2009-06-10 Akim Demaille <demaille@gostai.com>
1334 * gnulib: Update to latest.
1335 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
1336 * m4/.gitignore: Regen.
1337 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
1338 Call xalloc_die on hash_insert failures.
1339 Requested by the new __warn_unused_result__ attribute of
1342 2009-06-10 Akim Demaille <demaille@gostai.com>
1344 deterministic user-token-number redeclaration errors.
1345 Address nondeterminism reported by Joel E. Denny.
1346 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1348 * src/uniqstr.h: Comment changes.
1349 * src/location.h (boundary_cmp, location_cmp): New.
1350 * src/symtab.c (user_token_number_redeclaration): New.
1351 (symbol_translation): Use it.
1352 * tests/input.at (Numbered tokens): Adjust the expected output.
1354 2009-05-25 Akim Demaille <demaille@gostai.com>
1356 build: avoid ignored errors.
1357 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
1358 errors, they pollute the output.
1360 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1362 Convert multiple variable definition warnings to complaints.
1363 * NEWS (2.5): Add a new entry for that change.
1364 * doc/bison.texinfo (Decl Summary): Update %define entry.
1365 (Bison Options): Update -D/--define/-F/--force-define entry.
1366 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
1367 * src/muscle-tab.h (muscle_percent_define_insert): Update
1369 * tests/input.at (`%define errors'): Update.
1370 (`%define, --define, --force-define'): Update.
1372 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1374 -F/--force-define and relative %define/-D/--define priorities.
1375 * NEWS (2.5): Add documentation to -D/--define entry.
1376 * build-aux/cross-options.pl: Hard-code association of
1377 --force-define with %define.
1378 * doc/bison.texinfo (Decl Summary): In %define entry,
1379 cross-reference command-line options.
1380 (Bison Options): Add documentation to -D/--define entry.
1381 (Option Cross Key): Widen column for --force-define row.
1382 * src/getargs.c (usage): Document -F/--force-define. Realign
1384 (short_options, long_options, getargs): Parse -F/--force-define,
1385 and update muscle_percent_define_insert invocations.
1386 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
1387 (muscle_percent_define_insert): Add argument with that type.
1388 * src/muscle-tab.c (muscle_percent_define_insert): Implement
1389 -F/--force-define behavior and priorities.
1390 (muscle_percent_define_ensure): Update
1391 muscle_percent_define_insert invocation.
1392 * src/parse-gram.y (prologue_declaration): Update
1393 muscle_percent_define_insert invocations.
1394 * tests/input.at (`%define, --define'): Rename to...
1395 (`%define, --define, --force-define'): ... this and extend.
1397 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1399 Update some comments to make sense for -D.
1400 * data/bison.m4 (b4_check_user_names): In header comments, say
1401 "user occurrence" instead of "grammar occurrence".
1402 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
1403 (muscle_percent_code_grow): Likewise just for consistency.
1405 2009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1407 * data/c++.m4 (b4_namespace_close): Simplify slightly.
1409 2009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
1411 Handle a trailing `:' in a user-supplied C++ namespace better.
1412 * data/c++.m4 (b4_namespace_close): Don't let it be printed
1413 among the closing braces here. This fix might make the
1414 generated code easier to debug, but otherwise it should be
1415 insignificant because a trailing `:' is a C++ error already.
1417 2009-05-19 Akim Demaille <demaille@gostai.com>
1419 remove useless variable.
1420 * src/getargs.c (skeleton_arg): Remove now useless variable.
1421 Should help the compiler see that this printf-like call is sane.
1423 2009-05-15 Akim Demaille <demaille@gostai.com>
1425 Rename token.prefix as api.tokens.prefix.
1427 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
1429 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
1430 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
1431 (token.prefix): Rename as...
1432 (api.tokens.prefix): this.
1434 2009-05-11 Akim Demaille <demaille@gostai.com>
1436 doc: use C++ headers.
1437 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
1440 2009-05-11 Akim Demaille <demaille@gostai.com>
1443 * doc/bison.simple (Decl Summary): Document token.prefix.
1444 (Calc++ Parser): Various fixes.
1447 Introduce a macro TOKEN to shorten the code and make it more
1449 (Calc++ Scanner): Adjust.
1450 * NEWS (Variable token.prefix): New.
1452 2009-05-04 Akim Demaille <demaille@gostai.com>
1454 bison: catch bad symbol names.
1455 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
1456 * tests/input.at: Adjust.
1458 2009-05-04 Akim Demaille <demaille@gostai.com>
1460 identifiers: dashes are letters.
1461 Dashes can now start identifiers (symbols and directives).
1463 * src/scan-gram.l ({letter}): Add dash.
1465 * tests/input.at (Symbols): Adjust.
1466 Remove stray comment.
1467 * tests/regression.at (Invalid inputs): Adjust error message.
1468 * doc/bison.texinfo (Symbols): Update.
1470 2009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
1472 Declare %code to be a permanent feature.
1473 * NEWS (2.4.2): Here.
1474 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
1476 (Decl Summary): Likewise.
1478 2009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1480 Convert underscores to dashes in some %define variable names.
1481 For now, just api.push-pull and lr.keep-unreachable-states.
1482 Maintain old names for backward compatibility.
1483 * NEWS (2.5): Document.
1484 * data/c.m4 (b4_identification): Update comment.
1485 * data/yacc.c: Update access.
1486 * doc/bison.texinfo: Update.
1487 * etc/bench.pl.in (bench_push_parser): Update use.
1488 * src/files.c (tr): Move to...
1489 * src/getargs.c, src/getargs.h (tr): ... here because I can't
1490 think of a better place to expose it. My logic is that, for all
1491 uses of tr so far, command-line arguments can be involved, and
1492 getargs.h is already included.
1493 * src/main.c (main): Update access.
1494 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
1495 variable names to new variable names before assigning value.
1496 * src/reader.c (reader): Update setting default.
1497 * tests/calc.at: Update uses.
1498 * tests/conflicts.at (Unreachable States After Conflict
1499 Resolution): Update use.
1500 * tests/input.at (%define enum variables): Update use.
1501 (%define backward compatibility): New test group.
1502 * tests/push.at: Update uses.
1503 * tests/reduce.at: Update uses.
1504 * tests/torture.at: Update uses.
1506 2009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1508 Set all front-end %define defaults in one place.
1509 * src/main.c (main): Move lr.keep_unreachable_states default...
1510 * src/reader.c (reader): ... to here.
1512 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1514 Rename lr.default_reductions to lr.default-reductions.
1516 * doc/bison.texinfo: Here.
1517 * src/lalr.c (initialize_LA): Here.
1518 * src/print.c (print_reductions): Here.
1519 * src/reader.c (reader): Here.
1520 * src/tables.c (action_row): Here.
1521 * tests/input.at (%define enum variables): Here.
1522 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
1524 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1526 Pacify ./configure --enable-gcc-warnings.
1527 * tests/input.at (Symbols): Prototype yyerror and yylex.
1529 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1531 Document how `%define "var" "value"' is not M4-friendly.
1532 * src/parse-gram.y (variable): In comments here.
1534 2009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1536 Clean up recent patches a little.
1537 Reported by Akim Demaille.
1538 * doc/bison.texinfo (Understanding): Fix typos.
1539 * src/print.c (print_reductions): Don't use negated variable.
1541 2009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1543 List accepted values for a %define enum variable with an invalid value.
1544 Suggested by Akim Demaille at
1545 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
1546 * data/bison.m4 (_b4_percent_define_check_values): Implement.
1547 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
1548 * tests/input.at (%define lr.default_reductions invalid values): Merge
1550 (%define enum variables): ... here, and update output.
1552 2009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
1554 Rename "default rule" to "default reduction".
1555 This includes changing variable names in code, changing
1556 comments, and renaming %define lr.default_rules to %define
1557 lr.default_reductions.
1558 * NEWS (2.5): Update IELR documentation.
1559 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
1561 * data/glr.c, data/lalr1.java: Sync copyright dates.
1562 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
1563 and lr.type documentation. Make some other wording
1565 (Glossary): Adjust cross-references and Default Reduction
1567 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
1568 Remove a confusing comment pointed out by Akim Demaille.
1569 (initialize_LA): Adjust code.
1570 * src/print-xml.c (print_reductions): Adjust code.
1571 * src/print.c (print_reductions): Adjust code.
1572 * src/reader.c (reader): Adjust code.
1573 * src/tables.c (action_row): Adjust code.
1574 (token_actions): Adjust code.
1575 * src/tables.h: Adjust YYDEFACT documentation.
1576 * tests/input.at (%define lr.default_rules invalid values):
1577 Rename test group to...
1578 (%define lr.default_reductions invalid values): ... this, and
1579 update grammar file and expected output.
1580 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
1581 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
1583 2009-04-21 Akim Demaille <demaille@gostai.com>
1585 tests: check the use of dashes and periods in symbols.
1586 * tests/input.at (Symbol): New test group.
1588 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1590 Document %define lr.type and lr.default_rules.
1591 * NEWS (2.5): Add an entry.
1592 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
1593 besides just LALR(1) and GLR(1).
1594 * doc/bison.texinfo (Introduction): Likewise.
1595 (Language and Grammar): Bison is no longer limited to LALR(1)
1597 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
1598 when trying to distinguish from GLR. Talk about LR(1) grammars
1599 rather than LALR(1) grammars.
1600 (Decl Summary): In %define api.push_pull entry, say it applies
1601 to deterministic parsers in C rather than LALR(1) parsers in C.
1602 Add lr.default_rules entry.
1604 (Mystery Conflicts): Bison is no longer limited to LALR(1)
1606 (Generalized LR Parsing): Same changes as for the previous GLR
1608 (Memory Management): Say deterministic rather than LALR(1).
1609 (Understanding): Correct some bison output.
1610 Index discussion of "accepting state".
1611 Say deterministic rather than LALR(1).
1612 (Bison Options): In --yacc entry, say deterministic rather than
1614 In --report, --graph, and --xml entries, just don't mention
1616 (C++ Parsers): Say deterministic rather than LALR(1).
1617 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
1618 (Glossary): Add Accepting State, Consistent State, Default Rule,
1619 and IELR(1) definitions.
1620 In Generalized LR (GLR) definition, make same changes as in
1621 previous GLR sections.
1622 In LALR(1) definition, say Bison uses LALR(1) by default rather
1623 than implying Bison is limited to LALR(1).
1624 (LocalWords): Add IELR.
1626 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1628 Finish implementing %define lr.type.
1629 Its value can be "LALR", "IELR", or "canonical LR".
1630 * lib/timevar.def (TV_IELR_PHASE1): New var.
1631 (TV_IELR_PHASE2): New var.
1632 (TV_IELR_PHASE3): New var.
1633 (TV_IELR_PHASE4): New var.
1634 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
1635 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
1636 Sbitset.h, ielr.h, and ielr.c.
1637 * src/getargs.h, src/getargs.c (enum trace, trace_args,
1638 trace_types): Add trace_ielr.
1639 * src/lalr.h, src/lalr.c (ngotos): Export it.
1641 (goto_follows): ... this, update all uses, and export it.
1642 (set_goto_map): Export it.
1643 (map_goto): Export it.
1644 (compute_lookahead_tokens): Don't free goto_follows yet. Now
1646 (initialize_LA): Export it. Move lookback allocation to...
1647 (lalr): ... here because, for canonical LR, initialize_LA must
1648 be invoked but lookback and much of the rest of LALR isn't
1650 * main.c (main): Instead of lalr, invoke ielr, which invokes
1652 * src/reader.c (reader): Default lr.type to "LALR".
1653 Default lr.default_rules to "accepting" if lr.type is "canonical
1654 LR". Leave the default as "all" otherwise.
1655 Check for a valid lr.type value.
1656 * src/state.h, src/state.c (struct state_list): Add state_list
1658 (state_new): Initialize state_list member to NULL.
1659 (state_new_isocore): New function, exported.
1660 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
1661 exercises all values of lr.type.
1662 (GNU AWK Grammar): Rename test group to...
1663 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
1664 AT_TEST_EXISTING_GRAMMAR.
1665 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
1666 (GNU pic Grammar): Rename test group to...
1667 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
1668 AT_TEST_EXISTING_GRAMMAR.
1669 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
1670 all values of lr.type.
1671 (Single State Split): New test groups using AT_TEST_LR_TYPE.
1672 (Lane Split): Likewise.
1673 (Complex Lane Split): Likewise.
1674 (Split During Added Lookahead Propagation): Likewise.
1676 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1678 Add new files for IELR and canonical LR implementation.
1679 * src/AnnotationList.c: New.
1680 * src/AnnotationList.h: New.
1681 * src/InadequacyList.c: New.
1682 * src/InadequacyList.h: New.
1683 * src/Sbitset.c: New.
1684 * src/Sbitset.h: New.
1688 2009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1690 Implement %define lr.default_rules.
1691 Its value describes the states that are permitted to contain
1692 default rules: "all", "consistent", or "accepting".
1693 * src/reader.c (reader): Default lr.default_rules to "all".
1694 Check for a valid lr.default_rules value.
1695 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
1696 is "accepting", then only mark the accepting state as
1698 (initialize_LA): Tell state_lookahead_tokens_count whether
1699 lr.default_rules is "accepting".
1700 * src/tables.c (action_row): If lr.default_rules is not "all",
1701 then disable default rules in inconsistent states.
1702 * src/print.c (print_reductions): Use this opportunity to
1703 perform some assertions about whether lr.default_rules was
1705 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
1706 helps with checking the parser tables for a grammar.
1707 * tests/input.at (%define lr.default_rules invalid values): New
1709 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
1710 AT_TEST_TABLES_AND_PARSE.
1711 (`no %define lr.default_rules'): New test group generated by
1712 AT_TEST_LR_DEFAULT_RULES.
1713 (`%define lr.default_rules "all"'): Likewise.
1714 (`%define lr.default_rules "consistent"'): Likewise.
1715 (`%define lr.default_rules "accepting"'): Likewise.
1717 2009-04-20 Akim Demaille <demaille@gostai.com>
1721 2009-04-20 Akim Demaille <demaille@gostai.com>
1724 * src/output.c (token_definitions_output): Use symbol_id_get
1725 instead of duplicating its logic.
1726 * TODO (YYERRCODE): Extend.
1728 2009-04-20 Akim Demaille <demaille@gostai.com>
1730 variables: prefer error-verbose to error_verbose.
1731 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
1732 instead of error_verbose.
1733 * src/scan-gram.l (%error-verbose): Map to the error-verbose
1735 * doc/bison.texinfo: Promote %define error-verbose instead of
1737 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
1739 2009-04-15 Akim Demaille <demaille@gostai.com>
1741 variables: accept dashes.
1742 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
1744 * src/scan-gram.l ({id}): Also accept dashes after the initial
1746 ({directive}): Use {id}.
1747 * src/parse-gram.y: Comment and formatting changes.
1748 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
1750 * src/complain.h, src/complain.c (yacc_at): New.
1751 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
1753 * src/output.c (token_definitions_output): Do not #define token
1756 2009-04-20 Akim Demaille <demaille@gostai.com>
1758 Consistently refer to Yacc, not YACC.
1759 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
1761 2009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
1763 Pacify make maintainer-check-posix.
1764 * tests/input.at (%define, --define): Move bison command-line
1765 options before grammar file name.
1767 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1769 Document semicolon warnings.
1772 2009-04-14 Akim Demaille <demaille@gostai.com>
1774 variables: use `parse.assert' instead of `assert'.
1775 * TODO (assert): Remove.
1776 * data/bison.m4 (b4_assert_if): Replace with...
1777 (b4_parse_assert_if): this.
1778 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
1779 * doc/bison.texinfo (Decl Summary): Document parse.assert.
1781 2009-04-14 Akim Demaille <demaille@gostai.com>
1783 variables: use `parse.trace' instead of `debug'.
1784 * src/getargs.c (getargs): Map -t to %define trace.parse.
1785 * src/scan-gram.l (%debug): Map to %define trace.parse.
1786 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
1787 names to `_' in macro names.
1788 (b4_debug_if): Replace with...
1789 (b4_parse_trace_if): this.
1790 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1791 * data/yacc.c: Adjust.
1792 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
1793 Use @code to label the variable list.
1794 Document the variable parse.trace.
1795 (Tracing): Promote the parse.trace variable.
1796 * TODO: %printer is not documented.
1798 2009-04-14 Akim Demaille <demaille@gostai.com>
1801 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
1802 (Table of Symbols): Remove duplicate entry for %debug.
1804 2009-04-10 Eric Blake <ebb9@byu.net>
1806 submodules: update to latest
1807 * submodules/autoconf: Use latest upstream Autoconf.
1809 2009-04-06 Eric Blake <ebb9@byu.net>
1811 Work around autoconf 2.63b bug in testsuite.
1812 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
1813 autoconf bug related to # in test.
1815 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1817 * NEWS (2.5): New section. Describe new -D/--define feature.
1819 2009-04-06 Akim Demaille <demaille@gostai.com>
1822 * src/parse-gram.h, src/parse-gram.c: Regen.
1824 2009-04-06 Akim Demaille <demaille@gostai.com>
1826 rename muscle_tab.* as muscle-tab.* for consistency.
1827 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
1828 * src/muscle-tab.h, src/muscle-tab.c: these.
1829 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
1830 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
1832 2009-04-06 Akim Demaille <demaille@gostai.com>
1834 Makefile: introduce $(BISON).
1835 * src/local.mk (BISON): New.
1838 2009-04-06 Akim Demaille <demaille@gostai.com>
1840 parser: handle %locations as %define locations.
1841 * src/getargs.h, src/getargs.c (locations_flag): Remove.
1842 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
1843 to set "locations" to true.
1844 * src/output.c (prepare): Don't output "locations".
1845 * src/scan-gram.l (%locations): Handle it as a %<flag>.
1846 * src/parse-gram.y: It's no longer a token.
1848 * data/bison.m4 (b4_locations_if): Define it with
1849 b4_percent_define_if_define.
1850 * data/c.m4, data/glr.cc: Adjust.
1852 2009-04-06 Akim Demaille <demaille@gostai.com>
1855 * src/parse-gram.c: Regen.
1857 2009-04-06 Akim Demaille <demaille@gostai.com>
1859 muscle: factor the handling of obsolete of obsolete directives.
1860 Suggested by Joel E. Denny.
1862 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
1863 New, extracted from...
1864 * src/parse-gram.y (prologue_declaration: pure-parser): here.
1866 (prologue_declaration: "%<flag>"): Use
1867 muscle_percent_define_ensure.
1868 (%error-verbose, %pure-parser): No longer tokens.
1869 * src/scan-gram.l (pure-parser): Return as a %<flag>.
1871 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1873 Fix options documentation.
1874 * build-aux/cross-options.pl: As in --help output, write optional
1875 arguments as [=ARG] not =[ARG].
1876 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
1878 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1880 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
1881 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
1882 requirements for a correct m4 are stricter.
1883 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
1884 * configure.ac: Update to use AC_PROG_GNU_M4.
1885 Reported by Eric Blake.
1887 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1889 Help with updating web manual.
1890 * HACKING: Incorporate instructions from gnulib/doc/README.
1891 * bootstrap.conf (gnulib_modules): Add gendocs.
1893 2009-04-03 Akim Demaille <demaille@gostai.com>
1896 * src/parse-gram.h, src/parse-gram.c: Regen.
1898 2009-04-03 Akim Demaille <demaille@gostai.com>
1900 Factor %FLAG at scan level.
1901 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
1902 definitions and associated rules, replaced by....
1903 (PERCENT_FLAG): this new token type, and rule.
1904 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
1905 Use it for %debug and %error-verbose.
1907 2009-04-03 Akim Demaille <demaille@gostai.com>
1910 * src/parse-gram.h, src/parse-gram.c: Regen.
1912 2009-04-03 Akim Demaille <demaille@gostai.com>
1914 Treat %debug as %define debug.
1915 * data/bison.m4 (b4_debug_if): New.
1916 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
1917 * data/lalr1.java: Use it instead of b4_debug_flag.
1918 * src/getargs.h, src/getargs.c (debug_flag): Remove.
1919 * src/output.c (prepare): Don't output it.
1920 * src/parse-gram.y: Treat %debug as %define debug.
1922 2009-04-03 Akim Demaille <demaille@gostai.com>
1924 Treat %error-verbose as %define error_verbose.
1925 This allows to pass -Derror_verbose on the command line. Better
1926 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
1927 ERROR_VERBOSE being defined as false or true.
1928 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
1929 on b4_percent_define_ifdef, for does not check the defined value,
1930 but only whether the symbol is defined, rely on
1931 b4_percent_define_flag_if, so that a value of "false" is processed
1933 If not defined, define the flag to "false".
1934 (b4_error_verbose_if): New.
1935 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
1936 b4_error_verbose_flag.
1937 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
1938 * src/output.c (prepare): Don't output it.
1939 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
1941 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1943 Fix strange %define locations for default values.
1944 Reported by Akim Demaille at
1945 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
1946 and discussed again starting at
1947 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
1948 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
1949 because location information is bogus.
1950 Use angle brackets to delimit fake file name because square brackets
1951 look like underexpanded m4. Choose a better fake file name.
1952 Use negative line numbers.
1953 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
1954 * src/location.c (location_print): If line for a boundary is negative,
1955 only print that boundary's file name.
1956 * src/location.h: Document that.
1957 * tests/skeletons.at (%define Boolean variables: invalid skeleton
1958 defaults): Update output.
1960 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1962 Pacify ./configure --enable-gcc-warnings.
1963 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
1964 in lib won't compile with it.
1965 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
1967 2009-03-31 Akim Demaille <demaille@gostai.com>
1969 bootstrap: --help to stdout.
1970 * bootstrap (usage): Don't send --help to stderr.
1971 Use a here doc instead of a long string.
1973 2009-03-31 Akim Demaille <demaille@gostai.com>
1975 bootstrap: README-hacking no longer exists
1976 * bootstrap (checkout_only_file): Set to HACKING.
1978 2009-03-26 Akim Demaille <demaille@gostai.com>
1980 doc: merge HACKING and README-hacking.
1981 Two files is confusing.
1982 Reported by Alexandre Duret-Lutz.
1984 * README-hacking: Merge into...
1985 * HACKING (Working from the repository): here.
1987 2009-03-26 Akim Demaille <demaille@gostai.com>
1989 doc: update README-hacking.
1990 * README-hacking: We now use git and git submodules.
1991 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
1993 2009-03-26 Akim Demaille <demaille@gostai.com>
1995 lalr1.cc: avoid GCC 4.3 warnings.
1996 GCC 4.3 now warns about "a || b && c" and asks for explicit
1998 Reported by Alexandre Duret-Lutz.
1999 * data/location.cc: Update copyright years.
2000 (Position::operator==): Use parens to make precedence explicit.
2001 Compare lines and columns first, as they are more likely to be
2002 different, and they are faster to compare.
2004 2009-03-26 Akim Demaille <demaille@gostai.com>
2007 * gnulib: Update to latest.
2008 * src/local.mk (AM_CFLAGS): Move to...
2009 * Makefile.am: here.
2010 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
2013 2009-03-02 Akim Demaille <demaille@gostai.com>
2017 2009-03-02 Akim Demaille <demaille@gostai.com>
2019 Share b4_yytranslate_define.
2020 * data/lalr1.cc (b4_yytranslate_define): Move to...
2021 * data/c++.m4: here.
2023 2009-03-02 Akim Demaille <demaille@gostai.com>
2025 Use locations in the variant example.
2026 Yes, this obfuscates the point of this example, variants only.
2027 But glr.cc cannot work (yet?) without locations. This change
2028 makes it easier to use this example with glr.cc.
2030 * examples/variant.yy (assert): %define it.
2031 (locations): Request them.
2032 (yylex): Bind the location to the stage.
2034 2009-03-02 Akim Demaille <demaille@gostai.com>
2036 Dub make_TOKEN as a public type interface.
2037 * data/c++.m4 (b4_symbol_constructor_declare)
2038 (b4_symbol_constructor_define): New empty stubs.
2039 (b4_public_types_declare, b4_public_types_define): Use them.
2040 * data/lalr1.cc (b4_symbol_constructor_declare)
2041 (b4_symbol_constructor_declare_)
2042 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
2044 * data/variant.hh: here.
2045 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
2047 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
2048 b4_symbol_constructor_declare, as it is now done by
2049 b4_public_types_define and b4_public_types_declare.
2051 2009-03-02 Akim Demaille <demaille@gostai.com>
2053 Coding style changes.
2054 * data/lalr1.cc (b4_symbol_constructor_declaration_)
2055 (b4_symbol_constructor_declarations)
2056 (b4_symbol_constructor_definition_)
2057 (b4_symbol_constructor_definitions)
2058 (b4_yytranslate_definition): Rename as...
2059 (b4_symbol_constructor_declare_)
2060 (b4_symbol_constructor_declare)
2061 (b4_symbol_constructor_define_)
2062 (b4_symbol_constructor_define)
2063 (b4_yytranslate_define): these.
2064 * data/variant.hh (b4_variant_definition): Rename as...
2065 (b4_variant_define): this.
2067 2009-03-02 Akim Demaille <demaille@gostai.com>
2069 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
2070 * data/bison.m4 (b4_percent_define_if_define): New.
2071 * data/c++.m4 (b4_variant_if): Move to...
2072 * data/bison.m4: Here, using b4_percent_define_if_define.
2073 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
2074 * data/bison.m4: Here, using b4_percent_define_if_define.
2076 2009-03-02 Akim Demaille <demaille@gostai.com>
2078 Dub symbol_type_base as a public type.
2079 * data/c++.m4 (b4_public_types_declare): Now define
2080 symbol_type_base and symbol_type.
2081 (b4_public_types_define): New.
2082 In both cases, the definitions are taken verbatim from lalr1.cc.
2083 * data/lalr1.cc: Adjust.
2085 2009-03-02 Akim Demaille <demaille@gostai.com>
2087 b4_public_types_declare.
2088 * data/c++.m4 (b4_public_types_declare): New.
2089 * data/glr.cc, data/lalr1.cc: Use it.
2091 2009-03-02 Akim Demaille <demaille@gostai.com>
2093 b4_semantic_type_declare.
2094 * data/c++.m4 (b4_semantic_type_declare): New.
2095 Factors and generalizes what was in glr.cc and lalr1.cc.
2096 * data/variant.hh (b4_semantic_type_declare): Redefine it for
2098 * data/lalr1.cc, data/glr.cc: Use it.
2100 2009-02-26 Akim Demaille <demaille@gostai.com>
2103 * gnulib: Upgrade from master.
2104 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
2107 2009-02-25 Akim Demaille <demaille@gostai.com>
2109 Remove useless arguments.
2110 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
2113 2009-02-25 Akim Demaille <demaille@gostai.com>
2116 * data/lalr1.cc: here.
2118 2009-02-25 Akim Demaille <demaille@gostai.com>
2120 Fix glr.cc's debug level handling.
2121 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
2122 glr.c which is used.
2123 (debug_level, set_debug_level): Adjust.
2125 2009-02-25 Akim Demaille <demaille@gostai.com>
2128 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
2130 2009-02-25 Akim Demaille <demaille@gostai.com>
2133 * etc/bench.pl.in (generate_grammar_list): Consitently use
2134 location_type, not yy::location.
2136 2009-02-25 Akim Demaille <demaille@gostai.com>
2139 * data/lalr1.cc: here.
2141 2009-02-19 Akim Demaille <demaille@gostai.com>
2143 Make yyparser::error public.
2144 * data/lalr1.cc: here.
2145 There is no good reason to keep it private (and it is convenient
2146 to use it from the scanner for instance). It is already public in
2149 2009-02-19 Akim Demaille <demaille@gostai.com>
2152 * data/glr.cc: here.
2154 2009-02-19 Akim Demaille <demaille@gostai.com>
2156 Remove trailing blanks.
2157 The epilogue has its own ending \n, no need to add another.
2159 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
2161 * data/glr.cc: dnl when extending the epilogue.
2162 Remove stray "private:".
2164 2009-02-19 Akim Demaille <demaille@gostai.com>
2167 * data/c.m4 (b4_c_function_decl): Here.
2169 2009-02-19 Akim Demaille <demaille@gostai.com>
2172 * data/lalr1.cc: here.
2174 2009-02-19 Akim Demaille <demaille@gostai.com>
2177 * data/variant.hh: New, extracted from...
2178 * data/lalr1.cc: here.
2180 * data/local.mk: Adjust.
2182 2009-02-19 Akim Demaille <demaille@gostai.com>
2184 Extract stack.hh from lalr1.cc.
2185 * data/stack.hh: New.
2186 * data/lalr1.cc: Extract from here.
2187 * data/local.mk: Adjust.
2189 2009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
2191 Add reminder about uploading public key to keys.gnupg.net.
2192 * HACKING (Release Procedure): Here.
2194 2009-01-28 Akim Demaille <demaille@gostai.com>
2196 * NEWS: Update information about 2.4.1 and 2.4.2.
2198 2008-11-04 Akim Demaille <demaille@gostai.com>
2201 * NEWS: Use more outline-mode markup.
2202 Suggested by Jim Meyering.
2204 2009-01-08 Akim Demaille <demaille@gostai.com>
2206 Fix grep portability issues.
2207 Grep on Solaris does not support -q.
2208 Reported by Summum Bonum.
2210 * NEWS: Add a stub for 2.4.2.
2211 * THANKS: Add Summum Bonum.
2212 * tests/atlocal.in (EGREP): New.
2213 (CC, CXX, XSLTPROC): Make it possible to override them via
2215 * tests/java.at: Use $EGREP instead of egrep.
2216 Use AT_CHECK's ignore instead of grep's -q.
2218 2008-12-11 Akim Demaille <demaille@gostai.com>
2220 Pass the token type to yysyntax_error.
2221 * data/yacc.c (yysyntax_error): Take the transated token instead
2226 2008-12-11 Akim Demaille <demaille@gostai.com>
2229 * data/glr.c: Formatting changes.
2231 2008-12-11 Akim Demaille <demaille@gostai.com>
2233 Propagate i18n changes into glr.c.
2235 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
2236 building the error message format dynamically.
2237 * data/lalr1.java: Formatting changes.
2239 2008-12-11 Akim Demaille <demaille@gostai.com>
2242 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
2243 Solves problems when top_srcdir is an absolute path.
2244 Suggested by Eric Blake.
2245 * configure.ac: Require Autoconf 2.62.
2247 2008-12-11 Akim Demaille <demaille@gostai.com>
2249 Simplify the i18n of the error messages.
2250 * data/lalr1.cc: Comment changes.
2251 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
2252 lalr1.cc instead of building dynamically the format string.
2254 2008-12-08 Akim Demaille <demaille@gostai.com>
2256 Fix portability issue in the test suite.
2257 * tests/local.at (AT_MATCHES_CHECK): New.
2258 Based on Perl instead of Sed. Sed has too many portability
2259 pitfalls, not ever Sed is GNU Sed.
2260 * tests/actions.at (Fix user actions without a trailing semicolon):
2263 2008-12-08 Akim Demaille <demaille@gostai.com>
2266 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
2268 2008-12-08 Akim Demaille <demaille@gostai.com>
2270 Install autoconf as a submodule to get m4sugar.
2271 * .gitmodules: Add submodules/autoconf.
2272 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
2273 submodules/autoconf.
2275 2008-12-08 Akim Demaille <demaille@gostai.com>
2277 Test token.prefix in all the skeletons.
2278 * data/java.m4 (b4_token_enum): Use the token.prefix.
2279 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
2280 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
2281 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
2282 * tests/java.at: Comment changes.
2283 (AT_CHECK_JAVA_MINIMAL): Define the END token.
2284 (Java parser class and package names): Add token.prefix check.
2286 2008-12-08 Akim Demaille <demaille@gostai.com>
2288 Fix regeneration of atconfig.
2289 * tests/local.mk (tests/atconfig): The rule was incorrect, but
2290 remove it: now that there is no tests/Makefile.am, the top-level
2291 Makefile properly updates atconfig when needed.
2293 2008-12-07 Di-an Jan <dianj@freeshell.org>
2295 Implement the FIXME that ends an user action with a semicolon
2296 if it seems necessary.
2297 * src/scan-code.l (flex rules section): Flag cpp directive from
2298 any `#' to the first unescaped end-of-line. Semicolon is not
2299 needed after `;', `{', '}', or cpp directives and is needed after
2300 any other token (whitespaces and comments have no effect).
2301 * tests/actions.at (Fix user actions without a trailing semicolon):
2303 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
2304 to make user actions complete statements.
2305 Adjust column numbers in error messages.
2306 * tests/regression.at (Fix user actions without a trailing semicolon):
2307 Remove. Covered by new test.
2309 2008-12-07 Akim Demaille <demaille@gostai.com>
2312 * gnulib: Update from master.
2314 2008-12-05 Eric Blake <ebb9@byu.net>
2316 Avoid compiler warning.
2317 * src/output.c (muscle_insert_item_number_table): Delete unused
2320 2008-12-02 Eric Blake <ebb9@byu.net>
2322 Build testsuite with newer autoconf.
2323 * tests/output.at (m4_expand): Don't override in newer autoconf,
2324 where the underlying implementation changed.
2325 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
2326 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
2327 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
2328 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
2329 since some of them contain unbalanced ')'.
2331 2008-12-01 Akim Demaille <demaille@gostai.com>
2333 Use b4_symbol for printers and destructors everywhere.
2334 * data/bison.m4 (b4_symbol_action_location): New.
2335 * data/c.m4 (b4_symbol_actions): Remove.
2336 Adjust all callers to use by b4_symbol_foreach and the corresponding
2337 b4_symbol_printer/destructor macro.
2338 * data/glr.cc: Adjust.
2339 * data/lalr1.java: Adjust the %destructor sanity check.
2340 * src/output.c (symbol_code_props_output): Remove, we no longer
2341 need the b4_symbol_printers/destructors tables.
2343 2008-12-01 Akim Demaille <demaille@gostai.com>
2345 Use b4_symbol_case_.
2346 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
2349 2008-12-01 Akim Demaille <demaille@gostai.com>
2351 Move b4_symbol based macro to bison.m4.
2352 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
2353 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
2354 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
2355 (b4_type_foreach): Move to...
2356 * data/bison.m4: Here.
2357 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
2358 b4_symbol_value_template instead of b4_symbol_value.
2360 2008-12-01 Akim Demaille <demaille@gostai.com>
2362 b4_symbol/type_foreach.
2363 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
2366 2008-12-01 Akim Demaille <demaille@gostai.com>
2368 Use the symbol properties to output the printer/destructor for lalr1.cc.
2369 Instead of defining complex list of tuples to define various
2370 properties of the symbols, we now prefer to define symbols as
2371 "structs" in m4: using the symbol key (its number), and the
2372 property name, b4_symbol gives it value. Use this to handle
2373 destructors and printers.
2375 * src/output.c (CODE_PROP): New.
2376 (prepare_symbol_definitions): Use it to define the printer and
2377 destructor related attributes of the symbols.
2378 * data/lalr1.cc (b4_symbol_actions): Rename as...
2379 (b4_symbol_action): this.
2380 Use b4_symbol instead of 6 arguments.
2381 (b4_symbol_printer, b4_symbol_destructor): New.
2382 Use them instead of b4_symbol_actions.
2384 2008-12-01 Akim Demaille <demaille@gostai.com>
2386 Avoid capturing variables too easily.
2387 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
2388 v__ and p__ instead of v and p.
2390 2008-12-01 Akim Demaille <demaille@gostai.com>
2392 Remove spurious empty line before syncline.
2393 * data/bison.m4 (b4_syncline): Don't output an empty line before
2396 2008-11-26 Akim Demaille <demaille@gostai.com>
2398 Convert lib/Makefile.am into lib/local.mk.
2399 The real problem is rather gnulib.mk, which itself is extracted
2400 from a Makefile.am that gnulib expects to the "recursive". The
2401 tool prefix-gnulib-mk converts such a gnulib.mk to be
2402 non-recursive. Also, some AC_SUBST variables need to be adjusted.
2404 * etc/prefix-gnulib-mk: New.
2405 * bootstrap (slurp): Use it to convert further gnulib.mk.
2406 No longer try to avoid re-creation of lib/gnulib.mk as the changes
2408 * lib/Makefile.am: Rename as...
2409 * lib/local.mk: this.
2410 Adjust to be prefixed.
2411 * Makefile.am, configure.ac: Adjust.
2412 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
2414 2008-11-26 Akim Demaille <demaille@gostai.com>
2417 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
2418 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
2419 Reported by Eric Blake.
2421 2008-11-26 Akim Demaille <demaille@gostai.com>
2423 Use b4_parser_tables_define in glr.cc.
2424 * data/glr.c: Use b4_parser_tables_define instead of defining the
2425 (deterministic integral) tables by hand.
2427 2008-11-26 Akim Demaille <demaille@gostai.com>
2429 Use b4_parser_tables_define in Java.
2430 * data/java.m4 (b4_typed_parser_table): Rename as...
2431 (b4_typed_parser_table_define): this, for consistency.
2432 Accept a comment as $4.
2434 (b4_integral_parser_table): Rename as...
2435 (b4_integral_parser_table_define): this.
2436 * data/lalr1.java: Adjust all uses.
2437 Use b4_parser_tables_define instead of generation by hand.
2439 2008-11-26 Akim Demaille <demaille@gostai.com>
2441 Prepare the convergence bw C style and Java table generation.
2442 * data/bison.m4 (b4_tables_map, b4_tables_declare)
2443 (b4_tables_define): Rename as...
2444 (b4_integral_parser_tables_map, b4_parser_tables_declare)
2445 (b4_parser_tables_define): these.
2446 * data/c.m4 (b4_table_define): Rename as...
2447 (b4_integral_parser_table_define): this.
2448 * data/lalr1.cc: Adjust.
2449 (b4_table_define, b4_table_declare): Rename as...
2450 (b4_integral_parser_table_define)
2451 (b4_integral_parser_table_declare): these.
2452 (yyrline_): Move the comment where it is actually used.
2453 * data/yacc.c: Adjust.
2454 (yyrline): Use b4_integral_parser_table_define.
2456 2008-11-26 Akim Demaille <demaille@gostai.com>
2459 * src/parse-gram.h, src/parse-gram.c: Regen.
2461 2008-11-26 Akim Demaille <demaille@gostai.com>
2463 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
2464 * data/lalr1.cc (b4_tables_map): Move to...
2465 * data/bison.m4: here.
2466 Update the comment for yytable during the flight.
2467 (b4_tables_declare, b4_tables_define): New.
2468 * data/lalr1.cc: Use them.
2469 * data/c.m4 (b4_table_define): New.
2470 * data/yacc.c: Use b4_tables_define instead of output the tables
2472 * tests/regression.at (Web2c Actions): Adjust the expected output,
2473 the order of the tables changed.
2475 2008-11-26 Akim Demaille <demaille@gostai.com>
2477 Get rid of (yy)rhs and (yy)prhs.
2478 These tables are no longer needed in the parsers, and they don't seem to
2479 be useful. They are not documented either.
2481 * src/output.c (prepare_rules): Get rid of rhs and prhs.
2482 Adjust the computation of (yy)r2.
2484 2008-11-26 Akim Demaille <demaille@gostai.com>
2486 Rule length is unsigned.
2487 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
2489 2008-11-26 Akim Demaille <demaille@gostai.com>
2491 Get rid of lalr1-split.cc.
2492 It was no longer maintainer.
2494 * data/lalr1-split.cc: Remove.
2495 * etc/bench.pl.in (bench_fusion_parser): Remove.
2498 2008-11-26 Akim Demaille <demaille@gostai.com>
2500 Use yy* consistently.
2501 * data/glr.c: Now that yyrhs no longer exists as a global
2502 variable, rename local "rhs" variables into "yyrhs" for
2505 2008-11-25 Akim Demaille <demaille@gostai.com>
2507 Get rid of yyrhs and yyprhs in glr.c.
2508 * data/glr.c (yyrhs, yyprhs): Remove.
2509 Instead, use the state stack and yystos.
2511 2008-11-25 Akim Demaille <demaille@gostai.com>
2514 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
2515 as an Autotest keyword.
2517 2008-11-25 Akim Demaille <demaille@gostai.com>
2519 Prefer TESTSUITE_FLAGS.
2520 TESTSUITEFLAGS is barely readable.
2522 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
2523 for backward compatibility.
2524 Use the former instead of the latter.
2526 2008-11-25 Akim Demaille <demaille@gostai.com>
2528 Get rid of yyrhs and yyprhs in larl1.java.
2529 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
2530 (yy_reduce_print): Rather, use yystos_ and the state stack.
2532 2008-11-25 Akim Demaille <demaille@gostai.com>
2536 2008-11-25 Akim Demaille <demaille@gostai.com>
2538 Get rid of yyrhs and yyprhs in yacc.c.
2539 They were used to get the symbol types, given a rule number, when
2540 displaying the top of the stack before a reduction. But the
2541 symbol type is available from the state stack. This has two be
2542 benefits: two tables less in the parser (making it smaller), and a
2543 more consistent use of the three stacks which will help to fuse
2546 * data/yacc.c (yyprhs, yyrhs): Remove.
2547 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
2548 (yy_reduce_print): Take yyssp as argument.
2549 Use it, together with yystos, to get the symbol type.
2550 * tests/regression.at (Web2c Report): Remove these tables from the
2553 2008-11-25 Akim Demaille <demaille@gostai.com>
2556 The point is to factor the generation of the tables across skeletons.
2557 This is language dependant.
2559 * data/c.m4 (b4_comment_): New.
2560 Should be usable to define how to generate tables independently of
2562 (b4_c_comment): New.
2563 (b4_comment): Bounce to b4_c_comment.
2564 Now support $2 = [PREFIX] for indentation.
2565 * data/lalr1.cc (b4_table_declare): Don't output a comment if
2566 there is no comment.
2567 Indent it properly when there is one.
2568 Output the ending semicolon.
2569 (b4_table_define): Space changes.
2570 Output the ending semicolon.
2571 (b4_tables_map): New.
2572 Use it twice instead of declaring and defining the (integral)
2575 2008-11-25 Akim Demaille <demaille@gostai.com>
2578 * data/lalr1.cc (b4_table_declare): New.
2579 Use it to declare the tables defined with b4_table_define.
2580 (b4_table_define): Declare a third arg to match b4_table_declare
2582 Move all the comments around invocations of b4_table_define into
2583 the invocations itselves.
2584 Move things around to have the order for declarations and
2587 2008-11-25 Akim Demaille <demaille@gostai.com>
2590 * data/lalr1.java: here.
2592 2008-11-25 Akim Demaille <demaille@gostai.com>
2594 b4_args is more general than only C++.
2595 * data/lalr1.cc (b4_args, _b4_args): Move to...
2596 * data/bison.m4: here.
2598 2008-11-21 Di-an Jan <dianj@freeshell.org>
2600 Implement no-XXX arguments for --warnings, --report, --trace.
2601 * src/getargs.c (flags_argmatch): Handles no-XXX.
2602 Fix typo in doxygen comment.
2604 2008-11-21 Akim Demaille <demaille@gostai.com>
2606 Display the changes in cross-options.texi.
2607 * build-aux/cross-options.pl ($sep): New, to separate items.
2608 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
2611 2008-11-20 Di-an Jan <dianj@freeshell.org>
2613 Improves options in the manual.
2614 * doc/bison.texinfo (-g, -x): Add space before argument.
2615 (Option Cross Key): Implement FIXME: listing directives also.
2616 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
2617 (Short Option): Special case -d. Put arguments inside @option.
2618 (Bison Directive): Add column, automatically extracted from
2619 src/scan-gram.l (actual name passed as the first argument)
2620 with special case for %define.
2621 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
2622 to build-aux/cross-options.pl.
2623 * src/getargs.c (usage): Document limitations of cross-options.pl.
2624 * src/scan-gram.l: Likewise.
2626 2008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2628 Fix unexpanded macros in GLR defines file.
2629 Reported by Csaba Raduly at
2630 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
2631 * THANKS (Csaba Raduly): Add.
2632 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
2633 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
2634 lexer in a separate module that includes the defines file.
2635 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
2637 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
2638 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
2639 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
2640 (AT_DATA_SOURCE_PROLOGUE): New.
2641 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
2642 (AT_DATA_SOURCE): New.
2643 (AT_FULL_COMPILE): Extend to support an additional source file.
2645 2008-11-18 Akim Demaille <demaille@gostai.com>
2648 * TODO: More short term issues.
2650 2008-11-18 Akim Demaille <demaille@gostai.com>
2653 * src/parse-gram.h, src/parse-gram.c: Regen.
2655 2008-11-18 Akim Demaille <demaille@gostai.com>
2657 Use b4_subtract where possible.
2658 * data/lalr1.cc (b4_subtract): Move to...
2659 * data/bison.m4: here.
2660 * data/glr.c (b4_rhs_data): Use it.
2661 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
2663 2008-11-18 Akim Demaille <demaille@gostai.com>
2665 Remove incorrect mode specification.
2666 * data/glr.cc: Don't pretend it's C code.
2668 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2670 Simplify last patch slightly.
2671 * src/getargs.c (getargs): Here.
2673 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2675 Fix last warning from --enable-gcc-warnings.
2676 * src/getargs.c (getargs): Don't assign const address to non-const
2679 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2681 Don't let maintainer-*-check targets force a version update.
2682 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
2685 2008-11-17 Di-an Jan <dianj@freeshell.org>
2687 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
2688 Align menus. Adjust word wrapping. Use node names for menu names.
2689 (Examples): Don't abbreviate node names.
2690 (LocalWords): Remove abbreviations.
2691 (Copying): Make description a sentence.
2692 (Java Action Features): Remove period to match the rest of menu.
2694 2008-11-17 Di-an Jan <dianj@freeshell.org>
2696 Handles several --enable-gcc-warnings.
2697 * src/getargs.c (command_line_location): Set parameters to void.
2698 * src/output.c (symbol_type_name_cmp): Make static.
2699 (symbols_by_type_name): Set parameters to void.
2700 (symbol_definitions_output): Remove unused parameter. Rename as...
2701 (prepare_symbol_definitions): this.
2702 (muscles_output): Move symbol_definitions_output to...
2703 (output): here as prepare_symbol_definitions.
2704 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
2705 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
2707 2008-11-17 Di-an Jan <dianj@freeshell.org>
2709 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
2710 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
2712 2008-11-16 Akim Demaille <demaille@gostai.com>
2714 Add missing $(EXEEXT).
2715 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
2716 "src/bison$(EXEEXT)".
2717 Reported by Di-an Jan.
2719 2008-11-15 Akim Demaille <demaille@gostai.com>
2723 2008-11-15 Akim Demaille <demaille@gostai.com>
2726 * tests/input.at: here.
2728 2008-11-15 Akim Demaille <demaille@gostai.com>
2730 Remove duplicate header inclusion.
2733 2008-11-15 Akim Demaille <demaille@gostai.com>
2735 * src/parse-gram.h, src/parse-gram.c: Regen.
2737 2008-11-15 Akim Demaille <demaille@gostai.com>
2739 Support parametric types.
2741 There are two issues to handle: first scanning nested angle
2742 bracket pairs to support types such as std::pair< std::string,
2743 std::list<std::string> > >.
2745 Another issue is to address idiosyncracies of C++: do not glue two
2746 closing angle brackets together (otherwise it's operator>>), and
2747 avoid sticking blindly a TYPE to the opening <, as it can result
2748 in '<:' which is a digraph for '['.
2750 * src/scan-gram.l (brace_level): Rename as...
2753 Implement support for complex tags.
2756 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
2757 (b4_symbol_variant): Leave space around types as parameters.
2758 * examples/variant.yy: Use nested template types and leading ::.
2759 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
2761 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
2762 * tests/c++.at: Test parametric types.
2764 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2767 This is not sufficient, but we test at least that the make_SYMBOL
2768 interface is not affected by token.prefix. A more general test
2769 will be implemented when the support of token.prefix is generalized
2772 * tests/c++.at: One more variant test, using token.prefix.
2774 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2776 Test the make_TOKEN interface.
2777 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
2778 Factor the common code in yylex.
2779 Use it to test "%define lex_symbol".
2781 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2785 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2787 Simplify code for variants bench marks.
2788 * etc/bench.pl.in (&generate_grammar_list): Define and use
2790 Factor the common code in yylex.
2792 2008-11-15 Akim Demaille <demaille@gostai.com>
2794 Better error message.
2795 * bootstrap (find_tool): Fix the error message.
2797 2008-11-15 Akim Demaille <demaille@gostai.com>
2799 Update variant.yy to newest interface.
2800 * examples/variant.yy: Define lex_symbol.
2803 2008-11-15 Akim Demaille <demaille@gostai.com>
2805 Don't use locations in variant.yy.
2806 * examples/variant.yy: Adjust to not using locations.
2808 2008-11-15 Akim Demaille <demaille@gostai.com>
2811 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
2812 comments for the license.
2814 2008-11-15 Akim Demaille <demaille@gostai.com>
2816 Remove tests/Makefile.am.
2817 * tests/Makefile.am: Rename as...
2818 * tests/local.mk: this.
2819 * Makefile.am, configure.ac: Adjust.
2820 * Makefile.am (DISTCLEANFILES): Define.
2821 (maintainer-check, maintainer-xml-check, maintainer-push-check):
2822 Remove, we no longer need to bounce to the real targets.
2824 2008-11-15 Akim Demaille <demaille@gostai.com>
2828 2008-11-15 Akim Demaille <demaille@gostai.com>
2831 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
2832 * djgpp/local.mk: this new file.
2834 2008-11-15 Akim Demaille <demaille@gostai.com>
2836 Remove doc/Makefile.am.
2837 * doc/Makefile.am: Rename as...
2838 * doc/local.mk: this.
2840 * Makefile.am, configure.ac: Adjust.
2841 * Makefile.am (MOSTLYCLEANFILES): New.
2842 * src/local.mk: Adjust.
2844 2008-11-15 Akim Demaille <demaille@gostai.com>
2846 Move sc_tight_scope into maint.mk.
2847 It does not work, and I don't know how it was supposed to work: it
2848 seems to be looking for sources in the build tree. I just moved
2849 it at a better place, fixing it is still required.
2851 * src/local.mk (echo): Remove.
2852 (sc_tight_scope): Move to...
2855 2008-11-15 Akim Demaille <demaille@gostai.com>
2858 * src/parse-gram.h, src/parse-gram.h: Regen.
2860 2008-11-15 Akim Demaille <demaille@gostai.com>
2862 Remove src/Makefile.am.
2863 * src/Makefile.am: Rename as...
2864 * src/local.mk: this.
2865 Prefix all the paths with src/.
2866 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
2867 (AM_CPPFLAGS): Find find in builddir/src.
2868 (YACC): Move the flags into...
2870 * maint.mk (sc_tight_scope): Disable.
2871 It used to bounce to the version in src/Makefile.am which is now
2872 part of this very Makefile.
2873 * Makefile.am, configure.ac: Adjust.
2874 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
2875 include "..." to find files "here": we are no longer in src/, so
2876 qualify the includes with src/.
2877 * doc/Makefile.am (PREPATH): No longer include the top_builddir
2879 (.x.1): Adjust to be able to create src/foo from the top level
2880 Makefile, instead of going bounce to src/Makefile the creation of
2883 2008-11-15 Akim Demaille <demaille@gostai.com>
2885 Remove useless variable.
2886 * doc/Makefile.am (srcsrcdir): Remove.
2888 2008-11-15 Akim Demaille <demaille@gostai.com>
2890 Remove data/Makefile.am.
2891 * data/Makefile.am: Rename as...
2892 * data/local.mk: this.
2894 * Makefile.am, configure.ac: Adjust.
2896 2008-11-15 Akim Demaille <demaille@gostai.com>
2898 Remove etc/Makefile.am.
2899 * etc/Makefile.am: Rename as...
2900 * etc/local.mk: this.
2902 * Makefile.am, configure.ac: Adjust.
2904 2008-11-15 Akim Demaille <demaille@gostai.com>
2906 Remove examples/local.mk.
2907 examples/calc++/Makefile.am might be interesting to keep as is, since
2908 it is an example in itself.
2910 * examples/Makefile.am: Rename as...
2911 * examples/local.mk: this.
2913 * Makefile.am, configure.ac: Adjust.
2915 2008-11-15 Akim Demaille <demaille@gostai.com>
2917 Remove build-aux/Makefile.am.
2918 Recursive Makefiles are really way too slow, let's get rid of some of
2921 * build-aux/Makefile.am: Rename as...
2922 * build-aux/local.mk: this.
2924 * Makefile.am, configure.ac: Adjust.
2926 2008-11-15 Akim Demaille <demaille@gostai.com>
2928 Provide convenience constructors for locations and positions.
2929 * data/location.cc (position::position): Accept file, line and
2930 column as arguments with default values.
2931 Always qualify initial line and column literals as unsigned.
2932 (location::location): Provide convenience constructors.
2934 2008-11-15 Akim Demaille <demaille@gostai.com>
2936 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
2938 Using template buys us nothing, and makes it uselessly complex to
2939 construct a symbol. Besides, it could not be generalized to other
2940 languages, while make_FOO would work in C/Java etc.
2942 * data/lalr1.cc (b4_symbol_): New.
2943 (b4_symbol): Use it.
2944 (b4_symbol_constructor_declaration_)
2945 (b4_symbol_constructor_definition_): Instead of generating
2946 specializations of an overloaded template function, just generate
2947 several functions whose names are forged from the token names
2948 without the token.prefix.
2949 (b4_symbol_constructor_declarations): Generate them for all the
2950 symbols, not just by class of symbol type, now that instead of
2951 specializing a function template by the token, we generate a
2952 function named after the token.
2953 (b4_symbol_constructor_specialization_)
2954 (b4_symbol_constructor_specializations): Remove.
2955 * etc/bench.pl.in: Adjust to this new API.
2957 2008-11-13 Akim Demaille <demaille@gostai.com>
2959 %define token.prefix.
2960 Provide a means to add a prefix to the name of the tokens as
2961 output in the generated files. Because of name clashes, it is
2962 good to have such a prefix such as TOK_ that protects from names
2963 such as EOF, FILE etc. But it clutters the grammar itself.
2965 * data/bison.m4 (token.prefix): Empty by default.
2966 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
2967 * data/lalr1.cc (b4_symbol): Ditto.
2969 2008-11-13 Akim Demaille <demaille@gostai.com>
2971 Compute at M4 time some of the subtractions.
2972 * data/lalr1.cc (b4_subtract): New.
2973 (b4_rhs_data): Use it.
2975 2008-11-13 Akim Demaille <demaille@gostai.com>
2978 This allows the user to get the type of a token returned by yylex.
2980 * data/lalr1.cc (symbol::token): New.
2981 (yytoknum_): Define when %define lex_symbol, independently of
2983 (yytoken_number_): Move into...
2984 (symbol::token): here, since that's the only use.
2985 The other one is YYPRINT which was not officially supported
2986 by lalr1.cc, and anyway it did not work since YYPRINT uses this
2987 array under a different name (yytoknum).
2989 2008-11-13 Akim Demaille <demaille@gostai.com>
2992 * TODO (YYERRCODE): Mention the case of $undef.
2994 2008-11-13 Akim Demaille <demaille@gostai.com>
2997 * TODO (YYPRINT): New.
2999 2008-11-13 Akim Demaille <demaille@gostai.com>
3002 * data/lalr1.cc, data/yacc.c: Fix the description of the
3003 yytranslate and yytoknum tables.
3005 2008-11-13 Akim Demaille <demaille@gostai.com>
3007 Define make_symbol in the header.
3008 To reach good performances these functions should be inlined (yet
3009 this is to measure precisely). To this end they must be available
3012 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
3013 location_type with the class name.
3014 Since will now be output in the header, declare "inline".
3015 No longer use b4_symbol_constructor_specializations, but
3016 b4_symbol_constructor_definitions in the header.
3017 Don't call it in the *.cc file.
3019 2008-11-13 Akim Demaille <demaille@gostai.com>
3021 Define yytranslate in the header for lex_symbol.
3022 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
3023 into the header file when using %define lex_symbol.
3024 (yytranslate_): Declare inline.
3026 2008-11-13 Akim Demaille <demaille@gostai.com>
3028 Define the constructors of symbol_type in
3029 b4_symbol_constructor_definitions.
3030 The constructors are called by the make_symbol functions, which a
3031 forthcoming patch will move elsewhere. Hence the interest of
3032 putting them together.
3034 The stack_symbol_type does not need to be moved, it is used only
3037 * data/lalr1.cc: Move symbol_type and symbol_base_type
3038 constructors into...
3039 (b4_symbol_constructor_definitions): here.
3042 2008-11-13 Akim Demaille <demaille@gostai.com>
3044 Make it easier to move the definition of yytranslate_.
3045 Forthcoming changes will make it possible to use yytranslate_
3046 from outside the parser implementation file.
3048 * data/lalr1.cc (b4_yytranslate_definition): New.
3051 2008-11-13 Akim Demaille <demaille@gostai.com>
3053 Remove useless class specification.
3054 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
3055 to refer to the class name to use a type defined by the class for
3056 arguments of member functions.
3058 2008-11-13 Akim Demaille <demaille@gostai.com>
3060 Finer input type for yytranslate.
3061 This patch is debatable: the tradition expects yylex to return an int
3062 which happens to correspond to token_number (which is an enum). This
3063 allows for instance to return characters (such as '*' etc.). But this
3064 goes against the stronger typing I am trying to have with the new
3065 lex interface which return a symbol_type. So in this case, feed
3066 yytranslate_ with a token_type.
3068 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
3069 expect a token_type.
3071 2008-11-13 Akim Demaille <demaille@gostai.com>
3073 Honor lex-params in %define lex_symbol mode.
3074 * data/lalr1.cc: Use b4_lex_param.
3076 2008-11-13 Akim Demaille <demaille@gostai.com>
3079 * src/output.c (symbol_definitions_output): Rename symbol
3080 attributes type_name and has_type_name as type and has_type.
3081 * data/lalr1.cc: Adjust uses.
3083 2008-11-13 Akim Demaille <demaille@gostai.com>
3085 Use b4_type_names for the union type.
3086 The union used to compute the size of the variant used to iterate
3087 over the type of all the symbols, with a lot of redundancy. Now
3088 iterate over the lists of symbols having the same type-name.
3090 * data/lalr1.cc (b4_char_sizeof_): New.
3091 (b4_char_sizeof): Use it.
3092 Adjust to be called with a list of numbers instead of a single
3094 Adjust its caller for new-line issues.
3096 2008-11-13 Akim Demaille <demaille@gostai.com>
3098 Define the "identifier" of a symbol.
3099 Symbols may have several string representations, for instance if
3100 they have an alias. What I call its "id" is a string that can be
3101 used as an identifier. May not exist.
3103 Currently the symbols which have the "tag_is_id" flag set are
3104 those that don't have an alias. Look harder for the id.
3106 * src/output.c (is_identifier): Move to...
3107 * src/symtab.c (is_identifier): here.
3108 * src/symtab.h, src/symtab.c (symbol_id_get): New.
3109 * src/output.c (symbol_definitions_output): Use it to define "id"
3111 Remove the definition of "tag_is_id".
3112 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
3113 "tag_is_id" were used to produce code.
3114 We still use "tag" for documentation.
3116 2008-11-11 Akim Demaille <demaille@gostai.com>
3118 Locations are no longer required by lalr1.cc.
3119 * data/lalr1.cc (_b4_args, b4_args): New.
3120 Adjust all uses of locations to make them optional.
3121 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
3122 (AT_CHECK_NAMESPACE): Check the use of locations.
3123 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
3124 without locations with lalr1.cc.
3126 * tests/output.at: Check lalr1.cc with and without location
3128 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
3129 Don't use locations.
3131 2008-11-11 Akim Demaille <demaille@gostai.com>
3134 * tests/local.at (AT_FULL_COMPILE): New.
3135 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
3137 2008-11-11 Akim Demaille <demaille@gostai.com>
3139 Support parens in calc++.
3140 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
3141 * examples/calc++/test (run): Check the expected output.
3145 2008-11-11 Akim Demaille <demaille@gostai.com>
3147 Simplify lalr1.cc since %defines is mandatory.
3148 * data/lalr1.cc: Remove useless calls to b4_defines_if.
3150 2008-11-11 Akim Demaille <demaille@gostai.com>
3153 * TODO (yysyntax_error): New item.
3155 2008-11-11 Akim Demaille <demaille@gostai.com>
3158 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
3161 2008-11-11 Akim Demaille <demaille@gostai.com>
3163 Support i18n of the parse error messages.
3164 * TODO (lalr1.cc/I18n): Remove.
3165 * data/lalr1.cc (yysyntax_error_): Support the translation of the
3166 error messages, as done in yacc.c.
3167 Stay within the yy* pseudo namespace.
3169 2008-11-11 Akim Demaille <demaille@gostai.com>
3172 * TODO (single stack, yysyntax_error): New.
3174 2008-11-11 Akim Demaille <demaille@gostai.com>
3176 Make it possible to return a symbol_type from yylex.
3177 * data/lalr1.cc (b4_lex_symbol_if): New.
3178 (parse): When lex_symbol is defined, expected yylex to return the
3180 * etc/bench.pl.in (generate_grammar_list): Extend to support this
3182 (bench_variant_parser): Exercise it.
3184 2008-11-11 Akim Demaille <demaille@gostai.com>
3186 Remove useless bench case.
3187 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
3190 2008-11-11 Akim Demaille <demaille@gostai.com>
3192 Improve display of directives.
3193 * etc/bench.pl.in (parse_term): Don't add useless eol.
3195 2008-11-11 Akim Demaille <demaille@gostai.com>
3197 Use string_cast in the bench.
3198 * etc/bench.pl.in (generate_grammar_list): Define and use
3201 2008-11-11 Akim Demaille <demaille@gostai.com>
3203 Replace yychar with a Boolean.
3204 * data/lalr1.cc (parse::yychar): Replace by...
3205 (parse::yyempty): this.
3207 2008-11-11 Akim Demaille <demaille@gostai.com>
3212 2008-11-11 Akim Demaille <demaille@gostai.com>
3214 Let yytranslate handle the eof case.
3215 * data/lalr1.cc (yytranslate_): Handle the EOF case.
3217 No longer expect yychar to be equal to yyeof_, rather, test the
3218 lookahead's (translated) kind.
3220 2008-11-11 Akim Demaille <demaille@gostai.com>
3222 yychar cannot be empty in yyerrlab.
3223 * TODO (yychar == yyempty_): New.
3224 * data/lalr1.cc: Remove the handling of this case.
3225 This eases forthcoming changes related to yychar and yytranslate.
3227 2008-11-11 Akim Demaille <demaille@gostai.com>
3229 Bench: syntactic sugar for %define/#define.
3230 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
3231 (&bench_push_parser, bench_variant_parser): Use this feature.
3235 2008-11-11 Akim Demaille <demaille@gostai.com>
3237 Less memory pressure on the "list" bench.
3238 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
3239 the values, to limit memory pressure.
3241 2008-11-11 Akim Demaille <demaille@gostai.com>
3243 Introduce make_symbol.
3244 make_symbol provides a means to construct a full symbol (kind,
3245 value, location) in a single shot. It is meant to be a Symbol
3246 constructor, parameterized by the symbol kind so that overloading
3247 would prevent incorrect kind/value pairs. Unfortunately
3248 parameterized constructors do not work well in C++ (unless the
3249 parameter also appears as an argument, which is not acceptable),
3250 hence the use of a function instead of a constructor.
3252 * data/lalr1.cc (b4_symbol_constructor_declaration_)
3253 (b4_symbol_constructor_declarations)
3254 (b4_symbol_constructor_specialization_)
3255 (b4_symbol_constructor_specializations)
3256 (b4_symbol_constructor_definition_)
3257 (b4_symbol_constructor_definitions): New.
3258 Use them where appropriate to generate declaration, declaration of
3259 the specializations, and implementations of the templated
3260 overloaded function "make_symbol".
3261 (variant::variant): Always define a default ctor.
3262 Also provide a copy ctor.
3263 (symbol_base_type, symbol_type): New ctor overloads for value-less
3265 (symbol_type): Now public, so that functions such as yylex can use
3268 2008-11-11 Akim Demaille <demaille@gostai.com>
3270 Inform m4 whether a tag is a valid id.
3271 * src/output.c (is_identifier): New.
3272 (symbol_definitions_output): Use it to define tag_is_id.
3273 But maybe this should be done at m4 level?
3275 2008-11-11 Akim Demaille <demaille@gostai.com>
3277 Test 214 was failing: it greps with a pattern containing [ ]*
3278 which obviously meant to catch spaces and tabs, but contained only
3279 spaces. Tabulations in sources are a nuisance, so to simplify the
3280 matter, get rid of all the tabulations in the Java sources. The
3281 other skeletons will be treated equally later.
3283 * data/java.m4, data/lalr1.java: Untabify.
3284 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
3285 tabulations are no longer generated.
3287 2008-11-11 Paolo Bonzini <bonzini@gnu.org>
3289 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
3290 * configure.ac: Adjust usage.
3291 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3292 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3293 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
3295 2008-11-10 Di-an Jan <dianj@freeshell.org>
3297 Workaround Java's ``code too large'' problem for parser tables
3298 in most cases, by using one function per initialization.
3299 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
3300 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
3301 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
3302 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
3303 (yytname_): Use b4_typed_parser_table.
3304 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
3305 ``code too large'' error.
3307 2008-11-10 Di-an Jan <dianj@freeshell.org>
3309 * NEWS: Document them.
3311 General Java skeleton improvements.
3312 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
3313 using gcj < 4.3 in the testsuite, according to comments in
3314 gnulib/m4/javacomp.m4.
3315 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
3316 location_type, position_type): Remove extraneous brackets from
3317 b4_percent_define_default.
3318 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
3319 m4_define and m4_define_default.
3320 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
3321 which marks the end of user code with appropriate syncline, like all
3322 the other skeletons.
3323 (b4_user_post_prologue): Add. Don't silently drop.
3325 (parse): Inline yylex.
3326 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
3327 (%{...%}): Fix typo of %code imports.
3328 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
3330 Support annotations on parser class with %define annotations.
3331 * data/lalr1.java (annotations): Add to parser class modifier.
3332 * doc/bison.texinfo (Java Parser Interface): Document
3333 %define annotations.
3334 (Java Declarations Summary): Document %define annotations.
3335 * tests/java.at (Java parser class modifiers): Test annotations.
3337 Do not generate code for %error-verbose unless requested.
3338 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
3339 Make private. Make conditional on %error-verbose.
3340 (getErrorVerbose, setErrorVerbose): New.
3341 (yytnamerr_): Make conditional on %error-verbose.
3342 (yysyntax_error): Make some code conditional on %error-verbose.
3343 * doc/bison.texinfo (Java Bison Interface): Remove the parts
3344 about %error-verbose having no effect.
3345 (getErrorVerbose, setErrorVerbose): Document.
3347 Move constants for token names to Lexer interface.
3348 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
3349 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
3350 (parse): Qualify EOF to Lexer.EOF.
3351 * doc/bison.texinfo (Java Parser Interface): Move documentation of
3352 EOF and token names to Java Lexer Interface.
3353 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
3355 Make yyerror public.
3356 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
3357 (yyerror): Change to public. Add Javadoc comments. Use longer
3358 parameter names. Make the body rather than the declarator
3359 conditional on %locations.
3360 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
3362 Allow user to add code to the constructor with %code init.
3363 * data/java.m4 (b4_init_throws): New, for %define init_throws.
3364 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
3365 Add %code init to the front of the constructor body.
3366 * doc/bison.texinfo (YYParser.YYParser): Document %code init
3367 and %define init_throws.
3368 (Java Declarations Summary): Document %code init and
3369 %define init_throws.
3370 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
3371 (Java constructor init and init_throws): Add tests.
3373 2008-11-10 Akim Demaille <demaille@gostai.com>
3376 * TODO (-D): is implemented.
3377 (associativity): Same precedence must have the same associativity.
3378 For instance, how can a * b / c be parsed if * is %left and / is
3380 (YYERRORCODE, YYFAIL, YYBACKUP): New.
3382 2008-11-10 Akim Demaille <demaille@gostai.com>
3386 2008-11-10 Akim Demaille <demaille@gostai.com>
3388 More information about the symbols.
3389 * src/output.c (type_names_output): Document all the symbols,
3390 including those that don't have a type-name.
3391 (symbol_definitions_output): Define "is_token" and
3393 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
3394 type-name, now that they are defined too in b4_type_names.
3396 2008-11-10 Akim Demaille <demaille@gostai.com>
3400 2008-11-10 Akim Demaille <demaille@gostai.com>
3402 Make parser::yytranslate static.
3403 Small speedup (1%) on the list grammar. And makes yytranslate_
3404 available in non member functions.
3406 * data/lalr1.cc (yytranslate_): Does not need to be a instance
3409 2008-11-10 Akim Demaille <demaille@gostai.com>
3411 Avoid trailing spaces.
3412 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
3413 * data/lalr1.cc: Don't indent before rule and symbol actions, as
3414 they can be empty, and anyway this incorrectly indents the first
3417 2008-11-10 Akim Demaille <demaille@gostai.com>
3421 2008-11-10 Akim Demaille <demaille@gostai.com>
3423 Use "enum" for integral constants.
3424 This is just nicer to read, I observed no speedup.
3426 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
3427 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
3428 (yyuser_token_number_max_, yyundef_token_): Move into...
3429 (yytranslate_): here.
3431 2008-11-10 Akim Demaille <demaille@gostai.com>
3433 Shortcuts in bench directives.
3434 * etc/bench.pl.in (parse_dirs): New.
3436 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
3437 Create the benches in "benches/".
3439 2008-11-10 Akim Demaille <demaille@gostai.com>
3442 * data/lalr1.cc: here.
3444 2008-11-10 Akim Demaille <demaille@gostai.com>
3446 Adjust verbose message to using emacs.
3447 * etc/bench.pl.in: Inform compilation-mode when we change the
3449 (generate_grammar_list): Recognize %define "variant" in addition
3452 2008-11-10 Akim Demaille <demaille@gostai.com>
3454 Classify symbols by type-name.
3455 * src/uniqstr.h (UNIQSTR_CMP): New.
3456 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
3457 (type_names_output): New.
3458 (muscles_output): Use it.
3459 * data/lalr1.cc (b4_symbol_action_): Remove.
3460 (b4_symbol_case_, b4_type_action_): New.
3461 Adjust uses of b4_symbol_action_ to use b4_type_action_.
3463 2008-11-10 Akim Demaille <demaille@gostai.com>
3465 Change the handling of the symbols in the skeletons.
3466 Before we were using tables which lines were the symbols and which
3467 columns were things like number, tag, type-name etc. It is was
3468 difficult to extend: each time a column was added, all the numbers had
3469 to be updated (you asked for colon $2, not for "tag"). Also, it was
3470 hard to filter these tables when only a subset of the symbols (say the
3471 tokens, or the nterms, or the tokens that have and external number
3472 *and* a type-name) was of interest.
3474 Now instead of monolithic tables, we define one macro per cell. For
3475 instance "b4_symbol(0, tag)" is a macro name which contents is
3476 self-decriptive. The macro "b4_symbol" provides easier access to
3479 * src/output.c (type_names_output): Remove.
3480 (symbol_numbers_output, symbol_definitions_output): New.
3481 (muscles_output): Call them.
3482 (prepare_symbols): Define b4_symbols_number.
3484 2008-11-10 Akim Demaille <demaille@gostai.com>
3487 * src/getargs.h, src/getargs.c (trace_muscle): New.
3488 (trace_types, trace_args): Support it.
3489 * src/output.c (output_skeleton): Use it.
3491 2008-11-10 Akim Demaille <demaille@gostai.com>
3494 * src/output.c (muscles_output): New, extracted from...
3495 (output_skeleton): here.
3498 2008-11-10 Akim Demaille <demaille@gostai.com>
3502 2008-11-10 Akim Demaille <demaille@gostai.com>
3504 Update the variant example.
3505 * examples/variant.yy: Formatting changes.
3508 2008-11-10 Akim Demaille <demaille@gostai.com>
3510 Support constructor with an argument.
3511 This improves the "list" bench by 2%.
3513 * data/lalr1.cc (variant::build): Add an overloaded version with
3515 * tests/c++.at (AT_CHECK_VARIANT): Check it.
3517 2008-11-10 Akim Demaille <demaille@gostai.com>
3520 * tests/c++.at (AT_CHECK_VARIANTS): New.
3521 Use it with and without %define assert.
3523 2008-11-10 Akim Demaille <demaille@gostai.com>
3525 Add %precedence support.
3526 Unfortunately it is not possible to reuse the %prec directive. This
3527 is because to please POSIX, we do not require to end the rules with a
3528 semicolon. As a result,
3532 is ambiguous: either a rule which precedence is that of baz, or a rule,
3533 and then a declaration of the precedence of the token baz.
3535 * doc/bison.texinfo: Document %precedence.
3536 (Precedence Only): New.
3537 * src/assoc.h, src/assoc.c (precedence_assoc): New.
3538 * src/conflicts.c (resolve_sr_conflict): Support it.
3539 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
3541 * tests/calc.at: Use %precedence for NEG.
3542 * tests/conflicts.at (%precedence does not suffice)
3543 (%precedence suffices): New tests.
3545 2008-11-09 Akim Demaille <demaille@gostai.com>
3547 Make benches in a sub dirs.
3548 * etc/bench.pl.in ($dir): New.
3550 Check the use of constructors with an argument.
3551 (bench_variant_parser): Fix.
3553 2008-11-09 Akim Demaille <demaille@gostai.com>
3557 2008-11-09 Akim Demaille <demaille@gostai.com>
3561 2008-11-09 Akim Demaille <demaille@gostai.com>
3563 Require the generation of parse-gram.output.
3564 * src/Makefile.am (YACC): Pass --report=all.
3566 2008-11-09 Akim Demaille <demaille@gostai.com>
3570 2008-11-09 Akim Demaille <demaille@gostai.com>
3573 * TODO: Remove obsolete items.
3576 2008-11-09 Akim Demaille <demaille@gostai.com>
3579 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
3580 (@token, $grammar, $bench): New.
3581 (generate_grammar_variant): Rename as...
3582 (generate_grammar_list): this.
3583 (generate_grammar): Adjust.
3584 (bench_grammar): Rename as...
3586 Use it in the various bench-marking routines.
3587 (-b, -g): New options.
3589 2008-11-09 Akim Demaille <demaille@gostai.com>
3591 Use a static hierarchy for symbols in the C++ parser.
3592 * data/lalr1.cc (symbol_base_type, symbol_type)
3593 (stack_symbol_type): Make it a static hierarchy.
3594 Adjust dependencies.
3596 2008-11-09 Akim Demaille <demaille@gostai.com>
3598 bench.pl -d, --directive.
3599 * etc/bench.pl.in (@directive): New.
3600 (&bench_grammar): Use it.
3601 (&bench_list_grammar): New, to provide access to the "variant"
3604 (getopts): Support -d, --directive.
3606 2008-11-09 Akim Demaille <demaille@gostai.com>
3608 Use inline for small operations.
3609 * data/lalr1.cc (symbol_base_type, symbol_type)
3610 (stack_symbol_type): Declare constructor and other operations as
3612 (yy_destroy_): Inline.
3614 2008-11-09 Akim Demaille <demaille@gostai.com>
3616 Introduce a hierarchy for symbols.
3617 * data/lalr1.cc (symbol_base_type, symbol_type): New.
3618 (data_type): Rename as...
3619 (stack_symbol_type): this.
3620 Derive from symbol_base_type.
3621 (yy_symbol_value_print_): Merge into...
3622 (yy_symbol_print_): this.
3625 (yydestruct_): Rename as...
3626 (yy_destroy_): this.
3627 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
3628 (parser::parse): yyla is now of symbol_type.
3629 Use its type member instead of yytoken.
3631 2008-11-09 Akim Demaille <demaille@gostai.com>
3633 Rename data_type and stack_symbol_type.
3634 * data/lalr1.cc (data_type): Rename as...
3635 (stack_symbol_type): this.
3637 2008-11-09 Akim Demaille <demaille@gostai.com>
3639 Handle semantic value and location together.
3640 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
3641 yydata.value and yydata.location.
3642 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
3643 (YY_SYMBOL_PRINT): Now take semantic value and location as a
3646 (yydestruct_): New overload for a stack symbol.
3648 2008-11-09 Akim Demaille <demaille@gostai.com>
3650 Push a complete symbol, not connected parts.
3651 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
3652 state, value and location.
3655 2008-11-09 Akim Demaille <demaille@gostai.com>
3657 Agregate yylval and yylloc.
3658 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
3659 (parser::yyla): this.
3661 2008-11-09 Akim Demaille <demaille@gostai.com>
3663 Rely on the state stack to display reduction traces.
3664 To display rhs symbols before a reduction, we used information
3665 about the rule reduced, which required the tables yyrhs and
3666 yyprhs. Now use rely only on the state stack to get the same
3669 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
3671 (parser::yyrhs_, parser::yyprhs_): Remove.
3672 (parser::yy_reduce_print_): Use the state stack.
3674 2008-11-09 Akim Demaille <demaille@gostai.com>
3676 Fuse yyval and yyloc into yylhs.
3677 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
3679 (parse): Replace yyval and yyloc with yylhs.value and
3681 After a user action, compute yylhs.state earlier.
3682 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
3685 2008-11-09 Di-an Jan <dianj@freeshell.org>
3687 Remove unused variable.
3688 * src/output.c (type_names_output): Remove unused variable sep.
3690 2008-11-09 Paolo Bonzini <bonzini@gnu.org>
3692 Change tests/output.at quoting.
3693 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
3694 expanding arguments.
3696 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3698 Don't add a semicolon to actions for %skeleton or %language.
3699 It breaks Java test cases as reported by Akim Demaille.
3700 * src/scan-code.l: Implement.
3702 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3704 Clean up %skeleton and %language priority implementation.
3705 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
3706 remove static qualifier because others will soon need to see it.
3707 (language_prio): Likewise.
3708 (getargs): Use command_line_prio rather than 0.
3709 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
3711 (skeleton_prio): Extern it.
3712 (language_prio): Extern it.
3713 * src/parse-gram.y: Use grammar_prio rather than 1.
3715 2008-11-07 Akim Demaille <demaille@gostai.com>
3717 Moving push traces into yypush_.
3718 * data/lalr1.cc (yypush_): Now takes a optional trace message.
3721 2008-11-07 Akim Demaille <demaille@gostai.com>
3723 The single-stack C++ parser is now the standard one.
3724 * data/lalr1.cc: Rename as...
3725 * data/lalr1-split.cc: this.
3726 * data/lalr1-fusion.cc: Rename as...
3727 * data/lalr1.cc: this.
3728 * etc/bench.pl.in: Adjust.
3730 2008-11-07 Akim Demaille <demaille@gostai.com>
3732 Avoid empty-if warnings.
3733 Reported by Quentin Hocquet.
3735 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
3736 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
3738 2008-11-07 Akim Demaille <demaille@gostai.com>
3740 Pass command line location to skeleton_arg and language_argmatch.
3741 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
3742 The location argument is now mandatory.
3743 Adjust all dependencies.
3744 (getargs): Use command_line_location.
3746 2008-11-07 Akim Demaille <demaille@gostai.com>
3749 * src/getargs.c (usage): Document -D.
3750 Fix help string for --locations.
3751 (command_line_location): New.
3752 (short_options, long_options, getargs): Support -D, --define.
3753 (getargs): Move -d support at the right place.
3754 * doc/bison.texinfo (Bison Options): Update.
3755 * tests/input.at (%define, --define): New.
3757 2008-11-07 Akim Demaille <demaille@gostai.com>
3759 Initialize the muscle table before parsing the command line.
3760 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
3761 (getargs): Define file_name.
3762 * src/main.c (main): Initialize muscle_tab before calling
3764 * src/muscle_tab.c (muscle_init): No longer define file_name, as
3765 its value is not available yet.
3767 2008-11-07 Akim Demaille <demaille@gostai.com>
3769 Locations without columns for command line arguments.
3770 * src/location.c (location_print): Don't display negative columns.
3771 * src/location.h: Document this.
3773 2008-11-07 Akim Demaille <demaille@gostai.com>
3776 * src/getargs.c (usage): Fix help string for -W.
3778 2008-11-07 Akim Demaille <demaille@gostai.com>
3780 Handle more general types of option arguments.
3781 * build-aux/cross-options.pl: The argument ends at the first
3782 space, not the first non-symbol character.
3783 Use @var for each word appearing the argument description.
3785 2008-11-07 Akim Demaille <demaille@gostai.com>
3787 Destroy the variants that remain on the stack in case of error.
3788 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
3790 Display the value only if yymsg is nonnull.
3791 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
3793 2008-11-07 Akim Demaille <demaille@gostai.com>
3795 Add "%define assert" to variants.
3796 This is used to help the user catch cases where some value gets
3797 ovewritten by a new one. This should not happen, as this will
3800 Unfortunately this uncovered a bug in the C++ parser itself: the
3801 lookahead value was not destroyed between two calls to yylex. For
3802 instance if the previous lookahead was a std::string, and then an int,
3803 then the value of the std::string was correctly taken (i.e., the
3804 lookahead was now an empty string), but std::string structure itself
3807 This is now done in variant::build(other&) (which is used to take the
3808 value of the lookahead): other is not only stolen from its value, it
3809 is also destroyed. This incurs a new performance penalty of a few
3810 percent, and union becomes faster again.
3812 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
3813 (b4_variant_if): New.
3814 (variant::built): New.
3815 Use it whereever the status of the variant changes.
3816 * etc/bench.pl.in: Check the penalty of %define assert.
3818 2008-11-07 Akim Demaille <demaille@gostai.com>
3820 Use "%define variant" in bench.pl.
3821 * etc/bench.pl.in: No longer use the pseudo directive %variants,
3822 just use %define variants.
3824 2008-11-07 Akim Demaille <demaille@gostai.com>
3827 * src/parse-gram.h, src/parse-gram.c: Regen.
3829 2008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
3831 Fix user actions without a trailing semicolon.
3832 Reported by Sergei Steshenko at
3833 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
3834 * THANKS (Sergei Steshenko): Add.
3835 * src/scan-code.l (SC_RULE_ACTION): Fix it.
3836 * tests/regression.at (Fix user actions without a trailing semicolon):
3839 2008-11-04 Akim Demaille <demaille@gostai.com>
3841 Use b4_copyright_years.
3842 * data/yacc.c (b4_copyright_years): New.
3843 Fix its value according to the comments in the file.
3844 Use it and undefine it.
3846 2008-11-04 Akim Demaille <demaille@gostai.com>
3849 * data/lalr1-fusion.cc, src/parse-gram.y: here.
3851 2008-11-04 Akim Demaille <demaille@gostai.com>
3854 * data/lalr1-fusion.cc: here.
3856 2008-11-04 Akim Demaille <demaille@gostai.com>
3858 Use strict on bench.pl.
3859 * etc/bench.pl.in (&run, &generate_grammar): New.
3860 Rename the grammar generating functions for consistency.
3861 Change the interface so that the list of benches to run is passed
3862 as (optionless) arguments.
3863 (&compile): Use &run.
3865 2008-11-04 Akim Demaille <demaille@gostai.com>
3867 Remove spurious initial empty lines.
3868 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
3869 * data/yacc.c: End the @output lines with an @.
3871 2008-11-04 Akim Demaille <demaille@gostai.com>
3873 Improve the display of sizes.
3874 * etc/bench.p.in: Higher precision.
3875 Sort by decreasing size.
3877 2008-11-04 Akim Demaille <demaille@gostai.com>
3879 Don't memcpy C++ structures.
3880 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
3882 (variant::build): New overload for
3883 copy-construction-that-destroys.
3884 (variant::swap): New.
3885 (parser::yypush_): Use it in variant mode.
3887 2008-11-04 Akim Demaille <demaille@gostai.com>
3889 Better defaults for bench.pl.
3890 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
3892 Adjust &verbose uses.
3895 2008-11-04 Akim Demaille <demaille@gostai.com>
3897 Make variant.yy more complex.
3898 std::list cannot be copied via memcpy, they are more demanding than
3899 std::string. Use one std::list to strengthen the test.
3901 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
3903 Create a list of strings, instead of a single large string.
3905 2008-11-04 Akim Demaille <demaille@gostai.com>
3908 * etc/bench.pl.in (--bench, $bench): New.
3910 2008-11-04 Akim Demaille <demaille@gostai.com>
3913 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
3914 Define it after as().
3916 2008-11-04 Akim Demaille <demaille@gostai.com>
3919 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
3921 2008-11-04 Akim Demaille <demaille@gostai.com>
3923 Issue missing synclines after user actions.
3924 * data/c.m4 (b4_case): Issue synclines on the output file.
3926 2008-11-04 Akim Demaille <demaille@gostai.com>
3928 Remove trailing empty line.
3929 * data/lalr1-fusion.cc: Don't add an empty line after the user's
3932 2008-11-04 Akim Demaille <demaille@gostai.com>
3934 Fix output of copyright years.
3935 * data/bison.m4 (b4_copyright): Fix the indentation of the
3936 copyright year paragraph.
3937 Use b4_copyright_years when no years are given.
3938 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
3939 (b4_copyright_years): New.
3942 2008-11-04 Akim Demaille <demaille@gostai.com>
3944 Avoid the spurious initial empty line.
3945 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
3946 the end of @output request to suppress the empty line that
3949 2008-11-04 Akim Demaille <demaille@gostai.com>
3951 Remove parser::rhs_number_type.
3952 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
3953 (yyrhs_): Use b4_table_define.
3955 2008-11-04 Akim Demaille <demaille@gostai.com>
3958 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
3960 2008-11-04 Akim Demaille <demaille@gostai.com>
3962 Factor the declaration of the integer tables.
3963 * data/lalr1-fusion.cc (b4_table_define): New.
3966 2008-11-03 Akim Demaille <demaille@gostai.com>
3968 Fix indentation of tables in lalr1.cc
3969 * data/lalr1-fusion.cc: Fix the indentation.
3971 2008-11-03 Akim Demaille <demaille@gostai.com>
3973 Destroy the lhs symbols after reduction.
3974 * data/lalr1-fusion.cc (parse): After the user action, when in
3975 variant mode, destroy the lhs symbols.
3977 2008-11-03 Akim Demaille <demaille@gostai.com>
3979 Simplify yysyntax_error_ use.
3980 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
3981 type, but make it unnamed in the declaration when it is not used.
3983 2008-11-03 Akim Demaille <demaille@gostai.com>
3985 Let yy::variant::build return an lvalue.
3986 * data/lalr1-fusion.cc (variant::build): Return a reference to the
3989 2008-11-03 Akim Demaille <demaille@gostai.com>
3991 Define yy::variant only when needed.
3992 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
3995 2008-11-03 Akim Demaille <demaille@gostai.com>
3997 Bench the three-stack lalr1.cc.
3998 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
4001 2008-11-03 Akim Demaille <demaille@gostai.com>
4003 Fail on parse error in calc++.
4004 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
4006 * examples/calc++/test ($me, $number, $exit, run): New.
4007 Use them to propagate errors to the exit status.
4009 2008-11-03 Akim Demaille <demaille@gostai.com>
4011 Don't specify the skeleton twice in the example.
4012 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
4013 file does what is needed.
4015 2008-11-03 Akim Demaille <demaille@gostai.com>
4017 bench: Improve output.
4018 * etc/bench.pl.in (bench_grammar): Tune the printf format.
4020 2008-11-03 Akim Demaille <demaille@gostai.com>
4022 bench: check impact of %debug on variants.
4023 * etc/bench.pl.in (variant_grammar): Fix the computation of
4025 Generate a grammar file that can work with or without %debug.
4026 Do use the @directive.
4027 (bench_variant_parser): Check impact of %debug.
4028 (@directives): Rename all the occurrences to...
4029 (@directive): this, for consistency.
4031 2008-11-03 Akim Demaille <demaille@gostai.com>
4033 bench: report the size too.
4034 * etc/bench.pl.in ($iterations): Defaults to -3.
4035 (&bench_grammar): Require hireswallclock.
4036 Compute and display the size of the result.
4039 2008-11-03 Akim Demaille <demaille@gostai.com>
4041 bench: More use of the verbosity level.
4042 * etc/bench.pl.in ($verbose, &verbose): New.
4044 More POD documentation.
4046 2008-11-03 Akim Demaille <demaille@gostai.com>
4048 bench.pl: a command line interface
4049 * etc/bench.pl.in: More doc.
4050 Some fixes in the documentation.
4051 ($cflags, $iterations, &help, &getopt): New.
4053 (&variant_grammar): Let the number of stages be 10 times what is
4056 2008-11-03 Akim Demaille <demaille@gostai.com>
4058 Bench the use of Boost.Variants.
4059 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
4061 (&compile): Be ready to compile C++ parsers.
4062 (&bench_push_parser): Move debug information to the outermost
4064 * THANKS: Add Michiel De Wilde.
4066 2008-11-03 Akim Demaille <demaille@gostai.com>
4068 bench.pl: Pass directives as a list instead of as a string.
4069 * etc/bench.pl.in (&directives): New.
4070 (&triangular_grammar, &calc_grammar): Use it to format the Bison
4072 (&triangular_grammar): Do use the directives (were ignored).
4073 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
4076 2008-11-03 Akim Demaille <demaille@gostai.com>
4078 Improve genericity of bench.pl.
4079 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
4081 (&bench_push_parser): New.
4084 2008-11-03 Akim Demaille <demaille@gostai.com>
4086 Add documentation to bench.pl.
4087 * etc/bench.pl.in: Comment changes.
4089 2008-11-03 Akim Demaille <demaille@gostai.com>
4091 Fuse the three stacks into a single one.
4093 In order to make it easy to perform benchmarks to ensure that
4094 there are no performance loss, lalr1.cc is forked into
4095 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
4098 Meanwhile, to make sure that lalr1-fusion.cc is correctly
4099 exercized by the test suite, the user must install a symbolic link
4100 from lalr1.cc to it.
4102 Instead of having three stacks (state, value, location), use a
4103 stack of triples. This considerably simplifies the code (and it
4104 will be easier not to require locations as currently does the C++
4105 parser), and also gives a 10% speedup according to
4106 etc/bench (probably mainly since memory allocation is done once
4107 instead of three times).
4109 Another motivation is to make it easier to destruct properly
4110 semantic values: now that they are bound to their state (hence
4111 symbol type) it will be easier to call the appropriate destructor.
4113 These changes should probably benefit the C parser too.
4115 * data/lalr1.cc: Copy as...
4116 * data/lalr1-fusion.cc: this new file.
4117 (b4_rhs_value, b4_rhs_location): New definitions overriding those
4119 (state_stack_type, semantic_stack_type, location_stack_type)
4120 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
4121 (data_type, stack_type, yystack_): New.
4122 (YYLLOC_DEFAULT, yypush_): Adjust.
4123 (yyerror_range): Now based on data_type, not location_type.
4125 2008-11-03 Akim Demaille <demaille@gostai.com>
4127 Push the state, value, and location at the same time.
4128 This is needed to prepare a forthcoming patch that fuses the three
4131 * data/lalr1.cc (parser::yypush_): New.
4132 (parser::yynewstate): Change the semantics: instead of arriving to
4133 this label when value and location have been pushed, but yystate
4134 is to be pushed on the state stack, now the three of them must
4135 have been pushed before. yystate still must be the new state.
4136 This allows to use yypush_ everywhere instead of individual
4137 handling of the stacks.
4139 2008-11-03 Akim Demaille <demaille@gostai.com>
4141 Prefer references to pointers.
4142 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
4143 definition to use references instead of pointers.
4144 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
4145 Take the value and location as references.
4148 2008-11-03 Akim Demaille <demaille@gostai.com>
4150 stack::size instead of stack::height.
4151 * data/lalr1.cc (stack::height): Rename as...
4152 (stack::size): this.
4153 Fix the output type.
4156 2008-11-03 Akim Demaille <demaille@gostai.com>
4158 Use variants to support objects as semantic values.
4159 This patch was inspired by work by Michiel De Wilde. But he used
4160 Boost variants which (i) requires Boost on the user side, (ii) is
4161 slow, and (iii) has useless overhead (the parser knows the type of
4162 the semantic value there is no reason to duplicate this
4163 information as Boost.Variants do).
4165 This implementation reserves a buffer large enough to store the
4166 largest objects. yy::variant implements this buffer. It was
4167 implemented with Quentin Hocquet.
4169 * src/output.c (type_names_output): New.
4170 (output_skeleton): Invoke it.
4171 * data/c++.m4 (b4_variant_if): New.
4172 (b4_symbol_value): If needed, provide a definition for variants.
4173 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
4174 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
4175 (b4_char_sizeof, yy::variant): New.
4176 (parser::parse): If variants are requested, define
4177 parser::union_type, parser::variant, change the definition of
4178 semantic_type, construct $$ before running the user action instead
4179 of performing a default $$ = $1.
4180 * examples/variant.yy: New.
4181 Based on an example by Michiel De Wilde.
4183 2008-11-03 Akim Demaille <demaille@gostai.com>
4185 Parameterize the extraction of semantic values.
4186 To make future changes easier, no longer rely on ".TYPE" being the
4187 way to get a semantic value.
4189 * data/c.m4 (b4_symbol_value): New.
4191 * data/c++.m4, data/yacc.c: Use it.
4192 * data/glr.c: Use b4_symbol_value.
4196 2008-11-03 Akim Demaille <demaille@gostai.com>
4198 Prepare easier M4 changes.
4199 * data/lalr1.cc: Use escaped [] instead of literals to prepare
4202 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4204 Initiate further development.
4205 * NEWS: Create an empty section for new entries.
4206 * gnulib: Update submodule to HEAD.
4208 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4210 * NEWS: Version 2.4.
4212 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4214 Prepare for next release.
4215 * NEWS: Briefly mention changes since 2.3b.
4216 * README: Say GNU m4 1.4.6, which we've been requiring in release
4217 announcements already, not 1.4.3, which breaks the build.
4219 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4221 Say %language is experimental.
4222 We're thinking of extending it's effect on output file naming. See the
4224 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
4225 * NEWS: Say it's experimental.
4226 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
4227 recommend it over %skeleton for now.
4228 (Bison Options): Likewise.
4229 (C++ Bison Interface): Use %skeleton not %language.
4230 (Calc++ Parser): Use %skeleton not %language.
4231 * src/getargs.c (usage): Say it's experimental.
4233 2008-11-01 Di-an Jan <dianj@freeshell.org>
4234 Paolo Bonzini <bonzini@gnu.org>
4236 Support all Java parser class modifiers.
4237 * data/java.m4 (b4_percent_define_get3): New.
4238 (b4_final_if, b4_strictfp_if): New.
4239 * data/lalr1.java (final, strictfp, extends, implements): Support.
4240 * doc/bison.texinfo (final, strictfp, extends, implements): Add
4242 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
4243 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
4244 (AT_CHECK_JAVA_GREP): New.
4245 (Java parser class modifiers): New test.
4246 (Java parser class extends and implements): New test.
4248 Model exception propagation better with throws and lex_throws.
4249 * data/java.m4 (b4_list2): New.
4250 (throws): Change default.
4251 * data/lalr1.java (yyaction): Add throws.
4252 (parse): Add lex_throws in addition to throws.
4253 * doc/bison.texinfo (throws, lex_throws): Add documentation.
4254 * tests/java.at (Java throws specifications): New test.
4256 Improve documentation for Java parsers.
4257 * doc/bison.texinfo (Java Parsers): Add subsections.
4258 Don't quote first argument of %define.
4259 (Java Bison Interface): Document output files. Move documentation
4260 of parser class and merge into Java Parser Interface. Document
4261 features that error out. Document directives with no effect.
4262 Move note about Javadoc higher.
4263 (Java Semantic Values): Explicitly mention stype.
4264 Document that generic types cannot be used.
4265 (Java Location Values): Use @deftypeivar. Document constructors.
4266 Correct return value for toString.
4267 (Java Parser Interface): List undocumented constants/fields.
4268 Move documentation of fields added by %parse-param closer to list
4269 of members. Document that token names are added as fields.
4270 Document constructors accurately. Remove error method.
4271 (Java Scanner Interface): Move note on %pure-parser to Java Bison
4272 Interface. Describe %code lexer and yylex accutately.
4273 Remove documentation that does not match the code.
4274 (Java Action Features): New.
4275 (Java Differences): Add reference. Add item on semantic values.
4276 Add note about @{ ... @}. Clarify %% epilogue placement.
4277 (Java Declarations Summary): New.
4280 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
4281 (b4_remove_comma): Quote test argument.
4282 (b4_identification): Remove "bison" field.
4283 * tests/java.at (Java parser class and package names): New test.
4284 (Java %parse-param and %lex-param): New test.
4285 (Java stype, position_class and location_class): New test.
4287 2008-10-31 Di-an Jan <dianj@freeshell.org>
4289 * data/lalr1.jave: Update copyright years.
4290 (YYParser): Correct name of "generated from" file in Javadoc:
4291 use b4_file_name instead of @ofile@.
4292 (Location constructor): Correct Javadoc parameter name.
4293 (yylloc): Add missing opening m4 quote after b4_location_if.
4294 This removes a stray [ in the Javadoc of Lexer.getStartPos.
4295 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
4296 (YYParser constructor): Correct Javadoc parameter name.
4298 2008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
4300 Always put auxiliary code files in the same dir as other output files.
4301 * src/files.c (compute_file_name_parts): When the user specifies
4302 --output but not --file-prefix, extract the directory prefix from the
4303 file prefix not from the grammar file name. This affects the location
4304 of files like location.hh generated by the C++ skeleton. The includes
4305 in the other output files require this fix.
4306 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
4307 for expected output files.
4308 (Output files): Add a test for the above.
4310 2008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
4312 * gnulib: Update submodule to HEAD.
4314 2008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4316 Update copyright year.
4317 * src/files.c: Here.
4319 2008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
4321 Don't overwrite the input file.
4322 * src/files.c (output_file_name_check): Fatal error if using input file
4324 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
4326 (Conflicting output files): Add test.
4328 2008-10-28 Akim Demaille <demaille@gostai.com>
4331 * data/lalr1.cc: Formatting changes.
4333 2008-10-28 Akim Demaille <demaille@gostai.com>
4335 Don't define debugging functions when !YYDEBUG.
4336 * data/lalr1.cc (debug_stream, set_debug_stream)
4337 (debug_level_type, debug_level, set_debug_level): Don't
4338 declare them when YYDEBUG is not defined.
4339 The implementation are already YYDEBUG-aware.
4341 2008-10-28 Akim Demaille <demaille@gostai.com>
4343 Prefer "continue" for empty loop bodies.
4344 * etc/bench.pl.in: Use "continue" instead of {}.
4346 2008-10-28 Akim Demaille <demaille@gostai.com>
4348 Space and comments changes.
4349 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
4350 * data/c.m4, data/lalr1.cc: Space changes.
4352 2008-10-28 Akim Demaille <demaille@gostai.com>
4354 Make gnulib a submodule.
4356 * .gitmodules (gnulib): New.
4358 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4360 Fix yyerror_range for user-defined location type in C++. Reported by
4362 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
4363 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
4364 * THANKS (Georg Sauthoff): Add.
4366 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4368 Update several administrative files mainly to facilitate releasing.
4369 * HACKING (Administrivia): Make the git-merge-changelog notes more
4371 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
4372 (Release Procedure): Update for git and add numerous details that were
4374 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
4375 * maint.mk (announcement): Don't list bison as a bootstrap tool so
4376 that announcements don't claim we bootstrapped with whatever bison
4377 happened to be in PATH. Add flex as a bootstrap tool.
4378 * Makefile.maint: Remove, previously replaced by maint.mk.
4379 * Makefile.cfg: Remove, and migrate settings to...
4380 * cfg.mk: ... here for the sake of `make announcement'.
4381 * bootstrap.conf (gnulib_modules): Add announce-gen.
4382 * README: Say GNU Bison instead of just Bison. Suggested by Karl
4385 2008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
4387 Small but important bugfixes for the Java skeleton.
4388 * data/lalr1.java (yyerror): Change Location to b4_location_type.
4389 (yy_symbol_print): Call toString on yyvaluep.
4391 2008-08-29 Akim Demaille <demaille@gostai.com>
4393 Clarify UPDATED use.
4394 * doc/bison.texinfo: It refers to the last edition of this file,
4395 not to the release date of Bison.
4396 Reported by Joel E. Denny.
4398 2008-08-29 Akim Demaille <demaille@gostai.com>
4400 * README: Update FAQ pointer.
4401 Reported by Joel E. Denny.
4403 2008-08-27 Eric Blake <ebb9@byu.net>
4405 Resync m4sugar from autoconf.
4406 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
4407 (m4_init): Adjust to latest m4.git changes.
4408 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
4410 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
4411 (_m4_list_cmp): Reduce side effects.
4413 2008-08-27 Akim Demaille <demaille@gostai.com>
4415 Check yyerrok in calc.at.
4416 * tests/calc.at (calc.y): Use yyerrok on "( error )".
4417 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
4420 2008-08-27 Akim Demaille <demaille@gostai.com>
4422 Support yyerrok in lalr1.cc.
4423 YYBACKUP is still to import back into lalr1.cc.
4424 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
4426 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
4428 For maintainer-check*, don't recompile for a $(VERSION) update.
4430 (_is-dist-target): Override the one in GNUmakefile.
4431 * Makefile.am (EXTRA_DIST): Add cfg.mk.
4433 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
4435 Update for recent change to gnulib.
4436 * src/parse-gram.y: Don't include strverscmp.h. It comes from
4439 2008-08-15 Eric Blake <ebb9@byu.net>
4441 Remaining m4sugar merge from autoconf.
4442 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
4443 * data/m4sugar/foreach.m4: New file, copied from autoconf.
4444 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
4445 * src/output.c (output_skeleton): Tell m4 how to find it.
4447 Partial m4sugar merge from autoconf: m4_map.
4448 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
4449 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
4450 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
4451 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
4453 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
4455 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
4458 2008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
4460 Keep .version and PACKAGE_VERSION in sync.
4461 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
4462 dependency, and add comments justifying this in more detail. Discussed
4464 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
4466 2008-08-06 Eric Blake <ebb9@byu.net>
4468 Partial m4sugar merge from autoconf: m4_shiftn.
4469 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
4470 (m4_shift2, m4_shift3): New macros.
4471 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
4472 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
4473 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
4474 * data/java.m4 (b4_remove_comma): Likewise.
4476 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
4477 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
4478 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
4479 (m4_init): Consolidate wrapped text into single m4_wrap.
4480 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
4483 2008-08-05 Eric Blake <ebb9@byu.net>
4485 Partial m4sugar merge from autoconf: builtins, version.m4.
4486 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
4487 (m4_prepend): Remove, as it is unused and inherently quadratic,
4488 whereas m4_append is linear in newer m4.
4489 (m4_mkstemp): New builtin.
4490 (m4_symbols): Make rename conditional.
4491 (m4_version_prereq): Ensure fatal error if used in bison, which
4492 intentionally lacks version.m4.
4494 Fix comments in m4sugar.
4495 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
4497 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
4499 Update for recent .gitignore fix in Gnulib.
4500 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
4501 anchored .gitignore entries.
4503 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
4505 Set gnu or gnits strictness.
4506 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
4507 development and gnits strictness for releases. Based on Eric Blake's
4509 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
4511 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
4513 * NEWS: Clarify documentation of %language.
4515 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
4517 Support usage of git-merge-changelog.
4518 * .gitattributes: New.
4519 * HACKING: Document usage of git-merge-changelog.
4520 * bootstrap: Install git-merge-changelog entries in .git/config
4523 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4525 Remove remaining dependence on CVS Id keyword.
4526 * ChangeLog: For the sake of people still using CVS, don't use dollars
4528 * data/xslt/bison.xsl: Remove Id from header comments, where it was
4530 * data/xslt/xml2dot.xsl: Likewise.
4531 * data/xslt/xml2text.xsl: Likewise.
4532 * data/xslt/xml2xhtml.xsl: Likewise.
4533 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
4534 * doc/Makefile.am (neutralize): Remove, no longer needed.
4535 (.x.1): Don't use neutralize.
4536 (edit): Don't substitute for ID.
4537 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
4539 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4541 Fix dependence on computed configure variables.
4542 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
4543 $(top_srcdir)/configure.ac so that changes to computed variables, such
4544 as PACKAGE_VERSION, are seen.
4545 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
4547 2008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
4549 Update copyright dates for recent changes.
4550 * Makefile.am: Here.
4551 * src/Makefile.am: Here.
4552 * src/reduce.c: Here.
4553 * tests/reduce.at: Here.
4555 2008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
4557 Use git-version-gen for version names between releases.
4558 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
4559 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
4560 * .prev-version: New.
4561 * .version.in: Remove.
4562 * ChangeLog: Remove the Id previously used for capturing the CVS
4564 * GNUmakefile: Remove, now copied from Gnulib.
4565 * Makefile.am: Add code suggested by comments in
4566 build-aux/git-version-gen.
4567 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
4568 .prev-version, and .version.
4569 * NEWS (2.3b+): Rename to...
4570 (?.?): ... this because we're dropping the "+" version naming scheme,
4571 but, in general, we still can't be sure of our next release name.
4572 * bootstrap: Add a quick hack to remove from .gitignore the
4573 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
4574 entry. This should really be fixed in gnulib instead.
4575 * bootstrap.conf (gnulib_modules): Add gnumakefile.
4576 * configure.ac (AC_INIT): Set version name by invoking
4577 build-aux/git-version-gen.
4578 (AC_CONFIG_FILES): Remove .version, now generated by
4579 build-aux/git-version-gen.
4580 * maint.mk: New, copied from coreutils.
4581 * doc/.cvsignore (bison.1): Add.
4582 * doc/.gitignore (/bison.1): Add.
4583 * doc/bison.1: Remove, generated.
4584 * src/.cvsignore (revision.c): Remove.
4585 * src/.gitignore (/revision.c): Remove.
4586 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
4587 (BUILT_SOURCES): Remove revision.c.
4588 (revision.c): Remove.
4589 * src/getargs.c (version): Don't print revision after the VERSION.
4590 * src/revision.h: Remove.
4592 2008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4594 Fix untranslatable composition of sentences. Reported by Goran
4596 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
4597 * THANKS (Goran Uddeborg): Add.
4598 * src/reduce.c (reduce_print): Report the number of nonterminals and
4599 rules useless in the grammar in separate sentences.
4600 * tests/reduce.at (Useless Rules): Update output.
4601 (Reduced Automaton): Likewise.
4602 (Underivable Rules): Likewise.
4603 (Empty Language): Likewise.
4605 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4607 Fix some .gitignore and .cvsignore problems.
4608 * bootstrap (insert_sorted_if_absent): Replace all uses with...
4609 (insert_vc_ignore): ... this new function, which prepends `/' to all
4610 .gitignore entries before passing them to insert_sorted_if_absent.
4611 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
4612 .cvsignore files are maintained even though Bison developers run
4613 bootstrap while using Git.
4614 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
4617 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
4618 unneeded. Reported by Eric Blake.
4619 * lib/.gitignore (/*~): Add.
4620 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
4621 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
4623 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
4625 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4627 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
4628 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
4629 * bootstrap.conf (gnulib_modules): Add unsetenv.
4630 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
4631 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
4633 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
4634 the first argument because it may become position-dependent, and unset
4635 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
4636 Add comments explaining these issues in more detail.
4638 2008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
4640 Add .gitignore everywhere based on .cvsignore.
4642 * build-aux/.gitignore: New.
4643 * data/.gitignore: New.
4644 * doc/.gitignore: New.
4645 * etc/.gitignore: New.
4646 * examples/.gitignore: New.
4647 * examples/calc++/.gitignore: New.
4648 * lib/.gitignore: New.
4649 * m4/.gitignore: New.
4650 * po/.gitignore: New.
4651 * runtime-po/.gitignore: New.
4652 * src/.gitignore: New.
4653 * tests/.gitignore: New.
4655 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4657 * NEWS (2.3b+): New section, empty for now.
4658 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
4660 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4662 * NEWS (2.3b): Update release date since there has been a delay in
4663 getting the announcements and tarballs out.
4665 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
4667 * NEWS: Version 2.3b.
4668 * configure.ac (AC_INIT): Likewise.
4669 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
4671 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
4673 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
4674 been doing it for years.
4675 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
4676 (Release Procedure): Add FIXME about make alpha being unmaintained.
4678 2008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
4680 * data/yacc.c: Reformat m4 a little for readability.
4681 * src/lalr.c (build_relations): Correct comment.
4683 2008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4685 DJGPP specific issue.
4686 * djgpp/config.sed: Fixes required to run configure scripts generated
4689 2008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4691 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
4692 coordinator@translationproject.org.
4694 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4696 * THANKS: Add Eric Blake.
4698 2008-04-23 Eric Blake <ebb9@byu.net>
4700 Revert prior patch, by working around autoconf regression.
4701 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
4702 ("Output file name: ("): Uncomment test.
4703 ("Output file name: )"): Likewise.
4704 Based on an idea from Noah Misch.
4706 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4708 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
4709 2.61. Reported by Juan Manuel Guerrero at
4710 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
4711 * tests/output.at ("Output file name: ("): Comment out test case for
4713 ("Output file name: )"): Likewise.
4715 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4717 * GNUmakefile: Update git-version-gen invocation so make dist
4720 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4722 Update to the current gnulib CVS repository, and fix trigraph handling
4724 * bootstrap: Update gnulib CVS repository URL.
4725 (symlink_to_dir): Encapsulate the code that guarantees the destination
4726 directory exists into...
4727 (check_dst_dir): ... this new function, and...
4728 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
4729 fail when copying files into lib/uniwidth/.
4730 * src/output.c (prepare_symbols): When writing yytname muscles, where
4731 symbol names will be encoded in C-string literals, tell quotearg to
4732 escape trigraphs. This used to be the default in gnulib.
4733 * tests/regression.at (Token definitions): Because of the change in
4734 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
4735 escapes trigraphs in symbol names. Thus, yytname no longer has
4736 trigraphs unnecessarily doubly escaped. Update test case output.
4737 Extend test case to be sure Bison's own error messages will no longer
4738 have trigraphs in symbol names unnecessarily escaped once.
4740 2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
4742 Fix make dist infinite loop reported by Juan Manuel Guerrero at
4743 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
4744 * .cvsignore: Add .version.
4746 * bootstrap.conf (gnulib_modules): Add git-version-gen.
4747 * configure.ac (AC_CONFIG_FILES): Add .version.
4748 * build-aux/.cvsignore: Add git-version-gen.
4750 2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4752 * NEWS (2.3a+): Mention that -g now takes an argument.
4753 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
4754 consistency. Update the -g and -x entries now that they take
4755 arguments. Use brackets to indicate optional arguments.
4756 * src/getargs.c (usage): Explain the relationship between arguments of
4757 long and short options more completely. Document --defines and -d
4758 separately since the former takes an argument but, for POSIX Yacc, the
4760 (short_options): Let -W take an optional argument like --warnings.
4761 (getargs): Sort cases.
4763 2008-02-28 Akim Demaille <demaille@gostai.com>
4765 * doc/bison.texinfo: Fix a few typos.
4767 2008-02-28 Akim Demaille <akim@epita.fr>
4769 * doc/bison.texinfo (Bison Options): Document -W.
4770 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
4772 2008-02-28 Akim Demaille <akim@epita.fr>
4774 * src/getargs.c (short_options): Split and sort for readability.
4775 -g and -x take optional arguments, just like their long options.
4776 * build-aux/cross-options.pl: Use /x to make the regexp easier to
4778 Fix the handling of $opt which resulted in all the argument to be
4779 considered as optional.
4781 2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
4783 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
4784 say its interface is experimental.
4785 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4787 (Bison Options): In the -L and --language entry, mention Java.
4788 (Java Bison Interface): Say the interface is experimental.
4789 * src/getargs.c (usage): Mention -L and --language.
4791 * NEWS (2.3a+): Say the push parsing interface is experimental.
4792 * doc/bison.texinfo (Push Decl): Likewise.
4793 (Decl Summary): Likewise in the "%define api.push_pull" entry.
4794 (Push Parser Function): Likewise.
4795 (Pull Parser Function): Likewise.
4796 (Parser Create Function): Likewise.
4797 (Parser Delete Function): Likewise.
4798 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
4799 yypull_parse, and yypush_parse entries.
4801 * NEWS (2.3a+): Mention XML support, and say the schema is
4803 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
4804 * src/getargs.c (usage): Say the XML schema is experimental.
4806 * NEWS (2.3a+): Say option instead of flag.
4808 2008-02-21 Wojciech Polak <polak@gnu.org>
4810 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
4813 2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
4815 Fix impure push parser compile error reported by Bob Rossi at
4816 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
4817 * data/yacc.c: Clean up whitespace in the output a little.
4818 (yypstate_allocated): Define for impure push parsers regardless of
4819 whether the pull interface is also requested.
4820 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
4821 check impure push parsers without the pull interface.
4823 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
4824 yyerror takes arguments specified by %parse-param while yypstate_new
4826 * doc/bison.texinfo (Parser Create Function): Document that
4827 yypstate_new returns 0 for multiple impure parser instances.
4828 * tests/push.at (Push Parsing: Multiple impure instances): Update
4829 expected stderr output.
4831 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
4833 * runtime-po/POTFILES.in (push.c): Remove.
4835 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
4837 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
4838 * data/push.c: Rename to...
4839 * data/yacc.c: ... this, overwriting it.
4840 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
4841 `%push-pull-parser' -> `%define api.push_pull "both"'.
4842 Remove old yacc.c tests, and update push.c tests to yacc.c.
4844 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
4846 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
4847 `"%code top" blocks' instead of `%code "top" blocks'.
4848 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
4849 Clean up whitespace in the output a little.
4851 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
4853 Fix documentation problems reported by Tim Josling at
4854 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
4855 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
4856 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
4857 integers. Explain the effect of literal string aliases on error
4858 messages. Copy token 0 documentation from the C++ skeleton
4861 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
4863 Accept a token number in a %left, %right, or %nonassoc for POSIX
4864 conformance. Reported by Tim Josling at
4865 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
4866 * NEWS (2.3a+): Mention.
4867 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
4868 and code numbers are treated by precedence declarations.
4869 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
4871 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
4873 (symbol.prec): New, just like symbol but allows INT.
4874 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
4876 * tests/regression.at (Token number in precedence declaration): New
4879 2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4881 DJGPP specific issues.
4882 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
4883 be changed. Copyright timestamp adjusted.
4884 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
4885 be changed. Copyright timestamp adjusted.
4886 * djgpp/config.site: Copyright timestamp adjusted.
4887 * djgpp/config_h.sed: Copyright timestamp adjusted.
4888 * djgpp/djunpack.bat: Copyright timestamp adjusted.
4889 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
4890 filename translation list.
4891 * djgpp/subpipe.c (init_subpipe): Check the environment variables
4892 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
4893 files shall be created. Before trying to use the temp dir where the
4894 environment variable points to check that the dir really exists. If
4895 not default to the cwd as temp dir. Copyright timestamp adjusted.
4896 * djgpp/subpipe.h: Copyright timestamp adjusted.
4897 * djgpp/testsuite.sed: Copyright timestamp adjusted.
4899 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
4901 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
4903 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
4905 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
4906 Problem reported by Claudio Saavedra in
4907 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
4909 2008-01-05 Wojciech Polak <polak@gnu.org>
4911 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
4912 document's title with the input grammar file name.
4914 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
4916 Automate regression testing of the XML/XSLT implementation. Discussed
4918 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
4919 * configure.ac (XSLTPROC): New substitution.
4920 * Makefile.am (maintainer-xml-check): New phony target invoking...
4921 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
4922 invoking make maintainer-check with BISON_TEST_XML=1.
4923 * tests/atlocal.in (XSLTPROC): New.
4924 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
4925 not to report reachable memory when Bison is expected to have a
4926 non-zero exit status and (2) to compare XML/XSLT output with --graph
4927 and --report=all output for every working grammar when
4929 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
4930 (AT_BISON_CHECK_XML): New.
4931 (AT_QUELL_VALGRIND): New.
4932 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
4933 (AT_CHECK): ... don't redefine this since this was the old way to
4935 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
4936 AT_BISON_CHECK invocations.
4937 * tests/c++.at: Likewise.
4938 * tests/calc.at: Likewise.
4939 * tests/conflicts.at: Likewise.
4940 * tests/cxx-type.at: Likewise.
4941 * tests/existing.at: Likewise.
4942 * tests/glr-regression.at: Likewise.
4943 * tests/headers.at: Likewise.
4944 * tests/input.at: Likewise.
4945 * tests/java.at: Likewise.
4946 * tests/output.at: Likewise.
4947 * tests/push.at: Likewise.
4948 * tests/reduce.at: Likewise.
4949 * tests/regression.at: Likewise.
4950 * tests/sets.at: Likewise.
4951 * tests/skeletons.at: Likewise.
4952 * tests/synclines.at: Likewise.
4953 * tests/torture.at: Likewise.
4954 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
4955 tends to hang xsltproc.
4956 (Big horizontal): Likewise.
4958 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
4960 In XML output, remove redundant class attribute on symbol element.
4961 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
4962 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
4963 look up a symbol to determine whether it's a nonterminal or terminal.
4964 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
4965 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
4967 Add prec/assoc information to XML output.
4968 * src/gram.c (grammar_rules_print_xml): For each rule that has a
4969 %prec, add a percent_prec attribute.
4970 * src/print-xml.c (print_grammar): For each terminal that has a
4971 precedence or associativity, add a prec or assoc attribute.
4973 (xml_puts): Use xml_indent.
4974 (xml_printf): Use xml_indent.
4975 * src/print-xml.h (xml_indent): Prototype.
4977 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
4978 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
4980 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
4982 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
4983 (bison:ruleByNumber): ... this for clarity.
4984 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
4985 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
4986 (xsl:template match="reduction"): Update.
4987 (xsl:template match="item"): Update.
4988 (xsl:template match="reduction"): Update.
4990 In the XML output, don't print the list of rules where symbols appear.
4991 Compute it in XSLT instead. Discussed at
4992 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
4993 * data/xslt/bison.xsl (bison:ruleByLhs): New.
4994 (bison:ruleByRhs): New.
4995 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
4997 (xsl:template match="terminal/rule"): Remove.
4998 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
5000 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
5002 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
5003 bison:ruleByRhs and mode="number-link" for rule template.
5004 (xsl:template match="terminal/rule"): Remove.
5005 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
5006 bison:ruleByRhs and mode="number-link" for rule template.
5007 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
5009 (xsl:template match="rule" mode="number-link"): ... this.
5010 * src/print-xml.c (print_grammar): Don't print the list of rules.
5012 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
5014 Don't let --report affect XML output; always print all information.
5016 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
5017 * src/conflicts.c (log_resolution): Implement.
5018 * src/print-xml.c (print_core): Implement.
5019 (print_state): Implement.
5020 (print_xml): Implement.
5022 * NEWS (2.3a+): Fix quotes.
5023 * src/parse-gram.y (prologue_declaration): For consistency with -v,
5024 don't let %verbose clear the list specified by --report.
5026 2007-11-26 Akim Demaille <akim@epita.fr>
5028 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
5030 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
5032 In the XML output, list useless and unused symbols and rules with the
5033 useful ones and add a "usefulness" attribute. Discussed starting at
5034 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
5035 * src/gram.c (grammar_rules_partial_print_xml): Remove.
5036 (grammar_rules_print_xml): Print all rules instead of just those
5037 useful in the grammar, and add a "usefulness" attribute.
5038 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
5039 * src/print-xml.c (print_rules_useless_in_parser): Remove.
5040 (print_grammar): Print all nonterminals instead of just useful ones,
5041 and add a "usefulness" attribute to nonterminals and terminals.
5042 (print_xml): Don't print a separate "reductions" or
5043 "rules-useless-in-parser" element.
5044 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
5045 (reduce_xml): Remove.
5046 (reduce_token_unused_in_grammar): New.
5047 (reduce_nonterminal_useless_in_grammar): New.
5048 * src/reduce.h (reduce_xml): Remove prototype.
5049 (reduce_token_unused_in_grammar): Add prototype.
5050 (reduce_nonterminal_useless_in_grammar): Add prototype.
5051 * data/xslt/xml2text.xsl: Update for XML changes.
5052 * data/xslt/xml2xhtml.xsl: Update for XML changes.
5053 * tests/reduce.at (Useless Terminals): Update output.
5054 (Useless Rules): Update output.
5055 (Reduced Automaton): Update output.
5057 Say "Terminals unused in grammar" instead of "Unused terminals".
5058 * NEWS (2.3a+): Update.
5059 * doc/bison.texinfo (Understanding): Update example output.
5060 * src/reduce.c (reduce_output): Implement.
5061 * data/xslt/xml2text.xsl: Implement.
5062 * data/xslt/xml2xhtml.xsl: Implement.
5064 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
5066 Accept --report-file=FILE to override the default `.output' filename.
5067 * NEWS (2.3a+): Mention.
5068 * doc/bison.texinfo (Bison Options): Add an entry.
5069 * src/files.c (compute_output_file_names): Don't override
5070 spec_verbose_file if already set.
5071 * src/getargs.c (usage): Document --report-file.
5072 (REPORT_FILE_OPTION): New anonymous enum member.
5073 (long_options): Add entry for it.
5074 (getargs): Add case for it setting spec_verbose_file.
5076 * build-aux/cross-options.pl: Don't record a short option just because
5078 * doc/.cvsignore: Add yacc.1.
5080 2007-11-14 Akim Demaille <akim@epita.fr>
5082 * doc/yacc.1.in: New.
5083 * configure.ac, doc/Makefile.am: Adjust.
5084 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
5086 Use AC_SUBST for assignments too.
5087 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
5089 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5091 * src/gram.c: Remove comments that duplicate comments in gram.h.
5093 When reporting useless rules and nonterminals, say "useless in grammar"
5094 instead of "useless", and say "useless in parser" instead of "never
5095 reduced". Discussed starting at
5096 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
5097 * NEWS (2.3a+): Mention this change.
5098 * data/xslt/xml2text.xsl: Update output text and expected input XML
5099 element names to match changes below.
5100 * data/xslt/xml2xhtml.xsl: Likewise.
5101 (xsl:template match="bison-xml-report"): Add missing entry in Table of
5102 Contents: "Rules useless in parser due to conflicts".
5103 * doc/bison.texinfo (Decl Summary): Reword a little.
5104 (Understanding): Update example output for changes below.
5105 * src/gram.c: (rule_useful_p): Rename to...
5106 (rule_useful_in_grammar_p): ... this.
5107 (rule_useless_p): Rename to...
5108 (rule_useless_in_grammar_p): ... this.
5109 (rule_never_reduced_p): Rename to...
5110 (rule_useless_in_parser_p): ... this.
5111 (grammar_rules_print): Update for renames.
5112 (grammar_rules_print_xml): Update for renames.
5113 (grammar_rules_never_reduced_report): Rename to...
5114 (grammar_rules_useless_report): ... this since it is used for either
5115 kind of useless rule.
5116 * src/gram.h: Reword comments and update function names in prototypes.
5117 * src/main.c (main): Say "rule useless in parser due to conflicts".
5118 * src/print-xml.c (print_rules_never_reduced): Rename to...
5119 (print_rules_useless_in_parser): ... this, and rename output XML
5120 element "rules-never-reduced" to "rules-useless-in-parser".
5121 (print_xml): Update for rename.
5122 * src/print.c (print_results): Say "Rules useless in parser due to
5124 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
5125 (nonterminals_reduce): Say "nonterminal useless in grammar".
5126 (reduce_output): Say "Nonterminals useless in grammar".
5127 Say "Rules useless in grammar".
5128 (reduce_xml): Rename output XML element "useless" to
5129 "useless-in-grammar".
5130 (reduce_print): Don't report the count of grammatically useless rules
5131 as "rules never reduced" just because %yacc is specified.
5132 In the correct report of this count, say nonterminal(s) and rule(s)
5133 "useless in grammar".
5134 * tests/conflicts.at (S/R in initial): Update expected output.
5135 (Defaulted Conflicted Reduction): Likewise.
5136 (Unreachable States After Conflict Resolution): Likewise.
5137 * tests/existing.at (GNU pic Grammar): Likewise.
5138 * tests/reduce.at (Useless Nonterminals): Likewise.
5139 (Useless Rules): Likewise.
5140 (Reduced Automaton): Likewise.
5141 (Underivable Rules): Likewise.
5142 (Empty Language): Likewise.
5144 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
5146 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
5147 here document and before the EOF so that BSD's implementation of Bourne
5148 shell doesn't parse the delimiter as part of the here document.
5149 * doc/.cvsignore: Add cross-options.texi.
5150 * src/getargs.c (usage): Add a blank line after the warning categories.
5152 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
5154 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
5156 2007-11-05 Akim Demaille <akim@epita.fr>
5158 Remove Id: from bison.1.
5159 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
5160 (perl -0777 -pi -e 's/\.PP\nId): New.
5161 (.x.1): Use it to ignore the version control revision.
5163 2007-11-05 Akim Demaille <demaille@gostai.com>
5165 * build-aux/Makefile.am: Ship cross-options.pl.
5166 * doc/Makefile.am: Always refer to cross-options.texi with
5168 (MAINTAINERCLEANFILES): Add it.
5170 2007-11-04 Akim Demaille <demaille@gostai.com>
5172 Generate the long/short option cross-table.
5173 * build-aux/cross-options.pl: New.
5174 * doc/Makefile.am (cross-options.texi): New.
5175 * doc/bison.texinfo: Use it.
5177 2007-11-04 Akim Demaille <demaille@gostai.com>
5179 Generate bison.1 using help2man.
5180 * doc/common.x, doc/bison.x: New.
5181 * doc/Makefile.am (bison.1, .x.1): New.
5182 The code is taken from autoconf-2.61/man/Makefile.am.
5183 * configure.ac: Look for help2man.
5185 2007-11-04 Akim Demaille <demaille@gostai.com>
5188 * src/getargs.c (usage): Document -W, make it clear that -d,
5189 -g and -x have optional arguments.
5191 2007-11-04 Akim Demaille <demaille@gostai.com>
5193 Find sha1sum when named gsha1sum.
5194 * bootstrap (find_tool): New.
5197 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5199 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
5201 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
5202 * NEWS (2.3a+): Mention.
5203 * data/bison.m4 (b4_pure_if): Don't define it here.
5204 * data/c.m4 (b4_identification): Depend on individual skeletons to
5205 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
5206 values of the %define variables api.pure or api.push_pull. Define
5207 YYPURE, YYPUSH, and YYPULL accordingly.
5208 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
5209 glr.cc has already defined b4_pure_flag.
5210 * data/push.c: Define b4_pure_if based on `%define api.pure'.
5211 Remove YYPUSH and YYPULL since they're back in b4_identification again.
5212 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
5213 * doc/bison.texinfo (Pure Decl): Update.
5214 (Push Decl): Update.
5215 (Decl Summary): Add api.pure to %define entry.
5216 In %pure-parser entry, say it's deprecated and reference %define.
5217 (Pure Calling): Update.
5218 (Error Reporting): Update.
5219 (C++ Scanner Interface): Update.
5220 (How Can I Reset the Parser): Update.
5221 (Table of Symbols): In %pure-parser entry, say it's deprecated and
5223 * src/getargs.c (pure_parser): Remove global variable.
5224 * src/getargs.h (pure_parser): Remove extern.
5225 * src/output.c (prepare): Don't define pure_flag muscle.
5226 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
5227 wrapper around `%define api.pure'.
5228 * tests/calc.at (Simple LALR Calculator): Update.
5229 (Simple GLR Calculator): Update.
5230 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
5232 (GLR: Resolve ambiguity, pure, locations): Update.
5233 (GLR: Merge conflicting parses, pure, no locations): Update.
5234 (GLR: Merge conflicting parses, pure, locations): Update.
5235 * tests/glr-regression.at (Uninitialized location when reporting
5237 * tests/input.at (Unused %define api.pure): New test case.
5238 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
5239 AT_PURE_IF and AT_PURE_AND_LOC_IF.
5240 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5242 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5244 %define push_pull -> %define api.push_pull. Discussed starting at
5245 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
5246 * data/push.c: Expect the new name.
5247 * data/yacc.c: Likewise.
5248 * doc/bison.texinfo (Push Decl): Update.
5249 (Decl Summary): Update %define entry.
5250 (Push Parser Function): Update.
5251 (Pull Parser Function): Update.
5252 (Parser Create Function): Update.
5253 (Parser Delete Function): Update.
5254 * tests/calc.at (Simple LALR Calculator): Update.
5255 * tests/input.at (%define enum variables): Update.
5256 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5257 (Push Parsing: Multiple impure instances): Update.
5258 (Push Parsing: Unsupported Skeletons): Update.
5259 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
5260 (Exploding the Stack Size with Malloc): Update.
5262 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
5265 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
5267 For the XML output's terminal element, rename @number to @token-number,
5268 and add @symbol-number. In the nonterminal element, rename @number to
5269 @symbol-number. Discussed starting at
5270 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
5271 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
5273 (xsl:template match="nonterminal"): Likewise.
5274 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
5275 (xsl:template match="nonterminal"): Likewise.
5276 * src/print-xml.c (print_grammar): Implement.
5278 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5280 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
5281 2007-10-11 change, the child elements here are items not rules.
5282 (xsl:template match="item"): New.
5283 (xsl:template match="rule"): Update for new reduced itemset.
5284 (xsl:template match="point"): Remove.
5285 (xsl:template match="empty"): For consistency with --graph, don't
5286 output "/* empty */".
5287 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
5288 line-wrap, don't pass a negative value as first-line-length since this
5289 won't work with the following changes.
5290 (xsl:template name="line-wrap"): Simplify slightly.
5291 (xsl:template name="ws-search"): Eliminate recursion.
5292 * src/print_graph.c (print_core): Don't print a reduction's lookahead
5293 set next to an item whose dot is not at the end of the RHS even if it
5294 happens to be associated with the same rule.
5296 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5298 Add %define lr.keep_unreachable_states.
5299 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
5300 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
5301 * src/main.c (main): Implement it.
5302 * tests/conflicts.at (Unreachable States After Conflict Resolution):
5303 Extend to test it, and fix a typo.
5305 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5307 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
5308 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
5309 the example .output text.
5310 * tests/regression.at (Extra lookahead sets in report): Improve wording
5313 2007-10-17 Wojciech Polak <polak@gnu.org>
5315 * src/print-xml.c (print_grammar): Renamed
5316 <terminal> and <nonterminal> attributes:
5317 "type" to "number" and "symbol" to "name".
5318 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
5319 Use new attribute names.
5320 (xsl:template match="nonterminal"): Likewise.
5321 * data/xslt/xml2xhtml.xsl: Likewise.
5323 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
5325 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
5326 (Option Cross Key): Likewise.
5328 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
5329 next to an item whose dot is not at the end of the RHS even if it
5330 happens to be associated with the same rule.
5331 * src/print.c (print_core): Likewise.
5332 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
5333 (Resolved SR Conflicts): Update output.
5334 * tests/regression.at (Extra lookahead sets in report): New test case.
5336 2007-10-11 Wojciech Polak <polak@gnu.org>
5338 * src/print-xml.c (print_core): Remove item set
5340 * data/xslt/bison.xsl (bison:ruleNumber): New key.
5341 Improve processing time. Suggested by Joel E. Denny.
5342 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
5343 Write xsl:param "required" attribute as comment.
5344 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
5345 (xsl:template match="rule"): Support new reduced itemset.
5346 (xsl:template match="point"): Remove.
5347 * data/xslt/xml2xhtml.xsl: Likewise.
5349 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5351 * src/getargs.c (version): Update copyright year.
5353 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5355 Make xml2dot.xsl and --graph produce the same output.
5356 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a ` '
5357 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
5359 (xsl:template name="output-node"): Use the new escape template instead
5360 of the string-replace template directly.
5361 (xsl:template name="output-edge"): Likewise.
5362 (xsl:template name="escape"): New, escapes backslashes and newlines in
5363 addition to quotation marks.
5364 * src/graphviz.c (start_graph, output_node, output_edge): Add
5365 whitespace to output for legibility.
5367 Make xml2text.xsl and --report produce the same output, and remove the
5368 XML "conflicts" element since a conflict summary is easily extracted
5370 * data/xslt/bison.xsl: New.
5371 (xsl:template match="state" mode="bison:count-conflicts): New.
5372 * data/xslt/xml2text.xsl: Import bison.xsl.
5373 (xsl:template match="bison-xml-report"): Instead of styling the
5374 "conflicts" element, style the "automaton" element with mode
5375 "conflicts". Unlike the former, the latter lists S/R and R/R
5376 conflicts for a state on the same line.
5377 (xsl:template match="conflicts"): Remove.
5378 (xsl:template match="conflict"): Remove.
5379 (xsl:template match="terminal"): Line-wrap the list of rules in which
5380 the terminal is used.
5381 (xsl:template match="nonterminal"): Likewise for nonterminals.
5382 (xsl:template match="automaton" mode="conflicts"): New.
5383 (xsl:template match="state" mode="conflicts"): New.
5384 (xsl:template name="line-wrap"): New.
5385 (xsl:template name="ws-search"): New.
5386 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
5387 (xsl:template match="bison-xml-report"): Instead of styling the
5388 "conflicts" element, style the "automaton" element with mode
5390 (xsl:template match="conflicts"): Remove.
5391 (xsl:template match="conflict"): Remove.
5392 (xsl:template match="automaton" mode="conflicts"): New.
5393 (xsl:template match="state" mode="conflicts): New.
5394 * src/conflicts.c (conflicts_output_xml): Remove.
5395 * src/conflicts.h (conflicts_output_xml): Remove prototype.
5396 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
5397 * src/print.c (print_grammar): Consistently wrap at the 66th column so
5398 the corresponding XSLT is easier. Also, never wrap between a word and
5399 the comma that follows it.
5401 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
5403 Improve C++ namespace support. Discussed starting at
5404 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
5405 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
5406 b4_namespace_close): New macros that interpret the %define variable
5407 "namespace" so its value can contain "::" to indicate nested
5409 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
5411 * data/lalr1.cc (b4_namespace): Likewise.
5412 * data/location.cc (b4_namespace): Likewise.
5413 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
5414 inside a new table in the general %define entry. Document `%define
5415 namespace' there as well. Point the %name-prefix entry to it since it
5416 explains it more completely in the case of C++.
5417 (C++ Bison Interface): Mention `%define namespace' instead of
5419 (Table of Symbols): Remove the `%define push_pull' entry. The %define
5421 * tests/c++.at (Relative namespace references): New test case.
5422 (Absolute namespace references): New test case.
5423 (Syntactically invalid namespace references): New test case.
5424 * tests/input.at (C++ namespace reference errors): New test case.
5426 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
5428 Add syncline support and location accessor to internal %define
5430 * data/bison.m4 (b4_percent_define_get_loc): New.
5431 (b4_percent_define_get_syncline): New.
5432 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
5433 (b4_percent_define_default): Record defining location as line 1 rather
5434 than 0 for the sake of synchronizing #line's, and define
5435 b4_percent_define_syncline(VARIABLE).
5436 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
5437 * src/muscle_tab.c (muscle_syncline_grow): New.
5438 (muscle_code_grow): Use muscle_syncline_grow.
5439 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
5440 define b4_percent_define_syncline(VARIABLE).
5441 (muscle_percent_define_get_loc): New.
5442 (muscle_percent_define_get_syncline): New.
5443 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
5444 remove some unused variables.
5445 (muscle_percent_define_default): Record defining location as line 1
5446 rather than 0 for the sake of synchronizing #line's, and define
5447 b4_percent_define_syncline(VARIABLE).
5448 (muscle_percent_define_check_values): Use
5449 muscle_percent_define_get_loc.
5450 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
5451 (muscle_percent_define_get_syncline): Prototype.
5452 * tests/skeletons.at (%define Boolean variables: invalid skeleton
5453 defaults): Update output for location change.
5454 (Complaining during macro argument expansion): Extend to test
5455 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
5457 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
5459 Fix some error-reporting macro bugs.
5460 * data/bison.m4 (b4_cat): New.
5461 (b4_error, b4_error_at): Use b4_cat to send error directives directly
5462 to stdout so they don't become arguments to other macros. Update
5463 comments and add examples.
5464 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
5466 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
5467 after printing the error directive so that M4 doesn't report subsequent
5468 problems that are induced by this problem.
5469 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
5470 instead of just in them. Recognize @\n in both places. Both expand to
5471 the empty string. Needed by b4_cat.
5472 * tests/skeletons.at (Complaining during macro argument expansion):
5474 (Fatal errors make M4 exit immediately): New test case.
5476 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
5478 Implement --print-datadir.
5479 * src/getargs.c (usage): Mention.
5480 (PRINT_DATADIR_OPTION): New anonymous enum member.
5481 (long_options): Add entry for it.
5482 (getargs): Add case for it calling compute_pkgdatadir.
5483 * src/output.c (output_skeleton): Encapsulate data directory
5484 computation from here...
5485 (prepare): ... and from here...
5486 (compute_pkgdatadir): ... into this new function.
5487 * src/output.h (compute_pkgdatadir): Prototype.
5489 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
5491 * src/print-xml.c (escape_bufs): New static global variable
5493 (xml_escape_n): ... the static local variable buf here.
5494 (print_xml): Free memory for escape_bufs.
5495 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
5497 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
5499 Replace `%push-parser' and `%push-pull-parser' with
5500 `%define push_pull "push"' and `%define push_pull "both"'.
5501 `%define push_pull "pull"' is the default.
5502 * doc/bison.texinfo (Push Decl, Push Parser Function,
5503 Pull Parser Function, Parser Create Function, Parser Delete Function):
5504 Update declarations.
5505 (Decl Summary, Table of Symbols): Replace %push-parser and
5506 %push-pull-parser entries with a %define push_pull entry.
5507 * data/bison.m4 (b4_percent_define_check_values): New macro.
5508 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
5510 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
5512 * data/push.c: ... to here and compute them from the value of the
5513 %define variable push_pull.
5514 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
5515 parsing requests here...
5516 * data/yacc.c: ... hack this to switch to push.c any time
5517 b4_use_push_pull_flag or the %define variable push_pull is set. This
5518 will go away when we mv push.c yacc.c.
5519 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
5520 push parsing is not supported since unused %define variables are
5522 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
5523 * src/muscle_tab.h (muscle_percent_define_check_values): Update
5524 comments for consistency with b4_percent_define_check_values.
5525 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
5527 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
5529 (prologue_declaration): Remove %push-parser and %push-pull-parser
5531 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
5532 * tests/calc.at: Update declarations.
5533 * tests/input.at (%define enum variables): New test case.
5534 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
5536 (Push Parsing: Multiple impure instances): Update declaration.
5537 (Push Parsing: Unsupported Skeletons): New test case.
5538 * tests/torture.at (Exploding the Stack Size with Alloca): Update
5540 (Exploding the Stack Size with Malloc): Update declaration.
5542 2007-09-24 Wojciech Polak <polak@gnu.org>
5544 Add XSLT transformations.
5546 * data/xslt/xml2dot.xsl: Transform XML into DOT.
5547 * data/xslt/xml2text.xsl: Transform XML into plain text.
5548 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
5549 * data/Makefile.am (xsltdir): New variable.
5550 (dist_xslt_DATA): Add xslt/*.xsl files.
5552 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
5554 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
5555 Problem reported by Wojciech Polak.
5556 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
5557 (xml_printf): Undo change I made on 21 September; that is,
5558 indent 2 spaces, not 1.
5560 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
5562 Pacify ./configure --enable-gcc-warnings.
5563 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
5564 `char const *' instead of `char *'.
5565 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
5566 local variable `sep'.
5568 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5570 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
5572 * src/print-xml.c: Prefer "const" after types; that's more consistent.
5573 (xml_printf): Indent just 1 space for level.
5574 (e_char, xlate_char): Remove.
5575 (xml_escape_string): Rewrite to avoid undefined behavior (used
5576 storage that was freed from the stack).
5577 (xml_escape_n): Don't bother checking for subscript error.
5579 2007-09-21 Wojciech Polak <polak@gnu.org>
5581 Add Bison XML Automaton Report.
5583 Add support for an -x option to generate an XML report.
5584 It is not documented yet.
5585 * src/print-xml.c: New file.
5586 * src/print-xml.h: Likewise.
5587 * lib/timevar.def (TV_XML): New var.
5588 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
5589 * src/conflicts.c: Include print-xml.h.
5590 (solved_conflicts_xml_obstack): New var.
5591 (log_resolution, conflicts_solve, conflicts_free):
5592 Add support for XML report.
5593 (conflicts_output_val): New function.
5594 * src/conflicts.h (conflicts_output_val): New decl.
5595 * src/files.c (spec_xml_file): New var.
5596 (compute_output_file_names, output_file_names_free): Add XML support.
5597 * src/files.h (spec_xml_file): New decl.
5598 * src/getargs.c (xml_flag): New var.
5599 (usage, short_options, long_options, getargs): Add XML support.
5600 * src/getargs.h (xml_flag): New decl.
5601 * src/gram.c: Include print-xml.h.
5602 (rule_lhs_print_xml, rule_rhs_print_xml):
5603 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
5605 * src/gram.h: Declare external ones.
5606 * src/main.c: Include print-xml.h.
5607 (main): Add XML support.
5608 * src/reduce.c: Include print-xml.h.
5609 (reduce_xml): New function.
5610 * src/reduce.h: Declare it.
5611 * src/state.c: Include print-xml.h.
5612 (state_new): Add XML support.
5613 (state_rule_lookahead_tokens_print_xml): New function.
5614 * src/state.h: Declare it.
5615 (struct state): New member solved_conflicts_xml.
5616 * src/symtab.c (symbol_class_get_string): New function.
5617 * src/symtab.h: Declare it.
5619 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5621 * GNUmakefile: Switch to coreutils's version.
5622 * bootstrap: Likewise.
5623 * Makefile.cfg: Adjust to new GNUmakefile.
5624 * README-hacking: Likewise.
5628 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
5629 Bruno Haible <bruno@clisp.org>
5631 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
5632 and is a script that invokes bison. Tighten the code. Add comments.
5634 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
5636 Spell "boolean" as "Boolean". Reported by Akim Demaille.
5637 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
5638 * doc/bison.texinfo (Decl Summary): Fix.
5639 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
5640 * tests/input.at (Boolean %define variables): Update output.
5641 * tests/skeletons.at (%define boolean variables: invalid skeleton
5642 defaults): Rename to...
5643 (%define Boolean variables: invalid skeleton defaults): ... this and
5646 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
5648 In impure push mode, don't allow more than one yypstate to be allocated
5649 since multiple impure parsers would corrupt yynerrs.
5650 * data/push.c (yypstate_allocated): New static global variable
5652 (yypull_parse): If yypstate_new returns 0, don't report it as memory
5653 exhaustion if yypstate_allocated is 1, but still return 2.
5654 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
5655 already 1. Otherwise, set it to 1.
5656 (yypstate_delete): Set it to 0.
5657 * tests/push.at (Push Parsing: Multiple impure instances): New test
5660 2007-08-17 Bob Rossi <bob@brasko.net>
5662 * doc/bison.texinfo (Push Decl): Document the push parser.
5663 (Table of Symbols): Ditto.
5665 (Decl Summary): Ditto.
5666 (Multiple Parsers, Push Parser Function, Pull Parser Function,
5667 Parser Create Function, Parser Delete Function):
5668 Add new push parser symbols.
5669 (Table of Symbols): Document push-parser, push-pull-parser,
5670 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
5672 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
5675 * doc/gpl-3.0.texi: New file.
5676 * doc/gpl.texi: Remove.
5677 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
5678 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
5679 * README-hacking, TODO, bootstrap, bootstrap.conf:
5680 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
5681 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
5682 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
5683 * data/lalr1.cc, data/lalr1.java, data/location.cc:
5684 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
5685 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
5686 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
5687 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
5688 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
5689 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
5690 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
5691 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
5692 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
5693 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
5694 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
5695 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
5696 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
5697 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
5698 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
5699 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
5700 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
5701 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
5702 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
5703 * src/complain.c, src/complain.h, src/conflicts.c:
5704 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
5705 * src/files.h, src/flex-scanner.h, src/getargs.c:
5706 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
5707 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
5708 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
5709 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
5710 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
5711 * src/print.c, src/print.h, src/print_graph.c:
5712 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
5713 * src/reduce.h, src/relation.c, src/relation.h:
5714 * src/revision.h, src/scan-code.h, src/scan-code.l:
5715 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
5716 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
5717 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
5718 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
5719 * tests/Makefile.am, tests/actions.at, tests/c++.at:
5720 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
5721 * tests/existing.at, tests/glr-regression.at:
5722 * tests/headers.at, tests/input.at, tests/java.at:
5723 * tests/local.at, tests/output.at, tests/push.at:
5724 * tests/reduce.at, tests/regression.at, tests/sets.at:
5725 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
5729 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
5731 Get rid of broken %no-parser, -n, and --no-parser implementation and
5733 * TODO: Don't mention them.
5734 * doc/bison.1: Likewise.
5735 * doc/bison.texinfo (Decl Summary): Likewise.
5736 (Bison Options): Likewise.
5737 (Option Cross Key): Likewise.
5738 * src/getargs.c (no_parser_flag): Remove global variable.
5739 (usage): Don't print description of -n and --no-parser.
5740 (long_options): Remove --no-parser entry here.
5741 (getargs): Remove -n case in the switch here.
5742 * src/getargs.h (no_parser_flag): Remove extern.
5743 * tests/regression.at (Web2c Actions): Remove comment that mentions
5746 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
5748 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
5749 name user variables starting with `yy'. Just pass NULL instead of a
5750 dummy local &yylval to yypush_parse.
5751 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
5754 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
5756 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
5757 true since it's then always used regardless of whether yyoverflow is
5758 defined. Reported by Christian Burger at
5759 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
5760 * THANKS: Add Christian Burger.
5762 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
5763 node names: say "Decl Summary" not "Bison Declaration Summary".
5765 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
5767 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
5768 determine whether this function has already complained about an invalid
5769 value for a %define boolean variable, don't check whether Bison has
5770 ever examined the value. As written, the check was a tautology.
5771 Instead, record and check for this complaint using a separate muscle.
5773 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
5775 Fix push parsing memory leak reported by Brandon Lucia at
5776 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
5777 * THANKS: Add Brandon Lucia.
5778 * data/push.c (yypstate_delete): Free the stack if it was reallocated
5779 but the parse never completed and thus freed it.
5780 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
5781 * tests/testsuite.at: Include push.at.
5782 * test/push.at: New.
5783 (Push Parsing: Memory Leak for Early Deletion): New test case.
5785 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
5787 Improve handling of multiple S/R conflicts in the same state and of S/R
5788 conflicts involving multiple reductions.
5789 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
5790 set for a state here or Bison will abort if it is reassigned on a
5791 later conflicted reduction in the same state.
5792 Similarly, don't finalize and assign the solved conflicts report here
5793 or it will be lost if it is reassigned on a later conflicted reduction
5795 (set_conflicts): Instead, assign them both here after all S/R conflicts
5796 in the state have been fully examined.
5797 * src/print.c (shift_set): Rename to...
5798 (no_reduce_set): ... this.
5799 (print_reductions): Update for rename, and add %nonassoc error action
5800 tokens to no_reduce_set so that, when printing the first remaining
5801 reduction on an error action token, the reduction is enclosed in
5803 (print_results): Update for rename.
5804 * tests/conflicts.at (Solved conflicts report for multiple reductions
5805 in a state): New test case.
5806 (%nonassoc error actions for multiple reductions in a state): New test
5809 * src/main.c (main): Don't depend on C99 features.
5811 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
5813 * build-aux/.cvsignore: Add compile.
5814 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
5817 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
5819 * bootstrap (slurp): Create target directories that don't exist.
5820 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
5822 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5824 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
5826 * closure.c (closure): Likewise.
5827 * state.h (reductions): Comment sorting of rules.
5828 (state): Comment sorting of items.
5830 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
5832 Fix C++ test cases after recent Gnulib changes. Discussed starting at
5833 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
5834 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
5835 definition in order to avoid Gnulib headers since we don't use config.h
5837 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
5838 rather than AT_DATA so that config.h is included.
5840 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
5842 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
5843 instead of fprintf. Guard these functions with #if YYDEBUG instead of
5844 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
5845 and so that YYFPRINTF is guaranteed to be defined here.
5847 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
5849 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
5851 (muscle_percent_define_check_values): ... this more helpful function.
5852 Again, it's not used yet, but it will be.
5853 * src/muscle_tab.h: Likewise.
5855 Improve some comments in parser table construction.
5856 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
5857 (generate_states): Don't mention ruleset, which is internal to closure.
5858 * src/closure.c (closure): Explain sorting of core and itemset, which
5859 is required for this function to behave correctly.
5860 * src/closure.h (closure): Mention sorting.
5862 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
5864 * src/lalr.c (state_lookahead_tokens_count): For code readability,
5865 move the check for disabled transitions to an aver since conflict
5866 resolution hasn't happened yet.
5868 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
5869 labels a state as inconsistent just because it has error transitions.
5870 The original form of this check appeared in revision 1.1 of lalr.c,
5871 which was committed on 1991-12-21. Now (at least), changing the
5872 consistency label on such a state appears to have no useful effect in
5873 any of the places it is examined, which I enumerate below. The key
5874 point to understanding each item in this enumeration is that a state
5875 with an error transition is labelled consistent in the first place only
5876 if it has no rules, so the check cannot matter for states that have
5877 rules. (1) Labelling a state as inconsistent will cause set_conflicts
5878 to try to identify its conflicts, and a state must have *rules* to have
5879 conflicts. (2) Labelling a state as inconsistent will affect how
5880 action_row sets the default *rule* for the state. (3) Labelling a
5881 state as inconsistent will cause build_relations to add lookback edges
5882 to *rules* in that state.
5883 * src/state.h (struct state): Word the comment for member consistent
5886 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
5888 Don't depend on C99 features.
5889 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
5890 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
5891 * src/reader.c (check_and_convert_grammar): Fix for-loop.
5892 * src/state.c (state_mark_reachable_states): Fix for-loop.
5893 (state_remove_unreachable_states): Fix for-loop.
5895 Don't widen struct state with member reachable just to temporarily
5896 record reachability. Instead, use a local bitset.
5897 * src/state.h (struct state): Remove member.
5898 * src/state.c (state_new): Don't initialize it.
5899 (state_mark_reachable_states): Rename to...
5900 (state_record_reachable_states): ... this, and use bitset.
5901 (state_remove_unreachable_states): Use bitset.
5903 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
5905 * src/Makefile.am (yacc): Quote target action commands properly so
5906 that the yacc script isn't corrupt. Reported by Hans Aberg at
5907 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
5909 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
5910 the case of pure parsers. Reported by Frans Englich at
5911 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
5912 * THANKS: Add Frans Englich.
5914 * NEWS (2.3a+): In the %code entry, reference section `Bison
5915 Declaration Summary' from the manual now since the %code summary has
5917 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
5918 in the rules section must be terminated by semicolons.
5920 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
5922 Extend the front-end API for %define variables to more completely
5923 mirror the back-end. This will be useful in the future.
5924 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
5925 Update comments to mention the new front-end counterparts of these
5927 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
5928 for muscle_string_decode and muscle_location_decode.
5929 (muscle_string_decode): New static function.
5930 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
5931 (muscle_percent_define_get, muscle_percent_define_ifdef): New
5933 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
5934 muscle_percent_define_get to mimic the b4_percent_define_flag_if
5935 implementation more closely.
5936 (muscle_percent_define_invalid_value): New function.
5937 * src/muscle_tab.h (muscle_percent_define_get,
5938 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
5941 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
5943 * NEWS (2.3a+): Mention yesterday's state-removal change.
5944 (2.3a): Remove the %language entry, which was added after 2.3a.
5945 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
5946 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
5947 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
5948 tests/existing.at: Update copyright date.
5950 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5952 If conflict resolution makes states unreachable, remove those states,
5953 report rules that are then unused, and don't report conflicts in those
5955 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
5956 New global function.
5957 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
5959 * src/main.c (main): After conflict resolution, remove the unreachable
5960 states and update all data structures that reference states by number.
5961 * src/state.c (state_new): Initialize each state's reachable member to
5963 (state_mark_reachable_states): New static function.
5964 (state_remove_unreachable_states): New global function.
5965 * src/state.h (struct state): Add member bool reachable.
5966 (state_remove_unreachable_states): Prototype.
5967 * tests/conflicts.at (Unreachable States After Conflict Resolution):
5969 * tests/existing.at (GNU pic Grammar): Update test case output now that
5970 an unused rule is discovered.
5972 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5974 Minor code cleanup in parser table construction.
5975 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
5976 (new_itemsets, save_reductions): Update for rename to nitemset.
5977 * src/closure.c (nritemset): Rename to...
5978 (nitemset): ... this since the "r" appears to meaningless and isn't
5979 used in the comments.
5980 (closure): Update for rename.
5981 * src/closure.h (nritemset): Update extern to...
5982 (nitemset): ... this.
5983 * src/lalr.c (LA): Fix a typo in comments.
5984 * src/print.c (print_core): Update for rename to nitemset.
5985 * src/print_graph.c (print_graph): Likewise.
5986 * src/state.h: Fix some typos in header comments.
5988 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
5990 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
5991 still sticks to ASCII. Sorry!
5993 * README-hacking: New file, taken mostly from coreutils, with changes
5994 for Bison. Contains much of the contents of:
5995 * README-cvs: Remove.
5996 * bootstrap: Sync from gnulib.
5997 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
5998 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
6000 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
6002 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
6004 (Java Differences): Fix some typos.
6005 * THANKS: Add Sebastian Setzer.
6007 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
6009 * data/java.m4 (b4_single_class_if): Remove.
6010 (b4_abstract_if): Look at "%define abstract".
6012 (b4_union_name): Rename...
6013 (b4_yystype): ... to this. Map to "%define stype".
6014 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
6015 b4_maybe_throws): Fix quoting.
6016 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
6017 * data/lalr1.java (Lexer interface): Always define.
6018 (Lexer interface within parser class): Remove.
6019 (YYLexer class): New, used when "%code lexer" is present.
6020 (constructor): When "%code lexer" is used, pass %lex-param
6021 to the lexer constructor.
6022 (yylex, yyparse): Remove %lex-param from method invocations
6023 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
6025 * doc/bison.texinfo (Java Bison Interface): Mention "%define
6026 abstract". Rename "%define union_name" to "%define stype".
6027 Rename method names according to previous patch.
6028 (Java Scanner Interface): Describe "%code lexer" instead of
6029 "%pure-parser" and "%define single_class".
6030 (Java Differences): Mention "%code lexer".
6032 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
6033 Include scanner here, using macros from tests/local.at.
6034 (AT_DATA_CALC_Y): Remove final argument.
6035 (_AT_CHECK_JAVA_CALC): Likewise.
6036 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
6037 of %locations and %error-verbose.
6038 (main): Test with and without %lex-param.
6039 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
6040 (AT_BISON_OPTION_POPDEFS): Pop it.
6042 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6044 DJGPP spefic issue. Inhibit the use of disallowed characters for
6045 file name genertion on Win98, WinXP, etc. These are |<>":?*\
6046 and concern testsuite case 46.
6047 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
6048 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
6049 * djgpp/config.bat: Inhibit the use of disallowed characters.
6051 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6053 Miscellaneous %define and %code cleanup.
6054 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
6055 values are interpreted.
6056 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
6057 documentation a little more.
6058 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
6059 muscle_percent_define_insert, muscle_percent_code_grow): New
6061 * src/muscle_tab.h (muscle_percent_define_insert,
6062 muscle_percent_code_grow): Prototype.
6063 * src/parse-gram.y (prologue_declaration): Use
6064 muscle_percent_define_insert and muscle_percent_code_grow when parsing
6065 %define and %code directives.
6067 Make it easy to share %define boolean variables between the front-end
6068 and back-end. Though not used yet, this will be useful in the future.
6069 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
6070 Bison uses of names rather than just skeleton uses of names.
6071 (b4_percent_define_get, b4_percent_define_ifdef): Rename
6072 b4_percent_define_skeleton_variables(VARIABLE) to
6073 b4_percent_define_bison_variables(VARIABLE).
6074 (b4_percent_code_get, b4_percent_code_ifdef): Rename
6075 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
6076 b4_percent_code_bison_qualifiers(QUALIFIER).
6077 (b4_check_user_names_wrap): Update for renames.
6078 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
6079 muscle_percent_define_default): New functions mimicking
6080 b4_percent_define_flag_if and b4_percent_define_default.
6082 For %define variables, report locations for invalid values and
6084 * data/bison.m4 (b4_percent_define_flag_if): Read
6085 b4_percent_define_loc(VARIABLE) to report the location of an invalid
6087 (b4_percent_define_default): Save a special location in
6088 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
6089 must later be reported as invalid.
6090 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
6092 (muscle_percent_define_insert): Record the location of VARIABLE in
6093 muscle percent_define_loc(VARIABLE), and use it to report the previous
6094 location for a redefinition.
6095 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
6096 (muscle_percent_define_default): Update like b4_percent_define_default.
6097 (muscle_grow_user_name_list): Rename to...
6098 (muscle_user_name_list_grow): ... this for consistency and use
6099 muscle_location_grow.
6100 * src/muscle_tab.h (muscle_location_grow): Prototype.
6101 * tests/input.at (%define errors): Update expected output.
6102 * tests/skeletons.at (%define boolean variables: invalid skeleton
6103 defaults): New test case.
6105 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
6107 * src/print.c (lookahead_set, state_default_rule): Remove.
6108 (print_reductions): Replace state_default_rule invocation with
6109 equivalent use of yydefact, which was computed in token_actions in
6111 (print_results): Don't allocate lookahead_set.
6113 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
6115 * data/lalr1.java: Prefix all private members with yy.
6117 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
6119 Use YYFPRINTF instead of fprintf where appropriate. Reported by
6120 Sebastien Fricker at
6121 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
6122 * THANKS: Add Sebastien Fricker.
6123 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
6124 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
6125 accept a variable number of arguments.
6127 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
6129 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
6131 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6133 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
6134 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
6135 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
6137 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
6139 Undo my 2007-02-07 change, switching back to the c-strcase module
6140 introduced in the 2007-02-03 change. Bruno Haible reported that
6141 the 2007-02-07 change would be dangerous in Turkish if we add a
6142 language whose name contains "i", since "i" is not lowercase "I"
6144 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
6145 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
6146 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
6147 * m4/.cvsignore: Remove strcase.m4.
6148 * src/getargs.c: Revert 2007-02-07 change, as follows.
6149 Include c-strcase.h.
6150 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
6152 2007-02-11 Bruno Haible <bruno@clisp.org>
6154 Enable the Java related testsuite tests when the only Java compiler
6155 found is a gcj < 4.3. Discussed at
6156 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
6157 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
6159 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
6161 * data/Makefile.am: Update copyright date.
6162 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
6163 yypstate_new returns NULL.
6164 (yypstate_new): Return NULL if malloc does.
6165 * src/reader.c (packgram): Move translation of rule actions from the
6166 beginning of packgram to...
6167 (check_and_convert_grammar): ... here right before packgram is invoked
6168 so it's easier to write more complete comments, and remove redundant
6171 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
6173 As in semantic actions, make @$ in %initial-action, %destructor, and
6174 %printer imply %locations.
6175 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
6177 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
6178 (@$ in %initial-action implies %locations,
6179 @$ in %destructor implies %locations,
6180 @$ in %printer implies %locations): ... these new test cases.
6182 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
6184 Undo most of the 2007-02-03 change, switching to the strcase module
6185 now that gnulib strcase has been fixed.
6186 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
6187 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
6188 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
6189 * m4/.cvsignore: Add strcase.m4.
6190 * src/getargs.c: Revert 2007-02-03 change, as follows.
6191 Don't include c-strcase.h.
6192 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
6193 strcasecmp has "unspecified behavior" outside the POSIX locale,
6194 but it works fine in practice if at least one argument is ASCII,
6195 as is the case in Bison.
6197 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
6199 * tests/java.at: Skip tests if only one of javac/java is present.
6200 Reported by Joel E. Denny.
6201 * tests/atlocal.in: Adjust copyright years.
6203 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
6205 * data/lalr1.java (Stack): Work around old verifiers that disallow
6206 access to the private fields of an inner class, from the outer class.
6207 We can make Stack's fields public because user code doesn't have access
6208 to the instance of Stack used by parse(). Reported by Paul Eggert.
6210 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
6212 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
6213 the right spot for these files?
6214 * bootstrap.conf (gnulib_modules): Add c-strcase.
6215 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
6217 * src/getargs.c: Include c-strcase.h.
6218 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
6219 to avoid unspecified behavior.
6221 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
6223 * doc/bison.texinfo (Decl Summary): Correct typo.
6225 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
6227 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
6228 Complain if the value does not match empty, "true" or "false".
6229 * data/c++.m4: Adjust default definitions of %define variables.
6230 * data/java.m4: Adjust default definitions of %define variables.
6231 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
6233 * tests/input.at (Boolean %define variables): Test new behavior.
6235 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
6237 * NEWS: Mention java.
6238 * TODO: Remove things that are done.
6239 * bootstrap.conf: Add javacomp-script and javaexec-script.
6240 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
6242 * data/Makefile.am: Add new files.
6243 * data/java-skel.m4: New.
6244 * data/java.m4: New.
6245 * data/lalr1.java: New.
6247 * doc/bison.texinfo: Put "A Complete C++ Example" under
6248 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
6249 under Other Languages.
6251 * src/getargs.c (valid_languages): Add Java.
6252 * src/getargs.h (struct bison_language): Update size of string fields.
6254 * tests/Makefile.am: Add java.at.
6255 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
6256 * tests/java.at: New.
6257 * tests/testsuite.at: Include it.
6259 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
6262 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
6263 at_directive_argv arguments so these no longer have to be global
6264 variables. Also, update the implementation for the following changes.
6265 (fail_for_at_directive_too_many_args,
6266 fail_for_at_directive_too_few_args): Add at_directive_name argument.
6267 (at_directive_name): Remove as at_directive_argv[0] will be used for
6269 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
6270 for the directive name.
6271 (at_directive_argc, at_directive_argv): Make these local within
6272 skel_lex instead of global.
6273 (INITIAL): Update directive start action for above changes.
6274 (SC_AT_DIRECTIVE_ARG): Rename to...
6275 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
6276 (SC_AT_DIRECTIVE_SKIP_WS): Update.
6277 (scan_skel): Move yylex_destroy to...
6278 (skel_scanner_free): ... here.
6279 * tests/skeletons.at (installed skeleton file name): Rename to...
6280 (installed skeleton file names): ... this.
6282 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
6284 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
6285 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
6286 Summary" not "Directives".
6287 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
6288 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
6289 since the former is now the more complete one.
6290 (Prologue Alternatives): Likewise and do the same for %defines.
6291 (Table of Symbols): Add summary of %code, add summary of %define, and
6292 move full %code documentation to...
6293 (Decl Summary): ... here for consistency with other entries in these
6295 Move %define entry in order to keep this list alphabetized.
6296 Reword %define entry a little to put less emphasis on the skeleton
6297 concept, which most users shouldn't have to think about.
6299 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
6301 Adjust to recent gnulib changes.
6302 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
6303 Add string.h, string_.h, unistd_.h, wchar_.h.
6304 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
6305 * src/system.h: Don't include <stpcpy.h>; this is now done by
6308 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
6310 Simplify implementation of unqualified %code, implement macros for
6311 uniform treatment of boolean %define flags. Document %define.
6312 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
6313 b4_percent_code_ifdef): New.
6314 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
6315 * data/c++.m4: Define default value for global_tokens_and_yystype.
6316 * data/glr.cc: Likewise.
6317 * data/location.cc: Use b4_percent_define_flag_if.
6319 * doc/bison.texinfo (Decl Summary): Document %define.
6321 * src/parse-gram.y (Unqualified %code): Change muscle name to
6323 (content.opt): Default to empty.
6325 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6327 Implement support for relative and absolute skeleton file names.
6328 Discussed starting at
6329 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
6330 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
6331 (Bison Options): Document in --skeleton entry.
6332 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
6333 full_skeleton can't necessarily hold all of pkgdatadir.
6334 If the specified skeleton file name contains a `/', don't prepend
6336 * src/parse-gram.y (prologue_declaration): If the specified skeleton
6337 file name contains a `/', prepend the grammar file directory.
6338 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
6339 * skeletons.at: New file.
6340 (relative skeleton file names): New test case.
6341 (installed skeleton file names): New test case.
6342 * tests/testsuite.at: Include skeletons.at.
6344 * bootstrap: Update copyright to 2007.
6346 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
6348 * bootstrap: Remove occurrences of .#bootmp from the files.
6350 2007-01-17 Akim Demaille <akim@epita.fr>
6352 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
6354 Use per-type %printer.
6356 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6358 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
6359 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6360 djgpp/config.site, src/files.c, src/files.h, src/main.c,
6361 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
6362 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
6363 tests/glr-regression.at, tests/input.at, tests/local.at,
6364 tests/output.at, tests/torture.at: Update copyright to 2007.
6366 2007-01-16 Akim Demaille <akim@epita.fr>
6368 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
6370 (Calc++ Scanner): Exit with failure if we can't open the input
6372 Accept "-" standing for stdin.
6373 (Calc++ Top Level): Print the result only if the parsing was
6376 2007-01-16 Akim Demaille <akim@epita.fr>
6378 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
6380 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
6381 and Joel E. Denny <jdenny@ces.clemson.edu>
6383 Clean up %define and %code implementation in M4 some. Most
6384 importantly, rename all related macros to be in the b4_percent_define
6385 and b4_percent_code namespaces. Also, complete support for `.' in
6386 %define variable names and %code qualifiers.
6387 * data/bison.m4 (b4_check_user_names): Check for special
6388 "SKELETON-NAMESPACE(name)" macros instead of using two nested
6390 (b4_get_percent_define, b4_get_percent_code): Rename to...
6391 (b4_percent_define_get, b4_percent_code_get): ... these.
6392 Extend documentation with examples.
6393 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
6394 b4_percent_define_skeleton_variables and
6395 b4_percent_code_skeleton_qualifiers.
6396 Expect any value for the %define variable `foo' to be stored in the
6397 macro named `b4_percent_define(foo)'; expect any %code blocks for the
6398 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
6399 expect any unqualified %code blocks to be stored in a macro named
6400 `b4_percent_code_unqualified'.
6401 Use m4_indir so that %define variable names and %code qualifiers can
6402 contain `.', which is allowed by the grammar parser.
6403 (b4_percent_define_default): New macro to set a default value for a
6405 (m4_wrap): Update wrapped code, and fix some underquoting.
6406 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
6407 Expect grammar uses of %define variables and %code qualifiers to be
6408 defined in b4_percent_define_user_variables and
6409 b4_percent_code_user_qualifiers.
6410 * data/c++.m4: Use b4_percent_define_default rather than
6411 m4_define_default. Fix some underquoting. Skeleton usage of %define
6412 variable define_location_comparison now implies skeleton usage of
6413 %define variable filename_type.
6414 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6415 data/push.c, data/yacc.c: Update macro names.
6416 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
6419 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6421 DJGPP specific issues.
6423 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
6424 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
6426 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6428 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
6429 run parsers in all tests so that Valgrind is invoked during
6430 maintainer-check-valgrind.
6431 (Duplicate representation of merged trees): Free all semantic values.
6432 (Duplicated user destructor for lookahead): Likewise.
6434 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6436 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
6437 command-line prefix.
6438 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
6439 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
6440 miss Valgrind messages.
6441 (Exploding the Stack Size with Malloc): Likewise.
6443 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6445 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
6446 locals. Reported by Juan Manuel Guerrero at
6447 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
6448 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
6449 Fix some indentation also.
6450 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
6451 explaining this issue.
6453 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
6454 and Joel E. Denny <jdenny@ces.clemson.edu>
6456 Simplify union and prologue handling, and escape union and lex/parse
6457 params with digraphs.
6458 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
6459 values to the empty string since these are no longer guaranteed
6460 initialized by the front-end.
6461 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
6462 braces around b4_user_stype since this is no longer done by the
6464 * src/files.c, src/files.h (pre_prologue_obstack,
6465 post_prologue_obstack): Remove.
6466 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
6467 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
6468 with digraphs. This fixes lex params and parse params.
6469 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
6470 * src/output.c (prepare): Remove muscle insertion of the prologues.
6471 (output): Remove freeing of pre_prologue_obstack and
6472 post_prologue_obstack.
6473 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
6474 than prologue_augment for prologue parsing so you don't need prologue
6476 (grammar_declaration): For %union RHS, use `braceless' instead of
6477 "{...}" so that braces are already stripped and code is escaped with
6479 * src/reader.c (prologue_augment): Remove.
6480 (reader): Remove initialization of pre_prologue_obstack and
6481 post_prologue_obstack.
6482 * src/reader.h (prologue_augment): Remove.
6484 * data/c.m4: Remove stray parenthesis.
6486 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6488 Remove quotes from variables names in %define directives and from
6489 qualifiers in %code directives, and restrict the characters that are
6490 allowed in them to M4-friendly ones. For %define, continue to support
6491 the quoted form as a deprecated feature. Discussed starting at
6492 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
6493 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
6495 * doc/bison.texinfo (Prologue Alternatives): Update.
6496 (Decl Summary): In %defines entry, update mention of `%code requires'
6497 and `%code provides'.
6498 (C++ Location Values): Update %define uses.
6499 (Calc++ Parser Interface): Likewise.
6500 (Calc++ Parser): Likewise, and update `%code requires' uses.
6501 (Table of Symbols): Update %code documentation.
6502 * src/parse-gram.y (prologue_declaration): For %define variables, use
6503 `variable' instead of `STRING'.
6504 (grammar_declaration): For %code qualifiers, use `ID' instead of
6506 (variable): New nonterminal that takes an `ID' or a `STRING'.
6507 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
6509 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
6510 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
6511 (%define errors): Update %define uses.
6513 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6515 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
6516 instead of muscle_insert for %define values so that M4-special
6517 characters are replaced with digraphs.
6518 * tests/input.at (%define errors): Extend to check weird values.
6520 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6522 Instead of having skeletons declare all valid %define variables and
6523 %code qualifiers, provide macros that retrieve the associated values
6524 and build these lists automatically. Thus Bison will now warn when a
6525 variable or qualifier is not used by the skeleton in the current
6526 invocation regardless of whether it might sometimes be used by that
6527 skeleton in other invocations. Also, move all %define value macros to
6528 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
6529 form, which is replaced by %code.
6530 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
6531 (b4_check_user_names): ... this, and change the series of valid name
6532 arguments to a single list argument for names used in the skeleton
6533 similar to the existing list argument for names used in the grammar.
6534 Warn instead of complaining.
6535 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
6536 values and %code code, to format %code code properly, and to build
6537 lists of all %define variables and %code qualifiers used in the
6538 skeleton: b4_skeleton_percent_define_variables and
6539 b4_skeleton_percent_code_qualifiers.
6540 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
6542 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
6543 the skeleton names lists can finish building first. In place of
6544 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
6545 expect the lists b4_user_percent_define_variables and
6546 b4_user_percent_code_qualifiers.
6547 * data/c++.m4: Where setting default values for b4_parser_class_name,
6548 b4_location_type, b4_filename_type, b4_namespace, and
6549 b4_define_location_comparison, update their names to the
6550 b4_percent_define_ namespace.
6551 * data/glr.c: Don't use b4_check_percent_define_variables and
6552 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
6553 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
6554 (b4_parser_class_name, b4_namespace): Define these using
6555 b4_get_percent_define for parser_class_name and namespace.
6556 * data/location.cc: Use b4_get_percent_define.
6557 * data/push.c: Don't use b4_check_percent_define_variables and
6558 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
6559 * data/yacc.c: Likewise, and don't call m4_exit in
6560 b4_use_push_for_pull_if or m4_wrap code will never execute.
6561 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
6563 (muscle_grow_user_name_list): ... this for consistency with the
6564 terminology used in bison.m4.
6565 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
6566 %define variable names, and rename muscle used_percent_define_variables
6567 to user_percent_define_variables.
6568 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
6569 user_percent_code_qualifiers.
6571 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
6572 {CODE} form is no longer accepted.
6573 * tests/input.at (Reject bad %code qualifiers): Rename to...
6574 (Reject unused %code qualifiers): ... this, and update test output.
6575 (%define error): Update test output.
6577 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
6579 Check for unrecognized %define variables similar to checking for
6580 unrecognized %code qualifiers. Check for redefined %define variables.
6581 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
6583 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
6584 (b4_check_percent_define_variables): New, also wraps it.
6585 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
6586 variables using b4_check_percent_define_variables.
6587 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
6588 all those exercised in the test suite and all those listed in the
6589 `Default values' section of c++.m4. Are there others?
6590 * data/push.c, data/yacc.c: Declare no valid %define variables.
6591 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
6592 similar to muscle_find, but it works even when the muscle stores a
6594 (muscle_grow_used_name_list): New function for constructing the used
6595 name list muscles that b4_check_for_unrecognized_names requires.
6596 * src/parse-gram.y (prologue_declaration): Warn if a variable is
6597 %define'd more than once. Define the b4_used_percent_define_variables
6598 muscle with muscle_grow_used_name_list.
6599 (grammar_declaration): Abbreviate %code code with
6600 muscle_grow_used_name_list.
6601 * tests/input.at (%define errors): New.
6603 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6605 Provide warn_at, complain_at, and fatal_at function callbacks to the
6606 skeletons, and use this for %code qualifier complaints.
6607 * data/bison.m4 (b4_error_at): New, invoked by...
6608 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
6609 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
6610 @fatal_at(...@) directives.
6611 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
6612 qualifiers in b4_used_percent_code_qualifiers and to use
6614 * src/location.c, src/location.h (boundary_set_from_string): New global
6616 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
6618 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
6619 to b4_used_percent_code_qualifiers.
6620 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
6622 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
6623 (lineno): Rename to...
6624 (out_lineno): ... this so I don't misunderstand it again.
6625 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
6626 here; these newlines are in the input but not the output file.
6627 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
6628 (at_directive_perform): ... this new static function, and add handling
6629 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
6631 * tests/input.at (Reject bad %code qualifiers): Update test output with
6632 locations and extend.
6634 * tests/output.at (Output file name: [, Output file name: ]): Remove
6635 bogus comment about these tests failing.
6637 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6639 Clean up b4_check_percent_code_qualifiers a little.
6640 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
6641 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
6642 documentation and add examples.
6643 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
6646 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
6648 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
6649 unreliable -- especially when they're hidden inside another macro.
6650 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
6651 data/c.m4: Remove m4_divert(-1).
6652 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6653 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
6654 m4_divert_push(0) and m4_divert_pop(0).
6655 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
6656 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
6657 pushed and popped by m4sugar, should be first on the stack.
6659 Provide warn, complain, and fatal function callbacks to the skeletons.
6660 This provides more flexibility than m4_fatal, improves the error
6661 message format, and captures messages for translation. Discussed
6663 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
6664 * data/bison.m4 (b4_error): New, invoked by...
6665 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
6666 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
6667 directives. Because these M4 macros might be called when the current
6668 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
6669 the previous removal of uses of m4_divert, which caused trouble.
6670 (b4_check_percent_code_qualifiers): Use b4_complain instead of
6671 m4_fatal to report unrecognized %code qualifiers.
6672 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
6673 push parser requests.
6674 * data/glr.c: Use b4_complain instead of m4_fatal to report
6675 non-deterministic push parser requests.
6676 Update @output usage to @output(...@) form.
6677 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
6678 report missing %defines. Update @output usage to @output(...@) form.
6679 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
6681 * src/main.c (main): Invoke skel_scanner_free.
6682 * src/scan-skel.h (skel_scanner_free): Prototype new function.
6683 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
6684 obstack_for_string from flex-scanner.h.
6685 (YY_DECL): Use to declare skel_lex static.
6686 (decode_at_digraphs): Remove; now handled in the new
6687 SC_AT_DIRECTIVE_ARG start condition.
6688 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
6690 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
6691 at_directive_argv): New static globals.
6692 (INITIAL): Use fail_for_invalid_at.
6693 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
6694 recognize the start of a generalized `@directive(...@)' form and
6696 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
6697 directive args (using the new obstack_for_string), to decode the
6698 contained @ diagraphs, and to perform the directive. It recognizes
6699 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
6701 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
6702 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
6704 (scan_skel): Initialize obstack_for_string on the first call.
6705 (skel_scanner_free): New function to free obstack_for_string.
6706 * tests/input.at (Reject bad %code qualifiers): Update test output.
6708 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
6710 Consolidate the 4 prologue alternative directives (%code, %requires,
6711 %provides, and %code-top) into a single %code directive with an
6712 optional qualifier field. Discussed at
6713 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
6714 * NEWS (2.3a+): Rewrite the existing entry for the prologue
6716 * doc/bison.texinfo (Prologue Alternatives): Update.
6717 (Decl Summary): Update to %code "requires" and %code "provides".
6718 (Calc++ Parser): Update to %code "requires".
6719 (Table of Symbols): Remove entries for %requires, %provides, and
6720 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
6721 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
6722 are replaced by b4_percent_code_provides and b4_percent_code_requires,
6723 which are skeleton-specific.
6724 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
6725 declare what %code qualifiers it supports and to complain if any other
6726 qualifiers were used in the grammar.
6727 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
6728 and b4_user_code([b4_percent_code_provides]) in place of
6729 b4_user_requires and b4_user_provides.
6730 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
6731 Add b4_user_code([b4_percent_code_top]) and
6732 b4_user_code([b4_percent_code]).
6733 Invoke b4_check_percent_code_qualifiers.
6734 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
6735 PERCENT_REQUIRES): Remove.
6736 (grammar_declaration): Remove RHS's for %code-top, %provides, and
6737 %requires. Rewrite the %code RHS as the unqualified form defining the
6738 muscle b4_percent_code. Add another RHS for the qualified %code form,
6739 which defines muscles of the form b4_percent_code_QUALIFIER and the
6740 b4_used_percent_code_qualifiers muscle.
6741 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
6742 PERCENT_REQUIRES): Remove.
6743 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
6744 %code "requires" and %code "provides".
6745 * tests/input.at (Reject bad %code qualifiers): New.
6747 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
6749 Use the new code_props interface for destructors and printers.
6750 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
6751 printer_location members, and change the type of the destructor and
6752 printer members to code_props.
6753 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
6754 symbol_printer_get, semantic_type_destructor_set,
6755 semantic_type_printer_set, default_tagged_destructor_set,
6756 default_tagless_destructor_set, default_tagged_printer_set,
6757 default_tagless_printer_set): Use code_props in arguments and return
6758 types in place of char const * and location.
6759 (symbol_destructor_location_get, symbol_printer_location_get): Remove
6760 since the locations are now contained in the return of
6761 symbol_destructor_get and symbol_printer_get.
6762 * src/output.c (symbol_destructors_output, symbol_printers_output):
6764 (symbol_code_props_output): ... this to eliminate duplicate code.
6765 (output_skeleton): Update to use symbol_code_props_output.
6766 * src/reader.c (symbol_should_be_used): Update use of
6767 symbol_destructor_get.
6768 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
6769 Update uses of the various _destructor_set and _printer_set functions.
6770 * src/symtab.c: (default_tagged_destructor_location,
6771 default_tagless_destructor_location, default_tagged_printer_location,
6772 default_tagless_printer_location): Remove since we...
6773 (default_tagged_destructor, default_tagless_destructor,
6774 default_tagged_printer, default_tagless_printer): ... change the type
6775 of these to code_props.
6776 (symbol_new, semantic_type_new, symbol_destructor_set,
6777 semantic_type_destructor_set, symbol_destructor_get,
6778 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
6779 symbol_check_alias_consistency, default_tagged_destructor_set,
6780 default_tagless_destructor_set, default_tagged_printer_set,
6781 default_tagless_printer_set): Update.
6782 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
6783 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
6785 (symbol_print): Use SYMBOL_CODE_PRINT.
6787 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
6789 Use the new code_props interface for rule actions.
6790 * src/symlist.h (symbol_list): Replace action, action_location, and
6791 used members with a code_props action_props member.
6792 * src/reader.c (symbol_should_be_used, grammar_rule_check,
6793 grammar_midrule_action, grammar_current_rule_merge_set,
6794 grammar_current_rule_symbol_append, packgram): Update.
6795 * src/scan-code.h (translate_rule_action): Remove, no longer used.
6796 * src/scan-code.l (handle_action_dollar): Update.
6797 (translate_rule_action): Remove, no longer used.
6798 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
6800 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6802 Use the new code_props interface in parse-gram.y.
6803 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
6804 Update all uses of translate_* functions to use the new code_props
6805 interface and to use gram_scanner_last_string_free and
6806 code_scanner_last_string_free where possible.
6807 (grammar_declaration): symbol_list_destructor_set and
6808 symbol_list_printer_set now perform the translation, so don't do it
6809 here. Use gram_scanner_last_string_free where possible.
6810 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
6811 translate_code): Remove, no longer used.
6812 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
6813 symbol_list_printer_set): Perform code translation here rather than
6814 depending on the caller to do so.
6816 * src/symlist.h (struct symbol_list): Correct some documentation typos.
6817 * src/scan-gram.h (gram_last_string): Remove declaration.
6818 * src/scan-gram.l (last_string): Declare it static.
6820 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6822 Encapsulate code properties and related functionality for the various
6823 destructors, printers, and actions into a code_props structure and
6824 interface. This patch merely implements code_props in scan-code.h and
6825 scan-code.l. Future patches will rewrite other modules to use it.
6826 Discussed starting at
6827 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
6828 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
6829 consistently initialize const structs that have an empty location
6831 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
6832 to ensure consistency.
6833 * src/scan-code.h (code_props): New structure.
6834 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
6835 function, macro, and const global variable for initializing a
6836 code_props with no code.
6837 (code_props_plain_init, code_props_symbol_action_init,
6838 code_props_rule_action_init, code_props_translate_code): The rest of
6839 the new code_props functional interface. Among other things, the init
6840 functions set the code_props kind field so that
6841 code_props_translate_code will know whether to behave like
6842 translate_symbol_action, translate_rule_action, or translate_code.
6843 These old translate functions must remain until all other modules are
6844 updated to use the new code_props interface.
6845 (code_scanner_last_string_free): New function similar to
6846 gram_scanner_last_string_free.
6847 (code_scanner_free): Add documentation.
6848 * src/scan-code.l: Implement the new interface.
6849 (code_lex): Make it static, add a code_props* argument, and remove the
6851 (last_string): New static global similar to the one in scan-gram.l.
6852 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
6854 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
6855 code_props since Bison may one day use this information for destructors
6857 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
6858 (handle_action_dollar): Use symbol_list_n_get and set used flag
6859 directly since symbol_list_n_used_set is removed.
6860 (translate_action): Add a code_props* argument and remove the rule,
6861 action, and location arguments. Pass the code_props* on to code_lex.
6862 (translate_rule_action, translate_symbol_action, translate_code):
6863 Rewrite as wrappers around the new code_props interface.
6864 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
6865 it would eventually need to break the encapsulation of code_props.
6867 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
6869 * etc/.cvsignore: New.
6871 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
6873 Add maintainer-push-check to run maintainer-check using push parsing in
6874 place of pull parsing where available.
6875 * Makefile.am (maintainer-push-check): New.
6876 * data/bison.m4 (b4_use_push_for_pull_if): New.
6877 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
6878 appropriately based on their existing values.
6879 (yypush_parse): Don't print push-parser-specific diagnostics if push
6880 parsing is being used in place of pull parsing.
6881 * data/yacc.c: If push parsing should replace pull parsing, redirect to
6883 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
6884 variable, and insert b4_use_push_for_pull_flag into muscles.
6885 * tests/Makefile.am (maintainer-push-check): New.
6887 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
6889 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
6890 (whether successful or failed) so that yypush_parse can be invoked
6891 again to start a new parse using the same yypstate.
6892 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
6893 check multiple yypull_parse invocations on the same yypstate. For pull
6894 mode, extend to check multiple yyparse invocations.
6895 (Exploding the Stack Size with Alloca): Extend to try with
6897 (Exploding the Stack Size with Malloc): Likewise.
6899 * tests/calc.at (Simple LALR Calculator): Don't specify
6900 %skeleton "push.c" since %push-pull-parser implies that now.
6901 * tests/headers.at (export YYLTYPE): Don't check for the push
6902 declarations. Otherwise, this test case can't be used to see if push
6903 mode can truly emulate pull mode.
6904 * tests/input.at (Torturing the Scanner): Likewise.
6905 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
6906 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
6907 AT_YACC_IF, which now includes the case of push mode since %skeleton
6908 need not be used for push mode. This will be more intuitive once
6909 push.c is renamed to yacc.c.
6911 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
6913 For push mode, convert yyparse from a macro to a function, invoke yylex
6914 instead of passing a yylexp argument to yypull_parse, and don't
6915 generate yypull_parse or yyparse unless %push-pull-parser is declared.
6916 Discussed starting at
6917 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
6918 * data/bison.m4 (b4_pull_if): New.
6919 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
6920 * data/push.c: Improve M4 quoting a little.
6921 (b4_generate_macro_args, b4_parenthesize): Remove.
6922 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
6923 any time a pull parser is requested.
6924 Don't #define this as a wrapper around yypull_parse. Instead, when
6925 both push and pull are requested, make it a function that does that
6927 (yypull_parse): If there's a b4_prefix, #define this to
6928 b4_prefix[pull_parse] when both push and pull are requested.
6929 Don't define this as a function unless both push and pull are
6931 Remove the yylexp argument and hard-code yylex invocation instead.
6932 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
6934 * src/getargs.c (pull_parser): New global initialized to true.
6935 * getargs.h (pull_parser): extern it.
6936 * src/output.c (prepare): Insert pull_flag muscle.
6937 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
6938 (prologue_declaration): Set both push_parser and pull_parser = true for
6939 %push-pull-parser. Set push_parser = true and pull_parser = false for
6941 * src/scan-gram.l: Don't accept %push_parser as an alternative to
6942 %push-parser since there's no backward-compatibility concern here.
6943 Scan %push-pull-parser.
6944 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
6945 instead of %push-parser.
6946 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
6947 prototype it in the module that calls yyparse.
6948 * tests/input.at (Torturing the Scanner): Likewise.
6949 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
6951 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
6953 Update etc/bench.pl. Optimize push mode a little (the yyn change
6954 deserves most of the credit).
6955 * Makefile.am (SUBDIRS): Add etc subdirectory.
6956 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
6957 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
6958 yytoken, yyval, and yyloc declarations to...
6959 (yyparse or yypush_parse): ... here to improve performance. For
6960 yypush_parse invocations after the first, be sure to assign yyn its old
6962 (yypstate_new): Don't bother initializing the yyresult field since the
6963 initial value isn't used.
6964 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
6965 remove the #define that, in push mode, set it to yyps->NAME.
6966 * etc/Makefile.am: New.
6967 * etc/bench.pl: Remove and build it instead from...
6968 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
6969 "tests/bison" from the build directory by default rather than just
6970 invoking "bison" from $PATH.
6971 (calc_grammar): Update push parser code: don't declare yylval globally,
6972 don't define yyparse_wrapper, and don't #define yyparse.
6973 (bench_grammar): Update to check all working combinations of yacc.c,
6974 push.c, impure, pure, pull, and push.
6976 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
6978 For push mode, add pull wrappers around yypush_parse.
6979 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
6980 (yypull_parse): New function wrapping yypush_parse.
6981 (yyparse): New #define wrapping yypull_parse.
6982 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
6984 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
6985 prototype yylex in the module that calls yyparse, and don't prototype
6986 yyparse there. Otherwise, the yyparse expansion won't compile.
6987 * tests/input.at (Torturing the Scanner): Likewise.
6989 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
6991 Enable push parsers to operate in impure mode. Thus, %push-parser no
6992 longer implies %pure-parser. The point of this change is to move
6993 towards being able to test the push parser code by running the entire
6994 test suite as if %push-parser had been declared.
6995 * data/push.c (yypush_parse): For impure mode, remove the
6996 yypushed_char, yypushed_val, and yypushed_loc arguments.
6997 Instead, declare these as local variables initialized to the global
6998 yychar, yylval, and yylloc.
6999 For the first yypush_parse invocation only, restore the initial values
7000 of these global variables when it's time to read a token since they
7001 have been overwritten.
7002 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
7004 * tests/calc.at (Simple LALR(1) Calculator): Always declare
7005 %pure-parser along with %push-parser since this test case was designed
7006 for pure push parsers.
7007 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
7008 (AT_YACC_OR_PUSH_IF): New.
7009 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
7010 add a note that it's still wrong for some cases (as it has been for a
7012 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
7013 %push-parser no longer implies %pure-parser.
7015 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7017 Remove some unnecessary differences between the pull parser code and
7018 the push parser code. This patch enables yynerrs in push mode.
7019 * data/push.c: Reformat M4 a little.
7020 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
7021 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
7022 because push mode is on. Instead, if pure mode is on, move yynerrs
7024 (b4_declare_parser_state_variables): ... here.
7025 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
7026 to yyps->NAME so it can be used in yypush_parse.
7027 (yypush_parse): Don't omit uses of yynerrs in push mode.
7029 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7031 Fix bug such that the first pushed token's value and location are
7032 sometimes overwritten (sometimes by %initial-action) before being used.
7033 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
7034 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
7035 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
7036 more closely mimic the pull parser logic.
7037 Don't copy the pushed token to yychar, yylval, and yylloc until it's
7038 time to read a token, which is after any initialization of yylval and
7040 (gottoken): Rename label to...
7041 (yyread_pushed_token): ... for clarity and to avoid infringing on the
7044 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7046 Rearrange initialization of the parser state variables so that the
7047 skeleton doesn't have to have a copy for pull mode and another for push
7048 mode. This patch also fixes at least a bug such that yylloc was not
7049 initialized (with b4_location_initial_line and
7050 b4_location_initial_column) upon calling yypush_parse. However, that
7051 initialization now overwrites the first token's location;
7052 %initial-action assigning @$ already did the same thing, and both bugs
7053 will be fixed in a later patch.
7054 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
7055 (b4_declare_parser_state_variables): Remove initialization of yytoken,
7056 yyss, yyvs, yyls, and yystacksize.
7057 (yypstate_new): Remove initialization of some yypstate fields: yystate,
7058 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
7060 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
7061 yyps->NAME so it can be used in yypush_parse.
7062 (yyparse or yypush_parse): For yypush_parse, don't print the
7063 "Starting parse" diagnostic for invocations after the first.
7064 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
7065 yypush_parse, only do it for the first invocation.
7066 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
7067 initialization to occur in yypush_parse but only on the first
7070 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7072 * data/push.c: Add CPP guards around push parser declarations in both
7073 the header and the code file.
7074 In the code file, move the push parser declarations to the same place
7075 they appear in the header file.
7076 Clean up the M4 some, especially the inconsistent underquoting in
7077 some b4_c_function_def and b4_c_function_decl uses.
7079 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7081 Encapsulate the push parser state variables into an M4 macro so the
7082 push skeleton doesn't have to list them again for pull mode's yyparse.
7083 For push mode, remove yypush_parse's local equivalents of these
7084 variables to eliminate unnecessary copying between the two sets at
7085 run-time. This patch also fixes at least a bug related to multiple
7086 %initial-action invocations in push mode.
7087 * data/push.c (b4_declare_parser_variables): Rename to...
7088 (b4_declare_scanner_communication_variables): ... this for clarity and
7090 (b4_declare_yyparse_variables): Remove and move its contents to the one
7091 spot where it was invoked.
7092 (b4_declare_parser_state_variables): New macro containing the parser
7093 state variables required by push mode.
7094 (struct yypstate): Replace all fields but yynew with
7095 b4_declare_parser_state_variables.
7096 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
7097 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
7098 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
7099 (yyparse or yypush_parse): For yyparse in pull mode, replace local
7100 parser state variable declarations with
7101 b4_declare_parser_state_variables.
7102 Don't initialize parser state variables when calling yypush_parse since
7103 yypstate_new already does that.
7104 Invoke the user's initial action only upon the first yypush_parse
7106 Remove all code that copies between the local parser state variables
7109 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7111 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
7112 prevent a name collision in a future patch where these names will
7113 sometimes be #define'd.
7114 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
7115 since it no longer has the same name as the existing argument.
7116 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
7118 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
7119 and Joel E. Denny <jdenny@ces.clemson.edu>
7121 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
7122 that the argument is case-insensitive, and there's no `=' here.
7123 For the %skeleton entry, mention that %language is better.
7124 (Bison Options): Likewise for --language and --skeleton. Move the
7125 --skeleton entry so that the `Tuning the parser' section is sorted
7126 alphabetically on long options.
7127 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
7128 %language directive in detail here; cross-reference the %language
7129 documentation instead.
7130 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
7131 `%require "2.3b"' so that the example is always up-to-date.
7132 (Table of Symbols): Add entries for %language and %skeleton.
7133 * examples/extexi (normalize): Instead of replacing every %require
7134 argument with the current Bison version, just substitute for
7135 `@value{VERSION}'. This guarantees that we're testing what actually
7136 appears in the documentation.
7137 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
7138 rather than `@VERSION@'.
7140 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7142 * NEWS: Reword the %language news a bit, and put it earlier.
7144 * src/getargs.c (skeleton_arg): Last arg is now location const *.
7145 Rewrite to simplify the logic.
7146 (language_argmatch): Likewise.
7147 (program_name): We now own this var.
7148 * src/getargs.h (struct bison_language): Use char[] rather than
7151 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
7153 * src/complain.c (program_name): Remove decl; no longer needed.
7154 * src/main.c (program_name): Remove; now belongs to getargs.
7156 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
7158 * NEWS: Document %language.
7160 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
7162 * data/c-skel.m4, data/c++-skel.m4: New files.
7163 * data/glr.c: Complain on push parsers.
7165 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
7167 (Decl Summary): Document %language and %skeleton.
7168 (Command line): Document -L.
7170 * examples/extexi: Rewrite %require directive.
7171 * examples/calc++/Makefile.am: Pass VERSION to extexi.
7173 * src/files.c (compute_exts_from_gc): Look in language structure
7175 (compute_file_name_parts): Check whether .tab should be added.
7176 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
7177 (language, skeleton_arg, language_argmatch): New.
7178 (long_options): Add --language.
7179 (getargs): Use skeleton_arg, add -L/--language.
7180 * src/getargs.h: Include location.h.
7181 (struct bison_language, language, skeleton_arg, language_argmatch): New.
7182 * src/output.c (prepare): Pick default skeleton from struct language.
7183 Don't dispatch C skeletons here.
7184 * src/parse-gram.y (PERCENT_LANGUAGE): New.
7185 (prologue_declaration): Add "%language" rule, use skeleton_arg.
7186 * src/scan-gram.l ("%language"): New rule.
7188 * tests/calc.at: Test %skeleton and %language.
7189 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
7190 (AT_GLR_IF): Look for %skeleton "glr.cc".
7191 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
7192 (AT_YACC_IF): Reject %language.
7194 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7196 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
7197 since it wasn't used; only the typedef name 'semantic_type' is needed.
7198 Also, omit trailing white space.
7200 * bootstrap: Sync from coreutils.
7201 (gnulib_extra_files): Add build-aux/announce.gen.
7202 (slurp): Adjust .gitignore files like .cvsignore files.
7203 * build-aux/announce-gen: Remove from CVS, since bootstrap
7206 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
7208 Make %push-parser imply %pure-parser. This fixes several bugs; see
7209 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
7210 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
7212 * data/push.c: Don't bother testing b4_push_if when deciding whether
7213 to expand b4_declare_parser_variables globally.
7214 (yypush_parse): Likewise in here.
7216 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
7217 (yy_reduce_print): Reformat M4 for readability.
7219 2006-12-15 Bob Rossi <bob@brasko.net>
7220 and Joel Denny <jdenny@ces.clemson.edu>
7222 * data/push.c (yypstate): Add typedef, and update all uses of
7223 struct yypstate to just yypstate.
7224 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
7226 2006-12-14 Bob Rossi <bob@brasko.net>
7228 * data/push.c (yypush_parse): Declare prototype regardless of
7231 2006-12-14 Bob Rossi <bob@brasko.net>
7233 * data/push.c (yyparse): Remove the prototype and the #define when in
7236 2006-12-13 Bob Rossi <bob@brasko.net>
7238 * data/push.c (yypstate_init): Rename to...
7239 (yypstate_new): ... this and use b4_c_function_def.
7240 (yypstate_delete): New.
7241 (yypush_parse): Change parameters yynval and yynlloc to be const.
7242 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
7243 yypstate_delete functions.
7245 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
7247 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
7248 strange test case titles. Reported by Bob Rossi.
7250 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
7252 * TODO: Add pointer to Sylvain Schmitz's work on static detection
7253 of potential ambiguities in GLR grammers.
7255 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
7257 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
7258 `bison ', use m4_index instead of m4_substr since chopping up a string
7259 containing M4-special characters causes problems here.
7261 Fix a couple of bugs related to special characters in user-specified
7262 file names, and make it easier for skeletons to compute output file
7263 names with the same file name prefix as Bison-computed output file
7265 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
7266 b4_parser_file_name and b4_spec_defines_file instead of
7267 @output_parser_name@ and @output_header_name@, which are now redundant.
7268 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
7269 b4_parser_file_name, b4_spec_defines_file, and the new
7270 @basename(FILENAME@) instead of @output_parser_name@ and
7271 @output_header_name@, which inappropriately escaped the file names as
7273 * src/files.c (all_but_ext): Remove static qualifier.
7274 (compute_output_file_names): Move `free (all_but_ext)' to...
7275 (output_file_names_free): ... here since all_but_ext is needed later.
7276 * src/files.h (all_but_ext): Extern.
7277 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
7278 exactly what MUSCLE_INSERT_STRING used to do.
7279 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
7280 characters are escaped properly.
7281 * src/output.c (prepare): Define muscle file_name_all_but_ext as
7283 For pkgdatadir muscle, maintain previous functionality by using
7284 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
7285 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
7286 digraphs would never be expanded. Hopefully no one has M4-special
7287 characters in his Bison installation path.
7288 * src/scan-skel.l: Don't parse @output_header_name@ and
7289 @output_parser_name@ anymore since they're now redundant.
7290 In @output, use decode_at_digraphs.
7291 Parse a new @basename command that invokes last_component.
7292 (decode_at_digraphs): New.
7293 (BASE_QPUTS): Remove unused.
7294 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
7295 (Output file name): New tests.
7297 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
7299 Warn about output files that are generated by the skeletons and that
7300 conflict with other output files.
7301 * data/glr.c: Don't generate the header file here when glr.cc does.
7302 * src/files.c (file_names, file_names_count): New static globals.
7303 (compute_output_file_names): Invoke output_file_name_check for files
7304 not generated by the skeletons and remove existing checks.
7305 (output_file_name_check): New function that warns about conflicting
7307 (output_file_names_free): Free file_names.
7308 * src/files.h (output_file_name_check): Declare.
7309 * src/scan-skel.l: Invoke output_file_name_check for files generated by
7311 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
7312 (Conflicting output files): New tests.
7314 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7316 * doc/bison.texinfo: Fix a couple of typos.
7318 2006-12-08 Bob Rossi <bob@brasko.net>
7320 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
7322 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
7324 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
7325 (yypush_parse): Rename yypvars argument to yyps and remove redundant
7327 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
7328 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
7330 2006-12-07 Bob Rossi <bob@brasko.net>
7331 and Joel Denny <jdenny@ces.clemson.edu>
7333 * data/push.c (yypvarsinit): Change return type from void* to struct
7334 yypvars*. No longer cast to void* on return.
7335 (struct yypvars): Remove yylen since it need not be remembered between
7336 yypushparse invocations.
7337 (yypushparse): Don't copy between yylen and pv->yylen.
7339 2006-12-05 Bob Rossi <bob@brasko.net>
7341 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
7342 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
7343 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
7344 (struct yypvars): Remove b4_declare_parser_variables.
7345 (yypvarsinit): Remove init code for removed variables.
7346 (global scope): Do not declare b4_declare_parser_variables if
7348 (yypushparse): Add b4_declare_parser_variables.
7349 Init new local variables, and remove init code for removed
7352 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
7353 and yyparse for other modes.
7354 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
7355 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
7356 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
7357 (AT_PURE_LEX_IF): True if pure or push parser.
7359 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
7361 Document Yacc prologue alternatives and default %destructor's and
7362 %printer's as experimental. Don't mention Java yet. Discussed at
7363 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
7364 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
7365 (2.3a): Annotate this entry to say the old forms of these features were
7367 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
7368 Table of Symbols): Say they're experimental. Comment out any mention
7369 of Java (we'll want this back eventually).
7371 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
7373 Support a file name argument to %defines. Deprecate `=' in
7374 %file-prefix, %name-prefix, and %output. Discussed at
7375 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
7376 * NEWS (2.3a+): Mention.
7377 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
7378 form of %defines, and remove `=' from entries for %file-prefix,
7379 %name-prefix, and %output.
7380 * src/parse-gram.y (prologue_declaration): Implement.
7381 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
7382 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
7383 all but one occurrence of %name-prefix.
7384 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
7385 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
7386 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
7387 occurrence of each of %file-prefix and %output. Add check for %defines
7389 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
7390 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
7391 Remove the `=' from %output.
7393 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
7395 Don't escape $ in test case titles since Autoconf 2.61 now does that
7397 * tests/actions.at (Default %printer and %destructor are not for error
7398 or $undefined): Here.
7399 (Default %printer and %destructor are not for $accept): Here.
7400 * tests/input.at (Invalid $n and @n): Here.
7402 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
7404 Rename <!> to <>. Discussed starting at
7405 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
7406 * NEWS (2.3a+): Update.
7407 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
7409 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
7410 * src/scan-gram.l (INITIAL): Implement.
7411 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
7412 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
7414 * tests/actions.at (Default tagless %printer and %destructor,
7415 Default tagged and per-type %printer and %destructor,
7416 Default %printer and %destructor are not for error or $undefined,
7417 Default %printer and %destructor are not for $accept,
7418 Default %printer and %destructor for mid-rule values): Update.
7419 * tests/input.at (Default %printer and %destructor redeclared,
7420 Unused values with default %destructor): Update.
7422 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
7424 Don't let %prec take a nonterminal.
7425 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
7427 * tests/input.at (%prec takes a token): New test checking that %prec
7428 won't take a nonterminal.
7430 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
7432 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
7433 it was double-quoted.
7434 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
7435 grammar is maintained with Bison's highest standards.
7436 * src/getargs.c: Fix some typos in Doxygen comments.
7438 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
7440 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
7441 later. Reported by Paul Eggert in
7442 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
7443 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
7444 * src/scan-code.l (translate_action): Don't bother invoking
7445 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
7446 (code_scanner_free): Instead of invoking
7447 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
7449 * src/scan-gram.l (gram_scanner_free): Likewise.
7450 * src/scan-skel.l (scan_skel): Likewise.
7452 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
7454 * src/files.c (tr): Change return type to void.
7455 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
7456 has been called previously for the same key.
7457 (muscle_find): Return storage instead of value so that
7458 --enable-gcc-warnings doesn't produce warnings that the return discards
7459 const. aver that the value and storage are the same since storage
7460 could potentially be NULL when value is not.
7461 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
7464 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
7466 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
7467 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
7468 us a slightly cleaner distribution, and also works.
7469 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
7472 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
7473 and Paul Eggert <eggert@cs.ucla.edu>
7475 Don't let Bison leak memory except when it complains.
7476 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
7477 (spec_defines_file, dir_prefix): Now char *, not const char *,
7478 since they are freed.
7479 * src/files.c: Likewise.
7480 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
7482 (tr): Now operates in-place. All uses changed.
7483 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
7485 (compute_file_name_parts, compute_output_file_names): Don't store
7486 read-only data in variables that will be freed.
7487 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
7488 src_extension, and header_extension.
7489 (output_file_names_free): New public function to free
7490 spec_verbose_file, spec_graph_file, spec_defines_file,
7491 parser_file_name, and dir_prefix.
7492 * src/getargs.c (getargs): Don't store read-only data in variables that
7494 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
7495 (which previously existed but was unused), and quotearg_free.
7496 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
7497 * src/muscle_tab.c: Likewise.
7498 (muscle_entry): Make the value char const *,
7499 and add a new storage member that is char * and can be freed.
7500 (muscle_entry_free): New private function.
7501 (muscle_init): Use it instead of free.
7502 (muscle_insert, muscle_grow): Update and use new storage member.
7503 (muscle_code_grow): Free the string passed to muscle_grow
7504 since it's not needed anymore.
7505 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
7506 add a new `char *code' member.
7507 ("{...}"): Declare semantic type as code.
7508 * src/scan-code.h (translate_rule_action):
7509 (translate_symbol_action, translate_code, translate_action): Return
7510 `char const *' rather than `char *' since external code should not free
7512 * src/scan-code.l: Likewise.
7513 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
7514 which is "{...}" in the parser.
7515 * tests/Makefile.am (maintainer-check-valgrind): Set
7516 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
7518 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
7520 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
7521 expecting a non-zero exit status sets --leak-check=summary and
7522 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
7523 this case, and we don't want to hear about it.
7525 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
7527 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
7528 instead of from the template, to simplify configuration a bit.
7529 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
7530 and m4/wint_t.m4, as they are needed with the latest gnulib.
7532 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7534 Disable unset/unused mid-rule value warnings by default, and recognize
7535 --warnings=midrule-values to enable them. Discussed starting at
7536 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
7537 * NEWS (2.3a+): Mention.
7538 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
7539 warnings): Add entry for midrule-values subargument.
7540 * src/reader.c (symbol_should_be_used): Don't return true just because
7541 the value is a set/used mid-rule value unless
7542 --warnings=midrule-values was specified.
7543 * tests/input.at (Unused values, Unused values before symbol
7544 declarations): Run tests with and without --warnings=midrule-values.
7546 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
7547 than LIST_FREE directly.
7549 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7551 Finish implementing --warnings=error, which should not be implied by
7552 --warnings=all (or by its synonyms -W and --warnings without
7554 * src/complain.c (set_warning_issued): New function to report that
7555 warnings are being treated as errors and to record an error if so.
7557 (warn_at, warn): ... here.
7558 * src/getargs.c (warnings_args, warnings_types): Reorder so that
7559 "error - warnings are errors" does not appear above "all - all of the
7561 (getargs): For -W and --warnings without subarguments, don't let
7562 FLAGS_ARGMATCH set warnings_error in warnings_flag.
7563 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
7565 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7567 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
7568 empty subargument list. For example: `bison --warnings= parser.y'.
7570 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7572 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
7573 the parser header file so that gcc doesn't warn.
7575 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7577 Split the default %destructor/%printer into two kinds: <*> and <!>.
7578 Discussed starting at
7579 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
7580 * NEWS (2.3a+): Mention.
7581 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
7582 previous change today related to mid-rules.
7583 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
7584 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
7585 (TYPE_TAG_ANY): Add as <*>.
7586 (TYPE_TAG_NONE): Add as <!>.
7587 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
7589 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
7590 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
7591 * src/symlist.c (symbol_list_default_new): Split into tagged and
7593 (symbol_list_destructor_set, symbol_list_printer_set): Split
7594 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
7595 SYMLIST_DEFAULT_TAGLESS.
7596 * src/symlist.h: Update symbol_list_default*_new prototypes.
7597 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
7598 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
7599 * src/symtab.c (default_destructor, default_destructor_location,
7600 default_printer, default_printer_location): Split each into tagged and
7602 (symbol_destructor_get, symbol_destructor_location_get,
7603 symbol_printer_get, symbol_printer_location_get): Implement tagged
7604 default and tagless default cases.
7605 (default_destructor_set, default_printer_set): Split each into tagged
7606 and tagless versions.
7607 * src/symtab.h: Update prototypes.
7608 * tests/actions.at (Default %printer and %destructor): Rename to...
7609 (Default tagless %printer and %destructor): ... this, and extend.
7610 (Per-type %printer and %destructor): Rename to...
7611 (Default tagged and per-type %printer and %destructor): ... this, and
7613 (Default %printer and %destructor for user-defined end token): Extend.
7614 (Default %printer and %destructor are not for error or $undefined):
7616 (Default %printer and %destructor are not for $accept): Update.
7617 (Default %printer and %destructor for mid-rule values): Extend.
7618 * tests/input.at (Default %printer and %destructor redeclared): Extend.
7619 (Unused values with default %destructor): Extend.
7621 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7623 Don't apply the default %destructor/%printer to an unreferenced midrule
7625 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
7626 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
7627 like $@n instead of just @n so that the default %destructor/%printer
7628 logic doesn't see them as user-defined symbols.
7629 (symbol_is_dummy): Check for both forms of the name.
7630 * src/reader.c (packgram): Remove the `$' from each midrule symbol
7631 name for which the midrule value is referenced in any action.
7632 * tests/actions.at (Default %printer and %destructor for mid-rule
7634 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
7635 for change to dummy symbol names.
7637 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7639 Warn about unset midrule $$ if the corresponding $n is used.
7640 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
7642 (packgram): Before invoking grammar_rule_check on any rule, make sure
7643 all actions have already been scanned in order to set `used' flags.
7644 Otherwise, checking that a midrule's $$ is set will not always work
7645 properly because the midrule check must forward-reference the midrule's
7647 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
7650 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7652 More improvements to the documentation of the prologue alternatives:
7653 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
7655 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
7656 some text to clarify the relative importance of the new directives and
7657 to show how these directives may be viewed as code labels.
7659 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
7661 Similar to the recently removed %before-header, add %code-top as the
7662 alternative to the pre-prologue. Mentioned at
7663 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
7664 Also, let the prologue alternatives appear in the grammar section.
7665 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
7666 (prologue_declaration): Move the existing prologue alternatives to...
7667 (grammar_declaration): ... here and add %code-top.
7668 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
7670 Clean up and extend documentation for the prologue alternatives.
7671 * NEWS (2.3a+): Describe prologue alternatives.
7672 * doc/bison.texinfo (Prologue): Move discussion of prologue
7674 (Prologue Alternatives): ... this new section, and extend it to discuss
7675 all 4 directives in detail.
7676 (Table of Symbols): Clean up discussion of prologue alternatives and
7679 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7681 DJGPP specific issues.
7683 * djgpp/config.bat: config.hin has been moved to lib. Adjust
7684 config.bat accordingly.
7685 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
7686 * djgpp/config.site: Likewise.
7688 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
7690 Replace %*-header with %provides, %requires, %code. See discussion at
7691 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
7693 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
7694 (b4_user_start_header): Remove.
7695 * data/glr.c: Use new macros instead of b4_*start_header
7697 * data/glr.cc: Likewise.
7698 * data/lalr1.cc: Likewise.
7699 * data/push.c: Likewise.
7700 * data/yacc.c: Likewise.
7702 * doc/bison.texinfo: Remove %before-header, rename
7703 %{start,end,after}-header to %requires, %provides, %code.
7705 * src/parse-gram.y: Likewise (also rename token names accordingly).
7706 * src/scan-gram.l: Likewise.
7707 * tests/actions.at: Likewise.
7709 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
7711 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
7712 Problem reported by Joel E. Denny.
7714 2006-10-14 Jim Meyering <jim@meyering.net>
7716 (Sync from coreutils.)
7717 Work also when the working directory (with e.g. coreutils sources)
7718 is version controlled with git, rather than CVS.
7719 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
7721 In messages and comments, say e.g., "checked-out sources",
7722 rather than "CVS sources".
7723 (version_controlled_file): New function. Work for git as well as
7724 for CVS. Don't use grep's -q option.
7725 (slurp): Call it here, in place of CVS-specific code.
7727 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
7729 Fix testsuite for ./configure --enable-gcc-warnings:
7730 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
7731 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
7732 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
7733 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
7734 * test/regression.at (Diagnostic that expects two alternatives):
7737 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
7739 * bootstrap.conf (gnulib_modules): Add config-h.
7740 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
7741 worry about HAVE_CONFIG_H.
7742 * lib/abitset.c: Likewise.
7743 * lib/bitset.c: Likewise.
7744 * lib/bitset_stats.c: Likewise.
7745 * lib/bitsetv-print.c: Likewise.
7746 * lib/bitsetv.c: Likewise.
7747 * lib/ebitset.c: Likewise.
7748 * lib/get-errno.c: Likewise.
7749 * lib/lbitset.c: Likewise.
7750 * lib/subpipe.c: Likewise.
7751 * lib/timevar.c: Likewise.
7752 * lib/vbitset.c: Likewise.
7753 * lib/bitset.c: Include "bitset.h" first, to test interface.
7754 * lib/bitset_stats.c: Include "bitset_stats.h" first.
7755 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
7756 * lib/bitsetv.c: Include "bitsetv.h" first.
7757 * lib/get-errno.c: Include "get-errno.h" first.
7758 * m4/.cvsignore: Add config-h.m4.
7759 * tests/actions.at (Default %printer and %destructor for ...):
7760 Adjust expected line numbers in output to reflect removal of #if
7761 HAVE_CONFIG_H lines.
7762 * tests/glr-regression.at (Missed %merge type warnings when ...):
7764 * tests/regression.at (Braced code in declaration in rules section):
7766 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
7767 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
7768 Include <config.h> unconditionally.
7770 * bootstrap: Sync from coreutils, as follows:
7772 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
7774 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
7775 variable was sometimes used without being initialized. This
7776 messed up the installation of the INSTALL file in some cases.
7778 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
7780 * bootstrap (usage, main program, symlink_to_gnulib): Add option
7781 --copy. Inspired by a suggestion from Bruno Haible.
7783 2006-10-03 Jim Meyering <jim@meyering.net>
7785 * bootstrap: Undo last change to this file, since now gnulib-tool
7786 sticks with the automake default in generating dependencies.
7788 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
7790 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
7791 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
7793 * doc/bison.1: Add copyright notice.
7795 * data/glr.c: Don't include <stdarg.h>; not used.
7797 * NEWS: The -g and --graph options now output graphs in Graphviz
7798 DOT format, not VCG format.
7799 * doc/bison.1: Likewise.
7800 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
7801 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
7803 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
7804 * TODO: Remove Graphviz entry.
7805 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
7806 remove vcg.c, vcg.h, vcg_defaults.h.
7807 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
7808 * src/graphviz.c, src/graphviz.h: New files.
7809 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
7810 * src/files.h: Make comment more generic.
7811 * src/main.c (main): Likewise.
7812 * src/print_graph.h: Likewise.
7813 * src/getargs.c (usage): Make usage description more generic.
7814 * src/print_graph.c: Include graphviz.h rather than vcg.h.
7815 (static_graph, fgraph): Remove. All uses changed to pass
7816 arguments instead of sharing a static var.
7817 (print_core, print_actions, print_state, print_graph):
7818 Output graphviz format rather than VCG format.
7819 * tests/.cvsignore: Remove *.vcg; add *.dot.
7820 * tests/output.at: Expect *.dot files, not *.vcg files.
7822 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
7823 accommodates the 2006-10-08 change.
7825 2006-10-11 Bob Rossi <bob@brasko.net>
7827 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
7828 (b4_yyssa, b4_yyerror_range): New macros.
7829 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
7830 (yypvarsinit): Remove init of removed fields.
7831 (yypushparse): Remove use of removed fields; use new macros instead.
7833 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
7835 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
7836 in a push parser. Reindent slightly to match yacc.c better.
7838 2006-10-11 Bob Rossi <bob@brasko.net>
7840 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
7842 (yypvarsinit, yypushparse): Remove init of removed fields.
7843 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
7845 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
7847 * THANKS: Add Paolo Bonzini and Bob Rossi.
7849 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
7851 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
7852 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
7853 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
7854 b4_define_user_cde and uses): Remove.
7855 (b4_comment, b4_prefix, b4_sync_start): New.
7856 * data/bison.m4: New file, with most of the content removed from c.m4.
7857 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
7858 * src/output.c (output_skeleton): Pass bison.m4.
7859 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
7862 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
7864 Fix test failure reported by Tom Lane in
7865 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
7866 and try to make such failures easier to catch in the future.
7867 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
7868 that's now the caller's responsibility.
7869 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
7870 Set yychar = YYEOF if it's negative.
7871 * tests/actions.at (yylex): Abort if asked to read past EOF.
7872 * tests/conflicts.at (yylex): Likewise.
7873 * tests/cxx-type.at (yylex): Likewise.
7874 * tests/glr-regression.at (yylex): Likewise.
7875 * tests/input.at (yylex): Likewise.
7876 * tests/regression.at (yylex): Likewise.
7877 * tests/torture.at (yylex): Likewise.
7879 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
7881 Fix problems with translating English-language diagnostics.
7882 * bootstrap: Fix bug introduced in recent bootstrap changes, with
7883 respect to bison-runtime pot generation. The YY_ stuff
7884 wasn't being captured.
7885 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
7886 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
7887 * runtime-po/POTFILES.in: Add data/push.c.
7889 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
7891 Merge bootstrap changes from coreutils.
7893 2006-09-28 Jim Meyering <jim@meyering.net>
7895 Automatically generated dependencies are important even
7896 when all of the sources in a directory come from gnulib.
7897 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
7898 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
7900 2006-09-23 Jim Meyering <jim@meyering.net>
7902 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
7904 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7906 * bootstrap: Add support for --force.
7907 (usage): New function. Describe usage less tersely.
7908 (CVS_only_file): New var.
7910 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
7912 * data/push.c (YYPUSH_MORE): Make it an enum instead.
7913 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
7914 Adjust white space and comments to match GNU style better.
7916 2006-09-20 Bob Rossi <bob@brasko.net>
7918 * data/push.c (yyresult_get): Remove function.
7919 (YYPUSH_MORE): Add #define.
7920 (yypushparse): Modify return value.
7922 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7924 * stamp-h.in: Remove; no longer needed.
7925 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
7926 Remove config.h, config.hin, intl (no longer created).
7927 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
7930 Sync bootstrap from coreutils, as follows:
7932 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
7934 * bootstrap (symlink_to_gnulib): New function.
7935 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
7936 to copies-of-gnulib.
7937 (cp_mark_as_generated, slurp, gnulib_files):
7938 Avoid making a copy if it's the same as the old version.
7939 (gnulib_files): Add support for this variable (used by Bison).
7941 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7943 * src/getargs.c (usage): Rework to use conventions similar to
7944 coreutils, to make translation a bit easier and the code a bit
7945 smaller. Problem reported by Tim Van Holder.
7947 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
7949 Use some of gnulib's new modules, taken from coreutils.
7951 * bootstrap: Sync from coreutils, except add support for gnulib_files.
7952 * bootstrap.conf: New file.
7953 (gnulib_modules): Add configmake, inttypes, unistd.
7954 (XGETTEXT_OPTIONS): Add complain, complain_at,
7955 fatal, fatal_at, warn, warn_at, unexpected_end.
7956 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
7957 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
7959 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
7961 (GNULIB_AUTOCONF_SNIPPET): Remove.
7962 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
7964 * lib/.cvsignore: Add inttypes_.h.
7965 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
7966 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
7967 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
7968 no-longer-necessary initializations.
7969 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
7970 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
7971 use the unistd module.
7972 * src/system.h: Likewise.
7973 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
7974 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
7975 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
7976 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
7977 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
7978 * src/system.h: Include inttypes.h unconditionally, now that we
7979 use the inttypes module. Don't bother to include stdint.h, since
7980 inttypes.h now does that for us.
7981 (LOCALEDIR): Remove, now that we use the configmake module.
7982 * src/getargs.c: Include configmake.h.
7983 * src/main.c: Likewise.
7984 * src/output.c: Likewise.
7985 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
7986 not from $abs_top_builddir, since config.h moved.
7989 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
7990 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
7992 * src/parse-gram.y (symbol_declaration): Don't put statements
7993 before declarations; it's not portable to C89.
7994 * src/scan-code.l (handle_action_at): Likewise.
7996 * src/scan-code.l: Always initialize braces_level; the old code
7997 left it uninitialized and therefore had undefined behavior.
7999 Don't attempt to redefine 'assert', since it runs afoul of
8000 systems where standard headers (mistakenly) include <assert.h>.
8001 Instead, define and use our own alternative, called 'aver'.
8002 * src/reader.c: Don't include assert.h, since we no longer
8004 * src/scan-code.l: Likewise.
8005 * src/system.h (assert): Remove, replacing with....
8006 (aver): New function, taking a bool arg. All uses changed.
8007 * src/tables.c (pack_vector): Ensure that aver arg is bool,
8008 not merely an integer.
8010 2006-09-15 Bob Rossi <bob@brasko.net>
8012 Add support for push parsing. Based on the original work of
8013 Odd Arild Olsen <oao@fibula.no>.
8014 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
8015 * data/c.m4 (YYPUSH): New.
8016 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
8017 * data/push.c: New file.
8018 * src/getargs.c (push_parser): New var.
8019 * src/getargs.h (push_parser): New declaration.
8020 * src/output.c (prepare): Add macro insertion of `push_flag'.
8021 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
8022 (prologue_declaration): Parse %push-parser.
8023 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
8024 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
8025 list of removed lines from the traces observed.
8026 (AT_CHECK_CALC_LALR): Added push parser tests.
8028 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
8030 * NEWS: Version 2.3a.
8031 * configure.ac (AC_INIT): Likewise.
8033 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
8034 "#define YYSTYPE int" that caused "make maintainer-check" to fail
8035 due to header ordering dependencies. I don't know why the #define
8038 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
8039 runtime cost when YYDEBUG is not defined, and so that some tests
8040 that used to fail now work. Problem and initial suggestion by
8042 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
8043 * data/glr.cc (b4_parser_class_name):
8044 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
8045 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
8046 (yydebug_) [YYDEBUG]: New member.
8047 (yycdebug_): Now defined only if YYDEBUG.
8048 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
8049 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
8050 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
8052 (debug_stream, set_debug_stream, debug_level, set_debug_level):
8053 Define only if YYDEBUG.
8054 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
8056 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
8057 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
8058 AT_CHECK_CALC_GLR_CC that are working now.
8060 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
8062 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
8063 We don't need them in glr.cc, and glr.c defines them.
8064 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
8065 assumes that defining it to anything is the same as defining
8066 it to 1. Problem reported by Paolo Bonzini.
8068 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
8070 * data/c.m4 (b4_null, b4_case): Define.
8071 * src/output.c (prepare_symbols): Use b4_null.
8072 (user_actions_output): Use b4_case.
8074 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
8076 * data/glr.c (b4_shared_declarations): Put start-header first,
8077 before any #includes that we generate, so that feature-test
8078 macros work. Problem reported by Michael Deutschmann in
8079 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
8080 * data/lalr1.cc: Likewise.
8081 * doc/bison.texinfo (Prologue): Document that feature-test macros
8082 should be defined before any Bison declarations.
8083 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
8084 that depend on location.hh after, not before, Bison decls, since
8085 we now include location.hh after the first user prologue.
8087 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
8088 Sander Brandenburg in
8089 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
8090 Also, fix minor white space and comment issues.
8091 (Prologue): Mention that it's better to define feature-test macros
8092 before Bison declarations. Problem reported by Michael Deutschmann.
8094 * README-cvs: Fix typo: "&" should be "&&". Problem reported
8096 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
8097 This adjusts to recent gnulib changes.
8099 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
8101 Finish implementation of per-type %destructor/%printer. Discussed
8103 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
8105 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
8106 * NEWS (2.3+): Add a description of this feature to the default
8107 %destructor/%printer description.
8108 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
8109 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
8110 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
8111 list node contains a semantic type.
8112 * src/symtab.c, src/symtab.h: Extend with a table that associates
8113 semantic types with their %destructor's and %printer's.
8114 (semantic_type_from_uniqstr, semantic_type_get,
8115 semantic_type_destructor_set, semantic_type_printer_set): New functions
8116 composing the public interface of that table.
8117 (symbol_destructor_get, symbol_destructor_location_get,
8118 symbol_printer_get, symbol_printer_location_get): If there's no
8119 per-symbol %destructor/%printer, look up the per-type before trying
8121 * tests/actions.at (Per-type %printer and %destructor): New test case.
8122 * tests/input.at (Default %printer and %destructor redeclared):
8123 Extend to check that multiple occurrences of %symbol-default in a
8124 single %destructor/%printer declaration is an error.
8125 (Per-type %printer and %destructor redeclared, Unused values with
8126 per-type %destructor): New test cases.
8128 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
8130 Require default %destructor/%printer to be declared using
8131 %symbol-default instead of an empty symbol list, and start working on
8132 new per-type %destructor/%printer. Discussed at
8133 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
8134 * NEWS (2.3+): Add %symbol-default to example.
8135 * bison.texinfo (Freeing Discarded Symbols): Likewise.
8136 (Table of Symbols): Add entry for %symbol-default.
8137 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
8138 (generic_symlist, generic_symlist_item): New nonterminals for creating
8139 a list in which each item is a symbol, semantic type, or
8141 (grammar_declaration): Use generic_symlist in %destructor and %printer
8142 declarations instead of symbols.1 or an empty list.
8143 (symbol_declaration, precedence_declaration, symbols.1): Update actions
8144 for changes to symbol_list.
8145 * src/reader.c: Update for changes to symbol_list.
8146 * src/scan-code.l: Likewise.
8147 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
8148 * src/symlist.c, src/symlist.h: Extend such that a list node may
8149 represent a semantic type or a %symbol-default in addition to just an
8150 ordinary symbol. Add switched functions for setting %destructor's and
8152 * tests/actions.at, tests/input.at: Add %symbol-default to all default
8153 %destructor/%printer declarations.
8155 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
8157 Whether the default %destructor/%printer applies to a particular symbol
8158 isn't a question of whether the user *declares* that symbol (in %token,
8159 for example). It's a question of whether the user by any means
8160 *defines* the symbol at all (by simply using a char token, for
8161 example). $end is defined by Bison whereas any other token with token
8162 number 0 is defined by the user. The error token is always defined by
8163 Bison regardless of whether the user declares it with %token, but we
8164 may one day let the user define error as a nonterminal instead.
8165 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
8166 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
8167 the meaning of "user-defined".
8168 * tests/actions.at (Default %printer and %destructor for user-declared
8169 end token): Rename to...
8170 (Default %printer and %destructor for user-defined end token): ...
8173 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
8174 computation of whether to apply the default, don't maintain a list of
8175 every Bison-defined symbol. Instead, just check for a first character
8176 of '$', which a user symbol cannot have, and check for the error token.
8178 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
8180 Don't apply the default %destructor or %printer to the error token,
8181 $undefined, or $accept. This change fits the general rule that the
8182 default %destructor and %printer are only for user-declared symbols,
8183 and it solves several difficulties that are described in the new test
8185 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
8186 * tests/actions.at (Default %printer and %destructor are not for error
8187 or $undefined, Default %printer and %destructor are not for $accept):
8190 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
8192 Allow %start after the first rule.
8193 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
8194 when parsing the first rule.
8195 (check_and_convert_grammar): Search for it here after all grammar
8196 declarations have been parsed. Skip midrules, which have dummy LHS
8198 * src/symtab.c (symbol_is_dummy): New function.
8199 * src/symtab.h (symbol_is_dummy): Declare it.
8200 * tests/input.at (%start after first rule): New test.
8202 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8204 Redo some of the previous commit: add back the ability to use
8205 non-aliased/undeclared string literals since it might be useful to
8206 those declaring %token-table.
8207 * src/reader.c (check_and_convert_grammar): Undo changes in previous
8208 commit: don't worry about complaints from symbols_pack.
8209 * src/symtab.c (symbol_new, symbol_class_set,
8210 symbol_check_alias_consistency): Undo changes in previous commit: count
8211 each string literal as a new symbol and token, assign it a symbol
8212 number, and don't complain about non-aliased string literals.
8213 (symbols_pack): Since symbol_make_alias still does not decrement symbol
8214 and token counts but does still set aliased tokens to the same number,
8215 symbol_pack_processor now leaves empty slots in the symbols array.
8217 * tests/regression.at (Undeclared string literal): Remove test case
8218 added in previous commit since non-aliased string literals are allowed
8220 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
8221 remove unnecessary string literal declarations.
8222 * tests/sets.at (Firsts): Likewise.
8224 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8226 Don't allow an undeclared string literal, but allow a string literal to
8227 be used before its declaration.
8228 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
8229 symbols_pack complained.
8230 * src/symtab.c (symbol_new): Don't count a string literal as a new
8232 (symbol_class_set): Don't count a string literal as a new token, and
8233 don't assign it a symbol number since symbol_make_alias does that.
8234 (symbol_make_alias): It's not necessary to decrement the symbol and
8235 token counts anymore. Don't assume that an alias declaration occurs
8236 before any uses of the identifier or string, and thus don't assert that
8237 one of them has the highest symbol number so far.
8238 (symbol_check_alias_consistency): Complain if there's a string literal
8239 that wasn't declared as an alias.
8240 (symbols_pack): Bail if symbol_check_alias_consistency failed since
8241 symbol_pack asserts that every token has been assigned a symbol number
8242 although undeclared string literals have not.
8243 * tests/regression.at (String alias declared after use, Undeclared
8244 string literal): New test cases.
8245 (Characters Escapes, Web2c Actions): Declare string literals as
8247 * tests/sets.at (Firsts): Likewise.
8249 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
8251 In the grammar scanner, STRING_FINISH unclosed constructs and return
8252 them to the parser in order to improve error messages.
8253 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
8254 SC_BRACED_CODE, SC_PROLOGUE): Implement.
8255 * tests/input.at (Unclosed constructs): New test case.
8256 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
8259 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
8262 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
8264 Handle string aliases for character tokens correctly.
8265 * src/symtab.c (symbol_user_token_number_set): If the token has an
8266 alias, check and set its alias's user token number instead of its own,
8267 which is set to indicate the alias. Previously, every occurrence of
8268 the character token in the grammar overwrote that alias indicator with
8270 * tests/input.at (String aliases for character tokens): New test.
8272 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
8274 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
8276 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
8278 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
8279 to prevent failures when building on older platforms.
8280 Check for autopoint failure.
8281 Set XGETTEXT_OPTIONS to values that check for C format strings,
8282 so that translators are warned about them (this also helps
8283 prevent core dumps).
8285 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
8286 function, since it simplifies our code a bit.
8288 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
8289 rather than -W, so we don't get bogus warnings about sign comparisons.
8290 Add -Wpointer-arith, since that warning is useful (it reports code
8291 that does not conform to C89 and that some compilers reject).
8292 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
8293 since it's no longer needed.
8295 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
8297 Clean up scanners a bit.
8298 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
8299 definitions so gcc won't warn when obstack_for_string is unused.
8300 * src/scan-code.l: config.h and system.h are already #include'd by
8301 scan-code-c.c, so get rid of them here.
8302 * src/scan-gram.l: Likewise.
8303 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
8304 definitions rather than duplicating the rest of it.
8305 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
8307 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
8309 Suppress signed/unsigned comparison warnings for yycheck.
8310 * data/c.m4 (b4_safest_int_type): New macro.
8311 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
8312 a signed int type, cast it to b4_safest_int_type first.
8313 * data/yacc.c: Likewise.
8314 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
8317 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
8319 * doc/bison.texinfo: Fix some typos.
8321 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
8323 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
8324 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
8326 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
8327 the latest gnulib does this a different way.
8328 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
8329 translation was patched, so stop omitting it.
8331 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8333 Enable declaration of default %printer/%destructor. Make the parser
8334 use these for all user-declared grammar symbols for which the user does
8335 not declare a specific %printer/%destructor. Thus, the parser uses it
8336 for token 0 if the user declares it but not if Bison generates it as
8337 $end. Discussed starting at
8338 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
8339 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
8341 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
8342 * NEWS (2.3+): Mention.
8343 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
8344 declare a %destructor for a mid-rule's semantic value. It's just
8345 impossible to declare one specific to it.
8346 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
8347 code. Describe default %destructor form.
8348 * src/parse-gram.y (grammar_declaration): Parse default
8349 %printer/%destructor declarations.
8350 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
8351 and symbol_destructor_location_get rather than accessing the destructor
8352 and destructor_location members of struct symbol.
8353 (symbol_printers_output): Likewise but for %printer's.
8354 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
8356 * src/symtab.c (default_destructor, default_destructor_location,
8357 default_printer, default_printer_location): New static global
8358 variables to record the default %destructor and %printer.
8359 (symbol_destructor_get, symbol_destructor_location_get,
8360 symbol_printer_get, symbol_printer_location_get): New functions to
8361 compute the appropriate %destructor and %printer for a symbol.
8362 (default_destructor_set, default_printer_set): New functions to set the
8363 default %destructor and %printer.
8364 * src/symtab.h: Prototype all those new functions.
8365 * tests/actions.at (Default %printer and %destructor): New test to
8366 check that the right %printer and %destructor are called, that they're
8367 not called for $end, and that $$ and @$ work correctly.
8368 (Default %printer and %destructor for user-declared end token): New
8369 test to check that the default %printer and %destructor are called for
8370 a user-declared end token.
8371 * tests/input.at (Default %printer and %destructor redeclared, Unused
8372 values with default %destructor): New tests to check related grammar
8373 warnings and errors.
8375 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8377 Clean up handling of %destructor for the end token (token 0).
8378 Discussed starting at
8379 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
8381 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
8383 Make the skeletons consistent in how they pop the end token and invoke
8385 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
8386 state, which has token number 0, since this would invoke the
8387 %destructor for the end token.
8388 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
8389 until after shifting the end token, or else it won't be popped.
8390 * data/yacc.c (yyparse): Likewise.
8392 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
8393 it's the end token. Upon termination, destroy an unshifted lookahead
8394 even when it's the end token.
8395 * data/lalr1.cc (yy::parser::parse): Likewise.
8396 * data/yacc.c (yyparse): Likewise.
8398 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
8399 value warnings for the end token when the user gives the end token a
8402 * tests/actions.at (Printers and Destructors): Test all the above.
8404 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
8406 Update to latest gnulib and gettext versions.
8407 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
8409 (gnulib_files): Add m4/warning.m4. Don't worry about files
8410 overwritten by autopoint.
8411 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
8412 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
8414 Don't use autoreconf; instead, invoke autopoint etc. by hand,
8415 so that we can remove the intl files at a better time.
8416 (intl_files_to_remove): Remove aclocal.m4, since it gets
8417 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
8418 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
8419 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
8420 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
8421 Remove datarootdir hack; no longer needed.
8422 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
8423 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
8424 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
8426 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
8427 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
8429 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
8431 * bootstrap: Adjust to today's change to gnulib-tool by invoking
8432 it with --assume-autoconf='latest-stable'.
8434 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
8436 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
8437 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
8439 * src/muscle_tab.h (muscle_grow): Replace the header comments with
8440 those from muscle_tab.c since the old ones are misleading.
8442 2006-07-13 Akim Demaille <akim@epita.fr>
8444 Support %define "KEY" {VALUE}.
8445 * src/scan-code.h, src/scan-code.l (translate_action)
8446 (translate_rule_action, translate_symbol_action, translate_code):
8447 Return char *, not const char *.
8448 * src/parse-gram.y (declaration): Rename as...
8449 (prologue_declaration): this.
8450 (string_content): Remove this nonterminal, use STRING.
8451 (braceless, content, content.opt): New nonterminal.
8453 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
8455 * src/scan-gram.l (getargs.h): Don't include it.
8457 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
8459 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
8460 rather than a for-loop that declares a local bool variable. This
8461 should work around a compatibility problem with a Cray x1e C++
8462 compiler reported by Hung Nguyen in
8463 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
8464 The for-loop was introduced in the 2004-11-17 change but I don't
8465 know why it was needed.
8467 2006-07-12 Akim Demaille <akim@epita.fr>
8469 * data/c.m4: Comment changes.
8471 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
8473 * src/complain.c (error_message, ERROR_MESSAGE): New.
8475 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
8476 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
8478 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
8480 * NEWS: Instead of %union, you can define and use your own union type
8481 YYSTYPE if your grammar contains at least one <type> tag.
8482 Your YYSTYPE need not be a macro; it can be a typedef.
8483 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
8484 (Union Decl, Decl Summary): Document this.
8485 * data/glr.c (YYSTYPE): Implement this.
8486 * data/glr.cc (YYSTYPE): Likewise.
8487 * data/lalr1.cc (YYSTYPE): Likewise.
8488 * data/yacc.c (YYSTYPE): Likewise.
8489 * src/output.c (prepare): Output tag_seen_flag.
8490 * src/parse-gram.y (declaration, grammar_declaration):
8491 Use 'union_seen' rather than 'typed' to determine whether
8492 %union has been seen, since grammars can now be typed without
8494 (symbol_declaration, type.opt, symbol_def):
8495 Keep track of whether a tag has been seen.
8496 * src/reader.c (union_seen, tag_seen): New vars.
8498 * src/reader.h (union_seen, tag_seen, typed): Likewise.
8499 * src/scan-code.l (untyped_var_seen): New variable.
8500 (handle_action_dollar): Adjust to above changes.
8501 (handle_action_dollar, handle_action_at):
8502 Improve overflow checking for outlandish numbers.
8503 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
8504 avoid new diagnostics generated by above changes.
8505 * tests/regression.at (YYSTYPE typedef): Add test to check
8506 for type tags without %union.
8508 * src/symlist.c (symbol_list_length): Return int, not unsigned
8509 int, since callers expect int. This may need to get revisited
8510 once we have proper integer overflow checking.
8512 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
8513 object is now static.
8515 * src/getargs.c (flags_argmatch): Return void, not int,
8516 to pacify ./configure --enable-gcc-warnings.
8518 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
8519 since last_string is already defined to FLEX_PREFIX (last_string).
8521 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
8523 Implement --warnings/-W.
8524 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
8526 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
8528 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
8529 (warnings_args, warnings_types): New.
8530 (getargs, short_options, long_options): Accept -W/--warnings.
8531 Sort the options by alphabetical order, upper case letter right
8532 before its lower case.
8534 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
8536 Change %merge result type clash warnings to errors. Discussed at
8537 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
8538 * src/reader.c (record_merge_function_type): Use complain_at.
8539 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8540 declared later): Update test case results.
8542 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
8544 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
8545 to be in alphabetical order.
8546 (trace_args): Spelling fixes.
8548 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
8550 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
8551 so they don't collide with user-defined macros.
8552 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
8553 this was never guaranteed, and now that we're using gnulib stdint,
8554 which defines int_fast16_t to long int, the problem is exposed.
8556 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
8558 * data/c.m4 (b4_basename): Simplify a bit, since we don't
8559 need the full POSIX semantics (and weren't implementing them
8562 Adjust to Autoconf 2.60 and today's gnulib.
8563 * bootstrap (gnulib_modules): Add stdint.
8564 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
8565 no longer copies it.
8566 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
8567 since stdint needs the former and wcwidth (which is now required
8568 by mbswidth) needs the latter.
8569 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
8570 work around a compatibility glitch between gettext 0.14.6 and
8572 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
8573 Do not check for uintptr_t, since new stdint module does the right
8575 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
8576 Add stdint.h, stdint_.h, wcwidth.h.
8577 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
8578 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
8579 stdint.m4, wchar_t.m4, wcwidth.m4.
8580 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
8581 usual order for ../lib/*.h files.
8582 (file_name_split): Use last_component, not base_name, to adjust
8584 * src/parse-gram.h: Include <strverscmp.h> in the usual order
8585 for ../lib/*.h files.
8586 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
8587 Define unconditionally, since we now assume the stdint module.
8588 * src/scan-skel.l: Include <dirname.h>.
8589 (BASE_QPUTS): Use last_component, not base_name.
8590 * src/system.h: Include <unlocked-io.h> in the usual order
8591 for ../lib/*.h files. Include <stdint.h> unconditionally,
8592 since we now use the stdint module.
8593 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
8594 HAVE_UINTPTR_T, since we now use the stdint module.
8595 (base_name): Remove decl, since files now include <dirname.h>
8598 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
8600 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
8602 * data/yacc.c, data/glr.c, data/location.cc: Use them.
8603 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
8605 * tests/calc.at: Adjust.
8607 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
8609 * data/c.m4 (b4_basename): New.
8610 (b4_syncline): Also output the location of its invocation (from
8612 (b4_user_action, b4_define_user_action, b4_user_actions)
8613 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
8614 (b4_user_stype): New.
8615 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
8617 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8619 In the grammar file, the first column is 1 not 0 on the first line as
8620 on every other line.
8621 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
8622 * tests/input.at (Torturing the Scanner): Update output.
8624 * src/scan-gram.l (scanner_cursor): Declare it static.
8626 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8628 In warnings, say "previous declaration" rather than "first
8630 * src/symtab.c (redeclaration): Do that here.
8631 * src/reader.c (record_merge_function_type): In the case of a result
8632 type clash, report the previous declaration rather than the very first
8633 one in the grammar file.
8634 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8635 declared later): Add a third declaration to check this behavior.
8636 * tests/input.at (Incompatible Aliases): Update output.
8638 2006-06-27 Akim Demaille <akim@epita.fr>
8640 * doc/Doxyfile.in: New.
8641 * doc/Makefile.am: Use it.
8642 * src/lalr.h, src/symtab.h: Initial doxygenation.
8644 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8646 Don't miss %merge result type warnings just because the LHS types are
8647 declared after the %merge. This continues the effort of the previous
8649 * src/reader.c (get_merge_function): Don't set the merger type yet.
8650 (record_merge_function_type): New function for setting the merger type
8651 and checking for clashes.
8652 (grammar_current_rule_merge_set): Set the location of the %merge for
8654 (packgram): Invoke record_merge_function_type for each rule now that
8655 all symbol type declarations have been parsed.
8656 * src/reader.h (merger_list.type_declaration_location): New member
8657 storing the location of the first %merge from which the type for this
8658 merging function was derived.
8659 * src/symlist.h (symbol_list.merger_declaration_location): New member
8660 storing the location of a rule's %merge, if any.
8661 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8662 declared later): New test to catch the error fixed by the above patch.
8664 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8666 Get action warnings (grammar_rule_check) right even when symbol
8667 declarations appear after the rules. Discussed at
8668 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
8670 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
8671 Don't mistake the type of $$ in a midrule to be that of its parent
8673 * src/reader.c (grammar_current_rule_end): Don't invoke
8674 grammar_rule_check yet since not all symbol declarations may have been
8676 (grammar_midrule_action): Likewise.
8677 Don't record whether the midrule's $$ has been used yet since actions
8678 haven't been translated yet.
8679 Record the midrule's parent rule and its RHS index within the parent
8681 (grammar_current_rule_action_append): Don't translate the action yet
8682 since not all symbol declarations may have been parsed yet and, thus,
8683 warnings about types for $$, $n, @$, and @n can't be reported yet.
8684 (packgram): Translate the action and invoke grammar_rule_check now that
8685 all symbol declarations have been parsed.
8686 * src/scan-code.l (handle_action_dollar): Now that this is invoked
8687 after parsing the entire grammar file, the symbol list here in the case
8688 of a midrule is actually the midrule's empty RHS, so reference its
8689 parent rule's RHS where necessary.
8690 On the other hand, now that you can already know it's a midrule, you
8691 aren't forced to think $$ has the same type as its parent rule's $$.
8692 (handle_action_at): In the case of a midrule, reference the parent rule
8694 * src/symlist.c (symbol_list_new): Initialize new midrule-related
8696 (symbol_list_length): Now that this is invoked after all rules have
8697 been parsed, a NULL symbol (rather than a NULL symbol list node)
8698 terminates a rule. symbol_list_print already does this correctly.
8699 * src/symlist.h (symbol_list.midrule_parent_rule,
8700 symbol_list.midrule_parent_rhs_index): New members so that midrules can
8701 remember their relationships with their parents.
8702 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
8703 fixed by the above patch.
8704 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
8706 (Unused values): ... this old test case and...
8707 (Unused values before symbol declarations): ... this new test case.
8708 This one is the same as `Unused values' except that all symbol
8709 declarations appear after the rules in order to catch the rest of the
8710 errors fixed by the above patch.
8712 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8715 * src/reader.c (current_rule): Declare it static since it's no longer
8716 used outside this file.
8717 (grammar_current_rule_action_append): Remove redundant arguments from
8718 translate_rule_action invocation.
8719 * src/reader.h (current_rule): Remove this unused extern.
8720 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
8721 * src/scan-code.l (translate_rule_action): Likewise.
8723 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
8725 Clean up yesterday's patch.
8726 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
8728 * src/reader.c (grammar_current_rule_action_append): ... here for
8729 consistency with grammar_current_rule_symbol_append.
8730 * tests/regression.at (Braced code in declaration in rules section):
8731 Make yyerror and yylex static as usual.
8733 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
8735 Fix bug that mistakes braced code in a declaration in the rules section
8736 to be a rule action. Mentioned at
8737 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
8738 * src/scan-gram.l: Move midrule action detection from the start of the
8739 scanning of any braced code to...
8740 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
8741 action. For readability, use $2 and @2 rather than the equivalent
8743 * tests/regression.at (Braced code in declaration in rules section):
8744 New test to catch the error fixed by the above patch.
8746 Work on code readability some.
8747 * src/scan-code.l (current_rule): Get rid of this misleading and
8748 redundant declaration: it's actually extern'ed in reader.h.
8749 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
8750 translate_action): Add a rule argument and use it instead of the global
8752 (translate_rule_action): This already receives current_rule through an
8753 argument, so pass it on to translate_action instead of assigning
8754 current_rule to current_rule.
8755 (translate_symbol_action, translate_code): Pass rule = NULL to
8758 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
8760 Rename %before-definitions to %start-header and %after-definitions to
8761 %end-header. Don't use these declarations to separate pre-prologue
8762 blocks from post-prologue blocks. Add new order-independent
8763 declarations %before-header and %after-header as alternatives to the
8764 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
8765 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
8766 * NEWS (2.3+): Update for these changes.
8767 * data/glr.c (b4_before_definitions): Update to...
8768 (b4_start_header): ... this.
8769 (b4_after_definitions): Update to...
8770 (b4_end_header): ... this.
8771 * data/glr.cc: Likewise.
8772 * data/lalr1.cc: Likewise.
8773 * data/yacc.c: Likewise.
8774 * doc/bison.texinfo (The prologue): Update names, and replace remaining
8775 prologue blocks with %*-header declarations.
8776 (Calc++ Parser): Likewise.
8777 (Decl Summary): Update names.
8778 (Table of Symbols): Update description.
8779 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
8780 (PERCENT_END_HEADER): ... this.
8781 (PERCENT_BEFORE_DEFINITIONS): Update to...
8782 (PERCENT_START_HEADER): ... this.
8783 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
8784 (declaration): Update token names and m4 macro names.
8785 When parsing %end-header and %start-header, invoke translate_code
8786 before muscle_code_grow, and no longer set global booleans to remember
8787 whether these declarations have been seen.
8788 Parse new %after-header and %before-header.
8789 * src/reader.c (before_definitions, after_definitions): Remove.
8790 (prologue_augment): Accept a new bool argument to specify whether to
8791 augment the pre-prologue or post-prologue.
8792 * src/reader.h (before_definitions, after_definitions): Remove these
8794 (prologue_augment): Add new bool argument.
8795 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
8796 (PERCENT_END_HEADER): ... this.
8797 (PERCENT_BEFORE_DEFINITIONS): Update to...
8798 (PERCENT_START_HEADER): ... this.
8799 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
8800 * tests/actions.at (Printers and Destructors): Update names.
8802 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
8804 Add comparison operators for C++ location classes. Discussed at
8805 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
8806 * data/c++.m4 (b4_define_location_comparison): New boolean %define
8807 declaration indicating whether filename_type has an operator==. If
8808 filename_type is `std::string', it defaults to `1', `0' otherwise.
8809 * data/location.cc: Iff b4_define_location_comparison is `1', add
8810 operator== and operator!= for class position and for class location.
8813 * src/scan-action.l: Remove unused file.
8814 * src/symtab.c (symbol_printer_set): Use printer_location not
8815 destructor_location.
8816 * src/symtab.h (struct symbol): Replace incorrect source comment for
8818 * tests/input.at (Incompatible Aliases): Update output with correct
8821 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
8823 Don't put the pre-prologue in the header file. For the yacc.c code
8824 file and the glr.c header and code files, move the pre-prologue before
8825 the token definitions. Add new %before-definitions and
8826 %after-definitions to declare code that will go in both the header file
8827 and code file. Discussed at
8828 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
8829 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
8831 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
8832 * NEWS (2.3+): Describe these changes.
8833 * data/glr.c (b4_pre_prologue): Move from within to before...
8834 (b4_shared_declarations): ... this.
8835 Add new b4_before_definitions before b4_token_enums.
8836 Add new b4_after_definitions at the end.
8837 * data/glr.cc (b4_pre_prologue): Replace with...
8838 (b4_before_definitions): ... this in the header file.
8839 (b4_after_definitions): New near the end of the header file.
8840 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
8841 code file right before including the header file.
8842 (b4_before_definitions): New in the previous position of
8843 b4_pre_prologue in the header file.
8844 (b4_after_definitions): New near the end of the header file.
8845 * data/yacc.c: Clean up some m4 quoting especially in the header file.
8846 (b4_token_enums_defines): In the code file, move to right before
8847 YYSTYPE for consistency with the header file.
8848 (b4_before_definitions): New right before b4_token_enums_defines in
8849 both the header and code file.
8850 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
8851 header and code file.
8852 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
8853 of prologues for %union dependencies.
8854 (Decl Summary): In %defines description, mention the effect of
8855 %before-definitions and %after-definitions on the header file.
8856 (Calc++ Parser): Forward declare driver in a %before-definitions rather
8857 than in the pre-prologue so that make check succeeds.
8858 (Table of Symbols): Add entries for %before-definitions and
8860 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
8861 %before-definitions.
8862 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
8863 (declaration): Parse those declarations and append to
8864 b4_before_definitions and b4_after_definitions, respectively.
8865 * src/reader.c (before_definitions, after_definitions): New bools to
8866 track whether those declarations have been seen.
8867 (prologue_augment): Add to the post-prologue if %union,
8868 %before-definitions, or %after-definitions has been seen.
8869 * src/reader.h (before_definitions, after_definitions): New extern's.
8870 * src/scan-gram.l: Scan the new declarations.
8871 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
8872 prologue block in a %before-definitions or a %after-definitions based
8873 on whether the %union is declared.
8874 * tests/regression.at (Early token definitions with --yacc, Early token
8875 definitions without --yacc): Move tests for token definitions into the
8876 post-prologue since token names are no longer defined in the
8879 2006-06-20 Akim Demaille <akim@epita.fr>
8881 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
8882 (symbol_get): Use it.
8883 * src/parse-gram.y: Use it.
8885 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
8887 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
8888 build succeeds when configured with --enable-gcc-warnings.
8890 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
8892 * src/parse-gram.y (char_name): New function.
8893 (CHAR, STRING, string_content): For %printer, properly escape.
8894 (ID): Prefer fputs to fprintf.
8895 (id): Reindent to be consistent with other rules.
8896 Properly quote char.
8898 The Translation Project changed its way of publishing translations
8899 to maintainers. I haven't received any responses to my request
8900 for supporting the old way, or for documenting the new way. I
8901 have modified 'bootstrap' to use screen scraping
8902 (in this case, HTML scraping). This is unreliable and inelegant,
8903 but I don't see any better way. Yuck.
8904 * bootstrap (TP_URL, WGET_COMMAND): New vars.
8905 (get_translations): New function, which uses HTML scraping to
8906 deduce locations of latest translations.
8907 Use this function to grab both bison and bison-runtime .po files.
8908 Don't bother priming the pump for the runtime-po domain any more,
8909 as it's now translated better than bison is.
8911 2006-06-19 Akim Demaille <akim@epita.fr>
8913 * src/scan-gram.l: No longer "parse" things after `%union' until
8914 `{'. Rather, return a single "%union" token.
8915 No longer make symbols: return strings, and leave the conversion
8916 to symbols to the parser.
8917 (SC_PRE_CODE, token_type): Remove.
8918 * src/parse-gram.y (%union): New field `character'.
8921 (ID, ID_COLON): Now that the scanner no longer makes them
8922 identifiers, adjust all uses to invoke symbol_get.
8923 (id_colon): New, wraps the conversion from string to symbol.
8924 (%union): Accept a possible union_name.
8925 (symbol): Now can be a char.
8926 * data/c.m4 (b4_union_name): Leave a default value.
8927 * data/glr.c, data/yacc.c: Use it.
8929 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
8931 For associating token numbers with token names for "yacc.c", don't use
8932 #define statements unless `--yacc' is specified; always use enum
8933 yytokentype. Most important discussions start at:
8934 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
8935 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
8937 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
8938 * NEWS (2.3+): Mention.
8939 * data/c.m4 (b4_yacc_if): New.
8940 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
8942 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
8943 on token name definitions.
8944 * src/getargs.c (usage): Capitalize `Yacc' in English.
8945 * src/output.c (prepare): Define b4_yacc_flag.
8946 * tests/regression.at (Early token definitions): Test that tokens names
8947 are defined before the pre-prologue not just before the post-prologue.
8948 Remove this test case and copy to...
8949 (Early token definitions with --yacc): ... this to test #define's.
8950 (Early token definitions without --yacc): ... and this to test enums.
8952 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
8954 * NEWS: Reword the post-2.3 change to not be so optimistic about
8955 removing the old "look-ahead" spelling.
8956 Update previous look-ahead/lookahead change reports.
8957 * REFERENCES: look-ahead -> lookahead (since that's
8958 what he actually wrote).
8959 * doc/refcard.tex: look ahead -> lookahead,
8960 look-ahead -> lookahead
8962 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
8964 For consistency, use `lookahead' instead of `look-ahead' or
8965 `look_ahead'. Discussed starting at
8966 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
8968 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
8969 * NEWS: For the next release, note the change to `--report'.
8970 * TODO, doc/bison.1: Update English.
8971 * doc/bison.texinfo: Update English.
8972 (Understanding Your Parser, Bison Options): Document as
8973 `--report=lookahead' rather than `--report=look-ahead'.
8974 * src/conflicts.c: Update English in comments.
8975 (lookahead_set): Rename from look_ahead_set.
8976 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
8977 (resolve_sr_conflict): Rename local look_ahead_tokens to
8978 lookahead_tokens, and update other uses.
8979 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
8980 count_rr_conflicts, conflicts_free): Update uses.
8981 * src/getargs.c (report_args): Move "lookahead" before alternate
8983 (report_types): Update uses.
8984 (usage): For `--report' usage description, state `lookahead' spelling
8985 rather than `look-ahead'.
8986 * src/getargs.h (report.report_lookahead_tokens): Rename from
8987 report_look_ahead_tokens.
8988 * src/lalr.c: Update English in comments.
8989 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
8990 (state_lookahead_tokens_count): Rename from
8991 state_look_ahead_tokens_count.
8992 Rename local n_look_ahead_tokens to n_lookahead_tokens.
8993 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
8994 Rename local n_look_ahead_tokens to n_lookahead_tokens.
8996 Update English in output.
8997 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
8998 * src/print.c: Update English in comments.
8999 (lookahead_set): Rename from look_ahead_set.
9000 (print_reduction): Rename argument lookahead_token from
9002 (print_core, state_default_rule, print_reductions, print_results):
9004 * src/print_graph.c: Update English in comments.
9005 (print_core): Update uses.
9006 * src/state.c: Update English in comments.
9007 (reductions_new): Update uses.
9008 (state_rule_lookahead_tokens_print): Rename from
9009 state_rule_look_ahead_tokens_print, and update other uses.
9010 * src/state.h: Update English in comments.
9011 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
9012 (state_rule_lookahead_tokens_print): Rename from
9013 state_rule_look_ahead_tokens_print.
9014 * src/tables.c: Update English in comments.
9015 (conflict_row, action_row): Update uses.
9016 * tests/glr-regression.at
9017 (Incorrect lookahead during deterministic GLR,
9018 Incorrect lookahead during nondeterministic GLR): Rename
9019 print_look_ahead to print_lookahead.
9020 * tests/torture.at: Update English in comments.
9021 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
9022 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
9023 (Many lookahead tokens): Update uses.
9024 * data/glr.c: Update English in comments.
9025 * lalr1.cc: Likewise.
9027 * src/conflicts.h: Likewise.
9028 * src/lalr.h: Likewise.
9029 * src/main.c: Likewise.
9030 * src/output.c: Likewise.
9031 * src/parse-gram.c: Likewise.
9032 * src/tables.h: Likewise.
9033 * tests/calc.at: Likewise.
9035 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
9037 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
9039 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
9041 * TODO: Add request from Nelson H. F. Beebe to be able to install
9042 Bison without installing the yacc script.
9044 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
9046 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
9047 and yytext if they're already #define'd.
9048 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
9049 * src/scan-code-c.c: ... here.
9050 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
9053 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
9055 Get Bison to build again when configured with --enable-gcc-warnings.
9056 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
9058 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
9059 loc argument as it shadows a global.
9060 * src/scan-gram.l: Remove stray comma that prevents boundary_set
9063 * src/.cvsignore: Add scan-code.c.
9065 2006-06-07 Akim Demaille <akim@epita.fr>
9067 * src/scan-gram.l: Move the "add a trailing ; to actions" code
9069 * src/scan-code.l: here.
9070 * tests/input.at (Torturing the Scanner): Fix another location
9073 2006-06-07 Akim Demaille <akim@epita.fr>
9075 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
9077 2006-06-06 Akim Demaille <akim@epita.fr>
9079 Extract the parsing of user actions from the grammar scanner.
9080 As a consequence, the relation between the grammar scanner and
9081 parser is much simpler. We can also split "composite tokens" back
9083 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
9084 * src/scan-gram.l (add_column_width, adjust_location): Move to and
9086 * src/location.h, src/location.c (add_column_width)
9087 (location_compute): these.
9088 Fix the column count: the initial column is 0.
9089 (location_print): Be robust to ending column being 0.
9090 * src/location.h (boundary_set): New.
9091 * src/main.c: Adjust to scanner_free being renamed as
9093 * src/output.c: Include scan-code.h.
9094 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
9096 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
9097 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
9098 which is now, again, a separate token.
9099 Adjust all dependencies.
9100 Whereever actions with $ and @ are used, use translate_code.
9101 (action): Remove this nonterminal which is now useless.
9102 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
9103 (grammar_current_rule_action_append): Use translate_code.
9104 (packgram): Bound check ruleno, itemno, and rule_length.
9105 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
9106 (last_string, last_braced_code_loc, max_left_semantic_context)
9107 (scanner_initialize, scanner_free, scanner_last_string_free)
9108 (gram_out, gram_lineno, YY_DECL_): Move to...
9109 * src/scan-gram.h: this new file.
9110 (YY_DECL): Rename as...
9112 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
9113 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
9114 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
9115 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
9116 Move these declarations, and...
9117 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
9119 * src/flex-scanner.h: this new file.
9120 * src/scan-gram.l (rule_length, rule_length_overflow)
9121 (increment_rule_length): Remove.
9122 (last_braced_code_loc): Rename as...
9123 (gram_last_braced_code_loc): this.
9124 Adjust to the changes of the parser.
9125 Move all the handling of $ and @ into...
9126 * src/scan-code.l: here.
9127 * src/scan-gram.l (handle_dollar, handle_at): Remove.
9128 (handle_action_dollar, handle_action_at): Move to...
9129 * src/scan-code.l: here.
9130 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
9131 scan-code.h, scan-code-c.c, scan-gram.h.
9132 (EXTRA_bison_SOURCES): Add scan-code.l.
9133 (BUILT_SOURCES): Add scan-code.c.
9134 (yacc): Be robust to white spaces.
9136 * tests/conflicts.at, tests/input.at, tests/reduce.at,
9137 * tests/regression.at: Adjust the column numbers.
9138 * tests/regression.at: Adjust the error message.
9140 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
9142 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9143 Use Akim's wording from
9144 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
9146 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
9148 Between Bison releases, manually append `+' to the previous Bison
9149 release number, and use that as a signal to automatically print the
9150 ChangeLog's CVS Id keyword from --version. Discussed starting at
9151 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
9152 * ChangeLog: Add Id header.
9153 * configure.ac (AC_INIT): Append `+' to `2.3'.
9154 * src/.cvsignore: Add revision.c.
9155 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
9156 (BUILT_SOURCES): Add revision.c.
9157 (revision.c): New target rule. This file defines a new global variable
9158 named revision. It initializes it with either the Id from ChangeLog
9159 or, if VERSION doesn't contain `+', with the empty string.
9160 * src/getargs.c (version): Print the value of revision.
9161 * src/revision.h: Extern revision.
9163 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
9165 * NEWS: Version 2.3.
9166 * configure.ac (AC_INIT): Likewise.
9168 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
9170 * data/glr.c (YYRECOVERING): Define to be a function-like macro
9171 with no arguments, not as an object-like macro. This is for
9172 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
9173 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
9174 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
9177 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
9179 * src/getargs.c (usage): Back out yesterday's modification of the
9180 --help output so that we don't have to wait for translation before
9183 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
9185 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
9186 Problem reported by Akim Demaille.
9188 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
9190 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9192 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
9194 * data/yacc.c (yy_reduce_print): Omit trailing white space in
9195 generated source code. Problem reported by Frans Englich in
9196 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
9198 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
9200 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
9201 shell, not within 'make', so that 'make' by an ordinary builder
9202 (using GNU make) does not worry about configuring gzip. This also
9203 works around a bug reported independently by Keith Thompson and by
9204 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
9205 stderr rather than stdout, messing up the build logs.
9207 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
9209 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
9210 to make sure that YYID will never be unused. This fixes a 'make
9211 maintainer-check' failure caused by the recent changes to the 'Trivial
9212 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
9214 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
9216 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
9218 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
9219 state before an empty RHS is always resolved here. Only the location
9220 of that state is guaranteed to be resolved, and that's enough. This
9221 fixes the remaining bug reported by Derek M. Jones in
9222 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
9223 * tests/glr-regression.at (Uninitialized location when reporting
9224 ambiguity): Test the above case.
9225 Also, the embedded comments in this test case claim it checks the case
9226 of an empty RHS that has inherited the initial location. However, the
9227 corresponding LHS was already resolved, so yyresolveLocations didn't
9228 actually have reason to modify it. Fix this by forcing
9229 nondeterministic operation at the beginning of the parse.
9231 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
9233 * data/c.m4 (b4_yy_symbol_print_generate):
9234 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
9235 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
9236 of the bugs reported today by Derek M Jones in
9237 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
9238 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
9239 defined to be a type name without parens or brackets.
9240 (Location Type): Similarly for YYLTYPE.
9241 * tests/regression.at (Trivial grammars): Put in a test for this
9242 bug that will be caught by 'make maintainer-check' (though not,
9243 alas, by 'make check' unless your compiler is picky).
9245 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
9247 * NEWS: Version 2.2.
9248 * configure.ac (AC_INIT): Likewise.
9250 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
9252 * data/glr.c (yyreportTree): Make room in yystates for the state
9253 preceding the RHS. This fixes the segmentation fault reported by Derek
9255 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
9256 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
9257 to the user. Reported for yyreportTree by Derek M. Jones later in the
9259 * THANKS: Add Derek M. Jones.
9260 Update my email address.
9261 Fix typo in Steve Murphy's name.
9263 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
9265 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
9266 checking against YYLAST that caused the parser to miss a potential
9267 alternative in its diagnostic.
9268 Problem reported by Maria Jose Moron Fernandez in
9269 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
9270 * data/lalr1.cc (yysyntax_error_): Likewise.
9271 * data/yacc.c (yysyntax_error): Likewise.
9272 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
9273 tokens, in case we run into an older C compiler.
9274 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
9275 Use them to check for the off-by-one error fixed above.
9277 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
9278 YYSIZE_T, not size_t.
9279 * tests/regression.at (Trivial grammars): New test, to catch
9280 the error fixed by the above patch.
9282 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
9284 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
9286 Reported by Steve Murphy.
9288 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
9290 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
9291 * data/glr.cc: b4_location_flag is now b4_locations_flag.
9293 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
9295 Implement --trace=m4.
9296 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
9297 * src/output.c (output_skeleton): When set, pass -dV to m4.
9299 Factor the handling of flags in m4.
9300 * src/output.c (prepare): Rename the muscle names debug, defines,
9301 error_verbose to debug_flag, defines_flag, error_verbose_flag.
9302 * data/c.m4: Adjust.
9303 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
9304 Use b4_define_flag_if to define other b4_FLAG_if macros.
9305 (b4_location_if): As a consequence, rename as...
9306 (b4_locations_if): this, for consistency.
9307 Adjust all the skeletons.
9309 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
9311 * etc/bench.pm: Shorten bench names.
9313 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
9315 * src/output.h, src/output.c (error_verbose): Move to...
9316 * src/getargs.h, src/getargs.c: here.
9318 Adjust dependencies.
9320 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
9322 * data/c.m4 (b4_copyright): Put the special exception for Bison
9323 skeletons here, so we don't have to put it in each skeleton. All
9324 uses changed. Suggested by Akim Demaille. Also, wrap the
9325 copyright notice, in case it is longer than 80 columns. Replace
9326 comma by newline after title.
9328 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
9330 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
9331 incompatibility, not a bug. Mention that it wasn't fixed as of
9334 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
9336 * examples/extexi: Enforce the precedence of concatenation over
9338 Reported by Tommy Nordgren.
9340 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
9342 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
9343 with the member "token".
9344 Reported by Martin Nylin.
9346 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
9348 * data/glr.c: Switch to Bison 2.2 special-exception language in
9349 the copyright notice. Use more-regular format for titles and
9351 * data/glr.cc: Likewise.
9352 * data/location.cc: Likewise.
9353 * data/yacc.cc: Likewise.
9354 * doc/bison.texinfo (Conditions): Document this.
9355 * NEWS: likewise. Upgrade version to 2.2.
9357 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
9359 * data/glr.cc: Remove dead code.
9361 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
9363 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
9364 that variable and the line breaks the bootstrap. Problem reported
9365 by Juan M. Guerrero.
9367 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
9369 * doc/bison.texinfo (Multiple start-symbols): New.
9371 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
9373 * etc/README, etc/bench.pl: New.
9375 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
9377 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
9379 Reported by Mickael Labau.
9380 * tests/input.at (Torturing the Scanner): Test it.
9382 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
9384 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
9385 Problem reported by Bob Rossi.
9387 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
9389 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
9390 and didn't really work.
9391 For the index, use @ifnotinfo, not @iftex.
9392 Minor cleanups of spacing and terminology.
9394 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
9396 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
9397 of AT_NAME_PREFIX when %name-prefix is not used.
9399 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
9401 Apply --prefix to C++ skeletons too: they change the namespace.
9402 The test suite already exercize these cases.
9403 * data/c++.m4 (b4_namespace): New.
9404 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
9405 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
9406 * data/yacc.c, data/glr.c: Remove a useless `[]'.
9407 * doc/bison.texinfo: Document it.
9408 (Option Cross Key): Use @multitable in all formats. It looks
9409 nicer, even in TeX outputs.
9410 (Rules): Use the same code whatever the output type is.
9411 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
9412 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
9413 * tests/calc.at: Use it, instead of hard coding `yy'.
9415 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
9417 * TODO: Remove dead items.
9419 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
9421 * doc/FAQ: Remove, merged into...
9422 * doc/bison.texinfo (FAQ): this.
9423 * doc/Makefile.am (EXTRA_DIST): Adjust.
9425 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
9427 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
9429 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
9430 * doc/bison.texinfo (Calc++ Scanner): Use it.
9432 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
9434 Fix two nits reported by twlevo, plus one more that I discovered.
9436 * src/assoc.h (assoc_to_string): Give a name to the arg, as
9437 this is the usual Bison style.
9438 * src/location.h (location_print): Likewise.
9440 * src/reader.h (token_name): Likewise.
9442 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
9444 Fix some nits reported by twlevo.
9445 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
9446 and "POSIX". Use more-modern syntax for URLs. Mention C++
9447 and ask for Java. Don't hardwire OS version numbers. Add
9449 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
9450 * src/conflicts.c (solved_conflicts_obstack): Now static.
9452 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
9454 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
9455 page. Say "you can use it" not "you may use it" as on the web page;
9456 we're describing capabilities not granting permission.
9458 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
9460 * data/glr.c (yyresolveLocations): Rename local variables to avoid
9461 shadowing warnings. Use usual patter for iterating through RHS.
9462 * tests/glr-regression.at
9463 (Uninitialized location when reporting ambiguity):
9464 Modify yylex so that it uses its argument, rather than trying
9465 to rely on ARGSUSED (which doesn't work for gcc with warnings).
9466 const char -> char const.
9468 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
9469 Don't use tabs inside commands; it messes up 'ps'.
9470 Problem reported by twlevo.
9472 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
9474 * tests/glr-regression.at (Uninitialized location when reporting
9475 ambiguity): New test case.
9476 * data/glr.c (yyresolveLocations): New function, which uses
9478 (yyresolveValue): Invoke yyresolveLocations before reporting an
9480 * doc/bison.texinfo (Default Action for Locations): Note
9481 YYLLOC_DEFAULT's usage for ambiguity locations.
9482 (GLR Semantic Actions): Cross-reference those notes.
9484 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
9486 * tests/glr-regression.at (Leaked semantic values when reporting
9487 ambiguity): Remove unnecessary union and type declarations.
9488 (Leaked lookahead after nondeterministic parse syntax error): New test
9490 * data/glr.c (yyparse): Check for zero stacks remaining before
9491 attempting to shift the lookahead so that you don't lose it.
9493 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
9495 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
9496 * tests/glr-regression.at (Leaked semantic values when reporting
9497 ambiguity): New test case.
9498 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
9499 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
9500 now unnecessary yystackp parameter.
9501 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
9502 destructors can be called.
9504 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
9505 in existing testcases.
9507 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
9509 Don't leak semantic values for parent RHS when a user action cuts the
9510 parser, and clean up related code a bit.
9511 * tests/glr-regression.at (Leaked merged semantic value if user action
9512 cuts parse): Rename to...
9513 (Leaked semantic values if user action cuts parse): ... this. Add check
9514 for leaked parent RHS values.
9515 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
9516 between an unresolved state (non-empty chain of semantic options) and
9517 an incomplete one (signaled by an empty chain).
9518 (yyresolveStates): Document the interface. Move all manipulation of a
9519 successfully or unsuccessfully resolved yyGLRState to...
9520 (yyresolveValue): ... here so that yyresolveValue always leaves a
9521 yyGLRState with consistent data and thus is easier to understand.
9522 Remove the yyvalp and yylocp parameters since they are always just
9523 taken from the yys parameter. When reporting a discarded merged value
9524 in debugging output, note that it is incompletely merged. Document the
9526 (yyresolveAction): If resolving any of the RHS states fails, destroy
9527 them all rather than leaking them. Thus, as long as user actions are
9528 written to clean up the RHS correctly, yyresolveAction always cleans up
9529 the RHS of a semantic option. Document the interface.
9531 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
9533 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
9534 led to a segmentation fault in GNU Pascal. Problem reported
9537 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
9539 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
9540 mid-rule action inside a nonterminal symbol in order to declare a
9541 destructor for its semantic value.
9543 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
9545 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
9546 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
9547 __cplusplus && ! defined _STDLIB_H && !
9548 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
9549 defined free))]: Include <stdlib.h> rather than rolling our own
9550 declarations of malloc and free, to avoid problems with
9551 incompatible declarations (using 'throw') C++'s stdlib.h. This
9552 should fix Debian bug 340012
9553 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
9554 reported by Guillaume Melquiond.
9556 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
9558 * NEWS: Clarify symbols versus types in unused-value warnings.
9560 * configure.ac (AC_INIT): Bump version number.
9562 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
9564 * NEWS: Version 2.1a.
9565 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
9566 since C99 requires this.
9568 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
9570 * m4/c-working.m4: New file.
9571 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
9573 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
9575 * Makefile.maint: Merge from coreutils.
9577 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
9579 More portability fixes for problems summarized by Nelson H. F. Beebe.
9581 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
9582 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
9583 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
9584 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
9585 messes up because C++ code is compiled in 32-bit mode but linked
9588 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
9590 More portability fixes for problems summarized by Nelson H. F. Beebe.
9592 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
9593 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
9595 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
9596 nodist_PROGRAMS, since we don't need to actually compile the
9597 example if we're just doing a plain 'make'. This avoids bothering
9598 the installer unnecessarily about problems due to weird C++
9601 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
9603 More portability fixes for problems summarized by Nelson H. F. Beebe.
9605 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
9606 than #include "...", and compile with -I'.'. The old method was
9607 not portable, according to Posix and the C standard, and it does
9608 not work with Sun C 5.7, where previous #line directives affect
9609 the working directory used in later #include "..." directives.
9611 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9613 Various DJGGP specific issues in /djgpp
9615 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
9617 More portability fixes for problems summarized by Nelson H. F. Beebe.
9619 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
9620 '#include <map>' works and that you can apply ++ to iterators.
9622 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
9624 Work around portability problems summarized by Nelson H. F. Beebe in
9625 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
9627 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
9628 that '#include <string>' works.
9630 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
9631 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
9632 "warning: sorry: semantics of inline function static data `const
9633 unsigned char translate_table[262]' are wrong (you'll wind up with
9636 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
9637 or, xor to not_, and_, or_, and xor_, respectively. This works
9638 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
9639 random system header somewhere that includes the equivalent of
9642 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
9643 -E" works; it apparently doesn't work with PathScale EKO Compiler
9646 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
9648 During deterministic GLR operation, user actions should be able to
9649 influence the parse by changing yychar. To make this easier to fix and
9650 to make glr.c easier to evolve in general, don't maintain yytoken in
9651 parallel with yychar; just compute yytoken when needed.
9652 * tests/glr-regression.at (Incorrect lookahead during deterministic
9653 GLR): Check that setting yychar in a user action has the intended
9655 * data/glr.c (yyGLRStack): Remove yytokenp member.
9656 (yyclearin): Don't set *yytokenp.
9657 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
9658 yychar rather than *yytokenp to determine the current lookahead.
9659 Compute yytoken locally when needed.
9660 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
9663 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
9664 after `--report' documentation.
9666 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
9668 * src/parse-gram.y (grammar_declaration): Location of printer
9669 symbol is @1, not list->location. Bug reported by twlevo.
9670 * tests/input.at (Incompatible Aliases): Adjust to above change.
9672 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
9674 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
9675 all the test at once. This makes the output easier to read in the
9678 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
9679 got from <http://bro-ids.org/download.html>. The bug is that
9680 when two actions appeared in succession, the second one was
9681 scanned before the first one was added to the grammar rule
9682 as a midrule action. Bison then output the incorrect warning
9683 "parse.y:905.17-906.36: warning: unused value: $3".
9684 * src/parse-gram.y (BRACED_CODE, action): These are no longer
9685 associated with a value.
9686 (rhs): Don't invoke grammar_current_rule_action_append.
9687 (action): Invoke it here instead.
9688 * src/reader.c (grammar_midrule_action): Now extern.
9689 (grammar_current_rule_action_append): Don't invoke
9690 grammar_midrule_action; that is now the scanner's job.
9691 * src/reader.h (last_string, last_braced_code_loc):
9692 (grammar_midrule_action): New decls.
9693 * src/scan-gram.l (last_string): Now extern, sigh.
9694 (last_braced_code_loc): New extern variable.
9695 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
9696 rule already has an action.
9697 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
9698 * tests/input.at (AT_CHECK_UNUSED_VALUES):
9699 Add some tests to check that the above changes fixed the bug.
9701 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
9703 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
9704 All used changed. Check whether the symbol has a destructor,
9705 not whether it is typed.
9706 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
9707 that the values are still reported as unused. All line numbers
9710 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
9712 Work around a bug in bro 0.8, which underparenthesizes its
9713 definition of YYLLOC_DEFAULT.
9714 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
9716 * data/lalr1.cc: Likewise.
9717 * data/yacc.cc: Likewise.
9719 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
9721 Work around a bug in Pike 7.0, and give the Pike folks a
9722 better way to override the usual int widths.
9723 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
9724 user can override the types.
9725 (short): #undef, to work around a bug in Pike 7.0.
9726 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
9727 (union yyalloc.yyss): Use yytype_int16 rather than short.
9729 (yysigned_char): Remove.
9730 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
9731 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
9732 * tests/regression.at (Web2c Actions): Adjust to above changes.
9734 * src/reader.c (check_and_convert_grammar): New function.
9735 (reader): Close the input file even if something went wrong during
9736 parsing. Minor file descriptor leak reported by twlevo.
9738 * src/assoc.c (assoc_to_string): Use a default: abort (); case
9739 to pacify gcc -Wswitch-default.
9740 * src/scan-gram.l (adjust_location): Use a default: break; case
9741 to pacify gcc -Wswitch-default.
9742 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
9743 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
9744 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
9745 Move these decls to scan-skel.l, since they don't need to be
9747 * src/scan-skel.l: Accept the above decls.
9748 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
9751 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
9753 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
9754 since we don't want to insist on a version number at the start
9755 of the changelog every time.
9756 * Makefile.maint: Sync from coreutils a bit better.
9757 (sc_trailing_blank): Renamed from sc_trailing_space.
9759 (sc_no_if_have_config_h, sc_require_config_h):
9760 (sc_prohibit_assert_without_use): New rules.
9761 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
9762 (sc_dd_max_sym_length): Fix leading spaces in rule.
9763 (sc_system_h_headers): Prefix with @.
9764 (sc_useless_cpp_parens, m4-check): Output line numbers.
9765 (changelog-check): Allow version only in head.
9766 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
9767 satisfy new Makefile.maint rule.
9768 * data/glr.c: Likewise.
9769 * data/glr.cc: Likewise.
9770 * data/lalr1.cc: Likewise.
9771 * data/yacc.c: Likewise.
9772 * lib/ebitsetv.c: Likewise.
9773 * lib/lbitset.c: Likewise.
9774 * lib/subpipe.c: Likewise.
9775 * lib/timevar.c: Likewise.
9776 * src/system.h: Likewise.
9777 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
9778 * djgpp/Makefile.maint: Add copyright notice.
9779 * djgpp/README.in: Likewise.
9780 * djgpp/config.bat: Likewise.
9781 * djgpp/config.site: Likewise.
9782 * djgpp/config_h.sed: Likewise.
9783 * djgpp/djunpack.bat: Likewise.
9784 * djgpp/config.sed: Fix copyright notice to match standard format.
9785 * djgpp/subpipe.h: Likewise.
9786 * lib/bitsetv-print.c: Likewise.
9787 * lib/bitsetv.c: Likewise.
9788 * lib/subpipe.h: Likewise.
9789 * lib/timevar.c: Likewise.
9790 * lib/timevar.h: Likewise.
9791 * djgpp/subpipe.c: Use standard recipe for config.h.
9792 * lib/abitset.c: Likewise.
9793 * lib/bitset.c: Likewise.
9794 * lib/bitset_stats.c: Likewise.
9795 * lib/bitsetv-print.c: Likewise.
9796 * lib/bitsetv.c: Likewise.
9797 * lib/ebitsetv.c: Likewise.
9798 * lib/get-errno.c: Likewise.
9799 * lib/lbitset.c: Likewise.
9800 * lib/subpipe.c: Likewise.
9801 * lib/timevar.c: Likewise.
9802 * lib/vbitset.c: Likewise.
9803 * tests/local.at: Likewise.
9804 * src/scan-gram.l: Don't include verify.h, since system.h does
9806 * .x-sc_require_config_h: New file.
9807 * .x-sc_unmarked_diagnostics: New file.
9809 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
9811 Be a bit more systematic about using 'abort'.
9812 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
9813 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
9814 Put 'default: abort ();' before some other case, to satisfy older
9816 * lib/bitset_stats.c (bitset_stats_init): Likewise.
9817 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
9818 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
9819 * src/conflicts.c (resolve_sr_conflict): Likewise.
9820 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
9821 (get_decision_str, get_orientation_str, get_node_alignment_str):
9822 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
9823 (get_linestyle_str, get_arrowstyle_str): Likewise.
9824 * src/conflicts.c (resolve_sr_conflict):
9825 Use a default case rather than one for the one remaining enum
9826 value, to catch invalid enum values as well.
9827 * src/lalr.c (set_goto_map, map_goto):
9828 Prefer "assert (FOO);" to "if (!FOO) abort ();".
9829 * src/nullable.c (nullable_compute, token_definitions_output):
9831 * src/reader.c (packgram, reader): Likewise.
9832 * src/state.c (transitions_to, state_new, state_reduction_find):
9834 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
9835 (symbol_pack): Likewise.
9836 * src/tables.c (conflict_row, pack_vector): Likewise.
9837 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
9838 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
9839 * src/system.h: Don't include <assert.h>.
9840 (assert): New macro.
9842 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
9843 (Destructor Decl, Parser Function, Pure Calling):
9844 Describe rules for braces inside C code more carefully.
9846 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
9848 Fix some porting glitches found by Nelson H. F. Beebe.
9849 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
9850 compilers that don't understand that abort () does not return.
9851 * src/state.c (transitions_to): Likewise.
9852 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
9853 that '#include <cstdlib>' works.
9854 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
9855 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
9856 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
9857 for the benefit of some pre-C99 compilers.
9859 * bootstrap: Undo changes to gnulib files that autoreconf made.
9861 Minor fixups to get 'make maintainer-check' to work.
9862 * configure.ac: Don't use -Wnested-externs, as it's incompatible
9863 with the new verify.h implementation.
9864 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
9865 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
9866 * data/yacc.c (YYUSE): Likewise.
9867 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
9868 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
9869 * src/parse-gram.y (declaration): Don't pass a string constant
9870 to a function that expects char *, since GCC might complain
9871 about the constant value.
9872 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
9873 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
9874 before #defining them.
9875 * tests/glr-regression.at
9876 (Incorrectly initialized location for empty right-hand side in GLR):
9877 In yyerror, use the msg arg.
9878 (Corrupted semantic options if user action cuts parse):
9879 (Incorrect lookahead during deterministic GLR):
9880 (Incorrect lookahead during nondeterministic GLR):
9881 Don't name a local var 'index'; it shadows string.h's 'index'.
9883 2006-01-19 Akim Demaille <akim@epita.fr>
9885 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
9886 location, not just parts of it.
9888 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
9890 * NEWS: Document the fact that multiple %unions are now allowed.
9891 * doc/bison.texinfo (Union Decl): Likewise.
9892 * TODO: This feature is now implemented, so remove it from
9895 * Makefile.maint: Merge with coreutils Makefile.maint.
9896 (CVS_LIST): Use build-aux version if available.
9897 (VERSION_REGEXP): New macro.
9898 (syntax-check-rules): Add sc_no_if_have_config_h,
9899 sc_prohibit_assert_without_use, sc_require_config_h,
9900 sc_useless_cpp_parens.
9901 (sc_obsolete_symbols): Check for O_NDELAY.
9902 (sc_dd_max_sym_length): Track coreutils.
9903 (sc_unmarked_diagnostics): Look in all files, not just *.c.
9904 (sc_useless_cpp_parens): New rule.
9905 (news-date-check): Look for version or today's date.
9906 (changelog-check): Don't require version number near head.
9907 (copyright-check): Use current year instead of hardwiring 2005.
9908 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
9909 (announcement): Add --gpg-key-ID.
9911 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
9914 Avoid undefined behavior that addressed just before the start of an
9915 array. Problem reported by twlevo.
9916 * src/reader.c (packgram): Prepend a new sentinel before ritem.
9917 * src/lalr.c (build_relations): Rely on new sentinel.
9918 * src/gram.c (gram_free): Adjust to new sentinel.
9920 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
9922 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
9923 yylookaheadNeeds. All uses updated.
9924 (yysplitStack): Rename local yynewLookaheadStatuses to
9925 yynewLookaheadNeeds.
9926 * data/glr-regression.at (Incorrect lookahead during nondeterministic
9927 GLR): In comments, change `lookahead status' to `lookahead need'.
9929 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9931 * data/glr.c (yysplitStack): A little stylistic rewrite.
9933 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9935 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
9937 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
9939 * doc/bison.texinfo: Fix some typos.
9940 (GLR Semantic Actions): New subsection discussing special
9941 considerations because GLR semantic actions might be deferred.
9942 (Actions): Mention look-ahead usage of yylval.
9943 (Actions and Locations): Mention look-ahead usage of yylloc.
9944 (Special Features for Use in Actions): Add YYEOF entry and mention it
9945 in the yychar entry.
9946 In the yychar entry, remove mention of the local yychar case (pure
9947 parser) since this is irrelevant information when writing semantic
9948 actions and since it's already discussed in `Table of Symbols' where
9949 yychar is otherwise described as an external variable.
9950 In the yychar entry, don't call it the `current' look-ahead since it
9951 isn't when semantic actions are deferred.
9952 In the yychar and yyclearin entries, add note about deferred semantic
9954 Add yylloc and yylval entries discussing look-ahead usage.
9955 (Look-Ahead Tokens): When discussing yychar, don't call it the
9956 `current' look-ahead, and do mention yylval and yylloc.
9957 (Error Recovery): Cross-reference `Action Features' when mentioning
9959 (Table of Symbols): In the yychar entry, don't call it the `current'
9961 In the yylloc and yylval entries, mention look-ahead usage.
9963 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
9965 * tests/glr-regression.at: Update copyright year to 2006.
9967 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
9969 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
9970 use during nondeterministic operation to track which stacks have
9971 actually needed the current lookahead.
9972 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
9973 Allocate, deallocate, resize, and otherwise shuffle space for
9974 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
9975 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
9976 appropriately during nondeterministic operation.
9977 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
9978 members to store the current lookahead to be used by the deferred
9980 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
9981 from which the RHS is taken. Set the lookahead members of the new
9982 yySemanticOption according to the lookahead status for stack yyk.
9983 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
9984 yyaddDeferredAction.
9985 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
9986 members of yySemanticOption before invoking yyuserAction, and then set
9987 them back to their current values afterward.
9988 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
9989 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
9990 * tests/glr-regression.at: Remove `.' from the ends of recent test case
9991 titles for consistency.
9992 (Leaked merged semantic value if user action cuts parse): In order to
9993 suppress lint warnings, use arguments in merge function, and assign
9994 char value < 128 in main.
9995 (Incorrect lookahead during deterministic GLR): New test case.
9996 (Incorrect lookahead during nondeterministic GLR): New test case.
9998 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10000 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
10001 !yyvaluep as signal that no semantic value is available to print.
10002 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
10003 to print a semantic value.
10005 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10007 * tests/glr-regression.at: For consistency with my newer test cases,
10008 don't thank myself.
10010 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
10012 * data/glr.c (yyresolveValue): When merging semantic options, if at
10013 least one user action succeeds but a later one cuts the parse, then
10014 destroy the semantic value before returning rather than leaking it.
10015 (yyresolveStates): If a user action cuts the parse and thus
10016 yyresolveValue fails, ignore the (unset) semantic value rather than
10017 corrupting the yyGLRState, and empty the semantic options list since
10018 the user actions should have called all necessary destructors.
10019 Simplify code with YYCHK.
10020 * tests/glr-regression.at (Corrupted semantic options if user action
10021 cuts parse): New test case.
10022 (Undesirable destructors if user action cuts parse): New test case.
10023 Before applying any of this patch, this test case never actually failed
10024 for me... but only because the corrupted semantic options usually
10026 (Leaked merged semantic value if user action cuts parse): New test
10029 2006-01-05 Akim Demaille <akim@epita.fr>
10031 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
10033 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
10035 * data/c.m4 (b4_c_modern): New macro, with a new provision for
10036 _MSC_VER. Problem reported by Cenzato Marco.
10037 (b4_c_function_def): Use it.
10038 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
10040 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
10041 than rolling our own.
10043 2006-01-04 Akim Demaille <akim@epita.fr>
10045 Also warn about non-used mid-rule values.
10046 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
10048 (symbol_list_new): Adjust.
10049 * src/reader.c (symbol_typed_p): New.
10050 (grammar_rule_check): Use it.
10051 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
10053 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
10055 * tests/actions.at (Exotic Dollars): Adjust.
10057 2006-01-04 Akim Demaille <akim@epita.fr>
10059 * src/reader.c (grammar_midrule_action): If $$ is set in a
10060 mid-rule, move the `used' bit to its lhs.
10061 * tests/input.at (Unused values): New.
10062 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
10064 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
10066 * doc/bison.texinfo (Bison Options): Say more accurately what
10068 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
10069 about declarations in the grammar when in Yacc mode, as POSIX does
10070 not require a diagnostic when the grammar uses extensions.
10072 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
10074 Warn about dubious constructions like "%token T T".
10075 Reported by twlevo.
10076 * src/symtab.h (struct symbol.declared): New member.
10077 * src/symtab.c (symbol_new): Initialize it to false.
10078 (symbol_class_set): New arg DECLARING, specifying whether
10079 this is a declaration that we want to warn about, if there
10080 is more than one of them. All uses changed.
10082 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
10083 Allow multiple %union directives, whose contents concatenate.
10084 * src/parse-gram.y (grammar_declaration): Likewise.
10085 Use muscle_code_grow, so that we don't need stype_line any more.
10088 * src/muscle_tab.c (muscle_grow): Fix comment.
10090 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
10091 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
10092 Update copyright year to 2006.
10094 2006-01-03 Akim Demaille <akim@epita.fr>
10096 Have glr.cc pass (some of) the calc.at tests.
10097 * data/glr.cc (b4_parse_param_orig): New.
10098 (b4_parse_param): Improve its definition, and bound it more
10099 clearly in the skeleton.
10100 (b4_epilogue): Append, instead of prepending, in order to keep
10102 Simplify the generation of auxiliary functions: locations and
10103 purity are mandated.
10104 (b4_global_tokens_and_yystype): Honor it.
10105 * data/location.cc (c++.m4): Don't include it.
10106 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
10108 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
10110 Be sure to initialize the first position's filename.
10111 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
10113 (AT_CHECK_CALC_GLR_CC): New.
10114 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
10116 2006-01-02 Akim Demaille <akim@epita.fr>
10118 * src/output.c (output_skeleton): Don't hard wire the inclusion of
10120 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
10121 * data/glr.cc: Do not include stack.hh.
10123 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
10125 * data/glr.c: Reformat whitespace with tabs.
10126 (b4_lpure_formals): Remove this unused m4 macro.
10127 * tests/cxx-type.at: Reformat whitespace with tabs.
10128 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
10129 since it's a member. Rename type to isNterm for clarity.
10131 2005-12-29 Akim <akim@sulaco.local>
10133 Let glr.cc catch up with symbol_value_print.
10134 * data/glr.cc (b4_yysymprint_generate): Replace by...
10135 (b4_yy_symbol_print_generate): this.
10136 (yy_symbol_print, yy_symbol_value_print): Declare them.
10138 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
10140 * src/location.h (boundary): Note that a line or column equal
10141 to INT_MAX indicates an overflow.
10142 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
10143 (rule_length_overflow, increment_rule_length, add_column_width):
10145 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
10146 (<SC_BRACED_CODE>"}"):
10147 Use increment_rule_length rather than incrementing it by hand.
10148 (adjust_location, handle_syncline): Diagnose overflow.
10149 (handle_action_dollar, handle_action_at):
10150 Fix bug with monstrosities like $-2147483648.
10151 Remove now-unnecessary checks.
10152 (scan_integer): Verify assumptions and remove now-unnecessary checks.
10153 (convert_ucn_to_byte): Verify assumptions.
10154 (handle_syncline): New arg LOC. All callers changed.
10155 Don't store through a value derived from char const * pointer.
10157 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
10160 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
10162 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
10163 Remove unnecessary forward static decls.
10165 2005-12-27 Akim Demaille <akim@epita.fr>
10167 * src/reader.c (grammar_current_rule_check): Also check that $$
10169 Take the rule to check as argument, hence rename as...
10170 (grammar_rule_check): this.
10171 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
10173 (grammar_rule_begin, grammar_rule_end): these, for consistency.
10174 (grammar_midrule_action, grammar_symbol_append): Now static.
10175 * tests/torture.at (input): Don't rely on the default action
10176 being always performed.
10177 * tests/calc.at: "Set" $$ even when the action is "cut" with
10179 * tests/actions.at (Exotic Dollars): Instead of using unused
10180 values, check that the warning is issued.
10182 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
10184 * NEWS: Improve wording for unused-value warnings.
10186 2005-12-22 Akim Demaille <akim@epita.fr>
10188 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
10189 (b4_yysymprint_generate): Rename as...
10190 (b4_yy_symbol_print_generate): this.
10191 Generate yy_symbol_print instead of yysymprint.
10192 Generate also yy_symbol_value_print, and use it.
10194 2005-12-22 Akim Demaille <akim@epita.fr>
10196 * NEWS: Warn about unused values.
10197 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
10199 (symbol_list_n_get, symbol_list_n_used_set): New.
10200 (symbol_list_n_type_name_get): Use symbol_list_n_get.
10201 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
10202 * src/reader.c (grammar_current_rule_check): Check that values are
10204 * src/symtab.c (symbol_print): Accept 0.
10205 * tests/existing.at: Remove the type information.
10207 Remove useless actions (beware of mid-rule actions: perl -000
10208 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
10209 * tests/actions.at (Exotic Dollars): Use unused values.
10210 * tests/calc.at: Likewise.
10211 * tests/glr-regression.at (No users destructors if stack 0 deleted):
10214 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
10217 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
10219 Undo 2005-12-01 tentative license wording change. The wording is
10220 still being reviewed by the lawyers, and we don't want to wait for
10221 them before publishing a test release. For now, revert to the
10223 * NEWS: Undo 2005-12-01 change.
10224 * data/glr.c: Revert to previous license wording.
10225 * data/glr.cc: Likewise.
10226 * data/lalr1.cc: Likewise.
10227 * data/location.cc: Likewise.
10228 * data/yacc.c: Likewise.
10230 * NEWS: Reword %destructor vs YYABORT etc.
10231 * data/glr.c: Use American spacing, for consistency.
10232 * data/glr.cc: Likewise.
10233 * data/lalr1.cc: Likewise.
10234 * data/yacc.c: Likewise.
10235 * data/yacc.c: Reformat comments slightly.
10236 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
10237 for consistency. Fix some spelling errors and reword recently-included
10239 * tests/cxx-type.at: Cast results of malloc, for C++.
10241 2005-12-21 Joel E. Denny <address@hidden>
10243 * tests/cxx-type.at: Construct a tree, count the parents of shared
10244 nodes, and free each node once and only once. Previously, the memory
10245 for semantic values was leaked instead.
10247 2005-12-21 Joel E. Denny <address@hidden>
10249 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
10250 (yylval, yylloc): If pure, #define to yystackp->yyval and
10251 yystackp->yyloc similar to yychar and yynerrs.
10252 (yyparse): If pure, remove local yylval and yylloc. Add local
10253 yystackp to accommodate pure definitions of yylval and yylloc.
10254 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
10255 yylvalp and yyllocp to &yylval and &yylloc.
10256 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
10257 namespace. Previously, nerrs and char were missing, but lval and lloc
10259 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
10260 yylvalp and yyllocp parameters since, if pure, these are now always
10261 accessible through yystackp. If not pure, they are still accessible
10263 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
10264 `if (YYID (N))' to pacify lint.
10266 2005-12-21 Akim Demaille <akim@epita.fr>
10268 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
10269 destroy the RHS symbols of a rule.
10270 * data/yacc.c (yylen): Initialize to 0.
10271 Keep its value to the number of items to possibly shift.
10272 In particular, a regular successful parse that ends on YYFINAL by
10273 a (internal) YYACCEPT must not have yylen != 0.
10274 (yyerrorlab, yyreturn): Pop the RHS.
10275 Reorder a bit to emphasize the `shifting' bits of code.
10276 (YYPOPSTACK): Now accept a number of items to pop.
10277 * data/lalr1.cc: Likewise.
10278 * data/glr.c: Formatting changes.
10279 Use goto instead of fall through.
10280 * doc/bison.texinfo (Destructor Decl): Complete.
10282 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10284 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
10285 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
10286 * djgpp/config.bat: Replace every occurence of the file name
10287 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10288 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10289 * djgpp/config.sed: Replace every occurence of the file name
10290 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10291 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10292 * djgpp/djunpack.bat: DJGPP specific file.
10293 * djgpp/fnchange.lst: DJGPP specific file.
10294 * djgpp/README.in: Add new information about how to unpack the bison
10295 source on MSDOS and other systems which have 8.3 file name restrictions
10296 using djunpack.bat and fnchange.lst.
10298 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
10300 * bootstrap (build_cvs_prefix): Remove; unused.
10301 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
10302 when getting gnulib.
10304 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
10306 * data/glr.c: Reorder typedef declarations for structs to match order
10307 of struct declarations.
10308 Rename yystack everywhere to yystackp except in yyparse where it's not
10310 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
10312 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
10313 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
10314 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
10317 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
10319 * tests/sets.at (Accept): Fix typos in regular expression used to
10320 sed out the final state number.
10322 Work around portability problem on Solaris 10: flex-generated
10323 files include <stdio.h> before <config.h>, which messes up
10324 because the latter defines __EXTENSIONS__. Address the problem
10325 by creating two new little files that include <config.h> first,
10326 then include the flex-generated files. Rewrite everyone else
10327 to include <config.h> first, as well.
10328 * lib/timevar.c: Always include "config.h".
10329 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
10330 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
10331 (EXTRA_bison_SOURCES): New macro.
10332 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
10333 * src/system.h: Don't include config.h.
10334 * src/LR0.c: Include <config.h> first.
10335 * src/assoc.c: Likewise.
10336 * src/closure.c: Likewise.
10337 * src/complain.c: Likewise.
10338 * src/conflicts.c: Likewise.
10339 * src/derives.c: Likewise.
10340 * src/files.c: Likewise.
10341 * src/getargs.c: Likewise.
10342 * src/gram.c: Likewise.
10343 * src/lalr.c: Likewise.
10344 * src/location.c: Likewise.
10345 * src/main.c: Likewise.
10346 * src/muscle_tab.c: Likewise.
10347 * src/nullable.c: Likewise.
10348 * src/output.c: Likewise.
10349 * src/parse-gram.y: Likewise.
10350 * src/print.c: Likewise.
10351 * src/print_graph.c: Likewise.
10352 * src/reader.c: Likewise.
10353 * src/reduce.c: Likewise.
10354 * src/relation.c: Likewise.
10355 * src/state.c: Likewise.
10356 * src/symlist.c: Likewise.
10357 * src/symtab.c: Likewise.
10358 * src/tables.c: Likewise.
10359 * src/uniqstr.c: Likewise.
10360 * src/vcg.c: Likewise.
10362 * src/parse-gram.y: Fix minor problems uncovered by lint.
10363 (current_lhs, current_lhs_location): Now static.
10364 (current_assoc): Remove unused variable.
10366 Cleanups so that Bison-generated parsers have less lint.
10367 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
10368 Prepend /*ARGSUSED*/, for lint's sake.
10369 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
10370 definition if 'lint' is defined.
10371 (YYID): New macro (or function, if lint).
10372 All uses of /*CONSTCOND*/0 replaced by YYID(0).
10373 * data/yacc.c: Likewise.
10374 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
10375 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
10376 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
10378 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
10379 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
10380 Use YYID(0) rather than 0, for lint.
10381 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
10382 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
10384 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
10386 * tests/glr-regression.at
10387 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10388 Close memory leak reported by twlevo.
10390 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
10392 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
10394 (yyparse): Iterate another stack in order to call user destructors.
10395 * tests/glr-regression.at (No users destructors if stack 0 deleted):
10397 (Duplicated user destructor for lookahead): This test now is expected
10400 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
10402 * NEWS: Document the following change.
10403 * data/yacc.c: Say "parser skeleton" rather than "file", since
10404 it's no longer just a file.
10405 * data/glr.c: Grant a special exception for C GLR parsers, that
10406 reads like the already-existing exception for C LALR(1) parsers.
10407 * data/glr.cc: Likewise.
10408 * data/lalr1.cc: Likewise.
10409 * data/location.cc: Likewise.
10410 * data/yacc.c: Reword the "written by" statement to clarify that
10411 it was the parser skeleton, not the entire output file.
10412 * data/glr.c: Written by Paul Hilfinger.
10413 * data/glr.cc: Written by Akim Demaille.
10414 * data/lalr1.cc: Likewise.
10416 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
10418 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
10419 Fix typos in previous change that broke 'make check'.
10420 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
10422 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
10423 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
10424 We can revert this once things settle down.
10426 * src/conflicts.c (conflicts_print): Don't print file name twice
10427 when %expect fails because there were no conflicts.
10428 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
10430 * tests/conflicts.at (%expect not enough, %expect too much):
10431 (%expect with reduce conflicts): Adjust to new behavior.
10433 2005-11-18 Akim Demaille <akim@epita.fr>
10435 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
10437 * NEWS: Document this.
10438 * doc/bison.texinfo (Expect Decl): Likewise.
10440 2005-11-16 Akim Demaille <akim@epita.fr>
10442 Generalize the display of semantic values and locations in traces.
10443 * data/glr.c (yy_reduce_print): Fix indices (again).
10444 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
10446 * data/lalr1.cc (yyreduce_print): Rename as...
10447 (yy_reduce_print): this.
10448 Display values and locations.
10449 * data/yacc.c (yy_reduce_print): Likewise.
10450 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
10451 (yysymprint): Move higher to be visible from yy_reduce_print).
10453 * tests/calc.at: Adjust the expected length of the traces.
10455 2005-11-14 Akim Demaille <akim@epita.fr>
10457 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
10458 from 1 to N, while values and location start at 0.
10459 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
10461 2005-11-14 Akim Demaille <akim@epita.fr>
10463 * data/glr.c (yy_reduce_print): Fix the $ number.
10465 2005-11-14 Akim Demaille <akim@epita.fr>
10467 "Use" parse parameters.
10468 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
10469 * data/glr.c, data/glr.cc: Use them.
10470 * data/glr.c (YYUSE): Have a C++ definition that supports
10473 2005-11-14 Akim Demaille <akim@epita.fr>
10475 * data/glr.c (yyexpandGLRStack): Declare only if defined.
10477 2005-11-14 Akim Demaille <akim@epita.fr>
10479 * data/glr.cc: New.
10480 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
10482 2005-11-12 Akim Demaille <akim@epita.fr>
10484 Let position and location be PODs.
10485 * data/location.cc (position::initialize, location::initialize): New.
10486 (position::position, location::location): Define only if
10487 b4_location_constructors is defined.
10488 * data/lalr1.cc (b4_location_constructors): Define it for backward
10490 * doc/bison.texinfo (Initial Action Decl): Use initialize.
10492 2005-11-12 Akim Demaille <akim@epita.fr>
10494 * data/lalr1.cc: Move the body of the ctor and dtor into the
10495 parser file (instead of the header).
10496 Wrap the implementations in a "namespace yy".
10498 2005-11-12 Akim Demaille <akim@epita.fr>
10500 Have glr.c include its header file when created.
10501 * data/glr.c (b4_shared_declarations): New.
10502 Output them verbatim in the parser if !%defines, otherwise
10503 output then in the header file, and include it instead.
10505 2005-11-11 Akim Demaille <akim@epita.fr>
10507 * data/glr.c: Comment changes.
10509 2005-11-11 Akim Demaille <akim@epita.fr>
10511 When yydebug, report semantic and location values for reductions.
10512 * data/glr.c (yy_reduce_print): Report the semantic values and the
10514 (YY_REDUCE_PRINT): Adjust.
10515 (yyglrReduce): Use them.
10516 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
10517 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
10518 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
10521 2005-11-10 Akim Demaille <akim@epita.fr>
10523 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
10524 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
10525 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
10527 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
10529 * m4/cxx.m4, examples/Makefile.am: Don't build
10530 examples/calc++ if no C++ compiler is available. (trivial change)
10532 2005-11-09 Akim Demaille <akim@epita.fr>
10534 * src/scan-skel.l: Use a couple of asserts.
10536 2005-11-03 Akim Demaille <akim@epita.fr>
10538 In some (weird) cases, the final state number is incorrect.
10539 Reported by Alexandre Duret-Lutz.
10540 * src/LR0.c (state_list_append): Remove the computation of
10542 (save_reductions): Do it here.
10543 (get_state): Alpha conversion.
10544 (generate_states): Use a for loop.
10545 * src/gram.h (item_number_is_rule_number)
10546 (item_number_is_symbol_number): New.
10547 * src/state.c: Use assert.
10548 * src/system.h: Include assert.h.
10549 * tests/sets.at (Accept): New.
10551 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10553 * data/glr.c (yyfill): Adjust comment.
10554 (yyresolveAction): Initialize default location properly
10555 for empty right-hand sides.
10556 (yydoAction): Ditto.
10557 Add comment explaining apparently dead code.
10558 * tests/glr-regression.at
10559 (Incorrectly initialized location for empty right-hand side in GLR):
10562 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
10564 * bootstrap (cleanup_gnulib): New function. Use it to clean up
10565 gnulib when interrupted. This fixes some race conditions and
10566 works around some portability problems (one noted by Paul
10569 2005-10-22 Akim <akim@epita.fr>
10571 * Makefile.cfg: Adjust to config -> build-aux.
10572 Reported by twledo.
10574 2005-10-21 Akim Demaille <akim@epita.fr>
10576 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
10578 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
10579 * data/yacc.c (b4_Pure_if): Rename as...
10580 (b4_yacc_pure_if): this.
10581 (YY_SYMBOL_PRINT, yyparse): Adjust.
10582 * doc/bison.texinfo: Formatting changes.
10584 2005-10-21 Akim Demaille <akim@epita.fr>
10586 Finish the transition config -> build-aux.
10587 * configure.ac, Makefile.am: Use build-aux.
10588 * config/prev-version, config/announce-gen, config/Makefile.am:
10590 * build-aux/prev-version, build-aux/announce-gen,
10591 * build-aux/Makefile.am: here.
10593 2005-10-14 Akim Demaille <akim@epita.fr>
10595 * examples/calc++/test: Use set -x only when VERBOSE.
10597 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
10599 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
10600 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
10602 2005-10-13 Akim Demaille <akim@epita.fr>
10604 * src/scan-skel.l: Output the base name parts of the parser and
10606 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
10608 Use this to exercise C++ outputs in subdirs.
10609 Reported by Oleg Smolsky.
10611 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
10613 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
10614 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
10615 Problem reported by John P. Hartmann.
10616 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
10617 already defined it.
10619 2005-10-12 Akim Demaille <akim@epita.fr>
10621 * src/parse-gram.y (version_check): Exit 63 to please missing
10622 (stands for "version mismatch).
10623 * tests/input.at, doc/bison.texinfo: Adjust.
10625 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
10627 Work around portability problems with Visual Age C compiler
10628 (xlc and xlC_r) reported by John P. Hartmann.
10629 * data/location.cc (initial_column, initial_line): Remove.
10630 All uses replaced by 0 and 1.
10631 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
10632 that xlc complains about.
10633 * src/scan-skel.l (skel_wrap): Likewise.
10634 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
10636 * data/yacc.c (YYMODERN_C): New macro, which also looks at
10637 __STDC_VERSION__. Use it everywhere instead of looking at
10638 __STDC__ and __cplusplus.
10640 2005-10-10 Akim Demaille <akim@epita.fr>
10642 * examples/calc++/test: Be quiet unless VERBOSE.
10644 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
10646 * data/c.m4 (yydestruct, yysymprint):
10647 Use YYUSE instead of casting to void.
10648 * data/glr.c (YYUSE): New macro.
10649 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
10650 Use it instead of rolling our own.
10651 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10653 Use /*CONSTCOND*/ to suppress lint warnings.
10654 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10655 (YY_STACK_PRINT): Use 'false' not '0'.
10656 (YYUSE): New macro.
10657 (yysymprint_, yydestruct_): Use it instead of rolling our own.
10658 * data/yacc.c (YYUSE): New macro.
10659 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
10660 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
10661 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
10664 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
10665 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
10667 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
10669 Undo the parts of the unlocked-I/O change that substituted
10670 putc or puts for printf. This might hurt performance a bit,
10671 but some people prefer the printf style.
10672 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
10673 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
10674 All uses replaced by YYFPRINTF and YYDPRINTF.
10675 * data/yacc.c: Likewise.
10676 * lib/bitset.c (bitset_print): Likewise.
10677 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
10679 * lib/lbitset.c (debug_lbitset): Likewise.
10680 * src/closure.c (print_firsts, print_fderives): Likewise.
10681 * src/gram.c (grammar_dump): Likewise.
10682 * src/lalr.c (look_ahead_tokens_print): Likewise.
10683 * src/output.c (escaped_output): Likewise.
10684 (user_actions_output): Break apart two printfs.
10685 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
10686 * src/reduce.c (reduce_print): Likewise.
10687 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
10688 * src/system.h: Include unlocked-io.h rathe than stdio.h.
10690 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
10691 Use assignments rather than casts-to-void to suppress
10692 unused-variable warnings. This pacifies 'lint'.
10693 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
10694 unused-variable warnings.
10696 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10698 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
10700 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
10702 Use unlocked I/O for a minor performance improvement on hosts like
10703 GNU/Linux and Solaris that support unlocked I/O. The basic idea
10704 is to use the gnlib unlocked-io module, and to prefer putc and
10705 puts to printf when either will work (since the latter doesn't
10706 come in an unlocked flavor).
10707 * bootstrap (gnulib_modules): Add unlocked-io.
10708 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
10709 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
10710 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
10711 and similarly for puts and putc and printf.
10712 * data/yacc.c: Likewise.
10713 * lib/bitset.c (bitset_print): Likewise.
10714 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
10715 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
10717 * lib/lbitset.c (debug_lbitset): Likewise.
10718 * src/closure.c (print_firsts, print_fderives): Likewise.
10719 * src/gram.c (grammar_dump): Likewise.
10720 * src/lalr.c (look_ahead_tokens_print): Likewise.
10721 * src/output.c (escaped_output): Likewise.
10722 (user_actions_output): Coalesce two printfs.
10723 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
10724 * src/reduce.c (reduce_print): Likewise.
10725 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
10726 * src/system.h: Include unlocked-io.h rather than stdio.h.
10728 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
10729 this confuses xgettext.
10731 2005-10-02 Akim Demaille <akim@epita.fr>
10733 * bootstrap (gnulib_modules): Add strverscmp.
10734 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
10735 * m4/.cvsignore: Add strverscmp.m4.
10736 * src/parse-gram.y (%require): New token, new rule.
10737 (version_check): New.
10738 * src/scan-gram.l (%require): Adjust.
10739 * tests/input.at (AT_REQUIRE): New.
10741 * doc/bison.texinfo (Require Decl): New.
10742 (Calc++ Parser): Use %require.
10744 2005-10-02 Akim Demaille <akim@epita.fr>
10746 * data/location.cc: New.
10748 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
10749 Akim Demaille <akim@epita.fr>
10751 Make sure -odir/foo.cc creates dir/location.hh etc.
10752 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
10753 (spec_file_prefix, spec_verbose_file, spec_graph_file)
10754 (spec_defines_file): Now const.
10756 (short_base_name): Remove.
10757 * src/files.c: Adjust.
10758 (dirname.h): Include.
10759 (base_name): Don't prototype it.
10760 (finput): Remove, duplicates gram_in.
10761 (full_base_name, short_base_name): Replace by...
10762 (all_but_ext, all_but_tab_ext): these.
10763 (compute_base_names): Rename as...
10764 (compute_file_name_parts): this.
10765 Update to compute the new variables, including dir_prefix.
10766 Adjust dependencies.
10767 * src/output.c (prepare): Output them.
10768 * src/reader.c: Adjust to use gram_in, not finput.
10769 * src/scan-skel.l (@dir_prefix@): New.
10771 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10773 * lib/subpipe.c: New function end_of_output_subpipe() added
10774 to allow support for non-posix systems. This is a no-op function
10777 * lib/subpipe.h: New function end_of_output_subpipe() added
10778 to allow support for non-posix systems. This is a no-op function
10781 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
10782 handle the lack of pipe/fork functionality on non-posix systems.
10784 * djgpp/Makefile.maint: DJGPP specific file.
10786 * djgpp/README.in: DJGPP specific file.
10788 * djgpp/config.bat: DJGPP specific configuration file.
10790 * djgpp/config.sed: DJGPP specific configuration file.
10792 * djgpp/config.site: DJGPP specific configuration file.
10794 * djgpp/config_h.sed: DJGPP specific configuration file.
10796 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
10798 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
10800 2005-10-02 Akim Demaille <akim@epita.fr>
10802 * data/location.cc: New, extract from...
10803 * data/lalr1.cc: here.
10804 (location.hh): Include it after the user prologue, in case the
10805 filename type is defined by the user.
10806 Forward declation location and position before the pre-prologue.
10807 (yyresult_): Rename as...
10808 (yyresult): this, it's a local variable, not an attribute.
10809 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
10811 2005-10-01 Akim Demaille <akim@epita.fr>
10813 * examples/extexi: Restore the #line generation.
10815 2005-09-30 Akim Demaille <akim@epita.fr>,
10816 Alexandre Duret-Lutz <adl@gnu.org>
10818 Move the token type and YYSTYPE in the parser class.
10819 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
10820 (parser::token): New, from the moved free definition of tokens.
10821 (parser::semantic_value): Now a full definition instead of an
10822 indirection to YYSTYPE.
10823 (b4_post_prologue): No longer included in the header file, but
10824 in the implementation file.
10825 * doc/bison.texi (C+ Language Interface): Update.
10826 * src/parse-gram.y: Support unary %define.
10827 * tests/actions.at: Define global_tokens_and_yystype for backward
10828 compatibility until we update the tests.
10829 * tests/calc.at: Idem.
10830 (first_line, first_column, last_line, last_column): Define for lalr1.cc
10831 to simplify the code.
10833 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
10835 Port to SunOS 4.1.4, which lacks strtoul and strerror.
10836 Ah, the good old days! Problem reported by Peter Klein.
10837 * bootstrap (gnulib_modules): Add strerror, strtoul.
10838 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
10839 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
10841 2005-09-29 Akim Demaille <akim@epita.fr>
10843 * data/c.m4 (b4_error_verbose_if): New.
10844 * data/lalr1.cc: Use it.
10845 (YYERROR_VERBOSE_IF): Remove.
10846 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
10847 parser members, replaced by...
10848 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
10850 (yysyntax_error_): Takes the state number as argument.
10851 (yyreduce_print_): Use the argument yyrule, not the former
10854 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
10856 * bootstrap (gnulib_modules): Add verify.
10857 * lib/.cvsignore: Add verify.h.
10858 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
10859 * src/system.h (verify): Remove.
10860 Include verify.h instead.
10861 * src/tables.c (tables_generate): Use new API for 'verify'.
10863 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
10865 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
10866 local variables whose names begin with 'yy'.
10867 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
10868 Trivial changes from Joel E. Denny.
10870 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
10872 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
10873 don't use alloca any more.
10875 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
10876 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
10877 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
10878 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
10879 to match yacc.c, to test more hosts.
10881 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
10883 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
10884 doesn't affect behavior.
10885 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
10887 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
10888 This works a bit better with glibc, if user code has already included
10890 * doc/bison.texinfo (Bison Parser): Document that users can't
10891 arbitrarily use malloc and free for other purposes. Document
10892 that <alloca.h> and <malloc.h> might be included.
10893 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
10894 user must declare alloca.
10896 * HACKING (release): Forwarn the Translation Project about
10899 2005-09-20 Akim Demaille <akim@epita.fr>
10901 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
10903 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
10905 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
10906 (YYSTACK_ALLOC_MAXIMUM): Use it.
10907 (yysyntax_error): New function.
10908 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
10909 multiple syntax errors are reported, and alloca is being used.
10910 Instead, reallocate buffers twice as big each time, so that
10911 we waste at most half the allocated memory. Start with a small
10912 (128-byte) buffer that will suffice in most cases anyway.
10913 Use yysyntax_error to do most of the work.
10915 * doc/bison.texinfo (Error Reporting, Table of Symbols):
10916 yynerrs is the number of errors reported, not the number of
10917 errors encountered.
10919 * tests/glr-regression.at (Duplicated user destructor for lookahead):
10920 Mark it as expected to fail.
10921 Cast result of malloc; problem reported by twlevo@xs4all.nl.
10922 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
10923 Don't start user-code symbols with "yy", to avoid name space problems.
10925 2005-09-19 Akim Demaille <akim@epita.fr>
10927 Remove the traits, failed experiment.
10928 It never proved useful, and anyway because of the current
10929 definition, it was not possible to have several specialization of
10930 this traits, making it useless.
10931 * data/lalr1.cc (yy:traits): Remove.
10932 Inline its definitions in the parser class.
10934 2005-09-19 Akim Demaille <akim@epita.fr>
10936 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
10937 least Mac OSX with a /usr/local install of gettext.
10939 2005-09-19 Akim Demaille <akim@epita.fr>
10941 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
10942 and yytoken for similarity with the other skeletons.
10944 2005-09-19 Akim Demaille <akim@epita.fr>
10946 * NEWS, configure.ac: update version number to 2.1a.
10948 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
10950 * NEWS: Version 2.1.
10952 * NEWS: Remove notice of yytname change, since it was never in an
10954 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
10956 * src/output.c (prepare): Likewise.
10957 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
10958 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
10959 is not defined. This is an awful hack, but it's enough for now.
10960 All callers changed.
10961 * tests/glr-regression-at (make_value): Args are const pointers now,
10962 to avoid GCC warning.
10963 (Duplicated user destructor for lookahead): New test. Currently
10964 skipped. It fails on my host but I'm not sure it'll always fail.
10966 2005-09-16 Akim Demaille <akim@epita.fr>
10968 * src/symtab.h (struct symbol): Declare the printer and destructor
10969 as const, to avoid accidental calls to free.
10970 (symbol_destructor_set, symbol_printer_set): Adjust.
10971 * src/symtab.c: Adjust.
10973 2005-09-16 Akim Demaille <akim@epita.fr>
10975 * data/c.m4 (b4_token_enums): New.
10976 (b4_token_defines): Rename as...
10977 (b4_token_enums_defines): this.
10978 (b4_token_defines): New, output only the #defines.
10979 * data/yacc.c, data/glr.c: Adjust.
10980 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
10981 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
10984 2005-09-16 Akim Demaille <akim@epita.fr>
10986 * data/lalr1.cc (yylex_): Remove, inline its code.
10987 (yyreport_syntax_error_): Remove, replaced by...
10988 (yysyntax_error_): this which returns a string and leaves to the
10989 caller the call to the users' error function.
10990 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
10991 Move from members of the parser object...
10992 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
10993 to local variables of the parse function.
10995 2005-09-16 Akim Demaille <akim@epita.fr>
10997 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
10998 since it's in Bison's name space.
11000 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
11002 * data/glr.c (yyresolveValue): Add default case to pacify
11003 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
11005 * NEWS: Document when yyparse started to return 2.
11006 * doc/bison.texinfo (Parser Function): Document when yyparse
11009 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
11010 (b4_filename_type): Renamed back from b4_file_name_type. All uses
11012 (class position): file_name -> filename (reverting). All uses changed.
11014 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
11016 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
11017 do anything if $@ exists. This reverts part of the 2005-07-07
11020 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
11022 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
11023 contains obsolete information and isn't worth distributing as a
11024 separate file anyway.
11025 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
11026 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
11027 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
11028 (yyparse): Abort if user code uses longjmp to throw an unexpected
11031 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
11033 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
11034 Suggested by twlevo@xs4all.nl.
11036 * data/glr.c (YYCHK1): Do not assume YYE is in range.
11037 This avoids a diagnostic from gcc -Wswitch-enum.
11038 Problem reported by twlevo@xs4all.nl.
11040 * doc/bison.texinfo: Don't use "filename", as per GNU coding
11041 standards. Use "file name" or "file" or "name", depending on
11043 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
11044 not to hack/foo.tab.c.
11045 (Calc++ Top Level): 2nd arg of main is not const.
11046 * data/glr.c: b4_filename -> b4_file_name.
11047 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
11049 (class position): filename -> file_name. All uses changed.
11050 * data/yacc.c: b4_filename -> b4_file_name.
11051 * lib/bitset.h: filename -> file_name in local vars.
11052 * lib/bitset_stats.c: Likewise.
11053 * src/files.c: Likewise.
11054 * src/scan-skel.l ("@output ".*\n): Likewise.
11055 * src/files.c (file_name_split): Renamed from filename_split.
11056 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
11058 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
11060 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
11061 to accommodate latest gnulib.
11063 * tests/glr-regression.at (Duplicate representation of merged trees):
11064 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
11066 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
11069 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
11071 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
11072 All uses changed. Invoke user destructor after an error during a
11073 split parse (trivial change from Joel E. Denny).
11075 * tests/glr-regression.at
11076 (User destructor after an error during a split parse): New test case.
11077 Problem reported by Joel E. Denny in:
11078 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
11080 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
11082 * README-cvs: Give URLs for recommended tools.
11083 Mention Gzip version problem, and bootstrapping issues.
11084 Remove troubleshooting section, as it's somewhat obsolete.
11086 * bootstrap (no_cache): New var, to accommodate different wget
11087 variants. Use it instead of '-C off'. Problem reported by
11090 * data/glr.c (yydestroyStackItem): New function.
11091 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
11092 debugging information. Problem reported by Joel E. Denny.
11094 2005-08-25 Akim Demaille <akim@epita.fr>
11096 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
11098 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
11100 * data/glr.c (yyrecoverSyntaxError, yyreturn):
11101 Don't invoke destructor on unresolved entries.
11102 * tests/glr-regression.at
11103 (User destructor for unresolved GLR semantic value): New test case.
11104 Problem reported by Joel E. Denny in:
11105 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
11107 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
11109 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
11111 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
11112 lib-prefix.m4, po.m4.
11114 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
11115 in yydestruct diagnostic, since it might not be an error.
11116 Problem reported by Joel Denny near end of
11117 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
11118 * data/lalr1.cc (yyerturn): Likewise.
11119 * data/yacc.c (yyreturn): Likewise.
11120 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
11122 * src/files.c: Remove obsolete FIXME comment.
11124 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
11125 with the other templates, and to fix bogus run-on messages such
11126 as the one reported at the end of
11127 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
11128 All callers changed to avoid the newline.
11129 (yyprocessOneStack): Output two lines rather than one, to accommodate
11130 the above change. This changes the debug output format slightly.
11132 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
11133 reported by Joel E. Denny in
11134 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
11136 * tests/glr-regression.at (Duplicate representation of merged trees):
11137 New test, from Joel E. Denny in:
11138 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
11139 * THANKS: Add Joel E. Denny.
11141 * configure.ac (AC_INIT): Bump to 2.0c.
11143 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
11145 * NEWS: Version 2.0b.
11147 * Makefile.am (SUBDIRS): Put examples before tests, so that
11148 "make check" doesn't finish with "All 1 tests passed".
11150 * tests/regression.at (Token definitions): Don't rely on
11151 AT_PARSER_CHECK for data that contains backslashes. It currently
11152 uses 'echo', and 'echo' isn't portable if its argument contains
11153 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
11154 that the byte '\0xff' is not printable in the C locale; it is,
11155 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
11156 not printable, so use '\0x81' to test.
11158 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
11159 version of GCC, since the macro is used with non-GCC compilers.
11161 Fix core dump reported by Pablo De Napoli in
11162 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
11163 * tests/regression.at (Invalid inputs with {}): New test.
11164 * src/parse-gram.y (token_name): Translate type before using
11167 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
11168 the user's name space. All uses changed to __attribute__
11170 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
11171 Add __attribute__ ((__noreturn__)).
11173 * etc/clcommit: Remove. We weren't using it, and it failed
11174 "make maintainer-distcheck".
11175 * Makefile.maint: Merge from coreutils.
11176 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
11177 (syntax-check-rules): Change list of rules as described below.
11178 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
11179 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
11180 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
11181 (sc_trailing_space): New rules.
11182 (sc_xalloc_h_in_src): Remove.
11183 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
11184 (sc_space_tab, sc_error_exit_success, sc_changelog):
11185 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
11186 (makefile-check, po-check, author_mark_check):
11187 (makefile_path_separator_check, copyright-check):
11188 Use grep -n, to make it easier to find violations.
11189 Use CVS_LIST and CVS_LIST_EXCEPT.
11190 (header_regexp, h_re): Remove.
11192 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
11193 (my-distcheck): Use more-modern GCC flags.
11194 (signatures, %.asc): Remove.
11195 (rel-files, announcement): Remove signatures.
11196 Restore old updating code, even though we don't use it, so
11197 that we're the same as coreutils.
11198 (alpha, beta, major): Depend on news-date-check.
11199 Make the upload commands.
11201 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
11202 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
11203 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
11204 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
11205 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
11206 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
11207 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
11208 * tests/sets.at: Likewise.
11210 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
11211 we comment out the Autoconf version number.
11212 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
11213 it's error-prone and "make maintainer-distcheck" rejects it.
11215 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
11216 Indent calls to "error" to pacify "make maintainer-distcheck",
11217 when the calls are not intended to be translated.
11218 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
11220 * src/Makefile.am (DEFS): Use +=, to pacify
11221 "make maintainer-distcheck".
11222 (bison_SOURCES): Add scan-skel.h.
11223 (sc_tight_scope): New rule, from coreutils.
11225 * src/files.c (src_extension, header_extension):
11226 Now static, not extern.
11227 * src/getargs.c (short_options): Likewise.
11228 * src/muscle_tab.c (muscle_table): Likewise.
11229 * src/parse-gram.y (current_class, current_type, current_prec):
11231 * src/reader.c (grammar_end, previous_rule_end): Likewise.
11232 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
11233 * src/main.c (main): Cast bindtextdomain and textdomain calls to
11234 void, to avoid warning when NLS is disabled.
11235 * src/output.c: Include scan-skel.h.
11236 (scan_skel): Remove decl, since scan-skel.h does this.
11238 Indent calls to "error" to pacify "make maintainer-distcheck".
11239 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
11240 * src/reader.h (gram_end, gram_lineno): New decls to pacify
11241 "make maintainer-distcheck".
11242 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
11243 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
11244 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
11245 (skel_lex_destroy, scan_skel): Move these decls to...
11246 * src/scan-skel.h: New file.
11247 * src/uniqstr.c (uniqstr_assert):
11248 Indent calls to "error" to pacify "make maintainer-distcheck".
11250 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
11253 * tests/torture.at: Revamp to avoid misuse of atoi that
11254 "make maintainer-distcheck" complained about.
11256 * examples/extexi (message): Don't print a message more than once,
11257 and omit line-number decoration that makes Emacs compile think
11258 that informative messages are worth worrying about.
11260 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
11262 * configure.ac: Update version number.
11264 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
11266 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
11267 autogenerated by the maintainer.
11268 * examples/calc++/.cvsignore: Add *.yy.
11270 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
11271 * lib/bitset_stats.c (bitset_stats_init): Likewise.
11272 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11274 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
11276 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
11277 from maintainer-distcheck about casting the argument of 'free'.
11279 * NEWS: Mention recent yytname changes.
11280 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
11282 * bootstrap: For translations that have not yet been upgraded to
11283 the new runtime-po domain, prime the pump by extracting the
11284 relevant strings from the obsolete translations. This code can be
11285 removed once the bison-runtime domain has been translated by each
11288 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
11289 now that token names are already quoted.
11291 Fix problem reported by Anthony Heading.
11292 * data/glr.c (YYTOKEN_TABLE): New macro.
11293 (yytname): Define if YYTOKEN_TABLE.
11294 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
11295 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
11296 (YYERROR_VERBOSE): Define the same way the other skeletons do.
11297 * src/output.c (prepare_symbols): Output token_table_flag.
11299 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
11301 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
11302 again if the first call fails.
11304 * data/glr.c (yytnamerr): New function.
11305 (yyreportSyntaxError): Use it to dequote most string literals.
11306 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
11307 with other skeletons. All uses changed.
11308 (yytnameerr_): New function.
11309 (yyreport_syntax_error): Use it to dequote most string literals.
11310 * data/yacc.c (yytnamerr): New function.
11311 (yyerrlab): Use it to decode most string literals.
11312 * doc/bison.texinfo (Decl Summary, Calling Convention):
11313 Clarify quoting convention of yytname.
11314 * src/output.c (prepare_symbols): Quote all names. This undoes
11315 the 2005-04-17 change, which is now accomplished (mostly) via
11316 changes in the parsers as described above.
11317 * tests/regression.at (Token definitions, Web2c Actions):
11318 Undo most 2005-04-17 change here, too.
11320 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
11322 Fix more problems reported by twlevo@xs4all.nl.
11323 * tests/cxx-type.at: Don't pipe output of ./types through sed to
11324 remove trailing spaces. This loses the exit status of ./types,
11325 and isn't needed since ./types shouldn't be emitting trailing
11327 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
11328 as the stack isn't valid in that case.
11330 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
11331 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
11332 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
11333 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
11335 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
11336 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
11337 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
11340 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
11341 overly-picky compilers that reject 'char *foo = "bar";'.
11343 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
11344 to FILE * parameter, not to stderr. This fixes a typo introduced
11345 in the 2005-07-12 change.
11347 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
11348 warnings from GCC 4.
11350 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
11351 (yyglrShiftDefer, yysplitStack):
11352 Remove unused parameters b4_pure_formals. All uses changed.
11353 (yyglrShift): Remove unused parameters b4_user_formals.
11355 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
11357 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
11359 Destructor cleanups and regularization among the three skeletons.
11360 * NEWS: Document the behavior changes.
11361 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
11362 stack before failing, as the cleanup code will do it for us now.
11363 * data/lalr1.cc (yyerrlab): Likewise.
11364 * data/glr.c (yyparse): Pop everything off the stack before
11365 freeing it, so that destructors get called properly.
11366 * data/lalr1.cc (yyreturn): Likewise.
11367 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
11368 This is more consistent.
11369 * doc/bison.texinfo (Destructor Decl): Mention more reasons
11370 why destructors might be called. 1.875 -> 2.1.
11371 (Destructor Decl, Decl Summary, Table of Symbols):
11372 Some English-language cleanups for %destructor.
11373 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11374 Add output line for destructor of start symbol.
11375 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
11376 because of that same extra output line.
11378 * NEWS: Document minor wording changes in diagnostics of
11379 Bison-generated parsers.
11380 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
11381 Remove unused formals. All uses changed.
11382 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
11383 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
11384 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
11385 Rename yyoverflowab to yyexhaustedlab.
11386 When memory exhaustion occurs during syntax-error reporting,
11387 report it separately rather than in a single diagnostic; this
11389 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
11390 (Memory Exhausted): Renamed from Parser Stack Overflow.
11391 Revamp wording slightly to prefer "memory exhaustion".
11392 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
11394 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
11396 Add i18n support to the GLR skeleton. Partially fix the C++
11397 skeleton; a C++ expert needs to finish this. Remove debugging
11398 msgids; there's little point to having them translated, since they
11399 can be understood only by someone who can read the
11400 (English-language) source code.
11402 Generate runtime-po/bison-runtime.pot automatically, so that we
11403 don't have to worry about garbage getting in that file. We'll
11404 make sure after the next official release that old msgids don't
11406 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
11408 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
11409 Now auto-generated.
11410 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
11411 Fix typos in explanations of the runtime file.
11412 * bootstrap: Change gettext keyword from YYI18N to YY_.
11413 Use standard Makefile.in.in in runtime-po, since we'll arrange
11414 for backward-compatible bison-runtime.po files in a different way.
11415 * data/glr.c (YY_): New macro, from yacc.c.
11416 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
11417 Translate messages intended for users.
11418 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
11419 the wording in the other skeletons. We don't know that the memory
11421 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
11422 Use same method that yacc.c uses.
11423 Don't translate debugging messages.
11424 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
11425 it doesn't work (yet), and requires C++ expertise to fix.
11426 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
11427 Move defn to a more logical place, to be consistent with other
11429 Don't translate debugging messages.
11430 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
11431 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
11432 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
11433 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
11435 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
11436 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
11438 * tests/glr-regression.at (Badly Collapsed GLR States):
11440 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
11441 yylex should return 0 at EOF rather than aborting.
11443 Improve tests for stack overflow in GLR parser.
11444 Problem reported by twlevo@xs4all.nl.
11445 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
11447 (yyStackOverflow): Just longjmp, but with value 2 so that caller
11448 can handle the problem.
11449 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
11450 (yyparse): New local variable yyresult to record the result.
11451 Use result of setjmp to set it, rather than storing itinto
11453 (yyDone): Remove label.
11454 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
11455 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
11456 if YYABORT is used).
11457 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
11458 yyparse status; put status > 1 into diagnostic.
11459 Check that status==2 works.
11460 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
11461 Use exit status 3 for failure to open (which shouldn't happen).
11463 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
11465 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
11466 1 on syntax error; just let yyparse do its thing.
11467 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
11468 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
11469 (Exploding the Stack Size with Alloca):
11470 (Exploding the Stack Size with Malloc):
11471 Expect exit status 2, not 1, since the parser is supposed to blow
11472 its stack. Problem reported by twlevo@xs4all.nl.
11474 * data/glr.c (yyparse): Don't assume that the initial calls
11475 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
11476 Print a stack-overflow message and fail instead.
11477 Initialize the line-number information before creating the stack,
11478 so that the stack-overflow message can report line zero safely.
11480 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
11482 Fix problems reported by twlevo@xs4all.nl.
11483 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
11484 (yyuserMerge): Provide a default case if b4_mergers is empty.
11485 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
11486 * tests/glr-regression.at
11487 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
11488 Add casts to pacify C++ compilers.
11489 * tests/glr-regression.at (Improper merging of GLR delayed action
11490 sets): Declare yylex before using it.
11491 * tests/Makefile.am (maintainer-check-g++): Fix a stray
11492 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
11493 test for valgrind; valgrind is independent of g++.
11494 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
11495 for compatibility with POSIX 1003.1-2001 (if running coreutils).
11496 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
11497 Use a destructor, so that we can expand the stack. Change
11498 YYSTYPE to char * so that we can free it. Cast result of malloc.
11500 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11502 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
11503 a valgrind failure. Problem reported by twlevo@xs4all.nl.
11505 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
11507 * PACKAGING: New file, suggested by Bruno Haible and taken from
11508 similar wording in gettext's PACKAGING file.
11509 * NEWS: Mention PACKAGING.
11510 * Makefile.am (EXTRA_DIST): Add PACKAGING.
11512 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
11514 * NEWS: Document recent i18n improvements.
11515 * bootstrap: Get runtime translations into runtime-po.
11516 Create runtime-po files automatically, if possible.
11517 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
11518 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
11519 does not infringe on the user's name space.
11520 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
11521 * doc/bison.texinfo (Internationalization): Revamp the English
11522 and Texinfo syntax a bit, to try to make it clearer.
11523 (Bison Options, Option Cross Key): Mention --print-localedir.
11524 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
11525 YYENABLE_NLS. Quote a bit more.
11526 * runtime-po/.cvsignore: New file.
11527 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
11528 * runtime-po/Rules-quot: Remove; now created by bootstrap.
11529 * runtime-po/quot.sed: Likewise.
11530 * runtime-po/boldquot.sed: Likewise.
11531 * runtime-po/en@quot.header: Likewise.
11532 * runtime-po/en@boldquot.header: Likewise.
11533 * runtime-po/insert-header.sin: Likewise.
11534 * runtime-po/remove-potcdate.sin: Likewise.
11535 * runtime-po/Makevars: Likewise.
11536 * runtime-po/LINGUAS: Likewise.
11537 * runtime-po/de.po: Likewise; we will rely on the translation project
11538 to maintain this, so "bootstrap" should get it.
11539 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
11541 * src/main.c (main): Bind the bison-runtime domain, too.
11543 2005-07-12 Bruno Haible <bruno@clisp.org>
11545 * data/yacc.c: Include <libintl.h> when NLS is enabled.
11546 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
11547 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
11548 * runtime-po: New directory.
11549 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
11550 $(DOMAIN).pot-update rule, so that old messages are never dropped.
11551 * runtime-po/Rules-quot: New file, copied from po/.
11552 * runtime-po/quot.sed: Likewise.
11553 * runtime-po/boldquot.sed: Likewise.
11554 * runtime-po/en@quot.header: Likewise.
11555 * runtime-po/en@boldquot.header: Likewise.
11556 * runtime-po/insert-header.sin: Likewise.
11557 * runtime-po/remove-potcdate.sin: Likewise.
11558 * runtime-po/Makevars: New file.
11559 * runtime-po/POTFILES.in: New file.
11560 * runtime-po/LINGUAS: New file.
11561 * runtime-po/bison-runtime.pot: New file.
11562 * runtime-po/de.po: New file.
11563 * m4/bison.m4: New file.
11564 * Makefile.am (SUBDIRS): Add runtime-po.
11565 (aclocaldir, aclocal_DATA): New variables.
11566 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
11568 * src/getargs.c (usage): Document --print-localedir option.
11569 (PRINT_LOCALEDIR_OPTION): New enum item.
11570 (long_options): Add --print-localedir option.
11571 (getargs): Handle --print-localedir option.
11572 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
11573 (Internationalization): New section.
11575 2005-07-12 Akim Demaille <akim@epita.fr>
11577 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
11578 for consistency with the rest of the code.
11579 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
11582 2005-07-12 Akim Demaille <akim@epita.fr>
11584 * src/parse-gram.y: Use %printer instead of YYPRINT.
11586 2005-07-12 Akim Demaille <akim@epita.fr>
11588 * src/symtab.h, src/symtab.c (symbol_print): New.
11589 * src/symlist.h, src/symlist.c (symbol_list_print): New.
11590 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
11592 2005-07-12 Akim Demaille <akim@epita.fr>
11594 * data/glr.c (b4_syncline): Fix (swap) the definitions of
11595 b4_at_dollar and b4_dollar_dollar.
11597 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
11599 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
11600 and Pennello's paper.
11602 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
11604 * data/yacc.c (yyparse): Undo previous patch. Instead,
11605 set yylsp[0] and yyvsp[0] only if the initial action
11606 sets yylloc and yylval, respectively.
11608 * data/yacc.c (yyparse): In the initial action, set
11609 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
11610 This avoids the use of undefined variables if the initial
11611 action does not set yylloc and/or yylval.
11613 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
11615 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
11616 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
11617 Remove from CVS. These files are automatically generated.
11618 * examples/extexi: Clarify that this file is now part of Bison,
11619 not GNU M4, and that it works with any POSIX-compatible Awk.
11620 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
11621 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
11622 so that we also get calc++-parser.yy. Geneate it.
11623 Use $(AWK), not gawk, since any conforming Awk will do.
11624 Put comment before action, since older 'make' can't handle comment
11626 $(BUILT_SOURCES): List all built sources, not just some of them.
11627 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
11628 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
11629 $($(calc_sources_generated)): Remove unnecessary test for existence
11630 of target. (This had a shell syntax error anyway; a stray "x".)
11631 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
11633 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
11635 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
11636 implied by the other modules.
11638 2005-07-06 Akim Demaille <akim@epita.fr>
11640 Bind examples/calc++ to the package.
11641 * examples/calc++/Makefile: Remove, replaced by...
11642 * examples/calc++/Makefile.am: ... this new file.
11643 * examples/calc++/test: Remove input.
11644 * examples/calc++/compile: Remove.
11645 * examples/Makefile.am: New.
11646 * configure.ac, Makefile.am: Adjust.
11647 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
11649 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
11651 * data/glr.c (yyFail): Drastically simplify; since the format argument
11652 never had any % directives, we can simply pass it to yyerror.
11653 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
11654 be modified later, as that is the usual style in glr.c.
11655 Problems reported by Paul Hilfinger.
11657 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
11658 and size overflow errors.
11659 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
11660 in case the user prolog sets feature-test macros like _GNU_SOURCE.
11661 (YYSIZEMAX): New macro.
11662 (yystpcpy): New function, taken from yacc.c.
11663 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
11664 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
11665 so that we don't have to maintain their signatures.
11666 (yyFail): Check for buffer overflow, by using vsnprintf rather
11667 than vsprintf. Allocate a bigger buffer if possible.
11668 Report an error if buffer allocation fails.
11669 (yyStackOverflow): New function.
11670 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
11671 the initialization was successful. It might fail if storage was
11673 (yyexpandGLRStack): Add more checks for storage allocation failure.
11674 Use yyStackOverflow to report failures.
11675 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
11676 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
11677 Don't assume stack number fits in int.
11678 (yysplitStack): Check for storage allocation failure.
11679 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
11680 can print diagnostics on storage allocation failure. All callers
11682 (yyresolveValue): Use yybool for boolean.
11683 (yyreportSyntaxError): Check for size-calculation overflow.
11684 This code is taken from yacc.c.
11685 (yyparse): Check for storage allocation errors when allocating
11688 2005-07-05 Akim Demaille <akim@epita.fr>
11690 Extract calc++ from the documentation.
11691 * doc/bison.texinfo (Calc++): Add the extraction marks.
11692 * examples/extexi: New, from the aborted GNU Programming 2E.
11693 Separate the different paragraph of a file with empty lines.
11694 * examples/Makefile: Use it to extract the whole calc++ example.
11696 2005-06-24 Akim Demaille <akim@epita.fr>
11698 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
11701 2005-06-22 Akim Demaille <akim@epita.fr>
11703 * doc/bison.texinfo (C++ Language Interface): First stab.
11704 (C++ Parsers): Remove.
11706 2005-06-22 Akim Demaille <akim@epita.fr>
11708 * data/lalr1.cc (yylex_): Honor %lex-param.
11710 2005-06-22 Akim Demaille <akim@epita.fr>
11712 Start a set of simple examples.
11713 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
11714 * examples/calc++/calc++-driver.hh,
11715 * examples/calc++/calc++-parser.yy,
11716 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
11717 * examples/calc++/compile, examples/calc++/test: New.
11719 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
11721 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
11722 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
11723 which stems from the 2005-05-27 patch.
11725 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11727 * data/glr.c: Modify treatment of unused parameters to permit use
11728 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
11730 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
11732 Fix infringement on user name space reported by Janos Zoltan Szabo.
11733 * data/yacc.c (yyparse): strlen -> yystrlen.
11735 2005-05-30 Akim Demaille <akim@epita.fr>
11737 * data/lalr1.cc (_): New.
11738 Translate the various messages.
11740 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
11742 Fix infringement on user name space reported by Bruno Haible.
11743 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
11744 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
11745 the user's name space.
11746 (alloca): Include <stdlib.h> to get it, if it's not built in.
11747 (YYMALLOC, YYFREE): Define only if needed.
11748 (malloc, free): Declare, but only if needed, as this infringes on
11749 the user name space.
11751 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
11753 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
11754 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
11756 * lib/ebitset.c (min, max): Undef before defining.
11757 * lib/vbitset.c (min, max): Likewise.
11758 * lib/subpipe.c (create_subpipe): Save local variables in case
11759 vfork clobbers them.
11761 2005-05-24 Bruno Haible <bruno@clisp.org>
11763 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
11764 error message syntax used by gcc-4.0.
11766 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
11768 * README: Mention m4 1.4.3. Remove obsolete advice about
11769 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
11771 * bootstrap: Remove workaround for problem I encountered with
11772 gettext 0.14.1; it seems to be fixed now.
11774 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
11776 * NEWS: Version 2.0a.
11778 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
11779 the previous change.
11781 Various maintainer cleanups.
11782 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
11783 conftest*, for benefit of CVS commands run at the same time as
11784 "configure". Add build-aux, since "bootstrap" now creates it and
11786 * Makefile.cfg (move_if_change): Remove.
11787 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
11788 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
11789 (po_repo, do-po-update, po-update, wget_files, get-targets):
11790 (config.guess-url_prefix, config.sub-url_prefix):
11791 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
11792 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
11793 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
11795 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
11796 this is now the recommended name.
11797 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
11798 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
11799 ylwrap. These files now go into build-aux.
11800 * config/move-if-change: Remove.
11801 * config/prev-version.txt: Bump from 1.75 to 2.0.
11803 * bootstrap: Add stdio-safer, unistd-safer modules.
11804 Remove m4/glibc2.m4 (introduced by latest gnulib, but
11806 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
11807 fopen-safer.c, stdio-safer.h, unistd-safer.h.
11808 * lib/subpipe.c: Include "unistd-safer.h".
11809 (create_subpipe): Make sure all the newly-created
11810 file descriptors are > 2, so that diagnostics don't
11811 get sent down them (which might cause Bison to hang, in theory).
11812 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
11813 * src/files.c (xfopen): Use fopen_safer, not fopen.
11815 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
11816 yesterday's yacc.c fix.
11818 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
11820 * data/glr.c, data/lalr1.cc: Update copyright date.
11822 Fix a destructor bug reported by Wolfgang Spraul in
11823 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
11824 * data/yacc.c (yyabortlab): Don't call destructor, and
11825 don't set yychar to EMPTY.
11826 (yyoverflowlab): Don't call destructor.
11827 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
11828 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
11829 since we no longer output the message "discarding lookahead token
11832 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11834 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
11835 fix a small glitch in debugging output.
11836 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
11837 after YY_SYMBOL_PRINT where needed.
11839 (struct yyGLRState): Add some comments.
11840 (struct yySemanticOption): Add some comments.
11841 (union yyGLRStackItem): Add comment.
11843 (yymergeOptionSets): Correct this to properly perform the union,
11844 avoiding infinite reported by Michael Rosien.
11847 * tests/glr-regression.at: Add test for GLR merging error reported
11850 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
11852 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
11853 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
11854 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
11855 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
11856 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
11857 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
11858 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
11859 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
11860 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
11861 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
11862 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
11863 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
11864 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
11865 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
11866 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
11867 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
11868 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
11869 src/derives.h, src/files.c, src/files.h, src/getargs.c,
11870 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
11871 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
11872 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
11873 src/output.h, src/parse-gram.c, src/parse-gram.h,
11874 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
11875 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
11876 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
11877 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
11878 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
11879 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
11880 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
11881 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
11882 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
11883 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
11884 tests/reduce.at, tests/regression.at, tests/sets.at,
11885 tests/synclines.at, tests/testsuite.at, tests/torture.at:
11886 Update FSF postal mail address.
11888 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
11890 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
11891 Problem reported by Ralf Menzel.
11893 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
11895 * tests/actions.at: Test that stack overflow invokes destructors.
11896 From Marcus Holland-Moritz.
11897 * data/yacc.c (yyerrlab): Move the code that destroys the stack
11899 (yyreturn): to here. That way, destructors are called properly
11900 even if the stack overflows, or the user calls YYACCEPT or
11901 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
11902 (yyoverflowlab): Destroy the lookahead.
11904 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
11906 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
11908 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
11910 * NEWS: Bison-generated C parsers no longer quote literal strings
11911 associated with tokens.
11912 * src/output.c (prepare_symbols): Don't escape strings,
11913 since users don't want to see C escapes.
11914 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
11916 * tests/input.at (Torturing the Scanner): Likewise.
11917 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
11919 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
11921 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
11922 the data size is known to be too small and we can't increase it.
11923 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
11925 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
11927 * src/parse-gram.y: Include quotearg.h.
11928 (string_as_id): Quote $1 before using it as a key, since the
11929 lexer no longer quotes it for us.
11930 (string_content): Don't strip quotes, since lexer no longer
11932 * src/scan-gram.l: Include quotearg.h.
11933 ("\""): Omit quote.
11934 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
11935 a key, since the rest of the lexer doesn't quote it.
11936 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
11937 * tests/regression.at (Token definitions): Check for backslashes
11940 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
11941 (YYSIZE_T): Define to unsigned long int when using an older compiler.
11942 (yyparse): Revamp code to generate long syntax error message, to
11943 make it easier to translate, and to avoid problems with arithmetic
11944 overflow. Change "virtual memory" to "memory" in diagnostic, since
11945 we don't know whether the memory is virtual.
11947 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
11949 * NEWS: Bison-generated C parsers now use the _ macro to
11951 * data/yacc.c (_) [!defined _]: New macro.
11952 All English strings wrapped inside this macro.
11953 * doc/bison.texinfo (Bison Parser): Document _.
11954 * po/POTFILES.in: Include src/parse-gram.c, since it now
11955 includes translateable strings that parse-gram.y doesn't.
11957 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
11959 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
11960 reverting the 2004-10-11 change to this function.
11961 (symbol_check_alias_consistency): Don't call symbol_type_set
11962 if the type name is already correct.
11963 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
11965 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
11967 * tests/regression.at (Token definitions): Don't use a token named
11968 c, as that generates a "#define c ..." that runs afoul of buggy
11969 stdlib.h that uses the identifier c as a member of struct
11970 drand48_data. Problem reported by Horst Wente.
11972 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
11974 * bootstrap: Change translation URL from
11975 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
11976 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
11977 redirection glitches. Problem reported by twlevo@xs4all.nl.
11979 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
11981 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
11982 after operands; POSIX says this isn't portable for the c99 command.
11984 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
11986 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
11987 immediately if a data overrun has occurred; this may help us track
11988 down what may be a spurious failure on MacOS.
11990 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
11992 Respond to problems reported by twlevo@xs4all.nl.
11994 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
11996 * src/vcg.h: Comment fix.
11997 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
11998 (G_CMAX): Change to -1 instead of INT_MAX.
12000 * data/yacc.c (yyparse): Omit spaces before #line.
12002 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
12004 * src/tables.c (state_number_to_vector_number): Put it inside an
12005 "#if 0", since it's not currently used. Problem reported by
12008 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
12010 * src/output.c (escaped_output): Renamed from
12011 escaped_file_name_output, since we now use it for symbol tags as
12012 well. All uses changed.
12013 (symbol_destructors_output, symbol_printers_output):
12014 Escape symbol tags too.
12015 Problem reported by Matyas Forstner in
12016 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
12018 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
12020 * src/output.c (user_actions_output, token_definitions_output,
12021 symbol_destructors_output, symbol_printers_output): Likewise.
12022 * src/reader.c (prologue_augment): Likewise.
12023 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
12025 * src/vcg.c (output_edge): Don't quote linestyle arg.
12026 Problem reported by twlevo@xs4all.nl.
12028 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
12030 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
12031 example, reported by Derek M Jones. Also, make the example even
12032 more outrageous, to better illustrate how bad the problem is.
12034 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
12036 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
12037 putsym. Typo reported by Sebastian Piping.
12039 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
12041 * doc/bison.texinfo (Language and Grammar): some -> same
12042 (Epilogue): int he -> in the
12043 Typos reported by Sebastian Piping via Justin Pence.
12045 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
12047 * tests/glr-regression.at (Improper handling of embedded actions
12048 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
12049 embedded actions and $-N in GLR parsers", work around an Autoconf bug
12050 with dollar signs in test names.
12051 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
12052 for a similar reason.
12054 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
12056 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
12057 wants to redefine G_VIEW.
12059 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
12061 * src/vcg.c (get_view_str): Remove case for normal_view.
12062 Problem reported by twlevo@xs4all.nl.
12064 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
12066 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
12067 Problem reported by twlevo@xs4all.nl.
12069 * doc/bison.texinfo: Change @dircategory from "GNU programming
12070 tools" to "Software development". Requested by Richard Stallman
12073 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
12075 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
12076 Problem reported by twlevo@xs4all.nl.
12078 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
12080 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
12081 keyword; it's not needed with modern compilers, and it doesn't
12082 affect correctness with older compilers. Suggested by
12085 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
12087 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
12088 gcc -Wswitch-default.
12089 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
12090 * data/yacc.c (yyparse): Likewise.
12092 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
12094 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
12095 already. Let config.h define any nonstandard values.
12097 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
12099 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
12100 for the benefit of slower hosts. Problem reported by
12101 Nelson H. F. Beebe.
12103 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
12105 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
12106 being defined and not used.
12107 * data/lalr1.cc (yyparse): Likewise.
12108 Use "if (false)" rather than "if (0)".
12110 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
12112 * TODO: Mention that we should allow NUL bytes in tokens.
12114 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
12116 * src/scan-skel.l (<<EOF>>): Don't close standard output.
12117 Problem reported by Hans Aberg.
12119 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
12121 * src/getargs.c (version): Happy new year; update overall
12122 program copyright date from 2004 to 2005.
12124 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
12125 Problem reported by Hans Aberg.
12126 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
12127 (Output file names.): Add a test for the case when standard output
12130 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
12132 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
12133 to fix an oversight in the Bison 2.0 manual.
12135 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
12137 * NEWS: Version 2.0. Reformat the existing news items since
12138 1.875, so that related items are grouped together.
12139 * configure.ac (AC_INIT): Bump version to 2.0.
12140 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
12142 * tests/torture.at (Exploding the Stack Size with Alloca): Set
12143 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
12144 otherwise, we're not testing alloca. Unfortunately there's no
12145 simple way to consult HAVE_ALLOCA here.
12147 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
12150 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
12151 hand. This avoids a warning about comparing int to size_t when
12152 GCC warnings are enabled.
12154 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
12156 * NEWS: Bison-generated parsers no longer default to using the
12157 alloca function (when available) to extend the parser stack, due
12158 to widespread problems in unchecked stack-overflow detection.
12159 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
12160 responsibility to set it to a positive value. This lets the user
12161 specify a value that is not a preprocessor constant.
12162 * data/yacc.c (YYMAXDEPTH): Likewise.
12163 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
12164 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
12165 to be a compile-time constant. However, explain the constraints on it.
12166 Also, explain the constraints on YYINITDEPTH.
12167 (Table of Symbols): Explain that alloca is no longer the default.
12168 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
12171 * doc/bison.texinfo (Location Default Action): Mention that n must
12172 be zero when k is zero. Suggested by Frank Heckenbach.
12174 2004-12-22 Akim Demaille <akim@epita.fr>
12176 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
12177 (parser::state_type, parser::semantic_type, parser::location_type):
12178 Private, not public.
12179 (parser::parse): Return ints, not bool.
12180 Returning a bool introduces a problem: 0 corresponds to false, and
12181 it seems weird to return false on success. Returning true changes
12182 the conventions for yyparse.
12183 Alternatively we could return void and send an exception.
12184 There is no clear consensus (yet?).
12185 (state_stack, semantic_stack, location_stack): Rename as...
12186 (state_stack_type, semantic_stack_type, location_stack_type): these.
12187 Private, not public.
12188 * tests/c++.at: New.
12189 * tests/testsuite.at, tests/Makefile.am: Adjust.
12191 2004-12-21 Akim Demaille <akim@epita.fr>
12193 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
12195 2004-12-21 Akim Demaille <akim@epita.fr>
12197 Don't impose std::string for filenames.
12199 * data/lalr1.cc (b4_filename_type): New.
12200 (position::filename): Use it.
12201 (parser.hh): Move the inclusion of stack.hh and location.hh below
12202 the user code, so that needed headers for the filename type can be
12204 Forward declare them before the user code.
12205 * tests/Makefile.am (check-local, installcheck-local): Pass
12206 TESTSUITEFLAGS to the TESTSUITE.
12208 2004-12-20 Akim Demaille <akim@epita.fr>
12210 Use more STL like names: my_class instead of MyClass.
12212 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
12213 (SemanticStack, SemanticType, StateStack, StateType)
12214 (TokenNumberType, Stack, Slice, Traits, Parser::location)
12215 (Parser::value): Rename as...
12216 (location_stack, location_type, rhs_number_type, semantic_stack)
12217 (semantic_type, state_stack, state_type, token_number_type, stack)
12218 (slice, traits, parser::yylloc, parser::yylval): these.
12220 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
12222 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
12224 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
12225 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
12227 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
12229 Remove uses of 'short int' and 'unsigned short int'. This raises
12230 some arbitrary limits. It uses more memory but nowadays that's
12231 not much of an issue.
12233 This change does not affect the generated parsers; that's a different
12234 task, as some users will want to conserve memory there.
12236 Ideally we should use size_t to represent all object counts, and
12237 something like ptrdiff_t to represent signed differences of object
12238 counts; but that will require more code-cleanup than I have the
12239 time to do right now.
12241 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
12242 Use size_t, not int or short int, to count objects.
12243 * src/closure.c (nritemset, closure): Likewise.
12244 * src/closure.h (nritemset, closure): Likewise.
12245 * src/nullable.c (nullable_compute): Likewise.
12246 * src/print.c (print_core): Likewise.
12247 * src/print_graph.c (print_core): Likewise.
12248 * src/state.c (state_compare, state_hash): Likewise.
12249 * src/state.h (struct state): Likewise.
12250 * src/tables.c (default_goto, goto_actions): Likewise.
12252 * src/gram.h (rule_number, rule): Use int, not short int.
12253 * src/output.c (prepare_rules): Likewise.
12254 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
12255 errs, reductions): Likewise.
12256 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
12258 * src/tables.c (vector_number, tally, action_number,
12259 ACTION_NUMBER_MINIMUM): Likewise.
12260 * src/output.c (muscle_insert_short_int_table): Remove.
12262 2004-12-17 Akim Demaille <akim@epita.fr>
12264 * data/lalr1.cc: Extensive Doxygenation.
12265 (error_): Rename as...
12266 (error): this, since it is visible to the user.
12268 (Parser::message): Now an automatic variable from...
12269 (Parser::yyreport_syntax_error_): here.
12270 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
12272 * tests/input.at: Escape $.
12274 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
12276 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
12277 Parenthesize rhs to avoid obscure problems with mistakes like
12278 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
12279 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12280 b4_rhs_location): Likewise.
12281 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12282 b4_rhs_location): Likewise.
12284 2004-12-16 Akim Demaille <akim@epita.fr>
12286 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
12287 yacc.c: be sure to stay within yycheck_.
12288 * tests/actions.at: Re-enable C++ tests.
12290 2004-12-16 Akim Demaille <akim@epita.fr>
12292 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
12295 2004-12-16 Akim Demaille <akim@epita.fr>
12297 Use #define to handle the %name-prefix.
12299 * data/glr.c, data/yacc.c: Comment changes.
12300 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
12301 so that one can refer to yylex in the parser file, and have it
12302 renamed, as is the case with other skeletons.
12304 2004-12-16 Akim Demaille <akim@epita.fr>
12306 Move lalr1.cc internals into yy*.
12308 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
12309 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
12310 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
12311 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
12312 (empty_, final_, terror_, errcode_, ntokens_)
12313 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
12314 (looka_, ilooka_, error_range_, nerrs_):
12316 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
12317 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
12318 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
12319 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
12320 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
12321 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
12322 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
12323 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
12326 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
12328 Fix some problems reported by twlevo at xs4all.
12329 * src/symtab.c (symbol_new): Report an error if the input grammar
12330 contains too many symbols. This is better than calling abort() later.
12331 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
12332 (struct node, struct graph):
12333 Rename member expand to stretch. All uses changed.
12334 (struct graph): Remove member layoutalgorithm. All uses removed.
12335 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
12336 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
12338 (N_STRETCH): Rename from N_EXPAND. All uses changed.
12340 2004-12-15 Akim Demaille <akim@epita.fr>
12342 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
12343 Add more Doxygen comments.
12344 (symprint_, stack_print_, reduce_print_, destruct_, pop)
12345 (report_syntax_error_, translate_): Rename as...
12346 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
12347 (yypop_, yyreport_syntax_error_, yytranslate_): this.
12349 2004-12-15 Akim Demaille <akim@epita.fr>
12351 * data/lalr1.cc (lex_): Rename as...
12353 Move the trace here.
12354 Take the %name-prefix into account.
12355 Reported by Alexandre Duret-Lutz.
12357 2004-12-15 Akim Demaille <akim@epita.fr>
12359 Simplify the C++ parser constructor.
12361 * data/lalr1.cc (debug_): Rename as...
12362 (yydebug_): so that the parser's internals are always in the yy*
12365 (b4_parse_param_decl): Remove the leading comma as it is now only
12366 called as unique argument list.
12367 (Parser::Parser): Remove the constructor accepting a location and
12368 an initial debugging level.
12369 Remove from the other ctor the argument for the debugging level.
12370 (debug_level_type, debug_level, set_debug_level): New.
12372 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
12375 2004-12-15 Akim Demaille <akim@epita.fr>
12377 Remove b4_root related material: failure experiment
12378 (which goal was to allow to derive from a class).
12380 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
12381 definitions and uses.
12383 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
12385 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
12386 not 2, since it's not portable to subtract 1 from the start of an
12387 array. The new item 0 is never set or used. All uses changed.
12389 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
12390 the default definition of YYLLOC_DEFAULT. Problem reported
12391 by Frank Heckenbach.
12393 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
12395 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
12396 the normal case and one for the error case. Just use the
12397 first one uniformly. Problem reported by Frank Heckenbach.
12398 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
12399 use exactly the same macro in both places.
12400 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
12401 so that the normal-case YYRHSLOC works for the error case too.
12403 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
12404 (YYLLOC_DEFAULT): Use the same macro as glr.c.
12405 * doc/bison.texinfo (Location Default Action): Don't claim that
12406 we have an array of locations. Use the same macro for both glr
12407 and lalr parsers. Mention YYRHSLOC. Mention what happens when
12410 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
12412 * HACKING: Update email addresses to send announcements to.
12414 * configure.ac (AC_INIT): Bump version to 1.875f.
12416 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
12418 * NEWS: Version 1.875e.
12419 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
12421 * src/scan-skel.l: Include "complain.h", for "fatal".
12423 * src/relation.h (relation_print, relation_digraph):
12424 Relation sizes are of type relation_node, not size_t (this is
12425 merely a doc fix, since the two types are equivalent).
12426 (relation_transpose): Relation sizes are of type relation_node,
12428 * src/relation.c: Likewise.
12429 (top, infinity): Now of type relation_node, not int.
12430 (traverse, relation_transpose): Use relation_node, not int.
12432 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
12433 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
12434 (yyparse): Remove unused local introduced in 2004-10-25 patch.
12436 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
12437 specifying whether the test should be skipped. Use it tp
12438 specify that the [%defines %skeleton "lalr1.cc"] tests currently
12439 fail on some hosts, and should be skipped.
12441 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
12443 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
12444 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
12445 unless otherwise specified below.
12447 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
12448 to allocate kernel_base, kernel_items, kernel_size, since
12449 they needn't be initialized to 0.
12450 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
12451 * src/closure.c (new_closure): Likewise, for itemset.
12452 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
12453 * src/lalr.c (set_goto_map): Likewise, for temp_map.
12454 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
12455 (build_relations): Likewise for edge, states1, includes.
12456 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
12457 * src/reader.c (packgram): Likewise, for ritem, rules.
12458 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
12459 * src/relation.c (relation_digraph): Likewise for VERTICES.
12460 (relation_transpose): Likewise for new_R, end_R.
12461 * src/symtab.c (symbols_token_translations_init): Likewise for
12462 token_translations.
12463 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
12464 (token_actions): Likewise for yydefact, actrow, conflrow,
12466 (save_column): Likewise for froms[symno], tos[symno].
12467 (goto_actions): Likewise for state_count.
12468 (pack_table): Likewise for base, pos, check.
12469 (tables_generate): Likewise for width.
12471 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
12472 for initial core. Just have a separate core, so we needn't worry
12473 about whether kernel_size and kernel_base are initialized.
12475 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
12476 kernel_size, kernel_items): Remove unnecessary initialization.
12477 * src/conflicts.c (conflicts): Likewise.
12478 * src/derives.c (derives): Likewise.
12479 * src/muscle_tablc (muscle_insert): Likewise.
12480 * src/relation.c (relation_digraph): Likewise.
12481 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
12482 conflrow, conflict_table, conflict_list, table, check):
12485 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
12486 This is because all callers pass unsigned int.
12487 * src/closure.h (new_closure): Likewise.
12489 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
12490 (build_relations): Initialize includes[i] in all cases.
12491 * src/reader.c (packgram): Always initialize rules[ruleno].prec
12492 and rules[ruleno].precsym. Initialize members in order.
12493 * src/relation.c (relation_transpose): Always initialize new_R[i]
12495 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
12497 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
12498 conflict_list[0] was always 0, but now it isn't initialized.
12500 * src/table.c (table_grow): When conflict_table grew, the grown
12501 area wasn't cleared. Fix this.
12503 * lib/.cvsignore: Add strdup.c, strdup.h.
12504 * m4/.cvsignore: Add strdup.m4.
12506 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
12508 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
12509 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
12510 GOTO_NUMBER_MAXIMUM, since we occasionally compute
12511 ngotos + 1 without checking for overflow.
12512 (build_relations): Use END_NODE, not -1, to denote end of edges.
12513 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
12514 build_relations): Use goto_number, not int, for goto numbers.
12515 * src/tables.c (save_column, default_goto): Likewise.
12517 2004-11-23 Akim Demaille <akim@epita.fr>
12519 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
12520 of #defining from yystype.
12521 Don't typedef yystype, C++ does not need it.
12522 This lets it possible to forward declare it as union.
12524 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
12526 * bootstrap (gnulib_modules): Add extensions.
12527 Problem reported by Jim Meyering.
12529 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
12531 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
12532 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
12533 src/system.h, src/tables.c: XFREE -> free, to accommodate
12534 recent change to gnulib xalloc.h.
12535 Problem reported by Jim Meyering.
12537 2004-11-17 Akim Demaille <akim@epita.fr>
12539 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
12541 2004-11-17 Akim Demaille <akim@epita.fr>,
12542 Alexandre Duret-Lutz <adl@gnu.org>
12544 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
12546 (YYCDEBUG): Adjust.
12547 Use it instead of cdebug_.
12548 (Parser::debug_stream, Parser::set_debug_stream): New.
12549 (Parser::symprint_): Define cdebug_ for temporary backward
12551 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
12554 2004-11-17 Akim Demaille <akim@epita.fr>
12556 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
12557 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
12558 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
12559 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12561 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
12563 * data/glr.c (yyloc_default): Remove; not used.
12564 Problem reported by Frank Heckenbach.
12566 2004-10-25 Akim Demaille <akim@epita.fr>
12568 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
12569 Introduce another definition to address simple location arrays.
12570 (yyGLRStack): New member: yyerror_range.
12571 (yyrecoverSyntaxError, yyparse): Update it.
12572 (yyrecoverSyntaxError): Use it when shifting the error token to
12573 have an accurate range, equivalent to the one computed by both
12574 yacc.c and lalr1.cc.
12575 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
12576 that column numbers start at column 0, as per GNU Coding
12577 Standards, the others tests, and the doc.
12578 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
12579 Adjust to the above change (first column is 0).
12580 And adjust the location of the "<error>", now covering the whole
12583 2004-10-22 Akim Demaille <akim@epita.fr>
12584 and Paul Eggert <eggert@cs.ucla.edu>
12586 Remove some arbitrary limits on goto numbers and relations.
12587 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
12588 initial values, since they're never used.
12589 (set_goto_map): ngotos is now unsigned, so test for overflow
12590 by seeing whether it wraps around to zero.
12591 * src/lalr.h (goto_number): Now size_t, not short int.
12592 (GOTO_NUMBER_MAXIMUM): Remove.
12593 * src/relation.c (relation_print, traverse, relation_transpose):
12594 Check for END_NODE rather than looking at sign.
12595 * src/relation.h (END_NODE): New macro.
12596 (relation_node): Now size_t, not short int.
12598 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
12600 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
12601 keyword, not an identifier. Problem reported by Baron Schwartz in
12602 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
12604 2004-10-11 Akim Demaille <akim@epita.fr>
12606 * src/symtab.c (symbol_check_alias_consistency): Also check
12607 type names, destructors, and printers.
12608 Reported by Alexandre Duret-Lutz.
12609 Recode the handling of associativity and precedence in terms
12610 of symbol_precedence_set.
12611 Accept no redeclaration at all, not even equal to the previous
12613 (redeclaration): New.
12614 Use it to factor redeclaration complaints.
12615 (symbol_make_alias): Don't set the type of the alias, let
12616 symbol_check_alias_consistency do it as for other features.
12617 * src/symtab.h (symbol): Add new member prec_location, and
12619 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
12620 * tests/input.at (Incompatible Aliases): New.
12622 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
12624 .cvsignore fixes to accommodate gnulib changes,
12625 and the practice of naming build directories "_build".
12626 * .cvsignore: Add "_*". Sort.
12627 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
12628 * m4/.cvsignore: Add "*_gl.m4".
12630 2004-10-06 Akim Demaille <akim@epita.fr>
12632 * src/parse-gram.y (add_param): Fix the truncation of trailing
12635 2004-10-05 Akim Demaille <akim@epita.fr>
12637 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
12638 whether the reducion was empty or not. This leaves room to
12639 improve the use of YYLLOC_DEFAULT in such a case.
12640 lalr1.cc is still experimental, so changing this is acceptable.
12641 And finally, there are probably not many users who changed the
12642 handling of locations in GLR, so changing is admissible too.
12644 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
12645 empty reduction, set @$ to an empty location ending the previously
12647 Adjust uses to make sure the code is triggered on empty
12649 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
12650 expected output: empty reductions have empty locations.
12652 2004-09-29 Akim Demaille <akim@epita.fr>
12654 * data/lalr1.cc: Move towards a more standard C++ coding style
12655 for templates: Class < T > -> Class<T>.
12657 2004-09-29 Akim Demaille <akim@epita.fr>
12659 * data/lalr1.cc: Reinstall the former ctor, for sake of
12660 compatibility, but warn it will be removed.
12661 Move towards a more standard C++ coding style (i.e., type *var ->
12664 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
12666 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
12667 since it's less likely to work if NULs are involved in the future.
12669 2004-09-27 Akim Demaille <akim@epita.fr>
12671 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
12673 2004-09-27 Akim Demaille <akim@epita.fr>
12675 * data/lalr1.cc (b4_parse_param_decl_1): New.
12676 (b4_parse_param_decl): Use it to have different names between attribute
12677 and argument names.
12678 (b4_cc_constructor_call): Likewise.
12680 2004-09-24 Akim Demaille <akim@epita.fr>
12682 * src/parse-gram.y (add_param): Strip the leading and trailing
12683 blanks from a formal argument declaration.
12684 (YY_LOCATION_PRINT): New.
12686 2004-09-24 Akim Demaille <akim@epita.fr>
12688 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
12689 after the location.
12691 2004-09-24 Akim Demaille <akim@epita.fr>
12693 * doc/bison.texinfo (Table of Symbols): Sort.
12695 2004-09-21 Akim Demaille <akim@epita.fr>
12697 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
12698 the useless parentheses.
12699 Suggested by Paul Eggert.
12701 2004-09-20 Akim Demaille <akim@epita.fr>
12703 Let the initial-action act on the look-ahead, and use it for the
12704 "initial push" (corresponding to an hypothetical beginning-of-file).
12705 And let lalr1.cc honor %initial-action.
12707 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
12709 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
12710 (Parser::Parser): Remove the ctor that used to initialize it.
12711 (Parser::parse): Like in the other skeletons, issue the "starting
12712 parse" message before any action.
12713 Honor %initial-action.
12714 Initialize the stacks with the lookahead.
12715 * data/yacc.c: Let $$ and @$ in %initial-action designate the
12717 Push them in the stacks.
12718 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
12720 2004-09-20 Akim Demaille <akim@epita.fr>
12722 * doc/bison.texinfo (Initial Action Decl): New.
12724 2004-09-20 Akim Demaille <akim@epita.fr>
12726 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
12727 clearer criterion to define it.
12728 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
12729 When reducing on an empty RHS, use the latest stacked location as
12731 yylloc is not always available.
12732 * data/glr.c: Likewise.
12733 Also, honor initial-actions.
12735 2004-09-20 Akim Demaille <akim@epita.fr>
12737 * data/yacc.c (YY_LOCATION_PRINT): New.
12738 Define when we know YYLTYPE's structure, i.e., when the default
12739 YYLLOC_DEFAULT is used.
12740 * data/c.m4 (b4_yysymprint_generate): Use it.
12741 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
12742 value of the result.
12743 (error_start_): Replace with...
12744 (error_range_): this location array.
12745 This allows to replace code relying on the implementation of
12746 locations by portable code.
12747 * data/yacc.c (yylerrsp): Replace with...
12748 (yyerror_range): this.
12749 Every time a token is popped, update yyerror_range[0], to have an
12750 accurate location for the error token.
12751 * data/glr.c (YY_LOCATION_PRINT): New.
12752 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
12753 deference a pointer.
12754 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
12755 report the location in %printers.
12757 * src/scan-skel.l: Instead of abort, report error messages to ease
12758 understanding skeleton scanning failures.
12760 2004-09-16 Akim Demaille <akim@epita.fr>
12762 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
12763 (iterator, const_iterator): these, to be more in the C++ spirit.
12764 Also, return reverse iterators so that when displaying the stack
12765 we display its bottom first.
12766 (Parser::stack_print_, Parser::reduce_print_): Match the messages
12768 We should probably use vector here though.
12770 2004-09-16 Akim Demaille <akim@epita.fr>
12772 Have more complete shift traces.
12774 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
12775 to report Shifts instead of ad hoc YYDPRINTF invocations,
12776 including for the error token.
12777 * data/lalr1.cc (symprint_): Output the location.
12778 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
12779 output the location within the %printer.
12780 Activate GLR tests, at least to make sure they compile properly.
12781 They still don't pass though.
12782 * tests/calc.at: Adjust expect verbose output, since now "Entering
12783 state..." is on a different line than the "Shifting" message.
12785 2004-09-08 Akim Demaille <akim@epita.fr>
12787 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
12788 Bison directive from the Bison file to the invocation of this
12789 macro, so that these directives are passed to
12790 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
12791 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
12792 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
12793 the extra Bison directives instead of the whole series.
12794 Change the grammar so that there are recoverable errors, and
12795 unrecoverable errors. Now we can have the parser give up before
12796 consuming the whole input. As a result we now can observe that
12797 the lookahead is freed when needed.
12798 Change the parser source to parse argv[1] instead of a hard coded
12800 Simplify yylex, and give a value and location to EOF.
12801 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
12802 passed directives already coded in the file.
12803 Add some tests to check the location of "error".
12804 For some tests, the C++ parser is correct, and not yacc.c.
12805 For other tests, they provide different, but unsatisfying, values,
12806 so keep the C++ value so that at least one parser is "correct"
12807 according to the test suite.
12808 (Actions after errors): Remove, this is subsumed by the
12809 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
12811 2004-09-06 Akim Demaille <akim@epita.fr>
12813 * data/lalr1.cc: Adjust the indentation of the labels.
12814 (Parser::pop): New.
12817 2004-09-06 Akim Demaille <akim@epita.fr>
12819 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
12820 argument, an informative message.
12821 Call YY_SYMBOL_PRINT.
12822 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
12823 * data/lalr1.cc (destruct_): Likewise.
12824 In addition, no longer depend on b4_yysymprint_generate and
12825 b4_yydestruct_generate to generate these functions, do it "by
12828 2004-09-03 Akim Demaille <akim@epita.fr>
12830 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
12831 invoked, yydestruct the lookahead.
12832 * tests/calc.at (Calculator $1): Update the expected lengths of
12833 traces: there is an added line for the discarded lookahead.
12834 * doc/bison.texinfo (Destructor Decl): Some rewording.
12835 Define "discarded" symbols.
12837 2004-09-02 Akim Demaille <akim@epita.fr>
12839 * data/lalr1.cc (translate_, destruct_): No reason to be static.
12841 2004-09-02 Akim Demaille <akim@epita.fr>
12843 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
12844 (YYDSYMPRINTF): Rename as...
12845 (YY_SYMBOL_PRINT): this.
12846 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
12848 Use it instead of direct symprint_ calls.
12849 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
12852 2004-09-02 Akim Demaille <akim@epita.fr>
12854 * data/lalr1.cc (b4_yysymprint_generate): New.
12855 (symprint_): New member function, defined when YYDEBUG.
12856 Use it consistently instead of token/nterm debugging output by
12858 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
12859 %printer calls to use cdebug_ when using lalr1.cc.
12861 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
12863 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
12864 with #ifdef YYDEBUG.
12866 2004-08-26 Akim Demaille <akim@epita.fr>
12868 * doc/bison.texinfo (Implementing Loops): Rename as...
12869 (Implementing Gotos/Loops): this.
12871 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
12873 Adjust to latest gnulib.
12874 * bootstrap (gnulib_modules): Add xalloc-die.
12875 Set LC_ALL=C so that file names sort consistently.
12876 Prefer the gnulib copies of gettext.m4, glibc21.m4,
12877 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
12878 uintmax_t.m4, ulonglong.m4.
12879 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
12880 po.m4 since we are now using _gl.m4 instead.
12882 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
12884 * src/scan-action.l: Remove. Scanning of semantic actions is
12885 handled in scan-gram.l.
12887 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
12889 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
12891 * src/location.h (struct): The file member is a uniqstr.
12892 (equal_boundaries): Use UNIQSTR_EQ for comparison.
12894 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
12896 Fix bug with non-%union parsers that have printers or destructors,
12897 which led to a Bison core dump. Reported by Peter Fales in
12898 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
12900 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
12901 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
12902 not to our own type.
12903 * src/output.c (symbol_destructors_output, symbol_printers_output):
12904 Don't assume %union.
12905 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
12906 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
12907 UNION-FLAG. All callers changed.
12908 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
12909 Use type char, not unsigned int, when declaring an array of char;
12910 this lets us remove a cast.
12911 (Printers and Destructors): Add non-%union test cases.
12913 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
12915 * doc/bison.texinfo: Minor editorial changes, mostly to the new
12916 GLR writeups. E.g., avoid frenchspacing and the future tense,
12917 change "lookahead" to "look-ahead", and change "wrt" to "with
12920 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12922 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
12923 New sections, split off from the GLR Parsers section. Put the new
12924 Simple GLR Parser near the start of the GLR section, for clarity.
12925 Rewrite connective text.
12927 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
12929 * doc/bison.texinfo (Simple GLR Parsers): New section.
12931 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
12933 * NEWS, TODO, doc/bison.texinfo:
12934 Use "look-ahead" instead of "lookahead", to be consistent.
12935 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
12936 while we're fixing "look-ahead".
12937 * src/conflicts.c (shift_set): Renamed from shiftset.
12938 (look_ahead_set): Renamed from lookaheadset.
12939 * src/print.c: Likewise.
12940 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
12941 name for "lookahead".
12942 (report_types, usage): Likewise.
12943 * src/getargs.h (report_look_ahead_tokens): Renamed from
12945 * src/lalr.c (compute_look_ahead_tokens): Renamed from
12946 compute_lookaheads.
12947 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
12948 (look_ahead_tokens_print): Renamed from lookaheads_print.
12949 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
12950 state_rule_lookaheads_print.
12951 * src/state.h: Likewise.
12952 (reductions.look_ahead_tokens): Renamed from lookaheads.
12953 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
12954 AT_DATA_LOOKAHEADS_GRAMMAR.
12956 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
12958 * README: Update location of patched M4 distribution.
12960 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
12962 Don't assume the C++ compiler takes the same arguments as the C compiler
12964 * configure.ac (O0CXXFLAGS): New var.
12965 * tests/atlocal.in (CXXFLAGS): Use it.
12967 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
12969 Fix some "make check" problems with C++ reported by
12970 Albert Chin-A-Young for Tru64 C++ in this thread:
12971 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
12973 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
12974 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12975 Output to a .cc file for C++, not to a .c file.
12976 * tests/calc.at (AT_CHECK_CALC): Likewise.
12977 * tests/regression.at (AT_CHECK_DANCER): Likewise.
12978 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
12980 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
12982 * tests/calc.at, tests/actions.at: Workaround for SGI
12983 C++ compiler. (trivial change)
12985 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
12987 Spent a few hours checking out which prerequisite versions the
12988 current sources actually require. I went all the way back to
12989 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
12990 a seemingly endless set of combinations of versions more recent
12991 than that. The bottom line is that the current sources require
12992 fairly recent versions of the build tools, and it'll be some work
12994 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
12995 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
12996 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
12997 Add comments explaining why those particular versions are
13000 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
13001 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
13002 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
13004 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
13005 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
13007 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
13009 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
13010 0.11.5. Suggested by Bruno Haible.
13011 * bootstrap: Remove gettext version checking.
13013 * doc/bison.texinfo (Decl Summary): Also mention that %union
13014 can depend on prerequisite types. Problem reported by Tim
13017 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
13019 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
13020 * README-alpha: Don't tell people not to package this.
13022 * bootstrap: Don't assume $(...) works; use `...` instead.
13023 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
13026 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
13027 put into the -d output file, and mention what to do if YYSTYPE is
13028 defined as a macro.
13030 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
13032 Undo change made earlier today: it caused autopoint to not bring
13033 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
13036 * bootstrap: Check that gettext version matches what's in
13037 configure.ac. Warn users to ignore robots.txt ERROR 404.
13038 * bootstrap: Undo today's earlier change (logged below).
13039 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
13041 The gettext version checking is causing more trouble than it's
13042 curing; remove it. Problem reported by Paul Hilfinger.
13044 * bootstrap: Issue a warning that one can expect a message
13045 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
13046 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
13048 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
13050 Ensure that the C++ compiler used for testing actually works on a
13051 simple test program; if not, skip the C++-related tests. Problem
13052 reported by Vin Shelton in:
13053 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
13055 * m4/cxx.m4: New file.
13056 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
13057 * tests/atlocal.in (BISON_CXX_WORKS): Add.
13058 * tests/local.at (AT_COMPILE_CXX): Use it.
13060 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
13062 * data/glr.c (yylloc): Output this macro even if locations are not
13063 being generated, as the GLR parser needs it even in that case.
13064 Problem reported by Troy A. Johnson
13065 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
13067 * configure.ac (AC_INIT): Update to 1.875e.
13069 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
13071 * NEWS: Version 1.875d.
13072 * configure.ac (AC_INIT): Likewise.
13073 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
13075 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
13076 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
13077 lalr1.cc runs afoul of the first, and the last two are no longer
13078 supported by GCC 3.4.0.
13079 * README: Mention GNU m4 1.4 or later; mention m4 patches.
13080 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
13082 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
13084 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
13085 unsigned int, for compatibility with latest gnulib hash module.
13086 * src/state.c (state_hash, state_hasher): Likewise.
13087 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
13088 * src/uniqstr.c (hash_uniqstr): Likewise.
13090 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
13092 * NEWS: Unescaped newlines are no longer allowed in char & strings.
13094 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
13095 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
13096 character and string literals.
13097 (unexpected_end): New function.
13098 (unexpected_eof): Use it.
13099 (unexpected_newline): New function.
13100 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
13103 * NEWS: Document %expect-rr.
13105 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
13106 Fix typo by replacing $1 with $option.
13107 Remove more 'intl'-related files.
13108 Don't DEFUN AM_INTL_SUBDIR twice.
13110 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
13111 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
13113 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
13114 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
13115 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
13116 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
13117 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
13118 * src/.cvsignore: Add *.output.
13120 * src/parse-gram.y: Put copyright notice inside %{ %} so it
13121 gets copied to the output file.
13123 2004-04-28 Paul Eggert <eggert@twinsun.com>
13125 Get files from the gnulib and po repositories, instead of relying
13126 on them being in our CVS. Upgrade to latest versions of gnulib
13129 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
13130 * bootstrap: Bootstrap from gnulib and po repositories.
13131 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
13132 * README-cvs: Document these changes. Remove version numbers from
13133 mentions of build tools, since they change so often. Mention Flex.
13135 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
13136 (gl_USE_SYSTEM_EXTENSIONS): Add.
13137 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
13138 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
13140 (AC_ISC_POSIX): Remove; we no longer support this
13141 ancient OS, as it gets in the way of latest Autoconf & gnulib.
13142 (AC_HEADER_STDC): Remove: we now assume C89 or better.
13143 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
13144 Do not check for C89 headers, except for locale.h which is used
13145 by the Yacc library and must port to K&R hosts.
13146 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
13147 Do not check for C89 functions, except for setlocale which is
13148 used by the Yacc library.
13149 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
13150 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
13151 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
13152 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
13153 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
13154 AM_GNU_GETTEXT): Remove; now done by:
13155 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
13156 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
13159 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
13160 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
13161 Define to empty, as gnulib.mk will do the rest for us.
13162 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
13164 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
13165 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
13167 * src/files.c: Include gnulib's xstrndup.h.
13169 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
13170 (REALLOC): Use xnrealloc, for likewise.
13171 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
13172 (strnlen, memrchr): Remove decls; functions no longer used.
13173 Include <stpcpy.h>.
13175 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
13176 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
13177 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
13178 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
13179 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
13180 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
13181 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
13182 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
13183 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
13184 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
13185 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
13186 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
13187 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
13188 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
13189 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
13190 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
13191 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
13192 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
13193 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
13194 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
13195 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
13196 Remove, as these files are now generated automatically
13197 by bootstrap or automake.
13199 * po/ChangeLog: Remove: all but one entry was a duplicate
13200 of this file, and I moved that 2000-11-02 entry here.
13202 * config/.cvsignore: Add Makefile, depcomp, install-sh.
13203 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
13204 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
13205 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
13206 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
13207 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
13208 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
13209 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
13210 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
13211 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
13212 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
13214 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
13215 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
13216 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
13217 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
13218 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
13219 * src/.cvsignore: Remove *_.c.
13222 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
13223 support it. (The latest stable gzip doesn't.)
13225 2004-04-27 Paul Eggert <eggert@twinsun.com>
13227 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
13228 case, as stos_ is now used by destructors due to the 2004-02-09
13231 Remove more K&R C support.
13232 * lib/libiberty.y (PARAMS): Remove. All uses removed.
13233 * lib/subpipe.c (errno): Remove decl.
13234 Include <stdlib.h> unconditionally.
13235 (EXIT_FAILURE): Remove macro.
13236 * src/complain.c (vfprintf, strerror): Remove.
13237 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
13239 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
13240 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
13241 (strchr, strspn, memchr): Remove decls.
13242 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
13243 unconditionally. Do not declare perror.
13244 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
13247 * src/complain.c (_): Remove useless defn, as system.h defines this.
13249 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
13250 with latest obstack.h.
13251 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
13252 to procedure types, as obstack.h now does that for us.
13253 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
13255 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
13256 so that this include file can stand alone.
13257 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
13258 does this now. Include subpipe.h first after config.h, to
13259 test whether it can stand alone.
13261 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
13262 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
13263 unused declaration.
13265 * tests/synclines.at (%union synch line): Put a dummy member in
13266 the union, because empty unions aren't allowed in C. Caught
13269 2004-04-13 Jim Meyering <jim@meyering.net>
13271 * src/conflicts.c (conflicts_print): Correct format string typo:
13272 use `%%' to produce literal `%'. (trivial change)
13274 2004-03-30 Paul Eggert <eggert@twinsun.com>
13276 * src/getargs.c (version): Update copyright year to 2004.
13278 * data/c.m4 (b4_int_type): Use 'short int' rather than
13279 'short', and similarly for 'long', 'unsigned', etc.
13280 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
13281 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
13282 yy_yypstack, yydumpstack): Likewise.
13283 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
13284 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
13286 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
13287 yy_stack_print, yyparse): Likewise.
13288 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
13289 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
13290 * lib/bitset.c (bitset_print): Likewise.
13291 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
13292 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13293 * lib/bitsetv.c (bitsetv_dump): Likewise.
13294 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
13295 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
13297 * src/LR0.c (allocate_itemsets): Likewise.
13298 * src/gram.h (rule_number, rule): Likewise.
13299 * src/lalr.h (goto_number): Likewise.
13300 * src/nullable.c (nullable_compute): Likewise.
13301 * src/output.c (prepare_rules): Likewise.
13302 * src/relation.c (relation_print, relation_digraph): Likewise.
13303 * src/relation.h (relation_node): Likewise.
13304 * src/state.h (state_number, transitions, errs, reductions,
13305 struct state): Likewise.
13306 * src/symtab.h (symbol_number, struct symbol): Likewise.
13307 * src/tables.c (vector_number, tally, action_number,
13308 default_goto, goto_actions): Likewise.
13309 * tests/existing.at (GNU Cim Grammar): Likewise.
13310 * tests/regression.at (Web2c Actions): Likewise.
13312 * src/output.c (muscle_insert_short_int_table): Renamed from
13313 muscle_insert_short_table. All uses changed.
13315 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
13317 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
13318 (declaration): Replace expected_conflicts with expected_sr_conflicts.
13319 Add %expect-rr rule.
13321 * src/scan-gram.l: Recognize %expect-rr.
13323 * src/conflicts.h (expected_sr_conflicts): Rename from
13324 expected_conflicts.
13325 (expected_rr_conflicts): Declare.
13327 * src/conflicts.c (expected_sr_conflicts): Rename from
13328 expected_conflicts.
13329 (expected_rr_conflicts): Define.
13330 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
13332 Use expected_sr_conflicts in place of expected_conflicts.
13333 Warn if expected_rr_conflicts used in non-GLR parser.
13335 * doc/bison.texinfo: Add documentation for %expect-rr.
13337 2004-03-08 Paul Eggert <eggert@gnu.org>
13339 Add support for hex token numbers. Suggested by Odd Arild Olsen in
13340 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
13342 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
13344 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
13345 * src/scan-gram.l (scan_integer): New function.
13347 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
13348 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
13349 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
13350 Say "long int", not "long", for uniformity with GNU style.
13352 2004-02-25 Paul Eggert <eggert@twinsun.com>
13354 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
13355 compilers. This fixes a problem with Intel's C++ compiler being
13356 chatty, reported by Guido Trentalancia in
13357 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
13359 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
13361 Support %destructor and merge error locations in lalr1.cc.
13363 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
13364 (Parser::stos_): Define unconditionally.
13365 (Parser::destruct_): New method. Generate its body with
13366 b4_yydestruct_generate.
13367 (Parser::error_start_): New attribute.
13368 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
13369 token which are discarded.
13370 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
13371 error_start_ when erroneous token are discarded.
13372 (Parser::parse) <yyerrlab1>: Compute the location of the error
13373 token so that it covers all the discarded tokens.
13374 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
13375 it can be called with `%skeleton "lalr1.cc"', and do that.
13377 2004-02-02 Paul Eggert <eggert@twinsun.com>
13379 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
13380 $(top_srcdir)/lib and ../lib. This fixes a bug reported
13381 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
13382 There's no need to mention top_builddir since Automake does that
13384 (INCLUDES): Remove, as Automake says it's obsolescent.
13385 Contents migrated into AM_CPPFLAGS as described above.
13386 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
13388 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
13390 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
13391 (yyreportSyntaxError): Handle case where lookahead token is
13394 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13396 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
13397 resulting parsers are compilable with C++.
13399 2003-12-23 Paul Eggert <eggert@twinsun.com>
13401 * config/depcomp, config/install-sh: Sync with Automake 1.8.
13402 * src/output.c (output_skeleton): Rename local var.
13403 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
13404 Bison tokens, as this runs afoul of the 2003-10-07 change that
13405 disallowed NUL bytes in character constants or string literals.
13407 * tests/local.at: Require Autoconf 2.59's Autotest.
13408 * tests/testsuite.at: Don't include local.at, since we now assume
13409 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
13411 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
13412 multiple inclusion warnings.
13414 2003-12-02 Akim Demaille <akim@epita.fr>
13416 * doc/bison.texinfo (How Can I Reset the Parser): More about start
13420 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
13422 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
13424 2003-10-07 Paul Eggert <eggert@twinsun.com>
13426 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
13427 if testsuite doesn't exist.
13429 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
13430 literals, unfortunately.
13431 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
13432 Complain about NUL bytes in character constants or string literals.
13434 2003-10-05 Paul Eggert <eggert@twinsun.com>
13436 * NEWS: Don't document %no-default-prec, as it's still
13438 * doc/bison.texinfo: Document %no-default-prec only if
13439 the defaultprec flag is set. Normally it's not.
13441 2003-10-04 Paul Eggert <eggert@twinsun.com>
13443 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
13444 non-modifiable lvalue, instead of a modifiable one.
13445 * doc/bison.texinfo (Actions): Document that $$ can
13446 be assigned to. Do not claim that $$ and $N are
13447 array element references: user code should not rely on this.
13449 2003-10-01 Paul Eggert <eggert@twinsun.com>
13451 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
13452 (grammar_declaration): Use it.
13453 * src/scan-gram.l: New token %no-default-prec.
13454 * tests/conflicts.at: Revamp tests to use %no-default-prec.
13455 * NEWS, doc/bison.texinfo: Document the above.
13457 2003-10-01 Akim Demaille <akim@epita.fr>
13459 VCG no longer supports long_straight_phase.
13461 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
13462 * src/print_graph.c (print_graph): Adjust.
13464 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
13465 and Paul Eggert <eggert@twinsun.com>
13467 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
13468 Table of Symbols): Document %default-prec.
13469 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
13470 (grammar_declaration): Set default_prec on %default-prec.
13471 * src/scan-gram.l (%default-prec): New token.
13472 * src/reader.h (default_prec): New flag.
13473 * src/reader.c: Likewise.
13474 (packgram): Handle it.
13475 * tests/conflicts.at (%default-prec without %prec,
13476 %default-prec with %prec, %default-prec 1): New tests.
13478 2003-09-30 Paul Eggert <eggert@twinsun.com>
13480 * tests/testsuite.at: Include local.at, not input.at, fixing
13481 a typo in the 2003-08-25 patch.
13483 2003-08-27 Akim Demaille <akim@epita.fr>
13485 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
13488 2003-08-26 Akim Demaille <akim@epita.fr>
13490 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
13491 "<\#" to avoid magic from Gnus when posting parts of this script.
13493 2003-08-26 Akim Demaille <akim@epita.fr>
13495 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
13496 (Parser::parse): here.
13497 Adjust: nerrs and errstatus is now replaced by...
13498 (Parser::nerrs_, Parser::errstatus_): New.
13500 2003-08-25 Akim Demaille <akim@epita.fr>
13502 * config/announce-gen, Makefile.cfg: New.
13503 * Makefile.am: Adjust.
13504 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
13505 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
13507 2003-08-25 Akim Demaille <akim@epita.fr>
13509 When reducing initial empty rules, Bison parser read an initial
13510 location that is not defined. This results in garbage, and that
13511 affects Bison's own parser. Therefore we need (i) to extend Bison
13512 to support a means to initialize this location, and (ii) to use
13513 this CVS Bison to fix CVS Bison's parser.
13515 * src/reader.h, reader.c (epilogue_augment): Remove, replace
13517 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
13518 * src/parse-gram.y: Adjust.
13519 (%initial-action): New.
13520 (%error-verbose): Since we require CVS Bison, there is no reason
13522 * src/scan-gram.l: Adjust.
13523 * src/Makefile.am (YACC): New, to make sure we use our own parser.
13524 * data/yacc.c (yyparse): Use b4_initial_action.
13526 2003-08-25 Akim Demaille <akim@epita.fr>
13528 * doc/bison.texinfo: Don't promote stdout for error messages.
13530 2003-08-25 Akim Demaille <akim@epita.fr>
13532 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
13533 From Alexandre Duret-Lutz.
13535 2003-08-25 Akim Demaille <akim@epita.fr>
13539 2003-08-25 Akim Demaille <akim@epita.fr>
13541 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
13544 2003-08-25 Akim Demaille <akim@epita.fr>
13546 * data/lalr1.cc (Parser::reduce_print_): New.
13549 2003-08-25 Akim Demaille <akim@epita.fr>
13551 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
13552 error recovery loops. This patch is based on
13553 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
13554 Also, augment the similarity between lalr1.cc and yacc.c.
13555 Note: the locations of error recovery rules are not correct yet.
13557 * data/lalr1.cc: Comment changes to augment the similarity between
13558 lalr1.cc and yacc.c.
13559 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
13560 (yyerrlab1): Remove, but where it used to be (now the bottom part of
13561 yyerrlab), when hitting EOF, pop the whole stack here instead of
13562 merely falling thru the default error handling mechanism.
13563 (yyerrorlab): New label, with the old contents of YYERROR,
13564 plus the following change: pop the stack of rhs corresponding
13565 to the production that invoked YYERROR. That is how Yacc
13566 behaves (required by POSIX).
13567 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
13570 2003-08-25 Akim Demaille <akim@epita.fr>
13572 Tune local.at so that people can "autom4te -l autotest calc.at -o
13573 calc" for instance, to extract a sub test suite.
13575 * tests/testsuite.at: Move the initialization, Autotest version
13576 requirement, and AT_TESTED invocation into...
13577 * tests/local.at: here.
13578 * tests/testsuite.at: Include it for compatibility with Autoconf
13580 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
13583 2003-08-04 Paul Eggert <eggert@twinsun.com>
13585 Rework code slightly to avoid gcc -Wtraditional warnings.
13586 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
13587 The returned value is now stored in *YY0. All callers changed.
13588 * src/output.c (merge_output): Adjust to the above change.
13590 2003-07-26 Paul Eggert <eggert@twinsun.com>
13592 * data/glr.c (YYASSERT): New macro.
13593 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
13594 yyresolveStates, yyprocessOneStack):
13595 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
13596 Derived from a suggestion by Frank Heckenbach.
13598 2003-07-25 Paul Eggert <eggert@twinsun.com>
13600 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
13601 for portability to K&R C (after ansi2knr, presumably). See
13602 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
13603 by Frank Heckenbach, though I have omitted the structure-initialization
13604 part of his glr-knr.diff patch since I recall that the Portable
13605 C Compiler didn't require that change.
13607 Let the user specify how to allocate and free memory.
13608 Derived from a suggestion by Frank Heckenbach in
13609 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
13610 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
13611 All uses of free, malloc, realloc changed to use these macros,
13612 and unnecessary casts removed.
13613 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
13615 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
13617 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
13618 use s.empty() rather than s == "" to test for empty string; see
13619 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
13622 2003-06-25 Akim Demaille <akim@epita.fr>
13624 * config/depcomp, config/install-sh: Update from masters.
13626 2003-06-20 Paul Eggert <eggert@twinsun.com>
13628 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
13629 and return properly parenthesized result.
13630 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
13631 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
13632 Remove unnecessary parentheses from uses.
13633 * doc/bison.texinfo (Location Default Action): Describe the
13634 conventions for parentheses.
13636 2003-06-19 Paul Eggert <eggert@twinsun.com>
13638 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
13639 yyreportTree): Do not assume that size_t is the same width as int,
13640 when printing sizes. Print sizes using an unsigned format.
13641 Problem reported by Frank Heckenbach in
13642 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
13644 Port to Forte Developer 7 C compiler.
13645 * data/glr.c (struct YYLTYPE): If locations are not being used,
13646 declare a single dummy member, as empty structs do not conform
13648 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
13649 the Forte Developer 7 C compiler complains that end-of-loop
13650 code is not reached.
13652 2003-06-17 Paul Eggert <eggert@twinsun.com>
13654 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
13655 avoid warnings from picky compilers about redefinition of PARAMS.
13657 2003-06-17 Paul Eggert <eggert@twinsun.com>
13661 * NEWS: Document 1.875b.
13663 * lib/bbitset.h: Do not include config.h; that's the includer's job.
13664 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
13665 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
13666 Don't use 'index' in comments, as it's a builtin fn on some hosts.
13667 * lib/bitset_stats.c: Include gettext.h unconditionally, as
13668 per recent gettext manual's suggestion.
13669 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
13670 Use prototypes, not old-style definitions.
13671 * lib/lbitset.c (lbitset_unused_clear): Likewise.
13672 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
13673 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
13674 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
13675 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
13676 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
13677 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
13678 vbitset_or_and_cmp, vbitset_copy): Likewise.
13680 * lib/libiberty.h: Do not include config.h; that's the includer's job.
13681 Do not include <stdlib.h>.
13682 (PARAMS): Define unconditionally for C89.
13683 (ATTRIBUTE_NORETURN): Remove.
13684 (ATTRIBUTE_UNUSED): Define unconditionally.
13686 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
13687 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
13688 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
13689 * lib/vbitset.c, lib/vbitset.h: New files.
13690 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
13691 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
13694 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
13695 `How Can I Reset @code{yyparse}', since texinfo does not allow
13696 arbitrary @ in node names.
13698 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
13699 shouldn't be needed according to the gettext 0.12.1 documentation
13700 but which seem to be needed anyway: codeset.m4 glibc21.m4
13701 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
13702 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
13703 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
13705 * lib/.cvsignore: Add stdbool.h.
13706 * m4/.cvsignore: Add nls.m4, po.m4.
13708 Upgrade to CVS gnulib.
13709 * stdbool_.h: File renamed from stdbool.h.in.
13710 * configure.ac (AM_STDBOOL_H): Invoke this instead of
13712 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
13713 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
13714 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
13715 (MOSTLYCLEANFILES): New var.
13716 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
13717 (stdbool.h): New rule.
13718 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
13719 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
13720 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
13721 m4/quote.m4: Upgrade to today's gnulib.
13723 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
13724 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
13725 the tests right now.
13726 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
13727 yyerror are declared before use; C99 requires this.
13729 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13731 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
13733 (yyrecoverSyntaxError): Correct the logic for setting and testing
13735 Correct comment on handling EOF.
13736 Allow states with only a default reduction, rather than failing
13737 (I can't quite reconstruct why these were not allowed before).
13739 Fixes to avoid problem that $-N rules in GLR parsers can cause
13740 buffer overruns, corrupting state.
13742 * src/output.c (prepare_rules): Output max_left_semantic_context
13744 * src/reader.h (max_left_semantic_context): New variable declaration.
13745 * src/scan-gram.l (max_left_semantic_context): Define.
13746 (handle_action_dollar): Update max_left_semantic_context.
13747 * data/glr.c (YYMAXLEFT): New definition.
13748 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
13749 (yyresolveAction): Ditto.
13751 Fixes to problems with location handling in GLR parsers reported by
13752 Frank Heckenbach (2003/06/05).
13754 * data/glr.c (YYLTYPE): Make trivial if locations not used.
13755 (YYRHSLOC): Add parentheses, and define only if locations used.
13756 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
13757 locations not used.
13758 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
13759 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
13761 * tests/cxx-type.at: Exercise location information; update tests
13762 to differentiate output with and without locations.
13763 Remove forward declarations of yylex and yyerror---caused errors
13764 because default YYLTYPE not yet defined.
13765 Change semantic actions to compute strings, rather than printing
13766 them directly (to test proper passing of semantics values). Change
13767 output to prefix notation and update test data and expected results.
13768 (yylex): Track locations.
13769 (stmtMerge): Return value rather than printing, and include arguments
13772 2003-06-03 Paul Eggert <eggert@twinsun.com>
13774 Avoid warnings generated by GCC 2.95.4 when Bison is
13775 configured with --enable-gcc-warnings.
13776 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
13777 yy::]b4_parser_class_name[::translate_,
13778 yy::Stack::operator[] (unsigned),
13779 yy::Stack::operator[] (unsigned) const,
13780 yy::Slice::operator[] (unsigned),
13781 yy::Slice::operator[] (unsigned) const):
13782 Rename local vars to avoid warnings.
13783 * tests/glr-regression.at (Improper handling of embedded actions
13784 and $-N in GLR parsers): Remove unused local variable from yylex.
13785 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
13786 (void) as arg when not pure, since we now assume C89 when building
13787 Bison. Pacify GCC by using parameter.
13789 2003-06-02 Paul Eggert <eggert@twinsun.com>
13791 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
13792 yy::Location::lines, yy::Location::columns): Rename arguments
13793 to avoid shadowing; this removes a warning generated by GCC 3.3.
13795 2003-06-01 Paul Eggert <eggert@twinsun.com>
13797 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
13798 to g++, as GCC 3.3 complains if you do it.
13799 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
13800 everything that WARNING_CFLAGS has, except omit warnings
13801 not suitable for C++.
13802 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
13803 * tests/atlocal.in (CXXFLAGS): New var.
13804 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
13806 Fix a GLR parser bug I reported in February; see
13807 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
13808 The problem was that GLR parsers did not conform to the C standard,
13809 because actions like { $1 = $2 + $3; } expanded to expressions
13810 that invoked YYFILL in separate subexpressions, and YYFILL assigned
13811 to a local variable. The C standard says that expressions
13812 like (var = f ()) + (var = f ()) have undefined behavior.
13813 Another problem was that GCC sometimes issues warnings that
13814 yyfill and its parameters are unused.
13816 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
13817 as possibly unused.
13818 (yyfill): New function.
13820 (yyuserAction): Change type of yynormal to bool, so that it matches
13821 the new yyfill signature. Mark it as possibly unused.
13824 Follow up on a bug I reported in February, where a Bison-generated
13825 parser can loop. Provide a test case and a fix for yacc.c. I
13826 don't have a fix for lalr1.cc or for glr.c, unfortunately.
13827 The original bug report is in:
13828 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
13830 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
13831 macro's size was becoming unwieldy.
13832 (yyerrlab): Do not discard an empty lookahead symbol, as this
13833 might destroy garbage.
13834 (yyerrorlab): New label, with the old contents of YYERROR,
13835 plus the following change: pop the stack of rhs corresponding
13836 to the production that invoked YYERROR. That is how Yacc
13837 behaves, and POSIX requires this behavior.
13838 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
13839 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
13840 Define 'alarm' to do nothing if unistd.h is not available.
13841 Add a new rule "exp: '-' error;" to test the above change to
13842 data/yacc.c. Use 'alarm' to abort any test taking longer than
13843 10 seconds, as it's probably looping.
13844 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
13845 Also, the new yacc.c generates two fewer diagnostics for an
13848 2003-05-24 Paul Eggert <eggert@twinsun.com>
13850 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
13851 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
13852 This fixes a problem reported by John Bowman when the Compaq/HP
13853 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
13854 -ansi -Wall -gall).
13855 * data/yacc.c (union yyalloc): Likewise.
13856 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
13858 Switch from 'int' to 'bool' where that makes sense.
13860 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
13861 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
13862 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
13863 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
13864 Return or accept bool, not int. All callers changed.
13865 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
13866 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
13867 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
13868 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
13869 bitset_or_and_cmp_): Likewise.
13870 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
13871 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
13872 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
13873 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
13874 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
13875 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
13876 bitset_stats_or_and_cmp): Likewise.
13877 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
13878 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
13879 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
13880 ebitset_xor_cmp): Likewise.
13881 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
13882 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
13883 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
13884 lbitset_xor_cmp): Likewise.
13885 * lib/bbitset.h: Include <stdbool.h>.
13886 (struct bitset_vtable): The following members now return bool, not
13887 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
13888 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
13890 * src/conflicts.c (count_rr_conflicts): Likewise.
13891 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
13893 * lib/ebitset.c (ebitset_obstack_init): Likewise.
13894 * lib/lbitset.c (lbitset_obstack_init): Likewise.
13895 * src/getargs.c (debug_flag, defines_flag, locations_flag,
13896 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
13897 graph_flag): Likewise.
13898 * src/getargs.h (debug_flag, defines_flag, locations_flag,
13899 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
13900 graph_flag): Likewise.
13901 * src/output.c (error_verbose): Likewise.
13902 * src/output.h (error_verbose): Likewise.
13903 * src/reader.c (start_flag, typed): Likewise.
13904 * src/reader.h (typed): Likewise.
13905 * src/getargs.c (LOCATIONS_OPTION): New constant.
13906 (long_options, getargs): Use it.
13907 * src/lalr.c (build_relations): Use bool, not int.
13908 * src/nullable.c (nullable_compute): Likewise.
13909 * src/print.c (print_reductions): Likewise.
13910 * src/tables.c (action_row, pack_vector): Likewise.
13911 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
13912 * src/output.c (prepare): Use it.
13913 * src/output.c (token_definitions_output,
13914 symbol_destructors_output, symbol_destructors_output): Use string,
13915 not boolean integer, to keep track of whether to output separator.
13916 * src/print_graph.c (print_core): Likewise.
13917 * src/state.c (state_rule_lookaheads_print): Likewise.
13919 * config/install-sh: Sync from automake 1.7.5.
13921 2003-05-14 Paul Eggert <eggert@twinsun.com>
13923 * src/parse-gram.y (rules_or_grammar_declaration): Require a
13924 semicolon after a grammar declaration, in the interest of possible
13925 future changes to the Bison input language.
13926 Do not allow a stray semicolon at the start of the grammar.
13927 (rhses.1): Allow one or more semicolons after any rule, including
13928 just before "|" as required by POSIX.
13929 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
13932 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
13934 %parse-param support for lalr1.cc.
13936 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
13937 b4_cc_constructor_calls, b4_cc_constructor_call,
13938 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
13940 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
13941 parse-param arguments.
13942 (yy::b4_parser_class_name): Declare instance variables to
13943 hold parse-param arguments.
13944 * tests/calc.at: s/value/semantic_value/ because value clashes
13945 with a member of yy::b4_parser_class_name. Adjust C++ code
13946 to handle %parse-param. Enable %parse-param test in C++.
13948 2003-05-12 Paul Eggert <eggert@twinsun.com>
13950 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
13951 English a bit. Fix fclose typo. Change "const char" to "char
13952 const", and use ANSI C rather than K&R for "main". Suggest
13953 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
13954 and suggest yy_switch_to_buffer.
13956 2003-05-05 Paul Eggert <eggert@twinsun.com>
13958 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
13959 C89. This avoids a diagnostic on compilers that define __STDC__
13960 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
13961 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
13963 2003-05-03 Paul Eggert <eggert@twinsun.com>
13965 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
13966 Do not overrun array bounds.
13967 This should fix a bug reported today by Olatunji Oluwabukunmi in
13968 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
13970 2003-04-29 Akim Demaille <akim@epita.fr>
13972 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
13973 * src/getargs.c, src/getargs.h: here, as bool, not int.
13974 (nondeterministic_parser): New.
13975 * src/parse-gram.y, src/scan-gram.l: Support
13976 %nondeterministic-parser.
13977 * src/output.c (prepare): Use nondeterministic_parser instead
13978 of glr_parser where appropriate.
13979 * src/tables.c (conflict_row, action_row, save_row)
13980 (token_actions, token_actions, pack_vector): Ditto.
13982 2003-04-29 Akim Demaille <akim@epita.fr>
13984 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
13986 2003-04-29 Akim Demaille <akim@epita.fr>
13988 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
13989 with %pure-parser and %locations to exercise the patch from Yakov
13992 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
13994 * data/yacc.c: (b4_lex_param): Corrected for the case where
13995 %lex-param is provided and %pure-parser isn't.
13997 2003-04-27 Paul Eggert <eggert@twinsun.com>
13999 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
14000 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
14001 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
14002 if it is not defined.
14003 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
14005 2003-04-26 Paul Eggert <eggert@twinsun.com>
14007 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
14008 Declare to be of type suitable for the ninf value itself, not of
14009 type suitable for the corresponding table, since the latter might
14010 be unsigned but the ninf value might be negative. This fixes a
14011 bug reported by Alexandre Duret-Lutz in
14012 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
14014 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
14015 invokes it. We shouldn't invoke it twice because it will attempt
14016 to put error.o in the archive twice. This fixes a glitch reported
14017 by Martin Mokrejs in
14018 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
14020 2003-04-21 Paul Eggert <eggert@twinsun.com>
14022 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
14025 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
14027 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
14028 Fix obvious typo that results in uncompilable GLR parsers
14029 when both %pure-parser and %locations are used. (trivial change)
14031 2003-04-17 Paul Eggert <eggert@twinsun.com>
14033 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
14034 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
14035 Do not insert the expected token via unput, as this runs afoul
14036 of a POSIX-compatibility bug in flex 2.5.31.
14037 All uses changed to BEGIN the parent state,
14038 since we no longer insert the expected token via unput.
14039 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
14040 that is no longer emitted after the above change.
14042 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
14043 the first one. This change is from Paul Hilfinger, and it fixes
14044 regression reported by Werner Lemberg in
14045 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
14047 (resolve_sr_conflict): Don't invoke state_errs_set
14048 unless one or more tokens have been explicitly made errors.
14049 Otherwise, the above change causes Bison to abort.
14051 * tests/existing.at (GNU pic Grammar): New test case, taken from
14054 2003-03-31 Akim Demaille <akim@epita.fr>
14056 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
14058 2003-03-31 Akim Demaille <akim@epita.fr>
14060 * src/output.c (prepare_symbols): Avoid trailing spaces in the
14063 2003-03-31 Akim Demaille <akim@epita.fr>
14065 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
14066 From Paul Hilfinger.
14068 2003-03-29 Akim Demaille <akim@epita.fr>
14070 * m4/error.m4: Do not put under dynamic conditions some code which
14071 expansion is under static control.
14073 2003-03-29 Akim Demaille <akim@epita.fr>
14075 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
14077 2003-03-29 Akim Demaille <akim@epita.fr>
14079 * doc/bison.texinfo (Strings are Destroyed): New.
14081 2003-03-13 Paul Eggert <eggert@twinsun.com>
14083 * .cvsignore: Add configure.lineno.
14084 * src/.cvsignore: Add yacc.
14085 * tests/.cvsignore: Add testsuite.log.
14086 * doc/fdl.texi: Sync with latest FSF version.
14088 2003-03-12 Paul Eggert <eggert@twinsun.com>
14090 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
14091 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
14092 cursor, instead of leaving it undefined. This fixes a bug
14093 reported by Tim Van Holder in
14094 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
14095 * tests/input.at (Torturing the Scanner): Test the scanner on
14096 an empty input file, which was Tim Van Holder's test case.
14098 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
14099 <sys/resource.h> can be included, include sys/time.h and
14100 sys/times.h first, if available. This works around the SunOS
14101 4.1.4 porting bug reported by Bruce Becker in
14102 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
14104 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
14105 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
14106 AC_HEADER_SYS_WAIT.
14108 Merge changes from gnulib. This was prompted because the CVS
14109 snapshot didn't build on Solaris 7 due to strnlen problems.
14111 These changes need to be merged back into gnulib:
14112 * lib/hash.c: Include <stdbool.h> unconditionally.
14113 * m4/onceonly.m4 (m4_quote): New macro.
14114 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
14115 Quote AC_FOREACH variable-expansions properly.
14116 The 2003-01-03 obstack.h change also needs merging.
14117 {end of changes requiring merging}
14119 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
14120 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
14121 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
14122 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
14123 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
14124 New files, imported from gnulib.
14125 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
14128 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
14129 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
14132 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
14134 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
14135 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
14136 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
14137 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
14138 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
14139 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
14140 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
14141 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
14142 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
14143 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
14144 (jm_PREREQ_ARGMATCH): Remove.
14145 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
14146 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
14148 * src/system.h: Include <stdbool.h> unconditionally.
14150 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
14151 assuming at least C89 in the bitset code for some time now.
14153 2003-03-03 Akim Demaille <akim@epita.fr>
14157 2003-03-02 Akim Demaille <akim@epita.fr>
14159 * doc/bison.texinfo (Table of Symbols): Reactivate the
14160 documentation for %lex-param, and %parse-param.
14162 2003-03-02 Akim Demaille <akim@epita.fr>
14164 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
14165 generate verbose error messages.
14166 Use the number of tokens as an upper bound in yytname, as it
14167 cannot be a non terminal.
14169 2003-03-02 Akim Demaille <akim@epita.fr>
14171 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
14174 2003-03-02 Akim Demaille <akim@epita.fr>
14176 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
14177 Use them to exercise yycheck overrun.
14178 Based on Andrew Suffield's grammar.
14180 2003-03-02 Akim Demaille <akim@epita.fr>
14182 Create tests/local.at for Bison generic testing macros.
14184 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
14185 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
14187 * tests/calc.at (AT_CHECK_CALC): Adjust.
14188 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
14189 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
14190 * tests/local.at: here.
14191 (AT_COMPILE_CXX): Tags the tests using it as c++.
14192 Ignore the test if CXX is not functional.
14194 2003-03-01 Paul Eggert <eggert@twinsun.com>
14196 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
14197 not loc->end, since loc->end might contain garbage and this leads
14198 to undefined behavior on some platforms.
14199 (id_loc, token_start): Use (IF_LINTed) initial values that do not
14200 depend on *loc, so that the reader doesn't give the the false
14201 impression that *loc is initialized.
14202 (<INITIAL>"%%"): Do not bother setting code_start, since its value
14203 does not survive the return.
14205 2003-03-01 Akim Demaille <akim@epita.fr>
14207 * src/scan-gram.l (code_start): Always initialize it when entering
14208 into yylex, as SC_EPILOGUE is activated *before* the corresponding
14209 yylex invocation. An alternative would be making it static, but
14210 then it starts with the second %%'s beginning, instead of its end.
14212 2003-02-28 Paul Eggert <eggert@twinsun.com>
14214 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
14215 around a UnixWare 7.1.1 porting bug reported by John Hughes in
14216 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
14218 2003-02-26 Paul Eggert <eggert@twinsun.com>
14220 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
14221 Remove Sequent/Pyramid discussion (nobody uses them any more).
14222 Merge VMS and MS-DOS discussion; these ports may well be dead
14223 but let's keep mentioning them for now. Put <> around email
14224 addresses. Add copyright notice.
14226 2003-02-24 Paul Eggert <eggert@twinsun.com>
14228 * data/glr.c (yy_reduce_print): yylineno -> yylno,
14229 to avoid collision with flex use of yylineno.
14230 Problem reported by Bruce Lilly in
14231 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
14232 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
14233 * data/yacc.c (yy_reduce_print): Likewise.
14235 * config/depcomp: Sync with Automake 1.7.3.
14237 2003-02-21 Akim Demaille <akim@epita.fr>
14239 * data/lalr1.cc: Use temporary variables instead of casts to
14240 change integer types.
14241 Suggested by Paul Eggert.
14243 2003-02-21 Akim Demaille <akim@epita.fr>
14245 * doc/bison.texinfo: Use "location" consistently to refer to @n,
14246 to avoid confusions with lalr1.cc's notion of Position.
14247 Suggested by Paul Eggert.
14249 2003-02-20 Akim Demaille <akim@epita.fr>
14251 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
14252 before initial_columns.
14253 (location.hh): Use consistent variable names when defining the
14255 Use "last" so that we subtract from Positions, not from unsigned.
14257 2003-02-20 Akim Demaille <akim@epita.fr>
14259 * data/lalr1.cc (position.hh): New subfile, including the extended
14260 and Doxygen'ed documentation of class Position.
14261 (location.hh): Use it.
14262 Document a` la Doxygen.
14263 With the help of Benoit Perrot.
14265 2003-02-20 Akim Demaille <akim@epita.fr>
14267 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
14269 Redefine AT_YYERROR_SEES_LOC_IF using it.
14270 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
14272 Don't use the location in yy::Parser::error_ and
14273 yy::Parser::print_ when not %locations.
14274 Activate more lalr1.cc tests.
14276 2003-02-19 Akim Demaille <akim@epita.fr>
14278 * data/lalr1.cc: When displaying a line number, be sure to make it
14281 2003-02-19 Akim Demaille <akim@epita.fr>
14283 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
14285 (YYABORT, YYACCEPT, YYERROR): New.
14286 * tests/calc.at: Renable the lalr1.cc test.
14288 2003-02-19 Akim Demaille <akim@epita.fr>
14290 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
14291 error recovery, mixing with/without pops and discarding of the
14294 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
14296 2003-02-17 Paul Eggert <eggert@twinsun.com>
14298 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
14299 * tests/testsuite.at (AT_COMPILE): Use them.
14300 This fixes the testsuite problem reported by Robert Lentz in
14301 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
14303 2003-02-12 Paul Eggert <eggert@twinsun.com>
14305 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
14306 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
14307 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
14308 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
14309 Check for malloc failure, for consistency with yacc.c.
14310 (yytname_size): Remove, for consistency with yacc.c.
14312 The bug still remains in data/lalr1.cc, as I didn't have time
14315 2003-02-06 Akim Demaille <akim@epita.fr>
14317 * configure.ac (GXX): Rename as...
14318 (CXX): this, to keep the original Autoconf semantics.
14320 * data/lalr1.cc: Fix b4_copyright invocations.
14321 If YYDEBUG is not defined, don't depend upon name_ being defined.
14322 (location.hh): Include string and iostream.
14323 (Position::filename): New member.
14324 (Position::Position ()): New.
14325 (operator<< (Position)): New.
14326 (operator- (Position, int)): New.
14327 (Location::first, Location::last): Rename as...
14328 (Location::begin, Location::end): these, to mock the conventional
14330 (operator<< (Location)): New.
14331 * tests/atlocal.in (CXX): New.
14332 * tests/testsuite.at (AT_COMPILE_CXX): New.
14333 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
14334 locations in a more synthetic way.
14335 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
14337 Adjust the C locations to match those from Emacs: first column is
14339 Change all the expected results.
14340 Conform to the GCS: simplify the locations when applicable.
14341 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
14342 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
14343 these CPP macros with the m4 macros new defined by...
14344 (AT_CHECK_PUSHDEFS): this, i.e.:
14345 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
14346 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
14348 (AT_CHECK_POPDEFS): Undefine them.
14349 (AT_CHECK_CALC_LALR1_CC): New.
14350 Use it for the first lalr1.cc test.
14352 2003-02-04 Akim Demaille <akim@epita.fr>
14354 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
14355 Location as is defined.
14357 2003-02-04 Akim Demaille <akim@epita.fr>
14359 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
14360 name_ being defined.
14362 2003-02-03 Paul Eggert <eggert@twinsun.com>
14364 * src/gram.h (start_symbol): Remove unused decl.
14366 Use more-consistent naming conventions for local vars.
14368 * src/derives.c (derives_compute): Change type of local var from
14369 int to rule_number.
14370 * src/gram.c (grammar_rules_partial_print): Likewise.
14371 * src/print.c (print_core): Likewise.
14372 * src/reduce.c (reduce_grammar_tables): Likewise.
14374 * src/gram.c (grammar_dump): Change name of item_number *
14375 local var from r to rp.
14376 * src/nullable.c (nullable_compute): Likewise.
14378 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
14380 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
14381 for symbol or symbol_number var.
14382 * src/reader.c (grammar_start_symbol_set): Likewise.
14383 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
14385 * src/state.c (transitions_to): Likewise.
14386 * src/state.h: Likewise.
14387 * src/tables.c (symbol_number_to_vector_number): Likewise.
14389 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
14392 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
14395 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
14398 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
14399 Use str, not s, for char * var. Use ch, not c, for character var.
14400 Use size for size var.
14402 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
14404 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
14406 * src/uniqstr.h: Likewise.
14408 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
14409 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
14410 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
14411 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
14412 param to have same name as that of enum, so that we don't use
14413 "s" to stand for a non-state.
14415 2003-02-02 Akim Demaille <akim@epita.fr>
14417 * src/scan-skel.l: Scan more than one inert character per yylex
14420 2003-02-01 Paul Eggert <eggert@twinsun.com>
14424 * po/LINGUAS: Add ms.
14426 2003-01-30 Akim Demaille <akim@epita.fr>
14428 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
14430 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14432 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
14435 Changes in response to error report by S. Eken: GLR mode does not
14436 handle negative $ indices or $ indices in embedded rules correctly.
14437 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
14439 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
14440 (b4_rhs_location): Ditto.
14441 (yyfill): New function to copy from stack tree into array
14443 (yyuserAction): Modify to allow incremental move of semantic values
14444 to rhs array when in GLR mode.
14445 Define YYFILL to use in user-defined actions to fill semantic array
14447 Remove dummy use of yystack, as there is now a guaranteed use.
14448 (yydoAction): Modify to allow incremental move of semantic values
14449 to rhs array when in GLR mode.
14450 (yyresolveAction): Ditto.
14451 (yyglrShiftDefer): Update comment.
14452 (yyresolveStates): Use X == NULL for pointers, not !X.
14453 (yyglrReduce): Ditto.
14454 (yydoAction): Ditto
14456 * tests/glr-regr1.at: Rename to ...
14457 * tests/glr-regression.at: Add new regression test for the problems
14458 described above (adapted from S. Eken).
14459 Update copyright notice.
14460 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
14461 * tests/Makefile.am: Ditto.
14463 2003-01-28 Paul Eggert <eggert@twinsun.com>
14465 * data/lalr1.cc: Do not use @output_header_name@ unless
14466 b4_defines_flag is set. This fixes two bugs reported by
14468 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
14469 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
14471 2003-01-21 Paul Eggert <eggert@twinsun.com>
14473 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
14474 we don't need to worry about yyerrlab1 being reported as an
14475 "unused label" by non-GCC C compilers. The downside is that if
14476 locations are used then a couple of statements are duplicated each
14477 time YYERROR is invoked, but the upside is that the warnings
14479 (yyerrlab1): Move code to YERROR.
14480 (yyerrlab2): Remove. Change uses back to yyerrlab1.
14481 This reverts some of the 2002-12-27 change.
14483 2003-01-17 Paul Eggert <eggert@twinsun.com>
14485 * src/output.c (symbol_printers_output): Fix typo that led
14486 to core dump. Problem reported by Antonio Rus in
14487 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
14489 2003-01-13 Akim Demaille <akim@epita.fr>,
14490 Quoc Peyrot <chojin@lrde.epita.fr>,
14491 Robert Anisko <anisko_r@lrde.epita.fr>
14493 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
14494 when the stacks contain one element, as the loop would otherwise
14495 free the last state, and then use the top state (the one we just
14496 popped). This means that the initial elements will not be freed
14497 explicitly, as is the case in yacc.c; it is not a problem, as
14498 these elements have fake values.
14500 2003-01-11 Paul Eggert <eggert@twinsun.com>
14502 * NEWS: %expect-violations are now just warnings, reverting
14503 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
14504 bootstrapping problem reported by Matthias Klose; see
14505 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
14506 * src/conflicts.c (conflicts_print): Likewise.
14507 * tests/conflicts.at (%expect not enough, %expect too much,
14508 %expect with reduce conflicts): Likewise.
14509 * doc/bison.texinfo (Expect Decl): Document this. Also mention
14510 that the warning is enabled if the number of conflicts changes
14511 (not necessarily increases).
14513 * src/getargs.c (version): Update copyright year.
14515 2003-01-09 Akim Demaille <akim@epita.fr>
14517 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
14519 2003-01-08 Paul Eggert <eggert@twinsun.com>
14521 * Makefile.maint (WGETFLAGS):
14522 New macro, containing "-C off" to disable proxy caches.
14523 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
14524 (rel-check): Use $(WGET) instead of wget.
14526 2003-01-06 Paul Eggert <eggert@twinsun.com>
14528 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
14529 the GLR paper of Scott, Johnstone and Hussain.
14531 2003-01-04 Paul Eggert <eggert@twinsun.com>
14533 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
14534 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
14535 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
14536 (EXTRA_LIBRARIES): New var, for liby.a.
14537 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
14538 (EXTRA_SCRIPTS): New var, for yacc.
14540 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
14541 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
14542 Problem reported by Nelson H. F. Beebe.
14544 2003-01-03 Paul Eggert <eggert@twinsun.com>
14546 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
14547 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
14548 when compiling Bison 1.875's `bitset bset = obstack_alloc
14549 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
14551 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
14552 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
14553 grow to a huge size with typical invocation.
14555 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
14556 Use the pattern recommended by Autoconf 2.57, except also protect
14557 against double-definition.
14558 * src/system.h: Likewise.
14559 Portability issues reported by Nelson H. F. Beebe.
14561 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
14562 All uses changed. Provide a definition in both C and C++.
14563 (yytrue, yyfalse): Define even if defined (__cplusplus).
14565 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
14566 Reported by Nelson H. F. Beebe.
14568 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
14570 2003-01-02 Paul Eggert <eggert@twinsun.com>
14572 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
14573 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
14574 Bug reported by Nelson H. F. Beebe.
14576 2003-01-01 Paul Eggert <eggert@twinsun.com>
14580 2002-12-30 Paul Eggert <eggert@twinsun.com>
14582 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
14584 (<INITIAL>","): Here. This causes stray "," to be treated
14587 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
14588 last brace in braced code when not in Yacc mode, for compatibility
14589 with Bison 1.35. This resurrects the 2001-12-15 patch to
14592 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
14593 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
14595 2002-12-28 Paul Eggert <eggert@twinsun.com>
14597 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
14598 that of SYM's type. This fixes Debian bug 168069, reported by
14601 2002-12-28 Paul Eggert <eggert@twinsun.com>
14605 Switch back to the Yacc style of conflict reports, undoing some
14606 of the 2002-07-30 change.
14607 * doc/bison.texinfo (Understanding): Use Yacc style for
14608 conflict reports. Also, use new way of locating rules.
14609 * src/conflicts.c (conflict_report):
14610 Renamed from conflict_report_yacc, removing the old
14611 'conflict_report'. Translate the entire conflict report at once,
14612 so that we don't assume that "," has the same interpretation in
14614 (conflicts_output): Use Yacc-style conflict report for each state,
14615 instead of our more-complicated style.
14616 (conflicts_print): Use Yacc-style conflict report, except print
14617 the input file name when not emulating Yacc.
14618 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
14619 Conflicted Reduction, %expect not enough, %expect too much,
14620 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
14621 * tests/existing.at (GNU Cim Grammar): Likewise.
14622 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
14624 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
14625 fatal): Don't invoke fflush; it's not needed and it might even be
14626 harmful for stdout, as stdout might not be open.
14627 * src/reduce.c (reduce_print): Likewise.
14629 2002-12-27 Paul Eggert <eggert@twinsun.com>
14631 Fix a bug where error locations were not being recorded correctly.
14632 This problem was originally reported by Paul Hilfinger in
14633 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
14635 * data/yacc.c (yyparse): New local var yylerrsp, to record the
14636 top of the location stack's error locations.
14637 (yyerrlab): Set it. When discarding a token, push its location
14638 onto yylerrsp so that we don't lose track of the error's end.
14639 (yyerrlab1): Now is only the target of YYERROR, so that we can
14640 properly record the location of the action that failed. For GCC
14641 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
14642 GCC warning about yyerrlab1 being unused if YYERROR is unused.
14643 (yyerrlab2): New label, which yyerrlab now falls through to.
14644 Compute the error's location by applying YYLLOC_DEFAULT to
14645 the locations of all the symbols that went into the error.
14646 * doc/bison.texinfo (Location Default Action): Mention that
14647 YYLLOC_DEFAULT is also invoked for syntax errors.
14648 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
14649 Error locations include the locations of all the tokens that were
14650 discarded, not just the last token.
14652 2002-12-26 Paul Eggert <eggert@twinsun.com>
14654 * src/files.c: Include quote.h.
14655 (compute_output_file_names): Warn if we detect conflicting
14656 outputs to the same file. This should catch the misunderstanding
14657 exemplified by Debian Bug 165349, reported by Bruce Stephens..
14659 * src/conflicts.c (conflicts_print): If the user specifies
14660 "%expect N", report an error if there are any reduce/reduce
14661 conflicts. This is what the manual says should happen.
14662 This fixes Debian bug 130890, reported by Anthony DeRobertis.
14663 * tests/conflicts.at (%expect with reduce conflicts): New test.
14665 Don't use m4_include on relative file names, as it doesn't work as
14666 desired if there happens to be a file with that name under ".".
14668 * m4sugar/version.m4: Remove; it was included but it wasn't used.
14669 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
14670 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
14671 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
14672 * src/output.c (output_skeleton): Use full path names when
14673 specifying a file to include; don't rely on include path, as
14674 it's unreliable when the working file contains a file with
14677 2002-12-25 Paul Eggert <eggert@twinsun.com>
14679 Remove obsolete references to bison.simple and bison.hairy.
14680 Problem mentioned by Aubin Mahe in
14681 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
14682 * data/glr.c: Comment fix.
14683 * doc/bison.1: Remove references. Also, mention "yacc".
14685 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
14688 * src/parse-gram.y (declaration): Use enum "report_states" rather
14689 than its numeric value 1.
14691 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
14692 opening a new one. This fixes Debian bug 165349, reported by
14695 2002-12-24 Paul Eggert <eggert@twinsun.com>
14699 * Makefile.maint (cvs-update): Don't assume that the shell
14700 supports $(...), as Solaris sh doesn't.
14702 * src/parse-gram.y (lloc_default): Remove test for empty
14703 nonterminals at the end, since it didn't change the result.
14705 2002-12-24 Paul Eggert <eggert@twinsun.com>
14707 If the user does not define YYSTYPE as a macro, Bison now declares it
14708 using typedef instead of defining it as a macro. POSIX requires this.
14709 For consistency, YYLTYPE is also declared instead of defined.
14711 %union directives can now have a tag before the `{', e.g., the
14712 directive `%union foo {...}' now generates the C code
14713 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
14714 The default union tag is `YYSTYPE', for compatibility with Solaris 9
14715 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
14716 instead of `yyltype'.
14718 `yystype' and `yyltype' are now obsolescent macros instead of being
14719 typedefs or tags; they are no longer documented and will be
14720 withdrawn in a future release.
14722 * data/glr.c (b4_location_type): Remove.
14723 (YYSTYPE): Renamed from yystype.
14724 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
14725 (struct YYLTYPE): Renamed from struct yyltype.
14726 (YYLTYPE): Renamed from yyltype.
14727 (yyltype, yystype): New (and obsolescent) macros,
14728 for backward compatibility.
14729 * data/yacc.c: Likewise.
14731 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
14732 does not specify a union tag. This is for compatibility with
14735 * src/parse-gram.y (add_param): 2nd arg is now char * not char
14736 const *, since it is now modified by stripping surrounding { }.
14737 (current_braced_code): Remove.
14738 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
14739 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
14740 trailing " {...}". Now of type <chars>.
14741 (grammar_declaration): Adjust to bundled tokens.
14742 (code_content): Remove; stripping is now done by add_param.
14743 (print_token_value): Print contents of bundled tokens.
14744 (token_name): New function.
14746 * src/reader.h (braced_code, current_braced_code): Remove.
14747 (token_name): New decl.
14749 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
14750 token_type, not braced_code code_kind. All uses changed.
14751 (SC_PRE_CODE): New state, for scanning after a keyword that
14752 has (or usually has) an immediately-following braced code.
14753 (token_type): New local var, to keep track of which token type
14754 to return when scanning braced code.
14755 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
14756 <INITIAL>"%parse-param", <INITIAL>"%printer",
14757 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
14758 instead of returning a token type immediately.
14759 (<INITIAL>"{"): Set token type.
14760 (<SC_BRACED_CODE>"}"): Use it.
14761 (handle_action_dollar, handle_action_at): Now returns bool
14762 indicating success. Fail if ! current_rule; this prevents a core dump.
14763 (handle_symbol_code_dollar, handle_symbol_code_at):
14764 Remove; merge body into caller.
14765 (handle_dollar, handle_at): Complain in invalid contexts.
14767 * NEWS, doc/bison.texinfo: Document the above.
14768 * NEWS: Fix years and program names in copyright notice.
14770 2002-12-17 Paul Eggert <eggert@twinsun.com>
14772 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
14773 Reporting, Table of Symbols): Omit mentions of %lex-param and
14774 %parse-param from the documentation for now.
14776 2002-12-15 Paul Eggert <eggert@twinsun.com>
14778 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
14779 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
14780 lookahead symbol, and which sets yychar in parser actions) and it
14781 disagreed with the Bison documentation. Bug
14782 reported by Andrew Walrond.
14784 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
14785 as the caller now does that.
14786 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
14787 (YYEMPTY): Parenthesize right hand side, since others use it.
14788 (yyparse): Don't assume that our generated code is the only code
14791 2002-12-13 Paul Eggert <eggert@twinsun.com>
14795 POSIX requires a "yacc" command.
14796 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
14797 (MOSTLYCLEANFILES): Add yacc.
14799 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
14800 as an alias for bison y.
14802 * po/LINGUAS: Add da.
14804 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
14805 problem with latest <getopt.h>.
14806 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
14808 * doc/fdl.texi: Upgrade to 1.2.
14809 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
14810 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
14811 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
14813 * config/install-sh: Sync with autotools.
14815 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
14816 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
14817 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
14818 locations are requested.
14819 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
14820 locations are requested.
14822 2002-12-12 Paul Eggert <eggert@twinsun.com>
14824 Remove unportable casts and storage allocation tricks.
14825 While we're at it, remove almost all casts, since they
14826 usually aren't needed and are a sign of trouble.
14828 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
14830 * src/derives.c (derives_compute): Do not subtract NTOKENS from
14831 the pointer DSET returned by malloc; this isn't portable.
14832 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
14833 Similarly for DERIVES.
14834 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
14835 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
14836 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
14838 * src/derives.c (derives_compute): Do not bother invoking
14839 int_of_rule_number, since rule numbers are integers.
14841 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
14842 rather than XMALLOC (char, N).
14844 * src/files.c (filename_split): Rewrite to avoid cast.
14846 * src/gram.h (symbol_number_as_item_number,
14847 item_number_as_symbol_number, rule_number_as_item_number,
14848 item_number_as_rule_number):
14849 Now inline functions rather than macros, to avoid casts.
14850 * src/state.h (state_number_as_int): Likewise.
14851 * src/tables.c (state_number_to_vector_number,
14852 symbol_number_to_vector_number): Likewise.
14854 * src/gram.h (int_of_rule_number): Remove; no longer used.
14856 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
14857 since the resulting storage is always stored into.
14859 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
14862 * src/muscle_tab.c (muscle_m4_output):
14863 Now inline. Return bool, not int.
14864 * src/state.c (state_compare): Likewise.
14865 * src/symtab.c (symbol_check_defined,
14866 symbol_check_alias_consistency, symbol_pack, symbol_translation,
14867 hash_compare_symbol, hash_symbol):
14869 * src/uniqstr.c (uniqstr_print): Likewise.
14870 * src/muscle_tab.c (muscle_m4_output_processor):
14871 New function, to avoid casts.
14872 * src/state.c (state_comparator, stage_hasher): Likewise.
14873 * src/symtab.c (symbol_check_defined_processor,
14874 symbol_check_alias_consistency_processor, symbol_pack_processor,
14875 symbol_translation_processor, hash_symbol_comparator,
14876 hash_symbol_hasher): Likewise.
14877 * src/uniqstr.c (uniqstr_print_processor): Likewise.
14878 * src/muscle_tab.c (muscles_m4_output):
14879 Use new functions instead of casting old functions unportably.
14880 * src/state.c (state_hash_new): Likewise.
14881 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
14882 symbols_token_translations_init):
14884 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
14886 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
14887 var instead of casting to long, to avoid casts.
14888 (prepare_states): Use MALLOC rather than alloca, so that we don't
14889 have to worry about alloca.
14890 * src/state.c (state_hash_lookup): Likewise.
14892 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
14893 local var instead of casting to unsigned char, to avoid casts.
14895 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
14896 STATE_ALLOC): Remove.
14897 (transitions_new, errs_new, reductions_new, state_new): Use malloc
14898 rather than calloc, and use offsetof to avoid allocating slightly
14900 (state_new): Initialize all members.
14902 * src/state.c (state_hash): Use unsigned accumulator, not signed.
14904 * src/symtab.c (symbol_free): Remove; unused.
14905 (symbol_get): Remove cast in lhs of assignment.
14906 (symbols_do): Now static. Accept generic arguments, not
14907 hashing-related ones.
14909 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
14910 (symbol_processor): Remove.
14911 (symbols_do): Remove decl; now static.
14913 * src/system.h (alloca): Remove; decl no longer needed.
14914 (<stddef.h>): Include, for offsetof.
14915 (<inttypes.>, <stdint.h>): Include if available.
14916 (uintptr_t): New type, if system lacks it.
14917 (CALLOC, MALLOC, REALLOC): New macros.
14918 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
14921 * src/tables.c (table_size): Now int, to pacify GCC.
14922 (table_grow, table_ninf_remap): Use signed table size.
14923 (save_row): Don't bother initializing locals when not needed.
14924 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
14925 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
14927 * src/vcg.h: Correct misspellings.
14929 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
14932 * src/getargs.c (getargs): Don't assume EOF == -1.
14934 2002-12-09 Paul Eggert <eggert@twinsun.com>
14936 Change identifier spellings to avoid collisions with names
14937 that are reserved by POSIX.
14939 Don't use names ending in _t, since POSIX reserves them.
14940 For consistency, remove _e and _s endings -- they're weren't
14941 needed to remove ambiguity. All uses changed.
14942 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
14943 turn was just renamed from struniq_t.
14944 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
14945 which in turn was just renamed from struniq_processor_t.
14946 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
14947 in turn was renamed from hash_compare_struniq_t.
14948 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
14949 (state_list): Renamed from state_list_t.
14950 * src/assoc.h (assoc): Renamed from assoc_t.
14951 * src/conflicts.c (enum conflict_resolution): Renamed from
14952 enum conflict_resolution_e.
14953 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
14954 (rule_list): Renamed from rule_list_t.
14955 * src/getargs.h (enum trace): Renamed from enum trace_e.
14956 (enum report): Renamed from enum report_e.
14957 * src/gram.h (item_number): Renamed from item_number_t.
14958 (rule_number): Renamed from rule_number_t.
14959 (struct rule_s): Remove the "rule_s" part; not used.
14960 (rule): Renamed from rule_t.
14961 (rule_filter): Renamed from rule_filter_t.
14962 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
14963 (goto_list): Renamed from goto_list_t.
14964 * src/lalr.h (goto_number): Renamed from goto_number_t.
14965 * src/location.h (location): Renamed from location_t.
14966 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
14967 and moved here from:
14968 * src/muscle_tab.h (muscle_entry_t): here.
14969 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
14970 (rule_list): Renamed from rule_list_t.
14971 * src/print_graph.c (static_graph): Renamed from graph.
14972 * src/reader.h (braced_code): Renamed from braced_code_t.
14973 Remove brace_code_e tag.
14974 * src/relation.h (relation_node): Renamed from relation_node_t.
14975 (relation_nodes): Renamed from relation_nodes_t.
14976 (relation): Renamed from relation_t.
14977 * src/state.h (state_number): Renamed from state_number_t.
14978 (struct state): Renamed from struct state_s.
14979 (state): Renamed from state_t.
14980 (transitions): Renamed from transitions_t. Unused (and
14981 misspelled) transtion_s tag removed.
14982 (errs): Renamed from errs_t. Unused errs_s tag removed.
14983 (reductions): Renamed from reductions_t. Unused tag
14984 reductions_s removed.
14985 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
14986 (struct symbol_list): Renamed from struct symbol_list_s.
14987 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
14988 (struct symbol): Renamed from struct symbol_s.
14989 (symbol): Renamed from symbol_t.
14990 * src/tables.c (vector_number): Renamed from vector_number_t.
14991 (action_number): Renamed from action_t.
14992 * src/tables.h (base_number): Renamed from base_t.
14993 * src/vcg.h (enum color): Renamed from enum color_e.
14994 (enum textmode): Renamed from enum textmode_e.
14995 (enum shape): Renamed from enum shape_e.
14996 (struct colorentry): Renamed from struct colorentry_s.
14997 (struct classname): Renamed from struct classname_s.
14998 (struct infoname): Renamed from struct infoname_s.
14999 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
15000 (enum decision): Renamed from enum decision_e.
15001 (enum orientation): Renamed from enum orientation_e.
15002 (enum alignment): Renamed from enum alignment_e.
15003 (enum arrow_mode): Renamed from enum arrow_mode_e.
15004 (enum crossing_type): Renamed from enum crossing_type_e.
15005 (enum view): Renamed from enum view_e.
15006 (struct node): Renamed from struct node_s.
15007 (node): Renamed from node_t.
15008 (enum linestyle): Renamed from enum linestyle_e.
15009 (enum arrowstyle): Renamed from enum arrowstyle_e.
15010 (struct edge): Renamed from struct edge.
15011 (edge): Renamed from edge_t.
15012 (struct graph): Renamed from struct graph_s.
15013 (graph): Renamed from graph_t.
15014 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
15015 Rename value_t -> value.
15016 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
15017 value_t_as_yystype -> value_as_yystype.
15019 Don't include <errno.h> in the mainstream code, since it
15020 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
15021 * lib/get-errno.c, lib/get-errno.h: New files.
15022 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
15024 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
15025 * src/output.c (output_skeleton): Likewise.
15026 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
15028 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
15030 (handle_action_dollar, handle_action_at): Likewise.
15031 * src/system.h: Do not include <errno.h>.
15032 (TAB_EXT): Renamed from EXT_TAB.
15033 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
15035 Avoid str[a-z]*, since <string.h> reserves that name space.
15036 Change all instances of "struniq" in names to "uniqstr", and
15037 likewise for "STRUNIQ" and "UNIQSTR".
15038 * src/uniqstr.c: Renamed from src/struniq.c.
15039 * src/uniqstr.h: Renamed from src/struniq.h.
15040 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
15041 * src/files.c (strsuffix): Remove; unused.
15042 (concat2): Renamed from stringappend. Now static.
15043 * src/files.h (strsuffix, stringappend): Remove; unused.
15044 * src/parse-gram.y (<chars>): Renamed from <string>.
15045 (<uniqstr>): Renamed from <struniq>.
15046 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
15047 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
15048 (struct graph_s.expand): Renamed from struct graph_s.stretch.
15049 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
15050 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
15051 (N_EXPAND): Renamed from N_STRETCH.
15053 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
15054 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
15055 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
15057 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
15058 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
15059 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
15060 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
15061 (BASE_MAXIMUM): Renamed from BASE_MAX.
15062 (BASE_MINIMUM): Renamed from BASE_MIN.
15063 (ACTION_MAX): Remove; unused.
15064 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
15065 Unnecessary casts removed from above defines.
15068 Fix misspelling in names.
15069 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
15070 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
15074 * lib/timevar.c (timevar_report): Renamed from time_report,
15075 for consistency with other names.
15076 * lib/timevar.h (timevar_report): New decl.
15077 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
15080 Sort include-file uses.
15082 Reorder all include files under src to be in the order "system.h".
15083 then the ../lib include files in angle brackets (alphabetized),
15084 then the . include files in double-quotes (alphabetized). Fix
15085 dependency breakages encountered in this process, as follows:
15086 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
15087 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
15088 * src/state.h: Include "symtab.h".
15090 2002-12-08 Paul Eggert <eggert@twinsun.com>
15092 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
15093 since this causes problems when __file__ contains character
15094 sequences like "@" that are treated specially by src/scan-skel.l.
15095 Instead, just use the file's basename. This fixes the bug
15096 reported by Martin Mokrejs in
15097 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
15099 2002-12-06 Paul Eggert <eggert@twinsun.com>
15101 Add support for rules that do not have trailing semicolons, as
15102 POSIX requires. Improve the quality of locations in Bison
15105 * src/location.c: Include <quotearg.h>.
15106 (empty_location): Now const.
15107 (location_print): New function. Follow the recommendation of the
15108 GNU Coding Standards for locations that span file boundaries.
15109 * src/location.h: Do not include <quotearg.h>; no longer needed.
15110 (boundary): New type.
15111 (location_t): Use it. This allows locations to span file boundaries.
15112 All member uses changed: file -> start.file or end.file (as needed),
15113 first_line -> start.line, first_column -> start.column,
15114 last_line -> end.line, last_column -> end.column.
15115 (equal_boundaries): New function.
15116 (LOCATION_RESET, LOCATION_STEP): Remove.
15117 (LOCATION_PRINT): Remove. All callers changed to use location_print.
15118 (empty_location): Now const.
15119 (location_print): New decl.
15120 * src/parse-gram.y (lloc_default): New function, which handles
15121 empty locations more accurately.
15122 (YYLLOC_DEFAULT): Use it.
15123 (%token COLON): Remove.
15124 (%token ID_COLON): New token.
15126 (declarations, rules): Remove trailing semicolon.
15127 (declaration, rules_or_grammar_declaration):
15128 Allow empty (";") declaration.
15129 (symbol_def): Remove empty actions; no longer needed.
15130 (rules_or_grammar_declaration): Remove trailing semicolon.
15131 (semi_colon.opt): Remove.
15132 * src/reader.h: Include location.h.
15133 (scanner_cursor): New decl.
15134 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
15136 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
15138 (STEP): Remove. No longer needed, now that adjust_location does
15139 the work. All uses removed.
15140 (scanner_cursor): New var.
15141 (adjust_location): Renamed from extend_location. It now sets
15142 *loc and adjusts the scanner cursor. All uses changed.
15143 Don't bother testing for CR.
15144 (handle_syncline): Remove location arg; now updates scanner cursor.
15145 All callers changed.
15146 (unexpected_end_of_file): Now accepts start boundary of token or
15147 comment, not location. All callers changed. Update scanner cursor,
15149 (SC_AFTER_IDENTIFIER): New state.
15150 (context_state): Renamed from c_context. All uses changed.
15151 (id_loc, code_start, token_start): New local vars.
15152 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
15153 processing of Yacc white space and equivalents here.
15154 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
15155 instead of returning ID immediately, since we need to search for
15156 a subsequent colon.
15157 (<INITIAL>"'", "\""): Save token_start.
15158 (<INITIAL>"%{", "{", "%%"): Save code_start.
15159 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
15160 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
15161 BEGIN context_state at end, not INITIAL.
15162 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
15163 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
15164 Return correct token start.
15165 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
15166 the start of a character, string or multiline comment is found.
15167 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
15168 Reduction): Adjust reported locations to match the more-precise
15169 results now expected.
15170 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
15171 * tests/reduce.at (Useless Rules, Reduced Automaton,
15172 Underivable Rules): Likewise.
15173 * tests/regression.at (Invalid inputs): No longer `expecting ";"
15174 or "|"' now that so many other tokens are allowed by the new grammar.
15176 * src/complain.h (current_file): Remove duplicate decl;
15177 current_file is now owned by files.h.
15178 * src/complain.c, src/scan-gram.l: Include files.h.
15180 2002-12-06 Paul Eggert <eggert@twinsun.com>
15182 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
15183 promotes to int; it might be unsigned int.
15184 * data/yacc.c (yy_reduce_print): Likewise.
15186 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
15187 be #defined in the prologue, not in the Bison declarations.
15188 This fixes Debian Bug 102878, reported by Shaul Karl.
15190 2002-12-02 Paul Eggert <eggert@twinsun.com>
15192 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
15193 * lib/strtoul.c: New file, from gnulib.
15194 This fixes a porting bug reported by Peter Klein in
15195 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
15197 2002-11-30 Paul Eggert <eggert@twinsun.com>
15199 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
15200 and put only a forward declaration in the prologue. This is for
15201 consistency with the other scanner helper functions.
15203 Type clashes now generate warnings, not errors, since it
15204 appears that POSIX may allow some grammars with type clashes.
15205 * src/reader.c (grammar_current_rule_check): Warn about
15206 type clashes instead of complaining.
15207 * tests/input.at (Type Clashes): Expect warnings, not complaints.
15209 Add Yacc library, since POSIX requires it.
15210 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
15211 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
15212 * lib/main.c, lib/yyerror.c: New files.
15214 gram_error can be static; it need not be extern.
15215 * src/reader.h (gram_error): Remove decl.
15216 * src/parse-gram.y (gram_error): Now static. Add static decl.
15217 (print_token_value): Omit parameter names from forward decl,
15220 2002-11-29 Paul Eggert <eggert@twinsun.com>
15222 * doc/bison.texinfo: Emphasize that yylex and yyerror must
15223 be declared before being used. E.g., one should typically
15224 declare them in the prologue. Use GNU coding style in examples.
15225 Put "const" consistently after the type it modifies. Mention
15226 that C99 supports "inline". Mention that yyerror traditionally
15229 %parse-param and %lex-param now take just one argument, the
15230 declaration; the argument name is deduced from the declaration.
15232 * doc/bison.texinfo (Parser Function, Pure Calling, Error
15233 Reporting, Table of Symbols): Document this.
15234 * src/parse-gram.y (add_param): New function.
15236 (declaration): Implement new rule for %parse-param and %lex-param.
15237 * src/scan-gram.l: "," now elicits a warning, rather than being
15238 a token; this is more compatible with byacc.
15239 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
15241 2002-11-27 Paul Eggert <eggert@twinsun.com>
15243 Rename identifiers to avoid real and potential collisions.
15245 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
15246 to avoid collision with lex macro described by Bruce Lilly in
15247 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
15248 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
15249 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
15250 * src/parse-gram.y (print_token_value): Renamed from yyprint.
15252 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
15253 The name "yycontrol" violates the name space rules, and this stuff
15254 wasn't being used anyway.
15255 (input): Remove action; this stuff wasn't being used.
15256 (gram_error): Rename local variable yylloc -> loc.
15257 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
15258 (YY_DECL): Don't use "yy" at start of local variables.
15259 All uses changed, e.g., yylloc -> loc.
15260 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
15261 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
15262 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
15263 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
15265 * src/parse-gram.y (gram_error): loc is now const *.
15266 * src/reader.h (gram_error): Likewise.
15268 2002-11-24 Paul Eggert <eggert@twinsun.com>
15272 * tests/actions.at (Actions after errors): Use an output format
15273 more similar to that of the Printers and Destructors test.
15274 Test the position of the ';' token too.
15275 (Printers and Destructors): Likewise.
15276 (Printers and Destructors: %glr-parser): Remove for now, to avoid
15277 unnecessarily alarming people when the test fails.
15279 * data/yacc.c (yyerrlab1): Move this label down, so that the
15280 parser does not discard the lookahead token if the user code
15281 invokes YYERROR. This change is required for POSIX conformance.
15283 * lib/error.c: Sync with gnulib.
15285 2002-11-22 Paul Eggert <eggert@twinsun.com>
15287 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
15288 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
15289 * lib/xmalloc.c: Likewise.
15291 2002-11-20 Paul Eggert <eggert@twinsun.com>
15293 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
15295 2002-11-20 Paul Eggert <eggert@twinsun.com>
15297 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
15298 should use `if (! x) abort ();' rather than `assert (x);', and
15299 anyway it's one less thing to worry about configuring.
15301 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
15302 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
15303 and replace all instances of assert with abort.
15304 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
15305 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
15307 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
15308 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
15309 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
15310 hash_find_entry, hash_rehash, hash_insert): Likewise.
15311 * src/conflicts.c (resolve_sr_conflict): Likewise.
15312 * src/lalr.c (set_goto_map, map_goto): Likewise.
15313 * src/nullable.c (nullable_compute): Likewise.
15314 * src/output.c (prepare_rules, token_definitions_output): Likewise.
15315 * src/reader.c (packgram, reader): Likewise.
15316 * src/state.c (state_new, state_free, state_transitions_set,
15317 state_reduction_find): Likewise.
15318 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
15319 symbol_pack): Likewise.
15320 * src/tables.c (conflict_row, pack_vector): Likewise.
15321 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
15322 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
15323 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
15324 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
15326 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
15327 (ARGMATCH_CONSTRAINT): New macro.
15328 (ARGMATCH_ASSERT): Use it.
15330 * src/system.h (verify): New macro.
15331 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
15332 rather than assert.
15333 * src/tables.c (tables_generate): Likewise.
15335 * src/struniq.c (struniq_assert): Now returns void, and aborts
15336 if the assertion is false.
15337 (struniq_assert_p): Remove.
15338 * src/struniq.h: Likewise.
15340 2002-11-18 Paul Eggert <eggert@twinsun.com>
15342 * data/glr.c (yygetLRActions): Replace `yyindex' with
15343 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
15344 This fixes the regression with Sun ONE Studio 7 cc that I reported in
15345 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
15347 2002-11-18 Akim Demaille <akim@epita.fr>
15349 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
15351 From Tim Van Holder.
15353 2002-11-17 Paul Eggert <eggert@twinsun.com>
15355 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
15356 to "SyntaxError" for consistency with my 2002-11-15 change.
15358 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
15359 not define to {}, since this breaks the common use of `YYDPRINTF
15360 ((...));' if a single statement is desired (e.g. before `else').
15361 Work around GCC warnings by surrounding corresponding calls with
15363 (yyhasResolvedValue): Remove unused function.
15364 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
15366 (yyreportSyntaxError): Renamed from yyreportParseError.
15367 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
15369 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
15370 extern when possible. Remove unused initializations.
15372 2002-11-16 Akim Demaille <akim@epita.fr>
15374 Augment the similarity between GLR and LALR traces.
15376 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
15377 (YY_REDUCE_PRINT): New.
15378 (yyparse): Use them.
15379 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
15381 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
15382 state reached after the reduction/recovery, since...
15383 (yyparse, yyprocessOneStack): Report the state we are entering in.
15385 2002-11-16 Akim Demaille <akim@epita.fr>
15387 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
15388 Add support for --trace=skeleton.
15389 * src/scan-skel.l: %option debug.
15390 Scan strings of non-@ or \n instead of character by character.
15391 (scan_skel): Handle trace_skeleton.
15393 (@output_parser_name@, @output_header_name@): ``Restore'' their
15394 support (used to be M4 macros).
15395 * data/yacc.c: Quote larger chunks, a la glr.c.
15396 * data/lalr1.cc: Likewise.
15397 The header guards are no longer available, so use some other
15398 string than `YYLSP_NEEDED'.
15400 2002-11-16 Akim Demaille <akim@epita.fr>
15402 Make the ``Printers and Destructors'' test more verbose, taking
15403 `yacc.c''s behavior as (possibly wrong) reference.
15405 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
15406 instead of fprint on stdout.
15407 Set and report the last_line of the symbols.
15408 Consistently display values and locations.
15410 2002-11-16 Paul Eggert <eggert@twinsun.com>
15412 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
15414 2002-11-15 Paul Eggert <eggert@twinsun.com>
15416 * tests/actions.at (Actions after errors): New test case.
15418 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
15419 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
15420 tests/action.at, tests/calc.at, tests/conflicts.at,
15421 tests/cxx-type.at, tests/regression.at:
15422 "parse error" -> "syntax error" for POSIX compatibility.
15423 "parsing stack overflow..." -> "parser stack overflow" so
15424 that code matches Bison documentation.
15426 2002-11-15 Akim Demaille <akim@epita.fr>
15428 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
15429 take two BRACED_CODE, not two string_content.
15430 Free the scanner's obstack when we are done.
15431 (code_content): New.
15432 * tests/calc.at: Adjust.
15433 * doc/bison.texinfo: Adjust.
15434 Also, make sure to include the `,' for these declarations.
15436 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
15438 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
15439 definition; avoids potential autoreconf problems.
15441 2002-11-15 Akim Demaille <akim@epita.fr>
15443 Always check the value returned by yyparse.
15445 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
15446 returned by yyparse.
15447 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
15449 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
15450 returned by yyparse.
15452 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15454 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
15457 2002-11-14 Paul Eggert <eggert@twinsun.com>
15459 * src/output.c (output_skeleton): Call xfopen instead of
15460 duplicating xfopen's body.
15462 Fix bugs reported by Nelson H. F. Beebe in
15463 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
15465 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
15466 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
15467 Group compiler. Instead, use "$CC -E bar.c". Include the .h
15468 file twice in the grammar, as an extra check.
15470 * tests/input.at (Torturing the Scanner): Surround the
15471 backslash-newline tests with "#if 0", to make it less likely that
15472 we'll run into compiler bugs. Bring back solitary \ inside
15473 comment, but add a closing comment to work around HP C bug. Don't
15474 test backslash-newline in C character constant.
15476 2002-11-14 Akim Demaille <akim@epita.fr>
15478 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
15479 status of the compiler.
15480 Calling `exit 1' is no longer needed.
15481 Reported by Nelson H. F. Beebe.
15483 2002-11-14 Akim Demaille <akim@epita.fr>
15485 * tests/atlocal.in (CPPFLAGS): We have config.h.
15486 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
15488 * tests/actions.at, tests/calc.at, tests/conflicts.at,
15489 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
15490 * tests/regression.at, tests/torture.at: Use them for all the
15491 grammars that are to be compiled.
15492 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
15493 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
15494 * doc/bison.texinfo (GLR Parsers): Document `inline'.
15496 2002-11-14 Akim Demaille <akim@epita.fr>
15498 * doc/bison.texinfo: Various formatting changes (alignments in
15499 samples, additional @group/@end group, GCS in samples.
15500 Use @deffn instead of simple @table to define the directives,
15501 macros, variables etc.
15503 2002-11-13 Paul Eggert <eggert@twinsun.com>
15505 Fix some bugs reported by Albert Chin-A-Young in
15506 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
15508 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
15509 -o c"; the HP C compiler chatters during compilation.
15510 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
15511 * tests/headers.at (export YYLTYPE): Likewise.
15513 * tests/input.at (Torturing the Scanner): Remove lines containing
15514 solitary backslashes, as they tickle a bug in the HP C compiler.
15516 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
15517 comments, since they're not portable. Use GNU coding style.
15519 2002-11-13 Akim Demaille <akim@epita.fr>
15521 * data/yacc.c: Leave bigger chunks of quoted text.
15522 (YYDSYMPRINTF): New.
15523 Use it to report symbol activities.
15524 * data/glr.c (YYDSYMPRINTF): New.
15527 2002-11-12 Paul Eggert <eggert@twinsun.com>
15531 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
15532 (yyglrReduce): Return yyok, not 0.
15533 This should avoid the enumerated-type warnings reported
15534 by Nelson H. F. Beebe in
15535 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
15537 * lib/bbitset.h (BITSET_INLINE): Remove.
15538 * lib/bitset.h [! BITSET_INLINE]: Remove.
15539 (bitset_set, bitset_reset, bitset_test): Rename local vars
15540 to avoid shadowing warnings by GCC.
15542 * data/glr.c (inline): Remove #define. It's the user's
15543 responsibility to #define it away, just like 'const'.
15544 This fixes one of the bugs reported by Nelson H. F. Beebe in
15545 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
15547 * Makefile.maint (po-check): Scan .l and .y files instead of the
15548 .c and the .h files that they generate. This fixes the bug
15549 reported by Tim Van Holder in:
15550 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
15551 Look for N_ as well as for _. Try to avoid matching #define for
15553 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
15554 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
15555 * src/scan-gram.l: Revamp regular expressions so that " and '
15556 do not confuse xgettext.
15558 * src/struniq.h (struniq_new): Do not declare the return type
15559 to be 'const'; this violates the C standard.
15560 * src/struniq.c (struniq_new): Likewise.
15562 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
15564 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
15565 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
15568 2002-11-12 Akim Demaille <akim@epita.fr>
15570 * Makefile.maint: Sync with Autoconf:
15571 (local_updates): New.
15573 2002-11-12 Akim Demaille <akim@epita.fr>
15575 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
15577 2002-11-12 Akim Demaille <akim@epita.fr>
15579 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
15582 2002-11-12 Akim Demaille <akim@epita.fr>
15584 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
15587 2002-11-12 Akim Demaille <akim@epita.fr>
15589 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
15590 Use it to test the GLR parser.
15592 2002-11-12 Akim Demaille <akim@epita.fr>
15594 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
15596 * data/glr.c (yystos): New.
15597 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
15598 (YYDSYMPRINT): New.
15599 (yyval): Don't define it, it is handled via M4.
15600 (yyrecoverParseError): Free verbosely the discarded symbols.
15601 * data/yacc.c (yysymprint): Remove, rather...
15602 (b4_yysymprint_generate): invoke.
15603 * data/c.m4 (b4_yysymprint_generate): New.
15604 Accept pointers as arguments, as opposed to the version from
15606 (b4_yydestruct_generate): Likewise.
15607 * tests/cations.at (Printers and Destructors): Use Bison directives
15608 instead of CPP macros.
15609 Don't rely on internal details.
15611 2002-11-12 Akim Demaille <akim@epita.fr>
15613 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
15614 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
15615 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
15616 it against YYEMPTY and so forth), work on yytoken (i.e., set
15617 it to YYEMPTY etc.).
15618 (yydestruct): Replace with a b4_yydestruct_generate invocation.
15619 (b4_symbol_actions): Remove.
15620 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
15621 for 0, end-of-input.
15623 2002-11-12 Akim Demaille <akim@epita.fr>
15625 * doc/bison.texinfo (Destructor Decl): New.
15627 2002-11-12 Akim Demaille <akim@epita.fr>
15629 * src/tables.c (tables_generate): Use free for pointers that
15630 cannot be NULL, not XFREE.
15631 (pack_vector): Use assert, not fatal, for bound violations.
15632 * src/state.c (state_new): Likewise.
15633 * src/reader.c (reader): Likewise.
15634 * src/lalr.c (set_goto_map): Likewise.
15635 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
15638 2002-11-12 Akim Demaille <akim@epita.fr>
15640 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
15642 * src/scan-gram.l (last_string): Is global to the file, not to
15644 * src/parse-gram.y (input): Don't append the epilogue here,
15645 (epilogue.opt): do it here, and free the scanner's obstack.
15646 * src/reader.c (epilogue_set): Rename as...
15647 (epilogue_augment): this.
15648 * data/c.m4 (b4_epilogue): Defaults to empty.
15650 2002-11-12 Akim Demaille <akim@epita.fr>
15652 * src/getargs.c (long_options): Remove duplicates.
15653 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
15655 * doc/bison.rnh: Remove.
15656 * doc/bison.texinfo (VMS Invocation): Remove.
15658 2002-11-12 Akim Demaille <akim@epita.fr>
15660 * src/struniq.h, src/struniq.c (struniq_t): Is const.
15661 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
15663 Use struniq for symbols.
15665 * src/symtab.h (symbol_t): The tag member is a struniq.
15666 (symbol_type_set): Adjust.
15667 * src/symtab.c (symbol_new): Takes a struniq.
15668 (symbol_free): Don't free the tag member.
15669 (hash_compare_symbol_t, hash_symbol_t): Rename as...
15670 (hash_compare_symbol, hash_symbol): these.
15671 Use the fact that tags as struniqs.
15672 (symbol_get): Use struniq_new.
15673 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
15675 * src/reader.h (merger_list, grammar_currentmerge_set): The name
15676 and type members are struniqs.
15677 * src/reader.c (get_merge_function)
15678 (grammar_current_rule_merge_set): Adjust.
15679 (TYPE, current_type): Are struniq.
15681 Use struniq for file names.
15683 * src/files.h, src/files.c (infile): Split into...
15684 (grammar_file, current_file): these.
15685 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
15686 * src/reduce.c (reduce_print): Likewise.
15687 * src/getargs.c (getargs): Likewise.
15688 * src/complain.h, src/complain.c: Likewise.
15689 * src/main.c (main): Call struniqs_new early enough to use it for
15691 Don't free the input file name.
15693 2002-11-12 Akim Demaille <akim@epita.fr>
15695 * src/symtab.c (symbol_free): Remove dead deactivated code:
15696 type_name are properly removed.
15697 Don't use XFREE to free items that cannot be NULL.
15698 * src/struniq.h, src/struniq.c: New.
15699 * src/main.c (main): Initialize/free struniqs.
15700 * src/parse-gram.y (%union): Add astruniq member.
15702 * src/scan-gram.l (<{tag}>): Return a struniq.
15703 Free the obstack bit that used to store it.
15704 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
15706 2002-11-11 Paul Eggert <eggert@twinsun.com>
15708 Revamp to fix many (but not all) of the C- and M4-related quoting
15709 problems. Among other things, this fixes the Bison bug reported
15710 by Jan Hubicka when processing the Bash grammar; see:
15711 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
15713 Use new @ escapes consistently. Represent brackets with @{ and @}
15714 rather than @<:@ and @:>@, since this works a bit better with dumb
15715 editors like vi. Represent @ with @@, since @ is now consistently
15716 an escape. Use @oline@ and @ofile@ rather than __oline__ and
15717 __ofile__, to avoid unexpected expansions. Similarly, use @output
15718 rather than #output.
15720 * data/c.m4 (b4_copyright): Omit file name from comment, since
15721 the file name could contain "*/".
15722 (b4_synclines_flag): Don't quote the 2nd argument; it should already
15723 be quoted. All uses changed.
15725 * data/glr.c: Use new @ escapes consistently.
15726 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
15727 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
15728 Remove, since they couldn't handle arbitrary characters in file
15730 * data/lalr1.cc: Likewise.
15731 * data/yacc.c: Likewise.
15733 * src/files.c (output_infix): Remove; all uses removed.
15734 * src/files.h: Likewise.
15736 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
15737 mishandled funny characters in file names, and anyway it isn't
15739 * data/yacc.c: Likewise.
15740 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
15742 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
15743 * data/yacc.c: Likewise.
15745 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
15747 (muscle_init): Quote filename as a C string.
15748 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
15749 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
15750 * src/output.c (escaped_file_name_output): New function.
15751 (prepare_symbols): Quote tokens for M4.
15752 (prepare): Don't insert output_infix, output_prefix,
15753 output_parser_name, output_header_name; this is now down by scan-skel.
15754 Insert skeleton as a C string.
15756 * src/output.c (user_actions_output, symbol_destructors_output,
15757 symbol_printers_output): Quote filenames for C and M4.
15758 * src/reader.c (prologue_augment, epilogue_set): Likewise.
15760 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
15761 escapes other than \\ and \'; this simplifies the code.
15762 (<SC_STRING>): Likewise, for \\ and \".
15763 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
15764 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
15765 Use new escapes @{ and @} for [ and ].
15767 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
15768 them with auto vars.
15769 Switch to new escape scheme, where @ is the escape character uniformly.
15770 Abort if a stray escape character is found. Avoid unbounded input
15771 buffer when parsing non-escaped text.
15773 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
15774 __oline__, #output, $@, and @{ do not have unintended meanings.
15776 2002-11-09 Paul Eggert <eggert@twinsun.com>
15778 Fix the test failure due to GCC warnings described in
15779 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
15780 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
15781 evaluate to 0 if it's impossible for NINF to be in the respective
15783 (yygetLRActions, yyrecoverParseError): Use them.
15785 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
15786 counted in the token inserted at end of file. Now takes
15787 location_t *, not location_t, so that the location can be
15788 adjusted. All uses changed.
15790 * tests/regression.at (Invalid inputs): Adjust wording in
15791 diagnostic to match the new behavior.
15793 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
15794 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
15795 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
15796 abort ();'. This reduces the runtime of the "Many lookaheads"
15797 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
15800 2002-11-07 Paul Eggert <eggert@twinsun.com>
15802 * src/parse-gram.y (CHARACTER): Remove unused token.
15805 * src/scan-gram.l: Remove stack option. We no longer use the
15806 stack, since the stack was never deeper than 1; instead, use the
15807 new auto var c_context to record the stacked value.
15809 Remove nounput option. At an unexpected end of file, we now unput
15810 the minimal input necessary to end cleanly; this simplifies the
15813 Avoid unbounded token sizes where this is easy.
15815 (unexpected_end_of_file): New function.
15816 Use it to systematize the error message on unexpected EOF.
15817 (last-string): Now auto, not static.
15818 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
15819 (scanner_last_string_free): Remove; not used.
15820 (percent_percent_count): Move decl to just before use.
15821 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
15822 not the (never otherwised-used) CHARACTER.
15824 2002-11-07 Akim Demaille <akim@epita.fr>
15826 Let yyerror always receive the msg as last argument, so that
15827 yyerror can be variadic.
15829 * data/yacc.c (b4_yyerror_args): New.
15830 Use it when calling yyerror.
15831 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
15832 Use it when calling yyerror.
15833 * doc/bison.texinfo (Error Reporting): Adjust.
15834 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
15835 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
15837 2002-11-06 Akim Demaille <akim@epita.fr>
15839 #line should have quoted strings.
15840 Ideally, this should be done by m4_quotearg.
15842 * src/scan-skel.l: Include quotearg.h.
15844 * src/output.c (symbol_printers_output)
15845 (symbol_destructors_output): Quote the file name.
15847 2002-11-06 Akim Demaille <akim@epita.fr>
15849 * tests/regression.at (Invalid inputs): Adjust to the recent
15852 2002-11-06 Akim Demaille <akim@epita.fr>
15854 Restore --no-lines.
15855 Reported by Jim Kent.
15857 * data/c.m4 (b4_syncline): New.
15858 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
15859 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
15860 * src/output.c (user_actions_output): Likewise.
15861 (prepare): Define 'b4_synclines_flag'.
15862 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
15864 2002-11-06 Akim Demaille <akim@epita.fr>
15866 * src/main.c (main): Free `infile'.
15867 * src/scan-gram.l (handle_syncline): New.
15869 * src/output.c (user_actions_output, symbol_destructors_output)
15870 (symbol_printers_output): Use the location's file name, not
15872 * src/reader.c (prologue_augment, epilogue_set): Likewise.
15874 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15876 * src/tables.c (matching_state): Don't allow states to match if
15877 either has GLR conflict entries.
15879 2002-11-05 Paul Eggert <eggert@twinsun.com>
15881 * src/scan-gram.l: Use more accurate diagnostics, e.g.
15882 "integer out of range" rather than "invalid value".
15883 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
15886 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
15887 Also, remove one static variable in the scanner.
15889 * src/scan-gram.l (braces_level): Now auto, not static.
15890 Initialize to zero if the compiler is being picky.
15891 (INITIAL): Clear braces_level instead of incrementing it.
15892 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
15893 as POSIX 1003.1-2001 requires.
15894 * src/system.h (IF_LINT): New macro, taken from coreutils.
15895 * configure.ac: Define "lint" if --enable-gcc-warnings.
15897 2002-11-05 Akim Demaille <akim@epita.fr>
15899 * src/scan-gram.l: When it starts with `%', complain about the
15900 whole directive, not just that `invalid character: %'.
15902 2002-11-04 Akim Demaille <akim@epita.fr>
15904 * Makefile.maint: Update from Autoconf.
15905 (update, cvs-update, po-update, do-po-update): New.
15907 2002-11-04 Akim Demaille <akim@epita.fr>
15909 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
15911 Have yyerror `use' its arguments.
15912 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
15913 returns true when location & yacc & pure & parse-param.
15914 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
15916 2002-11-04 Akim Demaille <akim@epita.fr>
15918 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
15920 * src/scan-gram.l: Use [\'] instead of ['] to pacify
15923 Use quote, not quote_n since LOCATION_PRINT no longer uses the
15926 2002-11-03 Paul Eggert <eggert@twinsun.com>
15928 * src/reader.c (get_merge_function, grammar_current_rule_check):
15929 Use consistent diagnostics for reporting type name clashes.
15930 Quote the types with <>, for consistency with Yacc.
15931 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
15933 2002-11-03 Akim Demaille <akim@epita.fr>
15935 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
15937 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
15938 (b4_parse_param): Remove.
15939 Use b4_identification.
15940 Propagate b4_pure_args where needed to pass them to yyerror.
15941 * data/glr.m4 (b4_parse_param): Remove.
15942 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
15943 (b4_lpure_formals): New.
15944 Use b4_identification.
15945 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
15946 b4_user_formals and b4_user_args.
15947 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
15948 (yyreportAmbiguity): When using a pure parser, also need
15949 the location, and the parse-params.
15951 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
15952 When using a pure parser, also need the parse-params.
15954 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
15955 (%pure-parser + %parse-param) LALR and GLR parsers.
15956 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
15957 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
15958 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
15959 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
15960 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
15961 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
15962 * doc/bison.texinfo: Untabify the whole file.
15963 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
15964 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
15965 (Error Reporting): Adjust to these new directives.
15966 Document %error-verbose, deprecate YYERROR_VERBOSE.
15968 2002-11-03 Akim Demaille <akim@epita.fr>
15970 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
15971 AT_CHECK_CALC_GLR invocations to use % directives, instead of
15972 command line options.
15973 * tests/cxx-type.at: Formatting changes.
15975 2002-11-03 Paul Eggert <eggert@twinsun.com>
15977 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
15978 to count columns correctly, and to check for invalid inputs.
15980 Use mbsnwidth to count columns correctly. Account for tabs, too.
15981 Include mbswidth.h.
15982 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
15983 (extend_location): New function.
15984 (YY_LINES): Remove.
15986 Handle CRLF in C code rather than in Lex code.
15987 (YY_INPUT): New macro.
15988 (no_cr_read): New function.
15990 Scan UCNs, even though we don't fully handle them yet.
15991 (convert_ucn_to_byte): New function.
15993 Handle backslash-newline correctly in C code.
15994 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
15995 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
15997 (tag, splice): New EREs. Do not allow NUL or newline in tags.
15998 Use {splice} wherever C allows backslash-newline.
15999 YY_STEP after space, newline, vertical-tab.
16000 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
16002 (letter, id): Don't assume ASCII; e.g., spell out a-z.
16004 ({int}, handle_action_dollar, handle_action_at): Check for integer
16007 (YY_STEP): Omit trailing semicolon, so that it's more like C.
16009 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
16010 as well as \000. Check for UCHAR_MAX, not 255.
16011 Allow \x with an arbitrary positive number of digits, as in C.
16012 Check for overflow here.
16013 Allow \? and UCNs, for compatibility with C.
16015 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
16016 with quote slot used by complain_at.
16018 * tests/input.at: Add tests for backslash-newline, m4 quotes
16019 in symbols, long literals, and funny escapes in strings.
16021 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
16022 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
16023 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
16024 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
16025 * m4/mbswidth.m4: New file, from GNU coreutils.
16027 * doc/bison.texinfo (Grammar Outline): Document // comments.
16028 (Symbols): Document that trigraphs have no special meaning in Bison,
16029 nor is backslash-newline allowed.
16030 (Actions): Document that trigraphs have no special meaning.
16032 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
16035 2002-11-02 Paul Eggert <eggert@twinsun.com>
16037 * src/reader.c: Don't include quote.h; not needed.
16038 (get_merge_function): Reword warning to be consistent with
16039 type clash diagnostic in grammar_current_rule_check.
16041 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
16042 bug in trigraph handling.
16044 * src/output.c (prepare_symbols): When printing token names,
16045 escape "[" as "@<:@" and likewise for "]".
16047 * src/system.h (errno): Remove declaration, as we are now
16048 assuming C89 or better, and C89 guarantees errno.
16050 2002-10-30 Paul Eggert <eggert@twinsun.com>
16052 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
16053 Check for close failures.
16054 * src/files.h (xfclose): Return void, not int, since it always
16056 * src/files.c (xfclose): Likewise. Report I/O error if ferror
16058 * src/output.c (output_skeleton): Use xfclose rather than fclose
16059 and ferror. xfclose now checks ferror.
16061 * data/glr.c (YYLEFTMOST_STATE): Remove.
16062 (yyreportTree): Use a stack-based leftmost state. This avoids
16063 our continuing battles with bogus warnings about initializers.
16065 2002-10-30 Akim Demaille <akim@epita.fr>
16067 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
16070 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16072 * tests/glr-regr1.at: New test for reported regressions.
16073 * tests/testsuite.at: Add glr-regr1.at test.
16074 * tests/Makefile.am: Add glr-regr1.at test.
16076 2002-10-24 Paul Eggert <eggert@twinsun.com>
16080 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
16081 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
16082 we use malloc. Don't assume 'A' through 'Z' are contiguous.
16083 Don't assume strdup exists; POSIX says its an XSI extension.
16084 Check for buffer overflow on input.
16086 2002-10-24 Akim Demaille <akim@epita.fr>
16088 * src/output.c (output_skeleton): Don't disable M4sugar comments
16089 too soon: it results in comments being expanded.
16090 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
16093 2002-10-24 Akim Demaille <akim@epita.fr>
16095 * data/yacc.c (m4_int_type): New.
16096 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
16097 char' as only yacc.c wants K&R portability.
16098 * data/glr.c (yysigned_char): Remove.
16099 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
16100 Reported by Quoc Peyrot.
16102 2002-10-23 Paul Eggert <eggert@twinsun.com>
16104 * src/main.c (main): With --trace=time, report times even if a
16105 non-fatal error occurs. Formerly, the times were reported in some
16106 such cases but not in others.
16107 * src/reader.c (reader): Just return if a complaint has been issued,
16108 instead of exiting, so that 'main' can report times.
16110 2002-10-22 Akim Demaille <akim@epita.fr>
16112 * src/system.h: Include sys/types.
16113 Reported by Bert Deknuydt.
16115 2002-10-23 Paul Eggert <eggert@twinsun.com>
16117 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
16118 Suggested by Art Haas.
16120 2002-10-22 Paul Eggert <eggert@twinsun.com>
16122 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
16123 decl; not needed any more.
16124 * src/main.c (main): Use return to exit, undoing yesterday's change.
16125 The last OS that we could find where this wouldn't work is
16126 SunOS 3.5, and that's too old to worry about now.
16128 * data/glr.c (struct yyltype): Define members even when not
16129 doing locations. This is more consistent with yacc.c, and it
16130 works around the following bug reports:
16131 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
16132 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
16134 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
16135 @acronym consistently. Standardize on "Yacc" instead of "YACC",
16136 "Algol" instead of "ALGOL". Give a bit more history about BNF.
16138 2002-10-22 Akim Demaille <akim@epita.fr>
16140 * data/README: New.
16142 2002-10-21 Paul Eggert <eggert@twinsun.com>
16144 Be consistent about 'bool'; the old code used an enum in one
16145 module and an int in another, and this violates the C standard.
16146 * m4/stdbool.m4: New file, from coreutils 4.5.3.
16147 * configure.ac (AC_HEADER_STDBOOL): Add.
16148 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
16149 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
16150 * src/symtab.c (hash_compare_symbol_t): Likewise.
16151 * src/system.h (bool, false, true): Use a definition consistent
16152 with ../lib/hash.c. All uses changed.
16154 * src/complain.c (warning_issued): Renamed from warn_message_count,
16155 so that we needn't worry about integer overflow (!).
16156 Now of type bool. All uses changed.
16157 (complaint_issued): Renamed from complain_message_count; likewise.
16159 * src/main.c (main): Use exit to exit with failure.
16161 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
16162 rather than 1 and 0.
16163 * src/main.c (main): Likewise.
16164 * src/getargs.c (getargs): Likewise.
16165 * src/reader.c (reader): Likewise.
16167 * src/getarg.c (getargs): Remove duplicate code for
16168 "Try `bison --help'".
16170 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
16171 What was that "2" for?
16173 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
16174 * src/getargs.c (usage): Likewise.
16176 * src/getargs.c (getargs): When there are too few operands, report
16177 the last one. When there are too many, report the first extra
16178 one. This is how diffutils does it.
16180 2002-10-20 Paul Eggert <eggert@twinsun.com>
16182 Remove K&R vestiges.
16183 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
16184 * src/complain.c (VA_START): Remove. Assume prototypes.
16185 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
16186 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
16187 fatal): Assume prototypes.
16188 * src/complain.h: Assume prototypes.
16189 * src/system.h (PARAMS): Remove.
16190 Include <limits.h> unconditionally, since it's guaranteeed even
16191 for a freestanding C89 compiler.
16192 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
16193 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
16195 2002-10-20 Akim Demaille <akim@epita.fr>
16197 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
16198 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
16199 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
16200 (yyresolveStates, yyresolveAction, yyresolveStack)
16201 (yyprocessOneStack): Use them.
16202 (yy_reduce_print): New.
16203 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
16205 2002-10-20 Akim Demaille <akim@epita.fr>
16207 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
16208 arguments and output `void'.
16209 (b4_c_function): Rename as...
16210 (b4_c_function_def): this.
16211 (b4_c_function_decl, b4_c_ansi_function_def)
16212 (b4_c_ansi_function_decl): New.
16213 Change the interpretation of the arguments: before `int, foo', now
16215 * data/yacc.c (yyparse): Prototype and define thanks to these.
16216 Adjust b4_c_function_def uses.
16217 * data/glr.c (yyparse): Likewise, but ANSI only.
16219 2002-10-20 Akim Demaille <akim@epita.fr>
16221 * src/output.c (prepare): Move the definition of `tokens_number',
16222 `nterms_number', `undef_token_number', `user_token_number_max'
16224 (prepare_tokens): Here.
16225 (prepare_tokens): Rename as...
16226 (prepare_symbols): this.
16227 (prepare): Move the definition of `rules_number' to...
16228 (prepare_rules): here.
16229 (prepare): Move the definition of `last', `final_state_number',
16230 `states_number' to...
16231 (prepare_states): here.
16232 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
16234 2002-10-20 Akim Demaille <akim@epita.fr>
16236 * src/tables.h, src/tables.c, src/output.c: Comment changes.
16238 2002-10-20 Akim Demaille <akim@epita.fr>
16240 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
16243 2002-10-20 Akim Demaille <akim@epita.fr>
16245 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
16246 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
16248 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
16250 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
16251 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
16254 2002-10-19 Paul Eggert <eggert@twinsun.com>
16256 Do not create a temporary file, as that involves security and
16257 cleanup headaches. Instead, use a pair of pipes.
16258 Derived from a suggestion by Florian Krohm.
16259 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
16260 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
16261 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
16262 (BISON_PREREQ_SUBPIPE): Add.
16263 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
16264 Add subpipe.h, subpipe.c.
16265 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
16266 * po/POTFILES.in: Add lib/subpipe.c.
16267 * src/output.c: Include "subpipe.h".
16268 (m4_invoke): Remove decl.
16269 (scan_skel): New decl.
16270 (output_skeleton): Use pipe rather than temporary file for m4 input.
16271 Check that m4sugar.m4 is readable, to avoid deadlock.
16272 Check for pipe I/O error.
16273 * src/scan-skel.l (readpipe): Remove decl.
16274 (scan_skel): New function, to be used in place of m4_invoke.
16275 Read from stream rather than file.
16277 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
16278 float, as this generates a warning on Solaris 8 + GCC 3.2 with
16279 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
16280 this generates a more-accurate value anyway.
16282 * lib/timevar.c (timervar_accumulate): Rename locals to
16283 avoid confusion with similarly-named more-global.
16284 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
16286 * src/output.c (prepare): Use xstrdup to convert char const *
16287 to char *, to avoid GCC warning.
16289 2002-10-19 Akim Demaille <akim@epita.fr>
16291 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
16292 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
16293 Use them to have `calc.y' ready for %pure-parser.
16294 * data/yacc.c (YYLEX): Pass a yylex return type to
16295 b4_c_function_call.
16297 2002-10-19 Akim Demaille <akim@epita.fr>
16299 Prototype support of %lex-param and %parse-param.
16301 * src/parse-gram.y: Add the definition of the %lex-param and
16302 %parse-param tokens, plus their rules.
16303 Drop the `_' version of %glr-parser.
16305 * src/scan-gram.l (INITIAL): Scan them.
16306 * src/muscle_tab.c: Comment changes.
16307 (muscle_insert, muscle_find): Rename `pair' as `probe'.
16308 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
16309 (muscle_entry_s): The `value' member is no longer const.
16310 Adjust all dependencies.
16311 * src/muscle_tab.c (muscle_init): Adjust: use
16312 MUSCLE_INSERT_STRING.
16313 Initialize the obstack earlier.
16314 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
16315 (muscle_pair_list_grow): New.
16316 * data/c.m4 (b4_c_function_call, b4_c_args): New.
16317 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
16318 * tests/calc.at: Use %locations, not --locations.
16319 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
16321 2002-10-19 Akim Demaille <akim@epita.fr>
16323 * src/getargs.c (usage): Take status as argument and exit
16325 Report the traditional `Try ... --help' message when status != 0.
16326 (usage, version): Don't take a FILE * as arg, it is pointless.
16327 (getargs): When there is an incorrect number of arguments, make it
16328 an error, and report it GNUlically thanks to `usage ()'.
16330 2002-10-18 Paul Eggert <eggert@twinsun.com>
16332 * data/glr.c (yyreportParseError): Don't assume that sprintf
16333 yields the length of the printed string, as this is not true
16334 on SunOS 4.1.4. Reported by Peter Klein.
16336 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
16337 * tests/conflicts.at (%nonassoc and eof): Likewise.
16338 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
16340 2002-10-17 Akim Demaille <akim@epita.fr>
16342 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
16343 * src/getargs.c (trace_types, trace_args): Adjust.
16344 * src/reader.c (grammar_current_rule_prec_set)
16345 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
16346 Standardize error messages.
16347 And s/@prec/%prec/!
16348 (reader): Use trace_flag to enable scanner/parser debugging,
16349 instead of an adhoc scheme.
16350 * src/scan-gram.l: Remove trailing debugging code.
16352 2002-10-16 Paul Eggert <eggert@twinsun.com>
16354 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
16357 * NEWS: Officially drop support for building Bison with K&R C,
16358 since it didn't work anyway and it's not worth worrying about.
16359 * Makefile.maint (wget_files): Remove ansi2knr.c.
16360 (ansi2knr.c-url_prefix): Remove.
16361 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
16362 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16363 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16365 2002-10-15 Paul Eggert <eggert@twinsun.com>
16367 Stop using the "enum_" trick for K&R-style function definitions;
16368 it confused me, and I was the author! Instead, assume that people
16369 who want to use K&R C compilers (when using these modules in GCC,
16370 perhaps?) will run ansi2knr.
16372 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
16373 All uses of "enum_" changed to "enum ".
16374 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
16375 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
16377 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
16378 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
16379 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
16380 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
16381 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
16382 abitset_not, abitset_ones, abitset_or, abitset_or_and,
16383 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
16384 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
16385 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
16386 Use function prototypes; this removes the need for declaring
16387 static functions simply to provide their prototypes.
16388 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
16389 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
16390 bitset_count_, bitset_create, bitset_dump, bitset_first,
16391 bitset_free, bitset_init, bitset_last, bitset_next,
16392 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
16393 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
16394 bitset_print, bitset_release_memory, bitset_toggle_,
16395 bitset_type_choose, bitset_type_get, bitset_type_name_get,
16396 debug_bitset): Likewise.
16397 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
16398 * lib/bitset_stats.c (bitset_log_histogram_print,
16399 bitset_percent_histogram_print, bitset_stats_and,
16400 bitset_stats_and_cmp, bitset_stats_and_or,
16401 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
16402 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
16403 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
16404 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
16405 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
16406 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
16407 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
16408 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
16409 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
16410 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
16411 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
16412 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
16413 bitset_stats_zero): Likewise.
16414 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
16415 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
16416 bitsetv_dump, debug_bitsetv): Likewise.
16417 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
16418 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
16419 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
16420 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
16421 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
16422 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
16423 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
16424 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
16425 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
16426 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
16427 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
16429 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
16430 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
16431 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
16432 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
16433 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
16434 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
16435 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
16436 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
16437 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
16438 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
16439 lbitset_xor_cmp, lbitset_zero): Likewise.
16441 2002-10-14 Akim Demaille <akim@epita.fr>
16445 2002-10-14 Akim Demaille <akim@epita.fr>
16447 * tests/Makefile.am (maintainer-check-posix): New.
16449 2002-10-14 Akim Demaille <akim@epita.fr>
16451 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
16454 2002-10-14 Akim Demaille <akim@epita.fr>
16456 * src/tables.c (table_ninf_remap): base -> tab.
16457 Reported by Matt Rosing.
16459 2002-10-14 Paul Eggert <eggert@twinsun.com>
16461 * tests/action.at, tests/calc.at, tests/conflicts.at,
16462 tests/cxx-type.at, tests/headers.at, tests/input.at,
16463 tests/regression.at, tests/synclines.at, tests/torture.at:
16464 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
16465 so that the tests still work even if POSIXLY_CORRECT is set.
16466 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
16468 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
16469 for portability to K&R hosts. Fix typo: signed char is guaranteed
16470 only to 127, not to 128.
16471 * data/glr.c (yysigned_char): New type.
16472 * data/yacc.c (yysigned_char): Likewise.
16473 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
16475 2002-10-13 Paul Eggert <eggert@twinsun.com>
16477 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
16478 true due to limited range of data type" warning from GCC.
16480 * data/c.m4 (b4_token_defines): Protect against double-inclusion
16481 by wrapping enum yytokentype's definition inside #ifndef
16482 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
16484 2002-10-13 Akim Demaille <akim@epita.fr>
16486 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
16487 Un yy- yyrhs to avoid the name clash with the global YYRHS.
16489 2002-10-13 Akim Demaille <akim@epita.fr>
16491 * Makefile.maint: Update from Autoconf 2.54.
16492 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
16494 2002-10-13 Akim Demaille <akim@epita.fr>
16496 * src/print.c (print_state): Separate the list of solved conflicts
16497 from the other items.
16498 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
16500 2002-10-13 Akim Demaille <akim@epita.fr>
16502 Let nondeterministic skeletons be usable with deterministic
16505 With the patch, GAWK compiled by GCC without -O2 passes its test
16506 suite using a GLR parser driven by LALR tables. It fails with -O2
16507 because `struct stat' gives two different answers on my machine:
16508 88 (definition of an auto var) and later 96 (memset on this var).
16509 Hence the stack is badly corrumpted. The headers inclusion is to
16510 blame: if I move the awk.h inclusion before GLR's system header
16511 inclusion, the two struct stat have the same size.
16513 * src/tables.c (pack_table): Always create conflict_table.
16514 (token_actions): Always create conflict_list.
16515 * data/glr.c (YYFLAG): Remove, unused.
16517 2002-10-13 Akim Demaille <akim@epita.fr>
16519 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
16521 (VALGRIND, GXX): New.
16522 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
16523 * tests/bison.in: Run $PREBISON a pre-command.
16524 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
16525 (maintainer-check-g++): New.
16526 * Makefile.am (maintainer-check): New.
16528 2002-10-13 Akim Demaille <akim@epita.fr>
16530 * data/glr.c: Formatting changes.
16531 Tweak some trace messages to match yacc.c's.
16533 2002-10-13 Akim Demaille <akim@epita.fr>
16535 GLR parsers sometimes raise parse errors instead of performing the
16537 Reported by Charles-Henry de Boysson.
16539 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
16540 check the length of the traces when %glr.
16541 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
16543 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
16545 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
16546 (yyltype): Remove the yy prefix from the member names.
16547 (yytable): Complete its comment.
16548 (yygetLRActions): Map error action number from YYTABLE from
16550 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
16551 (which was a bug: it should have been YYTABEL_NINF, and yet it was
16552 not satisfying as we could compare an YYACTION computed from
16553 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
16554 only value for error actions.
16555 (yyreportParseError): In verbose parse error messages, don't issue
16556 `error' in the list of expected tokens.
16557 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
16558 next action to perform to match glr.c's decoding.
16559 (yytable): Complete its comment.
16561 2002-10-13 Paul Eggert <eggert@twinsun.com>
16563 Fix problem reported by Henrik Grubbstroem in
16564 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
16565 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
16566 because the Bison parser reads the second action before reducing
16568 * src/scan-gram.l (rule_length): New static var.
16569 Use it to keep track of the rule length in the scanner, since
16570 we can't expect the parser to be in lock-step sync with the scanner.
16571 (handle_action_dollar, handle_action_at): Use this var.
16572 * tests/actions.at (Exotic Dollars): Test for the problem.
16574 2002-10-12 Paul Eggert <eggert@twinsun.com>
16576 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
16577 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
16578 Include <sys/time.h> when checking for clock_t and struct tms.
16579 Use same include order as source.
16580 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
16581 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
16583 * lib/timevar.c: Update copyright date and clarify comments.
16584 (get_time) [IN_GCC]: Keep the GCC version for reference.
16586 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
16587 GCC version as of today, then merge Bison's changes.
16588 Change "GCC" to "Bison" in copyright notice. timevar.def's
16589 author is Akim, so change that too.
16591 * src/reader.c (grammar_current_rule_check):
16592 Don't worry about the default action if $$ is untyped.
16593 Prevents bogus warnings reported by Jim Gifford in
16594 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
16596 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
16597 * data/glr.c, data/lalr1.cc, data/yacc.c:
16598 Output token definitions before the first part of user declarations.
16599 Fixes compatibility problem reported by Jim Gifford for kbd in
16600 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
16602 2002-10-11 Paul Eggert <eggert@twinsun.com>
16604 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
16605 (yyparse): here. This undoes some of the 2002-07-25 change.
16606 Compatibility problem reported by Ralf S. Engelschall with
16607 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
16609 2002-10-11 Akim Demaille <akim@epita.fr>
16611 * tests/regression.at Characters Escapes): New.
16612 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
16614 Reported by Jan Nieuwenhuizen.
16616 2002-10-11 Akim Demaille <akim@epita.fr>
16620 2002-10-10 Paul Eggert <eggert@twinsun.com>
16622 Portability fixes for bitsets; this also avoids several GCC
16625 * lib/abitset.c: Include <stddef.h>, for offsetof.
16626 * lib/lbitset.c: Likewise.
16628 * lib/abitset.c (abitset_bytes): Return a size that is aligned
16629 properly for vectors of objects. Do not assume that adding a
16630 header size to a multiple of a word size yields a value that is
16631 properly aligned for the whole union.
16632 * lib/bitsetv.c (bitsetv_alloc): Likewise.
16634 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
16635 unique names for structures.
16636 * lib/ebitset.c (ebitset_bytes): Likewise.
16637 * lib/lbitset.c (lbitset_bytes): Likewise.
16639 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
16640 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
16641 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
16642 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
16643 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
16644 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
16645 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
16646 to improve the type-checking that GCC can do.
16647 * lib/bitset.c (bitset_op4_cmp): Likewise.
16648 * lib/bitset_stats.c (bitset_stats_count,
16649 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
16650 bitset_stats_copy, bitset_stats_disjoint_p,
16651 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
16652 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
16653 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
16654 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
16655 bitset_stats_and_or_cmp, bitset_stats_andn_or,
16656 bitset_stats_andn_or_cmp, bitset_stats_or_and,
16657 bitset_stats_or_and_cmp): Likewise.
16658 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
16659 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
16660 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
16661 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
16663 * lib/abitset.h: Include bitset.h, not bbitset.h.
16664 * lib/ebitset.h: Likewise.
16665 * lib/lbitset.h: Likewise.
16667 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
16668 All instances of parameters of type enum bitset_opts are now of
16669 type enum_bitset_opts, to conform to the C Standard, and similarly
16670 for enum_bitset_type.
16671 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
16672 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
16674 Do not use "struct bitset_struct" to mean different things in
16675 different modules. Not only is this confusing, it violates
16676 the C Standard, which requires that structure types in different
16677 modules must be compatible if one is to be passed to the other.
16678 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
16679 All instances of "struct bitset_struct *" replaced with "bitset".
16680 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
16681 (union bitset_union, struct abitset_struct, struct ebitset_struct,
16682 struct lbitset_struct, struct bitset_stats_struct): New types.
16683 All uses of struct bitset_struct changed to union bitset_union,
16685 * lib/abitset.c (struct abitset_struct, abitset,
16686 struct bitset_struct): Remove.
16687 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
16688 struct bitset_struct): Remove.
16689 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
16690 bitset_struct): Remove.
16691 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
16694 Do not call a function of type T using a call that assumes the
16695 function is of a different type U. Standard C requires that a
16696 function must be called with a type that is compatible with its
16698 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
16700 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
16702 * lib/ebitset.c (PFV): Remove.
16703 * lib/lbitset.c (PFV): Likewise.
16704 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
16705 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
16707 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
16708 (ebitset_vtable): Use them.
16709 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
16710 lbitset_xor): New functions.
16711 (lbitset_vtable): Use them.
16713 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
16716 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
16718 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
16719 Use offsetof, for simplicity.
16721 2002-10-06 Paul Eggert <eggert@twinsun.com>
16723 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
16724 the same width as int. This reapplies a hunk of the 2002-08-12 patch
16725 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
16726 which was inadvertently undone by the 2002-09-30 patch.
16727 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
16728 the same width as int.
16730 2002-10-04 Paul Eggert <eggert@twinsun.com>
16734 * configure.ac (AC_INIT), NEWS: Increment version number.
16736 * doc/bison.texinfo: Minor spelling, grammar, and white space
16738 (Symbols): Mention that any negative value returned from yylex
16739 signifies end-of-input. Warn about negative chars. Mention
16740 the portable Standard C character set.
16742 The GNU coding standard says CFLAGS and YFLAGS are reserved
16743 for the installer to set.
16744 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
16745 * src/Makefile.am (AM_CFLAGS): Likewise.
16746 (AM_YFLAGS): Renamed from YFLAGS.
16748 Fix some MAX and MIN problems.
16749 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
16750 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
16751 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
16752 * src/reader.c (reader): Use it.
16754 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
16755 POSIX 1003.1-2001 has removed fgrep.
16757 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
16759 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
16760 interpreted as signed.
16761 * lib/ebitset.c (ebitset_list): Fix bug.
16763 2002-10-01 Paul Eggert <eggert@twinsun.com>
16765 More fixes for 64-bit hosts and large bitsets.
16767 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
16768 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
16769 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
16770 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
16771 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
16772 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
16773 bitset_count_): Likewise.
16774 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
16775 bitset_first, bitset_last): Likewise.
16776 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
16777 bitset_stats_list_reverse, bitset_stats_size,
16778 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
16780 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
16781 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
16782 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
16783 bitsetv_reflexive_transitive_closure): Likewise.
16784 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
16785 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
16787 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
16790 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
16791 Use size_t, not unsigned int, to count bytes.
16792 * lib/abitset.h (abitset_bytes): Likewise.
16793 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
16795 * lib/bitset.h (bitset_bytes): Likewise.
16796 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
16797 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
16798 * lib/bitsetv.c (bitsetv_alloc): Likewise.
16799 * lib/ebitset.c (ebitset_bytes): Likewise.
16800 * lib/ebitset.h (ebitset_bytes): Likewise.
16801 * lib/lbitset.c (lbitset_bytes): Likewise.
16802 * lib/lbitset.h (lbitset_bytes): Likewise.
16804 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
16805 abitset_subset_p, abitset_disjoint_p, abitset_and,
16806 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
16807 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
16808 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
16809 abitset_or_and, abitset_or_and_cmp):
16810 Use bitset_windex instead of unsigned int.
16811 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
16812 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
16813 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
16814 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
16816 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
16818 * lib/bitset.c (bitset_print):
16819 Use proper printf formats for widths of integer types.
16820 * lib/bitset_stats.c (bitset_percent_histogram_print,
16821 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
16822 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
16823 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
16824 * lib/lbitset.c (lbitset_bytes): Likewise.
16826 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
16827 BITSET_SIZE_MAX): New macros.
16828 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
16829 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
16830 to BITSET_WINDEX_MAX.
16832 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
16833 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
16834 since we now return the bitset_bindex type (not int).
16836 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
16837 when computing sizes.
16838 * lib/ebitset.c (ebitset_elts_grow): Likewise.
16840 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
16841 and avoid cast to unsigned.
16843 2002-09-30 Akim Demaille <akim@epita.fr>
16845 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
16846 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
16847 Updates from Michael Hayes.
16849 2002-09-30 Art Haas <ahaas@neosoft.com>
16851 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
16853 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
16856 2002-09-27 Akim Demaille <akim@epita.fr>
16860 2002-09-27 Akim Demaille <akim@epita.fr>
16862 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
16863 (Because of AC_LIBSOURCE).
16865 2002-09-27 Akim Demaille <akim@epita.fr>
16867 Playing with Autoscan.
16869 * configure.ac: Remove the old LIBOBJ tweaks.
16870 (AC_REPLACE_FUNCS): Add strrchr and strtol.
16871 * lib/strrchr.c: New.
16872 * lib/strtol.c: New, from the Coreutils 4.5.1.
16874 2002-09-27 Akim Demaille <akim@epita.fr>
16876 Playing with Autoscan.
16878 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
16879 * lib/Makefile.am (libbison_a_SOURCES): No longer include
16880 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
16881 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
16884 2002-09-24 Akim Demaille <akim@epita.fr>
16886 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
16887 (Frequently Asked Questions, Parser Stack Overflow): New.
16889 2002-09-13 Akim Demaille <akim@epita.fr>
16891 Playing with autoscan.
16893 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
16894 * src/files.c (skeleton_find): Remove, unused.
16895 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
16896 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
16898 2002-09-13 Akim Demaille <akim@epita.fr>
16900 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
16901 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
16903 2002-09-13 Akim Demaille <akim@epita.fr>
16905 * configure.ac: Require 2.54.
16906 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
16907 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
16908 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
16909 Remove, provided by Autoconf macros.
16911 2002-09-12 Akim Demaille <akim@epita.fr>
16913 * m4/prereq.m4: Update, from Coreutils 4.5.1.
16915 2002-09-12 Akim Demaille <akim@epita.fr>
16917 * m4/prereq.m4: Update, from Fileutils 4.1.5.
16918 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
16919 Reported by Martin Mokrejs.
16921 2002-09-10 Akim Demaille <akim@epita.fr>
16923 * src/parse-gram.y: Associate a human readable string to each
16925 * tests/regression.at (Invalid inputs): Adjust.
16927 2002-09-10 Gary V. Vaughan <gary@gnu.org>
16929 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
16930 with an Autoconf-2.5x style configure.ac.
16932 2002-09-06 Paul Eggert <eggert@twinsun.com>
16934 * doc/bison.texinfo (Conditions): Make explicit that the GPL
16935 exception applies only to yacc.c. This is a modification of a
16936 patch originally suggested by Akim Demaille.
16938 2002-09-06 Akim Demaille <akim@epita.fr>
16940 * data/c.m4 (b4_copyright): Move the GPL exception comment from
16942 * data/yacc.c: here.
16944 * data/lalr1.cc (struct yyltype): Don't define it, since we use
16946 (b4_ltype): Default to yy::Location from location.hh.
16948 2002-09-04 Jim Meyering <jim@meyering.net>
16950 * data/yacc.c: Guard the declaration of yytoknum also with
16951 `#ifdef YYPRINT', so it is declared only when used.
16953 2002-09-04 Akim Demaille <akim@epita.fr>
16955 * configure.in: Rename as...
16956 * configure.ac: this.
16959 2002-09-04 Akim Demaille <akim@epita.fr>
16961 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
16962 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
16963 translate maintainer only messages.
16965 2002-08-12 Paul Eggert <eggert@twinsun.com>
16969 * Makefile.am (SUBDIRS): Remove intl.
16970 (DISTCLEANFILES): Remove.
16971 * NEWS: Mention that GNU M4 is now required. Clarify what is
16972 meant by "larger grammars". Mention the pt_BR translation.
16973 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
16974 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
16975 Bump version from 0.11.2 to 0.11.5.
16976 (BISON_PREREQ_STAGE): Remove.
16977 (AM_GNU_GETTEXT): Use external gettext.
16978 (AC_OUTPUT): Remove intl/Makefile.
16980 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
16982 * data/glr.c: Include string.h, for strlen.
16983 (yyreportParseError): Use size_t for yysize.
16984 (yy_yypstack): No longer nested inside yypstates, as nested
16985 functions are not portable. Do not assume size_t is the
16987 (yypstates): Do not assume that ptrdiff_t is the same width
16988 as int, and similarly for yyposn and YYINDEX.
16990 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
16992 * lib/Makefile.am (INCLUDES): Do not include from the intl
16993 directory, which has been removed.
16994 * src/Makefile.am (INCLUDES): Likewise.
16996 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
16997 (bitsets_sources, additional_bitsets_sources, timevars_sources):
17000 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
17001 * tests/Makefile.am (EXTRA_DIST): Likewise.
17003 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
17004 Do not assume that bitset_windex is the same width as unsigned.
17006 * lib/abitset.c (abitset_unused_clear): Do not assume that
17007 bitset_word is the same width as int.
17008 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
17009 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
17010 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
17011 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
17012 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
17014 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
17015 portability to one's complement hosts!).
17016 * lib/ebitset.c (ebitset_op1): Likewise.
17017 * lib/lbitset.c (lbitset_op1): Likewise.
17019 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
17020 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
17021 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
17022 Sync with fileutils.
17023 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
17024 lib/gettext.h: Sync with diffutils.
17026 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
17027 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
17029 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
17030 PROTOTYPES to check for prototypes, and "defined __STDC__" to
17033 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
17034 size_t; the old version tried to do this but casted improperly.
17035 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
17036 (bitset_test): Now returns int, not unsigned long.
17038 * lib/bitset_stats.c: Include "gettext.h".
17040 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
17041 name locals "index", as it generates unnecessary warnings on some
17042 hosts that have an "index" function.
17044 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
17045 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
17046 they need translation.
17047 * src/LR0.c (state_list_append, new_itemsets, get_state,
17048 append_states, generate_states): Likewise.
17049 * src/assoc.c (assoc_to_string): Likewise.
17050 * src/closure.c (print_closure, set_firsts, closure): Likewise.
17051 * src/gram.c (grammar_dump): Likewise.
17052 * src/injections.c (injections_compute): Likewise.
17053 * src/lalr.c (lookaheads_print): Likewise.
17054 * src/relation.c (relation_transpose): Likewise.
17055 * src/scan-gram.l: Likewise.
17056 * src/tables.c (table_grow, pack_vector): Likewise.
17058 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
17059 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
17060 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
17061 * m4/mbstate_t.m4: Sync with fileutils.
17062 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
17064 * po/LINGUAS: Add pt_BR.
17065 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
17066 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
17068 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
17070 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
17072 * src/complain.c (strerror_r): Remove decl; not needed.
17073 (strerror): Use same pattern as ../lib/error.c.
17075 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
17077 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
17079 * src/main.c (main): Cast result of bindtextdomain and textdomain
17080 to void, to avoid a GCC warning when --disable-nls is in effect.
17082 * src/scan-gram.l: Use strings rather than escapes when possible,
17083 to minimize the number of warnings from xgettext.
17084 (handle_action_dollar, handle_action_at): Don't use isdigit,
17085 as it mishandles negative chars and it may not work as expected
17086 outside the C locale.
17088 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
17089 this is a GCC extension and is not portable to other compilers.
17091 * src/system.h (alloca): Use same pattern as ../lib/error.c.
17092 Do not include <ctype.h>; no longer needed.
17093 Do not include <malloc.h>; no longer needed (and generates
17094 warnings on OpenBSD 3.0).
17096 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
17099 * tests/regression.at: Do not use 'cc -c input.c -o input';
17100 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
17102 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
17103 exit status as failure, not just exit status 1. Sun C exits
17104 with status 2 sometimes.
17106 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
17107 Use it for the two large tests.
17109 2002-08-02 Akim Demaille <akim@epita.fr>
17111 * src/conflicts.c (conflicts_output): Don't output rules never
17112 reduced here, since anyway that computation doesn't work.
17113 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
17114 (rule_useless_p, rule_never_reduced_p): New.
17115 (grammar_rules_partial_print): Use a filter instead of a range.
17116 Display the title only if needed.
17117 (grammar_rules_print): Adjust.
17118 (grammar_rules_never_reduced_report): New.
17119 * src/tables.c (action_row): Move the computation of rules never
17121 (token_actions): here.
17122 * src/main.c (main): Make the parser before making the report, so
17123 that rules never reduced are computed.
17124 Call grammar_rules_never_reduced_report.
17125 * src/print.c (print_results): Report rules never reduced.
17126 * tests/conflicts.at, tests/reduce.at: Adjust.
17128 2002-08-01 Akim Demaille <akim@epita.fr>
17130 Instead of attaching lookaheads and duplicating the rules being
17131 reduced by a state, attach the lookaheads to the reductions.
17133 * src/state.h (state_t): Remove the `lookaheads',
17134 `lookaheads_rule' member.
17135 (reductions_t): Add a `lookaheads' member.
17136 Use a regular array for the `rules'.
17137 * src/state.c (reductions_new): Initialize the lookaheads member
17139 (state_rule_lookaheads_print): Adjust.
17140 * src/state.h, src/state.c (state_reductions_find): New.
17141 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
17142 (count_rr_conflicts): Adjust.
17143 * src/lalr.c (LArule): Remove.
17144 (add_lookback_edge): Adjust.
17145 (state_lookaheads_count): New.
17146 (states_lookaheads_initialize): Merge into...
17147 (initialize_LA): this.
17148 (lalr_free): Adjust.
17149 * src/main.c (main): Don't free nullable and derives too early: it
17150 is used by --verbose.
17151 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
17153 2002-08-01 Akim Demaille <akim@epita.fr>
17155 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
17157 (set_derives, free_derives): Rename as...
17158 (derives_compute, derives_free): this.
17159 Adjust all dependencies.
17160 * src/nullable.c (set_nullable, free_nullable): Rename as...
17161 (nullable_compute, nullable_free): these.
17162 (rule_list_t): Store rule_t *, not rule_number_t.
17163 * src/state.c (state_rule_lookaheads_print): Directly compare rule
17164 pointers, instead of their numbers.
17165 * src/main.c (main): Call nullable_free, and derives_free earlier,
17166 as they were lo longer used.
17168 2002-08-01 Akim Demaille <akim@epita.fr>
17170 * lib/timevar.c (get_time): Include children time.
17171 * src/lalr.h (LA, LArule): Don't export them: used with the
17173 * src/lalr.c (LA, LArule): Static.
17174 * src/lalr.h, src/lalr.c (lalr_free): New.
17175 * src/main.c (main): Call it.
17176 * src/tables.c (pack_vector): Check whether loc is >= to the
17178 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
17179 (tables_generate): do it, since that's also it which allocates
17181 Don't free LA and LArule, main does.
17183 2002-07-31 Akim Demaille <akim@epita.fr>
17185 Separate parser tables computation and output.
17187 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
17188 (conflict_list, conflict_list_cnt, table, check, table_ninf)
17189 (yydefgoto, yydefact, high): Move to...
17190 * src/tables.h, src/tables.c: here.
17191 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17192 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17193 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
17194 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
17195 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
17196 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
17197 (action_row, save_row, token_actions, save_column, default_goto)
17198 (goto_actions, sort_actions, matching_state, pack_vector)
17199 (table_ninf_remap, pack_table, prepare_actions): Move to...
17200 * src/tables.c: here.
17201 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
17202 * src/output.c (token_actions, output_base, output_conflicts)
17203 (output_check): Merge into...
17204 (prepare_actions): this.
17205 (actions_output): Rename as...
17206 (user_actions_output): this.
17207 * src/main.c (main): Call tables_generate and tables_free.
17209 2002-07-31 Akim Demaille <akim@epita.fr>
17211 Steal GCC's --time-report support.
17213 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
17214 stolen/adjusted from GCC.
17215 * m4/stage.m4: Remove time related checks.
17216 * m4/timevar.m4: New.
17217 * configure.in: Adjust.
17218 * src/system.h: Adjust to using timevar.h.
17219 * src/getargs.h, src/getargs.c: Support trace_time for
17221 * src/main.c (stage): Remove.
17222 (main): Replace `stage' invocations with timevar calls.
17223 * src/output.c: Insert pertinent timevar calls.
17225 2002-07-31 Akim Demaille <akim@epita.fr>
17227 Let --trace have arguments.
17229 * src/getargs.h (enum trace_e): New.
17230 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
17231 (long_options, short_options): --trace/-T takes an optional
17233 Change all the uses of trace_flag to reflect the new flags.
17234 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
17236 Strengthen `stage' portability.
17238 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
17239 * configure.in: Use it.
17240 Don't check for malloc.h and sys/times.h.
17241 * src/system.h: Include them when appropriate.
17242 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
17243 times and struct tms are available.
17245 2002-07-30 Akim Demaille <akim@epita.fr>
17247 In verbose parse error message, don't report `error' as an
17249 * tests/actions.at (Printers and Destructors): Adjust.
17250 * tests/calc.at (Calculator $1): Adjust.
17251 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
17252 error message, do not report the parser accepts the error token in
17255 2002-07-30 Akim Demaille <akim@epita.fr>
17257 Normalize conflict related messages.
17259 * src/complain.h, src/complain.c (warn, complain): New.
17260 * src/conflicts.c (conflicts_print): Use them.
17261 (conflict_report_yacc): New, extracted from...
17262 (conflicts_print): here.
17263 * tests/conflicts.at, tests/existing.at: Adjust.
17265 2002-07-30 Akim Demaille <akim@epita.fr>
17267 Report rules which are never reduced by the parser: those hidden
17270 * src/LR0.c (save_reductions): Don't make the final state too
17271 different: save its reduction (accept) instead of having a state
17272 without any action (no shift or goto, no reduce).
17273 Note: the final state is now a ``regular'' state, i.e., the
17274 parsers now contain `reduce 0' as default reduction.
17275 Nevertheless, since they decide to `accept' when yystate =
17276 final_state, they still will not reduce rule 0.
17277 * src/print.c (print_actions, print_reduction): Adjust.
17278 * src/output.c (action_row): Track reduced rules.
17279 (token_actions): Report rules never reduced.
17280 * tests/conflicts.at, tests/regression.at: Adjust.
17282 2002-07-30 Akim Demaille <akim@epita.fr>
17284 `stage' was accidently included in a previous patch.
17285 Initiate its autoconfiscation.
17287 * configure.in: Look for malloc.h and sys/times.h.
17288 * src/main.c (stage): Adjust.
17289 Report only when trace_flag.
17291 2002-07-29 Akim Demaille <akim@epita.fr>
17293 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
17295 (errs_t): symbol_t*, not symbol_number_t.
17296 (reductions_t): rule_t*, not rule_number_t.
17297 (FOR_EACH_SHIFT): New.
17298 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
17299 * src/print.c, src/print_graph.c: Adjust.
17301 2002-07-29 Akim Demaille <akim@epita.fr>
17303 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
17305 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
17306 (endtoken, accept): these.
17307 * src/reader.c (reader): Set endtoken's default tag to "$end".
17308 Set undeftoken's tag to "$undefined" instead of "$undefined.".
17309 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
17312 2002-07-29 Akim Demaille <akim@epita.fr>
17314 * src/reduce.c (reduce_grammar): When the language is empty,
17315 complain about the start symbol, not the axiom.
17317 * tests/reduce.at (Empty Language): New.
17319 2002-07-26 Akim Demaille <akim@epita.fr>
17321 * src/reader.h, src/reader.c (gram_error): ... can't get
17322 yycontrol without making too strong assumptions on the parser
17324 * src/output.c (prepare_tokens): Use the real 0th value of
17325 token_translations instead of `0'.
17326 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
17328 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
17329 for the time being: %locations ought to provide it to yyerror.
17331 2002-07-25 Akim Demaille <akim@epita.fr>
17333 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
17334 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
17335 * tests/regression.at (Web2c Actions): Adjust.
17337 2002-07-25 Akim Demaille <akim@epita.fr>
17339 Stop storing rules from 1 to nrules + 1.
17341 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
17342 * src/nullable.c, src/output.c, src/print.c, src/reader.c
17343 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
17344 Iterate from 0 to nrules.
17345 Use rule_number_as_item_number and item_number_as_rule_number.
17346 Adjust to `derive' now containing possibly 0.
17347 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
17348 Handle the `- 1' part in rule numbers from/to item numbers.
17349 * src/conflicts.c (log_resolution): Fix the message which reversed
17351 * src/output.c (action_row): Initialize default_rule to -1.
17352 (token_actions): Adjust.
17353 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
17355 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
17357 2002-07-25 Akim Demaille <akim@epita.fr>
17359 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
17360 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
17361 (b4_c_knr_arg_decl): New.
17362 * data/yacc.c: Use it to define yysymprint, yydestruct, and
17363 yyreport_parse_error.
17365 2002-07-25 Akim Demaille <akim@epita.fr>
17367 * data/yacc.c (yyreport_parse_error): New, extracted from...
17369 (yydestruct, yysymprint): Move above yyparse.
17372 2002-07-25 Akim Demaille <akim@epita.fr>
17374 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
17376 (b4_sint_type, b4_uint_type): these.
17377 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
17378 * tests/regression.at (Web2c Actions): Adjust.
17380 2002-07-25 Akim Demaille <akim@epita.fr>
17382 * src/gram.h (TIEM_NUMBER_MAX): New.
17383 (item_number_of_rule_number, rule_number_of_item_number): Rename
17385 (rule_number_as_item_number, item_number_as_rule_number): these.
17386 Adjust dependencies.
17387 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17388 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17389 (symbol_number_to_vector_number): New.
17390 (order): Of vector_number_t* type.
17391 (base_t, BASE_MAX, BASE_MIN): New.
17392 (froms, tos, width, pos, check): Of base_t type.
17393 (action_number_t, ACTION_MIN, ACTION_MAX): New.
17394 (actrow): Of action_number_t type.
17395 (conflrow): Of unsigned int type.
17396 (table_ninf, base_ninf): New.
17397 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
17398 (muscle_insert_int_table, muscle_insert_base_table)
17399 (muscle_insert_rule_number_table): New.
17400 (prepare_tokens): Output `toknum' as int_table.
17401 (action_row): Returns a rule_number_t.
17402 Use ACTION_MIN, not SHRT_MIN.
17403 (token_actions): yydefact is rule_number_t*.
17404 (table_ninf_remap): New.
17405 (pack_table): Use it for `base' and `table'.
17406 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
17408 (YYPACT_NINF, YYTABLE_NINF): these.
17409 (yypact, yytable): Compute their types instead of hard-coded
17411 * tests/regression.at (Web2c Actions): Adjust.
17413 2002-07-19 Akim Demaille <akim@epita.fr>
17415 * src/scan-gram.l (id): Can start with an underscore.
17417 2002-07-16 Akim Demaille <akim@epita.fr>
17419 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
17420 Adjust all former `associativity' dependencies.
17421 * src/symtab.c (symbol_new): Default associativity is `undef', not
17423 (symbol_check_alias_consistence): Adjust.
17425 2002-07-09 Akim Demaille <akim@epita.fr>
17427 * doc/bison.texinfo: Properly set the ``header'' part.
17428 Use @dircategory ``GNU programming tools'' as per Texinfo's
17432 2002-07-09 Akim Demaille <akim@epita.fr>
17434 * lib/quotearg.h: Protect against multiple inclusions.
17435 * src/location.h (location_t): Add a `file' member.
17436 (LOCATION_RESET, LOCATION_PRINT): Adjust.
17437 * src/complain.c (warn_at, complain_at, fatal_at): Drop
17438 `error_one_per_line' support.
17440 2002-07-09 Akim Demaille <akim@epita.fr>
17442 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
17443 * src/reader.c (lineno): Remove.
17444 Adjust all dependencies.
17445 (get_merge_function): Take a location and use complain_at.
17446 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
17447 * tests/regression.at (Invalid inputs, Mixing %token styles):
17450 2002-07-09 Akim Demaille <akim@epita.fr>
17452 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
17453 recovery rule, and forbid extensions when --yacc.
17454 (gram_error): Use complain_at.
17455 * src/reader.c (reader): Exit if there were parse errors.
17457 2002-07-09 Akim Demaille <akim@epita.fr>
17459 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
17460 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
17461 Reported by R Blake <blakers@mac.com>.
17463 2002-07-09 Akim Demaille <akim@epita.fr>
17465 * data/yacc.c: Output the copyright notive in the header.
17467 2002-07-03 Akim Demaille <akim@epita.fr>
17469 * src/output.c (froms, tos): Are state_number_t.
17470 (save_column): sp, sp1, and sp2 are state_number_t.
17471 (prepare): Rename `final' as `final_state_number', `nnts' as
17472 `nterms_number', `nrules' as `rules_number', `nstates' as
17473 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
17475 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
17476 * data/lalr1.cc (nsym_): Remove, unused.
17478 2002-07-03 Akim Demaille <akim@epita.fr>
17480 * src/lalr.h, src/lalr.c (goto_number_t): New.
17481 * src/lalr.c (goto_list_t): New.
17483 * src/nullable.c (rule_list_t): New.
17485 * src/types.h: Remove.
17487 2002-07-03 Akim Demaille <akim@epita.fr>
17489 * src/closure.c (print_fderives): Use rule_rhs_print.
17490 * src/derives.c (print_derives): Use rule_rhs_print.
17491 (rule_list_t): New, replaces `shorts'.
17492 (set_derives): Add comments.
17493 * tests/sets.at (Nullable, Firsts): Adjust.
17495 2002-07-03 Akim Demaille <akim@epita.fr>
17497 * src/output.c (prepare_actions): Free `tally' and `width'.
17498 (prepare_actions): Allocate and free `order'.
17499 * src/symtab.c (symbols_free): Free `symbols'.
17500 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
17501 * src/output.c (m4_invoke): Move to...
17502 * src/scan-skel.l: here.
17503 (<<EOF>>): Close yyout, and free its name.
17505 2002-07-03 Akim Demaille <akim@epita.fr>
17507 Fix some memory leaks, and fix a bug: state 0 was examined twice.
17509 * src/LR0.c (new_state): Merge into...
17510 (state_list_append): this.
17511 (new_states): Merge into...
17512 (generate_states): here.
17513 (set_states): Don't ensure a proper `errs' state member here, do it...
17514 * src/conflicts.c (conflicts_solve): here.
17515 * src/state.h, src/state.c: Comment changes.
17516 (state_t): Rename member `shifts' as `transitions'.
17517 Adjust all dependencies.
17518 (errs_new): For consistency, also take the values as argument.
17519 (errs_dup): Remove.
17520 (state_errs_set): New.
17521 (state_reductions_set, state_transitions_set): Assert that no
17522 previous value was assigned.
17524 (states_free): Use it.
17525 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
17526 temporary storage: use `errs' and `nerrs' as elsewhere.
17527 (set_conflicts): Allocate and free this `errs'.
17529 2002-07-02 Akim Demaille <akim@epita.fr>
17531 * lib/libiberty.h: New.
17532 * lib: Update the bitset implementation from upstream.
17533 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
17534 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
17535 * src/main.c: Adjust bitset stats calls.
17537 2002-07-01 Paul Eggert <eggert@twinsun.com>
17539 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
17540 char, so that negative chars don't collide with $.
17542 2002-06-30 Akim Demaille <akim@epita.fr>
17544 Have the GLR tests be `warning' checked, and fix the warnings.
17546 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
17547 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
17548 (yyremoveDeletes): `yyi' and `yyj' are size_t.
17549 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
17550 (yyaddDeferredAction): static.
17551 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
17552 (yyreportParseError): yyprefix is const.
17553 yytokenp is used only when verbose.
17554 (yy__GNUC__): Replace with __GNUC__.
17555 (yypdumpstack): yyi is size_t.
17556 (yypreference): Un-yy local variables and arguments, to avoid
17557 clashes with `yyr1'. Anyway, we are not in the user name space.
17558 (yytname_size): be an int, as is compared with ints.
17559 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
17561 * tests/cxx-gram.at: Use quotation to protect $1.
17562 Use AT_COMPILE to enable warnings hunts.
17563 Prototype yylex and yyerror.
17565 Include `string.h', not `strings.h'.
17566 Produce and prototype stmtMerge only when used.
17567 yylex takes a location.
17569 2002-06-30 Akim Demaille <akim@epita.fr>
17571 We spend a lot of time in quotearg, in particular when --verbose.
17573 * src/symtab.c (symbol_get): Store a quoted version of the key.
17574 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
17575 Adjust all callers.
17577 2002-06-30 Akim Demaille <akim@epita.fr>
17579 * src/state.h (reductions_t): Rename member `nreds' as num.
17580 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
17581 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
17583 2002-06-30 Akim Demaille <akim@epita.fr>
17585 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
17586 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
17587 (shifts_to): Rename as...
17588 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
17589 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
17590 (TRANSITION_IS_DISABLED, transitions_to): these.
17592 2002-06-30 Akim Demaille <akim@epita.fr>
17594 * src/print.c (print_shifts, print_gotos): Merge into...
17595 (print_transitions): this.
17596 (print_transitions, print_errs, print_reductions): Align the
17597 lookaheads columns.
17598 (print_core, print_transitions, print_errs, print_state,
17599 print_grammar): Output empty lines separator before, not after.
17600 (state_default_rule_compute): Rename as...
17601 (state_default_rule): this.
17602 * tests/conflicts.at (Defaulted Conflicted Reduction),
17603 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
17604 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
17606 2002-06-30 Akim Demaille <akim@epita.fr>
17608 Display items as we display rules.
17610 * src/gram.h, src/gram.c (rule_lhs_print): New.
17611 * src/gram.c (grammar_rules_partial_print): Use it.
17612 * src/print.c (print_core): Likewise.
17613 * tests/conflicts.at (Defaulted Conflicted Reduction),
17614 (Unresolved SR Conflicts): Adjust.
17615 (Unresolved SR Conflicts): Adjust and rename as...
17616 (Resolved SR Conflicts): this, as was meant.
17617 * tests/regression.at (Web2c Report): Adjust.
17619 2002-06-30 Akim Demaille <akim@epita.fr>
17621 * src/print.c (state_default_rule_compute): New, extracted from...
17622 (print_reductions): here.
17623 Pessimize, but clarify the code.
17624 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
17626 2002-06-30 Akim Demaille <akim@epita.fr>
17628 * src/output.c (action_row): Let default_rule be always a rule
17631 2002-06-30 Akim Demaille <akim@epita.fr>
17633 * src/closure.c (print_firsts, print_fderives, closure):
17634 Use BITSET_EXECUTE.
17635 * src/lalr.c (lookaheads_print): Likewise.
17636 * src/state.c (state_rule_lookaheads_print): Likewise.
17637 * src/print_graph.c (print_core): Likewise.
17638 * src/print.c (print_reductions): Likewise.
17639 * src/output.c (action_row): Likewise.
17640 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
17642 2002-06-30 Akim Demaille <akim@epita.fr>
17644 * src/print_graph.c: Use report_flag.
17646 2002-06-30 Akim Demaille <akim@epita.fr>
17648 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
17650 * src/relation.h, src/relation.c (traverse, relation_digraph)
17651 (relation_print, relation_transpose): New.
17653 2002-06-30 Akim Demaille <akim@epita.fr>
17655 * src/state.h, src/state.c (shifts_to): New.
17656 * src/lalr.c (build_relations): Use it.
17658 2002-06-30 Akim Demaille <akim@epita.fr>
17660 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
17661 (item_number_of_rule_number, rule_number_of_item_number): New.
17662 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
17663 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
17664 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
17665 Propagate their use.
17666 Much remains to be done, in particular wrt `shorts' from types.h.
17668 2002-06-30 Akim Demaille <akim@epita.fr>
17670 * src/symtab.c (symbol_new): Initialize the `printer' member.
17672 2002-06-30 Akim Demaille <akim@epita.fr>
17674 * src/LR0.c (save_reductions): Remove, replaced by...
17675 * src/state.h, src/state.c (state_reductions_set): New.
17676 (reductions, errs): Rename as...
17677 (reductions_t, errs_t): these.
17678 Adjust all dependencies.
17680 2002-06-30 Akim Demaille <akim@epita.fr>
17682 * src/LR0.c (state_list_t, state_list_append): New.
17683 (first_state, last_state): Now symbol_list_t.
17684 (this_state): Remove.
17685 (new_itemsets, append_states, save_reductions): Take a state_t as
17687 (set_states, generate_states): Adjust.
17688 (save_shifts): Remove, replaced by...
17689 * src/state.h, src/state.c (state_shifts_set): New.
17690 (shifts): Rename as...
17692 Adjust all dependencies.
17693 * src/state.h (state_t): Remove the `next' member.
17695 2002-06-30 Akim Demaille <akim@epita.fr>
17697 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
17700 2002-06-30 Akim Demaille <akim@epita.fr>
17702 Use hash.h for the state hash table.
17704 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
17705 (allocate_storage): Use state_hash_new.
17706 (free_storage): Use state_hash_free.
17707 (new_state, get_state): Adjust.
17708 * src/lalr.h, src/lalr.c (states): Move to...
17709 * src/states.h (state_t): Remove the `link' member, no longer
17711 * src/states.h, src/states.c: here.
17712 (state_hash_new, state_hash_free, state_hash_lookup)
17713 (state_hash_insert, states_free): New.
17714 * src/states.c (state_table, state_compare, state_hash): New.
17715 * src/output.c (output_actions): Do not free states now, since we
17716 still need to know the final_state number in `prepare', called
17717 afterwards. Do it...
17718 * src/main.c (main): here: call states_free after `output'.
17720 2002-06-30 Akim Demaille <akim@epita.fr>
17722 * src/state.h, src/state.c (state_new): New, extracted from...
17723 * src/LR0.c (new_state): here.
17724 * src/state.h (STATE_ALLOC): Move to...
17725 * src/state.c: here.
17726 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
17727 * src/state.h, src/state.c: here.
17729 2002-06-30 Akim Demaille <akim@epita.fr>
17731 * src/reader.c (gensym): Rename as...
17732 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
17733 (getsym): Rename as...
17734 (symbol_get): this.
17736 2002-06-30 Akim Demaille <akim@epita.fr>
17738 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
17739 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
17740 * src/output.c, src/print.c, src/print_graph.c: Propagate.
17741 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
17743 2002-06-30 Akim Demaille <akim@epita.fr>
17745 Make the test suite pass with warnings checked.
17747 * tests/actions.at (Printers and Destructors): Improve.
17748 Avoid unsigned vs. signed issues.
17749 * tests/calc.at: Don't exercise the scanner here, do it...
17750 * tests/input.at (Torturing the Scanner): here.
17752 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17754 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
17755 reorganize first lines parallel to yacc.c.
17757 2002-06-28 Akim Demaille <akim@epita.fr>
17759 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
17760 (b4_token_enum, b4_token_defines): New, factored from...
17761 * data/lalr1.cc, data/yacc.c, glr.c: here.
17763 2002-06-28 Akim Demaille <akim@epita.fr>
17765 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
17767 * src/output.c (merger_output): static.
17769 2002-06-28 Akim Demaille <akim@epita.fr>
17771 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
17772 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
17774 * src/output.c (save_row): Initialize all the variables to pacify GCC.
17776 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17778 Accumulated changelog for new GLR parsing features.
17780 * src/conflicts.c (count_total_conflicts): Change name to
17781 conflicts_total_count.
17782 * src/conflicts.h: Ditto.
17783 * src/output.c (token_actions): Use the new name.
17784 (output_conflicts): Change conflp => conflict_list_heads, and
17785 confl => conflict_list for better readability.
17786 * data/glr.c: Use the new names.
17787 * NEWS: Add self to GLR announcement.
17789 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
17791 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
17794 * data/bison.glr: Change name to glr.c
17795 * data/glr.c: Renamed from bison.glr.
17796 * data/Makefile.am: Add glr.c
17800 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
17801 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
17803 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17805 * data/bison.glr: Be sure to restore the
17806 current #line when returning to the skeleton contents after having
17807 exposed the input file's #line.
17809 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17811 * data/bison.glr: Bring up to date with changes to bison.simple.
17813 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17815 * data/bison.glr: Correct definitions that use b4_prefix.
17816 Various reformatting.
17817 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
17818 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
17819 yytokenp argument; now part of stack.
17820 (yychar): Define to behave as documented.
17821 (yyclearin): Ditto.
17823 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17825 * src/reader.h: Add declaration for free_merger_functions.
17827 * src/reader.c (merge_functions): New variable.
17828 (get_merge_function): New function.
17829 (free_merger_functions): New function.
17830 (readgram): Check for %prec that is not followed by a symbol.
17831 Handle %dprec and %merge declarations.
17832 (packgram): Initialize dprec and merger fields in rules array.
17834 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
17835 conflict_list_cnt, conflict_list_free): New variables.
17836 (table_grow): Also grow conflict_table.
17837 (prepare_rules): Output dprec and merger tables.
17838 (conflict_row): New function.
17839 (action_row): Output conflict lists for GLR parser. Don't use
17840 default reduction in conflicted states for GLR parser so that there
17841 are spaces for the conflict lists.
17842 (save_row): Also save conflict information.
17843 (token_actions): Allocate conflict list.
17844 (merger_output): New function.
17845 (pack_vector): Pack conflict table, too.
17846 (output_conflicts): New function to output yyconflp and yyconfl.
17847 (output_check): Allocate conflict_tos.
17848 (output_actions): Output conflict tables, also.
17849 (output_skeleton): Output b4_mergers definition.
17850 (prepare): Output b4_max_rhs_length definition.
17851 Use 'bison.glr' as default skeleton for GLR parsers.
17853 * src/gram.c (glr_parser): New flag.
17854 (grammar_free): Call free_merger_functions.
17856 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
17857 all pairs of conflicting reductions, rather than just all tokens
17858 causing conflicts. Needed to size conflict tables.
17859 (conflicts_output): Modify call to count_rr_conflicts for new
17861 (conflicts_print): Ditto.
17862 (count_total_conflicts): New function.
17864 * src/reader.h (merger_list): New type.
17865 (merge_functions): New variable.
17867 * src/lex.h (tok_dprec, tok_merge): New token types.
17869 * src/gram.h (rule_s): Add dprec and merger fields.
17870 (glr_parser): New flag.
17872 * src/conflicts.h (count_total_conflicts): New function.
17874 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
17876 * doc/bison.texinfo (Generalized LR Parsing): New section.
17877 (GLR Parsers): New section.
17878 (Language and Grammar): Mention GLR parsing.
17879 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
17880 Correct typo ("tge" -> "the").
17882 * data/bison.glr: New skeleton for GLR parsing.
17884 * tests/cxx-gram.at: New tests for GLR parsing.
17886 * tests/testsuite.at: Include cxx-gram.at.
17888 * tests/Makefile.am: Add cxx-gram.at.
17890 * src/parse-gram.y:
17892 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
17894 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
17896 2002-06-27 Akim Demaille <akim@epita.fr>
17898 * src/options.h, src/options.c: Remove.
17899 * src/getargs.c (short_options, long_options): New.
17901 2002-06-27 Akim Demaille <akim@epita.fr>
17903 * data/bison.simple, data/bison.c++: Rename as...
17904 * data/yacc.c, data/lalr1.cc: these.
17905 * doc/bison.texinfo (Environment Variables): Remove.
17907 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
17909 * src/getargs.c (report_argmatch): Initialize strtok().
17911 2002-06-20 Akim Demaille <akim@epita.fr>
17913 * data/bison.simple (b4_symbol_actions): New, replaces...
17914 (b4_symbol_destructor, b4_symbol_printer): these.
17915 (yysymprint): Be sure to call YYPRINT only for tokens, and using
17916 user token numbers.
17918 2002-06-20 Akim Demaille <akim@epita.fr>
17920 * data/bison.simple (yydestructor): Rename as...
17921 (yydestruct): this.
17923 2002-06-20 Akim Demaille <akim@epita.fr>
17925 * src/symtab.h, src/symtab.c (symbol_type_set)
17926 (symbol_destructor_set, symbol_precedence_set): The location is
17928 Adjust all callers.
17930 2002-06-20 Akim Demaille <akim@epita.fr>
17932 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
17934 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
17936 * src/symtab.h, src/symtab.c (symbol_class_set)
17937 (symbol_user_token_number_set): Likewise.
17938 Adjust all callers.
17939 Promote complain_at.
17940 * tests/input.at (Type Clashes): Adjust.
17942 2002-06-20 Akim Demaille <akim@epita.fr>
17944 * data/bison.simple (YYLEX): Fix the declaration when
17947 2002-06-20 Akim Demaille <akim@epita.fr>
17949 * data/bison.simple (yysymprint): Don't print the token number,
17951 * tests/actions.at (Destructors): Rename as...
17952 (Printers and Destructors): this.
17953 Also exercise %printer.
17955 2002-06-20 Akim Demaille <akim@epita.fr>
17957 * data/bison.simple (YYDSYMPRINT): New.
17958 Use it to remove many of the #if YYDEBUG/if (yydebug).
17960 2002-06-20 Akim Demaille <akim@epita.fr>
17962 * src/symtab.h, src/symtab.c (symbol_t): printer and
17963 printer_location are new members.
17964 (symbol_printer_set): New.
17965 * src/parse-gram.y (PERCENT_PRINTER): New token.
17966 Handle its associated rule.
17967 * src/scan-gram.l: Adjust.
17968 (handle_destructor_at, handle_destructor_dollar): Rename as...
17969 (handle_symbol_code_at, handle_symbol_code_dollar): these.
17970 * src/output.c (symbol_printers_output): New.
17971 (output_skeleton): Call it.
17972 * data/bison.simple (yysymprint): New. Cannot be named yyprint
17973 since there are already many grammar files with a user `yyprint'.
17974 Replace the calls to YYPRINT to calls to yysymprint.
17975 * tests/calc.at: Adjust.
17976 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
17977 taking advantage of parser very internal details (stack size!).
17979 2002-06-20 Akim Demaille <akim@epita.fr>
17981 * src/scan-gram.l: Complete the scanner with the missing patterns
17983 Use `quote' and `symbol_tag_get' where appropriate.
17985 2002-06-19 Akim Demaille <akim@epita.fr>
17987 * tests/actions.at (Destructors): Augment to test locations.
17988 * data/bison.simple (yydestructor): Pass it the current location
17989 if locations are enabled.
17990 Prototype only when __STDC__ or C++.
17991 Change the argument names to move into the yy name space: there is
17994 2002-06-19 Akim Demaille <akim@epita.fr>
17996 * data/bison.simple (b4_pure_if): New.
17997 Use it instead of #ifdef YYPURE.
17999 2002-06-19 Akim Demaille <akim@epita.fr>
18001 * data/bison.simple (b4_location_if): New.
18002 Use it instead of #ifdef YYLSP_NEEDED.
18004 2002-06-19 Akim Demaille <akim@epita.fr>
18006 Prepare @$ in %destructor, but currently don't bind it in the
18007 skeleton, as %location use is not cleaned up yet.
18009 * src/scan-gram.l (handle_dollar, handle_destructor_at)
18010 (handle_action_at): New.
18011 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
18012 a braced_code_t and a location as additional arguments.
18013 (handle_destructor_dollar): Instead of requiring `b4_eval', just
18014 unquote one when outputting `b4_dollar_dollar'.
18016 * data/bison.simple (b4_eval): Remove.
18017 (b4_symbol_destructor): Adjust.
18018 * tests/input.at (Invalid @n): Adjust.
18020 2002-06-19 Zack Weinberg <zack@codesourcery.com>
18022 * doc/bison.texinfo: Document ability to have multiple
18025 2002-06-18 Akim Demaille <akim@epita.fr>
18027 * src/files.c (compute_base_names): When computing the output file
18028 names from the input file name, strip the directory part.
18030 2002-06-18 Akim Demaille <akim@epita.fr>
18032 * data/bison.simple.new: Comment changes.
18033 Reported by Andreas Schwab.
18035 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
18037 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
18038 there are no `label `yyoverflowlab' defined but not used' warnings
18039 when yyoverflow is defined.
18041 2002-06-18 Akim Demaille <akim@epita.fr>
18043 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
18045 (symbol_destructor_set): Adjust.
18046 * src/output.c (symbol_destructors_output): Output the destructor
18048 Output the symbol name.
18049 * data/bison.simple (b4_symbol_destructor): Adjust.
18051 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
18052 and Akim Demaille <akim@epita.fr>
18054 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
18055 what's left on the stack when the error recovery hits EOF.
18056 * tests/actions.at (Destructors): Complete to exercise this case.
18058 2002-06-17 Akim Demaille <akim@epita.fr>
18060 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
18061 arguments is really empty, not only equal to `[]'.
18062 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
18064 (symbol_destructor_set): New.
18065 * src/output.c (symbol_destructors_output): New.
18066 * src/reader.h (brace_code_t, current_braced_code): New.
18067 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
18068 (handle_dollar): Rename as...
18069 (handle_action_dollar): this.
18070 (handle_destructor_dollar): New.
18071 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
18072 (grammar_declaration): Use it.
18073 * data/bison.simple (yystos): Is always defined.
18074 (yydestructor): New.
18075 * tests/actions.at (Destructors): New.
18076 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
18078 2002-06-17 Akim Demaille <akim@epita.fr>
18080 * src/symlist.h, src/symlist.c (symbol_list_length): New.
18081 * src/scan-gram.l (handle_dollar, handle_at): Compute the
18082 rule_length only when needed.
18083 * src/output.c (actions_output, token_definitions_output): Output
18085 * src/symtab.c: Don't access directly to the symbol tag, use
18087 * src/parse-gram.y: Use symbol_list_free.
18089 2002-06-17 Akim Demaille <akim@epita.fr>
18091 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
18092 (symbol_list_prepend, get_type_name): Move to...
18093 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
18094 (symbol_list_prepend, symbol_list_n_type_name_get): here.
18095 Adjust all callers.
18096 (symbol_list_free): New.
18097 * src/scan-gram.l (handle_dollar): Takes a location.
18098 * tests/input.at (Invalid $n): Adjust.
18100 2002-06-17 Akim Demaille <akim@epita.fr>
18102 * src/reader.h, src/reader.c (symbol_list_new): Export it.
18103 (symbol_list_prepend): New.
18104 * src/parse-gram.y (%union): `list' is a new member.
18105 (symbols.1): New, replaces...
18106 (terms_to_prec.1, nterms_to_type.1): these.
18107 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
18108 Take a location as additional argument.
18109 Adjust all callers.
18111 2002-06-15 Akim Demaille <akim@epita.fr>
18113 * src/parse-gram.y: Move %token in the declaration section so that
18114 we don't depend upon CVS Bison.
18116 2002-06-15 Akim Demaille <akim@epita.fr>
18118 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
18119 * src/print.c (print_core): Use it.
18121 2002-06-15 Akim Demaille <akim@epita.fr>
18123 * src/conflicts.c (log_resolution): Accept the rule involved in
18124 the sr conflicts instead of the lookahead number that points to
18126 (flush_reduce): Accept the current lookahead vector as argument,
18127 instead of the index in LA.
18128 (resolve_sr_conflict): Accept the current number of lookahead
18129 bitset to consider for the STATE, instead of the index in LA.
18130 (set_conflicts): Adjust.
18131 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
18133 2002-06-15 Akim Demaille <akim@epita.fr>
18135 * src/state.h (state_t): Replace the `lookaheadsp' member, a
18136 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
18137 Adjust all dependencies.
18138 * src/lalr.c (initialize_lookaheads): Split into...
18139 (states_lookaheads_count, states_lookaheads_initialize): these.
18142 2002-06-15 Akim Demaille <akim@epita.fr>
18144 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
18146 (grammar_rules_print): here.
18147 * src/reduce.c (reduce_output): Use it.
18148 * tests/reduce.at (Useless Rules, Reduced Automaton)
18149 (Underivable Rules): Adjust.
18151 2002-06-15 Akim Demaille <akim@epita.fr>
18153 Copy BYacc's nice way to report the grammar.
18155 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
18157 Don't print the rules' location, it is confusing and useless.
18158 (rule_print): Use grammar_rhs_print.
18159 * src/print.c (print_grammar): Use grammar_rules_print.
18161 2002-06-15 Akim Demaille <akim@epita.fr>
18163 Complete and rationalize `useless thing' warnings.
18165 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
18166 (symbol_tag_print): New.
18167 Use them everywhere in place of accessing directly the tag member.
18168 * src/gram.h, src/gram.c (rule_print): New.
18169 Use it where a rule used to be printed `by hand'.
18170 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
18171 (reduce_grammar_tables): Report the useless rules.
18172 (reduce_print): Useless things are a warning, not an error.
18174 * tests/reduce.at (Useless Nonterminals, Useless Rules):
18175 (Reduced Automaton, Underivable Rules): Adjust.
18176 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
18177 * tests/conflicts.at (Unresolved SR Conflicts)
18178 (Solved SR Conflicts): Adjust.
18180 2002-06-15 Akim Demaille <akim@epita.fr>
18182 Let symbols have a location.
18184 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
18186 Adjust all callers.
18187 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
18188 Use location_t, not int.
18189 * src/symtab.c (symbol_check_defined): Take advantage of the
18191 * tests/regression.at (Invalid inputs): Adjust.
18193 2002-06-15 Akim Demaille <akim@epita.fr>
18195 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
18196 (input): Don't try to initialize yylloc here, do it in the
18198 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
18199 * src/gram.h (rule_t): Change line and action_line into location
18200 and action_location, of location_t type.
18201 Adjust all dependencies.
18202 * src/location.h, src/location.c (empty_location): New.
18203 * src/reader.h, src/reader.c (grammar_start_symbol_set)
18204 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
18205 (grammar_current_rule_symbol_append)
18206 (grammar_current_rule_action_append): Expect a location as argument.
18207 * src/reader.c (grammar_midrule_action): Adjust to attach an
18208 action's location as dummy symbol location.
18209 * src/symtab.h, src/symtab.c (startsymbol_location): New.
18210 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
18213 2002-06-14 Akim Demaille <akim@epita.fr>
18215 Grammar declarations may be found in the grammar section.
18217 * src/parse-gram.y (rules_or_grammar_declaration): New.
18218 (declarations): Each declaration may end with a semicolon, not
18220 (grammar_declaration): `"%union"'.
18221 (grammar): Branch to rules_or_grammar_declaration.
18223 2002-06-14 Akim Demaille <akim@epita.fr>
18225 * src/main.c (main): Invoke scanner_free.
18227 2002-06-14 Akim Demaille <akim@epita.fr>
18229 * src/output.c (m4_invoke): Extracted from...
18230 (output_skeleton): here.
18233 2002-06-14 Akim Demaille <akim@epita.fr>
18235 * src/parse-gram.y (directives, directive, gram)
18236 (grammar_directives, precedence_directives, precedence_directive):
18238 (declarations, declaration, grammar, grammar_declaration)
18239 (precedence_declaration, precedence_declarator): these.
18240 (symbol_declaration): New.
18242 2002-06-14 Akim Demaille <akim@epita.fr>
18244 * src/files.c (action_obstack): Remove, unused.
18245 (output_obstack): Remove it, and all its dependencies, as it is no
18247 * src/reader.c (epilogue_set): Build the epilogue in the
18249 * src/output.h, src/output.c (muscle_obstack): Move to...
18250 * src/muscle_tab.h, src/muscle_tab.h: here.
18251 (muscle_init): Initialize muscle_obstack.
18252 (muscle_free): New.
18253 * src/main.c (main): Call it.
18255 2002-06-14 Akim Demaille <akim@epita.fr>
18257 * src/location.h: New, extracted from...
18258 * src/reader.h: here.
18259 * src/Makefile.am (noinst_HEADERS): Merge into
18260 (bison_SOURCES): this.
18262 * src/parse-gram.y: Use location_t instead of Bison's.
18263 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
18264 Use location_t instead of ints.
18266 2002-06-14 Akim Demaille <akim@epita.fr>
18268 * data/bison.simple, data/bison.c++: Be sure to restore the
18269 current #line when returning to the skeleton contents after having
18270 exposed the input file's #line.
18272 2002-06-12 Akim Demaille <akim@epita.fr>
18274 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
18276 * tests/actions.at (Exotic Dollars): New.
18278 2002-06-12 Akim Demaille <akim@epita.fr>
18280 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
18282 * tests/input.at (Torturing the Scanner): New.
18284 2002-06-11 Akim Demaille <akim@epita.fr>
18286 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
18287 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
18288 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
18289 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
18290 * src/reader.c (reader): Use it.
18292 2002-06-11 Akim Demaille <akim@epita.fr>
18294 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
18295 Adjust all callers.
18296 (scanner_last_string_free): New.
18298 2002-06-11 Akim Demaille <akim@epita.fr>
18300 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
18301 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
18302 (last_string, YY_OBS_FREE): New.
18303 Use them when returning an ID.
18305 2002-06-11 Akim Demaille <akim@epita.fr>
18307 Have Bison grammars parsed by a Bison grammar.
18309 * src/reader.c, src/reader.h (prologue_augment): New.
18310 * src/reader.c (copy_definition): Remove.
18312 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
18313 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
18314 (grammar_current_rule_prec_set, grammar_current_rule_check)
18315 (grammar_current_rule_symbol_append)
18316 (grammar_current_rule_action_append): Export.
18317 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
18318 (symbol_list_action_append): Remove.
18319 Hook the routines from reader.
18320 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
18321 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
18323 * src/reader.c (read_declarations): Remove, unused.
18325 * src/parse-gram.y: Handle the epilogue.
18326 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
18327 (grammar_start_symbol_set): this.
18328 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
18329 * src/reader.c (readgram): Remove, unused.
18330 (reader): Adjust to insert eoftoken and axiom where appropriate.
18332 * src/reader.c (copy_dollar): Replace with...
18333 * src/scan-gram.h (handle_dollar): this.
18334 * src/parse-gram.y: Remove `%thong'.
18336 * src/reader.c (copy_at): Replace with...
18337 * src/scan-gram.h (handle_at): this.
18339 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
18342 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
18345 * src/reader.h, src/reader.c (grammar_rule_end): New.
18347 * src/parse.y (current_type, current_class): New.
18348 Implement `%nterm', `%token' support.
18349 Merge `%term' into `%token'.
18350 (string_as_id): New.
18351 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
18354 * src/parse-gram.y: Be sure to handle properly the beginning of
18357 * src/parse-gram.y: Handle %type.
18358 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
18360 * src/parse-gram.y: More directives support.
18361 * src/options.c: No longer handle source directives.
18363 * src/parse-gram.y: Fix %output.
18365 * src/parse-gram.y: Handle %union.
18366 Use the prologue locations.
18367 * src/reader.c (parse_union_decl): Remove.
18369 * src/reader.h, src/reader.c (epilogue_set): New.
18370 * src/parse-gram.y: Use it.
18372 * data/bison.simple, data/bison.c++: b4_stype is now either not
18373 defined, then default to int, or to the contents of %union,
18374 without `union' itself.
18376 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
18378 * src/output.c (actions_output): Don't output braces, as they are
18379 already handled by the scanner.
18381 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
18382 characters to themselves.
18384 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
18385 that the epilogue has a proper #line.
18387 * src/parse-gram.y: Handle precedence/associativity.
18389 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
18391 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
18392 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
18393 at all to define terminals that cannot be emitted.
18395 * src/scan-gram.l: Escape M4 characters.
18397 * src/scan-gram.l: Working properly with escapes in user
18398 strings/characters.
18400 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
18401 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
18403 Use more modest sizes, as for the time being the parser does not
18404 release memory, and therefore the process swallows a huge amount
18407 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
18408 stricter %token grammar.
18410 * src/symtab.h (associativity): Add `undef_assoc'.
18411 (symbol_precedence_set): Do nothing when passed an undef_assoc.
18412 * src/symtab.c (symbol_check_alias_consistence): Adjust.
18414 * tests/regression.at (Invalid %directive): Remove, as it is now
18416 (Invalid inputs): Adjust to the new error messages.
18417 (Token definitions): The new grammar doesn't allow too many
18420 * src/lex.h, src/lex.c: Remove.
18421 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
18422 (copy_character, copy_string2, copy_string, copy_identifier)
18423 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
18424 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
18425 (parse_action): Remove.
18426 * po/POTFILES.in: Adjust.
18428 2002-06-11 Akim Demaille <akim@epita.fr>
18430 * src/reader.c (parse_action): Don't store directly into the
18431 rule's action member: return the action as a string.
18432 Don't require `rule_length' as an argument: compute it.
18433 (grammar_current_rule_symbol_append)
18434 (grammar_current_rule_action_append): New, eved out from
18436 Remove `action_flag', `rulelength', unused now.
18438 2002-06-11 Akim Demaille <akim@epita.fr>
18440 * src/reader.c (grammar_current_rule_prec_set).
18441 (grammar_current_rule_check): New, eved out from...
18443 Remove `xaction', `first_rhs': useless.
18444 * tests/input.at (Type clashes): New.
18445 * tests/existing.at (GNU Cim Grammar): Adjust.
18447 2002-06-11 Akim Demaille <akim@epita.fr>
18449 * src/reader.c (grammar_midrule_action): New, Eved out from
18452 2002-06-11 Akim Demaille <akim@epita.fr>
18454 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
18456 (readgram): Use them as replacement of inlined code, crule and
18459 2002-06-11 Akim Demaille <akim@epita.fr>
18461 * src/reader.c (grammar_end, grammar_symbol_append): New.
18462 (readgram): Use them.
18463 Make the use of `p' as local as possible.
18465 2002-06-10 Akim Demaille <akim@epita.fr>
18467 GCJ's parser requires the tokens to be defined before the prologue.
18469 * data/bison.simple: Output the token definition before the user's
18471 * tests/regression.at (Braces parsing, Duplicate string)
18472 (Mixing %token styles): Check the output from bison.
18473 (Early token definitions): New.
18475 2002-06-10 Akim Demaille <akim@epita.fr>
18477 * src/symtab.c (symbol_user_token_number_set): Don't complain when
18478 assigning twice the same user number to a token, so that we can
18480 * src/lex.c (lex): here.
18481 Also use `symbol_class_set' instead of hand written code.
18482 * src/reader.c (parse_assoc_decl): Likewise.
18484 2002-06-10 Akim Demaille <akim@epita.fr>
18486 * src/symtab.c, src/symtab.c (symbol_class_set)
18487 (symbol_user_token_number_set): New.
18488 * src/reader.c (parse_token_decl): Use them.
18489 Use a switch instead of ifs.
18490 Use a single argument.
18492 2002-06-10 Akim Demaille <akim@epita.fr>
18494 Remove `%thong' support as it is undocumented, unused, duplicates
18495 `%token's job, and creates useless e-mail traffic with people who
18496 want to know what it is, why it is undocumented, unused, and
18497 duplicates `%token's job.
18499 * src/reader.c (parse_thong_decl): Remove.
18500 * src/options.c (option_table): Remove "thong".
18501 * src/lex.h (tok_thong): Remove.
18503 2002-06-10 Akim Demaille <akim@epita.fr>
18505 * src/symtab.c, src/symtab.c (symbol_type_set)
18506 (symbol_precedence_set): New.
18507 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
18508 (value_components_used): Remove, unused.
18510 2002-06-09 Akim Demaille <akim@epita.fr>
18512 Move symbols handling code out of the reader.
18514 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
18515 (axiom): Move to...
18516 * src/symtab.h, src/symtab.c: here.
18518 * src/gram.c (start_symbol): Remove: use startsymbol->number.
18519 * src/reader.c (startval): Rename as...
18520 * src/symtab.h, src/symtab.c (startsymbol): this.
18521 * src/reader.c: Adjust.
18523 * src/reader.c (symbol_check_defined, symbol_make_alias)
18524 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
18525 (token_translations_init)
18527 * src/symtab.c: here.
18528 * src/reader.c (packsymbols): Move to...
18529 * src/symtab.h, src/symtab.c (symbols_pack): here.
18530 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
18533 2002-06-03 Akim Demaille <akim@epita.fr>
18535 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
18538 2002-06-03 Akim Demaille <akim@epita.fr>
18540 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
18541 structs with non literals.
18542 * src/scan-skel.l: never-interactive.
18543 * src/conflicts.c (enum conflict_resolution_e): No trailing
18545 * src/getargs.c (usage): Split long literal strings.
18546 Reported by Hans Aberg.
18548 2002-05-28 Akim Demaille <akim@epita.fr>
18550 * data/bison.c++: Use C++ ostreams.
18551 (cdebug_): New member.
18553 2002-05-28 Akim Demaille <akim@epita.fr>
18555 * src/output.c (output_skeleton): Be sure to allocate enough room
18556 for `/' _and_ for `\0' in full_skeleton.
18558 2002-05-28 Akim Demaille <akim@epita.fr>
18560 * data/bison.c++: Catch up with bison.simple:
18561 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18562 and Paul Eggert <eggert@twinsun.com>: `error' handing.
18563 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
18564 and popping traces.
18566 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18568 * src/output.c (output_skeleton): Put an explicit path in front of
18569 the skeleton file name, rather than relying on the -I directory,
18570 to partially alleviate effects of having a skeleton file lying around
18571 in the current directory.
18573 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18575 * src/conflicts.c (log_resolution): Correct typo:
18576 obstack_printf should be obstack_fgrow1.
18578 2002-05-26 Akim Demaille <akim@epita.fr>
18580 * src/state.h (state_t): `solved_conflicts' is a new member.
18581 * src/LR0.c (new_state): Set it to 0.
18582 * src/conflicts.h, src/conflicts.c (print_conflicts)
18583 (free_conflicts, solve_conflicts): Rename as...
18584 (conflicts_print, conflicts_free, conflicts_solve): these.
18586 * src/conflicts.c (enum conflict_resolution_e)
18587 (solved_conflicts_obstack): New, used by...
18588 (log_resolution): this.
18589 Adjust to attach the conflict resolution to each state.
18590 Complete the description with the precedence/associativity
18592 (resolve_sr_conflict): Adjust.
18593 * src/print.c (print_state): Output its solved_conflicts.
18594 * tests/conflicts.at (Unresolved SR Conflicts)
18595 (Solved SR Conflicts): Exercise --report=all.
18597 2002-05-26 Akim Demaille <akim@epita.fr>
18599 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
18600 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
18601 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
18602 (token_number_t, item_number_as_token_number)
18603 (token_number_as_item_number, muscle_insert_token_number_table):
18605 (symbol_number_t, item_number_as_symbol_number)
18606 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
18607 these, since it is more appropriate.
18609 2002-05-26 Akim Demaille <akim@epita.fr>
18611 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
18613 * data/bison.simple (yystos) [YYDEBUG]: New.
18614 (yyparse) [YYDEBUG]: Display the symbols which are popped during
18616 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
18618 2002-05-25 Akim Demaille <akim@epita.fr>
18620 * doc/bison.texinfo (Debugging): Split into...
18621 (Tracing): this new section, its former contents, and...
18622 (Understanding): this new section.
18623 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
18625 (report_flag): this.
18626 Adjust all dependencies.
18627 (report_args, report_types, report_argmatch): New.
18628 (usage, getargs): Report/support -r, --report.
18630 (struct option_table_struct): Rename as..,
18631 (struct option_table_s): this.
18632 Rename the `set_flag' member to `flag' to match with getopt_long's
18634 * src/options.c (option_table): Split verbose into an entry for
18635 %verbose, and another for --verbose.
18636 Support --report/-r, so remove -r from the obsolete --raw.
18637 * src/print.c: Attach full item sets and lookaheads reports to
18638 report_flag instead of trace_flag.
18639 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
18641 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18642 and Paul Eggert <eggert@twinsun.com>
18644 * data/bison.simple (yyparse): Correct error handling to conform to
18645 POSIX and yacc. Specifically, after syntax error is discovered,
18646 do not reduce further before shifting the error token.
18647 Clean up the code a bit by removing the labels yyerrdefault,
18648 yyerrhandle, yyerrpop.
18649 * NEWS: Document the above.
18651 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18653 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
18654 type; it isn't always big enough, since it doesn't necessarily
18655 include non-terminals.
18656 (yytranslate): Expand definition of yy_token_number_type, so that
18657 the latter can be removed.
18658 (yy_token_number_type): Remove, only one use.
18659 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
18660 don't use TokenNumberType as element type.
18662 * tests/regression.at: Modify expected output to agree with change
18663 to yyr1 and yytranslate.
18665 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
18667 * src/reader.c (parse_action): Use copy_character instead of
18670 2002-05-13 Akim Demaille <akim@epita.fr>
18672 * tests/regression.at (Token definitions): Prototype yylex and
18675 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18677 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
18678 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
18680 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
18682 2002-05-07 Akim Demaille <akim@epita.fr>
18684 * tests/synclines.at: Be sure to prototype yylex and yyerror to
18685 avoid GCC warnings.
18687 2002-05-07 Akim Demaille <akim@epita.fr>
18691 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
18692 over the RHS of each rule.
18693 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
18694 * src/state.h (state_t): Member `nitems' is unsigned short.
18695 * src/LR0.c (get_state): Adjust.
18696 * src/reader.c (packgram): Likewise.
18697 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
18699 (muscle_insert_int_table): Remove, unused.
18700 (prepare_rules): Remove `max'.
18702 2002-05-06 Akim Demaille <akim@epita.fr>
18704 * src/closure.c (print_firsts): Display of the symbol tags.
18705 (bitmatrix_print): Move to...
18706 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
18708 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
18710 2002-05-06 Akim Demaille <akim@epita.fr>
18712 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
18715 2002-05-06 Akim Demaille <akim@epita.fr>
18717 * src/LR0.c (new_state, get_state): Instead of using the global
18718 `kernel_size' and `kernel_base', have two new arguments:
18719 `core_size' and `core'.
18722 2002-05-06 Akim Demaille <akim@epita.fr>
18724 * src/reader.c (packgram): No longer end `ritem' with a 0
18725 sentinel: it is not used.
18727 2002-05-05 Akim Demaille <akim@epita.fr>
18729 New experimental feature: display the lookaheads in the report and
18732 * src/print (print_core): When --trace-flag, display the rules
18734 * src/print_graph.c (print_core): Likewise.
18735 Swap the arguments.
18738 2002-05-05 Akim Demaille <akim@epita.fr>
18740 * tests/torture.at (Many lookaheads): New test.
18742 2002-05-05 Akim Demaille <akim@epita.fr>
18744 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
18745 (GENERATE_MUSCLE_INSERT_TABLE): this.
18746 (output_int_table, output_unsigned_int_table, output_short_table)
18747 (output_token_number_table, output_item_number_table): Replace with...
18748 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
18749 (muscle_insert_short_table, muscle_insert_token_number_table)
18750 (muscle_insert_item_number_table): these.
18751 Adjust all callers.
18752 (prepare_tokens): Don't free `translations', since...
18753 * src/reader.h, src/reader.c (grammar_free): do it.
18755 * src/gram.h, src/gram.c (grammar_free): here.
18756 * data/bison.simple, data/bison.c++: b4_token_number_max is now
18759 2002-05-05 Akim Demaille <akim@epita.fr>
18761 * src/output.c (output_unsigned_int_table): New.
18762 (prepare_rules): `i' is unsigned.
18763 `prhs', `rline', `r2' are unsigned int.
18764 Rename muscle `rhs_number_max' as `rhs_max'.
18765 Output muscles `prhs_max', `rline_max', and `r2_max'.
18767 * data/bison.simple, data/bison.c++: Adjust to use these muscles
18768 to compute types instead of constant types.
18769 * tests/regression.at (Web2c Actions): Adjust.
18771 2002-05-04 Akim Demaille <akim@epita.fr>
18773 * src/symtab.h (SALIAS, SUNDEF): Rename as...
18774 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
18775 Adjust dependencies.
18776 * src/output.c (token_definitions_output): Be sure not to output a
18777 `#define 'a'' when fed with `%token 'a' "a"'.
18778 * tests/regression.at (Token definitions): New.
18780 2002-05-03 Paul Eggert <eggert@twinsun.com>
18782 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
18785 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
18787 * Makefile.am (SUBDIRS): Remove intl.
18788 (EXTRA_DIST): Add config/config.rpath.
18790 2002-05-03 Akim Demaille <akim@epita.fr>
18792 * data/bison.simple (m4_if): Don't output empty enums.
18793 And actually, output valid enum definitions :(.
18795 2002-05-03 Akim Demaille <akim@epita.fr>
18797 * configure.bat: Remove, completely obsolete.
18798 * Makefile.am (EXTRA_DIST): Adjust.
18799 Don't distribute config.rpath...
18800 * config/Makefile.am (EXTRA_DIST): Do it.
18802 2002-05-03 Akim Demaille <akim@epita.fr>
18804 * configure.in (GETTEXT_VERSION): New.
18805 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
18807 2002-05-03 Akim Demaille <akim@epita.fr>
18809 * data/bison.simple (b4_token_enum): New.
18810 (b4_token_defines): Use it to output tokens both as #define and
18812 Suggested by Paul Eggert.
18813 * src/output.c (token_definitions_output): Don't output spurious
18816 2002-05-03 Akim Demaille <akim@epita.fr>
18818 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
18820 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
18822 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
18823 Update the stack class, give a try to deque as the default container.
18825 2002-05-02 Akim Demaille <akim@epita.fr>
18827 * data/bison.simple (yyparse): Do not implement @$ = @1.
18828 (YYLLOC_DEFAULT): Adjust to do it.
18829 * doc/bison.texinfo (Location Default Action): Fix.
18831 2002-05-02 Akim Demaille <akim@epita.fr>
18833 * src/reader.c (parse_braces): Merge into...
18834 (parse_action): this.
18836 2002-05-02 Akim Demaille <akim@epita.fr>
18838 * configure.in (ALL_LINGUAS): Remove.
18839 * po/LINGUAS, hr.po: New.
18841 2002-05-02 Akim Demaille <akim@epita.fr>
18843 Remove the so called hairy (semantic) parsers.
18845 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
18846 * src/gram.h, src/gram.c (semantic_parser): Remove.
18847 (rule_t): Remove the guard and guard_line members.
18848 * src/lex.h (token_t): remove tok_guard.
18849 * src/options.c (option_table): Remove %guard and %semantic_parser
18851 * src/output.c, src/output.h (guards_output): Remove.
18853 (token_definitions_output): Don't output the `T'
18855 (output_skeleton): Don't output the guards.
18856 * src/files.c, src/files.c (attrsfile): Remove.
18857 * src/reader.c (symbol_list): Remove the guard and guard_line
18859 Adjust dependencies.
18860 (parse_guard): Remove.
18861 * data/bison.hairy: Remove.
18862 * doc/bison.texinfo (Environment Variables): Remove occurrences of
18865 2002-05-02 Akim Demaille <akim@epita.fr>
18867 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
18868 (parse_guard): Rename the formal argument `stack_offset' as
18869 `rule_length', which is more readable.
18871 (copy_at, copy_dollar): Instead of outputting the hard coded
18872 values of $$, $n and so forth, output invocation to b4_lhs_value,
18873 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
18874 Note: this patch partially drops `semantic-parser' support: it
18875 always does `rule_length - n', where semantic parsers ought to
18877 * data/bison.simple, data/bison.c++ (b4_lhs_value)
18878 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
18880 2002-05-02 Akim Demaille <akim@epita.fr>
18882 * configure.in (AC_INIT): Bump to 1.49b.
18883 (AM_INIT_AUTOMAKE): Short invocation.
18885 2002-05-02 Akim Demaille <akim@epita.fr>
18889 2002-05-01 Akim Demaille <akim@epita.fr>
18891 * src/skeleton.h: Remove.
18893 2002-05-01 Akim Demaille <akim@epita.fr>
18895 * src/skeleton.h: Fix the #endif.
18896 Reported by Magnus Fromreide.
18898 2002-04-26 Paul Eggert <eggert@twinsun.com>
18900 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
18901 Define if we define YYSTYPE and YYLTYPE, respectively.
18902 (YYCOPY): Fix [] quoting problem in the non-GCC case.
18904 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
18906 * src/scan-skel.l: Postprocess quadrigraphs.
18908 * src/reader.c (copy_character): New function, used to output
18909 single characters while replacing `[' and `]' with quadrigraphs, to
18910 avoid troubles with M4 quotes.
18911 (copy_comment): Output characters with copy_character.
18912 (read_additionnal_code): Likewise.
18913 (copy_string2): Likewise.
18914 (copy_definition): Likewise.
18916 * tests/calc.at: Exercise M4 quoting.
18918 2002-04-25 Akim Demaille <akim@epita.fr>
18920 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
18921 between `!' and the command.
18922 Reported by Paul Eggert.
18924 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
18926 * tests/calc.at: Exercise prologue splitting.
18928 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
18929 `b4_post_prologue' instead of `b4_prologue'.
18931 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
18933 (output): Free pre_prologue_obstack and post_prologue_obstack.
18934 * src/files.h, src/files.c (attrs_obstack): Remove.
18935 (pre_prologue_obstack, post_prologue_obstack): New.
18936 * src/reader.c (copy_definition): Add a parameter to specify the
18937 obstack to fill, instead of using attrs_obstack unconditionally.
18938 (read_declarations): Pass pre_prologue_obstack to copy_definition if
18939 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
18941 2002-04-23 Paul Eggert <eggert@twinsun.com>
18943 * data/bison.simple: Remove unnecessary commentary and white
18944 space differences from 1_29-branch.
18945 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
18947 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
18948 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
18949 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
18950 constructors or destructors.
18952 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
18954 2002-04-23 Akim Demaille <akim@epita.fr>
18956 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
18957 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
18958 location with columns.
18959 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
18960 All reported by Paul Eggert.
18962 2002-04-22 Akim Demaille <akim@epita.fr>
18964 * src/reduce.c (dump_grammar): Move to...
18965 * src/gram.h, src/gram.c (grammar_dump): here.
18966 Be sure to separate long item numbers.
18967 Don't read the members of a rule's prec if its nil.
18969 2002-04-22 Akim Demaille <akim@epita.fr>
18971 * src/output.c (table_size, table_grow): New.
18972 (MAXTABLE): Remove, replace uses with table_size.
18973 (pack_vector): Instead of dying when the table is too big, grow it.
18975 2002-04-22 Akim Demaille <akim@epita.fr>
18977 * data/bison.simple (yyr1): Its type is that of a token number.
18978 * data/bison.c++ (r1_): Likewise.
18979 * tests/regression.at (Web2c Actions): Adjust.
18981 2002-04-22 Akim Demaille <akim@epita.fr>
18983 * src/reader.c (token_translations_init): 256 is now the default
18984 value for the error token, i.e., it will be assigned another
18985 number if the user assigned 256 to one of her tokens.
18986 (reader): Don't force 256 to error.
18987 * doc/bison.texinfo (Symbols): Adjust.
18988 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
18989 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
18990 etc. instead of 10, 20, 30 (which was used to `jump' over error
18991 (256) and undefined (2)).
18993 2002-04-22 Akim Demaille <akim@epita.fr>
18995 Propagate more token_number_t.
18997 * src/gram.h (token_number_as_item_number)
18998 (item_number_as_token_number): New.
18999 * src/output.c (GENERATE_OUTPUT_TABLE): New.
19000 Use it to create output_item_number_table and
19001 output_token_number_table.
19002 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
19003 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
19004 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
19005 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
19007 2002-04-22 Akim Demaille <akim@epita.fr>
19009 * src/output.h, src/output.c (get_lines_number): Remove.
19011 2002-04-19 Akim Demaille <akim@epita.fr>
19013 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
19015 (Debugging): More details about enabling the debugging features.
19016 (Table of Symbols): Describe $$, $n, @$, and @n.
19017 Suggested by Tim Josling.
19019 2002-04-19 Akim Demaille <akim@epita.fr>
19021 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
19023 2002-04-10 Akim Demaille <akim@epita.fr>
19025 * src/system.h: Rely on HAVE_LIMITS_H.
19026 Suggested by Paul Eggert.
19028 2002-04-09 Akim Demaille <akim@epita.fr>
19030 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
19031 full stderr, and strip it according to the bison options, instead
19032 of composing the error message from different bits.
19033 This makes it easier to check for several error messages.
19034 Adjust all the invocations.
19035 Add an invocation exercising the error token.
19036 Add an invocation demonstrating a stupid error message.
19037 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
19039 Error message are for stderr, not stdout.
19041 2002-04-09 Akim Demaille <akim@epita.fr>
19043 * src/gram.h, src/gram.c (error_token_number): Remove, use
19045 * src/reader.c (reader): Don't specify the user token number (2)
19046 for $undefined, as it uselessly prevents using it.
19047 * src/gram.h (token_number_t): Move to...
19048 * src/symtab.h: here.
19049 (state_t.number): Is a token_number_t.
19050 * src/print.c, src/reader.c: Use undeftoken->number instead of
19052 (Even though this 2 is not the same as above: the number of the
19053 undeftoken remains being 2, it is its user token number which
19055 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
19056 `user_token_number_max'.
19057 Output `undef_token_number'.
19058 * data/bison.simple, data/bison.c++: Use them.
19059 Be sure to map invalid yylex return values to
19060 `undef_token_number'. This saves us from gratuitous SEGV.
19062 * tests/conflicts.at (Solved SR Conflicts)
19063 (Unresolved SR Conflicts): Adjust.
19064 * tests/regression.at (Web2c Actions): Adjust.
19066 2002-04-08 Akim Demaille <akim@epita.fr>
19068 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
19070 Remove the duplicate `typedefs'.
19071 (RhsNumberType): Fix the declaration and various other typos.
19073 * data/bison.simple: Use __ofile__.
19074 * src/scan-skel.l: Handle __ofile__.
19076 2002-04-08 Akim Demaille <akim@epita.fr>
19078 * src/gram.h (item_number_t): New, the type of item numbers in
19079 RITEM. Note that it must be able to code symbol numbers as
19080 positive number, and the negation of rule numbers as negative
19082 Adjust all dependencies (pretty many).
19083 * src/reduce.c (rule): Remove this `short *' pointer: use
19085 * src/system.h (MINSHORT, MAXSHORT): Remove.
19086 Include `limits.h'.
19087 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
19088 (shortcpy): Remove.
19089 (MAXTABLE): Move to...
19090 * src/output.c (MAXTABLE): here.
19091 (prepare_rules): Use output_int_table to output rhs.
19092 * data/bison.simple, data/bison.c++: Adjust.
19093 * tests/torture.at (Big triangle): Move the limit from 254 to
19095 * tests/regression.at (Web2c Actions): Ajust.
19097 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
19098 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
19099 passes, but produces negative #line number, once fixed, GCC is
19100 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
19102 * src/state.h (state_h): Code input lines on ints, not shorts.
19104 2002-04-08 Akim Demaille <akim@epita.fr>
19106 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
19107 and then the grammar.
19109 2002-04-08 Akim Demaille <akim@epita.fr>
19111 * src/system.h: No longer using strndup.
19113 2002-04-07 Akim Demaille <akim@epita.fr>
19115 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
19116 * src/output.c (output_table_data): Return the longest number.
19117 (prepare_tokens): Output `token_number_max').
19118 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
19120 Use them to define yy_token_number_type/TokenNumberType.
19121 Use this type for yytranslate.
19122 * tests/torture.at (Big triangle): Push the limit from 124 to
19124 * tests/regression.at (Web2c Actions): Adjust.
19126 2002-04-07 Akim Demaille <akim@epita.fr>
19128 * tests/torture.at (Big triangle): New.
19129 (GNU AWK Grammar, GNU Cim Grammar): Move to...
19130 * tests/existing.at: here.
19132 2002-04-07 Akim Demaille <akim@epita.fr>
19134 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
19136 Adjust dependencies.
19138 2002-04-07 Akim Demaille <akim@epita.fr>
19140 * src/reader.c: Normalize increments to prefix form.
19142 2002-04-07 Akim Demaille <akim@epita.fr>
19144 * src/reader.c, symtab.c: Remove debugging code.
19146 2002-04-07 Akim Demaille <akim@epita.fr>
19148 Rename all the `bucket's as `symbol_t'.
19150 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
19151 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
19152 * src/symtab.c, src/symtab.h (bucket): Rename as...
19154 (symbol_list_new, bucket_check_defined, bucket_make_alias)
19155 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
19156 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
19157 (buckets_new, buckets_free, buckets_do): Rename as...
19158 (symbol_list_new, symbol_check_defined, symbol_make_alias)
19159 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
19160 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
19161 (symbols_new, symbols_free, symbols_do): these.
19163 2002-04-07 Akim Demaille <akim@epita.fr>
19165 Use lib/hash for the symbol table.
19167 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
19169 * src/lex.c (lex): Set the `number' member of new terminals.
19170 * src/reader.c (bucket_check_defined, bucket_make_alias)
19171 (bucket_check_alias_consistence, bucket_translation): New.
19172 (reader, grammar_free, readgram, token_translations_init)
19173 (packsymbols): Adjust.
19174 (reader): Number the predefined tokens.
19175 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
19176 for predefined tokens.
19177 * src/symtab.h (bucket): Remove all the hash table related
19179 * src/symtab.c (symtab): Replace by...
19180 (bucket_table): this.
19181 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
19182 (buckets_new, buckets_do): New.
19184 2002-04-07 Akim Demaille <akim@epita.fr>
19186 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
19187 (start_symbol, max_user_token_number, semantic_parser)
19188 (error_token_number): Initialize.
19189 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
19192 (errtoken, eoftoken, undeftoken, axiom): Extern.
19194 2002-04-07 Akim Demaille <akim@epita.fr>
19196 * src/gram.h (rule_s): prec and precsym are now pointers
19197 to the bucket giving the priority/associativity.
19198 Member `associativity' removed: useless.
19199 * src/reduce.c, src/conflicts.c: Adjust.
19201 2002-04-07 Akim Demaille <akim@epita.fr>
19203 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
19204 Properly escape the symbols' TAG when outputting them.
19206 2002-04-07 Akim Demaille <akim@epita.fr>
19208 * src/lalr.h (LA): Is a bitsetv, not bitset*.
19210 2002-04-07 Akim Demaille <akim@epita.fr>
19212 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
19213 (LArule): this, which is an array to rule_t*.
19214 * src/print.c, src/conflicts.c: Adjust.
19216 2002-04-07 Akim Demaille <akim@epita.fr>
19218 * src/gram.h (rule_t): Rename `number' as `user_number'.
19219 `number' is a new member.
19220 Adjust dependencies.
19221 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
19223 2002-04-07 Akim Demaille <akim@epita.fr>
19225 As a result of the previous patch, it is no longer needed
19226 to reorder ritem itself.
19228 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
19230 2002-04-07 Akim Demaille <akim@epita.fr>
19232 Be sure never to walk through RITEMS, but use only data related to
19233 the rules themselves. RITEMS should be banished.
19235 * src/output.c (output_token_translations): Rename as...
19236 (prepare_tokens): this.
19237 In addition to `translate', prepare the muscles `tname' and
19238 `toknum', which were handled by...
19239 (output_rule_data): this.
19240 Remove, and move the remainder of its outputs into...
19241 (prepare_rules): this new routines, which also merges content from
19242 (output_gram): this.
19243 (prepare_rules): Be sure never to walk through RITEMS.
19244 (output_stos): Rename as...
19245 (prepare_stos): this.
19246 (output): Always invoke prepare_states, after all, just don't use it
19247 in the output if you don't need it.
19249 2002-04-07 Akim Demaille <akim@epita.fr>
19251 * src/LR0.c (new_state): Display `nstates' as the name of the
19252 newly created state.
19253 Adjust to initialize first_state and last_state if needed.
19254 Be sure to distinguish the initial from the final state.
19255 (new_states): Create the itemset of the initial state, and use
19257 * src/closure.c (closure): Now that the initial state has its
19258 items properly set, there is no need for a special case when
19259 creating `ruleset'.
19261 As a result, now the rule 0, reducing to $axiom, is visible in the
19262 outputs. Adjust the test suite.
19264 * tests/conflicts.at (Solved SR Conflicts)
19265 (Unresolved SR Conflicts): Adjust.
19266 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
19267 * tests/conflicts.at (S/R in initial): New.
19269 2002-04-07 Akim Demaille <akim@epita.fr>
19271 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
19272 the RHS of the rules.
19273 * src/output.c (output_gram): Likewise.
19275 2002-04-07 Akim Demaille <akim@epita.fr>
19277 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
19279 Adjust all dependencies.
19280 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
19281 `number' of the buckets too.
19282 * src/gram.h: Include `symtab.h'.
19283 (associativity): Move to...
19284 * src/symtab.h: here.
19285 No longer include `gram.h'.
19287 2002-04-07 Akim Demaille <akim@epita.fr>
19289 * src/gram.h, src/gram.c (rules_rhs_length): New.
19290 (ritem_longest_rhs): Use it.
19291 * src/gram.h (rule_t): `number' is a new member.
19292 * src/reader.c (packgram): Set it.
19293 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
19294 the end of `rules', and count them out of `nrules'.
19295 (reduce_output, dump_grammar): Adjust.
19296 * src/print.c (print_grammar): It is no longer needed to check for
19297 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
19298 * tests/reduce.at (Reduced Automaton): New test.
19300 2002-04-07 Akim Demaille <akim@epita.fr>
19302 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
19303 lacking `+ 1' to nrules, Bison reported as useless a token if it
19304 was used solely to set the precedence of the last rule...
19306 2002-04-07 Akim Demaille <akim@epita.fr>
19308 * data/bison.c++, data/bison.simple: Don't output the current file
19309 name in #line, to avoid useless diffs between two identical
19310 outputs under different names.
19312 2002-04-07 Akim Demaille <akim@epita.fr>
19314 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
19315 Normalize loops to using `< nrules + 1', not `<= nrules'.
19317 2002-04-07 Akim Demaille <akim@epita.fr>
19321 2002-04-07 Akim Demaille <akim@epita.fr>
19323 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
19324 bucket.value as bucket.number.
19326 2002-04-07 Akim Demaille <akim@epita.fr>
19328 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
19329 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
19330 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
19331 RHS, instead of being an index in RITEMS.
19333 2002-04-04 Paul Eggert <eggert@twinsun.com>
19335 * doc/bison.texinfo: Update copyright date.
19336 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
19337 (Symbols): Warn about running Bison in one character set,
19338 but compiling and/or running in an incompatible one.
19339 Warn about character code 256, too.
19341 2002-04-03 Paul Eggert <eggert@twinsun.com>
19343 * src/bison.data (YYSTACK_ALLOC): Depend on whether
19344 YYERROR_VERBOSE is nonzero, not whether it is defined.
19346 Merge changes from bison-1_29-branch.
19348 2002-03-20 Paul Eggert <eggert@twinsun.com>
19350 Merge fixes from Debian bison_1.34-1.diff.
19352 * configure.in (AC_PREREQ): 2.53.
19354 2002-03-20 Akim Demaille <akim@epita.fr>
19356 * src/conflicts.c (log_resolution): Argument `resolution' is const.
19358 2002-03-19 Paul Eggert <eggert@twinsun.com>
19360 * src/bison.simple (YYCOPY): New macro.
19361 (YYSTACK_RELOCATE): Use it.
19362 Remove Type arg; no longer needed. All callers changed.
19363 (yymemcpy): Remove; no longer needed.
19365 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
19366 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
19368 2002-03-19 Akim Demaille <akim@epita.fr>
19370 Test and fix the #line outputs.
19372 * tests/atlocal.at (GCC): New.
19373 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
19374 (Prologue synch line, %union synch line, Postprologue synch line)
19375 (Action synch line, Epilogue synch line): New tests.
19376 * src/reader.c (parse_union_decl): Define the muscle stype_line.
19377 * data/bison.simple, data/bison.c++: Use it.
19379 2002-03-19 Akim Demaille <akim@epita.fr>
19381 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
19382 (Solved SR Conflicts, %expect not enough, %expect right)
19383 (%expect too much): Move to...
19384 * tests/conflicts.at: this new file.
19386 2002-03-19 Akim Demaille <akim@epita.fr>
19388 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
19389 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
19390 that we can move to enums for instance.
19391 * src/output.c (token_definitions_output): Output a list of
19392 `token-name, token-number' instead of the #define.
19393 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
19395 2002-03-14 Akim Demaille <akim@epita.fr>
19397 Use Gettext 0.11.1.
19399 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
19401 * data/bison.c++: Make the user able to add members to the generated
19402 parser by subclassing.
19404 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
19406 * src/reader.c (read_additionnal_code): `c' should be an integer, not
19408 Reported by Nicolas Tisserand and Nicolas Burrus.
19410 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
19412 * src/reader.c: Warn about lacking semi-colons, do not complain.
19414 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
19416 * data/bison.c++: Remove a debug line.
19418 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
19420 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
19421 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
19422 provide a default implementation.
19424 2002-03-04 Akim Demaille <akim@epita.fr>
19426 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
19427 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
19428 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
19429 * tests/semantic.at (Parsing Guards): Similarly.
19430 * src/reader.at (readgram): Complain if the last rule is not ended
19433 2002-03-04 Akim Demaille <akim@epita.fr>
19435 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
19436 * src/closure.c: here.
19437 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
19439 * src/warshall.h, src/warshall.c: Remove.
19440 * tests/sets.at (Broken Closure): Adjust.
19442 2002-03-04 Akim Demaille <akim@epita.fr>
19444 * src/output.c (output_skeleton): tempdir is const.
19445 bytes_read is unused.
19447 2002-03-04 Akim Demaille <akim@epita.fr>
19449 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
19450 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
19452 From Michael Hayes.
19454 2002-03-04 Akim Demaille <akim@epita.fr>
19456 * src/closure.c (closure): `r' is unused.
19458 2002-03-04 Akim Demaille <akim@epita.fr>
19460 * tests/sets.at (Broken Closure): Add the ending `;'.
19461 * src/reader.at (readgram): Complain if a rule is not ended with a
19464 2002-03-04 Akim Demaille <akim@epita.fr>
19466 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
19467 (count_sr_conflicts): Use bitset_count.
19468 * src/reduce.c (inaccessable_symbols): Ditto.
19469 (bits_size): Remove.
19470 * src/warshall.h, src/warshall.c: Convert to bitsetv.
19472 2002-03-04 Akim Demaille <akim@epita.fr>
19474 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
19475 * src/reduce.c: Remove the `bitset_zero's following the
19476 `bitset_create's, as now it is performed by the latter.
19478 2002-03-04 Akim Demaille <akim@epita.fr>
19480 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
19481 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
19482 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
19483 latest sources from Michael.
19485 2002-03-04 Akim Demaille <akim@epita.fr>
19487 * src/output.c (output): Don't free the grammar.
19488 * src/reader.c (grammar_free): New.
19489 * src/main.c (main): Call it and don't free symtab here.
19491 2002-03-04 Akim Demaille <akim@epita.fr>
19493 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
19495 Reported by Benoit Perrot.
19497 2002-03-04 Akim Demaille <akim@epita.fr>
19499 Use bitset operations when possible, not loops over bits.
19501 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
19503 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
19504 * src/reduce.c (useless_nonterminals): Formatting changes.
19505 * src/warshall.c (TC): Use bitset_or.
19507 2002-03-04 Akim Demaille <akim@epita.fr>
19509 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
19510 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
19513 2002-03-04 Akim Demaille <akim@epita.fr>
19515 * src/lalr.c (F): Now a bitset*.
19516 Adjust all dependencies.
19518 2002-03-04 Akim Demaille <akim@epita.fr>
19520 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
19521 Adjust all dependencies.
19523 2002-03-04 Akim Demaille <akim@epita.fr>
19525 * src/L0.c, src/LR0.h (nstates): Be size_t.
19526 Adjust comparisons (signed vs unsigned).
19527 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
19529 Adjust all dependencies.
19531 2002-03-04 Akim Demaille <akim@epita.fr>
19533 * src/closure.c (firsts): Now, also a bitset.
19534 Adjust all dependencies.
19535 (varsetsize): Remove, now unused.
19536 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
19538 2002-03-04 Akim Demaille <akim@epita.fr>
19540 * src/print.c: Convert to use bitset.h, not hand coded iterations
19543 2002-03-04 Akim Demaille <akim@epita.fr>
19545 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
19547 2002-03-04 Akim Demaille <akim@epita.fr>
19549 * src/closure.c (ruleset): Be a bitset.
19550 (rulesetsize): Remove.
19552 2002-03-04 Akim Demaille <akim@epita.fr>
19554 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
19555 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
19556 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
19557 * src/closure.c (fderives): Be an array of bitsets.
19559 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
19561 * data/bison.c++: Merge the two generated headers. Insert a copyright
19562 notice in each output file.
19564 2002-02-28 Akim Demaille <akim@epita.fr>
19566 * data/bison.c++: Copy the prologue of bison.simple to fetch
19567 useful M4 definitions, such as b4_header_guard.
19569 2002-02-25 Akim Demaille <akim@epita.fr>
19571 * src/getargs.c (version): Give the name of the authors, and use a
19572 translator friendly scheme for the bgr
19575 2002-02-25 Akim Demaille <akim@epita.fr>
19577 * src/output.c (header_output): Remove, now handled completely via
19580 2002-02-25 Akim Demaille <akim@epita.fr>
19582 * m4/m4.m4: New, from CVS Autoconf.
19583 * configure.in: Invoke it.
19584 * src/output.c (output_skeleton): Use its result instead of the
19587 2002-02-25 Akim Demaille <akim@epita.fr>
19589 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
19591 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
19592 * src/output.c (output_skeleton): Use mkstemp to create a real
19594 Move the filling of `skeleton' and its muscle to...
19596 (output): Move the definition of the prologue muscle to...
19598 * src/system.h (DEFAULT_TMPDIR): New.
19600 2002-02-14 Paul Eggert <eggert@twinsun.com>
19602 Remove the support for C++ namespace cleanliness; it was
19603 causing more problems than it was curing, since it didn't work
19604 properly on some nonstandard C++ compilers. This can wait
19605 for a proper C++ parser.
19607 * NEWS: Document this.
19608 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
19609 of C++, as it's treated like C now.
19610 * src/bison.simple (YYSTD): Remove.
19611 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
19612 Treat C++ just like Standard C instead of trying to support
19613 namespace cleanliness.
19615 2002-02-14 Akim Demaille <akim@epita.fr>
19617 * tests/regression.at (else): Adjust to Andreas' change.
19619 2002-02-14 Akim Demaille <akim@epita.fr>
19621 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
19623 2002-02-13 Andreas Schwab <schwab@suse.de>
19625 * src/output.c (output_rule_data): Don't output NULL, it might
19626 not be defined yet.
19628 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
19630 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
19631 (Copyright notice): Update.
19633 2002-02-11 Akim Demaille <akim@epita.fr>
19635 * tests/regression.at (%nonassoc and eof): Don't include
19636 nonportable headers.
19638 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
19640 * data/bison.c++: Correct error recovery. Make the user able to
19641 initialize the starting location.
19643 2002-02-07 Akim Demaille <akim@epita.fr>
19645 * tests/input.at: New.
19647 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
19649 * data/bison.c++: Replace some direct m4 expansions by constants. Be
19650 more consistent when naming methods and variables. Put preprocessor
19651 directives around tables only needed for debugging.
19653 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
19655 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
19657 (yy::b4_name::parse): Use print_.
19659 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
19661 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
19663 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
19665 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
19667 (yy::b4_name::parse): Build verbose error messages, and use error_.
19669 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
19671 * data/bison.c++: Fix m4 quoting in comments.
19673 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
19675 * data/bison.c++: Adjust the parser code. Fix some muscles that were
19676 not expanded by m4.
19678 2002-02-05 Akim Demaille <akim@epita.fr>
19680 * data/bison.c++: Adjust to the M4 back end.
19681 More is certainly needed.
19683 2002-02-05 Akim Demaille <akim@epita.fr>
19685 Give a try to M4 as a back end.
19687 * lib/readpipe.c: New, from wdiff.
19688 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
19690 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
19691 specific values. Now it is m4 that performs the lookup.
19692 * src/parse-skel.y: Remove.
19693 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
19694 * src/output.c (actions_output, guards_output)
19695 (token_definitions_output): No longer keeps track of the output
19696 line number, hence remove the second argument.
19697 (guards_output): Check against the guard member of a rule, not the
19700 (output_skeleton): Don't look for the skeleton location, let m4 do
19702 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
19704 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
19705 (prepare): Given that for the time being changesyntax is not
19706 usable in M4, rename the muscles using `-' to `_'.
19707 Define `defines_flag', `output_parser_name' and `output_header_name'.
19708 * src/output.h (actions_output, guards_output)
19709 (token_definitions_output): Adjust prototypes.
19710 * src/scan-skel.l: Instead of scanning the skeletons, it now
19711 processes the output of m4: `__oline__' and `#output'.
19712 * data/bison.simple: Adjust to be used by M4(sugar).
19713 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
19715 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
19716 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
19717 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
19718 shamelessly stolen from CVS Autoconf.
19720 2002-02-05 Akim Demaille <akim@epita.fr>
19722 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
19723 * configure.in: Check for the declarations of free and malloc.
19724 * src/muscle_tab.c: Adjust.
19726 2002-02-05 Akim Demaille <akim@epita.fr>
19728 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
19729 which have no values.
19731 2002-02-05 Akim Demaille <akim@epita.fr>
19733 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
19736 2002-01-29 Paul Eggert <eggert@twinsun.com>
19738 * src/bison.simple (YYSIZE_T): Do not define merely because
19739 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
19740 On some platforms, <alloca.h> does not declare YYSTD (size_t).
19742 2002-01-27 Akim Demaille <akim@epita.fr>
19744 Fix `%nonassoc and eof'.
19746 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
19747 which were not properly copied! Replace
19748 memcpy (res->errs, src->errs, src->nerrs);
19750 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
19752 * tests/regression.at (%nonassoc and eof): Adjust to newest
19753 Autotest: `.' is not in the PATH.
19755 2002-01-27 Akim Demaille <akim@epita.fr>
19757 * tests/sets.at (AT_EXTRACT_SETS): New.
19758 (Nullable): Use it.
19761 2002-01-26 Akim Demaille <akim@epita.fr>
19763 * tests/actions.at, tests/calc.at, tests/headers.at,
19764 * tests/torture.at: Adjust to the newest Autotest which no longer
19765 forces `.' in the PATH.
19767 2002-01-25 Akim Demaille <akim@epita.fr>
19769 * tests/regression.at (%nonassoc and eof): New.
19770 Suggested by Robert Anisko.
19772 2002-01-24 Akim Demaille <akim@epita.fr>
19774 Bison dumps core when trying to complain about broken input files.
19775 Reported by Cris van Pelt.
19777 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
19778 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
19780 (Invalid inputs): Strengthen: exercise parse_percent_token.
19782 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
19784 * src/Makefile.am: Add bison.c++.
19785 * src/bison.c++: New skeleton.
19787 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
19791 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
19793 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
19795 2002-01-20 Marc Autret <marc@gnu.org>
19797 * src/files.c (compute_output_file_names): Fix
19799 2002-01-20 Marc Autret <marc@gnu.org>
19801 * tests/output.at: New test.
19802 * src/files.c (compute_base_names): Don't map extensions when
19803 the YACC flag is set, use defaults.
19804 Reported by Evgeny Stambulchik.
19806 2002-01-20 Marc Autret <marc@gnu.org>
19808 * src/system.h: Need to define __attribute__ away for non-GCC
19809 compilers as well (i.e., the vendor C compiler).
19810 Suggested by Albert Chin-A-Young.
19812 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
19814 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
19815 canonical definition.
19816 * src/system.h: Use the canonical definition for PARAMS (avoids
19817 a conflict with the macro from lib/hash.h).
19819 2002-01-11 Akim Demaille <akim@epita.fr>
19821 * configure.in: Use AC_FUNC_STRNLEN.
19822 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
19824 2002-01-09 Akim Demaille <akim@epita.fr>
19826 * src/files.c, src/files.h (output_infix): New.
19827 (tab_extension): Remove.
19828 (compute_base_names): Compute the former, drop the latter.
19829 * src/output.c (prepare): Insert the muscles `output-infix', and
19831 * src/parse-skel.y (string, string.1): New.
19832 (section.header): Use it.
19833 (section.yacc): Remove.
19834 (prefix): Remove too.
19835 * src/scan-skel.l: Adjust.
19836 * src/bison.simple, src/bison.hairy: Adjust.
19838 2002-01-09 Akim Demaille <akim@epita.fr>
19840 * configure.in (WERROR_CFLAGS): Compute it.
19841 * src/Makefile.am (CFLAGS): Pass it.
19842 * tests/atlocal.in (CFLAGS): Idem.
19843 * src/files.c: Fix a few warnings.
19844 (get_extension_index): Remove, unused.
19846 2002-01-08 Akim Demaille <akim@epita.fr>
19848 * src/getargs.c (AS_FILE_NAME): New.
19849 (getargs): Use it to convert DOSish file names.
19850 * src/files.c (base_name): Rename as full_base_name to avoid
19851 clashes with `base_name ()'.
19852 (filename_split): New.
19853 (compute_base_names): N-th rewrite, using filename_split.
19855 2002-01-08 Akim Demaille <akim@epita.fr>
19857 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
19858 New, stolen from the Fileutils 4.1.
19859 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
19860 * configure.in: Check for the presence of memrchr, and of its
19863 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
19865 * lib/hash.h (__P): Added definition for this macro.
19866 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
19867 BUILT_SOURCES, to ensure they are generated first.
19868 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
19869 %error-verbose to allow bootstrapping with bison 1.30x.
19871 2002-01-06 Akim Demaille <akim@epita.fr>
19873 * src/reader.c (parse_braces): Don't fetch the next char, the
19874 convention is to fetch on entry.
19875 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
19876 'switch' without a following semicolon.
19877 * tests/regression.at (braces parsing): New.
19879 2002-01-06 Akim Demaille <akim@epita.fr>
19881 Bison is dead wrong in its RR conflict reports.
19883 * tests/torture.at (GNU Cim Grammar): New.
19884 * src/conflicts.c (count_rr_conflicts): Fix.
19886 2002-01-06 Akim Demaille <akim@epita.fr>
19888 Creating package.m4 from configure.ac causes too many problems.
19890 * tests/Makefile.am (package.m4): Create it by hand,
19891 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
19893 2002-01-06 Akim Demaille <akim@epita.fr>
19895 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
19898 2002-01-04 Paul Eggert <eggert@twinsun.com>
19900 * doc/bison.texinfo (Debugging):
19901 Remove YYSTDERR; it's no longer defined or used.
19902 Also, s/cstdio.h/cstdio/.
19904 2002-01-03 Akim Demaille <akim@epita.fr>
19906 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
19908 2002-01-03 Akim Demaille <akim@epita.fr>
19910 * src/parse-skel.y (process_skeleton): Don't bind the parser's
19911 tracing code to --trace, wait for a better --trace option, with
19914 2002-01-03 Akim Demaille <akim@epita.fr>
19916 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
19917 The ISO C++ standard is extremely clear about it: stderr is
19918 considered a macro, not a regular symbol (see table 94 `Header
19919 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
19920 Therefore std:: does not apply to it. It still does with fprintf.
19921 Also, s/cstdio.h/cstdio/.
19923 2002-01-03 Akim Demaille <akim@epita.fr>
19925 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
19926 for non system headers.
19928 2002-01-02 Akim Demaille <akim@epita.fr>
19930 Equip the skeleton chain with location tracking, runtime trace,
19931 pure parser and scanner.
19933 * src/parse-skel.y: Request a pure parser, locations, and prefix
19935 (%union): Having several members with the same type does not help
19936 type mismatches, simplify.
19937 (YYPRINT, yyprint): New.
19938 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
19939 (skel_error): this.
19941 * src/scan-skel.l: Adjust to these changes.
19942 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
19943 (LOCATION_PRINT, skel_control_t): New.
19945 2001-12-30 Akim Demaille <akim@epita.fr>
19947 * src/parse-skel.y: Get rid of the shift/reduce conflict:
19948 replace `gb' with BLANKS.
19949 * src/scan-skel.l: Adjust.
19951 2001-12-30 Akim Demaille <akim@epita.fr>
19953 * src/system.h: We don't need nor want bcopy.
19954 Throw away MS-DOS crap: we don't need getpid.
19955 * configure.in: We don't need strndup. It was even causing
19956 problems: because Flex includes the headers *before* us,
19957 _GNU_SOURCE is not defined by config.h, and therefore strndup was
19959 * lib/xstrndup.c: New.
19960 * src/scan-skel.l: Use it.
19961 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
19962 * src/parse-skel.y: Use %directives instead of #defines.
19964 2001-12-30 Akim Demaille <akim@epita.fr>
19966 * src/skeleton.h: New.
19967 * src/output.c (output_parser, output_master_parser): Remove, dead
19969 * src/output.h (get_lines_number, actions_output, guards_output)
19970 (token_definitions_output): Prototype them.
19971 * src/parse-skel.y: Add the license notice.
19972 Include output.h and skeleton.h.
19973 (process_skeleton): Returns void, and takes a single parameter.
19974 * src/scan-skel.l: Add the license notice.
19975 Include skeleton.h.
19976 Don't use %option yylineno: it seems that then Flex imagines
19977 REJECT has been used, and therefore it won't reallocate its
19978 buffers (which makes no other sense to me than a bug). It results
19979 in warnings for `unused: yy_flex_realloc'.
19981 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
19983 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
19984 (MUSCLE_INSERT_PREFIX): ...to there.
19985 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
19986 (MUSCLE_INSERT_PREFIX): Move from here...
19988 * src/bison.hairy: Add a section directive. Put braces around muscle
19989 names. This parser skeleton is still broken, but Bison should not
19990 choke on a bad muscle 'syntax'.
19991 * src/bison.simple: Add a section directive. Put braces around muscle
19994 * src/files.h (strsuffix, stringappend): Add declarations.
19995 (tab_extension): Add declaration.
19996 (short_base_name): Add declaration.
19998 * src/files.c (strsuffix, stringappend): No longer static. These
19999 functions are used in the skeleton parser.
20000 (tab_extension): New.
20001 (compute_base_names): Use the computations done in this function
20002 to guess if the generated parsers should have '.tab' in their
20004 (short_base_name): No longer static.
20006 * src/output.c (output_skeleton): New.
20007 (output): Disable call to output_master_parser, and give a try to
20008 a new skeleton handling system.
20009 (guards_output, actions_output): No longer static.
20010 (token_definitions_output, get_lines_number): No longer static.
20012 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
20014 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
20017 * src/parse-skel.y: New file.
20018 * src/scan-skel.l: New file.
20020 2001-12-29 Akim Demaille <akim@epita.fr>
20022 %name-prefix is broken.
20024 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
20025 Adjust all dependencies.
20026 * tests/headers.at (export YYLTYPE): Strengthen this test: use
20029 Renaming yylval but not yylloc is not consistent. Now we do.
20031 * src/bison.simple: Prefix yylloc if used.
20032 * doc/bison.texinfo (Decl Summary): Document that.
20034 2001-12-29 Akim Demaille <akim@epita.fr>
20036 * doc/bison.texinfo: Promote `%long-directive' over
20038 Remove all references to fixed-output-files, yacc is enough.
20040 2001-12-29 Akim Demaille <akim@epita.fr>
20042 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
20043 user prologue. These are defaults.
20044 * tests/actions.at (Mid-rule actions): Make sure the user can
20045 define YYDEBUG and YYERROR_VERBOSE.
20047 2001-12-29 Akim Demaille <akim@epita.fr>
20049 * src/output.c (header_output): Don't forget to export YYLTYPE and
20051 * tests/headers.at (export YYLTYPE): New, make sure it does.
20052 * tests/regression.at (%union and --defines, Invalid CPP headers):
20054 * tests/headers.at: here.
20056 2001-12-29 Akim Demaille <akim@epita.fr>
20058 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
20060 2001-12-29 Akim Demaille <akim@epita.fr>
20062 * tests/actions.at (Mid-rule actions): Output on a single line
20063 instead of several.
20065 2001-12-29 Akim Demaille <akim@epita.fr>
20067 * doc/bison.texinfo: Formatting changes.
20069 2001-12-29 Akim Demaille <akim@epita.fr>
20071 Don't store the token defs in a muscle, just be ready to output it
20072 on command. Now possible via `symbols'. Fixes a memory leak.
20074 * src/output.c (token_definitions_output): New.
20075 (output_parser, header_output): Use it.
20076 * src/reader.c (symbols_save): Remove.
20078 2001-12-29 Akim Demaille <akim@epita.fr>
20080 * src/bison.simple: Do not provide a default for YYSTYPE and
20081 YYLTYPE before the user's prologue. Otherwise it's hardly... a
20084 2001-12-29 Akim Demaille <akim@epita.fr>
20086 Mid-rule actions are simply... ignored!
20088 * src/reader.c (readgram): Be sure to attach mid-rule actions to
20089 the empty-rule associated to the dummy symbol, not to the host
20091 * tests/actions.at (Mid-rule actions): New.
20093 2001-12-29 Akim Demaille <akim@epita.fr>
20097 * src/reader.c (reader): Free grammar.
20099 2001-12-29 Akim Demaille <akim@epita.fr>
20103 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
20104 since it allocates it for each state, although only one is needed.
20105 (allocate_storage): Do it here.
20107 2001-12-29 Akim Demaille <akim@epita.fr>
20109 * src/options.h, src/options.c (create_long_option_table): Rename
20111 (long_option_table_new): this, with a clearer prototype.
20112 (percent_table): Remove, unused,
20113 * src/getargs.c (getargs): Adjust.
20115 2001-12-29 Akim Demaille <akim@epita.fr>
20117 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
20118 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
20121 2001-12-29 Akim Demaille <akim@epita.fr>
20123 * src/lalr.c (build_relations): Rename `states' as `states1'.
20124 Sorry, I don't understand exactly what it is, no better name...
20126 2001-12-29 Akim Demaille <akim@epita.fr>
20128 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
20129 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
20130 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
20133 2001-12-29 Akim Demaille <akim@epita.fr>
20135 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
20138 2001-12-29 Akim Demaille <akim@epita.fr>
20140 * src/reader.c, src/reader.h (user_toknums): Remove.
20141 Adjust all users to use symbols[i]->user_token_number.
20143 2001-12-29 Akim Demaille <akim@epita.fr>
20145 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
20146 Adjust all users to use symbols[i]->prec or ->assoc.
20148 2001-12-29 Akim Demaille <akim@epita.fr>
20150 * src/reader.c, src/reader.h (tags): Remove.
20151 Adjust all users to use symbols[i]->tag.
20153 2001-12-29 Akim Demaille <akim@epita.fr>
20155 * src/gram.h, src/gram.c (symbols): New, similar to state_table
20157 * src/reader.c (packsymbols): Fill this table.
20159 * src/conflicts.c (resolve_sr_conflict): Adjust.
20160 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
20162 Use symbols[i]->tag instead of tags[i].
20164 2001-12-29 Akim Demaille <akim@epita.fr>
20166 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
20167 In addition, put a comment in there, to replace...
20168 * tests/regression.at (%union and C comments): Remove.
20170 2001-12-29 Akim Demaille <akim@epita.fr>
20172 * tests/regression.at (Web2c Actions): Blindly move the actual
20173 output as expected output. The contents *seem* right to me, but I
20174 can't pretend reading perfectly parser tables... Nonetheless, all
20175 the other tests pass correctly, the table look OK, even though the
20176 presence of `$axiom' is to be noted: AFAICS it is useless (but
20179 2001-12-29 Akim Demaille <akim@epita.fr>
20181 * src/reader.c (readgram): Don't add the rule 0 if there were no
20182 rules read. In other words, add it _after_ having performed
20183 grammar sanity checks.
20184 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
20186 2001-12-29 Akim Demaille <akim@epita.fr>
20188 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
20189 visible, and some states have now a different number.
20191 2001-12-29 Akim Demaille <akim@epita.fr>
20193 * src/reader.c (readgram): Bind the initial rule's lineno to that
20195 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
20196 (Solved SR Conflicts): Adjust rule 0's line number.
20198 2001-12-29 Akim Demaille <akim@epita.fr>
20200 Fix the `GAWK Grammar' failure.
20202 * src/LR0.c (final_state): Initialize to -1 so that we do compute
20203 the reductions of the first state which was mistakenly confused
20204 with the final state because precisely final_state was initialized
20206 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
20207 now noticed by Bison.
20208 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
20209 have a reduction on $default.
20211 2001-12-29 Akim Demaille <akim@epita.fr>
20213 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
20215 * src/closure.c (print_closure): Likewise.
20216 * src/derives.c (print_derives): Likewise.
20217 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
20220 2001-12-29 Akim Demaille <akim@epita.fr>
20222 * src/lalr.c (lookaheads_print): New.
20223 (lalr): Call it when --trace-flag.
20224 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
20227 2001-12-29 Akim Demaille <akim@epita.fr>
20229 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
20230 when walking through ritem, even via rule->rhs.
20231 * src/reduce.c (dump_grammar, useful_production, reduce_output)
20232 (useful_production, useless_nonterminals): Likewise.
20233 (reduce_grammar_tables): Likewise, plus update nritems.
20234 * src/nullable.c (set_nullable): Likewise.
20235 * src/lalr.c (build_relations): Likewise.
20236 * tests/sets.at (Nullable): Adjust.
20237 Fortunately, now, the $axiom is no longer nullable.
20239 2001-12-29 Akim Demaille <akim@epita.fr>
20241 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
20243 * src/gram.c (ritem_longest_rhs): Likewise.
20244 * src/reduce.c (nonterminals_reduce): Likewise.
20245 * src/print_graph.c (print_graph): Likewise.
20246 * src/output.c (output_rule_data): Likewise.
20247 * src/nullable.c (set_nullable): Likewise.
20249 2001-12-29 Akim Demaille <akim@epita.fr>
20251 * src/output.c: Comment changes.
20253 2001-12-27 Paul Eggert <eggert@twinsun.com>
20255 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
20256 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
20257 Sparc, as they were causing more porting problems than the
20258 (minor) performance improvement was worth.
20260 Also, catch up with 1.31's YYSTD.
20262 2001-12-27 Akim Demaille <akim@epita.fr>
20264 * src/output.c (output_gram): Rely on nritems, not the
20265 0-sentinel. See below.
20266 Use -1 as separator, not 0.
20267 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
20268 Rely on -1 as separator in yyrhs, instead of 0.
20269 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
20270 twice `Now at end of input', therefore there are two lines less to
20273 2001-12-27 Akim Demaille <akim@epita.fr>
20275 * tests/regression.at (Unresolved SR Conflicts):
20276 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
20279 2001-12-27 Akim Demaille <akim@epita.fr>
20281 * src/LR0.c (new_state): Recognize the final state by the fact it
20282 is reached by eoftoken.
20283 (insert_start_shifting_state, insert_eof_shifting_state)
20284 (insert_accepting_state, augment_automaton): Remove, since now
20285 these states are automatically computed from the initial state.
20286 (generate_states): Adjust.
20287 * src/print.c: When reporting a rule number to the user, substract
20288 1, so that the axiom rule is rule 0, and the first user rule is 1.
20289 * src/reduce.c: Likewise.
20290 * src/print_graph.c (print_core): For the time being, just as for
20291 the report, depend upon --trace-flags to dump the full set of
20293 * src/reader.c (readgram): Once the grammar read, insert the rule
20294 0: `$axiom: START-SYMBOL $'.
20295 * tests/set.at: Adjust: rule 0 is now displayed, and since the
20296 number of the states has changed (the final state is no longer
20297 necessarily the last), catch up.
20299 2001-12-27 Akim Demaille <akim@epita.fr>
20301 Try to make the use of the eoftoken valid. Given that its value
20302 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
20303 is used instead of > 0 where appropriate, (ii), depend upon nritems
20304 instead of the 0-sentinel.
20306 * src/gram.h, src/gram.c (nritems): New.
20307 Expected to be duplication of nitems, but for the time being...
20308 * src/reader.c (packgram): Assert nritems and nitems are equal.
20309 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
20310 * src/closure.c (print_closure, print_fderives): Likewise.
20311 * src/gram.c (ritem_print): Likewise.
20312 * src/print.c (print_core, print_grammar): Likewise.
20313 * src/print_graph.c: Likewise.
20315 2001-12-27 Akim Demaille <akim@epita.fr>
20317 * src/main.c (main): If there are complains after grammar
20318 reductions, then output the report anyway if requested, then die.
20319 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
20320 * src/reader.c (eoftoken): New.
20321 (parse_token_decl): If the token being defined has value `0', it
20323 (packsymbols): No longer hack `tags' to insert `$' by hand.
20324 Be sure to preserve the value of the eoftoken.
20325 (reader): Make sure eoftoken is defined.
20326 Initialize nsyms to 0: now eoftoken is created just like the others.
20327 * src/print.c (print_grammar): Don't special case the eof token.
20328 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
20329 lie anyway, albeit pleasant.
20330 * tests/calc.at: Exercise error messages with eoftoken.
20331 Change the grammar so that empty input is invalid.
20332 Adjust expectations.
20333 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
20335 2001-12-27 Akim Demaille <akim@epita.fr>
20337 * configure.in: Check the protos of strchr ans strspn.
20338 Replace strchr if needed.
20339 * src/system.h: Provide the protos of strchr, strspn and memchr if
20341 * lib/strchr.c: New.
20342 * src/reader.c (symbols_save): Use strchr.
20344 2001-12-27 Akim Demaille <akim@epita.fr>
20346 * src/print.c, src/print_graph.c (escape): New.
20347 Use it to quote the TAGS outputs.
20348 * src/print_graph.c (print_state): Now errors are in red, and
20349 reductions in green.
20350 Prefer high to wide: output the state number on a line of its own.
20352 2001-12-27 Akim Demaille <akim@epita.fr>
20354 * src/state.h, src/state.c (reductions_new): New.
20355 * src/LR0.c (set_state_table): Let all the states have a
20356 `reductions', even if reduced to 0.
20357 (save_reductions): Adjust.
20358 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
20359 * src/print.c (print_reductions, print_actions): Adjust.
20360 * src/output.c (action_row): Adjust.
20362 2001-12-27 Akim Demaille <akim@epita.fr>
20364 * src/state.h, src/state.c (errs_new, errs_dup): New.
20365 * src/LR0.c (set_state_table): Let all the states have an errs,
20366 even if reduced to 0.
20367 * src/print.c (print_errs, print_reductions): Adjust.
20368 * src/output.c (output_actions, action_row): Adjust.
20369 * src/conflicts.c (resolve_sr_conflict): Adjust.
20371 2001-12-27 Akim Demaille <akim@epita.fr>
20373 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
20375 2001-12-27 Akim Demaille <akim@epita.fr>
20377 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
20378 * src/print.c: here.
20379 (lookaheadset, shiftset): New, used as additional storage by
20381 (print_results): Adjust.
20382 (print_shifts, print_gotos, print_errs): New, extracted from...
20383 (print_actions): here.
20384 * src/print_graph.c (print_actions): Remove dead code.
20386 2001-12-27 Akim Demaille <akim@epita.fr>
20388 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
20391 2001-12-27 Akim Demaille <akim@epita.fr>
20393 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
20394 (build_relations): Adjust.
20396 2001-12-27 Akim Demaille <akim@epita.fr>
20398 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
20401 2001-12-27 Akim Demaille <akim@epita.fr>
20403 * src/reader.c (packgram): Catch nitems overflows.
20405 2001-12-27 Akim Demaille <akim@epita.fr>
20407 * src/files.c, src/files.h (guard_obstack): Remove.
20408 * src/output.c (output): Adjust.
20409 * src/reader.c (parse_braces): New, factoring...
20410 (copy_action, copy_guard): these two which are renamed as...
20411 (parse_action, parse_guard): these.
20412 As a voluntary consequence, using braces around guards is now
20415 2001-12-27 Akim Demaille <akim@epita.fr>
20417 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
20418 * src/reader.c (symbol_list): `guard' and `guard_line' are new
20420 (symbol_list_new): Adjust.
20421 (copy_action): action_line is the first line, not the last.
20422 (copy_guard): Just as for actions, store the `action' only, not
20423 the switch/case/break flesh.
20424 Don't parse the user action that might follow the guard, let...
20425 (readgram): do it, i.e., now, there can be an action after a
20427 In other words the guard is just explicitly optional.
20428 (packgram): Adjust.
20429 * src/output.c (guards_output): New.
20430 (output_parser): Call it when needed.
20431 (output): Also free the guard and attrs obstacks.
20432 * src/files.c, src/files.h (obstack_save): Remove.
20433 (output_files): Remove.
20434 As a result, if one needs the former `.act' file, using an
20435 appropriate skeleton which requires actions and guards is now
20437 * src/main.c (main): Adjust.
20438 * tests/semantic.at: New.
20439 * tests/regression.at: Use `input.y' as input file name.
20440 Avoid 8+3 problems by requiring input.c when the test needs the
20443 2001-12-27 Akim Demaille <akim@epita.fr>
20445 * src/reader.c (symbol_list_new): Be sure to initialize all the
20448 2001-12-27 Akim Demaille <akim@epita.fr>
20450 All the hacks using a final pseudo state are now useless.
20452 * src/LR0.c (set_state_table): state_table holds exactly nstates.
20453 * src/lalr.c (nLA): New.
20454 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
20455 instead of lookaheadsp from the pseudo state (nstate + 1).
20457 2001-12-27 Akim Demaille <akim@epita.fr>
20459 * src/output.c (action_row, token_actions): Use a state_t instead
20460 of a integer, and nlookaheads instead of the following state's
20463 2001-12-27 Akim Demaille <akim@epita.fr>
20465 * src/conflicts.c (log_resolution, flush_shift)
20466 (resolve_sr_conflict, set_conflicts, solve_conflicts)
20467 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
20468 (conflicts_print, print_reductions): Use a state_t instead of an
20469 integer when referring to a state.
20470 As much as possible, depend upon nlookaheads, instead of the
20471 `lookaheadsp' member of the following state (since lookaheads of
20472 successive states are successive, the difference between state n + 1
20473 and n served as the number of lookaheads for state n).
20474 * src/lalr.c (add_lookback_edge): Likewise.
20475 * src/print.c (print_core, print_actions, print_state)
20476 (print_results): Likewise.
20477 * src/print_graph.c (print_core, print_actions, print_state)
20478 (print_graph): Likewise.
20479 * src/conflicts.h: Adjust.
20481 2001-12-27 Akim Demaille <akim@epita.fr>
20483 * src/bison.hairy: Formatting/comment changes.
20485 Remove `register' indications.
20486 Add plenty of `static'.
20488 2001-12-27 Akim Demaille <akim@epita.fr>
20490 * src/output.c (prepare): Drop the muscle `ntbase' which
20491 duplicates ntokens.
20492 * src/bison.simple: Formatting/comment changes.
20493 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
20494 is an undocumented synonym.
20496 2001-12-22 Akim Demaille <akim@epita.fr>
20498 * src/output.c (output_table_data): Change the prototype to use
20499 `int' for array ranges: some invocations do pass an int, not a
20501 Reported by Wayne Green.
20503 2001-12-22 Akim Demaille <akim@epita.fr>
20505 Some actions of web2c.y are improperly triggered.
20506 Reported by Mike Castle.
20508 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
20509 * tests/regression.at (Web2c): Rename as...
20510 (Web2c Report): this.
20511 (Web2c Actions): New.
20513 2001-12-22 Akim Demaille <akim@epita.fr>
20515 Reductions in web2c.y are improperly reported.
20516 Reported by Mike Castle.
20518 * src/conflicts.c (print_reductions): Fix.
20519 * tests/regression.at (Web2c): New.
20521 2001-12-18 Akim Demaille <akim@epita.fr>
20523 Some host fail on `assert (!"foo")', which expands to
20524 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
20525 Reported by Nelson Beebee.
20527 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
20528 `#define it_succeeded 0' and `assert (it_succeeded)'.
20530 2001-12-17 Marc Autret <autret_m@epita.fr>
20532 * src/bison.simple: Don't hard code the skeleton line and filename.
20533 * src/output.c (output_parser): Rename 'line' as 'output_line'.
20534 New line counter 'skeleton_line' (skeleton-line muscle).
20536 2001-12-17 Paul Eggert <eggert@twinsun.com>
20538 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
20539 YYDEBUG must be defined to a nonzero value.
20541 * src/bison.simple (yytname): Do not assume that the user defines
20542 YYDEBUG to a properly parenthesized expression.
20544 2001-12-17 Akim Demaille <akim@epita.fr>
20546 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
20547 nlookaheads is a new member.
20549 * src/lalr.h (nlookaheads): Remove this orphan declaration.
20550 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
20553 2001-12-17 Akim Demaille <akim@epita.fr>
20555 * src/files.h, src/files.c (open_files, close_files): Remove.
20556 * src/main.c (main): Don't open/close files, nor invoke lex_free,
20558 * src/reader.c (reader): Do it.
20560 2001-12-17 Akim Demaille <akim@epita.fr>
20562 * src/conflicts.c (print_reductions): Formatting changes.
20564 2001-12-17 Akim Demaille <akim@epita.fr>
20566 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
20567 (flush_reduce): New.
20568 (resolve_sr_conflict): Adjust.
20570 2001-12-17 Akim Demaille <akim@epita.fr>
20572 * src/output.c (output_obstack): Be static and rename as...
20573 (format_obstack): this, to avoid any confusion with files.c's
20575 * src/reader.h (muscle_obstack): Move to...
20576 * src/output.h: here, since it's defined in output.c.
20578 2001-12-17 Akim Demaille <akim@epita.fr>
20580 * src/output.c (action_row, save_column, default_goto)
20581 (sort_actions, matching_state, pack_vector): Better variable
20584 2001-12-17 Akim Demaille <akim@epita.fr>
20586 * src/output.c: Various formatting changes.
20588 2001-12-17 Akim Demaille <akim@epita.fr>
20590 * src/files.c (output_files): Free the output_obstack.
20591 * src/main.c (main): Call print and print_graph conditionally.
20592 * src/print.c (print): Work unconditionally.
20593 * src/print_graph.c (print_graph): Work unconditionally.
20594 * src/conflicts.c (log_resolution): Output only if verbose_flag.
20596 2001-12-16 Marc Autret <autret_m@epita.fr>
20598 * src/output.c (actions_output): Fix. When we use %no-lines,
20599 there is one less line per action.
20601 2001-12-16 Marc Autret <autret_m@epita.fr>
20603 * src/bison.simple: Remove a useless #line directive.
20604 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
20605 * src/output.c (get_lines_number): New.
20606 (output_parser): Adjust, now takes care about the lines of a
20608 Fix line numbering.
20609 (actions_output): Computes the number of lines taken by actions.
20610 (output_master_parser): Insert new skeleton which is the name of
20611 the output parser file name.
20613 2001-12-15 Marc Autret <autret_m@epita.fr>
20615 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
20617 2001-12-15 Marc Autret <autret_m@epita.fr>
20619 * src/output.c (output_gram): Keep track of the hairy one.
20621 2001-12-15 Akim Demaille <akim@epita.fr>
20623 Make `make distcheck' work.
20625 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
20626 system.h which uses libgettext.h.
20628 2001-12-15 Akim Demaille <akim@epita.fr>
20630 * src/nullable.c (set_nullable): Useless rules must be skipped,
20631 otherwise, since we range over their symbols, we might look at a
20632 nonterminal which no longer ``exists'', i.e., it is not counted in
20633 `nvars', hence we overflow our arrays.
20635 2001-12-15 Akim Demaille <akim@epita.fr>
20637 The header can also be produced directly, without any obstack!
20640 * src/files.c, src/files.h (defines_obstack): Remove.
20641 (compute_header_macro): Global.
20642 (defines_obstack_save): Remove.
20643 * src/reader.c (parse_union_decl): No longer output to
20644 defines_obstack: its content can be found in the `stype' muscle
20646 (output_token_translations): Merge into...
20647 (symbols_output): this.
20649 (symbols_save): this.
20651 * src/output.c (header_output): New.
20654 2001-12-15 Akim Demaille <akim@epita.fr>
20656 * src/reader.c (parse_union_decl): Instead of handling two obstack
20657 simultaneously, use one to define the `stype' muscle, and use the
20658 value of the latter to fill defines_obstack.
20659 (copy_comment): Remove.
20660 (copy_comment2): Work for a single obstack.
20662 (copy_comment): this.
20664 2001-12-15 Akim Demaille <akim@epita.fr>
20666 * src/lex.c, src/lex.h (xgetc): No longer static.
20667 * src/reader.c (parse_union_decl): Revamp.
20669 2001-12-15 Akim Demaille <akim@epita.fr>
20671 Still making progress in separating Bison into (i) input, (ii)
20672 process, (iii) output: now we can directly output the parser file
20673 without using table_obstack at all.
20675 * src/files.c, src/files.h (table_obstack): Bye bye.
20676 (parser_file_name): New.
20677 * src/files.c (compute_output_file_names): Compute it.
20678 * src/output.c (actions_output, output_parser)
20679 (output_master_parser): To a file instead of an obstack.
20681 2001-12-15 Akim Demaille <akim@epita.fr>
20683 Attach actions to rules, instead of pre-outputting them to
20686 * src/gram.h (rule_t): action and action_line are new members.
20687 * src/reader.c (symbol_list): Likewise.
20688 (copy_action): Save the actions within the rule.
20689 (packgram): Save them in rule_table.
20690 * src/output.c (actions_output): New.
20691 (output_parser): Use it on `%%actions'.
20692 (output_rule_data): Don't free rule_table.
20694 (prepare): Don't save the `action' muscle.
20695 * src/bison.simple: s/%%action/%%actions/.
20697 2001-12-15 Akim Demaille <akim@epita.fr>
20699 * src/reader.c (copy_action): When --yacc, don't append a `;'
20700 to the user action: let it fail if lacking.
20701 Suggested by Arnold Robbins and Tom Tromey.
20703 2001-12-14 Akim Demaille <akim@epita.fr>
20705 * src/lex.c (literalchar): Simply return the char you decoded, non
20706 longer mess around with obstacks and int pointers.
20707 Adjust all callers.
20709 2001-12-14 Akim Demaille <akim@epita.fr>
20711 * src/lex.c (literalchar): Don't escape the special characters,
20712 just decode them, and keep them as char (before, eol was output as
20713 the 2 char string `\n' etc.).
20714 * src/output.c (output_rule_data): Use quotearg to output the
20717 2001-12-13 Paul Eggert <eggert@twinsun.com>
20719 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
20720 Do not infringe on the global user namespace when using C++.
20721 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
20722 All uses of `fprintf' and `stderr' changed.
20724 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
20726 2001-12-13 Akim Demaille <akim@epita.fr>
20728 The computation of nullable is broken: it doesn't handle empty
20731 * tests/torture.at (GNU AWK Grammar): New.
20732 * tests/sets.at (Nullable): New.
20733 * src/nullable.c (set_nullable): Instead of blindly looping over
20734 `ritems', loop over the rules, and then over their rhs's.
20736 Work around Autotest bugs.
20738 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
20739 frame, because Autotest understand lines starting with a `+' as
20740 traces from the shell. Then, they are not processed properly.
20741 Admittedly an Autotest bug, but we don't have time to wait for
20742 Autotest to catch up.
20743 * tests/regression.at (Broken Closure): Adjust to the new table
20746 * tests/sets.at: here.
20748 2001-12-13 Akim Demaille <akim@epita.fr>
20750 * src/closure.c (closure): Use nrules instead of playing tricks
20751 with BITS_PER_WORD.
20753 2001-12-13 Akim Demaille <akim@epita.fr>
20755 * src/print.c (print_actions): Output the handling of `$' as the
20756 traces do: shifting the token EOF. Before EOF was treated as a
20758 * tests/regression.at: Adjust some tests.
20759 * src/print_graph.c (print_core): Complete the set of items via
20760 closure. The next-to-final and final states are still unsatisfying,
20761 but that's to be addressed elsewhere.
20762 No longer output the rule numbers, but do output the state number.
20763 A single loop for the shifts + gotos is enough, but picked a
20764 distinct color for each.
20765 (print_graph): Initialize and finalize closure.
20767 2001-12-13 Akim Demaille <akim@epita.fr>
20769 * src/reader.c (readgram): Remove dead code, an strip useless
20771 (get_type): Remove, unused.
20773 2001-12-12 Akim Demaille <akim@epita.fr>
20775 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
20776 on that of lib/error.c.
20778 2001-12-12 Akim Demaille <akim@epita.fr>
20780 Some hosts don't like `/' in includes.
20782 * src/system.h: Include libgettext.h without qualifying the path.
20783 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
20786 2001-12-11 Marc Autret <autret_m@epita.fr>
20788 * src/output.c (output_parser): Remove useless muscle.
20790 2001-12-11 Marc Autret <autret_m@epita.fr>
20792 * src/bison.simple: Remove #line just before %%epilogue. It
20793 is now handled in ...
20794 * src/reader.c (read_additionnal_code): Add the output of a
20795 #line for the epilogue.
20797 2001-12-10 Marc Autret <autret_m@epita.fr>
20799 * src/reader.c (copy_definition): Re-use CPP-outed code which
20800 replace precedent remove.
20801 * src/bison.simple: Remove #line before %%prologue because
20802 %%input-line is wrong at this time.
20804 2001-12-10 Marc Autret <autret_m@epita.fr>
20806 * src/reader.c (symbols_output): Clean up.
20807 * src/output.c (output_gram, output): Clean up.
20809 2001-12-10 Akim Demaille <akim@epita.fr>
20811 * src/lalr.c (initialize_lookaheads): New. Extracted from...
20812 * src/LR0.c (set_state_table): here.
20813 * src/lalr.c (lalr): Call it.
20815 2001-12-10 Akim Demaille <akim@epita.fr>
20817 * src/state.h (shifts): Remove the `number' member: shifts are
20818 attached to state, hence no longer need to be labelled with a
20821 2001-12-10 Akim Demaille <akim@epita.fr>
20823 Now that states have a complete set of members, the linked list of
20824 shifts is useless: just fill directly the state's shifts member.
20826 * src/state.h (shifts): Remove the `next' member.
20827 * src/LR0.c (first_state, last_state): Remove.
20828 Adjust the callers.
20829 (augment_automaton): Don't look for the shifts that must be added
20830 a shift on EOF: it is those of the state we looked for! But now,
20831 since shifts are attached, it is no longer needed to looking
20832 merely by its id: its number.
20834 2001-12-10 Akim Demaille <akim@epita.fr>
20836 * src/LR0.c (augment_automaton): Better variable locality.
20837 Remove an impossible branch: if there is a state corresponding to
20838 the start symbol being shifted, then there is shift for the start
20839 symbol from the initial state.
20841 2001-12-10 Akim Demaille <akim@epita.fr>
20843 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
20844 only when appropriate: when insert_start_shifting_state' is not
20846 * tests/regression.at (Rule Line Numbers): Adjust.
20848 2001-12-10 Akim Demaille <akim@epita.fr>
20850 * src/LR0.c (augment_automaton): Now that all states have shifts,
20851 merge the two cases addition shifts to the initial state.
20853 2001-12-10 Akim Demaille <akim@epita.fr>
20855 * src/lalr.c (set_state_table): Move to...
20857 * src/lalr.c (lalr): Don't call it...
20858 * src/LR0.c (generate_states): do it.
20859 * src/LR0.h (first_state): Remove, only the table is used.
20861 2001-12-10 Akim Demaille <akim@epita.fr>
20863 * src/LR0.h (first_shift, first_reduction): Remove.
20864 * src/lalr.c: Don't use first_shift: find shifts through the
20867 2001-12-10 Akim Demaille <akim@epita.fr>
20869 * src/LR0.c: Attach shifts to states as soon as they are
20871 * src/lalr.c (set_state_table): Instead of assigning shifts to
20872 state, just assert that the mapping was properly done.
20874 2001-12-10 Akim Demaille <akim@epita.fr>
20876 * src/LR0.c (insert_start_shift): Rename as...
20877 (insert_start_shifting_state): this.
20878 (insert_eof_shifting_state, insert_accepting_state): New.
20879 (augment_automaton): Adjust.
20880 Better locality of the variables.
20881 When looking if the start_symbol is shifted from the initial
20882 state, using `while (... symbol != start_symbol ...)' sounds
20883 better than `while (... symbol < start_symbol ...)': If fail
20884 to see how the order between symbols could be relevant!
20886 2001-12-10 Akim Demaille <akim@epita.fr>
20888 * src/getargs.h: Don't declare `spec_name_prefix' and
20889 `spec_file_prefix', declared by src/files.h.
20890 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
20891 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
20892 * src/output.c (prepare): Adjust.
20893 * src/reader.c (symbols_output): Likewise.
20894 * src/vmsgetargs.c: Vaguely adjust, but who cares?
20896 2001-12-10 Akim Demaille <akim@epita.fr>
20898 * src/muscle_tab.c (muscle_init): NULL is a better default than
20901 2001-12-10 Akim Demaille <akim@epita.fr>
20903 * src/reader.c (reader): Calling symbols_output once is enough.
20905 2001-12-10 Akim Demaille <akim@epita.fr>
20907 Now that states have a complete set of members, the linked list of
20908 reductions is useless: just fill directly the state's reductions
20911 * src/state.h (struct reductions): Remove member `number' and
20913 * src/LR0.c (first_reduction, last_reduction): Remove.
20914 (save_reductions): Don't link the new reductions, store them in
20916 * src/lalr.c (set_state_table): No need to attach reductions to
20917 states, it's already done.
20918 * src/output.c (output_actions): No longer free the shifts, then
20919 the reductions, then the states: free all the states and their
20922 2001-12-10 Akim Demaille <akim@epita.fr>
20924 * src/options.c (OPTN, DRTV, BOTH): New.
20925 (option_table): Use them.
20927 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
20928 the job of system.h.
20929 * src/options.c: Don't include stdio.h and xalloc.h for the same
20932 2001-12-10 Akim Demaille <akim@epita.fr>
20934 * src/output.c (output, prepare): Make sure the values of the
20935 muscles `action' and `prologue' are 0-terminated.
20937 2001-12-10 Akim Demaille <akim@epita.fr>
20939 Clean up GCC warnings.
20941 * src/reader.c (copy_action): `buf' is not used.
20942 (parse_skel_decl): Be static.
20943 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
20944 * src/options.h (create_long_option_table): Have a real prototype.
20945 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
20946 (hash_delete_at): Return const void *.
20947 Adjust casts to preserve the const.
20949 2001-12-10 Akim Demaille <akim@epita.fr>
20951 * configure.in: Require 2.52g.
20952 M4 is not needed, but AUTOM4TE is.
20953 * m4/m4.m4: Remove.
20954 * tests/Makefile.am: Adjust.
20956 2001-12-10 Akim Demaille <akim@epita.fr>
20958 One structure for states is enough, even though theoretically
20959 there are LR(0) states and LALR(1) states.
20961 * src/lalr.h (state_t): Remove.
20962 (state_table): Be state_t **, not state_t *.
20963 * src/state.h (core, CORE_ALLOC): Rename as...
20964 (state_t, STATE_ALLOC): this.
20965 Add the LALR(1) members: shifts, reductions, errs.
20966 * src/LR0.c (state_table): Rename as...
20967 (state_hash): this, to avoid name clashes with the global
20969 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
20970 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
20972 2001-12-10 Akim Demaille <akim@epita.fr>
20974 Bison dumps core on bash.y.
20975 Reported by Pascal Bart.
20977 * src/warshall.c (bitmatrix_print): New.
20979 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
20980 j must be the outer loop.
20981 * tests/regression.at (Broken Closure): New.
20983 2001-12-05 Akim Demaille <akim@epita.fr>
20985 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
20987 Reported by Peter Hamorsky.
20989 2001-12-05 Akim Demaille <akim@epita.fr>
20991 * src/conflicts.c (err_table): Remove.
20992 (resolve_sr_conflict): Adjust.
20993 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
20995 (state_t.reductions, state_t.shifts): this.
20997 2001-12-05 Akim Demaille <akim@epita.fr>
20999 * src/reduce.c (reduce_grammar_tables): No longer disable the
21000 removal of useless rules via CPP but via `if (0)', so that the
21001 compiler still check the code is valid.
21002 For instance, it should have noticed `rline' no longer exists: use
21003 the `line' member of rule_t.
21004 * src/gram.c (dummy, rline): Remove, unused.
21006 2001-12-05 Akim Demaille <akim@epita.fr>
21008 * src/output.c (pack_vector): Use assert, not berror.
21009 * src/main.c (berror): Remove, unused.
21011 2001-12-05 Akim Demaille <akim@epita.fr>
21013 New experimental feature: if --verbose --trace output all the
21014 items of a state, not only its kernel.
21016 * src/print.c (print_core): If `trace_flag', then invoke closure
21017 before outputting the items of the state (print_core is no longer
21018 a correct name them).
21019 (print_results): Invoke new_closure/free_closure if needed.
21021 2001-12-05 Akim Demaille <akim@epita.fr>
21023 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
21024 * src/closure.c, src/closure.h (itemsetsize): Rename as...
21025 (nitemset): for consistency with the rest of the project.
21027 2001-12-05 Akim Demaille <akim@epita.fr>
21029 * src/closure.c (print_closure): Improve.
21030 (closure): Use it for printing input and output.
21032 2001-12-05 Akim Demaille <akim@epita.fr>
21034 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
21035 indexed by nonterminals.
21037 2001-12-05 Akim Demaille <akim@epita.fr>
21039 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
21041 * src/warshall.h: Remove accidental duplication of the content.
21043 2001-12-05 Akim Demaille <akim@epita.fr>
21045 * src/closure.c (set_fderives): De-obfuscate.
21047 2001-12-05 Akim Demaille <akim@epita.fr>
21049 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
21051 2001-12-05 Akim Demaille <akim@epita.fr>
21053 * src/closure.c (set_firsts): De-obfuscate.
21055 2001-12-05 Akim Demaille <akim@epita.fr>
21057 * src/output.c (action_row): De-obfuscate
21058 using the good o' techniques: arrays not pointers, variable
21059 locality, BITISSET, RESETBIT etc.
21061 2001-12-05 Akim Demaille <akim@epita.fr>
21063 Pessimize the code to simplify it: from now on, all the states
21064 have a valid SHIFTS, which NSHIFTS is possibly 0.
21066 * src/LR0.c (shifts_new): Be global and move to..
21067 * src/state.c, src/state.h: here.
21068 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
21069 * src/print_graph: Adjust.
21071 2001-12-05 Akim Demaille <akim@epita.fr>
21073 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
21074 * src/conflicts.c: Use it.
21075 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
21076 incorrectly ``simplified''.
21078 2001-12-05 Akim Demaille <akim@epita.fr>
21080 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
21081 using the good o' techniques: arrays not pointers, variable
21082 locality, BITISSET, RESETBIT etc.
21084 2001-12-05 Akim Demaille <akim@epita.fr>
21086 * src/state.h (SHIFT_SYMBOL): New.
21087 * src/conflicts.c: Use it to deobfuscate.
21089 2001-12-05 Akim Demaille <akim@epita.fr>
21091 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
21092 (print_reductions): De-obfuscate using the good o' techniques:
21093 arrays not pointers, variable locality, BITISSET.
21095 2001-12-05 Akim Demaille <akim@epita.fr>
21097 * src/conflicts.c (print_reductions): Arrays, not pointers.
21100 2001-12-05 Akim Demaille <akim@epita.fr>
21102 * src/conflicts.c (print_reductions): Pessimize, but clarify.
21104 2001-12-05 Akim Demaille <akim@epita.fr>
21106 * src/conflicts.c (print_reductions): Improve variable locality.
21108 2001-12-05 Akim Demaille <akim@epita.fr>
21110 * src/conflicts.c (print_reductions): Pessimize, but clarify.
21112 2001-12-05 Akim Demaille <akim@epita.fr>
21114 * src/conflicts.c (print_reductions): Improve variable locality.
21116 2001-12-05 Akim Demaille <akim@epita.fr>
21118 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
21119 * src/lalr.c: Use them.
21121 2001-12-05 Akim Demaille <akim@epita.fr>
21123 * src/LR0.c (augment_automaton): Formatting changes.
21124 Better variable locality.
21126 2001-12-05 Akim Demaille <akim@epita.fr>
21128 * src/lalr.c (matrix_print): New.
21129 (transpose): Use it.
21130 Use arrays instead of pointers.
21132 2001-12-05 Akim Demaille <akim@epita.fr>
21134 * src/lalr.c (maxrhs): Move to...
21135 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
21136 * src/lalr.c (build_relations): Adjust.
21138 2001-12-05 Akim Demaille <akim@epita.fr>
21140 * src/lalr.c (transpose): Free the memory allocated to the
21141 argument, as it is replaced by the results by the unique caller.
21142 (build_relations): Merely invoke transpose: it handles the memory
21144 Improve variable locality.
21145 Avoid variables used as mere abbreviations.
21146 (compute_lookaheads): Use arrays instead of pointers.
21148 2001-12-05 Akim Demaille <akim@epita.fr>
21150 * src/lalr.c (initialize_F): Improve variable locality.
21151 Avoid variables used as mere abbreviations.
21153 2001-12-05 Akim Demaille <akim@epita.fr>
21155 * src/derives.c (print_derives): Display the ruleno.
21156 * src/lalr.c (initialize_F, transpose): Better variable locality
21157 to improve readability.
21158 Avoid variables used as mere abbreviations.
21160 2001-12-05 Akim Demaille <akim@epita.fr>
21162 * src/lalr.c (traverse): Use arrays instead of pointers.
21164 2001-12-05 Akim Demaille <akim@epita.fr>
21166 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
21167 the handling of squeue.
21168 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21170 2001-12-05 Akim Demaille <akim@epita.fr>
21172 Because useless nonterminals are now kept alive (instead of being
21173 `destroyed'), we now sometimes examine them, and store information
21174 related to them. Hence we need to know their number, and adjust
21175 memory allocations.
21177 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
21179 * src/LR0.c (allocate_itemsets): The memory allocated to
21180 `symbol_count' was used for two different purpose: once to count
21181 the number of occurrences of each symbol, and later reassigned to
21182 `shift_symbol', containing the symbol that can be shifted from a
21184 Deobfuscate, i.e., allocate, use and free `symbol_count' here
21186 (new_itemsets): Allocate `shift_symbol' here.
21187 (allocate_itemsets): symbol_count includes useless nonterminals.
21188 Make room for them.
21189 (free_storage): Use `free', not `XFREE', for pointers that cannot
21192 2001-12-05 Akim Demaille <akim@epita.fr>
21194 * src/nullable.c (set_nullable): Deobfuscate the handling of
21196 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21198 2001-12-05 Akim Demaille <akim@epita.fr>
21200 * src/gram.c, src/gram.h (ritem_print): New.
21201 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
21202 (This useless function was defined only to work around VMS linkers
21203 that can't handle compilation units with variables only).
21204 * src/reduce.c (dump_grammar): Use it to trace the construction of
21207 2001-12-04 Paul Eggert <eggert@twinsun.com>
21209 * src/bison.simple (union yyalloc): Change member names
21210 to be the same as the stack names.
21211 (yyparse): yyptr is now union yyalloc *, not char *.
21212 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
21213 and may generate better code on some machines.
21214 (yystpcpy): Use prototype if __STDC__ is defined, not just
21215 if __cplusplus is defined.
21217 2001-11-30 Akim Demaille <akim@epita.fr>
21219 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
21220 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
21221 Gettext doesn't compile cleanly, and dies with -Werror.
21222 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
21223 Include WARNING_CFLAGS here.
21224 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
21225 before being defined.
21227 2001-11-27 Paul Eggert <eggert@twinsun.com>
21229 * lib/quotearg.h (quotearg_n, quotearg_n_style):
21230 First arg is int, not unsigned.
21231 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
21232 (SIZE_MAX, UINT_MAX): New macros.
21233 (quotearg_n_options): Abort if N is negative.
21234 Avoid overflow check on hosts where size_t is 64 bits and int
21235 is 32 bits, as overflow is impossible there.
21236 Fix off-by-one typo that caused unnecessary reallocation.
21238 2001-11-29 Paul Eggert <eggert@twinsun.com>
21240 Name space cleanup in generated parser.
21242 * doc/bison.texinfo (Bison Parser): Discuss system headers
21243 and their effect on the user name space.
21245 * src/bison.simple:
21246 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
21247 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
21248 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
21250 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
21251 on user names when possible.
21253 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
21254 Simplify test for whather <alloca.h> exists.
21256 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
21258 (<stdio.h>): Include if YYDEBUG.
21260 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
21261 ! defined (yyoverflow) && ! defined (yymemcpy).
21263 (yymemcpy, yyparse): Rename local variables as needed so that
21264 they all begin with 'yy'.
21266 (yystrlen, yystpcpy): New functions.
21268 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
21271 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
21272 instead of relying on string.h functions. Use YYSTACK_ALLOC
21273 and YYSTACK_FREE instead of malloc and free.
21275 2001-11-30 Akim Demaille <akim@epita.fr>
21277 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
21278 before their first uses.
21279 (YYBISON, YYPURE): Move to the top of the output.
21281 2001-11-30 Akim Demaille <akim@epita.fr>
21283 * tests/reduce.at (Useless Nonterminals): Fix.
21285 2001-11-30 Akim Demaille <akim@epita.fr>
21287 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
21288 if body instead of `;' to pacify GCC's warnings.
21290 2001-11-30 Akim Demaille <akim@epita.fr>
21292 Instead of mapping the LHS of unused rules to -1, keep the LHS
21293 valid, but flag the rules as invalid.
21295 * src/gram.h (rule_t): `useful' is a new member.
21296 * src/print.c (print_grammar): Adjust.
21297 * src/derives.c (set_derives): Likewise.
21298 * src/reader.c (packgram, reduce_output): Likewise.
21299 * src/reduce.c (reduce_grammar_tables): Likewise.
21300 * tests/reduce.at (Underivable Rules, Useless Rules): New.
21302 2001-11-30 Akim Demaille <akim@epita.fr>
21304 * src/reduce.c (reduce_output): Formatting changes.
21305 * src/print.c (print_results, print_grammar): Likewise.
21306 * tests/regression.at (Rule Line Numbers)
21307 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
21309 2001-11-30 Akim Demaille <akim@epita.fr>
21311 * src/reduce.c (nonterminals_reduce): Instead of throwing away
21312 useless nonterminals, move them at the end of the symbol arrays.
21313 (reduce_output): Adjust.
21314 * tests/reduce.at (Useless Nonterminals): Adjust.
21316 2001-11-30 Akim Demaille <akim@epita.fr>
21318 * src/reduce.c: Various comment/formatting changes.
21319 (nonterminals_reduce): New, extracted from...
21320 (reduce_grammar_tables): here.
21321 (reduce_grammar): Call nonterminals_reduce.
21323 2001-11-29 Paul Eggert <eggert@twinsun.com>
21325 * src/bison.simple (YYSTACK_REALLOC): Remove.
21326 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
21327 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
21329 (union yyalloc): New type.
21330 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
21331 an arbitrary restriction on hosts where size_t is wider than int.
21333 (yyparse): Don't dump core if alloca or malloc fails; instead, report
21334 a parser stack overflow. Allocate just one block of memory for all
21335 three stacks, instead of allocating three blocks; this typically is
21336 faster and reduces fragmentation.
21338 Do not limit the number of items in the stack to a value that fits
21339 in 'int', as this is an arbitrary limit on hosts with 64-bit
21340 size_t and 32-bit int.
21342 2001-11-29 Marc Autret <autret_m@epita.fr>
21344 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
21345 of defining YYERROR_VERBOSE.
21346 [AT_DATA]: $4 is now out of C declarations in the prologue.
21348 2001-11-28 Marc Autret <autret_m@epita.fr>
21350 * src/reader.c (parse_dquoted_param): New.
21351 (parse_skel_decl): Use it.
21352 * src/lex.h: Add its prototype.
21353 * src/lex.c (literalchar): Become not static.
21355 2001-11-28 Marc Autret <autret_m@epita.fr>
21357 * src/output.h: And put its extern declaration here.
21358 * src/output.c (error_verbose): Define here.
21359 (prepare): Echo name modification.
21360 * src/getargs.h: Clean its extern declaration.
21361 * src/getargs.c (error_verbose_flag): Remove.
21362 (getargs): Remove case 'e'.
21363 * src/options.c (option_table): 'error-verbose' is now seen as simple
21367 * src/reader.c (read_declarations): Remove case tok_include.
21368 (parse_include_decl): Remove.
21369 * src/lex.h (token_t): Remove tok_include.
21370 * src/options.c (option_table): 'include' is now a simple command line
21373 2001-11-28 Marc Autret <autret_m@epita.fr>
21375 * src/bison.simple: Adjust muscle names.
21376 * src/muscle_tab.c (muscle_init): Also rename the muscles.
21377 * src/output.c (prepare): s/_/-/ for the muscles names.
21378 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
21380 2001-11-28 Marc Autret <autret_m@epita.fr>
21382 * src/bison.simple: Fix debug.
21383 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
21385 2001-11-28 Akim Demaille <akim@epita.fr>
21387 * src/LR0.c (shifts_new): New.
21388 (save_shifts, insert_start_shift, augment_automaton): Use it.
21390 2001-11-28 Akim Demaille <akim@epita.fr>
21392 * src/closure.c (closure): `b' and `ruleno' denote the same value:
21395 2001-11-28 Akim Demaille <akim@epita.fr>
21397 * src/closure.c (closure): Instead of looping over word in array
21398 then bits in words, loop over bits in array.
21400 2001-11-28 Akim Demaille <akim@epita.fr>
21402 * src/closure.c (closure): No longer optimize the special case
21403 where all the bits of `ruleset[r]' are set to 0, to make the code
21406 2001-11-28 Akim Demaille <akim@epita.fr>
21408 * src/closure.c (closure): `r' and `c' are new variables, used to
21409 de-obfuscate accesses to RULESET and CORE.
21411 2001-11-28 Akim Demaille <akim@epita.fr>
21413 * src/reduce.c (reduce_print): Use ngettext.
21414 (dump_grammar): Improve the trace accuracy.
21416 2001-11-28 Akim Demaille <akim@epita.fr>
21418 * src/reduce.c (dump_grammar): Don't translate trace messages.
21420 2001-11-28 Akim Demaille <akim@epita.fr>
21422 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
21423 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
21424 as all tags are free'ed afterwards.
21425 From Enrico Scholz.
21427 2001-11-27 Paul Eggert <eggert@twinsun.com>
21429 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
21430 use alloca when we didn't want to, and vice versa.
21432 2001-11-27 Marc Autret <autret_m@epita.fr>
21434 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
21436 * src/output.c (prepare): Remove its update.
21438 2001-11-27 Marc Autret <autret_m@epita.fr>
21440 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
21441 Use %error-verbose.
21443 2001-11-27 Marc Autret <autret_m@epita.fr>
21445 * src/bison.simple: Remove YYERROR_VERBOSE using.
21446 Use %%error_verbose.
21447 (yyparse): Likewise.
21448 * src/output.c (prepare): Give its final value.
21449 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
21450 * src/getargs.h: Add its extern declaration.
21451 * src/getargs.c (error_verbose_flag): New int.
21452 (getargs): Update to catch new case.
21453 * src/options.c (option_table): 'error-verbose' is a new option.
21454 (shortopts): Update.
21456 2001-11-27 Akim Demaille <akim@epita.fr>
21458 * src/system.h: Use intl/libgettext.h.
21459 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
21461 2001-11-27 Akim Demaille <akim@epita.fr>
21463 * tests/torture.at (Exploding the Stack Size with Malloc):
21464 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
21466 2001-11-27 Akim Demaille <akim@epita.fr>
21468 * src/files.c: Include error.h.
21469 Reported by Hans Aberg.
21471 2001-11-26 Marc Autret <autret_m@epita.fr>
21473 * src/reader.c (parse_include_decl): New, not yet implemented.
21474 (read_declarations): Add case tok_include.
21475 * src/getargs.h (include): Add its extern definition.
21476 * src/getargs.c (include): New const char *.
21477 (getargs): Add case '-I'.
21478 * src/options.c (option_table): Add include as command line and
21480 * src/lex.h (token_t): Add tok_include.
21482 2001-11-26 Akim Demaille <akim@epita.fr>
21484 * src/reader.c (readgram): Make sure rules for mid-rule actions
21485 have a lineno equal to that of their host rule.
21486 Reported by Hans Aberg.
21487 * tests/regression.at (Rule Line Numbers): New.
21489 2001-11-26 Akim Demaille <akim@epita.fr>
21491 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
21494 2001-11-26 Akim Demaille <akim@epita.fr>
21496 * src/complain.c, src/complain.h (error): Remove, provided by
21499 2001-11-26 Akim Demaille <akim@epita.fr>
21501 * src/reader.c (read_declarations): Don't abort on tok_illegal,
21502 issue an error message.
21503 * tests/regression.at (Invalid %directive): New.
21504 Reported by Hans Aberg.
21506 2001-11-26 Akim Demaille <akim@epita.fr>
21508 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
21509 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
21511 2001-11-26 Akim Demaille <akim@epita.fr>
21513 * src/conflicts.c (conflicts_print): Don't complain at all when
21514 there are no reduce/reduce conflicts, and as many shift/reduce
21515 conflicts as expected.
21516 * tests/regression.at (%expect right): Adjust.
21518 2001-11-23 Akim Demaille <akim@epita.fr>
21520 * lib/alloca.c: Update, from fileutils.
21522 2001-11-23 Akim Demaille <akim@epita.fr>
21524 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
21526 2001-11-23 Akim Demaille <akim@epita.fr>
21528 * src/system.h: Include alloca.h.
21529 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
21531 2001-11-23 Akim Demaille <akim@epita.fr>
21533 * src/print_graph.c (print_actions): Remove `rule', unused.
21534 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
21535 pacify GCC's signed < unsigned warnings.
21536 * src/closure.c (itemsetsize): Likewise.
21537 * src/reader.c (symbol_list_new): Static.
21539 2001-11-23 Akim Demaille <akim@epita.fr>
21541 Attaching lineno to buckets is stupid, since only one copy of each
21542 symbol is kept, only the line of the first occurrence is kept too.
21544 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
21545 * src/reader.c (rline_allocated): Remove, unused.
21546 (symbol_list): Have a `line' member.
21547 (symbol_list_new): New.
21548 (readgram): Use it.
21549 * src/print.c (print_grammar): Output the rule line numbers.
21550 * tests/regression.at (Solved SR Conflicts)
21551 (Unresolved SR Conflicts): Adjust.
21552 Reported by Hans Aberg.
21554 2001-11-22 Marc Autret <autret_m@epita.fr>
21556 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
21558 2001-11-22 Marc Autret <autret_m@epita.fr>
21560 * src/muscle_tab.c (muscle_init): Remove initialization of
21562 * src/output.c (output_master_parser): Do it here.
21564 2001-11-20 Akim Demaille <akim@epita.fr>
21567 * configure.in (ALL_LINGUAS): Adjust.
21568 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
21569 longer contains strings to translate.
21571 2001-11-19 Akim Demaille <akim@epita.fr>
21573 * src/conflicts.c (conflicts_print): Add a missing \n.
21575 2001-11-19 Akim Demaille <akim@epita.fr>
21577 * src/nullable.c (nullable_print): New.
21578 (set_nullable): Call it when tracing.
21579 Better locality of variables.
21581 2001-11-19 Akim Demaille <akim@epita.fr>
21583 * src/print.c (print_actions): Better locality of variables.
21585 2001-11-19 Akim Demaille <akim@epita.fr>
21587 * src/derives.c (print_derives): Fix and enrich.
21588 * src/closure.c (print_fderives): Likewise.
21590 2001-11-19 Akim Demaille <akim@epita.fr>
21592 * src/closure.c (itemsetend): Remove, replaced with...
21593 (itemsetsize): new.
21595 2001-11-19 Akim Demaille <akim@epita.fr>
21597 * src/LR0.c (kernel_end): Remove, replaced with...
21598 (kernel_size): new.
21600 2001-11-19 Akim Demaille <akim@epita.fr>
21602 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
21605 2001-11-19 Akim Demaille <akim@epita.fr>
21607 * src/closure.c (closure): Use arrays instead of pointers to clarify.
21609 2001-11-19 Akim Demaille <akim@epita.fr>
21611 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
21613 * src/LR0.c: Likewise.
21614 (allocate_itemsets): Use arrays instead of pointers to clarify.
21616 2001-11-19 Akim Demaille <akim@epita.fr>
21618 * src/getargs.c (statistics_flag): Replace with...
21620 (longopts): Accept --trace instead of --statistics.
21621 * src/getargs.h, src/options.c: Adjust.
21622 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
21623 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
21625 2001-11-19 Akim Demaille <akim@epita.fr>
21627 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
21628 pointers to clarify the code.
21629 (save_reductions, save_shifts): Factor common parts of alternatives.
21631 2001-11-19 Akim Demaille <akim@epita.fr>
21633 * src/LR0.c (new_state, get_state): Complete TRACE code.
21634 * src/closure.c: Include `reader.h' to get `tags', needed by the
21636 Rename the conditional DEBUG as TRACE.
21637 Output consistently TRACEs to stderr, not stdout.
21638 * src/derives.c: Likewise.
21639 * src/reduce.c: (inaccessable_symbols): Using if is better style
21641 Use `#if TRACE' instead of `#if 0' for tracing code.
21643 2001-11-19 Akim Demaille <akim@epita.fr>
21645 * src/system.h (LIST_FREE, shortcpy): New.
21646 * src/LR0.c: Use them.
21647 * src/output.c (free_itemsets, free_reductions, free_shifts):
21648 Remove, replaced by LIST_FREE.
21650 2001-11-19 Akim Demaille <akim@epita.fr>
21652 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
21653 (REDUCTIONS_ALLOC): New.
21654 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
21657 2001-11-19 Akim Demaille <akim@epita.fr>
21659 * src/LR0.c (new_state): Complete trace code.
21660 * src/nullable.c (set_nullable): Don't translate traces.
21662 2001-11-19 Akim Demaille <akim@epita.fr>
21664 * src/print_graph.c (print_core): Better locality of variables.
21665 * src/print.c (print_core): Likewise.
21667 2001-11-19 Akim Demaille <akim@epita.fr>
21669 * src/vcg.c: You do the output, so you are responsible of the
21670 handling of VCG syntax, in particular: use quotearg.
21671 * src/print_graph.c: Don't.
21672 (print_actions): Don't output the actions as part of the nodes,
21673 since that's the job of the edges.
21674 (print_state): Don't output by hand: fill the node description,
21675 and ask for its output.
21677 2001-11-19 Akim Demaille <akim@epita.fr>
21679 * src/bison.simple (yyparse): When verbosely reporting an error,
21680 no longer put additional quotes around token names.
21681 * tests/calc.at: Adjust.
21683 2001-11-19 Akim Demaille <akim@epita.fr>
21685 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
21686 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
21687 * src/output.c: Adjust.
21689 2001-11-19 Akim Demaille <akim@epita.fr>
21691 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
21693 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
21695 2001-11-19 Akim Demaille <akim@epita.fr>
21697 * src/gram.h (rule_t): New.
21699 (rrhs, rlhs): Remove, part of state_t.
21700 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
21701 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
21702 * src/reader.c, src/reduce.c: Adjust.
21704 2001-11-19 Akim Demaille <akim@epita.fr>
21706 * src/reader.c (symbols_output): New, extracted from...
21707 (packsymbols): Here.
21710 2001-11-19 Akim Demaille <akim@epita.fr>
21712 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
21713 (maxrhs): this new function.
21715 2001-11-19 Akim Demaille <akim@epita.fr>
21717 * src/lalr.c (F): New macro to access the variable F.
21720 2001-11-19 Akim Demaille <akim@epita.fr>
21722 * src/lalr.h (LA): New macro to access the variable LA.
21723 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21724 * src/lalr.c: Adjust.
21726 2001-11-19 Akim Demaille <akim@epita.fr>
21728 * src/lalr.c (initialize_LA): Only initialize LA. Let...
21729 (set_state_table): handle the `lookaheads' members.
21731 2001-11-19 Akim Demaille <akim@epita.fr>
21733 * src/lalr.h (lookaheads): Removed array, whose contents is now
21735 (state_t): this structure.
21736 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21739 2001-11-19 Akim Demaille <akim@epita.fr>
21741 * src/lalr.h (consistent): Removed array, whose contents is now
21743 (state_t): this structure.
21744 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21747 2001-11-19 Akim Demaille <akim@epita.fr>
21749 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
21750 contents are now members of...
21751 (state_t): this structure.
21752 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21755 2001-11-19 Akim Demaille <akim@epita.fr>
21757 * src/lalr.h (state_t): New.
21758 (state_table): Be a state_t * instead of a core **.
21759 (accessing_symbol): Remove, part of state_t.
21760 * src/lalr.c: Adjust.
21761 (set_accessing_symbol): Merge into...
21762 (set_state_table): this.
21763 * src/print_graph.c, src/conflicts.c: Adjust.
21765 2001-11-14 Akim Demaille <akim@epita.fr>
21767 * tests/calc.at, tests/output.at, tests/regression.at,
21768 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
21769 now the tests are run in private dirs, therefore AC_CLEANUP and
21770 family can be simplified to 0-ary.
21771 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
21772 use abs. path to find config.h.
21773 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
21774 stderr, there can be way too much random noise.
21775 Instead pass -Werror to GCC and rely on the exit status.
21776 Reported by Wolfram Wagner.
21778 2001-11-14 Akim Demaille <akim@epita.fr>
21780 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
21781 defined only if yyoverflow is defined, to avoid `warning: unused
21783 Reported by The Test Suite.
21785 2001-11-14 Akim Demaille <akim@epita.fr>
21787 * src/print.c: Include reduce.h.
21788 Reported by Hans Aberg.
21790 2001-11-14 Akim Demaille <akim@epita.fr>
21792 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
21793 Revert a previous patch: these are really const.
21794 * src/conflicts.c (conflict_report): Additional useless pair of
21795 braces to pacify GCC's warnings for `if () if () {} else {}'.
21796 * src/lex.c (parse_percent_token): Replace equal_offset with
21799 Be sure to strdup `arg' when used, since there is no reason for
21800 token_buffer not to change.
21802 2001-11-14 Akim Demaille <akim@epita.fr>
21804 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
21806 * src/main.c (main): Use them.
21807 Suggested by Hans Aberg.
21809 2001-11-12 Akim Demaille <akim@epita.fr>
21811 * src/system.h (ngettext): Now that we use ngettext, be sure to
21812 provide a default definition when NLS are not used.
21814 2001-11-12 Akim Demaille <akim@epita.fr>
21816 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
21817 Use @kbd to denote user input.
21818 (Language and Grammar): ANSIfy the example.
21819 Adjust its layout for info/notinfo.
21820 (Location Tracking Calc): Output error messages to stderr.
21821 Output locations in a more GNUtically correct way.
21822 Fix a couple of Englishos.
21823 Adjust @group/@end group pairs.
21825 2001-11-12 Akim Demaille <akim@epita.fr>
21827 %expect was not functioning at all.
21829 * src/conflicts.c (expected_conflicts): Set to -1.
21830 (conflict_report): Use ngettext.
21831 (conflicts_print): Check %expect and make its violation an error.
21832 * doc/bison.texinfo (Expect Decl): Adjust.
21833 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
21834 * tests/regression.at (%expect not enough, %expect right)
21835 (%expect too much): New.
21837 2001-11-12 Akim Demaille <akim@epita.fr>
21839 * tests/regression.at (Conflicts): Rename as...
21840 (Unresolved SR Conflicts): this.
21841 (Solved SR Conflicts): New.
21843 2001-11-12 Akim Demaille <akim@epita.fr>
21845 * src/reduce.c (print_results): Rename as...
21846 (reduce_output): This.
21847 Output to OUT, passed as argument, instead of output_obstack.
21848 (dump_grammar): Likewise.
21849 (reduce_free): New.
21851 (reduce_grammar): No longer call reduce_output, since...
21852 * src/print.c (print_results): do it.
21853 * src/main.c (main): Call reduce_free;
21855 2001-11-12 Akim Demaille <akim@epita.fr>
21857 * src/conflicts.c (print_reductions): Accept OUT as argument.
21858 Output to it, not to output_obstack.
21859 * src/print.c (print_actions): Adjust.
21861 2001-11-12 Akim Demaille <akim@epita.fr>
21863 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
21864 the result instead of using...
21865 (src_total, rrc_total, src_count, rrc_count): Remove.
21866 (any_conflicts): Remove.
21867 (print_conflicts): Split into...
21868 (conflicts_print, conflicts_output): New.
21869 * src/conflicts.h: Adjust.
21870 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
21871 * src/print.c (print_grammar): Issue `\n' between two rules.
21872 * tests/regression.at (Conflicts): New.
21873 Reported by Tom Lane.
21875 2001-11-12 Akim Demaille <akim@epita.fr>
21877 * tests/regression.at (Invalid input): Remove, duplicate with
21878 ``Invalid input: 1''.
21880 2001-11-12 Akim Demaille <akim@epita.fr>
21882 * tests/torture.at (AT_DATA_STACK_TORTURE)
21883 (Exploding the Stack Size with Alloca)
21884 (Exploding the Stack Size with Malloc): New.
21886 2001-11-12 Akim Demaille <akim@epita.fr>
21888 * src/bison.simple (YYSTACK_REALLOC): New.
21889 (yyparse) [!yyoverflow]: Use it and free the old stack.
21890 Reported by Per Allansson.
21892 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
21894 * src/bison.simple: Define type yystype instead of YYSTYPE, and
21895 define CPP macro, which substitute YYSTYPE by yystype.
21896 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
21897 with yyltype/YYLTYPE. This allows inclusion of the generated
21898 header within the parser if the compiler, such as GGC, accepts
21899 multiple equivalent #defines.
21902 2001-11-05 Akim Demaille <akim@epita.fr>
21904 * src/reader.c (symbols_output): New, extracted from...
21905 (packsymbols): here.
21908 2001-11-05 Akim Demaille <akim@epita.fr>
21910 * src/lex.c (parse_percent_token): s/quotearg/quote/.
21912 2001-11-05 Akim Demaille <akim@epita.fr>
21914 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
21917 2001-11-05 Akim Demaille <akim@epita.fr>
21919 * src/options.h (struct option_table_struct): set_flags is void*.
21920 * src/options.c (longopts): Support `--output' and `%output'.
21922 * src/lex.h (tok_setopt): Remove, replaced with...
21923 (tok_intopt, tok_stropt): these new guys.
21924 * src/lex.c (getopt.h): Not needed.
21925 (token_buffer, unlexed_token_buffer): Not const.
21926 (percent_table): Promote `-' over `_' in directive names.
21927 Active `%name-prefix', `file-prefix', and `output'.
21928 (parse_percent_token): Accept possible arguments to directives.
21929 Promote `-' over `_' in directive names.
21931 2001-11-04 Akim Demaille <akim@epita.fr>
21933 * doc/bison.texinfo (Decl Summary): Split the list into
21934 `directives for grammars' and `directives for bison'.
21936 Add description of `%name-prefix', `file-prefix', and `output'.
21937 Promote `-' over `_' in directive names.
21938 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
21939 Simplify the description of `--name-prefix'.
21940 Promote `-' over `_' in directive names.
21941 Promote `--output' over `--output-file'.
21942 Fix the description of `--defines'.
21943 * tests/output.at: Exercise %file-prefix and %output.
21945 2001-11-02 Akim Demaille <akim@epita.fr>
21947 * doc/refcard.tex: Update.
21949 2001-11-02 Akim Demaille <akim@epita.fr>
21951 * src/symtab.h (SUNDEF): New.
21952 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
21953 stand for `uninitialized', instead of 0.
21954 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
21955 * src/lex.c (lex): Adjust.
21957 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
21959 Let yylex return it instead of a plain 0.
21960 Reported by Dick Streefland.
21962 2001-11-02 Akim Demaille <akim@epita.fr>
21964 * tests/regression.at (Mixing %token styles): New test.
21966 2001-11-02 Akim Demaille <akim@epita.fr>
21968 * src/reader.c (parse_thong_decl): Formatting changes.
21969 (token_translations_init): New, extracted from...
21970 (packsymbols): Here.
21973 2001-11-01 Akim Demaille <akim@epita.fr>
21975 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
21976 Check that `9foo.y' produces correct cpp guards.
21977 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
21981 2001-11-01 Akim Demaille <akim@epita.fr>
21983 * tests/regression.at (Invalid input: 2): New.
21984 * src/lex.c (unlexed_token_buffer): New.
21985 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
21989 2001-11-01 Akim Demaille <akim@epita.fr>
21991 * tests/calc.at: Catch up with 1.30.
21992 * configure.in: Bump to 1.49a.
21993 Adjust to newer Autotest.
21995 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
21997 * src/conflicts.c: Move global variables rrc_total and src_total ...
21998 (print_conflicts): here.
21999 * src/output.c (output): Free global variable user_toknums.
22000 * src/lex.c (token_obstack): Become static.
22002 2001-10-18 Akim Demaille <akim@epita.fr>
22004 * tests/atlocal.in (GCC): Add.
22005 * tests/calc.at: s/m4_match/m4_bmatch/.
22006 s/m4_patsubst/m4_bpatsubst/.
22007 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
22008 * configure.in: AC_SUBST(GCC).
22010 2001-10-14 Marc Autret <autret_m@epita.fr>
22012 * src/options.c (create_long_option_table): Fix.
22014 2001-10-10 Akim Demaille <akim@epita.fr>
22016 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
22018 2001-10-04 Akim Demaille <akim@epita.fr>
22020 * src/reader.c (parse_union_decl): Push the caracters in
22021 union_obstack, not attrs_obstack.
22023 2001-10-04 Akim Demaille <akim@epita.fr>
22025 Merge in the branch 1.29.
22027 * src/reader.c (packsymbols): Use a temporary obstack for
22028 `%%tokendef', since output_stack is already used elsewhere.
22030 2001-10-02 Akim Demaille <akim@epita.fr>
22034 2001-10-02 Akim Demaille <akim@epita.fr>
22038 2001-10-02 Akim Demaille <akim@epita.fr>
22040 * tests/regression.at (Invalid CPP headers): New.
22041 From Alexander Belopolsky.
22042 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
22044 2001-10-02 Akim Demaille <akim@epita.fr>
22046 * tests/regression.at (Invalid input): New.
22047 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
22050 2001-10-02 Akim Demaille <akim@epita.fr>
22052 * tests/calc.at: Now that --debug works, the tests must be adjusted.
22054 2001-10-02 Akim Demaille <akim@epita.fr>
22056 * src/output.c (output_parser): Assert `skeleton'.
22057 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
22061 2001-10-01 Marc Autret <autret_m@epita.fr>
22063 * src/lex.h: Echo modifications.
22064 * src/lex.c (unlex): Parameter is now token_t.
22067 2001-10-01 Marc Autret <autret_m@epita.fr>
22069 * src/main.c: Include lex.h.
22072 2001-09-29 Akim Demaille <akim@epita.fr>
22074 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
22076 2001-09-28 Akim Demaille <akim@epita.fr>
22078 * tests/testsuite.at: Update to newer Autotest.
22079 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
22081 2001-09-27 Akim Demaille <akim@epita.fr>
22083 Position independent wrapper.
22085 * tests/bison: Remove.
22086 * tests/bison.in: New.
22087 * configure.in: Adjust.
22089 2001-09-27 Paul Eggert <eggert@twinsun.com>
22091 Port quotearg fixes from tar 1.13.24.
22093 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
22095 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
22096 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
22098 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
22099 * m4/mbrtowc.m4: New file.
22100 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
22101 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
22103 2001-09-27 Akim Demaille <akim@epita.fr>
22107 2001-09-27 Akim Demaille <akim@epita.fr>
22111 2001-09-25 Akim Demaille <akim@epita.fr>
22113 * src/system.h: Include `xalloc.h'.
22114 Remove it from the C files.
22115 * src/files.c (output_files): Free the obstacks.
22116 * src/lex.c (init_lex): Rename as...
22119 * src/main.c (main): Use it.
22121 2001-09-24 Marc Autret <autret_m@epita.fr>
22123 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
22124 to output informations in fout (FILE*).
22125 (open_graph, close_graph): Likewise.
22126 (output_graph, output_edge, output_node): Likewise.
22127 * src/vcg.h: Update function prototypes.
22128 * src/print_graph.c (print_graph): Open output graph file.
22129 (print_actions): Adjust.
22130 * src/files.h: Remove extern declaration.
22131 * src/files.c: Remove graph_obstack declaration.
22132 (open_files): Remove graph_obstack initialization.
22133 (output_files): Remove graph_obstack saving.
22135 2001-09-24 Marc Autret <autret_m@epita.fr>
22137 * src/files.c (compute_output_file_names): Fix.
22139 2001-09-24 Marc Autret <autret_m@epita.fr>,
22140 Akim Demaille <akim@epita.fr>
22142 * src/reader.c (reader): Remove call to free_symtab ().
22143 * src/main.c (main): Call it here.
22145 * src/conflicts.c (initialize_conflicts): Rename as...
22146 (solve_conflicts): this.
22147 * src/print.c (print_core, print_actions, print_state)
22148 (print_grammar): Dump to a file instead a `output_obstack'.
22149 (print_results): Dump `output_obstack', and then proceed with the
22151 * src/files.c (compute_output_file_names, close_files): New.
22152 (output_files): Adjust.
22153 * src/main.c (main): Adjust.
22155 2001-09-23 Marc Autret <autret_m@epita.fr>
22157 * src/files.c (compute_header_macro): Computes header macro name
22158 from spec_defines_file when given.
22160 2001-09-23 Marc Autret <autret_m@epita.fr>
22162 * src/files.c (output_files): Add default extensions.
22164 2001-09-22 Akim Demaille <akim@epita.fr>
22166 * src/conflicts.c (finalize_conflicts): Rename as...
22167 (free_conflicts): this.
22169 2001-09-22 Akim Demaille <akim@epita.fr>
22171 * src/gram.c (gram_free): Rename back as...
22173 (output_token_translations): Free `token_translations'.
22174 * src/symtab.c (free_symtab): Free the tag field.
22176 2001-09-22 Akim Demaille <akim@epita.fr>
22178 Remove `translations' as it is always set to true.
22180 * src/gram.h: Adjust.
22181 * src/reader.c (packsymbols, parse_token_decl): Adjust
22182 * src/print.c (print_grammar): Adjust.
22183 * src/output.c (output_token_translations): Adjust.
22184 * src/lex.c (lex): Adjust.
22185 * src/gram.c: Be sure the set pointers to NULL.
22186 (dummy): Rename as...
22189 2001-09-22 Akim Demaille <akim@epita.fr>
22191 * configure.in: Invoke AM_LIB_DMALLOC.
22192 * src/system.h: Use dmalloc.
22193 * src/LR0.c: Be sure to have pointers initialized to NULL.
22194 (allocate_itemsets): Allocate kernel_items only if needed.
22196 2001-09-22 Akim Demaille <akim@epita.fr>
22198 * configure.in: Bump to 1.29b.
22199 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
22200 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
22201 need xmalloc.c in calc.y.
22204 2001-09-21 Akim Demaille <akim@epita.fr>
22207 * Makefile.maint, config/config.guess, config/config.sub,
22208 * config/missing: Update from masters.
22209 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
22211 * configure.in (ALL_LINGUAS): Add `tr'.
22213 2001-09-21 Akim Demaille <akim@epita.fr>
22215 * tests/Makefile.am (package.m4): Move to...
22216 ($(srcdir)/$(TESTSUITE)): here.
22218 2001-09-20 Akim Demaille <akim@epita.fr>
22220 * src/complain.c: No longer try to be standalone: use system.h.
22221 Don't assume __STDC__ is defined to 1. Just test if it is defined.
22222 * src/complain.h: Likewise.
22223 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
22224 Remove the unused variable `n'.
22225 From Albert Chin-A-Young.
22227 2001-09-18 Marc Autret <autret_m@epita.fr>
22229 * doc/bison.1: Update.
22230 * doc/bison.texinfo (Bison Options): Update --defines and --graph
22232 (Option Cross Key): Update.
22235 2001-09-18 Marc Autret <autret_m@epita.fr>
22237 * tests/regression.at: New test (comment in %union).
22239 2001-09-18 Marc Autret <autret_m@epita.fr>
22241 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
22243 Reported by Keith Browne.
22245 2001-09-18 Marc Autret <autret_m@epita.fr>
22247 * tests/output.at: Add tests for --defines and --graph.
22249 2001-09-18 Marc Autret <autret_m@epita.fr>
22251 * tests/output.at: Removes tests of %{header,src}_extension features.
22253 2001-09-18 Akim Demaille <akim@epita.fr>
22255 * tests/Makefile.am (package.m4): New.
22256 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
22257 (_AT_CHECK_CALC_ERROR): Likewise.
22258 Factor the `, ' part of verbose error messages.
22260 2001-09-18 Marc Autret <autret_m@epita.fr>
22262 * src/getargs.c (longopts): Declare --defines and --graph as options
22263 with optional arguments.
22264 * src/files.h: Add extern declarations.
22265 * src/files.c (spec_graph_file, spec_defines_file): New.
22266 (output_files): Update.
22267 Remove CPP-outed code.
22269 2001-09-18 Marc Autret <autret_m@epita.fr>
22271 Turn off %{source,header}_extension feature.
22273 * src/files.c (compute_exts_from_gf): Update.
22274 (compute_exts_from_src): Update.
22275 (output_files): CPP-out useless code.
22276 * src/files.h: Remove {header,source}_extension extern declarations.
22277 * src/reader.c (parse_dquoted_param): CPP-out.
22278 (parse_header_extension_decl): Remove.
22279 (parse_source_extension_decl): Remove.
22280 (read_declarations): Remove cases tok_{hdrext,srcext}.
22281 * src/lex.c (percent_table): Remove {header,source}_extension entries.
22282 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
22284 2001-09-10 Akim Demaille <akim@epita.fr>
22286 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
22287 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
22288 (AT_CHECK_OUTPUT): this.
22289 Merely check ls' exit status, its output is useless.
22291 2001-09-10 Akim Demaille <akim@epita.fr>
22293 * tests/calc.at: Use m4_match.
22294 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
22296 2001-09-10 Marc Autret <autret_m@epita.fr>,
22297 Akim Demaille <akim@epita.fr>
22299 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
22301 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
22303 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
22304 * src/lex.h: Adjust prototype.
22305 (token_t): Add `tok_undef'.
22306 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
22307 (parse_percent_token): Now returns token_t.
22308 Add default statement in switch.
22309 (lex): Separate `c' as an input variable, from the token_t result
22311 (unlexed): Is a token_t.
22313 2001-09-10 Akim Demaille <akim@epita.fr>
22315 * configure.in: Bump to 1.29a.
22317 2001-09-07 Akim Demaille <akim@epita.fr>
22321 2001-08-30 Akim Demaille <akim@epita.fr>
22323 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
22324 * m4/atconfig.m4: Remove.
22325 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
22326 * tests/bison: New.
22327 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
22328 m4_if, m4_patsubst, and m4_regexp.
22329 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
22330 `input' file instead of echo.
22332 2001-08-29 Akim Demaille <akim@epita.fr>
22336 2001-08-29 Akim Demaille <akim@epita.fr>
22340 2001-08-29 Paul Eggert <eggert@twinsun.com>
22342 * src/bison.simple (yyparse): Don't take the address of an
22343 item before the start of an array, as that doesn't conform to
22346 2001-08-29 Robert Anisko <anisko_r@epita.fr>
22348 * doc/bison.texinfo (Location Tracking Calc): New node.
22350 2001-08-29 Paul Eggert <eggert@twinsun.com>
22352 * src/output.c (output): Do not define const, as this now
22353 causes more problems than it cures.
22355 2001-08-29 Akim Demaille <akim@epita.fr>
22357 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
22359 Be sure to tag the `detailmenu'.
22361 2001-08-29 Akim Demaille <akim@epita.fr>
22363 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
22364 download in a tmp dir.
22366 2001-08-28 Marc Autret <autret_m@epita.fr>
22368 * config/depcomp: New file.
22370 2001-08-28 Marc Autret <autret_m@epita.fr>
22372 * doc/bison.1 (mandoc): Adjust.
22373 From Juan Manuel Guerrero.
22375 2001-08-28 Marc Autret <autret_m@epita.fr>
22377 * src/print_graph.c (print_state): Fix.
22379 2001-08-27 Marc Autret <autret_m@epita.fr>
22381 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
22383 Echo modifications to the functions prototypes.
22384 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
22386 2001-08-27 Marc Autret <autret_m@epita.fr>
22388 * src/vcg.c: Include `xalloc.h'.
22389 (add_colorentry): New.
22390 (add_classname): New.
22391 (add_infoname): New.
22392 * src/vcg.h: Add new prototypes.
22394 2001-08-27 Akim Demaille <akim@epita.fr>
22396 * Makefile.maint: Sync. again with CVS Autoconf.
22398 2001-08-27 Akim Demaille <akim@epita.fr>
22400 * Makefile.maint: Formatting changes.
22401 (po-update, cvs-update, update): New targets.
22404 2001-08-27 Akim Demaille <akim@epita.fr>
22406 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
22407 * Makefile.maint: Sync. with CVS Autoconf.
22409 2001-08-27 Marc Autret <autret_m@epita.fr>
22411 * src/vcg.h (struct infoname_s): New.
22412 (struct colorentry_s): New.
22413 (graph_s): New fields {vertical,horizontal}_order in structure.
22414 Add `infoname' field.
22415 Add `colorentry' field;
22416 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
22417 (G_HORIZONTAL_ORDER): New.
22419 (G_COLORENTRY): New.
22420 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
22421 Add output of `infoname'.
22422 Add output of `colorentry'.
22424 2001-08-27 Marc Autret <autret_m@epita.fr>
22426 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
22427 This one shadowed a global parameter.
22429 2001-08-24 Marc Autret <autret_m@epita.fr>
22431 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
22432 instead of `unsigned'.
22433 (print_state): Do not call obstack_object_size () in obstack_grow ()
22434 to avoid macro variables shadowing.
22436 2001-08-23 Marc Autret <autret_m@epita.fr>
22438 * src/lex.c (percent_table): Typo: s/naem/name/.
22440 Normalize new options declarations.
22442 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
22444 * tests/suite.at: Exercise %header_extension and %source_extension.
22446 2001-08-16 Marc Autret <autret_m@epita.fr>
22448 * src/reader.c (parse_dquoted_param): New.
22449 (parse_header_extension_decl): Use it.
22450 (parse_source_extension_decl): Likewise.
22452 2001-08-16 Marc Autret <autret_m@epita.fr>
22454 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
22455 (get_xxxx_str): Use assert () instead of complain ().
22456 Remove return invokations in default cases.
22457 (get_decision_str): Modify default behaviour. Remove second argument.
22458 Echo modifications on calls.
22459 (output_graph): Fix.
22461 2001-08-16 Marc Autret <autret_m@epita.fr>
22463 * src/getargs.c (usage): Update with ``-g, --graph''.
22465 2001-08-16 Marc Autret <autret_m@epita.fr>
22467 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
22468 (Option Cross Key): Likewise.
22469 * doc/bison.1: Update.
22471 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
22473 * src/output.c (output_master_parser): Don't finish action_obstack.
22474 (output_parser): Don't care about the muscle action, here.
22475 (prepare): Copy the action_obstack in the action muscle.
22476 (output): Free action_obstack.
22478 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
22480 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
22481 will contain `%union' declaration.
22482 (parse_union_decl): Delete #line directive output.
22483 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
22484 informations about %union.
22485 (parse_union_decl): Copy the union_obstack in the muscle stype.
22486 * src/bison.simple: Add new #line directive.
22487 Add typdef %%stype YYSTYPE.
22489 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
22491 * src/bison.simple: Add new `#line' directive.
22493 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
22495 * src/bison.simple: New `#line' directive.
22496 * src/output.c (output_parser): Support new dynamic muscle input_line.
22498 2001-09-22 Marc Autret <autret_m@epita.fr>
22500 * src/output.c (output_master_parser): New.
22501 (output_parser): Be more re-entrant.
22503 2001-09-21 Marc Autret <autret_m@epita.fr>
22505 * src/reader.c (copy_definition, parse_union_decl): Update and use
22507 (copy_action): Likewise.
22508 Use obstack_1grow ().
22509 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
22511 2001-09-21 Marc Autret <autret_m@epita.fr>
22513 * src/options.c (option_table): Adjust.
22514 * src/lex.c (parse_percent_token): Fix.
22516 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
22518 * src/options.c (symtab.h): Include it, need by lex.h.
22520 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
22522 * src/lex.c (parse_percent_token): Change type of variable `tx', which
22523 is now an option_table_struct*.
22524 (option_strcmp): New function option_strcmp.
22525 (parse_percent_token): Call option_strcmp.
22526 * src/getargs.c (xalloc.h, options.h): Include it.
22527 (getargs): Call create_long_option_table.
22528 (getargs): Free longopts at the end of the function.
22529 (shortopts): Move in options.c.
22530 * src/options.c (create_long_option_table): New function. Convert
22531 information from option_table to option structure.
22532 * src/reader.c (options.h): Include it.
22534 * src/Makefile.am: Adjust.
22535 * src/options.c (option_table): Create from longopts and percent_table.
22536 * src/getargs.c (longopts): Delete.
22537 * src/lex.c (struct percent_table_struct): Delete.
22538 (percent_table): Delete.
22539 (options.h): Include it.
22540 * src/options.c: Create.
22541 * src/options.h: Create.
22542 Declare enum opt_access_e.
22543 Define struct option_table_struct.
22545 2001-09-20 Marc Autret <autret_m@epita.fr>
22547 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
22550 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
22552 * src/bison.simple: s/%%filename/%%skeleton.
22553 * src/muscle_tab.c (getargs.h): Include it.
22554 (muscle_init): Insert new muscle skeleton.
22556 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
22558 * src/output.c (output_parser): Delete unused variable actions_dumped.
22560 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
22562 * src/output.c (output): Delete call to reader_output_yylsp.
22563 * src/reader.c (reader): Likewise.
22564 * src/reader.h: Delete declaration of reader_output_yylsp.
22566 2001-09-02 Marc Autret <autret_m@epita.fr>
22568 * src/reader.c: Include muscle_tab.h.
22569 (parse_union_decl): Update.
22570 (parse_macro_decl): Rename parse_muscle_decl.
22571 Update to use renamed functions and variable.
22572 (read_declarations, copy_action, read_additionnal_code, : Updated
22573 with correct variables and functions names.
22574 (packsymbols, reader): Likewise.
22576 * src/reader.h (muscle_obstack): Extern declaration update.
22578 * src/output.c: Include muscle_tab.h
22579 In all functions using macro_insert, change by using muscle_insert ().
22580 (macro_obstack): Rename muscle_obstack.
22581 Echo modifications in the whole file.
22582 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
22583 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
22584 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
22586 * src/muscle_tab.h: Update double inclusion macros.
22587 (macro_entry_s): Rename muscle_entry_s.
22590 * src/muscle_tab.c: Include muscle_tab.h.
22591 Rename macro_tabble to muscle_table.
22592 (mhash1, mhash2, mcmp): Use muscle_entry.
22593 (macro_init): Rename muscle_init. Update.
22594 (macro_insert): Rename muscle_insert. Update.
22595 (macro_find): Rename muscle_find. Update.
22597 * src/main.c: Include muscle_tab.h.
22598 (main): Call muscle_init ().
22599 * src/Makefile.am (bison_SOURCES): Echo modifications.
22601 2001-09-02 Marc Autret <autret_m@epita.fr>
22603 Now the files macro_tab.[ch] are named muscle_tab.[ch].
22605 * src/muscle_tab.c, src/muscle_tab.h: Add files.
22607 2001-09-02 Marc Autret <autret_m@epita.fr>
22609 * src/macrotab.c, src/macrotab.h: Remove.
22611 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
22613 * src/reader.c (copy_guard): Use muscle to specify the `#line'
22616 2001-09-01 Marc Autret <autret_m@epita.fr>
22618 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
22619 to an explicit value to activate the feature. We do it here.
22621 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
22623 * src/output.c (prepare): Delete the `filename' muscule insertion.
22624 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
22625 (parse_union_decl): Likewise.
22626 * src/macrotab.c (macro_init): Initialize filename by infile.
22628 2001-08-31 Marc Autret <autret_m@epita.fr>
22630 * src/bison.simple (YYLSP_NEEDED): New definition.
22631 * src/output.c (prepare): Add macro insertion of `locations_flag'
22633 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
22635 * src/output.c (prepare): Delete insertion of previous muscles,
22636 and insert the `prefix' muscles.
22637 * src/macrotab.c (macro_init): Likewise.
22638 (macro_init): Initialization prefix directive by `yy'.
22639 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
22640 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
22641 yylval, yydebug, yyerror, yynerrs and yyparse.
22642 New directive `#define' to substitute yydebug, ... with option
22645 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
22647 * src/main.c (main): Standardize.
22648 * src/output.c (output_table_data, output_parser): Likewise.
22649 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
22651 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
22653 * src/reader.c (read_additionnal_code): Rename %%user_code to
22655 * src/output.c (output): Rename %%declarations to %%prologue.
22656 * src/bison.simple: Echo modifications.
22658 2001-08-31 Marc Autret <autret_m@epita.fr>
22660 * src/reader.c (readgram): CleanUp.
22661 (output_token_defines): Likewise.
22662 (packsymbols): Likewise.
22663 (reader): Likewise.
22664 * src/output.c (output): CPP-out useless code.
22666 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
22668 * src/reader.c (reader): Delete obsolete call to function
22669 output_trailers and output_headers.
22670 * src/output.h: Remove obsolete functions prototypes of output_headers
22671 and output_trailers.
22673 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
22675 * src/main.c: Include macrotab.h.
22676 * src/macrotab.h (macro_entry_s): Constify fields.
22677 Adjust functions prototypes.
22678 * src/macrotab.c (macro_insert): Constify key and value.
22679 (macro_find): Constify key.
22680 (macro_insert): Include 'xalloc.h'
22681 (macro_insert): Use XMALLOC.
22682 (macro_find): Constify return value.
22683 * src/output.c (output_table_data): Rename table to table_data.
22684 (output_parser): Constify macro_key, macro_value.
22686 2001-08-30 Marc Autret <autret_m@epita.fr>
22688 * src/reader.c (parse_skel_decl): New.
22689 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
22690 * src/lex.h (token_t): New token `tok_skel'.
22691 * src/lex.c (percent_table): Add skeleton option entry.
22694 2001-08-29 Marc Autret <autret_m@epita.fr>
22696 * src/bison.simple: Add %%user_code directive at the end.
22697 * src/reader.c (read_additionnal_code): New.
22699 * src/output.c (output_program): Remove.
22702 2001-08-28 Marc Autret <autret_m@epita.fr>
22704 * src/output.c (output_actions): Clean up.
22705 (output_gram): CPP-out useless code.
22706 * src/reader.c (reader): Clean up, CPP-out useless code.
22708 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
22710 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
22712 * src/bison.simple: Add `%%definitions'.
22714 2001-08-28 Marc Autret <autret_m@epita.fr>
22716 * config/depcomp: New file.
22718 2001-08-27 Paul Eggert <eggert@twinsun.com>
22720 * src/bison.simple (yyparse): Don't take the address of an
22721 item before the start of an array, as that doesn't conform to
22724 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
22726 * src/output.c (output): Remove the initialization of the macro
22727 obstack. It was done too late here.
22729 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
22731 (reader): Initialize the macro obstack here, since we need it to grow
22732 '%define' directives.
22734 * src/reader.h: Declare the macro obstack as extern.
22736 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
22738 * src/output.c (output_parser): Fix. Store single '%' characters in
22739 the output obstack instead of throwing them away.
22741 2001-08-27 Akim Demaille <akim@epita.fr>
22743 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
22745 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22747 * lib/Makefile.am: Adjust.
22749 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22751 * src/bison.simple: Update and add '%%' directives.
22753 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22755 * src/reader.c (reader): Remove calls to 'output_headers' and
22756 'output_trailers'. Remove some C output.
22757 (readgram): Disable a piece of code that was writing a default
22758 definition for 'YYSTYPE'.
22759 (reader_output_yylsp): Remove.
22760 (packsymbols): Output token defintions to a macro.
22761 (copy_definition): Disable C output.
22763 * src/reader.c (parse_macro_decl): New function used to parse macro
22765 (copy_string2): Put the body of copy_string into this new function.
22766 Add a parameter to let the caller choose whether he wants to copy the
22767 string delimiters or not.
22768 (copy_string): Be a simple call to copy_string2 with the last argument
22770 (read_declarations): Add case for macro definition.
22771 (copy_identifier): New.
22772 (parse_macro_decl): Read macro identifiers using copy_identifier
22775 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22777 * src/output.c (prepare): Add prefixed names.
22778 (output_parser): Output semantic actions.
22779 (output_parser): Fix bug on '%%line' directives.
22781 * src/output.c (output_headers): Remove. The C code printed by this
22782 function should now be in the skeletons.
22783 (output_trailers): Remove.
22784 (output): Disable call to 'reader_output_yylsp'.
22785 (output_rule_data): Do not output tables to the table obstack.
22787 * src/output.c: Remove some C dedicated output.
22788 Improve the use of macro and output obstacks.
22789 (output_defines): Remove.
22791 * src/output.c (output_token_translations): Associate 'translate'
22792 table with a macro. No output to the table obstack.
22793 (output_gram): Same for 'rhs' and 'prhs'.
22794 (output_stos): Same for 'stos'.
22795 (output_rule_data): Same for 'r1' and 'r2'.
22796 (token_actions): Same for 'defact'.
22797 (goto_actions): Same for 'defgoto'.
22798 (output_base): Same for 'pact' and 'pgoto'.
22799 (output_table): Same for 'table'.
22800 (output_check): Same for 'check'.
22802 * src/output.c (output_table_data): New function.
22803 (output_short_table): Remove.
22804 (output_short_or_char_table): Remove.
22806 * src/output.c (output_parser): Replace most of the skeleton copy code
22807 with something new. Skeletons are now processed character by character
22808 rather than line by line, and Bison looks for '%%' macros. This is the
22809 first step in making Bison's output process (a lot) more flexible.
22810 (output_parser): Use the macro table.
22812 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22814 * src/main.c (main): Initialize the macro table.
22816 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22818 * src/lex.c (percent_table): Add tok_define.
22819 * src/lex.h: Add tok_define.
22821 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22823 * src/macrotab.c: New file.
22824 * src/macrotab.h: New file.
22825 * src/Makefile.am: Update.
22827 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22829 * lib/hash.c: New file.
22830 * lib/hash.h: New file.
22831 * lib/Makefile.am: Update.
22833 2001-08-15 Akim Demaille <akim@epita.fr>
22837 2001-08-15 Marc Autret <autret_m@epita.fr>
22839 * src/reader.c (readgram): Indent output macro YYSTYPE.
22840 (packsymbols): Likewise.
22841 (output_token_defines): Likewise.
22842 * src/files.c: Standardize.
22843 (compute_header_macro): New.
22844 (defines_obstack_save): New. Use compute_header_macro.
22845 (output_files): Update. Use defines_obstack_save.
22847 2001-08-15 Akim Demaille <akim@epita.fr>
22849 * doc/bison.texinfo (Table of Symbols): Document
22850 YYSTACK_USE_ALLOCA.
22852 2001-08-15 Akim Demaille <akim@epita.fr>
22854 * missing: Update from CVS Automake.
22855 * config/config.guess, config/config.sub, config/texinfo.tex:
22856 Update from gnu.org.
22858 2001-08-15 Akim Demaille <akim@epita.fr>
22860 * Makefile.maint: Sync with CVS Autoconf.
22862 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
22864 * doc/bison.texinfo: Include GNU Free Documentation License from
22866 * doc/fdl.texi: Add to package.
22868 2001-08-14 Marc Autret <autret_m@epita.fr>
22870 Turn on %{source,header}_extension features.
22872 * src/lex.c (percent_table): Un-CPP out header_extension and
22874 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
22875 (compute_exts_from_src): Remove conditions. It restores priorities
22878 2001-08-14 Marc Autret <autret_m@epita.fr>
22880 * src/files.c (compute_base_names): Add extensions computing when
22881 `--file-prefix' used.
22882 Standardize function calls.
22884 2001-08-13 Marc Autret <autret_m@epita.fr>
22886 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
22887 defining it (defined but null disables alloca).
22889 2001-08-13 Marc Autret <autret_m@epita.fr>
22891 * src/bison.simple (_yy_memcpy): CPP reformat.
22893 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
22895 * tests/atconfig.in (CPPFLAGS): Fix.
22897 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
22899 * doc/bison.texinfo: Include GNU General Public License from
22901 * doc/gpl.texi: Add to package.
22903 2001-08-10 Marc Autret <autret_m@epita.fr>
22905 * src/print_graph.h: Fix.
22906 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
22908 2001-08-10 Akim Demaille <akim@epita.fr>
22910 * src/system.h: Provide default declarations for stpcpy, strndup,
22913 2001-08-10 Robert Anisko <anisko_r@epita.fr>
22915 * doc/bison.texinfo (Locations): Update @$ stuff.
22917 2001-08-09 Robert Anisko <anisko_r@epita.fr>
22919 * src/bison.simple (YYLLOC_DEFAULT): Update.
22922 2001-08-08 Marc Autret <autret_m@epita.fr>
22924 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
22925 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
22926 Reported by Fabrice Bauzac.
22928 2001-08-08 Marc Autret <autret_m@epita.fr>
22930 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
22931 * src/vcg.c (output_node): Fix.
22932 * src/vcg.h: Cleanup.
22933 * src/print_graph.c: Add comments.
22934 (node_output_size): New global variable. Simplify the formatting of
22935 the VCG graph output.
22936 (print_actions): Unused code is now used. It notifies the final state
22937 and no action states in the VCG graph. It also give the reduce actions.
22938 The `shift and goto' edges are red and the `go to state' edges are
22940 Get the current node name and node_obstack by argument.
22941 (node_obstack): New variable.
22942 (print_state): Manage node_obstack.
22943 (print_core): Use node_obstack given by argument.
22944 A node is not only computed here but in print_actions also.
22945 (print_graph): CPP out useless code instead of commenting it.
22947 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
22949 * tests/atconfig.in (CPPFLAGS): Fix.
22951 2001-08-07 Akim Demaille <akim@epita.fr>
22953 * src/print_graph.c (quote): New.
22954 (print_core): Use it.
22956 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
22958 * src/vcg.c (complain.h): Include it.
22959 Unepitaize `return' invocations.
22960 [NDEBUG] (main): Remove.
22961 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
22962 * src/files.c (open_files): Initialize graph_obstack.
22963 * src/print_graph.c (print_actions): CPP out useless code.
22964 (print_core): Don't output the last `\n' in labels.
22966 * src/files.c (output_files): Output the VCG file.
22967 * src/main.c (main): Invoke print_graph ();
22969 2001-08-06 Marc Autret <autret_m@epita.fr>
22971 Automaton VCG graph output.
22972 Using option ``-g'' or long option ``--graph'', you can generate
22973 a gram_filename.vcg file containing a VCG description of the LALR (1)
22974 automaton of your grammar.
22976 * src/main.c: Call to print_graph() function.
22977 * src/getargs.h: Update.
22978 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
22979 (graph_flag): New flag.
22980 (longopts): Update.
22981 (getargs): Add case `g'.
22982 * src/files.c (graph_obstack): New obstack struct.
22983 (open_files): Initialize new obstack.
22984 (output_files): Saves graph_obstack if required.
22985 * src/files.h (graph_obstack): New extern declaration.
22986 * src/Makefile.am: Add new source files.
22988 2001-08-06 Marc Autret <autret_m@epita.fr>
22990 * src/print_graph.c, src/print_graph.h (graph): New.
22991 * src/vcg.h: New file.
22992 * src/vcg.c: New file, VCG graph handling.
22994 2001-08-06 Marc Autret <autret_m@epita.fr>
22996 Add of %source_extension and %header_extension which specify
22997 the source or/and the header output file extension.
22999 * src/files.c (compute_base_names): Remove initialisation of
23000 src_extension and header_extension.
23001 (compute_exts_from_gf): Update.
23002 (compute_exts_from_src): Update.
23003 (output_files): Update.
23004 * src/reader.c (parse_header_extension_decl): New.
23005 (parse_source_extension_decl): New.
23006 (read_declarations): New case statements for the new tokens.
23007 * src/lex.c (percent_table): Add entries for %source_extension
23008 and %header_extension.
23009 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
23011 2001-08-06 Marc Autret <autret_m@epita.fr>
23013 * configure.in: Bump to 1.28c.
23014 * doc/bison.texinfo: Texinfo thingies.
23016 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
23018 * tests/atconfig.in (CPPFLAGS): Add.
23019 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
23021 2001-08-03 Akim Demaille <akim@epita.fr>
23025 2001-08-03 Akim Demaille <akim@epita.fr>
23027 * tests/Makefile.am (check-local): Ship testsuite.
23028 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
23029 Include `string.h'.
23031 2001-08-03 Akim Demaille <akim@epita.fr>
23033 * configure.in: Try using -Wformat when compiling.
23035 2001-08-03 Akim Demaille <akim@epita.fr>
23037 * configure.in: Bump to 1.28b.
23039 2001-08-03 Akim Demaille <akim@epita.fr>
23041 * src/complain.c: Adjust strerror_r portability issues.
23043 2001-08-03 Akim Demaille <akim@epita.fr>
23047 2001-08-03 Akim Demaille <akim@epita.fr>
23049 * src/getargs.c, src/getarg.h (skeleton)): Constify.
23050 * src/lex.c (literalchar): Avoid name clashes on `buf'.
23051 * src/getargs.c: Include complain.h.
23052 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
23053 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
23055 2001-08-03 Akim Demaille <akim@epita.fr>
23057 * src/reader.c (readgram): Display hidden chars in error messages.
23059 2001-08-03 Akim Demaille <akim@epita.fr>
23061 Update to gettext 0.10.39.
23063 2001-08-03 Akim Demaille <akim@epita.fr>
23065 * lib/strspn.c: New.
23067 2001-08-01 Marc Autret <autret_m@epita.fr>
23069 * doc/bison.texinfo: Update.
23070 * doc/bison.1 (mandoc): Update.
23071 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
23072 * src/files.c: Support output files extensions computing.
23073 (src_extension): New static variable.
23074 (header_extension): New static variable.
23075 (tr): New function.
23076 (get_extension_index): New function, gets the index of an extension
23077 filename in a string.
23078 (compute_exts_from_gf): New function, computes extensions from the
23079 grammar file extension.
23080 (compute_exts_from_src): New functions, computes extensions from the
23081 C source file extension, file given by ``-o'' option.
23082 (compute_base_names): Update.
23083 (output_files): Update.
23085 2001-08-01 Robert Anisko <anisko_r@epita.fr>
23087 * doc/bison.texi: Document @$.
23088 (Locations): New section.
23090 2001-07-18 Akim Demaille <akim@epita.fr>
23092 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
23093 * config/prev-version.txt, config/move-if-change: New.
23094 * Makefile.am: Adjust.
23096 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
23098 * src/bison.simple (yyparse): Suppress warning `comparaison
23099 between signed and unsigned'.
23101 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
23103 * src/getargs.h (raw_flag): Remove.
23104 * src/getargs.c: Die on `-r'/`--raw'.
23105 * src/lex.c (parse_percent_token): Die on `%raw'.
23106 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
23107 * tests/calc.at: Suppress test with option `--raw'.
23109 2001-07-14 Akim Demaille <akim@epita.fr>
23112 * configure.in: Require Autoconf 2.50.
23113 Update to gettext 0.10.38.
23115 2001-03-16 Akim Demaille <akim@epita.fr>
23117 * doc/bison.texinfo: ANSIfy the examples.
23119 2001-03-16 Akim Demaille <akim@epita.fr>
23121 * getargs.c (skeleton): New variable.
23122 (longopts): --skeleton is a new option.
23123 (shortopts, getargs): -S is a new option.
23124 * getargs.h: Declare skeleton.
23125 * output.c (output_parser): Use it.
23127 2001-03-16 Akim Demaille <akim@epita.fr>
23129 * m4/strerror_r.m4: New.
23130 * m4/error.m4: Run AC_FUNC_STRERROR_R.
23131 * lib/error.h, lib/error.c: Update.
23133 2001-03-16 Akim Demaille <akim@epita.fr>
23135 * src/getargs.c (longopts): Clean up.
23137 2001-02-21 Akim Demaille <akim@epita.fr>
23139 * src/reader.c (gensym): `gensym_count' is your own.
23140 Use a static buf to create the symbol name, as token_buffer is no
23143 2001-02-08 Akim Demaille <akim@epita.fr>
23145 * src/conflicts.c (conflict_report): Be sure not to append to res
23146 between two calls, which could happen if both first sprintf were
23147 skipped, but not the first cp += strlen.
23149 2001-02-08 Akim Demaille <akim@epita.fr>
23151 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
23152 New, from fileutils 4.0.37.
23153 * configure.in: Require Autoconf 2.49c. I took some time before
23154 making this decision. This is the only way out for portability
23155 issues in Bison, it would mean way too much duplicate effort to
23156 import in Bison features implemented in 2.49c since 2.13.
23157 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
23159 2001-02-02 Akim Demaille <akim@epita.fr>
23161 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
23162 * lib/xalloc.h, lib/xmalloc.c: Update.
23164 2001-01-19 Akim Demaille <akim@epita.fr>
23166 Get rid of the ad hoc handling of token_buffer in the scanner: use
23169 * src/lex.c (token_obstack): New.
23170 (init_lex): Initialize it. No longer call...
23171 (grow_token_buffer): this. Remove it.
23172 Adjust all the places which used it to use the obstack.
23174 2001-01-19 Akim Demaille <akim@epita.fr>
23176 * src/lex.h: Rename all the tokens:
23177 s/\bENDFILE\b/tok_eof/g;
23178 s/\bIDENTIFIER\b/tok_identifier/g;
23180 Let them be enums, not #define, to ease debugging.
23181 Adjust all the code.
23183 2001-01-18 Akim Demaille <akim@epita.fr>
23185 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
23186 * src/lex.c (maxtoken, grow_token_buffer): Static.
23188 2001-01-18 Akim Demaille <akim@epita.fr>
23190 Since we now use obstacks, more % directives can be enabled.
23192 * src/lex.c (percent_table): Also accept `%yacc',
23193 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
23195 Handle the actions for `%semantic_parser' and `%pure_parser' here,
23196 instead of returning a token.
23197 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
23198 * src/reader.c (read_declarations): Adjust.
23199 * src/files.c (open_files): Don't call `compute_base_names', don't
23200 compute `attrsfile' since they depend upon data which might be
23201 *in* the input file now.
23202 (output_files): Do it here.
23203 * src/output.c (output_headers): Document the fact that this patch
23204 introduces a guaranteed SEGV for semantic parsers.
23205 * doc/bison.texinfo: Document them.
23206 * tests/suite.at: Exercise these %options.
23208 2000-12-20 Akim Demaille <akim@epita.fr>
23210 Also handle the output file (--verbose) with obstacks.
23212 * files.c (foutput): Remove.
23213 (output_obstack): New.
23214 Adjust all dependencies.
23215 * src/conflicts.c: Return a string.
23216 * src/system.h (obstack_grow_string): Rename as...
23217 (obstack_sgrow): this. Be ready to work with non literals.
23218 (obstack_fgrow4): New.
23220 2000-12-20 Akim Demaille <akim@epita.fr>
23222 * src/files.c (open_files): Fix the computation of short_base_name
23223 in the case of `-o foo.tab.c'.
23225 2000-12-20 Akim Demaille <akim@epita.fr>
23227 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
23228 (copy_dollar): Now that everything uses obstacks, get rid of the
23231 2000-12-20 Akim Demaille <akim@epita.fr>
23233 * src/files.c (open_files): Actually the `.output' file is based
23234 on the short_base_name, not base_name.
23235 * tests/suite.at (Checking output file names): Adjust.
23237 2000-12-20 Akim Demaille <akim@epita.fr>
23239 * src/bison.s1: Remove, we now use directly...
23240 * src/bison.simple: this.
23241 * src/Makefile.am: Use pkgdata instead of data.
23243 2000-12-20 Akim Demaille <akim@epita.fr>
23245 * src/files.c (guard_obstack): New.
23246 (open_files): Initialize it.
23247 (output_files): Dump it...
23248 * src/files.h: Export it.
23249 * src/reader.c (copy_guard): Use it.
23251 2000-12-19 Akim Demaille <akim@epita.fr>
23253 * src/files.c (outfile, defsfile, actfile): Removed as global
23255 (open_files): Don't compute them.
23256 (output_files): Adjust.
23257 (base_name, short_base_name): Be global.
23258 Adjust dependencies.
23260 2000-12-19 Akim Demaille <akim@epita.fr>
23262 * src/files.c (strsuffix): New.
23263 (stringappend): Be just like strcat but allocate.
23264 (base_names): Eve out from open_files.
23265 Try to simplify the rather hairy computation of base_name and
23267 (open_files): Use it.
23268 * tests/suite.at (Checking output file names): New test.
23270 2000-12-19 Akim Demaille <akim@epita.fr>
23272 * src/system.h (obstack_grow_literal_string): Rename as...
23273 (obstack_grow_string): this.
23274 * src/output.c (output_parser): Recognize `%% actions' instead of
23276 * src/bison.s1: s/$/%% actions/.
23277 * src/bison.hairy: Likewise.
23279 2000-12-19 Akim Demaille <akim@epita.fr>
23281 * src/output.c (output_parser): Compute the `#line' lines when
23283 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
23284 Suggested by Hans Aberg.
23286 2000-12-19 Akim Demaille <akim@epita.fr>
23288 Let the handling of the skeleton files be local to the procedures
23291 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
23293 (fparser, open_extra_files): Remove.
23294 (open_files, output_files): Don't take care of fparser.
23295 * src/files.h: Adjust.
23296 * src/output.c (output_parser): Open and close the file to the
23298 * src/reader.c (read_declarations): When %semantic_parser, open
23301 2000-12-19 Akim Demaille <akim@epita.fr>
23303 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
23304 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
23306 2000-12-19 Akim Demaille <akim@epita.fr>
23308 * src/files.c (open_files): Yipee! We no longer need all the code
23309 looking for `/tmp' since we have no tmp file.
23311 2000-12-19 Akim Demaille <akim@epita.fr>
23313 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
23315 * src/files.c (open_files): Less dependency on MSDOS etc.
23317 2000-12-14 Akim Demaille <akim@epita.fr>
23319 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
23320 Provide a default definition.
23321 Use it when executing the default @ action.
23322 * src/reader.c (reader_output_yylsp): No longer include
23323 `timestamp' and `text' in the default YYLTYPE.
23325 2000-12-12 Akim Demaille <akim@epita.fr>
23327 * src/reader.c (copy_definition, parse_union_decl, copy_action)
23328 (copy_guard): Quote the file names.
23329 Reported by Laurent Mascherpa.
23331 2000-12-12 Akim Demaille <akim@epita.fr>
23333 * src/output.c (output_headers, output_program, output): Be sure
23334 to escape special characters when outputting filenames.
23335 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
23336 (output_headers): Don't depend on them, Use ACTSTR.
23338 2000-11-17 Akim Demaille <akim@epita.fr>
23340 * lib/obstack.h: Formatting changes.
23341 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
23342 prevents type checking.
23343 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
23344 cast the value to (void *): assigning a `foo *' to a `void *'
23346 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
23347 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
23350 2000-11-17 Akim Demaille <akim@epita.fr>
23352 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
23354 (suite.m4, regression.m4, calc.m4): these.
23355 * tests/atgeneral.m4: Update from CVS Autoconf.
23357 2000-11-17 Akim Demaille <akim@epita.fr>
23359 * tests/regression.m4 (%union and --defines): New test,
23360 demonstrating a current bug in the obstack implementation.
23362 2000-11-17 Akim Demaille <akim@epita.fr>
23364 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
23366 Use them to declare the variables which are global or local to
23369 2000-11-17 Akim Demaille <akim@epita.fr>
23371 * acconfig.h: Remove, no longer used.
23373 2000-11-07 Akim Demaille <akim@epita.fr>
23375 * src: s/Copyright (C)/Copyright/g.
23377 2000-11-07 Akim Demaille <akim@epita.fr>
23379 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
23381 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
23383 2000-11-07 Akim Demaille <akim@epita.fr>
23385 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
23386 Merge in a single CPP if/else.
23388 2000-11-07 Akim Demaille <akim@epita.fr>
23390 * src/output.c (output): Remove useless variables.
23391 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
23392 argument `data' for consistency with the prototypes.
23393 Qualify it `const'.
23394 (obstack_copy, obstack_copy0): Rename the second argument as
23395 `address' for consistency. Qualify it `const'.
23396 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
23397 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
23398 `const' their input argument (`data' or `address').
23399 Adjust the corresponding macros to include `const' in casts.
23401 2000-11-03 Akim Demaille <akim@epita.fr>
23403 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
23404 s/PFILE1/BISON_HAIRY/.
23405 Adjust dependencies.
23407 2000-11-03 Akim Demaille <akim@epita.fr>
23409 For some reason, this was not applied.
23411 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
23412 `unlink': it's no longer used.
23414 2000-11-03 Akim Demaille <akim@epita.fr>
23416 * src/files.c (skeleton_find): New function, eved out of...
23417 (open_files, open_extra_files): here.
23419 2000-11-03 Akim Demaille <akim@epita.fr>
23421 Don't use `atexit'.
23423 * src/files.c (obstack_save): New function.
23424 (done): Rename as...
23425 (output_files): this.
23426 Use `obstack_save'.
23427 * src/main.c (main): Don't use `atexit' to register `done', since
23428 it no longer has to remove tmp files, just call `output_files'
23429 when there are no errors.
23431 2000-11-02 Akim Demaille <akim@epita.fr>
23433 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
23434 `unlink': it's no longer used.
23435 * src/files.h: Formatting changes.
23437 2000-11-02 Akim Demaille <akim@epita.fr>
23439 Remove the last uses of mktemp and unlink/delete.
23441 * src/files.c (fdefines, ftable): Removed.
23442 (defines_ostack, table_obstack): New.
23443 Adjust dependencies of the former into uses of the latter.
23444 * src/output.c (output_short_or_char_table, output_short_table):
23445 Convert to using obstacks.
23446 * src/reader.c (copy_comment2): Accept one FILE * and two
23448 (output_token_defines, reader_output_yylsp): Use obstacks.
23449 * src/system.h (obstack_fgrow3): New.
23450 * po/POTFILES.in: Adjust.
23452 2000-11-01 Akim Demaille <akim@epita.fr>
23454 Change each use of `fattrs' into a use of `attrs_obstack'.
23456 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
23457 * src/files.c (fattrs): Remove.
23458 (attrs_obstack): New.
23459 Adjust all dependencies.
23460 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
23462 2000-11-01 Akim Demaille <akim@epita.fr>
23464 Introduce obstacks.
23465 Change each use of `faction' into a use of `action_obstack'.
23467 * lib/obstack.h, lib/obstack.c: New files.
23468 * src/files.c (faction): Remove.
23469 (action_obstack): New.
23470 Adjust all dependencies.
23472 2000-10-20 Akim Demaille <akim@epita.fr>
23474 * lib/quote.h (PARAMS): New macro. Use it.
23476 2000-10-16 Akim Demaille <akim@epita.fr>
23478 * src/output.c (output_short_or_char_table): New function.
23479 (output_short_table, output_token_translations): Use it.
23480 (goto_actions): Use output_short_table.
23482 2000-10-16 Akim Demaille <akim@epita.fr>
23484 * src/symtab.c (bucket_new): New function.
23487 * src/output.c (output_short_table): New argument to display the
23488 comment associated with the table.
23489 Adjust dependencies.
23490 (output_gram): Use it.
23491 (output_rule_data): Nicer output layout for YYTNAME.
23493 2000-10-16 Akim Demaille <akim@epita.fr>
23495 * src/lex.c (read_typename): New function.
23497 * src/reader.c (copy_dollar): Likewise.
23499 2000-10-16 Akim Demaille <akim@epita.fr>
23501 * src/reader.c (copy_comment2): Expect the input stream to be on
23502 the `/' which is suspected to open a comment, instead of being
23503 called after `//' or `/*' was read.
23504 (copy_comment, copy_definition, parse_union_decl, copy_action)
23505 (copy_guard): Adjust.
23507 2000-10-16 Akim Demaille <akim@epita.fr>
23509 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
23510 `read_signed_integer'.
23512 2000-10-16 Akim Demaille <akim@epita.fr>
23514 * src/reader.c (copy_dollar): New function.
23515 (copy_guard, copy_action): Use it.
23517 2000-10-16 Akim Demaille <akim@epita.fr>
23519 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
23520 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
23521 New files, from Fileutils 4.0.27.
23522 * src/main.c (printable_version): Remove.
23523 * src/lex.c, src/reader.c: Use `quote'.
23525 2000-10-04 Akim Demaille <akim@epita.fr>
23527 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
23529 2000-10-04 Akim Demaille <akim@epita.fr>
23531 * doc/bison.texinfo: Various typos spotted by Neil Booth.
23533 2000-10-04 Akim Demaille <akim@epita.fr>
23535 When a literal string is used to define two different tokens,
23536 `bison -v' segfaults.
23537 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
23539 * tests/regression.m4: New file.
23540 Include the core of the sample provided by Piotr Gackiewicz.
23541 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
23544 2000-10-04 Akim Demaille <akim@epita.fr>
23546 * src/reader.c (parse_expect_decl): Keep `count' within the size
23550 2000-10-02 Paul Eggert <eggert@twinsun.com>
23552 * bison.s1 (yyparse): Assign the default value
23553 unconditionally, to avoid a GCC warning and make the parser a
23556 2000-10-02 Akim Demaille <akim@epita.fr>
23558 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
23561 2000-10-02 Akim Demaille <akim@epita.fr>
23563 * src/derives.c, src/print.c, src/reduce.c: To ease the
23564 translation, move some `\n' out of the translated strings.
23566 2000-10-02 Akim Demaille <akim@epita.fr>
23568 The location tracking mechanism is precious for parse error
23569 messages. Nevertheless, it is enabled only when `@n' is used in
23570 the grammar, which is a different issue (you can use it in error
23571 message, but not in the grammar per se). Therefore, there should
23572 be another means to enable it.
23574 * src/getargs.c (getargs): Support `--locations'.
23575 (usage): Report it.
23576 * src/getargs.h (locationsflag): Export it.
23577 * src/lex.c (percent_table): Support `%locations'.
23578 * src/reader.c (yylsp_needed): Remove this variable, now replaced
23579 with `locationsflag'.
23580 * doc/bison.texinfo: Document `--locations' and `%locations'.
23582 * tests/calc.m4: Test it.
23584 For regularity of the names, replace each
23585 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
23586 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
23587 In addition replace each `flag' with `_flag'.
23589 2000-10-02 Akim Demaille <akim@epita.fr>
23591 Also test parse error messages, including with YYERROR_VERBOSE.
23593 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
23595 Use it to check the computations.
23596 Use it to check `nonassoc' is honored.
23597 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
23598 `--yyerror-verbose'.
23599 (_AT_CHECK_CALC): Adjust to this option.
23600 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
23602 2000-10-02 Akim Demaille <akim@epita.fr>
23604 Test also `--verbose', `--defines' and `--name-prefix'. Testing
23605 the latter demonstrates a flaw in the handling of non debugging
23606 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
23607 was used in order to simplify:
23623 unfortunately this leads to a CPP conflict when
23624 `--name-prefix=foo' is used since it produces `#define yydebug
23627 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
23628 (YYDPRINTF): New macro.
23630 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
23632 Also test `--verbose', `--defines' and `--name-prefix'.
23634 2000-10-02 Akim Demaille <akim@epita.fr>
23636 Improve the readability of the produced parsers.
23638 * src/bison.s1: Formatting changes.
23639 Improve the comment related to the `$' mark.
23640 (yydefault): Don't fall through to `yyresume': `goto' there.
23641 * src/output.c (output_parser): When the `$' is met, skip the end
23643 New variable, `number_of_dollar_signs', to check there's exactly
23644 one `$' in the parser skeleton.
23646 2000-10-02 Akim Demaille <akim@epita.fr>
23648 * lib/xstrdup.c: New file, from the fileutils.
23649 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
23650 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
23651 instead of strlen + xmalloc + strcpy.
23652 * src/symtab.c (copys): Remove, use xstrdup instead.
23654 2000-10-02 Akim Demaille <akim@epita.fr>
23656 * src/gram.h (associativity): New enum type which replaces the
23657 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
23658 `right_assoc', `left_assoc' and `non_assoc'.
23659 Adjust all dependencies.
23660 * src/reader.c: Formatting changes.
23661 (LTYPESTR): Don't define it, use it as a literal in
23662 `reader_output_yylsp'.
23663 * src/symtab.h (symbol_class): New enum type which replaces the
23664 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
23665 `sunknown', `stoken and `snterm'.
23667 2000-10-02 Akim Demaille <akim@epita.fr>
23669 * src/getargs.c (fixed_outfiles): Rename as...
23670 (yaccflag): for consistency and accuracy.
23671 Adjust dependencies.
23673 2000-10-02 Akim Demaille <akim@epita.fr>
23675 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
23676 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
23677 difficult and introduced a lot of core dump. It turns out that
23678 Bison used an implementation of `xmalloc' based on `calloc', and
23679 at various places it does depend upon the initialization to 0. I
23680 have not tried to isolate the pertinent places, and all the former
23681 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
23682 someone should address this issue.
23684 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
23685 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
23687 Adjust dependencies.
23688 * src/warshall.h: New file.
23691 2000-10-02 Akim Demaille <akim@epita.fr>
23693 Various anti-`extern in *.c' changes.
23695 * src/system.h: Include `assert.h'.
23697 2000-10-02 Akim Demaille <akim@epita.fr>
23699 * src/state.h (nstates, final_state, first_state, first_shift)
23700 (first_reduction): Move their exportation from here...
23701 * src/LR0.h: to here.
23702 Adjust dependencies.
23703 * src/getargs.c (statisticsflag): New variable.
23704 Add support for `--statistics'.
23705 Adjust dependencies.
23707 Remove a lot of now useless `extern' statements in most files.
23709 2000-10-02 Akim Demaille <akim@epita.fr>
23711 * src/LR0.h: New file.
23714 2000-10-02 Akim Demaille <akim@epita.fr>
23716 * src/print.h: New file.
23718 * src/print.c: Formatting and ordering changes.
23719 (verbose, terse): Replace with...
23720 (print_results): this new function.
23721 Adjust dependencies.
23723 2000-10-02 Akim Demaille <akim@epita.fr>
23725 * src/conflicts.c (conflict_report): New function.
23726 (conflict_log, verbose_conflict_log): Replace with...
23727 (print_conflicts): this function.
23728 Adjust dependencies.
23729 * src/conflicts.h: New file.
23730 Propagate its inclusion.
23732 2000-10-02 Akim Demaille <akim@epita.fr>
23734 * src/nullable.h: New file.
23735 Propagate its inclusion.
23736 * src/nullable.c: Formatting changes.
23738 2000-10-02 Akim Demaille <akim@epita.fr>
23740 * src/reduce.h: New file.
23741 Propagate its inclusion.
23742 * src/reduce.c: Topological sort and other formatting changes.
23743 (bool, TRUE, FALSE): Move their definition to...
23744 * src/system.h: here.
23746 2000-10-02 Akim Demaille <akim@epita.fr>
23748 * src/files.c: Formatting changes.
23749 (tryopen, tryclose, openfiles): Rename as...
23750 (xfopen, xfclose, open_files): this.
23751 (stringappend): static.
23752 * src/files.h: Complete the list of exported symbols.
23755 2000-10-02 Akim Demaille <akim@epita.fr>
23757 * src/reader.h: New file.
23758 Propagate its use instead of tedious list of `extern' and
23760 * src/reader.c: Formatting changes, topological sort,
23763 2000-10-02 Akim Demaille <akim@epita.fr>
23765 * src/lex.h: Prototype `lex.c' exported functions.
23766 * src/reader.c: Adjust.
23767 * src/lex.c: Formatting changes.
23768 (safegetc): Rename as...
23771 2000-10-02 Akim Demaille <akim@epita.fr>
23773 * src/lalr.h: New file.
23774 Propagate its inclusion instead of prototypes and `extern'.
23775 * src/lalr.c: Formatting changes, topological sorting etc.
23777 2000-10-02 Akim Demaille <akim@epita.fr>
23779 * src/output.c (token_actions): Introduce a temporary array,
23780 YYDEFACT, that makes it possible for this function to use
23781 output_short_table.
23783 2000-10-02 Akim Demaille <akim@epita.fr>
23785 `user_toknums' is output as a `short[]' in `output.c', while it is
23786 defined as a `int[]' in `reader.c'. For consistency with the
23787 other output tables, `user_toknums' is now defined as a table of
23790 * src/reader.c (user_toknums): Be a short table instead of an int
23792 Adjust dependencies.
23794 Factor the short table outputs.
23796 * src/output.c (output_short_table): New function.
23797 * src/output.c (output_gram, output_stos, output_rule_data)
23798 (output_base, output_table, output_check): Use it.
23800 2000-10-02 Akim Demaille <akim@epita.fr>
23802 * src/output.c (output): Topological sort of the functions, in
23803 order to get rid of the `static' prototypes.
23804 No longer use `register'.
23805 * src/output.h: New file.
23806 Propagate its inclusion in files explicitly prototyping functions
23809 2000-09-21 Akim Demaille <akim@epita.fr>
23811 * src/atgeneral.m4: Update from Autoconf.
23813 2000-09-21 Akim Demaille <akim@epita.fr>
23815 * src/closure.h: New file.
23816 * src/closure.c: Formatting changes, topological sort over the
23817 functions, use of closure.h.
23818 (initialize_closure, finalize_closure): Rename as...
23819 (new_closure, free_closure): these. Adjust dependencies.
23820 * src/LR0.c: Formatting changes, topological sort, use of
23822 (initialize_states): Rename as...
23823 (new_states): this.
23824 * src/Makefile.am (noinst_HEADERS): Adjust.
23826 2000-09-20 Akim Demaille <akim@epita.fr>
23828 * src/acconfig.h: Don't protect config.h against multiple
23830 Don't define PARAMS.
23831 * src/system.h: Define PARAMS.
23832 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
23833 purpose of config.h. system.h must not try to fix wrong
23834 definitions in config.h.
23836 2000-09-20 Akim Demaille <akim@epita.fr>
23838 * src/derives.h: New file.
23839 * src/main.c, src/derives.h: Use it.
23840 Formatting changes.
23841 * src/Makefile.am (noinst_HEADERS): Adjust.
23843 2000-09-20 Akim Demaille <akim@epita.fr>
23845 * tests/atgeneral.m4: Update from Autoconf.
23846 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
23847 (AT_CHECK_CALC): New macros.
23848 Use these macros to test bison with options `', `--raw',
23849 `--debug', `--yacc', `--yacc --debug'.
23851 2000-09-19 Akim Demaille <akim@epita.fr>
23853 * src/output.c: Formatting changes.
23854 * src/machine.h: Remove, leaving its contents in...
23855 * src/system.h: here.
23857 Adjust all dependencies on stdio.h and machine.h.
23858 * src/getargs.h: New file.
23859 Let all `extern' declarations about getargs.c be replaced with
23860 inclusion of `getargs.h'.
23861 * src/Makefile.am (noinst_HEADERS): Adjust.
23863 * tests/calc.m4 (yyin): Be initialized in main, not on the global
23865 (yyerror): Returns void, not int.
23866 * doc/bison.texinfo: Formatting changes.
23868 2000-09-19 Akim Demaille <akim@epita.fr>
23870 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
23873 2000-09-18 Akim Demaille <akim@epita.fr>
23875 * configure.in: Append WARNING_CFLAGS to CFLAGS.
23876 * src/Makefile.am (INCLUDES): Don't.
23877 Be ready to fetch headers in lib/.
23879 2000-09-18 Akim Demaille <akim@epita.fr>
23881 * doc/bison.texinfo: Update the copyright.
23882 ANSIfy and GNUify the examples.
23883 Remove the old menu.
23885 2000-09-18 Akim Demaille <akim@epita.fr>
23887 First set of tests: use the `calc' example from the documentation.
23889 * src/bison.s1 (yyparse): Condition the code using `yytname' which
23890 is defined only when YYDEBUG is.
23891 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
23892 * src/files.c (tryopen, tryclose): Formatting changes.
23893 Move to the top and be static.
23894 * src/reader.c (read_signed_integer): Likewise.
23895 * tests/calc.m4: New file.
23896 * Makefile.am, suite.m4: Adjust.
23897 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
23899 2000-09-18 Akim Demaille <akim@epita.fr>
23901 Add support for an Autotest test suite for Bison.
23903 * m4/m4.m4, m4/atconfig.m4: New files.
23904 * m4/Makefile.am (EXTRA_DIST): Adjust.
23905 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
23907 * src/getargs.c: Display a more standard --version message.
23908 * src/reader.c (reader): Formatting changes.
23909 No longer depend upon VERSION_STRING.
23910 * configure.in: No longer use `dnl'.
23911 Set up the test suite and the new directory `tests/.
23912 (VERSION_STRING): Remove.
23914 2000-04-14 Akim Demaille <akim@epita.fr>
23916 * src/reader.c (copy_comment2): New function, same as former
23917 `copy_comment', but outputs into two FILE *.
23918 (copy_comment): Use it.
23919 (parse_union_decl): Use it.
23920 (get_type, parse_start_decl): Use the same `invalid' message.
23921 (parse_start_decl, parse_union_decl): Use the same `multiple'
23923 (parse_union_decl, copy_guard, copy_action): Use the same
23924 `unmatched' message.
23925 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
23927 2000-03-31 Akim Demaille <akim@epita.fr>
23929 * src/files.c (tryopen, tryclose): Move to the top.
23932 2000-03-31 Akim Demaille <akim@epita.fr>
23934 * src/main.c (main): Don't call `done', exit does it.
23936 2000-03-31 Akim Demaille <akim@epita.fr>
23938 * allocate.c: s/return (foo)/return foo/.
23939 * lalr.c: Likewise.
23941 * output.c: Likewise.
23942 * reader.c: Likewise.
23943 * symtab.c: Likewise.
23944 * vmsgetargs.c: Likewise.
23946 2000-03-31 Akim Demaille <akim@epita.fr>
23948 Clean up the error reporting functions.
23950 * src/report.c: New file.
23951 * src/report.h: Likewise.
23952 * src/Makefile.am: Adjust.
23953 * m4/error.m4: New file.
23954 * m4/Makefile.am: Adjust.
23955 * configure.in (jm_PREREQ_ERROR): Call it.
23956 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
23958 (fatal, fatals): Remove. All callers use complain.c::fatal.
23959 (warn, warni, warns, warnss, warnss): Remove. All callers use
23960 complain.c::complain.
23961 (toomany): Remove, use fatal instead.
23962 * src/files.c (done): No argument, use complain_message_count.
23963 * src/main.c (main): Register `done' to `atexit'.
23965 * src/getargs.c (usage): More `fputs', less `fprintf'.
23967 2000-03-28 Akim Demaille <akim@epita.fr>
23969 * lib/: New directory.
23970 * Makefile.am (SUBDIRS): Adjust.
23971 * configure.in: Adjust.
23972 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
23974 * src/alloca.c: Moved to lib/.
23975 * src/getopt.c: Likewise.
23976 * src/getopt1.c: Likewise.
23977 * src/getopt.h: Likewise.
23978 * src/ansi2knr.c: Likewise.
23979 * src/ansi2knr.1: Likewise.
23980 * src/Makefile.am: Adjust.
23981 * lib/Makefile.am: New file.
23983 2000-03-28 Akim Demaille <akim@epita.fr>
23985 * src/getargs.c (usage): Refresh the help message.
23987 2000-03-17 Akim Demaille <akim@epita.fr>
23989 * src/getopt1.c: Updated from textutils 2.0e
23990 * src/getopt.c: Likewise.
23991 * src/getopt.h: Likewise.
23993 2000-03-17 Akim Demaille <akim@epita.fr>
23995 * src/Makefile.am (bison.simple): Fix the awk program: quote only
23996 the file name, not the whole `#line LINE FILE'.
23998 2000-03-17 Akim Demaille <akim@epita.fr>
24000 On syntax errors, report the token on which we choked.
24002 * src/bison.s1 (yyparse): In the label yyerrlab, when
24003 YYERROR_VERBOSE, add yychar in msg.
24005 2000-03-17 Akim Demaille <akim@epita.fr>
24007 * src/reader.c (copy_at): New function.
24008 (copy_guard): Use it.
24009 (copy_action): Use it.
24011 2000-03-17 Akim Demaille <akim@epita.fr>
24013 Be kind to translators, save some useless translations.
24015 * src/main.c (banner): New function.
24016 (fatal_banner): Use it.
24017 (warn_banner): Use it.
24019 2000-03-17 Akim Demaille <akim@epita.fr>
24021 * src/reader.c (copy_definition): Use copy_string and
24022 copy_comment. Removed now unused `match', `ended',
24024 (copy_comment, copy_string): Moved, to be visible from
24027 2000-03-17 Akim Demaille <akim@epita.fr>
24029 * src/reader.c (copy_string): Declare `static inline'. No
24030 problems with inline, since it is checked by configure.
24031 (copy_comment): Likewise.
24033 2000-03-17 Akim Demaille <akim@epita.fr>
24035 * src/reader.c (packsymbols): Formatting changes.
24037 2000-03-17 Akim Demaille <akim@epita.fr>
24039 * src/reader.c (copy_comment): New function, factored out from:
24040 (copy_action): Use it. Removed now unused `match', `ended',
24042 (copy_guard): Likewise.
24044 2000-03-17 Akim Demaille <akim@epita.fr>
24046 * src/reader.c (copy_string): New function, factored out from:
24047 (copy_action): Use it.
24048 (copy_guard): Likewise.
24050 2000-03-17 Akim Demaille <akim@epita.fr>
24052 Change the handling of @s so that they behave exactly like $s.
24053 There is now a pseudo variable @$ (readble and writable), location
24054 of the lhs of the rule (by default ranging from the location of
24055 the first symbol of the rhs, to the location of the last symbol,
24056 or, if the rhs is empty, YYLLOC).
24058 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
24060 (yyparse): When providing a default semantic action, provide a
24061 default location action.
24062 (after the $): No longer change `*YYLSP', just stack YYLOC the
24063 same way you stack YYVAL.
24064 * src/reader.c (read_declarations): Use warns.
24065 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
24066 (copy_action, case '@'): Likewise.
24067 Use a standard error message, to save useless work from
24070 2000-03-17 Akim Demaille <akim@epita.fr>
24072 * src/bison.s1: Formatting and cosmetics changes.
24073 * src/reader.c: Likewise.
24074 Update the Copyright notice.
24076 2000-03-17 Akim Demaille <akim@epita.fr>
24078 * src/bison.s1 (#line): All set to `#line' only, since the
24079 Makefile now handles them.
24081 2000-03-16 Akim Demaille <akim@epita.fr>
24083 * src/output.c (output_rule_data): Output the documentation of
24084 some of the tables.
24085 (Copyright notice): Update.
24086 Formatting changes.
24088 2000-03-16 Akim Demaille <akim@epita.fr>
24090 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
24091 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
24092 One `#if YYDEBUG' remains, since it uses variables which are
24093 defined only if `YYDEBUG != 0'.
24095 2000-03-16 Akim Demaille <akim@epita.fr>
24097 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
24098 and related variables so that the similarities are highlighted.
24100 2000-03-16 Akim Demaille <akim@epita.fr>
24102 * src/bison.s1: Properly indent CPP directives.
24104 2000-03-16 Akim Demaille <akim@epita.fr>
24106 * src/bison.s1: Properly indent the `alloca' CPP section.
24108 2000-03-16 Akim Demaille <akim@epita.fr>
24110 Do not hard code values of directories in `configure.in'.
24111 Update the `configure' tool chain.
24113 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
24115 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
24116 (AC_OUTPUT): Add m4/Makefile.
24117 Bump to bison 1.28a, 1.29 has never been released.
24118 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
24119 handled via src/Makefile.am.
24120 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
24121 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
24123 * Makefile.am (SUBDIRS): Add m4.
24124 (ACLOCAL_AM_FLAGS): New variable.
24125 (AUTOMAKE_OPTIONS): Add check-news.
24126 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
24127 the proper line number and file name.
24128 (DEFS): Propagate the location of bison library files and of the
24130 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
24132 * acinclude.m4: Remove, replaced by the directory m4.
24133 * m4/Makefile.am (EXTRA_DIST): New variable.
24134 * m4/gettext.m4: New file, from the fileutils.
24135 * m4/lcmessage.m4: Likewise
24136 * m4/progtest.m4: Likewise.
24137 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
24139 2000-03-10 Akim Demaille <akim@epita.fr>
24142 Formatting changes of various comments.
24143 Respect the GNU coding standards at various places.
24144 Don't use `_()' when no translation is needed.
24146 1999-12-13 Jesse Thilo <jthilo@gnu.org>
24149 OS/2 honors TMPDIR environment variable.
24151 1999-12-13 Jesse Thilo <jthilo@gnu.org>
24153 * doc/bison.texinfo: Tweaked spelling and grammar.
24155 Removed reference to price of printed copy.
24156 Mention BISON_SIMPLE and BISON_HAIRY.
24158 1999-12-13 Jesse Thilo <jthilo@gnu.org>
24160 * configure.in, NEWS:
24161 Bison 1.29 released.
24163 1999-10-27 Jesse Thilo <jthilo@gnu.org>
24165 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
24166 Added reference card.
24168 1999-07-26 Jesse Thilo <jthilo@gnu.org>
24170 * po/ru.po: Added Russian translation.
24172 1999-07-26 Jesse Thilo <jthilo@gnu.org>
24174 * configure.in: Added Russian translation.
24176 1999-07-06 Jesse Thilo <jthilo@gnu.org>
24178 * configure.in, NEWS, README:
24179 Released version 1.28.
24181 1999-06-14 Jesse Thilo <jthilo@gnu.org>
24184 Squashed redefinition warning on some systems.
24186 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
24187 Have configure build version string instead of relying on ANSI string
24190 1999-06-14 Jesse Thilo <jthilo@gnu.org>
24192 * po/POTFILES.in: Got rid of version.c.
24194 1999-06-14 Jesse Thilo <jthilo@gnu.org>
24196 * acconfig.h, configure.in:
24197 Have configure build version string instead of relying on ANSI string
24200 1999-06-08 Jesse Thilo <jthilo@gnu.org>
24203 Dropped mention of `+' for long-named options.
24205 1999-05-30 Jesse Thilo <jthilo@gnu.org>
24207 * src/files.c: Added <unistd.h> for unlink().
24209 * src/Makefile.am, src/system.h:
24212 1999-05-30 Jesse Thilo <jthilo@gnu.org>
24214 * README: Added a FAQ list.
24216 * configure.in, acconfig.h:
24219 1999-05-30 Jesse Thilo <jthilo@gnu.org>
24221 * doc/FAQ, doc/Makefile.am:
24224 1999-05-19 Jesse Thilo <jthilo@gnu.org>
24226 * src/alloc.h, src/symtab.h, src/version.c:
24227 Protected inclusion of "config.h" with HAVE_CONFIG_H.
24229 1999-04-18 Jesse Thilo <jthilo@gnu.org>
24231 * src/.cvsignore, src/Makefile.am:
24232 Reorganized: sources in `src', documentation in `doc'.
24234 * src/lex.c (literalchar):
24235 fixed the code for escaping double quotes (thanks
24238 1999-04-18 Jesse Thilo <jthilo@gnu.org>
24240 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
24241 Adjusted paths to reflect directory reorganization.
24243 1999-04-18 Jesse Thilo <jthilo@gnu.org>
24245 * doc/.cvsignore, doc/Makefile.am:
24246 Reorganized: sources in `src', documentation in `doc'.
24248 1999-04-18 Jesse Thilo <jthilo@gnu.org>
24251 Updated AC_INIT file to reflect directory reorganization.
24253 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
24254 Reorganized: sources in `src', documentation in `doc'.
24256 1999-04-13 Jesse Thilo <jthilo@gnu.org>
24259 Don't declare calloc() and realloc() if not necessary.
24261 1999-04-13 Jesse Thilo <jthilo@gnu.org>
24263 * configure.in, acconfig.h, acinclude.m4:
24264 Don't declare calloc() and realloc() if not necessary.
24266 1999-03-23 Jesse Thilo <jthilo@gnu.org>
24268 * po/.cvsignore: Added i18n support.
24270 1999-03-23 Jesse Thilo <jthilo@gnu.org>
24272 * acconfig.h, configure.in, Makefile.am:
24273 Added i18n support.
24275 1999-03-22 Jesse Thilo <jthilo@gnu.org>
24277 * src/bison.s1: Fixed #line numbers.
24279 1999-03-15 Jesse Thilo <jthilo@gnu.org>
24281 * po/es.po, po/fr.po, po/nl.po, po/de.po:
24282 Added PO files from Translation Project.
24284 1999-03-03 Jesse Thilo <jthilo@gnu.org>
24287 Added support for non-ANSI compilers (ansi2knr).
24289 1999-02-16 Jesse Thilo <jthilo@gnu.org>
24291 * configure.in: Bumped version number to 1.27.
24294 Added `bison.simple' to list of files removed by `make distclean'.
24296 1999-02-12 Jesse Thilo <jthilo@gnu.org>
24298 * src/files.c, src/files.h:
24299 Defined locations of parser files in config.h instead of Makefile.
24301 1999-02-12 Jesse Thilo <jthilo@gnu.org>
24303 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
24304 Defined locations of parser files in config.h instead of Makefile.
24306 1999-02-09 Jesse Thilo <jthilo@gnu.org>
24309 Removed inappropriate use of $< macro.
24311 1999-02-05 Jesse Thilo <jthilo@gnu.org>
24313 * po/Makefile.in.in, po/POTFILES.in:
24314 Add `po' directory skeleton.
24316 1999-01-27 Jesse Thilo <jthilo@gnu.org>
24318 * README: Document help-bison list.
24320 * configure.in: Add check for mkstemp().
24322 1999-01-20 Jesse Thilo <jthilo@gnu.org>
24324 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
24325 Hush a few compiler warnings.
24328 Add tryclose(), which verifies that fclose was successful.
24329 Hush a couple of compiler warnings.
24331 1999-01-20 Jesse Thilo <jthilo@gnu.org>
24333 * Makefile.am, OChangeLog:
24334 ChangeLog is now automatically generated. Include the old version as
24337 1999-01-14 Jesse Thilo <jthilo@gnu.org>
24339 * 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:
24340 Update FSF address.
24342 1999-01-14 Jesse Thilo <jthilo@gnu.org>
24344 * doc/bison.texinfo: Fix formatting glitch.
24346 * doc/bison.texinfo: Update FSF address.
24348 1999-01-14 Jesse Thilo <jthilo@gnu.org>
24350 * acconfig.h: Update FSF address.
24352 1999-01-08 Jesse Thilo <jthilo@gnu.org>
24355 Don't define PACKAGE here, since config.h defines it.
24357 1998-12-30 Jesse Thilo <jthilo@gnu.org>
24359 * src/reader.c: Update copyright date.
24362 Ditch sprintf to statically-sized buffers in fatal/warn functions in
24363 favor of output directly to stderr (avoids buffer overruns).
24365 * src/reader.c: Some checks for premature EOF.
24367 * 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:
24368 Use prototypes if the compiler understands them.
24370 * src/files.c: Honor TMPDIR on Unix hosts.
24371 Use prototypes if the compiler understands them.
24374 Fix a couple of buffer overrun bugs.
24375 Use prototypes if the compiler understands them.
24377 * src/system.h: Include unistd.h and ctype.h.
24378 Use #ifdef instead of #if for NLS symbols.
24380 1998-12-30 Jesse Thilo <jthilo@gnu.org>
24382 * doc/bison.texinfo:
24383 Delete comment "consider using @set for edition number, etc..." since
24384 we now are doing so.
24386 1998-12-30 Jesse Thilo <jthilo@gnu.org>
24389 Use prototypes if the compiler understands them.
24391 * NEWS: Document 1.26 highlights.
24393 * Makefile.am: Require Automake 1.3 or later.
24396 Use prototypes if the compiler understands them.
24398 1998-12-29 Jesse Thilo <jthilo@gnu.org>
24401 Use VERSION symbol from automake for version number.
24403 1998-12-29 Jesse Thilo <jthilo@gnu.org>
24405 * acconfig.h, configure.in, version.cin:
24406 Use VERSION symbol from automake for version number.
24408 1998-11-28 Jesse Thilo <jthilo@gnu.org>
24411 Distribute original version of simple parser (bison.s1), not built
24412 version (bison.simple).
24414 1998-11-28 Jesse Thilo <jthilo@gnu.org>
24416 * doc/bison.texinfo: Add info dir entry.
24418 * doc/bison.texinfo:
24419 Let automake put version number into documentation.
24421 1998-11-26 Jesse Thilo <jthilo@gnu.org>
24423 * src/bison.cld, src/build.com, src/vmshlp.mar:
24424 Add non-RCS files from /gd/gnu/bison.
24426 1998-11-26 Jesse Thilo <jthilo@gnu.org>
24429 Document the BISON_HAIRY and BISON_SIMPLE variables.
24431 1998-11-25 Jesse Thilo <jthilo@gnu.org>
24433 * src/version.c: Build version.c automatically.
24436 Fix token numbering (used to start at 258, not 257).
24438 * src/system.h: Include config.h.
24440 * src/getargs.c: Update bug report address.
24442 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
24443 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
24445 1998-11-25 Jesse Thilo <jthilo@gnu.org>
24448 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
24450 * configure.in, version.cin:
24451 Build version.c automatically.
24453 * AUTHORS: Add AUTHORS file.
24455 * README: Update bug report address.
24458 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
24460 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
24461 Add automake stuff.
24463 1998-11-25 Jesse Thilo <jthilo@gnu.org>
24465 * doc/bison.texinfo: Clean up some formatting.
24467 1998-05-05 Richard Stallman <rms@gnu.org>
24469 * doc/bison.texinfo:
24470 Explain better why to make a pure parser.
24472 1998-01-05 Richard Stallman <rms@gnu.org>
24474 * src/files.c (openfiles):
24475 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
24476 find a temporary directory, if possible. Do not unlink files while
24479 1997-08-25 Richard Stallman <rms@gnu.org>
24481 * src/reader.c (stack_offset;):
24482 Change some warni to warns.
24484 * src/lex.c (literalchar): Use warns, not warni.
24486 1997-06-28 Richard Stallman <rms@gnu.org>
24488 * src/bison.s1: Add a Bison version comment.
24490 * src/main.c (fatal, warn, berror):
24493 1997-06-28 Richard Stallman <rms@gnu.org>
24495 * Makefile.in (bison_version): New variable.
24496 (dist): Use that variable.
24497 (bison.s1): Substitute the Bison version into bison.simple.
24499 * bison.simple: Add a Bison version comment.
24501 1997-06-18 Richard Stallman <rms@gnu.org>
24503 * src/main.c (fatal, warn, berror):
24504 Make error messages standard.
24505 (toomany): Improve error message text.
24507 * 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:
24508 new.h renamed to alloc.h.
24510 1997-06-18 Richard Stallman <rms@gnu.org>
24512 * Makefile.in: new.h renamed to alloc.h.
24514 1997-05-24 Richard Stallman <rms@gnu.org>
24516 * src/lex.c (literalchar):
24517 Fix the code for escaping \, " and '.
24519 (lex): Avoid trouble when there are many chars
24520 to discard in a char literal with just several chars in it.
24522 1997-05-17 Richard Stallman <rms@gnu.org>
24525 Use malloc, if using alloca is troublesome.
24526 (YYSTACK_USE_ALLOCA): New flag macro.
24527 Define it for some systems and compilers.
24528 (YYSTACK_ALLOC): New macro.
24529 (yyparse): Use YYSTACK_ALLOC to allocate stack.
24530 If it was malloc'd, free it.
24532 1997-05-17 Richard Stallman <rms@gnu.org>
24535 Use malloc, if using alloca is troublesome.
24536 (YYSTACK_USE_ALLOCA): New flag macro.
24537 Define it for some systems and compilers.
24538 (YYSTACK_ALLOC): New macro.
24539 (yyparse): Use YYSTACK_ALLOC to allocate stack.
24540 If it was malloc'd, free it.
24542 1997-04-23 Richard Stallman <rms@gnu.org>
24545 (alloca) [__hpux]: Always define as __builtin_alloca.
24547 1997-04-23 Richard Stallman <rms@gnu.org>
24550 (alloca) [__hpux]: Always define as __builtin_alloca.
24552 1997-04-22 Richard Stallman <rms@gnu.org>
24555 [__hpux]: Include alloca.h (right for HPUX 10)
24556 instead of declaring alloca (right for HPUX 9).
24558 * src/bison.s1 (__yy_memcpy):
24559 Declare arg `count' as unsigned int.
24560 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
24562 1997-04-22 Richard Stallman <rms@gnu.org>
24565 [__hpux]: Include alloca.h (right for HPUX 10)
24566 instead of declaring alloca (right for HPUX 9).
24568 * bison.simple (__yy_memcpy):
24569 Declare arg `count' as unsigned int.
24570 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
24572 1997-01-03 Richard Stallman <rms@gnu.org>
24574 * src/allocate.c: [__STDC__ or _MSC_VER]:
24575 Declare calloc and realloc to return void *.
24577 1997-01-02 Richard Stallman <rms@gnu.org>
24580 [_MSC_VER]: Include stdlib.h and process.h.
24581 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
24583 * src/main.c (main): Return FAILURE as a value.
24584 (printable_version): Declare arg as int, not char.
24586 1997-01-02 Richard Stallman <rms@gnu.org>
24588 * Makefile.in (dist):
24589 Explicitly check for symlinks, and copy them.
24591 1996-12-19 Richard Stallman <rms@gnu.org>
24594 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
24596 1996-12-18 Paul Eggert <eggert@gnu.org>
24598 * src/bison.s1 (yyparse):
24599 If __GNUC__ and YYPARSE_PARAM are both defined,
24600 declare yyparse to have a void * argument.
24602 1996-12-18 Paul Eggert <eggert@gnu.org>
24604 * bison.simple (yyparse):
24605 If __GNUC__ and YYPARSE_PARAM are both defined,
24606 declare yyparse to have a void * argument.
24608 1996-12-17 Richard Stallman <rms@gnu.org>
24610 * src/reduce.c (nbits): Add some casts.
24612 1996-08-12 Richard Stallman <rms@gnu.org>
24614 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
24616 1996-08-12 Richard Stallman <rms@gnu.org>
24618 * bison.simple: Test _MSDOS as well as _MSDOS_.
24620 1996-07-31 Richard Stallman <rms@gnu.org>
24623 [__sun && __i386]: Include alloca.h.
24625 1996-07-31 Richard Stallman <rms@gnu.org>
24628 [__sun && __i386]: Include alloca.h.
24630 1996-07-30 Richard Stallman <rms@gnu.org>
24632 * src/bison.s1: Comment change.
24634 * src/bison.s1: Test _MSDOS_, not MSDOS.
24636 1996-07-30 Richard Stallman <rms@gnu.org>
24638 * bison.simple: Comment change.
24640 * bison.simple: Test _MSDOS_, not MSDOS.
24642 1996-06-01 Richard Stallman <rms@gnu.org>
24644 * 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:
24645 Insert `_' macro around many string constants.
24648 Insert `_' macro around many string constants.
24650 (main): Call setlocale, bindtextdomain and textdomain.
24652 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
24653 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
24654 [ENABLE_NLS]: Include libintl.h.
24655 [ENABLE_NLS] (gettext): Define.
24656 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
24657 (N_, PACKAGE, LOCALEDIR): New macros.
24659 1996-06-01 Richard Stallman <rms@gnu.org>
24661 * POTFILES.in: New file.
24663 * Makefile.in (allocate.o):
24664 Define target explicitly.
24666 * Makefile.in (CFLAGS): Set to @CFLAGS@.
24667 (LDFLAGS): Set to @LDFLAGS@.
24668 (configure): Run autoconf only if preceding `cd' succeeds.
24669 (bison.s1): Redirect output to temporary file then move the
24670 temporary to the target, rather than redirecting directly to bison.s1.
24671 (clean): Remove config.status and config.log.
24672 (distclean): Don't remove config.status here.
24674 1996-05-12 Richard Stallman <rms@gnu.org>
24677 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
24679 1996-05-12 Richard Stallman <rms@gnu.org>
24682 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
24684 1996-05-11 Richard Stallman <rms@gnu.org>
24686 * src/bison.s1 (__yy_memcpy):
24687 Really reorder the args, as was supposedly done on Feb 14 1995.
24688 (yyparse): Calls changed accordingly.
24690 1996-05-11 Richard Stallman <rms@gnu.org>
24692 * Makefile.in (dist): Don't use $(srcdir).
24694 * bison.simple (__yy_memcpy):
24695 Really reorder the args, as was supposedly done on Feb 14 1995.
24696 (yyparse): Calls changed accordingly.
24698 1996-01-27 Richard Stallman <rms@gnu.org>
24700 * src/output.c (output_rule_data):
24701 Test YYERROR_VERBOSE in the conditional
24702 around the definition of ttyname.
24704 1995-12-29 Richard Stallman <rms@gnu.org>
24707 Fix line numbers in #line commands.
24709 1995-12-29 Richard Stallman <rms@gnu.org>
24712 Fix line numbers in #line commands.
24714 1995-12-27 Richard Stallman <rms@gnu.org>
24716 * src/bison.s1 (YYPARSE_PARAM_DECL):
24717 In C++, make it always null.
24718 (YYPARSE_PARAM_ARG): New macro.
24719 (yyparse): Use YYPARSE_PARAM_ARG.
24721 1995-12-27 Richard Stallman <rms@gnu.org>
24723 * bison.simple (YYPARSE_PARAM_DECL):
24724 In C++, make it always null.
24725 (YYPARSE_PARAM_ARG): New macro.
24726 (yyparse): Use YYPARSE_PARAM_ARG.
24728 1995-11-29 Richard Stallman <rms@gnu.org>
24730 * doc/bison.texinfo:
24731 Describe literal string tokens, %raw, %no_lines, %token_table.
24733 1995-11-29 Daniel Hagerty <hag@gnu.org>
24735 * doc/bison.texinfo: Fixed update date
24737 1995-10-16 Richard Stallman <rms@gnu.org>
24739 * src/version.c: Version 1.25.
24741 1995-10-16 Richard Stallman <rms@gnu.org>
24743 * NEWS: *** empty log message ***
24745 1995-10-16 Richard Stallman <rms@gnu.org>
24747 * doc/bison.1, doc/bison.rnh:
24750 1995-10-15 Richard Stallman <rms@gnu.org>
24752 * src/vmsgetargs.c, src/getargs.c:
24753 Added -n, -k, and -raw switches.
24754 (noparserflag, toknumflag, rawtoknumflag): New variables.
24756 * src/symtab.h (SALIAS):
24757 New #define for adding aliases to %token.
24758 (struct bucket): Added `alias' field.
24760 * src/reduce.c (reduce_grammar):
24761 Revise error message.
24762 (print_notices): Remove final `.' from error message.
24764 * src/reader.c (reader_output_yylsp):
24766 (readgram): Use `#if 0' around code that accepted %command
24767 inside grammar rules: The documentation doesn't allow it,
24768 and it will fail since the %command processors scan for the next %.
24769 (parse_token_decl): Extended the %token
24770 declaration to allow a multi-character symbol as an alias.
24771 (parse_thong_decl): New function.
24772 (read_declarations): Added %thong declarations.
24773 (read_declarations): Handle NOOP to deal with allowing
24774 % declarations as another means to specify the flags.
24775 (readgram): Allow %prec prior to semantics embedded in a rule.
24776 (skip_to_char, read_declarations, copy_definition)
24777 (parse_token_decl, parse_start_decl, parse_type_decl)
24778 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
24779 (get_type_name, copy_guard, copy_action, readgram)
24780 (get_type, packsymbols): Revised most error messages.
24781 Changed `fatal' to `warnxxx' to avoid aborting for error.
24782 Revised and use multiple warnxxx functions to avoid using VARARGS1.
24783 (read_declarations): Improve the error message for
24784 an invalid character. Do not abort.
24785 (read_declarations, copy_guard, copy_action): Use
24786 printable_version to avoid unprintable characters in printed output.
24787 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
24788 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
24789 Allow the type of a non-terminal can be given
24790 more than once, as long as all specifications give the same type.
24793 (output_headers, output_trailers, output, output_gram)
24794 (output_rule_data): Implement noparserflag variable.
24795 Implement toknumflag variable.
24796 (output): Call reader_output_yylsp to output LTYPESTR.
24798 * src/main.c (main):
24799 If reader sees an error, don't process the grammar.
24800 (fatals): Updated to not use VARARGS1.
24801 (printable_version, int_to_string, warn, warni, warns, warnss)
24802 (warnsss): New error reporting functions. Avoid abort for error.
24805 Added THONG and NOOP for alias processing.
24806 Added SETOPT for the new code that allows setting options with %flags.
24809 Include getopt.h. Add some extern decls.
24810 (safegetc): New function to deal with EOF gracefully.
24811 (literalchar); new function to deal with reading \ escapes.
24812 (lex): Use literalchar.
24813 (lex): Implemented "..." tokens.
24814 (literalchar, lex, parse_percent_token): Made tokenbuffer
24815 always contain the token. This includes growing the token
24816 buffer while reading an integer.
24817 (parse_percent_token): Replaced if-else statement with percent_table.
24818 (parse_percent_token): Added % declarations as another
24819 way to specify the flags -n, -l, and -r. Also added hooks for
24820 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
24821 major changes to files.c.
24822 (lex) Retain in the incoming stream a character following
24824 (skip_white_space, lex): Revised most error messages
24825 and changed fatal to warn to avoid aborting.
24826 (percent_table): Added %thong declarations.
24828 * src/gram.h: Comment changes.
24830 * src/files.c (openfiles, open_extra_files, done):
24832 and actfile file. Handle noparserflag. Both for -n switch.
24834 * src/conflicts.c (resolve_sr_conflict):
24835 Remove use of alloca.
24837 1995-06-01 Jim Meyering <meyering@gnu.org>
24839 * doc/bison.texinfo: *** empty log message ***
24841 1995-05-06 Richard Stallman <rms@gnu.org>
24843 * src/bison.s1: Comment change.
24845 1995-05-06 Richard Stallman <rms@gnu.org>
24847 * bison.simple: Comment change.
24849 1995-05-03 Richard Stallman <rms@gnu.org>
24851 * src/version.c: Version now 1.24.
24853 * src/bison.s1: Change distribution terms.
24855 * src/version.c: Version now 1.23.
24857 1995-05-03 Richard Stallman <rms@gnu.org>
24859 * doc/bison.texinfo:
24860 Rewrite "Conditions for Using Bison".
24861 Update version to 1.24.
24863 1995-05-03 Richard Stallman <rms@gnu.org>
24865 * bison.simple: Change distribution terms.
24867 1995-02-23 Richard Stallman <rms@gnu.org>
24869 * src/files.c: Test __VMS_POSIX as well as VMS.
24871 1995-02-14 Jim Meyering <meyering@gnu.org>
24873 * src/bison.s1 (__yy_memcpy):
24874 Renamed from __yy_bcopy to avoid
24875 confusion. Reverse FROM and TO arguments to be consistent with
24878 1995-02-14 Jim Meyering <meyering@gnu.org>
24880 * bison.simple (__yy_memcpy):
24881 Renamed from __yy_bcopy to avoid
24882 confusion. Reverse FROM and TO arguments to be consistent with
24885 1994-11-10 David J. MacKenzie <djm@gnu.org>
24891 * Makefile.in (DISTFILES): Include NEWS.
24893 * Makefile.in (DISTFILES):
24894 Include install-sh, not install.sh.
24896 * configure.in: Update to Autoconf v2 macro names.
24898 1994-10-05 David J. MacKenzie <djm@gnu.org>
24900 * Makefile.in: fix typo
24902 * Makefile.in (prefix, exec_prefix):
24903 Let configure set them.
24905 1994-09-28 David J. MacKenzie <djm@gnu.org>
24907 * Makefile.in: Set datadir to $(prefix)/share.
24909 1994-09-15 Richard Stallman <rms@gnu.org>
24912 Update copyright notice and GPL version.
24914 1994-09-15 Richard Stallman <rms@gnu.org>
24917 Update copyright notice and GPL version.
24919 1994-07-12 Richard Stallman <rms@gnu.org>
24921 * src/reduce.c, src/reader.c:
24924 1994-05-05 David J. MacKenzie <djm@gnu.org>
24926 * Makefile.in: entered into RCS
24928 1994-03-26 Richard Stallman <rms@gnu.org>
24930 * src/bison.s1: entered into RCS
24932 1994-03-26 Richard Stallman <rms@gnu.org>
24934 * bison.simple: entered into RCS
24936 1994-03-25 Richard Stallman <rms@gnu.org>
24938 * src/main.c: entered into RCS
24940 1994-03-24 Richard Stallman <rms@gnu.org>
24942 * src/conflicts.c: entered into RCS
24944 1994-01-02 Richard Stallman <rms@gnu.org>
24946 * Makefile.in: *** empty log message ***
24948 1993-11-21 Richard Stallman <rms@gnu.org>
24950 * src/bison.s1: *** empty log message ***
24952 1993-11-21 Richard Stallman <rms@gnu.org>
24954 * doc/bison.texinfo: entered into RCS
24956 * doc/bison.texinfo: *** empty log message ***
24958 1993-11-21 Richard Stallman <rms@gnu.org>
24960 * bison.simple: *** empty log message ***
24962 1993-10-25 David J. MacKenzie <djm@gnu.org>
24964 * doc/bison.texinfo: *** empty log message ***
24966 1993-10-19 Richard Stallman <rms@gnu.org>
24968 * src/bison.s1: *** empty log message ***
24970 1993-10-19 Richard Stallman <rms@gnu.org>
24972 * bison.simple: *** empty log message ***
24974 1993-10-14 Richard Stallman <rms@gnu.org>
24976 * src/bison.s1: *** empty log message ***
24978 1993-10-14 Richard Stallman <rms@gnu.org>
24980 * bison.simple: *** empty log message ***
24982 1993-09-14 David J. MacKenzie <djm@gnu.org>
24984 * doc/bison.texinfo: *** empty log message ***
24986 1993-09-13 Noah Friedman <friedman@gnu.org>
24988 * Makefile.in: *** empty log message ***
24990 1993-09-10 Richard Stallman <rms@gnu.org>
24992 * src/conflicts.c: *** empty log message ***
24994 * src/system.h: entered into RCS
24996 1993-09-10 Richard Stallman <rms@gnu.org>
24998 * doc/bison.1: entered into RCS
25000 1993-09-06 Noah Friedman <friedman@gnu.org>
25002 * src/version.c: entered into RCS
25004 1993-09-06 Noah Friedman <friedman@gnu.org>
25006 * Makefile.in: *** empty log message ***
25008 1993-07-30 David J. MacKenzie <djm@gnu.org>
25010 * Makefile.in: *** empty log message ***
25012 1993-07-24 Richard Stallman <rms@gnu.org>
25014 * src/bison.s1: *** empty log message ***
25016 1993-07-24 Richard Stallman <rms@gnu.org>
25018 * bison.simple: *** empty log message ***
25020 1993-07-08 David J. MacKenzie <djm@gnu.org>
25022 * Makefile.in: *** empty log message ***
25024 1993-07-04 Richard Stallman <rms@gnu.org>
25026 * src/bison.s1: *** empty log message ***
25028 1993-07-04 Richard Stallman <rms@gnu.org>
25030 * bison.simple: *** empty log message ***
25032 1993-06-26 David J. MacKenzie <djm@gnu.org>
25034 * src/getargs.c: entered into RCS
25036 1993-06-26 David J. MacKenzie <djm@gnu.org>
25038 * doc/bison.texinfo: *** empty log message ***
25040 * doc/bison.1: New file.
25042 1993-06-25 Richard Stallman <rms@gnu.org>
25044 * src/getargs.c: New file.
25046 1993-06-16 Richard Stallman <rms@gnu.org>
25048 * src/bison.s1: *** empty log message ***
25050 1993-06-16 Richard Stallman <rms@gnu.org>
25052 * bison.simple: *** empty log message ***
25054 1993-06-03 Richard Stallman <rms@gnu.org>
25056 * src/bison.s1: New file.
25058 1993-06-03 Richard Stallman <rms@gnu.org>
25060 * doc/bison.texinfo: *** empty log message ***
25062 1993-06-03 Richard Stallman <rms@gnu.org>
25064 * bison.simple: New file.
25066 1993-05-19 Richard Stallman <rms@gnu.org>
25068 * doc/bison.texinfo: New file.
25070 1993-05-07 Noah Friedman <friedman@gnu.org>
25072 * Makefile.in: *** empty log message ***
25074 1993-04-28 Noah Friedman <friedman@gnu.org>
25076 * src/reader.c: *** empty log message ***
25078 1993-04-23 Noah Friedman <friedman@gnu.org>
25080 * src/alloc.h: entered into RCS
25082 1993-04-20 David J. MacKenzie <djm@gnu.org>
25084 * src/version.c: *** empty log message ***
25086 * src/files.c, src/allocate.c:
25089 * src/reader.c: *** empty log message ***
25091 * src/lex.c: entered into RCS
25093 * src/conflicts.c: New file.
25095 * src/symtab.c: entered into RCS
25097 * src/alloc.h: New file.
25099 * src/LR0.c: entered into RCS
25101 1993-04-18 Noah Friedman <friedman@gnu.org>
25103 * src/reader.c: New file.
25105 * src/version.c: *** empty log message ***
25107 1993-04-18 Noah Friedman <friedman@gnu.org>
25109 * Makefile.in: *** empty log message ***
25111 1993-04-17 Noah Friedman <friedman@gnu.org>
25113 * Makefile.in: *** empty log message ***
25115 1993-04-15 Richard Stallman <rms@gnu.org>
25117 * src/main.c, src/files.c:
25120 1993-04-15 Noah Friedman <friedman@gnu.org>
25122 * configure.in: entered into RCS
25124 * configure.in: *** empty log message ***
25126 * configure.in: New file.
25128 1993-04-14 Richard Stallman <rms@gnu.org>
25130 * Makefile.in: New file.
25132 1993-04-13 Richard Stallman <rms@gnu.org>
25134 * src/version.c: New file.
25136 1993-03-25 Richard Stallman <rms@gnu.org>
25138 * src/output.c: entered into RCS
25140 1992-09-25 Richard Stallman <rms@gnu.org>
25142 * configure.bat: entered into RCS
25144 1992-06-22 Richard Stallman <rms@gnu.org>
25146 * src/vmsgetargs.c: entered into RCS
25148 1992-06-22 Richard Stallman <rms@gnu.org>
25150 * doc/bison.rnh: entered into RCS
25152 1992-04-20 David J. MacKenzie <djm@gnu.org>
25154 * README: entered into RCS
25156 1992-01-22 Richard Stallman <rms@gnu.org>
25158 * src/machine.h: entered into RCS
25160 1991-12-21 Richard Stallman <rms@gnu.org>
25162 * src/lalr.c, src/closure.c:
25165 1991-12-20 Richard Stallman <rms@gnu.org>
25167 * src/state.h: entered into RCS
25169 1991-12-18 Richard Stallman <rms@gnu.org>
25171 * src/print.c, src/nullable.c, src/derives.c:
25174 1991-11-03 David J. MacKenzie <djm@gnu.org>
25176 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
25179 1988-09-09 Richard Stallman <rms@gnu.org>
25181 * src/bison.hairy: entered into RCS
25183 1987-12-16 Richard Stallman <rms@gnu.org>
25185 * REFERENCES: entered into RCS
25190 Copyright (C) 1987-1988, 1991-2010 Free Software Foundation,
25193 Copying and distribution of this file, with or without
25194 modification, are permitted provided the copyright notice and this
25195 notice are preserved.