1 2009-06-24 Akim Demaille <demaille@gostai.com>
3 variables: rename namespace as api.namespace.
5 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
7 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
9 (b4_percent_define_use): New.
10 Use it where applicable.
11 * data/c++.m4: Replace uses of the variable "namespace" by
13 Default the latter to the former.
14 * doc/bison.texinfo (Decl Summary): Document "namespace" as
16 Document api.namespace.
17 Use @samp to document %define uses, keep @code for identifiers.
19 * tests/c++.at, tests/input.at: Test api.namespace instead of
20 namespace. (The tests passed with namespace.)
22 2009-06-11 Akim Demaille <demaille@gostai.com>
25 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
26 * src/print-xml.c: Style changes.
27 * tests/conflicts.at: Comment changes.
29 2009-06-11 Akim Demaille <demaille@gostai.com>
31 xml: beware of user strings used to give a %prec to rules.
32 * tests/conflicts.at (%prec with user strings): New.
33 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
36 2009-06-11 Akim Demaille <demaille@gostai.com>
38 hash: check insertion for memory exhaustion.
39 * src/muscle-tab.c (muscle_insert, muscle_grow)
40 * src/state.c (state_hash_insert): Check the return value of
43 2009-06-11 Akim Demaille <demaille@gostai.com>
45 tests: honor TESTSUITEFLAGS in every check target.
46 * tests/local.mk (RUN_TESTSUITE): New.
47 (check-local, installcheck-local, maintainer-check-g++)
48 (maintainer-check-posix, maintainer-check-valgrind): Use it.
50 2009-06-10 Akim Demaille <demaille@gostai.com>
52 deterministic test suite.
53 Some consistency checks on symbols are performed after all the
54 symbols were read, by an iteration over the symbol table. This
55 traversal is nondeterministic, which can be a problem for test
58 Addresses another form of nondeterminism reported by Joel E. Denny.
59 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
61 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
63 Use different file names for the three tests to make the
66 2009-06-10 Akim Demaille <demaille@gostai.com>
69 * gnulib: Update to latest.
70 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
71 * m4/.gitignore: Regen.
72 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
73 Call xalloc_die on hash_insert failures.
74 Requested by the new __warn_unused_result__ attribute of
77 2009-06-10 Akim Demaille <demaille@gostai.com>
79 deterministic user-token-number redeclaration errors.
80 Address nondeterminism reported by Joel E. Denny.
81 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
83 * src/uniqstr.h: Comment changes.
84 * src/location.h (boundary_cmp, location_cmp): New.
85 * src/symtab.c (user_token_number_redeclaration): New.
86 (symbol_translation): Use it.
87 * tests/input.at (Numbered tokens): Adjust the expected output.
89 2009-05-25 Akim Demaille <demaille@gostai.com>
91 build: avoid ignored errors.
92 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
93 errors, they pollute the output.
95 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
97 Convert multiple variable definition warnings to complaints.
98 * NEWS (2.5): Add a new entry for that change.
99 * doc/bison.texinfo (Decl Summary): Update %define entry.
100 (Bison Options): Update -D/--define/-F/--force-define entry.
101 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
102 * src/muscle-tab.h (muscle_percent_define_insert): Update
104 * tests/input.at (`%define errors'): Update.
105 (`%define, --define, --force-define'): Update.
107 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
109 -F/--force-define and relative %define/-D/--define priorities.
110 * NEWS (2.5): Add documentation to -D/--define entry.
111 * build-aux/cross-options.pl: Hard-code association of
112 --force-define with %define.
113 * doc/bison.texinfo (Decl Summary): In %define entry,
114 cross-reference command-line options.
115 (Bison Options): Add documentation to -D/--define entry.
116 (Option Cross Key): Widen column for --force-define row.
117 * src/getargs.c (usage): Document -F/--force-define. Realign
119 (short_options, long_options, getargs): Parse -F/--force-define,
120 and update muscle_percent_define_insert invocations.
121 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
122 (muscle_percent_define_insert): Add argument with that type.
123 * src/muscle-tab.c (muscle_percent_define_insert): Implement
124 -F/--force-define behavior and priorities.
125 (muscle_percent_define_ensure): Update
126 muscle_percent_define_insert invocation.
127 * src/parse-gram.y (prologue_declaration): Update
128 muscle_percent_define_insert invocations.
129 * tests/input.at (`%define, --define'): Rename to...
130 (`%define, --define, --force-define'): ... this and extend.
132 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
134 Update some comments to make sense for -D.
135 * data/bison.m4 (b4_check_user_names): In header comments, say
136 "user occurrence" instead of "grammar occurrence".
137 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
138 (muscle_percent_code_grow): Likewise just for consistency.
140 2009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
142 * data/c++.m4 (b4_namespace_close): Simplify slightly.
144 2009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
146 Handle a trailing `:' in a user-supplied C++ namespace better.
147 * data/c++.m4 (b4_namespace_close): Don't let it be printed
148 among the closing braces here. This fix might make the
149 generated code easier to debug, but otherwise it should be
150 insignificant because a trailing `:' is a C++ error already.
152 2009-05-19 Akim Demaille <demaille@gostai.com>
154 remove useless variable.
155 * src/getargs.c (skeleton_arg): Remove now useless variable.
156 Should help the compiler see that this printf-like call is sane.
158 2009-05-15 Akim Demaille <demaille@gostai.com>
160 Rename token.prefix as api.tokens.prefix.
162 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
164 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
165 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
166 (token.prefix): Rename as...
167 (api.tokens.prefix): this.
169 2009-05-11 Akim Demaille <demaille@gostai.com>
171 doc: use C++ headers.
172 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
175 2009-05-11 Akim Demaille <demaille@gostai.com>
178 * doc/bison.simple (Decl Summary): Document token.prefix.
179 (Calc++ Parser): Various fixes.
182 Introduce a macro TOKEN to shorten the code and make it more
184 (Calc++ Scanner): Adjust.
185 * NEWS (Variable token.prefix): New.
187 2009-05-04 Akim Demaille <demaille@gostai.com>
189 bison: catch bad symbol names.
190 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
191 * tests/input.at: Adjust.
193 2009-05-04 Akim Demaille <demaille@gostai.com>
195 identifiers: dashes are letters.
196 Dashes can now start identifiers (symbols and directives).
198 * src/scan-gram.l ({letter}): Add dash.
200 * tests/input.at (Symbols): Adjust.
201 Remove stray comment.
202 * tests/regression.at (Invalid inputs): Adjust error message.
203 * doc/bison.texinfo (Symbols): Update.
205 2009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
207 Declare %code to be a permanent feature.
208 * NEWS (2.4.2): Here.
209 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
211 (Decl Summary): Likewise.
213 2009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
215 Convert underscores to dashes in some %define variable names.
216 For now, just api.push-pull and lr.keep-unreachable-states.
217 Maintain old names for backward compatibility.
218 * NEWS (2.5): Document.
219 * data/c.m4 (b4_identification): Update comment.
220 * data/yacc.c: Update access.
221 * doc/bison.texinfo: Update.
222 * etc/bench.pl.in (bench_push_parser): Update use.
223 * src/files.c (tr): Move to...
224 * src/getargs.c, src/getargs.h (tr): ... here because I can't
225 think of a better place to expose it. My logic is that, for all
226 uses of tr so far, command-line arguments can be involved, and
227 getargs.h is already included.
228 * src/main.c (main): Update access.
229 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
230 variable names to new variable names before assigning value.
231 * src/reader.c (reader): Update setting default.
232 * tests/calc.at: Update uses.
233 * tests/conflicts.at (Unreachable States After Conflict
234 Resolution): Update use.
235 * tests/input.at (%define enum variables): Update use.
236 (%define backward compatibility): New test group.
237 * tests/push.at: Update uses.
238 * tests/reduce.at: Update uses.
239 * tests/torture.at: Update uses.
241 2009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
243 Set all front-end %define defaults in one place.
244 * src/main.c (main): Move lr.keep_unreachable_states default...
245 * src/reader.c (reader): ... to here.
247 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
249 Rename lr.default_reductions to lr.default-reductions.
251 * doc/bison.texinfo: Here.
252 * src/lalr.c (initialize_LA): Here.
253 * src/print.c (print_reductions): Here.
254 * src/reader.c (reader): Here.
255 * src/tables.c (action_row): Here.
256 * tests/input.at (%define enum variables): Here.
257 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
259 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
261 Pacify ./configure --enable-gcc-warnings.
262 * tests/input.at (Symbols): Prototype yyerror and yylex.
264 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
266 Document how `%define "var" "value"' is not M4-friendly.
267 * src/parse-gram.y (variable): In comments here.
269 2009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
271 Clean up recent patches a little.
272 Reported by Akim Demaille.
273 * doc/bison.texinfo (Understanding): Fix typos.
274 * src/print.c (print_reductions): Don't use negated variable.
276 2009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
278 List accepted values for a %define enum variable with an invalid value.
279 Suggested by Akim Demaille at
280 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
281 * data/bison.m4 (_b4_percent_define_check_values): Implement.
282 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
283 * tests/input.at (%define lr.default_reductions invalid values): Merge
285 (%define enum variables): ... here, and update output.
287 2009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
289 Rename "default rule" to "default reduction".
290 This includes changing variable names in code, changing
291 comments, and renaming %define lr.default_rules to %define
292 lr.default_reductions.
293 * NEWS (2.5): Update IELR documentation.
294 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
296 * data/glr.c, data/lalr1.java: Sync copyright dates.
297 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
298 and lr.type documentation. Make some other wording
300 (Glossary): Adjust cross-references and Default Reduction
302 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
303 Remove a confusing comment pointed out by Akim Demaille.
304 (initialize_LA): Adjust code.
305 * src/print-xml.c (print_reductions): Adjust code.
306 * src/print.c (print_reductions): Adjust code.
307 * src/reader.c (reader): Adjust code.
308 * src/tables.c (action_row): Adjust code.
309 (token_actions): Adjust code.
310 * src/tables.h: Adjust YYDEFACT documentation.
311 * tests/input.at (%define lr.default_rules invalid values):
312 Rename test group to...
313 (%define lr.default_reductions invalid values): ... this, and
314 update grammar file and expected output.
315 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
316 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
318 2009-04-21 Akim Demaille <demaille@gostai.com>
320 tests: check the use of dashes and periods in symbols.
321 * tests/input.at (Symbol): New test group.
323 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
325 Document %define lr.type and lr.default_rules.
326 * NEWS (2.5): Add an entry.
327 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
328 besides just LALR(1) and GLR(1).
329 * doc/bison.texinfo (Introduction): Likewise.
330 (Language and Grammar): Bison is no longer limited to LALR(1)
332 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
333 when trying to distinguish from GLR. Talk about LR(1) grammars
334 rather than LALR(1) grammars.
335 (Decl Summary): In %define api.push_pull entry, say it applies
336 to deterministic parsers in C rather than LALR(1) parsers in C.
337 Add lr.default_rules entry.
339 (Mystery Conflicts): Bison is no longer limited to LALR(1)
341 (Generalized LR Parsing): Same changes as for the previous GLR
343 (Memory Management): Say deterministic rather than LALR(1).
344 (Understanding): Correct some bison output.
345 Index discussion of "accepting state".
346 Say deterministic rather than LALR(1).
347 (Bison Options): In --yacc entry, say deterministic rather than
349 In --report, --graph, and --xml entries, just don't mention
351 (C++ Parsers): Say deterministic rather than LALR(1).
352 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
353 (Glossary): Add Accepting State, Consistent State, Default Rule,
354 and IELR(1) definitions.
355 In Generalized LR (GLR) definition, make same changes as in
356 previous GLR sections.
357 In LALR(1) definition, say Bison uses LALR(1) by default rather
358 than implying Bison is limited to LALR(1).
359 (LocalWords): Add IELR.
361 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
363 Finish implementing %define lr.type.
364 Its value can be "LALR", "IELR", or "canonical LR".
365 * lib/timevar.def (TV_IELR_PHASE1): New var.
366 (TV_IELR_PHASE2): New var.
367 (TV_IELR_PHASE3): New var.
368 (TV_IELR_PHASE4): New var.
369 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
370 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
371 Sbitset.h, ielr.h, and ielr.c.
372 * src/getargs.h, src/getargs.c (enum trace, trace_args,
373 trace_types): Add trace_ielr.
374 * src/lalr.h, src/lalr.c (ngotos): Export it.
376 (goto_follows): ... this, update all uses, and export it.
377 (set_goto_map): Export it.
378 (map_goto): Export it.
379 (compute_lookahead_tokens): Don't free goto_follows yet. Now
381 (initialize_LA): Export it. Move lookback allocation to...
382 (lalr): ... here because, for canonical LR, initialize_LA must
383 be invoked but lookback and much of the rest of LALR isn't
385 * main.c (main): Instead of lalr, invoke ielr, which invokes
387 * src/reader.c (reader): Default lr.type to "LALR".
388 Default lr.default_rules to "accepting" if lr.type is "canonical
389 LR". Leave the default as "all" otherwise.
390 Check for a valid lr.type value.
391 * src/state.h, src/state.c (struct state_list): Add state_list
393 (state_new): Initialize state_list member to NULL.
394 (state_new_isocore): New function, exported.
395 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
396 exercises all values of lr.type.
397 (GNU AWK Grammar): Rename test group to...
398 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
399 AT_TEST_EXISTING_GRAMMAR.
400 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
401 (GNU pic Grammar): Rename test group to...
402 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
403 AT_TEST_EXISTING_GRAMMAR.
404 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
405 all values of lr.type.
406 (Single State Split): New test groups using AT_TEST_LR_TYPE.
407 (Lane Split): Likewise.
408 (Complex Lane Split): Likewise.
409 (Split During Added Lookahead Propagation): Likewise.
411 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
413 Add new files for IELR and canonical LR implementation.
414 * src/AnnotationList.c: New.
415 * src/AnnotationList.h: New.
416 * src/InadequacyList.c: New.
417 * src/InadequacyList.h: New.
418 * src/Sbitset.c: New.
419 * src/Sbitset.h: New.
423 2009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
425 Implement %define lr.default_rules.
426 Its value describes the states that are permitted to contain
427 default rules: "all", "consistent", or "accepting".
428 * src/reader.c (reader): Default lr.default_rules to "all".
429 Check for a valid lr.default_rules value.
430 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
431 is "accepting", then only mark the accepting state as
433 (initialize_LA): Tell state_lookahead_tokens_count whether
434 lr.default_rules is "accepting".
435 * src/tables.c (action_row): If lr.default_rules is not "all",
436 then disable default rules in inconsistent states.
437 * src/print.c (print_reductions): Use this opportunity to
438 perform some assertions about whether lr.default_rules was
440 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
441 helps with checking the parser tables for a grammar.
442 * tests/input.at (%define lr.default_rules invalid values): New
444 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
445 AT_TEST_TABLES_AND_PARSE.
446 (`no %define lr.default_rules'): New test group generated by
447 AT_TEST_LR_DEFAULT_RULES.
448 (`%define lr.default_rules "all"'): Likewise.
449 (`%define lr.default_rules "consistent"'): Likewise.
450 (`%define lr.default_rules "accepting"'): Likewise.
452 2009-04-20 Akim Demaille <demaille@gostai.com>
456 2009-04-20 Akim Demaille <demaille@gostai.com>
459 * src/output.c (token_definitions_output): Use symbol_id_get
460 instead of duplicating its logic.
461 * TODO (YYERRCODE): Extend.
463 2009-04-20 Akim Demaille <demaille@gostai.com>
465 variables: prefer error-verbose to error_verbose.
466 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
467 instead of error_verbose.
468 * src/scan-gram.l (%error-verbose): Map to the error-verbose
470 * doc/bison.texinfo: Promote %define error-verbose instead of
472 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
474 2009-04-15 Akim Demaille <demaille@gostai.com>
476 variables: accept dashes.
477 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
479 * src/scan-gram.l ({id}): Also accept dashes after the initial
481 ({directive}): Use {id}.
482 * src/parse-gram.y: Comment and formatting changes.
483 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
485 * src/complain.h, src/complain.c (yacc_at): New.
486 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
488 * src/output.c (token_definitions_output): Do not #define token
491 2009-04-20 Akim Demaille <demaille@gostai.com>
493 Consistently refer to Yacc, not YACC.
494 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
496 2009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
498 Pacify make maintainer-check-posix.
499 * tests/input.at (%define, --define): Move bison command-line
500 options before grammar file name.
502 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
504 Document semicolon warnings.
507 2009-04-14 Akim Demaille <demaille@gostai.com>
509 variables: use `parse.assert' instead of `assert'.
510 * TODO (assert): Remove.
511 * data/bison.m4 (b4_assert_if): Replace with...
512 (b4_parse_assert_if): this.
513 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
514 * doc/bison.texinfo (Decl Summary): Document parse.assert.
516 2009-04-14 Akim Demaille <demaille@gostai.com>
518 variables: use `parse.trace' instead of `debug'.
519 * src/getargs.c (getargs): Map -t to %define trace.parse.
520 * src/scan-gram.l (%debug): Map to %define trace.parse.
521 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
522 names to `_' in macro names.
523 (b4_debug_if): Replace with...
524 (b4_parse_trace_if): this.
525 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
526 * data/yacc.c: Adjust.
527 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
528 Use @code to label the variable list.
529 Document the variable parse.trace.
530 (Tracing): Promote the parse.trace variable.
531 * TODO: %printer is not documented.
533 2009-04-14 Akim Demaille <demaille@gostai.com>
536 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
537 (Table of Symbols): Remove duplicate entry for %debug.
539 2009-04-10 Eric Blake <ebb9@byu.net>
541 submodules: update to latest
542 * submodules/autoconf: Use latest upstream Autoconf.
544 2009-04-06 Eric Blake <ebb9@byu.net>
546 Work around autoconf 2.63b bug in testsuite.
547 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
548 autoconf bug related to # in test.
550 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
552 * NEWS (2.5): New section. Describe new -D/--define feature.
554 2009-04-06 Akim Demaille <demaille@gostai.com>
557 * src/parse-gram.h, src/parse-gram.c: Regen.
559 2009-04-06 Akim Demaille <demaille@gostai.com>
561 rename muscle_tab.* as muscle-tab.* for consistency.
562 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
563 * src/muscle-tab.h, src/muscle-tab.c: these.
564 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
565 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
567 2009-04-06 Akim Demaille <demaille@gostai.com>
569 Makefile: introduce $(BISON).
570 * src/local.mk (BISON): New.
573 2009-04-06 Akim Demaille <demaille@gostai.com>
575 parser: handle %locations as %define locations.
576 * src/getargs.h, src/getargs.c (locations_flag): Remove.
577 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
578 to set "locations" to true.
579 * src/output.c (prepare): Don't output "locations".
580 * src/scan-gram.l (%locations): Handle it as a %<flag>.
581 * src/parse-gram.y: It's no longer a token.
583 * data/bison.m4 (b4_locations_if): Define it with
584 b4_percent_define_if_define.
585 * data/c.m4, data/glr.cc: Adjust.
587 2009-04-06 Akim Demaille <demaille@gostai.com>
590 * src/parse-gram.c: Regen.
592 2009-04-06 Akim Demaille <demaille@gostai.com>
594 muscle: factor the handling of obsolete of obsolete directives.
595 Suggested by Joel E. Denny.
597 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
598 New, extracted from...
599 * src/parse-gram.y (prologue_declaration: pure-parser): here.
601 (prologue_declaration: "%<flag>"): Use
602 muscle_percent_define_ensure.
603 (%error-verbose, %pure-parser): No longer tokens.
604 * src/scan-gram.l (pure-parser): Return as a %<flag>.
606 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
608 Fix options documentation.
609 * build-aux/cross-options.pl: As in --help output, write optional
610 arguments as [=ARG] not =[ARG].
611 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
613 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
615 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
616 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
617 requirements for a correct m4 are stricter.
618 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
619 * configure.ac: Update to use AC_PROG_GNU_M4.
620 Reported by Eric Blake.
622 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
624 Help with updating web manual.
625 * HACKING: Incorporate instructions from gnulib/doc/README.
626 * bootstrap.conf (gnulib_modules): Add gendocs.
628 2009-04-03 Akim Demaille <demaille@gostai.com>
631 * src/parse-gram.h, src/parse-gram.c: Regen.
633 2009-04-03 Akim Demaille <demaille@gostai.com>
635 Factor %FLAG at scan level.
636 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
637 definitions and associated rules, replaced by....
638 (PERCENT_FLAG): this new token type, and rule.
639 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
640 Use it for %debug and %error-verbose.
642 2009-04-03 Akim Demaille <demaille@gostai.com>
645 * src/parse-gram.h, src/parse-gram.c: Regen.
647 2009-04-03 Akim Demaille <demaille@gostai.com>
649 Treat %debug as %define debug.
650 * data/bison.m4 (b4_debug_if): New.
651 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
652 * data/lalr1.java: Use it instead of b4_debug_flag.
653 * src/getargs.h, src/getargs.c (debug_flag): Remove.
654 * src/output.c (prepare): Don't output it.
655 * src/parse-gram.y: Treat %debug as %define debug.
657 2009-04-03 Akim Demaille <demaille@gostai.com>
659 Treat %error-verbose as %define error_verbose.
660 This allows to pass -Derror_verbose on the command line. Better
661 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
662 ERROR_VERBOSE being defined as false or true.
663 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
664 on b4_percent_define_ifdef, for does not check the defined value,
665 but only whether the symbol is defined, rely on
666 b4_percent_define_flag_if, so that a value of "false" is processed
668 If not defined, define the flag to "false".
669 (b4_error_verbose_if): New.
670 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
671 b4_error_verbose_flag.
672 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
673 * src/output.c (prepare): Don't output it.
674 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
676 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
678 Fix strange %define locations for default values.
679 Reported by Akim Demaille at
680 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
681 and discussed again starting at
682 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
683 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
684 because location information is bogus.
685 Use angle brackets to delimit fake file name because square brackets
686 look like underexpanded m4. Choose a better fake file name.
687 Use negative line numbers.
688 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
689 * src/location.c (location_print): If line for a boundary is negative,
690 only print that boundary's file name.
691 * src/location.h: Document that.
692 * tests/skeletons.at (%define Boolean variables: invalid skeleton
693 defaults): Update output.
695 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
697 Pacify ./configure --enable-gcc-warnings.
698 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
699 in lib won't compile with it.
700 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
702 2009-03-31 Akim Demaille <demaille@gostai.com>
704 bootstrap: --help to stdout.
705 * bootstrap (usage): Don't send --help to stderr.
706 Use a here doc instead of a long string.
708 2009-03-31 Akim Demaille <demaille@gostai.com>
710 bootstrap: README-hacking no longer exists
711 * bootstrap (checkout_only_file): Set to HACKING.
713 2009-03-26 Akim Demaille <demaille@gostai.com>
715 doc: merge HACKING and README-hacking.
716 Two files is confusing.
717 Reported by Alexandre Duret-Lutz.
719 * README-hacking: Merge into...
720 * HACKING (Working from the repository): here.
722 2009-03-26 Akim Demaille <demaille@gostai.com>
724 doc: update README-hacking.
725 * README-hacking: We now use git and git submodules.
726 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
728 2009-03-26 Akim Demaille <demaille@gostai.com>
730 lalr1.cc: avoid GCC 4.3 warnings.
731 GCC 4.3 now warns about "a || b && c" and asks for explicit
733 Reported by Alexandre Duret-Lutz.
734 * data/location.cc: Update copyright years.
735 (Position::operator==): Use parens to make precedence explicit.
736 Compare lines and columns first, as they are more likely to be
737 different, and they are faster to compare.
739 2009-03-26 Akim Demaille <demaille@gostai.com>
742 * gnulib: Update to latest.
743 * src/local.mk (AM_CFLAGS): Move to...
745 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
748 2009-03-02 Akim Demaille <demaille@gostai.com>
752 2009-03-02 Akim Demaille <demaille@gostai.com>
754 Share b4_yytranslate_define.
755 * data/lalr1.cc (b4_yytranslate_define): Move to...
758 2009-03-02 Akim Demaille <demaille@gostai.com>
760 Use locations in the variant example.
761 Yes, this obfuscates the point of this example, variants only.
762 But glr.cc cannot work (yet?) without locations. This change
763 makes it easier to use this example with glr.cc.
765 * examples/variant.yy (assert): %define it.
766 (locations): Request them.
767 (yylex): Bind the location to the stage.
769 2009-03-02 Akim Demaille <demaille@gostai.com>
771 Dub make_TOKEN as a public type interface.
772 * data/c++.m4 (b4_symbol_constructor_declare)
773 (b4_symbol_constructor_define): New empty stubs.
774 (b4_public_types_declare, b4_public_types_define): Use them.
775 * data/lalr1.cc (b4_symbol_constructor_declare)
776 (b4_symbol_constructor_declare_)
777 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
779 * data/variant.hh: here.
780 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
782 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
783 b4_symbol_constructor_declare, as it is now done by
784 b4_public_types_define and b4_public_types_declare.
786 2009-03-02 Akim Demaille <demaille@gostai.com>
788 Coding style changes.
789 * data/lalr1.cc (b4_symbol_constructor_declaration_)
790 (b4_symbol_constructor_declarations)
791 (b4_symbol_constructor_definition_)
792 (b4_symbol_constructor_definitions)
793 (b4_yytranslate_definition): Rename as...
794 (b4_symbol_constructor_declare_)
795 (b4_symbol_constructor_declare)
796 (b4_symbol_constructor_define_)
797 (b4_symbol_constructor_define)
798 (b4_yytranslate_define): these.
799 * data/variant.hh (b4_variant_definition): Rename as...
800 (b4_variant_define): this.
802 2009-03-02 Akim Demaille <demaille@gostai.com>
804 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
805 * data/bison.m4 (b4_percent_define_if_define): New.
806 * data/c++.m4 (b4_variant_if): Move to...
807 * data/bison.m4: Here, using b4_percent_define_if_define.
808 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
809 * data/bison.m4: Here, using b4_percent_define_if_define.
811 2009-03-02 Akim Demaille <demaille@gostai.com>
813 Dub symbol_type_base as a public type.
814 * data/c++.m4 (b4_public_types_declare): Now define
815 symbol_type_base and symbol_type.
816 (b4_public_types_define): New.
817 In both cases, the definitions are taken verbatim from lalr1.cc.
818 * data/lalr1.cc: Adjust.
820 2009-03-02 Akim Demaille <demaille@gostai.com>
822 b4_public_types_declare.
823 * data/c++.m4 (b4_public_types_declare): New.
824 * data/glr.cc, data/lalr1.cc: Use it.
826 2009-03-02 Akim Demaille <demaille@gostai.com>
828 b4_semantic_type_declare.
829 * data/c++.m4 (b4_semantic_type_declare): New.
830 Factors and generalizes what was in glr.cc and lalr1.cc.
831 * data/variant.hh (b4_semantic_type_declare): Redefine it for
833 * data/lalr1.cc, data/glr.cc: Use it.
835 2009-02-26 Akim Demaille <demaille@gostai.com>
838 * gnulib: Upgrade from master.
839 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
842 2009-02-25 Akim Demaille <demaille@gostai.com>
844 Remove useless arguments.
845 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
848 2009-02-25 Akim Demaille <demaille@gostai.com>
851 * data/lalr1.cc: here.
853 2009-02-25 Akim Demaille <demaille@gostai.com>
855 Fix glr.cc's debug level handling.
856 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
858 (debug_level, set_debug_level): Adjust.
860 2009-02-25 Akim Demaille <demaille@gostai.com>
863 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
865 2009-02-25 Akim Demaille <demaille@gostai.com>
868 * etc/bench.pl.in (generate_grammar_list): Consitently use
869 location_type, not yy::location.
871 2009-02-25 Akim Demaille <demaille@gostai.com>
874 * data/lalr1.cc: here.
876 2009-02-19 Akim Demaille <demaille@gostai.com>
878 Make yyparser::error public.
879 * data/lalr1.cc: here.
880 There is no good reason to keep it private (and it is convenient
881 to use it from the scanner for instance). It is already public in
884 2009-02-19 Akim Demaille <demaille@gostai.com>
889 2009-02-19 Akim Demaille <demaille@gostai.com>
891 Remove trailing blanks.
892 The epilogue has its own ending \n, no need to add another.
894 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
896 * data/glr.cc: dnl when extending the epilogue.
897 Remove stray "private:".
899 2009-02-19 Akim Demaille <demaille@gostai.com>
902 * data/c.m4 (b4_c_function_decl): Here.
904 2009-02-19 Akim Demaille <demaille@gostai.com>
907 * data/lalr1.cc: here.
909 2009-02-19 Akim Demaille <demaille@gostai.com>
912 * data/variant.hh: New, extracted from...
913 * data/lalr1.cc: here.
915 * data/local.mk: Adjust.
917 2009-02-19 Akim Demaille <demaille@gostai.com>
919 Extract stack.hh from lalr1.cc.
920 * data/stack.hh: New.
921 * data/lalr1.cc: Extract from here.
922 * data/local.mk: Adjust.
924 2009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
926 Add reminder about uploading public key to keys.gnupg.net.
927 * HACKING (Release Procedure): Here.
929 2009-01-28 Akim Demaille <demaille@gostai.com>
931 * NEWS: Update information about 2.4.1 and 2.4.2.
933 2008-11-04 Akim Demaille <demaille@gostai.com>
936 * NEWS: Use more outline-mode markup.
937 Suggested by Jim Meyering.
939 2009-01-08 Akim Demaille <demaille@gostai.com>
941 Fix grep portability issues.
942 Grep on Solaris does not support -q.
943 Reported by Summum Bonum.
945 * NEWS: Add a stub for 2.4.2.
946 * THANKS: Add Summum Bonum.
947 * tests/atlocal.in (EGREP): New.
948 (CC, CXX, XSLTPROC): Make it possible to override them via
950 * tests/java.at: Use $EGREP instead of egrep.
951 Use AT_CHECK's ignore instead of grep's -q.
953 2008-12-11 Akim Demaille <demaille@gostai.com>
955 Pass the token type to yysyntax_error.
956 * data/yacc.c (yysyntax_error): Take the transated token instead
961 2008-12-11 Akim Demaille <demaille@gostai.com>
964 * data/glr.c: Formatting changes.
966 2008-12-11 Akim Demaille <demaille@gostai.com>
968 Propagate i18n changes into glr.c.
970 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
971 building the error message format dynamically.
972 * data/lalr1.java: Formatting changes.
974 2008-12-11 Akim Demaille <demaille@gostai.com>
977 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
978 Solves problems when top_srcdir is an absolute path.
979 Suggested by Eric Blake.
980 * configure.ac: Require Autoconf 2.62.
982 2008-12-11 Akim Demaille <demaille@gostai.com>
984 Simplify the i18n of the error messages.
985 * data/lalr1.cc: Comment changes.
986 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
987 lalr1.cc instead of building dynamically the format string.
989 2008-12-08 Akim Demaille <demaille@gostai.com>
991 Fix portability issue in the test suite.
992 * tests/local.at (AT_MATCHES_CHECK): New.
993 Based on Perl instead of Sed. Sed has too many portability
994 pitfalls, not ever Sed is GNU Sed.
995 * tests/actions.at (Fix user actions without a trailing semicolon):
998 2008-12-08 Akim Demaille <demaille@gostai.com>
1001 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
1003 2008-12-08 Akim Demaille <demaille@gostai.com>
1005 Install autoconf as a submodule to get m4sugar.
1006 * .gitmodules: Add submodules/autoconf.
1007 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
1008 submodules/autoconf.
1010 2008-12-08 Akim Demaille <demaille@gostai.com>
1012 Test token.prefix in all the skeletons.
1013 * data/java.m4 (b4_token_enum): Use the token.prefix.
1014 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
1015 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
1016 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
1017 * tests/java.at: Comment changes.
1018 (AT_CHECK_JAVA_MINIMAL): Define the END token.
1019 (Java parser class and package names): Add token.prefix check.
1021 2008-12-08 Akim Demaille <demaille@gostai.com>
1023 Fix regeneration of atconfig.
1024 * tests/local.mk (tests/atconfig): The rule was incorrect, but
1025 remove it: now that there is no tests/Makefile.am, the top-level
1026 Makefile properly updates atconfig when needed.
1028 2008-12-07 Di-an Jan <dianj@freeshell.org>
1030 Implement the FIXME that ends an user action with a semicolon
1031 if it seems necessary.
1032 * src/scan-code.l (flex rules section): Flag cpp directive from
1033 any `#' to the first unescaped end-of-line. Semicolon is not
1034 needed after `;', `{', '}', or cpp directives and is needed after
1035 any other token (whitespaces and comments have no effect).
1036 * tests/actions.at (Fix user actions without a trailing semicolon):
1038 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
1039 to make user actions complete statements.
1040 Adjust column numbers in error messages.
1041 * tests/regression.at (Fix user actions without a trailing semicolon):
1042 Remove. Covered by new test.
1044 2008-12-07 Akim Demaille <demaille@gostai.com>
1047 * gnulib: Update from master.
1049 2008-12-05 Eric Blake <ebb9@byu.net>
1051 Avoid compiler warning.
1052 * src/output.c (muscle_insert_item_number_table): Delete unused
1055 2008-12-02 Eric Blake <ebb9@byu.net>
1057 Build testsuite with newer autoconf.
1058 * tests/output.at (m4_expand): Don't override in newer autoconf,
1059 where the underlying implementation changed.
1060 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
1061 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
1062 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
1063 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
1064 since some of them contain unbalanced ')'.
1066 2008-12-01 Akim Demaille <demaille@gostai.com>
1068 Use b4_symbol for printers and destructors everywhere.
1069 * data/bison.m4 (b4_symbol_action_location): New.
1070 * data/c.m4 (b4_symbol_actions): Remove.
1071 Adjust all callers to use by b4_symbol_foreach and the corresponding
1072 b4_symbol_printer/destructor macro.
1073 * data/glr.cc: Adjust.
1074 * data/lalr1.java: Adjust the %destructor sanity check.
1075 * src/output.c (symbol_code_props_output): Remove, we no longer
1076 need the b4_symbol_printers/destructors tables.
1078 2008-12-01 Akim Demaille <demaille@gostai.com>
1080 Use b4_symbol_case_.
1081 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
1084 2008-12-01 Akim Demaille <demaille@gostai.com>
1086 Move b4_symbol based macro to bison.m4.
1087 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
1088 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
1089 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
1090 (b4_type_foreach): Move to...
1091 * data/bison.m4: Here.
1092 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
1093 b4_symbol_value_template instead of b4_symbol_value.
1095 2008-12-01 Akim Demaille <demaille@gostai.com>
1097 b4_symbol/type_foreach.
1098 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
1101 2008-12-01 Akim Demaille <demaille@gostai.com>
1103 Use the symbol properties to output the printer/destructor for lalr1.cc.
1104 Instead of defining complex list of tuples to define various
1105 properties of the symbols, we now prefer to define symbols as
1106 "structs" in m4: using the symbol key (its number), and the
1107 property name, b4_symbol gives it value. Use this to handle
1108 destructors and printers.
1110 * src/output.c (CODE_PROP): New.
1111 (prepare_symbol_definitions): Use it to define the printer and
1112 destructor related attributes of the symbols.
1113 * data/lalr1.cc (b4_symbol_actions): Rename as...
1114 (b4_symbol_action): this.
1115 Use b4_symbol instead of 6 arguments.
1116 (b4_symbol_printer, b4_symbol_destructor): New.
1117 Use them instead of b4_symbol_actions.
1119 2008-12-01 Akim Demaille <demaille@gostai.com>
1121 Avoid capturing variables too easily.
1122 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
1123 v__ and p__ instead of v and p.
1125 2008-12-01 Akim Demaille <demaille@gostai.com>
1127 Remove spurious empty line before syncline.
1128 * data/bison.m4 (b4_syncline): Don't output an empty line before
1131 2008-11-26 Akim Demaille <demaille@gostai.com>
1133 Convert lib/Makefile.am into lib/local.mk.
1134 The real problem is rather gnulib.mk, which itself is extracted
1135 from a Makefile.am that gnulib expects to the "recursive". The
1136 tool prefix-gnulib-mk converts such a gnulib.mk to be
1137 non-recursive. Also, some AC_SUBST variables need to be adjusted.
1139 * etc/prefix-gnulib-mk: New.
1140 * bootstrap (slurp): Use it to convert further gnulib.mk.
1141 No longer try to avoid re-creation of lib/gnulib.mk as the changes
1143 * lib/Makefile.am: Rename as...
1144 * lib/local.mk: this.
1145 Adjust to be prefixed.
1146 * Makefile.am, configure.ac: Adjust.
1147 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
1149 2008-11-26 Akim Demaille <demaille@gostai.com>
1152 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
1153 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
1154 Reported by Eric Blake.
1156 2008-11-26 Akim Demaille <demaille@gostai.com>
1158 Use b4_parser_tables_define in glr.cc.
1159 * data/glr.c: Use b4_parser_tables_define instead of defining the
1160 (deterministic integral) tables by hand.
1162 2008-11-26 Akim Demaille <demaille@gostai.com>
1164 Use b4_parser_tables_define in Java.
1165 * data/java.m4 (b4_typed_parser_table): Rename as...
1166 (b4_typed_parser_table_define): this, for consistency.
1167 Accept a comment as $4.
1169 (b4_integral_parser_table): Rename as...
1170 (b4_integral_parser_table_define): this.
1171 * data/lalr1.java: Adjust all uses.
1172 Use b4_parser_tables_define instead of generation by hand.
1174 2008-11-26 Akim Demaille <demaille@gostai.com>
1176 Prepare the convergence bw C style and Java table generation.
1177 * data/bison.m4 (b4_tables_map, b4_tables_declare)
1178 (b4_tables_define): Rename as...
1179 (b4_integral_parser_tables_map, b4_parser_tables_declare)
1180 (b4_parser_tables_define): these.
1181 * data/c.m4 (b4_table_define): Rename as...
1182 (b4_integral_parser_table_define): this.
1183 * data/lalr1.cc: Adjust.
1184 (b4_table_define, b4_table_declare): Rename as...
1185 (b4_integral_parser_table_define)
1186 (b4_integral_parser_table_declare): these.
1187 (yyrline_): Move the comment where it is actually used.
1188 * data/yacc.c: Adjust.
1189 (yyrline): Use b4_integral_parser_table_define.
1191 2008-11-26 Akim Demaille <demaille@gostai.com>
1194 * src/parse-gram.h, src/parse-gram.c: Regen.
1196 2008-11-26 Akim Demaille <demaille@gostai.com>
1198 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
1199 * data/lalr1.cc (b4_tables_map): Move to...
1200 * data/bison.m4: here.
1201 Update the comment for yytable during the flight.
1202 (b4_tables_declare, b4_tables_define): New.
1203 * data/lalr1.cc: Use them.
1204 * data/c.m4 (b4_table_define): New.
1205 * data/yacc.c: Use b4_tables_define instead of output the tables
1207 * tests/regression.at (Web2c Actions): Adjust the expected output,
1208 the order of the tables changed.
1210 2008-11-26 Akim Demaille <demaille@gostai.com>
1212 Get rid of (yy)rhs and (yy)prhs.
1213 These tables are no longer needed in the parsers, and they don't seem to
1214 be useful. They are not documented either.
1216 * src/output.c (prepare_rules): Get rid of rhs and prhs.
1217 Adjust the computation of (yy)r2.
1219 2008-11-26 Akim Demaille <demaille@gostai.com>
1221 Rule length is unsigned.
1222 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
1224 2008-11-26 Akim Demaille <demaille@gostai.com>
1226 Get rid of lalr1-split.cc.
1227 It was no longer maintainer.
1229 * data/lalr1-split.cc: Remove.
1230 * etc/bench.pl.in (bench_fusion_parser): Remove.
1233 2008-11-26 Akim Demaille <demaille@gostai.com>
1235 Use yy* consistently.
1236 * data/glr.c: Now that yyrhs no longer exists as a global
1237 variable, rename local "rhs" variables into "yyrhs" for
1240 2008-11-25 Akim Demaille <demaille@gostai.com>
1242 Get rid of yyrhs and yyprhs in glr.c.
1243 * data/glr.c (yyrhs, yyprhs): Remove.
1244 Instead, use the state stack and yystos.
1246 2008-11-25 Akim Demaille <demaille@gostai.com>
1249 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
1250 as an Autotest keyword.
1252 2008-11-25 Akim Demaille <demaille@gostai.com>
1254 Prefer TESTSUITE_FLAGS.
1255 TESTSUITEFLAGS is barely readable.
1257 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
1258 for backward compatibility.
1259 Use the former instead of the latter.
1261 2008-11-25 Akim Demaille <demaille@gostai.com>
1263 Get rid of yyrhs and yyprhs in larl1.java.
1264 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
1265 (yy_reduce_print): Rather, use yystos_ and the state stack.
1267 2008-11-25 Akim Demaille <demaille@gostai.com>
1271 2008-11-25 Akim Demaille <demaille@gostai.com>
1273 Get rid of yyrhs and yyprhs in yacc.c.
1274 They were used to get the symbol types, given a rule number, when
1275 displaying the top of the stack before a reduction. But the
1276 symbol type is available from the state stack. This has two be
1277 benefits: two tables less in the parser (making it smaller), and a
1278 more consistent use of the three stacks which will help to fuse
1281 * data/yacc.c (yyprhs, yyrhs): Remove.
1282 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
1283 (yy_reduce_print): Take yyssp as argument.
1284 Use it, together with yystos, to get the symbol type.
1285 * tests/regression.at (Web2c Report): Remove these tables from the
1288 2008-11-25 Akim Demaille <demaille@gostai.com>
1291 The point is to factor the generation of the tables across skeletons.
1292 This is language dependant.
1294 * data/c.m4 (b4_comment_): New.
1295 Should be usable to define how to generate tables independently of
1297 (b4_c_comment): New.
1298 (b4_comment): Bounce to b4_c_comment.
1299 Now support $2 = [PREFIX] for indentation.
1300 * data/lalr1.cc (b4_table_declare): Don't output a comment if
1301 there is no comment.
1302 Indent it properly when there is one.
1303 Output the ending semicolon.
1304 (b4_table_define): Space changes.
1305 Output the ending semicolon.
1306 (b4_tables_map): New.
1307 Use it twice instead of declaring and defining the (integral)
1310 2008-11-25 Akim Demaille <demaille@gostai.com>
1313 * data/lalr1.cc (b4_table_declare): New.
1314 Use it to declare the tables defined with b4_table_define.
1315 (b4_table_define): Declare a third arg to match b4_table_declare
1317 Move all the comments around invocations of b4_table_define into
1318 the invocations itselves.
1319 Move things around to have the order for declarations and
1322 2008-11-25 Akim Demaille <demaille@gostai.com>
1325 * data/lalr1.java: here.
1327 2008-11-25 Akim Demaille <demaille@gostai.com>
1329 b4_args is more general than only C++.
1330 * data/lalr1.cc (b4_args, _b4_args): Move to...
1331 * data/bison.m4: here.
1333 2008-11-21 Di-an Jan <dianj@freeshell.org>
1335 Implement no-XXX arguments for --warnings, --report, --trace.
1336 * src/getargs.c (flags_argmatch): Handles no-XXX.
1337 Fix typo in doxygen comment.
1339 2008-11-21 Akim Demaille <demaille@gostai.com>
1341 Display the changes in cross-options.texi.
1342 * build-aux/cross-options.pl ($sep): New, to separate items.
1343 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
1346 2008-11-20 Di-an Jan <dianj@freeshell.org>
1348 Improves options in the manual.
1349 * doc/bison.texinfo (-g, -x): Add space before argument.
1350 (Option Cross Key): Implement FIXME: listing directives also.
1351 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
1352 (Short Option): Special case -d. Put arguments inside @option.
1353 (Bison Directive): Add column, automatically extracted from
1354 src/scan-gram.l (actual name passed as the first argument)
1355 with special case for %define.
1356 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
1357 to build-aux/cross-options.pl.
1358 * src/getargs.c (usage): Document limitations of cross-options.pl.
1359 * src/scan-gram.l: Likewise.
1361 2008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
1363 Fix unexpanded macros in GLR defines file.
1364 Reported by Csaba Raduly at
1365 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
1366 * THANKS (Csaba Raduly): Add.
1367 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
1368 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
1369 lexer in a separate module that includes the defines file.
1370 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
1372 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
1373 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
1374 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
1375 (AT_DATA_SOURCE_PROLOGUE): New.
1376 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
1377 (AT_DATA_SOURCE): New.
1378 (AT_FULL_COMPILE): Extend to support an additional source file.
1380 2008-11-18 Akim Demaille <demaille@gostai.com>
1383 * TODO: More short term issues.
1385 2008-11-18 Akim Demaille <demaille@gostai.com>
1388 * src/parse-gram.h, src/parse-gram.c: Regen.
1390 2008-11-18 Akim Demaille <demaille@gostai.com>
1392 Use b4_subtract where possible.
1393 * data/lalr1.cc (b4_subtract): Move to...
1394 * data/bison.m4: here.
1395 * data/glr.c (b4_rhs_data): Use it.
1396 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
1398 2008-11-18 Akim Demaille <demaille@gostai.com>
1400 Remove incorrect mode specification.
1401 * data/glr.cc: Don't pretend it's C code.
1403 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1405 Simplify last patch slightly.
1406 * src/getargs.c (getargs): Here.
1408 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1410 Fix last warning from --enable-gcc-warnings.
1411 * src/getargs.c (getargs): Don't assign const address to non-const
1414 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1416 Don't let maintainer-*-check targets force a version update.
1417 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
1420 2008-11-17 Di-an Jan <dianj@freeshell.org>
1422 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
1423 Align menus. Adjust word wrapping. Use node names for menu names.
1424 (Examples): Don't abbreviate node names.
1425 (LocalWords): Remove abbreviations.
1426 (Copying): Make description a sentence.
1427 (Java Action Features): Remove period to match the rest of menu.
1429 2008-11-17 Di-an Jan <dianj@freeshell.org>
1431 Handles several --enable-gcc-warnings.
1432 * src/getargs.c (command_line_location): Set parameters to void.
1433 * src/output.c (symbol_type_name_cmp): Make static.
1434 (symbols_by_type_name): Set parameters to void.
1435 (symbol_definitions_output): Remove unused parameter. Rename as...
1436 (prepare_symbol_definitions): this.
1437 (muscles_output): Move symbol_definitions_output to...
1438 (output): here as prepare_symbol_definitions.
1439 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
1440 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
1442 2008-11-17 Di-an Jan <dianj@freeshell.org>
1444 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
1445 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
1447 2008-11-16 Akim Demaille <demaille@gostai.com>
1449 Add missing $(EXEEXT).
1450 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
1451 "src/bison$(EXEEXT)".
1452 Reported by Di-an Jan.
1454 2008-11-15 Akim Demaille <demaille@gostai.com>
1458 2008-11-15 Akim Demaille <demaille@gostai.com>
1461 * tests/input.at: here.
1463 2008-11-15 Akim Demaille <demaille@gostai.com>
1465 Remove duplicate header inclusion.
1468 2008-11-15 Akim Demaille <demaille@gostai.com>
1470 * src/parse-gram.h, src/parse-gram.c: Regen.
1472 2008-11-15 Akim Demaille <demaille@gostai.com>
1474 Support parametric types.
1476 There are two issues to handle: first scanning nested angle
1477 bracket pairs to support types such as std::pair< std::string,
1478 std::list<std::string> > >.
1480 Another issue is to address idiosyncracies of C++: do not glue two
1481 closing angle brackets together (otherwise it's operator>>), and
1482 avoid sticking blindly a TYPE to the opening <, as it can result
1483 in '<:' which is a digraph for '['.
1485 * src/scan-gram.l (brace_level): Rename as...
1488 Implement support for complex tags.
1491 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
1492 (b4_symbol_variant): Leave space around types as parameters.
1493 * examples/variant.yy: Use nested template types and leading ::.
1494 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
1496 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
1497 * tests/c++.at: Test parametric types.
1499 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1502 This is not sufficient, but we test at least that the make_SYMBOL
1503 interface is not affected by token.prefix. A more general test
1504 will be implemented when the support of token.prefix is generalized
1507 * tests/c++.at: One more variant test, using token.prefix.
1509 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1511 Test the make_TOKEN interface.
1512 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
1513 Factor the common code in yylex.
1514 Use it to test "%define lex_symbol".
1516 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1520 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1522 Simplify code for variants bench marks.
1523 * etc/bench.pl.in (&generate_grammar_list): Define and use
1525 Factor the common code in yylex.
1527 2008-11-15 Akim Demaille <demaille@gostai.com>
1529 Better error message.
1530 * bootstrap (find_tool): Fix the error message.
1532 2008-11-15 Akim Demaille <demaille@gostai.com>
1534 Update variant.yy to newest interface.
1535 * examples/variant.yy: Define lex_symbol.
1538 2008-11-15 Akim Demaille <demaille@gostai.com>
1540 Don't use locations in variant.yy.
1541 * examples/variant.yy: Adjust to not using locations.
1543 2008-11-15 Akim Demaille <demaille@gostai.com>
1546 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
1547 comments for the license.
1549 2008-11-15 Akim Demaille <demaille@gostai.com>
1551 Remove tests/Makefile.am.
1552 * tests/Makefile.am: Rename as...
1553 * tests/local.mk: this.
1554 * Makefile.am, configure.ac: Adjust.
1555 * Makefile.am (DISTCLEANFILES): Define.
1556 (maintainer-check, maintainer-xml-check, maintainer-push-check):
1557 Remove, we no longer need to bounce to the real targets.
1559 2008-11-15 Akim Demaille <demaille@gostai.com>
1563 2008-11-15 Akim Demaille <demaille@gostai.com>
1566 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
1567 * djgpp/local.mk: this new file.
1569 2008-11-15 Akim Demaille <demaille@gostai.com>
1571 Remove doc/Makefile.am.
1572 * doc/Makefile.am: Rename as...
1573 * doc/local.mk: this.
1575 * Makefile.am, configure.ac: Adjust.
1576 * Makefile.am (MOSTLYCLEANFILES): New.
1577 * src/local.mk: Adjust.
1579 2008-11-15 Akim Demaille <demaille@gostai.com>
1581 Move sc_tight_scope into maint.mk.
1582 It does not work, and I don't know how it was supposed to work: it
1583 seems to be looking for sources in the build tree. I just moved
1584 it at a better place, fixing it is still required.
1586 * src/local.mk (echo): Remove.
1587 (sc_tight_scope): Move to...
1590 2008-11-15 Akim Demaille <demaille@gostai.com>
1593 * src/parse-gram.h, src/parse-gram.h: Regen.
1595 2008-11-15 Akim Demaille <demaille@gostai.com>
1597 Remove src/Makefile.am.
1598 * src/Makefile.am: Rename as...
1599 * src/local.mk: this.
1600 Prefix all the paths with src/.
1601 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
1602 (AM_CPPFLAGS): Find find in builddir/src.
1603 (YACC): Move the flags into...
1605 * maint.mk (sc_tight_scope): Disable.
1606 It used to bounce to the version in src/Makefile.am which is now
1607 part of this very Makefile.
1608 * Makefile.am, configure.ac: Adjust.
1609 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
1610 include "..." to find files "here": we are no longer in src/, so
1611 qualify the includes with src/.
1612 * doc/Makefile.am (PREPATH): No longer include the top_builddir
1614 (.x.1): Adjust to be able to create src/foo from the top level
1615 Makefile, instead of going bounce to src/Makefile the creation of
1618 2008-11-15 Akim Demaille <demaille@gostai.com>
1620 Remove useless variable.
1621 * doc/Makefile.am (srcsrcdir): Remove.
1623 2008-11-15 Akim Demaille <demaille@gostai.com>
1625 Remove data/Makefile.am.
1626 * data/Makefile.am: Rename as...
1627 * data/local.mk: this.
1629 * Makefile.am, configure.ac: Adjust.
1631 2008-11-15 Akim Demaille <demaille@gostai.com>
1633 Remove etc/Makefile.am.
1634 * etc/Makefile.am: Rename as...
1635 * etc/local.mk: this.
1637 * Makefile.am, configure.ac: Adjust.
1639 2008-11-15 Akim Demaille <demaille@gostai.com>
1641 Remove examples/local.mk.
1642 examples/calc++/Makefile.am might be interesting to keep as is, since
1643 it is an example in itself.
1645 * examples/Makefile.am: Rename as...
1646 * examples/local.mk: this.
1648 * Makefile.am, configure.ac: Adjust.
1650 2008-11-15 Akim Demaille <demaille@gostai.com>
1652 Remove build-aux/Makefile.am.
1653 Recursive Makefiles are really way too slow, let's get rid of some of
1656 * build-aux/Makefile.am: Rename as...
1657 * build-aux/local.mk: this.
1659 * Makefile.am, configure.ac: Adjust.
1661 2008-11-15 Akim Demaille <demaille@gostai.com>
1663 Provide convenience constructors for locations and positions.
1664 * data/location.cc (position::position): Accept file, line and
1665 column as arguments with default values.
1666 Always qualify initial line and column literals as unsigned.
1667 (location::location): Provide convenience constructors.
1669 2008-11-15 Akim Demaille <demaille@gostai.com>
1671 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
1673 Using template buys us nothing, and makes it uselessly complex to
1674 construct a symbol. Besides, it could not be generalized to other
1675 languages, while make_FOO would work in C/Java etc.
1677 * data/lalr1.cc (b4_symbol_): New.
1678 (b4_symbol): Use it.
1679 (b4_symbol_constructor_declaration_)
1680 (b4_symbol_constructor_definition_): Instead of generating
1681 specializations of an overloaded template function, just generate
1682 several functions whose names are forged from the token names
1683 without the token.prefix.
1684 (b4_symbol_constructor_declarations): Generate them for all the
1685 symbols, not just by class of symbol type, now that instead of
1686 specializing a function template by the token, we generate a
1687 function named after the token.
1688 (b4_symbol_constructor_specialization_)
1689 (b4_symbol_constructor_specializations): Remove.
1690 * etc/bench.pl.in: Adjust to this new API.
1692 2008-11-13 Akim Demaille <demaille@gostai.com>
1694 %define token.prefix.
1695 Provide a means to add a prefix to the name of the tokens as
1696 output in the generated files. Because of name clashes, it is
1697 good to have such a prefix such as TOK_ that protects from names
1698 such as EOF, FILE etc. But it clutters the grammar itself.
1700 * data/bison.m4 (token.prefix): Empty by default.
1701 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
1702 * data/lalr1.cc (b4_symbol): Ditto.
1704 2008-11-13 Akim Demaille <demaille@gostai.com>
1706 Compute at M4 time some of the subtractions.
1707 * data/lalr1.cc (b4_subtract): New.
1708 (b4_rhs_data): Use it.
1710 2008-11-13 Akim Demaille <demaille@gostai.com>
1713 This allows the user to get the type of a token returned by yylex.
1715 * data/lalr1.cc (symbol::token): New.
1716 (yytoknum_): Define when %define lex_symbol, independently of
1718 (yytoken_number_): Move into...
1719 (symbol::token): here, since that's the only use.
1720 The other one is YYPRINT which was not officially supported
1721 by lalr1.cc, and anyway it did not work since YYPRINT uses this
1722 array under a different name (yytoknum).
1724 2008-11-13 Akim Demaille <demaille@gostai.com>
1727 * TODO (YYERRCODE): Mention the case of $undef.
1729 2008-11-13 Akim Demaille <demaille@gostai.com>
1732 * TODO (YYPRINT): New.
1734 2008-11-13 Akim Demaille <demaille@gostai.com>
1737 * data/lalr1.cc, data/yacc.c: Fix the description of the
1738 yytranslate and yytoknum tables.
1740 2008-11-13 Akim Demaille <demaille@gostai.com>
1742 Define make_symbol in the header.
1743 To reach good performances these functions should be inlined (yet
1744 this is to measure precisely). To this end they must be available
1747 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
1748 location_type with the class name.
1749 Since will now be output in the header, declare "inline".
1750 No longer use b4_symbol_constructor_specializations, but
1751 b4_symbol_constructor_definitions in the header.
1752 Don't call it in the *.cc file.
1754 2008-11-13 Akim Demaille <demaille@gostai.com>
1756 Define yytranslate in the header for lex_symbol.
1757 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
1758 into the header file when using %define lex_symbol.
1759 (yytranslate_): Declare inline.
1761 2008-11-13 Akim Demaille <demaille@gostai.com>
1763 Define the constructors of symbol_type in
1764 b4_symbol_constructor_definitions.
1765 The constructors are called by the make_symbol functions, which a
1766 forthcoming patch will move elsewhere. Hence the interest of
1767 putting them together.
1769 The stack_symbol_type does not need to be moved, it is used only
1772 * data/lalr1.cc: Move symbol_type and symbol_base_type
1773 constructors into...
1774 (b4_symbol_constructor_definitions): here.
1777 2008-11-13 Akim Demaille <demaille@gostai.com>
1779 Make it easier to move the definition of yytranslate_.
1780 Forthcoming changes will make it possible to use yytranslate_
1781 from outside the parser implementation file.
1783 * data/lalr1.cc (b4_yytranslate_definition): New.
1786 2008-11-13 Akim Demaille <demaille@gostai.com>
1788 Remove useless class specification.
1789 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
1790 to refer to the class name to use a type defined by the class for
1791 arguments of member functions.
1793 2008-11-13 Akim Demaille <demaille@gostai.com>
1795 Finer input type for yytranslate.
1796 This patch is debatable: the tradition expects yylex to return an int
1797 which happens to correspond to token_number (which is an enum). This
1798 allows for instance to return characters (such as '*' etc.). But this
1799 goes against the stronger typing I am trying to have with the new
1800 lex interface which return a symbol_type. So in this case, feed
1801 yytranslate_ with a token_type.
1803 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
1804 expect a token_type.
1806 2008-11-13 Akim Demaille <demaille@gostai.com>
1808 Honor lex-params in %define lex_symbol mode.
1809 * data/lalr1.cc: Use b4_lex_param.
1811 2008-11-13 Akim Demaille <demaille@gostai.com>
1814 * src/output.c (symbol_definitions_output): Rename symbol
1815 attributes type_name and has_type_name as type and has_type.
1816 * data/lalr1.cc: Adjust uses.
1818 2008-11-13 Akim Demaille <demaille@gostai.com>
1820 Use b4_type_names for the union type.
1821 The union used to compute the size of the variant used to iterate
1822 over the type of all the symbols, with a lot of redundancy. Now
1823 iterate over the lists of symbols having the same type-name.
1825 * data/lalr1.cc (b4_char_sizeof_): New.
1826 (b4_char_sizeof): Use it.
1827 Adjust to be called with a list of numbers instead of a single
1829 Adjust its caller for new-line issues.
1831 2008-11-13 Akim Demaille <demaille@gostai.com>
1833 Define the "identifier" of a symbol.
1834 Symbols may have several string representations, for instance if
1835 they have an alias. What I call its "id" is a string that can be
1836 used as an identifier. May not exist.
1838 Currently the symbols which have the "tag_is_id" flag set are
1839 those that don't have an alias. Look harder for the id.
1841 * src/output.c (is_identifier): Move to...
1842 * src/symtab.c (is_identifier): here.
1843 * src/symtab.h, src/symtab.c (symbol_id_get): New.
1844 * src/output.c (symbol_definitions_output): Use it to define "id"
1846 Remove the definition of "tag_is_id".
1847 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
1848 "tag_is_id" were used to produce code.
1849 We still use "tag" for documentation.
1851 2008-11-11 Akim Demaille <demaille@gostai.com>
1853 Locations are no longer required by lalr1.cc.
1854 * data/lalr1.cc (_b4_args, b4_args): New.
1855 Adjust all uses of locations to make them optional.
1856 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
1857 (AT_CHECK_NAMESPACE): Check the use of locations.
1858 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
1859 without locations with lalr1.cc.
1861 * tests/output.at: Check lalr1.cc with and without location
1863 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
1864 Don't use locations.
1866 2008-11-11 Akim Demaille <demaille@gostai.com>
1869 * tests/local.at (AT_FULL_COMPILE): New.
1870 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
1872 2008-11-11 Akim Demaille <demaille@gostai.com>
1874 Support parens in calc++.
1875 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
1876 * examples/calc++/test (run): Check the expected output.
1880 2008-11-11 Akim Demaille <demaille@gostai.com>
1882 Simplify lalr1.cc since %defines is mandatory.
1883 * data/lalr1.cc: Remove useless calls to b4_defines_if.
1885 2008-11-11 Akim Demaille <demaille@gostai.com>
1888 * TODO (yysyntax_error): New item.
1890 2008-11-11 Akim Demaille <demaille@gostai.com>
1893 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
1896 2008-11-11 Akim Demaille <demaille@gostai.com>
1898 Support i18n of the parse error messages.
1899 * TODO (lalr1.cc/I18n): Remove.
1900 * data/lalr1.cc (yysyntax_error_): Support the translation of the
1901 error messages, as done in yacc.c.
1902 Stay within the yy* pseudo namespace.
1904 2008-11-11 Akim Demaille <demaille@gostai.com>
1907 * TODO (single stack, yysyntax_error): New.
1909 2008-11-11 Akim Demaille <demaille@gostai.com>
1911 Make it possible to return a symbol_type from yylex.
1912 * data/lalr1.cc (b4_lex_symbol_if): New.
1913 (parse): When lex_symbol is defined, expected yylex to return the
1915 * etc/bench.pl.in (generate_grammar_list): Extend to support this
1917 (bench_variant_parser): Exercise it.
1919 2008-11-11 Akim Demaille <demaille@gostai.com>
1921 Remove useless bench case.
1922 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
1925 2008-11-11 Akim Demaille <demaille@gostai.com>
1927 Improve display of directives.
1928 * etc/bench.pl.in (parse_term): Don't add useless eol.
1930 2008-11-11 Akim Demaille <demaille@gostai.com>
1932 Use string_cast in the bench.
1933 * etc/bench.pl.in (generate_grammar_list): Define and use
1936 2008-11-11 Akim Demaille <demaille@gostai.com>
1938 Replace yychar with a Boolean.
1939 * data/lalr1.cc (parse::yychar): Replace by...
1940 (parse::yyempty): this.
1942 2008-11-11 Akim Demaille <demaille@gostai.com>
1947 2008-11-11 Akim Demaille <demaille@gostai.com>
1949 Let yytranslate handle the eof case.
1950 * data/lalr1.cc (yytranslate_): Handle the EOF case.
1952 No longer expect yychar to be equal to yyeof_, rather, test the
1953 lookahead's (translated) kind.
1955 2008-11-11 Akim Demaille <demaille@gostai.com>
1957 yychar cannot be empty in yyerrlab.
1958 * TODO (yychar == yyempty_): New.
1959 * data/lalr1.cc: Remove the handling of this case.
1960 This eases forthcoming changes related to yychar and yytranslate.
1962 2008-11-11 Akim Demaille <demaille@gostai.com>
1964 Bench: syntactic sugar for %define/#define.
1965 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
1966 (&bench_push_parser, bench_variant_parser): Use this feature.
1970 2008-11-11 Akim Demaille <demaille@gostai.com>
1972 Less memory pressure on the "list" bench.
1973 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
1974 the values, to limit memory pressure.
1976 2008-11-11 Akim Demaille <demaille@gostai.com>
1978 Introduce make_symbol.
1979 make_symbol provides a means to construct a full symbol (kind,
1980 value, location) in a single shot. It is meant to be a Symbol
1981 constructor, parameterized by the symbol kind so that overloading
1982 would prevent incorrect kind/value pairs. Unfortunately
1983 parameterized constructors do not work well in C++ (unless the
1984 parameter also appears as an argument, which is not acceptable),
1985 hence the use of a function instead of a constructor.
1987 * data/lalr1.cc (b4_symbol_constructor_declaration_)
1988 (b4_symbol_constructor_declarations)
1989 (b4_symbol_constructor_specialization_)
1990 (b4_symbol_constructor_specializations)
1991 (b4_symbol_constructor_definition_)
1992 (b4_symbol_constructor_definitions): New.
1993 Use them where appropriate to generate declaration, declaration of
1994 the specializations, and implementations of the templated
1995 overloaded function "make_symbol".
1996 (variant::variant): Always define a default ctor.
1997 Also provide a copy ctor.
1998 (symbol_base_type, symbol_type): New ctor overloads for value-less
2000 (symbol_type): Now public, so that functions such as yylex can use
2003 2008-11-11 Akim Demaille <demaille@gostai.com>
2005 Inform m4 whether a tag is a valid id.
2006 * src/output.c (is_identifier): New.
2007 (symbol_definitions_output): Use it to define tag_is_id.
2008 But maybe this should be done at m4 level?
2010 2008-11-11 Akim Demaille <demaille@gostai.com>
2012 Test 214 was failing: it greps with a pattern containing [ ]*
2013 which obviously meant to catch spaces and tabs, but contained only
2014 spaces. Tabulations in sources are a nuisance, so to simplify the
2015 matter, get rid of all the tabulations in the Java sources. The
2016 other skeletons will be treated equally later.
2018 * data/java.m4, data/lalr1.java: Untabify.
2019 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
2020 tabulations are no longer generated.
2022 2008-11-11 Paolo Bonzini <bonzini@gnu.org>
2024 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
2025 * configure.ac: Adjust usage.
2026 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
2027 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
2028 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
2030 2008-11-10 Di-an Jan <dianj@freeshell.org>
2032 Workaround Java's ``code too large'' problem for parser tables
2033 in most cases, by using one function per initialization.
2034 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
2035 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
2036 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
2037 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
2038 (yytname_): Use b4_typed_parser_table.
2039 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
2040 ``code too large'' error.
2042 2008-11-10 Di-an Jan <dianj@freeshell.org>
2044 * NEWS: Document them.
2046 General Java skeleton improvements.
2047 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
2048 using gcj < 4.3 in the testsuite, according to comments in
2049 gnulib/m4/javacomp.m4.
2050 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
2051 location_type, position_type): Remove extraneous brackets from
2052 b4_percent_define_default.
2053 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
2054 m4_define and m4_define_default.
2055 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
2056 which marks the end of user code with appropriate syncline, like all
2057 the other skeletons.
2058 (b4_user_post_prologue): Add. Don't silently drop.
2060 (parse): Inline yylex.
2061 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
2062 (%{...%}): Fix typo of %code imports.
2063 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
2065 Support annotations on parser class with %define annotations.
2066 * data/lalr1.java (annotations): Add to parser class modifier.
2067 * doc/bison.texinfo (Java Parser Interface): Document
2068 %define annotations.
2069 (Java Declarations Summary): Document %define annotations.
2070 * tests/java.at (Java parser class modifiers): Test annotations.
2072 Do not generate code for %error-verbose unless requested.
2073 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
2074 Make private. Make conditional on %error-verbose.
2075 (getErrorVerbose, setErrorVerbose): New.
2076 (yytnamerr_): Make conditional on %error-verbose.
2077 (yysyntax_error): Make some code conditional on %error-verbose.
2078 * doc/bison.texinfo (Java Bison Interface): Remove the parts
2079 about %error-verbose having no effect.
2080 (getErrorVerbose, setErrorVerbose): Document.
2082 Move constants for token names to Lexer interface.
2083 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
2084 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
2085 (parse): Qualify EOF to Lexer.EOF.
2086 * doc/bison.texinfo (Java Parser Interface): Move documentation of
2087 EOF and token names to Java Lexer Interface.
2088 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
2090 Make yyerror public.
2091 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
2092 (yyerror): Change to public. Add Javadoc comments. Use longer
2093 parameter names. Make the body rather than the declarator
2094 conditional on %locations.
2095 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
2097 Allow user to add code to the constructor with %code init.
2098 * data/java.m4 (b4_init_throws): New, for %define init_throws.
2099 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
2100 Add %code init to the front of the constructor body.
2101 * doc/bison.texinfo (YYParser.YYParser): Document %code init
2102 and %define init_throws.
2103 (Java Declarations Summary): Document %code init and
2104 %define init_throws.
2105 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
2106 (Java constructor init and init_throws): Add tests.
2108 2008-11-10 Akim Demaille <demaille@gostai.com>
2111 * TODO (-D): is implemented.
2112 (associativity): Same precedence must have the same associativity.
2113 For instance, how can a * b / c be parsed if * is %left and / is
2115 (YYERRORCODE, YYFAIL, YYBACKUP): New.
2117 2008-11-10 Akim Demaille <demaille@gostai.com>
2121 2008-11-10 Akim Demaille <demaille@gostai.com>
2123 More information about the symbols.
2124 * src/output.c (type_names_output): Document all the symbols,
2125 including those that don't have a type-name.
2126 (symbol_definitions_output): Define "is_token" and
2128 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
2129 type-name, now that they are defined too in b4_type_names.
2131 2008-11-10 Akim Demaille <demaille@gostai.com>
2135 2008-11-10 Akim Demaille <demaille@gostai.com>
2137 Make parser::yytranslate static.
2138 Small speedup (1%) on the list grammar. And makes yytranslate_
2139 available in non member functions.
2141 * data/lalr1.cc (yytranslate_): Does not need to be a instance
2144 2008-11-10 Akim Demaille <demaille@gostai.com>
2146 Avoid trailing spaces.
2147 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
2148 * data/lalr1.cc: Don't indent before rule and symbol actions, as
2149 they can be empty, and anyway this incorrectly indents the first
2152 2008-11-10 Akim Demaille <demaille@gostai.com>
2156 2008-11-10 Akim Demaille <demaille@gostai.com>
2158 Use "enum" for integral constants.
2159 This is just nicer to read, I observed no speedup.
2161 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
2162 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
2163 (yyuser_token_number_max_, yyundef_token_): Move into...
2164 (yytranslate_): here.
2166 2008-11-10 Akim Demaille <demaille@gostai.com>
2168 Shortcuts in bench directives.
2169 * etc/bench.pl.in (parse_dirs): New.
2171 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
2172 Create the benches in "benches/".
2174 2008-11-10 Akim Demaille <demaille@gostai.com>
2177 * data/lalr1.cc: here.
2179 2008-11-10 Akim Demaille <demaille@gostai.com>
2181 Adjust verbose message to using emacs.
2182 * etc/bench.pl.in: Inform compilation-mode when we change the
2184 (generate_grammar_list): Recognize %define "variant" in addition
2187 2008-11-10 Akim Demaille <demaille@gostai.com>
2189 Classify symbols by type-name.
2190 * src/uniqstr.h (UNIQSTR_CMP): New.
2191 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
2192 (type_names_output): New.
2193 (muscles_output): Use it.
2194 * data/lalr1.cc (b4_symbol_action_): Remove.
2195 (b4_symbol_case_, b4_type_action_): New.
2196 Adjust uses of b4_symbol_action_ to use b4_type_action_.
2198 2008-11-10 Akim Demaille <demaille@gostai.com>
2200 Change the handling of the symbols in the skeletons.
2201 Before we were using tables which lines were the symbols and which
2202 columns were things like number, tag, type-name etc. It is was
2203 difficult to extend: each time a column was added, all the numbers had
2204 to be updated (you asked for colon $2, not for "tag"). Also, it was
2205 hard to filter these tables when only a subset of the symbols (say the
2206 tokens, or the nterms, or the tokens that have and external number
2207 *and* a type-name) was of interest.
2209 Now instead of monolithic tables, we define one macro per cell. For
2210 instance "b4_symbol(0, tag)" is a macro name which contents is
2211 self-decriptive. The macro "b4_symbol" provides easier access to
2214 * src/output.c (type_names_output): Remove.
2215 (symbol_numbers_output, symbol_definitions_output): New.
2216 (muscles_output): Call them.
2217 (prepare_symbols): Define b4_symbols_number.
2219 2008-11-10 Akim Demaille <demaille@gostai.com>
2222 * src/getargs.h, src/getargs.c (trace_muscle): New.
2223 (trace_types, trace_args): Support it.
2224 * src/output.c (output_skeleton): Use it.
2226 2008-11-10 Akim Demaille <demaille@gostai.com>
2229 * src/output.c (muscles_output): New, extracted from...
2230 (output_skeleton): here.
2233 2008-11-10 Akim Demaille <demaille@gostai.com>
2237 2008-11-10 Akim Demaille <demaille@gostai.com>
2239 Update the variant example.
2240 * examples/variant.yy: Formatting changes.
2243 2008-11-10 Akim Demaille <demaille@gostai.com>
2245 Support constructor with an argument.
2246 This improves the "list" bench by 2%.
2248 * data/lalr1.cc (variant::build): Add an overloaded version with
2250 * tests/c++.at (AT_CHECK_VARIANT): Check it.
2252 2008-11-10 Akim Demaille <demaille@gostai.com>
2255 * tests/c++.at (AT_CHECK_VARIANTS): New.
2256 Use it with and without %define assert.
2258 2008-11-10 Akim Demaille <demaille@gostai.com>
2260 Add %precedence support.
2261 Unfortunately it is not possible to reuse the %prec directive. This
2262 is because to please POSIX, we do not require to end the rules with a
2263 semicolon. As a result,
2267 is ambiguous: either a rule which precedence is that of baz, or a rule,
2268 and then a declaration of the precedence of the token baz.
2270 * doc/bison.texinfo: Document %precedence.
2271 (Precedence Only): New.
2272 * src/assoc.h, src/assoc.c (precedence_assoc): New.
2273 * src/conflicts.c (resolve_sr_conflict): Support it.
2274 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
2276 * tests/calc.at: Use %precedence for NEG.
2277 * tests/conflicts.at (%precedence does not suffice)
2278 (%precedence suffices): New tests.
2280 2008-11-09 Akim Demaille <demaille@gostai.com>
2282 Make benches in a sub dirs.
2283 * etc/bench.pl.in ($dir): New.
2285 Check the use of constructors with an argument.
2286 (bench_variant_parser): Fix.
2288 2008-11-09 Akim Demaille <demaille@gostai.com>
2292 2008-11-09 Akim Demaille <demaille@gostai.com>
2296 2008-11-09 Akim Demaille <demaille@gostai.com>
2298 Require the generation of parse-gram.output.
2299 * src/Makefile.am (YACC): Pass --report=all.
2301 2008-11-09 Akim Demaille <demaille@gostai.com>
2305 2008-11-09 Akim Demaille <demaille@gostai.com>
2308 * TODO: Remove obsolete items.
2311 2008-11-09 Akim Demaille <demaille@gostai.com>
2314 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
2315 (@token, $grammar, $bench): New.
2316 (generate_grammar_variant): Rename as...
2317 (generate_grammar_list): this.
2318 (generate_grammar): Adjust.
2319 (bench_grammar): Rename as...
2321 Use it in the various bench-marking routines.
2322 (-b, -g): New options.
2324 2008-11-09 Akim Demaille <demaille@gostai.com>
2326 Use a static hierarchy for symbols in the C++ parser.
2327 * data/lalr1.cc (symbol_base_type, symbol_type)
2328 (stack_symbol_type): Make it a static hierarchy.
2329 Adjust dependencies.
2331 2008-11-09 Akim Demaille <demaille@gostai.com>
2333 bench.pl -d, --directive.
2334 * etc/bench.pl.in (@directive): New.
2335 (&bench_grammar): Use it.
2336 (&bench_list_grammar): New, to provide access to the "variant"
2339 (getopts): Support -d, --directive.
2341 2008-11-09 Akim Demaille <demaille@gostai.com>
2343 Use inline for small operations.
2344 * data/lalr1.cc (symbol_base_type, symbol_type)
2345 (stack_symbol_type): Declare constructor and other operations as
2347 (yy_destroy_): Inline.
2349 2008-11-09 Akim Demaille <demaille@gostai.com>
2351 Introduce a hierarchy for symbols.
2352 * data/lalr1.cc (symbol_base_type, symbol_type): New.
2353 (data_type): Rename as...
2354 (stack_symbol_type): this.
2355 Derive from symbol_base_type.
2356 (yy_symbol_value_print_): Merge into...
2357 (yy_symbol_print_): this.
2360 (yydestruct_): Rename as...
2361 (yy_destroy_): this.
2362 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
2363 (parser::parse): yyla is now of symbol_type.
2364 Use its type member instead of yytoken.
2366 2008-11-09 Akim Demaille <demaille@gostai.com>
2368 Rename data_type and stack_symbol_type.
2369 * data/lalr1.cc (data_type): Rename as...
2370 (stack_symbol_type): this.
2372 2008-11-09 Akim Demaille <demaille@gostai.com>
2374 Handle semantic value and location together.
2375 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
2376 yydata.value and yydata.location.
2377 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
2378 (YY_SYMBOL_PRINT): Now take semantic value and location as a
2381 (yydestruct_): New overload for a stack symbol.
2383 2008-11-09 Akim Demaille <demaille@gostai.com>
2385 Push a complete symbol, not connected parts.
2386 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
2387 state, value and location.
2390 2008-11-09 Akim Demaille <demaille@gostai.com>
2392 Agregate yylval and yylloc.
2393 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
2394 (parser::yyla): this.
2396 2008-11-09 Akim Demaille <demaille@gostai.com>
2398 Rely on the state stack to display reduction traces.
2399 To display rhs symbols before a reduction, we used information
2400 about the rule reduced, which required the tables yyrhs and
2401 yyprhs. Now use rely only on the state stack to get the same
2404 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
2406 (parser::yyrhs_, parser::yyprhs_): Remove.
2407 (parser::yy_reduce_print_): Use the state stack.
2409 2008-11-09 Akim Demaille <demaille@gostai.com>
2411 Fuse yyval and yyloc into yylhs.
2412 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
2414 (parse): Replace yyval and yyloc with yylhs.value and
2416 After a user action, compute yylhs.state earlier.
2417 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
2420 2008-11-09 Di-an Jan <dianj@freeshell.org>
2422 Remove unused variable.
2423 * src/output.c (type_names_output): Remove unused variable sep.
2425 2008-11-09 Paolo Bonzini <bonzini@gnu.org>
2427 Change tests/output.at quoting.
2428 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
2429 expanding arguments.
2431 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
2433 Don't add a semicolon to actions for %skeleton or %language.
2434 It breaks Java test cases as reported by Akim Demaille.
2435 * src/scan-code.l: Implement.
2437 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
2439 Clean up %skeleton and %language priority implementation.
2440 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
2441 remove static qualifier because others will soon need to see it.
2442 (language_prio): Likewise.
2443 (getargs): Use command_line_prio rather than 0.
2444 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
2446 (skeleton_prio): Extern it.
2447 (language_prio): Extern it.
2448 * src/parse-gram.y: Use grammar_prio rather than 1.
2450 2008-11-07 Akim Demaille <demaille@gostai.com>
2452 Moving push traces into yypush_.
2453 * data/lalr1.cc (yypush_): Now takes a optional trace message.
2456 2008-11-07 Akim Demaille <demaille@gostai.com>
2458 The single-stack C++ parser is now the standard one.
2459 * data/lalr1.cc: Rename as...
2460 * data/lalr1-split.cc: this.
2461 * data/lalr1-fusion.cc: Rename as...
2462 * data/lalr1.cc: this.
2463 * etc/bench.pl.in: Adjust.
2465 2008-11-07 Akim Demaille <demaille@gostai.com>
2467 Avoid empty-if warnings.
2468 Reported by Quentin Hocquet.
2470 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
2471 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
2473 2008-11-07 Akim Demaille <demaille@gostai.com>
2475 Pass command line location to skeleton_arg and language_argmatch.
2476 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
2477 The location argument is now mandatory.
2478 Adjust all dependencies.
2479 (getargs): Use command_line_location.
2481 2008-11-07 Akim Demaille <demaille@gostai.com>
2484 * src/getargs.c (usage): Document -D.
2485 Fix help string for --locations.
2486 (command_line_location): New.
2487 (short_options, long_options, getargs): Support -D, --define.
2488 (getargs): Move -d support at the right place.
2489 * doc/bison.texinfo (Bison Options): Update.
2490 * tests/input.at (%define, --define): New.
2492 2008-11-07 Akim Demaille <demaille@gostai.com>
2494 Initialize the muscle table before parsing the command line.
2495 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
2496 (getargs): Define file_name.
2497 * src/main.c (main): Initialize muscle_tab before calling
2499 * src/muscle_tab.c (muscle_init): No longer define file_name, as
2500 its value is not available yet.
2502 2008-11-07 Akim Demaille <demaille@gostai.com>
2504 Locations without columns for command line arguments.
2505 * src/location.c (location_print): Don't display negative columns.
2506 * src/location.h: Document this.
2508 2008-11-07 Akim Demaille <demaille@gostai.com>
2511 * src/getargs.c (usage): Fix help string for -W.
2513 2008-11-07 Akim Demaille <demaille@gostai.com>
2515 Handle more general types of option arguments.
2516 * build-aux/cross-options.pl: The argument ends at the first
2517 space, not the first non-symbol character.
2518 Use @var for each word appearing the argument description.
2520 2008-11-07 Akim Demaille <demaille@gostai.com>
2522 Destroy the variants that remain on the stack in case of error.
2523 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
2525 Display the value only if yymsg is nonnull.
2526 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
2528 2008-11-07 Akim Demaille <demaille@gostai.com>
2530 Add "%define assert" to variants.
2531 This is used to help the user catch cases where some value gets
2532 ovewritten by a new one. This should not happen, as this will
2535 Unfortunately this uncovered a bug in the C++ parser itself: the
2536 lookahead value was not destroyed between two calls to yylex. For
2537 instance if the previous lookahead was a std::string, and then an int,
2538 then the value of the std::string was correctly taken (i.e., the
2539 lookahead was now an empty string), but std::string structure itself
2542 This is now done in variant::build(other&) (which is used to take the
2543 value of the lookahead): other is not only stolen from its value, it
2544 is also destroyed. This incurs a new performance penalty of a few
2545 percent, and union becomes faster again.
2547 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
2548 (b4_variant_if): New.
2549 (variant::built): New.
2550 Use it whereever the status of the variant changes.
2551 * etc/bench.pl.in: Check the penalty of %define assert.
2553 2008-11-07 Akim Demaille <demaille@gostai.com>
2555 Use "%define variant" in bench.pl.
2556 * etc/bench.pl.in: No longer use the pseudo directive %variants,
2557 just use %define variants.
2559 2008-11-07 Akim Demaille <demaille@gostai.com>
2562 * src/parse-gram.h, src/parse-gram.c: Regen.
2564 2008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
2566 Fix user actions without a trailing semicolon.
2567 Reported by Sergei Steshenko at
2568 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
2569 * THANKS (Sergei Steshenko): Add.
2570 * src/scan-code.l (SC_RULE_ACTION): Fix it.
2571 * tests/regression.at (Fix user actions without a trailing semicolon):
2574 2008-11-04 Akim Demaille <demaille@gostai.com>
2576 Use b4_copyright_years.
2577 * data/yacc.c (b4_copyright_years): New.
2578 Fix its value according to the comments in the file.
2579 Use it and undefine it.
2581 2008-11-04 Akim Demaille <demaille@gostai.com>
2584 * data/lalr1-fusion.cc, src/parse-gram.y: here.
2586 2008-11-04 Akim Demaille <demaille@gostai.com>
2589 * data/lalr1-fusion.cc: here.
2591 2008-11-04 Akim Demaille <demaille@gostai.com>
2593 Use strict on bench.pl.
2594 * etc/bench.pl.in (&run, &generate_grammar): New.
2595 Rename the grammar generating functions for consistency.
2596 Change the interface so that the list of benches to run is passed
2597 as (optionless) arguments.
2598 (&compile): Use &run.
2600 2008-11-04 Akim Demaille <demaille@gostai.com>
2602 Remove spurious initial empty lines.
2603 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
2604 * data/yacc.c: End the @output lines with an @.
2606 2008-11-04 Akim Demaille <demaille@gostai.com>
2608 Improve the display of sizes.
2609 * etc/bench.p.in: Higher precision.
2610 Sort by decreasing size.
2612 2008-11-04 Akim Demaille <demaille@gostai.com>
2614 Don't memcpy C++ structures.
2615 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
2617 (variant::build): New overload for
2618 copy-construction-that-destroys.
2619 (variant::swap): New.
2620 (parser::yypush_): Use it in variant mode.
2622 2008-11-04 Akim Demaille <demaille@gostai.com>
2624 Better defaults for bench.pl.
2625 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
2627 Adjust &verbose uses.
2630 2008-11-04 Akim Demaille <demaille@gostai.com>
2632 Make variant.yy more complex.
2633 std::list cannot be copied via memcpy, they are more demanding than
2634 std::string. Use one std::list to strengthen the test.
2636 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
2638 Create a list of strings, instead of a single large string.
2640 2008-11-04 Akim Demaille <demaille@gostai.com>
2643 * etc/bench.pl.in (--bench, $bench): New.
2645 2008-11-04 Akim Demaille <demaille@gostai.com>
2648 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
2649 Define it after as().
2651 2008-11-04 Akim Demaille <demaille@gostai.com>
2654 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
2656 2008-11-04 Akim Demaille <demaille@gostai.com>
2658 Issue missing synclines after user actions.
2659 * data/c.m4 (b4_case): Issue synclines on the output file.
2661 2008-11-04 Akim Demaille <demaille@gostai.com>
2663 Remove trailing empty line.
2664 * data/lalr1-fusion.cc: Don't add an empty line after the user's
2667 2008-11-04 Akim Demaille <demaille@gostai.com>
2669 Fix output of copyright years.
2670 * data/bison.m4 (b4_copyright): Fix the indentation of the
2671 copyright year paragraph.
2672 Use b4_copyright_years when no years are given.
2673 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
2674 (b4_copyright_years): New.
2677 2008-11-04 Akim Demaille <demaille@gostai.com>
2679 Avoid the spurious initial empty line.
2680 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
2681 the end of @output request to suppress the empty line that
2684 2008-11-04 Akim Demaille <demaille@gostai.com>
2686 Remove parser::rhs_number_type.
2687 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
2688 (yyrhs_): Use b4_table_define.
2690 2008-11-04 Akim Demaille <demaille@gostai.com>
2693 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
2695 2008-11-04 Akim Demaille <demaille@gostai.com>
2697 Factor the declaration of the integer tables.
2698 * data/lalr1-fusion.cc (b4_table_define): New.
2701 2008-11-03 Akim Demaille <demaille@gostai.com>
2703 Fix indentation of tables in lalr1.cc
2704 * data/lalr1-fusion.cc: Fix the indentation.
2706 2008-11-03 Akim Demaille <demaille@gostai.com>
2708 Destroy the lhs symbols after reduction.
2709 * data/lalr1-fusion.cc (parse): After the user action, when in
2710 variant mode, destroy the lhs symbols.
2712 2008-11-03 Akim Demaille <demaille@gostai.com>
2714 Simplify yysyntax_error_ use.
2715 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
2716 type, but make it unnamed in the declaration when it is not used.
2718 2008-11-03 Akim Demaille <demaille@gostai.com>
2720 Let yy::variant::build return an lvalue.
2721 * data/lalr1-fusion.cc (variant::build): Return a reference to the
2724 2008-11-03 Akim Demaille <demaille@gostai.com>
2726 Define yy::variant only when needed.
2727 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
2730 2008-11-03 Akim Demaille <demaille@gostai.com>
2732 Bench the three-stack lalr1.cc.
2733 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
2736 2008-11-03 Akim Demaille <demaille@gostai.com>
2738 Fail on parse error in calc++.
2739 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
2741 * examples/calc++/test ($me, $number, $exit, run): New.
2742 Use them to propagate errors to the exit status.
2744 2008-11-03 Akim Demaille <demaille@gostai.com>
2746 Don't specify the skeleton twice in the example.
2747 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
2748 file does what is needed.
2750 2008-11-03 Akim Demaille <demaille@gostai.com>
2752 bench: Improve output.
2753 * etc/bench.pl.in (bench_grammar): Tune the printf format.
2755 2008-11-03 Akim Demaille <demaille@gostai.com>
2757 bench: check impact of %debug on variants.
2758 * etc/bench.pl.in (variant_grammar): Fix the computation of
2760 Generate a grammar file that can work with or without %debug.
2761 Do use the @directive.
2762 (bench_variant_parser): Check impact of %debug.
2763 (@directives): Rename all the occurrences to...
2764 (@directive): this, for consistency.
2766 2008-11-03 Akim Demaille <demaille@gostai.com>
2768 bench: report the size too.
2769 * etc/bench.pl.in ($iterations): Defaults to -3.
2770 (&bench_grammar): Require hireswallclock.
2771 Compute and display the size of the result.
2774 2008-11-03 Akim Demaille <demaille@gostai.com>
2776 bench: More use of the verbosity level.
2777 * etc/bench.pl.in ($verbose, &verbose): New.
2779 More POD documentation.
2781 2008-11-03 Akim Demaille <demaille@gostai.com>
2783 bench.pl: a command line interface
2784 * etc/bench.pl.in: More doc.
2785 Some fixes in the documentation.
2786 ($cflags, $iterations, &help, &getopt): New.
2788 (&variant_grammar): Let the number of stages be 10 times what is
2791 2008-11-03 Akim Demaille <demaille@gostai.com>
2793 Bench the use of Boost.Variants.
2794 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
2796 (&compile): Be ready to compile C++ parsers.
2797 (&bench_push_parser): Move debug information to the outermost
2799 * THANKS: Add Michiel De Wilde.
2801 2008-11-03 Akim Demaille <demaille@gostai.com>
2803 bench.pl: Pass directives as a list instead of as a string.
2804 * etc/bench.pl.in (&directives): New.
2805 (&triangular_grammar, &calc_grammar): Use it to format the Bison
2807 (&triangular_grammar): Do use the directives (were ignored).
2808 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
2811 2008-11-03 Akim Demaille <demaille@gostai.com>
2813 Improve genericity of bench.pl.
2814 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
2816 (&bench_push_parser): New.
2819 2008-11-03 Akim Demaille <demaille@gostai.com>
2821 Add documentation to bench.pl.
2822 * etc/bench.pl.in: Comment changes.
2824 2008-11-03 Akim Demaille <demaille@gostai.com>
2826 Fuse the three stacks into a single one.
2828 In order to make it easy to perform benchmarks to ensure that
2829 there are no performance loss, lalr1.cc is forked into
2830 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
2833 Meanwhile, to make sure that lalr1-fusion.cc is correctly
2834 exercized by the test suite, the user must install a symbolic link
2835 from lalr1.cc to it.
2837 Instead of having three stacks (state, value, location), use a
2838 stack of triples. This considerably simplifies the code (and it
2839 will be easier not to require locations as currently does the C++
2840 parser), and also gives a 10% speedup according to
2841 etc/bench (probably mainly since memory allocation is done once
2842 instead of three times).
2844 Another motivation is to make it easier to destruct properly
2845 semantic values: now that they are bound to their state (hence
2846 symbol type) it will be easier to call the appropriate destructor.
2848 These changes should probably benefit the C parser too.
2850 * data/lalr1.cc: Copy as...
2851 * data/lalr1-fusion.cc: this new file.
2852 (b4_rhs_value, b4_rhs_location): New definitions overriding those
2854 (state_stack_type, semantic_stack_type, location_stack_type)
2855 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
2856 (data_type, stack_type, yystack_): New.
2857 (YYLLOC_DEFAULT, yypush_): Adjust.
2858 (yyerror_range): Now based on data_type, not location_type.
2860 2008-11-03 Akim Demaille <demaille@gostai.com>
2862 Push the state, value, and location at the same time.
2863 This is needed to prepare a forthcoming patch that fuses the three
2866 * data/lalr1.cc (parser::yypush_): New.
2867 (parser::yynewstate): Change the semantics: instead of arriving to
2868 this label when value and location have been pushed, but yystate
2869 is to be pushed on the state stack, now the three of them must
2870 have been pushed before. yystate still must be the new state.
2871 This allows to use yypush_ everywhere instead of individual
2872 handling of the stacks.
2874 2008-11-03 Akim Demaille <demaille@gostai.com>
2876 Prefer references to pointers.
2877 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
2878 definition to use references instead of pointers.
2879 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
2880 Take the value and location as references.
2883 2008-11-03 Akim Demaille <demaille@gostai.com>
2885 stack::size instead of stack::height.
2886 * data/lalr1.cc (stack::height): Rename as...
2887 (stack::size): this.
2888 Fix the output type.
2891 2008-11-03 Akim Demaille <demaille@gostai.com>
2893 Use variants to support objects as semantic values.
2894 This patch was inspired by work by Michiel De Wilde. But he used
2895 Boost variants which (i) requires Boost on the user side, (ii) is
2896 slow, and (iii) has useless overhead (the parser knows the type of
2897 the semantic value there is no reason to duplicate this
2898 information as Boost.Variants do).
2900 This implementation reserves a buffer large enough to store the
2901 largest objects. yy::variant implements this buffer. It was
2902 implemented with Quentin Hocquet.
2904 * src/output.c (type_names_output): New.
2905 (output_skeleton): Invoke it.
2906 * data/c++.m4 (b4_variant_if): New.
2907 (b4_symbol_value): If needed, provide a definition for variants.
2908 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
2909 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
2910 (b4_char_sizeof, yy::variant): New.
2911 (parser::parse): If variants are requested, define
2912 parser::union_type, parser::variant, change the definition of
2913 semantic_type, construct $$ before running the user action instead
2914 of performing a default $$ = $1.
2915 * examples/variant.yy: New.
2916 Based on an example by Michiel De Wilde.
2918 2008-11-03 Akim Demaille <demaille@gostai.com>
2920 Parameterize the extraction of semantic values.
2921 To make future changes easier, no longer rely on ".TYPE" being the
2922 way to get a semantic value.
2924 * data/c.m4 (b4_symbol_value): New.
2926 * data/c++.m4, data/yacc.c: Use it.
2927 * data/glr.c: Use b4_symbol_value.
2931 2008-11-03 Akim Demaille <demaille@gostai.com>
2933 Prepare easier M4 changes.
2934 * data/lalr1.cc: Use escaped [] instead of literals to prepare
2937 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2939 Initiate further development.
2940 * NEWS: Create an empty section for new entries.
2941 * gnulib: Update submodule to HEAD.
2943 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2945 * NEWS: Version 2.4.
2947 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2949 Prepare for next release.
2950 * NEWS: Briefly mention changes since 2.3b.
2951 * README: Say GNU m4 1.4.6, which we've been requiring in release
2952 announcements already, not 1.4.3, which breaks the build.
2954 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2956 Say %language is experimental.
2957 We're thinking of extending it's effect on output file naming. See the
2959 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
2960 * NEWS: Say it's experimental.
2961 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
2962 recommend it over %skeleton for now.
2963 (Bison Options): Likewise.
2964 (C++ Bison Interface): Use %skeleton not %language.
2965 (Calc++ Parser): Use %skeleton not %language.
2966 * src/getargs.c (usage): Say it's experimental.
2968 2008-11-01 Di-an Jan <dianj@freeshell.org>
2969 Paolo Bonzini <bonzini@gnu.org>
2971 Support all Java parser class modifiers.
2972 * data/java.m4 (b4_percent_define_get3): New.
2973 (b4_final_if, b4_strictfp_if): New.
2974 * data/lalr1.java (final, strictfp, extends, implements): Support.
2975 * doc/bison.texinfo (final, strictfp, extends, implements): Add
2977 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
2978 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
2979 (AT_CHECK_JAVA_GREP): New.
2980 (Java parser class modifiers): New test.
2981 (Java parser class extends and implements): New test.
2983 Model exception propagation better with throws and lex_throws.
2984 * data/java.m4 (b4_list2): New.
2985 (throws): Change default.
2986 * data/lalr1.java (yyaction): Add throws.
2987 (parse): Add lex_throws in addition to throws.
2988 * doc/bison.texinfo (throws, lex_throws): Add documentation.
2989 * tests/java.at (Java throws specifications): New test.
2991 Improve documentation for Java parsers.
2992 * doc/bison.texinfo (Java Parsers): Add subsections.
2993 Don't quote first argument of %define.
2994 (Java Bison Interface): Document output files. Move documentation
2995 of parser class and merge into Java Parser Interface. Document
2996 features that error out. Document directives with no effect.
2997 Move note about Javadoc higher.
2998 (Java Semantic Values): Explicitly mention stype.
2999 Document that generic types cannot be used.
3000 (Java Location Values): Use @deftypeivar. Document constructors.
3001 Correct return value for toString.
3002 (Java Parser Interface): List undocumented constants/fields.
3003 Move documentation of fields added by %parse-param closer to list
3004 of members. Document that token names are added as fields.
3005 Document constructors accurately. Remove error method.
3006 (Java Scanner Interface): Move note on %pure-parser to Java Bison
3007 Interface. Describe %code lexer and yylex accutately.
3008 Remove documentation that does not match the code.
3009 (Java Action Features): New.
3010 (Java Differences): Add reference. Add item on semantic values.
3011 Add note about @{ ... @}. Clarify %% epilogue placement.
3012 (Java Declarations Summary): New.
3015 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
3016 (b4_remove_comma): Quote test argument.
3017 (b4_identification): Remove "bison" field.
3018 * tests/java.at (Java parser class and package names): New test.
3019 (Java %parse-param and %lex-param): New test.
3020 (Java stype, position_class and location_class): New test.
3022 2008-10-31 Di-an Jan <dianj@freeshell.org>
3024 * data/lalr1.jave: Update copyright years.
3025 (YYParser): Correct name of "generated from" file in Javadoc:
3026 use b4_file_name instead of @ofile@.
3027 (Location constructor): Correct Javadoc parameter name.
3028 (yylloc): Add missing opening m4 quote after b4_location_if.
3029 This removes a stray [ in the Javadoc of Lexer.getStartPos.
3030 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
3031 (YYParser constructor): Correct Javadoc parameter name.
3033 2008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
3035 Always put auxiliary code files in the same dir as other output files.
3036 * src/files.c (compute_file_name_parts): When the user specifies
3037 --output but not --file-prefix, extract the directory prefix from the
3038 file prefix not from the grammar file name. This affects the location
3039 of files like location.hh generated by the C++ skeleton. The includes
3040 in the other output files require this fix.
3041 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
3042 for expected output files.
3043 (Output files): Add a test for the above.
3045 2008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
3047 * gnulib: Update submodule to HEAD.
3049 2008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3051 Update copyright year.
3052 * src/files.c: Here.
3054 2008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
3056 Don't overwrite the input file.
3057 * src/files.c (output_file_name_check): Fatal error if using input file
3059 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
3061 (Conflicting output files): Add test.
3063 2008-10-28 Akim Demaille <demaille@gostai.com>
3066 * data/lalr1.cc: Formatting changes.
3068 2008-10-28 Akim Demaille <demaille@gostai.com>
3070 Don't define debugging functions when !YYDEBUG.
3071 * data/lalr1.cc (debug_stream, set_debug_stream)
3072 (debug_level_type, debug_level, set_debug_level): Don't
3073 declare them when YYDEBUG is not defined.
3074 The implementation are already YYDEBUG-aware.
3076 2008-10-28 Akim Demaille <demaille@gostai.com>
3078 Prefer "continue" for empty loop bodies.
3079 * etc/bench.pl.in: Use "continue" instead of {}.
3081 2008-10-28 Akim Demaille <demaille@gostai.com>
3083 Space and comments changes.
3084 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
3085 * data/c.m4, data/lalr1.cc: Space changes.
3087 2008-10-28 Akim Demaille <demaille@gostai.com>
3089 Make gnulib a submodule.
3091 * .gitmodules (gnulib): New.
3093 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
3095 Fix yyerror_range for user-defined location type in C++. Reported by
3097 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
3098 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
3099 * THANKS (Georg Sauthoff): Add.
3101 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
3103 Update several administrative files mainly to facilitate releasing.
3104 * HACKING (Administrivia): Make the git-merge-changelog notes more
3106 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
3107 (Release Procedure): Update for git and add numerous details that were
3109 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
3110 * maint.mk (announcement): Don't list bison as a bootstrap tool so
3111 that announcements don't claim we bootstrapped with whatever bison
3112 happened to be in PATH. Add flex as a bootstrap tool.
3113 * Makefile.maint: Remove, previously replaced by maint.mk.
3114 * Makefile.cfg: Remove, and migrate settings to...
3115 * cfg.mk: ... here for the sake of `make announcement'.
3116 * bootstrap.conf (gnulib_modules): Add announce-gen.
3117 * README: Say GNU Bison instead of just Bison. Suggested by Karl
3120 2008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
3122 Small but important bugfixes for the Java skeleton.
3123 * data/lalr1.java (yyerror): Change Location to b4_location_type.
3124 (yy_symbol_print): Call toString on yyvaluep.
3126 2008-08-29 Akim Demaille <demaille@gostai.com>
3128 Clarify UPDATED use.
3129 * doc/bison.texinfo: It refers to the last edition of this file,
3130 not to the release date of Bison.
3131 Reported by Joel E. Denny.
3133 2008-08-29 Akim Demaille <demaille@gostai.com>
3135 * README: Update FAQ pointer.
3136 Reported by Joel E. Denny.
3138 2008-08-27 Eric Blake <ebb9@byu.net>
3140 Resync m4sugar from autoconf.
3141 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
3142 (m4_init): Adjust to latest m4.git changes.
3143 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
3145 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
3146 (_m4_list_cmp): Reduce side effects.
3148 2008-08-27 Akim Demaille <demaille@gostai.com>
3150 Check yyerrok in calc.at.
3151 * tests/calc.at (calc.y): Use yyerrok on "( error )".
3152 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
3155 2008-08-27 Akim Demaille <demaille@gostai.com>
3157 Support yyerrok in lalr1.cc.
3158 YYBACKUP is still to import back into lalr1.cc.
3159 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
3161 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
3163 For maintainer-check*, don't recompile for a $(VERSION) update.
3165 (_is-dist-target): Override the one in GNUmakefile.
3166 * Makefile.am (EXTRA_DIST): Add cfg.mk.
3168 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
3170 Update for recent change to gnulib.
3171 * src/parse-gram.y: Don't include strverscmp.h. It comes from
3174 2008-08-15 Eric Blake <ebb9@byu.net>
3176 Remaining m4sugar merge from autoconf.
3177 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
3178 * data/m4sugar/foreach.m4: New file, copied from autoconf.
3179 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
3180 * src/output.c (output_skeleton): Tell m4 how to find it.
3182 Partial m4sugar merge from autoconf: m4_map.
3183 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
3184 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
3185 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
3186 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
3188 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
3190 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
3193 2008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
3195 Keep .version and PACKAGE_VERSION in sync.
3196 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
3197 dependency, and add comments justifying this in more detail. Discussed
3199 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
3201 2008-08-06 Eric Blake <ebb9@byu.net>
3203 Partial m4sugar merge from autoconf: m4_shiftn.
3204 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
3205 (m4_shift2, m4_shift3): New macros.
3206 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
3207 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
3208 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
3209 * data/java.m4 (b4_remove_comma): Likewise.
3211 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
3212 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
3213 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
3214 (m4_init): Consolidate wrapped text into single m4_wrap.
3215 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
3218 2008-08-05 Eric Blake <ebb9@byu.net>
3220 Partial m4sugar merge from autoconf: builtins, version.m4.
3221 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
3222 (m4_prepend): Remove, as it is unused and inherently quadratic,
3223 whereas m4_append is linear in newer m4.
3224 (m4_mkstemp): New builtin.
3225 (m4_symbols): Make rename conditional.
3226 (m4_version_prereq): Ensure fatal error if used in bison, which
3227 intentionally lacks version.m4.
3229 Fix comments in m4sugar.
3230 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
3232 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3234 Update for recent .gitignore fix in Gnulib.
3235 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
3236 anchored .gitignore entries.
3238 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3240 Set gnu or gnits strictness.
3241 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
3242 development and gnits strictness for releases. Based on Eric Blake's
3244 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
3246 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
3248 * NEWS: Clarify documentation of %language.
3250 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
3252 Support usage of git-merge-changelog.
3253 * .gitattributes: New.
3254 * HACKING: Document usage of git-merge-changelog.
3255 * bootstrap: Install git-merge-changelog entries in .git/config
3258 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3260 Remove remaining dependence on CVS Id keyword.
3261 * ChangeLog: For the sake of people still using CVS, don't use dollars
3263 * data/xslt/bison.xsl: Remove Id from header comments, where it was
3265 * data/xslt/xml2dot.xsl: Likewise.
3266 * data/xslt/xml2text.xsl: Likewise.
3267 * data/xslt/xml2xhtml.xsl: Likewise.
3268 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
3269 * doc/Makefile.am (neutralize): Remove, no longer needed.
3270 (.x.1): Don't use neutralize.
3271 (edit): Don't substitute for ID.
3272 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
3274 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3276 Fix dependence on computed configure variables.
3277 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
3278 $(top_srcdir)/configure.ac so that changes to computed variables, such
3279 as PACKAGE_VERSION, are seen.
3280 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
3282 2008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
3284 Update copyright dates for recent changes.
3285 * Makefile.am: Here.
3286 * src/Makefile.am: Here.
3287 * src/reduce.c: Here.
3288 * tests/reduce.at: Here.
3290 2008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
3292 Use git-version-gen for version names between releases.
3293 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
3294 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
3295 * .prev-version: New.
3296 * .version.in: Remove.
3297 * ChangeLog: Remove the Id previously used for capturing the CVS
3299 * GNUmakefile: Remove, now copied from Gnulib.
3300 * Makefile.am: Add code suggested by comments in
3301 build-aux/git-version-gen.
3302 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
3303 .prev-version, and .version.
3304 * NEWS (2.3b+): Rename to...
3305 (?.?): ... this because we're dropping the "+" version naming scheme,
3306 but, in general, we still can't be sure of our next release name.
3307 * bootstrap: Add a quick hack to remove from .gitignore the
3308 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
3309 entry. This should really be fixed in gnulib instead.
3310 * bootstrap.conf (gnulib_modules): Add gnumakefile.
3311 * configure.ac (AC_INIT): Set version name by invoking
3312 build-aux/git-version-gen.
3313 (AC_CONFIG_FILES): Remove .version, now generated by
3314 build-aux/git-version-gen.
3315 * maint.mk: New, copied from coreutils.
3316 * doc/.cvsignore (bison.1): Add.
3317 * doc/.gitignore (/bison.1): Add.
3318 * doc/bison.1: Remove, generated.
3319 * src/.cvsignore (revision.c): Remove.
3320 * src/.gitignore (/revision.c): Remove.
3321 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
3322 (BUILT_SOURCES): Remove revision.c.
3323 (revision.c): Remove.
3324 * src/getargs.c (version): Don't print revision after the VERSION.
3325 * src/revision.h: Remove.
3327 2008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
3329 Fix untranslatable composition of sentences. Reported by Goran
3331 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
3332 * THANKS (Goran Uddeborg): Add.
3333 * src/reduce.c (reduce_print): Report the number of nonterminals and
3334 rules useless in the grammar in separate sentences.
3335 * tests/reduce.at (Useless Rules): Update output.
3336 (Reduced Automaton): Likewise.
3337 (Underivable Rules): Likewise.
3338 (Empty Language): Likewise.
3340 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3342 Fix some .gitignore and .cvsignore problems.
3343 * bootstrap (insert_sorted_if_absent): Replace all uses with...
3344 (insert_vc_ignore): ... this new function, which prepends `/' to all
3345 .gitignore entries before passing them to insert_sorted_if_absent.
3346 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
3347 .cvsignore files are maintained even though Bison developers run
3348 bootstrap while using Git.
3349 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
3352 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
3353 unneeded. Reported by Eric Blake.
3354 * lib/.gitignore (/*~): Add.
3355 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
3356 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
3358 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
3360 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3362 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
3363 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
3364 * bootstrap.conf (gnulib_modules): Add unsetenv.
3365 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
3366 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
3368 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
3369 the first argument because it may become position-dependent, and unset
3370 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
3371 Add comments explaining these issues in more detail.
3373 2008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
3375 Add .gitignore everywhere based on .cvsignore.
3377 * build-aux/.gitignore: New.
3378 * data/.gitignore: New.
3379 * doc/.gitignore: New.
3380 * etc/.gitignore: New.
3381 * examples/.gitignore: New.
3382 * examples/calc++/.gitignore: New.
3383 * lib/.gitignore: New.
3384 * m4/.gitignore: New.
3385 * po/.gitignore: New.
3386 * runtime-po/.gitignore: New.
3387 * src/.gitignore: New.
3388 * tests/.gitignore: New.
3390 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3392 * NEWS (2.3b+): New section, empty for now.
3393 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
3395 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3397 * NEWS (2.3b): Update release date since there has been a delay in
3398 getting the announcements and tarballs out.
3400 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
3402 * NEWS: Version 2.3b.
3403 * configure.ac (AC_INIT): Likewise.
3404 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
3406 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
3408 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
3409 been doing it for years.
3410 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
3411 (Release Procedure): Add FIXME about make alpha being unmaintained.
3413 2008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
3415 * data/yacc.c: Reformat m4 a little for readability.
3416 * src/lalr.c (build_relations): Correct comment.
3418 2008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3420 DJGPP specific issue.
3421 * djgpp/config.sed: Fixes required to run configure scripts generated
3424 2008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
3426 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
3427 coordinator@translationproject.org.
3429 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3431 * THANKS: Add Eric Blake.
3433 2008-04-23 Eric Blake <ebb9@byu.net>
3435 Revert prior patch, by working around autoconf regression.
3436 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
3437 ("Output file name: ("): Uncomment test.
3438 ("Output file name: )"): Likewise.
3439 Based on an idea from Noah Misch.
3441 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3443 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
3444 2.61. Reported by Juan Manuel Guerrero at
3445 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
3446 * tests/output.at ("Output file name: ("): Comment out test case for
3448 ("Output file name: )"): Likewise.
3450 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3452 * GNUmakefile: Update git-version-gen invocation so make dist
3455 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3457 Update to the current gnulib CVS repository, and fix trigraph handling
3459 * bootstrap: Update gnulib CVS repository URL.
3460 (symlink_to_dir): Encapsulate the code that guarantees the destination
3461 directory exists into...
3462 (check_dst_dir): ... this new function, and...
3463 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
3464 fail when copying files into lib/uniwidth/.
3465 * src/output.c (prepare_symbols): When writing yytname muscles, where
3466 symbol names will be encoded in C-string literals, tell quotearg to
3467 escape trigraphs. This used to be the default in gnulib.
3468 * tests/regression.at (Token definitions): Because of the change in
3469 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
3470 escapes trigraphs in symbol names. Thus, yytname no longer has
3471 trigraphs unnecessarily doubly escaped. Update test case output.
3472 Extend test case to be sure Bison's own error messages will no longer
3473 have trigraphs in symbol names unnecessarily escaped once.
3475 2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
3477 Fix make dist infinite loop reported by Juan Manuel Guerrero at
3478 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
3479 * .cvsignore: Add .version.
3481 * bootstrap.conf (gnulib_modules): Add git-version-gen.
3482 * configure.ac (AC_CONFIG_FILES): Add .version.
3483 * build-aux/.cvsignore: Add git-version-gen.
3485 2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
3487 * NEWS (2.3a+): Mention that -g now takes an argument.
3488 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
3489 consistency. Update the -g and -x entries now that they take
3490 arguments. Use brackets to indicate optional arguments.
3491 * src/getargs.c (usage): Explain the relationship between arguments of
3492 long and short options more completely. Document --defines and -d
3493 separately since the former takes an argument but, for POSIX Yacc, the
3495 (short_options): Let -W take an optional argument like --warnings.
3496 (getargs): Sort cases.
3498 2008-02-28 Akim Demaille <demaille@gostai.com>
3500 * doc/bison.texinfo: Fix a few typos.
3502 2008-02-28 Akim Demaille <akim@epita.fr>
3504 * doc/bison.texinfo (Bison Options): Document -W.
3505 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
3507 2008-02-28 Akim Demaille <akim@epita.fr>
3509 * src/getargs.c (short_options): Split and sort for readability.
3510 -g and -x take optional arguments, just like their long options.
3511 * build-aux/cross-options.pl: Use /x to make the regexp easier to
3513 Fix the handling of $opt which resulted in all the argument to be
3514 considered as optional.
3516 2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
3518 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
3519 say its interface is experimental.
3520 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
3522 (Bison Options): In the -L and --language entry, mention Java.
3523 (Java Bison Interface): Say the interface is experimental.
3524 * src/getargs.c (usage): Mention -L and --language.
3526 * NEWS (2.3a+): Say the push parsing interface is experimental.
3527 * doc/bison.texinfo (Push Decl): Likewise.
3528 (Decl Summary): Likewise in the "%define api.push_pull" entry.
3529 (Push Parser Function): Likewise.
3530 (Pull Parser Function): Likewise.
3531 (Parser Create Function): Likewise.
3532 (Parser Delete Function): Likewise.
3533 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
3534 yypull_parse, and yypush_parse entries.
3536 * NEWS (2.3a+): Mention XML support, and say the schema is
3538 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
3539 * src/getargs.c (usage): Say the XML schema is experimental.
3541 * NEWS (2.3a+): Say option instead of flag.
3543 2008-02-21 Wojciech Polak <polak@gnu.org>
3545 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
3548 2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
3550 Fix impure push parser compile error reported by Bob Rossi at
3551 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
3552 * data/yacc.c: Clean up whitespace in the output a little.
3553 (yypstate_allocated): Define for impure push parsers regardless of
3554 whether the pull interface is also requested.
3555 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
3556 check impure push parsers without the pull interface.
3558 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
3559 yyerror takes arguments specified by %parse-param while yypstate_new
3561 * doc/bison.texinfo (Parser Create Function): Document that
3562 yypstate_new returns 0 for multiple impure parser instances.
3563 * tests/push.at (Push Parsing: Multiple impure instances): Update
3564 expected stderr output.
3566 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3568 * runtime-po/POTFILES.in (push.c): Remove.
3570 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3572 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
3573 * data/push.c: Rename to...
3574 * data/yacc.c: ... this, overwriting it.
3575 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
3576 `%push-pull-parser' -> `%define api.push_pull "both"'.
3577 Remove old yacc.c tests, and update push.c tests to yacc.c.
3579 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3581 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
3582 `"%code top" blocks' instead of `%code "top" blocks'.
3583 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
3584 Clean up whitespace in the output a little.
3586 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3588 Fix documentation problems reported by Tim Josling at
3589 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
3590 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
3591 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
3592 integers. Explain the effect of literal string aliases on error
3593 messages. Copy token 0 documentation from the C++ skeleton
3596 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3598 Accept a token number in a %left, %right, or %nonassoc for POSIX
3599 conformance. Reported by Tim Josling at
3600 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
3601 * NEWS (2.3a+): Mention.
3602 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
3603 and code numbers are treated by precedence declarations.
3604 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
3606 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
3608 (symbol.prec): New, just like symbol but allows INT.
3609 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
3611 * tests/regression.at (Token number in precedence declaration): New
3614 2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3616 DJGPP specific issues.
3617 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
3618 be changed. Copyright timestamp adjusted.
3619 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
3620 be changed. Copyright timestamp adjusted.
3621 * djgpp/config.site: Copyright timestamp adjusted.
3622 * djgpp/config_h.sed: Copyright timestamp adjusted.
3623 * djgpp/djunpack.bat: Copyright timestamp adjusted.
3624 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
3625 filename translation list.
3626 * djgpp/subpipe.c (init_subpipe): Check the environment variables
3627 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
3628 files shall be created. Before trying to use the temp dir where the
3629 environment variable points to check that the dir really exists. If
3630 not default to the cwd as temp dir. Copyright timestamp adjusted.
3631 * djgpp/subpipe.h: Copyright timestamp adjusted.
3632 * djgpp/testsuite.sed: Copyright timestamp adjusted.
3634 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
3636 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
3638 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
3640 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
3641 Problem reported by Claudio Saavedra in
3642 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
3644 2008-01-05 Wojciech Polak <polak@gnu.org>
3646 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
3647 document's title with the input grammar file name.
3649 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
3651 Automate regression testing of the XML/XSLT implementation. Discussed
3653 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
3654 * configure.ac (XSLTPROC): New substitution.
3655 * Makefile.am (maintainer-xml-check): New phony target invoking...
3656 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
3657 invoking make maintainer-check with BISON_TEST_XML=1.
3658 * tests/atlocal.in (XSLTPROC): New.
3659 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
3660 not to report reachable memory when Bison is expected to have a
3661 non-zero exit status and (2) to compare XML/XSLT output with --graph
3662 and --report=all output for every working grammar when
3664 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
3665 (AT_BISON_CHECK_XML): New.
3666 (AT_QUELL_VALGRIND): New.
3667 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
3668 (AT_CHECK): ... don't redefine this since this was the old way to
3670 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
3671 AT_BISON_CHECK invocations.
3672 * tests/c++.at: Likewise.
3673 * tests/calc.at: Likewise.
3674 * tests/conflicts.at: Likewise.
3675 * tests/cxx-type.at: Likewise.
3676 * tests/existing.at: Likewise.
3677 * tests/glr-regression.at: Likewise.
3678 * tests/headers.at: Likewise.
3679 * tests/input.at: Likewise.
3680 * tests/java.at: Likewise.
3681 * tests/output.at: Likewise.
3682 * tests/push.at: Likewise.
3683 * tests/reduce.at: Likewise.
3684 * tests/regression.at: Likewise.
3685 * tests/sets.at: Likewise.
3686 * tests/skeletons.at: Likewise.
3687 * tests/synclines.at: Likewise.
3688 * tests/torture.at: Likewise.
3689 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
3690 tends to hang xsltproc.
3691 (Big horizontal): Likewise.
3693 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3695 In XML output, remove redundant class attribute on symbol element.
3696 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
3697 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
3698 look up a symbol to determine whether it's a nonterminal or terminal.
3699 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
3700 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
3702 Add prec/assoc information to XML output.
3703 * src/gram.c (grammar_rules_print_xml): For each rule that has a
3704 %prec, add a percent_prec attribute.
3705 * src/print-xml.c (print_grammar): For each terminal that has a
3706 precedence or associativity, add a prec or assoc attribute.
3708 (xml_puts): Use xml_indent.
3709 (xml_printf): Use xml_indent.
3710 * src/print-xml.h (xml_indent): Prototype.
3712 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
3713 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
3715 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3717 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
3718 (bison:ruleByNumber): ... this for clarity.
3719 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
3720 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
3721 (xsl:template match="reduction"): Update.
3722 (xsl:template match="item"): Update.
3723 (xsl:template match="reduction"): Update.
3725 In the XML output, don't print the list of rules where symbols appear.
3726 Compute it in XSLT instead. Discussed at
3727 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
3728 * data/xslt/bison.xsl (bison:ruleByLhs): New.
3729 (bison:ruleByRhs): New.
3730 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
3732 (xsl:template match="terminal/rule"): Remove.
3733 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3735 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3737 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
3738 bison:ruleByRhs and mode="number-link" for rule template.
3739 (xsl:template match="terminal/rule"): Remove.
3740 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3741 bison:ruleByRhs and mode="number-link" for rule template.
3742 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3744 (xsl:template match="rule" mode="number-link"): ... this.
3745 * src/print-xml.c (print_grammar): Don't print the list of rules.
3747 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
3749 Don't let --report affect XML output; always print all information.
3751 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
3752 * src/conflicts.c (log_resolution): Implement.
3753 * src/print-xml.c (print_core): Implement.
3754 (print_state): Implement.
3755 (print_xml): Implement.
3757 * NEWS (2.3a+): Fix quotes.
3758 * src/parse-gram.y (prologue_declaration): For consistency with -v,
3759 don't let %verbose clear the list specified by --report.
3761 2007-11-26 Akim Demaille <akim@epita.fr>
3763 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
3765 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
3767 In the XML output, list useless and unused symbols and rules with the
3768 useful ones and add a "usefulness" attribute. Discussed starting at
3769 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
3770 * src/gram.c (grammar_rules_partial_print_xml): Remove.
3771 (grammar_rules_print_xml): Print all rules instead of just those
3772 useful in the grammar, and add a "usefulness" attribute.
3773 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
3774 * src/print-xml.c (print_rules_useless_in_parser): Remove.
3775 (print_grammar): Print all nonterminals instead of just useful ones,
3776 and add a "usefulness" attribute to nonterminals and terminals.
3777 (print_xml): Don't print a separate "reductions" or
3778 "rules-useless-in-parser" element.
3779 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
3780 (reduce_xml): Remove.
3781 (reduce_token_unused_in_grammar): New.
3782 (reduce_nonterminal_useless_in_grammar): New.
3783 * src/reduce.h (reduce_xml): Remove prototype.
3784 (reduce_token_unused_in_grammar): Add prototype.
3785 (reduce_nonterminal_useless_in_grammar): Add prototype.
3786 * data/xslt/xml2text.xsl: Update for XML changes.
3787 * data/xslt/xml2xhtml.xsl: Update for XML changes.
3788 * tests/reduce.at (Useless Terminals): Update output.
3789 (Useless Rules): Update output.
3790 (Reduced Automaton): Update output.
3792 Say "Terminals unused in grammar" instead of "Unused terminals".
3793 * NEWS (2.3a+): Update.
3794 * doc/bison.texinfo (Understanding): Update example output.
3795 * src/reduce.c (reduce_output): Implement.
3796 * data/xslt/xml2text.xsl: Implement.
3797 * data/xslt/xml2xhtml.xsl: Implement.
3799 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
3801 Accept --report-file=FILE to override the default `.output' filename.
3802 * NEWS (2.3a+): Mention.
3803 * doc/bison.texinfo (Bison Options): Add an entry.
3804 * src/files.c (compute_output_file_names): Don't override
3805 spec_verbose_file if already set.
3806 * src/getargs.c (usage): Document --report-file.
3807 (REPORT_FILE_OPTION): New anonymous enum member.
3808 (long_options): Add entry for it.
3809 (getargs): Add case for it setting spec_verbose_file.
3811 * build-aux/cross-options.pl: Don't record a short option just because
3813 * doc/.cvsignore: Add yacc.1.
3815 2007-11-14 Akim Demaille <akim@epita.fr>
3817 * doc/yacc.1.in: New.
3818 * configure.ac, doc/Makefile.am: Adjust.
3819 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
3821 Use AC_SUBST for assignments too.
3822 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
3824 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
3826 * src/gram.c: Remove comments that duplicate comments in gram.h.
3828 When reporting useless rules and nonterminals, say "useless in grammar"
3829 instead of "useless", and say "useless in parser" instead of "never
3830 reduced". Discussed starting at
3831 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
3832 * NEWS (2.3a+): Mention this change.
3833 * data/xslt/xml2text.xsl: Update output text and expected input XML
3834 element names to match changes below.
3835 * data/xslt/xml2xhtml.xsl: Likewise.
3836 (xsl:template match="bison-xml-report"): Add missing entry in Table of
3837 Contents: "Rules useless in parser due to conflicts".
3838 * doc/bison.texinfo (Decl Summary): Reword a little.
3839 (Understanding): Update example output for changes below.
3840 * src/gram.c: (rule_useful_p): Rename to...
3841 (rule_useful_in_grammar_p): ... this.
3842 (rule_useless_p): Rename to...
3843 (rule_useless_in_grammar_p): ... this.
3844 (rule_never_reduced_p): Rename to...
3845 (rule_useless_in_parser_p): ... this.
3846 (grammar_rules_print): Update for renames.
3847 (grammar_rules_print_xml): Update for renames.
3848 (grammar_rules_never_reduced_report): Rename to...
3849 (grammar_rules_useless_report): ... this since it is used for either
3850 kind of useless rule.
3851 * src/gram.h: Reword comments and update function names in prototypes.
3852 * src/main.c (main): Say "rule useless in parser due to conflicts".
3853 * src/print-xml.c (print_rules_never_reduced): Rename to...
3854 (print_rules_useless_in_parser): ... this, and rename output XML
3855 element "rules-never-reduced" to "rules-useless-in-parser".
3856 (print_xml): Update for rename.
3857 * src/print.c (print_results): Say "Rules useless in parser due to
3859 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
3860 (nonterminals_reduce): Say "nonterminal useless in grammar".
3861 (reduce_output): Say "Nonterminals useless in grammar".
3862 Say "Rules useless in grammar".
3863 (reduce_xml): Rename output XML element "useless" to
3864 "useless-in-grammar".
3865 (reduce_print): Don't report the count of grammatically useless rules
3866 as "rules never reduced" just because %yacc is specified.
3867 In the correct report of this count, say nonterminal(s) and rule(s)
3868 "useless in grammar".
3869 * tests/conflicts.at (S/R in initial): Update expected output.
3870 (Defaulted Conflicted Reduction): Likewise.
3871 (Unreachable States After Conflict Resolution): Likewise.
3872 * tests/existing.at (GNU pic Grammar): Likewise.
3873 * tests/reduce.at (Useless Nonterminals): Likewise.
3874 (Useless Rules): Likewise.
3875 (Reduced Automaton): Likewise.
3876 (Underivable Rules): Likewise.
3877 (Empty Language): Likewise.
3879 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
3881 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
3882 here document and before the EOF so that BSD's implementation of Bourne
3883 shell doesn't parse the delimiter as part of the here document.
3884 * doc/.cvsignore: Add cross-options.texi.
3885 * src/getargs.c (usage): Add a blank line after the warning categories.
3887 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
3889 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
3891 2007-11-05 Akim Demaille <akim@epita.fr>
3893 Remove Id: from bison.1.
3894 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
3895 (perl -0777 -pi -e 's/\.PP\nId): New.
3896 (.x.1): Use it to ignore the version control revision.
3898 2007-11-05 Akim Demaille <demaille@gostai.com>
3900 * build-aux/Makefile.am: Ship cross-options.pl.
3901 * doc/Makefile.am: Always refer to cross-options.texi with
3903 (MAINTAINERCLEANFILES): Add it.
3905 2007-11-04 Akim Demaille <demaille@gostai.com>
3907 Generate the long/short option cross-table.
3908 * build-aux/cross-options.pl: New.
3909 * doc/Makefile.am (cross-options.texi): New.
3910 * doc/bison.texinfo: Use it.
3912 2007-11-04 Akim Demaille <demaille@gostai.com>
3914 Generate bison.1 using help2man.
3915 * doc/common.x, doc/bison.x: New.
3916 * doc/Makefile.am (bison.1, .x.1): New.
3917 The code is taken from autoconf-2.61/man/Makefile.am.
3918 * configure.ac: Look for help2man.
3920 2007-11-04 Akim Demaille <demaille@gostai.com>
3923 * src/getargs.c (usage): Document -W, make it clear that -d,
3924 -g and -x have optional arguments.
3926 2007-11-04 Akim Demaille <demaille@gostai.com>
3928 Find sha1sum when named gsha1sum.
3929 * bootstrap (find_tool): New.
3932 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3934 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
3936 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
3937 * NEWS (2.3a+): Mention.
3938 * data/bison.m4 (b4_pure_if): Don't define it here.
3939 * data/c.m4 (b4_identification): Depend on individual skeletons to
3940 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
3941 values of the %define variables api.pure or api.push_pull. Define
3942 YYPURE, YYPUSH, and YYPULL accordingly.
3943 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
3944 glr.cc has already defined b4_pure_flag.
3945 * data/push.c: Define b4_pure_if based on `%define api.pure'.
3946 Remove YYPUSH and YYPULL since they're back in b4_identification again.
3947 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
3948 * doc/bison.texinfo (Pure Decl): Update.
3949 (Push Decl): Update.
3950 (Decl Summary): Add api.pure to %define entry.
3951 In %pure-parser entry, say it's deprecated and reference %define.
3952 (Pure Calling): Update.
3953 (Error Reporting): Update.
3954 (C++ Scanner Interface): Update.
3955 (How Can I Reset the Parser): Update.
3956 (Table of Symbols): In %pure-parser entry, say it's deprecated and
3958 * src/getargs.c (pure_parser): Remove global variable.
3959 * src/getargs.h (pure_parser): Remove extern.
3960 * src/output.c (prepare): Don't define pure_flag muscle.
3961 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
3962 wrapper around `%define api.pure'.
3963 * tests/calc.at (Simple LALR Calculator): Update.
3964 (Simple GLR Calculator): Update.
3965 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
3967 (GLR: Resolve ambiguity, pure, locations): Update.
3968 (GLR: Merge conflicting parses, pure, no locations): Update.
3969 (GLR: Merge conflicting parses, pure, locations): Update.
3970 * tests/glr-regression.at (Uninitialized location when reporting
3972 * tests/input.at (Unused %define api.pure): New test case.
3973 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
3974 AT_PURE_IF and AT_PURE_AND_LOC_IF.
3975 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
3977 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3979 %define push_pull -> %define api.push_pull. Discussed starting at
3980 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
3981 * data/push.c: Expect the new name.
3982 * data/yacc.c: Likewise.
3983 * doc/bison.texinfo (Push Decl): Update.
3984 (Decl Summary): Update %define entry.
3985 (Push Parser Function): Update.
3986 (Pull Parser Function): Update.
3987 (Parser Create Function): Update.
3988 (Parser Delete Function): Update.
3989 * tests/calc.at (Simple LALR Calculator): Update.
3990 * tests/input.at (%define enum variables): Update.
3991 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
3992 (Push Parsing: Multiple impure instances): Update.
3993 (Push Parsing: Unsupported Skeletons): Update.
3994 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
3995 (Exploding the Stack Size with Malloc): Update.
3997 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
4000 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
4002 For the XML output's terminal element, rename @number to @token-number,
4003 and add @symbol-number. In the nonterminal element, rename @number to
4004 @symbol-number. Discussed starting at
4005 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
4006 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
4008 (xsl:template match="nonterminal"): Likewise.
4009 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
4010 (xsl:template match="nonterminal"): Likewise.
4011 * src/print-xml.c (print_grammar): Implement.
4013 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4015 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
4016 2007-10-11 change, the child elements here are items not rules.
4017 (xsl:template match="item"): New.
4018 (xsl:template match="rule"): Update for new reduced itemset.
4019 (xsl:template match="point"): Remove.
4020 (xsl:template match="empty"): For consistency with --graph, don't
4021 output "/* empty */".
4022 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
4023 line-wrap, don't pass a negative value as first-line-length since this
4024 won't work with the following changes.
4025 (xsl:template name="line-wrap"): Simplify slightly.
4026 (xsl:template name="ws-search"): Eliminate recursion.
4027 * src/print_graph.c (print_core): Don't print a reduction's lookahead
4028 set next to an item whose dot is not at the end of the RHS even if it
4029 happens to be associated with the same rule.
4031 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
4033 Add %define lr.keep_unreachable_states.
4034 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
4035 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
4036 * src/main.c (main): Implement it.
4037 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4038 Extend to test it, and fix a typo.
4040 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
4042 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
4043 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
4044 the example .output text.
4045 * tests/regression.at (Extra lookahead sets in report): Improve wording
4048 2007-10-17 Wojciech Polak <polak@gnu.org>
4050 * src/print-xml.c (print_grammar): Renamed
4051 <terminal> and <nonterminal> attributes:
4052 "type" to "number" and "symbol" to "name".
4053 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
4054 Use new attribute names.
4055 (xsl:template match="nonterminal"): Likewise.
4056 * data/xslt/xml2xhtml.xsl: Likewise.
4058 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
4060 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
4061 (Option Cross Key): Likewise.
4063 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
4064 next to an item whose dot is not at the end of the RHS even if it
4065 happens to be associated with the same rule.
4066 * src/print.c (print_core): Likewise.
4067 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
4068 (Resolved SR Conflicts): Update output.
4069 * tests/regression.at (Extra lookahead sets in report): New test case.
4071 2007-10-11 Wojciech Polak <polak@gnu.org>
4073 * src/print-xml.c (print_core): Remove item set
4075 * data/xslt/bison.xsl (bison:ruleNumber): New key.
4076 Improve processing time. Suggested by Joel E. Denny.
4077 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
4078 Write xsl:param "required" attribute as comment.
4079 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
4080 (xsl:template match="rule"): Support new reduced itemset.
4081 (xsl:template match="point"): Remove.
4082 * data/xslt/xml2xhtml.xsl: Likewise.
4084 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
4086 * src/getargs.c (version): Update copyright year.
4088 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
4090 Make xml2dot.xsl and --graph produce the same output.
4091 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a ` '
4092 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
4094 (xsl:template name="output-node"): Use the new escape template instead
4095 of the string-replace template directly.
4096 (xsl:template name="output-edge"): Likewise.
4097 (xsl:template name="escape"): New, escapes backslashes and newlines in
4098 addition to quotation marks.
4099 * src/graphviz.c (start_graph, output_node, output_edge): Add
4100 whitespace to output for legibility.
4102 Make xml2text.xsl and --report produce the same output, and remove the
4103 XML "conflicts" element since a conflict summary is easily extracted
4105 * data/xslt/bison.xsl: New.
4106 (xsl:template match="state" mode="bison:count-conflicts): New.
4107 * data/xslt/xml2text.xsl: Import bison.xsl.
4108 (xsl:template match="bison-xml-report"): Instead of styling the
4109 "conflicts" element, style the "automaton" element with mode
4110 "conflicts". Unlike the former, the latter lists S/R and R/R
4111 conflicts for a state on the same line.
4112 (xsl:template match="conflicts"): Remove.
4113 (xsl:template match="conflict"): Remove.
4114 (xsl:template match="terminal"): Line-wrap the list of rules in which
4115 the terminal is used.
4116 (xsl:template match="nonterminal"): Likewise for nonterminals.
4117 (xsl:template match="automaton" mode="conflicts"): New.
4118 (xsl:template match="state" mode="conflicts"): New.
4119 (xsl:template name="line-wrap"): New.
4120 (xsl:template name="ws-search"): New.
4121 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
4122 (xsl:template match="bison-xml-report"): Instead of styling the
4123 "conflicts" element, style the "automaton" element with mode
4125 (xsl:template match="conflicts"): Remove.
4126 (xsl:template match="conflict"): Remove.
4127 (xsl:template match="automaton" mode="conflicts"): New.
4128 (xsl:template match="state" mode="conflicts): New.
4129 * src/conflicts.c (conflicts_output_xml): Remove.
4130 * src/conflicts.h (conflicts_output_xml): Remove prototype.
4131 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
4132 * src/print.c (print_grammar): Consistently wrap at the 66th column so
4133 the corresponding XSLT is easier. Also, never wrap between a word and
4134 the comma that follows it.
4136 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
4138 Improve C++ namespace support. Discussed starting at
4139 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
4140 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
4141 b4_namespace_close): New macros that interpret the %define variable
4142 "namespace" so its value can contain "::" to indicate nested
4144 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
4146 * data/lalr1.cc (b4_namespace): Likewise.
4147 * data/location.cc (b4_namespace): Likewise.
4148 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
4149 inside a new table in the general %define entry. Document `%define
4150 namespace' there as well. Point the %name-prefix entry to it since it
4151 explains it more completely in the case of C++.
4152 (C++ Bison Interface): Mention `%define namespace' instead of
4154 (Table of Symbols): Remove the `%define push_pull' entry. The %define
4156 * tests/c++.at (Relative namespace references): New test case.
4157 (Absolute namespace references): New test case.
4158 (Syntactically invalid namespace references): New test case.
4159 * tests/input.at (C++ namespace reference errors): New test case.
4161 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
4163 Add syncline support and location accessor to internal %define
4165 * data/bison.m4 (b4_percent_define_get_loc): New.
4166 (b4_percent_define_get_syncline): New.
4167 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
4168 (b4_percent_define_default): Record defining location as line 1 rather
4169 than 0 for the sake of synchronizing #line's, and define
4170 b4_percent_define_syncline(VARIABLE).
4171 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
4172 * src/muscle_tab.c (muscle_syncline_grow): New.
4173 (muscle_code_grow): Use muscle_syncline_grow.
4174 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
4175 define b4_percent_define_syncline(VARIABLE).
4176 (muscle_percent_define_get_loc): New.
4177 (muscle_percent_define_get_syncline): New.
4178 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
4179 remove some unused variables.
4180 (muscle_percent_define_default): Record defining location as line 1
4181 rather than 0 for the sake of synchronizing #line's, and define
4182 b4_percent_define_syncline(VARIABLE).
4183 (muscle_percent_define_check_values): Use
4184 muscle_percent_define_get_loc.
4185 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
4186 (muscle_percent_define_get_syncline): Prototype.
4187 * tests/skeletons.at (%define Boolean variables: invalid skeleton
4188 defaults): Update output for location change.
4189 (Complaining during macro argument expansion): Extend to test
4190 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
4192 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
4194 Fix some error-reporting macro bugs.
4195 * data/bison.m4 (b4_cat): New.
4196 (b4_error, b4_error_at): Use b4_cat to send error directives directly
4197 to stdout so they don't become arguments to other macros. Update
4198 comments and add examples.
4199 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
4201 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
4202 after printing the error directive so that M4 doesn't report subsequent
4203 problems that are induced by this problem.
4204 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
4205 instead of just in them. Recognize @\n in both places. Both expand to
4206 the empty string. Needed by b4_cat.
4207 * tests/skeletons.at (Complaining during macro argument expansion):
4209 (Fatal errors make M4 exit immediately): New test case.
4211 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
4213 Implement --print-datadir.
4214 * src/getargs.c (usage): Mention.
4215 (PRINT_DATADIR_OPTION): New anonymous enum member.
4216 (long_options): Add entry for it.
4217 (getargs): Add case for it calling compute_pkgdatadir.
4218 * src/output.c (output_skeleton): Encapsulate data directory
4219 computation from here...
4220 (prepare): ... and from here...
4221 (compute_pkgdatadir): ... into this new function.
4222 * src/output.h (compute_pkgdatadir): Prototype.
4224 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
4226 * src/print-xml.c (escape_bufs): New static global variable
4228 (xml_escape_n): ... the static local variable buf here.
4229 (print_xml): Free memory for escape_bufs.
4230 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
4232 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
4234 Replace `%push-parser' and `%push-pull-parser' with
4235 `%define push_pull "push"' and `%define push_pull "both"'.
4236 `%define push_pull "pull"' is the default.
4237 * doc/bison.texinfo (Push Decl, Push Parser Function,
4238 Pull Parser Function, Parser Create Function, Parser Delete Function):
4239 Update declarations.
4240 (Decl Summary, Table of Symbols): Replace %push-parser and
4241 %push-pull-parser entries with a %define push_pull entry.
4242 * data/bison.m4 (b4_percent_define_check_values): New macro.
4243 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
4245 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
4247 * data/push.c: ... to here and compute them from the value of the
4248 %define variable push_pull.
4249 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
4250 parsing requests here...
4251 * data/yacc.c: ... hack this to switch to push.c any time
4252 b4_use_push_pull_flag or the %define variable push_pull is set. This
4253 will go away when we mv push.c yacc.c.
4254 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
4255 push parsing is not supported since unused %define variables are
4257 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
4258 * src/muscle_tab.h (muscle_percent_define_check_values): Update
4259 comments for consistency with b4_percent_define_check_values.
4260 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
4262 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
4264 (prologue_declaration): Remove %push-parser and %push-pull-parser
4266 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
4267 * tests/calc.at: Update declarations.
4268 * tests/input.at (%define enum variables): New test case.
4269 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
4271 (Push Parsing: Multiple impure instances): Update declaration.
4272 (Push Parsing: Unsupported Skeletons): New test case.
4273 * tests/torture.at (Exploding the Stack Size with Alloca): Update
4275 (Exploding the Stack Size with Malloc): Update declaration.
4277 2007-09-24 Wojciech Polak <polak@gnu.org>
4279 Add XSLT transformations.
4281 * data/xslt/xml2dot.xsl: Transform XML into DOT.
4282 * data/xslt/xml2text.xsl: Transform XML into plain text.
4283 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
4284 * data/Makefile.am (xsltdir): New variable.
4285 (dist_xslt_DATA): Add xslt/*.xsl files.
4287 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
4289 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
4290 Problem reported by Wojciech Polak.
4291 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
4292 (xml_printf): Undo change I made on 21 September; that is,
4293 indent 2 spaces, not 1.
4295 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
4297 Pacify ./configure --enable-gcc-warnings.
4298 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
4299 `char const *' instead of `char *'.
4300 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
4301 local variable `sep'.
4303 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4305 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
4307 * src/print-xml.c: Prefer "const" after types; that's more consistent.
4308 (xml_printf): Indent just 1 space for level.
4309 (e_char, xlate_char): Remove.
4310 (xml_escape_string): Rewrite to avoid undefined behavior (used
4311 storage that was freed from the stack).
4312 (xml_escape_n): Don't bother checking for subscript error.
4314 2007-09-21 Wojciech Polak <polak@gnu.org>
4316 Add Bison XML Automaton Report.
4318 Add support for an -x option to generate an XML report.
4319 It is not documented yet.
4320 * src/print-xml.c: New file.
4321 * src/print-xml.h: Likewise.
4322 * lib/timevar.def (TV_XML): New var.
4323 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
4324 * src/conflicts.c: Include print-xml.h.
4325 (solved_conflicts_xml_obstack): New var.
4326 (log_resolution, conflicts_solve, conflicts_free):
4327 Add support for XML report.
4328 (conflicts_output_val): New function.
4329 * src/conflicts.h (conflicts_output_val): New decl.
4330 * src/files.c (spec_xml_file): New var.
4331 (compute_output_file_names, output_file_names_free): Add XML support.
4332 * src/files.h (spec_xml_file): New decl.
4333 * src/getargs.c (xml_flag): New var.
4334 (usage, short_options, long_options, getargs): Add XML support.
4335 * src/getargs.h (xml_flag): New decl.
4336 * src/gram.c: Include print-xml.h.
4337 (rule_lhs_print_xml, rule_rhs_print_xml):
4338 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
4340 * src/gram.h: Declare external ones.
4341 * src/main.c: Include print-xml.h.
4342 (main): Add XML support.
4343 * src/reduce.c: Include print-xml.h.
4344 (reduce_xml): New function.
4345 * src/reduce.h: Declare it.
4346 * src/state.c: Include print-xml.h.
4347 (state_new): Add XML support.
4348 (state_rule_lookahead_tokens_print_xml): New function.
4349 * src/state.h: Declare it.
4350 (struct state): New member solved_conflicts_xml.
4351 * src/symtab.c (symbol_class_get_string): New function.
4352 * src/symtab.h: Declare it.
4354 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4356 * GNUmakefile: Switch to coreutils's version.
4357 * bootstrap: Likewise.
4358 * Makefile.cfg: Adjust to new GNUmakefile.
4359 * README-hacking: Likewise.
4363 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
4364 Bruno Haible <bruno@clisp.org>
4366 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
4367 and is a script that invokes bison. Tighten the code. Add comments.
4369 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
4371 Spell "boolean" as "Boolean". Reported by Akim Demaille.
4372 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
4373 * doc/bison.texinfo (Decl Summary): Fix.
4374 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
4375 * tests/input.at (Boolean %define variables): Update output.
4376 * tests/skeletons.at (%define boolean variables: invalid skeleton
4377 defaults): Rename to...
4378 (%define Boolean variables: invalid skeleton defaults): ... this and
4381 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
4383 In impure push mode, don't allow more than one yypstate to be allocated
4384 since multiple impure parsers would corrupt yynerrs.
4385 * data/push.c (yypstate_allocated): New static global variable
4387 (yypull_parse): If yypstate_new returns 0, don't report it as memory
4388 exhaustion if yypstate_allocated is 1, but still return 2.
4389 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
4390 already 1. Otherwise, set it to 1.
4391 (yypstate_delete): Set it to 0.
4392 * tests/push.at (Push Parsing: Multiple impure instances): New test
4395 2007-08-17 Bob Rossi <bob@brasko.net>
4397 * doc/bison.texinfo (Push Decl): Document the push parser.
4398 (Table of Symbols): Ditto.
4400 (Decl Summary): Ditto.
4401 (Multiple Parsers, Push Parser Function, Pull Parser Function,
4402 Parser Create Function, Parser Delete Function):
4403 Add new push parser symbols.
4404 (Table of Symbols): Document push-parser, push-pull-parser,
4405 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
4407 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
4410 * doc/gpl-3.0.texi: New file.
4411 * doc/gpl.texi: Remove.
4412 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
4413 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
4414 * README-hacking, TODO, bootstrap, bootstrap.conf:
4415 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
4416 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
4417 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
4418 * data/lalr1.cc, data/lalr1.java, data/location.cc:
4419 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
4420 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
4421 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
4422 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
4423 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
4424 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
4425 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
4426 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
4427 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
4428 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
4429 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
4430 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
4431 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
4432 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
4433 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
4434 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
4435 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
4436 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
4437 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
4438 * src/complain.c, src/complain.h, src/conflicts.c:
4439 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
4440 * src/files.h, src/flex-scanner.h, src/getargs.c:
4441 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
4442 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
4443 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
4444 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
4445 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
4446 * src/print.c, src/print.h, src/print_graph.c:
4447 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
4448 * src/reduce.h, src/relation.c, src/relation.h:
4449 * src/revision.h, src/scan-code.h, src/scan-code.l:
4450 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
4451 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
4452 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
4453 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
4454 * tests/Makefile.am, tests/actions.at, tests/c++.at:
4455 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
4456 * tests/existing.at, tests/glr-regression.at:
4457 * tests/headers.at, tests/input.at, tests/java.at:
4458 * tests/local.at, tests/output.at, tests/push.at:
4459 * tests/reduce.at, tests/regression.at, tests/sets.at:
4460 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
4464 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
4466 Get rid of broken %no-parser, -n, and --no-parser implementation and
4468 * TODO: Don't mention them.
4469 * doc/bison.1: Likewise.
4470 * doc/bison.texinfo (Decl Summary): Likewise.
4471 (Bison Options): Likewise.
4472 (Option Cross Key): Likewise.
4473 * src/getargs.c (no_parser_flag): Remove global variable.
4474 (usage): Don't print description of -n and --no-parser.
4475 (long_options): Remove --no-parser entry here.
4476 (getargs): Remove -n case in the switch here.
4477 * src/getargs.h (no_parser_flag): Remove extern.
4478 * tests/regression.at (Web2c Actions): Remove comment that mentions
4481 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
4483 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
4484 name user variables starting with `yy'. Just pass NULL instead of a
4485 dummy local &yylval to yypush_parse.
4486 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
4489 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
4491 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
4492 true since it's then always used regardless of whether yyoverflow is
4493 defined. Reported by Christian Burger at
4494 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
4495 * THANKS: Add Christian Burger.
4497 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
4498 node names: say "Decl Summary" not "Bison Declaration Summary".
4500 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
4502 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
4503 determine whether this function has already complained about an invalid
4504 value for a %define boolean variable, don't check whether Bison has
4505 ever examined the value. As written, the check was a tautology.
4506 Instead, record and check for this complaint using a separate muscle.
4508 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4510 Fix push parsing memory leak reported by Brandon Lucia at
4511 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
4512 * THANKS: Add Brandon Lucia.
4513 * data/push.c (yypstate_delete): Free the stack if it was reallocated
4514 but the parse never completed and thus freed it.
4515 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
4516 * tests/testsuite.at: Include push.at.
4517 * test/push.at: New.
4518 (Push Parsing: Memory Leak for Early Deletion): New test case.
4520 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
4522 Improve handling of multiple S/R conflicts in the same state and of S/R
4523 conflicts involving multiple reductions.
4524 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
4525 set for a state here or Bison will abort if it is reassigned on a
4526 later conflicted reduction in the same state.
4527 Similarly, don't finalize and assign the solved conflicts report here
4528 or it will be lost if it is reassigned on a later conflicted reduction
4530 (set_conflicts): Instead, assign them both here after all S/R conflicts
4531 in the state have been fully examined.
4532 * src/print.c (shift_set): Rename to...
4533 (no_reduce_set): ... this.
4534 (print_reductions): Update for rename, and add %nonassoc error action
4535 tokens to no_reduce_set so that, when printing the first remaining
4536 reduction on an error action token, the reduction is enclosed in
4538 (print_results): Update for rename.
4539 * tests/conflicts.at (Solved conflicts report for multiple reductions
4540 in a state): New test case.
4541 (%nonassoc error actions for multiple reductions in a state): New test
4544 * src/main.c (main): Don't depend on C99 features.
4546 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4548 * build-aux/.cvsignore: Add compile.
4549 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
4552 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
4554 * bootstrap (slurp): Create target directories that don't exist.
4555 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
4557 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
4559 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
4561 * closure.c (closure): Likewise.
4562 * state.h (reductions): Comment sorting of rules.
4563 (state): Comment sorting of items.
4565 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
4567 Fix C++ test cases after recent Gnulib changes. Discussed starting at
4568 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
4569 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
4570 definition in order to avoid Gnulib headers since we don't use config.h
4572 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
4573 rather than AT_DATA so that config.h is included.
4575 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
4577 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
4578 instead of fprintf. Guard these functions with #if YYDEBUG instead of
4579 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
4580 and so that YYFPRINTF is guaranteed to be defined here.
4582 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4584 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
4586 (muscle_percent_define_check_values): ... this more helpful function.
4587 Again, it's not used yet, but it will be.
4588 * src/muscle_tab.h: Likewise.
4590 Improve some comments in parser table construction.
4591 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
4592 (generate_states): Don't mention ruleset, which is internal to closure.
4593 * src/closure.c (closure): Explain sorting of core and itemset, which
4594 is required for this function to behave correctly.
4595 * src/closure.h (closure): Mention sorting.
4597 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
4599 * src/lalr.c (state_lookahead_tokens_count): For code readability,
4600 move the check for disabled transitions to an aver since conflict
4601 resolution hasn't happened yet.
4603 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
4604 labels a state as inconsistent just because it has error transitions.
4605 The original form of this check appeared in revision 1.1 of lalr.c,
4606 which was committed on 1991-12-21. Now (at least), changing the
4607 consistency label on such a state appears to have no useful effect in
4608 any of the places it is examined, which I enumerate below. The key
4609 point to understanding each item in this enumeration is that a state
4610 with an error transition is labelled consistent in the first place only
4611 if it has no rules, so the check cannot matter for states that have
4612 rules. (1) Labelling a state as inconsistent will cause set_conflicts
4613 to try to identify its conflicts, and a state must have *rules* to have
4614 conflicts. (2) Labelling a state as inconsistent will affect how
4615 action_row sets the default *rule* for the state. (3) Labelling a
4616 state as inconsistent will cause build_relations to add lookback edges
4617 to *rules* in that state.
4618 * src/state.h (struct state): Word the comment for member consistent
4621 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4623 Don't depend on C99 features.
4624 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
4625 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
4626 * src/reader.c (check_and_convert_grammar): Fix for-loop.
4627 * src/state.c (state_mark_reachable_states): Fix for-loop.
4628 (state_remove_unreachable_states): Fix for-loop.
4630 Don't widen struct state with member reachable just to temporarily
4631 record reachability. Instead, use a local bitset.
4632 * src/state.h (struct state): Remove member.
4633 * src/state.c (state_new): Don't initialize it.
4634 (state_mark_reachable_states): Rename to...
4635 (state_record_reachable_states): ... this, and use bitset.
4636 (state_remove_unreachable_states): Use bitset.
4638 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
4640 * src/Makefile.am (yacc): Quote target action commands properly so
4641 that the yacc script isn't corrupt. Reported by Hans Aberg at
4642 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
4644 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
4645 the case of pure parsers. Reported by Frans Englich at
4646 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
4647 * THANKS: Add Frans Englich.
4649 * NEWS (2.3a+): In the %code entry, reference section `Bison
4650 Declaration Summary' from the manual now since the %code summary has
4652 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
4653 in the rules section must be terminated by semicolons.
4655 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
4657 Extend the front-end API for %define variables to more completely
4658 mirror the back-end. This will be useful in the future.
4659 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
4660 Update comments to mention the new front-end counterparts of these
4662 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
4663 for muscle_string_decode and muscle_location_decode.
4664 (muscle_string_decode): New static function.
4665 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
4666 (muscle_percent_define_get, muscle_percent_define_ifdef): New
4668 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
4669 muscle_percent_define_get to mimic the b4_percent_define_flag_if
4670 implementation more closely.
4671 (muscle_percent_define_invalid_value): New function.
4672 * src/muscle_tab.h (muscle_percent_define_get,
4673 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
4676 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4678 * NEWS (2.3a+): Mention yesterday's state-removal change.
4679 (2.3a): Remove the %language entry, which was added after 2.3a.
4680 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
4681 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
4682 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
4683 tests/existing.at: Update copyright date.
4685 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4687 If conflict resolution makes states unreachable, remove those states,
4688 report rules that are then unused, and don't report conflicts in those
4690 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
4691 New global function.
4692 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
4694 * src/main.c (main): After conflict resolution, remove the unreachable
4695 states and update all data structures that reference states by number.
4696 * src/state.c (state_new): Initialize each state's reachable member to
4698 (state_mark_reachable_states): New static function.
4699 (state_remove_unreachable_states): New global function.
4700 * src/state.h (struct state): Add member bool reachable.
4701 (state_remove_unreachable_states): Prototype.
4702 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4704 * tests/existing.at (GNU pic Grammar): Update test case output now that
4705 an unused rule is discovered.
4707 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4709 Minor code cleanup in parser table construction.
4710 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
4711 (new_itemsets, save_reductions): Update for rename to nitemset.
4712 * src/closure.c (nritemset): Rename to...
4713 (nitemset): ... this since the "r" appears to meaningless and isn't
4714 used in the comments.
4715 (closure): Update for rename.
4716 * src/closure.h (nritemset): Update extern to...
4717 (nitemset): ... this.
4718 * src/lalr.c (LA): Fix a typo in comments.
4719 * src/print.c (print_core): Update for rename to nitemset.
4720 * src/print_graph.c (print_graph): Likewise.
4721 * src/state.h: Fix some typos in header comments.
4723 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
4725 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
4726 still sticks to ASCII. Sorry!
4728 * README-hacking: New file, taken mostly from coreutils, with changes
4729 for Bison. Contains much of the contents of:
4730 * README-cvs: Remove.
4731 * bootstrap: Sync from gnulib.
4732 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
4733 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
4735 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
4737 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
4739 (Java Differences): Fix some typos.
4740 * THANKS: Add Sebastian Setzer.
4742 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
4744 * data/java.m4 (b4_single_class_if): Remove.
4745 (b4_abstract_if): Look at "%define abstract".
4747 (b4_union_name): Rename...
4748 (b4_yystype): ... to this. Map to "%define stype".
4749 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
4750 b4_maybe_throws): Fix quoting.
4751 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
4752 * data/lalr1.java (Lexer interface): Always define.
4753 (Lexer interface within parser class): Remove.
4754 (YYLexer class): New, used when "%code lexer" is present.
4755 (constructor): When "%code lexer" is used, pass %lex-param
4756 to the lexer constructor.
4757 (yylex, yyparse): Remove %lex-param from method invocations
4758 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
4760 * doc/bison.texinfo (Java Bison Interface): Mention "%define
4761 abstract". Rename "%define union_name" to "%define stype".
4762 Rename method names according to previous patch.
4763 (Java Scanner Interface): Describe "%code lexer" instead of
4764 "%pure-parser" and "%define single_class".
4765 (Java Differences): Mention "%code lexer".
4767 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
4768 Include scanner here, using macros from tests/local.at.
4769 (AT_DATA_CALC_Y): Remove final argument.
4770 (_AT_CHECK_JAVA_CALC): Likewise.
4771 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
4772 of %locations and %error-verbose.
4773 (main): Test with and without %lex-param.
4774 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
4775 (AT_BISON_OPTION_POPDEFS): Pop it.
4777 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4779 DJGPP spefic issue. Inhibit the use of disallowed characters for
4780 file name genertion on Win98, WinXP, etc. These are |<>":?*\
4781 and concern testsuite case 46.
4782 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
4783 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
4784 * djgpp/config.bat: Inhibit the use of disallowed characters.
4786 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4788 Miscellaneous %define and %code cleanup.
4789 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
4790 values are interpreted.
4791 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
4792 documentation a little more.
4793 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
4794 muscle_percent_define_insert, muscle_percent_code_grow): New
4796 * src/muscle_tab.h (muscle_percent_define_insert,
4797 muscle_percent_code_grow): Prototype.
4798 * src/parse-gram.y (prologue_declaration): Use
4799 muscle_percent_define_insert and muscle_percent_code_grow when parsing
4800 %define and %code directives.
4802 Make it easy to share %define boolean variables between the front-end
4803 and back-end. Though not used yet, this will be useful in the future.
4804 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
4805 Bison uses of names rather than just skeleton uses of names.
4806 (b4_percent_define_get, b4_percent_define_ifdef): Rename
4807 b4_percent_define_skeleton_variables(VARIABLE) to
4808 b4_percent_define_bison_variables(VARIABLE).
4809 (b4_percent_code_get, b4_percent_code_ifdef): Rename
4810 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
4811 b4_percent_code_bison_qualifiers(QUALIFIER).
4812 (b4_check_user_names_wrap): Update for renames.
4813 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
4814 muscle_percent_define_default): New functions mimicking
4815 b4_percent_define_flag_if and b4_percent_define_default.
4817 For %define variables, report locations for invalid values and
4819 * data/bison.m4 (b4_percent_define_flag_if): Read
4820 b4_percent_define_loc(VARIABLE) to report the location of an invalid
4822 (b4_percent_define_default): Save a special location in
4823 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
4824 must later be reported as invalid.
4825 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
4827 (muscle_percent_define_insert): Record the location of VARIABLE in
4828 muscle percent_define_loc(VARIABLE), and use it to report the previous
4829 location for a redefinition.
4830 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
4831 (muscle_percent_define_default): Update like b4_percent_define_default.
4832 (muscle_grow_user_name_list): Rename to...
4833 (muscle_user_name_list_grow): ... this for consistency and use
4834 muscle_location_grow.
4835 * src/muscle_tab.h (muscle_location_grow): Prototype.
4836 * tests/input.at (%define errors): Update expected output.
4837 * tests/skeletons.at (%define boolean variables: invalid skeleton
4838 defaults): New test case.
4840 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
4842 * src/print.c (lookahead_set, state_default_rule): Remove.
4843 (print_reductions): Replace state_default_rule invocation with
4844 equivalent use of yydefact, which was computed in token_actions in
4846 (print_results): Don't allocate lookahead_set.
4848 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
4850 * data/lalr1.java: Prefix all private members with yy.
4852 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
4854 Use YYFPRINTF instead of fprintf where appropriate. Reported by
4855 Sebastien Fricker at
4856 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
4857 * THANKS: Add Sebastien Fricker.
4858 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
4859 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
4860 accept a variable number of arguments.
4862 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
4864 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
4866 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4868 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
4869 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
4870 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
4872 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
4874 Undo my 2007-02-07 change, switching back to the c-strcase module
4875 introduced in the 2007-02-03 change. Bruno Haible reported that
4876 the 2007-02-07 change would be dangerous in Turkish if we add a
4877 language whose name contains "i", since "i" is not lowercase "I"
4879 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
4880 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
4881 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
4882 * m4/.cvsignore: Remove strcase.m4.
4883 * src/getargs.c: Revert 2007-02-07 change, as follows.
4884 Include c-strcase.h.
4885 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
4887 2007-02-11 Bruno Haible <bruno@clisp.org>
4889 Enable the Java related testsuite tests when the only Java compiler
4890 found is a gcj < 4.3. Discussed at
4891 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
4892 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
4894 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
4896 * data/Makefile.am: Update copyright date.
4897 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
4898 yypstate_new returns NULL.
4899 (yypstate_new): Return NULL if malloc does.
4900 * src/reader.c (packgram): Move translation of rule actions from the
4901 beginning of packgram to...
4902 (check_and_convert_grammar): ... here right before packgram is invoked
4903 so it's easier to write more complete comments, and remove redundant
4906 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
4908 As in semantic actions, make @$ in %initial-action, %destructor, and
4909 %printer imply %locations.
4910 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
4912 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
4913 (@$ in %initial-action implies %locations,
4914 @$ in %destructor implies %locations,
4915 @$ in %printer implies %locations): ... these new test cases.
4917 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
4919 Undo most of the 2007-02-03 change, switching to the strcase module
4920 now that gnulib strcase has been fixed.
4921 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
4922 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
4923 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
4924 * m4/.cvsignore: Add strcase.m4.
4925 * src/getargs.c: Revert 2007-02-03 change, as follows.
4926 Don't include c-strcase.h.
4927 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
4928 strcasecmp has "unspecified behavior" outside the POSIX locale,
4929 but it works fine in practice if at least one argument is ASCII,
4930 as is the case in Bison.
4932 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
4934 * tests/java.at: Skip tests if only one of javac/java is present.
4935 Reported by Joel E. Denny.
4936 * tests/atlocal.in: Adjust copyright years.
4938 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
4940 * data/lalr1.java (Stack): Work around old verifiers that disallow
4941 access to the private fields of an inner class, from the outer class.
4942 We can make Stack's fields public because user code doesn't have access
4943 to the instance of Stack used by parse(). Reported by Paul Eggert.
4945 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
4947 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
4948 the right spot for these files?
4949 * bootstrap.conf (gnulib_modules): Add c-strcase.
4950 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
4952 * src/getargs.c: Include c-strcase.h.
4953 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
4954 to avoid unspecified behavior.
4956 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
4958 * doc/bison.texinfo (Decl Summary): Correct typo.
4960 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
4962 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
4963 Complain if the value does not match empty, "true" or "false".
4964 * data/c++.m4: Adjust default definitions of %define variables.
4965 * data/java.m4: Adjust default definitions of %define variables.
4966 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
4968 * tests/input.at (Boolean %define variables): Test new behavior.
4970 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
4972 * NEWS: Mention java.
4973 * TODO: Remove things that are done.
4974 * bootstrap.conf: Add javacomp-script and javaexec-script.
4975 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
4977 * data/Makefile.am: Add new files.
4978 * data/java-skel.m4: New.
4979 * data/java.m4: New.
4980 * data/lalr1.java: New.
4982 * doc/bison.texinfo: Put "A Complete C++ Example" under
4983 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
4984 under Other Languages.
4986 * src/getargs.c (valid_languages): Add Java.
4987 * src/getargs.h (struct bison_language): Update size of string fields.
4989 * tests/Makefile.am: Add java.at.
4990 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
4991 * tests/java.at: New.
4992 * tests/testsuite.at: Include it.
4994 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
4997 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
4998 at_directive_argv arguments so these no longer have to be global
4999 variables. Also, update the implementation for the following changes.
5000 (fail_for_at_directive_too_many_args,
5001 fail_for_at_directive_too_few_args): Add at_directive_name argument.
5002 (at_directive_name): Remove as at_directive_argv[0] will be used for
5004 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
5005 for the directive name.
5006 (at_directive_argc, at_directive_argv): Make these local within
5007 skel_lex instead of global.
5008 (INITIAL): Update directive start action for above changes.
5009 (SC_AT_DIRECTIVE_ARG): Rename to...
5010 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
5011 (SC_AT_DIRECTIVE_SKIP_WS): Update.
5012 (scan_skel): Move yylex_destroy to...
5013 (skel_scanner_free): ... here.
5014 * tests/skeletons.at (installed skeleton file name): Rename to...
5015 (installed skeleton file names): ... this.
5017 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
5019 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
5020 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
5021 Summary" not "Directives".
5022 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
5023 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
5024 since the former is now the more complete one.
5025 (Prologue Alternatives): Likewise and do the same for %defines.
5026 (Table of Symbols): Add summary of %code, add summary of %define, and
5027 move full %code documentation to...
5028 (Decl Summary): ... here for consistency with other entries in these
5030 Move %define entry in order to keep this list alphabetized.
5031 Reword %define entry a little to put less emphasis on the skeleton
5032 concept, which most users shouldn't have to think about.
5034 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
5036 Adjust to recent gnulib changes.
5037 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
5038 Add string.h, string_.h, unistd_.h, wchar_.h.
5039 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
5040 * src/system.h: Don't include <stpcpy.h>; this is now done by
5043 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
5045 Simplify implementation of unqualified %code, implement macros for
5046 uniform treatment of boolean %define flags. Document %define.
5047 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
5048 b4_percent_code_ifdef): New.
5049 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
5050 * data/c++.m4: Define default value for global_tokens_and_yystype.
5051 * data/glr.cc: Likewise.
5052 * data/location.cc: Use b4_percent_define_flag_if.
5054 * doc/bison.texinfo (Decl Summary): Document %define.
5056 * src/parse-gram.y (Unqualified %code): Change muscle name to
5058 (content.opt): Default to empty.
5060 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
5062 Implement support for relative and absolute skeleton file names.
5063 Discussed starting at
5064 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
5065 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
5066 (Bison Options): Document in --skeleton entry.
5067 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
5068 full_skeleton can't necessarily hold all of pkgdatadir.
5069 If the specified skeleton file name contains a `/', don't prepend
5071 * src/parse-gram.y (prologue_declaration): If the specified skeleton
5072 file name contains a `/', prepend the grammar file directory.
5073 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
5074 * skeletons.at: New file.
5075 (relative skeleton file names): New test case.
5076 (installed skeleton file names): New test case.
5077 * tests/testsuite.at: Include skeletons.at.
5079 * bootstrap: Update copyright to 2007.
5081 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
5083 * bootstrap: Remove occurrences of .#bootmp from the files.
5085 2007-01-17 Akim Demaille <akim@epita.fr>
5087 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
5089 Use per-type %printer.
5091 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
5093 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
5094 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5095 djgpp/config.site, src/files.c, src/files.h, src/main.c,
5096 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
5097 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
5098 tests/glr-regression.at, tests/input.at, tests/local.at,
5099 tests/output.at, tests/torture.at: Update copyright to 2007.
5101 2007-01-16 Akim Demaille <akim@epita.fr>
5103 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
5105 (Calc++ Scanner): Exit with failure if we can't open the input
5107 Accept "-" standing for stdin.
5108 (Calc++ Top Level): Print the result only if the parsing was
5111 2007-01-16 Akim Demaille <akim@epita.fr>
5113 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
5115 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
5116 and Joel E. Denny <jdenny@ces.clemson.edu>
5118 Clean up %define and %code implementation in M4 some. Most
5119 importantly, rename all related macros to be in the b4_percent_define
5120 and b4_percent_code namespaces. Also, complete support for `.' in
5121 %define variable names and %code qualifiers.
5122 * data/bison.m4 (b4_check_user_names): Check for special
5123 "SKELETON-NAMESPACE(name)" macros instead of using two nested
5125 (b4_get_percent_define, b4_get_percent_code): Rename to...
5126 (b4_percent_define_get, b4_percent_code_get): ... these.
5127 Extend documentation with examples.
5128 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
5129 b4_percent_define_skeleton_variables and
5130 b4_percent_code_skeleton_qualifiers.
5131 Expect any value for the %define variable `foo' to be stored in the
5132 macro named `b4_percent_define(foo)'; expect any %code blocks for the
5133 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
5134 expect any unqualified %code blocks to be stored in a macro named
5135 `b4_percent_code_unqualified'.
5136 Use m4_indir so that %define variable names and %code qualifiers can
5137 contain `.', which is allowed by the grammar parser.
5138 (b4_percent_define_default): New macro to set a default value for a
5140 (m4_wrap): Update wrapped code, and fix some underquoting.
5141 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
5142 Expect grammar uses of %define variables and %code qualifiers to be
5143 defined in b4_percent_define_user_variables and
5144 b4_percent_code_user_qualifiers.
5145 * data/c++.m4: Use b4_percent_define_default rather than
5146 m4_define_default. Fix some underquoting. Skeleton usage of %define
5147 variable define_location_comparison now implies skeleton usage of
5148 %define variable filename_type.
5149 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5150 data/push.c, data/yacc.c: Update macro names.
5151 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
5154 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5156 DJGPP specific issues.
5158 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
5159 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
5161 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5163 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
5164 run parsers in all tests so that Valgrind is invoked during
5165 maintainer-check-valgrind.
5166 (Duplicate representation of merged trees): Free all semantic values.
5167 (Duplicated user destructor for lookahead): Likewise.
5169 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5171 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
5172 command-line prefix.
5173 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
5174 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
5175 miss Valgrind messages.
5176 (Exploding the Stack Size with Malloc): Likewise.
5178 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5180 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
5181 locals. Reported by Juan Manuel Guerrero at
5182 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
5183 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
5184 Fix some indentation also.
5185 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
5186 explaining this issue.
5188 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
5189 and Joel E. Denny <jdenny@ces.clemson.edu>
5191 Simplify union and prologue handling, and escape union and lex/parse
5192 params with digraphs.
5193 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
5194 values to the empty string since these are no longer guaranteed
5195 initialized by the front-end.
5196 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
5197 braces around b4_user_stype since this is no longer done by the
5199 * src/files.c, src/files.h (pre_prologue_obstack,
5200 post_prologue_obstack): Remove.
5201 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
5202 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
5203 with digraphs. This fixes lex params and parse params.
5204 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
5205 * src/output.c (prepare): Remove muscle insertion of the prologues.
5206 (output): Remove freeing of pre_prologue_obstack and
5207 post_prologue_obstack.
5208 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
5209 than prologue_augment for prologue parsing so you don't need prologue
5211 (grammar_declaration): For %union RHS, use `braceless' instead of
5212 "{...}" so that braces are already stripped and code is escaped with
5214 * src/reader.c (prologue_augment): Remove.
5215 (reader): Remove initialization of pre_prologue_obstack and
5216 post_prologue_obstack.
5217 * src/reader.h (prologue_augment): Remove.
5219 * data/c.m4: Remove stray parenthesis.
5221 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5223 Remove quotes from variables names in %define directives and from
5224 qualifiers in %code directives, and restrict the characters that are
5225 allowed in them to M4-friendly ones. For %define, continue to support
5226 the quoted form as a deprecated feature. Discussed starting at
5227 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
5228 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
5230 * doc/bison.texinfo (Prologue Alternatives): Update.
5231 (Decl Summary): In %defines entry, update mention of `%code requires'
5232 and `%code provides'.
5233 (C++ Location Values): Update %define uses.
5234 (Calc++ Parser Interface): Likewise.
5235 (Calc++ Parser): Likewise, and update `%code requires' uses.
5236 (Table of Symbols): Update %code documentation.
5237 * src/parse-gram.y (prologue_declaration): For %define variables, use
5238 `variable' instead of `STRING'.
5239 (grammar_declaration): For %code qualifiers, use `ID' instead of
5241 (variable): New nonterminal that takes an `ID' or a `STRING'.
5242 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
5244 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
5245 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
5246 (%define errors): Update %define uses.
5248 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5250 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
5251 instead of muscle_insert for %define values so that M4-special
5252 characters are replaced with digraphs.
5253 * tests/input.at (%define errors): Extend to check weird values.
5255 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5257 Instead of having skeletons declare all valid %define variables and
5258 %code qualifiers, provide macros that retrieve the associated values
5259 and build these lists automatically. Thus Bison will now warn when a
5260 variable or qualifier is not used by the skeleton in the current
5261 invocation regardless of whether it might sometimes be used by that
5262 skeleton in other invocations. Also, move all %define value macros to
5263 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
5264 form, which is replaced by %code.
5265 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
5266 (b4_check_user_names): ... this, and change the series of valid name
5267 arguments to a single list argument for names used in the skeleton
5268 similar to the existing list argument for names used in the grammar.
5269 Warn instead of complaining.
5270 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
5271 values and %code code, to format %code code properly, and to build
5272 lists of all %define variables and %code qualifiers used in the
5273 skeleton: b4_skeleton_percent_define_variables and
5274 b4_skeleton_percent_code_qualifiers.
5275 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
5277 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
5278 the skeleton names lists can finish building first. In place of
5279 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
5280 expect the lists b4_user_percent_define_variables and
5281 b4_user_percent_code_qualifiers.
5282 * data/c++.m4: Where setting default values for b4_parser_class_name,
5283 b4_location_type, b4_filename_type, b4_namespace, and
5284 b4_define_location_comparison, update their names to the
5285 b4_percent_define_ namespace.
5286 * data/glr.c: Don't use b4_check_percent_define_variables and
5287 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5288 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
5289 (b4_parser_class_name, b4_namespace): Define these using
5290 b4_get_percent_define for parser_class_name and namespace.
5291 * data/location.cc: Use b4_get_percent_define.
5292 * data/push.c: Don't use b4_check_percent_define_variables and
5293 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5294 * data/yacc.c: Likewise, and don't call m4_exit in
5295 b4_use_push_for_pull_if or m4_wrap code will never execute.
5296 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
5298 (muscle_grow_user_name_list): ... this for consistency with the
5299 terminology used in bison.m4.
5300 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
5301 %define variable names, and rename muscle used_percent_define_variables
5302 to user_percent_define_variables.
5303 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
5304 user_percent_code_qualifiers.
5306 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
5307 {CODE} form is no longer accepted.
5308 * tests/input.at (Reject bad %code qualifiers): Rename to...
5309 (Reject unused %code qualifiers): ... this, and update test output.
5310 (%define error): Update test output.
5312 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
5314 Check for unrecognized %define variables similar to checking for
5315 unrecognized %code qualifiers. Check for redefined %define variables.
5316 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
5318 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
5319 (b4_check_percent_define_variables): New, also wraps it.
5320 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
5321 variables using b4_check_percent_define_variables.
5322 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
5323 all those exercised in the test suite and all those listed in the
5324 `Default values' section of c++.m4. Are there others?
5325 * data/push.c, data/yacc.c: Declare no valid %define variables.
5326 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
5327 similar to muscle_find, but it works even when the muscle stores a
5329 (muscle_grow_used_name_list): New function for constructing the used
5330 name list muscles that b4_check_for_unrecognized_names requires.
5331 * src/parse-gram.y (prologue_declaration): Warn if a variable is
5332 %define'd more than once. Define the b4_used_percent_define_variables
5333 muscle with muscle_grow_used_name_list.
5334 (grammar_declaration): Abbreviate %code code with
5335 muscle_grow_used_name_list.
5336 * tests/input.at (%define errors): New.
5338 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5340 Provide warn_at, complain_at, and fatal_at function callbacks to the
5341 skeletons, and use this for %code qualifier complaints.
5342 * data/bison.m4 (b4_error_at): New, invoked by...
5343 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
5344 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
5345 @fatal_at(...@) directives.
5346 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
5347 qualifiers in b4_used_percent_code_qualifiers and to use
5349 * src/location.c, src/location.h (boundary_set_from_string): New global
5351 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
5353 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
5354 to b4_used_percent_code_qualifiers.
5355 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
5357 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
5358 (lineno): Rename to...
5359 (out_lineno): ... this so I don't misunderstand it again.
5360 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
5361 here; these newlines are in the input but not the output file.
5362 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
5363 (at_directive_perform): ... this new static function, and add handling
5364 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
5366 * tests/input.at (Reject bad %code qualifiers): Update test output with
5367 locations and extend.
5369 * tests/output.at (Output file name: [, Output file name: ]): Remove
5370 bogus comment about these tests failing.
5372 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5374 Clean up b4_check_percent_code_qualifiers a little.
5375 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
5376 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
5377 documentation and add examples.
5378 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
5381 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
5383 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
5384 unreliable -- especially when they're hidden inside another macro.
5385 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
5386 data/c.m4: Remove m4_divert(-1).
5387 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5388 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
5389 m4_divert_push(0) and m4_divert_pop(0).
5390 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
5391 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
5392 pushed and popped by m4sugar, should be first on the stack.
5394 Provide warn, complain, and fatal function callbacks to the skeletons.
5395 This provides more flexibility than m4_fatal, improves the error
5396 message format, and captures messages for translation. Discussed
5398 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
5399 * data/bison.m4 (b4_error): New, invoked by...
5400 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
5401 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
5402 directives. Because these M4 macros might be called when the current
5403 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
5404 the previous removal of uses of m4_divert, which caused trouble.
5405 (b4_check_percent_code_qualifiers): Use b4_complain instead of
5406 m4_fatal to report unrecognized %code qualifiers.
5407 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
5408 push parser requests.
5409 * data/glr.c: Use b4_complain instead of m4_fatal to report
5410 non-deterministic push parser requests.
5411 Update @output usage to @output(...@) form.
5412 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
5413 report missing %defines. Update @output usage to @output(...@) form.
5414 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
5416 * src/main.c (main): Invoke skel_scanner_free.
5417 * src/scan-skel.h (skel_scanner_free): Prototype new function.
5418 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
5419 obstack_for_string from flex-scanner.h.
5420 (YY_DECL): Use to declare skel_lex static.
5421 (decode_at_digraphs): Remove; now handled in the new
5422 SC_AT_DIRECTIVE_ARG start condition.
5423 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
5425 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
5426 at_directive_argv): New static globals.
5427 (INITIAL): Use fail_for_invalid_at.
5428 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
5429 recognize the start of a generalized `@directive(...@)' form and
5431 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
5432 directive args (using the new obstack_for_string), to decode the
5433 contained @ diagraphs, and to perform the directive. It recognizes
5434 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
5436 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
5437 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
5439 (scan_skel): Initialize obstack_for_string on the first call.
5440 (skel_scanner_free): New function to free obstack_for_string.
5441 * tests/input.at (Reject bad %code qualifiers): Update test output.
5443 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
5445 Consolidate the 4 prologue alternative directives (%code, %requires,
5446 %provides, and %code-top) into a single %code directive with an
5447 optional qualifier field. Discussed at
5448 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
5449 * NEWS (2.3a+): Rewrite the existing entry for the prologue
5451 * doc/bison.texinfo (Prologue Alternatives): Update.
5452 (Decl Summary): Update to %code "requires" and %code "provides".
5453 (Calc++ Parser): Update to %code "requires".
5454 (Table of Symbols): Remove entries for %requires, %provides, and
5455 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
5456 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
5457 are replaced by b4_percent_code_provides and b4_percent_code_requires,
5458 which are skeleton-specific.
5459 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
5460 declare what %code qualifiers it supports and to complain if any other
5461 qualifiers were used in the grammar.
5462 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
5463 and b4_user_code([b4_percent_code_provides]) in place of
5464 b4_user_requires and b4_user_provides.
5465 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
5466 Add b4_user_code([b4_percent_code_top]) and
5467 b4_user_code([b4_percent_code]).
5468 Invoke b4_check_percent_code_qualifiers.
5469 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
5470 PERCENT_REQUIRES): Remove.
5471 (grammar_declaration): Remove RHS's for %code-top, %provides, and
5472 %requires. Rewrite the %code RHS as the unqualified form defining the
5473 muscle b4_percent_code. Add another RHS for the qualified %code form,
5474 which defines muscles of the form b4_percent_code_QUALIFIER and the
5475 b4_used_percent_code_qualifiers muscle.
5476 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
5477 PERCENT_REQUIRES): Remove.
5478 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
5479 %code "requires" and %code "provides".
5480 * tests/input.at (Reject bad %code qualifiers): New.
5482 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
5484 Use the new code_props interface for destructors and printers.
5485 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
5486 printer_location members, and change the type of the destructor and
5487 printer members to code_props.
5488 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
5489 symbol_printer_get, semantic_type_destructor_set,
5490 semantic_type_printer_set, default_tagged_destructor_set,
5491 default_tagless_destructor_set, default_tagged_printer_set,
5492 default_tagless_printer_set): Use code_props in arguments and return
5493 types in place of char const * and location.
5494 (symbol_destructor_location_get, symbol_printer_location_get): Remove
5495 since the locations are now contained in the return of
5496 symbol_destructor_get and symbol_printer_get.
5497 * src/output.c (symbol_destructors_output, symbol_printers_output):
5499 (symbol_code_props_output): ... this to eliminate duplicate code.
5500 (output_skeleton): Update to use symbol_code_props_output.
5501 * src/reader.c (symbol_should_be_used): Update use of
5502 symbol_destructor_get.
5503 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5504 Update uses of the various _destructor_set and _printer_set functions.
5505 * src/symtab.c: (default_tagged_destructor_location,
5506 default_tagless_destructor_location, default_tagged_printer_location,
5507 default_tagless_printer_location): Remove since we...
5508 (default_tagged_destructor, default_tagless_destructor,
5509 default_tagged_printer, default_tagless_printer): ... change the type
5510 of these to code_props.
5511 (symbol_new, semantic_type_new, symbol_destructor_set,
5512 semantic_type_destructor_set, symbol_destructor_get,
5513 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
5514 symbol_check_alias_consistency, default_tagged_destructor_set,
5515 default_tagless_destructor_set, default_tagged_printer_set,
5516 default_tagless_printer_set): Update.
5517 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
5518 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
5520 (symbol_print): Use SYMBOL_CODE_PRINT.
5522 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
5524 Use the new code_props interface for rule actions.
5525 * src/symlist.h (symbol_list): Replace action, action_location, and
5526 used members with a code_props action_props member.
5527 * src/reader.c (symbol_should_be_used, grammar_rule_check,
5528 grammar_midrule_action, grammar_current_rule_merge_set,
5529 grammar_current_rule_symbol_append, packgram): Update.
5530 * src/scan-code.h (translate_rule_action): Remove, no longer used.
5531 * src/scan-code.l (handle_action_dollar): Update.
5532 (translate_rule_action): Remove, no longer used.
5533 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
5535 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5537 Use the new code_props interface in parse-gram.y.
5538 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
5539 Update all uses of translate_* functions to use the new code_props
5540 interface and to use gram_scanner_last_string_free and
5541 code_scanner_last_string_free where possible.
5542 (grammar_declaration): symbol_list_destructor_set and
5543 symbol_list_printer_set now perform the translation, so don't do it
5544 here. Use gram_scanner_last_string_free where possible.
5545 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
5546 translate_code): Remove, no longer used.
5547 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
5548 symbol_list_printer_set): Perform code translation here rather than
5549 depending on the caller to do so.
5551 * src/symlist.h (struct symbol_list): Correct some documentation typos.
5552 * src/scan-gram.h (gram_last_string): Remove declaration.
5553 * src/scan-gram.l (last_string): Declare it static.
5555 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5557 Encapsulate code properties and related functionality for the various
5558 destructors, printers, and actions into a code_props structure and
5559 interface. This patch merely implements code_props in scan-code.h and
5560 scan-code.l. Future patches will rewrite other modules to use it.
5561 Discussed starting at
5562 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
5563 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
5564 consistently initialize const structs that have an empty location
5566 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
5567 to ensure consistency.
5568 * src/scan-code.h (code_props): New structure.
5569 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
5570 function, macro, and const global variable for initializing a
5571 code_props with no code.
5572 (code_props_plain_init, code_props_symbol_action_init,
5573 code_props_rule_action_init, code_props_translate_code): The rest of
5574 the new code_props functional interface. Among other things, the init
5575 functions set the code_props kind field so that
5576 code_props_translate_code will know whether to behave like
5577 translate_symbol_action, translate_rule_action, or translate_code.
5578 These old translate functions must remain until all other modules are
5579 updated to use the new code_props interface.
5580 (code_scanner_last_string_free): New function similar to
5581 gram_scanner_last_string_free.
5582 (code_scanner_free): Add documentation.
5583 * src/scan-code.l: Implement the new interface.
5584 (code_lex): Make it static, add a code_props* argument, and remove the
5586 (last_string): New static global similar to the one in scan-gram.l.
5587 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
5589 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
5590 code_props since Bison may one day use this information for destructors
5592 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
5593 (handle_action_dollar): Use symbol_list_n_get and set used flag
5594 directly since symbol_list_n_used_set is removed.
5595 (translate_action): Add a code_props* argument and remove the rule,
5596 action, and location arguments. Pass the code_props* on to code_lex.
5597 (translate_rule_action, translate_symbol_action, translate_code):
5598 Rewrite as wrappers around the new code_props interface.
5599 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
5600 it would eventually need to break the encapsulation of code_props.
5602 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5604 * etc/.cvsignore: New.
5606 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5608 Add maintainer-push-check to run maintainer-check using push parsing in
5609 place of pull parsing where available.
5610 * Makefile.am (maintainer-push-check): New.
5611 * data/bison.m4 (b4_use_push_for_pull_if): New.
5612 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
5613 appropriately based on their existing values.
5614 (yypush_parse): Don't print push-parser-specific diagnostics if push
5615 parsing is being used in place of pull parsing.
5616 * data/yacc.c: If push parsing should replace pull parsing, redirect to
5618 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
5619 variable, and insert b4_use_push_for_pull_flag into muscles.
5620 * tests/Makefile.am (maintainer-push-check): New.
5622 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5624 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
5625 (whether successful or failed) so that yypush_parse can be invoked
5626 again to start a new parse using the same yypstate.
5627 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
5628 check multiple yypull_parse invocations on the same yypstate. For pull
5629 mode, extend to check multiple yyparse invocations.
5630 (Exploding the Stack Size with Alloca): Extend to try with
5632 (Exploding the Stack Size with Malloc): Likewise.
5634 * tests/calc.at (Simple LALR Calculator): Don't specify
5635 %skeleton "push.c" since %push-pull-parser implies that now.
5636 * tests/headers.at (export YYLTYPE): Don't check for the push
5637 declarations. Otherwise, this test case can't be used to see if push
5638 mode can truly emulate pull mode.
5639 * tests/input.at (Torturing the Scanner): Likewise.
5640 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
5641 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
5642 AT_YACC_IF, which now includes the case of push mode since %skeleton
5643 need not be used for push mode. This will be more intuitive once
5644 push.c is renamed to yacc.c.
5646 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5648 For push mode, convert yyparse from a macro to a function, invoke yylex
5649 instead of passing a yylexp argument to yypull_parse, and don't
5650 generate yypull_parse or yyparse unless %push-pull-parser is declared.
5651 Discussed starting at
5652 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
5653 * data/bison.m4 (b4_pull_if): New.
5654 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
5655 * data/push.c: Improve M4 quoting a little.
5656 (b4_generate_macro_args, b4_parenthesize): Remove.
5657 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
5658 any time a pull parser is requested.
5659 Don't #define this as a wrapper around yypull_parse. Instead, when
5660 both push and pull are requested, make it a function that does that
5662 (yypull_parse): If there's a b4_prefix, #define this to
5663 b4_prefix[pull_parse] when both push and pull are requested.
5664 Don't define this as a function unless both push and pull are
5666 Remove the yylexp argument and hard-code yylex invocation instead.
5667 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
5669 * src/getargs.c (pull_parser): New global initialized to true.
5670 * getargs.h (pull_parser): extern it.
5671 * src/output.c (prepare): Insert pull_flag muscle.
5672 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
5673 (prologue_declaration): Set both push_parser and pull_parser = true for
5674 %push-pull-parser. Set push_parser = true and pull_parser = false for
5676 * src/scan-gram.l: Don't accept %push_parser as an alternative to
5677 %push-parser since there's no backward-compatibility concern here.
5678 Scan %push-pull-parser.
5679 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
5680 instead of %push-parser.
5681 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
5682 prototype it in the module that calls yyparse.
5683 * tests/input.at (Torturing the Scanner): Likewise.
5684 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
5686 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
5688 Update etc/bench.pl. Optimize push mode a little (the yyn change
5689 deserves most of the credit).
5690 * Makefile.am (SUBDIRS): Add etc subdirectory.
5691 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
5692 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
5693 yytoken, yyval, and yyloc declarations to...
5694 (yyparse or yypush_parse): ... here to improve performance. For
5695 yypush_parse invocations after the first, be sure to assign yyn its old
5697 (yypstate_new): Don't bother initializing the yyresult field since the
5698 initial value isn't used.
5699 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
5700 remove the #define that, in push mode, set it to yyps->NAME.
5701 * etc/Makefile.am: New.
5702 * etc/bench.pl: Remove and build it instead from...
5703 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
5704 "tests/bison" from the build directory by default rather than just
5705 invoking "bison" from $PATH.
5706 (calc_grammar): Update push parser code: don't declare yylval globally,
5707 don't define yyparse_wrapper, and don't #define yyparse.
5708 (bench_grammar): Update to check all working combinations of yacc.c,
5709 push.c, impure, pure, pull, and push.
5711 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5713 For push mode, add pull wrappers around yypush_parse.
5714 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
5715 (yypull_parse): New function wrapping yypush_parse.
5716 (yyparse): New #define wrapping yypull_parse.
5717 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
5719 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
5720 prototype yylex in the module that calls yyparse, and don't prototype
5721 yyparse there. Otherwise, the yyparse expansion won't compile.
5722 * tests/input.at (Torturing the Scanner): Likewise.
5724 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5726 Enable push parsers to operate in impure mode. Thus, %push-parser no
5727 longer implies %pure-parser. The point of this change is to move
5728 towards being able to test the push parser code by running the entire
5729 test suite as if %push-parser had been declared.
5730 * data/push.c (yypush_parse): For impure mode, remove the
5731 yypushed_char, yypushed_val, and yypushed_loc arguments.
5732 Instead, declare these as local variables initialized to the global
5733 yychar, yylval, and yylloc.
5734 For the first yypush_parse invocation only, restore the initial values
5735 of these global variables when it's time to read a token since they
5736 have been overwritten.
5737 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
5739 * tests/calc.at (Simple LALR(1) Calculator): Always declare
5740 %pure-parser along with %push-parser since this test case was designed
5741 for pure push parsers.
5742 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
5743 (AT_YACC_OR_PUSH_IF): New.
5744 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
5745 add a note that it's still wrong for some cases (as it has been for a
5747 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
5748 %push-parser no longer implies %pure-parser.
5750 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5752 Remove some unnecessary differences between the pull parser code and
5753 the push parser code. This patch enables yynerrs in push mode.
5754 * data/push.c: Reformat M4 a little.
5755 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
5756 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
5757 because push mode is on. Instead, if pure mode is on, move yynerrs
5759 (b4_declare_parser_state_variables): ... here.
5760 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
5761 to yyps->NAME so it can be used in yypush_parse.
5762 (yypush_parse): Don't omit uses of yynerrs in push mode.
5764 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5766 Fix bug such that the first pushed token's value and location are
5767 sometimes overwritten (sometimes by %initial-action) before being used.
5768 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
5769 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
5770 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
5771 more closely mimic the pull parser logic.
5772 Don't copy the pushed token to yychar, yylval, and yylloc until it's
5773 time to read a token, which is after any initialization of yylval and
5775 (gottoken): Rename label to...
5776 (yyread_pushed_token): ... for clarity and to avoid infringing on the
5779 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5781 Rearrange initialization of the parser state variables so that the
5782 skeleton doesn't have to have a copy for pull mode and another for push
5783 mode. This patch also fixes at least a bug such that yylloc was not
5784 initialized (with b4_location_initial_line and
5785 b4_location_initial_column) upon calling yypush_parse. However, that
5786 initialization now overwrites the first token's location;
5787 %initial-action assigning @$ already did the same thing, and both bugs
5788 will be fixed in a later patch.
5789 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
5790 (b4_declare_parser_state_variables): Remove initialization of yytoken,
5791 yyss, yyvs, yyls, and yystacksize.
5792 (yypstate_new): Remove initialization of some yypstate fields: yystate,
5793 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
5795 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
5796 yyps->NAME so it can be used in yypush_parse.
5797 (yyparse or yypush_parse): For yypush_parse, don't print the
5798 "Starting parse" diagnostic for invocations after the first.
5799 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
5800 yypush_parse, only do it for the first invocation.
5801 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
5802 initialization to occur in yypush_parse but only on the first
5805 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5807 * data/push.c: Add CPP guards around push parser declarations in both
5808 the header and the code file.
5809 In the code file, move the push parser declarations to the same place
5810 they appear in the header file.
5811 Clean up the M4 some, especially the inconsistent underquoting in
5812 some b4_c_function_def and b4_c_function_decl uses.
5814 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5816 Encapsulate the push parser state variables into an M4 macro so the
5817 push skeleton doesn't have to list them again for pull mode's yyparse.
5818 For push mode, remove yypush_parse's local equivalents of these
5819 variables to eliminate unnecessary copying between the two sets at
5820 run-time. This patch also fixes at least a bug related to multiple
5821 %initial-action invocations in push mode.
5822 * data/push.c (b4_declare_parser_variables): Rename to...
5823 (b4_declare_scanner_communication_variables): ... this for clarity and
5825 (b4_declare_yyparse_variables): Remove and move its contents to the one
5826 spot where it was invoked.
5827 (b4_declare_parser_state_variables): New macro containing the parser
5828 state variables required by push mode.
5829 (struct yypstate): Replace all fields but yynew with
5830 b4_declare_parser_state_variables.
5831 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
5832 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
5833 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
5834 (yyparse or yypush_parse): For yyparse in pull mode, replace local
5835 parser state variable declarations with
5836 b4_declare_parser_state_variables.
5837 Don't initialize parser state variables when calling yypush_parse since
5838 yypstate_new already does that.
5839 Invoke the user's initial action only upon the first yypush_parse
5841 Remove all code that copies between the local parser state variables
5844 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5846 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
5847 prevent a name collision in a future patch where these names will
5848 sometimes be #define'd.
5849 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
5850 since it no longer has the same name as the existing argument.
5851 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
5853 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
5854 and Joel E. Denny <jdenny@ces.clemson.edu>
5856 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
5857 that the argument is case-insensitive, and there's no `=' here.
5858 For the %skeleton entry, mention that %language is better.
5859 (Bison Options): Likewise for --language and --skeleton. Move the
5860 --skeleton entry so that the `Tuning the parser' section is sorted
5861 alphabetically on long options.
5862 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
5863 %language directive in detail here; cross-reference the %language
5864 documentation instead.
5865 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
5866 `%require "2.3b"' so that the example is always up-to-date.
5867 (Table of Symbols): Add entries for %language and %skeleton.
5868 * examples/extexi (normalize): Instead of replacing every %require
5869 argument with the current Bison version, just substitute for
5870 `@value{VERSION}'. This guarantees that we're testing what actually
5871 appears in the documentation.
5872 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
5873 rather than `@VERSION@'.
5875 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5877 * NEWS: Reword the %language news a bit, and put it earlier.
5879 * src/getargs.c (skeleton_arg): Last arg is now location const *.
5880 Rewrite to simplify the logic.
5881 (language_argmatch): Likewise.
5882 (program_name): We now own this var.
5883 * src/getargs.h (struct bison_language): Use char[] rather than
5886 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
5888 * src/complain.c (program_name): Remove decl; no longer needed.
5889 * src/main.c (program_name): Remove; now belongs to getargs.
5891 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
5893 * NEWS: Document %language.
5895 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
5897 * data/c-skel.m4, data/c++-skel.m4: New files.
5898 * data/glr.c: Complain on push parsers.
5900 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
5902 (Decl Summary): Document %language and %skeleton.
5903 (Command line): Document -L.
5905 * examples/extexi: Rewrite %require directive.
5906 * examples/calc++/Makefile.am: Pass VERSION to extexi.
5908 * src/files.c (compute_exts_from_gc): Look in language structure
5910 (compute_file_name_parts): Check whether .tab should be added.
5911 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
5912 (language, skeleton_arg, language_argmatch): New.
5913 (long_options): Add --language.
5914 (getargs): Use skeleton_arg, add -L/--language.
5915 * src/getargs.h: Include location.h.
5916 (struct bison_language, language, skeleton_arg, language_argmatch): New.
5917 * src/output.c (prepare): Pick default skeleton from struct language.
5918 Don't dispatch C skeletons here.
5919 * src/parse-gram.y (PERCENT_LANGUAGE): New.
5920 (prologue_declaration): Add "%language" rule, use skeleton_arg.
5921 * src/scan-gram.l ("%language"): New rule.
5923 * tests/calc.at: Test %skeleton and %language.
5924 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
5925 (AT_GLR_IF): Look for %skeleton "glr.cc".
5926 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
5927 (AT_YACC_IF): Reject %language.
5929 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5931 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
5932 since it wasn't used; only the typedef name 'semantic_type' is needed.
5933 Also, omit trailing white space.
5935 * bootstrap: Sync from coreutils.
5936 (gnulib_extra_files): Add build-aux/announce.gen.
5937 (slurp): Adjust .gitignore files like .cvsignore files.
5938 * build-aux/announce-gen: Remove from CVS, since bootstrap
5941 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
5943 Make %push-parser imply %pure-parser. This fixes several bugs; see
5944 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
5945 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
5947 * data/push.c: Don't bother testing b4_push_if when deciding whether
5948 to expand b4_declare_parser_variables globally.
5949 (yypush_parse): Likewise in here.
5951 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
5952 (yy_reduce_print): Reformat M4 for readability.
5954 2006-12-15 Bob Rossi <bob@brasko.net>
5955 and Joel Denny <jdenny@ces.clemson.edu>
5957 * data/push.c (yypstate): Add typedef, and update all uses of
5958 struct yypstate to just yypstate.
5959 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
5961 2006-12-14 Bob Rossi <bob@brasko.net>
5963 * data/push.c (yypush_parse): Declare prototype regardless of
5966 2006-12-14 Bob Rossi <bob@brasko.net>
5968 * data/push.c (yyparse): Remove the prototype and the #define when in
5971 2006-12-13 Bob Rossi <bob@brasko.net>
5973 * data/push.c (yypstate_init): Rename to...
5974 (yypstate_new): ... this and use b4_c_function_def.
5975 (yypstate_delete): New.
5976 (yypush_parse): Change parameters yynval and yynlloc to be const.
5977 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
5978 yypstate_delete functions.
5980 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
5982 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
5983 strange test case titles. Reported by Bob Rossi.
5985 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
5987 * TODO: Add pointer to Sylvain Schmitz's work on static detection
5988 of potential ambiguities in GLR grammers.
5990 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
5992 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
5993 `bison ', use m4_index instead of m4_substr since chopping up a string
5994 containing M4-special characters causes problems here.
5996 Fix a couple of bugs related to special characters in user-specified
5997 file names, and make it easier for skeletons to compute output file
5998 names with the same file name prefix as Bison-computed output file
6000 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
6001 b4_parser_file_name and b4_spec_defines_file instead of
6002 @output_parser_name@ and @output_header_name@, which are now redundant.
6003 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
6004 b4_parser_file_name, b4_spec_defines_file, and the new
6005 @basename(FILENAME@) instead of @output_parser_name@ and
6006 @output_header_name@, which inappropriately escaped the file names as
6008 * src/files.c (all_but_ext): Remove static qualifier.
6009 (compute_output_file_names): Move `free (all_but_ext)' to...
6010 (output_file_names_free): ... here since all_but_ext is needed later.
6011 * src/files.h (all_but_ext): Extern.
6012 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
6013 exactly what MUSCLE_INSERT_STRING used to do.
6014 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
6015 characters are escaped properly.
6016 * src/output.c (prepare): Define muscle file_name_all_but_ext as
6018 For pkgdatadir muscle, maintain previous functionality by using
6019 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
6020 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
6021 digraphs would never be expanded. Hopefully no one has M4-special
6022 characters in his Bison installation path.
6023 * src/scan-skel.l: Don't parse @output_header_name@ and
6024 @output_parser_name@ anymore since they're now redundant.
6025 In @output, use decode_at_digraphs.
6026 Parse a new @basename command that invokes last_component.
6027 (decode_at_digraphs): New.
6028 (BASE_QPUTS): Remove unused.
6029 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
6030 (Output file name): New tests.
6032 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
6034 Warn about output files that are generated by the skeletons and that
6035 conflict with other output files.
6036 * data/glr.c: Don't generate the header file here when glr.cc does.
6037 * src/files.c (file_names, file_names_count): New static globals.
6038 (compute_output_file_names): Invoke output_file_name_check for files
6039 not generated by the skeletons and remove existing checks.
6040 (output_file_name_check): New function that warns about conflicting
6042 (output_file_names_free): Free file_names.
6043 * src/files.h (output_file_name_check): Declare.
6044 * src/scan-skel.l: Invoke output_file_name_check for files generated by
6046 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
6047 (Conflicting output files): New tests.
6049 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6051 * doc/bison.texinfo: Fix a couple of typos.
6053 2006-12-08 Bob Rossi <bob@brasko.net>
6055 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
6057 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
6059 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
6060 (yypush_parse): Rename yypvars argument to yyps and remove redundant
6062 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
6063 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
6065 2006-12-07 Bob Rossi <bob@brasko.net>
6066 and Joel Denny <jdenny@ces.clemson.edu>
6068 * data/push.c (yypvarsinit): Change return type from void* to struct
6069 yypvars*. No longer cast to void* on return.
6070 (struct yypvars): Remove yylen since it need not be remembered between
6071 yypushparse invocations.
6072 (yypushparse): Don't copy between yylen and pv->yylen.
6074 2006-12-05 Bob Rossi <bob@brasko.net>
6076 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
6077 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
6078 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
6079 (struct yypvars): Remove b4_declare_parser_variables.
6080 (yypvarsinit): Remove init code for removed variables.
6081 (global scope): Do not declare b4_declare_parser_variables if
6083 (yypushparse): Add b4_declare_parser_variables.
6084 Init new local variables, and remove init code for removed
6087 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
6088 and yyparse for other modes.
6089 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
6090 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
6091 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
6092 (AT_PURE_LEX_IF): True if pure or push parser.
6094 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
6096 Document Yacc prologue alternatives and default %destructor's and
6097 %printer's as experimental. Don't mention Java yet. Discussed at
6098 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
6099 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
6100 (2.3a): Annotate this entry to say the old forms of these features were
6102 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
6103 Table of Symbols): Say they're experimental. Comment out any mention
6104 of Java (we'll want this back eventually).
6106 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
6108 Support a file name argument to %defines. Deprecate `=' in
6109 %file-prefix, %name-prefix, and %output. Discussed at
6110 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
6111 * NEWS (2.3a+): Mention.
6112 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
6113 form of %defines, and remove `=' from entries for %file-prefix,
6114 %name-prefix, and %output.
6115 * src/parse-gram.y (prologue_declaration): Implement.
6116 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
6117 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
6118 all but one occurrence of %name-prefix.
6119 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
6120 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
6121 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
6122 occurrence of each of %file-prefix and %output. Add check for %defines
6124 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
6125 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
6126 Remove the `=' from %output.
6128 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
6130 Don't escape $ in test case titles since Autoconf 2.61 now does that
6132 * tests/actions.at (Default %printer and %destructor are not for error
6133 or $undefined): Here.
6134 (Default %printer and %destructor are not for $accept): Here.
6135 * tests/input.at (Invalid $n and @n): Here.
6137 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
6139 Rename <!> to <>. Discussed starting at
6140 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
6141 * NEWS (2.3a+): Update.
6142 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
6144 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
6145 * src/scan-gram.l (INITIAL): Implement.
6146 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
6147 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
6149 * tests/actions.at (Default tagless %printer and %destructor,
6150 Default tagged and per-type %printer and %destructor,
6151 Default %printer and %destructor are not for error or $undefined,
6152 Default %printer and %destructor are not for $accept,
6153 Default %printer and %destructor for mid-rule values): Update.
6154 * tests/input.at (Default %printer and %destructor redeclared,
6155 Unused values with default %destructor): Update.
6157 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
6159 Don't let %prec take a nonterminal.
6160 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
6162 * tests/input.at (%prec takes a token): New test checking that %prec
6163 won't take a nonterminal.
6165 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6167 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
6168 it was double-quoted.
6169 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
6170 grammar is maintained with Bison's highest standards.
6171 * src/getargs.c: Fix some typos in Doxygen comments.
6173 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6175 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
6176 later. Reported by Paul Eggert in
6177 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
6178 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
6179 * src/scan-code.l (translate_action): Don't bother invoking
6180 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
6181 (code_scanner_free): Instead of invoking
6182 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
6184 * src/scan-gram.l (gram_scanner_free): Likewise.
6185 * src/scan-skel.l (scan_skel): Likewise.
6187 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
6189 * src/files.c (tr): Change return type to void.
6190 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
6191 has been called previously for the same key.
6192 (muscle_find): Return storage instead of value so that
6193 --enable-gcc-warnings doesn't produce warnings that the return discards
6194 const. aver that the value and storage are the same since storage
6195 could potentially be NULL when value is not.
6196 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
6199 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6201 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
6202 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
6203 us a slightly cleaner distribution, and also works.
6204 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
6207 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
6208 and Paul Eggert <eggert@cs.ucla.edu>
6210 Don't let Bison leak memory except when it complains.
6211 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
6212 (spec_defines_file, dir_prefix): Now char *, not const char *,
6213 since they are freed.
6214 * src/files.c: Likewise.
6215 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
6217 (tr): Now operates in-place. All uses changed.
6218 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
6220 (compute_file_name_parts, compute_output_file_names): Don't store
6221 read-only data in variables that will be freed.
6222 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
6223 src_extension, and header_extension.
6224 (output_file_names_free): New public function to free
6225 spec_verbose_file, spec_graph_file, spec_defines_file,
6226 parser_file_name, and dir_prefix.
6227 * src/getargs.c (getargs): Don't store read-only data in variables that
6229 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
6230 (which previously existed but was unused), and quotearg_free.
6231 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
6232 * src/muscle_tab.c: Likewise.
6233 (muscle_entry): Make the value char const *,
6234 and add a new storage member that is char * and can be freed.
6235 (muscle_entry_free): New private function.
6236 (muscle_init): Use it instead of free.
6237 (muscle_insert, muscle_grow): Update and use new storage member.
6238 (muscle_code_grow): Free the string passed to muscle_grow
6239 since it's not needed anymore.
6240 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
6241 add a new `char *code' member.
6242 ("{...}"): Declare semantic type as code.
6243 * src/scan-code.h (translate_rule_action):
6244 (translate_symbol_action, translate_code, translate_action): Return
6245 `char const *' rather than `char *' since external code should not free
6247 * src/scan-code.l: Likewise.
6248 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
6249 which is "{...}" in the parser.
6250 * tests/Makefile.am (maintainer-check-valgrind): Set
6251 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
6253 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
6255 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
6256 expecting a non-zero exit status sets --leak-check=summary and
6257 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
6258 this case, and we don't want to hear about it.
6260 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6262 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
6263 instead of from the template, to simplify configuration a bit.
6264 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
6265 and m4/wint_t.m4, as they are needed with the latest gnulib.
6267 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6269 Disable unset/unused mid-rule value warnings by default, and recognize
6270 --warnings=midrule-values to enable them. Discussed starting at
6271 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
6272 * NEWS (2.3a+): Mention.
6273 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
6274 warnings): Add entry for midrule-values subargument.
6275 * src/reader.c (symbol_should_be_used): Don't return true just because
6276 the value is a set/used mid-rule value unless
6277 --warnings=midrule-values was specified.
6278 * tests/input.at (Unused values, Unused values before symbol
6279 declarations): Run tests with and without --warnings=midrule-values.
6281 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
6282 than LIST_FREE directly.
6284 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6286 Finish implementing --warnings=error, which should not be implied by
6287 --warnings=all (or by its synonyms -W and --warnings without
6289 * src/complain.c (set_warning_issued): New function to report that
6290 warnings are being treated as errors and to record an error if so.
6292 (warn_at, warn): ... here.
6293 * src/getargs.c (warnings_args, warnings_types): Reorder so that
6294 "error - warnings are errors" does not appear above "all - all of the
6296 (getargs): For -W and --warnings without subarguments, don't let
6297 FLAGS_ARGMATCH set warnings_error in warnings_flag.
6298 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
6300 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6302 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
6303 empty subargument list. For example: `bison --warnings= parser.y'.
6305 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6307 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
6308 the parser header file so that gcc doesn't warn.
6310 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6312 Split the default %destructor/%printer into two kinds: <*> and <!>.
6313 Discussed starting at
6314 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
6315 * NEWS (2.3a+): Mention.
6316 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
6317 previous change today related to mid-rules.
6318 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
6319 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
6320 (TYPE_TAG_ANY): Add as <*>.
6321 (TYPE_TAG_NONE): Add as <!>.
6322 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
6324 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
6325 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
6326 * src/symlist.c (symbol_list_default_new): Split into tagged and
6328 (symbol_list_destructor_set, symbol_list_printer_set): Split
6329 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
6330 SYMLIST_DEFAULT_TAGLESS.
6331 * src/symlist.h: Update symbol_list_default*_new prototypes.
6332 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
6333 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
6334 * src/symtab.c (default_destructor, default_destructor_location,
6335 default_printer, default_printer_location): Split each into tagged and
6337 (symbol_destructor_get, symbol_destructor_location_get,
6338 symbol_printer_get, symbol_printer_location_get): Implement tagged
6339 default and tagless default cases.
6340 (default_destructor_set, default_printer_set): Split each into tagged
6341 and tagless versions.
6342 * src/symtab.h: Update prototypes.
6343 * tests/actions.at (Default %printer and %destructor): Rename to...
6344 (Default tagless %printer and %destructor): ... this, and extend.
6345 (Per-type %printer and %destructor): Rename to...
6346 (Default tagged and per-type %printer and %destructor): ... this, and
6348 (Default %printer and %destructor for user-defined end token): Extend.
6349 (Default %printer and %destructor are not for error or $undefined):
6351 (Default %printer and %destructor are not for $accept): Update.
6352 (Default %printer and %destructor for mid-rule values): Extend.
6353 * tests/input.at (Default %printer and %destructor redeclared): Extend.
6354 (Unused values with default %destructor): Extend.
6356 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6358 Don't apply the default %destructor/%printer to an unreferenced midrule
6360 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
6361 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
6362 like $@n instead of just @n so that the default %destructor/%printer
6363 logic doesn't see them as user-defined symbols.
6364 (symbol_is_dummy): Check for both forms of the name.
6365 * src/reader.c (packgram): Remove the `$' from each midrule symbol
6366 name for which the midrule value is referenced in any action.
6367 * tests/actions.at (Default %printer and %destructor for mid-rule
6369 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
6370 for change to dummy symbol names.
6372 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
6374 Warn about unset midrule $$ if the corresponding $n is used.
6375 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
6377 (packgram): Before invoking grammar_rule_check on any rule, make sure
6378 all actions have already been scanned in order to set `used' flags.
6379 Otherwise, checking that a midrule's $$ is set will not always work
6380 properly because the midrule check must forward-reference the midrule's
6382 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
6385 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
6387 More improvements to the documentation of the prologue alternatives:
6388 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
6390 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
6391 some text to clarify the relative importance of the new directives and
6392 to show how these directives may be viewed as code labels.
6394 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
6396 Similar to the recently removed %before-header, add %code-top as the
6397 alternative to the pre-prologue. Mentioned at
6398 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
6399 Also, let the prologue alternatives appear in the grammar section.
6400 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
6401 (prologue_declaration): Move the existing prologue alternatives to...
6402 (grammar_declaration): ... here and add %code-top.
6403 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
6405 Clean up and extend documentation for the prologue alternatives.
6406 * NEWS (2.3a+): Describe prologue alternatives.
6407 * doc/bison.texinfo (Prologue): Move discussion of prologue
6409 (Prologue Alternatives): ... this new section, and extend it to discuss
6410 all 4 directives in detail.
6411 (Table of Symbols): Clean up discussion of prologue alternatives and
6414 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6416 DJGPP specific issues.
6418 * djgpp/config.bat: config.hin has been moved to lib. Adjust
6419 config.bat accordingly.
6420 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
6421 * djgpp/config.site: Likewise.
6423 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
6425 Replace %*-header with %provides, %requires, %code. See discussion at
6426 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
6428 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
6429 (b4_user_start_header): Remove.
6430 * data/glr.c: Use new macros instead of b4_*start_header
6432 * data/glr.cc: Likewise.
6433 * data/lalr1.cc: Likewise.
6434 * data/push.c: Likewise.
6435 * data/yacc.c: Likewise.
6437 * doc/bison.texinfo: Remove %before-header, rename
6438 %{start,end,after}-header to %requires, %provides, %code.
6440 * src/parse-gram.y: Likewise (also rename token names accordingly).
6441 * src/scan-gram.l: Likewise.
6442 * tests/actions.at: Likewise.
6444 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
6446 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
6447 Problem reported by Joel E. Denny.
6449 2006-10-14 Jim Meyering <jim@meyering.net>
6451 (Sync from coreutils.)
6452 Work also when the working directory (with e.g. coreutils sources)
6453 is version controlled with git, rather than CVS.
6454 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
6456 In messages and comments, say e.g., "checked-out sources",
6457 rather than "CVS sources".
6458 (version_controlled_file): New function. Work for git as well as
6459 for CVS. Don't use grep's -q option.
6460 (slurp): Call it here, in place of CVS-specific code.
6462 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
6464 Fix testsuite for ./configure --enable-gcc-warnings:
6465 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
6466 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
6467 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
6468 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
6469 * test/regression.at (Diagnostic that expects two alternatives):
6472 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6474 * bootstrap.conf (gnulib_modules): Add config-h.
6475 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
6476 worry about HAVE_CONFIG_H.
6477 * lib/abitset.c: Likewise.
6478 * lib/bitset.c: Likewise.
6479 * lib/bitset_stats.c: Likewise.
6480 * lib/bitsetv-print.c: Likewise.
6481 * lib/bitsetv.c: Likewise.
6482 * lib/ebitset.c: Likewise.
6483 * lib/get-errno.c: Likewise.
6484 * lib/lbitset.c: Likewise.
6485 * lib/subpipe.c: Likewise.
6486 * lib/timevar.c: Likewise.
6487 * lib/vbitset.c: Likewise.
6488 * lib/bitset.c: Include "bitset.h" first, to test interface.
6489 * lib/bitset_stats.c: Include "bitset_stats.h" first.
6490 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
6491 * lib/bitsetv.c: Include "bitsetv.h" first.
6492 * lib/get-errno.c: Include "get-errno.h" first.
6493 * m4/.cvsignore: Add config-h.m4.
6494 * tests/actions.at (Default %printer and %destructor for ...):
6495 Adjust expected line numbers in output to reflect removal of #if
6496 HAVE_CONFIG_H lines.
6497 * tests/glr-regression.at (Missed %merge type warnings when ...):
6499 * tests/regression.at (Braced code in declaration in rules section):
6501 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
6502 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
6503 Include <config.h> unconditionally.
6505 * bootstrap: Sync from coreutils, as follows:
6507 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6509 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
6510 variable was sometimes used without being initialized. This
6511 messed up the installation of the INSTALL file in some cases.
6513 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6515 * bootstrap (usage, main program, symlink_to_gnulib): Add option
6516 --copy. Inspired by a suggestion from Bruno Haible.
6518 2006-10-03 Jim Meyering <jim@meyering.net>
6520 * bootstrap: Undo last change to this file, since now gnulib-tool
6521 sticks with the automake default in generating dependencies.
6523 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6525 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
6526 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
6528 * doc/bison.1: Add copyright notice.
6530 * data/glr.c: Don't include <stdarg.h>; not used.
6532 * NEWS: The -g and --graph options now output graphs in Graphviz
6533 DOT format, not VCG format.
6534 * doc/bison.1: Likewise.
6535 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
6536 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
6538 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
6539 * TODO: Remove Graphviz entry.
6540 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
6541 remove vcg.c, vcg.h, vcg_defaults.h.
6542 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
6543 * src/graphviz.c, src/graphviz.h: New files.
6544 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
6545 * src/files.h: Make comment more generic.
6546 * src/main.c (main): Likewise.
6547 * src/print_graph.h: Likewise.
6548 * src/getargs.c (usage): Make usage description more generic.
6549 * src/print_graph.c: Include graphviz.h rather than vcg.h.
6550 (static_graph, fgraph): Remove. All uses changed to pass
6551 arguments instead of sharing a static var.
6552 (print_core, print_actions, print_state, print_graph):
6553 Output graphviz format rather than VCG format.
6554 * tests/.cvsignore: Remove *.vcg; add *.dot.
6555 * tests/output.at: Expect *.dot files, not *.vcg files.
6557 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
6558 accommodates the 2006-10-08 change.
6560 2006-10-11 Bob Rossi <bob@brasko.net>
6562 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
6563 (b4_yyssa, b4_yyerror_range): New macros.
6564 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
6565 (yypvarsinit): Remove init of removed fields.
6566 (yypushparse): Remove use of removed fields; use new macros instead.
6568 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6570 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
6571 in a push parser. Reindent slightly to match yacc.c better.
6573 2006-10-11 Bob Rossi <bob@brasko.net>
6575 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
6577 (yypvarsinit, yypushparse): Remove init of removed fields.
6578 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
6580 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6582 * THANKS: Add Paolo Bonzini and Bob Rossi.
6584 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
6586 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
6587 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
6588 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
6589 b4_define_user_cde and uses): Remove.
6590 (b4_comment, b4_prefix, b4_sync_start): New.
6591 * data/bison.m4: New file, with most of the content removed from c.m4.
6592 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
6593 * src/output.c (output_skeleton): Pass bison.m4.
6594 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
6597 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
6599 Fix test failure reported by Tom Lane in
6600 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
6601 and try to make such failures easier to catch in the future.
6602 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
6603 that's now the caller's responsibility.
6604 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
6605 Set yychar = YYEOF if it's negative.
6606 * tests/actions.at (yylex): Abort if asked to read past EOF.
6607 * tests/conflicts.at (yylex): Likewise.
6608 * tests/cxx-type.at (yylex): Likewise.
6609 * tests/glr-regression.at (yylex): Likewise.
6610 * tests/input.at (yylex): Likewise.
6611 * tests/regression.at (yylex): Likewise.
6612 * tests/torture.at (yylex): Likewise.
6614 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
6616 Fix problems with translating English-language diagnostics.
6617 * bootstrap: Fix bug introduced in recent bootstrap changes, with
6618 respect to bison-runtime pot generation. The YY_ stuff
6619 wasn't being captured.
6620 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
6621 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
6622 * runtime-po/POTFILES.in: Add data/push.c.
6624 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
6626 Merge bootstrap changes from coreutils.
6628 2006-09-28 Jim Meyering <jim@meyering.net>
6630 Automatically generated dependencies are important even
6631 when all of the sources in a directory come from gnulib.
6632 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
6633 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
6635 2006-09-23 Jim Meyering <jim@meyering.net>
6637 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
6639 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6641 * bootstrap: Add support for --force.
6642 (usage): New function. Describe usage less tersely.
6643 (CVS_only_file): New var.
6645 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
6647 * data/push.c (YYPUSH_MORE): Make it an enum instead.
6648 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
6649 Adjust white space and comments to match GNU style better.
6651 2006-09-20 Bob Rossi <bob@brasko.net>
6653 * data/push.c (yyresult_get): Remove function.
6654 (YYPUSH_MORE): Add #define.
6655 (yypushparse): Modify return value.
6657 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6659 * stamp-h.in: Remove; no longer needed.
6660 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
6661 Remove config.h, config.hin, intl (no longer created).
6662 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
6665 Sync bootstrap from coreutils, as follows:
6667 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
6669 * bootstrap (symlink_to_gnulib): New function.
6670 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
6671 to copies-of-gnulib.
6672 (cp_mark_as_generated, slurp, gnulib_files):
6673 Avoid making a copy if it's the same as the old version.
6674 (gnulib_files): Add support for this variable (used by Bison).
6676 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6678 * src/getargs.c (usage): Rework to use conventions similar to
6679 coreutils, to make translation a bit easier and the code a bit
6680 smaller. Problem reported by Tim Van Holder.
6682 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
6684 Use some of gnulib's new modules, taken from coreutils.
6686 * bootstrap: Sync from coreutils, except add support for gnulib_files.
6687 * bootstrap.conf: New file.
6688 (gnulib_modules): Add configmake, inttypes, unistd.
6689 (XGETTEXT_OPTIONS): Add complain, complain_at,
6690 fatal, fatal_at, warn, warn_at, unexpected_end.
6691 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
6692 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
6694 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
6696 (GNULIB_AUTOCONF_SNIPPET): Remove.
6697 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
6699 * lib/.cvsignore: Add inttypes_.h.
6700 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
6701 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
6702 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
6703 no-longer-necessary initializations.
6704 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
6705 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
6706 use the unistd module.
6707 * src/system.h: Likewise.
6708 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
6709 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
6710 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
6711 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
6712 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
6713 * src/system.h: Include inttypes.h unconditionally, now that we
6714 use the inttypes module. Don't bother to include stdint.h, since
6715 inttypes.h now does that for us.
6716 (LOCALEDIR): Remove, now that we use the configmake module.
6717 * src/getargs.c: Include configmake.h.
6718 * src/main.c: Likewise.
6719 * src/output.c: Likewise.
6720 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
6721 not from $abs_top_builddir, since config.h moved.
6724 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
6725 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
6727 * src/parse-gram.y (symbol_declaration): Don't put statements
6728 before declarations; it's not portable to C89.
6729 * src/scan-code.l (handle_action_at): Likewise.
6731 * src/scan-code.l: Always initialize braces_level; the old code
6732 left it uninitialized and therefore had undefined behavior.
6734 Don't attempt to redefine 'assert', since it runs afoul of
6735 systems where standard headers (mistakenly) include <assert.h>.
6736 Instead, define and use our own alternative, called 'aver'.
6737 * src/reader.c: Don't include assert.h, since we no longer
6739 * src/scan-code.l: Likewise.
6740 * src/system.h (assert): Remove, replacing with....
6741 (aver): New function, taking a bool arg. All uses changed.
6742 * src/tables.c (pack_vector): Ensure that aver arg is bool,
6743 not merely an integer.
6745 2006-09-15 Bob Rossi <bob@brasko.net>
6747 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
6748 * data/c.m4 (YYPUSH): New.
6749 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
6750 * src/getargs.c (push_parser): New var.
6751 * src/getargs.h (push_parser): New declaration.
6752 * src/output.c (prepare): Add macro insertion of `push_flag'.
6753 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
6754 (prologue_declaration): Parse %push-parser.
6755 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
6756 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
6757 list of removed lines from the traces observed.
6758 (AT_CHECK_CALC_LALR): Added push parser tests.
6760 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
6762 * NEWS: Version 2.3a.
6763 * configure.ac (AC_INIT): Likewise.
6765 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
6766 "#define YYSTYPE int" that caused "make maintainer-check" to fail
6767 due to header ordering dependencies. I don't know why the #define
6770 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
6771 runtime cost when YYDEBUG is not defined, and so that some tests
6772 that used to fail now work. Problem and initial suggestion by
6774 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
6775 * data/glr.cc (b4_parser_class_name):
6776 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
6777 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
6778 (yydebug_) [YYDEBUG]: New member.
6779 (yycdebug_): Now defined only if YYDEBUG.
6780 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
6781 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
6782 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
6784 (debug_stream, set_debug_stream, debug_level, set_debug_level):
6785 Define only if YYDEBUG.
6786 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
6788 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
6789 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
6790 AT_CHECK_CALC_GLR_CC that are working now.
6792 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
6794 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
6795 We don't need them in glr.cc, and glr.c defines them.
6796 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
6797 assumes that defining it to anything is the same as defining
6798 it to 1. Problem reported by Paolo Bonzini.
6800 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
6802 * data/c.m4 (b4_null, b4_case): Define.
6803 * src/output.c (prepare_symbols): Use b4_null.
6804 (user_actions_output): Use b4_case.
6806 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
6808 * data/glr.c (b4_shared_declarations): Put start-header first,
6809 before any #includes that we generate, so that feature-test
6810 macros work. Problem reported by Michael Deutschmann in
6811 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
6812 * data/lalr1.cc: Likewise.
6813 * doc/bison.texinfo (Prologue): Document that feature-test macros
6814 should be defined before any Bison declarations.
6815 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
6816 that depend on location.hh after, not before, Bison decls, since
6817 we now include location.hh after the first user prologue.
6819 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
6820 Sander Brandenburg in
6821 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
6822 Also, fix minor white space and comment issues.
6823 (Prologue): Mention that it's better to define feature-test macros
6824 before Bison declarations. Problem reported by Michael Deutschmann.
6826 * README-cvs: Fix typo: "&" should be "&&". Problem reported
6828 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
6829 This adjusts to recent gnulib changes.
6831 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
6833 Finish implementation of per-type %destructor/%printer. Discussed
6835 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
6837 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
6838 * NEWS (2.3+): Add a description of this feature to the default
6839 %destructor/%printer description.
6840 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
6841 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
6842 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
6843 list node contains a semantic type.
6844 * src/symtab.c, src/symtab.h: Extend with a table that associates
6845 semantic types with their %destructor's and %printer's.
6846 (semantic_type_from_uniqstr, semantic_type_get,
6847 semantic_type_destructor_set, semantic_type_printer_set): New functions
6848 composing the public interface of that table.
6849 (symbol_destructor_get, symbol_destructor_location_get,
6850 symbol_printer_get, symbol_printer_location_get): If there's no
6851 per-symbol %destructor/%printer, look up the per-type before trying
6853 * tests/actions.at (Per-type %printer and %destructor): New test case.
6854 * tests/input.at (Default %printer and %destructor redeclared):
6855 Extend to check that multiple occurrences of %symbol-default in a
6856 single %destructor/%printer declaration is an error.
6857 (Per-type %printer and %destructor redeclared, Unused values with
6858 per-type %destructor): New test cases.
6860 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
6862 Require default %destructor/%printer to be declared using
6863 %symbol-default instead of an empty symbol list, and start working on
6864 new per-type %destructor/%printer. Discussed at
6865 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
6866 * NEWS (2.3+): Add %symbol-default to example.
6867 * bison.texinfo (Freeing Discarded Symbols): Likewise.
6868 (Table of Symbols): Add entry for %symbol-default.
6869 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
6870 (generic_symlist, generic_symlist_item): New nonterminals for creating
6871 a list in which each item is a symbol, semantic type, or
6873 (grammar_declaration): Use generic_symlist in %destructor and %printer
6874 declarations instead of symbols.1 or an empty list.
6875 (symbol_declaration, precedence_declaration, symbols.1): Update actions
6876 for changes to symbol_list.
6877 * src/reader.c: Update for changes to symbol_list.
6878 * src/scan-code.l: Likewise.
6879 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
6880 * src/symlist.c, src/symlist.h: Extend such that a list node may
6881 represent a semantic type or a %symbol-default in addition to just an
6882 ordinary symbol. Add switched functions for setting %destructor's and
6884 * tests/actions.at, tests/input.at: Add %symbol-default to all default
6885 %destructor/%printer declarations.
6887 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
6889 Whether the default %destructor/%printer applies to a particular symbol
6890 isn't a question of whether the user *declares* that symbol (in %token,
6891 for example). It's a question of whether the user by any means
6892 *defines* the symbol at all (by simply using a char token, for
6893 example). $end is defined by Bison whereas any other token with token
6894 number 0 is defined by the user. The error token is always defined by
6895 Bison regardless of whether the user declares it with %token, but we
6896 may one day let the user define error as a nonterminal instead.
6897 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
6898 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
6899 the meaning of "user-defined".
6900 * tests/actions.at (Default %printer and %destructor for user-declared
6901 end token): Rename to...
6902 (Default %printer and %destructor for user-defined end token): ...
6905 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
6906 computation of whether to apply the default, don't maintain a list of
6907 every Bison-defined symbol. Instead, just check for a first character
6908 of '$', which a user symbol cannot have, and check for the error token.
6910 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
6912 Don't apply the default %destructor or %printer to the error token,
6913 $undefined, or $accept. This change fits the general rule that the
6914 default %destructor and %printer are only for user-declared symbols,
6915 and it solves several difficulties that are described in the new test
6917 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
6918 * tests/actions.at (Default %printer and %destructor are not for error
6919 or $undefined, Default %printer and %destructor are not for $accept):
6922 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
6924 Allow %start after the first rule.
6925 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
6926 when parsing the first rule.
6927 (check_and_convert_grammar): Search for it here after all grammar
6928 declarations have been parsed. Skip midrules, which have dummy LHS
6930 * src/symtab.c (symbol_is_dummy): New function.
6931 * src/symtab.h (symbol_is_dummy): Declare it.
6932 * tests/input.at (%start after first rule): New test.
6934 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
6936 Redo some of the previous commit: add back the ability to use
6937 non-aliased/undeclared string literals since it might be useful to
6938 those declaring %token-table.
6939 * src/reader.c (check_and_convert_grammar): Undo changes in previous
6940 commit: don't worry about complaints from symbols_pack.
6941 * src/symtab.c (symbol_new, symbol_class_set,
6942 symbol_check_alias_consistency): Undo changes in previous commit: count
6943 each string literal as a new symbol and token, assign it a symbol
6944 number, and don't complain about non-aliased string literals.
6945 (symbols_pack): Since symbol_make_alias still does not decrement symbol
6946 and token counts but does still set aliased tokens to the same number,
6947 symbol_pack_processor now leaves empty slots in the symbols array.
6949 * tests/regression.at (Undeclared string literal): Remove test case
6950 added in previous commit since non-aliased string literals are allowed
6952 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
6953 remove unnecessary string literal declarations.
6954 * tests/sets.at (Firsts): Likewise.
6956 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
6958 Don't allow an undeclared string literal, but allow a string literal to
6959 be used before its declaration.
6960 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
6961 symbols_pack complained.
6962 * src/symtab.c (symbol_new): Don't count a string literal as a new
6964 (symbol_class_set): Don't count a string literal as a new token, and
6965 don't assign it a symbol number since symbol_make_alias does that.
6966 (symbol_make_alias): It's not necessary to decrement the symbol and
6967 token counts anymore. Don't assume that an alias declaration occurs
6968 before any uses of the identifier or string, and thus don't assert that
6969 one of them has the highest symbol number so far.
6970 (symbol_check_alias_consistency): Complain if there's a string literal
6971 that wasn't declared as an alias.
6972 (symbols_pack): Bail if symbol_check_alias_consistency failed since
6973 symbol_pack asserts that every token has been assigned a symbol number
6974 although undeclared string literals have not.
6975 * tests/regression.at (String alias declared after use, Undeclared
6976 string literal): New test cases.
6977 (Characters Escapes, Web2c Actions): Declare string literals as
6979 * tests/sets.at (Firsts): Likewise.
6981 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
6983 In the grammar scanner, STRING_FINISH unclosed constructs and return
6984 them to the parser in order to improve error messages.
6985 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
6986 SC_BRACED_CODE, SC_PROLOGUE): Implement.
6987 * tests/input.at (Unclosed constructs): New test case.
6988 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
6991 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
6994 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
6996 Handle string aliases for character tokens correctly.
6997 * src/symtab.c (symbol_user_token_number_set): If the token has an
6998 alias, check and set its alias's user token number instead of its own,
6999 which is set to indicate the alias. Previously, every occurrence of
7000 the character token in the grammar overwrote that alias indicator with
7002 * tests/input.at (String aliases for character tokens): New test.
7004 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
7006 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
7008 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
7010 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
7011 to prevent failures when building on older platforms.
7012 Check for autopoint failure.
7013 Set XGETTEXT_OPTIONS to values that check for C format strings,
7014 so that translators are warned about them (this also helps
7015 prevent core dumps).
7017 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
7018 function, since it simplifies our code a bit.
7020 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
7021 rather than -W, so we don't get bogus warnings about sign comparisons.
7022 Add -Wpointer-arith, since that warning is useful (it reports code
7023 that does not conform to C89 and that some compilers reject).
7024 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
7025 since it's no longer needed.
7027 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
7029 Clean up scanners a bit.
7030 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
7031 definitions so gcc won't warn when obstack_for_string is unused.
7032 * src/scan-code.l: config.h and system.h are already #include'd by
7033 scan-code-c.c, so get rid of them here.
7034 * src/scan-gram.l: Likewise.
7035 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
7036 definitions rather than duplicating the rest of it.
7037 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
7039 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
7041 Suppress signed/unsigned comparison warnings for yycheck.
7042 * data/c.m4 (b4_safest_int_type): New macro.
7043 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
7044 a signed int type, cast it to b4_safest_int_type first.
7045 * data/yacc.c: Likewise.
7046 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
7049 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
7051 * doc/bison.texinfo: Fix some typos.
7053 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
7055 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
7056 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
7058 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
7059 the latest gnulib does this a different way.
7060 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
7061 translation was patched, so stop omitting it.
7063 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
7065 Enable declaration of default %printer/%destructor. Make the parser
7066 use these for all user-declared grammar symbols for which the user does
7067 not declare a specific %printer/%destructor. Thus, the parser uses it
7068 for token 0 if the user declares it but not if Bison generates it as
7069 $end. Discussed starting at
7070 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
7071 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
7073 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
7074 * NEWS (2.3+): Mention.
7075 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
7076 declare a %destructor for a mid-rule's semantic value. It's just
7077 impossible to declare one specific to it.
7078 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
7079 code. Describe default %destructor form.
7080 * src/parse-gram.y (grammar_declaration): Parse default
7081 %printer/%destructor declarations.
7082 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
7083 and symbol_destructor_location_get rather than accessing the destructor
7084 and destructor_location members of struct symbol.
7085 (symbol_printers_output): Likewise but for %printer's.
7086 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
7088 * src/symtab.c (default_destructor, default_destructor_location,
7089 default_printer, default_printer_location): New static global
7090 variables to record the default %destructor and %printer.
7091 (symbol_destructor_get, symbol_destructor_location_get,
7092 symbol_printer_get, symbol_printer_location_get): New functions to
7093 compute the appropriate %destructor and %printer for a symbol.
7094 (default_destructor_set, default_printer_set): New functions to set the
7095 default %destructor and %printer.
7096 * src/symtab.h: Prototype all those new functions.
7097 * tests/actions.at (Default %printer and %destructor): New test to
7098 check that the right %printer and %destructor are called, that they're
7099 not called for $end, and that $$ and @$ work correctly.
7100 (Default %printer and %destructor for user-declared end token): New
7101 test to check that the default %printer and %destructor are called for
7102 a user-declared end token.
7103 * tests/input.at (Default %printer and %destructor redeclared, Unused
7104 values with default %destructor): New tests to check related grammar
7105 warnings and errors.
7107 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
7109 Clean up handling of %destructor for the end token (token 0).
7110 Discussed starting at
7111 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
7113 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
7115 Make the skeletons consistent in how they pop the end token and invoke
7117 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
7118 state, which has token number 0, since this would invoke the
7119 %destructor for the end token.
7120 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
7121 until after shifting the end token, or else it won't be popped.
7122 * data/yacc.c (yyparse): Likewise.
7124 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
7125 it's the end token. Upon termination, destroy an unshifted lookahead
7126 even when it's the end token.
7127 * data/lalr1.cc (yy::parser::parse): Likewise.
7128 * data/yacc.c (yyparse): Likewise.
7130 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
7131 value warnings for the end token when the user gives the end token a
7134 * tests/actions.at (Printers and Destructors): Test all the above.
7136 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
7138 Update to latest gnulib and gettext versions.
7139 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
7141 (gnulib_files): Add m4/warning.m4. Don't worry about files
7142 overwritten by autopoint.
7143 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
7144 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
7146 Don't use autoreconf; instead, invoke autopoint etc. by hand,
7147 so that we can remove the intl files at a better time.
7148 (intl_files_to_remove): Remove aclocal.m4, since it gets
7149 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
7150 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
7151 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
7152 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
7153 Remove datarootdir hack; no longer needed.
7154 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
7155 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
7156 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
7158 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
7159 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
7161 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
7163 * bootstrap: Adjust to today's change to gnulib-tool by invoking
7164 it with --assume-autoconf='latest-stable'.
7166 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
7168 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
7169 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
7171 * src/muscle_tab.h (muscle_grow): Replace the header comments with
7172 those from muscle_tab.c since the old ones are misleading.
7174 2006-07-13 Akim Demaille <akim@epita.fr>
7176 Support %define "KEY" {VALUE}.
7177 * src/scan-code.h, src/scan-code.l (translate_action)
7178 (translate_rule_action, translate_symbol_action, translate_code):
7179 Return char *, not const char *.
7180 * src/parse-gram.y (declaration): Rename as...
7181 (prologue_declaration): this.
7182 (string_content): Remove this nonterminal, use STRING.
7183 (braceless, content, content.opt): New nonterminal.
7185 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
7187 * src/scan-gram.l (getargs.h): Don't include it.
7189 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
7191 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
7192 rather than a for-loop that declares a local bool variable. This
7193 should work around a compatibility problem with a Cray x1e C++
7194 compiler reported by Hung Nguyen in
7195 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
7196 The for-loop was introduced in the 2004-11-17 change but I don't
7197 know why it was needed.
7199 2006-07-12 Akim Demaille <akim@epita.fr>
7201 * data/c.m4: Comment changes.
7203 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
7205 * src/complain.c (error_message, ERROR_MESSAGE): New.
7207 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
7208 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
7210 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7212 * NEWS: Instead of %union, you can define and use your own union type
7213 YYSTYPE if your grammar contains at least one <type> tag.
7214 Your YYSTYPE need not be a macro; it can be a typedef.
7215 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
7216 (Union Decl, Decl Summary): Document this.
7217 * data/glr.c (YYSTYPE): Implement this.
7218 * data/glr.cc (YYSTYPE): Likewise.
7219 * data/lalr1.cc (YYSTYPE): Likewise.
7220 * data/yacc.c (YYSTYPE): Likewise.
7221 * src/output.c (prepare): Output tag_seen_flag.
7222 * src/parse-gram.y (declaration, grammar_declaration):
7223 Use 'union_seen' rather than 'typed' to determine whether
7224 %union has been seen, since grammars can now be typed without
7226 (symbol_declaration, type.opt, symbol_def):
7227 Keep track of whether a tag has been seen.
7228 * src/reader.c (union_seen, tag_seen): New vars.
7230 * src/reader.h (union_seen, tag_seen, typed): Likewise.
7231 * src/scan-code.l (untyped_var_seen): New variable.
7232 (handle_action_dollar): Adjust to above changes.
7233 (handle_action_dollar, handle_action_at):
7234 Improve overflow checking for outlandish numbers.
7235 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
7236 avoid new diagnostics generated by above changes.
7237 * tests/regression.at (YYSTYPE typedef): Add test to check
7238 for type tags without %union.
7240 * src/symlist.c (symbol_list_length): Return int, not unsigned
7241 int, since callers expect int. This may need to get revisited
7242 once we have proper integer overflow checking.
7244 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
7245 object is now static.
7247 * src/getargs.c (flags_argmatch): Return void, not int,
7248 to pacify ./configure --enable-gcc-warnings.
7250 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
7251 since last_string is already defined to FLEX_PREFIX (last_string).
7253 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
7255 Implement --warnings/-W.
7256 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
7258 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
7260 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
7261 (warnings_args, warnings_types): New.
7262 (getargs, short_options, long_options): Accept -W/--warnings.
7263 Sort the options by alphabetical order, upper case letter right
7264 before its lower case.
7266 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
7268 Change %merge result type clash warnings to errors. Discussed at
7269 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
7270 * src/reader.c (record_merge_function_type): Use complain_at.
7271 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7272 declared later): Update test case results.
7274 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
7276 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
7277 to be in alphabetical order.
7278 (trace_args): Spelling fixes.
7280 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7282 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
7283 so they don't collide with user-defined macros.
7284 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
7285 this was never guaranteed, and now that we're using gnulib stdint,
7286 which defines int_fast16_t to long int, the problem is exposed.
7288 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
7290 * data/c.m4 (b4_basename): Simplify a bit, since we don't
7291 need the full POSIX semantics (and weren't implementing them
7294 Adjust to Autoconf 2.60 and today's gnulib.
7295 * bootstrap (gnulib_modules): Add stdint.
7296 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
7297 no longer copies it.
7298 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
7299 since stdint needs the former and wcwidth (which is now required
7300 by mbswidth) needs the latter.
7301 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
7302 work around a compatibility glitch between gettext 0.14.6 and
7304 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
7305 Do not check for uintptr_t, since new stdint module does the right
7307 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
7308 Add stdint.h, stdint_.h, wcwidth.h.
7309 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
7310 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
7311 stdint.m4, wchar_t.m4, wcwidth.m4.
7312 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
7313 usual order for ../lib/*.h files.
7314 (file_name_split): Use last_component, not base_name, to adjust
7316 * src/parse-gram.h: Include <strverscmp.h> in the usual order
7317 for ../lib/*.h files.
7318 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
7319 Define unconditionally, since we now assume the stdint module.
7320 * src/scan-skel.l: Include <dirname.h>.
7321 (BASE_QPUTS): Use last_component, not base_name.
7322 * src/system.h: Include <unlocked-io.h> in the usual order
7323 for ../lib/*.h files. Include <stdint.h> unconditionally,
7324 since we now use the stdint module.
7325 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
7326 HAVE_UINTPTR_T, since we now use the stdint module.
7327 (base_name): Remove decl, since files now include <dirname.h>
7330 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
7332 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
7334 * data/yacc.c, data/glr.c, data/location.cc: Use them.
7335 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
7337 * tests/calc.at: Adjust.
7339 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
7341 * data/c.m4 (b4_basename): New.
7342 (b4_syncline): Also output the location of its invocation (from
7344 (b4_user_action, b4_define_user_action, b4_user_actions)
7345 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
7346 (b4_user_stype): New.
7347 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
7349 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7351 In the grammar file, the first column is 1 not 0 on the first line as
7352 on every other line.
7353 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
7354 * tests/input.at (Torturing the Scanner): Update output.
7356 * src/scan-gram.l (scanner_cursor): Declare it static.
7358 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7360 In warnings, say "previous declaration" rather than "first
7362 * src/symtab.c (redeclaration): Do that here.
7363 * src/reader.c (record_merge_function_type): In the case of a result
7364 type clash, report the previous declaration rather than the very first
7365 one in the grammar file.
7366 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7367 declared later): Add a third declaration to check this behavior.
7368 * tests/input.at (Incompatible Aliases): Update output.
7370 2006-06-27 Akim Demaille <akim@epita.fr>
7372 * doc/Doxyfile.in: New.
7373 * doc/Makefile.am: Use it.
7374 * src/lalr.h, src/symtab.h: Initial doxygenation.
7376 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7378 Don't miss %merge result type warnings just because the LHS types are
7379 declared after the %merge. This continues the effort of the previous
7381 * src/reader.c (get_merge_function): Don't set the merger type yet.
7382 (record_merge_function_type): New function for setting the merger type
7383 and checking for clashes.
7384 (grammar_current_rule_merge_set): Set the location of the %merge for
7386 (packgram): Invoke record_merge_function_type for each rule now that
7387 all symbol type declarations have been parsed.
7388 * src/reader.h (merger_list.type_declaration_location): New member
7389 storing the location of the first %merge from which the type for this
7390 merging function was derived.
7391 * src/symlist.h (symbol_list.merger_declaration_location): New member
7392 storing the location of a rule's %merge, if any.
7393 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7394 declared later): New test to catch the error fixed by the above patch.
7396 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7398 Get action warnings (grammar_rule_check) right even when symbol
7399 declarations appear after the rules. Discussed at
7400 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
7402 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
7403 Don't mistake the type of $$ in a midrule to be that of its parent
7405 * src/reader.c (grammar_current_rule_end): Don't invoke
7406 grammar_rule_check yet since not all symbol declarations may have been
7408 (grammar_midrule_action): Likewise.
7409 Don't record whether the midrule's $$ has been used yet since actions
7410 haven't been translated yet.
7411 Record the midrule's parent rule and its RHS index within the parent
7413 (grammar_current_rule_action_append): Don't translate the action yet
7414 since not all symbol declarations may have been parsed yet and, thus,
7415 warnings about types for $$, $n, @$, and @n can't be reported yet.
7416 (packgram): Translate the action and invoke grammar_rule_check now that
7417 all symbol declarations have been parsed.
7418 * src/scan-code.l (handle_action_dollar): Now that this is invoked
7419 after parsing the entire grammar file, the symbol list here in the case
7420 of a midrule is actually the midrule's empty RHS, so reference its
7421 parent rule's RHS where necessary.
7422 On the other hand, now that you can already know it's a midrule, you
7423 aren't forced to think $$ has the same type as its parent rule's $$.
7424 (handle_action_at): In the case of a midrule, reference the parent rule
7426 * src/symlist.c (symbol_list_new): Initialize new midrule-related
7428 (symbol_list_length): Now that this is invoked after all rules have
7429 been parsed, a NULL symbol (rather than a NULL symbol list node)
7430 terminates a rule. symbol_list_print already does this correctly.
7431 * src/symlist.h (symbol_list.midrule_parent_rule,
7432 symbol_list.midrule_parent_rhs_index): New members so that midrules can
7433 remember their relationships with their parents.
7434 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
7435 fixed by the above patch.
7436 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
7438 (Unused values): ... this old test case and...
7439 (Unused values before symbol declarations): ... this new test case.
7440 This one is the same as `Unused values' except that all symbol
7441 declarations appear after the rules in order to catch the rest of the
7442 errors fixed by the above patch.
7444 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7447 * src/reader.c (current_rule): Declare it static since it's no longer
7448 used outside this file.
7449 (grammar_current_rule_action_append): Remove redundant arguments from
7450 translate_rule_action invocation.
7451 * src/reader.h (current_rule): Remove this unused extern.
7452 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
7453 * src/scan-code.l (translate_rule_action): Likewise.
7455 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
7457 Clean up yesterday's patch.
7458 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
7460 * src/reader.c (grammar_current_rule_action_append): ... here for
7461 consistency with grammar_current_rule_symbol_append.
7462 * tests/regression.at (Braced code in declaration in rules section):
7463 Make yyerror and yylex static as usual.
7465 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
7467 Fix bug that mistakes braced code in a declaration in the rules section
7468 to be a rule action. Mentioned at
7469 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
7470 * src/scan-gram.l: Move midrule action detection from the start of the
7471 scanning of any braced code to...
7472 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
7473 action. For readability, use $2 and @2 rather than the equivalent
7475 * tests/regression.at (Braced code in declaration in rules section):
7476 New test to catch the error fixed by the above patch.
7478 Work on code readability some.
7479 * src/scan-code.l (current_rule): Get rid of this misleading and
7480 redundant declaration: it's actually extern'ed in reader.h.
7481 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
7482 translate_action): Add a rule argument and use it instead of the global
7484 (translate_rule_action): This already receives current_rule through an
7485 argument, so pass it on to translate_action instead of assigning
7486 current_rule to current_rule.
7487 (translate_symbol_action, translate_code): Pass rule = NULL to
7490 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
7492 Rename %before-definitions to %start-header and %after-definitions to
7493 %end-header. Don't use these declarations to separate pre-prologue
7494 blocks from post-prologue blocks. Add new order-independent
7495 declarations %before-header and %after-header as alternatives to the
7496 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
7497 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
7498 * NEWS (2.3+): Update for these changes.
7499 * data/glr.c (b4_before_definitions): Update to...
7500 (b4_start_header): ... this.
7501 (b4_after_definitions): Update to...
7502 (b4_end_header): ... this.
7503 * data/glr.cc: Likewise.
7504 * data/lalr1.cc: Likewise.
7505 * data/yacc.c: Likewise.
7506 * doc/bison.texinfo (The prologue): Update names, and replace remaining
7507 prologue blocks with %*-header declarations.
7508 (Calc++ Parser): Likewise.
7509 (Decl Summary): Update names.
7510 (Table of Symbols): Update description.
7511 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
7512 (PERCENT_END_HEADER): ... this.
7513 (PERCENT_BEFORE_DEFINITIONS): Update to...
7514 (PERCENT_START_HEADER): ... this.
7515 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7516 (declaration): Update token names and m4 macro names.
7517 When parsing %end-header and %start-header, invoke translate_code
7518 before muscle_code_grow, and no longer set global booleans to remember
7519 whether these declarations have been seen.
7520 Parse new %after-header and %before-header.
7521 * src/reader.c (before_definitions, after_definitions): Remove.
7522 (prologue_augment): Accept a new bool argument to specify whether to
7523 augment the pre-prologue or post-prologue.
7524 * src/reader.h (before_definitions, after_definitions): Remove these
7526 (prologue_augment): Add new bool argument.
7527 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
7528 (PERCENT_END_HEADER): ... this.
7529 (PERCENT_BEFORE_DEFINITIONS): Update to...
7530 (PERCENT_START_HEADER): ... this.
7531 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7532 * tests/actions.at (Printers and Destructors): Update names.
7534 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
7536 Add comparison operators for C++ location classes. Discussed at
7537 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
7538 * data/c++.m4 (b4_define_location_comparison): New boolean %define
7539 declaration indicating whether filename_type has an operator==. If
7540 filename_type is `std::string', it defaults to `1', `0' otherwise.
7541 * data/location.cc: Iff b4_define_location_comparison is `1', add
7542 operator== and operator!= for class position and for class location.
7545 * src/scan-action.l: Remove unused file.
7546 * src/symtab.c (symbol_printer_set): Use printer_location not
7547 destructor_location.
7548 * src/symtab.h (struct symbol): Replace incorrect source comment for
7550 * tests/input.at (Incompatible Aliases): Update output with correct
7553 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
7555 Don't put the pre-prologue in the header file. For the yacc.c code
7556 file and the glr.c header and code files, move the pre-prologue before
7557 the token definitions. Add new %before-definitions and
7558 %after-definitions to declare code that will go in both the header file
7559 and code file. Discussed at
7560 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
7561 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
7563 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
7564 * NEWS (2.3+): Describe these changes.
7565 * data/glr.c (b4_pre_prologue): Move from within to before...
7566 (b4_shared_declarations): ... this.
7567 Add new b4_before_definitions before b4_token_enums.
7568 Add new b4_after_definitions at the end.
7569 * data/glr.cc (b4_pre_prologue): Replace with...
7570 (b4_before_definitions): ... this in the header file.
7571 (b4_after_definitions): New near the end of the header file.
7572 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
7573 code file right before including the header file.
7574 (b4_before_definitions): New in the previous position of
7575 b4_pre_prologue in the header file.
7576 (b4_after_definitions): New near the end of the header file.
7577 * data/yacc.c: Clean up some m4 quoting especially in the header file.
7578 (b4_token_enums_defines): In the code file, move to right before
7579 YYSTYPE for consistency with the header file.
7580 (b4_before_definitions): New right before b4_token_enums_defines in
7581 both the header and code file.
7582 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
7583 header and code file.
7584 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
7585 of prologues for %union dependencies.
7586 (Decl Summary): In %defines description, mention the effect of
7587 %before-definitions and %after-definitions on the header file.
7588 (Calc++ Parser): Forward declare driver in a %before-definitions rather
7589 than in the pre-prologue so that make check succeeds.
7590 (Table of Symbols): Add entries for %before-definitions and
7592 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
7593 %before-definitions.
7594 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
7595 (declaration): Parse those declarations and append to
7596 b4_before_definitions and b4_after_definitions, respectively.
7597 * src/reader.c (before_definitions, after_definitions): New bools to
7598 track whether those declarations have been seen.
7599 (prologue_augment): Add to the post-prologue if %union,
7600 %before-definitions, or %after-definitions has been seen.
7601 * src/reader.h (before_definitions, after_definitions): New extern's.
7602 * src/scan-gram.l: Scan the new declarations.
7603 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
7604 prologue block in a %before-definitions or a %after-definitions based
7605 on whether the %union is declared.
7606 * tests/regression.at (Early token definitions with --yacc, Early token
7607 definitions without --yacc): Move tests for token definitions into the
7608 post-prologue since token names are no longer defined in the
7611 2006-06-20 Akim Demaille <akim@epita.fr>
7613 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
7614 (symbol_get): Use it.
7615 * src/parse-gram.y: Use it.
7617 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
7619 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
7620 build succeeds when configured with --enable-gcc-warnings.
7622 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
7624 * src/parse-gram.y (char_name): New function.
7625 (CHAR, STRING, string_content): For %printer, properly escape.
7626 (ID): Prefer fputs to fprintf.
7627 (id): Reindent to be consistent with other rules.
7628 Properly quote char.
7630 The Translation Project changed its way of publishing translations
7631 to maintainers. I haven't received any responses to my request
7632 for supporting the old way, or for documenting the new way. I
7633 have modified 'bootstrap' to use screen scraping
7634 (in this case, HTML scraping). This is unreliable and inelegant,
7635 but I don't see any better way. Yuck.
7636 * bootstrap (TP_URL, WGET_COMMAND): New vars.
7637 (get_translations): New function, which uses HTML scraping to
7638 deduce locations of latest translations.
7639 Use this function to grab both bison and bison-runtime .po files.
7640 Don't bother priming the pump for the runtime-po domain any more,
7641 as it's now translated better than bison is.
7643 2006-06-19 Akim Demaille <akim@epita.fr>
7645 * src/scan-gram.l: No longer "parse" things after `%union' until
7646 `{'. Rather, return a single "%union" token.
7647 No longer make symbols: return strings, and leave the conversion
7648 to symbols to the parser.
7649 (SC_PRE_CODE, token_type): Remove.
7650 * src/parse-gram.y (%union): New field `character'.
7653 (ID, ID_COLON): Now that the scanner no longer makes them
7654 identifiers, adjust all uses to invoke symbol_get.
7655 (id_colon): New, wraps the conversion from string to symbol.
7656 (%union): Accept a possible union_name.
7657 (symbol): Now can be a char.
7658 * data/c.m4 (b4_union_name): Leave a default value.
7659 * data/glr.c, data/yacc.c: Use it.
7661 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
7663 For associating token numbers with token names for "yacc.c", don't use
7664 #define statements unless `--yacc' is specified; always use enum
7665 yytokentype. Most important discussions start at:
7666 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
7667 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
7669 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
7670 * NEWS (2.3+): Mention.
7671 * data/c.m4 (b4_yacc_if): New.
7672 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
7674 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
7675 on token name definitions.
7676 * src/getargs.c (usage): Capitalize `Yacc' in English.
7677 * src/output.c (prepare): Define b4_yacc_flag.
7678 * tests/regression.at (Early token definitions): Test that tokens names
7679 are defined before the pre-prologue not just before the post-prologue.
7680 Remove this test case and copy to...
7681 (Early token definitions with --yacc): ... this to test #define's.
7682 (Early token definitions without --yacc): ... and this to test enums.
7684 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
7686 * NEWS: Reword the post-2.3 change to not be so optimistic about
7687 removing the old "look-ahead" spelling.
7688 Update previous look-ahead/lookahead change reports.
7689 * REFERENCES: look-ahead -> lookahead (since that's
7690 what he actually wrote).
7691 * doc/refcard.tex: look ahead -> lookahead,
7692 look-ahead -> lookahead
7694 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
7696 For consistency, use `lookahead' instead of `look-ahead' or
7697 `look_ahead'. Discussed starting at
7698 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
7700 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
7701 * NEWS: For the next release, note the change to `--report'.
7702 * TODO, doc/bison.1: Update English.
7703 * doc/bison.texinfo: Update English.
7704 (Understanding Your Parser, Bison Options): Document as
7705 `--report=lookahead' rather than `--report=look-ahead'.
7706 * src/conflicts.c: Update English in comments.
7707 (lookahead_set): Rename from look_ahead_set.
7708 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
7709 (resolve_sr_conflict): Rename local look_ahead_tokens to
7710 lookahead_tokens, and update other uses.
7711 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
7712 count_rr_conflicts, conflicts_free): Update uses.
7713 * src/getargs.c (report_args): Move "lookahead" before alternate
7715 (report_types): Update uses.
7716 (usage): For `--report' usage description, state `lookahead' spelling
7717 rather than `look-ahead'.
7718 * src/getargs.h (report.report_lookahead_tokens): Rename from
7719 report_look_ahead_tokens.
7720 * src/lalr.c: Update English in comments.
7721 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
7722 (state_lookahead_tokens_count): Rename from
7723 state_look_ahead_tokens_count.
7724 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7725 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
7726 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7728 Update English in output.
7729 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
7730 * src/print.c: Update English in comments.
7731 (lookahead_set): Rename from look_ahead_set.
7732 (print_reduction): Rename argument lookahead_token from
7734 (print_core, state_default_rule, print_reductions, print_results):
7736 * src/print_graph.c: Update English in comments.
7737 (print_core): Update uses.
7738 * src/state.c: Update English in comments.
7739 (reductions_new): Update uses.
7740 (state_rule_lookahead_tokens_print): Rename from
7741 state_rule_look_ahead_tokens_print, and update other uses.
7742 * src/state.h: Update English in comments.
7743 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
7744 (state_rule_lookahead_tokens_print): Rename from
7745 state_rule_look_ahead_tokens_print.
7746 * src/tables.c: Update English in comments.
7747 (conflict_row, action_row): Update uses.
7748 * tests/glr-regression.at
7749 (Incorrect lookahead during deterministic GLR,
7750 Incorrect lookahead during nondeterministic GLR): Rename
7751 print_look_ahead to print_lookahead.
7752 * tests/torture.at: Update English in comments.
7753 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
7754 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
7755 (Many lookahead tokens): Update uses.
7756 * data/glr.c: Update English in comments.
7757 * lalr1.cc: Likewise.
7759 * src/conflicts.h: Likewise.
7760 * src/lalr.h: Likewise.
7761 * src/main.c: Likewise.
7762 * src/output.c: Likewise.
7763 * src/parse-gram.c: Likewise.
7764 * src/tables.h: Likewise.
7765 * tests/calc.at: Likewise.
7767 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
7769 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
7771 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
7773 * TODO: Add request from Nelson H. F. Beebe to be able to install
7774 Bison without installing the yacc script.
7776 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7778 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
7779 and yytext if they're already #define'd.
7780 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
7781 * src/scan-code-c.c: ... here.
7782 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
7785 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7787 Get Bison to build again when configured with --enable-gcc-warnings.
7788 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
7790 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
7791 loc argument as it shadows a global.
7792 * src/scan-gram.l: Remove stray comma that prevents boundary_set
7795 * src/.cvsignore: Add scan-code.c.
7797 2006-06-07 Akim Demaille <akim@epita.fr>
7799 * src/scan-gram.l: Move the "add a trailing ; to actions" code
7801 * src/scan-code.l: here.
7802 * tests/input.at (Torturing the Scanner): Fix another location
7805 2006-06-07 Akim Demaille <akim@epita.fr>
7807 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
7809 2006-06-06 Akim Demaille <akim@epita.fr>
7811 Extract the parsing of user actions from the grammar scanner.
7812 As a consequence, the relation between the grammar scanner and
7813 parser is much simpler. We can also split "composite tokens" back
7815 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
7816 * src/scan-gram.l (add_column_width, adjust_location): Move to and
7818 * src/location.h, src/location.c (add_column_width)
7819 (location_compute): these.
7820 Fix the column count: the initial column is 0.
7821 (location_print): Be robust to ending column being 0.
7822 * src/location.h (boundary_set): New.
7823 * src/main.c: Adjust to scanner_free being renamed as
7825 * src/output.c: Include scan-code.h.
7826 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
7828 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
7829 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
7830 which is now, again, a separate token.
7831 Adjust all dependencies.
7832 Whereever actions with $ and @ are used, use translate_code.
7833 (action): Remove this nonterminal which is now useless.
7834 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
7835 (grammar_current_rule_action_append): Use translate_code.
7836 (packgram): Bound check ruleno, itemno, and rule_length.
7837 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
7838 (last_string, last_braced_code_loc, max_left_semantic_context)
7839 (scanner_initialize, scanner_free, scanner_last_string_free)
7840 (gram_out, gram_lineno, YY_DECL_): Move to...
7841 * src/scan-gram.h: this new file.
7842 (YY_DECL): Rename as...
7844 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
7845 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
7846 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
7847 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
7848 Move these declarations, and...
7849 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
7851 * src/flex-scanner.h: this new file.
7852 * src/scan-gram.l (rule_length, rule_length_overflow)
7853 (increment_rule_length): Remove.
7854 (last_braced_code_loc): Rename as...
7855 (gram_last_braced_code_loc): this.
7856 Adjust to the changes of the parser.
7857 Move all the handling of $ and @ into...
7858 * src/scan-code.l: here.
7859 * src/scan-gram.l (handle_dollar, handle_at): Remove.
7860 (handle_action_dollar, handle_action_at): Move to...
7861 * src/scan-code.l: here.
7862 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
7863 scan-code.h, scan-code-c.c, scan-gram.h.
7864 (EXTRA_bison_SOURCES): Add scan-code.l.
7865 (BUILT_SOURCES): Add scan-code.c.
7866 (yacc): Be robust to white spaces.
7868 * tests/conflicts.at, tests/input.at, tests/reduce.at,
7869 * tests/regression.at: Adjust the column numbers.
7870 * tests/regression.at: Adjust the error message.
7872 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
7874 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
7875 Use Akim's wording from
7876 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
7878 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
7880 Between Bison releases, manually append `+' to the previous Bison
7881 release number, and use that as a signal to automatically print the
7882 ChangeLog's CVS Id keyword from --version. Discussed starting at
7883 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
7884 * ChangeLog: Add Id header.
7885 * configure.ac (AC_INIT): Append `+' to `2.3'.
7886 * src/.cvsignore: Add revision.c.
7887 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
7888 (BUILT_SOURCES): Add revision.c.
7889 (revision.c): New target rule. This file defines a new global variable
7890 named revision. It initializes it with either the Id from ChangeLog
7891 or, if VERSION doesn't contain `+', with the empty string.
7892 * src/getargs.c (version): Print the value of revision.
7893 * src/revision.h: Extern revision.
7895 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
7897 * NEWS: Version 2.3.
7898 * configure.ac (AC_INIT): Likewise.
7900 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
7902 * data/glr.c (YYRECOVERING): Define to be a function-like macro
7903 with no arguments, not as an object-like macro. This is for
7904 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
7905 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
7906 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
7909 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
7911 * src/getargs.c (usage): Back out yesterday's modification of the
7912 --help output so that we don't have to wait for translation before
7915 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
7917 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
7918 Problem reported by Akim Demaille.
7920 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
7922 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
7924 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
7926 * data/yacc.c (yy_reduce_print): Omit trailing white space in
7927 generated source code. Problem reported by Frans Englich in
7928 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
7930 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
7932 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
7933 shell, not within 'make', so that 'make' by an ordinary builder
7934 (using GNU make) does not worry about configuring gzip. This also
7935 works around a bug reported independently by Keith Thompson and by
7936 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
7937 stderr rather than stdout, messing up the build logs.
7939 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
7941 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
7942 to make sure that YYID will never be unused. This fixes a 'make
7943 maintainer-check' failure caused by the recent changes to the 'Trivial
7944 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
7946 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
7948 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
7950 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
7951 state before an empty RHS is always resolved here. Only the location
7952 of that state is guaranteed to be resolved, and that's enough. This
7953 fixes the remaining bug reported by Derek M. Jones in
7954 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
7955 * tests/glr-regression.at (Uninitialized location when reporting
7956 ambiguity): Test the above case.
7957 Also, the embedded comments in this test case claim it checks the case
7958 of an empty RHS that has inherited the initial location. However, the
7959 corresponding LHS was already resolved, so yyresolveLocations didn't
7960 actually have reason to modify it. Fix this by forcing
7961 nondeterministic operation at the beginning of the parse.
7963 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
7965 * data/c.m4 (b4_yy_symbol_print_generate):
7966 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
7967 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
7968 of the bugs reported today by Derek M Jones in
7969 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
7970 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
7971 defined to be a type name without parens or brackets.
7972 (Location Type): Similarly for YYLTYPE.
7973 * tests/regression.at (Trivial grammars): Put in a test for this
7974 bug that will be caught by 'make maintainer-check' (though not,
7975 alas, by 'make check' unless your compiler is picky).
7977 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
7979 * NEWS: Version 2.2.
7980 * configure.ac (AC_INIT): Likewise.
7982 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
7984 * data/glr.c (yyreportTree): Make room in yystates for the state
7985 preceding the RHS. This fixes the segmentation fault reported by Derek
7987 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
7988 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
7989 to the user. Reported for yyreportTree by Derek M. Jones later in the
7991 * THANKS: Add Derek M. Jones.
7992 Update my email address.
7993 Fix typo in Steve Murphy's name.
7995 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
7997 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
7998 checking against YYLAST that caused the parser to miss a potential
7999 alternative in its diagnostic.
8000 Problem reported by Maria Jose Moron Fernandez in
8001 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
8002 * data/lalr1.cc (yysyntax_error_): Likewise.
8003 * data/yacc.c (yysyntax_error): Likewise.
8004 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
8005 tokens, in case we run into an older C compiler.
8006 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
8007 Use them to check for the off-by-one error fixed above.
8009 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
8010 YYSIZE_T, not size_t.
8011 * tests/regression.at (Trivial grammars): New test, to catch
8012 the error fixed by the above patch.
8014 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
8016 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
8018 Reported by Steve Murphy.
8020 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
8022 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
8023 * data/glr.cc: b4_location_flag is now b4_locations_flag.
8025 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
8027 Implement --trace=m4.
8028 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
8029 * src/output.c (output_skeleton): When set, pass -dV to m4.
8031 Factor the handling of flags in m4.
8032 * src/output.c (prepare): Rename the muscle names debug, defines,
8033 error_verbose to debug_flag, defines_flag, error_verbose_flag.
8034 * data/c.m4: Adjust.
8035 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
8036 Use b4_define_flag_if to define other b4_FLAG_if macros.
8037 (b4_location_if): As a consequence, rename as...
8038 (b4_locations_if): this, for consistency.
8039 Adjust all the skeletons.
8041 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
8043 * etc/bench.pm: Shorten bench names.
8045 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
8047 * src/output.h, src/output.c (error_verbose): Move to...
8048 * src/getargs.h, src/getargs.c: here.
8050 Adjust dependencies.
8052 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
8054 * data/c.m4 (b4_copyright): Put the special exception for Bison
8055 skeletons here, so we don't have to put it in each skeleton. All
8056 uses changed. Suggested by Akim Demaille. Also, wrap the
8057 copyright notice, in case it is longer than 80 columns. Replace
8058 comma by newline after title.
8060 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
8062 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
8063 incompatibility, not a bug. Mention that it wasn't fixed as of
8066 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
8068 * examples/extexi: Enforce the precedence of concatenation over
8070 Reported by Tommy Nordgren.
8072 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
8074 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
8075 with the member "token".
8076 Reported by Martin Nylin.
8078 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
8080 * data/glr.c: Switch to Bison 2.2 special-exception language in
8081 the copyright notice. Use more-regular format for titles and
8083 * data/glr.cc: Likewise.
8084 * data/location.cc: Likewise.
8085 * data/yacc.cc: Likewise.
8086 * doc/bison.texinfo (Conditions): Document this.
8087 * NEWS: likewise. Upgrade version to 2.2.
8089 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
8091 * data/glr.cc: Remove dead code.
8093 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
8095 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
8096 that variable and the line breaks the bootstrap. Problem reported
8097 by Juan M. Guerrero.
8099 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
8101 * doc/bison.texinfo (Multiple start-symbols): New.
8103 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
8105 * etc/README, etc/bench.pl: New.
8107 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
8109 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
8111 Reported by Mickael Labau.
8112 * tests/input.at (Torturing the Scanner): Test it.
8114 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
8116 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
8117 Problem reported by Bob Rossi.
8119 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
8121 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
8122 and didn't really work.
8123 For the index, use @ifnotinfo, not @iftex.
8124 Minor cleanups of spacing and terminology.
8126 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
8128 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
8129 of AT_NAME_PREFIX when %name-prefix is not used.
8131 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
8133 Apply --prefix to C++ skeletons too: they change the namespace.
8134 The test suite already exercize these cases.
8135 * data/c++.m4 (b4_namespace): New.
8136 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
8137 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
8138 * data/yacc.c, data/glr.c: Remove a useless `[]'.
8139 * doc/bison.texinfo: Document it.
8140 (Option Cross Key): Use @multitable in all formats. It looks
8141 nicer, even in TeX outputs.
8142 (Rules): Use the same code whatever the output type is.
8143 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
8144 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
8145 * tests/calc.at: Use it, instead of hard coding `yy'.
8147 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
8149 * TODO: Remove dead items.
8151 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
8153 * doc/FAQ: Remove, merged into...
8154 * doc/bison.texinfo (FAQ): this.
8155 * doc/Makefile.am (EXTRA_DIST): Adjust.
8157 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
8159 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
8161 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
8162 * doc/bison.texinfo (Calc++ Scanner): Use it.
8164 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
8166 Fix two nits reported by twlevo, plus one more that I discovered.
8168 * src/assoc.h (assoc_to_string): Give a name to the arg, as
8169 this is the usual Bison style.
8170 * src/location.h (location_print): Likewise.
8172 * src/reader.h (token_name): Likewise.
8174 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
8176 Fix some nits reported by twlevo.
8177 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
8178 and "POSIX". Use more-modern syntax for URLs. Mention C++
8179 and ask for Java. Don't hardwire OS version numbers. Add
8181 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
8182 * src/conflicts.c (solved_conflicts_obstack): Now static.
8184 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
8186 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
8187 page. Say "you can use it" not "you may use it" as on the web page;
8188 we're describing capabilities not granting permission.
8190 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
8192 * data/glr.c (yyresolveLocations): Rename local variables to avoid
8193 shadowing warnings. Use usual patter for iterating through RHS.
8194 * tests/glr-regression.at
8195 (Uninitialized location when reporting ambiguity):
8196 Modify yylex so that it uses its argument, rather than trying
8197 to rely on ARGSUSED (which doesn't work for gcc with warnings).
8198 const char -> char const.
8200 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
8201 Don't use tabs inside commands; it messes up 'ps'.
8202 Problem reported by twlevo.
8204 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
8206 * tests/glr-regression.at (Uninitialized location when reporting
8207 ambiguity): New test case.
8208 * data/glr.c (yyresolveLocations): New function, which uses
8210 (yyresolveValue): Invoke yyresolveLocations before reporting an
8212 * doc/bison.texinfo (Default Action for Locations): Note
8213 YYLLOC_DEFAULT's usage for ambiguity locations.
8214 (GLR Semantic Actions): Cross-reference those notes.
8216 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
8218 * tests/glr-regression.at (Leaked semantic values when reporting
8219 ambiguity): Remove unnecessary union and type declarations.
8220 (Leaked lookahead after nondeterministic parse syntax error): New test
8222 * data/glr.c (yyparse): Check for zero stacks remaining before
8223 attempting to shift the lookahead so that you don't lose it.
8225 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8227 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
8228 * tests/glr-regression.at (Leaked semantic values when reporting
8229 ambiguity): New test case.
8230 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
8231 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
8232 now unnecessary yystackp parameter.
8233 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
8234 destructors can be called.
8236 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
8237 in existing testcases.
8239 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8241 Don't leak semantic values for parent RHS when a user action cuts the
8242 parser, and clean up related code a bit.
8243 * tests/glr-regression.at (Leaked merged semantic value if user action
8244 cuts parse): Rename to...
8245 (Leaked semantic values if user action cuts parse): ... this. Add check
8246 for leaked parent RHS values.
8247 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
8248 between an unresolved state (non-empty chain of semantic options) and
8249 an incomplete one (signaled by an empty chain).
8250 (yyresolveStates): Document the interface. Move all manipulation of a
8251 successfully or unsuccessfully resolved yyGLRState to...
8252 (yyresolveValue): ... here so that yyresolveValue always leaves a
8253 yyGLRState with consistent data and thus is easier to understand.
8254 Remove the yyvalp and yylocp parameters since they are always just
8255 taken from the yys parameter. When reporting a discarded merged value
8256 in debugging output, note that it is incompletely merged. Document the
8258 (yyresolveAction): If resolving any of the RHS states fails, destroy
8259 them all rather than leaking them. Thus, as long as user actions are
8260 written to clean up the RHS correctly, yyresolveAction always cleans up
8261 the RHS of a semantic option. Document the interface.
8263 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
8265 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
8266 led to a segmentation fault in GNU Pascal. Problem reported
8269 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
8271 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
8272 mid-rule action inside a nonterminal symbol in order to declare a
8273 destructor for its semantic value.
8275 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
8277 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
8278 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
8279 __cplusplus && ! defined _STDLIB_H && !
8280 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
8281 defined free))]: Include <stdlib.h> rather than rolling our own
8282 declarations of malloc and free, to avoid problems with
8283 incompatible declarations (using 'throw') C++'s stdlib.h. This
8284 should fix Debian bug 340012
8285 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
8286 reported by Guillaume Melquiond.
8288 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8290 * NEWS: Clarify symbols versus types in unused-value warnings.
8292 * configure.ac (AC_INIT): Bump version number.
8294 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8296 * NEWS: Version 2.1a.
8297 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
8298 since C99 requires this.
8300 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
8302 * m4/c-working.m4: New file.
8303 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
8305 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
8307 * Makefile.maint: Merge from coreutils.
8309 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
8311 More portability fixes for problems summarized by Nelson H. F. Beebe.
8313 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
8314 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
8315 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
8316 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
8317 messes up because C++ code is compiled in 32-bit mode but linked
8320 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
8322 More portability fixes for problems summarized by Nelson H. F. Beebe.
8324 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
8325 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
8327 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
8328 nodist_PROGRAMS, since we don't need to actually compile the
8329 example if we're just doing a plain 'make'. This avoids bothering
8330 the installer unnecessarily about problems due to weird C++
8333 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
8335 More portability fixes for problems summarized by Nelson H. F. Beebe.
8337 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
8338 than #include "...", and compile with -I'.'. The old method was
8339 not portable, according to Posix and the C standard, and it does
8340 not work with Sun C 5.7, where previous #line directives affect
8341 the working directory used in later #include "..." directives.
8343 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8345 Various DJGGP specific issues in /djgpp
8347 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
8349 More portability fixes for problems summarized by Nelson H. F. Beebe.
8351 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
8352 '#include <map>' works and that you can apply ++ to iterators.
8354 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
8356 Work around portability problems summarized by Nelson H. F. Beebe in
8357 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
8359 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8360 that '#include <string>' works.
8362 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
8363 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
8364 "warning: sorry: semantics of inline function static data `const
8365 unsigned char translate_table[262]' are wrong (you'll wind up with
8368 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
8369 or, xor to not_, and_, or_, and xor_, respectively. This works
8370 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
8371 random system header somewhere that includes the equivalent of
8374 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
8375 -E" works; it apparently doesn't work with PathScale EKO Compiler
8378 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
8380 During deterministic GLR operation, user actions should be able to
8381 influence the parse by changing yychar. To make this easier to fix and
8382 to make glr.c easier to evolve in general, don't maintain yytoken in
8383 parallel with yychar; just compute yytoken when needed.
8384 * tests/glr-regression.at (Incorrect lookahead during deterministic
8385 GLR): Check that setting yychar in a user action has the intended
8387 * data/glr.c (yyGLRStack): Remove yytokenp member.
8388 (yyclearin): Don't set *yytokenp.
8389 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
8390 yychar rather than *yytokenp to determine the current lookahead.
8391 Compute yytoken locally when needed.
8392 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
8395 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
8396 after `--report' documentation.
8398 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
8400 * src/parse-gram.y (grammar_declaration): Location of printer
8401 symbol is @1, not list->location. Bug reported by twlevo.
8402 * tests/input.at (Incompatible Aliases): Adjust to above change.
8404 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
8406 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
8407 all the test at once. This makes the output easier to read in the
8410 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
8411 got from <http://bro-ids.org/download.html>. The bug is that
8412 when two actions appeared in succession, the second one was
8413 scanned before the first one was added to the grammar rule
8414 as a midrule action. Bison then output the incorrect warning
8415 "parse.y:905.17-906.36: warning: unused value: $3".
8416 * src/parse-gram.y (BRACED_CODE, action): These are no longer
8417 associated with a value.
8418 (rhs): Don't invoke grammar_current_rule_action_append.
8419 (action): Invoke it here instead.
8420 * src/reader.c (grammar_midrule_action): Now extern.
8421 (grammar_current_rule_action_append): Don't invoke
8422 grammar_midrule_action; that is now the scanner's job.
8423 * src/reader.h (last_string, last_braced_code_loc):
8424 (grammar_midrule_action): New decls.
8425 * src/scan-gram.l (last_string): Now extern, sigh.
8426 (last_braced_code_loc): New extern variable.
8427 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
8428 rule already has an action.
8429 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
8430 * tests/input.at (AT_CHECK_UNUSED_VALUES):
8431 Add some tests to check that the above changes fixed the bug.
8433 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
8435 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
8436 All used changed. Check whether the symbol has a destructor,
8437 not whether it is typed.
8438 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
8439 that the values are still reported as unused. All line numbers
8442 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
8444 Work around a bug in bro 0.8, which underparenthesizes its
8445 definition of YYLLOC_DEFAULT.
8446 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
8448 * data/lalr1.cc: Likewise.
8449 * data/yacc.cc: Likewise.
8451 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
8453 Work around a bug in Pike 7.0, and give the Pike folks a
8454 better way to override the usual int widths.
8455 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
8456 user can override the types.
8457 (short): #undef, to work around a bug in Pike 7.0.
8458 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
8459 (union yyalloc.yyss): Use yytype_int16 rather than short.
8461 (yysigned_char): Remove.
8462 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
8463 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
8464 * tests/regression.at (Web2c Actions): Adjust to above changes.
8466 * src/reader.c (check_and_convert_grammar): New function.
8467 (reader): Close the input file even if something went wrong during
8468 parsing. Minor file descriptor leak reported by twlevo.
8470 * src/assoc.c (assoc_to_string): Use a default: abort (); case
8471 to pacify gcc -Wswitch-default.
8472 * src/scan-gram.l (adjust_location): Use a default: break; case
8473 to pacify gcc -Wswitch-default.
8474 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
8475 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8476 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8477 Move these decls to scan-skel.l, since they don't need to be
8479 * src/scan-skel.l: Accept the above decls.
8480 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
8483 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
8485 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
8486 since we don't want to insist on a version number at the start
8487 of the changelog every time.
8488 * Makefile.maint: Sync from coreutils a bit better.
8489 (sc_trailing_blank): Renamed from sc_trailing_space.
8491 (sc_no_if_have_config_h, sc_require_config_h):
8492 (sc_prohibit_assert_without_use): New rules.
8493 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
8494 (sc_dd_max_sym_length): Fix leading spaces in rule.
8495 (sc_system_h_headers): Prefix with @.
8496 (sc_useless_cpp_parens, m4-check): Output line numbers.
8497 (changelog-check): Allow version only in head.
8498 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
8499 satisfy new Makefile.maint rule.
8500 * data/glr.c: Likewise.
8501 * data/glr.cc: Likewise.
8502 * data/lalr1.cc: Likewise.
8503 * data/yacc.c: Likewise.
8504 * lib/ebitsetv.c: Likewise.
8505 * lib/lbitset.c: Likewise.
8506 * lib/subpipe.c: Likewise.
8507 * lib/timevar.c: Likewise.
8508 * src/system.h: Likewise.
8509 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
8510 * djgpp/Makefile.maint: Add copyright notice.
8511 * djgpp/README.in: Likewise.
8512 * djgpp/config.bat: Likewise.
8513 * djgpp/config.site: Likewise.
8514 * djgpp/config_h.sed: Likewise.
8515 * djgpp/djunpack.bat: Likewise.
8516 * djgpp/config.sed: Fix copyright notice to match standard format.
8517 * djgpp/subpipe.h: Likewise.
8518 * lib/bitsetv-print.c: Likewise.
8519 * lib/bitsetv.c: Likewise.
8520 * lib/subpipe.h: Likewise.
8521 * lib/timevar.c: Likewise.
8522 * lib/timevar.h: Likewise.
8523 * djgpp/subpipe.c: Use standard recipe for config.h.
8524 * lib/abitset.c: Likewise.
8525 * lib/bitset.c: Likewise.
8526 * lib/bitset_stats.c: Likewise.
8527 * lib/bitsetv-print.c: Likewise.
8528 * lib/bitsetv.c: Likewise.
8529 * lib/ebitsetv.c: Likewise.
8530 * lib/get-errno.c: Likewise.
8531 * lib/lbitset.c: Likewise.
8532 * lib/subpipe.c: Likewise.
8533 * lib/timevar.c: Likewise.
8534 * lib/vbitset.c: Likewise.
8535 * tests/local.at: Likewise.
8536 * src/scan-gram.l: Don't include verify.h, since system.h does
8538 * .x-sc_require_config_h: New file.
8539 * .x-sc_unmarked_diagnostics: New file.
8541 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
8543 Be a bit more systematic about using 'abort'.
8544 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
8545 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
8546 Put 'default: abort ();' before some other case, to satisfy older
8548 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8549 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
8550 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
8551 * src/conflicts.c (resolve_sr_conflict): Likewise.
8552 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
8553 (get_decision_str, get_orientation_str, get_node_alignment_str):
8554 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
8555 (get_linestyle_str, get_arrowstyle_str): Likewise.
8556 * src/conflicts.c (resolve_sr_conflict):
8557 Use a default case rather than one for the one remaining enum
8558 value, to catch invalid enum values as well.
8559 * src/lalr.c (set_goto_map, map_goto):
8560 Prefer "assert (FOO);" to "if (!FOO) abort ();".
8561 * src/nullable.c (nullable_compute, token_definitions_output):
8563 * src/reader.c (packgram, reader): Likewise.
8564 * src/state.c (transitions_to, state_new, state_reduction_find):
8566 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
8567 (symbol_pack): Likewise.
8568 * src/tables.c (conflict_row, pack_vector): Likewise.
8569 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
8570 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
8571 * src/system.h: Don't include <assert.h>.
8572 (assert): New macro.
8574 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
8575 (Destructor Decl, Parser Function, Pure Calling):
8576 Describe rules for braces inside C code more carefully.
8578 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
8580 Fix some porting glitches found by Nelson H. F. Beebe.
8581 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
8582 compilers that don't understand that abort () does not return.
8583 * src/state.c (transitions_to): Likewise.
8584 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8585 that '#include <cstdlib>' works.
8586 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
8587 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
8588 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
8589 for the benefit of some pre-C99 compilers.
8591 * bootstrap: Undo changes to gnulib files that autoreconf made.
8593 Minor fixups to get 'make maintainer-check' to work.
8594 * configure.ac: Don't use -Wnested-externs, as it's incompatible
8595 with the new verify.h implementation.
8596 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
8597 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
8598 * data/yacc.c (YYUSE): Likewise.
8599 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
8600 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
8601 * src/parse-gram.y (declaration): Don't pass a string constant
8602 to a function that expects char *, since GCC might complain
8603 about the constant value.
8604 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
8605 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
8606 before #defining them.
8607 * tests/glr-regression.at
8608 (Incorrectly initialized location for empty right-hand side in GLR):
8609 In yyerror, use the msg arg.
8610 (Corrupted semantic options if user action cuts parse):
8611 (Incorrect lookahead during deterministic GLR):
8612 (Incorrect lookahead during nondeterministic GLR):
8613 Don't name a local var 'index'; it shadows string.h's 'index'.
8615 2006-01-19 Akim Demaille <akim@epita.fr>
8617 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
8618 location, not just parts of it.
8620 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
8622 * NEWS: Document the fact that multiple %unions are now allowed.
8623 * doc/bison.texinfo (Union Decl): Likewise.
8624 * TODO: This feature is now implemented, so remove it from
8627 * Makefile.maint: Merge with coreutils Makefile.maint.
8628 (CVS_LIST): Use build-aux version if available.
8629 (VERSION_REGEXP): New macro.
8630 (syntax-check-rules): Add sc_no_if_have_config_h,
8631 sc_prohibit_assert_without_use, sc_require_config_h,
8632 sc_useless_cpp_parens.
8633 (sc_obsolete_symbols): Check for O_NDELAY.
8634 (sc_dd_max_sym_length): Track coreutils.
8635 (sc_unmarked_diagnostics): Look in all files, not just *.c.
8636 (sc_useless_cpp_parens): New rule.
8637 (news-date-check): Look for version or today's date.
8638 (changelog-check): Don't require version number near head.
8639 (copyright-check): Use current year instead of hardwiring 2005.
8640 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
8641 (announcement): Add --gpg-key-ID.
8643 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
8646 Avoid undefined behavior that addressed just before the start of an
8647 array. Problem reported by twlevo.
8648 * src/reader.c (packgram): Prepend a new sentinel before ritem.
8649 * src/lalr.c (build_relations): Rely on new sentinel.
8650 * src/gram.c (gram_free): Adjust to new sentinel.
8652 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
8654 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
8655 yylookaheadNeeds. All uses updated.
8656 (yysplitStack): Rename local yynewLookaheadStatuses to
8657 yynewLookaheadNeeds.
8658 * data/glr-regression.at (Incorrect lookahead during nondeterministic
8659 GLR): In comments, change `lookahead status' to `lookahead need'.
8661 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8663 * data/glr.c (yysplitStack): A little stylistic rewrite.
8665 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8667 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
8669 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
8671 * doc/bison.texinfo: Fix some typos.
8672 (GLR Semantic Actions): New subsection discussing special
8673 considerations because GLR semantic actions might be deferred.
8674 (Actions): Mention look-ahead usage of yylval.
8675 (Actions and Locations): Mention look-ahead usage of yylloc.
8676 (Special Features for Use in Actions): Add YYEOF entry and mention it
8677 in the yychar entry.
8678 In the yychar entry, remove mention of the local yychar case (pure
8679 parser) since this is irrelevant information when writing semantic
8680 actions and since it's already discussed in `Table of Symbols' where
8681 yychar is otherwise described as an external variable.
8682 In the yychar entry, don't call it the `current' look-ahead since it
8683 isn't when semantic actions are deferred.
8684 In the yychar and yyclearin entries, add note about deferred semantic
8686 Add yylloc and yylval entries discussing look-ahead usage.
8687 (Look-Ahead Tokens): When discussing yychar, don't call it the
8688 `current' look-ahead, and do mention yylval and yylloc.
8689 (Error Recovery): Cross-reference `Action Features' when mentioning
8691 (Table of Symbols): In the yychar entry, don't call it the `current'
8693 In the yylloc and yylval entries, mention look-ahead usage.
8695 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
8697 * tests/glr-regression.at: Update copyright year to 2006.
8699 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8701 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
8702 use during nondeterministic operation to track which stacks have
8703 actually needed the current lookahead.
8704 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
8705 Allocate, deallocate, resize, and otherwise shuffle space for
8706 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
8707 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
8708 appropriately during nondeterministic operation.
8709 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
8710 members to store the current lookahead to be used by the deferred
8712 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
8713 from which the RHS is taken. Set the lookahead members of the new
8714 yySemanticOption according to the lookahead status for stack yyk.
8715 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
8716 yyaddDeferredAction.
8717 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
8718 members of yySemanticOption before invoking yyuserAction, and then set
8719 them back to their current values afterward.
8720 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
8721 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
8722 * tests/glr-regression.at: Remove `.' from the ends of recent test case
8723 titles for consistency.
8724 (Leaked merged semantic value if user action cuts parse): In order to
8725 suppress lint warnings, use arguments in merge function, and assign
8726 char value < 128 in main.
8727 (Incorrect lookahead during deterministic GLR): New test case.
8728 (Incorrect lookahead during nondeterministic GLR): New test case.
8730 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8732 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
8733 !yyvaluep as signal that no semantic value is available to print.
8734 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
8735 to print a semantic value.
8737 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8739 * tests/glr-regression.at: For consistency with my newer test cases,
8742 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
8744 * data/glr.c (yyresolveValue): When merging semantic options, if at
8745 least one user action succeeds but a later one cuts the parse, then
8746 destroy the semantic value before returning rather than leaking it.
8747 (yyresolveStates): If a user action cuts the parse and thus
8748 yyresolveValue fails, ignore the (unset) semantic value rather than
8749 corrupting the yyGLRState, and empty the semantic options list since
8750 the user actions should have called all necessary destructors.
8751 Simplify code with YYCHK.
8752 * tests/glr-regression.at (Corrupted semantic options if user action
8753 cuts parse): New test case.
8754 (Undesirable destructors if user action cuts parse): New test case.
8755 Before applying any of this patch, this test case never actually failed
8756 for me... but only because the corrupted semantic options usually
8758 (Leaked merged semantic value if user action cuts parse): New test
8761 2006-01-05 Akim Demaille <akim@epita.fr>
8763 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
8765 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
8767 * data/c.m4 (b4_c_modern): New macro, with a new provision for
8768 _MSC_VER. Problem reported by Cenzato Marco.
8769 (b4_c_function_def): Use it.
8770 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
8772 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
8773 than rolling our own.
8775 2006-01-04 Akim Demaille <akim@epita.fr>
8777 Also warn about non-used mid-rule values.
8778 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
8780 (symbol_list_new): Adjust.
8781 * src/reader.c (symbol_typed_p): New.
8782 (grammar_rule_check): Use it.
8783 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
8785 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
8787 * tests/actions.at (Exotic Dollars): Adjust.
8789 2006-01-04 Akim Demaille <akim@epita.fr>
8791 * src/reader.c (grammar_midrule_action): If $$ is set in a
8792 mid-rule, move the `used' bit to its lhs.
8793 * tests/input.at (Unused values): New.
8794 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
8796 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
8798 * doc/bison.texinfo (Bison Options): Say more accurately what
8800 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
8801 about declarations in the grammar when in Yacc mode, as POSIX does
8802 not require a diagnostic when the grammar uses extensions.
8804 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
8806 Warn about dubious constructions like "%token T T".
8808 * src/symtab.h (struct symbol.declared): New member.
8809 * src/symtab.c (symbol_new): Initialize it to false.
8810 (symbol_class_set): New arg DECLARING, specifying whether
8811 this is a declaration that we want to warn about, if there
8812 is more than one of them. All uses changed.
8814 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
8815 Allow multiple %union directives, whose contents concatenate.
8816 * src/parse-gram.y (grammar_declaration): Likewise.
8817 Use muscle_code_grow, so that we don't need stype_line any more.
8820 * src/muscle_tab.c (muscle_grow): Fix comment.
8822 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
8823 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
8824 Update copyright year to 2006.
8826 2006-01-03 Akim Demaille <akim@epita.fr>
8828 Have glr.cc pass (some of) the calc.at tests.
8829 * data/glr.cc (b4_parse_param_orig): New.
8830 (b4_parse_param): Improve its definition, and bound it more
8831 clearly in the skeleton.
8832 (b4_epilogue): Append, instead of prepending, in order to keep
8834 Simplify the generation of auxiliary functions: locations and
8835 purity are mandated.
8836 (b4_global_tokens_and_yystype): Honor it.
8837 * data/location.cc (c++.m4): Don't include it.
8838 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
8840 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
8842 Be sure to initialize the first position's filename.
8843 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
8845 (AT_CHECK_CALC_GLR_CC): New.
8846 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
8848 2006-01-02 Akim Demaille <akim@epita.fr>
8850 * src/output.c (output_skeleton): Don't hard wire the inclusion of
8852 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
8853 * data/glr.cc: Do not include stack.hh.
8855 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
8857 * data/glr.c: Reformat whitespace with tabs.
8858 (b4_lpure_formals): Remove this unused m4 macro.
8859 * tests/cxx-type.at: Reformat whitespace with tabs.
8860 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
8861 since it's a member. Rename type to isNterm for clarity.
8863 2005-12-29 Akim <akim@sulaco.local>
8865 Let glr.cc catch up with symbol_value_print.
8866 * data/glr.cc (b4_yysymprint_generate): Replace by...
8867 (b4_yy_symbol_print_generate): this.
8868 (yy_symbol_print, yy_symbol_value_print): Declare them.
8870 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
8872 * src/location.h (boundary): Note that a line or column equal
8873 to INT_MAX indicates an overflow.
8874 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
8875 (rule_length_overflow, increment_rule_length, add_column_width):
8877 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
8878 (<SC_BRACED_CODE>"}"):
8879 Use increment_rule_length rather than incrementing it by hand.
8880 (adjust_location, handle_syncline): Diagnose overflow.
8881 (handle_action_dollar, handle_action_at):
8882 Fix bug with monstrosities like $-2147483648.
8883 Remove now-unnecessary checks.
8884 (scan_integer): Verify assumptions and remove now-unnecessary checks.
8885 (convert_ucn_to_byte): Verify assumptions.
8886 (handle_syncline): New arg LOC. All callers changed.
8887 Don't store through a value derived from char const * pointer.
8889 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
8892 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
8894 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
8895 Remove unnecessary forward static decls.
8897 2005-12-27 Akim Demaille <akim@epita.fr>
8899 * src/reader.c (grammar_current_rule_check): Also check that $$
8901 Take the rule to check as argument, hence rename as...
8902 (grammar_rule_check): this.
8903 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
8905 (grammar_rule_begin, grammar_rule_end): these, for consistency.
8906 (grammar_midrule_action, grammar_symbol_append): Now static.
8907 * tests/torture.at (input): Don't rely on the default action
8908 being always performed.
8909 * tests/calc.at: "Set" $$ even when the action is "cut" with
8911 * tests/actions.at (Exotic Dollars): Instead of using unused
8912 values, check that the warning is issued.
8914 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
8916 * NEWS: Improve wording for unused-value warnings.
8918 2005-12-22 Akim Demaille <akim@epita.fr>
8920 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
8921 (b4_yysymprint_generate): Rename as...
8922 (b4_yy_symbol_print_generate): this.
8923 Generate yy_symbol_print instead of yysymprint.
8924 Generate also yy_symbol_value_print, and use it.
8926 2005-12-22 Akim Demaille <akim@epita.fr>
8928 * NEWS: Warn about unused values.
8929 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
8931 (symbol_list_n_get, symbol_list_n_used_set): New.
8932 (symbol_list_n_type_name_get): Use symbol_list_n_get.
8933 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
8934 * src/reader.c (grammar_current_rule_check): Check that values are
8936 * src/symtab.c (symbol_print): Accept 0.
8937 * tests/existing.at: Remove the type information.
8939 Remove useless actions (beware of mid-rule actions: perl -000
8940 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
8941 * tests/actions.at (Exotic Dollars): Use unused values.
8942 * tests/calc.at: Likewise.
8943 * tests/glr-regression.at (No users destructors if stack 0 deleted):
8946 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
8949 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
8951 Undo 2005-12-01 tentative license wording change. The wording is
8952 still being reviewed by the lawyers, and we don't want to wait for
8953 them before publishing a test release. For now, revert to the
8955 * NEWS: Undo 2005-12-01 change.
8956 * data/glr.c: Revert to previous license wording.
8957 * data/glr.cc: Likewise.
8958 * data/lalr1.cc: Likewise.
8959 * data/location.cc: Likewise.
8960 * data/yacc.c: Likewise.
8962 * NEWS: Reword %destructor vs YYABORT etc.
8963 * data/glr.c: Use American spacing, for consistency.
8964 * data/glr.cc: Likewise.
8965 * data/lalr1.cc: Likewise.
8966 * data/yacc.c: Likewise.
8967 * data/yacc.c: Reformat comments slightly.
8968 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
8969 for consistency. Fix some spelling errors and reword recently-included
8971 * tests/cxx-type.at: Cast results of malloc, for C++.
8973 2005-12-21 Joel E. Denny <address@hidden>
8975 * tests/cxx-type.at: Construct a tree, count the parents of shared
8976 nodes, and free each node once and only once. Previously, the memory
8977 for semantic values was leaked instead.
8979 2005-12-21 Joel E. Denny <address@hidden>
8981 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
8982 (yylval, yylloc): If pure, #define to yystackp->yyval and
8983 yystackp->yyloc similar to yychar and yynerrs.
8984 (yyparse): If pure, remove local yylval and yylloc. Add local
8985 yystackp to accommodate pure definitions of yylval and yylloc.
8986 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
8987 yylvalp and yyllocp to &yylval and &yylloc.
8988 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
8989 namespace. Previously, nerrs and char were missing, but lval and lloc
8991 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
8992 yylvalp and yyllocp parameters since, if pure, these are now always
8993 accessible through yystackp. If not pure, they are still accessible
8995 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
8996 `if (YYID (N))' to pacify lint.
8998 2005-12-21 Akim Demaille <akim@epita.fr>
9000 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
9001 destroy the RHS symbols of a rule.
9002 * data/yacc.c (yylen): Initialize to 0.
9003 Keep its value to the number of items to possibly shift.
9004 In particular, a regular successful parse that ends on YYFINAL by
9005 a (internal) YYACCEPT must not have yylen != 0.
9006 (yyerrorlab, yyreturn): Pop the RHS.
9007 Reorder a bit to emphasize the `shifting' bits of code.
9008 (YYPOPSTACK): Now accept a number of items to pop.
9009 * data/lalr1.cc: Likewise.
9010 * data/glr.c: Formatting changes.
9011 Use goto instead of fall through.
9012 * doc/bison.texinfo (Destructor Decl): Complete.
9014 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9016 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
9017 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
9018 * djgpp/config.bat: Replace every occurence of the file name
9019 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
9020 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
9021 * djgpp/config.sed: Replace every occurence of the file name
9022 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
9023 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
9024 * djgpp/djunpack.bat: DJGPP specific file.
9025 * djgpp/fnchange.lst: DJGPP specific file.
9026 * djgpp/README.in: Add new information about how to unpack the bison
9027 source on MSDOS and other systems which have 8.3 file name restrictions
9028 using djunpack.bat and fnchange.lst.
9030 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
9032 * bootstrap (build_cvs_prefix): Remove; unused.
9033 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
9034 when getting gnulib.
9036 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
9038 * data/glr.c: Reorder typedef declarations for structs to match order
9039 of struct declarations.
9040 Rename yystack everywhere to yystackp except in yyparse where it's not
9042 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
9044 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
9045 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
9046 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
9049 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
9051 * tests/sets.at (Accept): Fix typos in regular expression used to
9052 sed out the final state number.
9054 Work around portability problem on Solaris 10: flex-generated
9055 files include <stdio.h> before <config.h>, which messes up
9056 because the latter defines __EXTENSIONS__. Address the problem
9057 by creating two new little files that include <config.h> first,
9058 then include the flex-generated files. Rewrite everyone else
9059 to include <config.h> first, as well.
9060 * lib/timevar.c: Always include "config.h".
9061 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
9062 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
9063 (EXTRA_bison_SOURCES): New macro.
9064 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
9065 * src/system.h: Don't include config.h.
9066 * src/LR0.c: Include <config.h> first.
9067 * src/assoc.c: Likewise.
9068 * src/closure.c: Likewise.
9069 * src/complain.c: Likewise.
9070 * src/conflicts.c: Likewise.
9071 * src/derives.c: Likewise.
9072 * src/files.c: Likewise.
9073 * src/getargs.c: Likewise.
9074 * src/gram.c: Likewise.
9075 * src/lalr.c: Likewise.
9076 * src/location.c: Likewise.
9077 * src/main.c: Likewise.
9078 * src/muscle_tab.c: Likewise.
9079 * src/nullable.c: Likewise.
9080 * src/output.c: Likewise.
9081 * src/parse-gram.y: Likewise.
9082 * src/print.c: Likewise.
9083 * src/print_graph.c: Likewise.
9084 * src/reader.c: Likewise.
9085 * src/reduce.c: Likewise.
9086 * src/relation.c: Likewise.
9087 * src/state.c: Likewise.
9088 * src/symlist.c: Likewise.
9089 * src/symtab.c: Likewise.
9090 * src/tables.c: Likewise.
9091 * src/uniqstr.c: Likewise.
9092 * src/vcg.c: Likewise.
9094 * src/parse-gram.y: Fix minor problems uncovered by lint.
9095 (current_lhs, current_lhs_location): Now static.
9096 (current_assoc): Remove unused variable.
9098 Cleanups so that Bison-generated parsers have less lint.
9099 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
9100 Prepend /*ARGSUSED*/, for lint's sake.
9101 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
9102 definition if 'lint' is defined.
9103 (YYID): New macro (or function, if lint).
9104 All uses of /*CONSTCOND*/0 replaced by YYID(0).
9105 * data/yacc.c: Likewise.
9106 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
9107 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
9108 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
9110 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
9111 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
9112 Use YYID(0) rather than 0, for lint.
9113 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
9114 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
9116 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
9118 * tests/glr-regression.at
9119 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9120 Close memory leak reported by twlevo.
9122 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
9124 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
9126 (yyparse): Iterate another stack in order to call user destructors.
9127 * tests/glr-regression.at (No users destructors if stack 0 deleted):
9129 (Duplicated user destructor for lookahead): This test now is expected
9132 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
9134 * NEWS: Document the following change.
9135 * data/yacc.c: Say "parser skeleton" rather than "file", since
9136 it's no longer just a file.
9137 * data/glr.c: Grant a special exception for C GLR parsers, that
9138 reads like the already-existing exception for C LALR(1) parsers.
9139 * data/glr.cc: Likewise.
9140 * data/lalr1.cc: Likewise.
9141 * data/location.cc: Likewise.
9142 * data/yacc.c: Reword the "written by" statement to clarify that
9143 it was the parser skeleton, not the entire output file.
9144 * data/glr.c: Written by Paul Hilfinger.
9145 * data/glr.cc: Written by Akim Demaille.
9146 * data/lalr1.cc: Likewise.
9148 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
9150 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
9151 Fix typos in previous change that broke 'make check'.
9152 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
9154 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
9155 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
9156 We can revert this once things settle down.
9158 * src/conflicts.c (conflicts_print): Don't print file name twice
9159 when %expect fails because there were no conflicts.
9160 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
9162 * tests/conflicts.at (%expect not enough, %expect too much):
9163 (%expect with reduce conflicts): Adjust to new behavior.
9165 2005-11-18 Akim Demaille <akim@epita.fr>
9167 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
9169 * NEWS: Document this.
9170 * doc/bison.texinfo (Expect Decl): Likewise.
9172 2005-11-16 Akim Demaille <akim@epita.fr>
9174 Generalize the display of semantic values and locations in traces.
9175 * data/glr.c (yy_reduce_print): Fix indices (again).
9176 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
9178 * data/lalr1.cc (yyreduce_print): Rename as...
9179 (yy_reduce_print): this.
9180 Display values and locations.
9181 * data/yacc.c (yy_reduce_print): Likewise.
9182 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
9183 (yysymprint): Move higher to be visible from yy_reduce_print).
9185 * tests/calc.at: Adjust the expected length of the traces.
9187 2005-11-14 Akim Demaille <akim@epita.fr>
9189 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
9190 from 1 to N, while values and location start at 0.
9191 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
9193 2005-11-14 Akim Demaille <akim@epita.fr>
9195 * data/glr.c (yy_reduce_print): Fix the $ number.
9197 2005-11-14 Akim Demaille <akim@epita.fr>
9199 "Use" parse parameters.
9200 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
9201 * data/glr.c, data/glr.cc: Use them.
9202 * data/glr.c (YYUSE): Have a C++ definition that supports
9205 2005-11-14 Akim Demaille <akim@epita.fr>
9207 * data/glr.c (yyexpandGLRStack): Declare only if defined.
9209 2005-11-14 Akim Demaille <akim@epita.fr>
9212 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
9214 2005-11-12 Akim Demaille <akim@epita.fr>
9216 Let position and location be PODs.
9217 * data/location.cc (position::initialize, location::initialize): New.
9218 (position::position, location::location): Define only if
9219 b4_location_constructors is defined.
9220 * data/lalr1.cc (b4_location_constructors): Define it for backward
9222 * doc/bison.texinfo (Initial Action Decl): Use initialize.
9224 2005-11-12 Akim Demaille <akim@epita.fr>
9226 * data/lalr1.cc: Move the body of the ctor and dtor into the
9227 parser file (instead of the header).
9228 Wrap the implementations in a "namespace yy".
9230 2005-11-12 Akim Demaille <akim@epita.fr>
9232 Have glr.c include its header file when created.
9233 * data/glr.c (b4_shared_declarations): New.
9234 Output them verbatim in the parser if !%defines, otherwise
9235 output then in the header file, and include it instead.
9237 2005-11-11 Akim Demaille <akim@epita.fr>
9239 * data/glr.c: Comment changes.
9241 2005-11-11 Akim Demaille <akim@epita.fr>
9243 When yydebug, report semantic and location values for reductions.
9244 * data/glr.c (yy_reduce_print): Report the semantic values and the
9246 (YY_REDUCE_PRINT): Adjust.
9247 (yyglrReduce): Use them.
9248 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
9249 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
9250 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
9253 2005-11-10 Akim Demaille <akim@epita.fr>
9255 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
9256 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
9257 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
9259 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
9261 * m4/cxx.m4, examples/Makefile.am: Don't build
9262 examples/calc++ if no C++ compiler is available. (trivial change)
9264 2005-11-09 Akim Demaille <akim@epita.fr>
9266 * src/scan-skel.l: Use a couple of asserts.
9268 2005-11-03 Akim Demaille <akim@epita.fr>
9270 In some (weird) cases, the final state number is incorrect.
9271 Reported by Alexandre Duret-Lutz.
9272 * src/LR0.c (state_list_append): Remove the computation of
9274 (save_reductions): Do it here.
9275 (get_state): Alpha conversion.
9276 (generate_states): Use a for loop.
9277 * src/gram.h (item_number_is_rule_number)
9278 (item_number_is_symbol_number): New.
9279 * src/state.c: Use assert.
9280 * src/system.h: Include assert.h.
9281 * tests/sets.at (Accept): New.
9283 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9285 * data/glr.c (yyfill): Adjust comment.
9286 (yyresolveAction): Initialize default location properly
9287 for empty right-hand sides.
9288 (yydoAction): Ditto.
9289 Add comment explaining apparently dead code.
9290 * tests/glr-regression.at
9291 (Incorrectly initialized location for empty right-hand side in GLR):
9294 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
9296 * bootstrap (cleanup_gnulib): New function. Use it to clean up
9297 gnulib when interrupted. This fixes some race conditions and
9298 works around some portability problems (one noted by Paul
9301 2005-10-22 Akim <akim@epita.fr>
9303 * Makefile.cfg: Adjust to config -> build-aux.
9306 2005-10-21 Akim Demaille <akim@epita.fr>
9308 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
9310 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
9311 * data/yacc.c (b4_Pure_if): Rename as...
9312 (b4_yacc_pure_if): this.
9313 (YY_SYMBOL_PRINT, yyparse): Adjust.
9314 * doc/bison.texinfo: Formatting changes.
9316 2005-10-21 Akim Demaille <akim@epita.fr>
9318 Finish the transition config -> build-aux.
9319 * configure.ac, Makefile.am: Use build-aux.
9320 * config/prev-version, config/announce-gen, config/Makefile.am:
9322 * build-aux/prev-version, build-aux/announce-gen,
9323 * build-aux/Makefile.am: here.
9325 2005-10-14 Akim Demaille <akim@epita.fr>
9327 * examples/calc++/test: Use set -x only when VERBOSE.
9329 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
9331 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
9332 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
9334 2005-10-13 Akim Demaille <akim@epita.fr>
9336 * src/scan-skel.l: Output the base name parts of the parser and
9338 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
9340 Use this to exercise C++ outputs in subdirs.
9341 Reported by Oleg Smolsky.
9343 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
9345 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
9346 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
9347 Problem reported by John P. Hartmann.
9348 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
9351 2005-10-12 Akim Demaille <akim@epita.fr>
9353 * src/parse-gram.y (version_check): Exit 63 to please missing
9354 (stands for "version mismatch).
9355 * tests/input.at, doc/bison.texinfo: Adjust.
9357 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
9359 Work around portability problems with Visual Age C compiler
9360 (xlc and xlC_r) reported by John P. Hartmann.
9361 * data/location.cc (initial_column, initial_line): Remove.
9362 All uses replaced by 0 and 1.
9363 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
9364 that xlc complains about.
9365 * src/scan-skel.l (skel_wrap): Likewise.
9366 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
9368 * data/yacc.c (YYMODERN_C): New macro, which also looks at
9369 __STDC_VERSION__. Use it everywhere instead of looking at
9370 __STDC__ and __cplusplus.
9372 2005-10-10 Akim Demaille <akim@epita.fr>
9374 * examples/calc++/test: Be quiet unless VERBOSE.
9376 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
9378 * data/c.m4 (yydestruct, yysymprint):
9379 Use YYUSE instead of casting to void.
9380 * data/glr.c (YYUSE): New macro.
9381 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
9382 Use it instead of rolling our own.
9383 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
9385 Use /*CONSTCOND*/ to suppress lint warnings.
9386 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
9387 (YY_STACK_PRINT): Use 'false' not '0'.
9389 (yysymprint_, yydestruct_): Use it instead of rolling our own.
9390 * data/yacc.c (YYUSE): New macro.
9391 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
9392 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
9393 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
9396 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
9397 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
9399 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
9401 Undo the parts of the unlocked-I/O change that substituted
9402 putc or puts for printf. This might hurt performance a bit,
9403 but some people prefer the printf style.
9404 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
9405 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
9406 All uses replaced by YYFPRINTF and YYDPRINTF.
9407 * data/yacc.c: Likewise.
9408 * lib/bitset.c (bitset_print): Likewise.
9409 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
9411 * lib/lbitset.c (debug_lbitset): Likewise.
9412 * src/closure.c (print_firsts, print_fderives): Likewise.
9413 * src/gram.c (grammar_dump): Likewise.
9414 * src/lalr.c (look_ahead_tokens_print): Likewise.
9415 * src/output.c (escaped_output): Likewise.
9416 (user_actions_output): Break apart two printfs.
9417 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
9418 * src/reduce.c (reduce_print): Likewise.
9419 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
9420 * src/system.h: Include unlocked-io.h rathe than stdio.h.
9422 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
9423 Use assignments rather than casts-to-void to suppress
9424 unused-variable warnings. This pacifies 'lint'.
9425 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
9426 unused-variable warnings.
9428 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9430 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
9432 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
9434 Use unlocked I/O for a minor performance improvement on hosts like
9435 GNU/Linux and Solaris that support unlocked I/O. The basic idea
9436 is to use the gnlib unlocked-io module, and to prefer putc and
9437 puts to printf when either will work (since the latter doesn't
9438 come in an unlocked flavor).
9439 * bootstrap (gnulib_modules): Add unlocked-io.
9440 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
9441 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
9442 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
9443 and similarly for puts and putc and printf.
9444 * data/yacc.c: Likewise.
9445 * lib/bitset.c (bitset_print): Likewise.
9446 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
9447 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
9449 * lib/lbitset.c (debug_lbitset): Likewise.
9450 * src/closure.c (print_firsts, print_fderives): Likewise.
9451 * src/gram.c (grammar_dump): Likewise.
9452 * src/lalr.c (look_ahead_tokens_print): Likewise.
9453 * src/output.c (escaped_output): Likewise.
9454 (user_actions_output): Coalesce two printfs.
9455 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
9456 * src/reduce.c (reduce_print): Likewise.
9457 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
9458 * src/system.h: Include unlocked-io.h rather than stdio.h.
9460 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
9461 this confuses xgettext.
9463 2005-10-02 Akim Demaille <akim@epita.fr>
9465 * bootstrap (gnulib_modules): Add strverscmp.
9466 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
9467 * m4/.cvsignore: Add strverscmp.m4.
9468 * src/parse-gram.y (%require): New token, new rule.
9469 (version_check): New.
9470 * src/scan-gram.l (%require): Adjust.
9471 * tests/input.at (AT_REQUIRE): New.
9473 * doc/bison.texinfo (Require Decl): New.
9474 (Calc++ Parser): Use %require.
9476 2005-10-02 Akim Demaille <akim@epita.fr>
9478 * data/location.cc: New.
9480 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
9481 Akim Demaille <akim@epita.fr>
9483 Make sure -odir/foo.cc creates dir/location.hh etc.
9484 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
9485 (spec_file_prefix, spec_verbose_file, spec_graph_file)
9486 (spec_defines_file): Now const.
9488 (short_base_name): Remove.
9489 * src/files.c: Adjust.
9490 (dirname.h): Include.
9491 (base_name): Don't prototype it.
9492 (finput): Remove, duplicates gram_in.
9493 (full_base_name, short_base_name): Replace by...
9494 (all_but_ext, all_but_tab_ext): these.
9495 (compute_base_names): Rename as...
9496 (compute_file_name_parts): this.
9497 Update to compute the new variables, including dir_prefix.
9498 Adjust dependencies.
9499 * src/output.c (prepare): Output them.
9500 * src/reader.c: Adjust to use gram_in, not finput.
9501 * src/scan-skel.l (@dir_prefix@): New.
9503 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9505 * lib/subpipe.c: New function end_of_output_subpipe() added
9506 to allow support for non-posix systems. This is a no-op function
9509 * lib/subpipe.h: New function end_of_output_subpipe() added
9510 to allow support for non-posix systems. This is a no-op function
9513 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
9514 handle the lack of pipe/fork functionality on non-posix systems.
9516 * djgpp/Makefile.maint: DJGPP specific file.
9518 * djgpp/README.in: DJGPP specific file.
9520 * djgpp/config.bat: DJGPP specific configuration file.
9522 * djgpp/config.sed: DJGPP specific configuration file.
9524 * djgpp/config.site: DJGPP specific configuration file.
9526 * djgpp/config_h.sed: DJGPP specific configuration file.
9528 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
9530 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
9532 2005-10-02 Akim Demaille <akim@epita.fr>
9534 * data/location.cc: New, extract from...
9535 * data/lalr1.cc: here.
9536 (location.hh): Include it after the user prologue, in case the
9537 filename type is defined by the user.
9538 Forward declation location and position before the pre-prologue.
9539 (yyresult_): Rename as...
9540 (yyresult): this, it's a local variable, not an attribute.
9541 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
9543 2005-10-01 Akim Demaille <akim@epita.fr>
9545 * examples/extexi: Restore the #line generation.
9547 2005-09-30 Akim Demaille <akim@epita.fr>,
9548 Alexandre Duret-Lutz <adl@gnu.org>
9550 Move the token type and YYSTYPE in the parser class.
9551 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
9552 (parser::token): New, from the moved free definition of tokens.
9553 (parser::semantic_value): Now a full definition instead of an
9554 indirection to YYSTYPE.
9555 (b4_post_prologue): No longer included in the header file, but
9556 in the implementation file.
9557 * doc/bison.texi (C+ Language Interface): Update.
9558 * src/parse-gram.y: Support unary %define.
9559 * tests/actions.at: Define global_tokens_and_yystype for backward
9560 compatibility until we update the tests.
9561 * tests/calc.at: Idem.
9562 (first_line, first_column, last_line, last_column): Define for lalr1.cc
9563 to simplify the code.
9565 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
9567 Port to SunOS 4.1.4, which lacks strtoul and strerror.
9568 Ah, the good old days! Problem reported by Peter Klein.
9569 * bootstrap (gnulib_modules): Add strerror, strtoul.
9570 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
9571 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
9573 2005-09-29 Akim Demaille <akim@epita.fr>
9575 * data/c.m4 (b4_error_verbose_if): New.
9576 * data/lalr1.cc: Use it.
9577 (YYERROR_VERBOSE_IF): Remove.
9578 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
9579 parser members, replaced by...
9580 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
9582 (yysyntax_error_): Takes the state number as argument.
9583 (yyreduce_print_): Use the argument yyrule, not the former
9586 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
9588 * bootstrap (gnulib_modules): Add verify.
9589 * lib/.cvsignore: Add verify.h.
9590 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
9591 * src/system.h (verify): Remove.
9592 Include verify.h instead.
9593 * src/tables.c (tables_generate): Use new API for 'verify'.
9595 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
9597 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
9598 local variables whose names begin with 'yy'.
9599 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
9600 Trivial changes from Joel E. Denny.
9602 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
9604 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
9605 don't use alloca any more.
9607 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
9608 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
9609 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
9610 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
9611 to match yacc.c, to test more hosts.
9613 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
9615 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
9616 doesn't affect behavior.
9617 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
9619 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
9620 This works a bit better with glibc, if user code has already included
9622 * doc/bison.texinfo (Bison Parser): Document that users can't
9623 arbitrarily use malloc and free for other purposes. Document
9624 that <alloca.h> and <malloc.h> might be included.
9625 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
9626 user must declare alloca.
9628 * HACKING (release): Forwarn the Translation Project about
9631 2005-09-20 Akim Demaille <akim@epita.fr>
9633 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
9635 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
9637 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
9638 (YYSTACK_ALLOC_MAXIMUM): Use it.
9639 (yysyntax_error): New function.
9640 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
9641 multiple syntax errors are reported, and alloca is being used.
9642 Instead, reallocate buffers twice as big each time, so that
9643 we waste at most half the allocated memory. Start with a small
9644 (128-byte) buffer that will suffice in most cases anyway.
9645 Use yysyntax_error to do most of the work.
9647 * doc/bison.texinfo (Error Reporting, Table of Symbols):
9648 yynerrs is the number of errors reported, not the number of
9651 * tests/glr-regression.at (Duplicated user destructor for lookahead):
9652 Mark it as expected to fail.
9653 Cast result of malloc; problem reported by twlevo@xs4all.nl.
9654 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
9655 Don't start user-code symbols with "yy", to avoid name space problems.
9657 2005-09-19 Akim Demaille <akim@epita.fr>
9659 Remove the traits, failed experiment.
9660 It never proved useful, and anyway because of the current
9661 definition, it was not possible to have several specialization of
9662 this traits, making it useless.
9663 * data/lalr1.cc (yy:traits): Remove.
9664 Inline its definitions in the parser class.
9666 2005-09-19 Akim Demaille <akim@epita.fr>
9668 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
9669 least Mac OSX with a /usr/local install of gettext.
9671 2005-09-19 Akim Demaille <akim@epita.fr>
9673 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
9674 and yytoken for similarity with the other skeletons.
9676 2005-09-19 Akim Demaille <akim@epita.fr>
9678 * NEWS, configure.ac: update version number to 2.1a.
9680 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
9682 * NEWS: Version 2.1.
9684 * NEWS: Remove notice of yytname change, since it was never in an
9686 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
9688 * src/output.c (prepare): Likewise.
9689 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
9690 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
9691 is not defined. This is an awful hack, but it's enough for now.
9692 All callers changed.
9693 * tests/glr-regression-at (make_value): Args are const pointers now,
9694 to avoid GCC warning.
9695 (Duplicated user destructor for lookahead): New test. Currently
9696 skipped. It fails on my host but I'm not sure it'll always fail.
9698 2005-09-16 Akim Demaille <akim@epita.fr>
9700 * src/symtab.h (struct symbol): Declare the printer and destructor
9701 as const, to avoid accidental calls to free.
9702 (symbol_destructor_set, symbol_printer_set): Adjust.
9703 * src/symtab.c: Adjust.
9705 2005-09-16 Akim Demaille <akim@epita.fr>
9707 * data/c.m4 (b4_token_enums): New.
9708 (b4_token_defines): Rename as...
9709 (b4_token_enums_defines): this.
9710 (b4_token_defines): New, output only the #defines.
9711 * data/yacc.c, data/glr.c: Adjust.
9712 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
9713 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
9716 2005-09-16 Akim Demaille <akim@epita.fr>
9718 * data/lalr1.cc (yylex_): Remove, inline its code.
9719 (yyreport_syntax_error_): Remove, replaced by...
9720 (yysyntax_error_): this which returns a string and leaves to the
9721 caller the call to the users' error function.
9722 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
9723 Move from members of the parser object...
9724 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
9725 to local variables of the parse function.
9727 2005-09-16 Akim Demaille <akim@epita.fr>
9729 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
9730 since it's in Bison's name space.
9732 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
9734 * data/glr.c (yyresolveValue): Add default case to pacify
9735 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
9737 * NEWS: Document when yyparse started to return 2.
9738 * doc/bison.texinfo (Parser Function): Document when yyparse
9741 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
9742 (b4_filename_type): Renamed back from b4_file_name_type. All uses
9744 (class position): file_name -> filename (reverting). All uses changed.
9746 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
9748 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
9749 do anything if $@ exists. This reverts part of the 2005-07-07
9752 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
9754 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
9755 contains obsolete information and isn't worth distributing as a
9756 separate file anyway.
9757 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
9758 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
9759 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
9760 (yyparse): Abort if user code uses longjmp to throw an unexpected
9763 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
9765 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
9766 Suggested by twlevo@xs4all.nl.
9768 * data/glr.c (YYCHK1): Do not assume YYE is in range.
9769 This avoids a diagnostic from gcc -Wswitch-enum.
9770 Problem reported by twlevo@xs4all.nl.
9772 * doc/bison.texinfo: Don't use "filename", as per GNU coding
9773 standards. Use "file name" or "file" or "name", depending on
9775 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
9776 not to hack/foo.tab.c.
9777 (Calc++ Top Level): 2nd arg of main is not const.
9778 * data/glr.c: b4_filename -> b4_file_name.
9779 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
9781 (class position): filename -> file_name. All uses changed.
9782 * data/yacc.c: b4_filename -> b4_file_name.
9783 * lib/bitset.h: filename -> file_name in local vars.
9784 * lib/bitset_stats.c: Likewise.
9785 * src/files.c: Likewise.
9786 * src/scan-skel.l ("@output ".*\n): Likewise.
9787 * src/files.c (file_name_split): Renamed from filename_split.
9788 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
9790 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
9792 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
9793 to accommodate latest gnulib.
9795 * tests/glr-regression.at (Duplicate representation of merged trees):
9796 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
9798 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
9801 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
9803 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
9804 All uses changed. Invoke user destructor after an error during a
9805 split parse (trivial change from Joel E. Denny).
9807 * tests/glr-regression.at
9808 (User destructor after an error during a split parse): New test case.
9809 Problem reported by Joel E. Denny in:
9810 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
9812 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
9814 * README-cvs: Give URLs for recommended tools.
9815 Mention Gzip version problem, and bootstrapping issues.
9816 Remove troubleshooting section, as it's somewhat obsolete.
9818 * bootstrap (no_cache): New var, to accommodate different wget
9819 variants. Use it instead of '-C off'. Problem reported by
9822 * data/glr.c (yydestroyStackItem): New function.
9823 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
9824 debugging information. Problem reported by Joel E. Denny.
9826 2005-08-25 Akim Demaille <akim@epita.fr>
9828 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
9830 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
9832 * data/glr.c (yyrecoverSyntaxError, yyreturn):
9833 Don't invoke destructor on unresolved entries.
9834 * tests/glr-regression.at
9835 (User destructor for unresolved GLR semantic value): New test case.
9836 Problem reported by Joel E. Denny in:
9837 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
9839 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
9841 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
9843 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
9844 lib-prefix.m4, po.m4.
9846 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
9847 in yydestruct diagnostic, since it might not be an error.
9848 Problem reported by Joel Denny near end of
9849 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
9850 * data/lalr1.cc (yyerturn): Likewise.
9851 * data/yacc.c (yyreturn): Likewise.
9852 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
9854 * src/files.c: Remove obsolete FIXME comment.
9856 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
9857 with the other templates, and to fix bogus run-on messages such
9858 as the one reported at the end of
9859 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
9860 All callers changed to avoid the newline.
9861 (yyprocessOneStack): Output two lines rather than one, to accommodate
9862 the above change. This changes the debug output format slightly.
9864 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
9865 reported by Joel E. Denny in
9866 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
9868 * tests/glr-regression.at (Duplicate representation of merged trees):
9869 New test, from Joel E. Denny in:
9870 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
9871 * THANKS: Add Joel E. Denny.
9873 * configure.ac (AC_INIT): Bump to 2.0c.
9875 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
9877 * NEWS: Version 2.0b.
9879 * Makefile.am (SUBDIRS): Put examples before tests, so that
9880 "make check" doesn't finish with "All 1 tests passed".
9882 * tests/regression.at (Token definitions): Don't rely on
9883 AT_PARSER_CHECK for data that contains backslashes. It currently
9884 uses 'echo', and 'echo' isn't portable if its argument contains
9885 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
9886 that the byte '\0xff' is not printable in the C locale; it is,
9887 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
9888 not printable, so use '\0x81' to test.
9890 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
9891 version of GCC, since the macro is used with non-GCC compilers.
9893 Fix core dump reported by Pablo De Napoli in
9894 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
9895 * tests/regression.at (Invalid inputs with {}): New test.
9896 * src/parse-gram.y (token_name): Translate type before using
9899 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
9900 the user's name space. All uses changed to __attribute__
9902 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
9903 Add __attribute__ ((__noreturn__)).
9905 * etc/clcommit: Remove. We weren't using it, and it failed
9906 "make maintainer-distcheck".
9907 * Makefile.maint: Merge from coreutils.
9908 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
9909 (syntax-check-rules): Change list of rules as described below.
9910 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
9911 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
9912 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
9913 (sc_trailing_space): New rules.
9914 (sc_xalloc_h_in_src): Remove.
9915 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
9916 (sc_space_tab, sc_error_exit_success, sc_changelog):
9917 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
9918 (makefile-check, po-check, author_mark_check):
9919 (makefile_path_separator_check, copyright-check):
9920 Use grep -n, to make it easier to find violations.
9921 Use CVS_LIST and CVS_LIST_EXCEPT.
9922 (header_regexp, h_re): Remove.
9924 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
9925 (my-distcheck): Use more-modern GCC flags.
9926 (signatures, %.asc): Remove.
9927 (rel-files, announcement): Remove signatures.
9928 Restore old updating code, even though we don't use it, so
9929 that we're the same as coreutils.
9930 (alpha, beta, major): Depend on news-date-check.
9931 Make the upload commands.
9933 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
9934 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
9935 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
9936 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
9937 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
9938 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
9939 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
9940 * tests/sets.at: Likewise.
9942 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
9943 we comment out the Autoconf version number.
9944 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
9945 it's error-prone and "make maintainer-distcheck" rejects it.
9947 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
9948 Indent calls to "error" to pacify "make maintainer-distcheck",
9949 when the calls are not intended to be translated.
9950 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
9952 * src/Makefile.am (DEFS): Use +=, to pacify
9953 "make maintainer-distcheck".
9954 (bison_SOURCES): Add scan-skel.h.
9955 (sc_tight_scope): New rule, from coreutils.
9957 * src/files.c (src_extension, header_extension):
9958 Now static, not extern.
9959 * src/getargs.c (short_options): Likewise.
9960 * src/muscle_tab.c (muscle_table): Likewise.
9961 * src/parse-gram.y (current_class, current_type, current_prec):
9963 * src/reader.c (grammar_end, previous_rule_end): Likewise.
9964 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
9965 * src/main.c (main): Cast bindtextdomain and textdomain calls to
9966 void, to avoid warning when NLS is disabled.
9967 * src/output.c: Include scan-skel.h.
9968 (scan_skel): Remove decl, since scan-skel.h does this.
9970 Indent calls to "error" to pacify "make maintainer-distcheck".
9971 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
9972 * src/reader.h (gram_end, gram_lineno): New decls to pacify
9973 "make maintainer-distcheck".
9974 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
9975 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
9976 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
9977 (skel_lex_destroy, scan_skel): Move these decls to...
9978 * src/scan-skel.h: New file.
9979 * src/uniqstr.c (uniqstr_assert):
9980 Indent calls to "error" to pacify "make maintainer-distcheck".
9982 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
9985 * tests/torture.at: Revamp to avoid misuse of atoi that
9986 "make maintainer-distcheck" complained about.
9988 * examples/extexi (message): Don't print a message more than once,
9989 and omit line-number decoration that makes Emacs compile think
9990 that informative messages are worth worrying about.
9992 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
9994 * configure.ac: Update version number.
9996 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
9998 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
9999 autogenerated by the maintainer.
10000 * examples/calc++/.cvsignore: Add *.yy.
10002 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
10003 * lib/bitset_stats.c (bitset_stats_init): Likewise.
10004 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10006 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
10008 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
10009 from maintainer-distcheck about casting the argument of 'free'.
10011 * NEWS: Mention recent yytname changes.
10012 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
10014 * bootstrap: For translations that have not yet been upgraded to
10015 the new runtime-po domain, prime the pump by extracting the
10016 relevant strings from the obsolete translations. This code can be
10017 removed once the bison-runtime domain has been translated by each
10020 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
10021 now that token names are already quoted.
10023 Fix problem reported by Anthony Heading.
10024 * data/glr.c (YYTOKEN_TABLE): New macro.
10025 (yytname): Define if YYTOKEN_TABLE.
10026 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
10027 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
10028 (YYERROR_VERBOSE): Define the same way the other skeletons do.
10029 * src/output.c (prepare_symbols): Output token_table_flag.
10031 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
10033 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
10034 again if the first call fails.
10036 * data/glr.c (yytnamerr): New function.
10037 (yyreportSyntaxError): Use it to dequote most string literals.
10038 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
10039 with other skeletons. All uses changed.
10040 (yytnameerr_): New function.
10041 (yyreport_syntax_error): Use it to dequote most string literals.
10042 * data/yacc.c (yytnamerr): New function.
10043 (yyerrlab): Use it to decode most string literals.
10044 * doc/bison.texinfo (Decl Summary, Calling Convention):
10045 Clarify quoting convention of yytname.
10046 * src/output.c (prepare_symbols): Quote all names. This undoes
10047 the 2005-04-17 change, which is now accomplished (mostly) via
10048 changes in the parsers as described above.
10049 * tests/regression.at (Token definitions, Web2c Actions):
10050 Undo most 2005-04-17 change here, too.
10052 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
10054 Fix more problems reported by twlevo@xs4all.nl.
10055 * tests/cxx-type.at: Don't pipe output of ./types through sed to
10056 remove trailing spaces. This loses the exit status of ./types,
10057 and isn't needed since ./types shouldn't be emitting trailing
10059 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
10060 as the stack isn't valid in that case.
10062 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
10063 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
10064 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
10065 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
10067 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
10068 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
10069 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
10072 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
10073 overly-picky compilers that reject 'char *foo = "bar";'.
10075 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
10076 to FILE * parameter, not to stderr. This fixes a typo introduced
10077 in the 2005-07-12 change.
10079 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
10080 warnings from GCC 4.
10082 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
10083 (yyglrShiftDefer, yysplitStack):
10084 Remove unused parameters b4_pure_formals. All uses changed.
10085 (yyglrShift): Remove unused parameters b4_user_formals.
10087 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
10089 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
10091 Destructor cleanups and regularization among the three skeletons.
10092 * NEWS: Document the behavior changes.
10093 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
10094 stack before failing, as the cleanup code will do it for us now.
10095 * data/lalr1.cc (yyerrlab): Likewise.
10096 * data/glr.c (yyparse): Pop everything off the stack before
10097 freeing it, so that destructors get called properly.
10098 * data/lalr1.cc (yyreturn): Likewise.
10099 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
10100 This is more consistent.
10101 * doc/bison.texinfo (Destructor Decl): Mention more reasons
10102 why destructors might be called. 1.875 -> 2.1.
10103 (Destructor Decl, Decl Summary, Table of Symbols):
10104 Some English-language cleanups for %destructor.
10105 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10106 Add output line for destructor of start symbol.
10107 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
10108 because of that same extra output line.
10110 * NEWS: Document minor wording changes in diagnostics of
10111 Bison-generated parsers.
10112 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
10113 Remove unused formals. All uses changed.
10114 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
10115 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
10116 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
10117 Rename yyoverflowab to yyexhaustedlab.
10118 When memory exhaustion occurs during syntax-error reporting,
10119 report it separately rather than in a single diagnostic; this
10121 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
10122 (Memory Exhausted): Renamed from Parser Stack Overflow.
10123 Revamp wording slightly to prefer "memory exhaustion".
10124 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
10126 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
10128 Add i18n support to the GLR skeleton. Partially fix the C++
10129 skeleton; a C++ expert needs to finish this. Remove debugging
10130 msgids; there's little point to having them translated, since they
10131 can be understood only by someone who can read the
10132 (English-language) source code.
10134 Generate runtime-po/bison-runtime.pot automatically, so that we
10135 don't have to worry about garbage getting in that file. We'll
10136 make sure after the next official release that old msgids don't
10138 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
10140 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
10141 Now auto-generated.
10142 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
10143 Fix typos in explanations of the runtime file.
10144 * bootstrap: Change gettext keyword from YYI18N to YY_.
10145 Use standard Makefile.in.in in runtime-po, since we'll arrange
10146 for backward-compatible bison-runtime.po files in a different way.
10147 * data/glr.c (YY_): New macro, from yacc.c.
10148 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
10149 Translate messages intended for users.
10150 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
10151 the wording in the other skeletons. We don't know that the memory
10153 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
10154 Use same method that yacc.c uses.
10155 Don't translate debugging messages.
10156 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
10157 it doesn't work (yet), and requires C++ expertise to fix.
10158 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
10159 Move defn to a more logical place, to be consistent with other
10161 Don't translate debugging messages.
10162 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
10163 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
10164 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
10165 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
10167 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
10168 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
10170 * tests/glr-regression.at (Badly Collapsed GLR States):
10172 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10173 yylex should return 0 at EOF rather than aborting.
10175 Improve tests for stack overflow in GLR parser.
10176 Problem reported by twlevo@xs4all.nl.
10177 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
10179 (yyStackOverflow): Just longjmp, but with value 2 so that caller
10180 can handle the problem.
10181 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
10182 (yyparse): New local variable yyresult to record the result.
10183 Use result of setjmp to set it, rather than storing itinto
10185 (yyDone): Remove label.
10186 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
10187 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
10188 if YYABORT is used).
10189 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
10190 yyparse status; put status > 1 into diagnostic.
10191 Check that status==2 works.
10192 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
10193 Use exit status 3 for failure to open (which shouldn't happen).
10195 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
10197 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
10198 1 on syntax error; just let yyparse do its thing.
10199 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
10200 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
10201 (Exploding the Stack Size with Alloca):
10202 (Exploding the Stack Size with Malloc):
10203 Expect exit status 2, not 1, since the parser is supposed to blow
10204 its stack. Problem reported by twlevo@xs4all.nl.
10206 * data/glr.c (yyparse): Don't assume that the initial calls
10207 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
10208 Print a stack-overflow message and fail instead.
10209 Initialize the line-number information before creating the stack,
10210 so that the stack-overflow message can report line zero safely.
10212 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
10214 Fix problems reported by twlevo@xs4all.nl.
10215 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
10216 (yyuserMerge): Provide a default case if b4_mergers is empty.
10217 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
10218 * tests/glr-regression.at
10219 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10220 Add casts to pacify C++ compilers.
10221 * tests/glr-regression.at (Improper merging of GLR delayed action
10222 sets): Declare yylex before using it.
10223 * tests/Makefile.am (maintainer-check-g++): Fix a stray
10224 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
10225 test for valgrind; valgrind is independent of g++.
10226 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
10227 for compatibility with POSIX 1003.1-2001 (if running coreutils).
10228 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
10229 Use a destructor, so that we can expand the stack. Change
10230 YYSTYPE to char * so that we can free it. Cast result of malloc.
10232 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10234 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
10235 a valgrind failure. Problem reported by twlevo@xs4all.nl.
10237 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
10239 * PACKAGING: New file, suggested by Bruno Haible and taken from
10240 similar wording in gettext's PACKAGING file.
10241 * NEWS: Mention PACKAGING.
10242 * Makefile.am (EXTRA_DIST): Add PACKAGING.
10244 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
10246 * NEWS: Document recent i18n improvements.
10247 * bootstrap: Get runtime translations into runtime-po.
10248 Create runtime-po files automatically, if possible.
10249 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
10250 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
10251 does not infringe on the user's name space.
10252 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
10253 * doc/bison.texinfo (Internationalization): Revamp the English
10254 and Texinfo syntax a bit, to try to make it clearer.
10255 (Bison Options, Option Cross Key): Mention --print-localedir.
10256 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
10257 YYENABLE_NLS. Quote a bit more.
10258 * runtime-po/.cvsignore: New file.
10259 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
10260 * runtime-po/Rules-quot: Remove; now created by bootstrap.
10261 * runtime-po/quot.sed: Likewise.
10262 * runtime-po/boldquot.sed: Likewise.
10263 * runtime-po/en@quot.header: Likewise.
10264 * runtime-po/en@boldquot.header: Likewise.
10265 * runtime-po/insert-header.sin: Likewise.
10266 * runtime-po/remove-potcdate.sin: Likewise.
10267 * runtime-po/Makevars: Likewise.
10268 * runtime-po/LINGUAS: Likewise.
10269 * runtime-po/de.po: Likewise; we will rely on the translation project
10270 to maintain this, so "bootstrap" should get it.
10271 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
10273 * src/main.c (main): Bind the bison-runtime domain, too.
10275 2005-07-12 Bruno Haible <bruno@clisp.org>
10277 * data/yacc.c: Include <libintl.h> when NLS is enabled.
10278 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
10279 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
10280 * runtime-po: New directory.
10281 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
10282 $(DOMAIN).pot-update rule, so that old messages are never dropped.
10283 * runtime-po/Rules-quot: New file, copied from po/.
10284 * runtime-po/quot.sed: Likewise.
10285 * runtime-po/boldquot.sed: Likewise.
10286 * runtime-po/en@quot.header: Likewise.
10287 * runtime-po/en@boldquot.header: Likewise.
10288 * runtime-po/insert-header.sin: Likewise.
10289 * runtime-po/remove-potcdate.sin: Likewise.
10290 * runtime-po/Makevars: New file.
10291 * runtime-po/POTFILES.in: New file.
10292 * runtime-po/LINGUAS: New file.
10293 * runtime-po/bison-runtime.pot: New file.
10294 * runtime-po/de.po: New file.
10295 * m4/bison.m4: New file.
10296 * Makefile.am (SUBDIRS): Add runtime-po.
10297 (aclocaldir, aclocal_DATA): New variables.
10298 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
10300 * src/getargs.c (usage): Document --print-localedir option.
10301 (PRINT_LOCALEDIR_OPTION): New enum item.
10302 (long_options): Add --print-localedir option.
10303 (getargs): Handle --print-localedir option.
10304 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
10305 (Internationalization): New section.
10307 2005-07-12 Akim Demaille <akim@epita.fr>
10309 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
10310 for consistency with the rest of the code.
10311 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
10314 2005-07-12 Akim Demaille <akim@epita.fr>
10316 * src/parse-gram.y: Use %printer instead of YYPRINT.
10318 2005-07-12 Akim Demaille <akim@epita.fr>
10320 * src/symtab.h, src/symtab.c (symbol_print): New.
10321 * src/symlist.h, src/symlist.c (symbol_list_print): New.
10322 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
10324 2005-07-12 Akim Demaille <akim@epita.fr>
10326 * data/glr.c (b4_syncline): Fix (swap) the definitions of
10327 b4_at_dollar and b4_dollar_dollar.
10329 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
10331 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
10332 and Pennello's paper.
10334 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
10336 * data/yacc.c (yyparse): Undo previous patch. Instead,
10337 set yylsp[0] and yyvsp[0] only if the initial action
10338 sets yylloc and yylval, respectively.
10340 * data/yacc.c (yyparse): In the initial action, set
10341 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
10342 This avoids the use of undefined variables if the initial
10343 action does not set yylloc and/or yylval.
10345 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
10347 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
10348 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
10349 Remove from CVS. These files are automatically generated.
10350 * examples/extexi: Clarify that this file is now part of Bison,
10351 not GNU M4, and that it works with any POSIX-compatible Awk.
10352 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
10353 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
10354 so that we also get calc++-parser.yy. Geneate it.
10355 Use $(AWK), not gawk, since any conforming Awk will do.
10356 Put comment before action, since older 'make' can't handle comment
10358 $(BUILT_SOURCES): List all built sources, not just some of them.
10359 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
10360 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
10361 $($(calc_sources_generated)): Remove unnecessary test for existence
10362 of target. (This had a shell syntax error anyway; a stray "x".)
10363 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
10365 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
10367 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
10368 implied by the other modules.
10370 2005-07-06 Akim Demaille <akim@epita.fr>
10372 Bind examples/calc++ to the package.
10373 * examples/calc++/Makefile: Remove, replaced by...
10374 * examples/calc++/Makefile.am: ... this new file.
10375 * examples/calc++/test: Remove input.
10376 * examples/calc++/compile: Remove.
10377 * examples/Makefile.am: New.
10378 * configure.ac, Makefile.am: Adjust.
10379 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
10381 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
10383 * data/glr.c (yyFail): Drastically simplify; since the format argument
10384 never had any % directives, we can simply pass it to yyerror.
10385 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
10386 be modified later, as that is the usual style in glr.c.
10387 Problems reported by Paul Hilfinger.
10389 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
10390 and size overflow errors.
10391 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
10392 in case the user prolog sets feature-test macros like _GNU_SOURCE.
10393 (YYSIZEMAX): New macro.
10394 (yystpcpy): New function, taken from yacc.c.
10395 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
10396 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
10397 so that we don't have to maintain their signatures.
10398 (yyFail): Check for buffer overflow, by using vsnprintf rather
10399 than vsprintf. Allocate a bigger buffer if possible.
10400 Report an error if buffer allocation fails.
10401 (yyStackOverflow): New function.
10402 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
10403 the initialization was successful. It might fail if storage was
10405 (yyexpandGLRStack): Add more checks for storage allocation failure.
10406 Use yyStackOverflow to report failures.
10407 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
10408 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
10409 Don't assume stack number fits in int.
10410 (yysplitStack): Check for storage allocation failure.
10411 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
10412 can print diagnostics on storage allocation failure. All callers
10414 (yyresolveValue): Use yybool for boolean.
10415 (yyreportSyntaxError): Check for size-calculation overflow.
10416 This code is taken from yacc.c.
10417 (yyparse): Check for storage allocation errors when allocating
10420 2005-07-05 Akim Demaille <akim@epita.fr>
10422 Extract calc++ from the documentation.
10423 * doc/bison.texinfo (Calc++): Add the extraction marks.
10424 * examples/extexi: New, from the aborted GNU Programming 2E.
10425 Separate the different paragraph of a file with empty lines.
10426 * examples/Makefile: Use it to extract the whole calc++ example.
10428 2005-06-24 Akim Demaille <akim@epita.fr>
10430 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
10433 2005-06-22 Akim Demaille <akim@epita.fr>
10435 * doc/bison.texinfo (C++ Language Interface): First stab.
10436 (C++ Parsers): Remove.
10438 2005-06-22 Akim Demaille <akim@epita.fr>
10440 * data/lalr1.cc (yylex_): Honor %lex-param.
10442 2005-06-22 Akim Demaille <akim@epita.fr>
10444 Start a set of simple examples.
10445 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
10446 * examples/calc++/calc++-driver.hh,
10447 * examples/calc++/calc++-parser.yy,
10448 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
10449 * examples/calc++/compile, examples/calc++/test: New.
10451 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
10453 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
10454 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
10455 which stems from the 2005-05-27 patch.
10457 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10459 * data/glr.c: Modify treatment of unused parameters to permit use
10460 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
10462 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
10464 Fix infringement on user name space reported by Janos Zoltan Szabo.
10465 * data/yacc.c (yyparse): strlen -> yystrlen.
10467 2005-05-30 Akim Demaille <akim@epita.fr>
10469 * data/lalr1.cc (_): New.
10470 Translate the various messages.
10472 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
10474 Fix infringement on user name space reported by Bruno Haible.
10475 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
10476 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
10477 the user's name space.
10478 (alloca): Include <stdlib.h> to get it, if it's not built in.
10479 (YYMALLOC, YYFREE): Define only if needed.
10480 (malloc, free): Declare, but only if needed, as this infringes on
10481 the user name space.
10483 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
10485 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
10486 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
10488 * lib/ebitset.c (min, max): Undef before defining.
10489 * lib/vbitset.c (min, max): Likewise.
10490 * lib/subpipe.c (create_subpipe): Save local variables in case
10491 vfork clobbers them.
10493 2005-05-24 Bruno Haible <bruno@clisp.org>
10495 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
10496 error message syntax used by gcc-4.0.
10498 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
10500 * README: Mention m4 1.4.3. Remove obsolete advice about
10501 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
10503 * bootstrap: Remove workaround for problem I encountered with
10504 gettext 0.14.1; it seems to be fixed now.
10506 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
10508 * NEWS: Version 2.0a.
10510 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
10511 the previous change.
10513 Various maintainer cleanups.
10514 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
10515 conftest*, for benefit of CVS commands run at the same time as
10516 "configure". Add build-aux, since "bootstrap" now creates it and
10518 * Makefile.cfg (move_if_change): Remove.
10519 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
10520 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
10521 (po_repo, do-po-update, po-update, wget_files, get-targets):
10522 (config.guess-url_prefix, config.sub-url_prefix):
10523 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
10524 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
10525 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
10527 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
10528 this is now the recommended name.
10529 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
10530 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
10531 ylwrap. These files now go into build-aux.
10532 * config/move-if-change: Remove.
10533 * config/prev-version.txt: Bump from 1.75 to 2.0.
10535 * bootstrap: Add stdio-safer, unistd-safer modules.
10536 Remove m4/glibc2.m4 (introduced by latest gnulib, but
10538 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
10539 fopen-safer.c, stdio-safer.h, unistd-safer.h.
10540 * lib/subpipe.c: Include "unistd-safer.h".
10541 (create_subpipe): Make sure all the newly-created
10542 file descriptors are > 2, so that diagnostics don't
10543 get sent down them (which might cause Bison to hang, in theory).
10544 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
10545 * src/files.c (xfopen): Use fopen_safer, not fopen.
10547 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
10548 yesterday's yacc.c fix.
10550 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
10552 * data/glr.c, data/lalr1.cc: Update copyright date.
10554 Fix a destructor bug reported by Wolfgang Spraul in
10555 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
10556 * data/yacc.c (yyabortlab): Don't call destructor, and
10557 don't set yychar to EMPTY.
10558 (yyoverflowlab): Don't call destructor.
10559 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
10560 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
10561 since we no longer output the message "discarding lookahead token
10564 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10566 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
10567 fix a small glitch in debugging output.
10568 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
10569 after YY_SYMBOL_PRINT where needed.
10571 (struct yyGLRState): Add some comments.
10572 (struct yySemanticOption): Add some comments.
10573 (union yyGLRStackItem): Add comment.
10575 (yymergeOptionSets): Correct this to properly perform the union,
10576 avoiding infinite reported by Michael Rosien.
10579 * tests/glr-regression.at: Add test for GLR merging error reported
10582 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
10584 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
10585 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
10586 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
10587 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
10588 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
10589 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
10590 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
10591 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
10592 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
10593 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
10594 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
10595 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
10596 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
10597 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
10598 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
10599 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
10600 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
10601 src/derives.h, src/files.c, src/files.h, src/getargs.c,
10602 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
10603 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
10604 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
10605 src/output.h, src/parse-gram.c, src/parse-gram.h,
10606 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
10607 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
10608 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
10609 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
10610 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
10611 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
10612 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
10613 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
10614 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
10615 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
10616 tests/reduce.at, tests/regression.at, tests/sets.at,
10617 tests/synclines.at, tests/testsuite.at, tests/torture.at:
10618 Update FSF postal mail address.
10620 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
10622 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
10623 Problem reported by Ralf Menzel.
10625 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
10627 * tests/actions.at: Test that stack overflow invokes destructors.
10628 From Marcus Holland-Moritz.
10629 * data/yacc.c (yyerrlab): Move the code that destroys the stack
10631 (yyreturn): to here. That way, destructors are called properly
10632 even if the stack overflows, or the user calls YYACCEPT or
10633 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
10634 (yyoverflowlab): Destroy the lookahead.
10636 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
10638 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
10640 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
10642 * NEWS: Bison-generated C parsers no longer quote literal strings
10643 associated with tokens.
10644 * src/output.c (prepare_symbols): Don't escape strings,
10645 since users don't want to see C escapes.
10646 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
10648 * tests/input.at (Torturing the Scanner): Likewise.
10649 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
10651 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
10653 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
10654 the data size is known to be too small and we can't increase it.
10655 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
10657 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
10659 * src/parse-gram.y: Include quotearg.h.
10660 (string_as_id): Quote $1 before using it as a key, since the
10661 lexer no longer quotes it for us.
10662 (string_content): Don't strip quotes, since lexer no longer
10664 * src/scan-gram.l: Include quotearg.h.
10665 ("\""): Omit quote.
10666 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
10667 a key, since the rest of the lexer doesn't quote it.
10668 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
10669 * tests/regression.at (Token definitions): Check for backslashes
10672 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
10673 (YYSIZE_T): Define to unsigned long int when using an older compiler.
10674 (yyparse): Revamp code to generate long syntax error message, to
10675 make it easier to translate, and to avoid problems with arithmetic
10676 overflow. Change "virtual memory" to "memory" in diagnostic, since
10677 we don't know whether the memory is virtual.
10679 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
10681 * NEWS: Bison-generated C parsers now use the _ macro to
10683 * data/yacc.c (_) [!defined _]: New macro.
10684 All English strings wrapped inside this macro.
10685 * doc/bison.texinfo (Bison Parser): Document _.
10686 * po/POTFILES.in: Include src/parse-gram.c, since it now
10687 includes translateable strings that parse-gram.y doesn't.
10689 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
10691 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
10692 reverting the 2004-10-11 change to this function.
10693 (symbol_check_alias_consistency): Don't call symbol_type_set
10694 if the type name is already correct.
10695 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
10697 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
10699 * tests/regression.at (Token definitions): Don't use a token named
10700 c, as that generates a "#define c ..." that runs afoul of buggy
10701 stdlib.h that uses the identifier c as a member of struct
10702 drand48_data. Problem reported by Horst Wente.
10704 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
10706 * bootstrap: Change translation URL from
10707 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
10708 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
10709 redirection glitches. Problem reported by twlevo@xs4all.nl.
10711 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
10713 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
10714 after operands; POSIX says this isn't portable for the c99 command.
10716 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
10718 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
10719 immediately if a data overrun has occurred; this may help us track
10720 down what may be a spurious failure on MacOS.
10722 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
10724 Respond to problems reported by twlevo@xs4all.nl.
10726 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
10728 * src/vcg.h: Comment fix.
10729 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
10730 (G_CMAX): Change to -1 instead of INT_MAX.
10732 * data/yacc.c (yyparse): Omit spaces before #line.
10734 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
10736 * src/tables.c (state_number_to_vector_number): Put it inside an
10737 "#if 0", since it's not currently used. Problem reported by
10740 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
10742 * src/output.c (escaped_output): Renamed from
10743 escaped_file_name_output, since we now use it for symbol tags as
10744 well. All uses changed.
10745 (symbol_destructors_output, symbol_printers_output):
10746 Escape symbol tags too.
10747 Problem reported by Matyas Forstner in
10748 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
10750 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
10752 * src/output.c (user_actions_output, token_definitions_output,
10753 symbol_destructors_output, symbol_printers_output): Likewise.
10754 * src/reader.c (prologue_augment): Likewise.
10755 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
10757 * src/vcg.c (output_edge): Don't quote linestyle arg.
10758 Problem reported by twlevo@xs4all.nl.
10760 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
10762 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
10763 example, reported by Derek M Jones. Also, make the example even
10764 more outrageous, to better illustrate how bad the problem is.
10766 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
10768 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
10769 putsym. Typo reported by Sebastian Piping.
10771 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
10773 * doc/bison.texinfo (Language and Grammar): some -> same
10774 (Epilogue): int he -> in the
10775 Typos reported by Sebastian Piping via Justin Pence.
10777 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
10779 * tests/glr-regression.at (Improper handling of embedded actions
10780 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
10781 embedded actions and $-N in GLR parsers", work around an Autoconf bug
10782 with dollar signs in test names.
10783 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
10784 for a similar reason.
10786 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
10788 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
10789 wants to redefine G_VIEW.
10791 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
10793 * src/vcg.c (get_view_str): Remove case for normal_view.
10794 Problem reported by twlevo@xs4all.nl.
10796 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
10798 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
10799 Problem reported by twlevo@xs4all.nl.
10801 * doc/bison.texinfo: Change @dircategory from "GNU programming
10802 tools" to "Software development". Requested by Richard Stallman
10805 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
10807 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
10808 Problem reported by twlevo@xs4all.nl.
10810 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
10812 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
10813 keyword; it's not needed with modern compilers, and it doesn't
10814 affect correctness with older compilers. Suggested by
10817 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
10819 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
10820 gcc -Wswitch-default.
10821 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
10822 * data/yacc.c (yyparse): Likewise.
10824 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
10826 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
10827 already. Let config.h define any nonstandard values.
10829 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
10831 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
10832 for the benefit of slower hosts. Problem reported by
10833 Nelson H. F. Beebe.
10835 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
10837 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
10838 being defined and not used.
10839 * data/lalr1.cc (yyparse): Likewise.
10840 Use "if (false)" rather than "if (0)".
10842 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
10844 * TODO: Mention that we should allow NUL bytes in tokens.
10846 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
10848 * src/scan-skel.l (<<EOF>>): Don't close standard output.
10849 Problem reported by Hans Aberg.
10851 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
10853 * src/getargs.c (version): Happy new year; update overall
10854 program copyright date from 2004 to 2005.
10856 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
10857 Problem reported by Hans Aberg.
10858 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
10859 (Output file names.): Add a test for the case when standard output
10862 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
10864 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
10865 to fix an oversight in the Bison 2.0 manual.
10867 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
10869 * NEWS: Version 2.0. Reformat the existing news items since
10870 1.875, so that related items are grouped together.
10871 * configure.ac (AC_INIT): Bump version to 2.0.
10872 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
10874 * tests/torture.at (Exploding the Stack Size with Alloca): Set
10875 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
10876 otherwise, we're not testing alloca. Unfortunately there's no
10877 simple way to consult HAVE_ALLOCA here.
10879 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
10882 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
10883 hand. This avoids a warning about comparing int to size_t when
10884 GCC warnings are enabled.
10886 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
10888 * NEWS: Bison-generated parsers no longer default to using the
10889 alloca function (when available) to extend the parser stack, due
10890 to widespread problems in unchecked stack-overflow detection.
10891 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
10892 responsibility to set it to a positive value. This lets the user
10893 specify a value that is not a preprocessor constant.
10894 * data/yacc.c (YYMAXDEPTH): Likewise.
10895 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
10896 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
10897 to be a compile-time constant. However, explain the constraints on it.
10898 Also, explain the constraints on YYINITDEPTH.
10899 (Table of Symbols): Explain that alloca is no longer the default.
10900 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
10903 * doc/bison.texinfo (Location Default Action): Mention that n must
10904 be zero when k is zero. Suggested by Frank Heckenbach.
10906 2004-12-22 Akim Demaille <akim@epita.fr>
10908 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
10909 (parser::state_type, parser::semantic_type, parser::location_type):
10910 Private, not public.
10911 (parser::parse): Return ints, not bool.
10912 Returning a bool introduces a problem: 0 corresponds to false, and
10913 it seems weird to return false on success. Returning true changes
10914 the conventions for yyparse.
10915 Alternatively we could return void and send an exception.
10916 There is no clear consensus (yet?).
10917 (state_stack, semantic_stack, location_stack): Rename as...
10918 (state_stack_type, semantic_stack_type, location_stack_type): these.
10919 Private, not public.
10920 * tests/c++.at: New.
10921 * tests/testsuite.at, tests/Makefile.am: Adjust.
10923 2004-12-21 Akim Demaille <akim@epita.fr>
10925 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
10927 2004-12-21 Akim Demaille <akim@epita.fr>
10929 Don't impose std::string for filenames.
10931 * data/lalr1.cc (b4_filename_type): New.
10932 (position::filename): Use it.
10933 (parser.hh): Move the inclusion of stack.hh and location.hh below
10934 the user code, so that needed headers for the filename type can be
10936 Forward declare them before the user code.
10937 * tests/Makefile.am (check-local, installcheck-local): Pass
10938 TESTSUITEFLAGS to the TESTSUITE.
10940 2004-12-20 Akim Demaille <akim@epita.fr>
10942 Use more STL like names: my_class instead of MyClass.
10944 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
10945 (SemanticStack, SemanticType, StateStack, StateType)
10946 (TokenNumberType, Stack, Slice, Traits, Parser::location)
10947 (Parser::value): Rename as...
10948 (location_stack, location_type, rhs_number_type, semantic_stack)
10949 (semantic_type, state_stack, state_type, token_number_type, stack)
10950 (slice, traits, parser::yylloc, parser::yylval): these.
10952 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
10954 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
10956 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
10957 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10959 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
10961 Remove uses of 'short int' and 'unsigned short int'. This raises
10962 some arbitrary limits. It uses more memory but nowadays that's
10963 not much of an issue.
10965 This change does not affect the generated parsers; that's a different
10966 task, as some users will want to conserve memory there.
10968 Ideally we should use size_t to represent all object counts, and
10969 something like ptrdiff_t to represent signed differences of object
10970 counts; but that will require more code-cleanup than I have the
10971 time to do right now.
10973 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
10974 Use size_t, not int or short int, to count objects.
10975 * src/closure.c (nritemset, closure): Likewise.
10976 * src/closure.h (nritemset, closure): Likewise.
10977 * src/nullable.c (nullable_compute): Likewise.
10978 * src/print.c (print_core): Likewise.
10979 * src/print_graph.c (print_core): Likewise.
10980 * src/state.c (state_compare, state_hash): Likewise.
10981 * src/state.h (struct state): Likewise.
10982 * src/tables.c (default_goto, goto_actions): Likewise.
10984 * src/gram.h (rule_number, rule): Use int, not short int.
10985 * src/output.c (prepare_rules): Likewise.
10986 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
10987 errs, reductions): Likewise.
10988 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
10990 * src/tables.c (vector_number, tally, action_number,
10991 ACTION_NUMBER_MINIMUM): Likewise.
10992 * src/output.c (muscle_insert_short_int_table): Remove.
10994 2004-12-17 Akim Demaille <akim@epita.fr>
10996 * data/lalr1.cc: Extensive Doxygenation.
10997 (error_): Rename as...
10998 (error): this, since it is visible to the user.
11000 (Parser::message): Now an automatic variable from...
11001 (Parser::yyreport_syntax_error_): here.
11002 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
11004 * tests/input.at: Escape $.
11006 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
11008 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
11009 Parenthesize rhs to avoid obscure problems with mistakes like
11010 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
11011 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
11012 b4_rhs_location): Likewise.
11013 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
11014 b4_rhs_location): Likewise.
11016 2004-12-16 Akim Demaille <akim@epita.fr>
11018 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
11019 yacc.c: be sure to stay within yycheck_.
11020 * tests/actions.at: Re-enable C++ tests.
11022 2004-12-16 Akim Demaille <akim@epita.fr>
11024 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
11027 2004-12-16 Akim Demaille <akim@epita.fr>
11029 Use #define to handle the %name-prefix.
11031 * data/glr.c, data/yacc.c: Comment changes.
11032 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
11033 so that one can refer to yylex in the parser file, and have it
11034 renamed, as is the case with other skeletons.
11036 2004-12-16 Akim Demaille <akim@epita.fr>
11038 Move lalr1.cc internals into yy*.
11040 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
11041 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
11042 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
11043 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
11044 (empty_, final_, terror_, errcode_, ntokens_)
11045 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
11046 (looka_, ilooka_, error_range_, nerrs_):
11048 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
11049 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
11050 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
11051 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
11052 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
11053 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
11054 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
11055 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
11058 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
11060 Fix some problems reported by twlevo at xs4all.
11061 * src/symtab.c (symbol_new): Report an error if the input grammar
11062 contains too many symbols. This is better than calling abort() later.
11063 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
11064 (struct node, struct graph):
11065 Rename member expand to stretch. All uses changed.
11066 (struct graph): Remove member layoutalgorithm. All uses removed.
11067 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
11068 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
11070 (N_STRETCH): Rename from N_EXPAND. All uses changed.
11072 2004-12-15 Akim Demaille <akim@epita.fr>
11074 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
11075 Add more Doxygen comments.
11076 (symprint_, stack_print_, reduce_print_, destruct_, pop)
11077 (report_syntax_error_, translate_): Rename as...
11078 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
11079 (yypop_, yyreport_syntax_error_, yytranslate_): this.
11081 2004-12-15 Akim Demaille <akim@epita.fr>
11083 * data/lalr1.cc (lex_): Rename as...
11085 Move the trace here.
11086 Take the %name-prefix into account.
11087 Reported by Alexandre Duret-Lutz.
11089 2004-12-15 Akim Demaille <akim@epita.fr>
11091 Simplify the C++ parser constructor.
11093 * data/lalr1.cc (debug_): Rename as...
11094 (yydebug_): so that the parser's internals are always in the yy*
11097 (b4_parse_param_decl): Remove the leading comma as it is now only
11098 called as unique argument list.
11099 (Parser::Parser): Remove the constructor accepting a location and
11100 an initial debugging level.
11101 Remove from the other ctor the argument for the debugging level.
11102 (debug_level_type, debug_level, set_debug_level): New.
11104 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
11107 2004-12-15 Akim Demaille <akim@epita.fr>
11109 Remove b4_root related material: failure experiment
11110 (which goal was to allow to derive from a class).
11112 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
11113 definitions and uses.
11115 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
11117 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
11118 not 2, since it's not portable to subtract 1 from the start of an
11119 array. The new item 0 is never set or used. All uses changed.
11121 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
11122 the default definition of YYLLOC_DEFAULT. Problem reported
11123 by Frank Heckenbach.
11125 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
11127 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
11128 the normal case and one for the error case. Just use the
11129 first one uniformly. Problem reported by Frank Heckenbach.
11130 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
11131 use exactly the same macro in both places.
11132 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
11133 so that the normal-case YYRHSLOC works for the error case too.
11135 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
11136 (YYLLOC_DEFAULT): Use the same macro as glr.c.
11137 * doc/bison.texinfo (Location Default Action): Don't claim that
11138 we have an array of locations. Use the same macro for both glr
11139 and lalr parsers. Mention YYRHSLOC. Mention what happens when
11142 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
11144 * HACKING: Update email addresses to send announcements to.
11146 * configure.ac (AC_INIT): Bump version to 1.875f.
11148 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
11150 * NEWS: Version 1.875e.
11151 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
11153 * src/scan-skel.l: Include "complain.h", for "fatal".
11155 * src/relation.h (relation_print, relation_digraph):
11156 Relation sizes are of type relation_node, not size_t (this is
11157 merely a doc fix, since the two types are equivalent).
11158 (relation_transpose): Relation sizes are of type relation_node,
11160 * src/relation.c: Likewise.
11161 (top, infinity): Now of type relation_node, not int.
11162 (traverse, relation_transpose): Use relation_node, not int.
11164 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
11165 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
11166 (yyparse): Remove unused local introduced in 2004-10-25 patch.
11168 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
11169 specifying whether the test should be skipped. Use it tp
11170 specify that the [%defines %skeleton "lalr1.cc"] tests currently
11171 fail on some hosts, and should be skipped.
11173 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
11175 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
11176 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
11177 unless otherwise specified below.
11179 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
11180 to allocate kernel_base, kernel_items, kernel_size, since
11181 they needn't be initialized to 0.
11182 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
11183 * src/closure.c (new_closure): Likewise, for itemset.
11184 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
11185 * src/lalr.c (set_goto_map): Likewise, for temp_map.
11186 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
11187 (build_relations): Likewise for edge, states1, includes.
11188 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
11189 * src/reader.c (packgram): Likewise, for ritem, rules.
11190 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
11191 * src/relation.c (relation_digraph): Likewise for VERTICES.
11192 (relation_transpose): Likewise for new_R, end_R.
11193 * src/symtab.c (symbols_token_translations_init): Likewise for
11194 token_translations.
11195 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
11196 (token_actions): Likewise for yydefact, actrow, conflrow,
11198 (save_column): Likewise for froms[symno], tos[symno].
11199 (goto_actions): Likewise for state_count.
11200 (pack_table): Likewise for base, pos, check.
11201 (tables_generate): Likewise for width.
11203 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
11204 for initial core. Just have a separate core, so we needn't worry
11205 about whether kernel_size and kernel_base are initialized.
11207 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
11208 kernel_size, kernel_items): Remove unnecessary initialization.
11209 * src/conflicts.c (conflicts): Likewise.
11210 * src/derives.c (derives): Likewise.
11211 * src/muscle_tablc (muscle_insert): Likewise.
11212 * src/relation.c (relation_digraph): Likewise.
11213 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
11214 conflrow, conflict_table, conflict_list, table, check):
11217 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
11218 This is because all callers pass unsigned int.
11219 * src/closure.h (new_closure): Likewise.
11221 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
11222 (build_relations): Initialize includes[i] in all cases.
11223 * src/reader.c (packgram): Always initialize rules[ruleno].prec
11224 and rules[ruleno].precsym. Initialize members in order.
11225 * src/relation.c (relation_transpose): Always initialize new_R[i]
11227 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
11229 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
11230 conflict_list[0] was always 0, but now it isn't initialized.
11232 * src/table.c (table_grow): When conflict_table grew, the grown
11233 area wasn't cleared. Fix this.
11235 * lib/.cvsignore: Add strdup.c, strdup.h.
11236 * m4/.cvsignore: Add strdup.m4.
11238 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
11240 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
11241 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
11242 GOTO_NUMBER_MAXIMUM, since we occasionally compute
11243 ngotos + 1 without checking for overflow.
11244 (build_relations): Use END_NODE, not -1, to denote end of edges.
11245 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
11246 build_relations): Use goto_number, not int, for goto numbers.
11247 * src/tables.c (save_column, default_goto): Likewise.
11249 2004-11-23 Akim Demaille <akim@epita.fr>
11251 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
11252 of #defining from yystype.
11253 Don't typedef yystype, C++ does not need it.
11254 This lets it possible to forward declare it as union.
11256 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
11258 * bootstrap (gnulib_modules): Add extensions.
11259 Problem reported by Jim Meyering.
11261 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
11263 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
11264 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
11265 src/system.h, src/tables.c: XFREE -> free, to accommodate
11266 recent change to gnulib xalloc.h.
11267 Problem reported by Jim Meyering.
11269 2004-11-17 Akim Demaille <akim@epita.fr>
11271 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
11273 2004-11-17 Akim Demaille <akim@epita.fr>,
11274 Alexandre Duret-Lutz <adl@gnu.org>
11276 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
11278 (YYCDEBUG): Adjust.
11279 Use it instead of cdebug_.
11280 (Parser::debug_stream, Parser::set_debug_stream): New.
11281 (Parser::symprint_): Define cdebug_ for temporary backward
11283 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
11286 2004-11-17 Akim Demaille <akim@epita.fr>
11288 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
11289 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
11290 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
11291 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
11293 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
11295 * data/glr.c (yyloc_default): Remove; not used.
11296 Problem reported by Frank Heckenbach.
11298 2004-10-25 Akim Demaille <akim@epita.fr>
11300 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
11301 Introduce another definition to address simple location arrays.
11302 (yyGLRStack): New member: yyerror_range.
11303 (yyrecoverSyntaxError, yyparse): Update it.
11304 (yyrecoverSyntaxError): Use it when shifting the error token to
11305 have an accurate range, equivalent to the one computed by both
11306 yacc.c and lalr1.cc.
11307 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
11308 that column numbers start at column 0, as per GNU Coding
11309 Standards, the others tests, and the doc.
11310 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
11311 Adjust to the above change (first column is 0).
11312 And adjust the location of the "<error>", now covering the whole
11315 2004-10-22 Akim Demaille <akim@epita.fr>
11316 and Paul Eggert <eggert@cs.ucla.edu>
11318 Remove some arbitrary limits on goto numbers and relations.
11319 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
11320 initial values, since they're never used.
11321 (set_goto_map): ngotos is now unsigned, so test for overflow
11322 by seeing whether it wraps around to zero.
11323 * src/lalr.h (goto_number): Now size_t, not short int.
11324 (GOTO_NUMBER_MAXIMUM): Remove.
11325 * src/relation.c (relation_print, traverse, relation_transpose):
11326 Check for END_NODE rather than looking at sign.
11327 * src/relation.h (END_NODE): New macro.
11328 (relation_node): Now size_t, not short int.
11330 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
11332 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
11333 keyword, not an identifier. Problem reported by Baron Schwartz in
11334 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
11336 2004-10-11 Akim Demaille <akim@epita.fr>
11338 * src/symtab.c (symbol_check_alias_consistency): Also check
11339 type names, destructors, and printers.
11340 Reported by Alexandre Duret-Lutz.
11341 Recode the handling of associativity and precedence in terms
11342 of symbol_precedence_set.
11343 Accept no redeclaration at all, not even equal to the previous
11345 (redeclaration): New.
11346 Use it to factor redeclaration complaints.
11347 (symbol_make_alias): Don't set the type of the alias, let
11348 symbol_check_alias_consistency do it as for other features.
11349 * src/symtab.h (symbol): Add new member prec_location, and
11351 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
11352 * tests/input.at (Incompatible Aliases): New.
11354 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
11356 .cvsignore fixes to accommodate gnulib changes,
11357 and the practice of naming build directories "_build".
11358 * .cvsignore: Add "_*". Sort.
11359 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
11360 * m4/.cvsignore: Add "*_gl.m4".
11362 2004-10-06 Akim Demaille <akim@epita.fr>
11364 * src/parse-gram.y (add_param): Fix the truncation of trailing
11367 2004-10-05 Akim Demaille <akim@epita.fr>
11369 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
11370 whether the reducion was empty or not. This leaves room to
11371 improve the use of YYLLOC_DEFAULT in such a case.
11372 lalr1.cc is still experimental, so changing this is acceptable.
11373 And finally, there are probably not many users who changed the
11374 handling of locations in GLR, so changing is admissible too.
11376 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
11377 empty reduction, set @$ to an empty location ending the previously
11379 Adjust uses to make sure the code is triggered on empty
11381 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
11382 expected output: empty reductions have empty locations.
11384 2004-09-29 Akim Demaille <akim@epita.fr>
11386 * data/lalr1.cc: Move towards a more standard C++ coding style
11387 for templates: Class < T > -> Class<T>.
11389 2004-09-29 Akim Demaille <akim@epita.fr>
11391 * data/lalr1.cc: Reinstall the former ctor, for sake of
11392 compatibility, but warn it will be removed.
11393 Move towards a more standard C++ coding style (i.e., type *var ->
11396 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
11398 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
11399 since it's less likely to work if NULs are involved in the future.
11401 2004-09-27 Akim Demaille <akim@epita.fr>
11403 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
11405 2004-09-27 Akim Demaille <akim@epita.fr>
11407 * data/lalr1.cc (b4_parse_param_decl_1): New.
11408 (b4_parse_param_decl): Use it to have different names between attribute
11409 and argument names.
11410 (b4_cc_constructor_call): Likewise.
11412 2004-09-24 Akim Demaille <akim@epita.fr>
11414 * src/parse-gram.y (add_param): Strip the leading and trailing
11415 blanks from a formal argument declaration.
11416 (YY_LOCATION_PRINT): New.
11418 2004-09-24 Akim Demaille <akim@epita.fr>
11420 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
11421 after the location.
11423 2004-09-24 Akim Demaille <akim@epita.fr>
11425 * doc/bison.texinfo (Table of Symbols): Sort.
11427 2004-09-21 Akim Demaille <akim@epita.fr>
11429 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
11430 the useless parentheses.
11431 Suggested by Paul Eggert.
11433 2004-09-20 Akim Demaille <akim@epita.fr>
11435 Let the initial-action act on the look-ahead, and use it for the
11436 "initial push" (corresponding to an hypothetical beginning-of-file).
11437 And let lalr1.cc honor %initial-action.
11439 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
11441 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
11442 (Parser::Parser): Remove the ctor that used to initialize it.
11443 (Parser::parse): Like in the other skeletons, issue the "starting
11444 parse" message before any action.
11445 Honor %initial-action.
11446 Initialize the stacks with the lookahead.
11447 * data/yacc.c: Let $$ and @$ in %initial-action designate the
11449 Push them in the stacks.
11450 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
11452 2004-09-20 Akim Demaille <akim@epita.fr>
11454 * doc/bison.texinfo (Initial Action Decl): New.
11456 2004-09-20 Akim Demaille <akim@epita.fr>
11458 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
11459 clearer criterion to define it.
11460 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
11461 When reducing on an empty RHS, use the latest stacked location as
11463 yylloc is not always available.
11464 * data/glr.c: Likewise.
11465 Also, honor initial-actions.
11467 2004-09-20 Akim Demaille <akim@epita.fr>
11469 * data/yacc.c (YY_LOCATION_PRINT): New.
11470 Define when we know YYLTYPE's structure, i.e., when the default
11471 YYLLOC_DEFAULT is used.
11472 * data/c.m4 (b4_yysymprint_generate): Use it.
11473 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
11474 value of the result.
11475 (error_start_): Replace with...
11476 (error_range_): this location array.
11477 This allows to replace code relying on the implementation of
11478 locations by portable code.
11479 * data/yacc.c (yylerrsp): Replace with...
11480 (yyerror_range): this.
11481 Every time a token is popped, update yyerror_range[0], to have an
11482 accurate location for the error token.
11483 * data/glr.c (YY_LOCATION_PRINT): New.
11484 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
11485 deference a pointer.
11486 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
11487 report the location in %printers.
11489 * src/scan-skel.l: Instead of abort, report error messages to ease
11490 understanding skeleton scanning failures.
11492 2004-09-16 Akim Demaille <akim@epita.fr>
11494 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
11495 (iterator, const_iterator): these, to be more in the C++ spirit.
11496 Also, return reverse iterators so that when displaying the stack
11497 we display its bottom first.
11498 (Parser::stack_print_, Parser::reduce_print_): Match the messages
11500 We should probably use vector here though.
11502 2004-09-16 Akim Demaille <akim@epita.fr>
11504 Have more complete shift traces.
11506 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
11507 to report Shifts instead of ad hoc YYDPRINTF invocations,
11508 including for the error token.
11509 * data/lalr1.cc (symprint_): Output the location.
11510 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
11511 output the location within the %printer.
11512 Activate GLR tests, at least to make sure they compile properly.
11513 They still don't pass though.
11514 * tests/calc.at: Adjust expect verbose output, since now "Entering
11515 state..." is on a different line than the "Shifting" message.
11517 2004-09-08 Akim Demaille <akim@epita.fr>
11519 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
11520 Bison directive from the Bison file to the invocation of this
11521 macro, so that these directives are passed to
11522 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
11523 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
11524 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
11525 the extra Bison directives instead of the whole series.
11526 Change the grammar so that there are recoverable errors, and
11527 unrecoverable errors. Now we can have the parser give up before
11528 consuming the whole input. As a result we now can observe that
11529 the lookahead is freed when needed.
11530 Change the parser source to parse argv[1] instead of a hard coded
11532 Simplify yylex, and give a value and location to EOF.
11533 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
11534 passed directives already coded in the file.
11535 Add some tests to check the location of "error".
11536 For some tests, the C++ parser is correct, and not yacc.c.
11537 For other tests, they provide different, but unsatisfying, values,
11538 so keep the C++ value so that at least one parser is "correct"
11539 according to the test suite.
11540 (Actions after errors): Remove, this is subsumed by the
11541 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
11543 2004-09-06 Akim Demaille <akim@epita.fr>
11545 * data/lalr1.cc: Adjust the indentation of the labels.
11546 (Parser::pop): New.
11549 2004-09-06 Akim Demaille <akim@epita.fr>
11551 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
11552 argument, an informative message.
11553 Call YY_SYMBOL_PRINT.
11554 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
11555 * data/lalr1.cc (destruct_): Likewise.
11556 In addition, no longer depend on b4_yysymprint_generate and
11557 b4_yydestruct_generate to generate these functions, do it "by
11560 2004-09-03 Akim Demaille <akim@epita.fr>
11562 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
11563 invoked, yydestruct the lookahead.
11564 * tests/calc.at (Calculator $1): Update the expected lengths of
11565 traces: there is an added line for the discarded lookahead.
11566 * doc/bison.texinfo (Destructor Decl): Some rewording.
11567 Define "discarded" symbols.
11569 2004-09-02 Akim Demaille <akim@epita.fr>
11571 * data/lalr1.cc (translate_, destruct_): No reason to be static.
11573 2004-09-02 Akim Demaille <akim@epita.fr>
11575 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
11576 (YYDSYMPRINTF): Rename as...
11577 (YY_SYMBOL_PRINT): this.
11578 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
11580 Use it instead of direct symprint_ calls.
11581 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
11584 2004-09-02 Akim Demaille <akim@epita.fr>
11586 * data/lalr1.cc (b4_yysymprint_generate): New.
11587 (symprint_): New member function, defined when YYDEBUG.
11588 Use it consistently instead of token/nterm debugging output by
11590 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
11591 %printer calls to use cdebug_ when using lalr1.cc.
11593 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
11595 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
11596 with #ifdef YYDEBUG.
11598 2004-08-26 Akim Demaille <akim@epita.fr>
11600 * doc/bison.texinfo (Implementing Loops): Rename as...
11601 (Implementing Gotos/Loops): this.
11603 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
11605 Adjust to latest gnulib.
11606 * bootstrap (gnulib_modules): Add xalloc-die.
11607 Set LC_ALL=C so that file names sort consistently.
11608 Prefer the gnulib copies of gettext.m4, glibc21.m4,
11609 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
11610 uintmax_t.m4, ulonglong.m4.
11611 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
11612 po.m4 since we are now using _gl.m4 instead.
11614 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
11616 * src/scan-action.l: Remove. Scanning of semantic actions is
11617 handled in scan-gram.l.
11619 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
11621 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
11623 * src/location.h (struct): The file member is a uniqstr.
11624 (equal_boundaries): Use UNIQSTR_EQ for comparison.
11626 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
11628 Fix bug with non-%union parsers that have printers or destructors,
11629 which led to a Bison core dump. Reported by Peter Fales in
11630 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
11632 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
11633 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
11634 not to our own type.
11635 * src/output.c (symbol_destructors_output, symbol_printers_output):
11636 Don't assume %union.
11637 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
11638 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
11639 UNION-FLAG. All callers changed.
11640 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
11641 Use type char, not unsigned int, when declaring an array of char;
11642 this lets us remove a cast.
11643 (Printers and Destructors): Add non-%union test cases.
11645 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11647 * doc/bison.texinfo: Minor editorial changes, mostly to the new
11648 GLR writeups. E.g., avoid frenchspacing and the future tense,
11649 change "lookahead" to "look-ahead", and change "wrt" to "with
11652 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11654 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
11655 New sections, split off from the GLR Parsers section. Put the new
11656 Simple GLR Parser near the start of the GLR section, for clarity.
11657 Rewrite connective text.
11659 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
11661 * doc/bison.texinfo (Simple GLR Parsers): New section.
11663 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11665 * NEWS, TODO, doc/bison.texinfo:
11666 Use "look-ahead" instead of "lookahead", to be consistent.
11667 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
11668 while we're fixing "look-ahead".
11669 * src/conflicts.c (shift_set): Renamed from shiftset.
11670 (look_ahead_set): Renamed from lookaheadset.
11671 * src/print.c: Likewise.
11672 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
11673 name for "lookahead".
11674 (report_types, usage): Likewise.
11675 * src/getargs.h (report_look_ahead_tokens): Renamed from
11677 * src/lalr.c (compute_look_ahead_tokens): Renamed from
11678 compute_lookaheads.
11679 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
11680 (look_ahead_tokens_print): Renamed from lookaheads_print.
11681 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
11682 state_rule_lookaheads_print.
11683 * src/state.h: Likewise.
11684 (reductions.look_ahead_tokens): Renamed from lookaheads.
11685 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
11686 AT_DATA_LOOKAHEADS_GRAMMAR.
11688 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
11690 * README: Update location of patched M4 distribution.
11692 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
11694 Don't assume the C++ compiler takes the same arguments as the C compiler
11696 * configure.ac (O0CXXFLAGS): New var.
11697 * tests/atlocal.in (CXXFLAGS): Use it.
11699 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
11701 Fix some "make check" problems with C++ reported by
11702 Albert Chin-A-Young for Tru64 C++ in this thread:
11703 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
11705 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
11706 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11707 Output to a .cc file for C++, not to a .c file.
11708 * tests/calc.at (AT_CHECK_CALC): Likewise.
11709 * tests/regression.at (AT_CHECK_DANCER): Likewise.
11710 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
11712 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
11714 * tests/calc.at, tests/actions.at: Workaround for SGI
11715 C++ compiler. (trivial change)
11717 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
11719 Spent a few hours checking out which prerequisite versions the
11720 current sources actually require. I went all the way back to
11721 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
11722 a seemingly endless set of combinations of versions more recent
11723 than that. The bottom line is that the current sources require
11724 fairly recent versions of the build tools, and it'll be some work
11726 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
11727 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
11728 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
11729 Add comments explaining why those particular versions are
11732 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
11733 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
11734 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
11736 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
11737 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
11739 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
11741 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
11742 0.11.5. Suggested by Bruno Haible.
11743 * bootstrap: Remove gettext version checking.
11745 * doc/bison.texinfo (Decl Summary): Also mention that %union
11746 can depend on prerequisite types. Problem reported by Tim
11749 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
11751 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
11752 * README-alpha: Don't tell people not to package this.
11754 * bootstrap: Don't assume $(...) works; use `...` instead.
11755 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
11758 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
11759 put into the -d output file, and mention what to do if YYSTYPE is
11760 defined as a macro.
11762 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
11764 Undo change made earlier today: it caused autopoint to not bring
11765 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
11768 * bootstrap: Check that gettext version matches what's in
11769 configure.ac. Warn users to ignore robots.txt ERROR 404.
11770 * bootstrap: Undo today's earlier change (logged below).
11771 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
11773 The gettext version checking is causing more trouble than it's
11774 curing; remove it. Problem reported by Paul Hilfinger.
11776 * bootstrap: Issue a warning that one can expect a message
11777 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
11778 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
11780 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
11782 Ensure that the C++ compiler used for testing actually works on a
11783 simple test program; if not, skip the C++-related tests. Problem
11784 reported by Vin Shelton in:
11785 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
11787 * m4/cxx.m4: New file.
11788 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
11789 * tests/atlocal.in (BISON_CXX_WORKS): Add.
11790 * tests/local.at (AT_COMPILE_CXX): Use it.
11792 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11794 * data/glr.c (yylloc): Output this macro even if locations are not
11795 being generated, as the GLR parser needs it even in that case.
11796 Problem reported by Troy A. Johnson
11797 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
11799 * configure.ac (AC_INIT): Update to 1.875e.
11801 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11803 * NEWS: Version 1.875d.
11804 * configure.ac (AC_INIT): Likewise.
11805 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
11807 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
11808 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
11809 lalr1.cc runs afoul of the first, and the last two are no longer
11810 supported by GCC 3.4.0.
11811 * README: Mention GNU m4 1.4 or later; mention m4 patches.
11812 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
11814 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
11816 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
11817 unsigned int, for compatibility with latest gnulib hash module.
11818 * src/state.c (state_hash, state_hasher): Likewise.
11819 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
11820 * src/uniqstr.c (hash_uniqstr): Likewise.
11822 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
11824 * NEWS: Unescaped newlines are no longer allowed in char & strings.
11826 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
11827 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
11828 character and string literals.
11829 (unexpected_end): New function.
11830 (unexpected_eof): Use it.
11831 (unexpected_newline): New function.
11832 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
11835 * NEWS: Document %expect-rr.
11837 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
11838 Fix typo by replacing $1 with $option.
11839 Remove more 'intl'-related files.
11840 Don't DEFUN AM_INTL_SUBDIR twice.
11842 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
11843 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
11845 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
11846 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
11847 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
11848 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
11849 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
11850 * src/.cvsignore: Add *.output.
11852 * src/parse-gram.y: Put copyright notice inside %{ %} so it
11853 gets copied to the output file.
11855 2004-04-28 Paul Eggert <eggert@twinsun.com>
11857 Get files from the gnulib and po repositories, instead of relying
11858 on them being in our CVS. Upgrade to latest versions of gnulib
11861 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
11862 * bootstrap: Bootstrap from gnulib and po repositories.
11863 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
11864 * README-cvs: Document these changes. Remove version numbers from
11865 mentions of build tools, since they change so often. Mention Flex.
11867 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
11868 (gl_USE_SYSTEM_EXTENSIONS): Add.
11869 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
11870 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
11872 (AC_ISC_POSIX): Remove; we no longer support this
11873 ancient OS, as it gets in the way of latest Autoconf & gnulib.
11874 (AC_HEADER_STDC): Remove: we now assume C89 or better.
11875 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
11876 Do not check for C89 headers, except for locale.h which is used
11877 by the Yacc library and must port to K&R hosts.
11878 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
11879 Do not check for C89 functions, except for setlocale which is
11880 used by the Yacc library.
11881 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
11882 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
11883 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
11884 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
11885 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
11886 AM_GNU_GETTEXT): Remove; now done by:
11887 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
11888 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
11891 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
11892 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
11893 Define to empty, as gnulib.mk will do the rest for us.
11894 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
11896 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
11897 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
11899 * src/files.c: Include gnulib's xstrndup.h.
11901 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
11902 (REALLOC): Use xnrealloc, for likewise.
11903 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
11904 (strnlen, memrchr): Remove decls; functions no longer used.
11905 Include <stpcpy.h>.
11907 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
11908 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
11909 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
11910 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
11911 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
11912 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
11913 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
11914 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
11915 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
11916 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
11917 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
11918 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11919 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
11920 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
11921 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
11922 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
11923 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
11924 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
11925 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
11926 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
11927 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
11928 Remove, as these files are now generated automatically
11929 by bootstrap or automake.
11931 * po/ChangeLog: Remove: all but one entry was a duplicate
11932 of this file, and I moved that 2000-11-02 entry here.
11934 * config/.cvsignore: Add Makefile, depcomp, install-sh.
11935 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
11936 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
11937 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
11938 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
11939 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
11940 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
11941 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
11942 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
11943 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
11944 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
11946 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
11947 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
11948 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
11949 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
11950 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
11951 * src/.cvsignore: Remove *_.c.
11954 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
11955 support it. (The latest stable gzip doesn't.)
11957 2004-04-27 Paul Eggert <eggert@twinsun.com>
11959 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
11960 case, as stos_ is now used by destructors due to the 2004-02-09
11963 Remove more K&R C support.
11964 * lib/libiberty.y (PARAMS): Remove. All uses removed.
11965 * lib/subpipe.c (errno): Remove decl.
11966 Include <stdlib.h> unconditionally.
11967 (EXIT_FAILURE): Remove macro.
11968 * src/complain.c (vfprintf, strerror): Remove.
11969 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
11971 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
11972 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
11973 (strchr, strspn, memchr): Remove decls.
11974 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
11975 unconditionally. Do not declare perror.
11976 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
11979 * src/complain.c (_): Remove useless defn, as system.h defines this.
11981 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
11982 with latest obstack.h.
11983 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
11984 to procedure types, as obstack.h now does that for us.
11985 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
11987 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
11988 so that this include file can stand alone.
11989 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
11990 does this now. Include subpipe.h first after config.h, to
11991 test whether it can stand alone.
11993 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
11994 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
11995 unused declaration.
11997 * tests/synclines.at (%union synch line): Put a dummy member in
11998 the union, because empty unions aren't allowed in C. Caught
12001 2004-04-13 Jim Meyering <jim@meyering.net>
12003 * src/conflicts.c (conflicts_print): Correct format string typo:
12004 use `%%' to produce literal `%'. (trivial change)
12006 2004-03-30 Paul Eggert <eggert@twinsun.com>
12008 * src/getargs.c (version): Update copyright year to 2004.
12010 * data/c.m4 (b4_int_type): Use 'short int' rather than
12011 'short', and similarly for 'long', 'unsigned', etc.
12012 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
12013 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
12014 yy_yypstack, yydumpstack): Likewise.
12015 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
12016 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
12018 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
12019 yy_stack_print, yyparse): Likewise.
12020 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
12021 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
12022 * lib/bitset.c (bitset_print): Likewise.
12023 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
12024 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12025 * lib/bitsetv.c (bitsetv_dump): Likewise.
12026 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
12027 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
12029 * src/LR0.c (allocate_itemsets): Likewise.
12030 * src/gram.h (rule_number, rule): Likewise.
12031 * src/lalr.h (goto_number): Likewise.
12032 * src/nullable.c (nullable_compute): Likewise.
12033 * src/output.c (prepare_rules): Likewise.
12034 * src/relation.c (relation_print, relation_digraph): Likewise.
12035 * src/relation.h (relation_node): Likewise.
12036 * src/state.h (state_number, transitions, errs, reductions,
12037 struct state): Likewise.
12038 * src/symtab.h (symbol_number, struct symbol): Likewise.
12039 * src/tables.c (vector_number, tally, action_number,
12040 default_goto, goto_actions): Likewise.
12041 * tests/existing.at (GNU Cim Grammar): Likewise.
12042 * tests/regression.at (Web2c Actions): Likewise.
12044 * src/output.c (muscle_insert_short_int_table): Renamed from
12045 muscle_insert_short_table. All uses changed.
12047 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
12049 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
12050 (declaration): Replace expected_conflicts with expected_sr_conflicts.
12051 Add %expect-rr rule.
12053 * src/scan-gram.l: Recognize %expect-rr.
12055 * src/conflicts.h (expected_sr_conflicts): Rename from
12056 expected_conflicts.
12057 (expected_rr_conflicts): Declare.
12059 * src/conflicts.c (expected_sr_conflicts): Rename from
12060 expected_conflicts.
12061 (expected_rr_conflicts): Define.
12062 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
12064 Use expected_sr_conflicts in place of expected_conflicts.
12065 Warn if expected_rr_conflicts used in non-GLR parser.
12067 * doc/bison.texinfo: Add documentation for %expect-rr.
12069 2004-03-08 Paul Eggert <eggert@gnu.org>
12071 Add support for hex token numbers. Suggested by Odd Arild Olsen in
12072 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
12074 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
12076 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
12077 * src/scan-gram.l (scan_integer): New function.
12079 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
12080 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
12081 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
12082 Say "long int", not "long", for uniformity with GNU style.
12084 2004-02-25 Paul Eggert <eggert@twinsun.com>
12086 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
12087 compilers. This fixes a problem with Intel's C++ compiler being
12088 chatty, reported by Guido Trentalancia in
12089 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
12091 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
12093 Support %destructor and merge error locations in lalr1.cc.
12095 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
12096 (Parser::stos_): Define unconditionally.
12097 (Parser::destruct_): New method. Generate its body with
12098 b4_yydestruct_generate.
12099 (Parser::error_start_): New attribute.
12100 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
12101 token which are discarded.
12102 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
12103 error_start_ when erroneous token are discarded.
12104 (Parser::parse) <yyerrlab1>: Compute the location of the error
12105 token so that it covers all the discarded tokens.
12106 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
12107 it can be called with `%skeleton "lalr1.cc"', and do that.
12109 2004-02-02 Paul Eggert <eggert@twinsun.com>
12111 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
12112 $(top_srcdir)/lib and ../lib. This fixes a bug reported
12113 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
12114 There's no need to mention top_builddir since Automake does that
12116 (INCLUDES): Remove, as Automake says it's obsolescent.
12117 Contents migrated into AM_CPPFLAGS as described above.
12118 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
12120 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12122 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
12123 (yyreportSyntaxError): Handle case where lookahead token is
12126 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12128 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
12129 resulting parsers are compilable with C++.
12131 2003-12-23 Paul Eggert <eggert@twinsun.com>
12133 * config/depcomp, config/install-sh: Sync with Automake 1.8.
12134 * src/output.c (output_skeleton): Rename local var.
12135 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
12136 Bison tokens, as this runs afoul of the 2003-10-07 change that
12137 disallowed NUL bytes in character constants or string literals.
12139 * tests/local.at: Require Autoconf 2.59's Autotest.
12140 * tests/testsuite.at: Don't include local.at, since we now assume
12141 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
12143 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
12144 multiple inclusion warnings.
12146 2003-12-02 Akim Demaille <akim@epita.fr>
12148 * doc/bison.texinfo (How Can I Reset the Parser): More about start
12152 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
12154 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
12156 2003-10-07 Paul Eggert <eggert@twinsun.com>
12158 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
12159 if testsuite doesn't exist.
12161 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
12162 literals, unfortunately.
12163 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
12164 Complain about NUL bytes in character constants or string literals.
12166 2003-10-05 Paul Eggert <eggert@twinsun.com>
12168 * NEWS: Don't document %no-default-prec, as it's still
12170 * doc/bison.texinfo: Document %no-default-prec only if
12171 the defaultprec flag is set. Normally it's not.
12173 2003-10-04 Paul Eggert <eggert@twinsun.com>
12175 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
12176 non-modifiable lvalue, instead of a modifiable one.
12177 * doc/bison.texinfo (Actions): Document that $$ can
12178 be assigned to. Do not claim that $$ and $N are
12179 array element references: user code should not rely on this.
12181 2003-10-01 Paul Eggert <eggert@twinsun.com>
12183 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
12184 (grammar_declaration): Use it.
12185 * src/scan-gram.l: New token %no-default-prec.
12186 * tests/conflicts.at: Revamp tests to use %no-default-prec.
12187 * NEWS, doc/bison.texinfo: Document the above.
12189 2003-10-01 Akim Demaille <akim@epita.fr>
12191 VCG no longer supports long_straight_phase.
12193 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
12194 * src/print_graph.c (print_graph): Adjust.
12196 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
12197 and Paul Eggert <eggert@twinsun.com>
12199 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
12200 Table of Symbols): Document %default-prec.
12201 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
12202 (grammar_declaration): Set default_prec on %default-prec.
12203 * src/scan-gram.l (%default-prec): New token.
12204 * src/reader.h (default_prec): New flag.
12205 * src/reader.c: Likewise.
12206 (packgram): Handle it.
12207 * tests/conflicts.at (%default-prec without %prec,
12208 %default-prec with %prec, %default-prec 1): New tests.
12210 2003-09-30 Paul Eggert <eggert@twinsun.com>
12212 * tests/testsuite.at: Include local.at, not input.at, fixing
12213 a typo in the 2003-08-25 patch.
12215 2003-08-27 Akim Demaille <akim@epita.fr>
12217 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
12220 2003-08-26 Akim Demaille <akim@epita.fr>
12222 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
12223 "<\#" to avoid magic from Gnus when posting parts of this script.
12225 2003-08-26 Akim Demaille <akim@epita.fr>
12227 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
12228 (Parser::parse): here.
12229 Adjust: nerrs and errstatus is now replaced by...
12230 (Parser::nerrs_, Parser::errstatus_): New.
12232 2003-08-25 Akim Demaille <akim@epita.fr>
12234 * config/announce-gen, Makefile.cfg: New.
12235 * Makefile.am: Adjust.
12236 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
12237 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
12239 2003-08-25 Akim Demaille <akim@epita.fr>
12241 When reducing initial empty rules, Bison parser read an initial
12242 location that is not defined. This results in garbage, and that
12243 affects Bison's own parser. Therefore we need (i) to extend Bison
12244 to support a means to initialize this location, and (ii) to use
12245 this CVS Bison to fix CVS Bison's parser.
12247 * src/reader.h, reader.c (epilogue_augment): Remove, replace
12249 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
12250 * src/parse-gram.y: Adjust.
12251 (%initial-action): New.
12252 (%error-verbose): Since we require CVS Bison, there is no reason
12254 * src/scan-gram.l: Adjust.
12255 * src/Makefile.am (YACC): New, to make sure we use our own parser.
12256 * data/yacc.c (yyparse): Use b4_initial_action.
12258 2003-08-25 Akim Demaille <akim@epita.fr>
12260 * doc/bison.texinfo: Don't promote stdout for error messages.
12262 2003-08-25 Akim Demaille <akim@epita.fr>
12264 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
12265 From Alexandre Duret-Lutz.
12267 2003-08-25 Akim Demaille <akim@epita.fr>
12271 2003-08-25 Akim Demaille <akim@epita.fr>
12273 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
12276 2003-08-25 Akim Demaille <akim@epita.fr>
12278 * data/lalr1.cc (Parser::reduce_print_): New.
12281 2003-08-25 Akim Demaille <akim@epita.fr>
12283 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
12284 error recovery loops. This patch is based on
12285 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
12286 Also, augment the similarity between lalr1.cc and yacc.c.
12287 Note: the locations of error recovery rules are not correct yet.
12289 * data/lalr1.cc: Comment changes to augment the similarity between
12290 lalr1.cc and yacc.c.
12291 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
12292 (yyerrlab1): Remove, but where it used to be (now the bottom part of
12293 yyerrlab), when hitting EOF, pop the whole stack here instead of
12294 merely falling thru the default error handling mechanism.
12295 (yyerrorlab): New label, with the old contents of YYERROR,
12296 plus the following change: pop the stack of rhs corresponding
12297 to the production that invoked YYERROR. That is how Yacc
12298 behaves (required by POSIX).
12299 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
12302 2003-08-25 Akim Demaille <akim@epita.fr>
12304 Tune local.at so that people can "autom4te -l autotest calc.at -o
12305 calc" for instance, to extract a sub test suite.
12307 * tests/testsuite.at: Move the initialization, Autotest version
12308 requirement, and AT_TESTED invocation into...
12309 * tests/local.at: here.
12310 * tests/testsuite.at: Include it for compatibility with Autoconf
12312 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
12315 2003-08-04 Paul Eggert <eggert@twinsun.com>
12317 Rework code slightly to avoid gcc -Wtraditional warnings.
12318 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
12319 The returned value is now stored in *YY0. All callers changed.
12320 * src/output.c (merge_output): Adjust to the above change.
12322 2003-07-26 Paul Eggert <eggert@twinsun.com>
12324 * data/glr.c (YYASSERT): New macro.
12325 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
12326 yyresolveStates, yyprocessOneStack):
12327 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
12328 Derived from a suggestion by Frank Heckenbach.
12330 2003-07-25 Paul Eggert <eggert@twinsun.com>
12332 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
12333 for portability to K&R C (after ansi2knr, presumably). See
12334 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
12335 by Frank Heckenbach, though I have omitted the structure-initialization
12336 part of his glr-knr.diff patch since I recall that the Portable
12337 C Compiler didn't require that change.
12339 Let the user specify how to allocate and free memory.
12340 Derived from a suggestion by Frank Heckenbach in
12341 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
12342 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
12343 All uses of free, malloc, realloc changed to use these macros,
12344 and unnecessary casts removed.
12345 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
12347 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
12349 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
12350 use s.empty() rather than s == "" to test for empty string; see
12351 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
12354 2003-06-25 Akim Demaille <akim@epita.fr>
12356 * config/depcomp, config/install-sh: Update from masters.
12358 2003-06-20 Paul Eggert <eggert@twinsun.com>
12360 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
12361 and return properly parenthesized result.
12362 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
12363 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
12364 Remove unnecessary parentheses from uses.
12365 * doc/bison.texinfo (Location Default Action): Describe the
12366 conventions for parentheses.
12368 2003-06-19 Paul Eggert <eggert@twinsun.com>
12370 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
12371 yyreportTree): Do not assume that size_t is the same width as int,
12372 when printing sizes. Print sizes using an unsigned format.
12373 Problem reported by Frank Heckenbach in
12374 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
12376 Port to Forte Developer 7 C compiler.
12377 * data/glr.c (struct YYLTYPE): If locations are not being used,
12378 declare a single dummy member, as empty structs do not conform
12380 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
12381 the Forte Developer 7 C compiler complains that end-of-loop
12382 code is not reached.
12384 2003-06-17 Paul Eggert <eggert@twinsun.com>
12386 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
12387 avoid warnings from picky compilers about redefinition of PARAMS.
12389 2003-06-17 Paul Eggert <eggert@twinsun.com>
12393 * NEWS: Document 1.875b.
12395 * lib/bbitset.h: Do not include config.h; that's the includer's job.
12396 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
12397 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
12398 Don't use 'index' in comments, as it's a builtin fn on some hosts.
12399 * lib/bitset_stats.c: Include gettext.h unconditionally, as
12400 per recent gettext manual's suggestion.
12401 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
12402 Use prototypes, not old-style definitions.
12403 * lib/lbitset.c (lbitset_unused_clear): Likewise.
12404 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
12405 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
12406 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
12407 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
12408 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
12409 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
12410 vbitset_or_and_cmp, vbitset_copy): Likewise.
12412 * lib/libiberty.h: Do not include config.h; that's the includer's job.
12413 Do not include <stdlib.h>.
12414 (PARAMS): Define unconditionally for C89.
12415 (ATTRIBUTE_NORETURN): Remove.
12416 (ATTRIBUTE_UNUSED): Define unconditionally.
12418 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
12419 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
12420 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
12421 * lib/vbitset.c, lib/vbitset.h: New files.
12422 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
12423 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
12426 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
12427 `How Can I Reset @code{yyparse}', since texinfo does not allow
12428 arbitrary @ in node names.
12430 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
12431 shouldn't be needed according to the gettext 0.12.1 documentation
12432 but which seem to be needed anyway: codeset.m4 glibc21.m4
12433 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
12434 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
12435 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
12437 * lib/.cvsignore: Add stdbool.h.
12438 * m4/.cvsignore: Add nls.m4, po.m4.
12440 Upgrade to CVS gnulib.
12441 * stdbool_.h: File renamed from stdbool.h.in.
12442 * configure.ac (AM_STDBOOL_H): Invoke this instead of
12444 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
12445 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
12446 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
12447 (MOSTLYCLEANFILES): New var.
12448 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
12449 (stdbool.h): New rule.
12450 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
12451 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
12452 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
12453 m4/quote.m4: Upgrade to today's gnulib.
12455 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
12456 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
12457 the tests right now.
12458 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
12459 yyerror are declared before use; C99 requires this.
12461 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12463 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
12465 (yyrecoverSyntaxError): Correct the logic for setting and testing
12467 Correct comment on handling EOF.
12468 Allow states with only a default reduction, rather than failing
12469 (I can't quite reconstruct why these were not allowed before).
12471 Fixes to avoid problem that $-N rules in GLR parsers can cause
12472 buffer overruns, corrupting state.
12474 * src/output.c (prepare_rules): Output max_left_semantic_context
12476 * src/reader.h (max_left_semantic_context): New variable declaration.
12477 * src/scan-gram.l (max_left_semantic_context): Define.
12478 (handle_action_dollar): Update max_left_semantic_context.
12479 * data/glr.c (YYMAXLEFT): New definition.
12480 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
12481 (yyresolveAction): Ditto.
12483 Fixes to problems with location handling in GLR parsers reported by
12484 Frank Heckenbach (2003/06/05).
12486 * data/glr.c (YYLTYPE): Make trivial if locations not used.
12487 (YYRHSLOC): Add parentheses, and define only if locations used.
12488 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
12489 locations not used.
12490 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
12491 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
12493 * tests/cxx-type.at: Exercise location information; update tests
12494 to differentiate output with and without locations.
12495 Remove forward declarations of yylex and yyerror---caused errors
12496 because default YYLTYPE not yet defined.
12497 Change semantic actions to compute strings, rather than printing
12498 them directly (to test proper passing of semantics values). Change
12499 output to prefix notation and update test data and expected results.
12500 (yylex): Track locations.
12501 (stmtMerge): Return value rather than printing, and include arguments
12504 2003-06-03 Paul Eggert <eggert@twinsun.com>
12506 Avoid warnings generated by GCC 2.95.4 when Bison is
12507 configured with --enable-gcc-warnings.
12508 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
12509 yy::]b4_parser_class_name[::translate_,
12510 yy::Stack::operator[] (unsigned),
12511 yy::Stack::operator[] (unsigned) const,
12512 yy::Slice::operator[] (unsigned),
12513 yy::Slice::operator[] (unsigned) const):
12514 Rename local vars to avoid warnings.
12515 * tests/glr-regression.at (Improper handling of embedded actions
12516 and $-N in GLR parsers): Remove unused local variable from yylex.
12517 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
12518 (void) as arg when not pure, since we now assume C89 when building
12519 Bison. Pacify GCC by using parameter.
12521 2003-06-02 Paul Eggert <eggert@twinsun.com>
12523 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
12524 yy::Location::lines, yy::Location::columns): Rename arguments
12525 to avoid shadowing; this removes a warning generated by GCC 3.3.
12527 2003-06-01 Paul Eggert <eggert@twinsun.com>
12529 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
12530 to g++, as GCC 3.3 complains if you do it.
12531 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
12532 everything that WARNING_CFLAGS has, except omit warnings
12533 not suitable for C++.
12534 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
12535 * tests/atlocal.in (CXXFLAGS): New var.
12536 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
12538 Fix a GLR parser bug I reported in February; see
12539 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
12540 The problem was that GLR parsers did not conform to the C standard,
12541 because actions like { $1 = $2 + $3; } expanded to expressions
12542 that invoked YYFILL in separate subexpressions, and YYFILL assigned
12543 to a local variable. The C standard says that expressions
12544 like (var = f ()) + (var = f ()) have undefined behavior.
12545 Another problem was that GCC sometimes issues warnings that
12546 yyfill and its parameters are unused.
12548 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
12549 as possibly unused.
12550 (yyfill): New function.
12552 (yyuserAction): Change type of yynormal to bool, so that it matches
12553 the new yyfill signature. Mark it as possibly unused.
12556 Follow up on a bug I reported in February, where a Bison-generated
12557 parser can loop. Provide a test case and a fix for yacc.c. I
12558 don't have a fix for lalr1.cc or for glr.c, unfortunately.
12559 The original bug report is in:
12560 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
12562 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
12563 macro's size was becoming unwieldy.
12564 (yyerrlab): Do not discard an empty lookahead symbol, as this
12565 might destroy garbage.
12566 (yyerrorlab): New label, with the old contents of YYERROR,
12567 plus the following change: pop the stack of rhs corresponding
12568 to the production that invoked YYERROR. That is how Yacc
12569 behaves, and POSIX requires this behavior.
12570 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
12571 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
12572 Define 'alarm' to do nothing if unistd.h is not available.
12573 Add a new rule "exp: '-' error;" to test the above change to
12574 data/yacc.c. Use 'alarm' to abort any test taking longer than
12575 10 seconds, as it's probably looping.
12576 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
12577 Also, the new yacc.c generates two fewer diagnostics for an
12580 2003-05-24 Paul Eggert <eggert@twinsun.com>
12582 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
12583 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
12584 This fixes a problem reported by John Bowman when the Compaq/HP
12585 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
12586 -ansi -Wall -gall).
12587 * data/yacc.c (union yyalloc): Likewise.
12588 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
12590 Switch from 'int' to 'bool' where that makes sense.
12592 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
12593 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
12594 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
12595 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
12596 Return or accept bool, not int. All callers changed.
12597 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
12598 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
12599 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
12600 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
12601 bitset_or_and_cmp_): Likewise.
12602 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
12603 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
12604 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
12605 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
12606 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
12607 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
12608 bitset_stats_or_and_cmp): Likewise.
12609 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
12610 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
12611 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
12612 ebitset_xor_cmp): Likewise.
12613 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
12614 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
12615 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
12616 lbitset_xor_cmp): Likewise.
12617 * lib/bbitset.h: Include <stdbool.h>.
12618 (struct bitset_vtable): The following members now return bool, not
12619 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
12620 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
12622 * src/conflicts.c (count_rr_conflicts): Likewise.
12623 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
12625 * lib/ebitset.c (ebitset_obstack_init): Likewise.
12626 * lib/lbitset.c (lbitset_obstack_init): Likewise.
12627 * src/getargs.c (debug_flag, defines_flag, locations_flag,
12628 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12629 graph_flag): Likewise.
12630 * src/getargs.h (debug_flag, defines_flag, locations_flag,
12631 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12632 graph_flag): Likewise.
12633 * src/output.c (error_verbose): Likewise.
12634 * src/output.h (error_verbose): Likewise.
12635 * src/reader.c (start_flag, typed): Likewise.
12636 * src/reader.h (typed): Likewise.
12637 * src/getargs.c (LOCATIONS_OPTION): New constant.
12638 (long_options, getargs): Use it.
12639 * src/lalr.c (build_relations): Use bool, not int.
12640 * src/nullable.c (nullable_compute): Likewise.
12641 * src/print.c (print_reductions): Likewise.
12642 * src/tables.c (action_row, pack_vector): Likewise.
12643 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
12644 * src/output.c (prepare): Use it.
12645 * src/output.c (token_definitions_output,
12646 symbol_destructors_output, symbol_destructors_output): Use string,
12647 not boolean integer, to keep track of whether to output separator.
12648 * src/print_graph.c (print_core): Likewise.
12649 * src/state.c (state_rule_lookaheads_print): Likewise.
12651 * config/install-sh: Sync from automake 1.7.5.
12653 2003-05-14 Paul Eggert <eggert@twinsun.com>
12655 * src/parse-gram.y (rules_or_grammar_declaration): Require a
12656 semicolon after a grammar declaration, in the interest of possible
12657 future changes to the Bison input language.
12658 Do not allow a stray semicolon at the start of the grammar.
12659 (rhses.1): Allow one or more semicolons after any rule, including
12660 just before "|" as required by POSIX.
12661 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
12664 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
12666 %parse-param support for lalr1.cc.
12668 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
12669 b4_cc_constructor_calls, b4_cc_constructor_call,
12670 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
12672 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
12673 parse-param arguments.
12674 (yy::b4_parser_class_name): Declare instance variables to
12675 hold parse-param arguments.
12676 * tests/calc.at: s/value/semantic_value/ because value clashes
12677 with a member of yy::b4_parser_class_name. Adjust C++ code
12678 to handle %parse-param. Enable %parse-param test in C++.
12680 2003-05-12 Paul Eggert <eggert@twinsun.com>
12682 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
12683 English a bit. Fix fclose typo. Change "const char" to "char
12684 const", and use ANSI C rather than K&R for "main". Suggest
12685 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
12686 and suggest yy_switch_to_buffer.
12688 2003-05-05 Paul Eggert <eggert@twinsun.com>
12690 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
12691 C89. This avoids a diagnostic on compilers that define __STDC__
12692 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
12693 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
12695 2003-05-03 Paul Eggert <eggert@twinsun.com>
12697 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
12698 Do not overrun array bounds.
12699 This should fix a bug reported today by Olatunji Oluwabukunmi in
12700 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
12702 2003-04-29 Akim Demaille <akim@epita.fr>
12704 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
12705 * src/getargs.c, src/getargs.h: here, as bool, not int.
12706 (nondeterministic_parser): New.
12707 * src/parse-gram.y, src/scan-gram.l: Support
12708 %nondeterministic-parser.
12709 * src/output.c (prepare): Use nondeterministic_parser instead
12710 of glr_parser where appropriate.
12711 * src/tables.c (conflict_row, action_row, save_row)
12712 (token_actions, token_actions, pack_vector): Ditto.
12714 2003-04-29 Akim Demaille <akim@epita.fr>
12716 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
12718 2003-04-29 Akim Demaille <akim@epita.fr>
12720 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
12721 with %pure-parser and %locations to exercise the patch from Yakov
12724 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
12726 * data/yacc.c: (b4_lex_param): Corrected for the case where
12727 %lex-param is provided and %pure-parser isn't.
12729 2003-04-27 Paul Eggert <eggert@twinsun.com>
12731 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
12732 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
12733 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
12734 if it is not defined.
12735 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
12737 2003-04-26 Paul Eggert <eggert@twinsun.com>
12739 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
12740 Declare to be of type suitable for the ninf value itself, not of
12741 type suitable for the corresponding table, since the latter might
12742 be unsigned but the ninf value might be negative. This fixes a
12743 bug reported by Alexandre Duret-Lutz in
12744 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
12746 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
12747 invokes it. We shouldn't invoke it twice because it will attempt
12748 to put error.o in the archive twice. This fixes a glitch reported
12749 by Martin Mokrejs in
12750 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
12752 2003-04-21 Paul Eggert <eggert@twinsun.com>
12754 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
12757 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
12759 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
12760 Fix obvious typo that results in uncompilable GLR parsers
12761 when both %pure-parser and %locations are used. (trivial change)
12763 2003-04-17 Paul Eggert <eggert@twinsun.com>
12765 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
12766 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
12767 Do not insert the expected token via unput, as this runs afoul
12768 of a POSIX-compatibility bug in flex 2.5.31.
12769 All uses changed to BEGIN the parent state,
12770 since we no longer insert the expected token via unput.
12771 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
12772 that is no longer emitted after the above change.
12774 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
12775 the first one. This change is from Paul Hilfinger, and it fixes
12776 regression reported by Werner Lemberg in
12777 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
12779 (resolve_sr_conflict): Don't invoke state_errs_set
12780 unless one or more tokens have been explicitly made errors.
12781 Otherwise, the above change causes Bison to abort.
12783 * tests/existing.at (GNU pic Grammar): New test case, taken from
12786 2003-03-31 Akim Demaille <akim@epita.fr>
12788 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
12790 2003-03-31 Akim Demaille <akim@epita.fr>
12792 * src/output.c (prepare_symbols): Avoid trailing spaces in the
12795 2003-03-31 Akim Demaille <akim@epita.fr>
12797 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
12798 From Paul Hilfinger.
12800 2003-03-29 Akim Demaille <akim@epita.fr>
12802 * m4/error.m4: Do not put under dynamic conditions some code which
12803 expansion is under static control.
12805 2003-03-29 Akim Demaille <akim@epita.fr>
12807 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
12809 2003-03-29 Akim Demaille <akim@epita.fr>
12811 * doc/bison.texinfo (Strings are Destroyed): New.
12813 2003-03-13 Paul Eggert <eggert@twinsun.com>
12815 * .cvsignore: Add configure.lineno.
12816 * src/.cvsignore: Add yacc.
12817 * tests/.cvsignore: Add testsuite.log.
12818 * doc/fdl.texi: Sync with latest FSF version.
12820 2003-03-12 Paul Eggert <eggert@twinsun.com>
12822 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
12823 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
12824 cursor, instead of leaving it undefined. This fixes a bug
12825 reported by Tim Van Holder in
12826 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
12827 * tests/input.at (Torturing the Scanner): Test the scanner on
12828 an empty input file, which was Tim Van Holder's test case.
12830 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
12831 <sys/resource.h> can be included, include sys/time.h and
12832 sys/times.h first, if available. This works around the SunOS
12833 4.1.4 porting bug reported by Bruce Becker in
12834 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
12836 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
12837 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
12838 AC_HEADER_SYS_WAIT.
12840 Merge changes from gnulib. This was prompted because the CVS
12841 snapshot didn't build on Solaris 7 due to strnlen problems.
12843 These changes need to be merged back into gnulib:
12844 * lib/hash.c: Include <stdbool.h> unconditionally.
12845 * m4/onceonly.m4 (m4_quote): New macro.
12846 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
12847 Quote AC_FOREACH variable-expansions properly.
12848 The 2003-01-03 obstack.h change also needs merging.
12849 {end of changes requiring merging}
12851 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
12852 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
12853 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
12854 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
12855 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
12856 New files, imported from gnulib.
12857 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
12860 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
12861 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
12864 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
12866 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
12867 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
12868 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
12869 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
12870 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
12871 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
12872 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
12873 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
12874 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
12875 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
12876 (jm_PREREQ_ARGMATCH): Remove.
12877 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
12878 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
12880 * src/system.h: Include <stdbool.h> unconditionally.
12882 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
12883 assuming at least C89 in the bitset code for some time now.
12885 2003-03-03 Akim Demaille <akim@epita.fr>
12889 2003-03-02 Akim Demaille <akim@epita.fr>
12891 * doc/bison.texinfo (Table of Symbols): Reactivate the
12892 documentation for %lex-param, and %parse-param.
12894 2003-03-02 Akim Demaille <akim@epita.fr>
12896 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
12897 generate verbose error messages.
12898 Use the number of tokens as an upper bound in yytname, as it
12899 cannot be a non terminal.
12901 2003-03-02 Akim Demaille <akim@epita.fr>
12903 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
12906 2003-03-02 Akim Demaille <akim@epita.fr>
12908 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
12909 Use them to exercise yycheck overrun.
12910 Based on Andrew Suffield's grammar.
12912 2003-03-02 Akim Demaille <akim@epita.fr>
12914 Create tests/local.at for Bison generic testing macros.
12916 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
12917 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
12919 * tests/calc.at (AT_CHECK_CALC): Adjust.
12920 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
12921 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
12922 * tests/local.at: here.
12923 (AT_COMPILE_CXX): Tags the tests using it as c++.
12924 Ignore the test if CXX is not functional.
12926 2003-03-01 Paul Eggert <eggert@twinsun.com>
12928 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
12929 not loc->end, since loc->end might contain garbage and this leads
12930 to undefined behavior on some platforms.
12931 (id_loc, token_start): Use (IF_LINTed) initial values that do not
12932 depend on *loc, so that the reader doesn't give the the false
12933 impression that *loc is initialized.
12934 (<INITIAL>"%%"): Do not bother setting code_start, since its value
12935 does not survive the return.
12937 2003-03-01 Akim Demaille <akim@epita.fr>
12939 * src/scan-gram.l (code_start): Always initialize it when entering
12940 into yylex, as SC_EPILOGUE is activated *before* the corresponding
12941 yylex invocation. An alternative would be making it static, but
12942 then it starts with the second %%'s beginning, instead of its end.
12944 2003-02-28 Paul Eggert <eggert@twinsun.com>
12946 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
12947 around a UnixWare 7.1.1 porting bug reported by John Hughes in
12948 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
12950 2003-02-26 Paul Eggert <eggert@twinsun.com>
12952 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
12953 Remove Sequent/Pyramid discussion (nobody uses them any more).
12954 Merge VMS and MS-DOS discussion; these ports may well be dead
12955 but let's keep mentioning them for now. Put <> around email
12956 addresses. Add copyright notice.
12958 2003-02-24 Paul Eggert <eggert@twinsun.com>
12960 * data/glr.c (yy_reduce_print): yylineno -> yylno,
12961 to avoid collision with flex use of yylineno.
12962 Problem reported by Bruce Lilly in
12963 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
12964 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
12965 * data/yacc.c (yy_reduce_print): Likewise.
12967 * config/depcomp: Sync with Automake 1.7.3.
12969 2003-02-21 Akim Demaille <akim@epita.fr>
12971 * data/lalr1.cc: Use temporary variables instead of casts to
12972 change integer types.
12973 Suggested by Paul Eggert.
12975 2003-02-21 Akim Demaille <akim@epita.fr>
12977 * doc/bison.texinfo: Use "location" consistently to refer to @n,
12978 to avoid confusions with lalr1.cc's notion of Position.
12979 Suggested by Paul Eggert.
12981 2003-02-20 Akim Demaille <akim@epita.fr>
12983 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
12984 before initial_columns.
12985 (location.hh): Use consistent variable names when defining the
12987 Use "last" so that we subtract from Positions, not from unsigned.
12989 2003-02-20 Akim Demaille <akim@epita.fr>
12991 * data/lalr1.cc (position.hh): New subfile, including the extended
12992 and Doxygen'ed documentation of class Position.
12993 (location.hh): Use it.
12994 Document a` la Doxygen.
12995 With the help of Benoit Perrot.
12997 2003-02-20 Akim Demaille <akim@epita.fr>
12999 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
13001 Redefine AT_YYERROR_SEES_LOC_IF using it.
13002 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
13004 Don't use the location in yy::Parser::error_ and
13005 yy::Parser::print_ when not %locations.
13006 Activate more lalr1.cc tests.
13008 2003-02-19 Akim Demaille <akim@epita.fr>
13010 * data/lalr1.cc: When displaying a line number, be sure to make it
13013 2003-02-19 Akim Demaille <akim@epita.fr>
13015 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
13017 (YYABORT, YYACCEPT, YYERROR): New.
13018 * tests/calc.at: Renable the lalr1.cc test.
13020 2003-02-19 Akim Demaille <akim@epita.fr>
13022 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
13023 error recovery, mixing with/without pops and discarding of the
13026 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
13028 2003-02-17 Paul Eggert <eggert@twinsun.com>
13030 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
13031 * tests/testsuite.at (AT_COMPILE): Use them.
13032 This fixes the testsuite problem reported by Robert Lentz in
13033 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
13035 2003-02-12 Paul Eggert <eggert@twinsun.com>
13037 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
13038 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
13039 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
13040 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
13041 Check for malloc failure, for consistency with yacc.c.
13042 (yytname_size): Remove, for consistency with yacc.c.
13044 The bug still remains in data/lalr1.cc, as I didn't have time
13047 2003-02-06 Akim Demaille <akim@epita.fr>
13049 * configure.ac (GXX): Rename as...
13050 (CXX): this, to keep the original Autoconf semantics.
13052 * data/lalr1.cc: Fix b4_copyright invocations.
13053 If YYDEBUG is not defined, don't depend upon name_ being defined.
13054 (location.hh): Include string and iostream.
13055 (Position::filename): New member.
13056 (Position::Position ()): New.
13057 (operator<< (Position)): New.
13058 (operator- (Position, int)): New.
13059 (Location::first, Location::last): Rename as...
13060 (Location::begin, Location::end): these, to mock the conventional
13062 (operator<< (Location)): New.
13063 * tests/atlocal.in (CXX): New.
13064 * tests/testsuite.at (AT_COMPILE_CXX): New.
13065 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
13066 locations in a more synthetic way.
13067 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
13069 Adjust the C locations to match those from Emacs: first column is
13071 Change all the expected results.
13072 Conform to the GCS: simplify the locations when applicable.
13073 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
13074 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
13075 these CPP macros with the m4 macros new defined by...
13076 (AT_CHECK_PUSHDEFS): this, i.e.:
13077 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
13078 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
13080 (AT_CHECK_POPDEFS): Undefine them.
13081 (AT_CHECK_CALC_LALR1_CC): New.
13082 Use it for the first lalr1.cc test.
13084 2003-02-04 Akim Demaille <akim@epita.fr>
13086 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
13087 Location as is defined.
13089 2003-02-04 Akim Demaille <akim@epita.fr>
13091 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
13092 name_ being defined.
13094 2003-02-03 Paul Eggert <eggert@twinsun.com>
13096 * src/gram.h (start_symbol): Remove unused decl.
13098 Use more-consistent naming conventions for local vars.
13100 * src/derives.c (derives_compute): Change type of local var from
13101 int to rule_number.
13102 * src/gram.c (grammar_rules_partial_print): Likewise.
13103 * src/print.c (print_core): Likewise.
13104 * src/reduce.c (reduce_grammar_tables): Likewise.
13106 * src/gram.c (grammar_dump): Change name of item_number *
13107 local var from r to rp.
13108 * src/nullable.c (nullable_compute): Likewise.
13110 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
13112 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
13113 for symbol or symbol_number var.
13114 * src/reader.c (grammar_start_symbol_set): Likewise.
13115 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
13117 * src/state.c (transitions_to): Likewise.
13118 * src/state.h: Likewise.
13119 * src/tables.c (symbol_number_to_vector_number): Likewise.
13121 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
13124 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
13127 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
13130 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
13131 Use str, not s, for char * var. Use ch, not c, for character var.
13132 Use size for size var.
13134 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
13136 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
13138 * src/uniqstr.h: Likewise.
13140 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
13141 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
13142 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
13143 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
13144 param to have same name as that of enum, so that we don't use
13145 "s" to stand for a non-state.
13147 2003-02-02 Akim Demaille <akim@epita.fr>
13149 * src/scan-skel.l: Scan more than one inert character per yylex
13152 2003-02-01 Paul Eggert <eggert@twinsun.com>
13156 * po/LINGUAS: Add ms.
13158 2003-01-30 Akim Demaille <akim@epita.fr>
13160 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
13162 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13164 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
13167 Changes in response to error report by S. Eken: GLR mode does not
13168 handle negative $ indices or $ indices in embedded rules correctly.
13169 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
13171 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
13172 (b4_rhs_location): Ditto.
13173 (yyfill): New function to copy from stack tree into array
13175 (yyuserAction): Modify to allow incremental move of semantic values
13176 to rhs array when in GLR mode.
13177 Define YYFILL to use in user-defined actions to fill semantic array
13179 Remove dummy use of yystack, as there is now a guaranteed use.
13180 (yydoAction): Modify to allow incremental move of semantic values
13181 to rhs array when in GLR mode.
13182 (yyresolveAction): Ditto.
13183 (yyglrShiftDefer): Update comment.
13184 (yyresolveStates): Use X == NULL for pointers, not !X.
13185 (yyglrReduce): Ditto.
13186 (yydoAction): Ditto
13188 * tests/glr-regr1.at: Rename to ...
13189 * tests/glr-regression.at: Add new regression test for the problems
13190 described above (adapted from S. Eken).
13191 Update copyright notice.
13192 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
13193 * tests/Makefile.am: Ditto.
13195 2003-01-28 Paul Eggert <eggert@twinsun.com>
13197 * data/lalr1.cc: Do not use @output_header_name@ unless
13198 b4_defines_flag is set. This fixes two bugs reported by
13200 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
13201 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
13203 2003-01-21 Paul Eggert <eggert@twinsun.com>
13205 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
13206 we don't need to worry about yyerrlab1 being reported as an
13207 "unused label" by non-GCC C compilers. The downside is that if
13208 locations are used then a couple of statements are duplicated each
13209 time YYERROR is invoked, but the upside is that the warnings
13211 (yyerrlab1): Move code to YERROR.
13212 (yyerrlab2): Remove. Change uses back to yyerrlab1.
13213 This reverts some of the 2002-12-27 change.
13215 2003-01-17 Paul Eggert <eggert@twinsun.com>
13217 * src/output.c (symbol_printers_output): Fix typo that led
13218 to core dump. Problem reported by Antonio Rus in
13219 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
13221 2003-01-13 Akim Demaille <akim@epita.fr>,
13222 Quoc Peyrot <chojin@lrde.epita.fr>,
13223 Robert Anisko <anisko_r@lrde.epita.fr>
13225 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
13226 when the stacks contain one element, as the loop would otherwise
13227 free the last state, and then use the top state (the one we just
13228 popped). This means that the initial elements will not be freed
13229 explicitly, as is the case in yacc.c; it is not a problem, as
13230 these elements have fake values.
13232 2003-01-11 Paul Eggert <eggert@twinsun.com>
13234 * NEWS: %expect-violations are now just warnings, reverting
13235 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
13236 bootstrapping problem reported by Matthias Klose; see
13237 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
13238 * src/conflicts.c (conflicts_print): Likewise.
13239 * tests/conflicts.at (%expect not enough, %expect too much,
13240 %expect with reduce conflicts): Likewise.
13241 * doc/bison.texinfo (Expect Decl): Document this. Also mention
13242 that the warning is enabled if the number of conflicts changes
13243 (not necessarily increases).
13245 * src/getargs.c (version): Update copyright year.
13247 2003-01-09 Akim Demaille <akim@epita.fr>
13249 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
13251 2003-01-08 Paul Eggert <eggert@twinsun.com>
13253 * Makefile.maint (WGETFLAGS):
13254 New macro, containing "-C off" to disable proxy caches.
13255 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
13256 (rel-check): Use $(WGET) instead of wget.
13258 2003-01-06 Paul Eggert <eggert@twinsun.com>
13260 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
13261 the GLR paper of Scott, Johnstone and Hussain.
13263 2003-01-04 Paul Eggert <eggert@twinsun.com>
13265 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
13266 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
13267 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
13268 (EXTRA_LIBRARIES): New var, for liby.a.
13269 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
13270 (EXTRA_SCRIPTS): New var, for yacc.
13272 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
13273 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
13274 Problem reported by Nelson H. F. Beebe.
13276 2003-01-03 Paul Eggert <eggert@twinsun.com>
13278 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
13279 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
13280 when compiling Bison 1.875's `bitset bset = obstack_alloc
13281 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
13283 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
13284 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
13285 grow to a huge size with typical invocation.
13287 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
13288 Use the pattern recommended by Autoconf 2.57, except also protect
13289 against double-definition.
13290 * src/system.h: Likewise.
13291 Portability issues reported by Nelson H. F. Beebe.
13293 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
13294 All uses changed. Provide a definition in both C and C++.
13295 (yytrue, yyfalse): Define even if defined (__cplusplus).
13297 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
13298 Reported by Nelson H. F. Beebe.
13300 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
13302 2003-01-02 Paul Eggert <eggert@twinsun.com>
13304 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
13305 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
13306 Bug reported by Nelson H. F. Beebe.
13308 2003-01-01 Paul Eggert <eggert@twinsun.com>
13312 2002-12-30 Paul Eggert <eggert@twinsun.com>
13314 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
13316 (<INITIAL>","): Here. This causes stray "," to be treated
13319 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
13320 last brace in braced code when not in Yacc mode, for compatibility
13321 with Bison 1.35. This resurrects the 2001-12-15 patch to
13324 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
13325 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
13327 2002-12-28 Paul Eggert <eggert@twinsun.com>
13329 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
13330 that of SYM's type. This fixes Debian bug 168069, reported by
13333 2002-12-28 Paul Eggert <eggert@twinsun.com>
13337 Switch back to the Yacc style of conflict reports, undoing some
13338 of the 2002-07-30 change.
13339 * doc/bison.texinfo (Understanding): Use Yacc style for
13340 conflict reports. Also, use new way of locating rules.
13341 * src/conflicts.c (conflict_report):
13342 Renamed from conflict_report_yacc, removing the old
13343 'conflict_report'. Translate the entire conflict report at once,
13344 so that we don't assume that "," has the same interpretation in
13346 (conflicts_output): Use Yacc-style conflict report for each state,
13347 instead of our more-complicated style.
13348 (conflicts_print): Use Yacc-style conflict report, except print
13349 the input file name when not emulating Yacc.
13350 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
13351 Conflicted Reduction, %expect not enough, %expect too much,
13352 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
13353 * tests/existing.at (GNU Cim Grammar): Likewise.
13354 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
13356 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
13357 fatal): Don't invoke fflush; it's not needed and it might even be
13358 harmful for stdout, as stdout might not be open.
13359 * src/reduce.c (reduce_print): Likewise.
13361 2002-12-27 Paul Eggert <eggert@twinsun.com>
13363 Fix a bug where error locations were not being recorded correctly.
13364 This problem was originally reported by Paul Hilfinger in
13365 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
13367 * data/yacc.c (yyparse): New local var yylerrsp, to record the
13368 top of the location stack's error locations.
13369 (yyerrlab): Set it. When discarding a token, push its location
13370 onto yylerrsp so that we don't lose track of the error's end.
13371 (yyerrlab1): Now is only the target of YYERROR, so that we can
13372 properly record the location of the action that failed. For GCC
13373 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
13374 GCC warning about yyerrlab1 being unused if YYERROR is unused.
13375 (yyerrlab2): New label, which yyerrlab now falls through to.
13376 Compute the error's location by applying YYLLOC_DEFAULT to
13377 the locations of all the symbols that went into the error.
13378 * doc/bison.texinfo (Location Default Action): Mention that
13379 YYLLOC_DEFAULT is also invoked for syntax errors.
13380 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
13381 Error locations include the locations of all the tokens that were
13382 discarded, not just the last token.
13384 2002-12-26 Paul Eggert <eggert@twinsun.com>
13386 * src/files.c: Include quote.h.
13387 (compute_output_file_names): Warn if we detect conflicting
13388 outputs to the same file. This should catch the misunderstanding
13389 exemplified by Debian Bug 165349, reported by Bruce Stephens..
13391 * src/conflicts.c (conflicts_print): If the user specifies
13392 "%expect N", report an error if there are any reduce/reduce
13393 conflicts. This is what the manual says should happen.
13394 This fixes Debian bug 130890, reported by Anthony DeRobertis.
13395 * tests/conflicts.at (%expect with reduce conflicts): New test.
13397 Don't use m4_include on relative file names, as it doesn't work as
13398 desired if there happens to be a file with that name under ".".
13400 * m4sugar/version.m4: Remove; it was included but it wasn't used.
13401 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
13402 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
13403 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
13404 * src/output.c (output_skeleton): Use full path names when
13405 specifying a file to include; don't rely on include path, as
13406 it's unreliable when the working file contains a file with
13409 2002-12-25 Paul Eggert <eggert@twinsun.com>
13411 Remove obsolete references to bison.simple and bison.hairy.
13412 Problem mentioned by Aubin Mahe in
13413 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
13414 * data/glr.c: Comment fix.
13415 * doc/bison.1: Remove references. Also, mention "yacc".
13417 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
13420 * src/parse-gram.y (declaration): Use enum "report_states" rather
13421 than its numeric value 1.
13423 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
13424 opening a new one. This fixes Debian bug 165349, reported by
13427 2002-12-24 Paul Eggert <eggert@twinsun.com>
13431 * Makefile.maint (cvs-update): Don't assume that the shell
13432 supports $(...), as Solaris sh doesn't.
13434 * src/parse-gram.y (lloc_default): Remove test for empty
13435 nonterminals at the end, since it didn't change the result.
13437 2002-12-24 Paul Eggert <eggert@twinsun.com>
13439 If the user does not define YYSTYPE as a macro, Bison now declares it
13440 using typedef instead of defining it as a macro. POSIX requires this.
13441 For consistency, YYLTYPE is also declared instead of defined.
13443 %union directives can now have a tag before the `{', e.g., the
13444 directive `%union foo {...}' now generates the C code
13445 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
13446 The default union tag is `YYSTYPE', for compatibility with Solaris 9
13447 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
13448 instead of `yyltype'.
13450 `yystype' and `yyltype' are now obsolescent macros instead of being
13451 typedefs or tags; they are no longer documented and will be
13452 withdrawn in a future release.
13454 * data/glr.c (b4_location_type): Remove.
13455 (YYSTYPE): Renamed from yystype.
13456 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
13457 (struct YYLTYPE): Renamed from struct yyltype.
13458 (YYLTYPE): Renamed from yyltype.
13459 (yyltype, yystype): New (and obsolescent) macros,
13460 for backward compatibility.
13461 * data/yacc.c: Likewise.
13463 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
13464 does not specify a union tag. This is for compatibility with
13467 * src/parse-gram.y (add_param): 2nd arg is now char * not char
13468 const *, since it is now modified by stripping surrounding { }.
13469 (current_braced_code): Remove.
13470 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
13471 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
13472 trailing " {...}". Now of type <chars>.
13473 (grammar_declaration): Adjust to bundled tokens.
13474 (code_content): Remove; stripping is now done by add_param.
13475 (print_token_value): Print contents of bundled tokens.
13476 (token_name): New function.
13478 * src/reader.h (braced_code, current_braced_code): Remove.
13479 (token_name): New decl.
13481 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
13482 token_type, not braced_code code_kind. All uses changed.
13483 (SC_PRE_CODE): New state, for scanning after a keyword that
13484 has (or usually has) an immediately-following braced code.
13485 (token_type): New local var, to keep track of which token type
13486 to return when scanning braced code.
13487 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
13488 <INITIAL>"%parse-param", <INITIAL>"%printer",
13489 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
13490 instead of returning a token type immediately.
13491 (<INITIAL>"{"): Set token type.
13492 (<SC_BRACED_CODE>"}"): Use it.
13493 (handle_action_dollar, handle_action_at): Now returns bool
13494 indicating success. Fail if ! current_rule; this prevents a core dump.
13495 (handle_symbol_code_dollar, handle_symbol_code_at):
13496 Remove; merge body into caller.
13497 (handle_dollar, handle_at): Complain in invalid contexts.
13499 * NEWS, doc/bison.texinfo: Document the above.
13500 * NEWS: Fix years and program names in copyright notice.
13502 2002-12-17 Paul Eggert <eggert@twinsun.com>
13504 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
13505 Reporting, Table of Symbols): Omit mentions of %lex-param and
13506 %parse-param from the documentation for now.
13508 2002-12-15 Paul Eggert <eggert@twinsun.com>
13510 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
13511 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
13512 lookahead symbol, and which sets yychar in parser actions) and it
13513 disagreed with the Bison documentation. Bug
13514 reported by Andrew Walrond.
13516 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
13517 as the caller now does that.
13518 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
13519 (YYEMPTY): Parenthesize right hand side, since others use it.
13520 (yyparse): Don't assume that our generated code is the only code
13523 2002-12-13 Paul Eggert <eggert@twinsun.com>
13527 POSIX requires a "yacc" command.
13528 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
13529 (MOSTLYCLEANFILES): Add yacc.
13531 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
13532 as an alias for bison y.
13534 * po/LINGUAS: Add da.
13536 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
13537 problem with latest <getopt.h>.
13538 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
13540 * doc/fdl.texi: Upgrade to 1.2.
13541 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
13542 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
13543 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
13545 * config/install-sh: Sync with autotools.
13547 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
13548 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
13549 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
13550 locations are requested.
13551 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
13552 locations are requested.
13554 2002-12-12 Paul Eggert <eggert@twinsun.com>
13556 Remove unportable casts and storage allocation tricks.
13557 While we're at it, remove almost all casts, since they
13558 usually aren't needed and are a sign of trouble.
13560 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
13562 * src/derives.c (derives_compute): Do not subtract NTOKENS from
13563 the pointer DSET returned by malloc; this isn't portable.
13564 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
13565 Similarly for DERIVES.
13566 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
13567 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
13568 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
13570 * src/derives.c (derives_compute): Do not bother invoking
13571 int_of_rule_number, since rule numbers are integers.
13573 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
13574 rather than XMALLOC (char, N).
13576 * src/files.c (filename_split): Rewrite to avoid cast.
13578 * src/gram.h (symbol_number_as_item_number,
13579 item_number_as_symbol_number, rule_number_as_item_number,
13580 item_number_as_rule_number):
13581 Now inline functions rather than macros, to avoid casts.
13582 * src/state.h (state_number_as_int): Likewise.
13583 * src/tables.c (state_number_to_vector_number,
13584 symbol_number_to_vector_number): Likewise.
13586 * src/gram.h (int_of_rule_number): Remove; no longer used.
13588 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
13589 since the resulting storage is always stored into.
13591 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
13594 * src/muscle_tab.c (muscle_m4_output):
13595 Now inline. Return bool, not int.
13596 * src/state.c (state_compare): Likewise.
13597 * src/symtab.c (symbol_check_defined,
13598 symbol_check_alias_consistency, symbol_pack, symbol_translation,
13599 hash_compare_symbol, hash_symbol):
13601 * src/uniqstr.c (uniqstr_print): Likewise.
13602 * src/muscle_tab.c (muscle_m4_output_processor):
13603 New function, to avoid casts.
13604 * src/state.c (state_comparator, stage_hasher): Likewise.
13605 * src/symtab.c (symbol_check_defined_processor,
13606 symbol_check_alias_consistency_processor, symbol_pack_processor,
13607 symbol_translation_processor, hash_symbol_comparator,
13608 hash_symbol_hasher): Likewise.
13609 * src/uniqstr.c (uniqstr_print_processor): Likewise.
13610 * src/muscle_tab.c (muscles_m4_output):
13611 Use new functions instead of casting old functions unportably.
13612 * src/state.c (state_hash_new): Likewise.
13613 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
13614 symbols_token_translations_init):
13616 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
13618 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
13619 var instead of casting to long, to avoid casts.
13620 (prepare_states): Use MALLOC rather than alloca, so that we don't
13621 have to worry about alloca.
13622 * src/state.c (state_hash_lookup): Likewise.
13624 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
13625 local var instead of casting to unsigned char, to avoid casts.
13627 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
13628 STATE_ALLOC): Remove.
13629 (transitions_new, errs_new, reductions_new, state_new): Use malloc
13630 rather than calloc, and use offsetof to avoid allocating slightly
13632 (state_new): Initialize all members.
13634 * src/state.c (state_hash): Use unsigned accumulator, not signed.
13636 * src/symtab.c (symbol_free): Remove; unused.
13637 (symbol_get): Remove cast in lhs of assignment.
13638 (symbols_do): Now static. Accept generic arguments, not
13639 hashing-related ones.
13641 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
13642 (symbol_processor): Remove.
13643 (symbols_do): Remove decl; now static.
13645 * src/system.h (alloca): Remove; decl no longer needed.
13646 (<stddef.h>): Include, for offsetof.
13647 (<inttypes.>, <stdint.h>): Include if available.
13648 (uintptr_t): New type, if system lacks it.
13649 (CALLOC, MALLOC, REALLOC): New macros.
13650 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
13653 * src/tables.c (table_size): Now int, to pacify GCC.
13654 (table_grow, table_ninf_remap): Use signed table size.
13655 (save_row): Don't bother initializing locals when not needed.
13656 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
13657 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
13659 * src/vcg.h: Correct misspellings.
13661 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
13664 * src/getargs.c (getargs): Don't assume EOF == -1.
13666 2002-12-09 Paul Eggert <eggert@twinsun.com>
13668 Change identifier spellings to avoid collisions with names
13669 that are reserved by POSIX.
13671 Don't use names ending in _t, since POSIX reserves them.
13672 For consistency, remove _e and _s endings -- they're weren't
13673 needed to remove ambiguity. All uses changed.
13674 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
13675 turn was just renamed from struniq_t.
13676 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
13677 which in turn was just renamed from struniq_processor_t.
13678 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
13679 in turn was renamed from hash_compare_struniq_t.
13680 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
13681 (state_list): Renamed from state_list_t.
13682 * src/assoc.h (assoc): Renamed from assoc_t.
13683 * src/conflicts.c (enum conflict_resolution): Renamed from
13684 enum conflict_resolution_e.
13685 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
13686 (rule_list): Renamed from rule_list_t.
13687 * src/getargs.h (enum trace): Renamed from enum trace_e.
13688 (enum report): Renamed from enum report_e.
13689 * src/gram.h (item_number): Renamed from item_number_t.
13690 (rule_number): Renamed from rule_number_t.
13691 (struct rule_s): Remove the "rule_s" part; not used.
13692 (rule): Renamed from rule_t.
13693 (rule_filter): Renamed from rule_filter_t.
13694 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
13695 (goto_list): Renamed from goto_list_t.
13696 * src/lalr.h (goto_number): Renamed from goto_number_t.
13697 * src/location.h (location): Renamed from location_t.
13698 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
13699 and moved here from:
13700 * src/muscle_tab.h (muscle_entry_t): here.
13701 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
13702 (rule_list): Renamed from rule_list_t.
13703 * src/print_graph.c (static_graph): Renamed from graph.
13704 * src/reader.h (braced_code): Renamed from braced_code_t.
13705 Remove brace_code_e tag.
13706 * src/relation.h (relation_node): Renamed from relation_node_t.
13707 (relation_nodes): Renamed from relation_nodes_t.
13708 (relation): Renamed from relation_t.
13709 * src/state.h (state_number): Renamed from state_number_t.
13710 (struct state): Renamed from struct state_s.
13711 (state): Renamed from state_t.
13712 (transitions): Renamed from transitions_t. Unused (and
13713 misspelled) transtion_s tag removed.
13714 (errs): Renamed from errs_t. Unused errs_s tag removed.
13715 (reductions): Renamed from reductions_t. Unused tag
13716 reductions_s removed.
13717 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
13718 (struct symbol_list): Renamed from struct symbol_list_s.
13719 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
13720 (struct symbol): Renamed from struct symbol_s.
13721 (symbol): Renamed from symbol_t.
13722 * src/tables.c (vector_number): Renamed from vector_number_t.
13723 (action_number): Renamed from action_t.
13724 * src/tables.h (base_number): Renamed from base_t.
13725 * src/vcg.h (enum color): Renamed from enum color_e.
13726 (enum textmode): Renamed from enum textmode_e.
13727 (enum shape): Renamed from enum shape_e.
13728 (struct colorentry): Renamed from struct colorentry_s.
13729 (struct classname): Renamed from struct classname_s.
13730 (struct infoname): Renamed from struct infoname_s.
13731 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
13732 (enum decision): Renamed from enum decision_e.
13733 (enum orientation): Renamed from enum orientation_e.
13734 (enum alignment): Renamed from enum alignment_e.
13735 (enum arrow_mode): Renamed from enum arrow_mode_e.
13736 (enum crossing_type): Renamed from enum crossing_type_e.
13737 (enum view): Renamed from enum view_e.
13738 (struct node): Renamed from struct node_s.
13739 (node): Renamed from node_t.
13740 (enum linestyle): Renamed from enum linestyle_e.
13741 (enum arrowstyle): Renamed from enum arrowstyle_e.
13742 (struct edge): Renamed from struct edge.
13743 (edge): Renamed from edge_t.
13744 (struct graph): Renamed from struct graph_s.
13745 (graph): Renamed from graph_t.
13746 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
13747 Rename value_t -> value.
13748 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
13749 value_t_as_yystype -> value_as_yystype.
13751 Don't include <errno.h> in the mainstream code, since it
13752 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
13753 * lib/get-errno.c, lib/get-errno.h: New files.
13754 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
13756 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
13757 * src/output.c (output_skeleton): Likewise.
13758 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
13760 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
13762 (handle_action_dollar, handle_action_at): Likewise.
13763 * src/system.h: Do not include <errno.h>.
13764 (TAB_EXT): Renamed from EXT_TAB.
13765 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
13767 Avoid str[a-z]*, since <string.h> reserves that name space.
13768 Change all instances of "struniq" in names to "uniqstr", and
13769 likewise for "STRUNIQ" and "UNIQSTR".
13770 * src/uniqstr.c: Renamed from src/struniq.c.
13771 * src/uniqstr.h: Renamed from src/struniq.h.
13772 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
13773 * src/files.c (strsuffix): Remove; unused.
13774 (concat2): Renamed from stringappend. Now static.
13775 * src/files.h (strsuffix, stringappend): Remove; unused.
13776 * src/parse-gram.y (<chars>): Renamed from <string>.
13777 (<uniqstr>): Renamed from <struniq>.
13778 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
13779 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
13780 (struct graph_s.expand): Renamed from struct graph_s.stretch.
13781 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
13782 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
13783 (N_EXPAND): Renamed from N_STRETCH.
13785 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
13786 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
13787 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
13789 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
13790 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
13791 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
13792 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
13793 (BASE_MAXIMUM): Renamed from BASE_MAX.
13794 (BASE_MINIMUM): Renamed from BASE_MIN.
13795 (ACTION_MAX): Remove; unused.
13796 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
13797 Unnecessary casts removed from above defines.
13800 Fix misspelling in names.
13801 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
13802 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
13806 * lib/timevar.c (timevar_report): Renamed from time_report,
13807 for consistency with other names.
13808 * lib/timevar.h (timevar_report): New decl.
13809 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
13812 Sort include-file uses.
13814 Reorder all include files under src to be in the order "system.h".
13815 then the ../lib include files in angle brackets (alphabetized),
13816 then the . include files in double-quotes (alphabetized). Fix
13817 dependency breakages encountered in this process, as follows:
13818 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
13819 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
13820 * src/state.h: Include "symtab.h".
13822 2002-12-08 Paul Eggert <eggert@twinsun.com>
13824 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
13825 since this causes problems when __file__ contains character
13826 sequences like "@" that are treated specially by src/scan-skel.l.
13827 Instead, just use the file's basename. This fixes the bug
13828 reported by Martin Mokrejs in
13829 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
13831 2002-12-06 Paul Eggert <eggert@twinsun.com>
13833 Add support for rules that do not have trailing semicolons, as
13834 POSIX requires. Improve the quality of locations in Bison
13837 * src/location.c: Include <quotearg.h>.
13838 (empty_location): Now const.
13839 (location_print): New function. Follow the recommendation of the
13840 GNU Coding Standards for locations that span file boundaries.
13841 * src/location.h: Do not include <quotearg.h>; no longer needed.
13842 (boundary): New type.
13843 (location_t): Use it. This allows locations to span file boundaries.
13844 All member uses changed: file -> start.file or end.file (as needed),
13845 first_line -> start.line, first_column -> start.column,
13846 last_line -> end.line, last_column -> end.column.
13847 (equal_boundaries): New function.
13848 (LOCATION_RESET, LOCATION_STEP): Remove.
13849 (LOCATION_PRINT): Remove. All callers changed to use location_print.
13850 (empty_location): Now const.
13851 (location_print): New decl.
13852 * src/parse-gram.y (lloc_default): New function, which handles
13853 empty locations more accurately.
13854 (YYLLOC_DEFAULT): Use it.
13855 (%token COLON): Remove.
13856 (%token ID_COLON): New token.
13858 (declarations, rules): Remove trailing semicolon.
13859 (declaration, rules_or_grammar_declaration):
13860 Allow empty (";") declaration.
13861 (symbol_def): Remove empty actions; no longer needed.
13862 (rules_or_grammar_declaration): Remove trailing semicolon.
13863 (semi_colon.opt): Remove.
13864 * src/reader.h: Include location.h.
13865 (scanner_cursor): New decl.
13866 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
13868 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
13870 (STEP): Remove. No longer needed, now that adjust_location does
13871 the work. All uses removed.
13872 (scanner_cursor): New var.
13873 (adjust_location): Renamed from extend_location. It now sets
13874 *loc and adjusts the scanner cursor. All uses changed.
13875 Don't bother testing for CR.
13876 (handle_syncline): Remove location arg; now updates scanner cursor.
13877 All callers changed.
13878 (unexpected_end_of_file): Now accepts start boundary of token or
13879 comment, not location. All callers changed. Update scanner cursor,
13881 (SC_AFTER_IDENTIFIER): New state.
13882 (context_state): Renamed from c_context. All uses changed.
13883 (id_loc, code_start, token_start): New local vars.
13884 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
13885 processing of Yacc white space and equivalents here.
13886 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
13887 instead of returning ID immediately, since we need to search for
13888 a subsequent colon.
13889 (<INITIAL>"'", "\""): Save token_start.
13890 (<INITIAL>"%{", "{", "%%"): Save code_start.
13891 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
13892 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
13893 BEGIN context_state at end, not INITIAL.
13894 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
13895 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
13896 Return correct token start.
13897 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
13898 the start of a character, string or multiline comment is found.
13899 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
13900 Reduction): Adjust reported locations to match the more-precise
13901 results now expected.
13902 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
13903 * tests/reduce.at (Useless Rules, Reduced Automaton,
13904 Underivable Rules): Likewise.
13905 * tests/regression.at (Invalid inputs): No longer `expecting ";"
13906 or "|"' now that so many other tokens are allowed by the new grammar.
13908 * src/complain.h (current_file): Remove duplicate decl;
13909 current_file is now owned by files.h.
13910 * src/complain.c, src/scan-gram.l: Include files.h.
13912 2002-12-06 Paul Eggert <eggert@twinsun.com>
13914 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
13915 promotes to int; it might be unsigned int.
13916 * data/yacc.c (yy_reduce_print): Likewise.
13918 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
13919 be #defined in the prologue, not in the Bison declarations.
13920 This fixes Debian Bug 102878, reported by Shaul Karl.
13922 2002-12-02 Paul Eggert <eggert@twinsun.com>
13924 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
13925 * lib/strtoul.c: New file, from gnulib.
13926 This fixes a porting bug reported by Peter Klein in
13927 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
13929 2002-11-30 Paul Eggert <eggert@twinsun.com>
13931 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
13932 and put only a forward declaration in the prologue. This is for
13933 consistency with the other scanner helper functions.
13935 Type clashes now generate warnings, not errors, since it
13936 appears that POSIX may allow some grammars with type clashes.
13937 * src/reader.c (grammar_current_rule_check): Warn about
13938 type clashes instead of complaining.
13939 * tests/input.at (Type Clashes): Expect warnings, not complaints.
13941 Add Yacc library, since POSIX requires it.
13942 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
13943 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
13944 * lib/main.c, lib/yyerror.c: New files.
13946 gram_error can be static; it need not be extern.
13947 * src/reader.h (gram_error): Remove decl.
13948 * src/parse-gram.y (gram_error): Now static. Add static decl.
13949 (print_token_value): Omit parameter names from forward decl,
13952 2002-11-29 Paul Eggert <eggert@twinsun.com>
13954 * doc/bison.texinfo: Emphasize that yylex and yyerror must
13955 be declared before being used. E.g., one should typically
13956 declare them in the prologue. Use GNU coding style in examples.
13957 Put "const" consistently after the type it modifies. Mention
13958 that C99 supports "inline". Mention that yyerror traditionally
13961 %parse-param and %lex-param now take just one argument, the
13962 declaration; the argument name is deduced from the declaration.
13964 * doc/bison.texinfo (Parser Function, Pure Calling, Error
13965 Reporting, Table of Symbols): Document this.
13966 * src/parse-gram.y (add_param): New function.
13968 (declaration): Implement new rule for %parse-param and %lex-param.
13969 * src/scan-gram.l: "," now elicits a warning, rather than being
13970 a token; this is more compatible with byacc.
13971 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
13973 2002-11-27 Paul Eggert <eggert@twinsun.com>
13975 Rename identifiers to avoid real and potential collisions.
13977 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
13978 to avoid collision with lex macro described by Bruce Lilly in
13979 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
13980 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
13981 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
13982 * src/parse-gram.y (print_token_value): Renamed from yyprint.
13984 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
13985 The name "yycontrol" violates the name space rules, and this stuff
13986 wasn't being used anyway.
13987 (input): Remove action; this stuff wasn't being used.
13988 (gram_error): Rename local variable yylloc -> loc.
13989 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
13990 (YY_DECL): Don't use "yy" at start of local variables.
13991 All uses changed, e.g., yylloc -> loc.
13992 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
13993 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
13994 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
13995 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
13997 * src/parse-gram.y (gram_error): loc is now const *.
13998 * src/reader.h (gram_error): Likewise.
14000 2002-11-24 Paul Eggert <eggert@twinsun.com>
14004 * tests/actions.at (Actions after errors): Use an output format
14005 more similar to that of the Printers and Destructors test.
14006 Test the position of the ';' token too.
14007 (Printers and Destructors): Likewise.
14008 (Printers and Destructors: %glr-parser): Remove for now, to avoid
14009 unnecessarily alarming people when the test fails.
14011 * data/yacc.c (yyerrlab1): Move this label down, so that the
14012 parser does not discard the lookahead token if the user code
14013 invokes YYERROR. This change is required for POSIX conformance.
14015 * lib/error.c: Sync with gnulib.
14017 2002-11-22 Paul Eggert <eggert@twinsun.com>
14019 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
14020 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
14021 * lib/xmalloc.c: Likewise.
14023 2002-11-20 Paul Eggert <eggert@twinsun.com>
14025 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
14027 2002-11-20 Paul Eggert <eggert@twinsun.com>
14029 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
14030 should use `if (! x) abort ();' rather than `assert (x);', and
14031 anyway it's one less thing to worry about configuring.
14033 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
14034 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
14035 and replace all instances of assert with abort.
14036 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
14037 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
14039 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
14040 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
14041 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
14042 hash_find_entry, hash_rehash, hash_insert): Likewise.
14043 * src/conflicts.c (resolve_sr_conflict): Likewise.
14044 * src/lalr.c (set_goto_map, map_goto): Likewise.
14045 * src/nullable.c (nullable_compute): Likewise.
14046 * src/output.c (prepare_rules, token_definitions_output): Likewise.
14047 * src/reader.c (packgram, reader): Likewise.
14048 * src/state.c (state_new, state_free, state_transitions_set,
14049 state_reduction_find): Likewise.
14050 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
14051 symbol_pack): Likewise.
14052 * src/tables.c (conflict_row, pack_vector): Likewise.
14053 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
14054 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
14055 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
14056 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
14058 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
14059 (ARGMATCH_CONSTRAINT): New macro.
14060 (ARGMATCH_ASSERT): Use it.
14062 * src/system.h (verify): New macro.
14063 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
14064 rather than assert.
14065 * src/tables.c (tables_generate): Likewise.
14067 * src/struniq.c (struniq_assert): Now returns void, and aborts
14068 if the assertion is false.
14069 (struniq_assert_p): Remove.
14070 * src/struniq.h: Likewise.
14072 2002-11-18 Paul Eggert <eggert@twinsun.com>
14074 * data/glr.c (yygetLRActions): Replace `yyindex' with
14075 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
14076 This fixes the regression with Sun ONE Studio 7 cc that I reported in
14077 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
14079 2002-11-18 Akim Demaille <akim@epita.fr>
14081 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
14083 From Tim Van Holder.
14085 2002-11-17 Paul Eggert <eggert@twinsun.com>
14087 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
14088 to "SyntaxError" for consistency with my 2002-11-15 change.
14090 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
14091 not define to {}, since this breaks the common use of `YYDPRINTF
14092 ((...));' if a single statement is desired (e.g. before `else').
14093 Work around GCC warnings by surrounding corresponding calls with
14095 (yyhasResolvedValue): Remove unused function.
14096 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
14098 (yyreportSyntaxError): Renamed from yyreportParseError.
14099 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
14101 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
14102 extern when possible. Remove unused initializations.
14104 2002-11-16 Akim Demaille <akim@epita.fr>
14106 Augment the similarity between GLR and LALR traces.
14108 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
14109 (YY_REDUCE_PRINT): New.
14110 (yyparse): Use them.
14111 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
14113 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
14114 state reached after the reduction/recovery, since...
14115 (yyparse, yyprocessOneStack): Report the state we are entering in.
14117 2002-11-16 Akim Demaille <akim@epita.fr>
14119 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
14120 Add support for --trace=skeleton.
14121 * src/scan-skel.l: %option debug.
14122 Scan strings of non-@ or \n instead of character by character.
14123 (scan_skel): Handle trace_skeleton.
14125 (@output_parser_name@, @output_header_name@): ``Restore'' their
14126 support (used to be M4 macros).
14127 * data/yacc.c: Quote larger chunks, a la glr.c.
14128 * data/lalr1.cc: Likewise.
14129 The header guards are no longer available, so use some other
14130 string than `YYLSP_NEEDED'.
14132 2002-11-16 Akim Demaille <akim@epita.fr>
14134 Make the ``Printers and Destructors'' test more verbose, taking
14135 `yacc.c''s behavior as (possibly wrong) reference.
14137 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
14138 instead of fprint on stdout.
14139 Set and report the last_line of the symbols.
14140 Consistently display values and locations.
14142 2002-11-16 Paul Eggert <eggert@twinsun.com>
14144 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
14146 2002-11-15 Paul Eggert <eggert@twinsun.com>
14148 * tests/actions.at (Actions after errors): New test case.
14150 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
14151 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
14152 tests/action.at, tests/calc.at, tests/conflicts.at,
14153 tests/cxx-type.at, tests/regression.at:
14154 "parse error" -> "syntax error" for POSIX compatibility.
14155 "parsing stack overflow..." -> "parser stack overflow" so
14156 that code matches Bison documentation.
14158 2002-11-15 Akim Demaille <akim@epita.fr>
14160 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
14161 take two BRACED_CODE, not two string_content.
14162 Free the scanner's obstack when we are done.
14163 (code_content): New.
14164 * tests/calc.at: Adjust.
14165 * doc/bison.texinfo: Adjust.
14166 Also, make sure to include the `,' for these declarations.
14168 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
14170 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
14171 definition; avoids potential autoreconf problems.
14173 2002-11-15 Akim Demaille <akim@epita.fr>
14175 Always check the value returned by yyparse.
14177 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
14178 returned by yyparse.
14179 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
14181 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
14182 returned by yyparse.
14184 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14186 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
14189 2002-11-14 Paul Eggert <eggert@twinsun.com>
14191 * src/output.c (output_skeleton): Call xfopen instead of
14192 duplicating xfopen's body.
14194 Fix bugs reported by Nelson H. F. Beebe in
14195 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
14197 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
14198 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
14199 Group compiler. Instead, use "$CC -E bar.c". Include the .h
14200 file twice in the grammar, as an extra check.
14202 * tests/input.at (Torturing the Scanner): Surround the
14203 backslash-newline tests with "#if 0", to make it less likely that
14204 we'll run into compiler bugs. Bring back solitary \ inside
14205 comment, but add a closing comment to work around HP C bug. Don't
14206 test backslash-newline in C character constant.
14208 2002-11-14 Akim Demaille <akim@epita.fr>
14210 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
14211 status of the compiler.
14212 Calling `exit 1' is no longer needed.
14213 Reported by Nelson H. F. Beebe.
14215 2002-11-14 Akim Demaille <akim@epita.fr>
14217 * tests/atlocal.in (CPPFLAGS): We have config.h.
14218 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
14220 * tests/actions.at, tests/calc.at, tests/conflicts.at,
14221 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
14222 * tests/regression.at, tests/torture.at: Use them for all the
14223 grammars that are to be compiled.
14224 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
14225 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
14226 * doc/bison.texinfo (GLR Parsers): Document `inline'.
14228 2002-11-14 Akim Demaille <akim@epita.fr>
14230 * doc/bison.texinfo: Various formatting changes (alignments in
14231 samples, additional @group/@end group, GCS in samples.
14232 Use @deffn instead of simple @table to define the directives,
14233 macros, variables etc.
14235 2002-11-13 Paul Eggert <eggert@twinsun.com>
14237 Fix some bugs reported by Albert Chin-A-Young in
14238 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
14240 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
14241 -o c"; the HP C compiler chatters during compilation.
14242 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
14243 * tests/headers.at (export YYLTYPE): Likewise.
14245 * tests/input.at (Torturing the Scanner): Remove lines containing
14246 solitary backslashes, as they tickle a bug in the HP C compiler.
14248 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
14249 comments, since they're not portable. Use GNU coding style.
14251 2002-11-13 Akim Demaille <akim@epita.fr>
14253 * data/yacc.c: Leave bigger chunks of quoted text.
14254 (YYDSYMPRINTF): New.
14255 Use it to report symbol activities.
14256 * data/glr.c (YYDSYMPRINTF): New.
14259 2002-11-12 Paul Eggert <eggert@twinsun.com>
14263 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
14264 (yyglrReduce): Return yyok, not 0.
14265 This should avoid the enumerated-type warnings reported
14266 by Nelson H. F. Beebe in
14267 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
14269 * lib/bbitset.h (BITSET_INLINE): Remove.
14270 * lib/bitset.h [! BITSET_INLINE]: Remove.
14271 (bitset_set, bitset_reset, bitset_test): Rename local vars
14272 to avoid shadowing warnings by GCC.
14274 * data/glr.c (inline): Remove #define. It's the user's
14275 responsibility to #define it away, just like 'const'.
14276 This fixes one of the bugs reported by Nelson H. F. Beebe in
14277 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
14279 * Makefile.maint (po-check): Scan .l and .y files instead of the
14280 .c and the .h files that they generate. This fixes the bug
14281 reported by Tim Van Holder in:
14282 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
14283 Look for N_ as well as for _. Try to avoid matching #define for
14285 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
14286 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
14287 * src/scan-gram.l: Revamp regular expressions so that " and '
14288 do not confuse xgettext.
14290 * src/struniq.h (struniq_new): Do not declare the return type
14291 to be 'const'; this violates the C standard.
14292 * src/struniq.c (struniq_new): Likewise.
14294 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
14296 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
14297 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
14300 2002-11-12 Akim Demaille <akim@epita.fr>
14302 * Makefile.maint: Sync with Autoconf:
14303 (local_updates): New.
14305 2002-11-12 Akim Demaille <akim@epita.fr>
14307 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
14309 2002-11-12 Akim Demaille <akim@epita.fr>
14311 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
14314 2002-11-12 Akim Demaille <akim@epita.fr>
14316 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
14319 2002-11-12 Akim Demaille <akim@epita.fr>
14321 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
14322 Use it to test the GLR parser.
14324 2002-11-12 Akim Demaille <akim@epita.fr>
14326 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
14328 * data/glr.c (yystos): New.
14329 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
14330 (YYDSYMPRINT): New.
14331 (yyval): Don't define it, it is handled via M4.
14332 (yyrecoverParseError): Free verbosely the discarded symbols.
14333 * data/yacc.c (yysymprint): Remove, rather...
14334 (b4_yysymprint_generate): invoke.
14335 * data/c.m4 (b4_yysymprint_generate): New.
14336 Accept pointers as arguments, as opposed to the version from
14338 (b4_yydestruct_generate): Likewise.
14339 * tests/cations.at (Printers and Destructors): Use Bison directives
14340 instead of CPP macros.
14341 Don't rely on internal details.
14343 2002-11-12 Akim Demaille <akim@epita.fr>
14345 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
14346 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
14347 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
14348 it against YYEMPTY and so forth), work on yytoken (i.e., set
14349 it to YYEMPTY etc.).
14350 (yydestruct): Replace with a b4_yydestruct_generate invocation.
14351 (b4_symbol_actions): Remove.
14352 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
14353 for 0, end-of-input.
14355 2002-11-12 Akim Demaille <akim@epita.fr>
14357 * doc/bison.texinfo (Destructor Decl): New.
14359 2002-11-12 Akim Demaille <akim@epita.fr>
14361 * src/tables.c (tables_generate): Use free for pointers that
14362 cannot be NULL, not XFREE.
14363 (pack_vector): Use assert, not fatal, for bound violations.
14364 * src/state.c (state_new): Likewise.
14365 * src/reader.c (reader): Likewise.
14366 * src/lalr.c (set_goto_map): Likewise.
14367 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
14370 2002-11-12 Akim Demaille <akim@epita.fr>
14372 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
14374 * src/scan-gram.l (last_string): Is global to the file, not to
14376 * src/parse-gram.y (input): Don't append the epilogue here,
14377 (epilogue.opt): do it here, and free the scanner's obstack.
14378 * src/reader.c (epilogue_set): Rename as...
14379 (epilogue_augment): this.
14380 * data/c.m4 (b4_epilogue): Defaults to empty.
14382 2002-11-12 Akim Demaille <akim@epita.fr>
14384 * src/getargs.c (long_options): Remove duplicates.
14385 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
14387 * doc/bison.rnh: Remove.
14388 * doc/bison.texinfo (VMS Invocation): Remove.
14390 2002-11-12 Akim Demaille <akim@epita.fr>
14392 * src/struniq.h, src/struniq.c (struniq_t): Is const.
14393 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
14395 Use struniq for symbols.
14397 * src/symtab.h (symbol_t): The tag member is a struniq.
14398 (symbol_type_set): Adjust.
14399 * src/symtab.c (symbol_new): Takes a struniq.
14400 (symbol_free): Don't free the tag member.
14401 (hash_compare_symbol_t, hash_symbol_t): Rename as...
14402 (hash_compare_symbol, hash_symbol): these.
14403 Use the fact that tags as struniqs.
14404 (symbol_get): Use struniq_new.
14405 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
14407 * src/reader.h (merger_list, grammar_currentmerge_set): The name
14408 and type members are struniqs.
14409 * src/reader.c (get_merge_function)
14410 (grammar_current_rule_merge_set): Adjust.
14411 (TYPE, current_type): Are struniq.
14413 Use struniq for file names.
14415 * src/files.h, src/files.c (infile): Split into...
14416 (grammar_file, current_file): these.
14417 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
14418 * src/reduce.c (reduce_print): Likewise.
14419 * src/getargs.c (getargs): Likewise.
14420 * src/complain.h, src/complain.c: Likewise.
14421 * src/main.c (main): Call struniqs_new early enough to use it for
14423 Don't free the input file name.
14425 2002-11-12 Akim Demaille <akim@epita.fr>
14427 * src/symtab.c (symbol_free): Remove dead deactivated code:
14428 type_name are properly removed.
14429 Don't use XFREE to free items that cannot be NULL.
14430 * src/struniq.h, src/struniq.c: New.
14431 * src/main.c (main): Initialize/free struniqs.
14432 * src/parse-gram.y (%union): Add astruniq member.
14434 * src/scan-gram.l (<{tag}>): Return a struniq.
14435 Free the obstack bit that used to store it.
14436 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
14438 2002-11-11 Paul Eggert <eggert@twinsun.com>
14440 Revamp to fix many (but not all) of the C- and M4-related quoting
14441 problems. Among other things, this fixes the Bison bug reported
14442 by Jan Hubicka when processing the Bash grammar; see:
14443 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
14445 Use new @ escapes consistently. Represent brackets with @{ and @}
14446 rather than @<:@ and @:>@, since this works a bit better with dumb
14447 editors like vi. Represent @ with @@, since @ is now consistently
14448 an escape. Use @oline@ and @ofile@ rather than __oline__ and
14449 __ofile__, to avoid unexpected expansions. Similarly, use @output
14450 rather than #output.
14452 * data/c.m4 (b4_copyright): Omit file name from comment, since
14453 the file name could contain "*/".
14454 (b4_synclines_flag): Don't quote the 2nd argument; it should already
14455 be quoted. All uses changed.
14457 * data/glr.c: Use new @ escapes consistently.
14458 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
14459 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
14460 Remove, since they couldn't handle arbitrary characters in file
14462 * data/lalr1.cc: Likewise.
14463 * data/yacc.c: Likewise.
14465 * src/files.c (output_infix): Remove; all uses removed.
14466 * src/files.h: Likewise.
14468 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
14469 mishandled funny characters in file names, and anyway it isn't
14471 * data/yacc.c: Likewise.
14472 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
14474 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
14475 * data/yacc.c: Likewise.
14477 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
14479 (muscle_init): Quote filename as a C string.
14480 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
14481 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
14482 * src/output.c (escaped_file_name_output): New function.
14483 (prepare_symbols): Quote tokens for M4.
14484 (prepare): Don't insert output_infix, output_prefix,
14485 output_parser_name, output_header_name; this is now down by scan-skel.
14486 Insert skeleton as a C string.
14488 * src/output.c (user_actions_output, symbol_destructors_output,
14489 symbol_printers_output): Quote filenames for C and M4.
14490 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14492 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
14493 escapes other than \\ and \'; this simplifies the code.
14494 (<SC_STRING>): Likewise, for \\ and \".
14495 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
14496 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
14497 Use new escapes @{ and @} for [ and ].
14499 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
14500 them with auto vars.
14501 Switch to new escape scheme, where @ is the escape character uniformly.
14502 Abort if a stray escape character is found. Avoid unbounded input
14503 buffer when parsing non-escaped text.
14505 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
14506 __oline__, #output, $@, and @{ do not have unintended meanings.
14508 2002-11-09 Paul Eggert <eggert@twinsun.com>
14510 Fix the test failure due to GCC warnings described in
14511 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
14512 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
14513 evaluate to 0 if it's impossible for NINF to be in the respective
14515 (yygetLRActions, yyrecoverParseError): Use them.
14517 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
14518 counted in the token inserted at end of file. Now takes
14519 location_t *, not location_t, so that the location can be
14520 adjusted. All uses changed.
14522 * tests/regression.at (Invalid inputs): Adjust wording in
14523 diagnostic to match the new behavior.
14525 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
14526 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
14527 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
14528 abort ();'. This reduces the runtime of the "Many lookaheads"
14529 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
14532 2002-11-07 Paul Eggert <eggert@twinsun.com>
14534 * src/parse-gram.y (CHARACTER): Remove unused token.
14537 * src/scan-gram.l: Remove stack option. We no longer use the
14538 stack, since the stack was never deeper than 1; instead, use the
14539 new auto var c_context to record the stacked value.
14541 Remove nounput option. At an unexpected end of file, we now unput
14542 the minimal input necessary to end cleanly; this simplifies the
14545 Avoid unbounded token sizes where this is easy.
14547 (unexpected_end_of_file): New function.
14548 Use it to systematize the error message on unexpected EOF.
14549 (last-string): Now auto, not static.
14550 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
14551 (scanner_last_string_free): Remove; not used.
14552 (percent_percent_count): Move decl to just before use.
14553 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
14554 not the (never otherwised-used) CHARACTER.
14556 2002-11-07 Akim Demaille <akim@epita.fr>
14558 Let yyerror always receive the msg as last argument, so that
14559 yyerror can be variadic.
14561 * data/yacc.c (b4_yyerror_args): New.
14562 Use it when calling yyerror.
14563 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
14564 Use it when calling yyerror.
14565 * doc/bison.texinfo (Error Reporting): Adjust.
14566 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
14567 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
14569 2002-11-06 Akim Demaille <akim@epita.fr>
14571 #line should have quoted strings.
14572 Ideally, this should be done by m4_quotearg.
14574 * src/scan-skel.l: Include quotearg.h.
14576 * src/output.c (symbol_printers_output)
14577 (symbol_destructors_output): Quote the file name.
14579 2002-11-06 Akim Demaille <akim@epita.fr>
14581 * tests/regression.at (Invalid inputs): Adjust to the recent
14584 2002-11-06 Akim Demaille <akim@epita.fr>
14586 Restore --no-lines.
14587 Reported by Jim Kent.
14589 * data/c.m4 (b4_syncline): New.
14590 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
14591 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
14592 * src/output.c (user_actions_output): Likewise.
14593 (prepare): Define 'b4_synclines_flag'.
14594 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
14596 2002-11-06 Akim Demaille <akim@epita.fr>
14598 * src/main.c (main): Free `infile'.
14599 * src/scan-gram.l (handle_syncline): New.
14601 * src/output.c (user_actions_output, symbol_destructors_output)
14602 (symbol_printers_output): Use the location's file name, not
14604 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14606 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14608 * src/tables.c (matching_state): Don't allow states to match if
14609 either has GLR conflict entries.
14611 2002-11-05 Paul Eggert <eggert@twinsun.com>
14613 * src/scan-gram.l: Use more accurate diagnostics, e.g.
14614 "integer out of range" rather than "invalid value".
14615 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
14618 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
14619 Also, remove one static variable in the scanner.
14621 * src/scan-gram.l (braces_level): Now auto, not static.
14622 Initialize to zero if the compiler is being picky.
14623 (INITIAL): Clear braces_level instead of incrementing it.
14624 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
14625 as POSIX 1003.1-2001 requires.
14626 * src/system.h (IF_LINT): New macro, taken from coreutils.
14627 * configure.ac: Define "lint" if --enable-gcc-warnings.
14629 2002-11-05 Akim Demaille <akim@epita.fr>
14631 * src/scan-gram.l: When it starts with `%', complain about the
14632 whole directive, not just that `invalid character: %'.
14634 2002-11-04 Akim Demaille <akim@epita.fr>
14636 * Makefile.maint: Update from Autoconf.
14637 (update, cvs-update, po-update, do-po-update): New.
14639 2002-11-04 Akim Demaille <akim@epita.fr>
14641 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
14643 Have yyerror `use' its arguments.
14644 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
14645 returns true when location & yacc & pure & parse-param.
14646 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
14648 2002-11-04 Akim Demaille <akim@epita.fr>
14650 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
14652 * src/scan-gram.l: Use [\'] instead of ['] to pacify
14655 Use quote, not quote_n since LOCATION_PRINT no longer uses the
14658 2002-11-03 Paul Eggert <eggert@twinsun.com>
14660 * src/reader.c (get_merge_function, grammar_current_rule_check):
14661 Use consistent diagnostics for reporting type name clashes.
14662 Quote the types with <>, for consistency with Yacc.
14663 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
14665 2002-11-03 Akim Demaille <akim@epita.fr>
14667 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
14669 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
14670 (b4_parse_param): Remove.
14671 Use b4_identification.
14672 Propagate b4_pure_args where needed to pass them to yyerror.
14673 * data/glr.m4 (b4_parse_param): Remove.
14674 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
14675 (b4_lpure_formals): New.
14676 Use b4_identification.
14677 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
14678 b4_user_formals and b4_user_args.
14679 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
14680 (yyreportAmbiguity): When using a pure parser, also need
14681 the location, and the parse-params.
14683 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
14684 When using a pure parser, also need the parse-params.
14686 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
14687 (%pure-parser + %parse-param) LALR and GLR parsers.
14688 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
14689 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
14690 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
14691 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
14692 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
14693 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
14694 * doc/bison.texinfo: Untabify the whole file.
14695 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
14696 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
14697 (Error Reporting): Adjust to these new directives.
14698 Document %error-verbose, deprecate YYERROR_VERBOSE.
14700 2002-11-03 Akim Demaille <akim@epita.fr>
14702 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
14703 AT_CHECK_CALC_GLR invocations to use % directives, instead of
14704 command line options.
14705 * tests/cxx-type.at: Formatting changes.
14707 2002-11-03 Paul Eggert <eggert@twinsun.com>
14709 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
14710 to count columns correctly, and to check for invalid inputs.
14712 Use mbsnwidth to count columns correctly. Account for tabs, too.
14713 Include mbswidth.h.
14714 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
14715 (extend_location): New function.
14716 (YY_LINES): Remove.
14718 Handle CRLF in C code rather than in Lex code.
14719 (YY_INPUT): New macro.
14720 (no_cr_read): New function.
14722 Scan UCNs, even though we don't fully handle them yet.
14723 (convert_ucn_to_byte): New function.
14725 Handle backslash-newline correctly in C code.
14726 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
14727 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
14729 (tag, splice): New EREs. Do not allow NUL or newline in tags.
14730 Use {splice} wherever C allows backslash-newline.
14731 YY_STEP after space, newline, vertical-tab.
14732 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
14734 (letter, id): Don't assume ASCII; e.g., spell out a-z.
14736 ({int}, handle_action_dollar, handle_action_at): Check for integer
14739 (YY_STEP): Omit trailing semicolon, so that it's more like C.
14741 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
14742 as well as \000. Check for UCHAR_MAX, not 255.
14743 Allow \x with an arbitrary positive number of digits, as in C.
14744 Check for overflow here.
14745 Allow \? and UCNs, for compatibility with C.
14747 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
14748 with quote slot used by complain_at.
14750 * tests/input.at: Add tests for backslash-newline, m4 quotes
14751 in symbols, long literals, and funny escapes in strings.
14753 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
14754 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
14755 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
14756 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
14757 * m4/mbswidth.m4: New file, from GNU coreutils.
14759 * doc/bison.texinfo (Grammar Outline): Document // comments.
14760 (Symbols): Document that trigraphs have no special meaning in Bison,
14761 nor is backslash-newline allowed.
14762 (Actions): Document that trigraphs have no special meaning.
14764 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
14767 2002-11-02 Paul Eggert <eggert@twinsun.com>
14769 * src/reader.c: Don't include quote.h; not needed.
14770 (get_merge_function): Reword warning to be consistent with
14771 type clash diagnostic in grammar_current_rule_check.
14773 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
14774 bug in trigraph handling.
14776 * src/output.c (prepare_symbols): When printing token names,
14777 escape "[" as "@<:@" and likewise for "]".
14779 * src/system.h (errno): Remove declaration, as we are now
14780 assuming C89 or better, and C89 guarantees errno.
14782 2002-10-30 Paul Eggert <eggert@twinsun.com>
14784 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
14785 Check for close failures.
14786 * src/files.h (xfclose): Return void, not int, since it always
14788 * src/files.c (xfclose): Likewise. Report I/O error if ferror
14790 * src/output.c (output_skeleton): Use xfclose rather than fclose
14791 and ferror. xfclose now checks ferror.
14793 * data/glr.c (YYLEFTMOST_STATE): Remove.
14794 (yyreportTree): Use a stack-based leftmost state. This avoids
14795 our continuing battles with bogus warnings about initializers.
14797 2002-10-30 Akim Demaille <akim@epita.fr>
14799 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
14802 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14804 * tests/glr-regr1.at: New test for reported regressions.
14805 * tests/testsuite.at: Add glr-regr1.at test.
14806 * tests/Makefile.am: Add glr-regr1.at test.
14808 2002-10-24 Paul Eggert <eggert@twinsun.com>
14812 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
14813 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
14814 we use malloc. Don't assume 'A' through 'Z' are contiguous.
14815 Don't assume strdup exists; POSIX says its an XSI extension.
14816 Check for buffer overflow on input.
14818 2002-10-24 Akim Demaille <akim@epita.fr>
14820 * src/output.c (output_skeleton): Don't disable M4sugar comments
14821 too soon: it results in comments being expanded.
14822 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
14825 2002-10-24 Akim Demaille <akim@epita.fr>
14827 * data/yacc.c (m4_int_type): New.
14828 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
14829 char' as only yacc.c wants K&R portability.
14830 * data/glr.c (yysigned_char): Remove.
14831 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
14832 Reported by Quoc Peyrot.
14834 2002-10-23 Paul Eggert <eggert@twinsun.com>
14836 * src/main.c (main): With --trace=time, report times even if a
14837 non-fatal error occurs. Formerly, the times were reported in some
14838 such cases but not in others.
14839 * src/reader.c (reader): Just return if a complaint has been issued,
14840 instead of exiting, so that 'main' can report times.
14842 2002-10-22 Akim Demaille <akim@epita.fr>
14844 * src/system.h: Include sys/types.
14845 Reported by Bert Deknuydt.
14847 2002-10-23 Paul Eggert <eggert@twinsun.com>
14849 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
14850 Suggested by Art Haas.
14852 2002-10-22 Paul Eggert <eggert@twinsun.com>
14854 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
14855 decl; not needed any more.
14856 * src/main.c (main): Use return to exit, undoing yesterday's change.
14857 The last OS that we could find where this wouldn't work is
14858 SunOS 3.5, and that's too old to worry about now.
14860 * data/glr.c (struct yyltype): Define members even when not
14861 doing locations. This is more consistent with yacc.c, and it
14862 works around the following bug reports:
14863 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
14864 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
14866 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
14867 @acronym consistently. Standardize on "Yacc" instead of "YACC",
14868 "Algol" instead of "ALGOL". Give a bit more history about BNF.
14870 2002-10-22 Akim Demaille <akim@epita.fr>
14872 * data/README: New.
14874 2002-10-21 Paul Eggert <eggert@twinsun.com>
14876 Be consistent about 'bool'; the old code used an enum in one
14877 module and an int in another, and this violates the C standard.
14878 * m4/stdbool.m4: New file, from coreutils 4.5.3.
14879 * configure.ac (AC_HEADER_STDBOOL): Add.
14880 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
14881 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
14882 * src/symtab.c (hash_compare_symbol_t): Likewise.
14883 * src/system.h (bool, false, true): Use a definition consistent
14884 with ../lib/hash.c. All uses changed.
14886 * src/complain.c (warning_issued): Renamed from warn_message_count,
14887 so that we needn't worry about integer overflow (!).
14888 Now of type bool. All uses changed.
14889 (complaint_issued): Renamed from complain_message_count; likewise.
14891 * src/main.c (main): Use exit to exit with failure.
14893 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
14894 rather than 1 and 0.
14895 * src/main.c (main): Likewise.
14896 * src/getargs.c (getargs): Likewise.
14897 * src/reader.c (reader): Likewise.
14899 * src/getarg.c (getargs): Remove duplicate code for
14900 "Try `bison --help'".
14902 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
14903 What was that "2" for?
14905 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
14906 * src/getargs.c (usage): Likewise.
14908 * src/getargs.c (getargs): When there are too few operands, report
14909 the last one. When there are too many, report the first extra
14910 one. This is how diffutils does it.
14912 2002-10-20 Paul Eggert <eggert@twinsun.com>
14914 Remove K&R vestiges.
14915 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
14916 * src/complain.c (VA_START): Remove. Assume prototypes.
14917 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
14918 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
14919 fatal): Assume prototypes.
14920 * src/complain.h: Assume prototypes.
14921 * src/system.h (PARAMS): Remove.
14922 Include <limits.h> unconditionally, since it's guaranteeed even
14923 for a freestanding C89 compiler.
14924 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
14925 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
14927 2002-10-20 Akim Demaille <akim@epita.fr>
14929 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
14930 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
14931 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
14932 (yyresolveStates, yyresolveAction, yyresolveStack)
14933 (yyprocessOneStack): Use them.
14934 (yy_reduce_print): New.
14935 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
14937 2002-10-20 Akim Demaille <akim@epita.fr>
14939 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
14940 arguments and output `void'.
14941 (b4_c_function): Rename as...
14942 (b4_c_function_def): this.
14943 (b4_c_function_decl, b4_c_ansi_function_def)
14944 (b4_c_ansi_function_decl): New.
14945 Change the interpretation of the arguments: before `int, foo', now
14947 * data/yacc.c (yyparse): Prototype and define thanks to these.
14948 Adjust b4_c_function_def uses.
14949 * data/glr.c (yyparse): Likewise, but ANSI only.
14951 2002-10-20 Akim Demaille <akim@epita.fr>
14953 * src/output.c (prepare): Move the definition of `tokens_number',
14954 `nterms_number', `undef_token_number', `user_token_number_max'
14956 (prepare_tokens): Here.
14957 (prepare_tokens): Rename as...
14958 (prepare_symbols): this.
14959 (prepare): Move the definition of `rules_number' to...
14960 (prepare_rules): here.
14961 (prepare): Move the definition of `last', `final_state_number',
14962 `states_number' to...
14963 (prepare_states): here.
14964 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
14966 2002-10-20 Akim Demaille <akim@epita.fr>
14968 * src/tables.h, src/tables.c, src/output.c: Comment changes.
14970 2002-10-20 Akim Demaille <akim@epita.fr>
14972 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
14975 2002-10-20 Akim Demaille <akim@epita.fr>
14977 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
14978 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
14980 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
14982 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
14983 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
14986 2002-10-19 Paul Eggert <eggert@twinsun.com>
14988 Do not create a temporary file, as that involves security and
14989 cleanup headaches. Instead, use a pair of pipes.
14990 Derived from a suggestion by Florian Krohm.
14991 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
14992 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
14993 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
14994 (BISON_PREREQ_SUBPIPE): Add.
14995 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
14996 Add subpipe.h, subpipe.c.
14997 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
14998 * po/POTFILES.in: Add lib/subpipe.c.
14999 * src/output.c: Include "subpipe.h".
15000 (m4_invoke): Remove decl.
15001 (scan_skel): New decl.
15002 (output_skeleton): Use pipe rather than temporary file for m4 input.
15003 Check that m4sugar.m4 is readable, to avoid deadlock.
15004 Check for pipe I/O error.
15005 * src/scan-skel.l (readpipe): Remove decl.
15006 (scan_skel): New function, to be used in place of m4_invoke.
15007 Read from stream rather than file.
15009 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
15010 float, as this generates a warning on Solaris 8 + GCC 3.2 with
15011 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
15012 this generates a more-accurate value anyway.
15014 * lib/timevar.c (timervar_accumulate): Rename locals to
15015 avoid confusion with similarly-named more-global.
15016 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
15018 * src/output.c (prepare): Use xstrdup to convert char const *
15019 to char *, to avoid GCC warning.
15021 2002-10-19 Akim Demaille <akim@epita.fr>
15023 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
15024 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
15025 Use them to have `calc.y' ready for %pure-parser.
15026 * data/yacc.c (YYLEX): Pass a yylex return type to
15027 b4_c_function_call.
15029 2002-10-19 Akim Demaille <akim@epita.fr>
15031 Prototype support of %lex-param and %parse-param.
15033 * src/parse-gram.y: Add the definition of the %lex-param and
15034 %parse-param tokens, plus their rules.
15035 Drop the `_' version of %glr-parser.
15037 * src/scan-gram.l (INITIAL): Scan them.
15038 * src/muscle_tab.c: Comment changes.
15039 (muscle_insert, muscle_find): Rename `pair' as `probe'.
15040 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
15041 (muscle_entry_s): The `value' member is no longer const.
15042 Adjust all dependencies.
15043 * src/muscle_tab.c (muscle_init): Adjust: use
15044 MUSCLE_INSERT_STRING.
15045 Initialize the obstack earlier.
15046 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
15047 (muscle_pair_list_grow): New.
15048 * data/c.m4 (b4_c_function_call, b4_c_args): New.
15049 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
15050 * tests/calc.at: Use %locations, not --locations.
15051 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
15053 2002-10-19 Akim Demaille <akim@epita.fr>
15055 * src/getargs.c (usage): Take status as argument and exit
15057 Report the traditional `Try ... --help' message when status != 0.
15058 (usage, version): Don't take a FILE * as arg, it is pointless.
15059 (getargs): When there is an incorrect number of arguments, make it
15060 an error, and report it GNUlically thanks to `usage ()'.
15062 2002-10-18 Paul Eggert <eggert@twinsun.com>
15064 * data/glr.c (yyreportParseError): Don't assume that sprintf
15065 yields the length of the printed string, as this is not true
15066 on SunOS 4.1.4. Reported by Peter Klein.
15068 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
15069 * tests/conflicts.at (%nonassoc and eof): Likewise.
15070 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
15072 2002-10-17 Akim Demaille <akim@epita.fr>
15074 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
15075 * src/getargs.c (trace_types, trace_args): Adjust.
15076 * src/reader.c (grammar_current_rule_prec_set)
15077 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
15078 Standardize error messages.
15079 And s/@prec/%prec/!
15080 (reader): Use trace_flag to enable scanner/parser debugging,
15081 instead of an adhoc scheme.
15082 * src/scan-gram.l: Remove trailing debugging code.
15084 2002-10-16 Paul Eggert <eggert@twinsun.com>
15086 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
15089 * NEWS: Officially drop support for building Bison with K&R C,
15090 since it didn't work anyway and it's not worth worrying about.
15091 * Makefile.maint (wget_files): Remove ansi2knr.c.
15092 (ansi2knr.c-url_prefix): Remove.
15093 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
15094 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15095 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15097 2002-10-15 Paul Eggert <eggert@twinsun.com>
15099 Stop using the "enum_" trick for K&R-style function definitions;
15100 it confused me, and I was the author! Instead, assume that people
15101 who want to use K&R C compilers (when using these modules in GCC,
15102 perhaps?) will run ansi2knr.
15104 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
15105 All uses of "enum_" changed to "enum ".
15106 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
15107 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
15109 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
15110 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
15111 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
15112 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
15113 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
15114 abitset_not, abitset_ones, abitset_or, abitset_or_and,
15115 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
15116 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
15117 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
15118 Use function prototypes; this removes the need for declaring
15119 static functions simply to provide their prototypes.
15120 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
15121 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
15122 bitset_count_, bitset_create, bitset_dump, bitset_first,
15123 bitset_free, bitset_init, bitset_last, bitset_next,
15124 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
15125 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
15126 bitset_print, bitset_release_memory, bitset_toggle_,
15127 bitset_type_choose, bitset_type_get, bitset_type_name_get,
15128 debug_bitset): Likewise.
15129 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
15130 * lib/bitset_stats.c (bitset_log_histogram_print,
15131 bitset_percent_histogram_print, bitset_stats_and,
15132 bitset_stats_and_cmp, bitset_stats_and_or,
15133 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
15134 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
15135 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
15136 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
15137 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
15138 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
15139 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
15140 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
15141 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
15142 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
15143 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
15144 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
15145 bitset_stats_zero): Likewise.
15146 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
15147 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
15148 bitsetv_dump, debug_bitsetv): Likewise.
15149 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
15150 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
15151 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
15152 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
15153 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
15154 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
15155 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
15156 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
15157 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
15158 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
15159 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
15161 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
15162 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
15163 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
15164 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
15165 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
15166 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
15167 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
15168 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
15169 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
15170 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
15171 lbitset_xor_cmp, lbitset_zero): Likewise.
15173 2002-10-14 Akim Demaille <akim@epita.fr>
15177 2002-10-14 Akim Demaille <akim@epita.fr>
15179 * tests/Makefile.am (maintainer-check-posix): New.
15181 2002-10-14 Akim Demaille <akim@epita.fr>
15183 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
15186 2002-10-14 Akim Demaille <akim@epita.fr>
15188 * src/tables.c (table_ninf_remap): base -> tab.
15189 Reported by Matt Rosing.
15191 2002-10-14 Paul Eggert <eggert@twinsun.com>
15193 * tests/action.at, tests/calc.at, tests/conflicts.at,
15194 tests/cxx-type.at, tests/headers.at, tests/input.at,
15195 tests/regression.at, tests/synclines.at, tests/torture.at:
15196 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
15197 so that the tests still work even if POSIXLY_CORRECT is set.
15198 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
15200 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
15201 for portability to K&R hosts. Fix typo: signed char is guaranteed
15202 only to 127, not to 128.
15203 * data/glr.c (yysigned_char): New type.
15204 * data/yacc.c (yysigned_char): Likewise.
15205 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
15207 2002-10-13 Paul Eggert <eggert@twinsun.com>
15209 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
15210 true due to limited range of data type" warning from GCC.
15212 * data/c.m4 (b4_token_defines): Protect against double-inclusion
15213 by wrapping enum yytokentype's definition inside #ifndef
15214 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
15216 2002-10-13 Akim Demaille <akim@epita.fr>
15218 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
15219 Un yy- yyrhs to avoid the name clash with the global YYRHS.
15221 2002-10-13 Akim Demaille <akim@epita.fr>
15223 * Makefile.maint: Update from Autoconf 2.54.
15224 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
15226 2002-10-13 Akim Demaille <akim@epita.fr>
15228 * src/print.c (print_state): Separate the list of solved conflicts
15229 from the other items.
15230 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
15232 2002-10-13 Akim Demaille <akim@epita.fr>
15234 Let nondeterministic skeletons be usable with deterministic
15237 With the patch, GAWK compiled by GCC without -O2 passes its test
15238 suite using a GLR parser driven by LALR tables. It fails with -O2
15239 because `struct stat' gives two different answers on my machine:
15240 88 (definition of an auto var) and later 96 (memset on this var).
15241 Hence the stack is badly corrumpted. The headers inclusion is to
15242 blame: if I move the awk.h inclusion before GLR's system header
15243 inclusion, the two struct stat have the same size.
15245 * src/tables.c (pack_table): Always create conflict_table.
15246 (token_actions): Always create conflict_list.
15247 * data/glr.c (YYFLAG): Remove, unused.
15249 2002-10-13 Akim Demaille <akim@epita.fr>
15251 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
15253 (VALGRIND, GXX): New.
15254 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
15255 * tests/bison.in: Run $PREBISON a pre-command.
15256 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
15257 (maintainer-check-g++): New.
15258 * Makefile.am (maintainer-check): New.
15260 2002-10-13 Akim Demaille <akim@epita.fr>
15262 * data/glr.c: Formatting changes.
15263 Tweak some trace messages to match yacc.c's.
15265 2002-10-13 Akim Demaille <akim@epita.fr>
15267 GLR parsers sometimes raise parse errors instead of performing the
15269 Reported by Charles-Henry de Boysson.
15271 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
15272 check the length of the traces when %glr.
15273 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
15275 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
15277 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
15278 (yyltype): Remove the yy prefix from the member names.
15279 (yytable): Complete its comment.
15280 (yygetLRActions): Map error action number from YYTABLE from
15282 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
15283 (which was a bug: it should have been YYTABEL_NINF, and yet it was
15284 not satisfying as we could compare an YYACTION computed from
15285 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
15286 only value for error actions.
15287 (yyreportParseError): In verbose parse error messages, don't issue
15288 `error' in the list of expected tokens.
15289 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
15290 next action to perform to match glr.c's decoding.
15291 (yytable): Complete its comment.
15293 2002-10-13 Paul Eggert <eggert@twinsun.com>
15295 Fix problem reported by Henrik Grubbstroem in
15296 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
15297 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
15298 because the Bison parser reads the second action before reducing
15300 * src/scan-gram.l (rule_length): New static var.
15301 Use it to keep track of the rule length in the scanner, since
15302 we can't expect the parser to be in lock-step sync with the scanner.
15303 (handle_action_dollar, handle_action_at): Use this var.
15304 * tests/actions.at (Exotic Dollars): Test for the problem.
15306 2002-10-12 Paul Eggert <eggert@twinsun.com>
15308 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
15309 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
15310 Include <sys/time.h> when checking for clock_t and struct tms.
15311 Use same include order as source.
15312 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
15313 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
15315 * lib/timevar.c: Update copyright date and clarify comments.
15316 (get_time) [IN_GCC]: Keep the GCC version for reference.
15318 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
15319 GCC version as of today, then merge Bison's changes.
15320 Change "GCC" to "Bison" in copyright notice. timevar.def's
15321 author is Akim, so change that too.
15323 * src/reader.c (grammar_current_rule_check):
15324 Don't worry about the default action if $$ is untyped.
15325 Prevents bogus warnings reported by Jim Gifford in
15326 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
15328 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
15329 * data/glr.c, data/lalr1.cc, data/yacc.c:
15330 Output token definitions before the first part of user declarations.
15331 Fixes compatibility problem reported by Jim Gifford for kbd in
15332 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
15334 2002-10-11 Paul Eggert <eggert@twinsun.com>
15336 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
15337 (yyparse): here. This undoes some of the 2002-07-25 change.
15338 Compatibility problem reported by Ralf S. Engelschall with
15339 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
15341 2002-10-11 Akim Demaille <akim@epita.fr>
15343 * tests/regression.at Characters Escapes): New.
15344 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
15346 Reported by Jan Nieuwenhuizen.
15348 2002-10-11 Akim Demaille <akim@epita.fr>
15352 2002-10-10 Paul Eggert <eggert@twinsun.com>
15354 Portability fixes for bitsets; this also avoids several GCC
15357 * lib/abitset.c: Include <stddef.h>, for offsetof.
15358 * lib/lbitset.c: Likewise.
15360 * lib/abitset.c (abitset_bytes): Return a size that is aligned
15361 properly for vectors of objects. Do not assume that adding a
15362 header size to a multiple of a word size yields a value that is
15363 properly aligned for the whole union.
15364 * lib/bitsetv.c (bitsetv_alloc): Likewise.
15366 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
15367 unique names for structures.
15368 * lib/ebitset.c (ebitset_bytes): Likewise.
15369 * lib/lbitset.c (lbitset_bytes): Likewise.
15371 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
15372 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
15373 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
15374 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
15375 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
15376 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
15377 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
15378 to improve the type-checking that GCC can do.
15379 * lib/bitset.c (bitset_op4_cmp): Likewise.
15380 * lib/bitset_stats.c (bitset_stats_count,
15381 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
15382 bitset_stats_copy, bitset_stats_disjoint_p,
15383 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
15384 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
15385 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
15386 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
15387 bitset_stats_and_or_cmp, bitset_stats_andn_or,
15388 bitset_stats_andn_or_cmp, bitset_stats_or_and,
15389 bitset_stats_or_and_cmp): Likewise.
15390 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
15391 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
15392 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
15393 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
15395 * lib/abitset.h: Include bitset.h, not bbitset.h.
15396 * lib/ebitset.h: Likewise.
15397 * lib/lbitset.h: Likewise.
15399 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
15400 All instances of parameters of type enum bitset_opts are now of
15401 type enum_bitset_opts, to conform to the C Standard, and similarly
15402 for enum_bitset_type.
15403 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
15404 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
15406 Do not use "struct bitset_struct" to mean different things in
15407 different modules. Not only is this confusing, it violates
15408 the C Standard, which requires that structure types in different
15409 modules must be compatible if one is to be passed to the other.
15410 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
15411 All instances of "struct bitset_struct *" replaced with "bitset".
15412 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
15413 (union bitset_union, struct abitset_struct, struct ebitset_struct,
15414 struct lbitset_struct, struct bitset_stats_struct): New types.
15415 All uses of struct bitset_struct changed to union bitset_union,
15417 * lib/abitset.c (struct abitset_struct, abitset,
15418 struct bitset_struct): Remove.
15419 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
15420 struct bitset_struct): Remove.
15421 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
15422 bitset_struct): Remove.
15423 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
15426 Do not call a function of type T using a call that assumes the
15427 function is of a different type U. Standard C requires that a
15428 function must be called with a type that is compatible with its
15430 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
15432 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
15434 * lib/ebitset.c (PFV): Remove.
15435 * lib/lbitset.c (PFV): Likewise.
15436 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
15437 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
15439 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
15440 (ebitset_vtable): Use them.
15441 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
15442 lbitset_xor): New functions.
15443 (lbitset_vtable): Use them.
15445 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
15448 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
15450 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
15451 Use offsetof, for simplicity.
15453 2002-10-06 Paul Eggert <eggert@twinsun.com>
15455 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
15456 the same width as int. This reapplies a hunk of the 2002-08-12 patch
15457 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
15458 which was inadvertently undone by the 2002-09-30 patch.
15459 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
15460 the same width as int.
15462 2002-10-04 Paul Eggert <eggert@twinsun.com>
15466 * configure.ac (AC_INIT), NEWS: Increment version number.
15468 * doc/bison.texinfo: Minor spelling, grammar, and white space
15470 (Symbols): Mention that any negative value returned from yylex
15471 signifies end-of-input. Warn about negative chars. Mention
15472 the portable Standard C character set.
15474 The GNU coding standard says CFLAGS and YFLAGS are reserved
15475 for the installer to set.
15476 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
15477 * src/Makefile.am (AM_CFLAGS): Likewise.
15478 (AM_YFLAGS): Renamed from YFLAGS.
15480 Fix some MAX and MIN problems.
15481 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
15482 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
15483 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
15484 * src/reader.c (reader): Use it.
15486 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
15487 POSIX 1003.1-2001 has removed fgrep.
15489 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
15491 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
15492 interpreted as signed.
15493 * lib/ebitset.c (ebitset_list): Fix bug.
15495 2002-10-01 Paul Eggert <eggert@twinsun.com>
15497 More fixes for 64-bit hosts and large bitsets.
15499 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
15500 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
15501 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
15502 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
15503 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
15504 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
15505 bitset_count_): Likewise.
15506 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
15507 bitset_first, bitset_last): Likewise.
15508 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
15509 bitset_stats_list_reverse, bitset_stats_size,
15510 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
15512 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15513 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
15514 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
15515 bitsetv_reflexive_transitive_closure): Likewise.
15516 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
15517 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
15519 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
15522 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
15523 Use size_t, not unsigned int, to count bytes.
15524 * lib/abitset.h (abitset_bytes): Likewise.
15525 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
15527 * lib/bitset.h (bitset_bytes): Likewise.
15528 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
15529 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
15530 * lib/bitsetv.c (bitsetv_alloc): Likewise.
15531 * lib/ebitset.c (ebitset_bytes): Likewise.
15532 * lib/ebitset.h (ebitset_bytes): Likewise.
15533 * lib/lbitset.c (lbitset_bytes): Likewise.
15534 * lib/lbitset.h (lbitset_bytes): Likewise.
15536 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
15537 abitset_subset_p, abitset_disjoint_p, abitset_and,
15538 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
15539 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
15540 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
15541 abitset_or_and, abitset_or_and_cmp):
15542 Use bitset_windex instead of unsigned int.
15543 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15544 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
15545 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
15546 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
15548 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
15550 * lib/bitset.c (bitset_print):
15551 Use proper printf formats for widths of integer types.
15552 * lib/bitset_stats.c (bitset_percent_histogram_print,
15553 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
15554 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15555 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15556 * lib/lbitset.c (lbitset_bytes): Likewise.
15558 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
15559 BITSET_SIZE_MAX): New macros.
15560 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
15561 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
15562 to BITSET_WINDEX_MAX.
15564 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
15565 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
15566 since we now return the bitset_bindex type (not int).
15568 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
15569 when computing sizes.
15570 * lib/ebitset.c (ebitset_elts_grow): Likewise.
15572 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
15573 and avoid cast to unsigned.
15575 2002-09-30 Akim Demaille <akim@epita.fr>
15577 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
15578 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
15579 Updates from Michael Hayes.
15581 2002-09-30 Art Haas <ahaas@neosoft.com>
15583 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
15585 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
15588 2002-09-27 Akim Demaille <akim@epita.fr>
15592 2002-09-27 Akim Demaille <akim@epita.fr>
15594 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
15595 (Because of AC_LIBSOURCE).
15597 2002-09-27 Akim Demaille <akim@epita.fr>
15599 Playing with Autoscan.
15601 * configure.ac: Remove the old LIBOBJ tweaks.
15602 (AC_REPLACE_FUNCS): Add strrchr and strtol.
15603 * lib/strrchr.c: New.
15604 * lib/strtol.c: New, from the Coreutils 4.5.1.
15606 2002-09-27 Akim Demaille <akim@epita.fr>
15608 Playing with Autoscan.
15610 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
15611 * lib/Makefile.am (libbison_a_SOURCES): No longer include
15612 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
15613 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
15616 2002-09-24 Akim Demaille <akim@epita.fr>
15618 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
15619 (Frequently Asked Questions, Parser Stack Overflow): New.
15621 2002-09-13 Akim Demaille <akim@epita.fr>
15623 Playing with autoscan.
15625 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
15626 * src/files.c (skeleton_find): Remove, unused.
15627 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
15628 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
15630 2002-09-13 Akim Demaille <akim@epita.fr>
15632 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
15633 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
15635 2002-09-13 Akim Demaille <akim@epita.fr>
15637 * configure.ac: Require 2.54.
15638 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
15639 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
15640 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
15641 Remove, provided by Autoconf macros.
15643 2002-09-12 Akim Demaille <akim@epita.fr>
15645 * m4/prereq.m4: Update, from Coreutils 4.5.1.
15647 2002-09-12 Akim Demaille <akim@epita.fr>
15649 * m4/prereq.m4: Update, from Fileutils 4.1.5.
15650 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
15651 Reported by Martin Mokrejs.
15653 2002-09-10 Akim Demaille <akim@epita.fr>
15655 * src/parse-gram.y: Associate a human readable string to each
15657 * tests/regression.at (Invalid inputs): Adjust.
15659 2002-09-10 Gary V. Vaughan <gary@gnu.org>
15661 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
15662 with an Autoconf-2.5x style configure.ac.
15664 2002-09-06 Paul Eggert <eggert@twinsun.com>
15666 * doc/bison.texinfo (Conditions): Make explicit that the GPL
15667 exception applies only to yacc.c. This is a modification of a
15668 patch originally suggested by Akim Demaille.
15670 2002-09-06 Akim Demaille <akim@epita.fr>
15672 * data/c.m4 (b4_copyright): Move the GPL exception comment from
15674 * data/yacc.c: here.
15676 * data/lalr1.cc (struct yyltype): Don't define it, since we use
15678 (b4_ltype): Default to yy::Location from location.hh.
15680 2002-09-04 Jim Meyering <jim@meyering.net>
15682 * data/yacc.c: Guard the declaration of yytoknum also with
15683 `#ifdef YYPRINT', so it is declared only when used.
15685 2002-09-04 Akim Demaille <akim@epita.fr>
15687 * configure.in: Rename as...
15688 * configure.ac: this.
15691 2002-09-04 Akim Demaille <akim@epita.fr>
15693 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
15694 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
15695 translate maintainer only messages.
15697 2002-08-12 Paul Eggert <eggert@twinsun.com>
15701 * Makefile.am (SUBDIRS): Remove intl.
15702 (DISTCLEANFILES): Remove.
15703 * NEWS: Mention that GNU M4 is now required. Clarify what is
15704 meant by "larger grammars". Mention the pt_BR translation.
15705 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
15706 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
15707 Bump version from 0.11.2 to 0.11.5.
15708 (BISON_PREREQ_STAGE): Remove.
15709 (AM_GNU_GETTEXT): Use external gettext.
15710 (AC_OUTPUT): Remove intl/Makefile.
15712 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
15714 * data/glr.c: Include string.h, for strlen.
15715 (yyreportParseError): Use size_t for yysize.
15716 (yy_yypstack): No longer nested inside yypstates, as nested
15717 functions are not portable. Do not assume size_t is the
15719 (yypstates): Do not assume that ptrdiff_t is the same width
15720 as int, and similarly for yyposn and YYINDEX.
15722 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
15724 * lib/Makefile.am (INCLUDES): Do not include from the intl
15725 directory, which has been removed.
15726 * src/Makefile.am (INCLUDES): Likewise.
15728 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
15729 (bitsets_sources, additional_bitsets_sources, timevars_sources):
15732 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
15733 * tests/Makefile.am (EXTRA_DIST): Likewise.
15735 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
15736 Do not assume that bitset_windex is the same width as unsigned.
15738 * lib/abitset.c (abitset_unused_clear): Do not assume that
15739 bitset_word is the same width as int.
15740 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
15741 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
15742 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
15743 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
15744 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
15746 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
15747 portability to one's complement hosts!).
15748 * lib/ebitset.c (ebitset_op1): Likewise.
15749 * lib/lbitset.c (lbitset_op1): Likewise.
15751 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
15752 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
15753 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
15754 Sync with fileutils.
15755 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
15756 lib/gettext.h: Sync with diffutils.
15758 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
15759 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
15761 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
15762 PROTOTYPES to check for prototypes, and "defined __STDC__" to
15765 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
15766 size_t; the old version tried to do this but casted improperly.
15767 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
15768 (bitset_test): Now returns int, not unsigned long.
15770 * lib/bitset_stats.c: Include "gettext.h".
15772 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
15773 name locals "index", as it generates unnecessary warnings on some
15774 hosts that have an "index" function.
15776 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
15777 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
15778 they need translation.
15779 * src/LR0.c (state_list_append, new_itemsets, get_state,
15780 append_states, generate_states): Likewise.
15781 * src/assoc.c (assoc_to_string): Likewise.
15782 * src/closure.c (print_closure, set_firsts, closure): Likewise.
15783 * src/gram.c (grammar_dump): Likewise.
15784 * src/injections.c (injections_compute): Likewise.
15785 * src/lalr.c (lookaheads_print): Likewise.
15786 * src/relation.c (relation_transpose): Likewise.
15787 * src/scan-gram.l: Likewise.
15788 * src/tables.c (table_grow, pack_vector): Likewise.
15790 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
15791 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
15792 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
15793 * m4/mbstate_t.m4: Sync with fileutils.
15794 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
15796 * po/LINGUAS: Add pt_BR.
15797 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
15798 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
15800 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
15802 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
15804 * src/complain.c (strerror_r): Remove decl; not needed.
15805 (strerror): Use same pattern as ../lib/error.c.
15807 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
15809 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
15811 * src/main.c (main): Cast result of bindtextdomain and textdomain
15812 to void, to avoid a GCC warning when --disable-nls is in effect.
15814 * src/scan-gram.l: Use strings rather than escapes when possible,
15815 to minimize the number of warnings from xgettext.
15816 (handle_action_dollar, handle_action_at): Don't use isdigit,
15817 as it mishandles negative chars and it may not work as expected
15818 outside the C locale.
15820 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
15821 this is a GCC extension and is not portable to other compilers.
15823 * src/system.h (alloca): Use same pattern as ../lib/error.c.
15824 Do not include <ctype.h>; no longer needed.
15825 Do not include <malloc.h>; no longer needed (and generates
15826 warnings on OpenBSD 3.0).
15828 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
15831 * tests/regression.at: Do not use 'cc -c input.c -o input';
15832 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
15834 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
15835 exit status as failure, not just exit status 1. Sun C exits
15836 with status 2 sometimes.
15838 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
15839 Use it for the two large tests.
15841 2002-08-02 Akim Demaille <akim@epita.fr>
15843 * src/conflicts.c (conflicts_output): Don't output rules never
15844 reduced here, since anyway that computation doesn't work.
15845 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
15846 (rule_useless_p, rule_never_reduced_p): New.
15847 (grammar_rules_partial_print): Use a filter instead of a range.
15848 Display the title only if needed.
15849 (grammar_rules_print): Adjust.
15850 (grammar_rules_never_reduced_report): New.
15851 * src/tables.c (action_row): Move the computation of rules never
15853 (token_actions): here.
15854 * src/main.c (main): Make the parser before making the report, so
15855 that rules never reduced are computed.
15856 Call grammar_rules_never_reduced_report.
15857 * src/print.c (print_results): Report rules never reduced.
15858 * tests/conflicts.at, tests/reduce.at: Adjust.
15860 2002-08-01 Akim Demaille <akim@epita.fr>
15862 Instead of attaching lookaheads and duplicating the rules being
15863 reduced by a state, attach the lookaheads to the reductions.
15865 * src/state.h (state_t): Remove the `lookaheads',
15866 `lookaheads_rule' member.
15867 (reductions_t): Add a `lookaheads' member.
15868 Use a regular array for the `rules'.
15869 * src/state.c (reductions_new): Initialize the lookaheads member
15871 (state_rule_lookaheads_print): Adjust.
15872 * src/state.h, src/state.c (state_reductions_find): New.
15873 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
15874 (count_rr_conflicts): Adjust.
15875 * src/lalr.c (LArule): Remove.
15876 (add_lookback_edge): Adjust.
15877 (state_lookaheads_count): New.
15878 (states_lookaheads_initialize): Merge into...
15879 (initialize_LA): this.
15880 (lalr_free): Adjust.
15881 * src/main.c (main): Don't free nullable and derives too early: it
15882 is used by --verbose.
15883 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
15885 2002-08-01 Akim Demaille <akim@epita.fr>
15887 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
15889 (set_derives, free_derives): Rename as...
15890 (derives_compute, derives_free): this.
15891 Adjust all dependencies.
15892 * src/nullable.c (set_nullable, free_nullable): Rename as...
15893 (nullable_compute, nullable_free): these.
15894 (rule_list_t): Store rule_t *, not rule_number_t.
15895 * src/state.c (state_rule_lookaheads_print): Directly compare rule
15896 pointers, instead of their numbers.
15897 * src/main.c (main): Call nullable_free, and derives_free earlier,
15898 as they were lo longer used.
15900 2002-08-01 Akim Demaille <akim@epita.fr>
15902 * lib/timevar.c (get_time): Include children time.
15903 * src/lalr.h (LA, LArule): Don't export them: used with the
15905 * src/lalr.c (LA, LArule): Static.
15906 * src/lalr.h, src/lalr.c (lalr_free): New.
15907 * src/main.c (main): Call it.
15908 * src/tables.c (pack_vector): Check whether loc is >= to the
15910 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
15911 (tables_generate): do it, since that's also it which allocates
15913 Don't free LA and LArule, main does.
15915 2002-07-31 Akim Demaille <akim@epita.fr>
15917 Separate parser tables computation and output.
15919 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
15920 (conflict_list, conflict_list_cnt, table, check, table_ninf)
15921 (yydefgoto, yydefact, high): Move to...
15922 * src/tables.h, src/tables.c: here.
15923 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
15924 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
15925 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
15926 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
15927 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
15928 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
15929 (action_row, save_row, token_actions, save_column, default_goto)
15930 (goto_actions, sort_actions, matching_state, pack_vector)
15931 (table_ninf_remap, pack_table, prepare_actions): Move to...
15932 * src/tables.c: here.
15933 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
15934 * src/output.c (token_actions, output_base, output_conflicts)
15935 (output_check): Merge into...
15936 (prepare_actions): this.
15937 (actions_output): Rename as...
15938 (user_actions_output): this.
15939 * src/main.c (main): Call tables_generate and tables_free.
15941 2002-07-31 Akim Demaille <akim@epita.fr>
15943 Steal GCC's --time-report support.
15945 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
15946 stolen/adjusted from GCC.
15947 * m4/stage.m4: Remove time related checks.
15948 * m4/timevar.m4: New.
15949 * configure.in: Adjust.
15950 * src/system.h: Adjust to using timevar.h.
15951 * src/getargs.h, src/getargs.c: Support trace_time for
15953 * src/main.c (stage): Remove.
15954 (main): Replace `stage' invocations with timevar calls.
15955 * src/output.c: Insert pertinent timevar calls.
15957 2002-07-31 Akim Demaille <akim@epita.fr>
15959 Let --trace have arguments.
15961 * src/getargs.h (enum trace_e): New.
15962 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
15963 (long_options, short_options): --trace/-T takes an optional
15965 Change all the uses of trace_flag to reflect the new flags.
15966 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
15968 Strengthen `stage' portability.
15970 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
15971 * configure.in: Use it.
15972 Don't check for malloc.h and sys/times.h.
15973 * src/system.h: Include them when appropriate.
15974 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
15975 times and struct tms are available.
15977 2002-07-30 Akim Demaille <akim@epita.fr>
15979 In verbose parse error message, don't report `error' as an
15981 * tests/actions.at (Printers and Destructors): Adjust.
15982 * tests/calc.at (Calculator $1): Adjust.
15983 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
15984 error message, do not report the parser accepts the error token in
15987 2002-07-30 Akim Demaille <akim@epita.fr>
15989 Normalize conflict related messages.
15991 * src/complain.h, src/complain.c (warn, complain): New.
15992 * src/conflicts.c (conflicts_print): Use them.
15993 (conflict_report_yacc): New, extracted from...
15994 (conflicts_print): here.
15995 * tests/conflicts.at, tests/existing.at: Adjust.
15997 2002-07-30 Akim Demaille <akim@epita.fr>
15999 Report rules which are never reduced by the parser: those hidden
16002 * src/LR0.c (save_reductions): Don't make the final state too
16003 different: save its reduction (accept) instead of having a state
16004 without any action (no shift or goto, no reduce).
16005 Note: the final state is now a ``regular'' state, i.e., the
16006 parsers now contain `reduce 0' as default reduction.
16007 Nevertheless, since they decide to `accept' when yystate =
16008 final_state, they still will not reduce rule 0.
16009 * src/print.c (print_actions, print_reduction): Adjust.
16010 * src/output.c (action_row): Track reduced rules.
16011 (token_actions): Report rules never reduced.
16012 * tests/conflicts.at, tests/regression.at: Adjust.
16014 2002-07-30 Akim Demaille <akim@epita.fr>
16016 `stage' was accidently included in a previous patch.
16017 Initiate its autoconfiscation.
16019 * configure.in: Look for malloc.h and sys/times.h.
16020 * src/main.c (stage): Adjust.
16021 Report only when trace_flag.
16023 2002-07-29 Akim Demaille <akim@epita.fr>
16025 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
16027 (errs_t): symbol_t*, not symbol_number_t.
16028 (reductions_t): rule_t*, not rule_number_t.
16029 (FOR_EACH_SHIFT): New.
16030 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
16031 * src/print.c, src/print_graph.c: Adjust.
16033 2002-07-29 Akim Demaille <akim@epita.fr>
16035 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
16037 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
16038 (endtoken, accept): these.
16039 * src/reader.c (reader): Set endtoken's default tag to "$end".
16040 Set undeftoken's tag to "$undefined" instead of "$undefined.".
16041 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
16044 2002-07-29 Akim Demaille <akim@epita.fr>
16046 * src/reduce.c (reduce_grammar): When the language is empty,
16047 complain about the start symbol, not the axiom.
16049 * tests/reduce.at (Empty Language): New.
16051 2002-07-26 Akim Demaille <akim@epita.fr>
16053 * src/reader.h, src/reader.c (gram_error): ... can't get
16054 yycontrol without making too strong assumptions on the parser
16056 * src/output.c (prepare_tokens): Use the real 0th value of
16057 token_translations instead of `0'.
16058 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
16060 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
16061 for the time being: %locations ought to provide it to yyerror.
16063 2002-07-25 Akim Demaille <akim@epita.fr>
16065 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
16066 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
16067 * tests/regression.at (Web2c Actions): Adjust.
16069 2002-07-25 Akim Demaille <akim@epita.fr>
16071 Stop storing rules from 1 to nrules + 1.
16073 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
16074 * src/nullable.c, src/output.c, src/print.c, src/reader.c
16075 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
16076 Iterate from 0 to nrules.
16077 Use rule_number_as_item_number and item_number_as_rule_number.
16078 Adjust to `derive' now containing possibly 0.
16079 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
16080 Handle the `- 1' part in rule numbers from/to item numbers.
16081 * src/conflicts.c (log_resolution): Fix the message which reversed
16083 * src/output.c (action_row): Initialize default_rule to -1.
16084 (token_actions): Adjust.
16085 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
16087 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
16089 2002-07-25 Akim Demaille <akim@epita.fr>
16091 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
16092 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
16093 (b4_c_knr_arg_decl): New.
16094 * data/yacc.c: Use it to define yysymprint, yydestruct, and
16095 yyreport_parse_error.
16097 2002-07-25 Akim Demaille <akim@epita.fr>
16099 * data/yacc.c (yyreport_parse_error): New, extracted from...
16101 (yydestruct, yysymprint): Move above yyparse.
16104 2002-07-25 Akim Demaille <akim@epita.fr>
16106 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
16108 (b4_sint_type, b4_uint_type): these.
16109 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
16110 * tests/regression.at (Web2c Actions): Adjust.
16112 2002-07-25 Akim Demaille <akim@epita.fr>
16114 * src/gram.h (TIEM_NUMBER_MAX): New.
16115 (item_number_of_rule_number, rule_number_of_item_number): Rename
16117 (rule_number_as_item_number, item_number_as_rule_number): these.
16118 Adjust dependencies.
16119 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
16120 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
16121 (symbol_number_to_vector_number): New.
16122 (order): Of vector_number_t* type.
16123 (base_t, BASE_MAX, BASE_MIN): New.
16124 (froms, tos, width, pos, check): Of base_t type.
16125 (action_number_t, ACTION_MIN, ACTION_MAX): New.
16126 (actrow): Of action_number_t type.
16127 (conflrow): Of unsigned int type.
16128 (table_ninf, base_ninf): New.
16129 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
16130 (muscle_insert_int_table, muscle_insert_base_table)
16131 (muscle_insert_rule_number_table): New.
16132 (prepare_tokens): Output `toknum' as int_table.
16133 (action_row): Returns a rule_number_t.
16134 Use ACTION_MIN, not SHRT_MIN.
16135 (token_actions): yydefact is rule_number_t*.
16136 (table_ninf_remap): New.
16137 (pack_table): Use it for `base' and `table'.
16138 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
16140 (YYPACT_NINF, YYTABLE_NINF): these.
16141 (yypact, yytable): Compute their types instead of hard-coded
16143 * tests/regression.at (Web2c Actions): Adjust.
16145 2002-07-19 Akim Demaille <akim@epita.fr>
16147 * src/scan-gram.l (id): Can start with an underscore.
16149 2002-07-16 Akim Demaille <akim@epita.fr>
16151 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
16152 Adjust all former `associativity' dependencies.
16153 * src/symtab.c (symbol_new): Default associativity is `undef', not
16155 (symbol_check_alias_consistence): Adjust.
16157 2002-07-09 Akim Demaille <akim@epita.fr>
16159 * doc/bison.texinfo: Properly set the ``header'' part.
16160 Use @dircategory ``GNU programming tools'' as per Texinfo's
16164 2002-07-09 Akim Demaille <akim@epita.fr>
16166 * lib/quotearg.h: Protect against multiple inclusions.
16167 * src/location.h (location_t): Add a `file' member.
16168 (LOCATION_RESET, LOCATION_PRINT): Adjust.
16169 * src/complain.c (warn_at, complain_at, fatal_at): Drop
16170 `error_one_per_line' support.
16172 2002-07-09 Akim Demaille <akim@epita.fr>
16174 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
16175 * src/reader.c (lineno): Remove.
16176 Adjust all dependencies.
16177 (get_merge_function): Take a location and use complain_at.
16178 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
16179 * tests/regression.at (Invalid inputs, Mixing %token styles):
16182 2002-07-09 Akim Demaille <akim@epita.fr>
16184 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
16185 recovery rule, and forbid extensions when --yacc.
16186 (gram_error): Use complain_at.
16187 * src/reader.c (reader): Exit if there were parse errors.
16189 2002-07-09 Akim Demaille <akim@epita.fr>
16191 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
16192 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
16193 Reported by R Blake <blakers@mac.com>.
16195 2002-07-09 Akim Demaille <akim@epita.fr>
16197 * data/yacc.c: Output the copyright notive in the header.
16199 2002-07-03 Akim Demaille <akim@epita.fr>
16201 * src/output.c (froms, tos): Are state_number_t.
16202 (save_column): sp, sp1, and sp2 are state_number_t.
16203 (prepare): Rename `final' as `final_state_number', `nnts' as
16204 `nterms_number', `nrules' as `rules_number', `nstates' as
16205 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
16207 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
16208 * data/lalr1.cc (nsym_): Remove, unused.
16210 2002-07-03 Akim Demaille <akim@epita.fr>
16212 * src/lalr.h, src/lalr.c (goto_number_t): New.
16213 * src/lalr.c (goto_list_t): New.
16215 * src/nullable.c (rule_list_t): New.
16217 * src/types.h: Remove.
16219 2002-07-03 Akim Demaille <akim@epita.fr>
16221 * src/closure.c (print_fderives): Use rule_rhs_print.
16222 * src/derives.c (print_derives): Use rule_rhs_print.
16223 (rule_list_t): New, replaces `shorts'.
16224 (set_derives): Add comments.
16225 * tests/sets.at (Nullable, Firsts): Adjust.
16227 2002-07-03 Akim Demaille <akim@epita.fr>
16229 * src/output.c (prepare_actions): Free `tally' and `width'.
16230 (prepare_actions): Allocate and free `order'.
16231 * src/symtab.c (symbols_free): Free `symbols'.
16232 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
16233 * src/output.c (m4_invoke): Move to...
16234 * src/scan-skel.l: here.
16235 (<<EOF>>): Close yyout, and free its name.
16237 2002-07-03 Akim Demaille <akim@epita.fr>
16239 Fix some memory leaks, and fix a bug: state 0 was examined twice.
16241 * src/LR0.c (new_state): Merge into...
16242 (state_list_append): this.
16243 (new_states): Merge into...
16244 (generate_states): here.
16245 (set_states): Don't ensure a proper `errs' state member here, do it...
16246 * src/conflicts.c (conflicts_solve): here.
16247 * src/state.h, src/state.c: Comment changes.
16248 (state_t): Rename member `shifts' as `transitions'.
16249 Adjust all dependencies.
16250 (errs_new): For consistency, also take the values as argument.
16251 (errs_dup): Remove.
16252 (state_errs_set): New.
16253 (state_reductions_set, state_transitions_set): Assert that no
16254 previous value was assigned.
16256 (states_free): Use it.
16257 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
16258 temporary storage: use `errs' and `nerrs' as elsewhere.
16259 (set_conflicts): Allocate and free this `errs'.
16261 2002-07-02 Akim Demaille <akim@epita.fr>
16263 * lib/libiberty.h: New.
16264 * lib: Update the bitset implementation from upstream.
16265 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
16266 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
16267 * src/main.c: Adjust bitset stats calls.
16269 2002-07-01 Paul Eggert <eggert@twinsun.com>
16271 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
16272 char, so that negative chars don't collide with $.
16274 2002-06-30 Akim Demaille <akim@epita.fr>
16276 Have the GLR tests be `warning' checked, and fix the warnings.
16278 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
16279 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
16280 (yyremoveDeletes): `yyi' and `yyj' are size_t.
16281 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
16282 (yyaddDeferredAction): static.
16283 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
16284 (yyreportParseError): yyprefix is const.
16285 yytokenp is used only when verbose.
16286 (yy__GNUC__): Replace with __GNUC__.
16287 (yypdumpstack): yyi is size_t.
16288 (yypreference): Un-yy local variables and arguments, to avoid
16289 clashes with `yyr1'. Anyway, we are not in the user name space.
16290 (yytname_size): be an int, as is compared with ints.
16291 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
16293 * tests/cxx-gram.at: Use quotation to protect $1.
16294 Use AT_COMPILE to enable warnings hunts.
16295 Prototype yylex and yyerror.
16297 Include `string.h', not `strings.h'.
16298 Produce and prototype stmtMerge only when used.
16299 yylex takes a location.
16301 2002-06-30 Akim Demaille <akim@epita.fr>
16303 We spend a lot of time in quotearg, in particular when --verbose.
16305 * src/symtab.c (symbol_get): Store a quoted version of the key.
16306 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
16307 Adjust all callers.
16309 2002-06-30 Akim Demaille <akim@epita.fr>
16311 * src/state.h (reductions_t): Rename member `nreds' as num.
16312 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
16313 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
16315 2002-06-30 Akim Demaille <akim@epita.fr>
16317 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
16318 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
16319 (shifts_to): Rename as...
16320 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
16321 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
16322 (TRANSITION_IS_DISABLED, transitions_to): these.
16324 2002-06-30 Akim Demaille <akim@epita.fr>
16326 * src/print.c (print_shifts, print_gotos): Merge into...
16327 (print_transitions): this.
16328 (print_transitions, print_errs, print_reductions): Align the
16329 lookaheads columns.
16330 (print_core, print_transitions, print_errs, print_state,
16331 print_grammar): Output empty lines separator before, not after.
16332 (state_default_rule_compute): Rename as...
16333 (state_default_rule): this.
16334 * tests/conflicts.at (Defaulted Conflicted Reduction),
16335 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
16336 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
16338 2002-06-30 Akim Demaille <akim@epita.fr>
16340 Display items as we display rules.
16342 * src/gram.h, src/gram.c (rule_lhs_print): New.
16343 * src/gram.c (grammar_rules_partial_print): Use it.
16344 * src/print.c (print_core): Likewise.
16345 * tests/conflicts.at (Defaulted Conflicted Reduction),
16346 (Unresolved SR Conflicts): Adjust.
16347 (Unresolved SR Conflicts): Adjust and rename as...
16348 (Resolved SR Conflicts): this, as was meant.
16349 * tests/regression.at (Web2c Report): Adjust.
16351 2002-06-30 Akim Demaille <akim@epita.fr>
16353 * src/print.c (state_default_rule_compute): New, extracted from...
16354 (print_reductions): here.
16355 Pessimize, but clarify the code.
16356 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
16358 2002-06-30 Akim Demaille <akim@epita.fr>
16360 * src/output.c (action_row): Let default_rule be always a rule
16363 2002-06-30 Akim Demaille <akim@epita.fr>
16365 * src/closure.c (print_firsts, print_fderives, closure):
16366 Use BITSET_EXECUTE.
16367 * src/lalr.c (lookaheads_print): Likewise.
16368 * src/state.c (state_rule_lookaheads_print): Likewise.
16369 * src/print_graph.c (print_core): Likewise.
16370 * src/print.c (print_reductions): Likewise.
16371 * src/output.c (action_row): Likewise.
16372 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
16374 2002-06-30 Akim Demaille <akim@epita.fr>
16376 * src/print_graph.c: Use report_flag.
16378 2002-06-30 Akim Demaille <akim@epita.fr>
16380 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
16382 * src/relation.h, src/relation.c (traverse, relation_digraph)
16383 (relation_print, relation_transpose): New.
16385 2002-06-30 Akim Demaille <akim@epita.fr>
16387 * src/state.h, src/state.c (shifts_to): New.
16388 * src/lalr.c (build_relations): Use it.
16390 2002-06-30 Akim Demaille <akim@epita.fr>
16392 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
16393 (item_number_of_rule_number, rule_number_of_item_number): New.
16394 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
16395 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
16396 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
16397 Propagate their use.
16398 Much remains to be done, in particular wrt `shorts' from types.h.
16400 2002-06-30 Akim Demaille <akim@epita.fr>
16402 * src/symtab.c (symbol_new): Initialize the `printer' member.
16404 2002-06-30 Akim Demaille <akim@epita.fr>
16406 * src/LR0.c (save_reductions): Remove, replaced by...
16407 * src/state.h, src/state.c (state_reductions_set): New.
16408 (reductions, errs): Rename as...
16409 (reductions_t, errs_t): these.
16410 Adjust all dependencies.
16412 2002-06-30 Akim Demaille <akim@epita.fr>
16414 * src/LR0.c (state_list_t, state_list_append): New.
16415 (first_state, last_state): Now symbol_list_t.
16416 (this_state): Remove.
16417 (new_itemsets, append_states, save_reductions): Take a state_t as
16419 (set_states, generate_states): Adjust.
16420 (save_shifts): Remove, replaced by...
16421 * src/state.h, src/state.c (state_shifts_set): New.
16422 (shifts): Rename as...
16424 Adjust all dependencies.
16425 * src/state.h (state_t): Remove the `next' member.
16427 2002-06-30 Akim Demaille <akim@epita.fr>
16429 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
16432 2002-06-30 Akim Demaille <akim@epita.fr>
16434 Use hash.h for the state hash table.
16436 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
16437 (allocate_storage): Use state_hash_new.
16438 (free_storage): Use state_hash_free.
16439 (new_state, get_state): Adjust.
16440 * src/lalr.h, src/lalr.c (states): Move to...
16441 * src/states.h (state_t): Remove the `link' member, no longer
16443 * src/states.h, src/states.c: here.
16444 (state_hash_new, state_hash_free, state_hash_lookup)
16445 (state_hash_insert, states_free): New.
16446 * src/states.c (state_table, state_compare, state_hash): New.
16447 * src/output.c (output_actions): Do not free states now, since we
16448 still need to know the final_state number in `prepare', called
16449 afterwards. Do it...
16450 * src/main.c (main): here: call states_free after `output'.
16452 2002-06-30 Akim Demaille <akim@epita.fr>
16454 * src/state.h, src/state.c (state_new): New, extracted from...
16455 * src/LR0.c (new_state): here.
16456 * src/state.h (STATE_ALLOC): Move to...
16457 * src/state.c: here.
16458 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
16459 * src/state.h, src/state.c: here.
16461 2002-06-30 Akim Demaille <akim@epita.fr>
16463 * src/reader.c (gensym): Rename as...
16464 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
16465 (getsym): Rename as...
16466 (symbol_get): this.
16468 2002-06-30 Akim Demaille <akim@epita.fr>
16470 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
16471 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
16472 * src/output.c, src/print.c, src/print_graph.c: Propagate.
16473 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
16475 2002-06-30 Akim Demaille <akim@epita.fr>
16477 Make the test suite pass with warnings checked.
16479 * tests/actions.at (Printers and Destructors): Improve.
16480 Avoid unsigned vs. signed issues.
16481 * tests/calc.at: Don't exercise the scanner here, do it...
16482 * tests/input.at (Torturing the Scanner): here.
16484 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16486 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
16487 reorganize first lines parallel to yacc.c.
16489 2002-06-28 Akim Demaille <akim@epita.fr>
16491 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
16492 (b4_token_enum, b4_token_defines): New, factored from...
16493 * data/lalr1.cc, data/yacc.c, glr.c: here.
16495 2002-06-28 Akim Demaille <akim@epita.fr>
16497 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
16499 * src/output.c (merger_output): static.
16501 2002-06-28 Akim Demaille <akim@epita.fr>
16503 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
16504 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
16506 * src/output.c (save_row): Initialize all the variables to pacify GCC.
16508 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16510 Accumulated changelog for new GLR parsing features.
16512 * src/conflicts.c (count_total_conflicts): Change name to
16513 conflicts_total_count.
16514 * src/conflicts.h: Ditto.
16515 * src/output.c (token_actions): Use the new name.
16516 (output_conflicts): Change conflp => conflict_list_heads, and
16517 confl => conflict_list for better readability.
16518 * data/glr.c: Use the new names.
16519 * NEWS: Add self to GLR announcement.
16521 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
16523 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
16526 * data/bison.glr: Change name to glr.c
16527 * data/glr.c: Renamed from bison.glr.
16528 * data/Makefile.am: Add glr.c
16532 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
16533 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
16535 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16537 * data/bison.glr: Be sure to restore the
16538 current #line when returning to the skeleton contents after having
16539 exposed the input file's #line.
16541 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16543 * data/bison.glr: Bring up to date with changes to bison.simple.
16545 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16547 * data/bison.glr: Correct definitions that use b4_prefix.
16548 Various reformatting.
16549 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
16550 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
16551 yytokenp argument; now part of stack.
16552 (yychar): Define to behave as documented.
16553 (yyclearin): Ditto.
16555 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16557 * src/reader.h: Add declaration for free_merger_functions.
16559 * src/reader.c (merge_functions): New variable.
16560 (get_merge_function): New function.
16561 (free_merger_functions): New function.
16562 (readgram): Check for %prec that is not followed by a symbol.
16563 Handle %dprec and %merge declarations.
16564 (packgram): Initialize dprec and merger fields in rules array.
16566 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
16567 conflict_list_cnt, conflict_list_free): New variables.
16568 (table_grow): Also grow conflict_table.
16569 (prepare_rules): Output dprec and merger tables.
16570 (conflict_row): New function.
16571 (action_row): Output conflict lists for GLR parser. Don't use
16572 default reduction in conflicted states for GLR parser so that there
16573 are spaces for the conflict lists.
16574 (save_row): Also save conflict information.
16575 (token_actions): Allocate conflict list.
16576 (merger_output): New function.
16577 (pack_vector): Pack conflict table, too.
16578 (output_conflicts): New function to output yyconflp and yyconfl.
16579 (output_check): Allocate conflict_tos.
16580 (output_actions): Output conflict tables, also.
16581 (output_skeleton): Output b4_mergers definition.
16582 (prepare): Output b4_max_rhs_length definition.
16583 Use 'bison.glr' as default skeleton for GLR parsers.
16585 * src/gram.c (glr_parser): New flag.
16586 (grammar_free): Call free_merger_functions.
16588 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
16589 all pairs of conflicting reductions, rather than just all tokens
16590 causing conflicts. Needed to size conflict tables.
16591 (conflicts_output): Modify call to count_rr_conflicts for new
16593 (conflicts_print): Ditto.
16594 (count_total_conflicts): New function.
16596 * src/reader.h (merger_list): New type.
16597 (merge_functions): New variable.
16599 * src/lex.h (tok_dprec, tok_merge): New token types.
16601 * src/gram.h (rule_s): Add dprec and merger fields.
16602 (glr_parser): New flag.
16604 * src/conflicts.h (count_total_conflicts): New function.
16606 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
16608 * doc/bison.texinfo (Generalized LR Parsing): New section.
16609 (GLR Parsers): New section.
16610 (Language and Grammar): Mention GLR parsing.
16611 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
16612 Correct typo ("tge" -> "the").
16614 * data/bison.glr: New skeleton for GLR parsing.
16616 * tests/cxx-gram.at: New tests for GLR parsing.
16618 * tests/testsuite.at: Include cxx-gram.at.
16620 * tests/Makefile.am: Add cxx-gram.at.
16622 * src/parse-gram.y:
16624 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
16626 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
16628 2002-06-27 Akim Demaille <akim@epita.fr>
16630 * src/options.h, src/options.c: Remove.
16631 * src/getargs.c (short_options, long_options): New.
16633 2002-06-27 Akim Demaille <akim@epita.fr>
16635 * data/bison.simple, data/bison.c++: Rename as...
16636 * data/yacc.c, data/lalr1.cc: these.
16637 * doc/bison.texinfo (Environment Variables): Remove.
16639 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
16641 * src/getargs.c (report_argmatch): Initialize strtok().
16643 2002-06-20 Akim Demaille <akim@epita.fr>
16645 * data/bison.simple (b4_symbol_actions): New, replaces...
16646 (b4_symbol_destructor, b4_symbol_printer): these.
16647 (yysymprint): Be sure to call YYPRINT only for tokens, and using
16648 user token numbers.
16650 2002-06-20 Akim Demaille <akim@epita.fr>
16652 * data/bison.simple (yydestructor): Rename as...
16653 (yydestruct): this.
16655 2002-06-20 Akim Demaille <akim@epita.fr>
16657 * src/symtab.h, src/symtab.c (symbol_type_set)
16658 (symbol_destructor_set, symbol_precedence_set): The location is
16660 Adjust all callers.
16662 2002-06-20 Akim Demaille <akim@epita.fr>
16664 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
16666 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
16668 * src/symtab.h, src/symtab.c (symbol_class_set)
16669 (symbol_user_token_number_set): Likewise.
16670 Adjust all callers.
16671 Promote complain_at.
16672 * tests/input.at (Type Clashes): Adjust.
16674 2002-06-20 Akim Demaille <akim@epita.fr>
16676 * data/bison.simple (YYLEX): Fix the declaration when
16679 2002-06-20 Akim Demaille <akim@epita.fr>
16681 * data/bison.simple (yysymprint): Don't print the token number,
16683 * tests/actions.at (Destructors): Rename as...
16684 (Printers and Destructors): this.
16685 Also exercise %printer.
16687 2002-06-20 Akim Demaille <akim@epita.fr>
16689 * data/bison.simple (YYDSYMPRINT): New.
16690 Use it to remove many of the #if YYDEBUG/if (yydebug).
16692 2002-06-20 Akim Demaille <akim@epita.fr>
16694 * src/symtab.h, src/symtab.c (symbol_t): printer and
16695 printer_location are new members.
16696 (symbol_printer_set): New.
16697 * src/parse-gram.y (PERCENT_PRINTER): New token.
16698 Handle its associated rule.
16699 * src/scan-gram.l: Adjust.
16700 (handle_destructor_at, handle_destructor_dollar): Rename as...
16701 (handle_symbol_code_at, handle_symbol_code_dollar): these.
16702 * src/output.c (symbol_printers_output): New.
16703 (output_skeleton): Call it.
16704 * data/bison.simple (yysymprint): New. Cannot be named yyprint
16705 since there are already many grammar files with a user `yyprint'.
16706 Replace the calls to YYPRINT to calls to yysymprint.
16707 * tests/calc.at: Adjust.
16708 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
16709 taking advantage of parser very internal details (stack size!).
16711 2002-06-20 Akim Demaille <akim@epita.fr>
16713 * src/scan-gram.l: Complete the scanner with the missing patterns
16715 Use `quote' and `symbol_tag_get' where appropriate.
16717 2002-06-19 Akim Demaille <akim@epita.fr>
16719 * tests/actions.at (Destructors): Augment to test locations.
16720 * data/bison.simple (yydestructor): Pass it the current location
16721 if locations are enabled.
16722 Prototype only when __STDC__ or C++.
16723 Change the argument names to move into the yy name space: there is
16726 2002-06-19 Akim Demaille <akim@epita.fr>
16728 * data/bison.simple (b4_pure_if): New.
16729 Use it instead of #ifdef YYPURE.
16731 2002-06-19 Akim Demaille <akim@epita.fr>
16733 * data/bison.simple (b4_location_if): New.
16734 Use it instead of #ifdef YYLSP_NEEDED.
16736 2002-06-19 Akim Demaille <akim@epita.fr>
16738 Prepare @$ in %destructor, but currently don't bind it in the
16739 skeleton, as %location use is not cleaned up yet.
16741 * src/scan-gram.l (handle_dollar, handle_destructor_at)
16742 (handle_action_at): New.
16743 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
16744 a braced_code_t and a location as additional arguments.
16745 (handle_destructor_dollar): Instead of requiring `b4_eval', just
16746 unquote one when outputting `b4_dollar_dollar'.
16748 * data/bison.simple (b4_eval): Remove.
16749 (b4_symbol_destructor): Adjust.
16750 * tests/input.at (Invalid @n): Adjust.
16752 2002-06-19 Zack Weinberg <zack@codesourcery.com>
16754 * doc/bison.texinfo: Document ability to have multiple
16757 2002-06-18 Akim Demaille <akim@epita.fr>
16759 * src/files.c (compute_base_names): When computing the output file
16760 names from the input file name, strip the directory part.
16762 2002-06-18 Akim Demaille <akim@epita.fr>
16764 * data/bison.simple.new: Comment changes.
16765 Reported by Andreas Schwab.
16767 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
16769 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
16770 there are no `label `yyoverflowlab' defined but not used' warnings
16771 when yyoverflow is defined.
16773 2002-06-18 Akim Demaille <akim@epita.fr>
16775 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
16777 (symbol_destructor_set): Adjust.
16778 * src/output.c (symbol_destructors_output): Output the destructor
16780 Output the symbol name.
16781 * data/bison.simple (b4_symbol_destructor): Adjust.
16783 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
16784 and Akim Demaille <akim@epita.fr>
16786 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
16787 what's left on the stack when the error recovery hits EOF.
16788 * tests/actions.at (Destructors): Complete to exercise this case.
16790 2002-06-17 Akim Demaille <akim@epita.fr>
16792 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
16793 arguments is really empty, not only equal to `[]'.
16794 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
16796 (symbol_destructor_set): New.
16797 * src/output.c (symbol_destructors_output): New.
16798 * src/reader.h (brace_code_t, current_braced_code): New.
16799 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
16800 (handle_dollar): Rename as...
16801 (handle_action_dollar): this.
16802 (handle_destructor_dollar): New.
16803 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
16804 (grammar_declaration): Use it.
16805 * data/bison.simple (yystos): Is always defined.
16806 (yydestructor): New.
16807 * tests/actions.at (Destructors): New.
16808 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
16810 2002-06-17 Akim Demaille <akim@epita.fr>
16812 * src/symlist.h, src/symlist.c (symbol_list_length): New.
16813 * src/scan-gram.l (handle_dollar, handle_at): Compute the
16814 rule_length only when needed.
16815 * src/output.c (actions_output, token_definitions_output): Output
16817 * src/symtab.c: Don't access directly to the symbol tag, use
16819 * src/parse-gram.y: Use symbol_list_free.
16821 2002-06-17 Akim Demaille <akim@epita.fr>
16823 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
16824 (symbol_list_prepend, get_type_name): Move to...
16825 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
16826 (symbol_list_prepend, symbol_list_n_type_name_get): here.
16827 Adjust all callers.
16828 (symbol_list_free): New.
16829 * src/scan-gram.l (handle_dollar): Takes a location.
16830 * tests/input.at (Invalid $n): Adjust.
16832 2002-06-17 Akim Demaille <akim@epita.fr>
16834 * src/reader.h, src/reader.c (symbol_list_new): Export it.
16835 (symbol_list_prepend): New.
16836 * src/parse-gram.y (%union): `list' is a new member.
16837 (symbols.1): New, replaces...
16838 (terms_to_prec.1, nterms_to_type.1): these.
16839 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
16840 Take a location as additional argument.
16841 Adjust all callers.
16843 2002-06-15 Akim Demaille <akim@epita.fr>
16845 * src/parse-gram.y: Move %token in the declaration section so that
16846 we don't depend upon CVS Bison.
16848 2002-06-15 Akim Demaille <akim@epita.fr>
16850 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
16851 * src/print.c (print_core): Use it.
16853 2002-06-15 Akim Demaille <akim@epita.fr>
16855 * src/conflicts.c (log_resolution): Accept the rule involved in
16856 the sr conflicts instead of the lookahead number that points to
16858 (flush_reduce): Accept the current lookahead vector as argument,
16859 instead of the index in LA.
16860 (resolve_sr_conflict): Accept the current number of lookahead
16861 bitset to consider for the STATE, instead of the index in LA.
16862 (set_conflicts): Adjust.
16863 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
16865 2002-06-15 Akim Demaille <akim@epita.fr>
16867 * src/state.h (state_t): Replace the `lookaheadsp' member, a
16868 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
16869 Adjust all dependencies.
16870 * src/lalr.c (initialize_lookaheads): Split into...
16871 (states_lookaheads_count, states_lookaheads_initialize): these.
16874 2002-06-15 Akim Demaille <akim@epita.fr>
16876 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
16878 (grammar_rules_print): here.
16879 * src/reduce.c (reduce_output): Use it.
16880 * tests/reduce.at (Useless Rules, Reduced Automaton)
16881 (Underivable Rules): Adjust.
16883 2002-06-15 Akim Demaille <akim@epita.fr>
16885 Copy BYacc's nice way to report the grammar.
16887 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
16889 Don't print the rules' location, it is confusing and useless.
16890 (rule_print): Use grammar_rhs_print.
16891 * src/print.c (print_grammar): Use grammar_rules_print.
16893 2002-06-15 Akim Demaille <akim@epita.fr>
16895 Complete and rationalize `useless thing' warnings.
16897 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
16898 (symbol_tag_print): New.
16899 Use them everywhere in place of accessing directly the tag member.
16900 * src/gram.h, src/gram.c (rule_print): New.
16901 Use it where a rule used to be printed `by hand'.
16902 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
16903 (reduce_grammar_tables): Report the useless rules.
16904 (reduce_print): Useless things are a warning, not an error.
16906 * tests/reduce.at (Useless Nonterminals, Useless Rules):
16907 (Reduced Automaton, Underivable Rules): Adjust.
16908 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
16909 * tests/conflicts.at (Unresolved SR Conflicts)
16910 (Solved SR Conflicts): Adjust.
16912 2002-06-15 Akim Demaille <akim@epita.fr>
16914 Let symbols have a location.
16916 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
16918 Adjust all callers.
16919 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
16920 Use location_t, not int.
16921 * src/symtab.c (symbol_check_defined): Take advantage of the
16923 * tests/regression.at (Invalid inputs): Adjust.
16925 2002-06-15 Akim Demaille <akim@epita.fr>
16927 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
16928 (input): Don't try to initialize yylloc here, do it in the
16930 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
16931 * src/gram.h (rule_t): Change line and action_line into location
16932 and action_location, of location_t type.
16933 Adjust all dependencies.
16934 * src/location.h, src/location.c (empty_location): New.
16935 * src/reader.h, src/reader.c (grammar_start_symbol_set)
16936 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
16937 (grammar_current_rule_symbol_append)
16938 (grammar_current_rule_action_append): Expect a location as argument.
16939 * src/reader.c (grammar_midrule_action): Adjust to attach an
16940 action's location as dummy symbol location.
16941 * src/symtab.h, src/symtab.c (startsymbol_location): New.
16942 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
16945 2002-06-14 Akim Demaille <akim@epita.fr>
16947 Grammar declarations may be found in the grammar section.
16949 * src/parse-gram.y (rules_or_grammar_declaration): New.
16950 (declarations): Each declaration may end with a semicolon, not
16952 (grammar_declaration): `"%union"'.
16953 (grammar): Branch to rules_or_grammar_declaration.
16955 2002-06-14 Akim Demaille <akim@epita.fr>
16957 * src/main.c (main): Invoke scanner_free.
16959 2002-06-14 Akim Demaille <akim@epita.fr>
16961 * src/output.c (m4_invoke): Extracted from...
16962 (output_skeleton): here.
16965 2002-06-14 Akim Demaille <akim@epita.fr>
16967 * src/parse-gram.y (directives, directive, gram)
16968 (grammar_directives, precedence_directives, precedence_directive):
16970 (declarations, declaration, grammar, grammar_declaration)
16971 (precedence_declaration, precedence_declarator): these.
16972 (symbol_declaration): New.
16974 2002-06-14 Akim Demaille <akim@epita.fr>
16976 * src/files.c (action_obstack): Remove, unused.
16977 (output_obstack): Remove it, and all its dependencies, as it is no
16979 * src/reader.c (epilogue_set): Build the epilogue in the
16981 * src/output.h, src/output.c (muscle_obstack): Move to...
16982 * src/muscle_tab.h, src/muscle_tab.h: here.
16983 (muscle_init): Initialize muscle_obstack.
16984 (muscle_free): New.
16985 * src/main.c (main): Call it.
16987 2002-06-14 Akim Demaille <akim@epita.fr>
16989 * src/location.h: New, extracted from...
16990 * src/reader.h: here.
16991 * src/Makefile.am (noinst_HEADERS): Merge into
16992 (bison_SOURCES): this.
16994 * src/parse-gram.y: Use location_t instead of Bison's.
16995 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
16996 Use location_t instead of ints.
16998 2002-06-14 Akim Demaille <akim@epita.fr>
17000 * data/bison.simple, data/bison.c++: Be sure to restore the
17001 current #line when returning to the skeleton contents after having
17002 exposed the input file's #line.
17004 2002-06-12 Akim Demaille <akim@epita.fr>
17006 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
17008 * tests/actions.at (Exotic Dollars): New.
17010 2002-06-12 Akim Demaille <akim@epita.fr>
17012 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
17014 * tests/input.at (Torturing the Scanner): New.
17016 2002-06-11 Akim Demaille <akim@epita.fr>
17018 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
17019 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
17020 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
17021 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
17022 * src/reader.c (reader): Use it.
17024 2002-06-11 Akim Demaille <akim@epita.fr>
17026 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
17027 Adjust all callers.
17028 (scanner_last_string_free): New.
17030 2002-06-11 Akim Demaille <akim@epita.fr>
17032 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
17033 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
17034 (last_string, YY_OBS_FREE): New.
17035 Use them when returning an ID.
17037 2002-06-11 Akim Demaille <akim@epita.fr>
17039 Have Bison grammars parsed by a Bison grammar.
17041 * src/reader.c, src/reader.h (prologue_augment): New.
17042 * src/reader.c (copy_definition): Remove.
17044 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
17045 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
17046 (grammar_current_rule_prec_set, grammar_current_rule_check)
17047 (grammar_current_rule_symbol_append)
17048 (grammar_current_rule_action_append): Export.
17049 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
17050 (symbol_list_action_append): Remove.
17051 Hook the routines from reader.
17052 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
17053 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
17055 * src/reader.c (read_declarations): Remove, unused.
17057 * src/parse-gram.y: Handle the epilogue.
17058 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
17059 (grammar_start_symbol_set): this.
17060 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
17061 * src/reader.c (readgram): Remove, unused.
17062 (reader): Adjust to insert eoftoken and axiom where appropriate.
17064 * src/reader.c (copy_dollar): Replace with...
17065 * src/scan-gram.h (handle_dollar): this.
17066 * src/parse-gram.y: Remove `%thong'.
17068 * src/reader.c (copy_at): Replace with...
17069 * src/scan-gram.h (handle_at): this.
17071 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
17074 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
17077 * src/reader.h, src/reader.c (grammar_rule_end): New.
17079 * src/parse.y (current_type, current_class): New.
17080 Implement `%nterm', `%token' support.
17081 Merge `%term' into `%token'.
17082 (string_as_id): New.
17083 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
17086 * src/parse-gram.y: Be sure to handle properly the beginning of
17089 * src/parse-gram.y: Handle %type.
17090 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
17092 * src/parse-gram.y: More directives support.
17093 * src/options.c: No longer handle source directives.
17095 * src/parse-gram.y: Fix %output.
17097 * src/parse-gram.y: Handle %union.
17098 Use the prologue locations.
17099 * src/reader.c (parse_union_decl): Remove.
17101 * src/reader.h, src/reader.c (epilogue_set): New.
17102 * src/parse-gram.y: Use it.
17104 * data/bison.simple, data/bison.c++: b4_stype is now either not
17105 defined, then default to int, or to the contents of %union,
17106 without `union' itself.
17108 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
17110 * src/output.c (actions_output): Don't output braces, as they are
17111 already handled by the scanner.
17113 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
17114 characters to themselves.
17116 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
17117 that the epilogue has a proper #line.
17119 * src/parse-gram.y: Handle precedence/associativity.
17121 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
17123 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
17124 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
17125 at all to define terminals that cannot be emitted.
17127 * src/scan-gram.l: Escape M4 characters.
17129 * src/scan-gram.l: Working properly with escapes in user
17130 strings/characters.
17132 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
17133 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
17135 Use more modest sizes, as for the time being the parser does not
17136 release memory, and therefore the process swallows a huge amount
17139 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
17140 stricter %token grammar.
17142 * src/symtab.h (associativity): Add `undef_assoc'.
17143 (symbol_precedence_set): Do nothing when passed an undef_assoc.
17144 * src/symtab.c (symbol_check_alias_consistence): Adjust.
17146 * tests/regression.at (Invalid %directive): Remove, as it is now
17148 (Invalid inputs): Adjust to the new error messages.
17149 (Token definitions): The new grammar doesn't allow too many
17152 * src/lex.h, src/lex.c: Remove.
17153 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
17154 (copy_character, copy_string2, copy_string, copy_identifier)
17155 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
17156 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
17157 (parse_action): Remove.
17158 * po/POTFILES.in: Adjust.
17160 2002-06-11 Akim Demaille <akim@epita.fr>
17162 * src/reader.c (parse_action): Don't store directly into the
17163 rule's action member: return the action as a string.
17164 Don't require `rule_length' as an argument: compute it.
17165 (grammar_current_rule_symbol_append)
17166 (grammar_current_rule_action_append): New, eved out from
17168 Remove `action_flag', `rulelength', unused now.
17170 2002-06-11 Akim Demaille <akim@epita.fr>
17172 * src/reader.c (grammar_current_rule_prec_set).
17173 (grammar_current_rule_check): New, eved out from...
17175 Remove `xaction', `first_rhs': useless.
17176 * tests/input.at (Type clashes): New.
17177 * tests/existing.at (GNU Cim Grammar): Adjust.
17179 2002-06-11 Akim Demaille <akim@epita.fr>
17181 * src/reader.c (grammar_midrule_action): New, Eved out from
17184 2002-06-11 Akim Demaille <akim@epita.fr>
17186 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
17188 (readgram): Use them as replacement of inlined code, crule and
17191 2002-06-11 Akim Demaille <akim@epita.fr>
17193 * src/reader.c (grammar_end, grammar_symbol_append): New.
17194 (readgram): Use them.
17195 Make the use of `p' as local as possible.
17197 2002-06-10 Akim Demaille <akim@epita.fr>
17199 GCJ's parser requires the tokens to be defined before the prologue.
17201 * data/bison.simple: Output the token definition before the user's
17203 * tests/regression.at (Braces parsing, Duplicate string)
17204 (Mixing %token styles): Check the output from bison.
17205 (Early token definitions): New.
17207 2002-06-10 Akim Demaille <akim@epita.fr>
17209 * src/symtab.c (symbol_user_token_number_set): Don't complain when
17210 assigning twice the same user number to a token, so that we can
17212 * src/lex.c (lex): here.
17213 Also use `symbol_class_set' instead of hand written code.
17214 * src/reader.c (parse_assoc_decl): Likewise.
17216 2002-06-10 Akim Demaille <akim@epita.fr>
17218 * src/symtab.c, src/symtab.c (symbol_class_set)
17219 (symbol_user_token_number_set): New.
17220 * src/reader.c (parse_token_decl): Use them.
17221 Use a switch instead of ifs.
17222 Use a single argument.
17224 2002-06-10 Akim Demaille <akim@epita.fr>
17226 Remove `%thong' support as it is undocumented, unused, duplicates
17227 `%token's job, and creates useless e-mail traffic with people who
17228 want to know what it is, why it is undocumented, unused, and
17229 duplicates `%token's job.
17231 * src/reader.c (parse_thong_decl): Remove.
17232 * src/options.c (option_table): Remove "thong".
17233 * src/lex.h (tok_thong): Remove.
17235 2002-06-10 Akim Demaille <akim@epita.fr>
17237 * src/symtab.c, src/symtab.c (symbol_type_set)
17238 (symbol_precedence_set): New.
17239 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
17240 (value_components_used): Remove, unused.
17242 2002-06-09 Akim Demaille <akim@epita.fr>
17244 Move symbols handling code out of the reader.
17246 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
17247 (axiom): Move to...
17248 * src/symtab.h, src/symtab.c: here.
17250 * src/gram.c (start_symbol): Remove: use startsymbol->number.
17251 * src/reader.c (startval): Rename as...
17252 * src/symtab.h, src/symtab.c (startsymbol): this.
17253 * src/reader.c: Adjust.
17255 * src/reader.c (symbol_check_defined, symbol_make_alias)
17256 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17257 (token_translations_init)
17259 * src/symtab.c: here.
17260 * src/reader.c (packsymbols): Move to...
17261 * src/symtab.h, src/symtab.c (symbols_pack): here.
17262 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
17265 2002-06-03 Akim Demaille <akim@epita.fr>
17267 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
17270 2002-06-03 Akim Demaille <akim@epita.fr>
17272 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
17273 structs with non literals.
17274 * src/scan-skel.l: never-interactive.
17275 * src/conflicts.c (enum conflict_resolution_e): No trailing
17277 * src/getargs.c (usage): Split long literal strings.
17278 Reported by Hans Aberg.
17280 2002-05-28 Akim Demaille <akim@epita.fr>
17282 * data/bison.c++: Use C++ ostreams.
17283 (cdebug_): New member.
17285 2002-05-28 Akim Demaille <akim@epita.fr>
17287 * src/output.c (output_skeleton): Be sure to allocate enough room
17288 for `/' _and_ for `\0' in full_skeleton.
17290 2002-05-28 Akim Demaille <akim@epita.fr>
17292 * data/bison.c++: Catch up with bison.simple:
17293 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17294 and Paul Eggert <eggert@twinsun.com>: `error' handing.
17295 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
17296 and popping traces.
17298 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17300 * src/output.c (output_skeleton): Put an explicit path in front of
17301 the skeleton file name, rather than relying on the -I directory,
17302 to partially alleviate effects of having a skeleton file lying around
17303 in the current directory.
17305 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17307 * src/conflicts.c (log_resolution): Correct typo:
17308 obstack_printf should be obstack_fgrow1.
17310 2002-05-26 Akim Demaille <akim@epita.fr>
17312 * src/state.h (state_t): `solved_conflicts' is a new member.
17313 * src/LR0.c (new_state): Set it to 0.
17314 * src/conflicts.h, src/conflicts.c (print_conflicts)
17315 (free_conflicts, solve_conflicts): Rename as...
17316 (conflicts_print, conflicts_free, conflicts_solve): these.
17318 * src/conflicts.c (enum conflict_resolution_e)
17319 (solved_conflicts_obstack): New, used by...
17320 (log_resolution): this.
17321 Adjust to attach the conflict resolution to each state.
17322 Complete the description with the precedence/associativity
17324 (resolve_sr_conflict): Adjust.
17325 * src/print.c (print_state): Output its solved_conflicts.
17326 * tests/conflicts.at (Unresolved SR Conflicts)
17327 (Solved SR Conflicts): Exercise --report=all.
17329 2002-05-26 Akim Demaille <akim@epita.fr>
17331 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17332 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
17333 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
17334 (token_number_t, item_number_as_token_number)
17335 (token_number_as_item_number, muscle_insert_token_number_table):
17337 (symbol_number_t, item_number_as_symbol_number)
17338 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
17339 these, since it is more appropriate.
17341 2002-05-26 Akim Demaille <akim@epita.fr>
17343 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
17345 * data/bison.simple (yystos) [YYDEBUG]: New.
17346 (yyparse) [YYDEBUG]: Display the symbols which are popped during
17348 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
17350 2002-05-25 Akim Demaille <akim@epita.fr>
17352 * doc/bison.texinfo (Debugging): Split into...
17353 (Tracing): this new section, its former contents, and...
17354 (Understanding): this new section.
17355 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
17357 (report_flag): this.
17358 Adjust all dependencies.
17359 (report_args, report_types, report_argmatch): New.
17360 (usage, getargs): Report/support -r, --report.
17362 (struct option_table_struct): Rename as..,
17363 (struct option_table_s): this.
17364 Rename the `set_flag' member to `flag' to match with getopt_long's
17366 * src/options.c (option_table): Split verbose into an entry for
17367 %verbose, and another for --verbose.
17368 Support --report/-r, so remove -r from the obsolete --raw.
17369 * src/print.c: Attach full item sets and lookaheads reports to
17370 report_flag instead of trace_flag.
17371 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
17373 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17374 and Paul Eggert <eggert@twinsun.com>
17376 * data/bison.simple (yyparse): Correct error handling to conform to
17377 POSIX and yacc. Specifically, after syntax error is discovered,
17378 do not reduce further before shifting the error token.
17379 Clean up the code a bit by removing the labels yyerrdefault,
17380 yyerrhandle, yyerrpop.
17381 * NEWS: Document the above.
17383 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17385 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
17386 type; it isn't always big enough, since it doesn't necessarily
17387 include non-terminals.
17388 (yytranslate): Expand definition of yy_token_number_type, so that
17389 the latter can be removed.
17390 (yy_token_number_type): Remove, only one use.
17391 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
17392 don't use TokenNumberType as element type.
17394 * tests/regression.at: Modify expected output to agree with change
17395 to yyr1 and yytranslate.
17397 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
17399 * src/reader.c (parse_action): Use copy_character instead of
17402 2002-05-13 Akim Demaille <akim@epita.fr>
17404 * tests/regression.at (Token definitions): Prototype yylex and
17407 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17409 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
17410 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
17412 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
17414 2002-05-07 Akim Demaille <akim@epita.fr>
17416 * tests/synclines.at: Be sure to prototype yylex and yyerror to
17417 avoid GCC warnings.
17419 2002-05-07 Akim Demaille <akim@epita.fr>
17423 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
17424 over the RHS of each rule.
17425 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
17426 * src/state.h (state_t): Member `nitems' is unsigned short.
17427 * src/LR0.c (get_state): Adjust.
17428 * src/reader.c (packgram): Likewise.
17429 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
17431 (muscle_insert_int_table): Remove, unused.
17432 (prepare_rules): Remove `max'.
17434 2002-05-06 Akim Demaille <akim@epita.fr>
17436 * src/closure.c (print_firsts): Display of the symbol tags.
17437 (bitmatrix_print): Move to...
17438 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
17440 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
17442 2002-05-06 Akim Demaille <akim@epita.fr>
17444 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
17447 2002-05-06 Akim Demaille <akim@epita.fr>
17449 * src/LR0.c (new_state, get_state): Instead of using the global
17450 `kernel_size' and `kernel_base', have two new arguments:
17451 `core_size' and `core'.
17454 2002-05-06 Akim Demaille <akim@epita.fr>
17456 * src/reader.c (packgram): No longer end `ritem' with a 0
17457 sentinel: it is not used.
17459 2002-05-05 Akim Demaille <akim@epita.fr>
17461 New experimental feature: display the lookaheads in the report and
17464 * src/print (print_core): When --trace-flag, display the rules
17466 * src/print_graph.c (print_core): Likewise.
17467 Swap the arguments.
17470 2002-05-05 Akim Demaille <akim@epita.fr>
17472 * tests/torture.at (Many lookaheads): New test.
17474 2002-05-05 Akim Demaille <akim@epita.fr>
17476 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
17477 (GENERATE_MUSCLE_INSERT_TABLE): this.
17478 (output_int_table, output_unsigned_int_table, output_short_table)
17479 (output_token_number_table, output_item_number_table): Replace with...
17480 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
17481 (muscle_insert_short_table, muscle_insert_token_number_table)
17482 (muscle_insert_item_number_table): these.
17483 Adjust all callers.
17484 (prepare_tokens): Don't free `translations', since...
17485 * src/reader.h, src/reader.c (grammar_free): do it.
17487 * src/gram.h, src/gram.c (grammar_free): here.
17488 * data/bison.simple, data/bison.c++: b4_token_number_max is now
17491 2002-05-05 Akim Demaille <akim@epita.fr>
17493 * src/output.c (output_unsigned_int_table): New.
17494 (prepare_rules): `i' is unsigned.
17495 `prhs', `rline', `r2' are unsigned int.
17496 Rename muscle `rhs_number_max' as `rhs_max'.
17497 Output muscles `prhs_max', `rline_max', and `r2_max'.
17499 * data/bison.simple, data/bison.c++: Adjust to use these muscles
17500 to compute types instead of constant types.
17501 * tests/regression.at (Web2c Actions): Adjust.
17503 2002-05-04 Akim Demaille <akim@epita.fr>
17505 * src/symtab.h (SALIAS, SUNDEF): Rename as...
17506 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
17507 Adjust dependencies.
17508 * src/output.c (token_definitions_output): Be sure not to output a
17509 `#define 'a'' when fed with `%token 'a' "a"'.
17510 * tests/regression.at (Token definitions): New.
17512 2002-05-03 Paul Eggert <eggert@twinsun.com>
17514 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
17517 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
17519 * Makefile.am (SUBDIRS): Remove intl.
17520 (EXTRA_DIST): Add config/config.rpath.
17522 2002-05-03 Akim Demaille <akim@epita.fr>
17524 * data/bison.simple (m4_if): Don't output empty enums.
17525 And actually, output valid enum definitions :(.
17527 2002-05-03 Akim Demaille <akim@epita.fr>
17529 * configure.bat: Remove, completely obsolete.
17530 * Makefile.am (EXTRA_DIST): Adjust.
17531 Don't distribute config.rpath...
17532 * config/Makefile.am (EXTRA_DIST): Do it.
17534 2002-05-03 Akim Demaille <akim@epita.fr>
17536 * configure.in (GETTEXT_VERSION): New.
17537 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
17539 2002-05-03 Akim Demaille <akim@epita.fr>
17541 * data/bison.simple (b4_token_enum): New.
17542 (b4_token_defines): Use it to output tokens both as #define and
17544 Suggested by Paul Eggert.
17545 * src/output.c (token_definitions_output): Don't output spurious
17548 2002-05-03 Akim Demaille <akim@epita.fr>
17550 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
17552 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
17554 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
17555 Update the stack class, give a try to deque as the default container.
17557 2002-05-02 Akim Demaille <akim@epita.fr>
17559 * data/bison.simple (yyparse): Do not implement @$ = @1.
17560 (YYLLOC_DEFAULT): Adjust to do it.
17561 * doc/bison.texinfo (Location Default Action): Fix.
17563 2002-05-02 Akim Demaille <akim@epita.fr>
17565 * src/reader.c (parse_braces): Merge into...
17566 (parse_action): this.
17568 2002-05-02 Akim Demaille <akim@epita.fr>
17570 * configure.in (ALL_LINGUAS): Remove.
17571 * po/LINGUAS, hr.po: New.
17573 2002-05-02 Akim Demaille <akim@epita.fr>
17575 Remove the so called hairy (semantic) parsers.
17577 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
17578 * src/gram.h, src/gram.c (semantic_parser): Remove.
17579 (rule_t): Remove the guard and guard_line members.
17580 * src/lex.h (token_t): remove tok_guard.
17581 * src/options.c (option_table): Remove %guard and %semantic_parser
17583 * src/output.c, src/output.h (guards_output): Remove.
17585 (token_definitions_output): Don't output the `T'
17587 (output_skeleton): Don't output the guards.
17588 * src/files.c, src/files.c (attrsfile): Remove.
17589 * src/reader.c (symbol_list): Remove the guard and guard_line
17591 Adjust dependencies.
17592 (parse_guard): Remove.
17593 * data/bison.hairy: Remove.
17594 * doc/bison.texinfo (Environment Variables): Remove occurrences of
17597 2002-05-02 Akim Demaille <akim@epita.fr>
17599 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
17600 (parse_guard): Rename the formal argument `stack_offset' as
17601 `rule_length', which is more readable.
17603 (copy_at, copy_dollar): Instead of outputting the hard coded
17604 values of $$, $n and so forth, output invocation to b4_lhs_value,
17605 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
17606 Note: this patch partially drops `semantic-parser' support: it
17607 always does `rule_length - n', where semantic parsers ought to
17609 * data/bison.simple, data/bison.c++ (b4_lhs_value)
17610 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
17612 2002-05-02 Akim Demaille <akim@epita.fr>
17614 * configure.in (AC_INIT): Bump to 1.49b.
17615 (AM_INIT_AUTOMAKE): Short invocation.
17617 2002-05-02 Akim Demaille <akim@epita.fr>
17621 2002-05-01 Akim Demaille <akim@epita.fr>
17623 * src/skeleton.h: Remove.
17625 2002-05-01 Akim Demaille <akim@epita.fr>
17627 * src/skeleton.h: Fix the #endif.
17628 Reported by Magnus Fromreide.
17630 2002-04-26 Paul Eggert <eggert@twinsun.com>
17632 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
17633 Define if we define YYSTYPE and YYLTYPE, respectively.
17634 (YYCOPY): Fix [] quoting problem in the non-GCC case.
17636 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
17638 * src/scan-skel.l: Postprocess quadrigraphs.
17640 * src/reader.c (copy_character): New function, used to output
17641 single characters while replacing `[' and `]' with quadrigraphs, to
17642 avoid troubles with M4 quotes.
17643 (copy_comment): Output characters with copy_character.
17644 (read_additionnal_code): Likewise.
17645 (copy_string2): Likewise.
17646 (copy_definition): Likewise.
17648 * tests/calc.at: Exercise M4 quoting.
17650 2002-04-25 Akim Demaille <akim@epita.fr>
17652 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
17653 between `!' and the command.
17654 Reported by Paul Eggert.
17656 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
17658 * tests/calc.at: Exercise prologue splitting.
17660 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
17661 `b4_post_prologue' instead of `b4_prologue'.
17663 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
17665 (output): Free pre_prologue_obstack and post_prologue_obstack.
17666 * src/files.h, src/files.c (attrs_obstack): Remove.
17667 (pre_prologue_obstack, post_prologue_obstack): New.
17668 * src/reader.c (copy_definition): Add a parameter to specify the
17669 obstack to fill, instead of using attrs_obstack unconditionally.
17670 (read_declarations): Pass pre_prologue_obstack to copy_definition if
17671 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
17673 2002-04-23 Paul Eggert <eggert@twinsun.com>
17675 * data/bison.simple: Remove unnecessary commentary and white
17676 space differences from 1_29-branch.
17677 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
17679 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
17680 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
17681 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
17682 constructors or destructors.
17684 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
17686 2002-04-23 Akim Demaille <akim@epita.fr>
17688 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
17689 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
17690 location with columns.
17691 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
17692 All reported by Paul Eggert.
17694 2002-04-22 Akim Demaille <akim@epita.fr>
17696 * src/reduce.c (dump_grammar): Move to...
17697 * src/gram.h, src/gram.c (grammar_dump): here.
17698 Be sure to separate long item numbers.
17699 Don't read the members of a rule's prec if its nil.
17701 2002-04-22 Akim Demaille <akim@epita.fr>
17703 * src/output.c (table_size, table_grow): New.
17704 (MAXTABLE): Remove, replace uses with table_size.
17705 (pack_vector): Instead of dying when the table is too big, grow it.
17707 2002-04-22 Akim Demaille <akim@epita.fr>
17709 * data/bison.simple (yyr1): Its type is that of a token number.
17710 * data/bison.c++ (r1_): Likewise.
17711 * tests/regression.at (Web2c Actions): Adjust.
17713 2002-04-22 Akim Demaille <akim@epita.fr>
17715 * src/reader.c (token_translations_init): 256 is now the default
17716 value for the error token, i.e., it will be assigned another
17717 number if the user assigned 256 to one of her tokens.
17718 (reader): Don't force 256 to error.
17719 * doc/bison.texinfo (Symbols): Adjust.
17720 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
17721 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
17722 etc. instead of 10, 20, 30 (which was used to `jump' over error
17723 (256) and undefined (2)).
17725 2002-04-22 Akim Demaille <akim@epita.fr>
17727 Propagate more token_number_t.
17729 * src/gram.h (token_number_as_item_number)
17730 (item_number_as_token_number): New.
17731 * src/output.c (GENERATE_OUTPUT_TABLE): New.
17732 Use it to create output_item_number_table and
17733 output_token_number_table.
17734 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17735 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
17736 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
17737 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
17739 2002-04-22 Akim Demaille <akim@epita.fr>
17741 * src/output.h, src/output.c (get_lines_number): Remove.
17743 2002-04-19 Akim Demaille <akim@epita.fr>
17745 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
17747 (Debugging): More details about enabling the debugging features.
17748 (Table of Symbols): Describe $$, $n, @$, and @n.
17749 Suggested by Tim Josling.
17751 2002-04-19 Akim Demaille <akim@epita.fr>
17753 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
17755 2002-04-10 Akim Demaille <akim@epita.fr>
17757 * src/system.h: Rely on HAVE_LIMITS_H.
17758 Suggested by Paul Eggert.
17760 2002-04-09 Akim Demaille <akim@epita.fr>
17762 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
17763 full stderr, and strip it according to the bison options, instead
17764 of composing the error message from different bits.
17765 This makes it easier to check for several error messages.
17766 Adjust all the invocations.
17767 Add an invocation exercising the error token.
17768 Add an invocation demonstrating a stupid error message.
17769 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
17771 Error message are for stderr, not stdout.
17773 2002-04-09 Akim Demaille <akim@epita.fr>
17775 * src/gram.h, src/gram.c (error_token_number): Remove, use
17777 * src/reader.c (reader): Don't specify the user token number (2)
17778 for $undefined, as it uselessly prevents using it.
17779 * src/gram.h (token_number_t): Move to...
17780 * src/symtab.h: here.
17781 (state_t.number): Is a token_number_t.
17782 * src/print.c, src/reader.c: Use undeftoken->number instead of
17784 (Even though this 2 is not the same as above: the number of the
17785 undeftoken remains being 2, it is its user token number which
17787 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
17788 `user_token_number_max'.
17789 Output `undef_token_number'.
17790 * data/bison.simple, data/bison.c++: Use them.
17791 Be sure to map invalid yylex return values to
17792 `undef_token_number'. This saves us from gratuitous SEGV.
17794 * tests/conflicts.at (Solved SR Conflicts)
17795 (Unresolved SR Conflicts): Adjust.
17796 * tests/regression.at (Web2c Actions): Adjust.
17798 2002-04-08 Akim Demaille <akim@epita.fr>
17800 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
17802 Remove the duplicate `typedefs'.
17803 (RhsNumberType): Fix the declaration and various other typos.
17805 * data/bison.simple: Use __ofile__.
17806 * src/scan-skel.l: Handle __ofile__.
17808 2002-04-08 Akim Demaille <akim@epita.fr>
17810 * src/gram.h (item_number_t): New, the type of item numbers in
17811 RITEM. Note that it must be able to code symbol numbers as
17812 positive number, and the negation of rule numbers as negative
17814 Adjust all dependencies (pretty many).
17815 * src/reduce.c (rule): Remove this `short *' pointer: use
17817 * src/system.h (MINSHORT, MAXSHORT): Remove.
17818 Include `limits.h'.
17819 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
17820 (shortcpy): Remove.
17821 (MAXTABLE): Move to...
17822 * src/output.c (MAXTABLE): here.
17823 (prepare_rules): Use output_int_table to output rhs.
17824 * data/bison.simple, data/bison.c++: Adjust.
17825 * tests/torture.at (Big triangle): Move the limit from 254 to
17827 * tests/regression.at (Web2c Actions): Ajust.
17829 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
17830 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
17831 passes, but produces negative #line number, once fixed, GCC is
17832 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
17834 * src/state.h (state_h): Code input lines on ints, not shorts.
17836 2002-04-08 Akim Demaille <akim@epita.fr>
17838 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
17839 and then the grammar.
17841 2002-04-08 Akim Demaille <akim@epita.fr>
17843 * src/system.h: No longer using strndup.
17845 2002-04-07 Akim Demaille <akim@epita.fr>
17847 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
17848 * src/output.c (output_table_data): Return the longest number.
17849 (prepare_tokens): Output `token_number_max').
17850 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
17852 Use them to define yy_token_number_type/TokenNumberType.
17853 Use this type for yytranslate.
17854 * tests/torture.at (Big triangle): Push the limit from 124 to
17856 * tests/regression.at (Web2c Actions): Adjust.
17858 2002-04-07 Akim Demaille <akim@epita.fr>
17860 * tests/torture.at (Big triangle): New.
17861 (GNU AWK Grammar, GNU Cim Grammar): Move to...
17862 * tests/existing.at: here.
17864 2002-04-07 Akim Demaille <akim@epita.fr>
17866 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
17868 Adjust dependencies.
17870 2002-04-07 Akim Demaille <akim@epita.fr>
17872 * src/reader.c: Normalize increments to prefix form.
17874 2002-04-07 Akim Demaille <akim@epita.fr>
17876 * src/reader.c, symtab.c: Remove debugging code.
17878 2002-04-07 Akim Demaille <akim@epita.fr>
17880 Rename all the `bucket's as `symbol_t'.
17882 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
17883 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
17884 * src/symtab.c, src/symtab.h (bucket): Rename as...
17886 (symbol_list_new, bucket_check_defined, bucket_make_alias)
17887 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
17888 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
17889 (buckets_new, buckets_free, buckets_do): Rename as...
17890 (symbol_list_new, symbol_check_defined, symbol_make_alias)
17891 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17892 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
17893 (symbols_new, symbols_free, symbols_do): these.
17895 2002-04-07 Akim Demaille <akim@epita.fr>
17897 Use lib/hash for the symbol table.
17899 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
17901 * src/lex.c (lex): Set the `number' member of new terminals.
17902 * src/reader.c (bucket_check_defined, bucket_make_alias)
17903 (bucket_check_alias_consistence, bucket_translation): New.
17904 (reader, grammar_free, readgram, token_translations_init)
17905 (packsymbols): Adjust.
17906 (reader): Number the predefined tokens.
17907 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
17908 for predefined tokens.
17909 * src/symtab.h (bucket): Remove all the hash table related
17911 * src/symtab.c (symtab): Replace by...
17912 (bucket_table): this.
17913 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
17914 (buckets_new, buckets_do): New.
17916 2002-04-07 Akim Demaille <akim@epita.fr>
17918 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
17919 (start_symbol, max_user_token_number, semantic_parser)
17920 (error_token_number): Initialize.
17921 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
17924 (errtoken, eoftoken, undeftoken, axiom): Extern.
17926 2002-04-07 Akim Demaille <akim@epita.fr>
17928 * src/gram.h (rule_s): prec and precsym are now pointers
17929 to the bucket giving the priority/associativity.
17930 Member `associativity' removed: useless.
17931 * src/reduce.c, src/conflicts.c: Adjust.
17933 2002-04-07 Akim Demaille <akim@epita.fr>
17935 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
17936 Properly escape the symbols' TAG when outputting them.
17938 2002-04-07 Akim Demaille <akim@epita.fr>
17940 * src/lalr.h (LA): Is a bitsetv, not bitset*.
17942 2002-04-07 Akim Demaille <akim@epita.fr>
17944 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
17945 (LArule): this, which is an array to rule_t*.
17946 * src/print.c, src/conflicts.c: Adjust.
17948 2002-04-07 Akim Demaille <akim@epita.fr>
17950 * src/gram.h (rule_t): Rename `number' as `user_number'.
17951 `number' is a new member.
17952 Adjust dependencies.
17953 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
17955 2002-04-07 Akim Demaille <akim@epita.fr>
17957 As a result of the previous patch, it is no longer needed
17958 to reorder ritem itself.
17960 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
17962 2002-04-07 Akim Demaille <akim@epita.fr>
17964 Be sure never to walk through RITEMS, but use only data related to
17965 the rules themselves. RITEMS should be banished.
17967 * src/output.c (output_token_translations): Rename as...
17968 (prepare_tokens): this.
17969 In addition to `translate', prepare the muscles `tname' and
17970 `toknum', which were handled by...
17971 (output_rule_data): this.
17972 Remove, and move the remainder of its outputs into...
17973 (prepare_rules): this new routines, which also merges content from
17974 (output_gram): this.
17975 (prepare_rules): Be sure never to walk through RITEMS.
17976 (output_stos): Rename as...
17977 (prepare_stos): this.
17978 (output): Always invoke prepare_states, after all, just don't use it
17979 in the output if you don't need it.
17981 2002-04-07 Akim Demaille <akim@epita.fr>
17983 * src/LR0.c (new_state): Display `nstates' as the name of the
17984 newly created state.
17985 Adjust to initialize first_state and last_state if needed.
17986 Be sure to distinguish the initial from the final state.
17987 (new_states): Create the itemset of the initial state, and use
17989 * src/closure.c (closure): Now that the initial state has its
17990 items properly set, there is no need for a special case when
17991 creating `ruleset'.
17993 As a result, now the rule 0, reducing to $axiom, is visible in the
17994 outputs. Adjust the test suite.
17996 * tests/conflicts.at (Solved SR Conflicts)
17997 (Unresolved SR Conflicts): Adjust.
17998 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
17999 * tests/conflicts.at (S/R in initial): New.
18001 2002-04-07 Akim Demaille <akim@epita.fr>
18003 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
18004 the RHS of the rules.
18005 * src/output.c (output_gram): Likewise.
18007 2002-04-07 Akim Demaille <akim@epita.fr>
18009 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
18011 Adjust all dependencies.
18012 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
18013 `number' of the buckets too.
18014 * src/gram.h: Include `symtab.h'.
18015 (associativity): Move to...
18016 * src/symtab.h: here.
18017 No longer include `gram.h'.
18019 2002-04-07 Akim Demaille <akim@epita.fr>
18021 * src/gram.h, src/gram.c (rules_rhs_length): New.
18022 (ritem_longest_rhs): Use it.
18023 * src/gram.h (rule_t): `number' is a new member.
18024 * src/reader.c (packgram): Set it.
18025 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
18026 the end of `rules', and count them out of `nrules'.
18027 (reduce_output, dump_grammar): Adjust.
18028 * src/print.c (print_grammar): It is no longer needed to check for
18029 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
18030 * tests/reduce.at (Reduced Automaton): New test.
18032 2002-04-07 Akim Demaille <akim@epita.fr>
18034 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
18035 lacking `+ 1' to nrules, Bison reported as useless a token if it
18036 was used solely to set the precedence of the last rule...
18038 2002-04-07 Akim Demaille <akim@epita.fr>
18040 * data/bison.c++, data/bison.simple: Don't output the current file
18041 name in #line, to avoid useless diffs between two identical
18042 outputs under different names.
18044 2002-04-07 Akim Demaille <akim@epita.fr>
18046 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
18047 Normalize loops to using `< nrules + 1', not `<= nrules'.
18049 2002-04-07 Akim Demaille <akim@epita.fr>
18053 2002-04-07 Akim Demaille <akim@epita.fr>
18055 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
18056 bucket.value as bucket.number.
18058 2002-04-07 Akim Demaille <akim@epita.fr>
18060 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
18061 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
18062 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
18063 RHS, instead of being an index in RITEMS.
18065 2002-04-04 Paul Eggert <eggert@twinsun.com>
18067 * doc/bison.texinfo: Update copyright date.
18068 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
18069 (Symbols): Warn about running Bison in one character set,
18070 but compiling and/or running in an incompatible one.
18071 Warn about character code 256, too.
18073 2002-04-03 Paul Eggert <eggert@twinsun.com>
18075 * src/bison.data (YYSTACK_ALLOC): Depend on whether
18076 YYERROR_VERBOSE is nonzero, not whether it is defined.
18078 Merge changes from bison-1_29-branch.
18080 2002-03-20 Paul Eggert <eggert@twinsun.com>
18082 Merge fixes from Debian bison_1.34-1.diff.
18084 * configure.in (AC_PREREQ): 2.53.
18086 2002-03-20 Akim Demaille <akim@epita.fr>
18088 * src/conflicts.c (log_resolution): Argument `resolution' is const.
18090 2002-03-19 Paul Eggert <eggert@twinsun.com>
18092 * src/bison.simple (YYCOPY): New macro.
18093 (YYSTACK_RELOCATE): Use it.
18094 Remove Type arg; no longer needed. All callers changed.
18095 (yymemcpy): Remove; no longer needed.
18097 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
18098 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
18100 2002-03-19 Akim Demaille <akim@epita.fr>
18102 Test and fix the #line outputs.
18104 * tests/atlocal.at (GCC): New.
18105 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
18106 (Prologue synch line, %union synch line, Postprologue synch line)
18107 (Action synch line, Epilogue synch line): New tests.
18108 * src/reader.c (parse_union_decl): Define the muscle stype_line.
18109 * data/bison.simple, data/bison.c++: Use it.
18111 2002-03-19 Akim Demaille <akim@epita.fr>
18113 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
18114 (Solved SR Conflicts, %expect not enough, %expect right)
18115 (%expect too much): Move to...
18116 * tests/conflicts.at: this new file.
18118 2002-03-19 Akim Demaille <akim@epita.fr>
18120 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
18121 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
18122 that we can move to enums for instance.
18123 * src/output.c (token_definitions_output): Output a list of
18124 `token-name, token-number' instead of the #define.
18125 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
18127 2002-03-14 Akim Demaille <akim@epita.fr>
18129 Use Gettext 0.11.1.
18131 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
18133 * data/bison.c++: Make the user able to add members to the generated
18134 parser by subclassing.
18136 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
18138 * src/reader.c (read_additionnal_code): `c' should be an integer, not
18140 Reported by Nicolas Tisserand and Nicolas Burrus.
18142 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
18144 * src/reader.c: Warn about lacking semi-colons, do not complain.
18146 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
18148 * data/bison.c++: Remove a debug line.
18150 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
18152 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
18153 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
18154 provide a default implementation.
18156 2002-03-04 Akim Demaille <akim@epita.fr>
18158 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
18159 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
18160 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
18161 * tests/semantic.at (Parsing Guards): Similarly.
18162 * src/reader.at (readgram): Complain if the last rule is not ended
18165 2002-03-04 Akim Demaille <akim@epita.fr>
18167 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
18168 * src/closure.c: here.
18169 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
18171 * src/warshall.h, src/warshall.c: Remove.
18172 * tests/sets.at (Broken Closure): Adjust.
18174 2002-03-04 Akim Demaille <akim@epita.fr>
18176 * src/output.c (output_skeleton): tempdir is const.
18177 bytes_read is unused.
18179 2002-03-04 Akim Demaille <akim@epita.fr>
18181 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18182 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
18184 From Michael Hayes.
18186 2002-03-04 Akim Demaille <akim@epita.fr>
18188 * src/closure.c (closure): `r' is unused.
18190 2002-03-04 Akim Demaille <akim@epita.fr>
18192 * tests/sets.at (Broken Closure): Add the ending `;'.
18193 * src/reader.at (readgram): Complain if a rule is not ended with a
18196 2002-03-04 Akim Demaille <akim@epita.fr>
18198 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
18199 (count_sr_conflicts): Use bitset_count.
18200 * src/reduce.c (inaccessable_symbols): Ditto.
18201 (bits_size): Remove.
18202 * src/warshall.h, src/warshall.c: Convert to bitsetv.
18204 2002-03-04 Akim Demaille <akim@epita.fr>
18206 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
18207 * src/reduce.c: Remove the `bitset_zero's following the
18208 `bitset_create's, as now it is performed by the latter.
18210 2002-03-04 Akim Demaille <akim@epita.fr>
18212 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
18213 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
18214 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
18215 latest sources from Michael.
18217 2002-03-04 Akim Demaille <akim@epita.fr>
18219 * src/output.c (output): Don't free the grammar.
18220 * src/reader.c (grammar_free): New.
18221 * src/main.c (main): Call it and don't free symtab here.
18223 2002-03-04 Akim Demaille <akim@epita.fr>
18225 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
18227 Reported by Benoit Perrot.
18229 2002-03-04 Akim Demaille <akim@epita.fr>
18231 Use bitset operations when possible, not loops over bits.
18233 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
18235 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
18236 * src/reduce.c (useless_nonterminals): Formatting changes.
18237 * src/warshall.c (TC): Use bitset_or.
18239 2002-03-04 Akim Demaille <akim@epita.fr>
18241 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
18242 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
18245 2002-03-04 Akim Demaille <akim@epita.fr>
18247 * src/lalr.c (F): Now a bitset*.
18248 Adjust all dependencies.
18250 2002-03-04 Akim Demaille <akim@epita.fr>
18252 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
18253 Adjust all dependencies.
18255 2002-03-04 Akim Demaille <akim@epita.fr>
18257 * src/L0.c, src/LR0.h (nstates): Be size_t.
18258 Adjust comparisons (signed vs unsigned).
18259 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
18261 Adjust all dependencies.
18263 2002-03-04 Akim Demaille <akim@epita.fr>
18265 * src/closure.c (firsts): Now, also a bitset.
18266 Adjust all dependencies.
18267 (varsetsize): Remove, now unused.
18268 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
18270 2002-03-04 Akim Demaille <akim@epita.fr>
18272 * src/print.c: Convert to use bitset.h, not hand coded iterations
18275 2002-03-04 Akim Demaille <akim@epita.fr>
18277 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
18279 2002-03-04 Akim Demaille <akim@epita.fr>
18281 * src/closure.c (ruleset): Be a bitset.
18282 (rulesetsize): Remove.
18284 2002-03-04 Akim Demaille <akim@epita.fr>
18286 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18287 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
18288 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
18289 * src/closure.c (fderives): Be an array of bitsets.
18291 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
18293 * data/bison.c++: Merge the two generated headers. Insert a copyright
18294 notice in each output file.
18296 2002-02-28 Akim Demaille <akim@epita.fr>
18298 * data/bison.c++: Copy the prologue of bison.simple to fetch
18299 useful M4 definitions, such as b4_header_guard.
18301 2002-02-25 Akim Demaille <akim@epita.fr>
18303 * src/getargs.c (version): Give the name of the authors, and use a
18304 translator friendly scheme for the bgr
18307 2002-02-25 Akim Demaille <akim@epita.fr>
18309 * src/output.c (header_output): Remove, now handled completely via
18312 2002-02-25 Akim Demaille <akim@epita.fr>
18314 * m4/m4.m4: New, from CVS Autoconf.
18315 * configure.in: Invoke it.
18316 * src/output.c (output_skeleton): Use its result instead of the
18319 2002-02-25 Akim Demaille <akim@epita.fr>
18321 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
18323 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
18324 * src/output.c (output_skeleton): Use mkstemp to create a real
18326 Move the filling of `skeleton' and its muscle to...
18328 (output): Move the definition of the prologue muscle to...
18330 * src/system.h (DEFAULT_TMPDIR): New.
18332 2002-02-14 Paul Eggert <eggert@twinsun.com>
18334 Remove the support for C++ namespace cleanliness; it was
18335 causing more problems than it was curing, since it didn't work
18336 properly on some nonstandard C++ compilers. This can wait
18337 for a proper C++ parser.
18339 * NEWS: Document this.
18340 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
18341 of C++, as it's treated like C now.
18342 * src/bison.simple (YYSTD): Remove.
18343 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
18344 Treat C++ just like Standard C instead of trying to support
18345 namespace cleanliness.
18347 2002-02-14 Akim Demaille <akim@epita.fr>
18349 * tests/regression.at (else): Adjust to Andreas' change.
18351 2002-02-14 Akim Demaille <akim@epita.fr>
18353 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
18355 2002-02-13 Andreas Schwab <schwab@suse.de>
18357 * src/output.c (output_rule_data): Don't output NULL, it might
18358 not be defined yet.
18360 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
18362 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
18363 (Copyright notice): Update.
18365 2002-02-11 Akim Demaille <akim@epita.fr>
18367 * tests/regression.at (%nonassoc and eof): Don't include
18368 nonportable headers.
18370 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
18372 * data/bison.c++: Correct error recovery. Make the user able to
18373 initialize the starting location.
18375 2002-02-07 Akim Demaille <akim@epita.fr>
18377 * tests/input.at: New.
18379 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
18381 * data/bison.c++: Replace some direct m4 expansions by constants. Be
18382 more consistent when naming methods and variables. Put preprocessor
18383 directives around tables only needed for debugging.
18385 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
18387 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
18389 (yy::b4_name::parse): Use print_.
18391 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
18393 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
18395 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
18397 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
18399 (yy::b4_name::parse): Build verbose error messages, and use error_.
18401 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
18403 * data/bison.c++: Fix m4 quoting in comments.
18405 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
18407 * data/bison.c++: Adjust the parser code. Fix some muscles that were
18408 not expanded by m4.
18410 2002-02-05 Akim Demaille <akim@epita.fr>
18412 * data/bison.c++: Adjust to the M4 back end.
18413 More is certainly needed.
18415 2002-02-05 Akim Demaille <akim@epita.fr>
18417 Give a try to M4 as a back end.
18419 * lib/readpipe.c: New, from wdiff.
18420 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
18422 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
18423 specific values. Now it is m4 that performs the lookup.
18424 * src/parse-skel.y: Remove.
18425 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
18426 * src/output.c (actions_output, guards_output)
18427 (token_definitions_output): No longer keeps track of the output
18428 line number, hence remove the second argument.
18429 (guards_output): Check against the guard member of a rule, not the
18432 (output_skeleton): Don't look for the skeleton location, let m4 do
18434 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
18436 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
18437 (prepare): Given that for the time being changesyntax is not
18438 usable in M4, rename the muscles using `-' to `_'.
18439 Define `defines_flag', `output_parser_name' and `output_header_name'.
18440 * src/output.h (actions_output, guards_output)
18441 (token_definitions_output): Adjust prototypes.
18442 * src/scan-skel.l: Instead of scanning the skeletons, it now
18443 processes the output of m4: `__oline__' and `#output'.
18444 * data/bison.simple: Adjust to be used by M4(sugar).
18445 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
18447 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
18448 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
18449 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
18450 shamelessly stolen from CVS Autoconf.
18452 2002-02-05 Akim Demaille <akim@epita.fr>
18454 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
18455 * configure.in: Check for the declarations of free and malloc.
18456 * src/muscle_tab.c: Adjust.
18458 2002-02-05 Akim Demaille <akim@epita.fr>
18460 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
18461 which have no values.
18463 2002-02-05 Akim Demaille <akim@epita.fr>
18465 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
18468 2002-01-29 Paul Eggert <eggert@twinsun.com>
18470 * src/bison.simple (YYSIZE_T): Do not define merely because
18471 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
18472 On some platforms, <alloca.h> does not declare YYSTD (size_t).
18474 2002-01-27 Akim Demaille <akim@epita.fr>
18476 Fix `%nonassoc and eof'.
18478 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
18479 which were not properly copied! Replace
18480 memcpy (res->errs, src->errs, src->nerrs);
18482 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
18484 * tests/regression.at (%nonassoc and eof): Adjust to newest
18485 Autotest: `.' is not in the PATH.
18487 2002-01-27 Akim Demaille <akim@epita.fr>
18489 * tests/sets.at (AT_EXTRACT_SETS): New.
18490 (Nullable): Use it.
18493 2002-01-26 Akim Demaille <akim@epita.fr>
18495 * tests/actions.at, tests/calc.at, tests/headers.at,
18496 * tests/torture.at: Adjust to the newest Autotest which no longer
18497 forces `.' in the PATH.
18499 2002-01-25 Akim Demaille <akim@epita.fr>
18501 * tests/regression.at (%nonassoc and eof): New.
18502 Suggested by Robert Anisko.
18504 2002-01-24 Akim Demaille <akim@epita.fr>
18506 Bison dumps core when trying to complain about broken input files.
18507 Reported by Cris van Pelt.
18509 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
18510 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
18512 (Invalid inputs): Strengthen: exercise parse_percent_token.
18514 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
18516 * src/Makefile.am: Add bison.c++.
18517 * src/bison.c++: New skeleton.
18519 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
18523 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
18525 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
18527 2002-01-20 Marc Autret <marc@gnu.org>
18529 * src/files.c (compute_output_file_names): Fix
18531 2002-01-20 Marc Autret <marc@gnu.org>
18533 * tests/output.at: New test.
18534 * src/files.c (compute_base_names): Don't map extensions when
18535 the YACC flag is set, use defaults.
18536 Reported by Evgeny Stambulchik.
18538 2002-01-20 Marc Autret <marc@gnu.org>
18540 * src/system.h: Need to define __attribute__ away for non-GCC
18541 compilers as well (i.e., the vendor C compiler).
18542 Suggested by Albert Chin-A-Young.
18544 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
18546 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
18547 canonical definition.
18548 * src/system.h: Use the canonical definition for PARAMS (avoids
18549 a conflict with the macro from lib/hash.h).
18551 2002-01-11 Akim Demaille <akim@epita.fr>
18553 * configure.in: Use AC_FUNC_STRNLEN.
18554 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
18556 2002-01-09 Akim Demaille <akim@epita.fr>
18558 * src/files.c, src/files.h (output_infix): New.
18559 (tab_extension): Remove.
18560 (compute_base_names): Compute the former, drop the latter.
18561 * src/output.c (prepare): Insert the muscles `output-infix', and
18563 * src/parse-skel.y (string, string.1): New.
18564 (section.header): Use it.
18565 (section.yacc): Remove.
18566 (prefix): Remove too.
18567 * src/scan-skel.l: Adjust.
18568 * src/bison.simple, src/bison.hairy: Adjust.
18570 2002-01-09 Akim Demaille <akim@epita.fr>
18572 * configure.in (WERROR_CFLAGS): Compute it.
18573 * src/Makefile.am (CFLAGS): Pass it.
18574 * tests/atlocal.in (CFLAGS): Idem.
18575 * src/files.c: Fix a few warnings.
18576 (get_extension_index): Remove, unused.
18578 2002-01-08 Akim Demaille <akim@epita.fr>
18580 * src/getargs.c (AS_FILE_NAME): New.
18581 (getargs): Use it to convert DOSish file names.
18582 * src/files.c (base_name): Rename as full_base_name to avoid
18583 clashes with `base_name ()'.
18584 (filename_split): New.
18585 (compute_base_names): N-th rewrite, using filename_split.
18587 2002-01-08 Akim Demaille <akim@epita.fr>
18589 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
18590 New, stolen from the Fileutils 4.1.
18591 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18592 * configure.in: Check for the presence of memrchr, and of its
18595 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
18597 * lib/hash.h (__P): Added definition for this macro.
18598 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
18599 BUILT_SOURCES, to ensure they are generated first.
18600 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
18601 %error-verbose to allow bootstrapping with bison 1.30x.
18603 2002-01-06 Akim Demaille <akim@epita.fr>
18605 * src/reader.c (parse_braces): Don't fetch the next char, the
18606 convention is to fetch on entry.
18607 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
18608 'switch' without a following semicolon.
18609 * tests/regression.at (braces parsing): New.
18611 2002-01-06 Akim Demaille <akim@epita.fr>
18613 Bison is dead wrong in its RR conflict reports.
18615 * tests/torture.at (GNU Cim Grammar): New.
18616 * src/conflicts.c (count_rr_conflicts): Fix.
18618 2002-01-06 Akim Demaille <akim@epita.fr>
18620 Creating package.m4 from configure.ac causes too many problems.
18622 * tests/Makefile.am (package.m4): Create it by hand,
18623 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
18625 2002-01-06 Akim Demaille <akim@epita.fr>
18627 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
18630 2002-01-04 Paul Eggert <eggert@twinsun.com>
18632 * doc/bison.texinfo (Debugging):
18633 Remove YYSTDERR; it's no longer defined or used.
18634 Also, s/cstdio.h/cstdio/.
18636 2002-01-03 Akim Demaille <akim@epita.fr>
18638 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
18640 2002-01-03 Akim Demaille <akim@epita.fr>
18642 * src/parse-skel.y (process_skeleton): Don't bind the parser's
18643 tracing code to --trace, wait for a better --trace option, with
18646 2002-01-03 Akim Demaille <akim@epita.fr>
18648 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
18649 The ISO C++ standard is extremely clear about it: stderr is
18650 considered a macro, not a regular symbol (see table 94 `Header
18651 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
18652 Therefore std:: does not apply to it. It still does with fprintf.
18653 Also, s/cstdio.h/cstdio/.
18655 2002-01-03 Akim Demaille <akim@epita.fr>
18657 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
18658 for non system headers.
18660 2002-01-02 Akim Demaille <akim@epita.fr>
18662 Equip the skeleton chain with location tracking, runtime trace,
18663 pure parser and scanner.
18665 * src/parse-skel.y: Request a pure parser, locations, and prefix
18667 (%union): Having several members with the same type does not help
18668 type mismatches, simplify.
18669 (YYPRINT, yyprint): New.
18670 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
18671 (skel_error): this.
18673 * src/scan-skel.l: Adjust to these changes.
18674 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
18675 (LOCATION_PRINT, skel_control_t): New.
18677 2001-12-30 Akim Demaille <akim@epita.fr>
18679 * src/parse-skel.y: Get rid of the shift/reduce conflict:
18680 replace `gb' with BLANKS.
18681 * src/scan-skel.l: Adjust.
18683 2001-12-30 Akim Demaille <akim@epita.fr>
18685 * src/system.h: We don't need nor want bcopy.
18686 Throw away MS-DOS crap: we don't need getpid.
18687 * configure.in: We don't need strndup. It was even causing
18688 problems: because Flex includes the headers *before* us,
18689 _GNU_SOURCE is not defined by config.h, and therefore strndup was
18691 * lib/xstrndup.c: New.
18692 * src/scan-skel.l: Use it.
18693 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
18694 * src/parse-skel.y: Use %directives instead of #defines.
18696 2001-12-30 Akim Demaille <akim@epita.fr>
18698 * src/skeleton.h: New.
18699 * src/output.c (output_parser, output_master_parser): Remove, dead
18701 * src/output.h (get_lines_number, actions_output, guards_output)
18702 (token_definitions_output): Prototype them.
18703 * src/parse-skel.y: Add the license notice.
18704 Include output.h and skeleton.h.
18705 (process_skeleton): Returns void, and takes a single parameter.
18706 * src/scan-skel.l: Add the license notice.
18707 Include skeleton.h.
18708 Don't use %option yylineno: it seems that then Flex imagines
18709 REJECT has been used, and therefore it won't reallocate its
18710 buffers (which makes no other sense to me than a bug). It results
18711 in warnings for `unused: yy_flex_realloc'.
18713 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
18715 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18716 (MUSCLE_INSERT_PREFIX): ...to there.
18717 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18718 (MUSCLE_INSERT_PREFIX): Move from here...
18720 * src/bison.hairy: Add a section directive. Put braces around muscle
18721 names. This parser skeleton is still broken, but Bison should not
18722 choke on a bad muscle 'syntax'.
18723 * src/bison.simple: Add a section directive. Put braces around muscle
18726 * src/files.h (strsuffix, stringappend): Add declarations.
18727 (tab_extension): Add declaration.
18728 (short_base_name): Add declaration.
18730 * src/files.c (strsuffix, stringappend): No longer static. These
18731 functions are used in the skeleton parser.
18732 (tab_extension): New.
18733 (compute_base_names): Use the computations done in this function
18734 to guess if the generated parsers should have '.tab' in their
18736 (short_base_name): No longer static.
18738 * src/output.c (output_skeleton): New.
18739 (output): Disable call to output_master_parser, and give a try to
18740 a new skeleton handling system.
18741 (guards_output, actions_output): No longer static.
18742 (token_definitions_output, get_lines_number): No longer static.
18744 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
18746 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
18749 * src/parse-skel.y: New file.
18750 * src/scan-skel.l: New file.
18752 2001-12-29 Akim Demaille <akim@epita.fr>
18754 %name-prefix is broken.
18756 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
18757 Adjust all dependencies.
18758 * tests/headers.at (export YYLTYPE): Strengthen this test: use
18761 Renaming yylval but not yylloc is not consistent. Now we do.
18763 * src/bison.simple: Prefix yylloc if used.
18764 * doc/bison.texinfo (Decl Summary): Document that.
18766 2001-12-29 Akim Demaille <akim@epita.fr>
18768 * doc/bison.texinfo: Promote `%long-directive' over
18770 Remove all references to fixed-output-files, yacc is enough.
18772 2001-12-29 Akim Demaille <akim@epita.fr>
18774 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
18775 user prologue. These are defaults.
18776 * tests/actions.at (Mid-rule actions): Make sure the user can
18777 define YYDEBUG and YYERROR_VERBOSE.
18779 2001-12-29 Akim Demaille <akim@epita.fr>
18781 * src/output.c (header_output): Don't forget to export YYLTYPE and
18783 * tests/headers.at (export YYLTYPE): New, make sure it does.
18784 * tests/regression.at (%union and --defines, Invalid CPP headers):
18786 * tests/headers.at: here.
18788 2001-12-29 Akim Demaille <akim@epita.fr>
18790 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
18792 2001-12-29 Akim Demaille <akim@epita.fr>
18794 * tests/actions.at (Mid-rule actions): Output on a single line
18795 instead of several.
18797 2001-12-29 Akim Demaille <akim@epita.fr>
18799 * doc/bison.texinfo: Formatting changes.
18801 2001-12-29 Akim Demaille <akim@epita.fr>
18803 Don't store the token defs in a muscle, just be ready to output it
18804 on command. Now possible via `symbols'. Fixes a memory leak.
18806 * src/output.c (token_definitions_output): New.
18807 (output_parser, header_output): Use it.
18808 * src/reader.c (symbols_save): Remove.
18810 2001-12-29 Akim Demaille <akim@epita.fr>
18812 * src/bison.simple: Do not provide a default for YYSTYPE and
18813 YYLTYPE before the user's prologue. Otherwise it's hardly... a
18816 2001-12-29 Akim Demaille <akim@epita.fr>
18818 Mid-rule actions are simply... ignored!
18820 * src/reader.c (readgram): Be sure to attach mid-rule actions to
18821 the empty-rule associated to the dummy symbol, not to the host
18823 * tests/actions.at (Mid-rule actions): New.
18825 2001-12-29 Akim Demaille <akim@epita.fr>
18829 * src/reader.c (reader): Free grammar.
18831 2001-12-29 Akim Demaille <akim@epita.fr>
18835 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
18836 since it allocates it for each state, although only one is needed.
18837 (allocate_storage): Do it here.
18839 2001-12-29 Akim Demaille <akim@epita.fr>
18841 * src/options.h, src/options.c (create_long_option_table): Rename
18843 (long_option_table_new): this, with a clearer prototype.
18844 (percent_table): Remove, unused,
18845 * src/getargs.c (getargs): Adjust.
18847 2001-12-29 Akim Demaille <akim@epita.fr>
18849 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
18850 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
18853 2001-12-29 Akim Demaille <akim@epita.fr>
18855 * src/lalr.c (build_relations): Rename `states' as `states1'.
18856 Sorry, I don't understand exactly what it is, no better name...
18858 2001-12-29 Akim Demaille <akim@epita.fr>
18860 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
18861 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
18862 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
18865 2001-12-29 Akim Demaille <akim@epita.fr>
18867 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
18870 2001-12-29 Akim Demaille <akim@epita.fr>
18872 * src/reader.c, src/reader.h (user_toknums): Remove.
18873 Adjust all users to use symbols[i]->user_token_number.
18875 2001-12-29 Akim Demaille <akim@epita.fr>
18877 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
18878 Adjust all users to use symbols[i]->prec or ->assoc.
18880 2001-12-29 Akim Demaille <akim@epita.fr>
18882 * src/reader.c, src/reader.h (tags): Remove.
18883 Adjust all users to use symbols[i]->tag.
18885 2001-12-29 Akim Demaille <akim@epita.fr>
18887 * src/gram.h, src/gram.c (symbols): New, similar to state_table
18889 * src/reader.c (packsymbols): Fill this table.
18891 * src/conflicts.c (resolve_sr_conflict): Adjust.
18892 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
18894 Use symbols[i]->tag instead of tags[i].
18896 2001-12-29 Akim Demaille <akim@epita.fr>
18898 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
18899 In addition, put a comment in there, to replace...
18900 * tests/regression.at (%union and C comments): Remove.
18902 2001-12-29 Akim Demaille <akim@epita.fr>
18904 * tests/regression.at (Web2c Actions): Blindly move the actual
18905 output as expected output. The contents *seem* right to me, but I
18906 can't pretend reading perfectly parser tables... Nonetheless, all
18907 the other tests pass correctly, the table look OK, even though the
18908 presence of `$axiom' is to be noted: AFAICS it is useless (but
18911 2001-12-29 Akim Demaille <akim@epita.fr>
18913 * src/reader.c (readgram): Don't add the rule 0 if there were no
18914 rules read. In other words, add it _after_ having performed
18915 grammar sanity checks.
18916 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
18918 2001-12-29 Akim Demaille <akim@epita.fr>
18920 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
18921 visible, and some states have now a different number.
18923 2001-12-29 Akim Demaille <akim@epita.fr>
18925 * src/reader.c (readgram): Bind the initial rule's lineno to that
18927 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
18928 (Solved SR Conflicts): Adjust rule 0's line number.
18930 2001-12-29 Akim Demaille <akim@epita.fr>
18932 Fix the `GAWK Grammar' failure.
18934 * src/LR0.c (final_state): Initialize to -1 so that we do compute
18935 the reductions of the first state which was mistakenly confused
18936 with the final state because precisely final_state was initialized
18938 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
18939 now noticed by Bison.
18940 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
18941 have a reduction on $default.
18943 2001-12-29 Akim Demaille <akim@epita.fr>
18945 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
18947 * src/closure.c (print_closure): Likewise.
18948 * src/derives.c (print_derives): Likewise.
18949 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
18952 2001-12-29 Akim Demaille <akim@epita.fr>
18954 * src/lalr.c (lookaheads_print): New.
18955 (lalr): Call it when --trace-flag.
18956 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
18959 2001-12-29 Akim Demaille <akim@epita.fr>
18961 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
18962 when walking through ritem, even via rule->rhs.
18963 * src/reduce.c (dump_grammar, useful_production, reduce_output)
18964 (useful_production, useless_nonterminals): Likewise.
18965 (reduce_grammar_tables): Likewise, plus update nritems.
18966 * src/nullable.c (set_nullable): Likewise.
18967 * src/lalr.c (build_relations): Likewise.
18968 * tests/sets.at (Nullable): Adjust.
18969 Fortunately, now, the $axiom is no longer nullable.
18971 2001-12-29 Akim Demaille <akim@epita.fr>
18973 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
18975 * src/gram.c (ritem_longest_rhs): Likewise.
18976 * src/reduce.c (nonterminals_reduce): Likewise.
18977 * src/print_graph.c (print_graph): Likewise.
18978 * src/output.c (output_rule_data): Likewise.
18979 * src/nullable.c (set_nullable): Likewise.
18981 2001-12-29 Akim Demaille <akim@epita.fr>
18983 * src/output.c: Comment changes.
18985 2001-12-27 Paul Eggert <eggert@twinsun.com>
18987 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
18988 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
18989 Sparc, as they were causing more porting problems than the
18990 (minor) performance improvement was worth.
18992 Also, catch up with 1.31's YYSTD.
18994 2001-12-27 Akim Demaille <akim@epita.fr>
18996 * src/output.c (output_gram): Rely on nritems, not the
18997 0-sentinel. See below.
18998 Use -1 as separator, not 0.
18999 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
19000 Rely on -1 as separator in yyrhs, instead of 0.
19001 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
19002 twice `Now at end of input', therefore there are two lines less to
19005 2001-12-27 Akim Demaille <akim@epita.fr>
19007 * tests/regression.at (Unresolved SR Conflicts):
19008 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
19011 2001-12-27 Akim Demaille <akim@epita.fr>
19013 * src/LR0.c (new_state): Recognize the final state by the fact it
19014 is reached by eoftoken.
19015 (insert_start_shifting_state, insert_eof_shifting_state)
19016 (insert_accepting_state, augment_automaton): Remove, since now
19017 these states are automatically computed from the initial state.
19018 (generate_states): Adjust.
19019 * src/print.c: When reporting a rule number to the user, substract
19020 1, so that the axiom rule is rule 0, and the first user rule is 1.
19021 * src/reduce.c: Likewise.
19022 * src/print_graph.c (print_core): For the time being, just as for
19023 the report, depend upon --trace-flags to dump the full set of
19025 * src/reader.c (readgram): Once the grammar read, insert the rule
19026 0: `$axiom: START-SYMBOL $'.
19027 * tests/set.at: Adjust: rule 0 is now displayed, and since the
19028 number of the states has changed (the final state is no longer
19029 necessarily the last), catch up.
19031 2001-12-27 Akim Demaille <akim@epita.fr>
19033 Try to make the use of the eoftoken valid. Given that its value
19034 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
19035 is used instead of > 0 where appropriate, (ii), depend upon nritems
19036 instead of the 0-sentinel.
19038 * src/gram.h, src/gram.c (nritems): New.
19039 Expected to be duplication of nitems, but for the time being...
19040 * src/reader.c (packgram): Assert nritems and nitems are equal.
19041 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
19042 * src/closure.c (print_closure, print_fderives): Likewise.
19043 * src/gram.c (ritem_print): Likewise.
19044 * src/print.c (print_core, print_grammar): Likewise.
19045 * src/print_graph.c: Likewise.
19047 2001-12-27 Akim Demaille <akim@epita.fr>
19049 * src/main.c (main): If there are complains after grammar
19050 reductions, then output the report anyway if requested, then die.
19051 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
19052 * src/reader.c (eoftoken): New.
19053 (parse_token_decl): If the token being defined has value `0', it
19055 (packsymbols): No longer hack `tags' to insert `$' by hand.
19056 Be sure to preserve the value of the eoftoken.
19057 (reader): Make sure eoftoken is defined.
19058 Initialize nsyms to 0: now eoftoken is created just like the others.
19059 * src/print.c (print_grammar): Don't special case the eof token.
19060 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
19061 lie anyway, albeit pleasant.
19062 * tests/calc.at: Exercise error messages with eoftoken.
19063 Change the grammar so that empty input is invalid.
19064 Adjust expectations.
19065 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
19067 2001-12-27 Akim Demaille <akim@epita.fr>
19069 * configure.in: Check the protos of strchr ans strspn.
19070 Replace strchr if needed.
19071 * src/system.h: Provide the protos of strchr, strspn and memchr if
19073 * lib/strchr.c: New.
19074 * src/reader.c (symbols_save): Use strchr.
19076 2001-12-27 Akim Demaille <akim@epita.fr>
19078 * src/print.c, src/print_graph.c (escape): New.
19079 Use it to quote the TAGS outputs.
19080 * src/print_graph.c (print_state): Now errors are in red, and
19081 reductions in green.
19082 Prefer high to wide: output the state number on a line of its own.
19084 2001-12-27 Akim Demaille <akim@epita.fr>
19086 * src/state.h, src/state.c (reductions_new): New.
19087 * src/LR0.c (set_state_table): Let all the states have a
19088 `reductions', even if reduced to 0.
19089 (save_reductions): Adjust.
19090 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
19091 * src/print.c (print_reductions, print_actions): Adjust.
19092 * src/output.c (action_row): Adjust.
19094 2001-12-27 Akim Demaille <akim@epita.fr>
19096 * src/state.h, src/state.c (errs_new, errs_dup): New.
19097 * src/LR0.c (set_state_table): Let all the states have an errs,
19098 even if reduced to 0.
19099 * src/print.c (print_errs, print_reductions): Adjust.
19100 * src/output.c (output_actions, action_row): Adjust.
19101 * src/conflicts.c (resolve_sr_conflict): Adjust.
19103 2001-12-27 Akim Demaille <akim@epita.fr>
19105 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
19107 2001-12-27 Akim Demaille <akim@epita.fr>
19109 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
19110 * src/print.c: here.
19111 (lookaheadset, shiftset): New, used as additional storage by
19113 (print_results): Adjust.
19114 (print_shifts, print_gotos, print_errs): New, extracted from...
19115 (print_actions): here.
19116 * src/print_graph.c (print_actions): Remove dead code.
19118 2001-12-27 Akim Demaille <akim@epita.fr>
19120 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
19123 2001-12-27 Akim Demaille <akim@epita.fr>
19125 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
19126 (build_relations): Adjust.
19128 2001-12-27 Akim Demaille <akim@epita.fr>
19130 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
19133 2001-12-27 Akim Demaille <akim@epita.fr>
19135 * src/reader.c (packgram): Catch nitems overflows.
19137 2001-12-27 Akim Demaille <akim@epita.fr>
19139 * src/files.c, src/files.h (guard_obstack): Remove.
19140 * src/output.c (output): Adjust.
19141 * src/reader.c (parse_braces): New, factoring...
19142 (copy_action, copy_guard): these two which are renamed as...
19143 (parse_action, parse_guard): these.
19144 As a voluntary consequence, using braces around guards is now
19147 2001-12-27 Akim Demaille <akim@epita.fr>
19149 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
19150 * src/reader.c (symbol_list): `guard' and `guard_line' are new
19152 (symbol_list_new): Adjust.
19153 (copy_action): action_line is the first line, not the last.
19154 (copy_guard): Just as for actions, store the `action' only, not
19155 the switch/case/break flesh.
19156 Don't parse the user action that might follow the guard, let...
19157 (readgram): do it, i.e., now, there can be an action after a
19159 In other words the guard is just explicitly optional.
19160 (packgram): Adjust.
19161 * src/output.c (guards_output): New.
19162 (output_parser): Call it when needed.
19163 (output): Also free the guard and attrs obstacks.
19164 * src/files.c, src/files.h (obstack_save): Remove.
19165 (output_files): Remove.
19166 As a result, if one needs the former `.act' file, using an
19167 appropriate skeleton which requires actions and guards is now
19169 * src/main.c (main): Adjust.
19170 * tests/semantic.at: New.
19171 * tests/regression.at: Use `input.y' as input file name.
19172 Avoid 8+3 problems by requiring input.c when the test needs the
19175 2001-12-27 Akim Demaille <akim@epita.fr>
19177 * src/reader.c (symbol_list_new): Be sure to initialize all the
19180 2001-12-27 Akim Demaille <akim@epita.fr>
19182 All the hacks using a final pseudo state are now useless.
19184 * src/LR0.c (set_state_table): state_table holds exactly nstates.
19185 * src/lalr.c (nLA): New.
19186 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
19187 instead of lookaheadsp from the pseudo state (nstate + 1).
19189 2001-12-27 Akim Demaille <akim@epita.fr>
19191 * src/output.c (action_row, token_actions): Use a state_t instead
19192 of a integer, and nlookaheads instead of the following state's
19195 2001-12-27 Akim Demaille <akim@epita.fr>
19197 * src/conflicts.c (log_resolution, flush_shift)
19198 (resolve_sr_conflict, set_conflicts, solve_conflicts)
19199 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
19200 (conflicts_print, print_reductions): Use a state_t instead of an
19201 integer when referring to a state.
19202 As much as possible, depend upon nlookaheads, instead of the
19203 `lookaheadsp' member of the following state (since lookaheads of
19204 successive states are successive, the difference between state n + 1
19205 and n served as the number of lookaheads for state n).
19206 * src/lalr.c (add_lookback_edge): Likewise.
19207 * src/print.c (print_core, print_actions, print_state)
19208 (print_results): Likewise.
19209 * src/print_graph.c (print_core, print_actions, print_state)
19210 (print_graph): Likewise.
19211 * src/conflicts.h: Adjust.
19213 2001-12-27 Akim Demaille <akim@epita.fr>
19215 * src/bison.hairy: Formatting/comment changes.
19217 Remove `register' indications.
19218 Add plenty of `static'.
19220 2001-12-27 Akim Demaille <akim@epita.fr>
19222 * src/output.c (prepare): Drop the muscle `ntbase' which
19223 duplicates ntokens.
19224 * src/bison.simple: Formatting/comment changes.
19225 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
19226 is an undocumented synonym.
19228 2001-12-22 Akim Demaille <akim@epita.fr>
19230 * src/output.c (output_table_data): Change the prototype to use
19231 `int' for array ranges: some invocations do pass an int, not a
19233 Reported by Wayne Green.
19235 2001-12-22 Akim Demaille <akim@epita.fr>
19237 Some actions of web2c.y are improperly triggered.
19238 Reported by Mike Castle.
19240 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
19241 * tests/regression.at (Web2c): Rename as...
19242 (Web2c Report): this.
19243 (Web2c Actions): New.
19245 2001-12-22 Akim Demaille <akim@epita.fr>
19247 Reductions in web2c.y are improperly reported.
19248 Reported by Mike Castle.
19250 * src/conflicts.c (print_reductions): Fix.
19251 * tests/regression.at (Web2c): New.
19253 2001-12-18 Akim Demaille <akim@epita.fr>
19255 Some host fail on `assert (!"foo")', which expands to
19256 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
19257 Reported by Nelson Beebee.
19259 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
19260 `#define it_succeeded 0' and `assert (it_succeeded)'.
19262 2001-12-17 Marc Autret <autret_m@epita.fr>
19264 * src/bison.simple: Don't hard code the skeleton line and filename.
19265 * src/output.c (output_parser): Rename 'line' as 'output_line'.
19266 New line counter 'skeleton_line' (skeleton-line muscle).
19268 2001-12-17 Paul Eggert <eggert@twinsun.com>
19270 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
19271 YYDEBUG must be defined to a nonzero value.
19273 * src/bison.simple (yytname): Do not assume that the user defines
19274 YYDEBUG to a properly parenthesized expression.
19276 2001-12-17 Akim Demaille <akim@epita.fr>
19278 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
19279 nlookaheads is a new member.
19281 * src/lalr.h (nlookaheads): Remove this orphan declaration.
19282 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
19285 2001-12-17 Akim Demaille <akim@epita.fr>
19287 * src/files.h, src/files.c (open_files, close_files): Remove.
19288 * src/main.c (main): Don't open/close files, nor invoke lex_free,
19290 * src/reader.c (reader): Do it.
19292 2001-12-17 Akim Demaille <akim@epita.fr>
19294 * src/conflicts.c (print_reductions): Formatting changes.
19296 2001-12-17 Akim Demaille <akim@epita.fr>
19298 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
19299 (flush_reduce): New.
19300 (resolve_sr_conflict): Adjust.
19302 2001-12-17 Akim Demaille <akim@epita.fr>
19304 * src/output.c (output_obstack): Be static and rename as...
19305 (format_obstack): this, to avoid any confusion with files.c's
19307 * src/reader.h (muscle_obstack): Move to...
19308 * src/output.h: here, since it's defined in output.c.
19310 2001-12-17 Akim Demaille <akim@epita.fr>
19312 * src/output.c (action_row, save_column, default_goto)
19313 (sort_actions, matching_state, pack_vector): Better variable
19316 2001-12-17 Akim Demaille <akim@epita.fr>
19318 * src/output.c: Various formatting changes.
19320 2001-12-17 Akim Demaille <akim@epita.fr>
19322 * src/files.c (output_files): Free the output_obstack.
19323 * src/main.c (main): Call print and print_graph conditionally.
19324 * src/print.c (print): Work unconditionally.
19325 * src/print_graph.c (print_graph): Work unconditionally.
19326 * src/conflicts.c (log_resolution): Output only if verbose_flag.
19328 2001-12-16 Marc Autret <autret_m@epita.fr>
19330 * src/output.c (actions_output): Fix. When we use %no-lines,
19331 there is one less line per action.
19333 2001-12-16 Marc Autret <autret_m@epita.fr>
19335 * src/bison.simple: Remove a useless #line directive.
19336 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
19337 * src/output.c (get_lines_number): New.
19338 (output_parser): Adjust, now takes care about the lines of a
19340 Fix line numbering.
19341 (actions_output): Computes the number of lines taken by actions.
19342 (output_master_parser): Insert new skeleton which is the name of
19343 the output parser file name.
19345 2001-12-15 Marc Autret <autret_m@epita.fr>
19347 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
19349 2001-12-15 Marc Autret <autret_m@epita.fr>
19351 * src/output.c (output_gram): Keep track of the hairy one.
19353 2001-12-15 Akim Demaille <akim@epita.fr>
19355 Make `make distcheck' work.
19357 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
19358 system.h which uses libgettext.h.
19360 2001-12-15 Akim Demaille <akim@epita.fr>
19362 * src/nullable.c (set_nullable): Useless rules must be skipped,
19363 otherwise, since we range over their symbols, we might look at a
19364 nonterminal which no longer ``exists'', i.e., it is not counted in
19365 `nvars', hence we overflow our arrays.
19367 2001-12-15 Akim Demaille <akim@epita.fr>
19369 The header can also be produced directly, without any obstack!
19372 * src/files.c, src/files.h (defines_obstack): Remove.
19373 (compute_header_macro): Global.
19374 (defines_obstack_save): Remove.
19375 * src/reader.c (parse_union_decl): No longer output to
19376 defines_obstack: its content can be found in the `stype' muscle
19378 (output_token_translations): Merge into...
19379 (symbols_output): this.
19381 (symbols_save): this.
19383 * src/output.c (header_output): New.
19386 2001-12-15 Akim Demaille <akim@epita.fr>
19388 * src/reader.c (parse_union_decl): Instead of handling two obstack
19389 simultaneously, use one to define the `stype' muscle, and use the
19390 value of the latter to fill defines_obstack.
19391 (copy_comment): Remove.
19392 (copy_comment2): Work for a single obstack.
19394 (copy_comment): this.
19396 2001-12-15 Akim Demaille <akim@epita.fr>
19398 * src/lex.c, src/lex.h (xgetc): No longer static.
19399 * src/reader.c (parse_union_decl): Revamp.
19401 2001-12-15 Akim Demaille <akim@epita.fr>
19403 Still making progress in separating Bison into (i) input, (ii)
19404 process, (iii) output: now we can directly output the parser file
19405 without using table_obstack at all.
19407 * src/files.c, src/files.h (table_obstack): Bye bye.
19408 (parser_file_name): New.
19409 * src/files.c (compute_output_file_names): Compute it.
19410 * src/output.c (actions_output, output_parser)
19411 (output_master_parser): To a file instead of an obstack.
19413 2001-12-15 Akim Demaille <akim@epita.fr>
19415 Attach actions to rules, instead of pre-outputting them to
19418 * src/gram.h (rule_t): action and action_line are new members.
19419 * src/reader.c (symbol_list): Likewise.
19420 (copy_action): Save the actions within the rule.
19421 (packgram): Save them in rule_table.
19422 * src/output.c (actions_output): New.
19423 (output_parser): Use it on `%%actions'.
19424 (output_rule_data): Don't free rule_table.
19426 (prepare): Don't save the `action' muscle.
19427 * src/bison.simple: s/%%action/%%actions/.
19429 2001-12-15 Akim Demaille <akim@epita.fr>
19431 * src/reader.c (copy_action): When --yacc, don't append a `;'
19432 to the user action: let it fail if lacking.
19433 Suggested by Arnold Robbins and Tom Tromey.
19435 2001-12-14 Akim Demaille <akim@epita.fr>
19437 * src/lex.c (literalchar): Simply return the char you decoded, non
19438 longer mess around with obstacks and int pointers.
19439 Adjust all callers.
19441 2001-12-14 Akim Demaille <akim@epita.fr>
19443 * src/lex.c (literalchar): Don't escape the special characters,
19444 just decode them, and keep them as char (before, eol was output as
19445 the 2 char string `\n' etc.).
19446 * src/output.c (output_rule_data): Use quotearg to output the
19449 2001-12-13 Paul Eggert <eggert@twinsun.com>
19451 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
19452 Do not infringe on the global user namespace when using C++.
19453 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
19454 All uses of `fprintf' and `stderr' changed.
19456 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
19458 2001-12-13 Akim Demaille <akim@epita.fr>
19460 The computation of nullable is broken: it doesn't handle empty
19463 * tests/torture.at (GNU AWK Grammar): New.
19464 * tests/sets.at (Nullable): New.
19465 * src/nullable.c (set_nullable): Instead of blindly looping over
19466 `ritems', loop over the rules, and then over their rhs's.
19468 Work around Autotest bugs.
19470 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
19471 frame, because Autotest understand lines starting with a `+' as
19472 traces from the shell. Then, they are not processed properly.
19473 Admittedly an Autotest bug, but we don't have time to wait for
19474 Autotest to catch up.
19475 * tests/regression.at (Broken Closure): Adjust to the new table
19478 * tests/sets.at: here.
19480 2001-12-13 Akim Demaille <akim@epita.fr>
19482 * src/closure.c (closure): Use nrules instead of playing tricks
19483 with BITS_PER_WORD.
19485 2001-12-13 Akim Demaille <akim@epita.fr>
19487 * src/print.c (print_actions): Output the handling of `$' as the
19488 traces do: shifting the token EOF. Before EOF was treated as a
19490 * tests/regression.at: Adjust some tests.
19491 * src/print_graph.c (print_core): Complete the set of items via
19492 closure. The next-to-final and final states are still unsatisfying,
19493 but that's to be addressed elsewhere.
19494 No longer output the rule numbers, but do output the state number.
19495 A single loop for the shifts + gotos is enough, but picked a
19496 distinct color for each.
19497 (print_graph): Initialize and finalize closure.
19499 2001-12-13 Akim Demaille <akim@epita.fr>
19501 * src/reader.c (readgram): Remove dead code, an strip useless
19503 (get_type): Remove, unused.
19505 2001-12-12 Akim Demaille <akim@epita.fr>
19507 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
19508 on that of lib/error.c.
19510 2001-12-12 Akim Demaille <akim@epita.fr>
19512 Some hosts don't like `/' in includes.
19514 * src/system.h: Include libgettext.h without qualifying the path.
19515 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
19518 2001-12-11 Marc Autret <autret_m@epita.fr>
19520 * src/output.c (output_parser): Remove useless muscle.
19522 2001-12-11 Marc Autret <autret_m@epita.fr>
19524 * src/bison.simple: Remove #line just before %%epilogue. It
19525 is now handled in ...
19526 * src/reader.c (read_additionnal_code): Add the output of a
19527 #line for the epilogue.
19529 2001-12-10 Marc Autret <autret_m@epita.fr>
19531 * src/reader.c (copy_definition): Re-use CPP-outed code which
19532 replace precedent remove.
19533 * src/bison.simple: Remove #line before %%prologue because
19534 %%input-line is wrong at this time.
19536 2001-12-10 Marc Autret <autret_m@epita.fr>
19538 * src/reader.c (symbols_output): Clean up.
19539 * src/output.c (output_gram, output): Clean up.
19541 2001-12-10 Akim Demaille <akim@epita.fr>
19543 * src/lalr.c (initialize_lookaheads): New. Extracted from...
19544 * src/LR0.c (set_state_table): here.
19545 * src/lalr.c (lalr): Call it.
19547 2001-12-10 Akim Demaille <akim@epita.fr>
19549 * src/state.h (shifts): Remove the `number' member: shifts are
19550 attached to state, hence no longer need to be labelled with a
19553 2001-12-10 Akim Demaille <akim@epita.fr>
19555 Now that states have a complete set of members, the linked list of
19556 shifts is useless: just fill directly the state's shifts member.
19558 * src/state.h (shifts): Remove the `next' member.
19559 * src/LR0.c (first_state, last_state): Remove.
19560 Adjust the callers.
19561 (augment_automaton): Don't look for the shifts that must be added
19562 a shift on EOF: it is those of the state we looked for! But now,
19563 since shifts are attached, it is no longer needed to looking
19564 merely by its id: its number.
19566 2001-12-10 Akim Demaille <akim@epita.fr>
19568 * src/LR0.c (augment_automaton): Better variable locality.
19569 Remove an impossible branch: if there is a state corresponding to
19570 the start symbol being shifted, then there is shift for the start
19571 symbol from the initial state.
19573 2001-12-10 Akim Demaille <akim@epita.fr>
19575 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
19576 only when appropriate: when insert_start_shifting_state' is not
19578 * tests/regression.at (Rule Line Numbers): Adjust.
19580 2001-12-10 Akim Demaille <akim@epita.fr>
19582 * src/LR0.c (augment_automaton): Now that all states have shifts,
19583 merge the two cases addition shifts to the initial state.
19585 2001-12-10 Akim Demaille <akim@epita.fr>
19587 * src/lalr.c (set_state_table): Move to...
19589 * src/lalr.c (lalr): Don't call it...
19590 * src/LR0.c (generate_states): do it.
19591 * src/LR0.h (first_state): Remove, only the table is used.
19593 2001-12-10 Akim Demaille <akim@epita.fr>
19595 * src/LR0.h (first_shift, first_reduction): Remove.
19596 * src/lalr.c: Don't use first_shift: find shifts through the
19599 2001-12-10 Akim Demaille <akim@epita.fr>
19601 * src/LR0.c: Attach shifts to states as soon as they are
19603 * src/lalr.c (set_state_table): Instead of assigning shifts to
19604 state, just assert that the mapping was properly done.
19606 2001-12-10 Akim Demaille <akim@epita.fr>
19608 * src/LR0.c (insert_start_shift): Rename as...
19609 (insert_start_shifting_state): this.
19610 (insert_eof_shifting_state, insert_accepting_state): New.
19611 (augment_automaton): Adjust.
19612 Better locality of the variables.
19613 When looking if the start_symbol is shifted from the initial
19614 state, using `while (... symbol != start_symbol ...)' sounds
19615 better than `while (... symbol < start_symbol ...)': If fail
19616 to see how the order between symbols could be relevant!
19618 2001-12-10 Akim Demaille <akim@epita.fr>
19620 * src/getargs.h: Don't declare `spec_name_prefix' and
19621 `spec_file_prefix', declared by src/files.h.
19622 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
19623 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
19624 * src/output.c (prepare): Adjust.
19625 * src/reader.c (symbols_output): Likewise.
19626 * src/vmsgetargs.c: Vaguely adjust, but who cares?
19628 2001-12-10 Akim Demaille <akim@epita.fr>
19630 * src/muscle_tab.c (muscle_init): NULL is a better default than
19633 2001-12-10 Akim Demaille <akim@epita.fr>
19635 * src/reader.c (reader): Calling symbols_output once is enough.
19637 2001-12-10 Akim Demaille <akim@epita.fr>
19639 Now that states have a complete set of members, the linked list of
19640 reductions is useless: just fill directly the state's reductions
19643 * src/state.h (struct reductions): Remove member `number' and
19645 * src/LR0.c (first_reduction, last_reduction): Remove.
19646 (save_reductions): Don't link the new reductions, store them in
19648 * src/lalr.c (set_state_table): No need to attach reductions to
19649 states, it's already done.
19650 * src/output.c (output_actions): No longer free the shifts, then
19651 the reductions, then the states: free all the states and their
19654 2001-12-10 Akim Demaille <akim@epita.fr>
19656 * src/options.c (OPTN, DRTV, BOTH): New.
19657 (option_table): Use them.
19659 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
19660 the job of system.h.
19661 * src/options.c: Don't include stdio.h and xalloc.h for the same
19664 2001-12-10 Akim Demaille <akim@epita.fr>
19666 * src/output.c (output, prepare): Make sure the values of the
19667 muscles `action' and `prologue' are 0-terminated.
19669 2001-12-10 Akim Demaille <akim@epita.fr>
19671 Clean up GCC warnings.
19673 * src/reader.c (copy_action): `buf' is not used.
19674 (parse_skel_decl): Be static.
19675 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
19676 * src/options.h (create_long_option_table): Have a real prototype.
19677 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
19678 (hash_delete_at): Return const void *.
19679 Adjust casts to preserve the const.
19681 2001-12-10 Akim Demaille <akim@epita.fr>
19683 * configure.in: Require 2.52g.
19684 M4 is not needed, but AUTOM4TE is.
19685 * m4/m4.m4: Remove.
19686 * tests/Makefile.am: Adjust.
19688 2001-12-10 Akim Demaille <akim@epita.fr>
19690 One structure for states is enough, even though theoretically
19691 there are LR(0) states and LALR(1) states.
19693 * src/lalr.h (state_t): Remove.
19694 (state_table): Be state_t **, not state_t *.
19695 * src/state.h (core, CORE_ALLOC): Rename as...
19696 (state_t, STATE_ALLOC): this.
19697 Add the LALR(1) members: shifts, reductions, errs.
19698 * src/LR0.c (state_table): Rename as...
19699 (state_hash): this, to avoid name clashes with the global
19701 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
19702 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
19704 2001-12-10 Akim Demaille <akim@epita.fr>
19706 Bison dumps core on bash.y.
19707 Reported by Pascal Bart.
19709 * src/warshall.c (bitmatrix_print): New.
19711 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
19712 j must be the outer loop.
19713 * tests/regression.at (Broken Closure): New.
19715 2001-12-05 Akim Demaille <akim@epita.fr>
19717 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
19719 Reported by Peter Hamorsky.
19721 2001-12-05 Akim Demaille <akim@epita.fr>
19723 * src/conflicts.c (err_table): Remove.
19724 (resolve_sr_conflict): Adjust.
19725 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
19727 (state_t.reductions, state_t.shifts): this.
19729 2001-12-05 Akim Demaille <akim@epita.fr>
19731 * src/reduce.c (reduce_grammar_tables): No longer disable the
19732 removal of useless rules via CPP but via `if (0)', so that the
19733 compiler still check the code is valid.
19734 For instance, it should have noticed `rline' no longer exists: use
19735 the `line' member of rule_t.
19736 * src/gram.c (dummy, rline): Remove, unused.
19738 2001-12-05 Akim Demaille <akim@epita.fr>
19740 * src/output.c (pack_vector): Use assert, not berror.
19741 * src/main.c (berror): Remove, unused.
19743 2001-12-05 Akim Demaille <akim@epita.fr>
19745 New experimental feature: if --verbose --trace output all the
19746 items of a state, not only its kernel.
19748 * src/print.c (print_core): If `trace_flag', then invoke closure
19749 before outputting the items of the state (print_core is no longer
19750 a correct name them).
19751 (print_results): Invoke new_closure/free_closure if needed.
19753 2001-12-05 Akim Demaille <akim@epita.fr>
19755 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
19756 * src/closure.c, src/closure.h (itemsetsize): Rename as...
19757 (nitemset): for consistency with the rest of the project.
19759 2001-12-05 Akim Demaille <akim@epita.fr>
19761 * src/closure.c (print_closure): Improve.
19762 (closure): Use it for printing input and output.
19764 2001-12-05 Akim Demaille <akim@epita.fr>
19766 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
19767 indexed by nonterminals.
19769 2001-12-05 Akim Demaille <akim@epita.fr>
19771 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
19773 * src/warshall.h: Remove accidental duplication of the content.
19775 2001-12-05 Akim Demaille <akim@epita.fr>
19777 * src/closure.c (set_fderives): De-obfuscate.
19779 2001-12-05 Akim Demaille <akim@epita.fr>
19781 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
19783 2001-12-05 Akim Demaille <akim@epita.fr>
19785 * src/closure.c (set_firsts): De-obfuscate.
19787 2001-12-05 Akim Demaille <akim@epita.fr>
19789 * src/output.c (action_row): De-obfuscate
19790 using the good o' techniques: arrays not pointers, variable
19791 locality, BITISSET, RESETBIT etc.
19793 2001-12-05 Akim Demaille <akim@epita.fr>
19795 Pessimize the code to simplify it: from now on, all the states
19796 have a valid SHIFTS, which NSHIFTS is possibly 0.
19798 * src/LR0.c (shifts_new): Be global and move to..
19799 * src/state.c, src/state.h: here.
19800 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
19801 * src/print_graph: Adjust.
19803 2001-12-05 Akim Demaille <akim@epita.fr>
19805 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
19806 * src/conflicts.c: Use it.
19807 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
19808 incorrectly ``simplified''.
19810 2001-12-05 Akim Demaille <akim@epita.fr>
19812 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
19813 using the good o' techniques: arrays not pointers, variable
19814 locality, BITISSET, RESETBIT etc.
19816 2001-12-05 Akim Demaille <akim@epita.fr>
19818 * src/state.h (SHIFT_SYMBOL): New.
19819 * src/conflicts.c: Use it to deobfuscate.
19821 2001-12-05 Akim Demaille <akim@epita.fr>
19823 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
19824 (print_reductions): De-obfuscate using the good o' techniques:
19825 arrays not pointers, variable locality, BITISSET.
19827 2001-12-05 Akim Demaille <akim@epita.fr>
19829 * src/conflicts.c (print_reductions): Arrays, not pointers.
19832 2001-12-05 Akim Demaille <akim@epita.fr>
19834 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19836 2001-12-05 Akim Demaille <akim@epita.fr>
19838 * src/conflicts.c (print_reductions): Improve variable locality.
19840 2001-12-05 Akim Demaille <akim@epita.fr>
19842 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19844 2001-12-05 Akim Demaille <akim@epita.fr>
19846 * src/conflicts.c (print_reductions): Improve variable locality.
19848 2001-12-05 Akim Demaille <akim@epita.fr>
19850 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
19851 * src/lalr.c: Use them.
19853 2001-12-05 Akim Demaille <akim@epita.fr>
19855 * src/LR0.c (augment_automaton): Formatting changes.
19856 Better variable locality.
19858 2001-12-05 Akim Demaille <akim@epita.fr>
19860 * src/lalr.c (matrix_print): New.
19861 (transpose): Use it.
19862 Use arrays instead of pointers.
19864 2001-12-05 Akim Demaille <akim@epita.fr>
19866 * src/lalr.c (maxrhs): Move to...
19867 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
19868 * src/lalr.c (build_relations): Adjust.
19870 2001-12-05 Akim Demaille <akim@epita.fr>
19872 * src/lalr.c (transpose): Free the memory allocated to the
19873 argument, as it is replaced by the results by the unique caller.
19874 (build_relations): Merely invoke transpose: it handles the memory
19876 Improve variable locality.
19877 Avoid variables used as mere abbreviations.
19878 (compute_lookaheads): Use arrays instead of pointers.
19880 2001-12-05 Akim Demaille <akim@epita.fr>
19882 * src/lalr.c (initialize_F): Improve variable locality.
19883 Avoid variables used as mere abbreviations.
19885 2001-12-05 Akim Demaille <akim@epita.fr>
19887 * src/derives.c (print_derives): Display the ruleno.
19888 * src/lalr.c (initialize_F, transpose): Better variable locality
19889 to improve readability.
19890 Avoid variables used as mere abbreviations.
19892 2001-12-05 Akim Demaille <akim@epita.fr>
19894 * src/lalr.c (traverse): Use arrays instead of pointers.
19896 2001-12-05 Akim Demaille <akim@epita.fr>
19898 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
19899 the handling of squeue.
19900 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
19902 2001-12-05 Akim Demaille <akim@epita.fr>
19904 Because useless nonterminals are now kept alive (instead of being
19905 `destroyed'), we now sometimes examine them, and store information
19906 related to them. Hence we need to know their number, and adjust
19907 memory allocations.
19909 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
19911 * src/LR0.c (allocate_itemsets): The memory allocated to
19912 `symbol_count' was used for two different purpose: once to count
19913 the number of occurrences of each symbol, and later reassigned to
19914 `shift_symbol', containing the symbol that can be shifted from a
19916 Deobfuscate, i.e., allocate, use and free `symbol_count' here
19918 (new_itemsets): Allocate `shift_symbol' here.
19919 (allocate_itemsets): symbol_count includes useless nonterminals.
19920 Make room for them.
19921 (free_storage): Use `free', not `XFREE', for pointers that cannot
19924 2001-12-05 Akim Demaille <akim@epita.fr>
19926 * src/nullable.c (set_nullable): Deobfuscate the handling of
19928 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
19930 2001-12-05 Akim Demaille <akim@epita.fr>
19932 * src/gram.c, src/gram.h (ritem_print): New.
19933 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
19934 (This useless function was defined only to work around VMS linkers
19935 that can't handle compilation units with variables only).
19936 * src/reduce.c (dump_grammar): Use it to trace the construction of
19939 2001-12-04 Paul Eggert <eggert@twinsun.com>
19941 * src/bison.simple (union yyalloc): Change member names
19942 to be the same as the stack names.
19943 (yyparse): yyptr is now union yyalloc *, not char *.
19944 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
19945 and may generate better code on some machines.
19946 (yystpcpy): Use prototype if __STDC__ is defined, not just
19947 if __cplusplus is defined.
19949 2001-11-30 Akim Demaille <akim@epita.fr>
19951 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
19952 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
19953 Gettext doesn't compile cleanly, and dies with -Werror.
19954 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
19955 Include WARNING_CFLAGS here.
19956 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
19957 before being defined.
19959 2001-11-27 Paul Eggert <eggert@twinsun.com>
19961 * lib/quotearg.h (quotearg_n, quotearg_n_style):
19962 First arg is int, not unsigned.
19963 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
19964 (SIZE_MAX, UINT_MAX): New macros.
19965 (quotearg_n_options): Abort if N is negative.
19966 Avoid overflow check on hosts where size_t is 64 bits and int
19967 is 32 bits, as overflow is impossible there.
19968 Fix off-by-one typo that caused unnecessary reallocation.
19970 2001-11-29 Paul Eggert <eggert@twinsun.com>
19972 Name space cleanup in generated parser.
19974 * doc/bison.texinfo (Bison Parser): Discuss system headers
19975 and their effect on the user name space.
19977 * src/bison.simple:
19978 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
19979 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
19980 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
19982 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
19983 on user names when possible.
19985 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
19986 Simplify test for whather <alloca.h> exists.
19988 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
19990 (<stdio.h>): Include if YYDEBUG.
19992 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
19993 ! defined (yyoverflow) && ! defined (yymemcpy).
19995 (yymemcpy, yyparse): Rename local variables as needed so that
19996 they all begin with 'yy'.
19998 (yystrlen, yystpcpy): New functions.
20000 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
20003 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
20004 instead of relying on string.h functions. Use YYSTACK_ALLOC
20005 and YYSTACK_FREE instead of malloc and free.
20007 2001-11-30 Akim Demaille <akim@epita.fr>
20009 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
20010 before their first uses.
20011 (YYBISON, YYPURE): Move to the top of the output.
20013 2001-11-30 Akim Demaille <akim@epita.fr>
20015 * tests/reduce.at (Useless Nonterminals): Fix.
20017 2001-11-30 Akim Demaille <akim@epita.fr>
20019 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
20020 if body instead of `;' to pacify GCC's warnings.
20022 2001-11-30 Akim Demaille <akim@epita.fr>
20024 Instead of mapping the LHS of unused rules to -1, keep the LHS
20025 valid, but flag the rules as invalid.
20027 * src/gram.h (rule_t): `useful' is a new member.
20028 * src/print.c (print_grammar): Adjust.
20029 * src/derives.c (set_derives): Likewise.
20030 * src/reader.c (packgram, reduce_output): Likewise.
20031 * src/reduce.c (reduce_grammar_tables): Likewise.
20032 * tests/reduce.at (Underivable Rules, Useless Rules): New.
20034 2001-11-30 Akim Demaille <akim@epita.fr>
20036 * src/reduce.c (reduce_output): Formatting changes.
20037 * src/print.c (print_results, print_grammar): Likewise.
20038 * tests/regression.at (Rule Line Numbers)
20039 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
20041 2001-11-30 Akim Demaille <akim@epita.fr>
20043 * src/reduce.c (nonterminals_reduce): Instead of throwing away
20044 useless nonterminals, move them at the end of the symbol arrays.
20045 (reduce_output): Adjust.
20046 * tests/reduce.at (Useless Nonterminals): Adjust.
20048 2001-11-30 Akim Demaille <akim@epita.fr>
20050 * src/reduce.c: Various comment/formatting changes.
20051 (nonterminals_reduce): New, extracted from...
20052 (reduce_grammar_tables): here.
20053 (reduce_grammar): Call nonterminals_reduce.
20055 2001-11-29 Paul Eggert <eggert@twinsun.com>
20057 * src/bison.simple (YYSTACK_REALLOC): Remove.
20058 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
20059 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
20061 (union yyalloc): New type.
20062 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
20063 an arbitrary restriction on hosts where size_t is wider than int.
20065 (yyparse): Don't dump core if alloca or malloc fails; instead, report
20066 a parser stack overflow. Allocate just one block of memory for all
20067 three stacks, instead of allocating three blocks; this typically is
20068 faster and reduces fragmentation.
20070 Do not limit the number of items in the stack to a value that fits
20071 in 'int', as this is an arbitrary limit on hosts with 64-bit
20072 size_t and 32-bit int.
20074 2001-11-29 Marc Autret <autret_m@epita.fr>
20076 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
20077 of defining YYERROR_VERBOSE.
20078 [AT_DATA]: $4 is now out of C declarations in the prologue.
20080 2001-11-28 Marc Autret <autret_m@epita.fr>
20082 * src/reader.c (parse_dquoted_param): New.
20083 (parse_skel_decl): Use it.
20084 * src/lex.h: Add its prototype.
20085 * src/lex.c (literalchar): Become not static.
20087 2001-11-28 Marc Autret <autret_m@epita.fr>
20089 * src/output.h: And put its extern declaration here.
20090 * src/output.c (error_verbose): Define here.
20091 (prepare): Echo name modification.
20092 * src/getargs.h: Clean its extern declaration.
20093 * src/getargs.c (error_verbose_flag): Remove.
20094 (getargs): Remove case 'e'.
20095 * src/options.c (option_table): 'error-verbose' is now seen as simple
20099 * src/reader.c (read_declarations): Remove case tok_include.
20100 (parse_include_decl): Remove.
20101 * src/lex.h (token_t): Remove tok_include.
20102 * src/options.c (option_table): 'include' is now a simple command line
20105 2001-11-28 Marc Autret <autret_m@epita.fr>
20107 * src/bison.simple: Adjust muscle names.
20108 * src/muscle_tab.c (muscle_init): Also rename the muscles.
20109 * src/output.c (prepare): s/_/-/ for the muscles names.
20110 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
20112 2001-11-28 Marc Autret <autret_m@epita.fr>
20114 * src/bison.simple: Fix debug.
20115 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
20117 2001-11-28 Akim Demaille <akim@epita.fr>
20119 * src/LR0.c (shifts_new): New.
20120 (save_shifts, insert_start_shift, augment_automaton): Use it.
20122 2001-11-28 Akim Demaille <akim@epita.fr>
20124 * src/closure.c (closure): `b' and `ruleno' denote the same value:
20127 2001-11-28 Akim Demaille <akim@epita.fr>
20129 * src/closure.c (closure): Instead of looping over word in array
20130 then bits in words, loop over bits in array.
20132 2001-11-28 Akim Demaille <akim@epita.fr>
20134 * src/closure.c (closure): No longer optimize the special case
20135 where all the bits of `ruleset[r]' are set to 0, to make the code
20138 2001-11-28 Akim Demaille <akim@epita.fr>
20140 * src/closure.c (closure): `r' and `c' are new variables, used to
20141 de-obfuscate accesses to RULESET and CORE.
20143 2001-11-28 Akim Demaille <akim@epita.fr>
20145 * src/reduce.c (reduce_print): Use ngettext.
20146 (dump_grammar): Improve the trace accuracy.
20148 2001-11-28 Akim Demaille <akim@epita.fr>
20150 * src/reduce.c (dump_grammar): Don't translate trace messages.
20152 2001-11-28 Akim Demaille <akim@epita.fr>
20154 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
20155 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
20156 as all tags are free'ed afterwards.
20157 From Enrico Scholz.
20159 2001-11-27 Paul Eggert <eggert@twinsun.com>
20161 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
20162 use alloca when we didn't want to, and vice versa.
20164 2001-11-27 Marc Autret <autret_m@epita.fr>
20166 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
20168 * src/output.c (prepare): Remove its update.
20170 2001-11-27 Marc Autret <autret_m@epita.fr>
20172 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
20173 Use %error-verbose.
20175 2001-11-27 Marc Autret <autret_m@epita.fr>
20177 * src/bison.simple: Remove YYERROR_VERBOSE using.
20178 Use %%error_verbose.
20179 (yyparse): Likewise.
20180 * src/output.c (prepare): Give its final value.
20181 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
20182 * src/getargs.h: Add its extern declaration.
20183 * src/getargs.c (error_verbose_flag): New int.
20184 (getargs): Update to catch new case.
20185 * src/options.c (option_table): 'error-verbose' is a new option.
20186 (shortopts): Update.
20188 2001-11-27 Akim Demaille <akim@epita.fr>
20190 * src/system.h: Use intl/libgettext.h.
20191 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
20193 2001-11-27 Akim Demaille <akim@epita.fr>
20195 * tests/torture.at (Exploding the Stack Size with Malloc):
20196 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
20198 2001-11-27 Akim Demaille <akim@epita.fr>
20200 * src/files.c: Include error.h.
20201 Reported by Hans Aberg.
20203 2001-11-26 Marc Autret <autret_m@epita.fr>
20205 * src/reader.c (parse_include_decl): New, not yet implemented.
20206 (read_declarations): Add case tok_include.
20207 * src/getargs.h (include): Add its extern definition.
20208 * src/getargs.c (include): New const char *.
20209 (getargs): Add case '-I'.
20210 * src/options.c (option_table): Add include as command line and
20212 * src/lex.h (token_t): Add tok_include.
20214 2001-11-26 Akim Demaille <akim@epita.fr>
20216 * src/reader.c (readgram): Make sure rules for mid-rule actions
20217 have a lineno equal to that of their host rule.
20218 Reported by Hans Aberg.
20219 * tests/regression.at (Rule Line Numbers): New.
20221 2001-11-26 Akim Demaille <akim@epita.fr>
20223 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
20226 2001-11-26 Akim Demaille <akim@epita.fr>
20228 * src/complain.c, src/complain.h (error): Remove, provided by
20231 2001-11-26 Akim Demaille <akim@epita.fr>
20233 * src/reader.c (read_declarations): Don't abort on tok_illegal,
20234 issue an error message.
20235 * tests/regression.at (Invalid %directive): New.
20236 Reported by Hans Aberg.
20238 2001-11-26 Akim Demaille <akim@epita.fr>
20240 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
20241 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20243 2001-11-26 Akim Demaille <akim@epita.fr>
20245 * src/conflicts.c (conflicts_print): Don't complain at all when
20246 there are no reduce/reduce conflicts, and as many shift/reduce
20247 conflicts as expected.
20248 * tests/regression.at (%expect right): Adjust.
20250 2001-11-23 Akim Demaille <akim@epita.fr>
20252 * lib/alloca.c: Update, from fileutils.
20254 2001-11-23 Akim Demaille <akim@epita.fr>
20256 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
20258 2001-11-23 Akim Demaille <akim@epita.fr>
20260 * src/system.h: Include alloca.h.
20261 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
20263 2001-11-23 Akim Demaille <akim@epita.fr>
20265 * src/print_graph.c (print_actions): Remove `rule', unused.
20266 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
20267 pacify GCC's signed < unsigned warnings.
20268 * src/closure.c (itemsetsize): Likewise.
20269 * src/reader.c (symbol_list_new): Static.
20271 2001-11-23 Akim Demaille <akim@epita.fr>
20273 Attaching lineno to buckets is stupid, since only one copy of each
20274 symbol is kept, only the line of the first occurrence is kept too.
20276 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
20277 * src/reader.c (rline_allocated): Remove, unused.
20278 (symbol_list): Have a `line' member.
20279 (symbol_list_new): New.
20280 (readgram): Use it.
20281 * src/print.c (print_grammar): Output the rule line numbers.
20282 * tests/regression.at (Solved SR Conflicts)
20283 (Unresolved SR Conflicts): Adjust.
20284 Reported by Hans Aberg.
20286 2001-11-22 Marc Autret <autret_m@epita.fr>
20288 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
20290 2001-11-22 Marc Autret <autret_m@epita.fr>
20292 * src/muscle_tab.c (muscle_init): Remove initialization of
20294 * src/output.c (output_master_parser): Do it here.
20296 2001-11-20 Akim Demaille <akim@epita.fr>
20299 * configure.in (ALL_LINGUAS): Adjust.
20300 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
20301 longer contains strings to translate.
20303 2001-11-19 Akim Demaille <akim@epita.fr>
20305 * src/conflicts.c (conflicts_print): Add a missing \n.
20307 2001-11-19 Akim Demaille <akim@epita.fr>
20309 * src/nullable.c (nullable_print): New.
20310 (set_nullable): Call it when tracing.
20311 Better locality of variables.
20313 2001-11-19 Akim Demaille <akim@epita.fr>
20315 * src/print.c (print_actions): Better locality of variables.
20317 2001-11-19 Akim Demaille <akim@epita.fr>
20319 * src/derives.c (print_derives): Fix and enrich.
20320 * src/closure.c (print_fderives): Likewise.
20322 2001-11-19 Akim Demaille <akim@epita.fr>
20324 * src/closure.c (itemsetend): Remove, replaced with...
20325 (itemsetsize): new.
20327 2001-11-19 Akim Demaille <akim@epita.fr>
20329 * src/LR0.c (kernel_end): Remove, replaced with...
20330 (kernel_size): new.
20332 2001-11-19 Akim Demaille <akim@epita.fr>
20334 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
20337 2001-11-19 Akim Demaille <akim@epita.fr>
20339 * src/closure.c (closure): Use arrays instead of pointers to clarify.
20341 2001-11-19 Akim Demaille <akim@epita.fr>
20343 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
20345 * src/LR0.c: Likewise.
20346 (allocate_itemsets): Use arrays instead of pointers to clarify.
20348 2001-11-19 Akim Demaille <akim@epita.fr>
20350 * src/getargs.c (statistics_flag): Replace with...
20352 (longopts): Accept --trace instead of --statistics.
20353 * src/getargs.h, src/options.c: Adjust.
20354 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
20355 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
20357 2001-11-19 Akim Demaille <akim@epita.fr>
20359 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
20360 pointers to clarify the code.
20361 (save_reductions, save_shifts): Factor common parts of alternatives.
20363 2001-11-19 Akim Demaille <akim@epita.fr>
20365 * src/LR0.c (new_state, get_state): Complete TRACE code.
20366 * src/closure.c: Include `reader.h' to get `tags', needed by the
20368 Rename the conditional DEBUG as TRACE.
20369 Output consistently TRACEs to stderr, not stdout.
20370 * src/derives.c: Likewise.
20371 * src/reduce.c: (inaccessable_symbols): Using if is better style
20373 Use `#if TRACE' instead of `#if 0' for tracing code.
20375 2001-11-19 Akim Demaille <akim@epita.fr>
20377 * src/system.h (LIST_FREE, shortcpy): New.
20378 * src/LR0.c: Use them.
20379 * src/output.c (free_itemsets, free_reductions, free_shifts):
20380 Remove, replaced by LIST_FREE.
20382 2001-11-19 Akim Demaille <akim@epita.fr>
20384 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
20385 (REDUCTIONS_ALLOC): New.
20386 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
20389 2001-11-19 Akim Demaille <akim@epita.fr>
20391 * src/LR0.c (new_state): Complete trace code.
20392 * src/nullable.c (set_nullable): Don't translate traces.
20394 2001-11-19 Akim Demaille <akim@epita.fr>
20396 * src/print_graph.c (print_core): Better locality of variables.
20397 * src/print.c (print_core): Likewise.
20399 2001-11-19 Akim Demaille <akim@epita.fr>
20401 * src/vcg.c: You do the output, so you are responsible of the
20402 handling of VCG syntax, in particular: use quotearg.
20403 * src/print_graph.c: Don't.
20404 (print_actions): Don't output the actions as part of the nodes,
20405 since that's the job of the edges.
20406 (print_state): Don't output by hand: fill the node description,
20407 and ask for its output.
20409 2001-11-19 Akim Demaille <akim@epita.fr>
20411 * src/bison.simple (yyparse): When verbosely reporting an error,
20412 no longer put additional quotes around token names.
20413 * tests/calc.at: Adjust.
20415 2001-11-19 Akim Demaille <akim@epita.fr>
20417 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
20418 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
20419 * src/output.c: Adjust.
20421 2001-11-19 Akim Demaille <akim@epita.fr>
20423 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
20425 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
20427 2001-11-19 Akim Demaille <akim@epita.fr>
20429 * src/gram.h (rule_t): New.
20431 (rrhs, rlhs): Remove, part of state_t.
20432 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
20433 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
20434 * src/reader.c, src/reduce.c: Adjust.
20436 2001-11-19 Akim Demaille <akim@epita.fr>
20438 * src/reader.c (symbols_output): New, extracted from...
20439 (packsymbols): Here.
20442 2001-11-19 Akim Demaille <akim@epita.fr>
20444 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
20445 (maxrhs): this new function.
20447 2001-11-19 Akim Demaille <akim@epita.fr>
20449 * src/lalr.c (F): New macro to access the variable F.
20452 2001-11-19 Akim Demaille <akim@epita.fr>
20454 * src/lalr.h (LA): New macro to access the variable LA.
20455 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20456 * src/lalr.c: Adjust.
20458 2001-11-19 Akim Demaille <akim@epita.fr>
20460 * src/lalr.c (initialize_LA): Only initialize LA. Let...
20461 (set_state_table): handle the `lookaheads' members.
20463 2001-11-19 Akim Demaille <akim@epita.fr>
20465 * src/lalr.h (lookaheads): Removed array, whose contents is now
20467 (state_t): this structure.
20468 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20471 2001-11-19 Akim Demaille <akim@epita.fr>
20473 * src/lalr.h (consistent): Removed array, whose contents is now
20475 (state_t): this structure.
20476 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20479 2001-11-19 Akim Demaille <akim@epita.fr>
20481 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
20482 contents are now members of...
20483 (state_t): this structure.
20484 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20487 2001-11-19 Akim Demaille <akim@epita.fr>
20489 * src/lalr.h (state_t): New.
20490 (state_table): Be a state_t * instead of a core **.
20491 (accessing_symbol): Remove, part of state_t.
20492 * src/lalr.c: Adjust.
20493 (set_accessing_symbol): Merge into...
20494 (set_state_table): this.
20495 * src/print_graph.c, src/conflicts.c: Adjust.
20497 2001-11-14 Akim Demaille <akim@epita.fr>
20499 * tests/calc.at, tests/output.at, tests/regression.at,
20500 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
20501 now the tests are run in private dirs, therefore AC_CLEANUP and
20502 family can be simplified to 0-ary.
20503 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
20504 use abs. path to find config.h.
20505 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
20506 stderr, there can be way too much random noise.
20507 Instead pass -Werror to GCC and rely on the exit status.
20508 Reported by Wolfram Wagner.
20510 2001-11-14 Akim Demaille <akim@epita.fr>
20512 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
20513 defined only if yyoverflow is defined, to avoid `warning: unused
20515 Reported by The Test Suite.
20517 2001-11-14 Akim Demaille <akim@epita.fr>
20519 * src/print.c: Include reduce.h.
20520 Reported by Hans Aberg.
20522 2001-11-14 Akim Demaille <akim@epita.fr>
20524 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
20525 Revert a previous patch: these are really const.
20526 * src/conflicts.c (conflict_report): Additional useless pair of
20527 braces to pacify GCC's warnings for `if () if () {} else {}'.
20528 * src/lex.c (parse_percent_token): Replace equal_offset with
20531 Be sure to strdup `arg' when used, since there is no reason for
20532 token_buffer not to change.
20534 2001-11-14 Akim Demaille <akim@epita.fr>
20536 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
20538 * src/main.c (main): Use them.
20539 Suggested by Hans Aberg.
20541 2001-11-12 Akim Demaille <akim@epita.fr>
20543 * src/system.h (ngettext): Now that we use ngettext, be sure to
20544 provide a default definition when NLS are not used.
20546 2001-11-12 Akim Demaille <akim@epita.fr>
20548 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
20549 Use @kbd to denote user input.
20550 (Language and Grammar): ANSIfy the example.
20551 Adjust its layout for info/notinfo.
20552 (Location Tracking Calc): Output error messages to stderr.
20553 Output locations in a more GNUtically correct way.
20554 Fix a couple of Englishos.
20555 Adjust @group/@end group pairs.
20557 2001-11-12 Akim Demaille <akim@epita.fr>
20559 %expect was not functioning at all.
20561 * src/conflicts.c (expected_conflicts): Set to -1.
20562 (conflict_report): Use ngettext.
20563 (conflicts_print): Check %expect and make its violation an error.
20564 * doc/bison.texinfo (Expect Decl): Adjust.
20565 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
20566 * tests/regression.at (%expect not enough, %expect right)
20567 (%expect too much): New.
20569 2001-11-12 Akim Demaille <akim@epita.fr>
20571 * tests/regression.at (Conflicts): Rename as...
20572 (Unresolved SR Conflicts): this.
20573 (Solved SR Conflicts): New.
20575 2001-11-12 Akim Demaille <akim@epita.fr>
20577 * src/reduce.c (print_results): Rename as...
20578 (reduce_output): This.
20579 Output to OUT, passed as argument, instead of output_obstack.
20580 (dump_grammar): Likewise.
20581 (reduce_free): New.
20583 (reduce_grammar): No longer call reduce_output, since...
20584 * src/print.c (print_results): do it.
20585 * src/main.c (main): Call reduce_free;
20587 2001-11-12 Akim Demaille <akim@epita.fr>
20589 * src/conflicts.c (print_reductions): Accept OUT as argument.
20590 Output to it, not to output_obstack.
20591 * src/print.c (print_actions): Adjust.
20593 2001-11-12 Akim Demaille <akim@epita.fr>
20595 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
20596 the result instead of using...
20597 (src_total, rrc_total, src_count, rrc_count): Remove.
20598 (any_conflicts): Remove.
20599 (print_conflicts): Split into...
20600 (conflicts_print, conflicts_output): New.
20601 * src/conflicts.h: Adjust.
20602 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
20603 * src/print.c (print_grammar): Issue `\n' between two rules.
20604 * tests/regression.at (Conflicts): New.
20605 Reported by Tom Lane.
20607 2001-11-12 Akim Demaille <akim@epita.fr>
20609 * tests/regression.at (Invalid input): Remove, duplicate with
20610 ``Invalid input: 1''.
20612 2001-11-12 Akim Demaille <akim@epita.fr>
20614 * tests/torture.at (AT_DATA_STACK_TORTURE)
20615 (Exploding the Stack Size with Alloca)
20616 (Exploding the Stack Size with Malloc): New.
20618 2001-11-12 Akim Demaille <akim@epita.fr>
20620 * src/bison.simple (YYSTACK_REALLOC): New.
20621 (yyparse) [!yyoverflow]: Use it and free the old stack.
20622 Reported by Per Allansson.
20624 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
20626 * src/bison.simple: Define type yystype instead of YYSTYPE, and
20627 define CPP macro, which substitute YYSTYPE by yystype.
20628 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
20629 with yyltype/YYLTYPE. This allows inclusion of the generated
20630 header within the parser if the compiler, such as GGC, accepts
20631 multiple equivalent #defines.
20634 2001-11-05 Akim Demaille <akim@epita.fr>
20636 * src/reader.c (symbols_output): New, extracted from...
20637 (packsymbols): here.
20640 2001-11-05 Akim Demaille <akim@epita.fr>
20642 * src/lex.c (parse_percent_token): s/quotearg/quote/.
20644 2001-11-05 Akim Demaille <akim@epita.fr>
20646 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
20649 2001-11-05 Akim Demaille <akim@epita.fr>
20651 * src/options.h (struct option_table_struct): set_flags is void*.
20652 * src/options.c (longopts): Support `--output' and `%output'.
20654 * src/lex.h (tok_setopt): Remove, replaced with...
20655 (tok_intopt, tok_stropt): these new guys.
20656 * src/lex.c (getopt.h): Not needed.
20657 (token_buffer, unlexed_token_buffer): Not const.
20658 (percent_table): Promote `-' over `_' in directive names.
20659 Active `%name-prefix', `file-prefix', and `output'.
20660 (parse_percent_token): Accept possible arguments to directives.
20661 Promote `-' over `_' in directive names.
20663 2001-11-04 Akim Demaille <akim@epita.fr>
20665 * doc/bison.texinfo (Decl Summary): Split the list into
20666 `directives for grammars' and `directives for bison'.
20668 Add description of `%name-prefix', `file-prefix', and `output'.
20669 Promote `-' over `_' in directive names.
20670 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
20671 Simplify the description of `--name-prefix'.
20672 Promote `-' over `_' in directive names.
20673 Promote `--output' over `--output-file'.
20674 Fix the description of `--defines'.
20675 * tests/output.at: Exercise %file-prefix and %output.
20677 2001-11-02 Akim Demaille <akim@epita.fr>
20679 * doc/refcard.tex: Update.
20681 2001-11-02 Akim Demaille <akim@epita.fr>
20683 * src/symtab.h (SUNDEF): New.
20684 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
20685 stand for `uninitialized', instead of 0.
20686 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
20687 * src/lex.c (lex): Adjust.
20689 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
20691 Let yylex return it instead of a plain 0.
20692 Reported by Dick Streefland.
20694 2001-11-02 Akim Demaille <akim@epita.fr>
20696 * tests/regression.at (Mixing %token styles): New test.
20698 2001-11-02 Akim Demaille <akim@epita.fr>
20700 * src/reader.c (parse_thong_decl): Formatting changes.
20701 (token_translations_init): New, extracted from...
20702 (packsymbols): Here.
20705 2001-11-01 Akim Demaille <akim@epita.fr>
20707 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
20708 Check that `9foo.y' produces correct cpp guards.
20709 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
20713 2001-11-01 Akim Demaille <akim@epita.fr>
20715 * tests/regression.at (Invalid input: 2): New.
20716 * src/lex.c (unlexed_token_buffer): New.
20717 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
20721 2001-11-01 Akim Demaille <akim@epita.fr>
20723 * tests/calc.at: Catch up with 1.30.
20724 * configure.in: Bump to 1.49a.
20725 Adjust to newer Autotest.
20727 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
20729 * src/conflicts.c: Move global variables rrc_total and src_total ...
20730 (print_conflicts): here.
20731 * src/output.c (output): Free global variable user_toknums.
20732 * src/lex.c (token_obstack): Become static.
20734 2001-10-18 Akim Demaille <akim@epita.fr>
20736 * tests/atlocal.in (GCC): Add.
20737 * tests/calc.at: s/m4_match/m4_bmatch/.
20738 s/m4_patsubst/m4_bpatsubst/.
20739 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
20740 * configure.in: AC_SUBST(GCC).
20742 2001-10-14 Marc Autret <autret_m@epita.fr>
20744 * src/options.c (create_long_option_table): Fix.
20746 2001-10-10 Akim Demaille <akim@epita.fr>
20748 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
20750 2001-10-04 Akim Demaille <akim@epita.fr>
20752 * src/reader.c (parse_union_decl): Push the caracters in
20753 union_obstack, not attrs_obstack.
20755 2001-10-04 Akim Demaille <akim@epita.fr>
20757 Merge in the branch 1.29.
20759 * src/reader.c (packsymbols): Use a temporary obstack for
20760 `%%tokendef', since output_stack is already used elsewhere.
20762 2001-10-02 Akim Demaille <akim@epita.fr>
20766 2001-10-02 Akim Demaille <akim@epita.fr>
20770 2001-10-02 Akim Demaille <akim@epita.fr>
20772 * tests/regression.at (Invalid CPP headers): New.
20773 From Alexander Belopolsky.
20774 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
20776 2001-10-02 Akim Demaille <akim@epita.fr>
20778 * tests/regression.at (Invalid input): New.
20779 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
20782 2001-10-02 Akim Demaille <akim@epita.fr>
20784 * tests/calc.at: Now that --debug works, the tests must be adjusted.
20786 2001-10-02 Akim Demaille <akim@epita.fr>
20788 * src/output.c (output_parser): Assert `skeleton'.
20789 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
20793 2001-10-01 Marc Autret <autret_m@epita.fr>
20795 * src/lex.h: Echo modifications.
20796 * src/lex.c (unlex): Parameter is now token_t.
20799 2001-10-01 Marc Autret <autret_m@epita.fr>
20801 * src/main.c: Include lex.h.
20804 2001-09-29 Akim Demaille <akim@epita.fr>
20806 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
20808 2001-09-28 Akim Demaille <akim@epita.fr>
20810 * tests/testsuite.at: Update to newer Autotest.
20811 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
20813 2001-09-27 Akim Demaille <akim@epita.fr>
20815 Position independent wrapper.
20817 * tests/bison: Remove.
20818 * tests/bison.in: New.
20819 * configure.in: Adjust.
20821 2001-09-27 Paul Eggert <eggert@twinsun.com>
20823 Port quotearg fixes from tar 1.13.24.
20825 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
20827 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
20828 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
20830 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
20831 * m4/mbrtowc.m4: New file.
20832 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
20833 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
20835 2001-09-27 Akim Demaille <akim@epita.fr>
20839 2001-09-27 Akim Demaille <akim@epita.fr>
20843 2001-09-25 Akim Demaille <akim@epita.fr>
20845 * src/system.h: Include `xalloc.h'.
20846 Remove it from the C files.
20847 * src/files.c (output_files): Free the obstacks.
20848 * src/lex.c (init_lex): Rename as...
20851 * src/main.c (main): Use it.
20853 2001-09-24 Marc Autret <autret_m@epita.fr>
20855 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
20856 to output informations in fout (FILE*).
20857 (open_graph, close_graph): Likewise.
20858 (output_graph, output_edge, output_node): Likewise.
20859 * src/vcg.h: Update function prototypes.
20860 * src/print_graph.c (print_graph): Open output graph file.
20861 (print_actions): Adjust.
20862 * src/files.h: Remove extern declaration.
20863 * src/files.c: Remove graph_obstack declaration.
20864 (open_files): Remove graph_obstack initialization.
20865 (output_files): Remove graph_obstack saving.
20867 2001-09-24 Marc Autret <autret_m@epita.fr>
20869 * src/files.c (compute_output_file_names): Fix.
20871 2001-09-24 Marc Autret <autret_m@epita.fr>,
20872 Akim Demaille <akim@epita.fr>
20874 * src/reader.c (reader): Remove call to free_symtab ().
20875 * src/main.c (main): Call it here.
20877 * src/conflicts.c (initialize_conflicts): Rename as...
20878 (solve_conflicts): this.
20879 * src/print.c (print_core, print_actions, print_state)
20880 (print_grammar): Dump to a file instead a `output_obstack'.
20881 (print_results): Dump `output_obstack', and then proceed with the
20883 * src/files.c (compute_output_file_names, close_files): New.
20884 (output_files): Adjust.
20885 * src/main.c (main): Adjust.
20887 2001-09-23 Marc Autret <autret_m@epita.fr>
20889 * src/files.c (compute_header_macro): Computes header macro name
20890 from spec_defines_file when given.
20892 2001-09-23 Marc Autret <autret_m@epita.fr>
20894 * src/files.c (output_files): Add default extensions.
20896 2001-09-22 Akim Demaille <akim@epita.fr>
20898 * src/conflicts.c (finalize_conflicts): Rename as...
20899 (free_conflicts): this.
20901 2001-09-22 Akim Demaille <akim@epita.fr>
20903 * src/gram.c (gram_free): Rename back as...
20905 (output_token_translations): Free `token_translations'.
20906 * src/symtab.c (free_symtab): Free the tag field.
20908 2001-09-22 Akim Demaille <akim@epita.fr>
20910 Remove `translations' as it is always set to true.
20912 * src/gram.h: Adjust.
20913 * src/reader.c (packsymbols, parse_token_decl): Adjust
20914 * src/print.c (print_grammar): Adjust.
20915 * src/output.c (output_token_translations): Adjust.
20916 * src/lex.c (lex): Adjust.
20917 * src/gram.c: Be sure the set pointers to NULL.
20918 (dummy): Rename as...
20921 2001-09-22 Akim Demaille <akim@epita.fr>
20923 * configure.in: Invoke AM_LIB_DMALLOC.
20924 * src/system.h: Use dmalloc.
20925 * src/LR0.c: Be sure to have pointers initialized to NULL.
20926 (allocate_itemsets): Allocate kernel_items only if needed.
20928 2001-09-22 Akim Demaille <akim@epita.fr>
20930 * configure.in: Bump to 1.29b.
20931 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
20932 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
20933 need xmalloc.c in calc.y.
20936 2001-09-21 Akim Demaille <akim@epita.fr>
20939 * Makefile.maint, config/config.guess, config/config.sub,
20940 * config/missing: Update from masters.
20941 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
20943 * configure.in (ALL_LINGUAS): Add `tr'.
20945 2001-09-21 Akim Demaille <akim@epita.fr>
20947 * tests/Makefile.am (package.m4): Move to...
20948 ($(srcdir)/$(TESTSUITE)): here.
20950 2001-09-20 Akim Demaille <akim@epita.fr>
20952 * src/complain.c: No longer try to be standalone: use system.h.
20953 Don't assume __STDC__ is defined to 1. Just test if it is defined.
20954 * src/complain.h: Likewise.
20955 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
20956 Remove the unused variable `n'.
20957 From Albert Chin-A-Young.
20959 2001-09-18 Marc Autret <autret_m@epita.fr>
20961 * doc/bison.1: Update.
20962 * doc/bison.texinfo (Bison Options): Update --defines and --graph
20964 (Option Cross Key): Update.
20967 2001-09-18 Marc Autret <autret_m@epita.fr>
20969 * tests/regression.at: New test (comment in %union).
20971 2001-09-18 Marc Autret <autret_m@epita.fr>
20973 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
20975 Reported by Keith Browne.
20977 2001-09-18 Marc Autret <autret_m@epita.fr>
20979 * tests/output.at: Add tests for --defines and --graph.
20981 2001-09-18 Marc Autret <autret_m@epita.fr>
20983 * tests/output.at: Removes tests of %{header,src}_extension features.
20985 2001-09-18 Akim Demaille <akim@epita.fr>
20987 * tests/Makefile.am (package.m4): New.
20988 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
20989 (_AT_CHECK_CALC_ERROR): Likewise.
20990 Factor the `, ' part of verbose error messages.
20992 2001-09-18 Marc Autret <autret_m@epita.fr>
20994 * src/getargs.c (longopts): Declare --defines and --graph as options
20995 with optional arguments.
20996 * src/files.h: Add extern declarations.
20997 * src/files.c (spec_graph_file, spec_defines_file): New.
20998 (output_files): Update.
20999 Remove CPP-outed code.
21001 2001-09-18 Marc Autret <autret_m@epita.fr>
21003 Turn off %{source,header}_extension feature.
21005 * src/files.c (compute_exts_from_gf): Update.
21006 (compute_exts_from_src): Update.
21007 (output_files): CPP-out useless code.
21008 * src/files.h: Remove {header,source}_extension extern declarations.
21009 * src/reader.c (parse_dquoted_param): CPP-out.
21010 (parse_header_extension_decl): Remove.
21011 (parse_source_extension_decl): Remove.
21012 (read_declarations): Remove cases tok_{hdrext,srcext}.
21013 * src/lex.c (percent_table): Remove {header,source}_extension entries.
21014 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
21016 2001-09-10 Akim Demaille <akim@epita.fr>
21018 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
21019 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
21020 (AT_CHECK_OUTPUT): this.
21021 Merely check ls' exit status, its output is useless.
21023 2001-09-10 Akim Demaille <akim@epita.fr>
21025 * tests/calc.at: Use m4_match.
21026 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
21028 2001-09-10 Marc Autret <autret_m@epita.fr>,
21029 Akim Demaille <akim@epita.fr>
21031 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
21033 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
21035 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
21036 * src/lex.h: Adjust prototype.
21037 (token_t): Add `tok_undef'.
21038 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
21039 (parse_percent_token): Now returns token_t.
21040 Add default statement in switch.
21041 (lex): Separate `c' as an input variable, from the token_t result
21043 (unlexed): Is a token_t.
21045 2001-09-10 Akim Demaille <akim@epita.fr>
21047 * configure.in: Bump to 1.29a.
21049 2001-09-07 Akim Demaille <akim@epita.fr>
21053 2001-08-30 Akim Demaille <akim@epita.fr>
21055 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
21056 * m4/atconfig.m4: Remove.
21057 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
21058 * tests/bison: New.
21059 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
21060 m4_if, m4_patsubst, and m4_regexp.
21061 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
21062 `input' file instead of echo.
21064 2001-08-29 Akim Demaille <akim@epita.fr>
21068 2001-08-29 Akim Demaille <akim@epita.fr>
21072 2001-08-29 Paul Eggert <eggert@twinsun.com>
21074 * src/bison.simple (yyparse): Don't take the address of an
21075 item before the start of an array, as that doesn't conform to
21078 2001-08-29 Robert Anisko <anisko_r@epita.fr>
21080 * doc/bison.texinfo (Location Tracking Calc): New node.
21082 2001-08-29 Paul Eggert <eggert@twinsun.com>
21084 * src/output.c (output): Do not define const, as this now
21085 causes more problems than it cures.
21087 2001-08-29 Akim Demaille <akim@epita.fr>
21089 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
21091 Be sure to tag the `detailmenu'.
21093 2001-08-29 Akim Demaille <akim@epita.fr>
21095 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
21096 download in a tmp dir.
21098 2001-08-28 Marc Autret <autret_m@epita.fr>
21100 * config/depcomp: New file.
21102 2001-08-28 Marc Autret <autret_m@epita.fr>
21104 * doc/bison.1 (mandoc): Adjust.
21105 From Juan Manuel Guerrero.
21107 2001-08-28 Marc Autret <autret_m@epita.fr>
21109 * src/print_graph.c (print_state): Fix.
21111 2001-08-27 Marc Autret <autret_m@epita.fr>
21113 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
21115 Echo modifications to the functions prototypes.
21116 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
21118 2001-08-27 Marc Autret <autret_m@epita.fr>
21120 * src/vcg.c: Include `xalloc.h'.
21121 (add_colorentry): New.
21122 (add_classname): New.
21123 (add_infoname): New.
21124 * src/vcg.h: Add new prototypes.
21126 2001-08-27 Akim Demaille <akim@epita.fr>
21128 * Makefile.maint: Sync. again with CVS Autoconf.
21130 2001-08-27 Akim Demaille <akim@epita.fr>
21132 * Makefile.maint: Formatting changes.
21133 (po-update, cvs-update, update): New targets.
21136 2001-08-27 Akim Demaille <akim@epita.fr>
21138 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
21139 * Makefile.maint: Sync. with CVS Autoconf.
21141 2001-08-27 Marc Autret <autret_m@epita.fr>
21143 * src/vcg.h (struct infoname_s): New.
21144 (struct colorentry_s): New.
21145 (graph_s): New fields {vertical,horizontal}_order in structure.
21146 Add `infoname' field.
21147 Add `colorentry' field;
21148 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
21149 (G_HORIZONTAL_ORDER): New.
21151 (G_COLORENTRY): New.
21152 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
21153 Add output of `infoname'.
21154 Add output of `colorentry'.
21156 2001-08-27 Marc Autret <autret_m@epita.fr>
21158 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
21159 This one shadowed a global parameter.
21161 2001-08-24 Marc Autret <autret_m@epita.fr>
21163 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
21164 instead of `unsigned'.
21165 (print_state): Do not call obstack_object_size () in obstack_grow ()
21166 to avoid macro variables shadowing.
21168 2001-08-23 Marc Autret <autret_m@epita.fr>
21170 * src/lex.c (percent_table): Typo: s/naem/name/.
21172 Normalize new options declarations.
21174 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
21176 * tests/suite.at: Exercise %header_extension and %source_extension.
21178 2001-08-16 Marc Autret <autret_m@epita.fr>
21180 * src/reader.c (parse_dquoted_param): New.
21181 (parse_header_extension_decl): Use it.
21182 (parse_source_extension_decl): Likewise.
21184 2001-08-16 Marc Autret <autret_m@epita.fr>
21186 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
21187 (get_xxxx_str): Use assert () instead of complain ().
21188 Remove return invokations in default cases.
21189 (get_decision_str): Modify default behaviour. Remove second argument.
21190 Echo modifications on calls.
21191 (output_graph): Fix.
21193 2001-08-16 Marc Autret <autret_m@epita.fr>
21195 * src/getargs.c (usage): Update with ``-g, --graph''.
21197 2001-08-16 Marc Autret <autret_m@epita.fr>
21199 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
21200 (Option Cross Key): Likewise.
21201 * doc/bison.1: Update.
21203 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
21205 * src/output.c (output_master_parser): Don't finish action_obstack.
21206 (output_parser): Don't care about the muscle action, here.
21207 (prepare): Copy the action_obstack in the action muscle.
21208 (output): Free action_obstack.
21210 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
21212 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
21213 will contain `%union' declaration.
21214 (parse_union_decl): Delete #line directive output.
21215 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
21216 informations about %union.
21217 (parse_union_decl): Copy the union_obstack in the muscle stype.
21218 * src/bison.simple: Add new #line directive.
21219 Add typdef %%stype YYSTYPE.
21221 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
21223 * src/bison.simple: Add new `#line' directive.
21225 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
21227 * src/bison.simple: New `#line' directive.
21228 * src/output.c (output_parser): Support new dynamic muscle input_line.
21230 2001-09-22 Marc Autret <autret_m@epita.fr>
21232 * src/output.c (output_master_parser): New.
21233 (output_parser): Be more re-entrant.
21235 2001-09-21 Marc Autret <autret_m@epita.fr>
21237 * src/reader.c (copy_definition, parse_union_decl): Update and use
21239 (copy_action): Likewise.
21240 Use obstack_1grow ().
21241 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
21243 2001-09-21 Marc Autret <autret_m@epita.fr>
21245 * src/options.c (option_table): Adjust.
21246 * src/lex.c (parse_percent_token): Fix.
21248 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
21250 * src/options.c (symtab.h): Include it, need by lex.h.
21252 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
21254 * src/lex.c (parse_percent_token): Change type of variable `tx', which
21255 is now an option_table_struct*.
21256 (option_strcmp): New function option_strcmp.
21257 (parse_percent_token): Call option_strcmp.
21258 * src/getargs.c (xalloc.h, options.h): Include it.
21259 (getargs): Call create_long_option_table.
21260 (getargs): Free longopts at the end of the function.
21261 (shortopts): Move in options.c.
21262 * src/options.c (create_long_option_table): New function. Convert
21263 information from option_table to option structure.
21264 * src/reader.c (options.h): Include it.
21266 * src/Makefile.am: Adjust.
21267 * src/options.c (option_table): Create from longopts and percent_table.
21268 * src/getargs.c (longopts): Delete.
21269 * src/lex.c (struct percent_table_struct): Delete.
21270 (percent_table): Delete.
21271 (options.h): Include it.
21272 * src/options.c: Create.
21273 * src/options.h: Create.
21274 Declare enum opt_access_e.
21275 Define struct option_table_struct.
21277 2001-09-20 Marc Autret <autret_m@epita.fr>
21279 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
21282 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
21284 * src/bison.simple: s/%%filename/%%skeleton.
21285 * src/muscle_tab.c (getargs.h): Include it.
21286 (muscle_init): Insert new muscle skeleton.
21288 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
21290 * src/output.c (output_parser): Delete unused variable actions_dumped.
21292 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
21294 * src/output.c (output): Delete call to reader_output_yylsp.
21295 * src/reader.c (reader): Likewise.
21296 * src/reader.h: Delete declaration of reader_output_yylsp.
21298 2001-09-02 Marc Autret <autret_m@epita.fr>
21300 * src/reader.c: Include muscle_tab.h.
21301 (parse_union_decl): Update.
21302 (parse_macro_decl): Rename parse_muscle_decl.
21303 Update to use renamed functions and variable.
21304 (read_declarations, copy_action, read_additionnal_code, : Updated
21305 with correct variables and functions names.
21306 (packsymbols, reader): Likewise.
21308 * src/reader.h (muscle_obstack): Extern declaration update.
21310 * src/output.c: Include muscle_tab.h
21311 In all functions using macro_insert, change by using muscle_insert ().
21312 (macro_obstack): Rename muscle_obstack.
21313 Echo modifications in the whole file.
21314 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
21315 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
21316 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
21318 * src/muscle_tab.h: Update double inclusion macros.
21319 (macro_entry_s): Rename muscle_entry_s.
21322 * src/muscle_tab.c: Include muscle_tab.h.
21323 Rename macro_tabble to muscle_table.
21324 (mhash1, mhash2, mcmp): Use muscle_entry.
21325 (macro_init): Rename muscle_init. Update.
21326 (macro_insert): Rename muscle_insert. Update.
21327 (macro_find): Rename muscle_find. Update.
21329 * src/main.c: Include muscle_tab.h.
21330 (main): Call muscle_init ().
21331 * src/Makefile.am (bison_SOURCES): Echo modifications.
21333 2001-09-02 Marc Autret <autret_m@epita.fr>
21335 Now the files macro_tab.[ch] are named muscle_tab.[ch].
21337 * src/muscle_tab.c, src/muscle_tab.h: Add files.
21339 2001-09-02 Marc Autret <autret_m@epita.fr>
21341 * src/macrotab.c, src/macrotab.h: Remove.
21343 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
21345 * src/reader.c (copy_guard): Use muscle to specify the `#line'
21348 2001-09-01 Marc Autret <autret_m@epita.fr>
21350 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
21351 to an explicit value to activate the feature. We do it here.
21353 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
21355 * src/output.c (prepare): Delete the `filename' muscule insertion.
21356 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
21357 (parse_union_decl): Likewise.
21358 * src/macrotab.c (macro_init): Initialize filename by infile.
21360 2001-08-31 Marc Autret <autret_m@epita.fr>
21362 * src/bison.simple (YYLSP_NEEDED): New definition.
21363 * src/output.c (prepare): Add macro insertion of `locations_flag'
21365 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
21367 * src/output.c (prepare): Delete insertion of previous muscles,
21368 and insert the `prefix' muscles.
21369 * src/macrotab.c (macro_init): Likewise.
21370 (macro_init): Initialization prefix directive by `yy'.
21371 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
21372 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
21373 yylval, yydebug, yyerror, yynerrs and yyparse.
21374 New directive `#define' to substitute yydebug, ... with option
21377 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
21379 * src/main.c (main): Standardize.
21380 * src/output.c (output_table_data, output_parser): Likewise.
21381 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
21383 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
21385 * src/reader.c (read_additionnal_code): Rename %%user_code to
21387 * src/output.c (output): Rename %%declarations to %%prologue.
21388 * src/bison.simple: Echo modifications.
21390 2001-08-31 Marc Autret <autret_m@epita.fr>
21392 * src/reader.c (readgram): CleanUp.
21393 (output_token_defines): Likewise.
21394 (packsymbols): Likewise.
21395 (reader): Likewise.
21396 * src/output.c (output): CPP-out useless code.
21398 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
21400 * src/reader.c (reader): Delete obsolete call to function
21401 output_trailers and output_headers.
21402 * src/output.h: Remove obsolete functions prototypes of output_headers
21403 and output_trailers.
21405 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
21407 * src/main.c: Include macrotab.h.
21408 * src/macrotab.h (macro_entry_s): Constify fields.
21409 Adjust functions prototypes.
21410 * src/macrotab.c (macro_insert): Constify key and value.
21411 (macro_find): Constify key.
21412 (macro_insert): Include 'xalloc.h'
21413 (macro_insert): Use XMALLOC.
21414 (macro_find): Constify return value.
21415 * src/output.c (output_table_data): Rename table to table_data.
21416 (output_parser): Constify macro_key, macro_value.
21418 2001-08-30 Marc Autret <autret_m@epita.fr>
21420 * src/reader.c (parse_skel_decl): New.
21421 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
21422 * src/lex.h (token_t): New token `tok_skel'.
21423 * src/lex.c (percent_table): Add skeleton option entry.
21426 2001-08-29 Marc Autret <autret_m@epita.fr>
21428 * src/bison.simple: Add %%user_code directive at the end.
21429 * src/reader.c (read_additionnal_code): New.
21431 * src/output.c (output_program): Remove.
21434 2001-08-28 Marc Autret <autret_m@epita.fr>
21436 * src/output.c (output_actions): Clean up.
21437 (output_gram): CPP-out useless code.
21438 * src/reader.c (reader): Clean up, CPP-out useless code.
21440 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
21442 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
21444 * src/bison.simple: Add `%%definitions'.
21446 2001-08-28 Marc Autret <autret_m@epita.fr>
21448 * config/depcomp: New file.
21450 2001-08-27 Paul Eggert <eggert@twinsun.com>
21452 * src/bison.simple (yyparse): Don't take the address of an
21453 item before the start of an array, as that doesn't conform to
21456 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
21458 * src/output.c (output): Remove the initialization of the macro
21459 obstack. It was done too late here.
21461 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
21463 (reader): Initialize the macro obstack here, since we need it to grow
21464 '%define' directives.
21466 * src/reader.h: Declare the macro obstack as extern.
21468 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
21470 * src/output.c (output_parser): Fix. Store single '%' characters in
21471 the output obstack instead of throwing them away.
21473 2001-08-27 Akim Demaille <akim@epita.fr>
21475 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
21477 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21479 * lib/Makefile.am: Adjust.
21481 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21483 * src/bison.simple: Update and add '%%' directives.
21485 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21487 * src/reader.c (reader): Remove calls to 'output_headers' and
21488 'output_trailers'. Remove some C output.
21489 (readgram): Disable a piece of code that was writing a default
21490 definition for 'YYSTYPE'.
21491 (reader_output_yylsp): Remove.
21492 (packsymbols): Output token defintions to a macro.
21493 (copy_definition): Disable C output.
21495 * src/reader.c (parse_macro_decl): New function used to parse macro
21497 (copy_string2): Put the body of copy_string into this new function.
21498 Add a parameter to let the caller choose whether he wants to copy the
21499 string delimiters or not.
21500 (copy_string): Be a simple call to copy_string2 with the last argument
21502 (read_declarations): Add case for macro definition.
21503 (copy_identifier): New.
21504 (parse_macro_decl): Read macro identifiers using copy_identifier
21507 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21509 * src/output.c (prepare): Add prefixed names.
21510 (output_parser): Output semantic actions.
21511 (output_parser): Fix bug on '%%line' directives.
21513 * src/output.c (output_headers): Remove. The C code printed by this
21514 function should now be in the skeletons.
21515 (output_trailers): Remove.
21516 (output): Disable call to 'reader_output_yylsp'.
21517 (output_rule_data): Do not output tables to the table obstack.
21519 * src/output.c: Remove some C dedicated output.
21520 Improve the use of macro and output obstacks.
21521 (output_defines): Remove.
21523 * src/output.c (output_token_translations): Associate 'translate'
21524 table with a macro. No output to the table obstack.
21525 (output_gram): Same for 'rhs' and 'prhs'.
21526 (output_stos): Same for 'stos'.
21527 (output_rule_data): Same for 'r1' and 'r2'.
21528 (token_actions): Same for 'defact'.
21529 (goto_actions): Same for 'defgoto'.
21530 (output_base): Same for 'pact' and 'pgoto'.
21531 (output_table): Same for 'table'.
21532 (output_check): Same for 'check'.
21534 * src/output.c (output_table_data): New function.
21535 (output_short_table): Remove.
21536 (output_short_or_char_table): Remove.
21538 * src/output.c (output_parser): Replace most of the skeleton copy code
21539 with something new. Skeletons are now processed character by character
21540 rather than line by line, and Bison looks for '%%' macros. This is the
21541 first step in making Bison's output process (a lot) more flexible.
21542 (output_parser): Use the macro table.
21544 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21546 * src/main.c (main): Initialize the macro table.
21548 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21550 * src/lex.c (percent_table): Add tok_define.
21551 * src/lex.h: Add tok_define.
21553 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21555 * src/macrotab.c: New file.
21556 * src/macrotab.h: New file.
21557 * src/Makefile.am: Update.
21559 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21561 * lib/hash.c: New file.
21562 * lib/hash.h: New file.
21563 * lib/Makefile.am: Update.
21565 2001-08-15 Akim Demaille <akim@epita.fr>
21569 2001-08-15 Marc Autret <autret_m@epita.fr>
21571 * src/reader.c (readgram): Indent output macro YYSTYPE.
21572 (packsymbols): Likewise.
21573 (output_token_defines): Likewise.
21574 * src/files.c: Standardize.
21575 (compute_header_macro): New.
21576 (defines_obstack_save): New. Use compute_header_macro.
21577 (output_files): Update. Use defines_obstack_save.
21579 2001-08-15 Akim Demaille <akim@epita.fr>
21581 * doc/bison.texinfo (Table of Symbols): Document
21582 YYSTACK_USE_ALLOCA.
21584 2001-08-15 Akim Demaille <akim@epita.fr>
21586 * missing: Update from CVS Automake.
21587 * config/config.guess, config/config.sub, config/texinfo.tex:
21588 Update from gnu.org.
21590 2001-08-15 Akim Demaille <akim@epita.fr>
21592 * Makefile.maint: Sync with CVS Autoconf.
21594 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
21596 * doc/bison.texinfo: Include GNU Free Documentation License from
21598 * doc/fdl.texi: Add to package.
21600 2001-08-14 Marc Autret <autret_m@epita.fr>
21602 Turn on %{source,header}_extension features.
21604 * src/lex.c (percent_table): Un-CPP out header_extension and
21606 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
21607 (compute_exts_from_src): Remove conditions. It restores priorities
21610 2001-08-14 Marc Autret <autret_m@epita.fr>
21612 * src/files.c (compute_base_names): Add extensions computing when
21613 `--file-prefix' used.
21614 Standardize function calls.
21616 2001-08-13 Marc Autret <autret_m@epita.fr>
21618 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
21619 defining it (defined but null disables alloca).
21621 2001-08-13 Marc Autret <autret_m@epita.fr>
21623 * src/bison.simple (_yy_memcpy): CPP reformat.
21625 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
21627 * tests/atconfig.in (CPPFLAGS): Fix.
21629 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
21631 * doc/bison.texinfo: Include GNU General Public License from
21633 * doc/gpl.texi: Add to package.
21635 2001-08-10 Marc Autret <autret_m@epita.fr>
21637 * src/print_graph.h: Fix.
21638 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
21640 2001-08-10 Akim Demaille <akim@epita.fr>
21642 * src/system.h: Provide default declarations for stpcpy, strndup,
21645 2001-08-10 Robert Anisko <anisko_r@epita.fr>
21647 * doc/bison.texinfo (Locations): Update @$ stuff.
21649 2001-08-09 Robert Anisko <anisko_r@epita.fr>
21651 * src/bison.simple (YYLLOC_DEFAULT): Update.
21654 2001-08-08 Marc Autret <autret_m@epita.fr>
21656 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
21657 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
21658 Reported by Fabrice Bauzac.
21660 2001-08-08 Marc Autret <autret_m@epita.fr>
21662 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
21663 * src/vcg.c (output_node): Fix.
21664 * src/vcg.h: Cleanup.
21665 * src/print_graph.c: Add comments.
21666 (node_output_size): New global variable. Simplify the formatting of
21667 the VCG graph output.
21668 (print_actions): Unused code is now used. It notifies the final state
21669 and no action states in the VCG graph. It also give the reduce actions.
21670 The `shift and goto' edges are red and the `go to state' edges are
21672 Get the current node name and node_obstack by argument.
21673 (node_obstack): New variable.
21674 (print_state): Manage node_obstack.
21675 (print_core): Use node_obstack given by argument.
21676 A node is not only computed here but in print_actions also.
21677 (print_graph): CPP out useless code instead of commenting it.
21679 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
21681 * tests/atconfig.in (CPPFLAGS): Fix.
21683 2001-08-07 Akim Demaille <akim@epita.fr>
21685 * src/print_graph.c (quote): New.
21686 (print_core): Use it.
21688 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
21690 * src/vcg.c (complain.h): Include it.
21691 Unepitaize `return' invocations.
21692 [NDEBUG] (main): Remove.
21693 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
21694 * src/files.c (open_files): Initialize graph_obstack.
21695 * src/print_graph.c (print_actions): CPP out useless code.
21696 (print_core): Don't output the last `\n' in labels.
21698 * src/files.c (output_files): Output the VCG file.
21699 * src/main.c (main): Invoke print_graph ();
21701 2001-08-06 Marc Autret <autret_m@epita.fr>
21703 Automaton VCG graph output.
21704 Using option ``-g'' or long option ``--graph'', you can generate
21705 a gram_filename.vcg file containing a VCG description of the LALR (1)
21706 automaton of your grammar.
21708 * src/main.c: Call to print_graph() function.
21709 * src/getargs.h: Update.
21710 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
21711 (graph_flag): New flag.
21712 (longopts): Update.
21713 (getargs): Add case `g'.
21714 * src/files.c (graph_obstack): New obstack struct.
21715 (open_files): Initialize new obstack.
21716 (output_files): Saves graph_obstack if required.
21717 * src/files.h (graph_obstack): New extern declaration.
21718 * src/Makefile.am: Add new source files.
21720 2001-08-06 Marc Autret <autret_m@epita.fr>
21722 * src/print_graph.c, src/print_graph.h (graph): New.
21723 * src/vcg.h: New file.
21724 * src/vcg.c: New file, VCG graph handling.
21726 2001-08-06 Marc Autret <autret_m@epita.fr>
21728 Add of %source_extension and %header_extension which specify
21729 the source or/and the header output file extension.
21731 * src/files.c (compute_base_names): Remove initialisation of
21732 src_extension and header_extension.
21733 (compute_exts_from_gf): Update.
21734 (compute_exts_from_src): Update.
21735 (output_files): Update.
21736 * src/reader.c (parse_header_extension_decl): New.
21737 (parse_source_extension_decl): New.
21738 (read_declarations): New case statements for the new tokens.
21739 * src/lex.c (percent_table): Add entries for %source_extension
21740 and %header_extension.
21741 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
21743 2001-08-06 Marc Autret <autret_m@epita.fr>
21745 * configure.in: Bump to 1.28c.
21746 * doc/bison.texinfo: Texinfo thingies.
21748 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
21750 * tests/atconfig.in (CPPFLAGS): Add.
21751 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
21753 2001-08-03 Akim Demaille <akim@epita.fr>
21757 2001-08-03 Akim Demaille <akim@epita.fr>
21759 * tests/Makefile.am (check-local): Ship testsuite.
21760 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
21761 Include `string.h'.
21763 2001-08-03 Akim Demaille <akim@epita.fr>
21765 * configure.in: Try using -Wformat when compiling.
21767 2001-08-03 Akim Demaille <akim@epita.fr>
21769 * configure.in: Bump to 1.28b.
21771 2001-08-03 Akim Demaille <akim@epita.fr>
21773 * src/complain.c: Adjust strerror_r portability issues.
21775 2001-08-03 Akim Demaille <akim@epita.fr>
21779 2001-08-03 Akim Demaille <akim@epita.fr>
21781 * src/getargs.c, src/getarg.h (skeleton)): Constify.
21782 * src/lex.c (literalchar): Avoid name clashes on `buf'.
21783 * src/getargs.c: Include complain.h.
21784 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
21785 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
21787 2001-08-03 Akim Demaille <akim@epita.fr>
21789 * src/reader.c (readgram): Display hidden chars in error messages.
21791 2001-08-03 Akim Demaille <akim@epita.fr>
21793 Update to gettext 0.10.39.
21795 2001-08-03 Akim Demaille <akim@epita.fr>
21797 * lib/strspn.c: New.
21799 2001-08-01 Marc Autret <autret_m@epita.fr>
21801 * doc/bison.texinfo: Update.
21802 * doc/bison.1 (mandoc): Update.
21803 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
21804 * src/files.c: Support output files extensions computing.
21805 (src_extension): New static variable.
21806 (header_extension): New static variable.
21807 (tr): New function.
21808 (get_extension_index): New function, gets the index of an extension
21809 filename in a string.
21810 (compute_exts_from_gf): New function, computes extensions from the
21811 grammar file extension.
21812 (compute_exts_from_src): New functions, computes extensions from the
21813 C source file extension, file given by ``-o'' option.
21814 (compute_base_names): Update.
21815 (output_files): Update.
21817 2001-08-01 Robert Anisko <anisko_r@epita.fr>
21819 * doc/bison.texi: Document @$.
21820 (Locations): New section.
21822 2001-07-18 Akim Demaille <akim@epita.fr>
21824 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
21825 * config/prev-version.txt, config/move-if-change: New.
21826 * Makefile.am: Adjust.
21828 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
21830 * src/bison.simple (yyparse): Suppress warning `comparaison
21831 between signed and unsigned'.
21833 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
21835 * src/getargs.h (raw_flag): Remove.
21836 * src/getargs.c: Die on `-r'/`--raw'.
21837 * src/lex.c (parse_percent_token): Die on `%raw'.
21838 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
21839 * tests/calc.at: Suppress test with option `--raw'.
21841 2001-07-14 Akim Demaille <akim@epita.fr>
21844 * configure.in: Require Autoconf 2.50.
21845 Update to gettext 0.10.38.
21847 2001-03-16 Akim Demaille <akim@epita.fr>
21849 * doc/bison.texinfo: ANSIfy the examples.
21851 2001-03-16 Akim Demaille <akim@epita.fr>
21853 * getargs.c (skeleton): New variable.
21854 (longopts): --skeleton is a new option.
21855 (shortopts, getargs): -S is a new option.
21856 * getargs.h: Declare skeleton.
21857 * output.c (output_parser): Use it.
21859 2001-03-16 Akim Demaille <akim@epita.fr>
21861 * m4/strerror_r.m4: New.
21862 * m4/error.m4: Run AC_FUNC_STRERROR_R.
21863 * lib/error.h, lib/error.c: Update.
21865 2001-03-16 Akim Demaille <akim@epita.fr>
21867 * src/getargs.c (longopts): Clean up.
21869 2001-02-21 Akim Demaille <akim@epita.fr>
21871 * src/reader.c (gensym): `gensym_count' is your own.
21872 Use a static buf to create the symbol name, as token_buffer is no
21875 2001-02-08 Akim Demaille <akim@epita.fr>
21877 * src/conflicts.c (conflict_report): Be sure not to append to res
21878 between two calls, which could happen if both first sprintf were
21879 skipped, but not the first cp += strlen.
21881 2001-02-08 Akim Demaille <akim@epita.fr>
21883 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
21884 New, from fileutils 4.0.37.
21885 * configure.in: Require Autoconf 2.49c. I took some time before
21886 making this decision. This is the only way out for portability
21887 issues in Bison, it would mean way too much duplicate effort to
21888 import in Bison features implemented in 2.49c since 2.13.
21889 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
21891 2001-02-02 Akim Demaille <akim@epita.fr>
21893 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
21894 * lib/xalloc.h, lib/xmalloc.c: Update.
21896 2001-01-19 Akim Demaille <akim@epita.fr>
21898 Get rid of the ad hoc handling of token_buffer in the scanner: use
21901 * src/lex.c (token_obstack): New.
21902 (init_lex): Initialize it. No longer call...
21903 (grow_token_buffer): this. Remove it.
21904 Adjust all the places which used it to use the obstack.
21906 2001-01-19 Akim Demaille <akim@epita.fr>
21908 * src/lex.h: Rename all the tokens:
21909 s/\bENDFILE\b/tok_eof/g;
21910 s/\bIDENTIFIER\b/tok_identifier/g;
21912 Let them be enums, not #define, to ease debugging.
21913 Adjust all the code.
21915 2001-01-18 Akim Demaille <akim@epita.fr>
21917 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
21918 * src/lex.c (maxtoken, grow_token_buffer): Static.
21920 2001-01-18 Akim Demaille <akim@epita.fr>
21922 Since we now use obstacks, more % directives can be enabled.
21924 * src/lex.c (percent_table): Also accept `%yacc',
21925 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
21927 Handle the actions for `%semantic_parser' and `%pure_parser' here,
21928 instead of returning a token.
21929 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
21930 * src/reader.c (read_declarations): Adjust.
21931 * src/files.c (open_files): Don't call `compute_base_names', don't
21932 compute `attrsfile' since they depend upon data which might be
21933 *in* the input file now.
21934 (output_files): Do it here.
21935 * src/output.c (output_headers): Document the fact that this patch
21936 introduces a guaranteed SEGV for semantic parsers.
21937 * doc/bison.texinfo: Document them.
21938 * tests/suite.at: Exercise these %options.
21940 2000-12-20 Akim Demaille <akim@epita.fr>
21942 Also handle the output file (--verbose) with obstacks.
21944 * files.c (foutput): Remove.
21945 (output_obstack): New.
21946 Adjust all dependencies.
21947 * src/conflicts.c: Return a string.
21948 * src/system.h (obstack_grow_string): Rename as...
21949 (obstack_sgrow): this. Be ready to work with non literals.
21950 (obstack_fgrow4): New.
21952 2000-12-20 Akim Demaille <akim@epita.fr>
21954 * src/files.c (open_files): Fix the computation of short_base_name
21955 in the case of `-o foo.tab.c'.
21957 2000-12-20 Akim Demaille <akim@epita.fr>
21959 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
21960 (copy_dollar): Now that everything uses obstacks, get rid of the
21963 2000-12-20 Akim Demaille <akim@epita.fr>
21965 * src/files.c (open_files): Actually the `.output' file is based
21966 on the short_base_name, not base_name.
21967 * tests/suite.at (Checking output file names): Adjust.
21969 2000-12-20 Akim Demaille <akim@epita.fr>
21971 * src/bison.s1: Remove, we now use directly...
21972 * src/bison.simple: this.
21973 * src/Makefile.am: Use pkgdata instead of data.
21975 2000-12-20 Akim Demaille <akim@epita.fr>
21977 * src/files.c (guard_obstack): New.
21978 (open_files): Initialize it.
21979 (output_files): Dump it...
21980 * src/files.h: Export it.
21981 * src/reader.c (copy_guard): Use it.
21983 2000-12-19 Akim Demaille <akim@epita.fr>
21985 * src/files.c (outfile, defsfile, actfile): Removed as global
21987 (open_files): Don't compute them.
21988 (output_files): Adjust.
21989 (base_name, short_base_name): Be global.
21990 Adjust dependencies.
21992 2000-12-19 Akim Demaille <akim@epita.fr>
21994 * src/files.c (strsuffix): New.
21995 (stringappend): Be just like strcat but allocate.
21996 (base_names): Eve out from open_files.
21997 Try to simplify the rather hairy computation of base_name and
21999 (open_files): Use it.
22000 * tests/suite.at (Checking output file names): New test.
22002 2000-12-19 Akim Demaille <akim@epita.fr>
22004 * src/system.h (obstack_grow_literal_string): Rename as...
22005 (obstack_grow_string): this.
22006 * src/output.c (output_parser): Recognize `%% actions' instead of
22008 * src/bison.s1: s/$/%% actions/.
22009 * src/bison.hairy: Likewise.
22011 2000-12-19 Akim Demaille <akim@epita.fr>
22013 * src/output.c (output_parser): Compute the `#line' lines when
22015 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
22016 Suggested by Hans Aberg.
22018 2000-12-19 Akim Demaille <akim@epita.fr>
22020 Let the handling of the skeleton files be local to the procedures
22023 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
22025 (fparser, open_extra_files): Remove.
22026 (open_files, output_files): Don't take care of fparser.
22027 * src/files.h: Adjust.
22028 * src/output.c (output_parser): Open and close the file to the
22030 * src/reader.c (read_declarations): When %semantic_parser, open
22033 2000-12-19 Akim Demaille <akim@epita.fr>
22035 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
22036 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
22038 2000-12-19 Akim Demaille <akim@epita.fr>
22040 * src/files.c (open_files): Yipee! We no longer need all the code
22041 looking for `/tmp' since we have no tmp file.
22043 2000-12-19 Akim Demaille <akim@epita.fr>
22045 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
22047 * src/files.c (open_files): Less dependency on MSDOS etc.
22049 2000-12-14 Akim Demaille <akim@epita.fr>
22051 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
22052 Provide a default definition.
22053 Use it when executing the default @ action.
22054 * src/reader.c (reader_output_yylsp): No longer include
22055 `timestamp' and `text' in the default YYLTYPE.
22057 2000-12-12 Akim Demaille <akim@epita.fr>
22059 * src/reader.c (copy_definition, parse_union_decl, copy_action)
22060 (copy_guard): Quote the file names.
22061 Reported by Laurent Mascherpa.
22063 2000-12-12 Akim Demaille <akim@epita.fr>
22065 * src/output.c (output_headers, output_program, output): Be sure
22066 to escape special characters when outputting filenames.
22067 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
22068 (output_headers): Don't depend on them, Use ACTSTR.
22070 2000-11-17 Akim Demaille <akim@epita.fr>
22072 * lib/obstack.h: Formatting changes.
22073 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
22074 prevents type checking.
22075 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
22076 cast the value to (void *): assigning a `foo *' to a `void *'
22078 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
22079 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
22082 2000-11-17 Akim Demaille <akim@epita.fr>
22084 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
22086 (suite.m4, regression.m4, calc.m4): these.
22087 * tests/atgeneral.m4: Update from CVS Autoconf.
22089 2000-11-17 Akim Demaille <akim@epita.fr>
22091 * tests/regression.m4 (%union and --defines): New test,
22092 demonstrating a current bug in the obstack implementation.
22094 2000-11-17 Akim Demaille <akim@epita.fr>
22096 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
22098 Use them to declare the variables which are global or local to
22101 2000-11-17 Akim Demaille <akim@epita.fr>
22103 * acconfig.h: Remove, no longer used.
22105 2000-11-07 Akim Demaille <akim@epita.fr>
22107 * src: s/Copyright (C)/Copyright/g.
22109 2000-11-07 Akim Demaille <akim@epita.fr>
22111 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
22113 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
22115 2000-11-07 Akim Demaille <akim@epita.fr>
22117 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
22118 Merge in a single CPP if/else.
22120 2000-11-07 Akim Demaille <akim@epita.fr>
22122 * src/output.c (output): Remove useless variables.
22123 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
22124 argument `data' for consistency with the prototypes.
22125 Qualify it `const'.
22126 (obstack_copy, obstack_copy0): Rename the second argument as
22127 `address' for consistency. Qualify it `const'.
22128 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
22129 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
22130 `const' their input argument (`data' or `address').
22131 Adjust the corresponding macros to include `const' in casts.
22133 2000-11-03 Akim Demaille <akim@epita.fr>
22135 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
22136 s/PFILE1/BISON_HAIRY/.
22137 Adjust dependencies.
22139 2000-11-03 Akim Demaille <akim@epita.fr>
22141 For some reason, this was not applied.
22143 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
22144 `unlink': it's no longer used.
22146 2000-11-03 Akim Demaille <akim@epita.fr>
22148 * src/files.c (skeleton_find): New function, eved out of...
22149 (open_files, open_extra_files): here.
22151 2000-11-03 Akim Demaille <akim@epita.fr>
22153 Don't use `atexit'.
22155 * src/files.c (obstack_save): New function.
22156 (done): Rename as...
22157 (output_files): this.
22158 Use `obstack_save'.
22159 * src/main.c (main): Don't use `atexit' to register `done', since
22160 it no longer has to remove tmp files, just call `output_files'
22161 when there are no errors.
22163 2000-11-02 Akim Demaille <akim@epita.fr>
22165 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
22166 `unlink': it's no longer used.
22167 * src/files.h: Formatting changes.
22169 2000-11-02 Akim Demaille <akim@epita.fr>
22171 Remove the last uses of mktemp and unlink/delete.
22173 * src/files.c (fdefines, ftable): Removed.
22174 (defines_ostack, table_obstack): New.
22175 Adjust dependencies of the former into uses of the latter.
22176 * src/output.c (output_short_or_char_table, output_short_table):
22177 Convert to using obstacks.
22178 * src/reader.c (copy_comment2): Accept one FILE * and two
22180 (output_token_defines, reader_output_yylsp): Use obstacks.
22181 * src/system.h (obstack_fgrow3): New.
22182 * po/POTFILES.in: Adjust.
22184 2000-11-01 Akim Demaille <akim@epita.fr>
22186 Change each use of `fattrs' into a use of `attrs_obstack'.
22188 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
22189 * src/files.c (fattrs): Remove.
22190 (attrs_obstack): New.
22191 Adjust all dependencies.
22192 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
22194 2000-11-01 Akim Demaille <akim@epita.fr>
22196 Introduce obstacks.
22197 Change each use of `faction' into a use of `action_obstack'.
22199 * lib/obstack.h, lib/obstack.c: New files.
22200 * src/files.c (faction): Remove.
22201 (action_obstack): New.
22202 Adjust all dependencies.
22204 2000-10-20 Akim Demaille <akim@epita.fr>
22206 * lib/quote.h (PARAMS): New macro. Use it.
22208 2000-10-16 Akim Demaille <akim@epita.fr>
22210 * src/output.c (output_short_or_char_table): New function.
22211 (output_short_table, output_token_translations): Use it.
22212 (goto_actions): Use output_short_table.
22214 2000-10-16 Akim Demaille <akim@epita.fr>
22216 * src/symtab.c (bucket_new): New function.
22219 * src/output.c (output_short_table): New argument to display the
22220 comment associated with the table.
22221 Adjust dependencies.
22222 (output_gram): Use it.
22223 (output_rule_data): Nicer output layout for YYTNAME.
22225 2000-10-16 Akim Demaille <akim@epita.fr>
22227 * src/lex.c (read_typename): New function.
22229 * src/reader.c (copy_dollar): Likewise.
22231 2000-10-16 Akim Demaille <akim@epita.fr>
22233 * src/reader.c (copy_comment2): Expect the input stream to be on
22234 the `/' which is suspected to open a comment, instead of being
22235 called after `//' or `/*' was read.
22236 (copy_comment, copy_definition, parse_union_decl, copy_action)
22237 (copy_guard): Adjust.
22239 2000-10-16 Akim Demaille <akim@epita.fr>
22241 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
22242 `read_signed_integer'.
22244 2000-10-16 Akim Demaille <akim@epita.fr>
22246 * src/reader.c (copy_dollar): New function.
22247 (copy_guard, copy_action): Use it.
22249 2000-10-16 Akim Demaille <akim@epita.fr>
22251 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
22252 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
22253 New files, from Fileutils 4.0.27.
22254 * src/main.c (printable_version): Remove.
22255 * src/lex.c, src/reader.c: Use `quote'.
22257 2000-10-04 Akim Demaille <akim@epita.fr>
22259 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
22261 2000-10-04 Akim Demaille <akim@epita.fr>
22263 * doc/bison.texinfo: Various typos spotted by Neil Booth.
22265 2000-10-04 Akim Demaille <akim@epita.fr>
22267 When a literal string is used to define two different tokens,
22268 `bison -v' segfaults.
22269 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
22271 * tests/regression.m4: New file.
22272 Include the core of the sample provided by Piotr Gackiewicz.
22273 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
22276 2000-10-04 Akim Demaille <akim@epita.fr>
22278 * src/reader.c (parse_expect_decl): Keep `count' within the size
22282 2000-10-02 Paul Eggert <eggert@twinsun.com>
22284 * bison.s1 (yyparse): Assign the default value
22285 unconditionally, to avoid a GCC warning and make the parser a
22288 2000-10-02 Akim Demaille <akim@epita.fr>
22290 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
22293 2000-10-02 Akim Demaille <akim@epita.fr>
22295 * src/derives.c, src/print.c, src/reduce.c: To ease the
22296 translation, move some `\n' out of the translated strings.
22298 2000-10-02 Akim Demaille <akim@epita.fr>
22300 The location tracking mechanism is precious for parse error
22301 messages. Nevertheless, it is enabled only when `@n' is used in
22302 the grammar, which is a different issue (you can use it in error
22303 message, but not in the grammar per se). Therefore, there should
22304 be another means to enable it.
22306 * src/getargs.c (getargs): Support `--locations'.
22307 (usage): Report it.
22308 * src/getargs.h (locationsflag): Export it.
22309 * src/lex.c (percent_table): Support `%locations'.
22310 * src/reader.c (yylsp_needed): Remove this variable, now replaced
22311 with `locationsflag'.
22312 * doc/bison.texinfo: Document `--locations' and `%locations'.
22314 * tests/calc.m4: Test it.
22316 For regularity of the names, replace each
22317 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
22318 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
22319 In addition replace each `flag' with `_flag'.
22321 2000-10-02 Akim Demaille <akim@epita.fr>
22323 Also test parse error messages, including with YYERROR_VERBOSE.
22325 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
22327 Use it to check the computations.
22328 Use it to check `nonassoc' is honored.
22329 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
22330 `--yyerror-verbose'.
22331 (_AT_CHECK_CALC): Adjust to this option.
22332 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
22334 2000-10-02 Akim Demaille <akim@epita.fr>
22336 Test also `--verbose', `--defines' and `--name-prefix'. Testing
22337 the latter demonstrates a flaw in the handling of non debugging
22338 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
22339 was used in order to simplify:
22355 unfortunately this leads to a CPP conflict when
22356 `--name-prefix=foo' is used since it produces `#define yydebug
22359 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
22360 (YYDPRINTF): New macro.
22362 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
22364 Also test `--verbose', `--defines' and `--name-prefix'.
22366 2000-10-02 Akim Demaille <akim@epita.fr>
22368 Improve the readability of the produced parsers.
22370 * src/bison.s1: Formatting changes.
22371 Improve the comment related to the `$' mark.
22372 (yydefault): Don't fall through to `yyresume': `goto' there.
22373 * src/output.c (output_parser): When the `$' is met, skip the end
22375 New variable, `number_of_dollar_signs', to check there's exactly
22376 one `$' in the parser skeleton.
22378 2000-10-02 Akim Demaille <akim@epita.fr>
22380 * lib/xstrdup.c: New file, from the fileutils.
22381 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
22382 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
22383 instead of strlen + xmalloc + strcpy.
22384 * src/symtab.c (copys): Remove, use xstrdup instead.
22386 2000-10-02 Akim Demaille <akim@epita.fr>
22388 * src/gram.h (associativity): New enum type which replaces the
22389 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
22390 `right_assoc', `left_assoc' and `non_assoc'.
22391 Adjust all dependencies.
22392 * src/reader.c: Formatting changes.
22393 (LTYPESTR): Don't define it, use it as a literal in
22394 `reader_output_yylsp'.
22395 * src/symtab.h (symbol_class): New enum type which replaces the
22396 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
22397 `sunknown', `stoken and `snterm'.
22399 2000-10-02 Akim Demaille <akim@epita.fr>
22401 * src/getargs.c (fixed_outfiles): Rename as...
22402 (yaccflag): for consistency and accuracy.
22403 Adjust dependencies.
22405 2000-10-02 Akim Demaille <akim@epita.fr>
22407 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
22408 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
22409 difficult and introduced a lot of core dump. It turns out that
22410 Bison used an implementation of `xmalloc' based on `calloc', and
22411 at various places it does depend upon the initialization to 0. I
22412 have not tried to isolate the pertinent places, and all the former
22413 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
22414 someone should address this issue.
22416 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
22417 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
22419 Adjust dependencies.
22420 * src/warshall.h: New file.
22423 2000-10-02 Akim Demaille <akim@epita.fr>
22425 Various anti-`extern in *.c' changes.
22427 * src/system.h: Include `assert.h'.
22429 2000-10-02 Akim Demaille <akim@epita.fr>
22431 * src/state.h (nstates, final_state, first_state, first_shift)
22432 (first_reduction): Move their exportation from here...
22433 * src/LR0.h: to here.
22434 Adjust dependencies.
22435 * src/getargs.c (statisticsflag): New variable.
22436 Add support for `--statistics'.
22437 Adjust dependencies.
22439 Remove a lot of now useless `extern' statements in most files.
22441 2000-10-02 Akim Demaille <akim@epita.fr>
22443 * src/LR0.h: New file.
22446 2000-10-02 Akim Demaille <akim@epita.fr>
22448 * src/print.h: New file.
22450 * src/print.c: Formatting and ordering changes.
22451 (verbose, terse): Replace with...
22452 (print_results): this new function.
22453 Adjust dependencies.
22455 2000-10-02 Akim Demaille <akim@epita.fr>
22457 * src/conflicts.c (conflict_report): New function.
22458 (conflict_log, verbose_conflict_log): Replace with...
22459 (print_conflicts): this function.
22460 Adjust dependencies.
22461 * src/conflicts.h: New file.
22462 Propagate its inclusion.
22464 2000-10-02 Akim Demaille <akim@epita.fr>
22466 * src/nullable.h: New file.
22467 Propagate its inclusion.
22468 * src/nullable.c: Formatting changes.
22470 2000-10-02 Akim Demaille <akim@epita.fr>
22472 * src/reduce.h: New file.
22473 Propagate its inclusion.
22474 * src/reduce.c: Topological sort and other formatting changes.
22475 (bool, TRUE, FALSE): Move their definition to...
22476 * src/system.h: here.
22478 2000-10-02 Akim Demaille <akim@epita.fr>
22480 * src/files.c: Formatting changes.
22481 (tryopen, tryclose, openfiles): Rename as...
22482 (xfopen, xfclose, open_files): this.
22483 (stringappend): static.
22484 * src/files.h: Complete the list of exported symbols.
22487 2000-10-02 Akim Demaille <akim@epita.fr>
22489 * src/reader.h: New file.
22490 Propagate its use instead of tedious list of `extern' and
22492 * src/reader.c: Formatting changes, topological sort,
22495 2000-10-02 Akim Demaille <akim@epita.fr>
22497 * src/lex.h: Prototype `lex.c' exported functions.
22498 * src/reader.c: Adjust.
22499 * src/lex.c: Formatting changes.
22500 (safegetc): Rename as...
22503 2000-10-02 Akim Demaille <akim@epita.fr>
22505 * src/lalr.h: New file.
22506 Propagate its inclusion instead of prototypes and `extern'.
22507 * src/lalr.c: Formatting changes, topological sorting etc.
22509 2000-10-02 Akim Demaille <akim@epita.fr>
22511 * src/output.c (token_actions): Introduce a temporary array,
22512 YYDEFACT, that makes it possible for this function to use
22513 output_short_table.
22515 2000-10-02 Akim Demaille <akim@epita.fr>
22517 `user_toknums' is output as a `short[]' in `output.c', while it is
22518 defined as a `int[]' in `reader.c'. For consistency with the
22519 other output tables, `user_toknums' is now defined as a table of
22522 * src/reader.c (user_toknums): Be a short table instead of an int
22524 Adjust dependencies.
22526 Factor the short table outputs.
22528 * src/output.c (output_short_table): New function.
22529 * src/output.c (output_gram, output_stos, output_rule_data)
22530 (output_base, output_table, output_check): Use it.
22532 2000-10-02 Akim Demaille <akim@epita.fr>
22534 * src/output.c (output): Topological sort of the functions, in
22535 order to get rid of the `static' prototypes.
22536 No longer use `register'.
22537 * src/output.h: New file.
22538 Propagate its inclusion in files explicitly prototyping functions
22541 2000-09-21 Akim Demaille <akim@epita.fr>
22543 * src/atgeneral.m4: Update from Autoconf.
22545 2000-09-21 Akim Demaille <akim@epita.fr>
22547 * src/closure.h: New file.
22548 * src/closure.c: Formatting changes, topological sort over the
22549 functions, use of closure.h.
22550 (initialize_closure, finalize_closure): Rename as...
22551 (new_closure, free_closure): these. Adjust dependencies.
22552 * src/LR0.c: Formatting changes, topological sort, use of
22554 (initialize_states): Rename as...
22555 (new_states): this.
22556 * src/Makefile.am (noinst_HEADERS): Adjust.
22558 2000-09-20 Akim Demaille <akim@epita.fr>
22560 * src/acconfig.h: Don't protect config.h against multiple
22562 Don't define PARAMS.
22563 * src/system.h: Define PARAMS.
22564 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
22565 purpose of config.h. system.h must not try to fix wrong
22566 definitions in config.h.
22568 2000-09-20 Akim Demaille <akim@epita.fr>
22570 * src/derives.h: New file.
22571 * src/main.c, src/derives.h: Use it.
22572 Formatting changes.
22573 * src/Makefile.am (noinst_HEADERS): Adjust.
22575 2000-09-20 Akim Demaille <akim@epita.fr>
22577 * tests/atgeneral.m4: Update from Autoconf.
22578 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
22579 (AT_CHECK_CALC): New macros.
22580 Use these macros to test bison with options `', `--raw',
22581 `--debug', `--yacc', `--yacc --debug'.
22583 2000-09-19 Akim Demaille <akim@epita.fr>
22585 * src/output.c: Formatting changes.
22586 * src/machine.h: Remove, leaving its contents in...
22587 * src/system.h: here.
22589 Adjust all dependencies on stdio.h and machine.h.
22590 * src/getargs.h: New file.
22591 Let all `extern' declarations about getargs.c be replaced with
22592 inclusion of `getargs.h'.
22593 * src/Makefile.am (noinst_HEADERS): Adjust.
22595 * tests/calc.m4 (yyin): Be initialized in main, not on the global
22597 (yyerror): Returns void, not int.
22598 * doc/bison.texinfo: Formatting changes.
22600 2000-09-19 Akim Demaille <akim@epita.fr>
22602 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
22605 2000-09-18 Akim Demaille <akim@epita.fr>
22607 * configure.in: Append WARNING_CFLAGS to CFLAGS.
22608 * src/Makefile.am (INCLUDES): Don't.
22609 Be ready to fetch headers in lib/.
22611 2000-09-18 Akim Demaille <akim@epita.fr>
22613 * doc/bison.texinfo: Update the copyright.
22614 ANSIfy and GNUify the examples.
22615 Remove the old menu.
22617 2000-09-18 Akim Demaille <akim@epita.fr>
22619 First set of tests: use the `calc' example from the documentation.
22621 * src/bison.s1 (yyparse): Condition the code using `yytname' which
22622 is defined only when YYDEBUG is.
22623 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
22624 * src/files.c (tryopen, tryclose): Formatting changes.
22625 Move to the top and be static.
22626 * src/reader.c (read_signed_integer): Likewise.
22627 * tests/calc.m4: New file.
22628 * Makefile.am, suite.m4: Adjust.
22629 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
22631 2000-09-18 Akim Demaille <akim@epita.fr>
22633 Add support for an Autotest test suite for Bison.
22635 * m4/m4.m4, m4/atconfig.m4: New files.
22636 * m4/Makefile.am (EXTRA_DIST): Adjust.
22637 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
22639 * src/getargs.c: Display a more standard --version message.
22640 * src/reader.c (reader): Formatting changes.
22641 No longer depend upon VERSION_STRING.
22642 * configure.in: No longer use `dnl'.
22643 Set up the test suite and the new directory `tests/.
22644 (VERSION_STRING): Remove.
22646 2000-04-14 Akim Demaille <akim@epita.fr>
22648 * src/reader.c (copy_comment2): New function, same as former
22649 `copy_comment', but outputs into two FILE *.
22650 (copy_comment): Use it.
22651 (parse_union_decl): Use it.
22652 (get_type, parse_start_decl): Use the same `invalid' message.
22653 (parse_start_decl, parse_union_decl): Use the same `multiple'
22655 (parse_union_decl, copy_guard, copy_action): Use the same
22656 `unmatched' message.
22657 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
22659 2000-03-31 Akim Demaille <akim@epita.fr>
22661 * src/files.c (tryopen, tryclose): Move to the top.
22664 2000-03-31 Akim Demaille <akim@epita.fr>
22666 * src/main.c (main): Don't call `done', exit does it.
22668 2000-03-31 Akim Demaille <akim@epita.fr>
22670 * allocate.c: s/return (foo)/return foo/.
22671 * lalr.c: Likewise.
22673 * output.c: Likewise.
22674 * reader.c: Likewise.
22675 * symtab.c: Likewise.
22676 * vmsgetargs.c: Likewise.
22678 2000-03-31 Akim Demaille <akim@epita.fr>
22680 Clean up the error reporting functions.
22682 * src/report.c: New file.
22683 * src/report.h: Likewise.
22684 * src/Makefile.am: Adjust.
22685 * m4/error.m4: New file.
22686 * m4/Makefile.am: Adjust.
22687 * configure.in (jm_PREREQ_ERROR): Call it.
22688 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
22690 (fatal, fatals): Remove. All callers use complain.c::fatal.
22691 (warn, warni, warns, warnss, warnss): Remove. All callers use
22692 complain.c::complain.
22693 (toomany): Remove, use fatal instead.
22694 * src/files.c (done): No argument, use complain_message_count.
22695 * src/main.c (main): Register `done' to `atexit'.
22697 * src/getargs.c (usage): More `fputs', less `fprintf'.
22699 2000-03-28 Akim Demaille <akim@epita.fr>
22701 * lib/: New directory.
22702 * Makefile.am (SUBDIRS): Adjust.
22703 * configure.in: Adjust.
22704 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
22706 * src/alloca.c: Moved to lib/.
22707 * src/getopt.c: Likewise.
22708 * src/getopt1.c: Likewise.
22709 * src/getopt.h: Likewise.
22710 * src/ansi2knr.c: Likewise.
22711 * src/ansi2knr.1: Likewise.
22712 * src/Makefile.am: Adjust.
22713 * lib/Makefile.am: New file.
22715 2000-03-28 Akim Demaille <akim@epita.fr>
22717 * src/getargs.c (usage): Refresh the help message.
22719 2000-03-17 Akim Demaille <akim@epita.fr>
22721 * src/getopt1.c: Updated from textutils 2.0e
22722 * src/getopt.c: Likewise.
22723 * src/getopt.h: Likewise.
22725 2000-03-17 Akim Demaille <akim@epita.fr>
22727 * src/Makefile.am (bison.simple): Fix the awk program: quote only
22728 the file name, not the whole `#line LINE FILE'.
22730 2000-03-17 Akim Demaille <akim@epita.fr>
22732 On syntax errors, report the token on which we choked.
22734 * src/bison.s1 (yyparse): In the label yyerrlab, when
22735 YYERROR_VERBOSE, add yychar in msg.
22737 2000-03-17 Akim Demaille <akim@epita.fr>
22739 * src/reader.c (copy_at): New function.
22740 (copy_guard): Use it.
22741 (copy_action): Use it.
22743 2000-03-17 Akim Demaille <akim@epita.fr>
22745 Be kind to translators, save some useless translations.
22747 * src/main.c (banner): New function.
22748 (fatal_banner): Use it.
22749 (warn_banner): Use it.
22751 2000-03-17 Akim Demaille <akim@epita.fr>
22753 * src/reader.c (copy_definition): Use copy_string and
22754 copy_comment. Removed now unused `match', `ended',
22756 (copy_comment, copy_string): Moved, to be visible from
22759 2000-03-17 Akim Demaille <akim@epita.fr>
22761 * src/reader.c (copy_string): Declare `static inline'. No
22762 problems with inline, since it is checked by configure.
22763 (copy_comment): Likewise.
22765 2000-03-17 Akim Demaille <akim@epita.fr>
22767 * src/reader.c (packsymbols): Formatting changes.
22769 2000-03-17 Akim Demaille <akim@epita.fr>
22771 * src/reader.c (copy_comment): New function, factored out from:
22772 (copy_action): Use it. Removed now unused `match', `ended',
22774 (copy_guard): Likewise.
22776 2000-03-17 Akim Demaille <akim@epita.fr>
22778 * src/reader.c (copy_string): New function, factored out from:
22779 (copy_action): Use it.
22780 (copy_guard): Likewise.
22782 2000-03-17 Akim Demaille <akim@epita.fr>
22784 Change the handling of @s so that they behave exactly like $s.
22785 There is now a pseudo variable @$ (readble and writable), location
22786 of the lhs of the rule (by default ranging from the location of
22787 the first symbol of the rhs, to the location of the last symbol,
22788 or, if the rhs is empty, YYLLOC).
22790 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
22792 (yyparse): When providing a default semantic action, provide a
22793 default location action.
22794 (after the $): No longer change `*YYLSP', just stack YYLOC the
22795 same way you stack YYVAL.
22796 * src/reader.c (read_declarations): Use warns.
22797 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
22798 (copy_action, case '@'): Likewise.
22799 Use a standard error message, to save useless work from
22802 2000-03-17 Akim Demaille <akim@epita.fr>
22804 * src/bison.s1: Formatting and cosmetics changes.
22805 * src/reader.c: Likewise.
22806 Update the Copyright notice.
22808 2000-03-17 Akim Demaille <akim@epita.fr>
22810 * src/bison.s1 (#line): All set to `#line' only, since the
22811 Makefile now handles them.
22813 2000-03-16 Akim Demaille <akim@epita.fr>
22815 * src/output.c (output_rule_data): Output the documentation of
22816 some of the tables.
22817 (Copyright notice): Update.
22818 Formatting changes.
22820 2000-03-16 Akim Demaille <akim@epita.fr>
22822 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
22823 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
22824 One `#if YYDEBUG' remains, since it uses variables which are
22825 defined only if `YYDEBUG != 0'.
22827 2000-03-16 Akim Demaille <akim@epita.fr>
22829 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
22830 and related variables so that the similarities are highlighted.
22832 2000-03-16 Akim Demaille <akim@epita.fr>
22834 * src/bison.s1: Properly indent CPP directives.
22836 2000-03-16 Akim Demaille <akim@epita.fr>
22838 * src/bison.s1: Properly indent the `alloca' CPP section.
22840 2000-03-16 Akim Demaille <akim@epita.fr>
22842 Do not hard code values of directories in `configure.in'.
22843 Update the `configure' tool chain.
22845 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
22847 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
22848 (AC_OUTPUT): Add m4/Makefile.
22849 Bump to bison 1.28a, 1.29 has never been released.
22850 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
22851 handled via src/Makefile.am.
22852 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
22853 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
22855 * Makefile.am (SUBDIRS): Add m4.
22856 (ACLOCAL_AM_FLAGS): New variable.
22857 (AUTOMAKE_OPTIONS): Add check-news.
22858 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
22859 the proper line number and file name.
22860 (DEFS): Propagate the location of bison library files and of the
22862 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
22864 * acinclude.m4: Remove, replaced by the directory m4.
22865 * m4/Makefile.am (EXTRA_DIST): New variable.
22866 * m4/gettext.m4: New file, from the fileutils.
22867 * m4/lcmessage.m4: Likewise
22868 * m4/progtest.m4: Likewise.
22869 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
22871 2000-03-10 Akim Demaille <akim@epita.fr>
22874 Formatting changes of various comments.
22875 Respect the GNU coding standards at various places.
22876 Don't use `_()' when no translation is needed.
22878 1999-12-13 Jesse Thilo <jthilo@gnu.org>
22881 OS/2 honors TMPDIR environment variable.
22883 1999-12-13 Jesse Thilo <jthilo@gnu.org>
22885 * doc/bison.texinfo: Tweaked spelling and grammar.
22887 Removed reference to price of printed copy.
22888 Mention BISON_SIMPLE and BISON_HAIRY.
22890 1999-12-13 Jesse Thilo <jthilo@gnu.org>
22892 * configure.in, NEWS:
22893 Bison 1.29 released.
22895 1999-10-27 Jesse Thilo <jthilo@gnu.org>
22897 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
22898 Added reference card.
22900 1999-07-26 Jesse Thilo <jthilo@gnu.org>
22902 * po/ru.po: Added Russian translation.
22904 1999-07-26 Jesse Thilo <jthilo@gnu.org>
22906 * configure.in: Added Russian translation.
22908 1999-07-06 Jesse Thilo <jthilo@gnu.org>
22910 * configure.in, NEWS, README:
22911 Released version 1.28.
22913 1999-06-14 Jesse Thilo <jthilo@gnu.org>
22916 Squashed redefinition warning on some systems.
22918 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
22919 Have configure build version string instead of relying on ANSI string
22922 1999-06-14 Jesse Thilo <jthilo@gnu.org>
22924 * po/POTFILES.in: Got rid of version.c.
22926 1999-06-14 Jesse Thilo <jthilo@gnu.org>
22928 * acconfig.h, configure.in:
22929 Have configure build version string instead of relying on ANSI string
22932 1999-06-08 Jesse Thilo <jthilo@gnu.org>
22935 Dropped mention of `+' for long-named options.
22937 1999-05-30 Jesse Thilo <jthilo@gnu.org>
22939 * src/files.c: Added <unistd.h> for unlink().
22941 * src/Makefile.am, src/system.h:
22944 1999-05-30 Jesse Thilo <jthilo@gnu.org>
22946 * README: Added a FAQ list.
22948 * configure.in, acconfig.h:
22951 1999-05-30 Jesse Thilo <jthilo@gnu.org>
22953 * doc/FAQ, doc/Makefile.am:
22956 1999-05-19 Jesse Thilo <jthilo@gnu.org>
22958 * src/alloc.h, src/symtab.h, src/version.c:
22959 Protected inclusion of "config.h" with HAVE_CONFIG_H.
22961 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22963 * src/.cvsignore, src/Makefile.am:
22964 Reorganized: sources in `src', documentation in `doc'.
22966 * src/lex.c (literalchar):
22967 fixed the code for escaping double quotes (thanks
22970 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22972 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
22973 Adjusted paths to reflect directory reorganization.
22975 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22977 * doc/.cvsignore, doc/Makefile.am:
22978 Reorganized: sources in `src', documentation in `doc'.
22980 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22983 Updated AC_INIT file to reflect directory reorganization.
22985 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
22986 Reorganized: sources in `src', documentation in `doc'.
22988 1999-04-13 Jesse Thilo <jthilo@gnu.org>
22991 Don't declare calloc() and realloc() if not necessary.
22993 1999-04-13 Jesse Thilo <jthilo@gnu.org>
22995 * configure.in, acconfig.h, acinclude.m4:
22996 Don't declare calloc() and realloc() if not necessary.
22998 1999-03-23 Jesse Thilo <jthilo@gnu.org>
23000 * po/.cvsignore: Added i18n support.
23002 1999-03-23 Jesse Thilo <jthilo@gnu.org>
23004 * acconfig.h, configure.in, Makefile.am:
23005 Added i18n support.
23007 1999-03-22 Jesse Thilo <jthilo@gnu.org>
23009 * src/bison.s1: Fixed #line numbers.
23011 1999-03-15 Jesse Thilo <jthilo@gnu.org>
23013 * po/es.po, po/fr.po, po/nl.po, po/de.po:
23014 Added PO files from Translation Project.
23016 1999-03-03 Jesse Thilo <jthilo@gnu.org>
23019 Added support for non-ANSI compilers (ansi2knr).
23021 1999-02-16 Jesse Thilo <jthilo@gnu.org>
23023 * configure.in: Bumped version number to 1.27.
23026 Added `bison.simple' to list of files removed by `make distclean'.
23028 1999-02-12 Jesse Thilo <jthilo@gnu.org>
23030 * src/files.c, src/files.h:
23031 Defined locations of parser files in config.h instead of Makefile.
23033 1999-02-12 Jesse Thilo <jthilo@gnu.org>
23035 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
23036 Defined locations of parser files in config.h instead of Makefile.
23038 1999-02-09 Jesse Thilo <jthilo@gnu.org>
23041 Removed inappropriate use of $< macro.
23043 1999-02-05 Jesse Thilo <jthilo@gnu.org>
23045 * po/Makefile.in.in, po/POTFILES.in:
23046 Add `po' directory skeleton.
23048 1999-01-27 Jesse Thilo <jthilo@gnu.org>
23050 * README: Document help-bison list.
23052 * configure.in: Add check for mkstemp().
23054 1999-01-20 Jesse Thilo <jthilo@gnu.org>
23056 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
23057 Hush a few compiler warnings.
23060 Add tryclose(), which verifies that fclose was successful.
23061 Hush a couple of compiler warnings.
23063 1999-01-20 Jesse Thilo <jthilo@gnu.org>
23065 * Makefile.am, OChangeLog:
23066 ChangeLog is now automatically generated. Include the old version as
23069 1999-01-14 Jesse Thilo <jthilo@gnu.org>
23071 * 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:
23072 Update FSF address.
23074 1999-01-14 Jesse Thilo <jthilo@gnu.org>
23076 * doc/bison.texinfo: Fix formatting glitch.
23078 * doc/bison.texinfo: Update FSF address.
23080 1999-01-14 Jesse Thilo <jthilo@gnu.org>
23082 * acconfig.h: Update FSF address.
23084 1999-01-08 Jesse Thilo <jthilo@gnu.org>
23087 Don't define PACKAGE here, since config.h defines it.
23089 1998-12-30 Jesse Thilo <jthilo@gnu.org>
23091 * src/reader.c: Update copyright date.
23094 Ditch sprintf to statically-sized buffers in fatal/warn functions in
23095 favor of output directly to stderr (avoids buffer overruns).
23097 * src/reader.c: Some checks for premature EOF.
23099 * 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:
23100 Use prototypes if the compiler understands them.
23102 * src/files.c: Honor TMPDIR on Unix hosts.
23103 Use prototypes if the compiler understands them.
23106 Fix a couple of buffer overrun bugs.
23107 Use prototypes if the compiler understands them.
23109 * src/system.h: Include unistd.h and ctype.h.
23110 Use #ifdef instead of #if for NLS symbols.
23112 1998-12-30 Jesse Thilo <jthilo@gnu.org>
23114 * doc/bison.texinfo:
23115 Delete comment "consider using @set for edition number, etc..." since
23116 we now are doing so.
23118 1998-12-30 Jesse Thilo <jthilo@gnu.org>
23121 Use prototypes if the compiler understands them.
23123 * NEWS: Document 1.26 highlights.
23125 * Makefile.am: Require Automake 1.3 or later.
23128 Use prototypes if the compiler understands them.
23130 1998-12-29 Jesse Thilo <jthilo@gnu.org>
23133 Use VERSION symbol from automake for version number.
23135 1998-12-29 Jesse Thilo <jthilo@gnu.org>
23137 * acconfig.h, configure.in, version.cin:
23138 Use VERSION symbol from automake for version number.
23140 1998-11-28 Jesse Thilo <jthilo@gnu.org>
23143 Distribute original version of simple parser (bison.s1), not built
23144 version (bison.simple).
23146 1998-11-28 Jesse Thilo <jthilo@gnu.org>
23148 * doc/bison.texinfo: Add info dir entry.
23150 * doc/bison.texinfo:
23151 Let automake put version number into documentation.
23153 1998-11-26 Jesse Thilo <jthilo@gnu.org>
23155 * src/bison.cld, src/build.com, src/vmshlp.mar:
23156 Add non-RCS files from /gd/gnu/bison.
23158 1998-11-26 Jesse Thilo <jthilo@gnu.org>
23161 Document the BISON_HAIRY and BISON_SIMPLE variables.
23163 1998-11-25 Jesse Thilo <jthilo@gnu.org>
23165 * src/version.c: Build version.c automatically.
23168 Fix token numbering (used to start at 258, not 257).
23170 * src/system.h: Include config.h.
23172 * src/getargs.c: Update bug report address.
23174 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
23175 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
23177 1998-11-25 Jesse Thilo <jthilo@gnu.org>
23180 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23182 * configure.in, version.cin:
23183 Build version.c automatically.
23185 * AUTHORS: Add AUTHORS file.
23187 * README: Update bug report address.
23190 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23192 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
23193 Add automake stuff.
23195 1998-11-25 Jesse Thilo <jthilo@gnu.org>
23197 * doc/bison.texinfo: Clean up some formatting.
23199 1998-05-05 Richard Stallman <rms@gnu.org>
23201 * doc/bison.texinfo:
23202 Explain better why to make a pure parser.
23204 1998-01-05 Richard Stallman <rms@gnu.org>
23206 * src/files.c (openfiles):
23207 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
23208 find a temporary directory, if possible. Do not unlink files while
23211 1997-08-25 Richard Stallman <rms@gnu.org>
23213 * src/reader.c (stack_offset;):
23214 Change some warni to warns.
23216 * src/lex.c (literalchar): Use warns, not warni.
23218 1997-06-28 Richard Stallman <rms@gnu.org>
23220 * src/bison.s1: Add a Bison version comment.
23222 * src/main.c (fatal, warn, berror):
23225 1997-06-28 Richard Stallman <rms@gnu.org>
23227 * Makefile.in (bison_version): New variable.
23228 (dist): Use that variable.
23229 (bison.s1): Substitute the Bison version into bison.simple.
23231 * bison.simple: Add a Bison version comment.
23233 1997-06-18 Richard Stallman <rms@gnu.org>
23235 * src/main.c (fatal, warn, berror):
23236 Make error messages standard.
23237 (toomany): Improve error message text.
23239 * 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:
23240 new.h renamed to alloc.h.
23242 1997-06-18 Richard Stallman <rms@gnu.org>
23244 * Makefile.in: new.h renamed to alloc.h.
23246 1997-05-24 Richard Stallman <rms@gnu.org>
23248 * src/lex.c (literalchar):
23249 Fix the code for escaping \, " and '.
23251 (lex): Avoid trouble when there are many chars
23252 to discard in a char literal with just several chars in it.
23254 1997-05-17 Richard Stallman <rms@gnu.org>
23257 Use malloc, if using alloca is troublesome.
23258 (YYSTACK_USE_ALLOCA): New flag macro.
23259 Define it for some systems and compilers.
23260 (YYSTACK_ALLOC): New macro.
23261 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23262 If it was malloc'd, free it.
23264 1997-05-17 Richard Stallman <rms@gnu.org>
23267 Use malloc, if using alloca is troublesome.
23268 (YYSTACK_USE_ALLOCA): New flag macro.
23269 Define it for some systems and compilers.
23270 (YYSTACK_ALLOC): New macro.
23271 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23272 If it was malloc'd, free it.
23274 1997-04-23 Richard Stallman <rms@gnu.org>
23277 (alloca) [__hpux]: Always define as __builtin_alloca.
23279 1997-04-23 Richard Stallman <rms@gnu.org>
23282 (alloca) [__hpux]: Always define as __builtin_alloca.
23284 1997-04-22 Richard Stallman <rms@gnu.org>
23287 [__hpux]: Include alloca.h (right for HPUX 10)
23288 instead of declaring alloca (right for HPUX 9).
23290 * src/bison.s1 (__yy_memcpy):
23291 Declare arg `count' as unsigned int.
23292 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23294 1997-04-22 Richard Stallman <rms@gnu.org>
23297 [__hpux]: Include alloca.h (right for HPUX 10)
23298 instead of declaring alloca (right for HPUX 9).
23300 * bison.simple (__yy_memcpy):
23301 Declare arg `count' as unsigned int.
23302 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23304 1997-01-03 Richard Stallman <rms@gnu.org>
23306 * src/allocate.c: [__STDC__ or _MSC_VER]:
23307 Declare calloc and realloc to return void *.
23309 1997-01-02 Richard Stallman <rms@gnu.org>
23312 [_MSC_VER]: Include stdlib.h and process.h.
23313 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
23315 * src/main.c (main): Return FAILURE as a value.
23316 (printable_version): Declare arg as int, not char.
23318 1997-01-02 Richard Stallman <rms@gnu.org>
23320 * Makefile.in (dist):
23321 Explicitly check for symlinks, and copy them.
23323 1996-12-19 Richard Stallman <rms@gnu.org>
23326 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
23328 1996-12-18 Paul Eggert <eggert@gnu.org>
23330 * src/bison.s1 (yyparse):
23331 If __GNUC__ and YYPARSE_PARAM are both defined,
23332 declare yyparse to have a void * argument.
23334 1996-12-18 Paul Eggert <eggert@gnu.org>
23336 * bison.simple (yyparse):
23337 If __GNUC__ and YYPARSE_PARAM are both defined,
23338 declare yyparse to have a void * argument.
23340 1996-12-17 Richard Stallman <rms@gnu.org>
23342 * src/reduce.c (nbits): Add some casts.
23344 1996-08-12 Richard Stallman <rms@gnu.org>
23346 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
23348 1996-08-12 Richard Stallman <rms@gnu.org>
23350 * bison.simple: Test _MSDOS as well as _MSDOS_.
23352 1996-07-31 Richard Stallman <rms@gnu.org>
23355 [__sun && __i386]: Include alloca.h.
23357 1996-07-31 Richard Stallman <rms@gnu.org>
23360 [__sun && __i386]: Include alloca.h.
23362 1996-07-30 Richard Stallman <rms@gnu.org>
23364 * src/bison.s1: Comment change.
23366 * src/bison.s1: Test _MSDOS_, not MSDOS.
23368 1996-07-30 Richard Stallman <rms@gnu.org>
23370 * bison.simple: Comment change.
23372 * bison.simple: Test _MSDOS_, not MSDOS.
23374 1996-06-01 Richard Stallman <rms@gnu.org>
23376 * 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:
23377 Insert `_' macro around many string constants.
23380 Insert `_' macro around many string constants.
23382 (main): Call setlocale, bindtextdomain and textdomain.
23384 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
23385 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
23386 [ENABLE_NLS]: Include libintl.h.
23387 [ENABLE_NLS] (gettext): Define.
23388 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
23389 (N_, PACKAGE, LOCALEDIR): New macros.
23391 1996-06-01 Richard Stallman <rms@gnu.org>
23393 * POTFILES.in: New file.
23395 * Makefile.in (allocate.o):
23396 Define target explicitly.
23398 * Makefile.in (CFLAGS): Set to @CFLAGS@.
23399 (LDFLAGS): Set to @LDFLAGS@.
23400 (configure): Run autoconf only if preceding `cd' succeeds.
23401 (bison.s1): Redirect output to temporary file then move the
23402 temporary to the target, rather than redirecting directly to bison.s1.
23403 (clean): Remove config.status and config.log.
23404 (distclean): Don't remove config.status here.
23406 1996-05-12 Richard Stallman <rms@gnu.org>
23409 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
23411 1996-05-12 Richard Stallman <rms@gnu.org>
23414 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
23416 1996-05-11 Richard Stallman <rms@gnu.org>
23418 * src/bison.s1 (__yy_memcpy):
23419 Really reorder the args, as was supposedly done on Feb 14 1995.
23420 (yyparse): Calls changed accordingly.
23422 1996-05-11 Richard Stallman <rms@gnu.org>
23424 * Makefile.in (dist): Don't use $(srcdir).
23426 * bison.simple (__yy_memcpy):
23427 Really reorder the args, as was supposedly done on Feb 14 1995.
23428 (yyparse): Calls changed accordingly.
23430 1996-01-27 Richard Stallman <rms@gnu.org>
23432 * src/output.c (output_rule_data):
23433 Test YYERROR_VERBOSE in the conditional
23434 around the definition of ttyname.
23436 1995-12-29 Richard Stallman <rms@gnu.org>
23439 Fix line numbers in #line commands.
23441 1995-12-29 Richard Stallman <rms@gnu.org>
23444 Fix line numbers in #line commands.
23446 1995-12-27 Richard Stallman <rms@gnu.org>
23448 * src/bison.s1 (YYPARSE_PARAM_DECL):
23449 In C++, make it always null.
23450 (YYPARSE_PARAM_ARG): New macro.
23451 (yyparse): Use YYPARSE_PARAM_ARG.
23453 1995-12-27 Richard Stallman <rms@gnu.org>
23455 * bison.simple (YYPARSE_PARAM_DECL):
23456 In C++, make it always null.
23457 (YYPARSE_PARAM_ARG): New macro.
23458 (yyparse): Use YYPARSE_PARAM_ARG.
23460 1995-11-29 Richard Stallman <rms@gnu.org>
23462 * doc/bison.texinfo:
23463 Describe literal string tokens, %raw, %no_lines, %token_table.
23465 1995-11-29 Daniel Hagerty <hag@gnu.org>
23467 * doc/bison.texinfo: Fixed update date
23469 1995-10-16 Richard Stallman <rms@gnu.org>
23471 * src/version.c: Version 1.25.
23473 1995-10-16 Richard Stallman <rms@gnu.org>
23475 * NEWS: *** empty log message ***
23477 1995-10-16 Richard Stallman <rms@gnu.org>
23479 * doc/bison.1, doc/bison.rnh:
23482 1995-10-15 Richard Stallman <rms@gnu.org>
23484 * src/vmsgetargs.c, src/getargs.c:
23485 Added -n, -k, and -raw switches.
23486 (noparserflag, toknumflag, rawtoknumflag): New variables.
23488 * src/symtab.h (SALIAS):
23489 New #define for adding aliases to %token.
23490 (struct bucket): Added `alias' field.
23492 * src/reduce.c (reduce_grammar):
23493 Revise error message.
23494 (print_notices): Remove final `.' from error message.
23496 * src/reader.c (reader_output_yylsp):
23498 (readgram): Use `#if 0' around code that accepted %command
23499 inside grammar rules: The documentation doesn't allow it,
23500 and it will fail since the %command processors scan for the next %.
23501 (parse_token_decl): Extended the %token
23502 declaration to allow a multi-character symbol as an alias.
23503 (parse_thong_decl): New function.
23504 (read_declarations): Added %thong declarations.
23505 (read_declarations): Handle NOOP to deal with allowing
23506 % declarations as another means to specify the flags.
23507 (readgram): Allow %prec prior to semantics embedded in a rule.
23508 (skip_to_char, read_declarations, copy_definition)
23509 (parse_token_decl, parse_start_decl, parse_type_decl)
23510 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
23511 (get_type_name, copy_guard, copy_action, readgram)
23512 (get_type, packsymbols): Revised most error messages.
23513 Changed `fatal' to `warnxxx' to avoid aborting for error.
23514 Revised and use multiple warnxxx functions to avoid using VARARGS1.
23515 (read_declarations): Improve the error message for
23516 an invalid character. Do not abort.
23517 (read_declarations, copy_guard, copy_action): Use
23518 printable_version to avoid unprintable characters in printed output.
23519 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
23520 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
23521 Allow the type of a non-terminal can be given
23522 more than once, as long as all specifications give the same type.
23525 (output_headers, output_trailers, output, output_gram)
23526 (output_rule_data): Implement noparserflag variable.
23527 Implement toknumflag variable.
23528 (output): Call reader_output_yylsp to output LTYPESTR.
23530 * src/main.c (main):
23531 If reader sees an error, don't process the grammar.
23532 (fatals): Updated to not use VARARGS1.
23533 (printable_version, int_to_string, warn, warni, warns, warnss)
23534 (warnsss): New error reporting functions. Avoid abort for error.
23537 Added THONG and NOOP for alias processing.
23538 Added SETOPT for the new code that allows setting options with %flags.
23541 Include getopt.h. Add some extern decls.
23542 (safegetc): New function to deal with EOF gracefully.
23543 (literalchar); new function to deal with reading \ escapes.
23544 (lex): Use literalchar.
23545 (lex): Implemented "..." tokens.
23546 (literalchar, lex, parse_percent_token): Made tokenbuffer
23547 always contain the token. This includes growing the token
23548 buffer while reading an integer.
23549 (parse_percent_token): Replaced if-else statement with percent_table.
23550 (parse_percent_token): Added % declarations as another
23551 way to specify the flags -n, -l, and -r. Also added hooks for
23552 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
23553 major changes to files.c.
23554 (lex) Retain in the incoming stream a character following
23556 (skip_white_space, lex): Revised most error messages
23557 and changed fatal to warn to avoid aborting.
23558 (percent_table): Added %thong declarations.
23560 * src/gram.h: Comment changes.
23562 * src/files.c (openfiles, open_extra_files, done):
23564 and actfile file. Handle noparserflag. Both for -n switch.
23566 * src/conflicts.c (resolve_sr_conflict):
23567 Remove use of alloca.
23569 1995-06-01 Jim Meyering <meyering@gnu.org>
23571 * doc/bison.texinfo: *** empty log message ***
23573 1995-05-06 Richard Stallman <rms@gnu.org>
23575 * src/bison.s1: Comment change.
23577 1995-05-06 Richard Stallman <rms@gnu.org>
23579 * bison.simple: Comment change.
23581 1995-05-03 Richard Stallman <rms@gnu.org>
23583 * src/version.c: Version now 1.24.
23585 * src/bison.s1: Change distribution terms.
23587 * src/version.c: Version now 1.23.
23589 1995-05-03 Richard Stallman <rms@gnu.org>
23591 * doc/bison.texinfo:
23592 Rewrite "Conditions for Using Bison".
23593 Update version to 1.24.
23595 1995-05-03 Richard Stallman <rms@gnu.org>
23597 * bison.simple: Change distribution terms.
23599 1995-02-23 Richard Stallman <rms@gnu.org>
23601 * src/files.c: Test __VMS_POSIX as well as VMS.
23603 1995-02-14 Jim Meyering <meyering@gnu.org>
23605 * src/bison.s1 (__yy_memcpy):
23606 Renamed from __yy_bcopy to avoid
23607 confusion. Reverse FROM and TO arguments to be consistent with
23610 1995-02-14 Jim Meyering <meyering@gnu.org>
23612 * bison.simple (__yy_memcpy):
23613 Renamed from __yy_bcopy to avoid
23614 confusion. Reverse FROM and TO arguments to be consistent with
23617 1994-11-10 David J. MacKenzie <djm@gnu.org>
23623 * Makefile.in (DISTFILES): Include NEWS.
23625 * Makefile.in (DISTFILES):
23626 Include install-sh, not install.sh.
23628 * configure.in: Update to Autoconf v2 macro names.
23630 1994-10-05 David J. MacKenzie <djm@gnu.org>
23632 * Makefile.in: fix typo
23634 * Makefile.in (prefix, exec_prefix):
23635 Let configure set them.
23637 1994-09-28 David J. MacKenzie <djm@gnu.org>
23639 * Makefile.in: Set datadir to $(prefix)/share.
23641 1994-09-15 Richard Stallman <rms@gnu.org>
23644 Update copyright notice and GPL version.
23646 1994-09-15 Richard Stallman <rms@gnu.org>
23649 Update copyright notice and GPL version.
23651 1994-07-12 Richard Stallman <rms@gnu.org>
23653 * src/reduce.c, src/reader.c:
23656 1994-05-05 David J. MacKenzie <djm@gnu.org>
23658 * Makefile.in: entered into RCS
23660 1994-03-26 Richard Stallman <rms@gnu.org>
23662 * src/bison.s1: entered into RCS
23664 1994-03-26 Richard Stallman <rms@gnu.org>
23666 * bison.simple: entered into RCS
23668 1994-03-25 Richard Stallman <rms@gnu.org>
23670 * src/main.c: entered into RCS
23672 1994-03-24 Richard Stallman <rms@gnu.org>
23674 * src/conflicts.c: entered into RCS
23676 1994-01-02 Richard Stallman <rms@gnu.org>
23678 * Makefile.in: *** empty log message ***
23680 1993-11-21 Richard Stallman <rms@gnu.org>
23682 * src/bison.s1: *** empty log message ***
23684 1993-11-21 Richard Stallman <rms@gnu.org>
23686 * doc/bison.texinfo: entered into RCS
23688 * doc/bison.texinfo: *** empty log message ***
23690 1993-11-21 Richard Stallman <rms@gnu.org>
23692 * bison.simple: *** empty log message ***
23694 1993-10-25 David J. MacKenzie <djm@gnu.org>
23696 * doc/bison.texinfo: *** empty log message ***
23698 1993-10-19 Richard Stallman <rms@gnu.org>
23700 * src/bison.s1: *** empty log message ***
23702 1993-10-19 Richard Stallman <rms@gnu.org>
23704 * bison.simple: *** empty log message ***
23706 1993-10-14 Richard Stallman <rms@gnu.org>
23708 * src/bison.s1: *** empty log message ***
23710 1993-10-14 Richard Stallman <rms@gnu.org>
23712 * bison.simple: *** empty log message ***
23714 1993-09-14 David J. MacKenzie <djm@gnu.org>
23716 * doc/bison.texinfo: *** empty log message ***
23718 1993-09-13 Noah Friedman <friedman@gnu.org>
23720 * Makefile.in: *** empty log message ***
23722 1993-09-10 Richard Stallman <rms@gnu.org>
23724 * src/conflicts.c: *** empty log message ***
23726 * src/system.h: entered into RCS
23728 1993-09-10 Richard Stallman <rms@gnu.org>
23730 * doc/bison.1: entered into RCS
23732 1993-09-06 Noah Friedman <friedman@gnu.org>
23734 * src/version.c: entered into RCS
23736 1993-09-06 Noah Friedman <friedman@gnu.org>
23738 * Makefile.in: *** empty log message ***
23740 1993-07-30 David J. MacKenzie <djm@gnu.org>
23742 * Makefile.in: *** empty log message ***
23744 1993-07-24 Richard Stallman <rms@gnu.org>
23746 * src/bison.s1: *** empty log message ***
23748 1993-07-24 Richard Stallman <rms@gnu.org>
23750 * bison.simple: *** empty log message ***
23752 1993-07-08 David J. MacKenzie <djm@gnu.org>
23754 * Makefile.in: *** empty log message ***
23756 1993-07-04 Richard Stallman <rms@gnu.org>
23758 * src/bison.s1: *** empty log message ***
23760 1993-07-04 Richard Stallman <rms@gnu.org>
23762 * bison.simple: *** empty log message ***
23764 1993-06-26 David J. MacKenzie <djm@gnu.org>
23766 * src/getargs.c: entered into RCS
23768 1993-06-26 David J. MacKenzie <djm@gnu.org>
23770 * doc/bison.texinfo: *** empty log message ***
23772 * doc/bison.1: New file.
23774 1993-06-25 Richard Stallman <rms@gnu.org>
23776 * src/getargs.c: New file.
23778 1993-06-16 Richard Stallman <rms@gnu.org>
23780 * src/bison.s1: *** empty log message ***
23782 1993-06-16 Richard Stallman <rms@gnu.org>
23784 * bison.simple: *** empty log message ***
23786 1993-06-03 Richard Stallman <rms@gnu.org>
23788 * src/bison.s1: New file.
23790 1993-06-03 Richard Stallman <rms@gnu.org>
23792 * doc/bison.texinfo: *** empty log message ***
23794 1993-06-03 Richard Stallman <rms@gnu.org>
23796 * bison.simple: New file.
23798 1993-05-19 Richard Stallman <rms@gnu.org>
23800 * doc/bison.texinfo: New file.
23802 1993-05-07 Noah Friedman <friedman@gnu.org>
23804 * Makefile.in: *** empty log message ***
23806 1993-04-28 Noah Friedman <friedman@gnu.org>
23808 * src/reader.c: *** empty log message ***
23810 1993-04-23 Noah Friedman <friedman@gnu.org>
23812 * src/alloc.h: entered into RCS
23814 1993-04-20 David J. MacKenzie <djm@gnu.org>
23816 * src/version.c: *** empty log message ***
23818 * src/files.c, src/allocate.c:
23821 * src/reader.c: *** empty log message ***
23823 * src/lex.c: entered into RCS
23825 * src/conflicts.c: New file.
23827 * src/symtab.c: entered into RCS
23829 * src/alloc.h: New file.
23831 * src/LR0.c: entered into RCS
23833 1993-04-18 Noah Friedman <friedman@gnu.org>
23835 * src/reader.c: New file.
23837 * src/version.c: *** empty log message ***
23839 1993-04-18 Noah Friedman <friedman@gnu.org>
23841 * Makefile.in: *** empty log message ***
23843 1993-04-17 Noah Friedman <friedman@gnu.org>
23845 * Makefile.in: *** empty log message ***
23847 1993-04-15 Richard Stallman <rms@gnu.org>
23849 * src/main.c, src/files.c:
23852 1993-04-15 Noah Friedman <friedman@gnu.org>
23854 * configure.in: entered into RCS
23856 * configure.in: *** empty log message ***
23858 * configure.in: New file.
23860 1993-04-14 Richard Stallman <rms@gnu.org>
23862 * Makefile.in: New file.
23864 1993-04-13 Richard Stallman <rms@gnu.org>
23866 * src/version.c: New file.
23868 1993-03-25 Richard Stallman <rms@gnu.org>
23870 * src/output.c: entered into RCS
23872 1992-09-25 Richard Stallman <rms@gnu.org>
23874 * configure.bat: entered into RCS
23876 1992-06-22 Richard Stallman <rms@gnu.org>
23878 * src/vmsgetargs.c: entered into RCS
23880 1992-06-22 Richard Stallman <rms@gnu.org>
23882 * doc/bison.rnh: entered into RCS
23884 1992-04-20 David J. MacKenzie <djm@gnu.org>
23886 * README: entered into RCS
23888 1992-01-22 Richard Stallman <rms@gnu.org>
23890 * src/machine.h: entered into RCS
23892 1991-12-21 Richard Stallman <rms@gnu.org>
23894 * src/lalr.c, src/closure.c:
23897 1991-12-20 Richard Stallman <rms@gnu.org>
23899 * src/state.h: entered into RCS
23901 1991-12-18 Richard Stallman <rms@gnu.org>
23903 * src/print.c, src/nullable.c, src/derives.c:
23906 1991-11-03 David J. MacKenzie <djm@gnu.org>
23908 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
23911 1988-09-09 Richard Stallman <rms@gnu.org>
23913 * src/bison.hairy: entered into RCS
23915 1987-12-16 Richard Stallman <rms@gnu.org>
23917 * REFERENCES: entered into RCS
23922 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
23923 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
23924 2008, 2009 Free Software Foundation, Inc.
23926 Copying and distribution of this file, with or without
23927 modification, are permitted provided the copyright notice and this
23928 notice are preserved.