]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
Revert unnecessary column realignment in --help output.
[bison.git] / ChangeLog
... / ...
CommitLineData
12009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 Revert unnecessary column realignment in --help output.
4 Reported by Akim Demaille at
5 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
6 * src/getargs.c (usage): Here.
7
82009-07-04 Alex Rozenman <rozenman@gmail.com>
9
10 Alphabetical order in src/Makefile.am.
11 * src/Makefile.am: Adjust.
12
132009-07-04 Alex Rozenman <rozenman@gmail.com>
14
15 Style changes and factoring.
16 * src/named-ref.h: Add comments.
17 * src/parse-gram.y: Readability and style changes.
18 * src/reader.c: Factoring: assign_named_ref function.
19 * src/scan-code.l: Factoring and style changes. Rename
20 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
21 Use "unsigned" type for variant index. Improve readablity.
22 * src/scan-gram.l: Change error messages and add comments.
23 * src/symlist.h: symbol_list_null: New function decl.
24 * src/symlist.c: symbol_list_null: Implement here.
25 * tests/named-refs.at: Adjust for new error messages.
26
272009-06-29 Eric Blake <ebb9@byu.net>
28
29 scan-code: avoid compiler warnings
30 * src/scan-code.l (parse_named_ref): Use correct specifiers.
31
322009-06-29 Akim Demaille <demaille@gostai.com>
33
34 build: avoid concurrent extraction of calc++.
35 * examples/calc++/Makefile.am (calc.stamp): New.
36 Depend on it to create the sources of calc++ so that concurrent
37 builds don't launch several "extexi" in parallel.
38 Not only this is inefficient, this also builds incorrect sources
39 with several extractions mixed together.
40
412009-06-27 Alex Rozenman <rozenman@gmail.com>
42
43 Implement support for named symbol references.
44 * src/parse-gram.y: Add new syntax (named_ref.opt).
45 * src/reader.c: Store named refs in symbol lists.
46 * src/reader.h: New argument for symbol_append and
47 action_append functions.
48 * src/scan-code.h: Add new field (named_ref) into
49 code_props data structure. Keeps named ref of midrule
50 actions.
51 * src/scan-code.l: Support for named refs in semantic
52 action code. New function 'parse_named_ref'.
53 * src/scan-gram.l: Support bracketed id.
54 * src/symlist.c: Store named refs in symbol lists.
55 * src/symlist.h: New field in symbol list: named_ref.
56 * src/named-ref.h: New file, a struct for named_ref.
57 * src/named-ref.cp: New file, named_ref_new function.
58 * src/local.mk: Add two new files.
59 * tests/testsuite.at: Include new test group:
60 * tests/named-refs.at: this new file.
61
622009-06-25 Akim Demaille <demaille@gostai.com>
63
64 hash: check insertion for memory exhaustion.
65 * src/uniqstr.c (uniqstr_new): New.
66
672009-06-11 Akim Demaille <demaille@gostai.com>
68
69 style changes.
70 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
71 * src/print-xml.c: Style changes.
72 * tests/conflicts.at: Comment changes.
73
742009-06-11 Akim Demaille <demaille@gostai.com>
75
76 xml: beware of user strings used to give a %prec to rules.
77 * tests/conflicts.at (%prec with user strings): New.
78 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
79 XML output.
80
812009-06-11 Akim Demaille <demaille@gostai.com>
82
83 hash: check insertion for memory exhaustion.
84 * src/muscle-tab.c (muscle_insert, muscle_grow)
85 * src/state.c (state_hash_insert): Check the return value of
86 hash_insert.
87
882009-06-10 Akim Demaille <demaille@gostai.com>
89
90 deterministic test suite.
91 Some consistency checks on symbols are performed after all the
92 symbols were read, by an iteration over the symbol table. This
93 traversal is nondeterministic, which can be a problem for test
94 cases.
95 Avoid this.
96 Addresses another form of nondeterminism reported by Joel E. Denny.
97 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
98
99 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
100 test in two.
101 Use different file names for the three tests to make the
102 maintenance easier.
103
1042009-06-10 Akim Demaille <demaille@gostai.com>
105
106 deterministic user-token-number redeclaration errors.
107 Address nondeterminism reported by Joel E. Denny.
108 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
109
110 * src/uniqstr.h: Comment changes.
111 * src/location.h (boundary_cmp, location_cmp): New.
112 * src/symtab.c (user_token_number_redeclaration): New.
113 (symbol_translation): Use it.
114 * tests/input.at (Numbered tokens): Adjust the expected output.
115
1162009-05-25 Akim Demaille <demaille@gostai.com>
117
118 gnulib: update.
119 * gnulib: Update to latest.
120 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
121 * m4/.gitignore: Regen.
122 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
123 Call xalloc_die on hash_insert failures.
124 Requested by the new __warn_unused_result__ attribute of
125 hash_insert.
126
1272009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
128
129 Convert multiple variable definition warnings to complaints.
130 * NEWS (2.5): Add a new entry for that change.
131 * doc/bison.texinfo (Decl Summary): Update %define entry.
132 (Bison Options): Update -D/--define/-F/--force-define entry.
133 * src/muscle_tab.c (muscle_percent_define_insert): Implement.
134 * src/muscle_tab.h (muscle_percent_define_insert): Update
135 comments.
136 * tests/input.at (`%define errors'): Update.
137 (`%define, --define, --force-define'): Update.
138
1392009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
140
141 -F/--force-define and relative %define/-D/--define priorities.
142 * NEWS (2.5): Add documentation to -D/--define entry.
143 * build-aux/cross-options.pl: Hard-code association of
144 --force-define with %define.
145 * doc/bison.texinfo (Decl Summary): In %define entry,
146 cross-reference command-line options.
147 (Bison Options): Add documentation to -D/--define entry.
148 (Option Cross Key): Widen column for --force-define row.
149 * src/getargs.c (usage): Document -F/--force-define. Realign
150 options in output.
151 (short_options, long_options, getargs): Parse -F/--force-define,
152 and update muscle_percent_define_insert invocation.
153 * src/muscle_tab.h (muscle_percent_define_how): New enum type.
154 (muscle_percent_define_insert): Add argument with that type.
155 * src/muscle_tab.c (muscle_percent_define_insert): Implement
156 -F/--force-define behavior and priorities.
157 * src/parse-gram.y (prologue_declaration): Update
158 muscle_percent_define_insert invocations.
159 * tests/input.at (`%define, --define'): Rename to...
160 (`%define, --define, --force-define'): ... this and extend.
161
1622009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
163
164 Update some comments to make sense for -D.
165 * data/bison.m4 (b4_check_user_names): In header comments, say
166 "user occurrence" instead of "grammar occurrence".
167 * src/muscle_tab.h (muscle_percent_define_insert): Likewise.
168 (muscle_percent_code_grow): Likewise just for consistency.
169
1702009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
171
172 * data/c++.m4: Update copyright year.
173
1742009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
175
176 * data/c++.m4 (b4_namespace_close): Simplify slightly.
177
1782009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
179
180 Handle a trailing `:' in a user-supplied C++ namespace better.
181 * data/c++.m4 (b4_namespace_close): Don't let it be printed
182 among the closing braces here. This fix might make the
183 generated code easier to debug, but otherwise it should be
184 insignificant because a trailing `:' is a C++ error already.
185
1862009-05-19 Akim Demaille <demaille@gostai.com>
187
188 remove useless variable.
189 * src/getargs.c (skeleton_arg): Remove now useless variable.
190 Should help the compiler see that this printf-like call is sane.
191
1922009-05-11 Akim Demaille <demaille@gostai.com>
193
194 doc: use C++ headers.
195 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
196 headers.
197
1982009-05-05 Akim Demaille <demaille@gostai.com>
199
200 fix hexadecimal token number support.
201 * src/scan-gram.l: Catch incorrect ids after hexadecimal numbers.
202
2032009-05-05 Akim Demaille <demaille@gostai.com>
204
205 tests: check token numbers.
206 * tests/input.at (Numbered tokens): New.
207
2082009-05-04 Akim Demaille <demaille@gostai.com>
209
210 bison: catch bad symbol names.
211 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
212 * tests/input.at: Adjust.
213
2142009-05-04 Akim Demaille <demaille@gostai.com>
215
216 space changes.
217 * src/scan-gram.l: Untabify to be robust to zealous editors.
218
2192009-05-04 Akim Demaille <demaille@gostai.com>
220
221 identifiers: dashes are letters.
222 Dashes can now start identifiers (symbols and directives).
223
224 * src/scan-gram.l ({letter}): Add dash.
225 ({id}): Remove it.
226 * tests/input.at (Symbols): Adjust.
227 Remove stray comment.
228 * tests/regression.at (Invalid inputs): Adjust error message.
229 * doc/bison.texinfo (Symbols): Update.
230
2312009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
232
233 Declare %code to be a permanent feature.
234 * NEWS (2.4.2): Here.
235 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
236 experimental.
237 (Decl Summary): Likewise.
238
2392009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
240
241 Convert underscores to dashes in some %define variable names.
242 For now, just api.push-pull and lr.keep-unreachable-states.
243 Maintain old names for backward compatibility.
244 * NEWS (2.5): Document.
245 * data/c.m4 (b4_identification): Update comment.
246 * data/yacc.c: Update access.
247 * doc/bison.texinfo: Update.
248 * etc/bench.pl.in (bench_grammar): Update use.
249 * src/files.c (tr): Move to...
250 * src/getargs.c, src/getargs.h (tr): ... here because I can't
251 think of a better place to expose it. My logic is that, for all
252 uses of tr so far, command-line arguments can be involved, and
253 getargs.h is already included.
254 * src/main.c (main): Update access.
255 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
256 variable names to new variable names before assigning value.
257 * src/reader.c (reader): Update setting default.
258 * tests/calc.at: Update uses.
259 * tests/conflicts.at (Unreachable States After Conflict
260 Resolution): Update use.
261 * tests/input.at (%define enum variables): Update use.
262 (%define backward compatibility): New test group.
263 * tests/push.at: Update uses.
264 * tests/reduce.at: Update uses.
265 * tests/torture.at: Update uses.
266
2672009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
268
269 Set all front-end %define defaults in one place.
270 * src/main.c (main): Move lr.keep_unreachable_states default...
271 * src/reader.c (reader): ... to here.
272
2732009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
274
275 Rename lr.default_reductions to lr.default-reductions.
276 * NEWS (2.5): Here.
277 * doc/bison.texinfo: Here.
278 * src/lalr.c (initialize_LA): Here.
279 * src/print.c (print_reductions): Here.
280 * src/reader.c (reader): Here.
281 * src/tables.c (action_row): Here.
282 * tests/input.at (%define enum variables): Here.
283 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
284
2852009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
286
287 Pacify ./configure --enable-gcc-warnings.
288 * tests/input.at (Symbols): Prototype yyerror and yylex.
289
2902009-04-21 Akim Demaille <demaille@gostai.com>
291
292 tests: check the use of dashes and periods in symbols.
293 * tests/input.at (Symbol): New test group.
294
2952009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
296
297 Document how `%define "var" "value"' is not M4-friendly.
298 * src/parse-gram.y (variable): In comments here.
299
3002009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
301
302 Add copyright updates missed during previous cherry pick.
303 * src/output.c: Here.
304 * src/parse-gram.y: Here.
305 * src/scan-gram.l: Here.
306
3072009-04-20 Akim Demaille <demaille@gostai.com>
308
309 variables: accept dashes.
310 * src/scan-gram.l ({id}): Also accept dashes after the initial
311 letter.
312 ({directive}): Use {id}.
313 * src/parse-gram.y: Comment and formatting changes.
314 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
315 symbols.
316 * src/complain.h, src/complain.c (yacc_at): New.
317 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
318 symbol names.
319 * src/output.c (token_definitions_output): Do not #define token
320 names with dashes.
321
3222009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
323
324 Clean up recent patches a little.
325 Reported by Akim Demaille.
326 * doc/bison.texinfo (Understanding): Fix typos.
327 * src/print.c (print_reductions): Don't use negated variable.
328
3292009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
330
331 List accepted values for a %define enum variable with an invalid value.
332 Suggested by Akim Demaille at
333 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
334 * data/bison.m4 (_b4_percent_define_check_values): Implement.
335 * src/muscle_tab.c (muscle_percent_define_check_values): Implement.
336 * tests/input.at (%define lr.default_reductions invalid values): Merge
337 into...
338 (%define enum variables): ... here, and update output.
339
3402009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
341
342 Rename "default rule" to "default reduction".
343 This includes changing variable names in code, changing
344 comments, and renaming %define lr.default_rules to %define
345 lr.default_reductions.
346 * NEWS (2.5): Update IELR documentation.
347 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c:
348 Adjust YYDEFACT and yydefact_ documentation.
349 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
350 and lr.type documentation. Make some other wording
351 improvements.
352 (Glossary): Adjust cross-references and Default Reduction
353 definition.
354 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
355 Remove a confusing comment pointed out by Akim Demaille.
356 (initialize_LA): Adjust code.
357 * src/print-xml.c (print_reductions): Adjust code.
358 * src/print.c (print_reductions): Adjust code.
359 * src/reader.c (reader): Adjust code.
360 * src/tables.c (action_row): Adjust code.
361 (token_actions): Adjust code.
362 * src/tables.h: Adjust YYDEFACT documentation.
363 * tests/input.at (%define lr.default_rules invalid values):
364 Rename test group to...
365 (%define lr.default_reductions invalid values): ... this, and
366 update grammar file and expected output.
367 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
368 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
369
3702009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
371
372 Document %define lr.type and lr.default_rules.
373 * NEWS (2.5): Add an entry.
374 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
375 besides just LALR(1) and GLR(1).
376 * doc/bison.texinfo (Introduction): Likewise.
377 (Language and Grammar): Bison is no longer limited to LALR(1)
378 restrictions.
379 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
380 when trying to distinguish from GLR. Talk about LR(1) grammars
381 rather than LALR(1) grammars.
382 (Decl Summary): In %define api.push_pull entry, say it applies
383 to deterministic parsers in C rather than LALR(1) parsers in C.
384 Add lr.default_rules entry.
385 Add lr.type entry.
386 (Mystery Conflicts): Bison is no longer limited to LALR(1)
387 restrictions.
388 (Generalized LR Parsing): Same changes as for the previous GLR
389 section.
390 (Memory Management): Say deterministic rather than LALR(1).
391 (Understanding): Correct some bison output.
392 Index discussion of "accepting state".
393 Say deterministic rather than LALR(1).
394 (Bison Options): In --yacc entry, say deterministic rather than
395 LALR(1).
396 In --report, --graph, and --xml entries, just don't mention
397 LALR(1).
398 (C++ Parsers): Say deterministic rather than LALR(1).
399 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
400 (Glossary): Add Accepting State, Consistent State, Default Rule,
401 and IELR(1) definitions.
402 In Generalized LR (GLR) definition, make same changes as in
403 previous GLR sections.
404 In LALR(1) definition, say Bison uses LALR(1) by default rather
405 than implying Bison is limited to LALR(1).
406 (LocalWords): Add IELR.
407
4082009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
409
410 Finish implementing %define lr.type.
411 Its value can be "LALR", "IELR", or "canonical LR".
412 * lib/timevar.def (TV_IELR_PHASE1): New var.
413 (TV_IELR_PHASE2): New var.
414 (TV_IELR_PHASE3): New var.
415 (TV_IELR_PHASE4): New var.
416 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
417 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
418 Sbitset.h, ielr.h, and ielr.c.
419 * src/getargs.h, src/getargs.c (enum trace, trace_args,
420 trace_types): Add trace_ielr.
421 * src/lalr.h, src/lalr.c (ngotos): Export it.
422 (F): Rename to...
423 (goto_follows): ... this, update all uses, and export it.
424 (set_goto_map): Export it.
425 (map_goto): Export it.
426 (compute_lookahead_tokens): Don't free goto_follows yet. Now
427 handled in ielr.
428 (initialize_LA): Export it. Move lookback allocation to...
429 (lalr): ... here because, for canonical LR, initialize_LA must
430 be invoked but lookback and much of the rest of LALR isn't
431 needed.
432 * main.c (main): Instead of lalr, invoke ielr, which invokes
433 lalr.
434 * src/reader.c (reader): Default lr.type to "LALR".
435 Default lr.default_rules to "accepting" if lr.type is "canonical
436 LR". Leave the default as "all" otherwise.
437 Check for a valid lr.type value.
438 * src/state.h, src/state.c (struct state_list): Add state_list
439 member.
440 (state_new): Initialize state_list member to NULL.
441 (state_new_isocore): New function, exported.
442 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
443 exercises all values of lr.type.
444 (GNU AWK Grammar): Rename test group to...
445 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
446 AT_TEST_EXISTING_GRAMMAR.
447 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
448 (GNU pic Grammar): Rename test group to...
449 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
450 AT_TEST_EXISTING_GRAMMAR.
451 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
452 all values of lr.type.
453 (Single State Split): New test groups using AT_TEST_LR_TYPE.
454 (Lane Split): Likewise.
455 (Complex Lane Split): Likewise.
456 (Split During Added Lookahead Propagation): Likewise.
457
4582009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
459
460 Add new files for IELR and canonical LR implementation.
461 * src/AnnotationList.c: New.
462 * src/AnnotationList.h: New.
463 * src/InadequacyList.c: New.
464 * src/InadequacyList.h: New.
465 * src/Sbitset.c: New.
466 * src/Sbitset.h: New.
467 * src/ielr.c: New.
468 * src/ielr.h: New.
469
4702009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
471
472 Implement %define lr.default_rules.
473 Its value describes the states that are permitted to contain
474 default rules: "all", "consistent", or "accepting".
475 * src/reader.c (reader): Default lr.default_rules to "all".
476 Check for a valid lr.default_rules value.
477 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
478 is "accepting", then only mark the accepting state as
479 consistent.
480 (initialize_LA): Tell state_lookahead_tokens_count whether
481 lr.default_rules is "accepting".
482 * src/tables.c (action_row): If lr.default_rules is not "all",
483 then disable default rules in inconsistent states.
484 * src/print.c (print_reductions): Use this opportunity to
485 perform some assertions about whether lr.default_rules was
486 obeyed correctly.
487 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
488 helps with checking the parser tables for a grammar.
489 * tests/input.at (%define lr.default_rules invalid values): New
490 test group.
491 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
492 AT_TEST_TABLES_AND_PARSE.
493 (`no %define lr.default_rules'): New test group generated by
494 AT_TEST_LR_DEFAULT_RULES.
495 (`%define lr.default_rules "all"'): Likewise.
496 (`%define lr.default_rules "consistent"'): Likewise.
497 (`%define lr.default_rules "accepting"'): Likewise.
498
4992009-04-20 Akim Demaille <demaille@gostai.com>
500
501 Consistently refer to Yacc, not YACC.
502 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
503
5042009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
505
506 Pacify make maintainer-check-posix.
507 * tests/input.at (%define, --define): Move bison command-line
508 options before grammar file name.
509
5102009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
511
512 Document semicolon warnings.
513 * NEWS (2.5): Here.
514
5152008-12-08 Akim Demaille <demaille@gostai.com>
516
517 Fix portability issue in the test suite.
518 * tests/local.at (AT_MATCHES_CHECK): New.
519 Based on Perl instead of Sed. Sed has too many portability
520 pitfalls, not ever Sed is GNU Sed.
521 * tests/actions.at (Fix user actions without a trailing semicolon):
522 Use it.
523
5242008-12-07 Di-an Jan <dianj@freeshell.org>
525
526 Implement the FIXME that ends an user action with a semicolon
527 if it seems necessary.
528 * src/scan-code.l (flex rules section): Flag cpp directive from
529 any `#' to the first unescaped end-of-line. Semicolon is not
530 needed after `;', `{', '}', or cpp directives and is needed after
531 any other token (whitespaces and comments have no effect).
532 * tests/actions.at (Fix user actions without a trailing semicolon):
533 New test.
534 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
535 to make user actions complete statements.
536 Adjust column numbers in error messages.
537 * tests/regression.at (Fix user actions without a trailing semicolon):
538 Remove. Covered by new test.
539
5402009-04-14 Akim Demaille <demaille@gostai.com>
541
542 doc: minor fixes.
543 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
544 (Table of Symbols): Remove duplicate entry for %debug.
545
5462009-04-10 Eric Blake <ebb9@byu.net>
547
548 submodules: update to latest
549 * submodules/autoconf: Use latest upstream Autoconf.
550
5512009-04-06 Eric Blake <ebb9@byu.net>
552
553 Work around autoconf 2.63b bug in testsuite.
554 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
555 autoconf bug related to # in test.
556
5572009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
558
559 * NEWS (2.5): Describe new -D/--define feature.
560
5612008-11-10 Akim Demaille <demaille@gostai.com>
562
563 --trace=muscles
564 * src/getargs.h, src/getargs.c (trace_muscle): New.
565 (trace_types, trace_args): Support it.
566 * src/output.c (output_skeleton): Use it.
567
5682008-11-10 Akim Demaille <demaille@gostai.com>
569
570 muscles_output.
571 * src/output.c (muscles_output): New, extracted from...
572 (output_skeleton): here.
573 Adjust.
574
5752008-11-21 Akim Demaille <demaille@gostai.com>
576
577 Display the changes in cross-options.texi.
578 * build-aux/cross-options.pl ($sep): New, to separate items.
579 * doc/Makefile.am ($(srcdir)/cross-options.texi): Use diff to display
580 the changes.
581
5822008-11-20 Di-an Jan <dianj@freeshell.org>
583
584 Improves options in the manual.
585 * doc/bison.texinfo (-g, -x): Add space before argument.
586 (Option Cross Key): Implement FIXME: listing directives also.
587 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
588 (Short Option): Special case -d. Put arguments inside @option.
589 (Bison Directive): Add column, automatically extracted from
590 src/scan-gram.l (actual name passed as the first argument)
591 with special case for %define.
592 * doc/Makefile.am (doc/cross-options.texi): Pass src/scan-gram.l
593 to build-aux/cross-options.pl.
594 * src/getargs.c (usage): Document limitations of cross-options.pl.
595 * src/scan-gram.l: Likewise.
596
5972009-02-25 Akim Demaille <demaille@gostai.com>
598
599 Copyright years.
600 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
601
6022008-12-08 Akim Demaille <demaille@gostai.com>
603
604 Install autoconf as a submodule to get m4sugar.
605 * .gitmodules: Add submodules/autoconf.
606 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
607 submodules/autoconf.
608
6092008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
610
611 Simplify last patch slightly.
612 * src/getargs.c (getargs): Here.
613
6142008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
615
616 Fix last warning from --enable-gcc-warnings.
617 * src/getargs.c (getargs): Don't assign const address to non-const
618 pointer.
619
6202008-11-17 Di-an Jan <dianj@freeshell.org>
621
622 Handle --enable-gcc-warnings.
623 * src/getargs.c (command_line_location): Set parameters to void.
624
6252008-11-11 Akim Demaille <demaille@gostai.com>
626
627 AT_FULL_COMPILE.
628 * tests/actions.at, tests/regression.at: Use it.
629
6302008-11-07 Akim Demaille <demaille@gostai.com>
631
632 Pass command line location to skeleton_arg and language_argmatch.
633 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
634 The location argument is now mandatory.
635 Adjust all dependencies.
636 (getargs): Use command_line_location.
637
6382008-11-07 Akim Demaille <demaille@gostai.com>
639
640 -D, --define.
641 * src/getargs.c (usage): Document -D.
642 Fix help string for --locations.
643 (command_line_location): New.
644 (short_options, long_options, getargs): Support -D, --define.
645 (getargs): Move -d support at the right place.
646 * doc/bison.texinfo (Bison Options): Update.
647 * tests/input.at (%define, --define): New.
648
6492008-11-07 Akim Demaille <demaille@gostai.com>
650
651 Initialize the muscle table before parsing the command line.
652 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
653 (getargs): Define file_name.
654 * src/main.c (main): Initialize muscle_tab before calling
655 getargs.
656 * src/muscle_tab.c (muscle_init): No longer define file_name, as
657 its value is not available yet.
658
6592008-11-09 Akim Demaille <demaille@gostai.com>
660
661 Require the generation of parse-gram.output.
662 * src/Makefile.am (YACC): Pass --report=all.
663
6642009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
665
666 * NEWS (2.5): New stub.
667
6682009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
669
670 Fix options documentation.
671 * build-aux/cross-options.pl: As in --help output, write optional
672 arguments as [=ARG] not =[ARG].
673 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
674
6752008-11-07 Akim Demaille <demaille@gostai.com>
676
677 Fix --help.
678 * src/getargs.c (usage): Fix help string for -W.
679
6802008-11-07 Akim Demaille <demaille@gostai.com>
681
682 Handle more general types of option arguments.
683 * build-aux/cross-options.pl: The argument ends at the first
684 space, not the first non-symbol character.
685 Use @var for each word appearing the argument description.
686
6872009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
688
689 Remove spurious initial empty lines.
690 * data/location.cc: End the @output lines with an @.
691
6922008-11-04 Akim Demaille <demaille@gostai.com>
693
694 Remove spurious initial empty lines.
695 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
696 * data/yacc.c: End the @output lines with an @.
697
6982009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
699
700 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
701 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
702 requirements for a correct m4 are stricter.
703 * m4/m4.m4: Replace with Autoconf 2.63's m4/m4.m4.
704 * configure.ac: Update to use AC_PROG_GNU_M4.
705 Reported by Eric Blake.
706
7072009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
708
709 Help with updating web manual.
710 * HACKING: Incorporate instructions from gnulib/doc/README.
711 * bootstrap.conf (gnulib_modules): Add gendocs.
712
7132009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
714
715 Fix strange %define locations for default values.
716 Reported by Akim Demaille at
717 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
718 and discussed again starting at
719 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
720 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
721 because location information is bogus.
722 Use angle brackets to delimit fake file name because square brackets
723 look like underexpanded m4. Choose a better fake file name.
724 Use negative line numbers.
725 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
726 * src/location.c (location_print): If line for a boundary is negative,
727 only print that boundary's file name.
728 * src/location.h: Document that.
729 * tests/skeletons.at (%define Boolean variables: invalid skeleton
730 defaults): Update output.
731
7322008-11-07 Akim Demaille <demaille@gostai.com>
733
734 Locations without columns for command line arguments.
735 * src/location.c (location_print): Don't display negative columns.
736 * src/location.h: Document this.
737
7382009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
739
740 Add reminder about uploading public key to keys.gnupg.net.
741 * HACKING (Release Procedure): Here.
742
7432009-03-31 Akim Demaille <demaille@gostai.com>
744
745 bootstrap: --help to stdout.
746 * bootstrap (usage): Don't send --help to stderr.
747 Use a here doc instead of a long string.
748
7492009-03-31 Akim Demaille <demaille@gostai.com>
750
751 bootstrap: README-hacking no longer exists
752 * bootstrap (checkout_only_file): Set to HACKING.
753
7542009-03-26 Akim Demaille <demaille@gostai.com>
755
756 doc: merge HACKING and README-hacking.
757 Two files is confusing.
758 Reported by Alexandre Duret-Lutz.
759
760 * README-hacking: Merge into...
761 * HACKING (Working from the repository): here.
762
7632009-03-26 Akim Demaille <demaille@gostai.com>
764
765 doc: update README-hacking.
766 * README-hacking: We now use git and git submodules.
767 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
768
7692009-03-26 Akim Demaille <demaille@gostai.com>
770
771 lalr1.cc: avoid GCC 4.3 warnings.
772 GCC 4.3 now warns about "a || b && c" and asks for explicit
773 parentheses.
774 Reported by Alexandre Duret-Lutz.
775 * data/location.cc: Update copyright years.
776 (Position::operator==): Use parens to make precedence explicit.
777 Compare lines and columns first, as they are more likely to be
778 different, and they are faster to compare.
779
7802009-03-26 Akim Demaille <demaille@gostai.com>
781
782 gnulib: update.
783 * gnulib: Update to latest.
784 * lib/Makefile.am (AM_CPPFLAGS): It is now defined by gnulib, so
785 use +=.
786
7872009-01-08 Akim Demaille <demaille@gostai.com>
788
789 Fix grep portability issues.
790 Grep on Solaris does not support -q.
791 Reported by Summum Bonum.
792
793 * NEWS: Add a stub for 2.4.2.
794 * THANKS: Add Summum Bonum.
795 * tests/atlocal.in (EGREP): New.
796 (CC, CXX, XSLTPROC): Make it possible to override them via
797 envvars.
798 * tests/java.at: Use $EGREP instead of egrep.
799 Use AT_CHECK's ignore instead of grep's -q.
800
8012008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
802
803 Version 2.4.1.
804 * NEWS: Set version and date.
805 * lib/Makefile.am: Update copyright year.
806 * tests/atlocal.in: Update copyright year.
807
8082008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
809
810 Semicolon feature removal is not about future language support.
811 * NEWS: The semicolon feature is no longer active for newer languages,
812 so don't claim that it causes trouble for them.
813
8142008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
815
816 * gnulib: Update submodule to HEAD.
817
8182008-12-09 Akim Demaille <demaille@gostai.com>
819
820 Update data/README.
821 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
822
8232008-12-05 Eric Blake <ebb9@byu.net>
824
825 Build testsuite with newer autoconf.
826 * tests/output.at (m4_expand): Don't override in newer autoconf,
827 where the underlying implementation changed.
828 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
829 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
830 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
831 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
832 since some of them contain unbalanced ')'.
833
8342008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
835
836 * NEWS: Clarify a little.
837
8382008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
839
840 * NEWS: Update for recent changes.
841
8422008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
843
844 Fix unexpanded macros in GLR defines file.
845 Reported by Csaba Raduly at
846 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
847 * THANKS (Csaba Raduly): Add.
848 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
849 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
850 lexer in a separate module that includes the defines file.
851 (AT_CHECK_CALC): Use AT_FULL_COMPILE and request compilation of lexer
852 source.
853 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
854 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
855 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
856 (AT_DATA_SOURCE_PROLOGUE): New.
857 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
858 (AT_DATA_SOURCE): New.
859 (AT_FULL_COMPILE): New, copied from master branch and extended to
860 support an additional source file.
861
8622008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
863
864 Don't let maintainer-*-check targets force a version update.
865 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
866 handled.
867
8682008-11-17 Di-an Jan <dianj@freeshell.org>
869
870 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
871 Align menus. Adjust word wrapping. Use node names for menu names.
872 (Examples): Don't abbreviate node names.
873 (LocalWords): Remove abbreviations.
874 (Copying): Make description a sentence.
875 (Java Action Features): Remove period to match the rest of menu.
876
8772008-11-11 Paolo Bonzini <bonzini@gnu.org>
878
879 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
880 * configure.ac: Adjust usage.
881 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
882 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
883 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
884
8852008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
886
887 Don't add a semicolon to actions for %skeleton or %language.
888 It breaks Java test cases as reported by Akim Demaille.
889 * src/scan-code.l: Implement.
890
8912008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
892
893 Clean up %skeleton and %language priority implementation.
894 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
895 remove static qualifier because others will soon need to see it.
896 (language_prio): Likewise.
897 (getargs): Use command_line_prio rather than 0.
898 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
899 enum fields.
900 (skeleton_prio): Extern it.
901 (language_prio): Extern it.
902 * src/parse-gram.y: Use grammar_prio rather than 1.
903
9042008-11-04 Akim Demaille <demaille@gostai.com>
905
906 * NEWS: Mention the trailing semicolon in action.
907
9082008-11-04 Akim Demaille <demaille@gostai.com>
909
910 Reformat NEWS.
911 * NEWS: Use more outline-mode markup.
912 Suggested by Jim Meyering.
913
9142008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
915
916 Fix user actions without a trailing semicolon.
917 Reported by Sergei Steshenko at
918 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
919 * THANKS (Sergei Steshenko): Add.
920 * src/scan-code.l (SC_RULE_ACTION): Fix it.
921 * tests/regression.at (Fix user actions without a trailing semicolon):
922 New test case.
923
9242008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
925
926 Initiate further development.
927 * NEWS: Create an empty section for new entries.
928 * gnulib: Update submodule to HEAD.
929
9302008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
931
932 * NEWS: Version 2.4.
933
9342008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
935
936 Prepare for next release.
937 * NEWS: Briefly mention changes since 2.3b.
938 * README: Say GNU m4 1.4.6, which we've been requiring in release
939 announcements already, not 1.4.3, which breaks the build.
940
9412008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
942
943 Say %language is experimental.
944 We're thinking of extending it's effect on output file naming. See the
945 thread at
946 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
947 * NEWS: Say it's experimental.
948 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
949 recommend it over %skeleton for now.
950 (Bison Options): Likewise.
951 (C++ Bison Interface): Use %skeleton not %language.
952 (Calc++ Parser): Use %skeleton not %language.
953 * src/getargs.c (usage): Say it's experimental.
954
9552008-11-01 Di-an Jan <dianj@freeshell.org>
956 Paolo Bonzini <bonzini@gnu.org>
957
958 Support all Java parser class modifiers.
959 * data/java.m4 (b4_percent_define_get3): New.
960 (b4_final_if, b4_strictfp_if): New.
961 * data/lalr1.java (final, strictfp, extends, implements): Support.
962 * doc/bison.texinfo (final, strictfp, extends, implements): Add
963 documentation.
964 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
965 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
966 (AT_CHECK_JAVA_GREP): New.
967 (Java parser class modifiers): New test.
968 (Java parser class extends and implements): New test.
969
970 Model exception propagation better with throws and lex_throws.
971 * data/java.m4 (b4_list2): New.
972 (throws): Change default.
973 * data/lalr1.java (yyaction): Add throws.
974 (parse): Add lex_throws in addition to throws.
975 * doc/bison.texinfo (throws, lex_throws): Add documentation.
976 * tests/java.at (Java throws specifications): New test.
977
978 Improve documentation for Java parsers.
979 * doc/bison.texinfo (Java Parsers): Add subsections.
980 Don't quote first argument of %define.
981 (Java Bison Interface): Document output files. Move documentation
982 of parser class and merge into Java Parser Interface. Document
983 features that error out. Document directives with no effect.
984 Move note about Javadoc higher.
985 (Java Semantic Values): Explicitly mention stype.
986 Document that generic types cannot be used.
987 (Java Location Values): Use @deftypeivar. Document constructors.
988 Correct return value for toString.
989 (Java Parser Interface): List undocumented constants/fields.
990 Move documentation of fields added by %parse-param closer to list
991 of members. Document that token names are added as fields.
992 Document constructors accurately. Remove error method.
993 (Java Scanner Interface): Move note on %pure-parser to Java Bison
994 Interface. Describe %code lexer and yylex accutately.
995 Remove documentation that does not match the code.
996 (Java Action Features): New.
997 (Java Differences): Add reference. Add item on semantic values.
998 Add note about @{ ... @}. Clarify %% epilogue placement.
999 (Java Declarations Summary): New.
1000
1001 Fix Java skeleton.
1002 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
1003 (b4_remove_comma): Quote test argument.
1004 (b4_identification): Remove "bison" field.
1005 * tests/java.at (Java parser class and package names): New test.
1006 (Java %parse-param and %lex-param): New test.
1007 (Java stype, position_class and location_class): New test.
1008
10092008-10-31 Di-an Jan <dianj@freeshell.org>
1010
1011 * data/lalr1.jave: Update copyright years.
1012 (YYParser): Correct name of "generated from" file in Javadoc:
1013 use b4_file_name instead of @ofile@.
1014 (Location constructor): Correct Javadoc parameter name.
1015 (yylloc): Add missing opening m4 quote after b4_location_if.
1016 This removes a stray [ in the Javadoc of Lexer.getStartPos.
1017 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
1018 (YYParser constructor): Correct Javadoc parameter name.
1019
10202008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
1021
1022 Always put auxiliary code files in the same dir as other output files.
1023 * src/files.c (compute_file_name_parts): When the user specifies
1024 --output but not --file-prefix, extract the directory prefix from the
1025 file prefix not from the grammar file name. This affects the location
1026 of files like location.hh generated by the C++ skeleton. The includes
1027 in the other output files require this fix.
1028 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
1029 for expected output files.
1030 (Output files): Add a test for the above.
1031
10322008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
1033
1034 * gnulib: Update submodule to HEAD.
1035
10362008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1037
1038 Update copyright year.
1039 * src/files.c: Here.
1040
10412008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
1042
1043 Don't overwrite the input file.
1044 * src/files.c (output_file_name_check): Fatal error if using input file
1045 for output.
1046 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
1047 argument.
1048 (Conflicting output files): Add test.
1049
10502008-10-28 Akim Demaille <demaille@gostai.com>
1051
1052 Space changes.
1053 * data/lalr1.cc: Formatting changes.
1054
10552008-10-28 Akim Demaille <demaille@gostai.com>
1056
1057 Don't define debugging functions when !YYDEBUG.
1058 * data/lalr1.cc (debug_stream, set_debug_stream)
1059 (debug_level_type, debug_level, set_debug_level): Don't
1060 declare them when YYDEBUG is not defined.
1061 The implementation are already YYDEBUG-aware.
1062
10632008-10-28 Akim Demaille <demaille@gostai.com>
1064
1065 Prefer "continue" for empty loop bodies.
1066 * etc/bench.pl.in: Use "continue" instead of {}.
1067
10682008-10-28 Akim Demaille <demaille@gostai.com>
1069
1070 Space and comments changes.
1071 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
1072 * data/c.m4, data/lalr1.cc: Space changes.
1073
10742008-10-28 Akim Demaille <demaille@gostai.com>
1075
1076 Make gnulib a submodule.
1077 * gnulib: New.
1078 * .gitmodules (gnulib): New.
1079
10802008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1081
1082 Fix yyerror_range for user-defined location type in C++. Reported by
1083 Georg Sauthoff at
1084 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
1085 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
1086 * THANKS (Georg Sauthoff): Add.
1087
10882008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1089
1090 Update several administrative files mainly to facilitate releasing.
1091 * HACKING (Administrivia): Make the git-merge-changelog notes more
1092 helpful.
1093 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
1094 (Release Procedure): Update for git and add numerous details that were
1095 previously missing.
1096 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
1097 * maint.mk (announcement): Don't list bison as a bootstrap tool so
1098 that announcements don't claim we bootstrapped with whatever bison
1099 happened to be in PATH. Add flex as a bootstrap tool.
1100 * Makefile.maint: Remove, previously replaced by maint.mk.
1101 * Makefile.cfg: Remove, and migrate settings to...
1102 * cfg.mk: ... here for the sake of `make announcement'.
1103 * bootstrap.conf (gnulib_modules): Add announce-gen.
1104 * README: Say GNU Bison instead of just Bison. Suggested by Karl
1105 Berry.
1106
11072008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
1108
1109 Small but important bugfixes for the Java skeleton.
1110 * data/lalr1.java (yyerror): Change Location to b4_location_type.
1111 (yy_symbol_print): Call toString on yyvaluep.
1112
11132008-08-29 Akim Demaille <demaille@gostai.com>
1114
1115 Clarify UPDATED use.
1116 * doc/bison.texinfo: It refers to the last edition of this file,
1117 not to the release date of Bison.
1118 Reported by Joel E. Denny.
1119
11202008-08-29 Akim Demaille <demaille@gostai.com>
1121
1122 * README: Update FAQ pointer.
1123 Reported by Joel E. Denny.
1124
11252008-08-27 Eric Blake <ebb9@byu.net>
1126
1127 Resync m4sugar from autoconf.
1128 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
1129 (m4_init): Adjust to latest m4.git changes.
1130 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
1131 effects.
1132 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
1133 (_m4_list_cmp): Reduce side effects.
1134
11352008-08-27 Akim Demaille <demaille@gostai.com>
1136
1137 Check yyerrok in calc.at.
1138 * tests/calc.at (calc.y): Use yyerrok on "( error )".
1139 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
1140 expected.
1141
11422008-08-27 Akim Demaille <demaille@gostai.com>
1143
1144 Support yyerrok in lalr1.cc.
1145 YYBACKUP is still to import back into lalr1.cc.
1146 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
1147
11482008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1149
1150 For maintainer-check*, don't recompile for a $(VERSION) update.
1151 * cfg.mk: New file.
1152 (_is-dist-target): Override the one in GNUmakefile.
1153 * Makefile.am (EXTRA_DIST): Add cfg.mk.
1154
11552008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1156
1157 Update for recent change to gnulib.
1158 * src/parse-gram.y: Don't include strverscmp.h. It comes from
1159 string.h now.
1160
11612008-08-15 Eric Blake <ebb9@byu.net>
1162
1163 Remaining m4sugar merge from autoconf.
1164 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
1165 * data/m4sugar/foreach.m4: New file, copied from autoconf.
1166 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
1167 * src/output.c (output_skeleton): Tell m4 how to find it.
1168
1169 Partial m4sugar merge from autoconf: m4_map.
1170 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
1171 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
1172 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
1173 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
1174 for empty list.
1175 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
1176 Likewise.
1177 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
1178 declares it.
1179
11802008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
1181
1182 Keep .version and PACKAGE_VERSION in sync.
1183 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
1184 dependency, and add comments justifying this in more detail. Discussed
1185 starting at
1186 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
1187
11882008-08-06 Eric Blake <ebb9@byu.net>
1189
1190 Partial m4sugar merge from autoconf: m4_shiftn.
1191 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
1192 (m4_shift2, m4_shift3): New macros.
1193 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
1194 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
1195 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
1196 * data/java.m4 (b4_remove_comma): Likewise.
1197
1198 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
1199 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
1200 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
1201 (m4_init): Consolidate wrapped text into single m4_wrap.
1202 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
1203 in wrapped text.
1204
12052008-08-05 Eric Blake <ebb9@byu.net>
1206
1207 Partial m4sugar merge from autoconf: builtins, version.m4.
1208 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
1209 (m4_prepend): Remove, as it is unused and inherently quadratic,
1210 whereas m4_append is linear in newer m4.
1211 (m4_mkstemp): New builtin.
1212 (m4_symbols): Make rename conditional.
1213 (m4_version_prereq): Ensure fatal error if used in bison, which
1214 intentionally lacks version.m4.
1215
1216 Fix comments in m4sugar.
1217 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
1218
12192008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1220
1221 Update for recent .gitignore fix in Gnulib.
1222 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
1223 anchored .gitignore entries.
1224
12252008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1226
1227 Set gnu or gnits strictness.
1228 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
1229 development and gnits strictness for releases. Based on Eric Blake's
1230 suggestion at
1231 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
1232
12332008-07-31 Paolo Bonzini <bonzini@gnu.org>
1234
1235 * NEWS: Clarify documentation of %language.
1236
12372008-07-31 Paolo Bonzini <bonzini@gnu.org>
1238
1239 Support usage of git-merge-changelog.
1240 * .gitattributes: New.
1241 * HACKING: Document usage of git-merge-changelog.
1242 * bootstrap: Install git-merge-changelog entries in .git/config
1243 if appropriate.
1244
12452008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1246
1247 Remove remaining dependence on CVS Id keyword.
1248 * ChangeLog: For the sake of people still using CVS, don't use dollars
1249 when mentioning Id.
1250 * data/xslt/bison.xsl: Remove Id from header comments, where it was
1251 unusual anyway.
1252 * data/xslt/xml2dot.xsl: Likewise.
1253 * data/xslt/xml2text.xsl: Likewise.
1254 * data/xslt/xml2xhtml.xsl: Likewise.
1255 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
1256 * doc/Makefile.am (neutralize): Remove, no longer needed.
1257 (.x.1): Don't use neutralize.
1258 (edit): Don't substitute for ID.
1259 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
1260
12612008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1262
1263 Fix dependence on computed configure variables.
1264 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
1265 $(top_srcdir)/configure.ac so that changes to computed variables, such
1266 as PACKAGE_VERSION, are seen.
1267 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
1268
12692008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
1270
1271 Update copyright dates for recent changes.
1272 * Makefile.am: Here.
1273 * src/Makefile.am: Here.
1274 * src/reduce.c: Here.
1275 * tests/reduce.at: Here.
1276
12772008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
1278
1279 Use git-version-gen for version names between releases.
1280 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
1281 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
1282 * .prev-version: New.
1283 * .version.in: Remove.
1284 * ChangeLog: Remove the Id previously used for capturing the CVS
1285 revision.
1286 * GNUmakefile: Remove, now copied from Gnulib.
1287 * Makefile.am: Add code suggested by comments in
1288 build-aux/git-version-gen.
1289 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
1290 .prev-version, and .version.
1291 * NEWS (2.3b+): Rename to...
1292 (?.?): ... this because we're dropping the "+" version naming scheme,
1293 but, in general, we still can't be sure of our next release name.
1294 * bootstrap: Add a quick hack to remove from .gitignore the
1295 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
1296 entry. This should really be fixed in gnulib instead.
1297 * bootstrap.conf (gnulib_modules): Add gnumakefile.
1298 * configure.ac (AC_INIT): Set version name by invoking
1299 build-aux/git-version-gen.
1300 (AC_CONFIG_FILES): Remove .version, now generated by
1301 build-aux/git-version-gen.
1302 * maint.mk: New, copied from coreutils.
1303 * doc/.cvsignore (bison.1): Add.
1304 * doc/.gitignore (/bison.1): Add.
1305 * doc/bison.1: Remove, generated.
1306 * src/.cvsignore (revision.c): Remove.
1307 * src/.gitignore (/revision.c): Remove.
1308 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
1309 (BUILT_SOURCES): Remove revision.c.
1310 (revision.c): Remove.
1311 * src/getargs.c (version): Don't print revision after the VERSION.
1312 * src/revision.h: Remove.
1313
13142008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1315
1316 Fix untranslatable composition of sentences. Reported by Goran
1317 Uddeborg at
1318 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
1319 * THANKS (Goran Uddeborg): Add.
1320 * src/reduce.c (reduce_print): Report the number of nonterminals and
1321 rules useless in the grammar in separate sentences.
1322 * tests/reduce.at (Useless Rules): Update output.
1323 (Reduced Automaton): Likewise.
1324 (Underivable Rules): Likewise.
1325 (Empty Language): Likewise.
1326
13272008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1328
1329 Fix some .gitignore and .cvsignore problems.
1330 * bootstrap (insert_sorted_if_absent): Replace all uses with...
1331 (insert_vc_ignore): ... this new function, which prepends `/' to all
1332 .gitignore entries before passing them to insert_sorted_if_absent.
1333 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
1334 .cvsignore files are maintained even though Bison developers run
1335 bootstrap while using Git.
1336 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
1337 unneeded by Bison.
1338 (gnulib): Add.
1339 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
1340 unneeded. Reported by Eric Blake.
1341 * lib/.gitignore (/*~): Add.
1342 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
1343 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
1344 Blake.
1345 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
1346
13472008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1348
1349 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
1350 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
1351 * bootstrap.conf (gnulib_modules): Add unsetenv.
1352 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
1353 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
1354 (/setenv.m4): Add.
1355 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
1356 the first argument because it may become position-dependent, and unset
1357 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
1358 Add comments explaining these issues in more detail.
1359
13602008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
1361
1362 Add .gitignore everywhere based on .cvsignore.
1363 * .gitignore: New.
1364 * build-aux/.gitignore: New.
1365 * data/.gitignore: New.
1366 * doc/.gitignore: New.
1367 * etc/.gitignore: New.
1368 * examples/.gitignore: New.
1369 * examples/calc++/.gitignore: New.
1370 * lib/.gitignore: New.
1371 * m4/.gitignore: New.
1372 * po/.gitignore: New.
1373 * runtime-po/.gitignore: New.
1374 * src/.gitignore: New.
1375 * tests/.gitignore: New.
1376
13772008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1378
1379 * NEWS (2.3b+): New section, empty for now.
1380 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
1381
13822008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1383
1384 * NEWS (2.3b): Update release date since there has been a delay in
1385 getting the announcements and tarballs out.
1386
13872008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1388
1389 * NEWS: Version 2.3b.
1390 * configure.ac (AC_INIT): Likewise.
1391 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
1392
13932008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1394
1395 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
1396 been doing it for years.
1397 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
1398 (Release Procedure): Add FIXME about make alpha being unmaintained.
1399
14002008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
1401
1402 * data/yacc.c: Reformat m4 a little for readability.
1403 * src/lalr.c (build_relations): Correct comment.
1404
14052008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1406
1407 DJGPP specific issue.
1408 * djgpp/config.sed: Fixes required to run configure scripts generated
1409 by autoconf 2.62.
1410
14112008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1412
1413 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
1414 coordinator@translationproject.org.
1415
14162008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1417
1418 * THANKS: Add Eric Blake.
1419
14202008-04-23 Eric Blake <ebb9@byu.net>
1421
1422 Revert prior patch, by working around autoconf regression.
1423 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
1424 ("Output file name: ("): Uncomment test.
1425 ("Output file name: )"): Likewise.
1426 Based on an idea from Noah Misch.
1427
14282008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1429
1430 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
1431 2.61. Reported by Juan Manuel Guerrero at
1432 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
1433 * tests/output.at ("Output file name: ("): Comment out test case for
1434 now.
1435 ("Output file name: )"): Likewise.
1436
14372008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1438
1439 * GNUmakefile: Update git-version-gen invocation so make dist
1440 succeeds.
1441
14422008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1443
1444 Update to the current gnulib CVS repository, and fix trigraph handling
1445 in Bison.
1446 * bootstrap: Update gnulib CVS repository URL.
1447 (symlink_to_dir): Encapsulate the code that guarantees the destination
1448 directory exists into...
1449 (check_dst_dir): ... this new function, and...
1450 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
1451 fail when copying files into lib/uniwidth/.
1452 * src/output.c (prepare_symbols): When writing yytname muscles, where
1453 symbol names will be encoded in C-string literals, tell quotearg to
1454 escape trigraphs. This used to be the default in gnulib.
1455 * tests/regression.at (Token definitions): Because of the change in
1456 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
1457 escapes trigraphs in symbol names. Thus, yytname no longer has
1458 trigraphs unnecessarily doubly escaped. Update test case output.
1459 Extend test case to be sure Bison's own error messages will no longer
1460 have trigraphs in symbol names unnecessarily escaped once.
1461
14622008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1463
1464 Fix make dist infinite loop reported by Juan Manuel Guerrero at
1465 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
1466 * .cvsignore: Add .version.
1467 * .version.in: New.
1468 * bootstrap.conf (gnulib_modules): Add git-version-gen.
1469 * configure.ac (AC_CONFIG_FILES): Add .version.
1470 * build-aux/.cvsignore: Add git-version-gen.
1471
14722008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
1473
1474 * NEWS (2.3a+): Mention that -g now takes an argument.
1475 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
1476 consistency. Update the -g and -x entries now that they take
1477 arguments. Use brackets to indicate optional arguments.
1478 * src/getargs.c (usage): Explain the relationship between arguments of
1479 long and short options more completely. Document --defines and -d
1480 separately since the former takes an argument but, for POSIX Yacc, the
1481 latter does not.
1482 (short_options): Let -W take an optional argument like --warnings.
1483 (getargs): Sort cases.
1484
14852008-02-28 Akim Demaille <demaille@gostai.com>
1486
1487 * doc/bison.texinfo: Fix a few typos.
1488
14892008-02-28 Akim Demaille <akim@epita.fr>
1490
1491 * doc/bison.texinfo (Bison Options): Document -W.
1492 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
1493
14942008-02-28 Akim Demaille <akim@epita.fr>
1495
1496 * src/getargs.c (short_options): Split and sort for readability.
1497 -g and -x take optional arguments, just like their long options.
1498 * build-aux/cross-options.pl: Use /x to make the regexp easier to
1499 understand.
1500 Fix the handling of $opt which resulted in all the argument to be
1501 considered as optional.
1502
15032008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
1504
1505 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
1506 say its interface is experimental.
1507 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
1508 Java.
1509 (Bison Options): In the -L and --language entry, mention Java.
1510 (Java Bison Interface): Say the interface is experimental.
1511 * src/getargs.c (usage): Mention -L and --language.
1512
1513 * NEWS (2.3a+): Say the push parsing interface is experimental.
1514 * doc/bison.texinfo (Push Decl): Likewise.
1515 (Decl Summary): Likewise in the "%define api.push_pull" entry.
1516 (Push Parser Function): Likewise.
1517 (Pull Parser Function): Likewise.
1518 (Parser Create Function): Likewise.
1519 (Parser Delete Function): Likewise.
1520 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
1521 yypull_parse, and yypush_parse entries.
1522
1523 * NEWS (2.3a+): Mention XML support, and say the schema is
1524 experimental.
1525 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
1526 * src/getargs.c (usage): Say the XML schema is experimental.
1527
1528 * NEWS (2.3a+): Say option instead of flag.
1529
15302008-02-21 Wojciech Polak <polak@gnu.org>
1531
1532 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
1533 text.
1534
15352008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
1536
1537 Fix impure push parser compile error reported by Bob Rossi at
1538 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
1539 * data/yacc.c: Clean up whitespace in the output a little.
1540 (yypstate_allocated): Define for impure push parsers regardless of
1541 whether the pull interface is also requested.
1542 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
1543 check impure push parsers without the pull interface.
1544
1545 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
1546 yyerror takes arguments specified by %parse-param while yypstate_new
1547 does not.
1548 * doc/bison.texinfo (Parser Create Function): Document that
1549 yypstate_new returns 0 for multiple impure parser instances.
1550 * tests/push.at (Push Parsing: Multiple impure instances): Update
1551 expected stderr output.
1552
15532008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
1554
1555 * runtime-po/POTFILES.in (push.c): Remove.
1556
15572008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1558
1559 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
1560 * data/push.c: Rename to...
1561 * data/yacc.c: ... this, overwriting it.
1562 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
1563 `%push-pull-parser' -> `%define api.push_pull "both"'.
1564 Remove old yacc.c tests, and update push.c tests to yacc.c.
1565
15662008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1567
1568 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
1569 `"%code top" blocks' instead of `%code "top" blocks'.
1570 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
1571 Clean up whitespace in the output a little.
1572
15732008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1574
1575 Fix documentation problems reported by Tim Josling at
1576 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
1577 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
1578 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
1579 integers. Explain the effect of literal string aliases on error
1580 messages. Copy token 0 documentation from the C++ skeleton
1581 documentation.
1582
15832008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1584
1585 Accept a token number in a %left, %right, or %nonassoc for POSIX
1586 conformance. Reported by Tim Josling at
1587 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
1588 * NEWS (2.3a+): Mention.
1589 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
1590 and code numbers are treated by precedence declarations.
1591 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
1592 of symbols.1.
1593 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
1594 of symbol.
1595 (symbol.prec): New, just like symbol but allows INT.
1596 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
1597 longer holds.
1598 * tests/regression.at (Token number in precedence declaration): New
1599 test case.
1600
16012008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1602
1603 DJGPP specific issues.
1604 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
1605 be changed. Copyright timestamp adjusted.
1606 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
1607 be changed. Copyright timestamp adjusted.
1608 * djgpp/config.site: Copyright timestamp adjusted.
1609 * djgpp/config_h.sed: Copyright timestamp adjusted.
1610 * djgpp/djunpack.bat: Copyright timestamp adjusted.
1611 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
1612 filename translation list.
1613 * djgpp/subpipe.c (init_subpipe): Check the environment variables
1614 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
1615 files shall be created. Before trying to use the temp dir where the
1616 environment variable points to check that the dir really exists. If
1617 not default to the cwd as temp dir. Copyright timestamp adjusted.
1618 * djgpp/subpipe.h: Copyright timestamp adjusted.
1619 * djgpp/testsuite.sed: Copyright timestamp adjusted.
1620
16212008-01-30 Paul Eggert <eggert@cs.ucla.edu>
1622
1623 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
1624
16252008-01-09 Paul Eggert <eggert@cs.ucla.edu>
1626
1627 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
1628 Problem reported by Claudio Saavedra in
1629 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
1630
16312008-01-05 Wojciech Polak <polak@gnu.org>
1632
1633 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
1634 document's title with the input grammar file name.
1635
16362007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
1637
1638 Automate regression testing of the XML/XSLT implementation. Discussed
1639 starting at
1640 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
1641 * configure.ac (XSLTPROC): New substitution.
1642 * Makefile.am (maintainer-xml-check): New phony target invoking...
1643 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
1644 invoking make maintainer-check with BISON_TEST_XML=1.
1645 * tests/atlocal.in (XSLTPROC): New.
1646 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
1647 not to report reachable memory when Bison is expected to have a
1648 non-zero exit status and (2) to compare XML/XSLT output with --graph
1649 and --report=all output for every working grammar when
1650 BISON_TEST_XML=1.
1651 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
1652 (AT_BISON_CHECK_XML): New.
1653 (AT_QUELL_VALGRIND): New.
1654 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
1655 (AT_CHECK): ... don't redefine this since this was the old way to
1656 quell Valgrind.
1657 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
1658 AT_BISON_CHECK invocations.
1659 * tests/c++.at: Likewise.
1660 * tests/calc.at: Likewise.
1661 * tests/conflicts.at: Likewise.
1662 * tests/cxx-type.at: Likewise.
1663 * tests/existing.at: Likewise.
1664 * tests/glr-regression.at: Likewise.
1665 * tests/headers.at: Likewise.
1666 * tests/input.at: Likewise.
1667 * tests/java.at: Likewise.
1668 * tests/output.at: Likewise.
1669 * tests/push.at: Likewise.
1670 * tests/reduce.at: Likewise.
1671 * tests/regression.at: Likewise.
1672 * tests/sets.at: Likewise.
1673 * tests/skeletons.at: Likewise.
1674 * tests/synclines.at: Likewise.
1675 * tests/torture.at: Likewise.
1676 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
1677 tends to hang xsltproc.
1678 (Big horizontal): Likewise.
1679
16802007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
1681
1682 In XML output, remove redundant class attribute on symbol element.
1683 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
1684 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
1685 look up a symbol to determine whether it's a nonterminal or terminal.
1686 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
1687 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
1688
1689 Add prec/assoc information to XML output.
1690 * src/gram.c (grammar_rules_print_xml): For each rule that has a
1691 %prec, add a percent_prec attribute.
1692 * src/print-xml.c (print_grammar): For each terminal that has a
1693 precedence or associativity, add a prec or assoc attribute.
1694 (xml_indent): New.
1695 (xml_puts): Use xml_indent.
1696 (xml_printf): Use xml_indent.
1697 * src/print-xml.h (xml_indent): Prototype.
1698
1699 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
1700 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
1701
17022007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
1703
1704 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
1705 (bison:ruleByNumber): ... this for clarity.
1706 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
1707 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
1708 (xsl:template match="reduction"): Update.
1709 (xsl:template match="item"): Update.
1710 (xsl:template match="reduction"): Update.
1711
1712 In the XML output, don't print the list of rules where symbols appear.
1713 Compute it in XSLT instead. Discussed at
1714 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
1715 * data/xslt/bison.xsl (bison:ruleByLhs): New.
1716 (bison:ruleByRhs): New.
1717 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
1718 bison:ruleByRhs.
1719 (xsl:template match="terminal/rule"): Remove.
1720 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
1721 bison:ruleByRhs.
1722 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
1723 Remove.
1724 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
1725 bison:ruleByRhs and mode="number-link" for rule template.
1726 (xsl:template match="terminal/rule"): Remove.
1727 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
1728 bison:ruleByRhs and mode="number-link" for rule template.
1729 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
1730 Rewrite as...
1731 (xsl:template match="rule" mode="number-link"): ... this.
1732 * src/print-xml.c (print_grammar): Don't print the list of rules.
1733
17342007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
1735
1736 Don't let --report affect XML output; always print all information.
1737 Discussed at
1738 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
1739 * src/conflicts.c (log_resolution): Implement.
1740 * src/print-xml.c (print_core): Implement.
1741 (print_state): Implement.
1742 (print_xml): Implement.
1743
1744 * NEWS (2.3a+): Fix quotes.
1745 * src/parse-gram.y (prologue_declaration): For consistency with -v,
1746 don't let %verbose clear the list specified by --report.
1747
17482007-11-26 Akim Demaille <akim@epita.fr>
1749
1750 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
1751
17522007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
1753
1754 In the XML output, list useless and unused symbols and rules with the
1755 useful ones and add a "usefulness" attribute. Discussed starting at
1756 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
1757 * src/gram.c (grammar_rules_partial_print_xml): Remove.
1758 (grammar_rules_print_xml): Print all rules instead of just those
1759 useful in the grammar, and add a "usefulness" attribute.
1760 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
1761 * src/print-xml.c (print_rules_useless_in_parser): Remove.
1762 (print_grammar): Print all nonterminals instead of just useful ones,
1763 and add a "usefulness" attribute to nonterminals and terminals.
1764 (print_xml): Don't print a separate "reductions" or
1765 "rules-useless-in-parser" element.
1766 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
1767 (reduce_xml): Remove.
1768 (reduce_token_unused_in_grammar): New.
1769 (reduce_nonterminal_useless_in_grammar): New.
1770 * src/reduce.h (reduce_xml): Remove prototype.
1771 (reduce_token_unused_in_grammar): Add prototype.
1772 (reduce_nonterminal_useless_in_grammar): Add prototype.
1773 * data/xslt/xml2text.xsl: Update for XML changes.
1774 * data/xslt/xml2xhtml.xsl: Update for XML changes.
1775 * tests/reduce.at (Useless Terminals): Update output.
1776 (Useless Rules): Update output.
1777 (Reduced Automaton): Update output.
1778
1779 Say "Terminals unused in grammar" instead of "Unused terminals".
1780 * NEWS (2.3a+): Update.
1781 * doc/bison.texinfo (Understanding): Update example output.
1782 * src/reduce.c (reduce_output): Implement.
1783 * data/xslt/xml2text.xsl: Implement.
1784 * data/xslt/xml2xhtml.xsl: Implement.
1785
17862007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
1787
1788 Accept --report-file=FILE to override the default `.output' filename.
1789 * NEWS (2.3a+): Mention.
1790 * doc/bison.texinfo (Bison Options): Add an entry.
1791 * src/files.c (compute_output_file_names): Don't override
1792 spec_verbose_file if already set.
1793 * src/getargs.c (usage): Document --report-file.
1794 (REPORT_FILE_OPTION): New anonymous enum member.
1795 (long_options): Add entry for it.
1796 (getargs): Add case for it setting spec_verbose_file.
1797
1798 * build-aux/cross-options.pl: Don't record a short option just because
1799 there's an arg.
1800 * doc/.cvsignore: Add yacc.1.
1801
18022007-11-14 Akim Demaille <akim@epita.fr>
1803
1804 * doc/yacc.1.in: New.
1805 * configure.ac, doc/Makefile.am: Adjust.
1806 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
1807 config.h symbol.
1808 Use AC_SUBST for assignments too.
1809 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
1810
18112007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
1812
1813 * src/gram.c: Remove comments that duplicate comments in gram.h.
1814
1815 When reporting useless rules and nonterminals, say "useless in grammar"
1816 instead of "useless", and say "useless in parser" instead of "never
1817 reduced". Discussed starting at
1818 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
1819 * NEWS (2.3a+): Mention this change.
1820 * data/xslt/xml2text.xsl: Update output text and expected input XML
1821 element names to match changes below.
1822 * data/xslt/xml2xhtml.xsl: Likewise.
1823 (xsl:template match="bison-xml-report"): Add missing entry in Table of
1824 Contents: "Rules useless in parser due to conflicts".
1825 * doc/bison.texinfo (Decl Summary): Reword a little.
1826 (Understanding): Update example output for changes below.
1827 * src/gram.c: (rule_useful_p): Rename to...
1828 (rule_useful_in_grammar_p): ... this.
1829 (rule_useless_p): Rename to...
1830 (rule_useless_in_grammar_p): ... this.
1831 (rule_never_reduced_p): Rename to...
1832 (rule_useless_in_parser_p): ... this.
1833 (grammar_rules_print): Update for renames.
1834 (grammar_rules_print_xml): Update for renames.
1835 (grammar_rules_never_reduced_report): Rename to...
1836 (grammar_rules_useless_report): ... this since it is used for either
1837 kind of useless rule.
1838 * src/gram.h: Reword comments and update function names in prototypes.
1839 * src/main.c (main): Say "rule useless in parser due to conflicts".
1840 * src/print-xml.c (print_rules_never_reduced): Rename to...
1841 (print_rules_useless_in_parser): ... this, and rename output XML
1842 element "rules-never-reduced" to "rules-useless-in-parser".
1843 (print_xml): Update for rename.
1844 * src/print.c (print_results): Say "Rules useless in parser due to
1845 conflicts".
1846 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
1847 (nonterminals_reduce): Say "nonterminal useless in grammar".
1848 (reduce_output): Say "Nonterminals useless in grammar".
1849 Say "Rules useless in grammar".
1850 (reduce_xml): Rename output XML element "useless" to
1851 "useless-in-grammar".
1852 (reduce_print): Don't report the count of grammatically useless rules
1853 as "rules never reduced" just because %yacc is specified.
1854 In the correct report of this count, say nonterminal(s) and rule(s)
1855 "useless in grammar".
1856 * tests/conflicts.at (S/R in initial): Update expected output.
1857 (Defaulted Conflicted Reduction): Likewise.
1858 (Unreachable States After Conflict Resolution): Likewise.
1859 * tests/existing.at (GNU pic Grammar): Likewise.
1860 * tests/reduce.at (Useless Nonterminals): Likewise.
1861 (Useless Rules): Likewise.
1862 (Reduced Automaton): Likewise.
1863 (Underivable Rules): Likewise.
1864 (Empty Language): Likewise.
1865
18662007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
1867
1868 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
1869 here document and before the EOF so that BSD's implementation of Bourne
1870 shell doesn't parse the delimiter as part of the here document.
1871 * doc/.cvsignore: Add cross-options.texi.
1872 * src/getargs.c (usage): Add a blank line after the warning categories.
1873
18742007-11-08 Paolo Bonzini <bonzini@gnu.org>
1875
1876 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
1877
18782007-11-05 Akim Demaille <akim@epita.fr>
1879
1880 Remove Id: from bison.1.
1881 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
1882 (perl -0777 -pi -e 's/\.PP\nId): New.
1883 (.x.1): Use it to ignore the version control revision.
1884
18852007-11-05 Akim Demaille <demaille@gostai.com>
1886
1887 * build-aux/Makefile.am: Ship cross-options.pl.
1888 * doc/Makefile.am: Always refer to cross-options.texi with
1889 $(srcdir).
1890 (MAINTAINERCLEANFILES): Add it.
1891
18922007-11-04 Akim Demaille <demaille@gostai.com>
1893
1894 Generate the long/short option cross-table.
1895 * build-aux/cross-options.pl: New.
1896 * doc/Makefile.am (cross-options.texi): New.
1897 * doc/bison.texinfo: Use it.
1898
18992007-11-04 Akim Demaille <demaille@gostai.com>
1900
1901 Generate bison.1 using help2man.
1902 * doc/common.x, doc/bison.x: New.
1903 * doc/Makefile.am (bison.1, .x.1): New.
1904 The code is taken from autoconf-2.61/man/Makefile.am.
1905 * configure.ac: Look for help2man.
1906
19072007-11-04 Akim Demaille <demaille@gostai.com>
1908
1909 Complete --help.
1910 * src/getargs.c (usage): Document -W, make it clear that -d,
1911 -g and -x have optional arguments.
1912
19132007-11-04 Akim Demaille <demaille@gostai.com>
1914
1915 Find sha1sum when named gsha1sum.
1916 * bootstrap (find_tool): New.
1917 ($SHA1SUM): New.
1918
19192007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1920
1921 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
1922 at
1923 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
1924 * NEWS (2.3a+): Mention.
1925 * data/bison.m4 (b4_pure_if): Don't define it here.
1926 * data/c.m4 (b4_identification): Depend on individual skeletons to
1927 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
1928 values of the %define variables api.pure or api.push_pull. Define
1929 YYPURE, YYPUSH, and YYPULL accordingly.
1930 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
1931 glr.cc has already defined b4_pure_flag.
1932 * data/push.c: Define b4_pure_if based on `%define api.pure'.
1933 Remove YYPUSH and YYPULL since they're back in b4_identification again.
1934 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
1935 * doc/bison.texinfo (Pure Decl): Update.
1936 (Push Decl): Update.
1937 (Decl Summary): Add api.pure to %define entry.
1938 In %pure-parser entry, say it's deprecated and reference %define.
1939 (Pure Calling): Update.
1940 (Error Reporting): Update.
1941 (C++ Scanner Interface): Update.
1942 (How Can I Reset the Parser): Update.
1943 (Table of Symbols): In %pure-parser entry, say it's deprecated and
1944 reference %define.
1945 * src/getargs.c (pure_parser): Remove global variable.
1946 * src/getargs.h (pure_parser): Remove extern.
1947 * src/output.c (prepare): Don't define pure_flag muscle.
1948 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
1949 wrapper around `%define api.pure'.
1950 * tests/calc.at (Simple LALR Calculator): Update.
1951 (Simple GLR Calculator): Update.
1952 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
1953 Update.
1954 (GLR: Resolve ambiguity, pure, locations): Update.
1955 (GLR: Merge conflicting parses, pure, no locations): Update.
1956 (GLR: Merge conflicting parses, pure, locations): Update.
1957 * tests/glr-regression.at (Uninitialized location when reporting
1958 ambiguity): Update
1959 * tests/input.at (Unused %define api.pure): New test case.
1960 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
1961 AT_PURE_IF and AT_PURE_AND_LOC_IF.
1962 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
1963
19642007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1965
1966 %define push_pull -> %define api.push_pull. Discussed starting at
1967 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
1968 * data/push.c: Expect the new name.
1969 * data/yacc.c: Likewise.
1970 * doc/bison.texinfo (Push Decl): Update.
1971 (Decl Summary): Update %define entry.
1972 (Push Parser Function): Update.
1973 (Pull Parser Function): Update.
1974 (Parser Create Function): Update.
1975 (Parser Delete Function): Update.
1976 * tests/calc.at (Simple LALR Calculator): Update.
1977 * tests/input.at (%define enum variables): Update.
1978 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
1979 (Push Parsing: Multiple impure instances): Update.
1980 (Push Parsing: Unsupported Skeletons): Update.
1981 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
1982 (Exploding the Stack Size with Malloc): Update.
1983
1984 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
1985 other entries some.
1986
19872007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
1988
1989 For the XML output's terminal element, rename @number to @token-number,
1990 and add @symbol-number. In the nonterminal element, rename @number to
1991 @symbol-number. Discussed starting at
1992 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
1993 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
1994 renames.
1995 (xsl:template match="nonterminal"): Likewise.
1996 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
1997 (xsl:template match="nonterminal"): Likewise.
1998 * src/print-xml.c (print_grammar): Implement.
1999
20002007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2001
2002 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
2003 2007-10-11 change, the child elements here are items not rules.
2004 (xsl:template match="item"): New.
2005 (xsl:template match="rule"): Update for new reduced itemset.
2006 (xsl:template match="point"): Remove.
2007 (xsl:template match="empty"): For consistency with --graph, don't
2008 output "/* empty */".
2009 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
2010 line-wrap, don't pass a negative value as first-line-length since this
2011 won't work with the following changes.
2012 (xsl:template name="line-wrap"): Simplify slightly.
2013 (xsl:template name="ws-search"): Eliminate recursion.
2014 * src/print_graph.c (print_core): Don't print a reduction's lookahead
2015 set next to an item whose dot is not at the end of the RHS even if it
2016 happens to be associated with the same rule.
2017
20182007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2019
2020 Add %define lr.keep_unreachable_states.
2021 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
2022 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
2023 * src/main.c (main): Implement it.
2024 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2025 Extend to test it, and fix a typo.
2026
20272007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2028
2029 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
2030 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
2031 the example .output text.
2032 * tests/regression.at (Extra lookahead sets in report): Improve wording
2033 of comments.
2034
20352007-10-17 Wojciech Polak <polak@gnu.org>
2036
2037 * src/print-xml.c (print_grammar): Renamed
2038 <terminal> and <nonterminal> attributes:
2039 "type" to "number" and "symbol" to "name".
2040 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
2041 Use new attribute names.
2042 (xsl:template match="nonterminal"): Likewise.
2043 * data/xslt/xml2xhtml.xsl: Likewise.
2044
20452007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
2046
2047 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
2048 (Option Cross Key): Likewise.
2049
2050 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
2051 next to an item whose dot is not at the end of the RHS even if it
2052 happens to be associated with the same rule.
2053 * src/print.c (print_core): Likewise.
2054 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
2055 (Resolved SR Conflicts): Update output.
2056 * tests/regression.at (Extra lookahead sets in report): New test case.
2057
20582007-10-11 Wojciech Polak <polak@gnu.org>
2059
2060 * src/print-xml.c (print_core): Remove item set
2061 redundancy.
2062 * data/xslt/bison.xsl (bison:ruleNumber): New key.
2063 Improve processing time. Suggested by Joel E. Denny.
2064 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
2065 Write xsl:param "required" attribute as comment.
2066 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
2067 (xsl:template match="rule"): Support new reduced itemset.
2068 (xsl:template match="point"): Remove.
2069 * data/xslt/xml2xhtml.xsl: Likewise.
2070
20712007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2072
2073 * src/getargs.c (version): Update copyright year.
2074
20752007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2076
2077 Make xml2dot.xsl and --graph produce the same output.
2078 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
2079 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
2080 escaped later.
2081 (xsl:template name="output-node"): Use the new escape template instead
2082 of the string-replace template directly.
2083 (xsl:template name="output-edge"): Likewise.
2084 (xsl:template name="escape"): New, escapes backslashes and newlines in
2085 addition to quotation marks.
2086 * src/graphviz.c (start_graph, output_node, output_edge): Add
2087 whitespace to output for legibility.
2088
2089 Make xml2text.xsl and --report produce the same output, and remove the
2090 XML "conflicts" element since a conflict summary is easily extracted
2091 from the automaton.
2092 * data/xslt/bison.xsl: New.
2093 (xsl:template match="state" mode="bison:count-conflicts): New.
2094 * data/xslt/xml2text.xsl: Import bison.xsl.
2095 (xsl:template match="bison-xml-report"): Instead of styling the
2096 "conflicts" element, style the "automaton" element with mode
2097 "conflicts". Unlike the former, the latter lists S/R and R/R
2098 conflicts for a state on the same line.
2099 (xsl:template match="conflicts"): Remove.
2100 (xsl:template match="conflict"): Remove.
2101 (xsl:template match="terminal"): Line-wrap the list of rules in which
2102 the terminal is used.
2103 (xsl:template match="nonterminal"): Likewise for nonterminals.
2104 (xsl:template match="automaton" mode="conflicts"): New.
2105 (xsl:template match="state" mode="conflicts"): New.
2106 (xsl:template name="line-wrap"): New.
2107 (xsl:template name="ws-search"): New.
2108 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
2109 (xsl:template match="bison-xml-report"): Instead of styling the
2110 "conflicts" element, style the "automaton" element with mode
2111 "conflicts."
2112 (xsl:template match="conflicts"): Remove.
2113 (xsl:template match="conflict"): Remove.
2114 (xsl:template match="automaton" mode="conflicts"): New.
2115 (xsl:template match="state" mode="conflicts): New.
2116 * src/conflicts.c (conflicts_output_xml): Remove.
2117 * src/conflicts.h (conflicts_output_xml): Remove prototype.
2118 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
2119 * src/print.c (print_grammar): Consistently wrap at the 66th column so
2120 the corresponding XSLT is easier. Also, never wrap between a word and
2121 the comma that follows it.
2122
21232007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2124
2125 Improve C++ namespace support. Discussed starting at
2126 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
2127 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
2128 b4_namespace_close): New macros that interpret the %define variable
2129 "namespace" so its value can contain "::" to indicate nested
2130 namespaces.
2131 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
2132 the above macros.
2133 * data/lalr1.cc (b4_namespace): Likewise.
2134 * data/location.cc (b4_namespace): Likewise.
2135 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
2136 inside a new table in the general %define entry. Document `%define
2137 namespace' there as well. Point the %name-prefix entry to it since it
2138 explains it more completely in the case of C++.
2139 (C++ Bison Interface): Mention `%define namespace' instead of
2140 %name-prefix.
2141 (Table of Symbols): Remove the `%define push_pull' entry. The %define
2142 entry suffices.
2143 * tests/c++.at (Relative namespace references): New test case.
2144 (Absolute namespace references): New test case.
2145 (Syntactically invalid namespace references): New test case.
2146 * tests/input.at (C++ namespace reference errors): New test case.
2147
21482007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2149
2150 Add syncline support and location accessor to internal %define
2151 interfaces.
2152 * data/bison.m4 (b4_percent_define_get_loc): New.
2153 (b4_percent_define_get_syncline): New.
2154 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
2155 (b4_percent_define_default): Record defining location as line 1 rather
2156 than 0 for the sake of synchronizing #line's, and define
2157 b4_percent_define_syncline(VARIABLE).
2158 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
2159 * src/muscle_tab.c (muscle_syncline_grow): New.
2160 (muscle_code_grow): Use muscle_syncline_grow.
2161 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
2162 define b4_percent_define_syncline(VARIABLE).
2163 (muscle_percent_define_get_loc): New.
2164 (muscle_percent_define_get_syncline): New.
2165 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
2166 remove some unused variables.
2167 (muscle_percent_define_default): Record defining location as line 1
2168 rather than 0 for the sake of synchronizing #line's, and define
2169 b4_percent_define_syncline(VARIABLE).
2170 (muscle_percent_define_check_values): Use
2171 muscle_percent_define_get_loc.
2172 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
2173 (muscle_percent_define_get_syncline): Prototype.
2174 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2175 defaults): Update output for location change.
2176 (Complaining during macro argument expansion): Extend to test
2177 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
2178
21792007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
2180
2181 Fix some error-reporting macro bugs.
2182 * data/bison.m4 (b4_cat): New.
2183 (b4_error, b4_error_at): Use b4_cat to send error directives directly
2184 to stdout so they don't become arguments to other macros. Update
2185 comments and add examples.
2186 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
2187 add examples.
2188 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
2189 after printing the error directive so that M4 doesn't report subsequent
2190 problems that are induced by this problem.
2191 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
2192 instead of just in them. Recognize @\n in both places. Both expand to
2193 the empty string. Needed by b4_cat.
2194 * tests/skeletons.at (Complaining during macro argument expansion):
2195 New test case.
2196 (Fatal errors make M4 exit immediately): New test case.
2197
21982007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
2199
2200 Implement --print-datadir.
2201 * src/getargs.c (usage): Mention.
2202 (PRINT_DATADIR_OPTION): New anonymous enum member.
2203 (long_options): Add entry for it.
2204 (getargs): Add case for it calling compute_pkgdatadir.
2205 * src/output.c (output_skeleton): Encapsulate data directory
2206 computation from here...
2207 (prepare): ... and from here...
2208 (compute_pkgdatadir): ... into this new function.
2209 * src/output.h (compute_pkgdatadir): Prototype.
2210
22112007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
2212
2213 * src/print-xml.c (escape_bufs): New static global variable
2214 replacing...
2215 (xml_escape_n): ... the static local variable buf here.
2216 (print_xml): Free memory for escape_bufs.
2217 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
2218
22192007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
2220
2221 Replace `%push-parser' and `%push-pull-parser' with
2222 `%define push_pull "push"' and `%define push_pull "both"'.
2223 `%define push_pull "pull"' is the default.
2224 * doc/bison.texinfo (Push Decl, Push Parser Function,
2225 Pull Parser Function, Parser Create Function, Parser Delete Function):
2226 Update declarations.
2227 (Decl Summary, Table of Symbols): Replace %push-parser and
2228 %push-pull-parser entries with a %define push_pull entry.
2229 * data/bison.m4 (b4_percent_define_check_values): New macro.
2230 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
2231 definitions...
2232 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
2233 definitions...
2234 * data/push.c: ... to here and compute them from the value of the
2235 %define variable push_pull.
2236 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
2237 parsing requests here...
2238 * data/yacc.c: ... hack this to switch to push.c any time
2239 b4_use_push_pull_flag or the %define variable push_pull is set. This
2240 will go away when we mv push.c yacc.c.
2241 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
2242 push parsing is not supported since unused %define variables are
2243 reported anyway.
2244 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
2245 * src/muscle_tab.h (muscle_percent_define_check_values): Update
2246 comments for consistency with b4_percent_define_check_values.
2247 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
2248 muscles.
2249 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
2250 Remove.
2251 (prologue_declaration): Remove %push-parser and %push-pull-parser
2252 rules.
2253 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
2254 * tests/calc.at: Update declarations.
2255 * tests/input.at (%define enum variables): New test case.
2256 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
2257 declaration.
2258 (Push Parsing: Multiple impure instances): Update declaration.
2259 (Push Parsing: Unsupported Skeletons): New test case.
2260 * tests/torture.at (Exploding the Stack Size with Alloca): Update
2261 declaration.
2262 (Exploding the Stack Size with Malloc): Update declaration.
2263
22642007-09-24 Wojciech Polak <polak@gnu.org>
2265
2266 Add XSLT transformations.
2267
2268 * data/xslt/xml2dot.xsl: Transform XML into DOT.
2269 * data/xslt/xml2text.xsl: Transform XML into plain text.
2270 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
2271 * data/Makefile.am (xsltdir): New variable.
2272 (dist_xslt_DATA): Add xslt/*.xsl files.
2273
22742007-09-23 Paul Eggert <eggert@cs.ucla.edu>
2275
2276 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
2277 Problem reported by Wojciech Polak.
2278 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
2279 (xml_printf): Undo change I made on 21 September; that is,
2280 indent 2 spaces, not 1.
2281
22822007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
2283
2284 Pacify ./configure --enable-gcc-warnings.
2285 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
2286 `char const *' instead of `char *'.
2287 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
2288 local variable `sep'.
2289
22902007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2291
2292 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
2293 elsewhere.
2294 * src/print-xml.c: Prefer "const" after types; that's more consistent.
2295 (xml_printf): Indent just 1 space for level.
2296 (e_char, xlate_char): Remove.
2297 (xml_escape_string): Rewrite to avoid undefined behavior (used
2298 storage that was freed from the stack).
2299 (xml_escape_n): Don't bother checking for subscript error.
2300
23012007-09-21 Wojciech Polak <polak@gnu.org>
2302
2303 Add Bison XML Automaton Report.
2304
2305 Add support for an -x option to generate an XML report.
2306 It is not documented yet.
2307 * src/print-xml.c: New file.
2308 * src/print-xml.h: Likewise.
2309 * lib/timevar.def (TV_XML): New var.
2310 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
2311 * src/conflicts.c: Include print-xml.h.
2312 (solved_conflicts_xml_obstack): New var.
2313 (log_resolution, conflicts_solve, conflicts_free):
2314 Add support for XML report.
2315 (conflicts_output_val): New function.
2316 * src/conflicts.h (conflicts_output_val): New decl.
2317 * src/files.c (spec_xml_file): New var.
2318 (compute_output_file_names, output_file_names_free): Add XML support.
2319 * src/files.h (spec_xml_file): New decl.
2320 * src/getargs.c (xml_flag): New var.
2321 (usage, short_options, long_options, getargs): Add XML support.
2322 * src/getargs.h (xml_flag): New decl.
2323 * src/gram.c: Include print-xml.h.
2324 (rule_lhs_print_xml, rule_rhs_print_xml):
2325 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
2326 New functions.
2327 * src/gram.h: Declare external ones.
2328 * src/main.c: Include print-xml.h.
2329 (main): Add XML support.
2330 * src/reduce.c: Include print-xml.h.
2331 (reduce_xml): New function.
2332 * src/reduce.h: Declare it.
2333 * src/state.c: Include print-xml.h.
2334 (state_new): Add XML support.
2335 (state_rule_lookahead_tokens_print_xml): New function.
2336 * src/state.h: Declare it.
2337 (struct state): New member solved_conflicts_xml.
2338 * src/symtab.c (symbol_class_get_string): New function.
2339 * src/symtab.h: Declare it.
2340
23412007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2342
2343 * GNUmakefile: Switch to coreutils's version.
2344 * bootstrap: Likewise.
2345 * Makefile.cfg: Adjust to new GNUmakefile.
2346 * README-hacking: Likewise.
2347
2348 Import from gnulib:
2349
2350 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
2351 Bruno Haible <bruno@clisp.org>
2352
2353 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
2354 and is a script that invokes bison. Tighten the code. Add comments.
2355
23562007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
2357
2358 Spell "boolean" as "Boolean". Reported by Akim Demaille.
2359 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
2360 * doc/bison.texinfo (Decl Summary): Fix.
2361 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
2362 * tests/input.at (Boolean %define variables): Update output.
2363 * tests/skeletons.at (%define boolean variables: invalid skeleton
2364 defaults): Rename to...
2365 (%define Boolean variables: invalid skeleton defaults): ... this and
2366 update output.
2367
23682007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
2369
2370 In impure push mode, don't allow more than one yypstate to be allocated
2371 since multiple impure parsers would corrupt yynerrs.
2372 * data/push.c (yypstate_allocated): New static global variable
2373 initialized to 0.
2374 (yypull_parse): If yypstate_new returns 0, don't report it as memory
2375 exhaustion if yypstate_allocated is 1, but still return 2.
2376 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
2377 already 1. Otherwise, set it to 1.
2378 (yypstate_delete): Set it to 0.
2379 * tests/push.at (Push Parsing: Multiple impure instances): New test
2380 case.
2381
23822007-08-17 Bob Rossi <bob@brasko.net>
2383
2384 * doc/bison.texinfo (Push Decl): Document the push parser.
2385 (Table of Symbols): Ditto.
2386 (Pure Decl): Ditto.
2387 (Decl Summary): Ditto.
2388 (Multiple Parsers, Push Parser Function, Pull Parser Function,
2389 Parser Create Function, Parser Delete Function):
2390 Add new push parser symbols.
2391 (Table of Symbols): Document push-parser, push-pull-parser,
2392 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
2393
23942007-08-15 Paul Eggert <eggert@cs.ucla.edu>
2395
2396 Update to GPLv3.
2397 * doc/gpl-3.0.texi: New file.
2398 * doc/gpl.texi: Remove.
2399 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
2400 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
2401 * README-hacking, TODO, bootstrap, bootstrap.conf:
2402 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
2403 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
2404 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
2405 * data/lalr1.cc, data/lalr1.java, data/location.cc:
2406 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
2407 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
2408 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
2409 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
2410 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
2411 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
2412 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
2413 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
2414 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
2415 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
2416 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
2417 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
2418 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
2419 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
2420 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
2421 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
2422 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
2423 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
2424 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
2425 * src/complain.c, src/complain.h, src/conflicts.c:
2426 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
2427 * src/files.h, src/flex-scanner.h, src/getargs.c:
2428 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
2429 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
2430 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
2431 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
2432 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
2433 * src/print.c, src/print.h, src/print_graph.c:
2434 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
2435 * src/reduce.h, src/relation.c, src/relation.h:
2436 * src/revision.h, src/scan-code.h, src/scan-code.l:
2437 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
2438 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
2439 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
2440 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
2441 * tests/Makefile.am, tests/actions.at, tests/c++.at:
2442 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
2443 * tests/existing.at, tests/glr-regression.at:
2444 * tests/headers.at, tests/input.at, tests/java.at:
2445 * tests/local.at, tests/output.at, tests/push.at:
2446 * tests/reduce.at, tests/regression.at, tests/sets.at:
2447 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
2448 * tests/torture.at:
2449 Update to GPLv3.
2450
24512007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2452
2453 Get rid of broken %no-parser, -n, and --no-parser implementation and
2454 documentation.
2455 * TODO: Don't mention them.
2456 * doc/bison.1: Likewise.
2457 * doc/bison.texinfo (Decl Summary): Likewise.
2458 (Bison Options): Likewise.
2459 (Option Cross Key): Likewise.
2460 * src/getargs.c (no_parser_flag): Remove global variable.
2461 (usage): Don't print description of -n and --no-parser.
2462 (long_options): Remove --no-parser entry here.
2463 (getargs): Remove -n case in the switch here.
2464 * src/getargs.h (no_parser_flag): Remove extern.
2465 * tests/regression.at (Web2c Actions): Remove comment that mentions
2466 --no-parser.
2467
24682007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2469
2470 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
2471 name user variables starting with `yy'. Just pass NULL instead of a
2472 dummy local &yylval to yypush_parse.
2473 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
2474 starting with `yy'.
2475
24762007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
2477
2478 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
2479 true since it's then always used regardless of whether yyoverflow is
2480 defined. Reported by Christian Burger at
2481 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
2482 * THANKS: Add Christian Burger.
2483
2484 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
2485 node names: say "Decl Summary" not "Bison Declaration Summary".
2486
24872007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
2488
2489 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
2490 determine whether this function has already complained about an invalid
2491 value for a %define boolean variable, don't check whether Bison has
2492 ever examined the value. As written, the check was a tautology.
2493 Instead, record and check for this complaint using a separate muscle.
2494
24952007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2496
2497 Fix push parsing memory leak reported by Brandon Lucia at
2498 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
2499 * THANKS: Add Brandon Lucia.
2500 * data/push.c (yypstate_delete): Free the stack if it was reallocated
2501 but the parse never completed and thus freed it.
2502 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
2503 * tests/testsuite.at: Include push.at.
2504 * test/push.at: New.
2505 (Push Parsing: Memory Leak for Early Deletion): New test case.
2506
25072007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
2508
2509 Improve handling of multiple S/R conflicts in the same state and of S/R
2510 conflicts involving multiple reductions.
2511 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
2512 set for a state here or Bison will abort if it is reassigned on a
2513 later conflicted reduction in the same state.
2514 Similarly, don't finalize and assign the solved conflicts report here
2515 or it will be lost if it is reassigned on a later conflicted reduction
2516 in the same state.
2517 (set_conflicts): Instead, assign them both here after all S/R conflicts
2518 in the state have been fully examined.
2519 * src/print.c (shift_set): Rename to...
2520 (no_reduce_set): ... this.
2521 (print_reductions): Update for rename, and add %nonassoc error action
2522 tokens to no_reduce_set so that, when printing the first remaining
2523 reduction on an error action token, the reduction is enclosed in
2524 brackets.
2525 (print_results): Update for rename.
2526 * tests/conflicts.at (Solved conflicts report for multiple reductions
2527 in a state): New test case.
2528 (%nonassoc error actions for multiple reductions in a state): New test
2529 case.
2530
2531 * src/main.c (main): Don't depend on C99 features.
2532
25332007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
2534
2535 * build-aux/.cvsignore: Add compile.
2536 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
2537 uniwidth.
2538
25392007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
2540
2541 * bootstrap (slurp): Create target directories that don't exist.
2542 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
2543
25442007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
2545
2546 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
2547 than item number.
2548 * closure.c (closure): Likewise.
2549 * state.h (reductions): Comment sorting of rules.
2550 (state): Comment sorting of items.
2551
25522007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
2553
2554 Fix C++ test cases after recent Gnulib changes. Discussed starting at
2555 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
2556 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
2557 definition in order to avoid Gnulib headers since we don't use config.h
2558 here.
2559 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
2560 rather than AT_DATA so that config.h is included.
2561
25622007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
2563
2564 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
2565 instead of fprintf. Guard these functions with #if YYDEBUG instead of
2566 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
2567 and so that YYFPRINTF is guaranteed to be defined here.
2568
25692007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
2570
2571 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
2572 with...
2573 (muscle_percent_define_check_values): ... this more helpful function.
2574 Again, it's not used yet, but it will be.
2575 * src/muscle_tab.h: Likewise.
2576
2577 Improve some comments in parser table construction.
2578 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
2579 (generate_states): Don't mention ruleset, which is internal to closure.
2580 * src/closure.c (closure): Explain sorting of core and itemset, which
2581 is required for this function to behave correctly.
2582 * src/closure.h (closure): Mention sorting.
2583
25842007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
2585
2586 * src/lalr.c (state_lookahead_tokens_count): For code readability,
2587 move the check for disabled transitions to an aver since conflict
2588 resolution hasn't happened yet.
2589
2590 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
2591 labels a state as inconsistent just because it has error transitions.
2592 The original form of this check appeared in revision 1.1 of lalr.c,
2593 which was committed on 1991-12-21. Now (at least), changing the
2594 consistency label on such a state appears to have no useful effect in
2595 any of the places it is examined, which I enumerate below. The key
2596 point to understanding each item in this enumeration is that a state
2597 with an error transition is labelled consistent in the first place only
2598 if it has no rules, so the check cannot matter for states that have
2599 rules. (1) Labelling a state as inconsistent will cause set_conflicts
2600 to try to identify its conflicts, and a state must have *rules* to have
2601 conflicts. (2) Labelling a state as inconsistent will affect how
2602 action_row sets the default *rule* for the state. (3) Labelling a
2603 state as inconsistent will cause build_relations to add lookback edges
2604 to *rules* in that state.
2605 * src/state.h (struct state): Word the comment for member consistent
2606 more carefully.
2607
26082007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2609
2610 Don't depend on C99 features.
2611 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
2612 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
2613 * src/reader.c (check_and_convert_grammar): Fix for-loop.
2614 * src/state.c (state_mark_reachable_states): Fix for-loop.
2615 (state_remove_unreachable_states): Fix for-loop.
2616
2617 Don't widen struct state with member reachable just to temporarily
2618 record reachability. Instead, use a local bitset.
2619 * src/state.h (struct state): Remove member.
2620 * src/state.c (state_new): Don't initialize it.
2621 (state_mark_reachable_states): Rename to...
2622 (state_record_reachable_states): ... this, and use bitset.
2623 (state_remove_unreachable_states): Use bitset.
2624
26252007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
2626
2627 * src/Makefile.am (yacc): Quote target action commands properly so
2628 that the yacc script isn't corrupt. Reported by Hans Aberg at
2629 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
2630
2631 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
2632 the case of pure parsers. Reported by Frans Englich at
2633 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
2634 * THANKS: Add Frans Englich.
2635
2636 * NEWS (2.3a+): In the %code entry, reference section `Bison
2637 Declaration Summary' from the manual now since the %code summary has
2638 moved there.
2639 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
2640 in the rules section must be terminated by semicolons.
2641
26422007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
2643
2644 Extend the front-end API for %define variables to more completely
2645 mirror the back-end. This will be useful in the future.
2646 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
2647 Update comments to mention the new front-end counterparts of these
2648 macros.
2649 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
2650 for muscle_string_decode and muscle_location_decode.
2651 (muscle_string_decode): New static function.
2652 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
2653 (muscle_percent_define_get, muscle_percent_define_ifdef): New
2654 functions.
2655 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
2656 muscle_percent_define_get to mimic the b4_percent_define_flag_if
2657 implementation more closely.
2658 (muscle_percent_define_invalid_value): New function.
2659 * src/muscle_tab.h (muscle_percent_define_get,
2660 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
2661 Prototype.
2662
26632007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
2664
2665 * NEWS (2.3a+): Mention yesterday's state-removal change.
2666 (2.3a): Remove the %language entry, which was added after 2.3a.
2667 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
2668 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
2669 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
2670 tests/existing.at: Update copyright date.
2671
26722007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2673
2674 If conflict resolution makes states unreachable, remove those states,
2675 report rules that are then unused, and don't report conflicts in those
2676 states.
2677 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
2678 New global function.
2679 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
2680 function.
2681 * src/main.c (main): After conflict resolution, remove the unreachable
2682 states and update all data structures that reference states by number.
2683 * src/state.c (state_new): Initialize each state's reachable member to
2684 false.
2685 (state_mark_reachable_states): New static function.
2686 (state_remove_unreachable_states): New global function.
2687 * src/state.h (struct state): Add member bool reachable.
2688 (state_remove_unreachable_states): Prototype.
2689 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2690 New test case.
2691 * tests/existing.at (GNU pic Grammar): Update test case output now that
2692 an unused rule is discovered.
2693
26942007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2695
2696 Minor code cleanup in parser table construction.
2697 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
2698 (new_itemsets, save_reductions): Update for rename to nitemset.
2699 * src/closure.c (nritemset): Rename to...
2700 (nitemset): ... this since the "r" appears to meaningless and isn't
2701 used in the comments.
2702 (closure): Update for rename.
2703 * src/closure.h (nritemset): Update extern to...
2704 (nitemset): ... this.
2705 * src/lalr.c (LA): Fix a typo in comments.
2706 * src/print.c (print_core): Update for rename to nitemset.
2707 * src/print_graph.c (print_graph): Likewise.
2708 * src/state.h: Fix some typos in header comments.
2709
27102007-04-04 Paul Eggert <eggert@cs.ucla.edu>
2711
2712 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
2713 still sticks to ASCII. Sorry!
2714
2715 * README-hacking: New file, taken mostly from coreutils, with changes
2716 for Bison. Contains much of the contents of:
2717 * README-cvs: Remove.
2718 * bootstrap: Sync from gnulib.
2719 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
2720 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
2721
27222007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
2723
2724 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
2725 Setzer.
2726 (Java Differences): Fix some typos.
2727 * THANKS: Add Sebastian Setzer.
2728
27292007-03-07 Paolo Bonzini <bonzini@gnu.org>
2730
2731 * data/java.m4 (b4_single_class_if): Remove.
2732 (b4_abstract_if): Look at "%define abstract".
2733 (b4_lexer_if): New.
2734 (b4_union_name): Rename...
2735 (b4_yystype): ... to this. Map to "%define stype".
2736 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
2737 b4_maybe_throws): Fix quoting.
2738 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
2739 * data/lalr1.java (Lexer interface): Always define.
2740 (Lexer interface within parser class): Remove.
2741 (YYLexer class): New, used when "%code lexer" is present.
2742 (constructor): When "%code lexer" is used, pass %lex-param
2743 to the lexer constructor.
2744 (yylex, yyparse): Remove %lex-param from method invocations
2745 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
2746
2747 * doc/bison.texinfo (Java Bison Interface): Mention "%define
2748 abstract". Rename "%define union_name" to "%define stype".
2749 Rename method names according to previous patch.
2750 (Java Scanner Interface): Describe "%code lexer" instead of
2751 "%pure-parser" and "%define single_class".
2752 (Java Differences): Mention "%code lexer".
2753
2754 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
2755 Include scanner here, using macros from tests/local.at.
2756 (AT_DATA_CALC_Y): Remove final argument.
2757 (_AT_CHECK_JAVA_CALC): Likewise.
2758 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
2759 of %locations and %error-verbose.
2760 (main): Test with and without %lex-param.
2761 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
2762 (AT_BISON_OPTION_POPDEFS): Pop it.
2763
27642007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2765
2766 DJGPP spefic issue. Inhibit the use of disallowed characters for
2767 file name genertion on Win98, WinXP, etc. These are |<>":?*\
2768 and concern testsuite case 46.
2769 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
2770 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
2771 * djgpp/config.bat: Inhibit the use of disallowed characters.
2772
27732007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2774
2775 Miscellaneous %define and %code cleanup.
2776 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
2777 values are interpreted.
2778 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
2779 documentation a little more.
2780 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
2781 muscle_percent_define_insert, muscle_percent_code_grow): New
2782 functions/macros.
2783 * src/muscle_tab.h (muscle_percent_define_insert,
2784 muscle_percent_code_grow): Prototype.
2785 * src/parse-gram.y (prologue_declaration): Use
2786 muscle_percent_define_insert and muscle_percent_code_grow when parsing
2787 %define and %code directives.
2788
2789 Make it easy to share %define boolean variables between the front-end
2790 and back-end. Though not used yet, this will be useful in the future.
2791 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
2792 Bison uses of names rather than just skeleton uses of names.
2793 (b4_percent_define_get, b4_percent_define_ifdef): Rename
2794 b4_percent_define_skeleton_variables(VARIABLE) to
2795 b4_percent_define_bison_variables(VARIABLE).
2796 (b4_percent_code_get, b4_percent_code_ifdef): Rename
2797 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
2798 b4_percent_code_bison_qualifiers(QUALIFIER).
2799 (b4_check_user_names_wrap): Update for renames.
2800 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
2801 muscle_percent_define_default): New functions mimicking
2802 b4_percent_define_flag_if and b4_percent_define_default.
2803
2804 For %define variables, report locations for invalid values and
2805 redefinitions.
2806 * data/bison.m4 (b4_percent_define_flag_if): Read
2807 b4_percent_define_loc(VARIABLE) to report the location of an invalid
2808 value for VARIABLE.
2809 (b4_percent_define_default): Save a special location in
2810 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
2811 must later be reported as invalid.
2812 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
2813 functions.
2814 (muscle_percent_define_insert): Record the location of VARIABLE in
2815 muscle percent_define_loc(VARIABLE), and use it to report the previous
2816 location for a redefinition.
2817 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
2818 (muscle_percent_define_default): Update like b4_percent_define_default.
2819 (muscle_grow_user_name_list): Rename to...
2820 (muscle_user_name_list_grow): ... this for consistency and use
2821 muscle_location_grow.
2822 * src/muscle_tab.h (muscle_location_grow): Prototype.
2823 * tests/input.at (%define errors): Update expected output.
2824 * tests/skeletons.at (%define boolean variables: invalid skeleton
2825 defaults): New test case.
2826
28272007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
2828
2829 * src/print.c (lookahead_set, state_default_rule): Remove.
2830 (print_reductions): Replace state_default_rule invocation with
2831 equivalent use of yydefact, which was computed in token_actions in
2832 tables.c.
2833 (print_results): Don't allocate lookahead_set.
2834
28352007-02-27 Paolo Bonzini <bonzini@gnu.org>
2836
2837 * data/lalr1.java: Prefix all private members with yy.
2838
28392007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
2840
2841 Use YYFPRINTF instead of fprintf where appropriate. Reported by
2842 Sebastien Fricker at
2843 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
2844 * THANKS: Add Sebastien Fricker.
2845 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
2846 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
2847 accept a variable number of arguments.
2848
28492007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
2850
2851 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
2852
28532007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2854
2855 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
2856 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
2857 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
2858
28592007-02-11 Paul Eggert <eggert@cs.ucla.edu>
2860
2861 Undo my 2007-02-07 change, switching back to the c-strcase module
2862 introduced in the 2007-02-03 change. Bruno Haible reported that
2863 the 2007-02-07 change would be dangerous in Turkish if we add a
2864 language whose name contains "i", since "i" is not lowercase "I"
2865 in Turkish.
2866 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
2867 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
2868 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
2869 * m4/.cvsignore: Remove strcase.m4.
2870 * src/getargs.c: Revert 2007-02-07 change, as follows.
2871 Include c-strcase.h.
2872 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
2873
28742007-02-11 Bruno Haible <bruno@clisp.org>
2875
2876 Enable the Java related testsuite tests when the only Java compiler
2877 found is a gcj < 4.3. Discussed at
2878 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
2879 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
2880
28812007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
2882
2883 * data/Makefile.am: Update copyright date.
2884 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
2885 yypstate_new returns NULL.
2886 (yypstate_new): Return NULL if malloc does.
2887 * src/reader.c (packgram): Move translation of rule actions from the
2888 beginning of packgram to...
2889 (check_and_convert_grammar): ... here right before packgram is invoked
2890 so it's easier to write more complete comments, and remove redundant
2891 code.
2892
28932007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
2894
2895 As in semantic actions, make @$ in %initial-action, %destructor, and
2896 %printer imply %locations.
2897 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
2898 scanning @$.
2899 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
2900 (@$ in %initial-action implies %locations,
2901 @$ in %destructor implies %locations,
2902 @$ in %printer implies %locations): ... these new test cases.
2903
29042007-02-07 Paul Eggert <eggert@cs.ucla.edu>
2905
2906 Undo most of the 2007-02-03 change, switching to the strcase module
2907 now that gnulib strcase has been fixed.
2908 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
2909 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
2910 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
2911 * m4/.cvsignore: Add strcase.m4.
2912 * src/getargs.c: Revert 2007-02-03 change, as follows.
2913 Don't include c-strcase.h.
2914 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
2915 strcasecmp has "unspecified behavior" outside the POSIX locale,
2916 but it works fine in practice if at least one argument is ASCII,
2917 as is the case in Bison.
2918
29192007-02-07 Paolo Bonzini <bonzini@gnu.org>
2920
2921 * tests/java.at: Skip tests if only one of javac/java is present.
2922 Reported by Joel E. Denny.
2923 * tests/atlocal.in: Adjust copyright years.
2924
29252007-02-05 Paolo Bonzini <bonzini@gnu.org>
2926
2927 * data/lalr1.java (Stack): Work around old verifiers that disallow
2928 access to the private fields of an inner class, from the outer class.
2929 We can make Stack's fields public because user code doesn't have access
2930 to the instance of Stack used by parse(). Reported by Paul Eggert.
2931
29322007-02-03 Paul Eggert <eggert@cs.ucla.edu>
2933
2934 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
2935 the right spot for these files?
2936 * bootstrap.conf (gnulib_modules): Add c-strcase.
2937 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
2938 c-strncasecmp.c.
2939 * src/getargs.c: Include c-strcase.h.
2940 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
2941 to avoid unspecified behavior.
2942
29432007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
2944
2945 * doc/bison.texinfo (Decl Summary): Correct typo.
2946
29472007-01-30 Paolo Bonzini <bonzini@gnu.org>
2948
2949 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
2950 Complain if the value does not match empty, "true" or "false".
2951 * data/c++.m4: Adjust default definitions of %define variables.
2952 * data/java.m4: Adjust default definitions of %define variables.
2953 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
2954 to above behavior.
2955 * tests/input.at (Boolean %define variables): Test new behavior.
2956
29572007-01-29 Paolo Bonzini <bonzini@gnu.org>
2958
2959 * NEWS: Mention java.
2960 * TODO: Remove things that are done.
2961 * bootstrap.conf: Add javacomp-script and javaexec-script.
2962 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
2963
2964 * data/Makefile.am: Add new files.
2965 * data/java-skel.m4: New.
2966 * data/java.m4: New.
2967 * data/lalr1.java: New.
2968
2969 * doc/bison.texinfo: Put "A Complete C++ Example" under
2970 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
2971 under Other Languages.
2972
2973 * src/getargs.c (valid_languages): Add Java.
2974 * src/getargs.h (struct bison_language): Update size of string fields.
2975
2976 * tests/Makefile.am: Add java.at.
2977 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
2978 * tests/java.at: New.
2979 * tests/testsuite.at: Include it.
2980
29812007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
2982
2983 Clean up.
2984 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
2985 at_directive_argv arguments so these no longer have to be global
2986 variables. Also, update the implementation for the following changes.
2987 (fail_for_at_directive_too_many_args,
2988 fail_for_at_directive_too_few_args): Add at_directive_name argument.
2989 (at_directive_name): Remove as at_directive_argv[0] will be used for
2990 this now.
2991 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
2992 for the directive name.
2993 (at_directive_argc, at_directive_argv): Make these local within
2994 skel_lex instead of global.
2995 (INITIAL): Update directive start action for above changes.
2996 (SC_AT_DIRECTIVE_ARG): Rename to...
2997 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
2998 (SC_AT_DIRECTIVE_SKIP_WS): Update.
2999 (scan_skel): Move yylex_destroy to...
3000 (skel_scanner_free): ... here.
3001 * tests/skeletons.at (installed skeleton file name): Rename to...
3002 (installed skeleton file names): ... this.
3003
30042007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
3005
3006 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3007 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
3008 Summary" not "Directives".
3009 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
3010 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
3011 since the former is now the more complete one.
3012 (Prologue Alternatives): Likewise and do the same for %defines.
3013 (Table of Symbols): Add summary of %code, add summary of %define, and
3014 move full %code documentation to...
3015 (Decl Summary): ... here for consistency with other entries in these
3016 sections.
3017 Move %define entry in order to keep this list alphabetized.
3018 Reword %define entry a little to put less emphasis on the skeleton
3019 concept, which most users shouldn't have to think about.
3020
30212007-01-26 Paul Eggert <eggert@cs.ucla.edu>
3022
3023 Adjust to recent gnulib changes.
3024 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
3025 Add string.h, string_.h, unistd_.h, wchar_.h.
3026 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
3027 * src/system.h: Don't include <stpcpy.h>; this is now done by
3028 <string.h>.
3029
30302007-01-23 Paolo Bonzini <bonzini@gnu.org>
3031
3032 Simplify implementation of unqualified %code, implement macros for
3033 uniform treatment of boolean %define flags. Document %define.
3034 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
3035 b4_percent_code_ifdef): New.
3036 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
3037 * data/c++.m4: Define default value for global_tokens_and_yystype.
3038 * data/glr.cc: Likewise.
3039 * data/location.cc: Use b4_percent_define_flag_if.
3040
3041 * doc/bison.texinfo (Decl Summary): Document %define.
3042
3043 * src/parse-gram.y (Unqualified %code): Change muscle name to
3044 b4_percent_code().
3045 (content.opt): Default to empty.
3046
30472007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3048
3049 Implement support for relative and absolute skeleton file names.
3050 Discussed starting at
3051 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
3052 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
3053 (Bison Options): Document in --skeleton entry.
3054 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
3055 full_skeleton can't necessarily hold all of pkgdatadir.
3056 If the specified skeleton file name contains a `/', don't prepend
3057 pkgdatadir.
3058 * src/parse-gram.y (prologue_declaration): If the specified skeleton
3059 file name contains a `/', prepend the grammar file directory.
3060 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
3061 * skeletons.at: New file.
3062 (relative skeleton file names): New test case.
3063 (installed skeleton file names): New test case.
3064 * tests/testsuite.at: Include skeletons.at.
3065
3066 * bootstrap: Update copyright to 2007.
3067
30682007-01-17 Paolo Bonzini <bonzini@gnu.org>
3069
3070 * bootstrap: Remove occurrences of .#bootmp from the files.
3071
30722007-01-17 Akim Demaille <akim@epita.fr>
3073
3074 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
3075 nonterminals.
3076 Use per-type %printer.
3077
30782007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3079
3080 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
3081 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3082 djgpp/config.site, src/files.c, src/files.h, src/main.c,
3083 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
3084 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
3085 tests/glr-regression.at, tests/input.at, tests/local.at,
3086 tests/output.at, tests/torture.at: Update copyright to 2007.
3087
30882007-01-16 Akim Demaille <akim@epita.fr>
3089
3090 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
3091 error code.
3092 (Calc++ Scanner): Exit with failure if we can't open the input
3093 file.
3094 Accept "-" standing for stdin.
3095 (Calc++ Top Level): Print the result only if the parsing was
3096 successful.
3097
30982007-01-16 Akim Demaille <akim@epita.fr>
3099
3100 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
3101
31022007-01-15 Paolo Bonzini <bonzini@gnu.org>
3103 and Joel E. Denny <jdenny@ces.clemson.edu>
3104
3105 Clean up %define and %code implementation in M4 some. Most
3106 importantly, rename all related macros to be in the b4_percent_define
3107 and b4_percent_code namespaces. Also, complete support for `.' in
3108 %define variable names and %code qualifiers.
3109 * data/bison.m4 (b4_check_user_names): Check for special
3110 "SKELETON-NAMESPACE(name)" macros instead of using two nested
3111 m4_foreach loops.
3112 (b4_get_percent_define, b4_get_percent_code): Rename to...
3113 (b4_percent_define_get, b4_percent_code_get): ... these.
3114 Extend documentation with examples.
3115 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
3116 b4_percent_define_skeleton_variables and
3117 b4_percent_code_skeleton_qualifiers.
3118 Expect any value for the %define variable `foo' to be stored in the
3119 macro named `b4_percent_define(foo)'; expect any %code blocks for the
3120 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
3121 expect any unqualified %code blocks to be stored in a macro named
3122 `b4_percent_code_unqualified'.
3123 Use m4_indir so that %define variable names and %code qualifiers can
3124 contain `.', which is allowed by the grammar parser.
3125 (b4_percent_define_default): New macro to set a default value for a
3126 %define variable.
3127 (m4_wrap): Update wrapped code, and fix some underquoting.
3128 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
3129 Expect grammar uses of %define variables and %code qualifiers to be
3130 defined in b4_percent_define_user_variables and
3131 b4_percent_code_user_qualifiers.
3132 * data/c++.m4: Use b4_percent_define_default rather than
3133 m4_define_default. Fix some underquoting. Skeleton usage of %define
3134 variable define_location_comparison now implies skeleton usage of
3135 %define variable filename_type.
3136 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3137 data/push.c, data/yacc.c: Update macro names.
3138 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
3139 muscle names.
3140
31412007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3142
3143 DJGPP specific issues.
3144
3145 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
3146 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
3147
31482007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3149
3150 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
3151 run parsers in all tests so that Valgrind is invoked during
3152 maintainer-check-valgrind.
3153 (Duplicate representation of merged trees): Free all semantic values.
3154 (Duplicated user destructor for lookahead): Likewise.
3155
31562007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3157
3158 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
3159 command-line prefix.
3160 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
3161 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
3162 miss Valgrind messages.
3163 (Exploding the Stack Size with Malloc): Likewise.
3164
31652007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3166
3167 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
3168 locals. Reported by Juan Manuel Guerrero at
3169 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
3170 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
3171 Fix some indentation also.
3172 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
3173 explaining this issue.
3174
31752007-01-09 Paolo Bonzini <bonzini@gnu.org>
3176 and Joel E. Denny <jdenny@ces.clemson.edu>
3177
3178 Simplify union and prologue handling, and escape union and lex/parse
3179 params with digraphs.
3180 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
3181 values to the empty string since these are no longer guaranteed
3182 initialized by the front-end.
3183 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
3184 braces around b4_user_stype since this is no longer done by the
3185 front-end.
3186 * src/files.c, src/files.h (pre_prologue_obstack,
3187 post_prologue_obstack): Remove.
3188 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
3189 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
3190 with digraphs. This fixes lex params and parse params.
3191 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
3192 * src/output.c (prepare): Remove muscle insertion of the prologues.
3193 (output): Remove freeing of pre_prologue_obstack and
3194 post_prologue_obstack.
3195 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
3196 than prologue_augment for prologue parsing so you don't need prologue
3197 obstacks.
3198 (grammar_declaration): For %union RHS, use `braceless' instead of
3199 "{...}" so that braces are already stripped and code is escaped with
3200 digraphs.
3201 * src/reader.c (prologue_augment): Remove.
3202 (reader): Remove initialization of pre_prologue_obstack and
3203 post_prologue_obstack.
3204 * src/reader.h (prologue_augment): Remove.
3205
3206 * data/c.m4: Remove stray parenthesis.
3207
32082007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3209
3210 Remove quotes from variables names in %define directives and from
3211 qualifiers in %code directives, and restrict the characters that are
3212 allowed in them to M4-friendly ones. For %define, continue to support
3213 the quoted form as a deprecated feature. Discussed starting at
3214 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
3215 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
3216 %code.
3217 * doc/bison.texinfo (Prologue Alternatives): Update.
3218 (Decl Summary): In %defines entry, update mention of `%code requires'
3219 and `%code provides'.
3220 (C++ Location Values): Update %define uses.
3221 (Calc++ Parser Interface): Likewise.
3222 (Calc++ Parser): Likewise, and update `%code requires' uses.
3223 (Table of Symbols): Update %code documentation.
3224 * src/parse-gram.y (prologue_declaration): For %define variables, use
3225 `variable' instead of `STRING'.
3226 (grammar_declaration): For %code qualifiers, use `ID' instead of
3227 `STRING'.
3228 (variable): New nonterminal that takes an `ID' or a `STRING'.
3229 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
3230 and %define uses.
3231 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
3232 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
3233 (%define errors): Update %define uses.
3234
32352007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3236
3237 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
3238 instead of muscle_insert for %define values so that M4-special
3239 characters are replaced with digraphs.
3240 * tests/input.at (%define errors): Extend to check weird values.
3241
32422007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3243
3244 Instead of having skeletons declare all valid %define variables and
3245 %code qualifiers, provide macros that retrieve the associated values
3246 and build these lists automatically. Thus Bison will now warn when a
3247 variable or qualifier is not used by the skeleton in the current
3248 invocation regardless of whether it might sometimes be used by that
3249 skeleton in other invocations. Also, move all %define value macros to
3250 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
3251 form, which is replaced by %code.
3252 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
3253 (b4_check_user_names): ... this, and change the series of valid name
3254 arguments to a single list argument for names used in the skeleton
3255 similar to the existing list argument for names used in the grammar.
3256 Warn instead of complaining.
3257 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
3258 values and %code code, to format %code code properly, and to build
3259 lists of all %define variables and %code qualifiers used in the
3260 skeleton: b4_skeleton_percent_define_variables and
3261 b4_skeleton_percent_code_qualifiers.
3262 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
3263 Remove, and...
3264 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
3265 the skeleton names lists can finish building first. In place of
3266 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
3267 expect the lists b4_user_percent_define_variables and
3268 b4_user_percent_code_qualifiers.
3269 * data/c++.m4: Where setting default values for b4_parser_class_name,
3270 b4_location_type, b4_filename_type, b4_namespace, and
3271 b4_define_location_comparison, update their names to the
3272 b4_percent_define_ namespace.
3273 * data/glr.c: Don't use b4_check_percent_define_variables and
3274 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3275 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
3276 (b4_parser_class_name, b4_namespace): Define these using
3277 b4_get_percent_define for parser_class_name and namespace.
3278 * data/location.cc: Use b4_get_percent_define.
3279 * data/push.c: Don't use b4_check_percent_define_variables and
3280 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3281 * data/yacc.c: Likewise, and don't call m4_exit in
3282 b4_use_push_for_pull_if or m4_wrap code will never execute.
3283 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
3284 Rename to...
3285 (muscle_grow_user_name_list): ... this for consistency with the
3286 terminology used in bison.m4.
3287 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
3288 %define variable names, and rename muscle used_percent_define_variables
3289 to user_percent_define_variables.
3290 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
3291 user_percent_code_qualifiers.
3292 (content): Remove.
3293 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
3294 {CODE} form is no longer accepted.
3295 * tests/input.at (Reject bad %code qualifiers): Rename to...
3296 (Reject unused %code qualifiers): ... this, and update test output.
3297 (%define error): Update test output.
3298
32992007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
3300
3301 Check for unrecognized %define variables similar to checking for
3302 unrecognized %code qualifiers. Check for redefined %define variables.
3303 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
3304 generalizes...
3305 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
3306 (b4_check_percent_define_variables): New, also wraps it.
3307 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
3308 variables using b4_check_percent_define_variables.
3309 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
3310 all those exercised in the test suite and all those listed in the
3311 `Default values' section of c++.m4. Are there others?
3312 * data/push.c, data/yacc.c: Declare no valid %define variables.
3313 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
3314 similar to muscle_find, but it works even when the muscle stores a
3315 const value.
3316 (muscle_grow_used_name_list): New function for constructing the used
3317 name list muscles that b4_check_for_unrecognized_names requires.
3318 * src/parse-gram.y (prologue_declaration): Warn if a variable is
3319 %define'd more than once. Define the b4_used_percent_define_variables
3320 muscle with muscle_grow_used_name_list.
3321 (grammar_declaration): Abbreviate %code code with
3322 muscle_grow_used_name_list.
3323 * tests/input.at (%define errors): New.
3324
33252007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3326
3327 Provide warn_at, complain_at, and fatal_at function callbacks to the
3328 skeletons, and use this for %code qualifier complaints.
3329 * data/bison.m4 (b4_error_at): New, invoked by...
3330 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
3331 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
3332 @fatal_at(...@) directives.
3333 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
3334 qualifiers in b4_used_percent_code_qualifiers and to use
3335 b4_complain_at.
3336 * src/location.c, src/location.h (boundary_set_from_string): New global
3337 function.
3338 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
3339 function.
3340 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
3341 to b4_used_percent_code_qualifiers.
3342 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
3343 function.
3344 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
3345 (lineno): Rename to...
3346 (out_lineno): ... this so I don't misunderstand it again.
3347 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
3348 here; these newlines are in the input but not the output file.
3349 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
3350 (at_directive_perform): ... this new static function, and add handling
3351 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
3352 directives.
3353 * tests/input.at (Reject bad %code qualifiers): Update test output with
3354 locations and extend.
3355
3356 * tests/output.at (Output file name: [, Output file name: ]): Remove
3357 bogus comment about these tests failing.
3358
33592007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3360
3361 Clean up b4_check_percent_code_qualifiers a little.
3362 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
3363 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
3364 documentation and add examples.
3365 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
3366 qualifiers here.
3367
33682007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
3369
3370 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
3371 unreliable -- especially when they're hidden inside another macro.
3372 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
3373 data/c.m4: Remove m4_divert(-1).
3374 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3375 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
3376 m4_divert_push(0) and m4_divert_pop(0).
3377 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
3378 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
3379 pushed and popped by m4sugar, should be first on the stack.
3380
3381 Provide warn, complain, and fatal function callbacks to the skeletons.
3382 This provides more flexibility than m4_fatal, improves the error
3383 message format, and captures messages for translation. Discussed
3384 starting at
3385 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
3386 * data/bison.m4 (b4_error): New, invoked by...
3387 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
3388 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
3389 directives. Because these M4 macros might be called when the current
3390 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
3391 the previous removal of uses of m4_divert, which caused trouble.
3392 (b4_check_percent_code_qualifiers): Use b4_complain instead of
3393 m4_fatal to report unrecognized %code qualifiers.
3394 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
3395 push parser requests.
3396 * data/glr.c: Use b4_complain instead of m4_fatal to report
3397 non-deterministic push parser requests.
3398 Update @output usage to @output(...@) form.
3399 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
3400 report missing %defines. Update @output usage to @output(...@) form.
3401 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
3402 @output(...@) form.
3403 * src/main.c (main): Invoke skel_scanner_free.
3404 * src/scan-skel.h (skel_scanner_free): Prototype new function.
3405 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
3406 obstack_for_string from flex-scanner.h.
3407 (YY_DECL): Use to declare skel_lex static.
3408 (decode_at_digraphs): Remove; now handled in the new
3409 SC_AT_DIRECTIVE_ARG start condition.
3410 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
3411 functions.
3412 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
3413 at_directive_argv): New static globals.
3414 (INITIAL): Use fail_for_invalid_at.
3415 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
3416 recognize the start of a generalized `@directive(...@)' form and
3417 start...
3418 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
3419 directive args (using the new obstack_for_string), to decode the
3420 contained @ diagraphs, and to perform the directive. It recognizes
3421 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
3422 @output(...@).
3423 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
3424 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
3425 `@,'.
3426 (scan_skel): Initialize obstack_for_string on the first call.
3427 (skel_scanner_free): New function to free obstack_for_string.
3428 * tests/input.at (Reject bad %code qualifiers): Update test output.
3429
34302007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
3431
3432 Consolidate the 4 prologue alternative directives (%code, %requires,
3433 %provides, and %code-top) into a single %code directive with an
3434 optional qualifier field. Discussed at
3435 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
3436 * NEWS (2.3a+): Rewrite the existing entry for the prologue
3437 alternatives.
3438 * doc/bison.texinfo (Prologue Alternatives): Update.
3439 (Decl Summary): Update to %code "requires" and %code "provides".
3440 (Calc++ Parser): Update to %code "requires".
3441 (Table of Symbols): Remove entries for %requires, %provides, and
3442 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
3443 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
3444 are replaced by b4_percent_code_provides and b4_percent_code_requires,
3445 which are skeleton-specific.
3446 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
3447 declare what %code qualifiers it supports and to complain if any other
3448 qualifiers were used in the grammar.
3449 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
3450 and b4_user_code([b4_percent_code_provides]) in place of
3451 b4_user_requires and b4_user_provides.
3452 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
3453 Add b4_user_code([b4_percent_code_top]) and
3454 b4_user_code([b4_percent_code]).
3455 Invoke b4_check_percent_code_qualifiers.
3456 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3457 PERCENT_REQUIRES): Remove.
3458 (grammar_declaration): Remove RHS's for %code-top, %provides, and
3459 %requires. Rewrite the %code RHS as the unqualified form defining the
3460 muscle b4_percent_code. Add another RHS for the qualified %code form,
3461 which defines muscles of the form b4_percent_code_QUALIFIER and the
3462 b4_used_percent_code_qualifiers muscle.
3463 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3464 PERCENT_REQUIRES): Remove.
3465 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
3466 %code "requires" and %code "provides".
3467 * tests/input.at (Reject bad %code qualifiers): New.
3468
34692007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3470
3471 Use the new code_props interface for destructors and printers.
3472 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
3473 printer_location members, and change the type of the destructor and
3474 printer members to code_props.
3475 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
3476 symbol_printer_get, semantic_type_destructor_set,
3477 semantic_type_printer_set, default_tagged_destructor_set,
3478 default_tagless_destructor_set, default_tagged_printer_set,
3479 default_tagless_printer_set): Use code_props in arguments and return
3480 types in place of char const * and location.
3481 (symbol_destructor_location_get, symbol_printer_location_get): Remove
3482 since the locations are now contained in the return of
3483 symbol_destructor_get and symbol_printer_get.
3484 * src/output.c (symbol_destructors_output, symbol_printers_output):
3485 Replace with...
3486 (symbol_code_props_output): ... this to eliminate duplicate code.
3487 (output_skeleton): Update to use symbol_code_props_output.
3488 * src/reader.c (symbol_should_be_used): Update use of
3489 symbol_destructor_get.
3490 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3491 Update uses of the various _destructor_set and _printer_set functions.
3492 * src/symtab.c: (default_tagged_destructor_location,
3493 default_tagless_destructor_location, default_tagged_printer_location,
3494 default_tagless_printer_location): Remove since we...
3495 (default_tagged_destructor, default_tagless_destructor,
3496 default_tagged_printer, default_tagless_printer): ... change the type
3497 of these to code_props.
3498 (symbol_new, semantic_type_new, symbol_destructor_set,
3499 semantic_type_destructor_set, symbol_destructor_get,
3500 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
3501 symbol_check_alias_consistency, default_tagged_destructor_set,
3502 default_tagless_destructor_set, default_tagged_printer_set,
3503 default_tagless_printer_set): Update.
3504 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
3505 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
3506 code_props members.
3507 (symbol_print): Use SYMBOL_CODE_PRINT.
3508
35092007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3510
3511 Use the new code_props interface for rule actions.
3512 * src/symlist.h (symbol_list): Replace action, action_location, and
3513 used members with a code_props action_props member.
3514 * src/reader.c (symbol_should_be_used, grammar_rule_check,
3515 grammar_midrule_action, grammar_current_rule_merge_set,
3516 grammar_current_rule_symbol_append, packgram): Update.
3517 * src/scan-code.h (translate_rule_action): Remove, no longer used.
3518 * src/scan-code.l (handle_action_dollar): Update.
3519 (translate_rule_action): Remove, no longer used.
3520 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
3521
35222007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3523
3524 Use the new code_props interface in parse-gram.y.
3525 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
3526 Update all uses of translate_* functions to use the new code_props
3527 interface and to use gram_scanner_last_string_free and
3528 code_scanner_last_string_free where possible.
3529 (grammar_declaration): symbol_list_destructor_set and
3530 symbol_list_printer_set now perform the translation, so don't do it
3531 here. Use gram_scanner_last_string_free where possible.
3532 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
3533 translate_code): Remove, no longer used.
3534 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
3535 symbol_list_printer_set): Perform code translation here rather than
3536 depending on the caller to do so.
3537
3538 * src/symlist.h (struct symbol_list): Correct some documentation typos.
3539 * src/scan-gram.h (gram_last_string): Remove declaration.
3540 * src/scan-gram.l (last_string): Declare it static.
3541
35422007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3543
3544 Encapsulate code properties and related functionality for the various
3545 destructors, printers, and actions into a code_props structure and
3546 interface. This patch merely implements code_props in scan-code.h and
3547 scan-code.l. Future patches will rewrite other modules to use it.
3548 Discussed starting at
3549 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
3550 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
3551 consistently initialize const structs that have an empty location
3552 field.
3553 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
3554 to ensure consistency.
3555 * src/scan-code.h (code_props): New structure.
3556 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
3557 function, macro, and const global variable for initializing a
3558 code_props with no code.
3559 (code_props_plain_init, code_props_symbol_action_init,
3560 code_props_rule_action_init, code_props_translate_code): The rest of
3561 the new code_props functional interface. Among other things, the init
3562 functions set the code_props kind field so that
3563 code_props_translate_code will know whether to behave like
3564 translate_symbol_action, translate_rule_action, or translate_code.
3565 These old translate functions must remain until all other modules are
3566 updated to use the new code_props interface.
3567 (code_scanner_last_string_free): New function similar to
3568 gram_scanner_last_string_free.
3569 (code_scanner_free): Add documentation.
3570 * src/scan-code.l: Implement the new interface.
3571 (code_lex): Make it static, add a code_props* argument, and remove the
3572 rule argument.
3573 (last_string): New static global similar to the one in scan-gram.l.
3574 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
3575 instead of rule.
3576 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
3577 code_props since Bison may one day use this information for destructors
3578 and printers.
3579 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
3580 (handle_action_dollar): Use symbol_list_n_get and set used flag
3581 directly since symbol_list_n_used_set is removed.
3582 (translate_action): Add a code_props* argument and remove the rule,
3583 action, and location arguments. Pass the code_props* on to code_lex.
3584 (translate_rule_action, translate_symbol_action, translate_code):
3585 Rewrite as wrappers around the new code_props interface.
3586 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
3587 it would eventually need to break the encapsulation of code_props.
3588
35892007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3590
3591 * etc/.cvsignore: New.
3592
35932007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3594
3595 Add maintainer-push-check to run maintainer-check using push parsing in
3596 place of pull parsing where available.
3597 * Makefile.am (maintainer-push-check): New.
3598 * data/bison.m4 (b4_use_push_for_pull_if): New.
3599 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
3600 appropriately based on their existing values.
3601 (yypush_parse): Don't print push-parser-specific diagnostics if push
3602 parsing is being used in place of pull parsing.
3603 * data/yacc.c: If push parsing should replace pull parsing, redirect to
3604 push.c.
3605 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
3606 variable, and insert b4_use_push_for_pull_flag into muscles.
3607 * tests/Makefile.am (maintainer-push-check): New.
3608
36092006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
3610
3611 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
3612 (whether successful or failed) so that yypush_parse can be invoked
3613 again to start a new parse using the same yypstate.
3614 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
3615 check multiple yypull_parse invocations on the same yypstate. For pull
3616 mode, extend to check multiple yyparse invocations.
3617 (Exploding the Stack Size with Alloca): Extend to try with
3618 %push-pull-parser.
3619 (Exploding the Stack Size with Malloc): Likewise.
3620
3621 * tests/calc.at (Simple LALR Calculator): Don't specify
3622 %skeleton "push.c" since %push-pull-parser implies that now.
3623 * tests/headers.at (export YYLTYPE): Don't check for the push
3624 declarations. Otherwise, this test case can't be used to see if push
3625 mode can truly emulate pull mode.
3626 * tests/input.at (Torturing the Scanner): Likewise.
3627 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
3628 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
3629 AT_YACC_IF, which now includes the case of push mode since %skeleton
3630 need not be used for push mode. This will be more intuitive once
3631 push.c is renamed to yacc.c.
3632
36332006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
3634
3635 For push mode, convert yyparse from a macro to a function, invoke yylex
3636 instead of passing a yylexp argument to yypull_parse, and don't
3637 generate yypull_parse or yyparse unless %push-pull-parser is declared.
3638 Discussed starting at
3639 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
3640 * data/bison.m4 (b4_pull_if): New.
3641 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
3642 * data/push.c: Improve M4 quoting a little.
3643 (b4_generate_macro_args, b4_parenthesize): Remove.
3644 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
3645 any time a pull parser is requested.
3646 Don't #define this as a wrapper around yypull_parse. Instead, when
3647 both push and pull are requested, make it a function that does that
3648 same thing.
3649 (yypull_parse): If there's a b4_prefix, #define this to
3650 b4_prefix[pull_parse] when both push and pull are requested.
3651 Don't define this as a function unless both push and pull are
3652 requested.
3653 Remove the yylexp argument and hard-code yylex invocation instead.
3654 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
3655 %push-parser.
3656 * src/getargs.c (pull_parser): New global initialized to true.
3657 * getargs.h (pull_parser): extern it.
3658 * src/output.c (prepare): Insert pull_flag muscle.
3659 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
3660 (prologue_declaration): Set both push_parser and pull_parser = true for
3661 %push-pull-parser. Set push_parser = true and pull_parser = false for
3662 %push-parser.
3663 * src/scan-gram.l: Don't accept %push_parser as an alternative to
3664 %push-parser since there's no backward-compatibility concern here.
3665 Scan %push-pull-parser.
3666 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
3667 instead of %push-parser.
3668 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
3669 prototype it in the module that calls yyparse.
3670 * tests/input.at (Torturing the Scanner): Likewise.
3671 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
3672
36732006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
3674
3675 Update etc/bench.pl. Optimize push mode a little (the yyn change
3676 deserves most of the credit).
3677 * Makefile.am (SUBDIRS): Add etc subdirectory.
3678 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
3679 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
3680 yytoken, yyval, and yyloc declarations to...
3681 (yyparse or yypush_parse): ... here to improve performance. For
3682 yypush_parse invocations after the first, be sure to assign yyn its old
3683 value again.
3684 (yypstate_new): Don't bother initializing the yyresult field since the
3685 initial value isn't used.
3686 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
3687 remove the #define that, in push mode, set it to yyps->NAME.
3688 * etc/Makefile.am: New.
3689 * etc/bench.pl: Remove and build it instead from...
3690 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
3691 "tests/bison" from the build directory by default rather than just
3692 invoking "bison" from $PATH.
3693 (calc_grammar): Update push parser code: don't declare yylval globally,
3694 don't define yyparse_wrapper, and don't #define yyparse.
3695 (bench_grammar): Update to check all working combinations of yacc.c,
3696 push.c, impure, pure, pull, and push.
3697
36982006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
3699
3700 For push mode, add pull wrappers around yypush_parse.
3701 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
3702 (yypull_parse): New function wrapping yypush_parse.
3703 (yyparse): New #define wrapping yypull_parse.
3704 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
3705 is declared.
3706 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
3707 prototype yylex in the module that calls yyparse, and don't prototype
3708 yyparse there. Otherwise, the yyparse expansion won't compile.
3709 * tests/input.at (Torturing the Scanner): Likewise.
3710
37112006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
3712
3713 Enable push parsers to operate in impure mode. Thus, %push-parser no
3714 longer implies %pure-parser. The point of this change is to move
3715 towards being able to test the push parser code by running the entire
3716 test suite as if %push-parser had been declared.
3717 * data/push.c (yypush_parse): For impure mode, remove the
3718 yypushed_char, yypushed_val, and yypushed_loc arguments.
3719 Instead, declare these as local variables initialized to the global
3720 yychar, yylval, and yylloc.
3721 For the first yypush_parse invocation only, restore the initial values
3722 of these global variables when it's time to read a token since they
3723 have been overwritten.
3724 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
3725 %push-parser.
3726 * tests/calc.at (Simple LALR(1) Calculator): Always declare
3727 %pure-parser along with %push-parser since this test case was designed
3728 for pure push parsers.
3729 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
3730 (AT_YACC_OR_PUSH_IF): New.
3731 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
3732 add a note that it's still wrong for some cases (as it has been for a
3733 while).
3734 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
3735 %push-parser no longer implies %pure-parser.
3736
37372006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
3738
3739 Remove some unnecessary differences between the pull parser code and
3740 the push parser code. This patch enables yynerrs in push mode.
3741 * data/push.c: Reformat M4 a little.
3742 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
3743 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
3744 because push mode is on. Instead, if pure mode is on, move yynerrs
3745 to...
3746 (b4_declare_parser_state_variables): ... here.
3747 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
3748 to yyps->NAME so it can be used in yypush_parse.
3749 (yypush_parse): Don't omit uses of yynerrs in push mode.
3750
37512006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
3752
3753 Fix bug such that the first pushed token's value and location are
3754 sometimes overwritten (sometimes by %initial-action) before being used.
3755 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
3756 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
3757 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
3758 more closely mimic the pull parser logic.
3759 Don't copy the pushed token to yychar, yylval, and yylloc until it's
3760 time to read a token, which is after any initialization of yylval and
3761 yylloc.
3762 (gottoken): Rename label to...
3763 (yyread_pushed_token): ... for clarity and to avoid infringing on the
3764 user namespace.
3765
37662006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
3767
3768 Rearrange initialization of the parser state variables so that the
3769 skeleton doesn't have to have a copy for pull mode and another for push
3770 mode. This patch also fixes at least a bug such that yylloc was not
3771 initialized (with b4_location_initial_line and
3772 b4_location_initial_column) upon calling yypush_parse. However, that
3773 initialization now overwrites the first token's location;
3774 %initial-action assigning @$ already did the same thing, and both bugs
3775 will be fixed in a later patch.
3776 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
3777 (b4_declare_parser_state_variables): Remove initialization of yytoken,
3778 yyss, yyvs, yyls, and yystacksize.
3779 (yypstate_new): Remove initialization of some yypstate fields: yystate,
3780 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
3781 yylsp.
3782 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
3783 yyps->NAME so it can be used in yypush_parse.
3784 (yyparse or yypush_parse): For yypush_parse, don't print the
3785 "Starting parse" diagnostic for invocations after the first.
3786 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
3787 yypush_parse, only do it for the first invocation.
3788 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
3789 initialization to occur in yypush_parse but only on the first
3790 invocation.
3791
37922006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
3793
3794 * data/push.c: Add CPP guards around push parser declarations in both
3795 the header and the code file.
3796 In the code file, move the push parser declarations to the same place
3797 they appear in the header file.
3798 Clean up the M4 some, especially the inconsistent underquoting in
3799 some b4_c_function_def and b4_c_function_decl uses.
3800
38012006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
3802
3803 Encapsulate the push parser state variables into an M4 macro so the
3804 push skeleton doesn't have to list them again for pull mode's yyparse.
3805 For push mode, remove yypush_parse's local equivalents of these
3806 variables to eliminate unnecessary copying between the two sets at
3807 run-time. This patch also fixes at least a bug related to multiple
3808 %initial-action invocations in push mode.
3809 * data/push.c (b4_declare_parser_variables): Rename to...
3810 (b4_declare_scanner_communication_variables): ... this for clarity and
3811 update both uses.
3812 (b4_declare_yyparse_variables): Remove and move its contents to the one
3813 spot where it was invoked.
3814 (b4_declare_parser_state_variables): New macro containing the parser
3815 state variables required by push mode.
3816 (struct yypstate): Replace all fields but yynew with
3817 b4_declare_parser_state_variables.
3818 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
3819 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
3820 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
3821 (yyparse or yypush_parse): For yyparse in pull mode, replace local
3822 parser state variable declarations with
3823 b4_declare_parser_state_variables.
3824 Don't initialize parser state variables when calling yypush_parse since
3825 yypstate_new already does that.
3826 Invoke the user's initial action only upon the first yypush_parse
3827 invocation.
3828 Remove all code that copies between the local parser state variables
3829 and the yypstate.
3830
38312006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
3832
3833 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
3834 prevent a name collision in a future patch where these names will
3835 sometimes be #define'd.
3836 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
3837 since it no longer has the same name as the existing argument.
3838 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
3839
38402006-12-19 Paolo Bonzini <bonzini@gnu.org>
3841 and Joel E. Denny <jdenny@ces.clemson.edu>
3842
3843 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
3844 that the argument is case-insensitive, and there's no `=' here.
3845 For the %skeleton entry, mention that %language is better.
3846 (Bison Options): Likewise for --language and --skeleton. Move the
3847 --skeleton entry so that the `Tuning the parser' section is sorted
3848 alphabetically on long options.
3849 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
3850 %language directive in detail here; cross-reference the %language
3851 documentation instead.
3852 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
3853 `%require "2.3b"' so that the example is always up-to-date.
3854 (Table of Symbols): Add entries for %language and %skeleton.
3855 * examples/extexi (normalize): Instead of replacing every %require
3856 argument with the current Bison version, just substitute for
3857 `@value{VERSION}'. This guarantees that we're testing what actually
3858 appears in the documentation.
3859 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
3860 rather than `@VERSION@'.
3861
38622006-12-18 Paul Eggert <eggert@cs.ucla.edu>
3863
3864 * NEWS: Reword the %language news a bit, and put it earlier.
3865
3866 * src/getargs.c (skeleton_arg): Last arg is now location const *.
3867 Rewrite to simplify the logic.
3868 (language_argmatch): Likewise.
3869 (program_name): We now own this var.
3870 * src/getargs.h (struct bison_language): Use char[] rather than
3871 const char *.
3872
3873 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
3874 Java is supported.
3875 * src/complain.c (program_name): Remove decl; no longer needed.
3876 * src/main.c (program_name): Remove; now belongs to getargs.
3877
38782006-12-18 Paolo Bonzini <bonzini@gnu.org>
3879
3880 * NEWS: Document %language.
3881
3882 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
3883
3884 * data/c-skel.m4, data/c++-skel.m4: New files.
3885 * data/glr.c: Complain on push parsers.
3886
3887 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
3888 over %skeleton.
3889 (Decl Summary): Document %language and %skeleton.
3890 (Command line): Document -L.
3891
3892 * examples/extexi: Rewrite %require directive.
3893 * examples/calc++/Makefile.am: Pass VERSION to extexi.
3894
3895 * src/files.c (compute_exts_from_gc): Look in language structure
3896 for .y extension.
3897 (compute_file_name_parts): Check whether .tab should be added.
3898 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
3899 (language, skeleton_arg, language_argmatch): New.
3900 (long_options): Add --language.
3901 (getargs): Use skeleton_arg, add -L/--language.
3902 * src/getargs.h: Include location.h.
3903 (struct bison_language, language, skeleton_arg, language_argmatch): New.
3904 * src/output.c (prepare): Pick default skeleton from struct language.
3905 Don't dispatch C skeletons here.
3906 * src/parse-gram.y (PERCENT_LANGUAGE): New.
3907 (prologue_declaration): Add "%language" rule, use skeleton_arg.
3908 * src/scan-gram.l ("%language"): New rule.
3909
3910 * tests/calc.at: Test %skeleton and %language.
3911 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
3912 (AT_GLR_IF): Look for %skeleton "glr.cc".
3913 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
3914 (AT_YACC_IF): Reject %language.
3915
39162006-12-18 Paul Eggert <eggert@cs.ucla.edu>
3917
3918 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
3919 since it wasn't used; only the typedef name 'semantic_type' is needed.
3920 Also, omit trailing white space.
3921
3922 * bootstrap: Sync from coreutils.
3923 (gnulib_extra_files): Add build-aux/announce.gen.
3924 (slurp): Adjust .gitignore files like .cvsignore files.
3925 * build-aux/announce-gen: Remove from CVS, since bootstrap
3926 now creates this.
3927
39282006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
3929
3930 Make %push-parser imply %pure-parser. This fixes several bugs; see
3931 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
3932 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
3933 pure_parser = true.
3934 * data/push.c: Don't bother testing b4_push_if when deciding whether
3935 to expand b4_declare_parser_variables globally.
3936 (yypush_parse): Likewise in here.
3937
3938 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
3939 (yy_reduce_print): Reformat M4 for readability.
3940
39412006-12-15 Bob Rossi <bob@brasko.net>
3942 and Joel Denny <jdenny@ces.clemson.edu>
3943
3944 * data/push.c (yypstate): Add typedef, and update all uses of
3945 struct yypstate to just yypstate.
3946 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
3947
39482006-12-14 Bob Rossi <bob@brasko.net>
3949
3950 * data/push.c (yypush_parse): Declare prototype regardless of
3951 %locations option.
3952
39532006-12-14 Bob Rossi <bob@brasko.net>
3954
3955 * data/push.c (yyparse): Remove the prototype and the #define when in
3956 push-parser mode.
3957
39582006-12-13 Bob Rossi <bob@brasko.net>
3959
3960 * data/push.c (yypstate_init): Rename to...
3961 (yypstate_new): ... this and use b4_c_function_def.
3962 (yypstate_delete): New.
3963 (yypush_parse): Change parameters yynval and yynlloc to be const.
3964 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
3965 yypstate_delete functions.
3966
39672006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
3968
3969 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
3970 strange test case titles. Reported by Bob Rossi.
3971
39722006-12-13 Paul Eggert <eggert@cs.ucla.edu>
3973
3974 * TODO: Add pointer to Sylvain Schmitz's work on static detection
3975 of potential ambiguities in GLR grammers.
3976
39772006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
3978
3979 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
3980 `bison ', use m4_index instead of m4_substr since chopping up a string
3981 containing M4-special characters causes problems here.
3982
3983 Fix a couple of bugs related to special characters in user-specified
3984 file names, and make it easier for skeletons to compute output file
3985 names with the same file name prefix as Bison-computed output file
3986 names.
3987 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
3988 b4_parser_file_name and b4_spec_defines_file instead of
3989 @output_parser_name@ and @output_header_name@, which are now redundant.
3990 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
3991 b4_parser_file_name, b4_spec_defines_file, and the new
3992 @basename(FILENAME@) instead of @output_parser_name@ and
3993 @output_header_name@, which inappropriately escaped the file names as
3994 C string literals.
3995 * src/files.c (all_but_ext): Remove static qualifier.
3996 (compute_output_file_names): Move `free (all_but_ext)' to...
3997 (output_file_names_free): ... here since all_but_ext is needed later.
3998 * src/files.h (all_but_ext): Extern.
3999 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
4000 exactly what MUSCLE_INSERT_STRING used to do.
4001 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
4002 characters are escaped properly.
4003 * src/output.c (prepare): Define muscle file_name_all_but_ext as
4004 all_but_ext.
4005 For pkgdatadir muscle, maintain previous functionality by using
4006 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
4007 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
4008 digraphs would never be expanded. Hopefully no one has M4-special
4009 characters in his Bison installation path.
4010 * src/scan-skel.l: Don't parse @output_header_name@ and
4011 @output_parser_name@ anymore since they're now redundant.
4012 In @output, use decode_at_digraphs.
4013 Parse a new @basename command that invokes last_component.
4014 (decode_at_digraphs): New.
4015 (BASE_QPUTS): Remove unused.
4016 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
4017 (Output file name): New tests.
4018
40192006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
4020
4021 Warn about output files that are generated by the skeletons and that
4022 conflict with other output files.
4023 * data/glr.c: Don't generate the header file here when glr.cc does.
4024 * src/files.c (file_names, file_names_count): New static globals.
4025 (compute_output_file_names): Invoke output_file_name_check for files
4026 not generated by the skeletons and remove existing checks.
4027 (output_file_name_check): New function that warns about conflicting
4028 output file names.
4029 (output_file_names_free): Free file_names.
4030 * src/files.h (output_file_name_check): Declare.
4031 * src/scan-skel.l: Invoke output_file_name_check for files generated by
4032 the skeletons.
4033 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
4034 (Conflicting output files): New tests.
4035
40362006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4037
4038 * doc/bison.texinfo: Fix a couple of typos.
4039
40402006-12-08 Bob Rossi <bob@brasko.net>
4041
4042 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
4043 Rename to...
4044 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
4045 update all uses.
4046 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
4047 (yypush_parse): Rename yypvars argument to yyps and remove redundant
4048 local pv.
4049 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
4050 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
4051
40522006-12-07 Bob Rossi <bob@brasko.net>
4053 and Joel Denny <jdenny@ces.clemson.edu>
4054
4055 * data/push.c (yypvarsinit): Change return type from void* to struct
4056 yypvars*. No longer cast to void* on return.
4057 (struct yypvars): Remove yylen since it need not be remembered between
4058 yypushparse invocations.
4059 (yypushparse): Don't copy between yylen and pv->yylen.
4060
40612006-12-05 Bob Rossi <bob@brasko.net>
4062
4063 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
4064 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
4065 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
4066 (struct yypvars): Remove b4_declare_parser_variables.
4067 (yypvarsinit): Remove init code for removed variables.
4068 (global scope): Do not declare b4_declare_parser_variables if
4069 push or pure mode.
4070 (yypushparse): Add b4_declare_parser_variables.
4071 Init new local variables, and remove init code for removed
4072 yypvars variables.
4073 (yyparse): Delete.
4074 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
4075 and yyparse for other modes.
4076 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
4077 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
4078 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
4079 (AT_PURE_LEX_IF): True if pure or push parser.
4080
40812006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
4082
4083 Document Yacc prologue alternatives and default %destructor's and
4084 %printer's as experimental. Don't mention Java yet. Discussed at
4085 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
4086 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
4087 (2.3a): Annotate this entry to say the old forms of these features were
4088 also experimental.
4089 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
4090 Table of Symbols): Say they're experimental. Comment out any mention
4091 of Java (we'll want this back eventually).
4092
40932006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4094
4095 Support a file name argument to %defines. Deprecate `=' in
4096 %file-prefix, %name-prefix, and %output. Discussed at
4097 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
4098 * NEWS (2.3a+): Mention.
4099 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
4100 form of %defines, and remove `=' from entries for %file-prefix,
4101 %name-prefix, and %output.
4102 * src/parse-gram.y (prologue_declaration): Implement.
4103 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
4104 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
4105 all but one occurrence of %name-prefix.
4106 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
4107 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
4108 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
4109 occurrence of each of %file-prefix and %output. Add check for %defines
4110 with argument.
4111 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
4112 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
4113 Remove the `=' from %output.
4114
41152006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
4116
4117 Don't escape $ in test case titles since Autoconf 2.61 now does that
4118 correctly.
4119 * tests/actions.at (Default %printer and %destructor are not for error
4120 or $undefined): Here.
4121 (Default %printer and %destructor are not for $accept): Here.
4122 * tests/input.at (Invalid $n and @n): Here.
4123
41242006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
4125
4126 Rename <!> to <>. Discussed starting at
4127 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
4128 * NEWS (2.3a+): Update.
4129 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
4130 Update.
4131 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
4132 * src/scan-gram.l (INITIAL): Implement.
4133 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
4134 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
4135 comment.
4136 * tests/actions.at (Default tagless %printer and %destructor,
4137 Default tagged and per-type %printer and %destructor,
4138 Default %printer and %destructor are not for error or $undefined,
4139 Default %printer and %destructor are not for $accept,
4140 Default %printer and %destructor for mid-rule values): Update.
4141 * tests/input.at (Default %printer and %destructor redeclared,
4142 Unused values with default %destructor): Update.
4143
41442006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
4145
4146 Don't let %prec take a nonterminal.
4147 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
4148 token.
4149 * tests/input.at (%prec takes a token): New test checking that %prec
4150 won't take a nonterminal.
4151
41522006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4153
4154 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
4155 it was double-quoted.
4156 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
4157 grammar is maintained with Bison's highest standards.
4158 * src/getargs.c: Fix some typos in Doxygen comments.
4159
41602006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4161
4162 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
4163 later. Reported by Paul Eggert in
4164 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
4165 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
4166 * src/scan-code.l (translate_action): Don't bother invoking
4167 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
4168 (code_scanner_free): Instead of invoking
4169 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
4170 which frees more.
4171 * src/scan-gram.l (gram_scanner_free): Likewise.
4172 * src/scan-skel.l (scan_skel): Likewise.
4173
41742006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4175
4176 * src/files.c (tr): Change return type to void.
4177 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
4178 has been called previously for the same key.
4179 (muscle_find): Return storage instead of value so that
4180 --enable-gcc-warnings doesn't produce warnings that the return discards
4181 const. aver that the value and storage are the same since storage
4182 could potentially be NULL when value is not.
4183 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
4184 same as 0.
4185
41862006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4187
4188 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
4189 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
4190 us a slightly cleaner distribution, and also works.
4191 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
4192 gnulib changes.
4193
41942006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
4195 and Paul Eggert <eggert@cs.ucla.edu>
4196
4197 Don't let Bison leak memory except when it complains.
4198 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
4199 (spec_defines_file, dir_prefix): Now char *, not const char *,
4200 since they are freed.
4201 * src/files.c: Likewise.
4202 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
4203 Likewise.
4204 (tr): Now operates in-place. All uses changed.
4205 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
4206 values.
4207 (compute_file_name_parts, compute_output_file_names): Don't store
4208 read-only data in variables that will be freed.
4209 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
4210 src_extension, and header_extension.
4211 (output_file_names_free): New public function to free
4212 spec_verbose_file, spec_graph_file, spec_defines_file,
4213 parser_file_name, and dir_prefix.
4214 * src/getargs.c (getargs): Don't store read-only data in variables that
4215 will be freed.
4216 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
4217 (which previously existed but was unused), and quotearg_free.
4218 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
4219 * src/muscle_tab.c: Likewise.
4220 (muscle_entry): Make the value char const *,
4221 and add a new storage member that is char * and can be freed.
4222 (muscle_entry_free): New private function.
4223 (muscle_init): Use it instead of free.
4224 (muscle_insert, muscle_grow): Update and use new storage member.
4225 (muscle_code_grow): Free the string passed to muscle_grow
4226 since it's not needed anymore.
4227 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
4228 add a new `char *code' member.
4229 ("{...}"): Declare semantic type as code.
4230 * src/scan-code.h (translate_rule_action):
4231 (translate_symbol_action, translate_code, translate_action): Return
4232 `char const *' rather than `char *' since external code should not free
4233 these strings.
4234 * src/scan-code.l: Likewise.
4235 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
4236 which is "{...}" in the parser.
4237 * tests/Makefile.am (maintainer-check-valgrind): Set
4238 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
4239 Valgrind.
4240 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
4241 complain.
4242 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
4243 expecting a non-zero exit status sets --leak-check=summary and
4244 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
4245 this case, and we don't want to hear about it.
4246
42472006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4248
4249 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
4250 instead of from the template, to simplify configuration a bit.
4251 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
4252 and m4/wint_t.m4, as they are needed with the latest gnulib.
4253
42542006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4255
4256 Disable unset/unused mid-rule value warnings by default, and recognize
4257 --warnings=midrule-values to enable them. Discussed starting at
4258 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
4259 * NEWS (2.3a+): Mention.
4260 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
4261 warnings): Add entry for midrule-values subargument.
4262 * src/reader.c (symbol_should_be_used): Don't return true just because
4263 the value is a set/used mid-rule value unless
4264 --warnings=midrule-values was specified.
4265 * tests/input.at (Unused values, Unused values before symbol
4266 declarations): Run tests with and without --warnings=midrule-values.
4267
4268 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
4269 than LIST_FREE directly.
4270
42712006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4272
4273 Finish implementing --warnings=error, which should not be implied by
4274 --warnings=all (or by its synonyms -W and --warnings without
4275 subarguments).
4276 * src/complain.c (set_warning_issued): New function to report that
4277 warnings are being treated as errors and to record an error if so.
4278 Invoke...
4279 (warn_at, warn): ... here.
4280 * src/getargs.c (warnings_args, warnings_types): Reorder so that
4281 "error - warnings are errors" does not appear above "all - all of the
4282 above".
4283 (getargs): For -W and --warnings without subarguments, don't let
4284 FLAGS_ARGMATCH set warnings_error in warnings_flag.
4285 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
4286
42872006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4288
4289 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
4290 empty subargument list. For example: `bison --warnings= parser.y'.
4291
42922006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4293
4294 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
4295 the parser header file so that gcc doesn't warn.
4296
42972006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4298
4299 Split the default %destructor/%printer into two kinds: <*> and <!>.
4300 Discussed starting at
4301 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
4302 * NEWS (2.3a+): Mention.
4303 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
4304 previous change today related to mid-rules.
4305 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
4306 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
4307 (TYPE_TAG_ANY): Add as <*>.
4308 (TYPE_TAG_NONE): Add as <!>.
4309 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
4310 for <*> and <!>.
4311 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
4312 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
4313 * src/symlist.c (symbol_list_default_new): Split into tagged and
4314 tagless versions.
4315 (symbol_list_destructor_set, symbol_list_printer_set): Split
4316 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
4317 SYMLIST_DEFAULT_TAGLESS.
4318 * src/symlist.h: Update symbol_list_default*_new prototypes.
4319 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
4320 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
4321 * src/symtab.c (default_destructor, default_destructor_location,
4322 default_printer, default_printer_location): Split each into tagged and
4323 tagless versions.
4324 (symbol_destructor_get, symbol_destructor_location_get,
4325 symbol_printer_get, symbol_printer_location_get): Implement tagged
4326 default and tagless default cases.
4327 (default_destructor_set, default_printer_set): Split each into tagged
4328 and tagless versions.
4329 * src/symtab.h: Update prototypes.
4330 * tests/actions.at (Default %printer and %destructor): Rename to...
4331 (Default tagless %printer and %destructor): ... this, and extend.
4332 (Per-type %printer and %destructor): Rename to...
4333 (Default tagged and per-type %printer and %destructor): ... this, and
4334 extend.
4335 (Default %printer and %destructor for user-defined end token): Extend.
4336 (Default %printer and %destructor are not for error or $undefined):
4337 Update.
4338 (Default %printer and %destructor are not for $accept): Update.
4339 (Default %printer and %destructor for mid-rule values): Extend.
4340 * tests/input.at (Default %printer and %destructor redeclared): Extend.
4341 (Unused values with default %destructor): Extend.
4342
43432006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4344
4345 Don't apply the default %destructor/%printer to an unreferenced midrule
4346 value. Mentioned at
4347 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
4348 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
4349 like $@n instead of just @n so that the default %destructor/%printer
4350 logic doesn't see them as user-defined symbols.
4351 (symbol_is_dummy): Check for both forms of the name.
4352 * src/reader.c (packgram): Remove the `$' from each midrule symbol
4353 name for which the midrule value is referenced in any action.
4354 * tests/actions.at (Default %printer and %destructor for mid-rule
4355 values): New test.
4356 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
4357 for change to dummy symbol names.
4358
43592006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4360
4361 Warn about unset midrule $$ if the corresponding $n is used.
4362 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
4363 $n usage.
4364 (packgram): Before invoking grammar_rule_check on any rule, make sure
4365 all actions have already been scanned in order to set `used' flags.
4366 Otherwise, checking that a midrule's $$ is set will not always work
4367 properly because the midrule check must forward-reference the midrule's
4368 parent rule.
4369 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
4370 warning.
4371
43722006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4373
4374 More improvements to the documentation of the prologue alternatives:
4375 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
4376 Bison manual.
4377 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
4378 some text to clarify the relative importance of the new directives and
4379 to show how these directives may be viewed as code labels.
4380
43812006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
4382
4383 Similar to the recently removed %before-header, add %code-top as the
4384 alternative to the pre-prologue. Mentioned at
4385 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
4386 Also, let the prologue alternatives appear in the grammar section.
4387 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
4388 (prologue_declaration): Move the existing prologue alternatives to...
4389 (grammar_declaration): ... here and add %code-top.
4390 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
4391
4392 Clean up and extend documentation for the prologue alternatives.
4393 * NEWS (2.3a+): Describe prologue alternatives.
4394 * doc/bison.texinfo (Prologue): Move discussion of prologue
4395 alternatives to...
4396 (Prologue Alternatives): ... this new section, and extend it to discuss
4397 all 4 directives in detail.
4398 (Table of Symbols): Clean up discussion of prologue alternatives and
4399 add %code-top.
4400
44012006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4402
4403 DJGPP specific issues.
4404
4405 * djgpp/config.bat: config.hin has been moved to lib. Adjust
4406 config.bat accordingly.
4407 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
4408 * djgpp/config.site: Likewise.
4409
44102006-10-16 Paolo Bonzini <bonzini@gnu.org>
4411
4412 Replace %*-header with %provides, %requires, %code. See discussion at
4413 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
4414
4415 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
4416 (b4_user_start_header): Remove.
4417 * data/glr.c: Use new macros instead of b4_*start_header
4418 and b4_*end_header.
4419 * data/glr.cc: Likewise.
4420 * data/lalr1.cc: Likewise.
4421 * data/push.c: Likewise.
4422 * data/yacc.c: Likewise.
4423
4424 * doc/bison.texinfo: Remove %before-header, rename
4425 %{start,end,after}-header to %requires, %provides, %code.
4426
4427 * src/parse-gram.y: Likewise (also rename token names accordingly).
4428 * src/scan-gram.l: Likewise.
4429 * tests/actions.at: Likewise.
4430
44312006-10-14 Paul Eggert <eggert@cs.ucla.edu>
4432
4433 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
4434 Problem reported by Joel E. Denny.
4435
44362006-10-14 Jim Meyering <jim@meyering.net>
4437
4438 (Sync from coreutils.)
4439 Work also when the working directory (with e.g. coreutils sources)
4440 is version controlled with git, rather than CVS.
4441 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
4442 rather than CVS.
4443 In messages and comments, say e.g., "checked-out sources",
4444 rather than "CVS sources".
4445 (version_controlled_file): New function. Work for git as well as
4446 for CVS. Don't use grep's -q option.
4447 (slurp): Call it here, in place of CVS-specific code.
4448
44492006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
4450
4451 Fix testsuite for ./configure --enable-gcc-warnings:
4452 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
4453 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
4454 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
4455 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
4456 * test/regression.at (Diagnostic that expects two alternatives):
4457 Likewise.
4458
44592006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4460
4461 * bootstrap.conf (gnulib_modules): Add config-h.
4462 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
4463 worry about HAVE_CONFIG_H.
4464 * lib/abitset.c: Likewise.
4465 * lib/bitset.c: Likewise.
4466 * lib/bitset_stats.c: Likewise.
4467 * lib/bitsetv-print.c: Likewise.
4468 * lib/bitsetv.c: Likewise.
4469 * lib/ebitset.c: Likewise.
4470 * lib/get-errno.c: Likewise.
4471 * lib/lbitset.c: Likewise.
4472 * lib/subpipe.c: Likewise.
4473 * lib/timevar.c: Likewise.
4474 * lib/vbitset.c: Likewise.
4475 * lib/bitset.c: Include "bitset.h" first, to test interface.
4476 * lib/bitset_stats.c: Include "bitset_stats.h" first.
4477 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
4478 * lib/bitsetv.c: Include "bitsetv.h" first.
4479 * lib/get-errno.c: Include "get-errno.h" first.
4480 * m4/.cvsignore: Add config-h.m4.
4481 * tests/actions.at (Default %printer and %destructor for ...):
4482 Adjust expected line numbers in output to reflect removal of #if
4483 HAVE_CONFIG_H lines.
4484 * tests/glr-regression.at (Missed %merge type warnings when ...):
4485 Likewise.
4486 * tests/regression.at (Braced code in declaration in rules section):
4487 Likewise.
4488 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
4489 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
4490 Include <config.h> unconditionally.
4491
4492 * bootstrap: Sync from coreutils, as follows:
4493
4494 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4495
4496 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
4497 variable was sometimes used without being initialized. This
4498 messed up the installation of the INSTALL file in some cases.
4499
4500 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4501
4502 * bootstrap (usage, main program, symlink_to_gnulib): Add option
4503 --copy. Inspired by a suggestion from Bruno Haible.
4504
4505 2006-10-03 Jim Meyering <jim@meyering.net>
4506
4507 * bootstrap: Undo last change to this file, since now gnulib-tool
4508 sticks with the automake default in generating dependencies.
4509
45102006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4511
4512 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
4513 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
4514
4515 * doc/bison.1: Add copyright notice.
4516
4517 * data/glr.c: Don't include <stdarg.h>; not used.
4518
4519 * NEWS: The -g and --graph options now output graphs in Graphviz
4520 DOT format, not VCG format.
4521 * doc/bison.1: Likewise.
4522 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
4523 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
4524 of this change in
4525 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
4526 * TODO: Remove Graphviz entry.
4527 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
4528 remove vcg.c, vcg.h, vcg_defaults.h.
4529 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
4530 * src/graphviz.c, src/graphviz.h: New files.
4531 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
4532 * src/files.h: Make comment more generic.
4533 * src/main.c (main): Likewise.
4534 * src/print_graph.h: Likewise.
4535 * src/getargs.c (usage): Make usage description more generic.
4536 * src/print_graph.c: Include graphviz.h rather than vcg.h.
4537 (static_graph, fgraph): Remove. All uses changed to pass
4538 arguments instead of sharing a static var.
4539 (print_core, print_actions, print_state, print_graph):
4540 Output graphviz format rather than VCG format.
4541 * tests/.cvsignore: Remove *.vcg; add *.dot.
4542 * tests/output.at: Expect *.dot files, not *.vcg files.
4543
4544 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
4545 accommodates the 2006-10-08 change.
4546
45472006-10-11 Bob Rossi <bob@brasko.net>
4548
4549 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
4550 (b4_yyssa, b4_yyerror_range): New macros.
4551 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
4552 (yypvarsinit): Remove init of removed fields.
4553 (yypushparse): Remove use of removed fields; use new macros instead.
4554
45552006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4556
4557 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
4558 in a push parser. Reindent slightly to match yacc.c better.
4559
45602006-10-11 Bob Rossi <bob@brasko.net>
4561
4562 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
4563 yymsg_alloc fields.
4564 (yypvarsinit, yypushparse): Remove init of removed fields.
4565 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
4566
45672006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4568
4569 * THANKS: Add Paolo Bonzini and Bob Rossi.
4570
45712006-10-08 Paolo Bonzini <bonzini@gnu.org>
4572
4573 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
4574 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
4575 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
4576 b4_define_user_cde and uses): Remove.
4577 (b4_comment, b4_prefix, b4_sync_start): New.
4578 * data/bison.m4: New file, with most of the content removed from c.m4.
4579 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
4580 * src/output.c (output_skeleton): Pass bison.m4.
4581 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
4582 only if specified.
4583
45842006-10-05 Paul Eggert <eggert@cs.ucla.edu>
4585
4586 Fix test failure reported by Tom Lane in
4587 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
4588 and try to make such failures easier to catch in the future.
4589 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
4590 that's now the caller's responsibility.
4591 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
4592 Set yychar = YYEOF if it's negative.
4593 * tests/actions.at (yylex): Abort if asked to read past EOF.
4594 * tests/conflicts.at (yylex): Likewise.
4595 * tests/cxx-type.at (yylex): Likewise.
4596 * tests/glr-regression.at (yylex): Likewise.
4597 * tests/input.at (yylex): Likewise.
4598 * tests/regression.at (yylex): Likewise.
4599 * tests/torture.at (yylex): Likewise.
4600
46012006-10-01 Paul Eggert <eggert@cs.ucla.edu>
4602
4603 Fix problems with translating English-language diagnostics.
4604 * bootstrap: Fix bug introduced in recent bootstrap changes, with
4605 respect to bison-runtime pot generation. The YY_ stuff
4606 wasn't being captured.
4607 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
4608 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
4609 * runtime-po/POTFILES.in: Add data/push.c.
4610
46112006-09-29 Paul Eggert <eggert@cs.ucla.edu>
4612
4613 Merge bootstrap changes from coreutils.
4614
4615 2006-09-28 Jim Meyering <jim@meyering.net>
4616
4617 Automatically generated dependencies are important even
4618 when all of the sources in a directory come from gnulib.
4619 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
4620 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
4621
4622 2006-09-23 Jim Meyering <jim@meyering.net>
4623
4624 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
4625
4626 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4627
4628 * bootstrap: Add support for --force.
4629 (usage): New function. Describe usage less tersely.
4630 (CVS_only_file): New var.
4631
46322006-09-21 Paul Eggert <eggert@cs.ucla.edu>
4633
4634 * data/push.c (YYPUSH_MORE): Make it an enum instead.
4635 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
4636 Adjust white space and comments to match GNU style better.
4637
46382006-09-20 Bob Rossi <bob@brasko.net>
4639
4640 * data/push.c (yyresult_get): Remove function.
4641 (YYPUSH_MORE): Add #define.
4642 (yypushparse): Modify return value.
4643
46442006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4645
4646 * stamp-h.in: Remove; no longer needed.
4647 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
4648 Remove config.h, config.hin, intl (no longer created).
4649 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
4650 stamp-h1.
4651
4652 Sync bootstrap from coreutils, as follows:
4653
4654 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
4655
4656 * bootstrap (symlink_to_gnulib): New function.
4657 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
4658 to copies-of-gnulib.
4659 (cp_mark_as_generated, slurp, gnulib_files):
4660 Avoid making a copy if it's the same as the old version.
4661 (gnulib_files): Add support for this variable (used by Bison).
4662
46632006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4664
4665 * src/getargs.c (usage): Rework to use conventions similar to
4666 coreutils, to make translation a bit easier and the code a bit
4667 smaller. Problem reported by Tim Van Holder.
4668
46692006-09-15 Paul Eggert <eggert@cs.ucla.edu>
4670
4671 Use some of gnulib's new modules, taken from coreutils.
4672
4673 * bootstrap: Sync from coreutils, except add support for gnulib_files.
4674 * bootstrap.conf: New file.
4675 (gnulib_modules): Add configmake, inttypes, unistd.
4676 (XGETTEXT_OPTIONS): Add complain, complain_at,
4677 fatal, fatal_at, warn, warn_at, unexpected_end.
4678 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
4679 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
4680 (gl_EARLY): Add.
4681 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
4682 (gl_INIT): Add
4683 (GNULIB_AUTOCONF_SNIPPET): Remove.
4684 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
4685 the pickiest.
4686 * lib/.cvsignore: Add inttypes_.h.
4687 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
4688 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
4689 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
4690 no-longer-necessary initializations.
4691 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
4692 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
4693 use the unistd module.
4694 * src/system.h: Likewise.
4695 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
4696 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
4697 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
4698 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
4699 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
4700 * src/system.h: Include inttypes.h unconditionally, now that we
4701 use the inttypes module. Don't bother to include stdint.h, since
4702 inttypes.h now does that for us.
4703 (LOCALEDIR): Remove, now that we use the configmake module.
4704 * src/getargs.c: Include configmake.h.
4705 * src/main.c: Likewise.
4706 * src/output.c: Likewise.
4707 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
4708 not from $abs_top_builddir, since config.h moved.
4709
4710
4711 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
4712 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
4713
4714 * src/parse-gram.y (symbol_declaration): Don't put statements
4715 before declarations; it's not portable to C89.
4716 * src/scan-code.l (handle_action_at): Likewise.
4717
4718 * src/scan-code.l: Always initialize braces_level; the old code
4719 left it uninitialized and therefore had undefined behavior.
4720
4721 Don't attempt to redefine 'assert', since it runs afoul of
4722 systems where standard headers (mistakenly) include <assert.h>.
4723 Instead, define and use our own alternative, called 'aver'.
4724 * src/reader.c: Don't include assert.h, since we no longer
4725 use assert.
4726 * src/scan-code.l: Likewise.
4727 * src/system.h (assert): Remove, replacing with....
4728 (aver): New function, taking a bool arg. All uses changed.
4729 * src/tables.c (pack_vector): Ensure that aver arg is bool,
4730 not merely an integer.
4731
47322006-09-15 Bob Rossi <bob@brasko.net>
4733
4734 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
4735 * data/c.m4 (YYPUSH): New.
4736 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
4737 * src/getargs.c (push_parser): New var.
4738 * src/getargs.h (push_parser): New declaration.
4739 * src/output.c (prepare): Add macro insertion of `push_flag'.
4740 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
4741 (prologue_declaration): Parse %push-parser.
4742 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
4743 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
4744 list of removed lines from the traces observed.
4745 (AT_CHECK_CALC_LALR): Added push parser tests.
4746
47472006-09-13 Paul Eggert <eggert@cs.ucla.edu>
4748
4749 * NEWS: Version 2.3a.
4750 * configure.ac (AC_INIT): Likewise.
4751
4752 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
4753 "#define YYSTYPE int" that caused "make maintainer-check" to fail
4754 due to header ordering dependencies. I don't know why the #define
4755 was there.
4756
4757 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
4758 runtime cost when YYDEBUG is not defined, and so that some tests
4759 that used to fail now work. Problem and initial suggestion by
4760 Paolo Bonzini.
4761 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
4762 * data/glr.cc (b4_parser_class_name):
4763 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
4764 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
4765 (yydebug_) [YYDEBUG]: New member.
4766 (yycdebug_): Now defined only if YYDEBUG.
4767 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
4768 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
4769 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
4770 if YYYDEBUG.
4771 (debug_stream, set_debug_stream, debug_level, set_debug_level):
4772 Define only if YYDEBUG.
4773 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
4774 set_debug_level.
4775 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
4776 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
4777 AT_CHECK_CALC_GLR_CC that are working now.
4778
47792006-09-12 Paul Eggert <eggert@cs.ucla.edu>
4780
4781 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
4782 We don't need them in glr.cc, and glr.c defines them.
4783 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
4784 assumes that defining it to anything is the same as defining
4785 it to 1. Problem reported by Paolo Bonzini.
4786
47872006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
4788
4789 * data/c.m4 (b4_null, b4_case): Define.
4790 * src/output.c (prepare_symbols): Use b4_null.
4791 (user_actions_output): Use b4_case.
4792
47932006-09-11 Paul Eggert <eggert@cs.ucla.edu>
4794
4795 * data/glr.c (b4_shared_declarations): Put start-header first,
4796 before any #includes that we generate, so that feature-test
4797 macros work. Problem reported by Michael Deutschmann in
4798 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
4799 * data/lalr1.cc: Likewise.
4800 * doc/bison.texinfo (Prologue): Document that feature-test macros
4801 should be defined before any Bison declarations.
4802 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
4803 that depend on location.hh after, not before, Bison decls, since
4804 we now include location.hh after the first user prologue.
4805
4806 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
4807 Sander Brandenburg in
4808 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
4809 Also, fix minor white space and comment issues.
4810 (Prologue): Mention that it's better to define feature-test macros
4811 before Bison declarations. Problem reported by Michael Deutschmann.
4812
4813 * README-cvs: Fix typo: "&" should be "&&". Problem reported
4814 by Jim Meyering.
4815 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
4816 This adjusts to recent gnulib changes.
4817
48182006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
4819
4820 Finish implementation of per-type %destructor/%printer. Discussed
4821 starting at
4822 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
4823 and
4824 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
4825 * NEWS (2.3+): Add a description of this feature to the default
4826 %destructor/%printer description.
4827 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
4828 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
4829 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
4830 list node contains a semantic type.
4831 * src/symtab.c, src/symtab.h: Extend with a table that associates
4832 semantic types with their %destructor's and %printer's.
4833 (semantic_type_from_uniqstr, semantic_type_get,
4834 semantic_type_destructor_set, semantic_type_printer_set): New functions
4835 composing the public interface of that table.
4836 (symbol_destructor_get, symbol_destructor_location_get,
4837 symbol_printer_get, symbol_printer_location_get): If there's no
4838 per-symbol %destructor/%printer, look up the per-type before trying
4839 the default.
4840 * tests/actions.at (Per-type %printer and %destructor): New test case.
4841 * tests/input.at (Default %printer and %destructor redeclared):
4842 Extend to check that multiple occurrences of %symbol-default in a
4843 single %destructor/%printer declaration is an error.
4844 (Per-type %printer and %destructor redeclared, Unused values with
4845 per-type %destructor): New test cases.
4846
48472006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
4848
4849 Require default %destructor/%printer to be declared using
4850 %symbol-default instead of an empty symbol list, and start working on
4851 new per-type %destructor/%printer. Discussed at
4852 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
4853 * NEWS (2.3+): Add %symbol-default to example.
4854 * bison.texinfo (Freeing Discarded Symbols): Likewise.
4855 (Table of Symbols): Add entry for %symbol-default.
4856 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
4857 (generic_symlist, generic_symlist_item): New nonterminals for creating
4858 a list in which each item is a symbol, semantic type, or
4859 %symbol-default.
4860 (grammar_declaration): Use generic_symlist in %destructor and %printer
4861 declarations instead of symbols.1 or an empty list.
4862 (symbol_declaration, precedence_declaration, symbols.1): Update actions
4863 for changes to symbol_list.
4864 * src/reader.c: Update for changes to symbol_list.
4865 * src/scan-code.l: Likewise.
4866 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
4867 * src/symlist.c, src/symlist.h: Extend such that a list node may
4868 represent a semantic type or a %symbol-default in addition to just an
4869 ordinary symbol. Add switched functions for setting %destructor's and
4870 %printer's.
4871 * tests/actions.at, tests/input.at: Add %symbol-default to all default
4872 %destructor/%printer declarations.
4873
48742006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
4875
4876 Whether the default %destructor/%printer applies to a particular symbol
4877 isn't a question of whether the user *declares* that symbol (in %token,
4878 for example). It's a question of whether the user by any means
4879 *defines* the symbol at all (by simply using a char token, for
4880 example). $end is defined by Bison whereas any other token with token
4881 number 0 is defined by the user. The error token is always defined by
4882 Bison regardless of whether the user declares it with %token, but we
4883 may one day let the user define error as a nonterminal instead.
4884 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
4885 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
4886 the meaning of "user-defined".
4887 * tests/actions.at (Default %printer and %destructor for user-declared
4888 end token): Rename to...
4889 (Default %printer and %destructor for user-defined end token): ...
4890 this.
4891
4892 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
4893 computation of whether to apply the default, don't maintain a list of
4894 every Bison-defined symbol. Instead, just check for a first character
4895 of '$', which a user symbol cannot have, and check for the error token.
4896
48972006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
4898
4899 Don't apply the default %destructor or %printer to the error token,
4900 $undefined, or $accept. This change fits the general rule that the
4901 default %destructor and %printer are only for user-declared symbols,
4902 and it solves several difficulties that are described in the new test
4903 cases listed below.
4904 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
4905 * tests/actions.at (Default %printer and %destructor are not for error
4906 or $undefined, Default %printer and %destructor are not for $accept):
4907 New test cases.
4908
49092006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
4910
4911 Allow %start after the first rule.
4912 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
4913 when parsing the first rule.
4914 (check_and_convert_grammar): Search for it here after all grammar
4915 declarations have been parsed. Skip midrules, which have dummy LHS
4916 nonterminals.
4917 * src/symtab.c (symbol_is_dummy): New function.
4918 * src/symtab.h (symbol_is_dummy): Declare it.
4919 * tests/input.at (%start after first rule): New test.
4920
49212006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
4922
4923 Redo some of the previous commit: add back the ability to use
4924 non-aliased/undeclared string literals since it might be useful to
4925 those declaring %token-table.
4926 * src/reader.c (check_and_convert_grammar): Undo changes in previous
4927 commit: don't worry about complaints from symbols_pack.
4928 * src/symtab.c (symbol_new, symbol_class_set,
4929 symbol_check_alias_consistency): Undo changes in previous commit: count
4930 each string literal as a new symbol and token, assign it a symbol
4931 number, and don't complain about non-aliased string literals.
4932 (symbols_pack): Since symbol_make_alias still does not decrement symbol
4933 and token counts but does still set aliased tokens to the same number,
4934 symbol_pack_processor now leaves empty slots in the symbols array.
4935 Remove those slots.
4936 * tests/regression.at (Undeclared string literal): Remove test case
4937 added in previous commit since non-aliased string literals are allowed
4938 again.
4939 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
4940 remove unnecessary string literal declarations.
4941 * tests/sets.at (Firsts): Likewise.
4942
49432006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
4944
4945 Don't allow an undeclared string literal, but allow a string literal to
4946 be used before its declaration.
4947 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
4948 symbols_pack complained.
4949 * src/symtab.c (symbol_new): Don't count a string literal as a new
4950 symbol.
4951 (symbol_class_set): Don't count a string literal as a new token, and
4952 don't assign it a symbol number since symbol_make_alias does that.
4953 (symbol_make_alias): It's not necessary to decrement the symbol and
4954 token counts anymore. Don't assume that an alias declaration occurs
4955 before any uses of the identifier or string, and thus don't assert that
4956 one of them has the highest symbol number so far.
4957 (symbol_check_alias_consistency): Complain if there's a string literal
4958 that wasn't declared as an alias.
4959 (symbols_pack): Bail if symbol_check_alias_consistency failed since
4960 symbol_pack asserts that every token has been assigned a symbol number
4961 although undeclared string literals have not.
4962 * tests/regression.at (String alias declared after use, Undeclared
4963 string literal): New test cases.
4964 (Characters Escapes, Web2c Actions): Declare string literals as
4965 aliases.
4966 * tests/sets.at (Firsts): Likewise.
4967
49682006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
4969
4970 In the grammar scanner, STRING_FINISH unclosed constructs and return
4971 them to the parser in order to improve error messages.
4972 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
4973 SC_BRACED_CODE, SC_PROLOGUE): Implement.
4974 * tests/input.at (Unclosed constructs): New test case.
4975 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
4976 seen.
4977
4978 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
4979 unused global.
4980
49812006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
4982
4983 Handle string aliases for character tokens correctly.
4984 * src/symtab.c (symbol_user_token_number_set): If the token has an
4985 alias, check and set its alias's user token number instead of its own,
4986 which is set to indicate the alias. Previously, every occurrence of
4987 the character token in the grammar overwrote that alias indicator with
4988 the character code.
4989 * tests/input.at (String aliases for character tokens): New test.
4990
49912006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
4992
4993 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
4994
49952006-08-11 Paul Eggert <eggert@cs.ucla.edu>
4996
4997 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
4998 to prevent failures when building on older platforms.
4999 Check for autopoint failure.
5000 Set XGETTEXT_OPTIONS to values that check for C format strings,
5001 so that translators are warned about them (this also helps
5002 prevent core dumps).
5003
5004 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
5005 function, since it simplifies our code a bit.
5006
5007 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
5008 rather than -W, so we don't get bogus warnings about sign comparisons.
5009 Add -Wpointer-arith, since that warning is useful (it reports code
5010 that does not conform to C89 and that some compilers reject).
5011 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
5012 since it's no longer needed.
5013
50142006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
5015
5016 Clean up scanners a bit.
5017 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
5018 definitions so gcc won't warn when obstack_for_string is unused.
5019 * src/scan-code.l: config.h and system.h are already #include'd by
5020 scan-code-c.c, so get rid of them here.
5021 * src/scan-gram.l: Likewise.
5022 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
5023 definitions rather than duplicating the rest of it.
5024 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
5025
50262006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
5027
5028 Suppress signed/unsigned comparison warnings for yycheck.
5029 * data/c.m4 (b4_safest_int_type): New macro.
5030 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
5031 a signed int type, cast it to b4_safest_int_type first.
5032 * data/yacc.c: Likewise.
5033 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
5034 also overwritten.
5035
50362006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
5037
5038 * doc/bison.texinfo: Fix some typos.
5039
50402006-08-02 Paul Eggert <eggert@cs.ucla.edu>
5041
5042 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
5043 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
5044
5045 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
5046 the latest gnulib does this a different way.
5047 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
5048 translation was patched, so stop omitting it.
5049
50502006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5051
5052 Enable declaration of default %printer/%destructor. Make the parser
5053 use these for all user-declared grammar symbols for which the user does
5054 not declare a specific %printer/%destructor. Thus, the parser uses it
5055 for token 0 if the user declares it but not if Bison generates it as
5056 $end. Discussed starting at
5057 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
5058 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
5059 and
5060 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
5061 * NEWS (2.3+): Mention.
5062 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
5063 declare a %destructor for a mid-rule's semantic value. It's just
5064 impossible to declare one specific to it.
5065 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
5066 code. Describe default %destructor form.
5067 * src/parse-gram.y (grammar_declaration): Parse default
5068 %printer/%destructor declarations.
5069 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
5070 and symbol_destructor_location_get rather than accessing the destructor
5071 and destructor_location members of struct symbol.
5072 (symbol_printers_output): Likewise but for %printer's.
5073 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
5074 again.
5075 * src/symtab.c (default_destructor, default_destructor_location,
5076 default_printer, default_printer_location): New static global
5077 variables to record the default %destructor and %printer.
5078 (symbol_destructor_get, symbol_destructor_location_get,
5079 symbol_printer_get, symbol_printer_location_get): New functions to
5080 compute the appropriate %destructor and %printer for a symbol.
5081 (default_destructor_set, default_printer_set): New functions to set the
5082 default %destructor and %printer.
5083 * src/symtab.h: Prototype all those new functions.
5084 * tests/actions.at (Default %printer and %destructor): New test to
5085 check that the right %printer and %destructor are called, that they're
5086 not called for $end, and that $$ and @$ work correctly.
5087 (Default %printer and %destructor for user-declared end token): New
5088 test to check that the default %printer and %destructor are called for
5089 a user-declared end token.
5090 * tests/input.at (Default %printer and %destructor redeclared, Unused
5091 values with default %destructor): New tests to check related grammar
5092 warnings and errors.
5093
50942006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5095
5096 Clean up handling of %destructor for the end token (token 0).
5097 Discussed starting at
5098 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
5099 and
5100 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
5101
5102 Make the skeletons consistent in how they pop the end token and invoke
5103 its %destructor.
5104 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
5105 state, which has token number 0, since this would invoke the
5106 %destructor for the end token.
5107 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
5108 until after shifting the end token, or else it won't be popped.
5109 * data/yacc.c (yyparse): Likewise.
5110
5111 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
5112 it's the end token. Upon termination, destroy an unshifted lookahead
5113 even when it's the end token.
5114 * data/lalr1.cc (yy::parser::parse): Likewise.
5115 * data/yacc.c (yyparse): Likewise.
5116
5117 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
5118 value warnings for the end token when the user gives the end token a
5119 %destructor.
5120
5121 * tests/actions.at (Printers and Destructors): Test all the above.
5122
51232006-07-24 Paul Eggert <eggert@cs.ucla.edu>
5124
5125 Update to latest gnulib and gettext versions.
5126 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
5127 Add fopen-safer.
5128 (gnulib_files): Add m4/warning.m4. Don't worry about files
5129 overwritten by autopoint.
5130 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
5131 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
5132 rejects them.
5133 Don't use autoreconf; instead, invoke autopoint etc. by hand,
5134 so that we can remove the intl files at a better time.
5135 (intl_files_to_remove): Remove aclocal.m4, since it gets
5136 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
5137 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
5138 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
5139 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
5140 Remove datarootdir hack; no longer needed.
5141 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
5142 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
5143 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
5144 strdup.h.
5145 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
5146 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
5147
51482006-07-20 Paul Eggert <eggert@cs.ucla.edu>
5149
5150 * bootstrap: Adjust to today's change to gnulib-tool by invoking
5151 it with --assume-autoconf='latest-stable'.
5152
51532006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
5154
5155 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
5156 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
5157 YYSTYPE' and `{'.
5158 * src/muscle_tab.h (muscle_grow): Replace the header comments with
5159 those from muscle_tab.c since the old ones are misleading.
5160
51612006-07-13 Akim Demaille <akim@epita.fr>
5162
5163 Support %define "KEY" {VALUE}.
5164 * src/scan-code.h, src/scan-code.l (translate_action)
5165 (translate_rule_action, translate_symbol_action, translate_code):
5166 Return char *, not const char *.
5167 * src/parse-gram.y (declaration): Rename as...
5168 (prologue_declaration): this.
5169 (string_content): Remove this nonterminal, use STRING.
5170 (braceless, content, content.opt): New nonterminal.
5171 Use them.
5172 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
5173 as value.
5174 * src/scan-gram.l (getargs.h): Don't include it.
5175
51762006-07-12 Paul Eggert <eggert@cs.ucla.edu>
5177
5178 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
5179 rather than a for-loop that declares a local bool variable. This
5180 should work around a compatibility problem with a Cray x1e C++
5181 compiler reported by Hung Nguyen in
5182 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
5183 The for-loop was introduced in the 2004-11-17 change but I don't
5184 know why it was needed.
5185
51862006-07-12 Akim Demaille <akim@epita.fr>
5187
5188 * data/c.m4: Comment changes.
5189
51902006-07-10 Akim Demaille <akim@lrde.epita.fr>
5191
5192 * src/complain.c (error_message, ERROR_MESSAGE): New.
5193 To factor...
5194 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
5195 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
5196
51972006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5198
5199 * NEWS: Instead of %union, you can define and use your own union type
5200 YYSTYPE if your grammar contains at least one <type> tag.
5201 Your YYSTYPE need not be a macro; it can be a typedef.
5202 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
5203 (Union Decl, Decl Summary): Document this.
5204 * data/glr.c (YYSTYPE): Implement this.
5205 * data/glr.cc (YYSTYPE): Likewise.
5206 * data/lalr1.cc (YYSTYPE): Likewise.
5207 * data/yacc.c (YYSTYPE): Likewise.
5208 * src/output.c (prepare): Output tag_seen_flag.
5209 * src/parse-gram.y (declaration, grammar_declaration):
5210 Use 'union_seen' rather than 'typed' to determine whether
5211 %union has been seen, since grammars can now be typed without
5212 %union.
5213 (symbol_declaration, type.opt, symbol_def):
5214 Keep track of whether a tag has been seen.
5215 * src/reader.c (union_seen, tag_seen): New vars.
5216 (typed): remove.
5217 * src/reader.h (union_seen, tag_seen, typed): Likewise.
5218 * src/scan-code.l (untyped_var_seen): New variable.
5219 (handle_action_dollar): Adjust to above changes.
5220 (handle_action_dollar, handle_action_at):
5221 Improve overflow checking for outlandish numbers.
5222 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
5223 avoid new diagnostics generated by above changes.
5224 * tests/regression.at (YYSTYPE typedef): Add test to check
5225 for type tags without %union.
5226
5227 * src/symlist.c (symbol_list_length): Return int, not unsigned
5228 int, since callers expect int. This may need to get revisited
5229 once we have proper integer overflow checking.
5230
5231 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
5232 object is now static.
5233
5234 * src/getargs.c (flags_argmatch): Return void, not int,
5235 to pacify ./configure --enable-gcc-warnings.
5236
5237 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
5238 since last_string is already defined to FLEX_PREFIX (last_string).
5239
52402006-07-09 Akim Demaille <akim@lrde.epita.fr>
5241
5242 Implement --warnings/-W.
5243 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
5244 replaced by...
5245 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
5246 Adjust callers.
5247 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
5248 (warnings_args, warnings_types): New.
5249 (getargs, short_options, long_options): Accept -W/--warnings.
5250 Sort the options by alphabetical order, upper case letter right
5251 before its lower case.
5252
52532006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5254
5255 Change %merge result type clash warnings to errors. Discussed at
5256 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
5257 * src/reader.c (record_merge_function_type): Use complain_at.
5258 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5259 declared later): Update test case results.
5260
52612006-07-09 Akim Demaille <akim@lrde.epita.fr>
5262
5263 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
5264 to be in alphabetical order.
5265 (trace_args): Spelling fixes.
5266
52672006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5268
5269 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
5270 so they don't collide with user-defined macros.
5271 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
5272 this was never guaranteed, and now that we're using gnulib stdint,
5273 which defines int_fast16_t to long int, the problem is exposed.
5274
52752006-07-08 Paul Eggert <eggert@cs.ucla.edu>
5276
5277 * data/c.m4 (b4_basename): Simplify a bit, since we don't
5278 need the full POSIX semantics (and weren't implementing them
5279 anyway).
5280
5281 Adjust to Autoconf 2.60 and today's gnulib.
5282 * bootstrap (gnulib_modules): Add stdint.
5283 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
5284 no longer copies it.
5285 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
5286 since stdint needs the former and wcwidth (which is now required
5287 by mbswidth) needs the latter.
5288 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
5289 work around a compatibility glitch between gettext 0.14.6 and
5290 Autoconf 2.60.
5291 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
5292 Do not check for uintptr_t, since new stdint module does the right
5293 thing.
5294 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
5295 Add stdint.h, stdint_.h, wcwidth.h.
5296 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
5297 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
5298 stdint.m4, wchar_t.m4, wcwidth.m4.
5299 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
5300 usual order for ../lib/*.h files.
5301 (file_name_split): Use last_component, not base_name, to adjust
5302 to gnulib changes.
5303 * src/parse-gram.h: Include <strverscmp.h> in the usual order
5304 for ../lib/*.h files.
5305 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
5306 Define unconditionally, since we now assume the stdint module.
5307 * src/scan-skel.l: Include <dirname.h>.
5308 (BASE_QPUTS): Use last_component, not base_name.
5309 * src/system.h: Include <unlocked-io.h> in the usual order
5310 for ../lib/*.h files. Include <stdint.h> unconditionally,
5311 since we now use the stdint module.
5312 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
5313 HAVE_UINTPTR_T, since we now use the stdint module.
5314 (base_name): Remove decl, since files now include <dirname.h>
5315 to get the decl.
5316
53172006-07-08 Akim Demaille <akim@lrde.epita.fr>
5318
5319 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
5320 New, default to 1.
5321 * data/yacc.c, data/glr.c, data/location.cc: Use them.
5322 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
5323 default.
5324 * tests/calc.at: Adjust.
5325
53262006-07-08 Akim Demaille <akim@lrde.epita.fr>
5327
5328 * data/c.m4 (b4_basename): New.
5329 (b4_syncline): Also output the location of its invocation (from
5330 the skeleton).
5331 (b4_user_action, b4_define_user_action, b4_user_actions)
5332 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
5333 (b4_user_stype): New.
5334 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
5335
53362006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5337
5338 In the grammar file, the first column is 1 not 0 on the first line as
5339 on every other line.
5340 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
5341 * tests/input.at (Torturing the Scanner): Update output.
5342
5343 * src/scan-gram.l (scanner_cursor): Declare it static.
5344
53452006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5346
5347 In warnings, say "previous declaration" rather than "first
5348 declaration".
5349 * src/symtab.c (redeclaration): Do that here.
5350 * src/reader.c (record_merge_function_type): In the case of a result
5351 type clash, report the previous declaration rather than the very first
5352 one in the grammar file.
5353 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5354 declared later): Add a third declaration to check this behavior.
5355 * tests/input.at (Incompatible Aliases): Update output.
5356
53572006-06-27 Akim Demaille <akim@epita.fr>
5358
5359 * doc/Doxyfile.in: New.
5360 * doc/Makefile.am: Use it.
5361 * src/lalr.h, src/symtab.h: Initial doxygenation.
5362
53632006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5364
5365 Don't miss %merge result type warnings just because the LHS types are
5366 declared after the %merge. This continues the effort of the previous
5367 patch.
5368 * src/reader.c (get_merge_function): Don't set the merger type yet.
5369 (record_merge_function_type): New function for setting the merger type
5370 and checking for clashes.
5371 (grammar_current_rule_merge_set): Set the location of the %merge for
5372 the current rule.
5373 (packgram): Invoke record_merge_function_type for each rule now that
5374 all symbol type declarations have been parsed.
5375 * src/reader.h (merger_list.type_declaration_location): New member
5376 storing the location of the first %merge from which the type for this
5377 merging function was derived.
5378 * src/symlist.h (symbol_list.merger_declaration_location): New member
5379 storing the location of a rule's %merge, if any.
5380 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5381 declared later): New test to catch the error fixed by the above patch.
5382
53832006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5384
5385 Get action warnings (grammar_rule_check) right even when symbol
5386 declarations appear after the rules. Discussed at
5387 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
5388 and
5389 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
5390 Don't mistake the type of $$ in a midrule to be that of its parent
5391 rule's $$.
5392 * src/reader.c (grammar_current_rule_end): Don't invoke
5393 grammar_rule_check yet since not all symbol declarations may have been
5394 parsed yet.
5395 (grammar_midrule_action): Likewise.
5396 Don't record whether the midrule's $$ has been used yet since actions
5397 haven't been translated yet.
5398 Record the midrule's parent rule and its RHS index within the parent
5399 rule.
5400 (grammar_current_rule_action_append): Don't translate the action yet
5401 since not all symbol declarations may have been parsed yet and, thus,
5402 warnings about types for $$, $n, @$, and @n can't be reported yet.
5403 (packgram): Translate the action and invoke grammar_rule_check now that
5404 all symbol declarations have been parsed.
5405 * src/scan-code.l (handle_action_dollar): Now that this is invoked
5406 after parsing the entire grammar file, the symbol list here in the case
5407 of a midrule is actually the midrule's empty RHS, so reference its
5408 parent rule's RHS where necessary.
5409 On the other hand, now that you can already know it's a midrule, you
5410 aren't forced to think $$ has the same type as its parent rule's $$.
5411 (handle_action_at): In the case of a midrule, reference the parent rule
5412 where necessary.
5413 * src/symlist.c (symbol_list_new): Initialize new midrule-related
5414 members.
5415 (symbol_list_length): Now that this is invoked after all rules have
5416 been parsed, a NULL symbol (rather than a NULL symbol list node)
5417 terminates a rule. symbol_list_print already does this correctly.
5418 * src/symlist.h (symbol_list.midrule_parent_rule,
5419 symbol_list.midrule_parent_rhs_index): New members so that midrules can
5420 remember their relationships with their parents.
5421 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
5422 fixed by the above patch.
5423 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
5424 implementing...
5425 (Unused values): ... this old test case and...
5426 (Unused values before symbol declarations): ... this new test case.
5427 This one is the same as `Unused values' except that all symbol
5428 declarations appear after the rules in order to catch the rest of the
5429 errors fixed by the above patch.
5430
54312006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5432
5433 More cleanup.
5434 * src/reader.c (current_rule): Declare it static since it's no longer
5435 used outside this file.
5436 (grammar_current_rule_action_append): Remove redundant arguments from
5437 translate_rule_action invocation.
5438 * src/reader.h (current_rule): Remove this unused extern.
5439 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
5440 * src/scan-code.l (translate_rule_action): Likewise.
5441
54422006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
5443
5444 Clean up yesterday's patch.
5445 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
5446 to...
5447 * src/reader.c (grammar_current_rule_action_append): ... here for
5448 consistency with grammar_current_rule_symbol_append.
5449 * tests/regression.at (Braced code in declaration in rules section):
5450 Make yyerror and yylex static as usual.
5451
54522006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
5453
5454 Fix bug that mistakes braced code in a declaration in the rules section
5455 to be a rule action. Mentioned at
5456 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
5457 * src/scan-gram.l: Move midrule action detection from the start of the
5458 scanning of any braced code to...
5459 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
5460 action. For readability, use $2 and @2 rather than the equivalent
5461 global variables.
5462 * tests/regression.at (Braced code in declaration in rules section):
5463 New test to catch the error fixed by the above patch.
5464
5465 Work on code readability some.
5466 * src/scan-code.l (current_rule): Get rid of this misleading and
5467 redundant declaration: it's actually extern'ed in reader.h.
5468 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
5469 translate_action): Add a rule argument and use it instead of the global
5470 current_rule.
5471 (translate_rule_action): This already receives current_rule through an
5472 argument, so pass it on to translate_action instead of assigning
5473 current_rule to current_rule.
5474 (translate_symbol_action, translate_code): Pass rule = NULL to
5475 translate_action.
5476
54772006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
5478
5479 Rename %before-definitions to %start-header and %after-definitions to
5480 %end-header. Don't use these declarations to separate pre-prologue
5481 blocks from post-prologue blocks. Add new order-independent
5482 declarations %before-header and %after-header as alternatives to the
5483 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
5484 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
5485 * NEWS (2.3+): Update for these changes.
5486 * data/glr.c (b4_before_definitions): Update to...
5487 (b4_start_header): ... this.
5488 (b4_after_definitions): Update to...
5489 (b4_end_header): ... this.
5490 * data/glr.cc: Likewise.
5491 * data/lalr1.cc: Likewise.
5492 * data/yacc.c: Likewise.
5493 * doc/bison.texinfo (The prologue): Update names, and replace remaining
5494 prologue blocks with %*-header declarations.
5495 (Calc++ Parser): Likewise.
5496 (Decl Summary): Update names.
5497 (Table of Symbols): Update description.
5498 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
5499 (PERCENT_END_HEADER): ... this.
5500 (PERCENT_BEFORE_DEFINITIONS): Update to...
5501 (PERCENT_START_HEADER): ... this.
5502 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5503 (declaration): Update token names and m4 macro names.
5504 When parsing %end-header and %start-header, invoke translate_code
5505 before muscle_code_grow, and no longer set global booleans to remember
5506 whether these declarations have been seen.
5507 Parse new %after-header and %before-header.
5508 * src/reader.c (before_definitions, after_definitions): Remove.
5509 (prologue_augment): Accept a new bool argument to specify whether to
5510 augment the pre-prologue or post-prologue.
5511 * src/reader.h (before_definitions, after_definitions): Remove these
5512 extern's.
5513 (prologue_augment): Add new bool argument.
5514 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
5515 (PERCENT_END_HEADER): ... this.
5516 (PERCENT_BEFORE_DEFINITIONS): Update to...
5517 (PERCENT_START_HEADER): ... this.
5518 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5519 * tests/actions.at (Printers and Destructors): Update names.
5520
55212006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
5522
5523 Add comparison operators for C++ location classes. Discussed at
5524 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
5525 * data/c++.m4 (b4_define_location_comparison): New boolean %define
5526 declaration indicating whether filename_type has an operator==. If
5527 filename_type is `std::string', it defaults to `1', `0' otherwise.
5528 * data/location.cc: Iff b4_define_location_comparison is `1', add
5529 operator== and operator!= for class position and for class location.
5530
5531 Some minor fixes.
5532 * src/scan-action.l: Remove unused file.
5533 * src/symtab.c (symbol_printer_set): Use printer_location not
5534 destructor_location.
5535 * src/symtab.h (struct symbol): Replace incorrect source comment for
5536 printer members.
5537 * tests/input.at (Incompatible Aliases): Update output with correct
5538 printer location.
5539
55402006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
5541
5542 Don't put the pre-prologue in the header file. For the yacc.c code
5543 file and the glr.c header and code files, move the pre-prologue before
5544 the token definitions. Add new %before-definitions and
5545 %after-definitions to declare code that will go in both the header file
5546 and code file. Discussed at
5547 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
5548 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
5549 and
5550 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
5551 * NEWS (2.3+): Describe these changes.
5552 * data/glr.c (b4_pre_prologue): Move from within to before...
5553 (b4_shared_declarations): ... this.
5554 Add new b4_before_definitions before b4_token_enums.
5555 Add new b4_after_definitions at the end.
5556 * data/glr.cc (b4_pre_prologue): Replace with...
5557 (b4_before_definitions): ... this in the header file.
5558 (b4_after_definitions): New near the end of the header file.
5559 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
5560 code file right before including the header file.
5561 (b4_before_definitions): New in the previous position of
5562 b4_pre_prologue in the header file.
5563 (b4_after_definitions): New near the end of the header file.
5564 * data/yacc.c: Clean up some m4 quoting especially in the header file.
5565 (b4_token_enums_defines): In the code file, move to right before
5566 YYSTYPE for consistency with the header file.
5567 (b4_before_definitions): New right before b4_token_enums_defines in
5568 both the header and code file.
5569 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
5570 header and code file.
5571 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
5572 of prologues for %union dependencies.
5573 (Decl Summary): In %defines description, mention the effect of
5574 %before-definitions and %after-definitions on the header file.
5575 (Calc++ Parser): Forward declare driver in a %before-definitions rather
5576 than in the pre-prologue so that make check succeeds.
5577 (Table of Symbols): Add entries for %before-definitions and
5578 %after-definitions.
5579 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
5580 %before-definitions.
5581 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
5582 (declaration): Parse those declarations and append to
5583 b4_before_definitions and b4_after_definitions, respectively.
5584 * src/reader.c (before_definitions, after_definitions): New bools to
5585 track whether those declarations have been seen.
5586 (prologue_augment): Add to the post-prologue if %union,
5587 %before-definitions, or %after-definitions has been seen.
5588 * src/reader.h (before_definitions, after_definitions): New extern's.
5589 * src/scan-gram.l: Scan the new declarations.
5590 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
5591 prologue block in a %before-definitions or a %after-definitions based
5592 on whether the %union is declared.
5593 * tests/regression.at (Early token definitions with --yacc, Early token
5594 definitions without --yacc): Move tests for token definitions into the
5595 post-prologue since token names are no longer defined in the
5596 pre-prologue.
5597
55982006-06-20 Akim Demaille <akim@epita.fr>
5599
5600 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
5601 (symbol_get): Use it.
5602 * src/parse-gram.y: Use it.
5603
56042006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
5605
5606 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
5607 build succeeds when configured with --enable-gcc-warnings.
5608
56092006-06-19 Paul Eggert <eggert@cs.ucla.edu>
5610
5611 * src/parse-gram.y (char_name): New function.
5612 (CHAR, STRING, string_content): For %printer, properly escape.
5613 (ID): Prefer fputs to fprintf.
5614 (id): Reindent to be consistent with other rules.
5615 Properly quote char.
5616
5617 The Translation Project changed its way of publishing translations
5618 to maintainers. I haven't received any responses to my request
5619 for supporting the old way, or for documenting the new way. I
5620 have modified 'bootstrap' to use screen scraping
5621 (in this case, HTML scraping). This is unreliable and inelegant,
5622 but I don't see any better way. Yuck.
5623 * bootstrap (TP_URL, WGET_COMMAND): New vars.
5624 (get_translations): New function, which uses HTML scraping to
5625 deduce locations of latest translations.
5626 Use this function to grab both bison and bison-runtime .po files.
5627 Don't bother priming the pump for the runtime-po domain any more,
5628 as it's now translated better than bison is.
5629
56302006-06-19 Akim Demaille <akim@epita.fr>
5631
5632 * src/scan-gram.l: No longer "parse" things after `%union' until
5633 `{'. Rather, return a single "%union" token.
5634 No longer make symbols: return strings, and leave the conversion
5635 to symbols to the parser.
5636 (SC_PRE_CODE, token_type): Remove.
5637 * src/parse-gram.y (%union): New field `character'.
5638 Sort tokens.
5639 (CHAR): New token.
5640 (ID, ID_COLON): Now that the scanner no longer makes them
5641 identifiers, adjust all uses to invoke symbol_get.
5642 (id_colon): New, wraps the conversion from string to symbol.
5643 (%union): Accept a possible union_name.
5644 (symbol): Now can be a char.
5645 * data/c.m4 (b4_union_name): Leave a default value.
5646 * data/glr.c, data/yacc.c: Use it.
5647
56482006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
5649
5650 For associating token numbers with token names for "yacc.c", don't use
5651 #define statements unless `--yacc' is specified; always use enum
5652 yytokentype. Most important discussions start at:
5653 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
5654 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
5655 and
5656 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
5657 * NEWS (2.3+): Mention.
5658 * data/c.m4 (b4_yacc_if): New.
5659 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
5660 token #define's.
5661 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
5662 on token name definitions.
5663 * src/getargs.c (usage): Capitalize `Yacc' in English.
5664 * src/output.c (prepare): Define b4_yacc_flag.
5665 * tests/regression.at (Early token definitions): Test that tokens names
5666 are defined before the pre-prologue not just before the post-prologue.
5667 Remove this test case and copy to...
5668 (Early token definitions with --yacc): ... this to test #define's.
5669 (Early token definitions without --yacc): ... and this to test enums.
5670
56712006-06-11 Paul Eggert <eggert@cs.ucla.edu>
5672
5673 * NEWS: Reword the post-2.3 change to not be so optimistic about
5674 removing the old "look-ahead" spelling.
5675 Update previous look-ahead/lookahead change reports.
5676 * REFERENCES: look-ahead -> lookahead (since that's
5677 what he actually wrote).
5678 * doc/refcard.tex: look ahead -> lookahead,
5679 look-ahead -> lookahead
5680
56812006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
5682
5683 For consistency, use `lookahead' instead of `look-ahead' or
5684 `look_ahead'. Discussed starting at
5685 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
5686 and then at
5687 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
5688 * NEWS: For the next release, note the change to `--report'.
5689 * TODO, doc/bison.1: Update English.
5690 * doc/bison.texinfo: Update English.
5691 (Understanding Your Parser, Bison Options): Document as
5692 `--report=lookahead' rather than `--report=look-ahead'.
5693 * src/conflicts.c: Update English in comments.
5694 (lookahead_set): Rename from look_ahead_set.
5695 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
5696 (resolve_sr_conflict): Rename local look_ahead_tokens to
5697 lookahead_tokens, and update other uses.
5698 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
5699 count_rr_conflicts, conflicts_free): Update uses.
5700 * src/getargs.c (report_args): Move "lookahead" before alternate
5701 spellings.
5702 (report_types): Update uses.
5703 (usage): For `--report' usage description, state `lookahead' spelling
5704 rather than `look-ahead'.
5705 * src/getargs.h (report.report_lookahead_tokens): Rename from
5706 report_look_ahead_tokens.
5707 * src/lalr.c: Update English in comments.
5708 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
5709 (state_lookahead_tokens_count): Rename from
5710 state_look_ahead_tokens_count.
5711 Rename local n_look_ahead_tokens to n_lookahead_tokens.
5712 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
5713 Rename local n_look_ahead_tokens to n_lookahead_tokens.
5714 Update other uses.
5715 Update English in output.
5716 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
5717 * src/print.c: Update English in comments.
5718 (lookahead_set): Rename from look_ahead_set.
5719 (print_reduction): Rename argument lookahead_token from
5720 look_ahead_token.
5721 (print_core, state_default_rule, print_reductions, print_results):
5722 Update uses.
5723 * src/print_graph.c: Update English in comments.
5724 (print_core): Update uses.
5725 * src/state.c: Update English in comments.
5726 (reductions_new): Update uses.
5727 (state_rule_lookahead_tokens_print): Rename from
5728 state_rule_look_ahead_tokens_print, and update other uses.
5729 * src/state.h: Update English in comments.
5730 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
5731 (state_rule_lookahead_tokens_print): Rename from
5732 state_rule_look_ahead_tokens_print.
5733 * src/tables.c: Update English in comments.
5734 (conflict_row, action_row): Update uses.
5735 * tests/glr-regression.at
5736 (Incorrect lookahead during deterministic GLR,
5737 Incorrect lookahead during nondeterministic GLR): Rename
5738 print_look_ahead to print_lookahead.
5739 * tests/torture.at: Update English in comments.
5740 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
5741 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
5742 (Many lookahead tokens): Update uses.
5743 * data/glr.c: Update English in comments.
5744 * lalr1.cc: Likewise.
5745 * yacc.c: Likewise.
5746 * src/conflicts.h: Likewise.
5747 * src/lalr.h: Likewise.
5748 * src/main.c: Likewise.
5749 * src/output.c: Likewise.
5750 * src/parse-gram.c: Likewise.
5751 * src/tables.h: Likewise.
5752 * tests/calc.at: Likewise.
5753
57542006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
5755
5756 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
5757
57582006-06-07 Paul Eggert <eggert@cs.ucla.edu>
5759
5760 * TODO: Add request from Nelson H. F. Beebe to be able to install
5761 Bison without installing the yacc script.
5762
57632006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
5764
5765 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
5766 and yytext if they're already #define'd.
5767 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
5768 * src/scan-code-c.c: ... here.
5769 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
5770 <config.h>.
5771
57722006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
5773
5774 Get Bison to build again when configured with --enable-gcc-warnings.
5775 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
5776 missing #include's.
5777 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
5778 loc argument as it shadows a global.
5779 * src/scan-gram.l: Remove stray comma that prevents boundary_set
5780 invocation.
5781
5782 * src/.cvsignore: Add scan-code.c.
5783
57842006-06-07 Akim Demaille <akim@epita.fr>
5785
5786 * src/scan-gram.l: Move the "add a trailing ; to actions" code
5787 to...
5788 * src/scan-code.l: here.
5789 * tests/input.at (Torturing the Scanner): Fix another location
5790 error.
5791
57922006-06-07 Akim Demaille <akim@epita.fr>
5793
5794 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
5795
57962006-06-06 Akim Demaille <akim@epita.fr>
5797
5798 Extract the parsing of user actions from the grammar scanner.
5799 As a consequence, the relation between the grammar scanner and
5800 parser is much simpler. We can also split "composite tokens" back
5801 into simple tokens.
5802 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
5803 * src/scan-gram.l (add_column_width, adjust_location): Move to and
5804 rename as...
5805 * src/location.h, src/location.c (add_column_width)
5806 (location_compute): these.
5807 Fix the column count: the initial column is 0.
5808 (location_print): Be robust to ending column being 0.
5809 * src/location.h (boundary_set): New.
5810 * src/main.c: Adjust to scanner_free being renamed as
5811 gram_scanner_free.
5812 * src/output.c: Include scan-code.h.
5813 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
5814 Use boundary_set.
5815 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
5816 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
5817 which is now, again, a separate token.
5818 Adjust all dependencies.
5819 Whereever actions with $ and @ are used, use translate_code.
5820 (action): Remove this nonterminal which is now useless.
5821 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
5822 (grammar_current_rule_action_append): Use translate_code.
5823 (packgram): Bound check ruleno, itemno, and rule_length.
5824 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
5825 (last_string, last_braced_code_loc, max_left_semantic_context)
5826 (scanner_initialize, scanner_free, scanner_last_string_free)
5827 (gram_out, gram_lineno, YY_DECL_): Move to...
5828 * src/scan-gram.h: this new file.
5829 (YY_DECL): Rename as...
5830 (GRAM_DECL): this.
5831 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
5832 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
5833 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
5834 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
5835 Move these declarations, and...
5836 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
5837 these to...
5838 * src/flex-scanner.h: this new file.
5839 * src/scan-gram.l (rule_length, rule_length_overflow)
5840 (increment_rule_length): Remove.
5841 (last_braced_code_loc): Rename as...
5842 (gram_last_braced_code_loc): this.
5843 Adjust to the changes of the parser.
5844 Move all the handling of $ and @ into...
5845 * src/scan-code.l: here.
5846 * src/scan-gram.l (handle_dollar, handle_at): Remove.
5847 (handle_action_dollar, handle_action_at): Move to...
5848 * src/scan-code.l: here.
5849 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
5850 scan-code.h, scan-code-c.c, scan-gram.h.
5851 (EXTRA_bison_SOURCES): Add scan-code.l.
5852 (BUILT_SOURCES): Add scan-code.c.
5853 (yacc): Be robust to white spaces.
5854
5855 * tests/conflicts.at, tests/input.at, tests/reduce.at,
5856 * tests/regression.at: Adjust the column numbers.
5857 * tests/regression.at: Adjust the error message.
5858
58592006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
5860
5861 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
5862 Use Akim's wording from
5863 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
5864
58652006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
5866
5867 Between Bison releases, manually append `+' to the previous Bison
5868 release number, and use that as a signal to automatically print the
5869 ChangeLog's CVS Id keyword from --version. Discussed starting at
5870 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
5871 * ChangeLog: Add Id header.
5872 * configure.ac (AC_INIT): Append `+' to `2.3'.
5873 * src/.cvsignore: Add revision.c.
5874 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
5875 (BUILT_SOURCES): Add revision.c.
5876 (revision.c): New target rule. This file defines a new global variable
5877 named revision. It initializes it with either the Id from ChangeLog
5878 or, if VERSION doesn't contain `+', with the empty string.
5879 * src/getargs.c (version): Print the value of revision.
5880 * src/revision.h: Extern revision.
5881
58822006-06-05 Paul Eggert <eggert@cs.ucla.edu>
5883
5884 * NEWS: Version 2.3.
5885 * configure.ac (AC_INIT): Likewise.
5886
58872006-05-30 Paul Eggert <eggert@cs.ucla.edu>
5888
5889 * data/glr.c (YYRECOVERING): Define to be a function-like macro
5890 with no arguments, not as an object-like macro. This is for
5891 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
5892 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
5893 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
5894 Document this.
5895
58962006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
5897
5898 * src/getargs.c (usage): Back out yesterday's modification of the
5899 --help output so that we don't have to wait for translation before
5900 releasing 2.3.
5901
59022006-05-29 Paul Eggert <eggert@cs.ucla.edu>
5903
5904 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
5905 Problem reported by Akim Demaille.
5906
59072006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
5908
5909 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
5910
59112006-05-26 Paul Eggert <eggert@cs.ucla.edu>
5912
5913 * data/yacc.c (yy_reduce_print): Omit trailing white space in
5914 generated source code. Problem reported by Frans Englich in
5915 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
5916
59172006-05-22 Paul Eggert <eggert@cs.ucla.edu>
5918
5919 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
5920 shell, not within 'make', so that 'make' by an ordinary builder
5921 (using GNU make) does not worry about configuring gzip. This also
5922 works around a bug reported independently by Keith Thompson and by
5923 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
5924 stderr rather than stdout, messing up the build logs.
5925
59262006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
5927
5928 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
5929 to make sure that YYID will never be unused. This fixes a 'make
5930 maintainer-check' failure caused by the recent changes to the 'Trivial
5931 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
5932 not used.
5933 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
5934
59352006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
5936
5937 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
5938 state before an empty RHS is always resolved here. Only the location
5939 of that state is guaranteed to be resolved, and that's enough. This
5940 fixes the remaining bug reported by Derek M. Jones in
5941 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
5942 * tests/glr-regression.at (Uninitialized location when reporting
5943 ambiguity): Test the above case.
5944 Also, the embedded comments in this test case claim it checks the case
5945 of an empty RHS that has inherited the initial location. However, the
5946 corresponding LHS was already resolved, so yyresolveLocations didn't
5947 actually have reason to modify it. Fix this by forcing
5948 nondeterministic operation at the beginning of the parse.
5949
59502006-05-20 Paul Eggert <eggert@cs.ucla.edu>
5951
5952 * data/c.m4 (b4_yy_symbol_print_generate):
5953 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
5954 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
5955 of the bugs reported today by Derek M Jones in
5956 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
5957 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
5958 defined to be a type name without parens or brackets.
5959 (Location Type): Similarly for YYLTYPE.
5960 * tests/regression.at (Trivial grammars): Put in a test for this
5961 bug that will be caught by 'make maintainer-check' (though not,
5962 alas, by 'make check' unless your compiler is picky).
5963
59642006-05-19 Paul Eggert <eggert@cs.ucla.edu>
5965
5966 * NEWS: Version 2.2.
5967 * configure.ac (AC_INIT): Likewise.
5968
59692006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
5970
5971 * data/glr.c (yyreportTree): Make room in yystates for the state
5972 preceding the RHS. This fixes the segmentation fault reported by Derek
5973 M. Jones in
5974 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
5975 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
5976 to the user. Reported for yyreportTree by Derek M. Jones later in the
5977 same thread.
5978 * THANKS: Add Derek M. Jones.
5979 Update my email address.
5980 Fix typo in Steve Murphy's name.
5981
59822006-05-14 Paul Eggert <eggert@cs.ucla.edu>
5983
5984 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
5985 checking against YYLAST that caused the parser to miss a potential
5986 alternative in its diagnostic.
5987 Problem reported by Maria Jose Moron Fernandez in
5988 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
5989 * data/lalr1.cc (yysyntax_error_): Likewise.
5990 * data/yacc.c (yysyntax_error): Likewise.
5991 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
5992 tokens, in case we run into an older C compiler.
5993 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
5994 Use them to check for the off-by-one error fixed above.
5995
5996 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
5997 YYSIZE_T, not size_t.
5998 * tests/regression.at (Trivial grammars): New test, to catch
5999 the error fixed by the above patch.
6000
60012006-05-14 Akim Demaille <akim@lrde.epita.fr>
6002
6003 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
6004 scheme.
6005 Reported by Steve Murphy.
6006
60072006-05-14 Akim Demaille <akim@lrde.epita.fr>
6008
6009 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
6010 * data/glr.cc: b4_location_flag is now b4_locations_flag.
6011
60122006-05-14 Akim Demaille <akim@lrde.epita.fr>
6013
6014 Implement --trace=m4.
6015 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
6016 * src/output.c (output_skeleton): When set, pass -dV to m4.
6017
6018 Factor the handling of flags in m4.
6019 * src/output.c (prepare): Rename the muscle names debug, defines,
6020 error_verbose to debug_flag, defines_flag, error_verbose_flag.
6021 * data/c.m4: Adjust.
6022 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
6023 Use b4_define_flag_if to define other b4_FLAG_if macros.
6024 (b4_location_if): As a consequence, rename as...
6025 (b4_locations_if): this, for consistency.
6026 Adjust all the skeletons.
6027
60282006-05-14 Akim Demaille <akim@lrde.epita.fr>
6029
6030 * etc/bench.pm: Shorten bench names.
6031
60322006-05-14 Akim Demaille <akim@lrde.epita.fr>
6033
6034 * src/output.h, src/output.c (error_verbose): Move to...
6035 * src/getargs.h, src/getargs.c: here.
6036 Sort the flags.
6037 Adjust dependencies.
6038
60392006-05-13 Paul Eggert <eggert@cs.ucla.edu>
6040
6041 * data/c.m4 (b4_copyright): Put the special exception for Bison
6042 skeletons here, so we don't have to put it in each skeleton. All
6043 uses changed. Suggested by Akim Demaille. Also, wrap the
6044 copyright notice, in case it is longer than 80 columns. Replace
6045 comma by newline after title.
6046
60472006-05-11 Paul Eggert <eggert@cs.ucla.edu>
6048
6049 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
6050 incompatibility, not a bug. Mention that it wasn't fixed as of
6051 flex 2.5.33.
6052
60532006-05-11 Akim Demaille <akim@lrde.epita.fr>
6054
6055 * examples/extexi: Enforce the precedence of concatenation over
6056 >>.
6057 Reported by Tommy Nordgren.
6058
60592006-05-11 Akim Demaille <akim@lrde.epita.fr>
6060
6061 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
6062 with the member "token".
6063 Reported by Martin Nylin.
6064
60652006-05-08 Paul Eggert <eggert@cs.ucla.edu>
6066
6067 * data/glr.c: Switch to Bison 2.2 special-exception language in
6068 the copyright notice. Use more-regular format for titles and
6069 copyright notices.
6070 * data/glr.cc: Likewise.
6071 * data/location.cc: Likewise.
6072 * data/yacc.cc: Likewise.
6073 * doc/bison.texinfo (Conditions): Document this.
6074 * NEWS: likewise. Upgrade version to 2.2.
6075
60762006-04-27 Akim Demaille <akim@lrde.epita.fr>
6077
6078 * data/glr.cc: Remove dead code.
6079
60802006-04-25 Paul Eggert <eggert@cs.ucla.edu>
6081
6082 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
6083 that variable and the line breaks the bootstrap. Problem reported
6084 by Juan M. Guerrero.
6085
60862006-04-24 Akim Demaille <akim@lrde.epita.fr>
6087
6088 * doc/bison.texinfo (Multiple start-symbols): New.
6089
60902006-04-24 Akim Demaille <akim@lrde.epita.fr>
6091
6092 * etc/README, etc/bench.pl: New.
6093
60942006-04-03 Akim Demaille <akim@lrde.epita.fr>
6095
6096 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
6097 rule.
6098 Reported by Mickael Labau.
6099 * tests/input.at (Torturing the Scanner): Test it.
6100
61012006-03-16 Paul Eggert <eggert@cs.ucla.edu>
6102
6103 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
6104 Problem reported by Bob Rossi.
6105
61062006-03-13 Paul Eggert <eggert@cs.ucla.edu>
6107
6108 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
6109 and didn't really work.
6110 For the index, use @ifnotinfo, not @iftex.
6111 Minor cleanups of spacing and terminology.
6112
61132006-03-12 Akim Demaille <akim@lrde.epita.fr>
6114
6115 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
6116 of AT_NAME_PREFIX when %name-prefix is not used.
6117
61182006-03-12 Akim Demaille <akim@lrde.epita.fr>
6119
6120 Apply --prefix to C++ skeletons too: they change the namespace.
6121 The test suite already exercize these cases.
6122 * data/c++.m4 (b4_namespace): New.
6123 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
6124 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
6125 * data/yacc.c, data/glr.c: Remove a useless `[]'.
6126 * doc/bison.texinfo: Document it.
6127 (Option Cross Key): Use @multitable in all formats. It looks
6128 nicer, even in TeX outputs.
6129 (Rules): Use the same code whatever the output type is.
6130 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
6131 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
6132 * tests/calc.at: Use it, instead of hard coding `yy'.
6133
61342006-03-10 Akim Demaille <akim@lrde.epita.fr>
6135
6136 * TODO: Remove dead items.
6137
61382006-03-10 Akim Demaille <akim@lrde.epita.fr>
6139
6140 * doc/FAQ: Remove, merged into...
6141 * doc/bison.texinfo (FAQ): this.
6142 * doc/Makefile.am (EXTRA_DIST): Adjust.
6143
61442006-03-10 Akim Demaille <akim@lrde.epita.fr>
6145
6146 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
6147 even if empty.
6148 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
6149 * doc/bison.texinfo (Calc++ Scanner): Use it.
6150
61512006-03-09 Paul Eggert <eggert@cs.ucla.edu>
6152
6153 Fix two nits reported by twlevo, plus one more that I discovered.
6154
6155 * src/assoc.h (assoc_to_string): Give a name to the arg, as
6156 this is the usual Bison style.
6157 * src/location.h (location_print): Likewise.
6158
6159 * src/reader.h (token_name): Likewise.
6160
61612006-03-08 Paul Eggert <eggert@cs.ucla.edu>
6162
6163 Fix some nits reported by twlevo.
6164 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
6165 and "POSIX". Use more-modern syntax for URLs. Mention C++
6166 and ask for Java. Don't hardwire OS version numbers. Add
6167 copyright notice.
6168 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
6169 * src/conflicts.c (solved_conflicts_obstack): Now static.
6170
61712006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
6172
6173 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
6174 page. Say "you can use it" not "you may use it" as on the web page;
6175 we're describing capabilities not granting permission.
6176
61772006-03-06 Paul Eggert <eggert@cs.ucla.edu>
6178
6179 * data/glr.c (yyresolveLocations): Rename local variables to avoid
6180 shadowing warnings. Use usual patter for iterating through RHS.
6181 * tests/glr-regression.at
6182 (Uninitialized location when reporting ambiguity):
6183 Modify yylex so that it uses its argument, rather than trying
6184 to rely on ARGSUSED (which doesn't work for gcc with warnings).
6185 const char -> char const.
6186
6187 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
6188 Don't use tabs inside commands; it messes up 'ps'.
6189 Problem reported by twlevo.
6190
61912006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
6192
6193 * tests/glr-regression.at (Uninitialized location when reporting
6194 ambiguity): New test case.
6195 * data/glr.c (yyresolveLocations): New function, which uses
6196 YYLLOC_DEFAULT.
6197 (yyresolveValue): Invoke yyresolveLocations before reporting an
6198 ambiguity.
6199 * doc/bison.texinfo (Default Action for Locations): Note
6200 YYLLOC_DEFAULT's usage for ambiguity locations.
6201 (GLR Semantic Actions): Cross-reference those notes.
6202
62032006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
6204
6205 * tests/glr-regression.at (Leaked semantic values when reporting
6206 ambiguity): Remove unnecessary union and type declarations.
6207 (Leaked lookahead after nondeterministic parse syntax error): New test
6208 case.
6209 * data/glr.c (yyparse): Check for zero stacks remaining before
6210 attempting to shift the lookahead so that you don't lose it.
6211
62122006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6213
6214 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
6215 * tests/glr-regression.at (Leaked semantic values when reporting
6216 ambiguity): New test case.
6217 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
6218 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
6219 now unnecessary yystackp parameter.
6220 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
6221 destructors can be called.
6222
6223 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
6224 in existing testcases.
6225
62262006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6227
6228 Don't leak semantic values for parent RHS when a user action cuts the
6229 parser, and clean up related code a bit.
6230 * tests/glr-regression.at (Leaked merged semantic value if user action
6231 cuts parse): Rename to...
6232 (Leaked semantic values if user action cuts parse): ... this. Add check
6233 for leaked parent RHS values.
6234 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
6235 between an unresolved state (non-empty chain of semantic options) and
6236 an incomplete one (signaled by an empty chain).
6237 (yyresolveStates): Document the interface. Move all manipulation of a
6238 successfully or unsuccessfully resolved yyGLRState to...
6239 (yyresolveValue): ... here so that yyresolveValue always leaves a
6240 yyGLRState with consistent data and thus is easier to understand.
6241 Remove the yyvalp and yylocp parameters since they are always just
6242 taken from the yys parameter. When reporting a discarded merged value
6243 in debugging output, note that it is incompletely merged. Document the
6244 interface.
6245 (yyresolveAction): If resolving any of the RHS states fails, destroy
6246 them all rather than leaking them. Thus, as long as user actions are
6247 written to clean up the RHS correctly, yyresolveAction always cleans up
6248 the RHS of a semantic option. Document the interface.
6249
62502006-02-27 Paul Eggert <eggert@cs.ucla.edu>
6251
6252 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
6253 led to a segmentation fault in GNU Pascal. Problem reported
6254 by Waldek Hebisch.
6255
62562006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
6257
6258 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
6259 mid-rule action inside a nonterminal symbol in order to declare a
6260 destructor for its semantic value.
6261
62622006-02-16 Paul Eggert <eggert@cs.ucla.edu>
6263
6264 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
6265 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
6266 __cplusplus && ! defined _STDLIB_H && !
6267 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
6268 defined free))]: Include <stdlib.h> rather than rolling our own
6269 declarations of malloc and free, to avoid problems with
6270 incompatible declarations (using 'throw') C++'s stdlib.h. This
6271 should fix Debian bug 340012
6272 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
6273 reported by Guillaume Melquiond.
6274
62752006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6276
6277 * NEWS: Clarify symbols versus types in unused-value warnings.
6278
6279 * configure.ac (AC_INIT): Bump version number.
6280
62812006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6282
6283 * NEWS: Version 2.1a.
6284 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
6285 since C99 requires this.
6286
62872006-02-11 Paul Eggert <eggert@cs.ucla.edu>
6288
6289 * m4/c-working.m4: New file.
6290 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
6291
62922006-02-10 Paul Eggert <eggert@cs.ucla.edu>
6293
6294 * Makefile.maint: Merge from coreutils.
6295
62962006-02-09 Paul Eggert <eggert@cs.ucla.edu>
6297
6298 More portability fixes for problems summarized by Nelson H. F. Beebe.
6299
6300 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
6301 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
6302 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
6303 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
6304 messes up because C++ code is compiled in 32-bit mode but linked
6305 in 64-bit mode.
6306
63072006-02-08 Paul Eggert <eggert@cs.ucla.edu>
6308
6309 More portability fixes for problems summarized by Nelson H. F. Beebe.
6310
6311 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
6312 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
6313
6314 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
6315 nodist_PROGRAMS, since we don't need to actually compile the
6316 example if we're just doing a plain 'make'. This avoids bothering
6317 the installer unnecessarily about problems due to weird C++
6318 compilers.
6319
63202006-02-06 Paul Eggert <eggert@cs.ucla.edu>
6321
6322 More portability fixes for problems summarized by Nelson H. F. Beebe.
6323
6324 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
6325 than #include "...", and compile with -I'.'. The old method was
6326 not portable, according to Posix and the C standard, and it does
6327 not work with Sun C 5.7, where previous #line directives affect
6328 the working directory used in later #include "..." directives.
6329
63302006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6331
6332 Various DJGGP specific issues in /djgpp
6333
63342006-02-02 Paul Eggert <eggert@cs.ucla.edu>
6335
6336 More portability fixes for problems summarized by Nelson H. F. Beebe.
6337
6338 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
6339 '#include <map>' works and that you can apply ++ to iterators.
6340
63412006-02-01 Paul Eggert <eggert@cs.ucla.edu>
6342
6343 Work around portability problems summarized by Nelson H. F. Beebe in
6344 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
6345
6346 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6347 that '#include <string>' works.
6348
6349 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
6350 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
6351 "warning: sorry: semantics of inline function static data `const
6352 unsigned char translate_table[262]' are wrong (you'll wind up with
6353 multiple copies)".
6354
6355 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
6356 or, xor to not_, and_, or_, and xor_, respectively. This works
6357 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
6358 random system header somewhere that includes the equivalent of
6359 <iso646.h>.
6360
6361 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
6362 -E" works; it apparently doesn't work with PathScale EKO Compiler
6363 Suite Version 2.0.
6364
63652006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
6366
6367 During deterministic GLR operation, user actions should be able to
6368 influence the parse by changing yychar. To make this easier to fix and
6369 to make glr.c easier to evolve in general, don't maintain yytoken in
6370 parallel with yychar; just compute yytoken when needed.
6371 * tests/glr-regression.at (Incorrect lookahead during deterministic
6372 GLR): Check that setting yychar in a user action has the intended
6373 effect.
6374 * data/glr.c (yyGLRStack): Remove yytokenp member.
6375 (yyclearin): Don't set *yytokenp.
6376 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
6377 yychar rather than *yytokenp to determine the current lookahead.
6378 Compute yytoken locally when needed.
6379 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
6380 point to.
6381
6382 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
6383 after `--report' documentation.
6384
63852006-01-30 Paul Eggert <eggert@cs.ucla.edu>
6386
6387 * src/parse-gram.y (grammar_declaration): Location of printer
6388 symbol is @1, not list->location. Bug reported by twlevo.
6389 * tests/input.at (Incompatible Aliases): Adjust to above change.
6390
63912006-01-29 Paul Eggert <eggert@cs.ucla.edu>
6392
6393 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
6394 all the test at once. This makes the output easier to read in the
6395 normal case.
6396
6397 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
6398 got from <http://bro-ids.org/download.html>. The bug is that
6399 when two actions appeared in succession, the second one was
6400 scanned before the first one was added to the grammar rule
6401 as a midrule action. Bison then output the incorrect warning
6402 "parse.y:905.17-906.36: warning: unused value: $3".
6403 * src/parse-gram.y (BRACED_CODE, action): These are no longer
6404 associated with a value.
6405 (rhs): Don't invoke grammar_current_rule_action_append.
6406 (action): Invoke it here instead.
6407 * src/reader.c (grammar_midrule_action): Now extern.
6408 (grammar_current_rule_action_append): Don't invoke
6409 grammar_midrule_action; that is now the scanner's job.
6410 * src/reader.h (last_string, last_braced_code_loc):
6411 (grammar_midrule_action): New decls.
6412 * src/scan-gram.l (last_string): Now extern, sigh.
6413 (last_braced_code_loc): New extern variable.
6414 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
6415 rule already has an action.
6416 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
6417 * tests/input.at (AT_CHECK_UNUSED_VALUES):
6418 Add some tests to check that the above changes fixed the bug.
6419
64202006-01-27 Paul Eggert <eggert@cs.ucla.edu>
6421
6422 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
6423 All used changed. Check whether the symbol has a destructor,
6424 not whether it is typed.
6425 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
6426 that the values are still reported as unused. All line numbers
6427 adjusted.
6428
64292006-01-23 Paul Eggert <eggert@cs.ucla.edu>
6430
6431 Work around a bug in bro 0.8, which underparenthesizes its
6432 definition of YYLLOC_DEFAULT.
6433 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
6434 their arguments.
6435 * data/lalr1.cc: Likewise.
6436 * data/yacc.cc: Likewise.
6437
64382006-01-22 Paul Eggert <eggert@cs.ucla.edu>
6439
6440 Work around a bug in Pike 7.0, and give the Pike folks a
6441 better way to override the usual int widths.
6442 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
6443 user can override the types.
6444 (short): #undef, to work around a bug in Pike 7.0.
6445 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
6446 (union yyalloc.yyss): Use yytype_int16 rather than short.
6447 All uses changed.
6448 (yysigned_char): Remove.
6449 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
6450 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
6451 * tests/regression.at (Web2c Actions): Adjust to above changes.
6452
6453 * src/reader.c (check_and_convert_grammar): New function.
6454 (reader): Close the input file even if something went wrong during
6455 parsing. Minor file descriptor leak reported by twlevo.
6456
6457 * src/assoc.c (assoc_to_string): Use a default: abort (); case
6458 to pacify gcc -Wswitch-default.
6459 * src/scan-gram.l (adjust_location): Use a default: break; case
6460 to pacify gcc -Wswitch-default.
6461 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
6462 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6463 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6464 Move these decls to scan-skel.l, since they don't need to be
6465 visible elsewhere.
6466 * src/scan-skel.l: Accept the above decls.
6467 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
6468 is used.
6469
64702006-01-21 Paul Eggert <eggert@cs.ucla.edu>
6471
6472 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
6473 since we don't want to insist on a version number at the start
6474 of the changelog every time.
6475 * Makefile.maint: Sync from coreutils a bit better.
6476 (sc_trailing_blank): Renamed from sc_trailing_space.
6477 All uses changed.
6478 (sc_no_if_have_config_h, sc_require_config_h):
6479 (sc_prohibit_assert_without_use): New rules.
6480 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
6481 (sc_dd_max_sym_length): Fix leading spaces in rule.
6482 (sc_system_h_headers): Prefix with @.
6483 (sc_useless_cpp_parens, m4-check): Output line numbers.
6484 (changelog-check): Allow version only in head.
6485 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
6486 satisfy new Makefile.maint rule.
6487 * data/glr.c: Likewise.
6488 * data/glr.cc: Likewise.
6489 * data/lalr1.cc: Likewise.
6490 * data/yacc.c: Likewise.
6491 * lib/ebitsetv.c: Likewise.
6492 * lib/lbitset.c: Likewise.
6493 * lib/subpipe.c: Likewise.
6494 * lib/timevar.c: Likewise.
6495 * src/system.h: Likewise.
6496 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
6497 * djgpp/Makefile.maint: Add copyright notice.
6498 * djgpp/README.in: Likewise.
6499 * djgpp/config.bat: Likewise.
6500 * djgpp/config.site: Likewise.
6501 * djgpp/config_h.sed: Likewise.
6502 * djgpp/djunpack.bat: Likewise.
6503 * djgpp/config.sed: Fix copyright notice to match standard format.
6504 * djgpp/subpipe.h: Likewise.
6505 * lib/bitsetv-print.c: Likewise.
6506 * lib/bitsetv.c: Likewise.
6507 * lib/subpipe.h: Likewise.
6508 * lib/timevar.c: Likewise.
6509 * lib/timevar.h: Likewise.
6510 * djgpp/subpipe.c: Use standard recipe for config.h.
6511 * lib/abitset.c: Likewise.
6512 * lib/bitset.c: Likewise.
6513 * lib/bitset_stats.c: Likewise.
6514 * lib/bitsetv-print.c: Likewise.
6515 * lib/bitsetv.c: Likewise.
6516 * lib/ebitsetv.c: Likewise.
6517 * lib/get-errno.c: Likewise.
6518 * lib/lbitset.c: Likewise.
6519 * lib/subpipe.c: Likewise.
6520 * lib/timevar.c: Likewise.
6521 * lib/vbitset.c: Likewise.
6522 * tests/local.at: Likewise.
6523 * src/scan-gram.l: Don't include verify.h, since system.h does
6524 that for us.
6525 * .x-sc_require_config_h: New file.
6526 * .x-sc_unmarked_diagnostics: New file.
6527
65282006-01-20 Paul Eggert <eggert@cs.ucla.edu>
6529
6530 Be a bit more systematic about using 'abort'.
6531 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
6532 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
6533 Put 'default: abort ();' before some other case, to satisfy older
6534 pedantic compilers.
6535 * lib/bitset_stats.c (bitset_stats_init): Likewise.
6536 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
6537 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
6538 * src/conflicts.c (resolve_sr_conflict): Likewise.
6539 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
6540 (get_decision_str, get_orientation_str, get_node_alignment_str):
6541 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
6542 (get_linestyle_str, get_arrowstyle_str): Likewise.
6543 * src/conflicts.c (resolve_sr_conflict):
6544 Use a default case rather than one for the one remaining enum
6545 value, to catch invalid enum values as well.
6546 * src/lalr.c (set_goto_map, map_goto):
6547 Prefer "assert (FOO);" to "if (!FOO) abort ();".
6548 * src/nullable.c (nullable_compute, token_definitions_output):
6549 Likewise.
6550 * src/reader.c (packgram, reader): Likewise.
6551 * src/state.c (transitions_to, state_new, state_reduction_find):
6552 Likewise.
6553 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
6554 (symbol_pack): Likewise.
6555 * src/tables.c (conflict_row, pack_vector): Likewise.
6556 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
6557 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
6558 * src/system.h: Don't include <assert.h>.
6559 (assert): New macro.
6560
6561 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
6562 (Destructor Decl, Parser Function, Pure Calling):
6563 Describe rules for braces inside C code more carefully.
6564
65652006-01-19 Paul Eggert <eggert@cs.ucla.edu>
6566
6567 Fix some porting glitches found by Nelson H. F. Beebe.
6568 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
6569 compilers that don't understand that abort () does not return.
6570 * src/state.c (transitions_to): Likewise.
6571 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6572 that '#include <cstdlib>' works.
6573 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
6574 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
6575 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
6576 for the benefit of some pre-C99 compilers.
6577
6578 * bootstrap: Undo changes to gnulib files that autoreconf made.
6579
6580 Minor fixups to get 'make maintainer-check' to work.
6581 * configure.ac: Don't use -Wnested-externs, as it's incompatible
6582 with the new verify.h implementation.
6583 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
6584 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
6585 * data/yacc.c (YYUSE): Likewise.
6586 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
6587 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
6588 * src/parse-gram.y (declaration): Don't pass a string constant
6589 to a function that expects char *, since GCC might complain
6590 about the constant value.
6591 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
6592 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
6593 before #defining them.
6594 * tests/glr-regression.at
6595 (Incorrectly initialized location for empty right-hand side in GLR):
6596 In yyerror, use the msg arg.
6597 (Corrupted semantic options if user action cuts parse):
6598 (Incorrect lookahead during deterministic GLR):
6599 (Incorrect lookahead during nondeterministic GLR):
6600 Don't name a local var 'index'; it shadows string.h's 'index'.
6601
66022006-01-19 Akim Demaille <akim@epita.fr>
6603
6604 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
6605 location, not just parts of it.
6606
66072006-01-18 Paul Eggert <eggert@cs.ucla.edu>
6608
6609 * NEWS: Document the fact that multiple %unions are now allowed.
6610 * doc/bison.texinfo (Union Decl): Likewise.
6611 * TODO: This feature is now implemented, so remove it from
6612 the wishlist.
6613
6614 * Makefile.maint: Merge with coreutils Makefile.maint.
6615 (CVS_LIST): Use build-aux version if available.
6616 (VERSION_REGEXP): New macro.
6617 (syntax-check-rules): Add sc_no_if_have_config_h,
6618 sc_prohibit_assert_without_use, sc_require_config_h,
6619 sc_useless_cpp_parens.
6620 (sc_obsolete_symbols): Check for O_NDELAY.
6621 (sc_dd_max_sym_length): Track coreutils.
6622 (sc_unmarked_diagnostics): Look in all files, not just *.c.
6623 (sc_useless_cpp_parens): New rule.
6624 (news-date-check): Look for version or today's date.
6625 (changelog-check): Don't require version number near head.
6626 (copyright-check): Use current year instead of hardwiring 2005.
6627 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
6628 (announcement): Add --gpg-key-ID.
6629
6630 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
6631 with "file system".
6632
6633 Avoid undefined behavior that addressed just before the start of an
6634 array. Problem reported by twlevo.
6635 * src/reader.c (packgram): Prepend a new sentinel before ritem.
6636 * src/lalr.c (build_relations): Rely on new sentinel.
6637 * src/gram.c (gram_free): Adjust to new sentinel.
6638
66392006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
6640
6641 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
6642 yylookaheadNeeds. All uses updated.
6643 (yysplitStack): Rename local yynewLookaheadStatuses to
6644 yynewLookaheadNeeds.
6645 * data/glr-regression.at (Incorrect lookahead during nondeterministic
6646 GLR): In comments, change `lookahead status' to `lookahead need'.
6647
66482006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6649
6650 * data/glr.c (yysplitStack): A little stylistic rewrite.
6651
66522006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6653
6654 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
6655
66562006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
6657
6658 * doc/bison.texinfo: Fix some typos.
6659 (GLR Semantic Actions): New subsection discussing special
6660 considerations because GLR semantic actions might be deferred.
6661 (Actions): Mention look-ahead usage of yylval.
6662 (Actions and Locations): Mention look-ahead usage of yylloc.
6663 (Special Features for Use in Actions): Add YYEOF entry and mention it
6664 in the yychar entry.
6665 In the yychar entry, remove mention of the local yychar case (pure
6666 parser) since this is irrelevant information when writing semantic
6667 actions and since it's already discussed in `Table of Symbols' where
6668 yychar is otherwise described as an external variable.
6669 In the yychar entry, don't call it the `current' look-ahead since it
6670 isn't when semantic actions are deferred.
6671 In the yychar and yyclearin entries, add note about deferred semantic
6672 actions.
6673 Add yylloc and yylval entries discussing look-ahead usage.
6674 (Look-Ahead Tokens): When discussing yychar, don't call it the
6675 `current' look-ahead, and do mention yylval and yylloc.
6676 (Error Recovery): Cross-reference `Action Features' when mentioning
6677 yyclearin.
6678 (Table of Symbols): In the yychar entry, don't call it the `current'
6679 look-ahead.
6680 In the yylloc and yylval entries, mention look-ahead usage.
6681
66822006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6683
6684 * tests/glr-regression.at: Update copyright year to 2006.
6685
66862006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6687
6688 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
6689 use during nondeterministic operation to track which stacks have
6690 actually needed the current lookahead.
6691 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
6692 Allocate, deallocate, resize, and otherwise shuffle space for
6693 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
6694 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
6695 appropriately during nondeterministic operation.
6696 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
6697 members to store the current lookahead to be used by the deferred
6698 user action.
6699 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
6700 from which the RHS is taken. Set the lookahead members of the new
6701 yySemanticOption according to the lookahead status for stack yyk.
6702 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
6703 yyaddDeferredAction.
6704 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
6705 members of yySemanticOption before invoking yyuserAction, and then set
6706 them back to their current values afterward.
6707 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
6708 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
6709 * tests/glr-regression.at: Remove `.' from the ends of recent test case
6710 titles for consistency.
6711 (Leaked merged semantic value if user action cuts parse): In order to
6712 suppress lint warnings, use arguments in merge function, and assign
6713 char value < 128 in main.
6714 (Incorrect lookahead during deterministic GLR): New test case.
6715 (Incorrect lookahead during nondeterministic GLR): New test case.
6716
67172006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6718
6719 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
6720 !yyvaluep as signal that no semantic value is available to print.
6721 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
6722 to print a semantic value.
6723
67242006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6725
6726 * tests/glr-regression.at: For consistency with my newer test cases,
6727 don't thank myself.
6728
67292006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
6730
6731 * data/glr.c (yyresolveValue): When merging semantic options, if at
6732 least one user action succeeds but a later one cuts the parse, then
6733 destroy the semantic value before returning rather than leaking it.
6734 (yyresolveStates): If a user action cuts the parse and thus
6735 yyresolveValue fails, ignore the (unset) semantic value rather than
6736 corrupting the yyGLRState, and empty the semantic options list since
6737 the user actions should have called all necessary destructors.
6738 Simplify code with YYCHK.
6739 * tests/glr-regression.at (Corrupted semantic options if user action
6740 cuts parse): New test case.
6741 (Undesirable destructors if user action cuts parse): New test case.
6742 Before applying any of this patch, this test case never actually failed
6743 for me... but only because the corrupted semantic options usually
6744 masked this bug.
6745 (Leaked merged semantic value if user action cuts parse): New test
6746 case.
6747
67482006-01-05 Akim Demaille <akim@epita.fr>
6749
6750 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
6751
67522006-01-04 Paul Eggert <eggert@cs.ucla.edu>
6753
6754 * data/c.m4 (b4_c_modern): New macro, with a new provision for
6755 _MSC_VER. Problem reported by Cenzato Marco.
6756 (b4_c_function_def): Use it.
6757 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
6758 b4_c_modern.
6759 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
6760 than rolling our own.
6761
67622006-01-04 Akim Demaille <akim@epita.fr>
6763
6764 Also warn about non-used mid-rule values.
6765 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
6766 member.
6767 (symbol_list_new): Adjust.
6768 * src/reader.c (symbol_typed_p): New.
6769 (grammar_rule_check): Use it.
6770 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
6771 Check its rule.
6772 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
6773 Use it.
6774 * tests/actions.at (Exotic Dollars): Adjust.
6775
67762006-01-04 Akim Demaille <akim@epita.fr>
6777
6778 * src/reader.c (grammar_midrule_action): If $$ is set in a
6779 mid-rule, move the `used' bit to its lhs.
6780 * tests/input.at (Unused values): New.
6781 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
6782
67832006-01-03 Paul Eggert <eggert@cs.ucla.edu>
6784
6785 * doc/bison.texinfo (Bison Options): Say more accurately what
6786 --yacc does.
6787 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
6788 about declarations in the grammar when in Yacc mode, as POSIX does
6789 not require a diagnostic when the grammar uses extensions.
6790
6791 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
6792
6793 Warn about dubious constructions like "%token T T".
6794 Reported by twlevo.
6795 * src/symtab.h (struct symbol.declared): New member.
6796 * src/symtab.c (symbol_new): Initialize it to false.
6797 (symbol_class_set): New arg DECLARING, specifying whether
6798 this is a declaration that we want to warn about, if there
6799 is more than one of them. All uses changed.
6800
6801 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
6802 Allow multiple %union directives, whose contents concatenate.
6803 * src/parse-gram.y (grammar_declaration): Likewise.
6804 Use muscle_code_grow, so that we don't need stype_line any more.
6805 All uses changed.
6806
6807 * src/muscle_tab.c (muscle_grow): Fix comment.
6808
6809 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
6810 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
6811 Update copyright year to 2006.
6812
68132006-01-03 Akim Demaille <akim@epita.fr>
6814
6815 Have glr.cc pass (some of) the calc.at tests.
6816 * data/glr.cc (b4_parse_param_orig): New.
6817 (b4_parse_param): Improve its definition, and bound it more
6818 clearly in the skeleton.
6819 (b4_epilogue): Append, instead of prepending, in order to keep
6820 #line consistency.
6821 Simplify the generation of auxiliary functions: locations and
6822 purity are mandated.
6823 (b4_global_tokens_and_yystype): Honor it.
6824 * data/location.cc (c++.m4): Don't include it.
6825 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
6826 and AT_SKEL_CC_IF.
6827 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
6828 AT_LALR1_CC_IF.
6829 Be sure to initialize the first position's filename.
6830 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
6831 mandated anyway.
6832 (AT_CHECK_CALC_GLR_CC): New.
6833 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
6834
68352006-01-02 Akim Demaille <akim@epita.fr>
6836
6837 * src/output.c (output_skeleton): Don't hard wire the inclusion of
6838 c.m4.
6839 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
6840 * data/glr.cc: Do not include stack.hh.
6841
68422006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6843
6844 * data/glr.c: Reformat whitespace with tabs.
6845 (b4_lpure_formals): Remove this unused m4 macro.
6846 * tests/cxx-type.at: Reformat whitespace with tabs.
6847 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
6848 since it's a member. Rename type to isNterm for clarity.
6849
68502005-12-29 Akim <akim@sulaco.local>
6851
6852 Let glr.cc catch up with symbol_value_print.
6853 * data/glr.cc (b4_yysymprint_generate): Replace by...
6854 (b4_yy_symbol_print_generate): this.
6855 (yy_symbol_print, yy_symbol_value_print): Declare them.
6856
68572005-12-28 Paul Eggert <eggert@cs.ucla.edu>
6858
6859 * src/location.h (boundary): Note that a line or column equal
6860 to INT_MAX indicates an overflow.
6861 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
6862 (rule_length_overflow, increment_rule_length, add_column_width):
6863 New functions.
6864 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
6865 (<SC_BRACED_CODE>"}"):
6866 Use increment_rule_length rather than incrementing it by hand.
6867 (adjust_location, handle_syncline): Diagnose overflow.
6868 (handle_action_dollar, handle_action_at):
6869 Fix bug with monstrosities like $-2147483648.
6870 Remove now-unnecessary checks.
6871 (scan_integer): Verify assumptions and remove now-unnecessary checks.
6872 (convert_ucn_to_byte): Verify assumptions.
6873 (handle_syncline): New arg LOC. All callers changed.
6874 Don't store through a value derived from char const * pointer.
6875
6876 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
6877 GCC warnings.
6878
68792005-12-27 Paul Eggert <eggert@cs.ucla.edu>
6880
6881 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
6882 Remove unnecessary forward static decls.
6883
68842005-12-27 Akim Demaille <akim@epita.fr>
6885
6886 * src/reader.c (grammar_current_rule_check): Also check that $$
6887 is used.
6888 Take the rule to check as argument, hence rename as...
6889 (grammar_rule_check): this.
6890 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
6891 Rename as...
6892 (grammar_rule_begin, grammar_rule_end): these, for consistency.
6893 (grammar_midrule_action, grammar_symbol_append): Now static.
6894 * tests/torture.at (input): Don't rely on the default action
6895 being always performed.
6896 * tests/calc.at: "Set" $$ even when the action is "cut" with
6897 YYERROR or other.
6898 * tests/actions.at (Exotic Dollars): Instead of using unused
6899 values, check that the warning is issued.
6900
69012005-12-22 Paul Eggert <eggert@cs.ucla.edu>
6902
6903 * NEWS: Improve wording for unused-value warnings.
6904
69052005-12-22 Akim Demaille <akim@epita.fr>
6906
6907 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
6908 (b4_yysymprint_generate): Rename as...
6909 (b4_yy_symbol_print_generate): this.
6910 Generate yy_symbol_print instead of yysymprint.
6911 Generate also yy_symbol_value_print, and use it.
6912
69132005-12-22 Akim Demaille <akim@epita.fr>
6914
6915 * NEWS: Warn about unused values.
6916 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
6917 a `used' member.
6918 (symbol_list_n_get, symbol_list_n_used_set): New.
6919 (symbol_list_n_type_name_get): Use symbol_list_n_get.
6920 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
6921 * src/reader.c (grammar_current_rule_check): Check that values are
6922 used.
6923 * src/symtab.c (symbol_print): Accept 0.
6924 * tests/existing.at: Remove the type information.
6925 Empty the actions.
6926 Remove useless actions (beware of mid-rule actions: perl -000
6927 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
6928 * tests/actions.at (Exotic Dollars): Use unused values.
6929 * tests/calc.at: Likewise.
6930 * tests/glr-regression.at (No users destructors if stack 0 deleted):
6931 Likewise.
6932
6933 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
6934 rule_useful_p.
6935
69362005-12-21 Paul Eggert <eggert@cs.ucla.edu>
6937
6938 Undo 2005-12-01 tentative license wording change. The wording is
6939 still being reviewed by the lawyers, and we don't want to wait for
6940 them before publishing a test release. For now, revert to the
6941 previous wording.
6942 * NEWS: Undo 2005-12-01 change.
6943 * data/glr.c: Revert to previous license wording.
6944 * data/glr.cc: Likewise.
6945 * data/lalr1.cc: Likewise.
6946 * data/location.cc: Likewise.
6947 * data/yacc.c: Likewise.
6948
6949 * NEWS: Reword %destructor vs YYABORT etc.
6950 * data/glr.c: Use American spacing, for consistency.
6951 * data/glr.cc: Likewise.
6952 * data/lalr1.cc: Likewise.
6953 * data/yacc.c: Likewise.
6954 * data/yacc.c: Reformat comments slightly.
6955 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
6956 for consistency. Fix some spelling errors and reword recently-included
6957 text slightly.
6958 * tests/cxx-type.at: Cast results of malloc, for C++.
6959
69602005-12-21 Joel E. Denny <address@hidden>
6961
6962 * tests/cxx-type.at: Construct a tree, count the parents of shared
6963 nodes, and free each node once and only once. Previously, the memory
6964 for semantic values was leaked instead.
6965
69662005-12-21 Joel E. Denny <address@hidden>
6967
6968 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
6969 (yylval, yylloc): If pure, #define to yystackp->yyval and
6970 yystackp->yyloc similar to yychar and yynerrs.
6971 (yyparse): If pure, remove local yylval and yylloc. Add local
6972 yystackp to accommodate pure definitions of yylval and yylloc.
6973 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
6974 yylvalp and yyllocp to &yylval and &yylloc.
6975 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
6976 namespace. Previously, nerrs and char were missing, but lval and lloc
6977 weren't necessary.
6978 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
6979 yylvalp and yyllocp parameters since, if pure, these are now always
6980 accessible through yystackp. If not pure, they are still accessible
6981 globally.
6982 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
6983 `if (YYID (N))' to pacify lint.
6984
69852005-12-21 Akim Demaille <akim@epita.fr>
6986
6987 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
6988 destroy the RHS symbols of a rule.
6989 * data/yacc.c (yylen): Initialize to 0.
6990 Keep its value to the number of items to possibly shift.
6991 In particular, a regular successful parse that ends on YYFINAL by
6992 a (internal) YYACCEPT must not have yylen != 0.
6993 (yyerrorlab, yyreturn): Pop the RHS.
6994 Reorder a bit to emphasize the `shifting' bits of code.
6995 (YYPOPSTACK): Now accept a number of items to pop.
6996 * data/lalr1.cc: Likewise.
6997 * data/glr.c: Formatting changes.
6998 Use goto instead of fall through.
6999 * doc/bison.texinfo (Destructor Decl): Complete.
7000
70012005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7002
7003 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7004 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
7005 * djgpp/config.bat: Replace every occurence of the file name
7006 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7007 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7008 * djgpp/config.sed: Replace every occurence of the file name
7009 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7010 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7011 * djgpp/djunpack.bat: DJGPP specific file.
7012 * djgpp/fnchange.lst: DJGPP specific file.
7013 * djgpp/README.in: Add new information about how to unpack the bison
7014 source on MSDOS and other systems which have 8.3 file name restrictions
7015 using djunpack.bat and fnchange.lst.
7016
70172005-12-12 Paul Eggert <eggert@cs.ucla.edu>
7018
7019 * bootstrap (build_cvs_prefix): Remove; unused.
7020 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
7021 when getting gnulib.
7022
70232005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
7024
7025 * data/glr.c: Reorder typedef declarations for structs to match order
7026 of struct declarations.
7027 Rename yystack everywhere to yystackp except in yyparse where it's not
7028 a pointer.
7029 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
7030 consistency.
7031 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
7032 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
7033 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
7034 lint.
7035
70362005-12-09 Paul Eggert <eggert@cs.ucla.edu>
7037
7038 * tests/sets.at (Accept): Fix typos in regular expression used to
7039 sed out the final state number.
7040
7041 Work around portability problem on Solaris 10: flex-generated
7042 files include <stdio.h> before <config.h>, which messes up
7043 because the latter defines __EXTENSIONS__. Address the problem
7044 by creating two new little files that include <config.h> first,
7045 then include the flex-generated files. Rewrite everyone else
7046 to include <config.h> first, as well.
7047 * lib/timevar.c: Always include "config.h".
7048 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
7049 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
7050 (EXTRA_bison_SOURCES): New macro.
7051 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
7052 * src/system.h: Don't include config.h.
7053 * src/LR0.c: Include <config.h> first.
7054 * src/assoc.c: Likewise.
7055 * src/closure.c: Likewise.
7056 * src/complain.c: Likewise.
7057 * src/conflicts.c: Likewise.
7058 * src/derives.c: Likewise.
7059 * src/files.c: Likewise.
7060 * src/getargs.c: Likewise.
7061 * src/gram.c: Likewise.
7062 * src/lalr.c: Likewise.
7063 * src/location.c: Likewise.
7064 * src/main.c: Likewise.
7065 * src/muscle_tab.c: Likewise.
7066 * src/nullable.c: Likewise.
7067 * src/output.c: Likewise.
7068 * src/parse-gram.y: Likewise.
7069 * src/print.c: Likewise.
7070 * src/print_graph.c: Likewise.
7071 * src/reader.c: Likewise.
7072 * src/reduce.c: Likewise.
7073 * src/relation.c: Likewise.
7074 * src/state.c: Likewise.
7075 * src/symlist.c: Likewise.
7076 * src/symtab.c: Likewise.
7077 * src/tables.c: Likewise.
7078 * src/uniqstr.c: Likewise.
7079 * src/vcg.c: Likewise.
7080
7081 * src/parse-gram.y: Fix minor problems uncovered by lint.
7082 (current_lhs, current_lhs_location): Now static.
7083 (current_assoc): Remove unused variable.
7084
7085 Cleanups so that Bison-generated parsers have less lint.
7086 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
7087 Prepend /*ARGSUSED*/, for lint's sake.
7088 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
7089 definition if 'lint' is defined.
7090 (YYID): New macro (or function, if lint).
7091 All uses of /*CONSTCOND*/0 replaced by YYID(0).
7092 * data/yacc.c: Likewise.
7093 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
7094 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
7095 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
7096 is C++ only.
7097 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
7098 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
7099 Use YYID(0) rather than 0, for lint.
7100 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
7101 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
7102
71032005-12-07 Paul Eggert <eggert@cs.ucla.edu>
7104
7105 * tests/glr-regression.at
7106 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
7107 Close memory leak reported by twlevo.
7108
71092005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
7110
7111 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
7112 all stacks.
7113 (yyparse): Iterate another stack in order to call user destructors.
7114 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7115 New test case.
7116 (Duplicated user destructor for lookahead): This test now is expected
7117 to succeed.
7118
71192005-12-01 Paul Eggert <eggert@cs.ucla.edu>
7120
7121 * NEWS: Document the following change.
7122 * data/yacc.c: Say "parser skeleton" rather than "file", since
7123 it's no longer just a file.
7124 * data/glr.c: Grant a special exception for C GLR parsers, that
7125 reads like the already-existing exception for C LALR(1) parsers.
7126 * data/glr.cc: Likewise.
7127 * data/lalr1.cc: Likewise.
7128 * data/location.cc: Likewise.
7129 * data/yacc.c: Reword the "written by" statement to clarify that
7130 it was the parser skeleton, not the entire output file.
7131 * data/glr.c: Written by Paul Hilfinger.
7132 * data/glr.cc: Written by Akim Demaille.
7133 * data/lalr1.cc: Likewise.
7134
71352005-11-18 Paul Eggert <eggert@cs.ucla.edu>
7136
7137 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
7138 Fix typos in previous change that broke 'make check'.
7139 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
7140 supported in C.
7141 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
7142 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
7143 We can revert this once things settle down.
7144
7145 * src/conflicts.c (conflicts_print): Don't print file name twice
7146 when %expect fails because there were no conflicts.
7147 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
7148 change.
7149 * tests/conflicts.at (%expect not enough, %expect too much):
7150 (%expect with reduce conflicts): Adjust to new behavior.
7151
71522005-11-18 Akim Demaille <akim@epita.fr>
7153
7154 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
7155 errors.
7156 * NEWS: Document this.
7157 * doc/bison.texinfo (Expect Decl): Likewise.
7158
71592005-11-16 Akim Demaille <akim@epita.fr>
7160
7161 Generalize the display of semantic values and locations in traces.
7162 * data/glr.c (yy_reduce_print): Fix indices (again).
7163 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
7164 literal integers.
7165 * data/lalr1.cc (yyreduce_print): Rename as...
7166 (yy_reduce_print): this.
7167 Display values and locations.
7168 * data/yacc.c (yy_reduce_print): Likewise.
7169 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
7170 (yysymprint): Move higher to be visible from yy_reduce_print).
7171 (yyparse): Adjust.
7172 * tests/calc.at: Adjust the expected length of the traces.
7173
71742005-11-14 Akim Demaille <akim@epita.fr>
7175
7176 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
7177 from 1 to N, while values and location start at 0.
7178 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
7179
71802005-11-14 Akim Demaille <akim@epita.fr>
7181
7182 * data/glr.c (yy_reduce_print): Fix the $ number.
7183
71842005-11-14 Akim Demaille <akim@epita.fr>
7185
7186 "Use" parse parameters.
7187 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
7188 * data/glr.c, data/glr.cc: Use them.
7189 * data/glr.c (YYUSE): Have a C++ definition that supports
7190 non-pointer types.
7191
71922005-11-14 Akim Demaille <akim@epita.fr>
7193
7194 * data/glr.c (yyexpandGLRStack): Declare only if defined.
7195
71962005-11-14 Akim Demaille <akim@epita.fr>
7197
7198 * data/glr.cc: New.
7199 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
7200
72012005-11-12 Akim Demaille <akim@epita.fr>
7202
7203 Let position and location be PODs.
7204 * data/location.cc (position::initialize, location::initialize): New.
7205 (position::position, location::location): Define only if
7206 b4_location_constructors is defined.
7207 * data/lalr1.cc (b4_location_constructors): Define it for backward
7208 compatibility.
7209 * doc/bison.texinfo (Initial Action Decl): Use initialize.
7210
72112005-11-12 Akim Demaille <akim@epita.fr>
7212
7213 * data/lalr1.cc: Move the body of the ctor and dtor into the
7214 parser file (instead of the header).
7215 Wrap the implementations in a "namespace yy".
7216
72172005-11-12 Akim Demaille <akim@epita.fr>
7218
7219 Have glr.c include its header file when created.
7220 * data/glr.c (b4_shared_declarations): New.
7221 Output them verbatim in the parser if !%defines, otherwise
7222 output then in the header file, and include it instead.
7223
72242005-11-11 Akim Demaille <akim@epita.fr>
7225
7226 * data/glr.c: Comment changes.
7227
72282005-11-11 Akim Demaille <akim@epita.fr>
7229
7230 When yydebug, report semantic and location values for reductions.
7231 * data/glr.c (yy_reduce_print): Report the semantic values and the
7232 locations.
7233 (YY_REDUCE_PRINT): Adjust.
7234 (yyglrReduce): Use them.
7235 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
7236 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
7237 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
7238 traces.
7239
72402005-11-10 Akim Demaille <akim@epita.fr>
7241
7242 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
7243 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
7244 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
7245
72462005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
7247
7248 * m4/cxx.m4, examples/Makefile.am: Don't build
7249 examples/calc++ if no C++ compiler is available. (trivial change)
7250
72512005-11-09 Akim Demaille <akim@epita.fr>
7252
7253 * src/scan-skel.l: Use a couple of asserts.
7254
72552005-11-03 Akim Demaille <akim@epita.fr>
7256
7257 In some (weird) cases, the final state number is incorrect.
7258 Reported by Alexandre Duret-Lutz.
7259 * src/LR0.c (state_list_append): Remove the computation of
7260 final_state.
7261 (save_reductions): Do it here.
7262 (get_state): Alpha conversion.
7263 (generate_states): Use a for loop.
7264 * src/gram.h (item_number_is_rule_number)
7265 (item_number_is_symbol_number): New.
7266 * src/state.c: Use assert.
7267 * src/system.h: Include assert.h.
7268 * tests/sets.at (Accept): New.
7269
72702005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7271
7272 * data/glr.c (yyfill): Adjust comment.
7273 (yyresolveAction): Initialize default location properly
7274 for empty right-hand sides.
7275 (yydoAction): Ditto.
7276 Add comment explaining apparently dead code.
7277 * tests/glr-regression.at
7278 (Incorrectly initialized location for empty right-hand side in GLR):
7279 New test.
7280
72812005-10-30 Paul Eggert <eggert@cs.ucla.edu>
7282
7283 * bootstrap (cleanup_gnulib): New function. Use it to clean up
7284 gnulib when interrupted. This fixes some race conditions and
7285 works around some portability problems (one noted by Paul
7286 Hilfinger).
7287
72882005-10-22 Akim <akim@epita.fr>
7289
7290 * Makefile.cfg: Adjust to config -> build-aux.
7291 Reported by twledo.
7292
72932005-10-21 Akim Demaille <akim@epita.fr>
7294
7295 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
7296 the %parse-params.
7297 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
7298 * data/yacc.c (b4_Pure_if): Rename as...
7299 (b4_yacc_pure_if): this.
7300 (YY_SYMBOL_PRINT, yyparse): Adjust.
7301 * doc/bison.texinfo: Formatting changes.
7302
73032005-10-21 Akim Demaille <akim@epita.fr>
7304
7305 Finish the transition config -> build-aux.
7306 * configure.ac, Makefile.am: Use build-aux.
7307 * config/prev-version, config/announce-gen, config/Makefile.am:
7308 Move to...
7309 * build-aux/prev-version, build-aux/announce-gen,
7310 * build-aux/Makefile.am: here.
7311
73122005-10-14 Akim Demaille <akim@epita.fr>
7313
7314 * examples/calc++/test: Use set -x only when VERBOSE.
7315
73162005-10-13 Paul Eggert <eggert@cs.ucla.edu>
7317
7318 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
7319 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
7320
73212005-10-13 Akim Demaille <akim@epita.fr>
7322
7323 * src/scan-skel.l: Output the base name parts of the parser and
7324 header file names.
7325 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7326 additional checks.
7327 Use this to exercise C++ outputs in subdirs.
7328 Reported by Oleg Smolsky.
7329
73302005-10-12 Paul Eggert <eggert@cs.ucla.edu>
7331
7332 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
7333 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
7334 Problem reported by John P. Hartmann.
7335 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
7336 already defined it.
7337
73382005-10-12 Akim Demaille <akim@epita.fr>
7339
7340 * src/parse-gram.y (version_check): Exit 63 to please missing
7341 (stands for "version mismatch).
7342 * tests/input.at, doc/bison.texinfo: Adjust.
7343
73442005-10-10 Paul Eggert <eggert@cs.ucla.edu>
7345
7346 Work around portability problems with Visual Age C compiler
7347 (xlc and xlC_r) reported by John P. Hartmann.
7348 * data/location.cc (initial_column, initial_line): Remove.
7349 All uses replaced by 0 and 1.
7350 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
7351 that xlc complains about.
7352 * src/scan-skel.l (skel_wrap): Likewise.
7353 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
7354 as __STDC__.
7355 * data/yacc.c (YYMODERN_C): New macro, which also looks at
7356 __STDC_VERSION__. Use it everywhere instead of looking at
7357 __STDC__ and __cplusplus.
7358
73592005-10-10 Akim Demaille <akim@epita.fr>
7360
7361 * examples/calc++/test: Be quiet unless VERBOSE.
7362
73632005-10-05 Paul Eggert <eggert@cs.ucla.edu>
7364
7365 * data/c.m4 (yydestruct, yysymprint):
7366 Use YYUSE instead of casting to void.
7367 * data/glr.c (YYUSE): New macro.
7368 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7369 Use it instead of rolling our own.
7370 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7371 (YYCHK1):
7372 Use /*CONSTCOND*/ to suppress lint warnings.
7373 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7374 (YY_STACK_PRINT): Use 'false' not '0'.
7375 (YYUSE): New macro.
7376 (yysymprint_, yydestruct_): Use it instead of rolling our own.
7377 * data/yacc.c (YYUSE): New macro.
7378 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
7379 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
7380 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
7381
7382
7383 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
7384 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
7385
73862005-10-04 Paul Eggert <eggert@cs.ucla.edu>
7387
7388 Undo the parts of the unlocked-I/O change that substituted
7389 putc or puts for printf. This might hurt performance a bit,
7390 but some people prefer the printf style.
7391 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
7392 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
7393 All uses replaced by YYFPRINTF and YYDPRINTF.
7394 * data/yacc.c: Likewise.
7395 * lib/bitset.c (bitset_print): Likewise.
7396 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
7397 putc and puts.
7398 * lib/lbitset.c (debug_lbitset): Likewise.
7399 * src/closure.c (print_firsts, print_fderives): Likewise.
7400 * src/gram.c (grammar_dump): Likewise.
7401 * src/lalr.c (look_ahead_tokens_print): Likewise.
7402 * src/output.c (escaped_output): Likewise.
7403 (user_actions_output): Break apart two printfs.
7404 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
7405 * src/reduce.c (reduce_print): Likewise.
7406 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
7407 * src/system.h: Include unlocked-io.h rathe than stdio.h.
7408
7409 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7410 Use assignments rather than casts-to-void to suppress
7411 unused-variable warnings. This pacifies 'lint'.
7412 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
7413 unused-variable warnings.
7414
74152005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7416
7417 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7418
74192005-10-02 Paul Eggert <eggert@cs.ucla.edu>
7420
7421 Use unlocked I/O for a minor performance improvement on hosts like
7422 GNU/Linux and Solaris that support unlocked I/O. The basic idea
7423 is to use the gnlib unlocked-io module, and to prefer putc and
7424 puts to printf when either will work (since the latter doesn't
7425 come in an unlocked flavor).
7426 * bootstrap (gnulib_modules): Add unlocked-io.
7427 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
7428 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
7429 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
7430 and similarly for puts and putc and printf.
7431 * data/yacc.c: Likewise.
7432 * lib/bitset.c (bitset_print): Likewise.
7433 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
7434 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
7435 to printf.
7436 * lib/lbitset.c (debug_lbitset): Likewise.
7437 * src/closure.c (print_firsts, print_fderives): Likewise.
7438 * src/gram.c (grammar_dump): Likewise.
7439 * src/lalr.c (look_ahead_tokens_print): Likewise.
7440 * src/output.c (escaped_output): Likewise.
7441 (user_actions_output): Coalesce two printfs.
7442 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
7443 * src/reduce.c (reduce_print): Likewise.
7444 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
7445 * src/system.h: Include unlocked-io.h rather than stdio.h.
7446
7447 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
7448 this confuses xgettext.
7449
74502005-10-02 Akim Demaille <akim@epita.fr>
7451
7452 * bootstrap (gnulib_modules): Add strverscmp.
7453 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
7454 * m4/.cvsignore: Add strverscmp.m4.
7455 * src/parse-gram.y (%require): New token, new rule.
7456 (version_check): New.
7457 * src/scan-gram.l (%require): Adjust.
7458 * tests/input.at (AT_REQUIRE): New.
7459 Use it.
7460 * doc/bison.texinfo (Require Decl): New.
7461 (Calc++ Parser): Use %require.
7462
74632005-10-02 Akim Demaille <akim@epita.fr>
7464
7465 * data/location.cc: New.
7466
74672005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
7468 Akim Demaille <akim@epita.fr>
7469
7470 Make sure -odir/foo.cc creates dir/location.hh etc.
7471 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
7472 (spec_file_prefix, spec_verbose_file, spec_graph_file)
7473 (spec_defines_file): Now const.
7474 (dir_prefix): New.
7475 (short_base_name): Remove.
7476 * src/files.c: Adjust.
7477 (dirname.h): Include.
7478 (base_name): Don't prototype it.
7479 (finput): Remove, duplicates gram_in.
7480 (full_base_name, short_base_name): Replace by...
7481 (all_but_ext, all_but_tab_ext): these.
7482 (compute_base_names): Rename as...
7483 (compute_file_name_parts): this.
7484 Update to compute the new variables, including dir_prefix.
7485 Adjust dependencies.
7486 * src/output.c (prepare): Output them.
7487 * src/reader.c: Adjust to use gram_in, not finput.
7488 * src/scan-skel.l (@dir_prefix@): New.
7489
74902005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7491
7492 * lib/subpipe.c: New function end_of_output_subpipe() added
7493 to allow support for non-posix systems. This is a no-op function
7494 for posix systems.
7495
7496 * lib/subpipe.h: New function end_of_output_subpipe() added
7497 to allow support for non-posix systems. This is a no-op function
7498 for posix systems.
7499
7500 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
7501 handle the lack of pipe/fork functionality on non-posix systems.
7502
7503 * djgpp/Makefile.maint: DJGPP specific file.
7504
7505 * djgpp/README.in: DJGPP specific file.
7506
7507 * djgpp/config.bat: DJGPP specific configuration file.
7508
7509 * djgpp/config.sed: DJGPP specific configuration file.
7510
7511 * djgpp/config.site: DJGPP specific configuration file.
7512
7513 * djgpp/config_h.sed: DJGPP specific configuration file.
7514
7515 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
7516
7517 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
7518
75192005-10-02 Akim Demaille <akim@epita.fr>
7520
7521 * data/location.cc: New, extract from...
7522 * data/lalr1.cc: here.
7523 (location.hh): Include it after the user prologue, in case the
7524 filename type is defined by the user.
7525 Forward declation location and position before the pre-prologue.
7526 (yyresult_): Rename as...
7527 (yyresult): this, it's a local variable, not an attribute.
7528 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
7529
75302005-10-01 Akim Demaille <akim@epita.fr>
7531
7532 * examples/extexi: Restore the #line generation.
7533
75342005-09-30 Akim Demaille <akim@epita.fr>,
7535 Alexandre Duret-Lutz <adl@gnu.org>
7536
7537 Move the token type and YYSTYPE in the parser class.
7538 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
7539 (parser::token): New, from the moved free definition of tokens.
7540 (parser::semantic_value): Now a full definition instead of an
7541 indirection to YYSTYPE.
7542 (b4_post_prologue): No longer included in the header file, but
7543 in the implementation file.
7544 * doc/bison.texi (C+ Language Interface): Update.
7545 * src/parse-gram.y: Support unary %define.
7546 * tests/actions.at: Define global_tokens_and_yystype for backward
7547 compatibility until we update the tests.
7548 * tests/calc.at: Idem.
7549 (first_line, first_column, last_line, last_column): Define for lalr1.cc
7550 to simplify the code.
7551
75522005-09-29 Paul Eggert <eggert@cs.ucla.edu>
7553
7554 Port to SunOS 4.1.4, which lacks strtoul and strerror.
7555 Ah, the good old days! Problem reported by Peter Klein.
7556 * bootstrap (gnulib_modules): Add strerror, strtoul.
7557 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
7558 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
7559
75602005-09-29 Akim Demaille <akim@epita.fr>
7561
7562 * data/c.m4 (b4_error_verbose_if): New.
7563 * data/lalr1.cc: Use it.
7564 (YYERROR_VERBOSE_IF): Remove.
7565 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
7566 parser members, replaced by...
7567 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
7568 local variables.
7569 (yysyntax_error_): Takes the state number as argument.
7570 (yyreduce_print_): Use the argument yyrule, not the former
7571 attribute yyn_.
7572
75732005-09-26 Paul Eggert <eggert@cs.ucla.edu>
7574
7575 * bootstrap (gnulib_modules): Add verify.
7576 * lib/.cvsignore: Add verify.h.
7577 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
7578 * src/system.h (verify): Remove.
7579 Include verify.h instead.
7580 * src/tables.c (tables_generate): Use new API for 'verify'.
7581
75822005-09-21 Paul Eggert <eggert@cs.ucla.edu>
7583
7584 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
7585 local variables whose names begin with 'yy'.
7586 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
7587 Trivial changes from Joel E. Denny.
7588
7589 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
7590 it itself.
7591 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
7592 don't use alloca any more.
7593
7594 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
7595 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
7596 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
7597 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
7598 to match yacc.c, to test more hosts.
7599
76002005-09-20 Paul Eggert <eggert@cs.ucla.edu>
7601
7602 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
7603 doesn't affect behavior.
7604 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
7605 Solaris, AIX, MSC.
7606 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
7607 This works a bit better with glibc, if user code has already included
7608 stdlib.h.
7609 * doc/bison.texinfo (Bison Parser): Document that users can't
7610 arbitrarily use malloc and free for other purposes. Document
7611 that <alloca.h> and <malloc.h> might be included.
7612 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
7613 user must declare alloca.
7614
7615 * HACKING (release): Forwarn the Translation Project about
7616 stable releses.
7617
76182005-09-20 Akim Demaille <akim@epita.fr>
7619
7620 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
7621
76222005-09-19 Paul Eggert <eggert@cs.ucla.edu>
7623
7624 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
7625 (YYSTACK_ALLOC_MAXIMUM): Use it.
7626 (yysyntax_error): New function.
7627 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
7628 multiple syntax errors are reported, and alloca is being used.
7629 Instead, reallocate buffers twice as big each time, so that
7630 we waste at most half the allocated memory. Start with a small
7631 (128-byte) buffer that will suffice in most cases anyway.
7632 Use yysyntax_error to do most of the work.
7633
7634 * doc/bison.texinfo (Error Reporting, Table of Symbols):
7635 yynerrs is the number of errors reported, not the number of
7636 errors encountered.
7637
7638 * tests/glr-regression.at (Duplicated user destructor for lookahead):
7639 Mark it as expected to fail.
7640 Cast result of malloc; problem reported by twlevo@xs4all.nl.
7641 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
7642 Don't start user-code symbols with "yy", to avoid name space problems.
7643
76442005-09-19 Akim Demaille <akim@epita.fr>
7645
7646 Remove the traits, failed experiment.
7647 It never proved useful, and anyway because of the current
7648 definition, it was not possible to have several specialization of
7649 this traits, making it useless.
7650 * data/lalr1.cc (yy:traits): Remove.
7651 Inline its definitions in the parser class.
7652
76532005-09-19 Akim Demaille <akim@epita.fr>
7654
7655 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
7656 least Mac OSX with a /usr/local install of gettext.
7657
76582005-09-19 Akim Demaille <akim@epita.fr>
7659
7660 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
7661 and yytoken for similarity with the other skeletons.
7662
76632005-09-19 Akim Demaille <akim@epita.fr>
7664
7665 * NEWS, configure.ac: update version number to 2.1a.
7666
76672005-09-16 Paul Eggert <eggert@cs.ucla.edu>
7668
7669 * NEWS: Version 2.1.
7670
7671 * NEWS: Remove notice of yytname change, since it was never in an
7672 official release.
7673 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
7674 diagnostic.
7675 * src/output.c (prepare): Likewise.
7676 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
7677 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
7678 is not defined. This is an awful hack, but it's enough for now.
7679 All callers changed.
7680 * tests/glr-regression-at (make_value): Args are const pointers now,
7681 to avoid GCC warning.
7682 (Duplicated user destructor for lookahead): New test. Currently
7683 skipped. It fails on my host but I'm not sure it'll always fail.
7684
76852005-09-16 Akim Demaille <akim@epita.fr>
7686
7687 * src/symtab.h (struct symbol): Declare the printer and destructor
7688 as const, to avoid accidental calls to free.
7689 (symbol_destructor_set, symbol_printer_set): Adjust.
7690 * src/symtab.c: Adjust.
7691
76922005-09-16 Akim Demaille <akim@epita.fr>
7693
7694 * data/c.m4 (b4_token_enums): New.
7695 (b4_token_defines): Rename as...
7696 (b4_token_enums_defines): this.
7697 (b4_token_defines): New, output only the #defines.
7698 * data/yacc.c, data/glr.c: Adjust.
7699 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
7700 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
7701 as default values.
7702
77032005-09-16 Akim Demaille <akim@epita.fr>
7704
7705 * data/lalr1.cc (yylex_): Remove, inline its code.
7706 (yyreport_syntax_error_): Remove, replaced by...
7707 (yysyntax_error_): this which returns a string and leaves to the
7708 caller the call to the users' error function.
7709 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
7710 Move from members of the parser object...
7711 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
7712 to local variables of the parse function.
7713
77142005-09-16 Akim Demaille <akim@epita.fr>
7715
7716 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
7717 since it's in Bison's name space.
7718
77192005-09-15 Paul Eggert <eggert@cs.ucla.edu>
7720
7721 * data/glr.c (yyresolveValue): Add default case to pacify
7722 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
7723
7724 * NEWS: Document when yyparse started to return 2.
7725 * doc/bison.texinfo (Parser Function): Document when yyparse
7726 returns 2.
7727
7728 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
7729 (b4_filename_type): Renamed back from b4_file_name_type. All uses
7730 changed.
7731 (class position): file_name -> filename (reverting). All uses changed.
7732
77332005-09-14 Paul Eggert <eggert@cs.ucla.edu>
7734
7735 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
7736 do anything if $@ exists. This reverts part of the 2005-07-07
7737 patch.
7738
77392005-09-11 Paul Eggert <eggert@cs.ucla.edu>
7740
7741 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
7742 contains obsolete information and isn't worth distributing as a
7743 separate file anyway.
7744 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
7745 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
7746 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
7747 (yyparse): Abort if user code uses longjmp to throw an unexpected
7748 value.
7749
77502005-09-09 Paul Eggert <eggert@cs.ucla.edu>
7751
7752 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
7753 Suggested by twlevo@xs4all.nl.
7754
7755 * data/glr.c (YYCHK1): Do not assume YYE is in range.
7756 This avoids a diagnostic from gcc -Wswitch-enum.
7757 Problem reported by twlevo@xs4all.nl.
7758
7759 * doc/bison.texinfo: Don't use "filename", as per GNU coding
7760 standards. Use "file name" or "file" or "name", depending on
7761 the context.
7762 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
7763 not to hack/foo.tab.c.
7764 (Calc++ Top Level): 2nd arg of main is not const.
7765 * data/glr.c: b4_filename -> b4_file_name.
7766 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
7767 All uses changed.
7768 (class position): filename -> file_name. All uses changed.
7769 * data/yacc.c: b4_filename -> b4_file_name.
7770 * lib/bitset.h: filename -> file_name in local vars.
7771 * lib/bitset_stats.c: Likewise.
7772 * src/files.c: Likewise.
7773 * src/scan-skel.l ("@output ".*\n): Likewise.
7774 * src/files.c (file_name_split): Renamed from filename_split.
7775 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
7776
77772005-09-08 Paul Eggert <eggert@cs.ucla.edu>
7778
7779 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
7780 to accommodate latest gnulib.
7781
7782 * tests/glr-regression.at (Duplicate representation of merged trees):
7783 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
7784
7785 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
7786 needed.
7787
77882005-08-26 Paul Eggert <eggert@cs.ucla.edu>
7789
7790 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
7791 All uses changed. Invoke user destructor after an error during a
7792 split parse (trivial change from Joel E. Denny).
7793
7794 * tests/glr-regression.at
7795 (User destructor after an error during a split parse): New test case.
7796 Problem reported by Joel E. Denny in:
7797 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
7798
77992005-08-25 Paul Eggert <eggert@cs.ucla.edu>
7800
7801 * README-cvs: Give URLs for recommended tools.
7802 Mention Gzip version problem, and bootstrapping issues.
7803 Remove troubleshooting section, as it's somewhat obsolete.
7804
7805 * bootstrap (no_cache): New var, to accommodate different wget
7806 variants. Use it instead of '-C off'. Problem reported by
7807 twlevo@xs4all.nl.
7808
7809 * data/glr.c (yydestroyStackItem): New function.
7810 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
7811 debugging information. Problem reported by Joel E. Denny.
7812
78132005-08-25 Akim Demaille <akim@epita.fr>
7814
7815 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
7816
78172005-08-24 Paul Eggert <eggert@cs.ucla.edu>
7818
7819 * data/glr.c (yyrecoverSyntaxError, yyreturn):
7820 Don't invoke destructor on unresolved entries.
7821 * tests/glr-regression.at
7822 (User destructor for unresolved GLR semantic value): New test case.
7823 Problem reported by Joel E. Denny in:
7824 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
7825
78262005-08-21 Paul Eggert <eggert@cs.ucla.edu>
7827
7828 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
7829 Add strnlen.c.
7830 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
7831 lib-prefix.m4, po.m4.
7832
7833 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
7834 in yydestruct diagnostic, since it might not be an error.
7835 Problem reported by Joel Denny near end of
7836 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
7837 * data/lalr1.cc (yyerturn): Likewise.
7838 * data/yacc.c (yyreturn): Likewise.
7839 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
7840
7841 * src/files.c: Remove obsolete FIXME comment.
7842
7843 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
7844 with the other templates, and to fix bogus run-on messages such
7845 as the one reported at the end of
7846 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
7847 All callers changed to avoid the newline.
7848 (yyprocessOneStack): Output two lines rather than one, to accommodate
7849 the above change. This changes the debug output format slightly.
7850
7851 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
7852 reported by Joel E. Denny in
7853 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
7854 (trivial change).
7855 * tests/glr-regression.at (Duplicate representation of merged trees):
7856 New test, from Joel E. Denny in:
7857 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
7858 * THANKS: Add Joel E. Denny.
7859
7860 * configure.ac (AC_INIT): Bump to 2.0c.
7861
78622005-07-24 Paul Eggert <eggert@cs.ucla.edu>
7863
7864 * NEWS: Version 2.0b.
7865
7866 * Makefile.am (SUBDIRS): Put examples before tests, so that
7867 "make check" doesn't finish with "All 1 tests passed".
7868
7869 * tests/regression.at (Token definitions): Don't rely on
7870 AT_PARSER_CHECK for data that contains backslashes. It currently
7871 uses 'echo', and 'echo' isn't portable if its argument contains
7872 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
7873 that the byte '\0xff' is not printable in the C locale; it is,
7874 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
7875 not printable, so use '\0x81' to test.
7876
7877 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
7878 version of GCC, since the macro is used with non-GCC compilers.
7879
7880 Fix core dump reported by Pablo De Napoli in
7881 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
7882 * tests/regression.at (Invalid inputs with {}): New test.
7883 * src/parse-gram.y (token_name): Translate type before using
7884 it as an index.
7885
7886 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
7887 the user's name space. All uses changed to __attribute__
7888 ((__unused__)).
7889 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
7890 Add __attribute__ ((__noreturn__)).
7891
7892 * etc/clcommit: Remove. We weren't using it, and it failed
7893 "make maintainer-distcheck".
7894 * Makefile.maint: Merge from coreutils.
7895 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
7896 (syntax-check-rules): Change list of rules as described below.
7897 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
7898 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
7899 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
7900 (sc_trailing_space): New rules.
7901 (sc_xalloc_h_in_src): Remove.
7902 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
7903 (sc_space_tab, sc_error_exit_success, sc_changelog):
7904 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
7905 (makefile-check, po-check, author_mark_check):
7906 (makefile_path_separator_check, copyright-check):
7907 Use grep -n, to make it easier to find violations.
7908 Use CVS_LIST and CVS_LIST_EXCEPT.
7909 (header_regexp, h_re): Remove.
7910 (dd_c): New macro.
7911 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
7912 (my-distcheck): Use more-modern GCC flags.
7913 (signatures, %.asc): Remove.
7914 (rel-files, announcement): Remove signatures.
7915 Restore old updating code, even though we don't use it, so
7916 that we're the same as coreutils.
7917 (alpha, beta, major): Depend on news-date-check.
7918 Make the upload commands.
7919
7920 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
7921 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
7922 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
7923 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
7924 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
7925 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
7926 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
7927 * tests/sets.at: Likewise.
7928
7929 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
7930 we comment out the Autoconf version number.
7931 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
7932 it's error-prone and "make maintainer-distcheck" rejects it.
7933
7934 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
7935 Indent calls to "error" to pacify "make maintainer-distcheck",
7936 when the calls are not intended to be translated.
7937 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
7938
7939 * src/Makefile.am (DEFS): Use +=, to pacify
7940 "make maintainer-distcheck".
7941 (bison_SOURCES): Add scan-skel.h.
7942 (sc_tight_scope): New rule, from coreutils.
7943
7944 * src/files.c (src_extension, header_extension):
7945 Now static, not extern.
7946 * src/getargs.c (short_options): Likewise.
7947 * src/muscle_tab.c (muscle_table): Likewise.
7948 * src/parse-gram.y (current_class, current_type, current_prec):
7949 Likewise.
7950 * src/reader.c (grammar_end, previous_rule_end): Likewise.
7951 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
7952 * src/main.c (main): Cast bindtextdomain and textdomain calls to
7953 void, to avoid warning when NLS is disabled.
7954 * src/output.c: Include scan-skel.h.
7955 (scan_skel): Remove decl, since scan-skel.h does this.
7956 (output_skeleton):
7957 Indent calls to "error" to pacify "make maintainer-distcheck".
7958 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
7959 * src/reader.h (gram_end, gram_lineno): New decls to pacify
7960 "make maintainer-distcheck".
7961 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
7962 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
7963 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
7964 (skel_lex_destroy, scan_skel): Move these decls to...
7965 * src/scan-skel.h: New file.
7966 * src/uniqstr.c (uniqstr_assert):
7967 Indent calls to "error" to pacify "make maintainer-distcheck".
7968
7969 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
7970 not @VAR@.
7971
7972 * tests/torture.at: Revamp to avoid misuse of atoi that
7973 "make maintainer-distcheck" complained about.
7974
7975 * examples/extexi (message): Don't print a message more than once,
7976 and omit line-number decoration that makes Emacs compile think
7977 that informative messages are worth worrying about.
7978
79792005-07-22 Paul Eggert <eggert@cs.ucla.edu>
7980
7981 * configure.ac: Update version number.
7982
7983 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
7984 accidentally.
7985 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
7986 autogenerated by the maintainer.
7987 * examples/calc++/.cvsignore: Add *.yy.
7988
7989 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
7990 * lib/bitset_stats.c (bitset_stats_init): Likewise.
7991 * lib/bitsetv.c (bitsetv_alloc): Likewise.
7992
7993 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
7994
7995 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
7996 from maintainer-distcheck about casting the argument of 'free'.
7997
7998 * NEWS: Mention recent yytname changes.
7999 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
8000
8001 * bootstrap: For translations that have not yet been upgraded to
8002 the new runtime-po domain, prime the pump by extracting the
8003 relevant strings from the obsolete translations. This code can be
8004 removed once the bison-runtime domain has been translated by each
8005 team.
8006
8007 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
8008 now that token names are already quoted.
8009
8010 Fix problem reported by Anthony Heading.
8011 * data/glr.c (YYTOKEN_TABLE): New macro.
8012 (yytname): Define if YYTOKEN_TABLE.
8013 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
8014 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
8015 (YYERROR_VERBOSE): Define the same way the other skeletons do.
8016 * src/output.c (prepare_symbols): Output token_table_flag.
8017
80182005-07-21 Paul Eggert <eggert@cs.ucla.edu>
8019
8020 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
8021 again if the first call fails.
8022
8023 * data/glr.c (yytnamerr): New function.
8024 (yyreportSyntaxError): Use it to dequote most string literals.
8025 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
8026 with other skeletons. All uses changed.
8027 (yytnameerr_): New function.
8028 (yyreport_syntax_error): Use it to dequote most string literals.
8029 * data/yacc.c (yytnamerr): New function.
8030 (yyerrlab): Use it to decode most string literals.
8031 * doc/bison.texinfo (Decl Summary, Calling Convention):
8032 Clarify quoting convention of yytname.
8033 * src/output.c (prepare_symbols): Quote all names. This undoes
8034 the 2005-04-17 change, which is now accomplished (mostly) via
8035 changes in the parsers as described above.
8036 * tests/regression.at (Token definitions, Web2c Actions):
8037 Undo most 2005-04-17 change here, too.
8038
80392005-07-20 Paul Eggert <eggert@cs.ucla.edu>
8040
8041 Fix more problems reported by twlevo@xs4all.nl.
8042 * tests/cxx-type.at: Don't pipe output of ./types through sed to
8043 remove trailing spaces. This loses the exit status of ./types,
8044 and isn't needed since ./types shouldn't be emitting trailing
8045 spaces.
8046 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
8047 as the stack isn't valid in that case.
8048
8049 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8050 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8051 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8052 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
8053 is used.
8054 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
8055 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8056 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8057 Likewise.
8058
8059 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
8060 overly-picky compilers that reject 'char *foo = "bar";'.
8061
8062 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
8063 to FILE * parameter, not to stderr. This fixes a typo introduced
8064 in the 2005-07-12 change.
8065
8066 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
8067 warnings from GCC 4.
8068
8069 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
8070 (yyglrShiftDefer, yysplitStack):
8071 Remove unused parameters b4_pure_formals. All uses changed.
8072 (yyglrShift): Remove unused parameters b4_user_formals.
8073 All uses changed.
8074 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
8075
80762005-07-18 Paul Eggert <eggert@cs.ucla.edu>
8077
8078 Destructor cleanups and regularization among the three skeletons.
8079 * NEWS: Document the behavior changes.
8080 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
8081 stack before failing, as the cleanup code will do it for us now.
8082 * data/lalr1.cc (yyerrlab): Likewise.
8083 * data/glr.c (yyparse): Pop everything off the stack before
8084 freeing it, so that destructors get called properly.
8085 * data/lalr1.cc (yyreturn): Likewise.
8086 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
8087 This is more consistent.
8088 * doc/bison.texinfo (Destructor Decl): Mention more reasons
8089 why destructors might be called. 1.875 -> 2.1.
8090 (Destructor Decl, Decl Summary, Table of Symbols):
8091 Some English-language cleanups for %destructor.
8092 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8093 Add output line for destructor of start symbol.
8094 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
8095 because of that same extra output line.
8096
8097 * NEWS: Document minor wording changes in diagnostics of
8098 Bison-generated parsers.
8099 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
8100 Remove unused formals. All uses changed.
8101 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
8102 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
8103 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
8104 Rename yyoverflowab to yyexhaustedlab.
8105 When memory exhaustion occurs during syntax-error reporting,
8106 report it separately rather than in a single diagnostic; this
8107 eases translation.
8108 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
8109 (Memory Exhausted): Renamed from Parser Stack Overflow.
8110 Revamp wording slightly to prefer "memory exhaustion".
8111 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
8112
8113 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
8114
8115 Add i18n support to the GLR skeleton. Partially fix the C++
8116 skeleton; a C++ expert needs to finish this. Remove debugging
8117 msgids; there's little point to having them translated, since they
8118 can be understood only by someone who can read the
8119 (English-language) source code.
8120
8121 Generate runtime-po/bison-runtime.pot automatically, so that we
8122 don't have to worry about garbage getting in that file. We'll
8123 make sure after the next official release that old msgids don't
8124 get lost. See
8125 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
8126
8127 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
8128 Now auto-generated.
8129 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
8130 Fix typos in explanations of the runtime file.
8131 * bootstrap: Change gettext keyword from YYI18N to YY_.
8132 Use standard Makefile.in.in in runtime-po, since we'll arrange
8133 for backward-compatible bison-runtime.po files in a different way.
8134 * data/glr.c (YY_): New macro, from yacc.c.
8135 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
8136 Translate messages intended for users.
8137 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
8138 the wording in the other skeletons. We don't know that the memory
8139 is virtual.
8140 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
8141 Use same method that yacc.c uses.
8142 Don't translate debugging messages.
8143 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
8144 it doesn't work (yet), and requires C++ expertise to fix.
8145 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
8146 Move defn to a more logical place, to be consistent with other
8147 skeletons.
8148 Don't translate debugging messages.
8149 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
8150 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
8151 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
8152 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
8153
8154 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
8155 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
8156 void, not int.
8157 * tests/glr-regression.at (Badly Collapsed GLR States):
8158 Likewise.
8159 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8160 yylex should return 0 at EOF rather than aborting.
8161
8162 Improve tests for stack overflow in GLR parser.
8163 Problem reported by twlevo@xs4all.nl.
8164 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
8165 All uses removed.
8166 (yyStackOverflow): Just longjmp, but with value 2 so that caller
8167 can handle the problem.
8168 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
8169 (yyparse): New local variable yyresult to record the result.
8170 Use result of setjmp to set it, rather than storing itinto
8171 struct.
8172 (yyDone): Remove label.
8173 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
8174 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
8175 if YYABORT is used).
8176 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
8177 yyparse status; put status > 1 into diagnostic.
8178 Check that status==2 works.
8179 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
8180 Use exit status 3 for failure to open (which shouldn't happen).
8181
81822005-07-17 Paul Eggert <eggert@cs.ucla.edu>
8183
8184 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
8185 1 on syntax error; just let yyparse do its thing.
8186 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
8187 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
8188 (Exploding the Stack Size with Alloca):
8189 (Exploding the Stack Size with Malloc):
8190 Expect exit status 2, not 1, since the parser is supposed to blow
8191 its stack. Problem reported by twlevo@xs4all.nl.
8192
8193 * data/glr.c (yyparse): Don't assume that the initial calls
8194 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
8195 Print a stack-overflow message and fail instead.
8196 Initialize the line-number information before creating the stack,
8197 so that the stack-overflow message can report line zero safely.
8198
81992005-07-14 Paul Eggert <eggert@cs.ucla.edu>
8200
8201 Fix problems reported by twlevo@xs4all.nl.
8202 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
8203 (yyuserMerge): Provide a default case if b4_mergers is empty.
8204 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
8205 * tests/glr-regression.at
8206 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8207 Add casts to pacify C++ compilers.
8208 * tests/glr-regression.at (Improper merging of GLR delayed action
8209 sets): Declare yylex before using it.
8210 * tests/Makefile.am (maintainer-check-g++): Fix a stray
8211 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
8212 test for valgrind; valgrind is independent of g++.
8213 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
8214 for compatibility with POSIX 1003.1-2001 (if running coreutils).
8215 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
8216 Use a destructor, so that we can expand the stack. Change
8217 YYSTYPE to char * so that we can free it. Cast result of malloc.
8218
82192005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8220
8221 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
8222 a valgrind failure. Problem reported by twlevo@xs4all.nl.
8223
82242005-07-13 Paul Eggert <eggert@cs.ucla.edu>
8225
8226 * PACKAGING: New file, suggested by Bruno Haible and taken from
8227 similar wording in gettext's PACKAGING file.
8228 * NEWS: Mention PACKAGING.
8229 * Makefile.am (EXTRA_DIST): Add PACKAGING.
8230
82312005-07-12 Paul Eggert <eggert@cs.ucla.edu>
8232
8233 * NEWS: Document recent i18n improvements.
8234 * bootstrap: Get runtime translations into runtime-po.
8235 Create runtime-po files automatically, if possible.
8236 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
8237 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
8238 does not infringe on the user's name space.
8239 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
8240 * doc/bison.texinfo (Internationalization): Revamp the English
8241 and Texinfo syntax a bit, to try to make it clearer.
8242 (Bison Options, Option Cross Key): Mention --print-localedir.
8243 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
8244 YYENABLE_NLS. Quote a bit more.
8245 * runtime-po/.cvsignore: New file.
8246 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
8247 * runtime-po/Rules-quot: Remove; now created by bootstrap.
8248 * runtime-po/quot.sed: Likewise.
8249 * runtime-po/boldquot.sed: Likewise.
8250 * runtime-po/en@quot.header: Likewise.
8251 * runtime-po/en@boldquot.header: Likewise.
8252 * runtime-po/insert-header.sin: Likewise.
8253 * runtime-po/remove-potcdate.sin: Likewise.
8254 * runtime-po/Makevars: Likewise.
8255 * runtime-po/LINGUAS: Likewise.
8256 * runtime-po/de.po: Likewise; we will rely on the translation project
8257 to maintain this, so "bootstrap" should get it.
8258 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
8259 its value.
8260 * src/main.c (main): Bind the bison-runtime domain, too.
8261
82622005-07-12 Bruno Haible <bruno@clisp.org>
8263
8264 * data/yacc.c: Include <libintl.h> when NLS is enabled.
8265 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
8266 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
8267 * runtime-po: New directory.
8268 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
8269 $(DOMAIN).pot-update rule, so that old messages are never dropped.
8270 * runtime-po/Rules-quot: New file, copied from po/.
8271 * runtime-po/quot.sed: Likewise.
8272 * runtime-po/boldquot.sed: Likewise.
8273 * runtime-po/en@quot.header: Likewise.
8274 * runtime-po/en@boldquot.header: Likewise.
8275 * runtime-po/insert-header.sin: Likewise.
8276 * runtime-po/remove-potcdate.sin: Likewise.
8277 * runtime-po/Makevars: New file.
8278 * runtime-po/POTFILES.in: New file.
8279 * runtime-po/LINGUAS: New file.
8280 * runtime-po/bison-runtime.pot: New file.
8281 * runtime-po/de.po: New file.
8282 * m4/bison.m4: New file.
8283 * Makefile.am (SUBDIRS): Add runtime-po.
8284 (aclocaldir, aclocal_DATA): New variables.
8285 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
8286 Define aclocaldir.
8287 * src/getargs.c (usage): Document --print-localedir option.
8288 (PRINT_LOCALEDIR_OPTION): New enum item.
8289 (long_options): Add --print-localedir option.
8290 (getargs): Handle --print-localedir option.
8291 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
8292 (Internationalization): New section.
8293
82942005-07-12 Akim Demaille <akim@epita.fr>
8295
8296 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
8297 for consistency with the rest of the code.
8298 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
8299 Add separators.
8300
83012005-07-12 Akim Demaille <akim@epita.fr>
8302
8303 * src/parse-gram.y: Use %printer instead of YYPRINT.
8304
83052005-07-12 Akim Demaille <akim@epita.fr>
8306
8307 * src/symtab.h, src/symtab.c (symbol_print): New.
8308 * src/symlist.h, src/symlist.c (symbol_list_print): New.
8309 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
8310
83112005-07-12 Akim Demaille <akim@epita.fr>
8312
8313 * data/glr.c (b4_syncline): Fix (swap) the definitions of
8314 b4_at_dollar and b4_dollar_dollar.
8315
83162005-07-11 Paul Eggert <eggert@cs.ucla.edu>
8317
8318 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
8319 and Pennello's paper.
8320
83212005-07-09 Paul Eggert <eggert@cs.ucla.edu>
8322
8323 * data/yacc.c (yyparse): Undo previous patch. Instead,
8324 set yylsp[0] and yyvsp[0] only if the initial action
8325 sets yylloc and yylval, respectively.
8326
8327 * data/yacc.c (yyparse): In the initial action, set
8328 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
8329 This avoids the use of undefined variables if the initial
8330 action does not set yylloc and/or yylval.
8331
83322005-07-07 Paul Eggert <eggert@cs.ucla.edu>
8333
8334 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
8335 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
8336 Remove from CVS. These files are automatically generated.
8337 * examples/extexi: Clarify that this file is now part of Bison,
8338 not GNU M4, and that it works with any POSIX-compatible Awk.
8339 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
8340 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
8341 so that we also get calc++-parser.yy. Geneate it.
8342 Use $(AWK), not gawk, since any conforming Awk will do.
8343 Put comment before action, since older 'make' can't handle comment
8344 in action.
8345 $(BUILT_SOURCES): List all built sources, not just some of them.
8346 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
8347 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
8348 $($(calc_sources_generated)): Remove unnecessary test for existence
8349 of target. (This had a shell syntax error anyway; a stray "x".)
8350 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
8351 calc++-parser.yy.
8352 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
8353
8354 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
8355 implied by the other modules.
8356
83572005-07-06 Akim Demaille <akim@epita.fr>
8358
8359 Bind examples/calc++ to the package.
8360 * examples/calc++/Makefile: Remove, replaced by...
8361 * examples/calc++/Makefile.am: ... this new file.
8362 * examples/calc++/test: Remove input.
8363 * examples/calc++/compile: Remove.
8364 * examples/Makefile.am: New.
8365 * configure.ac, Makefile.am: Adjust.
8366 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
8367
83682005-07-05 Paul Eggert <eggert@cs.ucla.edu>
8369
8370 * data/glr.c (yyFail): Drastically simplify; since the format argument
8371 never had any % directives, we can simply pass it to yyerror.
8372 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
8373 be modified later, as that is the usual style in glr.c.
8374 Problems reported by Paul Hilfinger.
8375
8376 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
8377 and size overflow errors.
8378 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
8379 in case the user prolog sets feature-test macros like _GNU_SOURCE.
8380 (YYSIZEMAX): New macro.
8381 (yystpcpy): New function, taken from yacc.c.
8382 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
8383 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
8384 so that we don't have to maintain their signatures.
8385 (yyFail): Check for buffer overflow, by using vsnprintf rather
8386 than vsprintf. Allocate a bigger buffer if possible.
8387 Report an error if buffer allocation fails.
8388 (yyStackOverflow): New function.
8389 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
8390 the initialization was successful. It might fail if storage was
8391 exhausted.
8392 (yyexpandGLRStack): Add more checks for storage allocation failure.
8393 Use yyStackOverflow to report failures.
8394 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
8395 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
8396 Don't assume stack number fits in int.
8397 (yysplitStack): Check for storage allocation failure.
8398 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
8399 can print diagnostics on storage allocation failure. All callers
8400 changed.
8401 (yyresolveValue): Use yybool for boolean.
8402 (yyreportSyntaxError): Check for size-calculation overflow.
8403 This code is taken from yacc.c.
8404 (yyparse): Check for storage allocation errors when allocating
8405 the initial stack.
8406
84072005-07-05 Akim Demaille <akim@epita.fr>
8408
8409 Extract calc++ from the documentation.
8410 * doc/bison.texinfo (Calc++): Add the extraction marks.
8411 * examples/extexi: New, from the aborted GNU Programming 2E.
8412 Separate the different paragraph of a file with empty lines.
8413 * examples/Makefile: Use it to extract the whole calc++ example.
8414
84152005-06-24 Akim Demaille <akim@epita.fr>
8416
8417 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
8418 class typedefs.
8419
84202005-06-22 Akim Demaille <akim@epita.fr>
8421
8422 * doc/bison.texinfo (C++ Language Interface): First stab.
8423 (C++ Parsers): Remove.
8424
84252005-06-22 Akim Demaille <akim@epita.fr>
8426
8427 * data/lalr1.cc (yylex_): Honor %lex-param.
8428
84292005-06-22 Akim Demaille <akim@epita.fr>
8430
8431 Start a set of simple examples.
8432 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
8433 * examples/calc++/calc++-driver.hh,
8434 * examples/calc++/calc++-parser.yy,
8435 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
8436 * examples/calc++/compile, examples/calc++/test: New.
8437
84382005-06-09 Paul Eggert <eggert@cs.ucla.edu>
8439
8440 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
8441 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
8442 which stems from the 2005-05-27 patch.
8443
84442005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8445
8446 * data/glr.c: Modify treatment of unused parameters to permit use
8447 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
8448
84492005-05-30 Paul Eggert <eggert@cs.ucla.edu>
8450
8451 Fix infringement on user name space reported by Janos Zoltan Szabo.
8452 * data/yacc.c (yyparse): strlen -> yystrlen.
8453
84542005-05-30 Akim Demaille <akim@epita.fr>
8455
8456 * data/lalr1.cc (_): New.
8457 Translate the various messages.
8458
84592005-05-27 Paul Eggert <eggert@cs.ucla.edu>
8460
8461 Fix infringement on user name space reported by Bruno Haible.
8462 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
8463 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
8464 the user's name space.
8465 (alloca): Include <stdlib.h> to get it, if it's not built in.
8466 (YYMALLOC, YYFREE): Define only if needed.
8467 (malloc, free): Declare, but only if needed, as this infringes on
8468 the user name space.
8469
84702005-05-25 Paul Eggert <eggert@cs.ucla.edu>
8471
8472 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
8473 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
8474 with %d format.
8475 * lib/ebitset.c (min, max): Undef before defining.
8476 * lib/vbitset.c (min, max): Likewise.
8477 * lib/subpipe.c (create_subpipe): Save local variables in case
8478 vfork clobbers them.
8479
84802005-05-24 Bruno Haible <bruno@clisp.org>
8481
8482 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
8483 error message syntax used by gcc-4.0.
8484
84852005-05-23 Paul Eggert <eggert@cs.ucla.edu>
8486
8487 * README: Mention m4 1.4.3. Remove obsolete advice about
8488 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
8489
8490 * bootstrap: Remove workaround for problem I encountered with
8491 gettext 0.14.1; it seems to be fixed now.
8492
84932005-05-22 Paul Eggert <eggert@cs.ucla.edu>
8494
8495 * NEWS: Version 2.0a.
8496
8497 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
8498 the previous change.
8499
8500 Various maintainer cleanups.
8501 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
8502 conftest*, for benefit of CVS commands run at the same time as
8503 "configure". Add build-aux, since "bootstrap" now creates it and
8504 its subfiles.
8505 * Makefile.cfg (move_if_change): Remove.
8506 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
8507 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
8508 (po_repo, do-po-update, po-update, wget_files, get-targets):
8509 (config.guess-url_prefix, config.sub-url_prefix):
8510 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
8511 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
8512 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
8513 Remove.
8514 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
8515 this is now the recommended name.
8516 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
8517 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
8518 ylwrap. These files now go into build-aux.
8519 * config/move-if-change: Remove.
8520 * config/prev-version.txt: Bump from 1.75 to 2.0.
8521
8522 * bootstrap: Add stdio-safer, unistd-safer modules.
8523 Remove m4/glibc2.m4 (introduced by latest gnulib, but
8524 we don't need it).
8525 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
8526 fopen-safer.c, stdio-safer.h, unistd-safer.h.
8527 * lib/subpipe.c: Include "unistd-safer.h".
8528 (create_subpipe): Make sure all the newly-created
8529 file descriptors are > 2, so that diagnostics don't
8530 get sent down them (which might cause Bison to hang, in theory).
8531 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
8532 * src/files.c (xfopen): Use fopen_safer, not fopen.
8533
8534 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
8535 yesterday's yacc.c fix.
8536
85372005-05-21 Paul Eggert <eggert@cs.ucla.edu>
8538
8539 * data/glr.c, data/lalr1.cc: Update copyright date.
8540
8541 Fix a destructor bug reported by Wolfgang Spraul in
8542 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
8543 * data/yacc.c (yyabortlab): Don't call destructor, and
8544 don't set yychar to EMPTY.
8545 (yyoverflowlab): Don't call destructor.
8546 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
8547 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
8548 since we no longer output the message "discarding lookahead token
8549 end of input ()".
8550
85512005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8552
8553 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
8554 fix a small glitch in debugging output.
8555 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
8556 after YY_SYMBOL_PRINT where needed.
8557
8558 (struct yyGLRState): Add some comments.
8559 (struct yySemanticOption): Add some comments.
8560 (union yyGLRStackItem): Add comment.
8561
8562 (yymergeOptionSets): Correct this to properly perform the union,
8563 avoiding infinite reported by Michael Rosien.
8564 Update comment.
8565
8566 * tests/glr-regression.at: Add test for GLR merging error reported
8567 by M. Rosien.
8568
85692005-05-13 Paul Eggert <eggert@cs.ucla.edu>
8570
8571 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
8572 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
8573 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
8574 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
8575 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
8576 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
8577 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
8578 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
8579 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
8580 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
8581 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
8582 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
8583 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
8584 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
8585 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
8586 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
8587 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
8588 src/derives.h, src/files.c, src/files.h, src/getargs.c,
8589 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
8590 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
8591 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
8592 src/output.h, src/parse-gram.c, src/parse-gram.h,
8593 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
8594 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
8595 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
8596 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
8597 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
8598 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
8599 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
8600 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
8601 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
8602 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
8603 tests/reduce.at, tests/regression.at, tests/sets.at,
8604 tests/synclines.at, tests/testsuite.at, tests/torture.at:
8605 Update FSF postal mail address.
8606
86072005-05-11 Paul Eggert <eggert@cs.ucla.edu>
8608
8609 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
8610 Problem reported by Ralf Menzel.
8611
86122005-05-01 Paul Eggert <eggert@cs.ucla.edu>
8613
8614 * tests/actions.at: Test that stack overflow invokes destructors.
8615 From Marcus Holland-Moritz.
8616 * data/yacc.c (yyerrlab): Move the code that destroys the stack
8617 from here....
8618 (yyreturn): to here. That way, destructors are called properly
8619 even if the stack overflows, or the user calls YYACCEPT or
8620 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
8621 (yyoverflowlab): Destroy the lookahead.
8622
86232005-04-24 Paul Eggert <eggert@cs.ucla.edu>
8624
8625 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
8626
86272005-04-17 Paul Eggert <eggert@cs.ucla.edu>
8628
8629 * NEWS: Bison-generated C parsers no longer quote literal strings
8630 associated with tokens.
8631 * src/output.c (prepare_symbols): Don't escape strings,
8632 since users don't want to see C escapes.
8633 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
8634 in diagnostics.
8635 * tests/input.at (Torturing the Scanner): Likewise.
8636 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
8637
86382005-04-16 Paul Eggert <eggert@cs.ucla.edu>
8639
8640 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
8641 the data size is known to be too small and we can't increase it.
8642 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
8643
86442005-04-15 Paul Eggert <eggert@cs.ucla.edu>
8645
8646 * src/parse-gram.y: Include quotearg.h.
8647 (string_as_id): Quote $1 before using it as a key, since the
8648 lexer no longer quotes it for us.
8649 (string_content): Don't strip quotes, since lexer no longer
8650 quotes it for us.
8651 * src/scan-gram.l: Include quotearg.h.
8652 ("\""): Omit quote.
8653 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
8654 a key, since the rest of the lexer doesn't quote it.
8655 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
8656 * tests/regression.at (Token definitions): Check for backslashes
8657 in token strings.
8658
8659 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
8660 (YYSIZE_T): Define to unsigned long int when using an older compiler.
8661 (yyparse): Revamp code to generate long syntax error message, to
8662 make it easier to translate, and to avoid problems with arithmetic
8663 overflow. Change "virtual memory" to "memory" in diagnostic, since
8664 we don't know whether the memory is virtual.
8665
86662005-04-13 Paul Eggert <eggert@cs.ucla.edu>
8667
8668 * NEWS: Bison-generated C parsers now use the _ macro to
8669 translate strings.
8670 * data/yacc.c (_) [!defined _]: New macro.
8671 All English strings wrapped inside this macro.
8672 * doc/bison.texinfo (Bison Parser): Document _.
8673 * po/POTFILES.in: Include src/parse-gram.c, since it now
8674 includes translateable strings that parse-gram.y doesn't.
8675
86762005-04-12 Paul Eggert <eggert@cs.ucla.edu>
8677
8678 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
8679 reverting the 2004-10-11 change to this function.
8680 (symbol_check_alias_consistency): Don't call symbol_type_set
8681 if the type name is already correct.
8682 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
8683
86842005-03-25 Paul Eggert <eggert@cs.ucla.edu>
8685
8686 * tests/regression.at (Token definitions): Don't use a token named
8687 c, as that generates a "#define c ..." that runs afoul of buggy
8688 stdlib.h that uses the identifier c as a member of struct
8689 drand48_data. Problem reported by Horst Wente.
8690
86912005-03-21 Paul Eggert <eggert@cs.ucla.edu>
8692
8693 * bootstrap: Change translation URL from
8694 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
8695 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
8696 redirection glitches. Problem reported by twlevo@xs4all.nl.
8697
86982005-03-20 Paul Eggert <eggert@cs.ucla.edu>
8699
8700 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
8701 after operands; POSIX says this isn't portable for the c99 command.
8702
87032005-03-18 Paul Eggert <eggert@cs.ucla.edu>
8704
8705 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
8706 immediately if a data overrun has occurred; this may help us track
8707 down what may be a spurious failure on MacOS.
8708
87092005-03-17 Paul Eggert <eggert@cs.ucla.edu>
8710
8711 Respond to problems reported by twlevo@xs4all.nl.
8712
8713 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
8714
8715 * src/vcg.h: Comment fix.
8716 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
8717 (G_CMAX): Change to -1 instead of INT_MAX.
8718
8719 * data/yacc.c (yyparse): Omit spaces before #line.
8720
87212005-03-15 Paul Eggert <eggert@cs.ucla.edu>
8722
8723 * src/tables.c (state_number_to_vector_number): Put it inside an
8724 "#if 0", since it's not currently used. Problem reported by
8725 Roland McGrath.
8726
87272005-03-06 Paul Eggert <eggert@cs.ucla.edu>
8728
8729 * src/output.c (escaped_output): Renamed from
8730 escaped_file_name_output, since we now use it for symbol tags as
8731 well. All uses changed.
8732 (symbol_destructors_output, symbol_printers_output):
8733 Escape symbol tags too.
8734 Problem reported by Matyas Forstner in
8735 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
8736
8737 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
8738 not needed.
8739 * src/output.c (user_actions_output, token_definitions_output,
8740 symbol_destructors_output, symbol_printers_output): Likewise.
8741 * src/reader.c (prologue_augment): Likewise.
8742 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
8743
8744 * src/vcg.c (output_edge): Don't quote linestyle arg.
8745 Problem reported by twlevo@xs4all.nl.
8746
87472005-02-28 Paul Eggert <eggert@cs.ucla.edu>
8748
8749 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
8750 example, reported by Derek M Jones. Also, make the example even
8751 more outrageous, to better illustrate how bad the problem is.
8752
87532005-02-24 Paul Eggert <eggert@cs.ucla.edu>
8754
8755 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
8756 putsym. Typo reported by Sebastian Piping.
8757
87582005-02-23 Paul Eggert <eggert@cs.ucla.edu>
8759
8760 * doc/bison.texinfo (Language and Grammar): some -> same
8761 (Epilogue): int he -> in the
8762 Typos reported by Sebastian Piping via Justin Pence.
8763
87642005-02-07 Paul Eggert <eggert@cs.ucla.edu>
8765
8766 * tests/glr-regression.at (Improper handling of embedded actions
8767 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
8768 embedded actions and $-N in GLR parsers", work around an Autoconf bug
8769 with dollar signs in test names.
8770 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
8771 for a similar reason.
8772
87732005-01-28 Paul Eggert <eggert@cs.ucla.edu>
8774
8775 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
8776 wants to redefine G_VIEW.
8777
87782005-01-27 Paul Eggert <eggert@cs.ucla.edu>
8779
8780 * src/vcg.c (get_view_str): Remove case for normal_view.
8781 Problem reported by twlevo@xs4all.nl.
8782
87832005-01-24 Paul Eggert <eggert@cs.ucla.edu>
8784
8785 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
8786 Problem reported by twlevo@xs4all.nl.
8787
8788 * doc/bison.texinfo: Change @dircategory from "GNU programming
8789 tools" to "Software development". Requested by Richard Stallman
8790 via Karl Berry.
8791
87922005-01-23 Paul Eggert <eggert@cs.ucla.edu>
8793
8794 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
8795 Problem reported by twlevo@xs4all.nl.
8796
87972005-01-21 Paul Eggert <eggert@cs.ucla.edu>
8798
8799 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
8800 keyword; it's not needed with modern compilers, and it doesn't
8801 affect correctness with older compilers. Suggested by
8802 twlevo@xs4all.nl.
8803
88042005-01-17 Paul Eggert <eggert@cs.ucla.edu>
8805
8806 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
8807 gcc -Wswitch-default.
8808 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
8809 * data/yacc.c (yyparse): Likewise.
8810
88112005-01-12 Paul Eggert <eggert@cs.ucla.edu>
8812
8813 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
8814 already. Let config.h define any nonstandard values.
8815
88162005-01-10 Paul Eggert <eggert@cs.ucla.edu>
8817
8818 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
8819 for the benefit of slower hosts. Problem reported by
8820 Nelson H. F. Beebe.
8821
88222005-01-07 Paul Eggert <eggert@cs.ucla.edu>
8823
8824 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
8825 being defined and not used.
8826 * data/lalr1.cc (yyparse): Likewise.
8827 Use "if (false)" rather than "if (0)".
8828
88292005-01-05 Paul Eggert <eggert@cs.ucla.edu>
8830
8831 * TODO: Mention that we should allow NUL bytes in tokens.
8832
88332005-01-02 Paul Eggert <eggert@cs.ucla.edu>
8834
8835 * src/scan-skel.l (<<EOF>>): Don't close standard output.
8836 Problem reported by Hans Aberg.
8837
88382005-01-01 Paul Eggert <eggert@cs.ucla.edu>
8839
8840 * src/getargs.c (version): Happy new year; update overall
8841 program copyright date from 2004 to 2005.
8842
8843 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
8844 Problem reported by Hans Aberg.
8845 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
8846 (Output file names.): Add a test for the case when standard output
8847 is closed.
8848
88492004-12-26 Paul Eggert <eggert@cs.ucla.edu>
8850
8851 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
8852 to fix an oversight in the Bison 2.0 manual.
8853
88542004-12-25 Paul Eggert <eggert@cs.ucla.edu>
8855
8856 * NEWS: Version 2.0. Reformat the existing news items since
8857 1.875, so that related items are grouped together.
8858 * configure.ac (AC_INIT): Bump version to 2.0.
8859 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
8860
8861 * tests/torture.at (Exploding the Stack Size with Alloca): Set
8862 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
8863 otherwise, we're not testing alloca. Unfortunately there's no
8864 simple way to consult HAVE_ALLOCA here.
8865
8866 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
8867 for yymsg, too.
8868
8869 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
8870 hand. This avoids a warning about comparing int to size_t when
8871 GCC warnings are enabled.
8872
88732004-12-22 Paul Eggert <eggert@cs.ucla.edu>
8874
8875 * NEWS: Bison-generated parsers no longer default to using the
8876 alloca function (when available) to extend the parser stack, due
8877 to widespread problems in unchecked stack-overflow detection.
8878 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
8879 responsibility to set it to a positive value. This lets the user
8880 specify a value that is not a preprocessor constant.
8881 * data/yacc.c (YYMAXDEPTH): Likewise.
8882 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
8883 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
8884 to be a compile-time constant. However, explain the constraints on it.
8885 Also, explain the constraints on YYINITDEPTH.
8886 (Table of Symbols): Explain that alloca is no longer the default.
8887 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
8888 to 1.
8889
8890 * doc/bison.texinfo (Location Default Action): Mention that n must
8891 be zero when k is zero. Suggested by Frank Heckenbach.
8892
88932004-12-22 Akim Demaille <akim@epita.fr>
8894
8895 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
8896 (parser::state_type, parser::semantic_type, parser::location_type):
8897 Private, not public.
8898 (parser::parse): Return ints, not bool.
8899 Returning a bool introduces a problem: 0 corresponds to false, and
8900 it seems weird to return false on success. Returning true changes
8901 the conventions for yyparse.
8902 Alternatively we could return void and send an exception.
8903 There is no clear consensus (yet?).
8904 (state_stack, semantic_stack, location_stack): Rename as...
8905 (state_stack_type, semantic_stack_type, location_stack_type): these.
8906 Private, not public.
8907 * tests/c++.at: New.
8908 * tests/testsuite.at, tests/Makefile.am: Adjust.
8909
89102004-12-21 Akim Demaille <akim@epita.fr>
8911
8912 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
8913
89142004-12-21 Akim Demaille <akim@epita.fr>
8915
8916 Don't impose std::string for filenames.
8917
8918 * data/lalr1.cc (b4_filename_type): New.
8919 (position::filename): Use it.
8920 (parser.hh): Move the inclusion of stack.hh and location.hh below
8921 the user code, so that needed headers for the filename type can be
8922 included first.
8923 Forward declare them before the user code.
8924 * tests/Makefile.am (check-local, installcheck-local): Pass
8925 TESTSUITEFLAGS to the TESTSUITE.
8926
89272004-12-20 Akim Demaille <akim@epita.fr>
8928
8929 Use more STL like names: my_class instead of MyClass.
8930
8931 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
8932 (SemanticStack, SemanticType, StateStack, StateType)
8933 (TokenNumberType, Stack, Slice, Traits, Parser::location)
8934 (Parser::value): Rename as...
8935 (location_stack, location_type, rhs_number_type, semantic_stack)
8936 (semantic_type, state_stack, state_type, token_number_type, stack)
8937 (slice, traits, parser::yylloc, parser::yylval): these.
8938
8939 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
8940
89412004-12-19 Paul Eggert <eggert@cs.ucla.edu>
8942
8943 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
8944 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
8945
89462004-12-17 Paul Eggert <eggert@cs.ucla.edu>
8947
8948 Remove uses of 'short int' and 'unsigned short int'. This raises
8949 some arbitrary limits. It uses more memory but nowadays that's
8950 not much of an issue.
8951
8952 This change does not affect the generated parsers; that's a different
8953 task, as some users will want to conserve memory there.
8954
8955 Ideally we should use size_t to represent all object counts, and
8956 something like ptrdiff_t to represent signed differences of object
8957 counts; but that will require more code-cleanup than I have the
8958 time to do right now.
8959
8960 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
8961 Use size_t, not int or short int, to count objects.
8962 * src/closure.c (nritemset, closure): Likewise.
8963 * src/closure.h (nritemset, closure): Likewise.
8964 * src/nullable.c (nullable_compute): Likewise.
8965 * src/print.c (print_core): Likewise.
8966 * src/print_graph.c (print_core): Likewise.
8967 * src/state.c (state_compare, state_hash): Likewise.
8968 * src/state.h (struct state): Likewise.
8969 * src/tables.c (default_goto, goto_actions): Likewise.
8970
8971 * src/gram.h (rule_number, rule): Use int, not short int.
8972 * src/output.c (prepare_rules): Likewise.
8973 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
8974 errs, reductions): Likewise.
8975 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
8976 Likewise.
8977 * src/tables.c (vector_number, tally, action_number,
8978 ACTION_NUMBER_MINIMUM): Likewise.
8979 * src/output.c (muscle_insert_short_int_table): Remove.
8980
89812004-12-17 Akim Demaille <akim@epita.fr>
8982
8983 * data/lalr1.cc: Extensive Doxygenation.
8984 (error_): Rename as...
8985 (error): this, since it is visible to the user.
8986 Adjust callers.
8987 (Parser::message): Now an automatic variable from...
8988 (Parser::yyreport_syntax_error_): here.
8989 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
8990 Parser::error.
8991 * tests/input.at: Escape $.
8992
89932004-12-16 Paul Eggert <eggert@cs.ucla.edu>
8994
8995 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
8996 Parenthesize rhs to avoid obscure problems with mistakes like
8997 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
8998 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
8999 b4_rhs_location): Likewise.
9000 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9001 b4_rhs_location): Likewise.
9002
90032004-12-16 Akim Demaille <akim@epita.fr>
9004
9005 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
9006 yacc.c: be sure to stay within yycheck_.
9007 * tests/actions.at: Re-enable C++ tests.
9008
90092004-12-16 Akim Demaille <akim@epita.fr>
9010
9011 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
9012 real.
9013
90142004-12-16 Akim Demaille <akim@epita.fr>
9015
9016 Use #define to handle the %name-prefix.
9017
9018 * data/glr.c, data/yacc.c: Comment changes.
9019 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
9020 so that one can refer to yylex in the parser file, and have it
9021 renamed, as is the case with other skeletons.
9022
90232004-12-16 Akim Demaille <akim@epita.fr>
9024
9025 Move lalr1.cc internals into yy*.
9026
9027 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
9028 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
9029 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
9030 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
9031 (empty_, final_, terror_, errcode_, ntokens_)
9032 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
9033 (looka_, ilooka_, error_range_, nerrs_):
9034 Rename as...
9035 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
9036 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
9037 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
9038 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
9039 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
9040 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
9041 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
9042 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
9043 these.
9044
90452004-12-15 Paul Eggert <eggert@cs.ucla.edu>
9046
9047 Fix some problems reported by twlevo at xs4all.
9048 * src/symtab.c (symbol_new): Report an error if the input grammar
9049 contains too many symbols. This is better than calling abort() later.
9050 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
9051 (struct node, struct graph):
9052 Rename member expand to stretch. All uses changed.
9053 (struct graph): Remove member layoutalgorithm. All uses removed.
9054 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
9055 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
9056 All uses changed.
9057 (N_STRETCH): Rename from N_EXPAND. All uses changed.
9058
90592004-12-15 Akim Demaille <akim@epita.fr>
9060
9061 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
9062 Add more Doxygen comments.
9063 (symprint_, stack_print_, reduce_print_, destruct_, pop)
9064 (report_syntax_error_, translate_): Rename as...
9065 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
9066 (yypop_, yyreport_syntax_error_, yytranslate_): this.
9067
90682004-12-15 Akim Demaille <akim@epita.fr>
9069
9070 * data/lalr1.cc (lex_): Rename as...
9071 (yylex_): this.
9072 Move the trace here.
9073 Take the %name-prefix into account.
9074 Reported by Alexandre Duret-Lutz.
9075
90762004-12-15 Akim Demaille <akim@epita.fr>
9077
9078 Simplify the C++ parser constructor.
9079
9080 * data/lalr1.cc (debug_): Rename as...
9081 (yydebug_): so that the parser's internals are always in the yy*
9082 pseudo namespace.
9083 Adjust uses.
9084 (b4_parse_param_decl): Remove the leading comma as it is now only
9085 called as unique argument list.
9086 (Parser::Parser): Remove the constructor accepting a location and
9087 an initial debugging level.
9088 Remove from the other ctor the argument for the debugging level.
9089 (debug_level_type, debug_level, set_debug_level): New.
9090
9091 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
9092 constructor calls.
9093
90942004-12-15 Akim Demaille <akim@epita.fr>
9095
9096 Remove b4_root related material: failure experiment
9097 (which goal was to allow to derive from a class).
9098
9099 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
9100 definitions and uses.
9101
91022004-12-14 Paul Eggert <eggert@cs.ucla.edu>
9103
9104 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
9105 not 2, since it's not portable to subtract 1 from the start of an
9106 array. The new item 0 is never set or used. All uses changed.
9107
9108 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
9109 the default definition of YYLLOC_DEFAULT. Problem reported
9110 by Frank Heckenbach.
9111
91122004-12-12 Paul Eggert <eggert@cs.ucla.edu>
9113
9114 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
9115 the normal case and one for the error case. Just use the
9116 first one uniformly. Problem reported by Frank Heckenbach.
9117 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
9118 use exactly the same macro in both places.
9119 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
9120 so that the normal-case YYRHSLOC works for the error case too.
9121 All uses changed.
9122 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
9123 (YYLLOC_DEFAULT): Use the same macro as glr.c.
9124 * doc/bison.texinfo (Location Default Action): Don't claim that
9125 we have an array of locations. Use the same macro for both glr
9126 and lalr parsers. Mention YYRHSLOC. Mention what happens when
9127 the index is 0.
9128
91292004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9130
9131 * HACKING: Update email addresses to send announcements to.
9132
9133 * configure.ac (AC_INIT): Bump version to 1.875f.
9134
91352004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9136
9137 * NEWS: Version 1.875e.
9138 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
9139
9140 * src/scan-skel.l: Include "complain.h", for "fatal".
9141
9142 * src/relation.h (relation_print, relation_digraph):
9143 Relation sizes are of type relation_node, not size_t (this is
9144 merely a doc fix, since the two types are equivalent).
9145 (relation_transpose): Relation sizes are of type relation_node,
9146 not int.
9147 * src/relation.c: Likewise.
9148 (top, infinity): Now of type relation_node, not int.
9149 (traverse, relation_transpose): Use relation_node, not int.
9150
9151 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
9152 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
9153 (yyparse): Remove unused local introduced in 2004-10-25 patch.
9154
9155 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
9156 specifying whether the test should be skipped. Use it tp
9157 specify that the [%defines %skeleton "lalr1.cc"] tests currently
9158 fail on some hosts, and should be skipped.
9159
91602004-12-08 Paul Eggert <eggert@cs.ucla.edu>
9161
9162 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
9163 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
9164 unless otherwise specified below.
9165
9166 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
9167 to allocate kernel_base, kernel_items, kernel_size, since
9168 they needn't be initialized to 0.
9169 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
9170 * src/closure.c (new_closure): Likewise, for itemset.
9171 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
9172 * src/lalr.c (set_goto_map): Likewise, for temp_map.
9173 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
9174 (build_relations): Likewise for edge, states1, includes.
9175 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
9176 * src/reader.c (packgram): Likewise, for ritem, rules.
9177 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
9178 * src/relation.c (relation_digraph): Likewise for VERTICES.
9179 (relation_transpose): Likewise for new_R, end_R.
9180 * src/symtab.c (symbols_token_translations_init): Likewise for
9181 token_translations.
9182 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
9183 (token_actions): Likewise for yydefact, actrow, conflrow,
9184 conflict_list.
9185 (save_column): Likewise for froms[symno], tos[symno].
9186 (goto_actions): Likewise for state_count.
9187 (pack_table): Likewise for base, pos, check.
9188 (tables_generate): Likewise for width.
9189
9190 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
9191 for initial core. Just have a separate core, so we needn't worry
9192 about whether kernel_size and kernel_base are initialized.
9193
9194 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
9195 kernel_size, kernel_items): Remove unnecessary initialization.
9196 * src/conflicts.c (conflicts): Likewise.
9197 * src/derives.c (derives): Likewise.
9198 * src/muscle_tablc (muscle_insert): Likewise.
9199 * src/relation.c (relation_digraph): Likewise.
9200 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
9201 conflrow, conflict_table, conflict_list, table, check):
9202 Likewise.
9203
9204 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
9205 This is because all callers pass unsigned int.
9206 * src/closure.h (new_closure): Likewise.
9207
9208 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
9209 (build_relations): Initialize includes[i] in all cases.
9210 * src/reader.c (packgram): Always initialize rules[ruleno].prec
9211 and rules[ruleno].precsym. Initialize members in order.
9212 * src/relation.c (relation_transpose): Always initialize new_R[i]
9213 and end_R[i].
9214 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
9215
9216 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
9217 conflict_list[0] was always 0, but now it isn't initialized.
9218
9219 * src/table.c (table_grow): When conflict_table grew, the grown
9220 area wasn't cleared. Fix this.
9221
9222 * lib/.cvsignore: Add strdup.c, strdup.h.
9223 * m4/.cvsignore: Add strdup.m4.
9224
92252004-12-07 Paul Eggert <eggert@cs.ucla.edu>
9226
9227 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
9228 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
9229 GOTO_NUMBER_MAXIMUM, since we occasionally compute
9230 ngotos + 1 without checking for overflow.
9231 (build_relations): Use END_NODE, not -1, to denote end of edges.
9232 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
9233 build_relations): Use goto_number, not int, for goto numbers.
9234 * src/tables.c (save_column, default_goto): Likewise.
9235
92362004-11-23 Akim Demaille <akim@epita.fr>
9237
9238 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
9239 of #defining from yystype.
9240 Don't typedef yystype, C++ does not need it.
9241 This lets it possible to forward declare it as union.
9242
92432004-11-23 Paul Eggert <eggert@cs.ucla.edu>
9244
9245 * bootstrap (gnulib_modules): Add extensions.
9246 Problem reported by Jim Meyering.
9247
92482004-11-22 Paul Eggert <eggert@cs.ucla.edu>
9249
9250 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
9251 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
9252 src/system.h, src/tables.c: XFREE -> free, to accommodate
9253 recent change to gnulib xalloc.h.
9254 Problem reported by Jim Meyering.
9255
92562004-11-17 Akim Demaille <akim@epita.fr>
9257
9258 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
9259
92602004-11-17 Akim Demaille <akim@epita.fr>,
9261 Alexandre Duret-Lutz <adl@gnu.org>
9262
9263 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
9264 changes.
9265 (YYCDEBUG): Adjust.
9266 Use it instead of cdebug_.
9267 (Parser::debug_stream, Parser::set_debug_stream): New.
9268 (Parser::symprint_): Define cdebug_ for temporary backward
9269 compatibility.
9270 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
9271 debug_stream ().
9272
92732004-11-17 Akim Demaille <akim@epita.fr>
9274
9275 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
9276 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
9277 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
9278 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9279
92802004-10-27 Paul Eggert <eggert@cs.ucla.edu>
9281
9282 * data/glr.c (yyloc_default): Remove; not used.
9283 Problem reported by Frank Heckenbach.
9284
92852004-10-25 Akim Demaille <akim@epita.fr>
9286
9287 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
9288 Introduce another definition to address simple location arrays.
9289 (yyGLRStack): New member: yyerror_range.
9290 (yyrecoverSyntaxError, yyparse): Update it.
9291 (yyrecoverSyntaxError): Use it when shifting the error token to
9292 have an accurate range, equivalent to the one computed by both
9293 yacc.c and lalr1.cc.
9294 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
9295 that column numbers start at column 0, as per GNU Coding
9296 Standards, the others tests, and the doc.
9297 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
9298 Adjust to the above change (first column is 0).
9299 And adjust the location of the "<error>", now covering the whole
9300 line.
9301
93022004-10-22 Akim Demaille <akim@epita.fr>
9303 and Paul Eggert <eggert@cs.ucla.edu>
9304
9305 Remove some arbitrary limits on goto numbers and relations.
9306 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
9307 initial values, since they're never used.
9308 (set_goto_map): ngotos is now unsigned, so test for overflow
9309 by seeing whether it wraps around to zero.
9310 * src/lalr.h (goto_number): Now size_t, not short int.
9311 (GOTO_NUMBER_MAXIMUM): Remove.
9312 * src/relation.c (relation_print, traverse, relation_transpose):
9313 Check for END_NODE rather than looking at sign.
9314 * src/relation.h (END_NODE): New macro.
9315 (relation_node): Now size_t, not short int.
9316
93172004-10-22 Paul Eggert <eggert@cs.ucla.edu>
9318
9319 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
9320 keyword, not an identifier. Problem reported by Baron Schwartz in
9321 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
9322
93232004-10-11 Akim Demaille <akim@epita.fr>
9324
9325 * src/symtab.c (symbol_check_alias_consistency): Also check
9326 type names, destructors, and printers.
9327 Reported by Alexandre Duret-Lutz.
9328 Recode the handling of associativity and precedence in terms
9329 of symbol_precedence_set.
9330 Accept no redeclaration at all, not even equal to the previous
9331 value.
9332 (redeclaration): New.
9333 Use it to factor redeclaration complaints.
9334 (symbol_make_alias): Don't set the type of the alias, let
9335 symbol_check_alias_consistency do it as for other features.
9336 * src/symtab.h (symbol): Add new member prec_location, and
9337 type_location.
9338 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
9339 * tests/input.at (Incompatible Aliases): New.
9340
93412004-10-09 Paul Eggert <eggert@cs.ucla.edu>
9342
9343 .cvsignore fixes to accommodate gnulib changes,
9344 and the practice of naming build directories "_build".
9345 * .cvsignore: Add "_*". Sort.
9346 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
9347 * m4/.cvsignore: Add "*_gl.m4".
9348
93492004-10-06 Akim Demaille <akim@epita.fr>
9350
9351 * src/parse-gram.y (add_param): Fix the truncation of trailing
9352 spaces.
9353
93542004-10-05 Akim Demaille <akim@epita.fr>
9355
9356 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
9357 whether the reducion was empty or not. This leaves room to
9358 improve the use of YYLLOC_DEFAULT in such a case.
9359 lalr1.cc is still experimental, so changing this is acceptable.
9360 And finally, there are probably not many users who changed the
9361 handling of locations in GLR, so changing is admissible too.
9362
9363 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
9364 empty reduction, set @$ to an empty location ending the previously
9365 stacked symbol.
9366 Adjust uses to make sure the code is triggered on empty
9367 reductions.
9368 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
9369 expected output: empty reductions have empty locations.
9370
93712004-09-29 Akim Demaille <akim@epita.fr>
9372
9373 * data/lalr1.cc: Move towards a more standard C++ coding style
9374 for templates: Class < T > -> Class<T>.
9375
93762004-09-29 Akim Demaille <akim@epita.fr>
9377
9378 * data/lalr1.cc: Reinstall the former ctor, for sake of
9379 compatibility, but warn it will be removed.
9380 Move towards a more standard C++ coding style (i.e., type *var ->
9381 type* var).
9382
93832004-09-27 Paul Eggert <eggert@cs.ucla.edu>
9384
9385 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
9386 since it's less likely to work if NULs are involved in the future.
9387
93882004-09-27 Akim Demaille <akim@epita.fr>
9389
9390 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
9391
93922004-09-27 Akim Demaille <akim@epita.fr>
9393
9394 * data/lalr1.cc (b4_parse_param_decl_1): New.
9395 (b4_parse_param_decl): Use it to have different names between attribute
9396 and argument names.
9397 (b4_cc_constructor_call): Likewise.
9398
93992004-09-24 Akim Demaille <akim@epita.fr>
9400
9401 * src/parse-gram.y (add_param): Strip the leading and trailing
9402 blanks from a formal argument declaration.
9403 (YY_LOCATION_PRINT): New.
9404
94052004-09-24 Akim Demaille <akim@epita.fr>
9406
9407 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
9408 after the location.
9409
94102004-09-24 Akim Demaille <akim@epita.fr>
9411
9412 * doc/bison.texinfo (Table of Symbols): Sort.
9413
94142004-09-21 Akim Demaille <akim@epita.fr>
9415
9416 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
9417 the useless parentheses.
9418 Suggested by Paul Eggert.
9419
94202004-09-20 Akim Demaille <akim@epita.fr>
9421
9422 Let the initial-action act on the look-ahead, and use it for the
9423 "initial push" (corresponding to an hypothetical beginning-of-file).
9424 And let lalr1.cc honor %initial-action.
9425
9426 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
9427 example.
9428 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
9429 (Parser::Parser): Remove the ctor that used to initialize it.
9430 (Parser::parse): Like in the other skeletons, issue the "starting
9431 parse" message before any action.
9432 Honor %initial-action.
9433 Initialize the stacks with the lookahead.
9434 * data/yacc.c: Let $$ and @$ in %initial-action designate the
9435 look-ahead.
9436 Push them in the stacks.
9437 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
9438
94392004-09-20 Akim Demaille <akim@epita.fr>
9440
9441 * doc/bison.texinfo (Initial Action Decl): New.
9442
94432004-09-20 Akim Demaille <akim@epita.fr>
9444
9445 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
9446 clearer criterion to define it.
9447 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
9448 When reducing on an empty RHS, use the latest stacked location as
9449 location.
9450 yylloc is not always available.
9451 * data/glr.c: Likewise.
9452 Also, honor initial-actions.
9453
94542004-09-20 Akim Demaille <akim@epita.fr>
9455
9456 * data/yacc.c (YY_LOCATION_PRINT): New.
9457 Define when we know YYLTYPE's structure, i.e., when the default
9458 YYLLOC_DEFAULT is used.
9459 * data/c.m4 (b4_yysymprint_generate): Use it.
9460 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
9461 value of the result.
9462 (error_start_): Replace with...
9463 (error_range_): this location array.
9464 This allows to replace code relying on the implementation of
9465 locations by portable code.
9466 * data/yacc.c (yylerrsp): Replace with...
9467 (yyerror_range): this.
9468 Every time a token is popped, update yyerror_range[0], to have an
9469 accurate location for the error token.
9470 * data/glr.c (YY_LOCATION_PRINT): New.
9471 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
9472 deference a pointer.
9473 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
9474 report the location in %printers.
9475
9476 * src/scan-skel.l: Instead of abort, report error messages to ease
9477 understanding skeleton scanning failures.
9478
94792004-09-16 Akim Demaille <akim@epita.fr>
9480
9481 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
9482 (iterator, const_iterator): these, to be more in the C++ spirit.
9483 Also, return reverse iterators so that when displaying the stack
9484 we display its bottom first.
9485 (Parser::stack_print_, Parser::reduce_print_): Match the messages
9486 from yacc.c.
9487 We should probably use vector here though.
9488
94892004-09-16 Akim Demaille <akim@epita.fr>
9490
9491 Have more complete shift traces.
9492
9493 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
9494 to report Shifts instead of ad hoc YYDPRINTF invocations,
9495 including for the error token.
9496 * data/lalr1.cc (symprint_): Output the location.
9497 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
9498 output the location within the %printer.
9499 Activate GLR tests, at least to make sure they compile properly.
9500 They still don't pass though.
9501 * tests/calc.at: Adjust expect verbose output, since now "Entering
9502 state..." is on a different line than the "Shifting" message.
9503
95042004-09-08 Akim Demaille <akim@epita.fr>
9505
9506 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
9507 Bison directive from the Bison file to the invocation of this
9508 macro, so that these directives are passed to
9509 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
9510 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
9511 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
9512 the extra Bison directives instead of the whole series.
9513 Change the grammar so that there are recoverable errors, and
9514 unrecoverable errors. Now we can have the parser give up before
9515 consuming the whole input. As a result we now can observe that
9516 the lookahead is freed when needed.
9517 Change the parser source to parse argv[1] instead of a hard coded
9518 string.
9519 Simplify yylex, and give a value and location to EOF.
9520 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
9521 passed directives already coded in the file.
9522 Add some tests to check the location of "error".
9523 For some tests, the C++ parser is correct, and not yacc.c.
9524 For other tests, they provide different, but unsatisfying, values,
9525 so keep the C++ value so that at least one parser is "correct"
9526 according to the test suite.
9527 (Actions after errors): Remove, this is subsumed by the
9528 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
9529
95302004-09-06 Akim Demaille <akim@epita.fr>
9531
9532 * data/lalr1.cc: Adjust the indentation of the labels.
9533 (Parser::pop): New.
9534 Use it.
9535
95362004-09-06 Akim Demaille <akim@epita.fr>
9537
9538 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
9539 argument, an informative message.
9540 Call YY_SYMBOL_PRINT.
9541 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
9542 * data/lalr1.cc (destruct_): Likewise.
9543 In addition, no longer depend on b4_yysymprint_generate and
9544 b4_yydestruct_generate to generate these functions, do it "by
9545 hand".
9546
95472004-09-03 Akim Demaille <akim@epita.fr>
9548
9549 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
9550 invoked, yydestruct the lookahead.
9551 * tests/calc.at (Calculator $1): Update the expected lengths of
9552 traces: there is an added line for the discarded lookahead.
9553 * doc/bison.texinfo (Destructor Decl): Some rewording.
9554 Define "discarded" symbols.
9555
95562004-09-02 Akim Demaille <akim@epita.fr>
9557
9558 * data/lalr1.cc (translate_, destruct_): No reason to be static.
9559
95602004-09-02 Akim Demaille <akim@epita.fr>
9561
9562 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
9563 (YYDSYMPRINTF): Rename as...
9564 (YY_SYMBOL_PRINT): this.
9565 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
9566 two.
9567 Use it instead of direct symprint_ calls.
9568 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
9569 one.
9570
95712004-09-02 Akim Demaille <akim@epita.fr>
9572
9573 * data/lalr1.cc (b4_yysymprint_generate): New.
9574 (symprint_): New member function, defined when YYDEBUG.
9575 Use it consistently instead of token/nterm debugging output by
9576 hand.
9577 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
9578 %printer calls to use cdebug_ when using lalr1.cc.
9579
95802004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
9581
9582 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
9583 with #ifdef YYDEBUG.
9584
95852004-08-26 Akim Demaille <akim@epita.fr>
9586
9587 * doc/bison.texinfo (Implementing Loops): Rename as...
9588 (Implementing Gotos/Loops): this.
9589
95902004-08-13 Paul Eggert <eggert@cs.ucla.edu>
9591
9592 Adjust to latest gnulib.
9593 * bootstrap (gnulib_modules): Add xalloc-die.
9594 Set LC_ALL=C so that file names sort consistently.
9595 Prefer the gnulib copies of gettext.m4, glibc21.m4,
9596 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
9597 uintmax_t.m4, ulonglong.m4.
9598 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
9599 po.m4 since we are now using _gl.m4 instead.
9600
96012004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
9602
9603 * src/scan-action.l: Remove. Scanning of semantic actions is
9604 handled in scan-gram.l.
9605
96062004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
9607
9608 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
9609
9610 * src/location.h (struct): The file member is a uniqstr.
9611 (equal_boundaries): Use UNIQSTR_EQ for comparison.
9612
96132004-07-22 Paul Eggert <eggert@cs.ucla.edu>
9614
9615 Fix bug with non-%union parsers that have printers or destructors,
9616 which led to a Bison core dump. Reported by Peter Fales in
9617 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
9618
9619 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
9620 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
9621 not to our own type.
9622 * src/output.c (symbol_destructors_output, symbol_printers_output):
9623 Don't assume %union.
9624 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
9625 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
9626 UNION-FLAG. All callers changed.
9627 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
9628 Use type char, not unsigned int, when declaring an array of char;
9629 this lets us remove a cast.
9630 (Printers and Destructors): Add non-%union test cases.
9631
96322004-06-21 Paul Eggert <eggert@cs.ucla.edu>
9633
9634 * doc/bison.texinfo: Minor editorial changes, mostly to the new
9635 GLR writeups. E.g., avoid frenchspacing and the future tense,
9636 change "lookahead" to "look-ahead", and change "wrt" to "with
9637 respect to".
9638
96392004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9640
9641 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
9642 New sections, split off from the GLR Parsers section. Put the new
9643 Simple GLR Parser near the start of the GLR section, for clarity.
9644 Rewrite connective text.
9645
96462004-06-21 Frank Heckenbach <frank@g-n-u.de>
9647
9648 * doc/bison.texinfo (Simple GLR Parsers): New section.
9649
96502004-06-21 Paul Eggert <eggert@cs.ucla.edu>
9651
9652 * NEWS, TODO, doc/bison.texinfo:
9653 Use "look-ahead" instead of "lookahead", to be consistent.
9654 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
9655 while we're fixing "look-ahead".
9656 * src/conflicts.c (shift_set): Renamed from shiftset.
9657 (look_ahead_set): Renamed from lookaheadset.
9658 * src/print.c: Likewise.
9659 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
9660 name for "lookahead".
9661 (report_types, usage): Likewise.
9662 * src/getargs.h (report_look_ahead_tokens): Renamed from
9663 report_lookaheads.
9664 * src/lalr.c (compute_look_ahead_tokens): Renamed from
9665 compute_lookaheads.
9666 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
9667 (look_ahead_tokens_print): Renamed from lookaheads_print.
9668 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
9669 state_rule_lookaheads_print.
9670 * src/state.h: Likewise.
9671 (reductions.look_ahead_tokens): Renamed from lookaheads.
9672 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
9673 AT_DATA_LOOKAHEADS_GRAMMAR.
9674
96752004-06-03 Paul Eggert <eggert@cs.ucla.edu>
9676
9677 * README: Update location of patched M4 distribution.
9678
96792004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
9680
9681 Don't assume the C++ compiler takes the same arguments as the C compiler
9682 (trivial change).
9683 * configure.ac (O0CXXFLAGS): New var.
9684 * tests/atlocal.in (CXXFLAGS): Use it.
9685
96862004-05-29 Paul Eggert <eggert@cs.ucla.edu>
9687
9688 Fix some "make check" problems with C++ reported by
9689 Albert Chin-A-Young for Tru64 C++ in this thread:
9690 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
9691
9692 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
9693 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9694 Output to a .cc file for C++, not to a .c file.
9695 * tests/calc.at (AT_CHECK_CALC): Likewise.
9696 * tests/regression.at (AT_CHECK_DANCER): Likewise.
9697 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
9698
96992004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
9700
9701 * tests/calc.at, tests/actions.at: Workaround for SGI
9702 C++ compiler. (trivial change)
9703
97042004-05-27 Paul Eggert <eggert@cs.ucla.edu>
9705
9706 Spent a few hours checking out which prerequisite versions the
9707 current sources actually require. I went all the way back to
9708 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
9709 a seemingly endless set of combinations of versions more recent
9710 than that. The bottom line is that the current sources require
9711 fairly recent versions of the build tools, and it'll be some work
9712 to change this.
9713 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
9714 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
9715 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
9716 Add comments explaining why those particular versions are
9717 currently needed.
9718
9719 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
9720 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
9721 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
9722
9723 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
9724 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
9725
97262004-05-26 Paul Eggert <eggert@cs.ucla.edu>
9727
9728 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
9729 0.11.5. Suggested by Bruno Haible.
9730 * bootstrap: Remove gettext version checking.
9731
9732 * doc/bison.texinfo (Decl Summary): Also mention that %union
9733 can depend on prerequisite types. Problem reported by Tim
9734 Van Holder.
9735
97362004-05-25 Paul Eggert <eggert@cs.ucla.edu>
9737
9738 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
9739 * README-alpha: Don't tell people not to package this.
9740
9741 * bootstrap: Don't assume $(...) works; use `...` instead.
9742 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
9743 gettext better.
9744
9745 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
9746 put into the -d output file, and mention what to do if YYSTYPE is
9747 defined as a macro.
9748
97492004-05-24 Paul Eggert <eggert@cs.ucla.edu>
9750
9751 Undo change made earlier today: it caused autopoint to not bring
9752 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
9753 autopoint's.
9754
9755 * bootstrap: Check that gettext version matches what's in
9756 configure.ac. Warn users to ignore robots.txt ERROR 404.
9757 * bootstrap: Undo today's earlier change (logged below).
9758 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
9759
9760 The gettext version checking is causing more trouble than it's
9761 curing; remove it. Problem reported by Paul Hilfinger.
9762
9763 * bootstrap: Issue a warning that one can expect a message
9764 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
9765 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
9766
97672004-05-23 Paul Eggert <eggert@cs.ucla.edu>
9768
9769 Ensure that the C++ compiler used for testing actually works on a
9770 simple test program; if not, skip the C++-related tests. Problem
9771 reported by Vin Shelton in:
9772 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
9773
9774 * m4/cxx.m4: New file.
9775 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
9776 * tests/atlocal.in (BISON_CXX_WORKS): Add.
9777 * tests/local.at (AT_COMPILE_CXX): Use it.
9778
97792004-05-21 Paul Eggert <eggert@cs.ucla.edu>
9780
9781 * data/glr.c (yylloc): Output this macro even if locations are not
9782 being generated, as the GLR parser needs it even in that case.
9783 Problem reported by Troy A. Johnson
9784 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
9785
9786 * configure.ac (AC_INIT): Update to 1.875e.
9787
97882004-05-21 Paul Eggert <eggert@cs.ucla.edu>
9789
9790 * NEWS: Version 1.875d.
9791 * configure.ac (AC_INIT): Likewise.
9792 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
9793
9794 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
9795 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
9796 lalr1.cc runs afoul of the first, and the last two are no longer
9797 supported by GCC 3.4.0.
9798 * README: Mention GNU m4 1.4 or later; mention m4 patches.
9799 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
9800
98012004-05-06 Paul Eggert <eggert@cs.ucla.edu>
9802
9803 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
9804 unsigned int, for compatibility with latest gnulib hash module.
9805 * src/state.c (state_hash, state_hasher): Likewise.
9806 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
9807 * src/uniqstr.c (hash_uniqstr): Likewise.
9808
98092004-05-03 Paul Eggert <eggert@cs.ucla.edu>
9810
9811 * NEWS: Unescaped newlines are no longer allowed in char & strings.
9812
9813 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
9814 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
9815 character and string literals.
9816 (unexpected_end): New function.
9817 (unexpected_eof): Use it.
9818 (unexpected_newline): New function.
9819 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
9820 actions.
9821
9822 * NEWS: Document %expect-rr.
9823
9824 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
9825 Fix typo by replacing $1 with $option.
9826 Remove more 'intl'-related files.
9827 Don't DEFUN AM_INTL_SUBDIR twice.
9828
9829 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
9830 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
9831 strtoul.c.
9832 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
9833 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
9834 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
9835 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
9836 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
9837 * src/.cvsignore: Add *.output.
9838
9839 * src/parse-gram.y: Put copyright notice inside %{ %} so it
9840 gets copied to the output file.
9841
98422004-04-28 Paul Eggert <eggert@twinsun.com>
9843
9844 Get files from the gnulib and po repositories, instead of relying
9845 on them being in our CVS. Upgrade to latest versions of gnulib
9846 and Automake.
9847
9848 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
9849 * bootstrap: Bootstrap from gnulib and po repositories.
9850 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
9851 * README-cvs: Document these changes. Remove version numbers from
9852 mentions of build tools, since they change so often. Mention Flex.
9853
9854 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
9855 (gl_USE_SYSTEM_EXTENSIONS): Add.
9856 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
9857 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
9858 does this for us.
9859 (AC_ISC_POSIX): Remove; we no longer support this
9860 ancient OS, as it gets in the way of latest Autoconf & gnulib.
9861 (AC_HEADER_STDC): Remove: we now assume C89 or better.
9862 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
9863 Do not check for C89 headers, except for locale.h which is used
9864 by the Yacc library and must port to K&R hosts.
9865 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
9866 Do not check for C89 functions, except for setlocale which is
9867 used by the Yacc library.
9868 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
9869 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
9870 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
9871 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
9872 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
9873 AM_GNU_GETTEXT): Remove; now done by:
9874 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
9875 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
9876 for us.
9877
9878 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
9879 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
9880 Define to empty, as gnulib.mk will do the rest for us.
9881 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
9882 for us.
9883 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
9884 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
9885
9886 * src/files.c: Include gnulib's xstrndup.h.
9887
9888 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
9889 (REALLOC): Use xnrealloc, for likewise.
9890 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
9891 (strnlen, memrchr): Remove decls; functions no longer used.
9892 Include <stpcpy.h>.
9893
9894 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
9895 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
9896 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
9897 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
9898 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
9899 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
9900 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
9901 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
9902 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
9903 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
9904 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
9905 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
9906 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
9907 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
9908 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
9909 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
9910 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
9911 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
9912 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
9913 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
9914 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
9915 Remove, as these files are now generated automatically
9916 by bootstrap or automake.
9917
9918 * po/ChangeLog: Remove: all but one entry was a duplicate
9919 of this file, and I moved that 2000-11-02 entry here.
9920
9921 * config/.cvsignore: Add Makefile, depcomp, install-sh.
9922 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
9923 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
9924 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
9925 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
9926 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
9927 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
9928 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
9929 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
9930 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
9931 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
9932 xstrndup.h.
9933 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
9934 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
9935 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
9936 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
9937 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
9938 * src/.cvsignore: Remove *_.c.
9939
9940
9941 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
9942 support it. (The latest stable gzip doesn't.)
9943
99442004-04-27 Paul Eggert <eggert@twinsun.com>
9945
9946 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
9947 case, as stos_ is now used by destructors due to the 2004-02-09
9948 change.
9949
9950 Remove more K&R C support.
9951 * lib/libiberty.y (PARAMS): Remove. All uses removed.
9952 * lib/subpipe.c (errno): Remove decl.
9953 Include <stdlib.h> unconditionally.
9954 (EXIT_FAILURE): Remove macro.
9955 * src/complain.c (vfprintf, strerror): Remove.
9956 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
9957 unconditionally.
9958 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
9959 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
9960 (strchr, strspn, memchr): Remove decls.
9961 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
9962 unconditionally. Do not declare perror.
9963 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
9964 unconditionally.
9965
9966 * src/complain.c (_): Remove useless defn, as system.h defines this.
9967
9968 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
9969 with latest obstack.h.
9970 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
9971 to procedure types, as obstack.h now does that for us.
9972 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
9973
9974 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
9975 so that this include file can stand alone.
9976 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
9977 does this now. Include subpipe.h first after config.h, to
9978 test whether it can stand alone.
9979
9980 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
9981 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
9982 unused declaration.
9983
9984 * tests/synclines.at (%union synch line): Put a dummy member in
9985 the union, because empty unions aren't allowed in C. Caught
9986 by GCC 3.4.0.
9987
99882004-04-13 Jim Meyering <jim@meyering.net>
9989
9990 * src/conflicts.c (conflicts_print): Correct format string typo:
9991 use `%%' to produce literal `%'. (trivial change)
9992
99932004-03-30 Paul Eggert <eggert@twinsun.com>
9994
9995 * src/getargs.c (version): Update copyright year to 2004.
9996
9997 * data/c.m4 (b4_int_type): Use 'short int' rather than
9998 'short', and similarly for 'long', 'unsigned', etc.
9999 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
10000 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
10001 yy_yypstack, yydumpstack): Likewise.
10002 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
10003 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
10004 Likewise.
10005 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
10006 yy_stack_print, yyparse): Likewise.
10007 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
10008 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
10009 * lib/bitset.c (bitset_print): Likewise.
10010 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
10011 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10012 * lib/bitsetv.c (bitsetv_dump): Likewise.
10013 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
10014 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
10015 Likewise.
10016 * src/LR0.c (allocate_itemsets): Likewise.
10017 * src/gram.h (rule_number, rule): Likewise.
10018 * src/lalr.h (goto_number): Likewise.
10019 * src/nullable.c (nullable_compute): Likewise.
10020 * src/output.c (prepare_rules): Likewise.
10021 * src/relation.c (relation_print, relation_digraph): Likewise.
10022 * src/relation.h (relation_node): Likewise.
10023 * src/state.h (state_number, transitions, errs, reductions,
10024 struct state): Likewise.
10025 * src/symtab.h (symbol_number, struct symbol): Likewise.
10026 * src/tables.c (vector_number, tally, action_number,
10027 default_goto, goto_actions): Likewise.
10028 * tests/existing.at (GNU Cim Grammar): Likewise.
10029 * tests/regression.at (Web2c Actions): Likewise.
10030
10031 * src/output.c (muscle_insert_short_int_table): Renamed from
10032 muscle_insert_short_table. All uses changed.
10033
100342004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10035
10036 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
10037 (declaration): Replace expected_conflicts with expected_sr_conflicts.
10038 Add %expect-rr rule.
10039
10040 * src/scan-gram.l: Recognize %expect-rr.
10041
10042 * src/conflicts.h (expected_sr_conflicts): Rename from
10043 expected_conflicts.
10044 (expected_rr_conflicts): Declare.
10045
10046 * src/conflicts.c (expected_sr_conflicts): Rename from
10047 expected_conflicts.
10048 (expected_rr_conflicts): Define.
10049 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
10050 for GLR parsers.
10051 Use expected_sr_conflicts in place of expected_conflicts.
10052 Warn if expected_rr_conflicts used in non-GLR parser.
10053
10054 * doc/bison.texinfo: Add documentation for %expect-rr.
10055
100562004-03-08 Paul Eggert <eggert@gnu.org>
10057
10058 Add support for hex token numbers. Suggested by Odd Arild Olsen in
10059 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
10060
10061 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
10062 in lalr1.cc.
10063 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
10064 * src/scan-gram.l (scan_integer): New function.
10065 ({int}): Use it.
10066 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
10067 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
10068 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
10069 Say "long int", not "long", for uniformity with GNU style.
10070
100712004-02-25 Paul Eggert <eggert@twinsun.com>
10072
10073 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
10074 compilers. This fixes a problem with Intel's C++ compiler being
10075 chatty, reported by Guido Trentalancia in
10076 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
10077
100782004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
10079
10080 Support %destructor and merge error locations in lalr1.cc.
10081
10082 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
10083 (Parser::stos_): Define unconditionally.
10084 (Parser::destruct_): New method. Generate its body with
10085 b4_yydestruct_generate.
10086 (Parser::error_start_): New attribute.
10087 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
10088 token which are discarded.
10089 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
10090 error_start_ when erroneous token are discarded.
10091 (Parser::parse) <yyerrlab1>: Compute the location of the error
10092 token so that it covers all the discarded tokens.
10093 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
10094 it can be called with `%skeleton "lalr1.cc"', and do that.
10095
100962004-02-02 Paul Eggert <eggert@twinsun.com>
10097
10098 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
10099 $(top_srcdir)/lib and ../lib. This fixes a bug reported
10100 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
10101 There's no need to mention top_builddir since Automake does that
10102 for us.
10103 (INCLUDES): Remove, as Automake says it's obsolescent.
10104 Contents migrated into AM_CPPFLAGS as described above.
10105 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
10106
101072004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10108
10109 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
10110 (yyreportSyntaxError): Handle case where lookahead token is
10111 YYEMPTY.
10112
101132004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10114
10115 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
10116 resulting parsers are compilable with C++.
10117
101182003-12-23 Paul Eggert <eggert@twinsun.com>
10119
10120 * config/depcomp, config/install-sh: Sync with Automake 1.8.
10121 * src/output.c (output_skeleton): Rename local var.
10122 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
10123 Bison tokens, as this runs afoul of the 2003-10-07 change that
10124 disallowed NUL bytes in character constants or string literals.
10125
10126 * tests/local.at: Require Autoconf 2.59's Autotest.
10127 * tests/testsuite.at: Don't include local.at, since we now assume
10128 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
10129 including it.
10130 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
10131 multiple inclusion warnings.
10132
101332003-12-02 Akim Demaille <akim@epita.fr>
10134
10135 * doc/bison.texinfo (How Can I Reset the Parser): More about start
10136 conditions.
10137 From Bruno Haible.
10138
101392003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
10140
10141 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
10142
101432003-10-07 Paul Eggert <eggert@twinsun.com>
10144
10145 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
10146 if testsuite doesn't exist.
10147
10148 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
10149 literals, unfortunately.
10150 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
10151 Complain about NUL bytes in character constants or string literals.
10152
101532003-10-05 Paul Eggert <eggert@twinsun.com>
10154
10155 * NEWS: Don't document %no-default-prec, as it's still
10156 too experimental.
10157 * doc/bison.texinfo: Document %no-default-prec only if
10158 the defaultprec flag is set. Normally it's not.
10159
101602003-10-04 Paul Eggert <eggert@twinsun.com>
10161
10162 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
10163 non-modifiable lvalue, instead of a modifiable one.
10164 * doc/bison.texinfo (Actions): Document that $$ can
10165 be assigned to. Do not claim that $$ and $N are
10166 array element references: user code should not rely on this.
10167
101682003-10-01 Paul Eggert <eggert@twinsun.com>
10169
10170 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
10171 (grammar_declaration): Use it.
10172 * src/scan-gram.l: New token %no-default-prec.
10173 * tests/conflicts.at: Revamp tests to use %no-default-prec.
10174 * NEWS, doc/bison.texinfo: Document the above.
10175
101762003-10-01 Akim Demaille <akim@epita.fr>
10177
10178 VCG no longer supports long_straight_phase.
10179
10180 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
10181 * src/print_graph.c (print_graph): Adjust.
10182
101832003-09-30 Frank Heckenbach <frank@g-n-u.de>
10184 and Paul Eggert <eggert@twinsun.com>
10185
10186 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
10187 Table of Symbols): Document %default-prec.
10188 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
10189 (grammar_declaration): Set default_prec on %default-prec.
10190 * src/scan-gram.l (%default-prec): New token.
10191 * src/reader.h (default_prec): New flag.
10192 * src/reader.c: Likewise.
10193 (packgram): Handle it.
10194 * tests/conflicts.at (%default-prec without %prec,
10195 %default-prec with %prec, %default-prec 1): New tests.
10196
101972003-09-30 Paul Eggert <eggert@twinsun.com>
10198
10199 * tests/testsuite.at: Include local.at, not input.at, fixing
10200 a typo in the 2003-08-25 patch.
10201
102022003-08-27 Akim Demaille <akim@epita.fr>
10203
10204 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
10205 GCC warnings.
10206
102072003-08-26 Akim Demaille <akim@epita.fr>
10208
10209 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
10210 "<\#" to avoid magic from Gnus when posting parts of this script.
10211
102122003-08-26 Akim Demaille <akim@epita.fr>
10213
10214 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
10215 (Parser::parse): here.
10216 Adjust: nerrs and errstatus is now replaced by...
10217 (Parser::nerrs_, Parser::errstatus_): New.
10218
102192003-08-25 Akim Demaille <akim@epita.fr>
10220
10221 * config/announce-gen, Makefile.cfg: New.
10222 * Makefile.am: Adjust.
10223 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
10224 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
10225
102262003-08-25 Akim Demaille <akim@epita.fr>
10227
10228 When reducing initial empty rules, Bison parser read an initial
10229 location that is not defined. This results in garbage, and that
10230 affects Bison's own parser. Therefore we need (i) to extend Bison
10231 to support a means to initialize this location, and (ii) to use
10232 this CVS Bison to fix CVS Bison's parser.
10233
10234 * src/reader.h, reader.c (epilogue_augment): Remove, replace
10235 with...
10236 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
10237 * src/parse-gram.y: Adjust.
10238 (%initial-action): New.
10239 (%error-verbose): Since we require CVS Bison, there is no reason
10240 not to use it.
10241 * src/scan-gram.l: Adjust.
10242 * src/Makefile.am (YACC): New, to make sure we use our own parser.
10243 * data/yacc.c (yyparse): Use b4_initial_action.
10244
102452003-08-25 Akim Demaille <akim@epita.fr>
10246
10247 * doc/bison.texinfo: Don't promote stdout for error messages.
10248
102492003-08-25 Akim Demaille <akim@epita.fr>
10250
10251 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
10252 From Alexandre Duret-Lutz.
10253
102542003-08-25 Akim Demaille <akim@epita.fr>
10255
10256 Version 1.875c.
10257
102582003-08-25 Akim Demaille <akim@epita.fr>
10259
10260 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
10261 Use them.
10262
102632003-08-25 Akim Demaille <akim@epita.fr>
10264
10265 * data/lalr1.cc (Parser::reduce_print_): New.
10266 Use it.
10267
102682003-08-25 Akim Demaille <akim@epita.fr>
10269
10270 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
10271 error recovery loops. This patch is based on
10272 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
10273 Also, augment the similarity between lalr1.cc and yacc.c.
10274 Note: the locations of error recovery rules are not correct yet.
10275
10276 * data/lalr1.cc: Comment changes to augment the similarity between
10277 lalr1.cc and yacc.c.
10278 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
10279 (yyerrlab1): Remove, but where it used to be (now the bottom part of
10280 yyerrlab), when hitting EOF, pop the whole stack here instead of
10281 merely falling thru the default error handling mechanism.
10282 (yyerrorlab): New label, with the old contents of YYERROR,
10283 plus the following change: pop the stack of rhs corresponding
10284 to the production that invoked YYERROR. That is how Yacc
10285 behaves (required by POSIX).
10286 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
10287 fail.
10288
102892003-08-25 Akim Demaille <akim@epita.fr>
10290
10291 Tune local.at so that people can "autom4te -l autotest calc.at -o
10292 calc" for instance, to extract a sub test suite.
10293
10294 * tests/testsuite.at: Move the initialization, Autotest version
10295 requirement, and AT_TESTED invocation into...
10296 * tests/local.at: here.
10297 * tests/testsuite.at: Include it for compatibility with Autoconf
10298 2.57.
10299 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
10300 be ignore.
10301
103022003-08-04 Paul Eggert <eggert@twinsun.com>
10303
10304 Rework code slightly to avoid gcc -Wtraditional warnings.
10305 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
10306 The returned value is now stored in *YY0. All callers changed.
10307 * src/output.c (merge_output): Adjust to the above change.
10308
103092003-07-26 Paul Eggert <eggert@twinsun.com>
10310
10311 * data/glr.c (YYASSERT): New macro.
10312 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
10313 yyresolveStates, yyprocessOneStack):
10314 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
10315 Derived from a suggestion by Frank Heckenbach.
10316
103172003-07-25 Paul Eggert <eggert@twinsun.com>
10318
10319 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
10320 for portability to K&R C (after ansi2knr, presumably). See
10321 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
10322 by Frank Heckenbach, though I have omitted the structure-initialization
10323 part of his glr-knr.diff patch since I recall that the Portable
10324 C Compiler didn't require that change.
10325
10326 Let the user specify how to allocate and free memory.
10327 Derived from a suggestion by Frank Heckenbach in
10328 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
10329 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
10330 All uses of free, malloc, realloc changed to use these macros,
10331 and unnecessary casts removed.
10332 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
10333
103342003-07-06 Matthias Mann <MatthiasMann@gmx.de>
10335
10336 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
10337 use s.empty() rather than s == "" to test for empty string; see
10338 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
10339 (trivial change)
10340
103412003-06-25 Akim Demaille <akim@epita.fr>
10342
10343 * config/depcomp, config/install-sh: Update from masters.
10344
103452003-06-20 Paul Eggert <eggert@twinsun.com>
10346
10347 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
10348 and return properly parenthesized result.
10349 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
10350 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10351 Remove unnecessary parentheses from uses.
10352 * doc/bison.texinfo (Location Default Action): Describe the
10353 conventions for parentheses.
10354
103552003-06-19 Paul Eggert <eggert@twinsun.com>
10356
10357 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
10358 yyreportTree): Do not assume that size_t is the same width as int,
10359 when printing sizes. Print sizes using an unsigned format.
10360 Problem reported by Frank Heckenbach in
10361 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
10362
10363 Port to Forte Developer 7 C compiler.
10364 * data/glr.c (struct YYLTYPE): If locations are not being used,
10365 declare a single dummy member, as empty structs do not conform
10366 to the C standard.
10367 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
10368 the Forte Developer 7 C compiler complains that end-of-loop
10369 code is not reached.
10370
103712003-06-17 Paul Eggert <eggert@twinsun.com>
10372
10373 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
10374 avoid warnings from picky compilers about redefinition of PARAMS.
10375
103762003-06-17 Paul Eggert <eggert@twinsun.com>
10377
10378 Version 1.875b.
10379
10380 * NEWS: Document 1.875b.
10381
10382 * lib/bbitset.h: Do not include config.h; that's the includer's job.
10383 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
10384 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
10385 Don't use 'index' in comments, as it's a builtin fn on some hosts.
10386 * lib/bitset_stats.c: Include gettext.h unconditionally, as
10387 per recent gettext manual's suggestion.
10388 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
10389 Use prototypes, not old-style definitions.
10390 * lib/lbitset.c (lbitset_unused_clear): Likewise.
10391 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
10392 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
10393 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
10394 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
10395 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
10396 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
10397 vbitset_or_and_cmp, vbitset_copy): Likewise.
10398
10399 * lib/libiberty.h: Do not include config.h; that's the includer's job.
10400 Do not include <stdlib.h>.
10401 (PARAMS): Define unconditionally for C89.
10402 (ATTRIBUTE_NORETURN): Remove.
10403 (ATTRIBUTE_UNUSED): Define unconditionally.
10404
10405 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
10406 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
10407 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
10408 * lib/vbitset.c, lib/vbitset.h: New files.
10409 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10410 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
10411 from libbitset.
10412
10413 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
10414 `How Can I Reset @code{yyparse}', since texinfo does not allow
10415 arbitrary @ in node names.
10416
10417 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
10418 shouldn't be needed according to the gettext 0.12.1 documentation
10419 but which seem to be needed anyway: codeset.m4 glibc21.m4
10420 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
10421 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
10422 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
10423
10424 * lib/.cvsignore: Add stdbool.h.
10425 * m4/.cvsignore: Add nls.m4, po.m4.
10426
10427 Upgrade to CVS gnulib.
10428 * stdbool_.h: File renamed from stdbool.h.in.
10429 * configure.ac (AM_STDBOOL_H): Invoke this instead of
10430 AC_HEADER_STDBOOL.
10431 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
10432 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
10433 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
10434 (MOSTLYCLEANFILES): New var.
10435 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
10436 (stdbool.h): New rule.
10437 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
10438 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
10439 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
10440 m4/quote.m4: Upgrade to today's gnulib.
10441
10442 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
10443 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
10444 the tests right now.
10445 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
10446 yyerror are declared before use; C99 requires this.
10447
104482003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10449
10450 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
10451 first.
10452 (yyrecoverSyntaxError): Correct the logic for setting and testing
10453 yyerrState.
10454 Correct comment on handling EOF.
10455 Allow states with only a default reduction, rather than failing
10456 (I can't quite reconstruct why these were not allowed before).
10457
10458 Fixes to avoid problem that $-N rules in GLR parsers can cause
10459 buffer overruns, corrupting state.
10460
10461 * src/output.c (prepare_rules): Output max_left_semantic_context
10462 definition.
10463 * src/reader.h (max_left_semantic_context): New variable declaration.
10464 * src/scan-gram.l (max_left_semantic_context): Define.
10465 (handle_action_dollar): Update max_left_semantic_context.
10466 * data/glr.c (YYMAXLEFT): New definition.
10467 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
10468 (yyresolveAction): Ditto.
10469
10470 Fixes to problems with location handling in GLR parsers reported by
10471 Frank Heckenbach (2003/06/05).
10472
10473 * data/glr.c (YYLTYPE): Make trivial if locations not used.
10474 (YYRHSLOC): Add parentheses, and define only if locations used.
10475 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
10476 locations not used.
10477 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
10478 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
10479
10480 * tests/cxx-type.at: Exercise location information; update tests
10481 to differentiate output with and without locations.
10482 Remove forward declarations of yylex and yyerror---caused errors
10483 because default YYLTYPE not yet defined.
10484 Change semantic actions to compute strings, rather than printing
10485 them directly (to test proper passing of semantics values). Change
10486 output to prefix notation and update test data and expected results.
10487 (yylex): Track locations.
10488 (stmtMerge): Return value rather than printing, and include arguments
10489 in value.
10490
104912003-06-03 Paul Eggert <eggert@twinsun.com>
10492
10493 Avoid warnings generated by GCC 2.95.4 when Bison is
10494 configured with --enable-gcc-warnings.
10495 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
10496 yy::]b4_parser_class_name[::translate_,
10497 yy::Stack::operator[] (unsigned),
10498 yy::Stack::operator[] (unsigned) const,
10499 yy::Slice::operator[] (unsigned),
10500 yy::Slice::operator[] (unsigned) const):
10501 Rename local vars to avoid warnings.
10502 * tests/glr-regression.at (Improper handling of embedded actions
10503 and $-N in GLR parsers): Remove unused local variable from yylex.
10504 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
10505 (void) as arg when not pure, since we now assume C89 when building
10506 Bison. Pacify GCC by using parameter.
10507
105082003-06-02 Paul Eggert <eggert@twinsun.com>
10509
10510 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
10511 yy::Location::lines, yy::Location::columns): Rename arguments
10512 to avoid shadowing; this removes a warning generated by GCC 3.3.
10513
105142003-06-01 Paul Eggert <eggert@twinsun.com>
10515
10516 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
10517 to g++, as GCC 3.3 complains if you do it.
10518 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
10519 everything that WARNING_CFLAGS has, except omit warnings
10520 not suitable for C++.
10521 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
10522 * tests/atlocal.in (CXXFLAGS): New var.
10523 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
10524
10525 Fix a GLR parser bug I reported in February; see
10526 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
10527 The problem was that GLR parsers did not conform to the C standard,
10528 because actions like { $1 = $2 + $3; } expanded to expressions
10529 that invoked YYFILL in separate subexpressions, and YYFILL assigned
10530 to a local variable. The C standard says that expressions
10531 like (var = f ()) + (var = f ()) have undefined behavior.
10532 Another problem was that GCC sometimes issues warnings that
10533 yyfill and its parameters are unused.
10534
10535 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
10536 as possibly unused.
10537 (yyfill): New function.
10538 (YYFILL): Use it.
10539 (yyuserAction): Change type of yynormal to bool, so that it matches
10540 the new yyfill signature. Mark it as possibly unused.
10541
10542
10543 Follow up on a bug I reported in February, where a Bison-generated
10544 parser can loop. Provide a test case and a fix for yacc.c. I
10545 don't have a fix for lalr1.cc or for glr.c, unfortunately.
10546 The original bug report is in:
10547 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
10548
10549 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
10550 macro's size was becoming unwieldy.
10551 (yyerrlab): Do not discard an empty lookahead symbol, as this
10552 might destroy garbage.
10553 (yyerrorlab): New label, with the old contents of YYERROR,
10554 plus the following change: pop the stack of rhs corresponding
10555 to the production that invoked YYERROR. That is how Yacc
10556 behaves, and POSIX requires this behavior.
10557 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
10558 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
10559 Define 'alarm' to do nothing if unistd.h is not available.
10560 Add a new rule "exp: '-' error;" to test the above change to
10561 data/yacc.c. Use 'alarm' to abort any test taking longer than
10562 10 seconds, as it's probably looping.
10563 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
10564 Also, the new yacc.c generates two fewer diagnostics for an
10565 existing test.
10566
105672003-05-24 Paul Eggert <eggert@twinsun.com>
10568
10569 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
10570 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
10571 This fixes a problem reported by John Bowman when the Compaq/HP
10572 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
10573 -ansi -Wall -gall).
10574 * data/yacc.c (union yyalloc): Likewise.
10575 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
10576
10577 Switch from 'int' to 'bool' where that makes sense.
10578
10579 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
10580 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
10581 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
10582 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
10583 Return or accept bool, not int. All callers changed.
10584 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
10585 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
10586 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
10587 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
10588 bitset_or_and_cmp_): Likewise.
10589 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
10590 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
10591 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
10592 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
10593 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
10594 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
10595 bitset_stats_or_and_cmp): Likewise.
10596 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
10597 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
10598 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
10599 ebitset_xor_cmp): Likewise.
10600 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
10601 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
10602 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
10603 lbitset_xor_cmp): Likewise.
10604 * lib/bbitset.h: Include <stdbool.h>.
10605 (struct bitset_vtable): The following members now return bool, not
10606 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
10607 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
10608 or_and_cmp).
10609 * src/conflicts.c (count_rr_conflicts): Likewise.
10610 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
10611 All uses changed.
10612 * lib/ebitset.c (ebitset_obstack_init): Likewise.
10613 * lib/lbitset.c (lbitset_obstack_init): Likewise.
10614 * src/getargs.c (debug_flag, defines_flag, locations_flag,
10615 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10616 graph_flag): Likewise.
10617 * src/getargs.h (debug_flag, defines_flag, locations_flag,
10618 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10619 graph_flag): Likewise.
10620 * src/output.c (error_verbose): Likewise.
10621 * src/output.h (error_verbose): Likewise.
10622 * src/reader.c (start_flag, typed): Likewise.
10623 * src/reader.h (typed): Likewise.
10624 * src/getargs.c (LOCATIONS_OPTION): New constant.
10625 (long_options, getargs): Use it.
10626 * src/lalr.c (build_relations): Use bool, not int.
10627 * src/nullable.c (nullable_compute): Likewise.
10628 * src/print.c (print_reductions): Likewise.
10629 * src/tables.c (action_row, pack_vector): Likewise.
10630 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
10631 * src/output.c (prepare): Use it.
10632 * src/output.c (token_definitions_output,
10633 symbol_destructors_output, symbol_destructors_output): Use string,
10634 not boolean integer, to keep track of whether to output separator.
10635 * src/print_graph.c (print_core): Likewise.
10636 * src/state.c (state_rule_lookaheads_print): Likewise.
10637
10638 * config/install-sh: Sync from automake 1.7.5.
10639
106402003-05-14 Paul Eggert <eggert@twinsun.com>
10641
10642 * src/parse-gram.y (rules_or_grammar_declaration): Require a
10643 semicolon after a grammar declaration, in the interest of possible
10644 future changes to the Bison input language.
10645 Do not allow a stray semicolon at the start of the grammar.
10646 (rhses.1): Allow one or more semicolons after any rule, including
10647 just before "|" as required by POSIX.
10648 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
10649 grammar.
10650
106512003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
10652
10653 %parse-param support for lalr1.cc.
10654
10655 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
10656 b4_cc_constructor_calls, b4_cc_constructor_call,
10657 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
10658 definitions.
10659 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
10660 parse-param arguments.
10661 (yy::b4_parser_class_name): Declare instance variables to
10662 hold parse-param arguments.
10663 * tests/calc.at: s/value/semantic_value/ because value clashes
10664 with a member of yy::b4_parser_class_name. Adjust C++ code
10665 to handle %parse-param. Enable %parse-param test in C++.
10666
106672003-05-12 Paul Eggert <eggert@twinsun.com>
10668
10669 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
10670 English a bit. Fix fclose typo. Change "const char" to "char
10671 const", and use ANSI C rather than K&R for "main". Suggest
10672 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
10673 and suggest yy_switch_to_buffer.
10674
106752003-05-05 Paul Eggert <eggert@twinsun.com>
10676
10677 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
10678 C89. This avoids a diagnostic on compilers that define __STDC__
10679 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
10680 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
10681
106822003-05-03 Paul Eggert <eggert@twinsun.com>
10683
10684 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
10685 Do not overrun array bounds.
10686 This should fix a bug reported today by Olatunji Oluwabukunmi in
10687 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
10688
106892003-04-29 Akim Demaille <akim@epita.fr>
10690
10691 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
10692 * src/getargs.c, src/getargs.h: here, as bool, not int.
10693 (nondeterministic_parser): New.
10694 * src/parse-gram.y, src/scan-gram.l: Support
10695 %nondeterministic-parser.
10696 * src/output.c (prepare): Use nondeterministic_parser instead
10697 of glr_parser where appropriate.
10698 * src/tables.c (conflict_row, action_row, save_row)
10699 (token_actions, token_actions, pack_vector): Ditto.
10700
107012003-04-29 Akim Demaille <akim@epita.fr>
10702
10703 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
10704
107052003-04-29 Akim Demaille <akim@epita.fr>
10706
10707 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
10708 with %pure-parser and %locations to exercise the patch from Yakov
10709 Markovitch below.
10710
107112003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
10712
10713 * data/yacc.c: (b4_lex_param): Corrected for the case where
10714 %lex-param is provided and %pure-parser isn't.
10715
107162003-04-27 Paul Eggert <eggert@twinsun.com>
10717
10718 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
10719 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
10720 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
10721 if it is not defined.
10722 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
10723
107242003-04-26 Paul Eggert <eggert@twinsun.com>
10725
10726 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
10727 Declare to be of type suitable for the ninf value itself, not of
10728 type suitable for the corresponding table, since the latter might
10729 be unsigned but the ninf value might be negative. This fixes a
10730 bug reported by Alexandre Duret-Lutz in
10731 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
10732
10733 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
10734 invokes it. We shouldn't invoke it twice because it will attempt
10735 to put error.o in the archive twice. This fixes a glitch reported
10736 by Martin Mokrejs in
10737 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
10738
107392003-04-21 Paul Eggert <eggert@twinsun.com>
10740
10741 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
10742 to gnulib.
10743
107442003-04-21 Yakov Markovitch <Markovitch@iso.ru>
10745
10746 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
10747 Fix obvious typo that results in uncompilable GLR parsers
10748 when both %pure-parser and %locations are used. (trivial change)
10749
107502003-04-17 Paul Eggert <eggert@twinsun.com>
10751
10752 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
10753 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
10754 Do not insert the expected token via unput, as this runs afoul
10755 of a POSIX-compatibility bug in flex 2.5.31.
10756 All uses changed to BEGIN the parent state,
10757 since we no longer insert the expected token via unput.
10758 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
10759 that is no longer emitted after the above change.
10760
10761 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
10762 the first one. This change is from Paul Hilfinger, and it fixes
10763 regression reported by Werner Lemberg in
10764 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
10765
10766 (resolve_sr_conflict): Don't invoke state_errs_set
10767 unless one or more tokens have been explicitly made errors.
10768 Otherwise, the above change causes Bison to abort.
10769
10770 * tests/existing.at (GNU pic Grammar): New test case, taken from
10771 Lemberg's email.
10772
107732003-03-31 Akim Demaille <akim@epita.fr>
10774
10775 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
10776
107772003-03-31 Akim Demaille <akim@epita.fr>
10778
10779 * src/output.c (prepare_symbols): Avoid trailing spaces in the
10780 output.
10781
107822003-03-31 Akim Demaille <akim@epita.fr>
10783
10784 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
10785 From Paul Hilfinger.
10786
107872003-03-29 Akim Demaille <akim@epita.fr>
10788
10789 * m4/error.m4: Do not put under dynamic conditions some code which
10790 expansion is under static control.
10791
107922003-03-29 Akim Demaille <akim@epita.fr>
10793
10794 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
10795
107962003-03-29 Akim Demaille <akim@epita.fr>
10797
10798 * doc/bison.texinfo (Strings are Destroyed): New.
10799
108002003-03-13 Paul Eggert <eggert@twinsun.com>
10801
10802 * .cvsignore: Add configure.lineno.
10803 * src/.cvsignore: Add yacc.
10804 * tests/.cvsignore: Add testsuite.log.
10805 * doc/fdl.texi: Sync with latest FSF version.
10806
108072003-03-12 Paul Eggert <eggert@twinsun.com>
10808
10809 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
10810 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
10811 cursor, instead of leaving it undefined. This fixes a bug
10812 reported by Tim Van Holder in
10813 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
10814 * tests/input.at (Torturing the Scanner): Test the scanner on
10815 an empty input file, which was Tim Van Holder's test case.
10816
10817 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
10818 <sys/resource.h> can be included, include sys/time.h and
10819 sys/times.h first, if available. This works around the SunOS
10820 4.1.4 porting bug reported by Bruce Becker in
10821 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
10822
10823 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
10824 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
10825 AC_HEADER_SYS_WAIT.
10826
10827 Merge changes from gnulib. This was prompted because the CVS
10828 snapshot didn't build on Solaris 7 due to strnlen problems.
10829
10830 These changes need to be merged back into gnulib:
10831 * lib/hash.c: Include <stdbool.h> unconditionally.
10832 * m4/onceonly.m4 (m4_quote): New macro.
10833 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
10834 Quote AC_FOREACH variable-expansions properly.
10835 The 2003-01-03 obstack.h change also needs merging.
10836 {end of changes requiring merging}
10837
10838 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
10839 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
10840 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
10841 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
10842 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
10843 New files, imported from gnulib.
10844 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
10845 above.
10846
10847 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
10848 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
10849 gnulib sources.
10850
10851 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
10852 Add.
10853 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
10854 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
10855 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
10856 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
10857 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
10858 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
10859 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
10860 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
10861 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
10862 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
10863 (jm_PREREQ_ARGMATCH): Remove.
10864 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
10865 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
10866
10867 * src/system.h: Include <stdbool.h> unconditionally.
10868
10869 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
10870 assuming at least C89 in the bitset code for some time now.
10871
108722003-03-03 Akim Demaille <akim@epita.fr>
10873
10874 * ro.po: New.
10875
108762003-03-02 Akim Demaille <akim@epita.fr>
10877
10878 * doc/bison.texinfo (Table of Symbols): Reactivate the
10879 documentation for %lex-param, and %parse-param.
10880
108812003-03-02 Akim Demaille <akim@epita.fr>
10882
10883 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
10884 generate verbose error messages.
10885 Use the number of tokens as an upper bound in yytname, as it
10886 cannot be a non terminal.
10887
108882003-03-02 Akim Demaille <akim@epita.fr>
10889
10890 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
10891 message.
10892
108932003-03-02 Akim Demaille <akim@epita.fr>
10894
10895 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
10896 Use them to exercise yycheck overrun.
10897 Based on Andrew Suffield's grammar.
10898
108992003-03-02 Akim Demaille <akim@epita.fr>
10900
10901 Create tests/local.at for Bison generic testing macros.
10902
10903 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
10904 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
10905 This new file.
10906 * tests/calc.at (AT_CHECK_CALC): Adjust.
10907 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
10908 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
10909 * tests/local.at: here.
10910 (AT_COMPILE_CXX): Tags the tests using it as c++.
10911 Ignore the test if CXX is not functional.
10912
109132003-03-01 Paul Eggert <eggert@twinsun.com>
10914
10915 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
10916 not loc->end, since loc->end might contain garbage and this leads
10917 to undefined behavior on some platforms.
10918 (id_loc, token_start): Use (IF_LINTed) initial values that do not
10919 depend on *loc, so that the reader doesn't give the the false
10920 impression that *loc is initialized.
10921 (<INITIAL>"%%"): Do not bother setting code_start, since its value
10922 does not survive the return.
10923
109242003-03-01 Akim Demaille <akim@epita.fr>
10925
10926 * src/scan-gram.l (code_start): Always initialize it when entering
10927 into yylex, as SC_EPILOGUE is activated *before* the corresponding
10928 yylex invocation. An alternative would be making it static, but
10929 then it starts with the second %%'s beginning, instead of its end.
10930
109312003-02-28 Paul Eggert <eggert@twinsun.com>
10932
10933 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
10934 around a UnixWare 7.1.1 porting bug reported by John Hughes in
10935 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
10936
109372003-02-26 Paul Eggert <eggert@twinsun.com>
10938
10939 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
10940 Remove Sequent/Pyramid discussion (nobody uses them any more).
10941 Merge VMS and MS-DOS discussion; these ports may well be dead
10942 but let's keep mentioning them for now. Put <> around email
10943 addresses. Add copyright notice.
10944
109452003-02-24 Paul Eggert <eggert@twinsun.com>
10946
10947 * data/glr.c (yy_reduce_print): yylineno -> yylno,
10948 to avoid collision with flex use of yylineno.
10949 Problem reported by Bruce Lilly in
10950 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
10951 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
10952 * data/yacc.c (yy_reduce_print): Likewise.
10953
10954 * config/depcomp: Sync with Automake 1.7.3.
10955
109562003-02-21 Akim Demaille <akim@epita.fr>
10957
10958 * data/lalr1.cc: Use temporary variables instead of casts to
10959 change integer types.
10960 Suggested by Paul Eggert.
10961
109622003-02-21 Akim Demaille <akim@epita.fr>
10963
10964 * doc/bison.texinfo: Use "location" consistently to refer to @n,
10965 to avoid confusions with lalr1.cc's notion of Position.
10966 Suggested by Paul Eggert.
10967
109682003-02-20 Akim Demaille <akim@epita.fr>
10969
10970 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
10971 before initial_columns.
10972 (location.hh): Use consistent variable names when defining the
10973 operator<<.
10974 Use "last" so that we subtract from Positions, not from unsigned.
10975
109762003-02-20 Akim Demaille <akim@epita.fr>
10977
10978 * data/lalr1.cc (position.hh): New subfile, including the extended
10979 and Doxygen'ed documentation of class Position.
10980 (location.hh): Use it.
10981 Document a` la Doxygen.
10982 With the help of Benoit Perrot.
10983
109842003-02-20 Akim Demaille <akim@epita.fr>
10985
10986 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
10987 AT_YACC_IF.
10988 Redefine AT_YYERROR_SEES_LOC_IF using it.
10989 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
10990 not defined.
10991 Don't use the location in yy::Parser::error_ and
10992 yy::Parser::print_ when not %locations.
10993 Activate more lalr1.cc tests.
10994
109952003-02-19 Akim Demaille <akim@epita.fr>
10996
10997 * data/lalr1.cc: When displaying a line number, be sure to make it
10998 an int.
10999
110002003-02-19 Akim Demaille <akim@epita.fr>
11001
11002 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
11003 Remove, useless.
11004 (YYABORT, YYACCEPT, YYERROR): New.
11005 * tests/calc.at: Renable the lalr1.cc test.
11006
110072003-02-19 Akim Demaille <akim@epita.fr>
11008
11009 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
11010 error recovery, mixing with/without pops and discarding of the
11011 lookahead.
11012 Exercise YYERROR.
11013 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
11014
110152003-02-17 Paul Eggert <eggert@twinsun.com>
11016
11017 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
11018 * tests/testsuite.at (AT_COMPILE): Use them.
11019 This fixes the testsuite problem reported by Robert Lentz in
11020 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
11021
110222003-02-12 Paul Eggert <eggert@twinsun.com>
11023
11024 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
11025 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
11026 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
11027 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
11028 Check for malloc failure, for consistency with yacc.c.
11029 (yytname_size): Remove, for consistency with yacc.c.
11030
11031 The bug still remains in data/lalr1.cc, as I didn't have time
11032 to fix it there.
11033
110342003-02-06 Akim Demaille <akim@epita.fr>
11035
11036 * configure.ac (GXX): Rename as...
11037 (CXX): this, to keep the original Autoconf semantics.
11038 Require 2.57.
11039 * data/lalr1.cc: Fix b4_copyright invocations.
11040 If YYDEBUG is not defined, don't depend upon name_ being defined.
11041 (location.hh): Include string and iostream.
11042 (Position::filename): New member.
11043 (Position::Position ()): New.
11044 (operator<< (Position)): New.
11045 (operator- (Position, int)): New.
11046 (Location::first, Location::last): Rename as...
11047 (Location::begin, Location::end): these, to mock the conventional
11048 iterator names.
11049 (operator<< (Location)): New.
11050 * tests/atlocal.in (CXX): New.
11051 * tests/testsuite.at (AT_COMPILE_CXX): New.
11052 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
11053 locations in a more synthetic way.
11054 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
11055 lalr1.cc is used.
11056 Adjust the C locations to match those from Emacs: first column is
11057 column 0.
11058 Change all the expected results.
11059 Conform to the GCS: simplify the locations when applicable.
11060 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
11061 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
11062 these CPP macros with the m4 macros new defined by...
11063 (AT_CHECK_PUSHDEFS): this, i.e.:
11064 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
11065 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
11066 New macros.
11067 (AT_CHECK_POPDEFS): Undefine them.
11068 (AT_CHECK_CALC_LALR1_CC): New.
11069 Use it for the first lalr1.cc test.
11070
110712003-02-04 Akim Demaille <akim@epita.fr>
11072
11073 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
11074 Location as is defined.
11075
110762003-02-04 Akim Demaille <akim@epita.fr>
11077
11078 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
11079 name_ being defined.
11080
110812003-02-03 Paul Eggert <eggert@twinsun.com>
11082
11083 * src/gram.h (start_symbol): Remove unused decl.
11084
11085 Use more-consistent naming conventions for local vars.
11086
11087 * src/derives.c (derives_compute): Change type of local var from
11088 int to rule_number.
11089 * src/gram.c (grammar_rules_partial_print): Likewise.
11090 * src/print.c (print_core): Likewise.
11091 * src/reduce.c (reduce_grammar_tables): Likewise.
11092
11093 * src/gram.c (grammar_dump): Change name of item_number *
11094 local var from r to rp.
11095 * src/nullable.c (nullable_compute): Likewise.
11096
11097 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
11098
11099 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
11100 for symbol or symbol_number var.
11101 * src/reader.c (grammar_start_symbol_set): Likewise.
11102 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
11103 Likewise.
11104 * src/state.c (transitions_to): Likewise.
11105 * src/state.h: Likewise.
11106 * src/tables.c (symbol_number_to_vector_number): Likewise.
11107
11108 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
11109 char * var.
11110
11111 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
11112 var.
11113
11114 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
11115 var.
11116
11117 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
11118 Use str, not s, for char * var. Use ch, not c, for character var.
11119 Use size for size var.
11120
11121 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
11122 char * var.
11123 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
11124 uniqstr var.
11125 * src/uniqstr.h: Likewise.
11126
11127 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
11128 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
11129 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
11130 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
11131 param to have same name as that of enum, so that we don't use
11132 "s" to stand for a non-state.
11133
111342003-02-02 Akim Demaille <akim@epita.fr>
11135
11136 * src/scan-skel.l: Scan more than one inert character per yylex
11137 invocation.
11138
111392003-02-01 Paul Eggert <eggert@twinsun.com>
11140
11141 Version 1.875a.
11142
11143 * po/LINGUAS: Add ms.
11144
111452003-01-30 Akim Demaille <akim@epita.fr>
11146
11147 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
11148
111492003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11150
11151 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
11152 of $1.
11153
11154 Changes in response to error report by S. Eken: GLR mode does not
11155 handle negative $ indices or $ indices in embedded rules correctly.
11156 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
11157
11158 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
11159 (b4_rhs_location): Ditto.
11160 (yyfill): New function to copy from stack tree into array
11161 incrementally.
11162 (yyuserAction): Modify to allow incremental move of semantic values
11163 to rhs array when in GLR mode.
11164 Define YYFILL to use in user-defined actions to fill semantic array
11165 as needed.
11166 Remove dummy use of yystack, as there is now a guaranteed use.
11167 (yydoAction): Modify to allow incremental move of semantic values
11168 to rhs array when in GLR mode.
11169 (yyresolveAction): Ditto.
11170 (yyglrShiftDefer): Update comment.
11171 (yyresolveStates): Use X == NULL for pointers, not !X.
11172 (yyglrReduce): Ditto.
11173 (yydoAction): Ditto
11174
11175 * tests/glr-regr1.at: Rename to ...
11176 * tests/glr-regression.at: Add new regression test for the problems
11177 described above (adapted from S. Eken).
11178 Update copyright notice.
11179 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
11180 * tests/Makefile.am: Ditto.
11181
111822003-01-28 Paul Eggert <eggert@twinsun.com>
11183
11184 * data/lalr1.cc: Do not use @output_header_name@ unless
11185 b4_defines_flag is set. This fixes two bugs reported by
11186 Tim Van Holder in
11187 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
11188 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
11189
111902003-01-21 Paul Eggert <eggert@twinsun.com>
11191
11192 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
11193 we don't need to worry about yyerrlab1 being reported as an
11194 "unused label" by non-GCC C compilers. The downside is that if
11195 locations are used then a couple of statements are duplicated each
11196 time YYERROR is invoked, but the upside is that the warnings
11197 should vanish.
11198 (yyerrlab1): Move code to YERROR.
11199 (yyerrlab2): Remove. Change uses back to yyerrlab1.
11200 This reverts some of the 2002-12-27 change.
11201
112022003-01-17 Paul Eggert <eggert@twinsun.com>
11203
11204 * src/output.c (symbol_printers_output): Fix typo that led
11205 to core dump. Problem reported by Antonio Rus in
11206 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
11207
112082003-01-13 Akim Demaille <akim@epita.fr>,
11209 Quoc Peyrot <chojin@lrde.epita.fr>,
11210 Robert Anisko <anisko_r@lrde.epita.fr>
11211
11212 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
11213 when the stacks contain one element, as the loop would otherwise
11214 free the last state, and then use the top state (the one we just
11215 popped). This means that the initial elements will not be freed
11216 explicitly, as is the case in yacc.c; it is not a problem, as
11217 these elements have fake values.
11218
112192003-01-11 Paul Eggert <eggert@twinsun.com>
11220
11221 * NEWS: %expect-violations are now just warnings, reverting
11222 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
11223 bootstrapping problem reported by Matthias Klose; see
11224 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
11225 * src/conflicts.c (conflicts_print): Likewise.
11226 * tests/conflicts.at (%expect not enough, %expect too much,
11227 %expect with reduce conflicts): Likewise.
11228 * doc/bison.texinfo (Expect Decl): Document this. Also mention
11229 that the warning is enabled if the number of conflicts changes
11230 (not necessarily increases).
11231
11232 * src/getargs.c (version): Update copyright year.
11233
112342003-01-09 Akim Demaille <akim@epita.fr>
11235
11236 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
11237
112382003-01-08 Paul Eggert <eggert@twinsun.com>
11239
11240 * Makefile.maint (WGETFLAGS):
11241 New macro, containing "-C off" to disable proxy caches.
11242 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
11243 (rel-check): Use $(WGET) instead of wget.
11244
112452003-01-06 Paul Eggert <eggert@twinsun.com>
11246
11247 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
11248 the GLR paper of Scott, Johnstone and Hussain.
11249
112502003-01-04 Paul Eggert <eggert@twinsun.com>
11251
11252 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
11253 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
11254 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
11255 (EXTRA_LIBRARIES): New var, for liby.a.
11256 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
11257 (EXTRA_SCRIPTS): New var, for yacc.
11258
11259 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
11260 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
11261 Problem reported by Nelson H. F. Beebe.
11262
112632003-01-03 Paul Eggert <eggert@twinsun.com>
11264
11265 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
11266 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
11267 when compiling Bison 1.875's `bitset bset = obstack_alloc
11268 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
11269
11270 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
11271 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
11272 grow to a huge size with typical invocation.
11273
11274 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
11275 Use the pattern recommended by Autoconf 2.57, except also protect
11276 against double-definition.
11277 * src/system.h: Likewise.
11278 Portability issues reported by Nelson H. F. Beebe.
11279
11280 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
11281 All uses changed. Provide a definition in both C and C++.
11282 (yytrue, yyfalse): Define even if defined (__cplusplus).
11283
11284 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
11285 Reported by Nelson H. F. Beebe.
11286
11287 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
11288
112892003-01-02 Paul Eggert <eggert@twinsun.com>
11290
11291 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
11292 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
11293 Bug reported by Nelson H. F. Beebe.
11294
112952003-01-01 Paul Eggert <eggert@twinsun.com>
11296
11297 * Version 1.875.
11298
112992002-12-30 Paul Eggert <eggert@twinsun.com>
11300
11301 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
11302 Moved here from...
11303 (<INITIAL>","): Here. This causes stray "," to be treated
11304 more uniformly.
11305
11306 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
11307 last brace in braced code when not in Yacc mode, for compatibility
11308 with Bison 1.35. This resurrects the 2001-12-15 patch to
11309 src/reader.c.
11310
11311 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
11312 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
11313
113142002-12-28 Paul Eggert <eggert@twinsun.com>
11315
11316 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
11317 that of SYM's type. This fixes Debian bug 168069, reported by
11318 Thomas Olsson.
11319
113202002-12-28 Paul Eggert <eggert@twinsun.com>
11321
11322 Version 1.75f.
11323
11324 Switch back to the Yacc style of conflict reports, undoing some
11325 of the 2002-07-30 change.
11326 * doc/bison.texinfo (Understanding): Use Yacc style for
11327 conflict reports. Also, use new way of locating rules.
11328 * src/conflicts.c (conflict_report):
11329 Renamed from conflict_report_yacc, removing the old
11330 'conflict_report'. Translate the entire conflict report at once,
11331 so that we don't assume that "," has the same interpretation in
11332 all languages.
11333 (conflicts_output): Use Yacc-style conflict report for each state,
11334 instead of our more-complicated style.
11335 (conflicts_print): Use Yacc-style conflict report, except print
11336 the input file name when not emulating Yacc.
11337 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
11338 Conflicted Reduction, %expect not enough, %expect too much,
11339 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
11340 * tests/existing.at (GNU Cim Grammar): Likewise.
11341 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
11342
11343 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
11344 fatal): Don't invoke fflush; it's not needed and it might even be
11345 harmful for stdout, as stdout might not be open.
11346 * src/reduce.c (reduce_print): Likewise.
11347
113482002-12-27 Paul Eggert <eggert@twinsun.com>
11349
11350 Fix a bug where error locations were not being recorded correctly.
11351 This problem was originally reported by Paul Hilfinger in
11352 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
11353
11354 * data/yacc.c (yyparse): New local var yylerrsp, to record the
11355 top of the location stack's error locations.
11356 (yyerrlab): Set it. When discarding a token, push its location
11357 onto yylerrsp so that we don't lose track of the error's end.
11358 (yyerrlab1): Now is only the target of YYERROR, so that we can
11359 properly record the location of the action that failed. For GCC
11360 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
11361 GCC warning about yyerrlab1 being unused if YYERROR is unused.
11362 (yyerrlab2): New label, which yyerrlab now falls through to.
11363 Compute the error's location by applying YYLLOC_DEFAULT to
11364 the locations of all the symbols that went into the error.
11365 * doc/bison.texinfo (Location Default Action): Mention that
11366 YYLLOC_DEFAULT is also invoked for syntax errors.
11367 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11368 Error locations include the locations of all the tokens that were
11369 discarded, not just the last token.
11370
113712002-12-26 Paul Eggert <eggert@twinsun.com>
11372
11373 * src/files.c: Include quote.h.
11374 (compute_output_file_names): Warn if we detect conflicting
11375 outputs to the same file. This should catch the misunderstanding
11376 exemplified by Debian Bug 165349, reported by Bruce Stephens..
11377
11378 * src/conflicts.c (conflicts_print): If the user specifies
11379 "%expect N", report an error if there are any reduce/reduce
11380 conflicts. This is what the manual says should happen.
11381 This fixes Debian bug 130890, reported by Anthony DeRobertis.
11382 * tests/conflicts.at (%expect with reduce conflicts): New test.
11383
11384 Don't use m4_include on relative file names, as it doesn't work as
11385 desired if there happens to be a file with that name under ".".
11386
11387 * m4sugar/version.m4: Remove; it was included but it wasn't used.
11388 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
11389 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
11390 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
11391 * src/output.c (output_skeleton): Use full path names when
11392 specifying a file to include; don't rely on include path, as
11393 it's unreliable when the working file contains a file with
11394 that name.
11395
113962002-12-25 Paul Eggert <eggert@twinsun.com>
11397
11398 Remove obsolete references to bison.simple and bison.hairy.
11399 Problem mentioned by Aubin Mahe in
11400 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
11401 * data/glr.c: Comment fix.
11402 * doc/bison.1: Remove references. Also, mention "yacc".
11403
11404 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
11405 with -g option.
11406
11407 * src/parse-gram.y (declaration): Use enum "report_states" rather
11408 than its numeric value 1.
11409
11410 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
11411 opening a new one. This fixes Debian bug 165349, reported by
11412 Bruce Stephens.
11413
114142002-12-24 Paul Eggert <eggert@twinsun.com>
11415
11416 Version 1.75e.
11417
11418 * Makefile.maint (cvs-update): Don't assume that the shell
11419 supports $(...), as Solaris sh doesn't.
11420
11421 * src/parse-gram.y (lloc_default): Remove test for empty
11422 nonterminals at the end, since it didn't change the result.
11423
114242002-12-24 Paul Eggert <eggert@twinsun.com>
11425
11426 If the user does not define YYSTYPE as a macro, Bison now declares it
11427 using typedef instead of defining it as a macro. POSIX requires this.
11428 For consistency, YYLTYPE is also declared instead of defined.
11429
11430 %union directives can now have a tag before the `{', e.g., the
11431 directive `%union foo {...}' now generates the C code
11432 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
11433 The default union tag is `YYSTYPE', for compatibility with Solaris 9
11434 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
11435 instead of `yyltype'.
11436
11437 `yystype' and `yyltype' are now obsolescent macros instead of being
11438 typedefs or tags; they are no longer documented and will be
11439 withdrawn in a future release.
11440
11441 * data/glr.c (b4_location_type): Remove.
11442 (YYSTYPE): Renamed from yystype.
11443 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
11444 (struct YYLTYPE): Renamed from struct yyltype.
11445 (YYLTYPE): Renamed from yyltype.
11446 (yyltype, yystype): New (and obsolescent) macros,
11447 for backward compatibility.
11448 * data/yacc.c: Likewise.
11449
11450 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
11451 does not specify a union tag. This is for compatibility with
11452 Solaris 9 yacc.
11453
11454 * src/parse-gram.y (add_param): 2nd arg is now char * not char
11455 const *, since it is now modified by stripping surrounding { }.
11456 (current_braced_code): Remove.
11457 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
11458 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
11459 trailing " {...}". Now of type <chars>.
11460 (grammar_declaration): Adjust to bundled tokens.
11461 (code_content): Remove; stripping is now done by add_param.
11462 (print_token_value): Print contents of bundled tokens.
11463 (token_name): New function.
11464
11465 * src/reader.h (braced_code, current_braced_code): Remove.
11466 (token_name): New decl.
11467
11468 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
11469 token_type, not braced_code code_kind. All uses changed.
11470 (SC_PRE_CODE): New state, for scanning after a keyword that
11471 has (or usually has) an immediately-following braced code.
11472 (token_type): New local var, to keep track of which token type
11473 to return when scanning braced code.
11474 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
11475 <INITIAL>"%parse-param", <INITIAL>"%printer",
11476 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
11477 instead of returning a token type immediately.
11478 (<INITIAL>"{"): Set token type.
11479 (<SC_BRACED_CODE>"}"): Use it.
11480 (handle_action_dollar, handle_action_at): Now returns bool
11481 indicating success. Fail if ! current_rule; this prevents a core dump.
11482 (handle_symbol_code_dollar, handle_symbol_code_at):
11483 Remove; merge body into caller.
11484 (handle_dollar, handle_at): Complain in invalid contexts.
11485
11486 * NEWS, doc/bison.texinfo: Document the above.
11487 * NEWS: Fix years and program names in copyright notice.
11488
114892002-12-17 Paul Eggert <eggert@twinsun.com>
11490
11491 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
11492 Reporting, Table of Symbols): Omit mentions of %lex-param and
11493 %parse-param from the documentation for now.
11494
114952002-12-15 Paul Eggert <eggert@twinsun.com>
11496
11497 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
11498 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
11499 lookahead symbol, and which sets yychar in parser actions) and it
11500 disagreed with the Bison documentation. Bug
11501 reported by Andrew Walrond.
11502
11503 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
11504 as the caller now does that.
11505 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
11506 (YYEMPTY): Parenthesize right hand side, since others use it.
11507 (yyparse): Don't assume that our generated code is the only code
11508 that sets yychar.
11509
115102002-12-13 Paul Eggert <eggert@twinsun.com>
11511
11512 Version 1.75d.
11513
11514 POSIX requires a "yacc" command.
11515 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
11516 (MOSTLYCLEANFILES): Add yacc.
11517 (yacc): New rule.
11518 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
11519 as an alias for bison y.
11520
11521 * po/LINGUAS: Add da.
11522
11523 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
11524 problem with latest <getopt.h>.
11525 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
11526
11527 * doc/fdl.texi: Upgrade to 1.2.
11528 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
11529 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
11530 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
11531 gnulib.
11532 * config/install-sh: Sync with autotools.
11533
11534 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
11535 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
11536 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
11537 locations are requested.
11538 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
11539 locations are requested.
11540
115412002-12-12 Paul Eggert <eggert@twinsun.com>
11542
11543 Remove unportable casts and storage allocation tricks.
11544 While we're at it, remove almost all casts, since they
11545 usually aren't needed and are a sign of trouble.
11546
11547 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
11548
11549 * src/derives.c (derives_compute): Do not subtract NTOKENS from
11550 the pointer DSET returned by malloc; this isn't portable.
11551 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
11552 Similarly for DERIVES.
11553 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
11554 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
11555 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
11556
11557 * src/derives.c (derives_compute): Do not bother invoking
11558 int_of_rule_number, since rule numbers are integers.
11559
11560 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
11561 rather than XMALLOC (char, N).
11562
11563 * src/files.c (filename_split): Rewrite to avoid cast.
11564
11565 * src/gram.h (symbol_number_as_item_number,
11566 item_number_as_symbol_number, rule_number_as_item_number,
11567 item_number_as_rule_number):
11568 Now inline functions rather than macros, to avoid casts.
11569 * src/state.h (state_number_as_int): Likewise.
11570 * src/tables.c (state_number_to_vector_number,
11571 symbol_number_to_vector_number): Likewise.
11572
11573 * src/gram.h (int_of_rule_number): Remove; no longer used.
11574
11575 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
11576 since the resulting storage is always stored into.
11577
11578 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
11579 where it's needed.
11580
11581 * src/muscle_tab.c (muscle_m4_output):
11582 Now inline. Return bool, not int.
11583 * src/state.c (state_compare): Likewise.
11584 * src/symtab.c (symbol_check_defined,
11585 symbol_check_alias_consistency, symbol_pack, symbol_translation,
11586 hash_compare_symbol, hash_symbol):
11587 Likewise.
11588 * src/uniqstr.c (uniqstr_print): Likewise.
11589 * src/muscle_tab.c (muscle_m4_output_processor):
11590 New function, to avoid casts.
11591 * src/state.c (state_comparator, stage_hasher): Likewise.
11592 * src/symtab.c (symbol_check_defined_processor,
11593 symbol_check_alias_consistency_processor, symbol_pack_processor,
11594 symbol_translation_processor, hash_symbol_comparator,
11595 hash_symbol_hasher): Likewise.
11596 * src/uniqstr.c (uniqstr_print_processor): Likewise.
11597 * src/muscle_tab.c (muscles_m4_output):
11598 Use new functions instead of casting old functions unportably.
11599 * src/state.c (state_hash_new): Likewise.
11600 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
11601 symbols_token_translations_init):
11602 Likewise.
11603 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
11604
11605 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
11606 var instead of casting to long, to avoid casts.
11607 (prepare_states): Use MALLOC rather than alloca, so that we don't
11608 have to worry about alloca.
11609 * src/state.c (state_hash_lookup): Likewise.
11610
11611 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
11612 local var instead of casting to unsigned char, to avoid casts.
11613
11614 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
11615 STATE_ALLOC): Remove.
11616 (transitions_new, errs_new, reductions_new, state_new): Use malloc
11617 rather than calloc, and use offsetof to avoid allocating slightly
11618 too much storage.
11619 (state_new): Initialize all members.
11620
11621 * src/state.c (state_hash): Use unsigned accumulator, not signed.
11622
11623 * src/symtab.c (symbol_free): Remove; unused.
11624 (symbol_get): Remove cast in lhs of assignment.
11625 (symbols_do): Now static. Accept generic arguments, not
11626 hashing-related ones.
11627
11628 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
11629 (symbol_processor): Remove.
11630 (symbols_do): Remove decl; now static.
11631
11632 * src/system.h (alloca): Remove; decl no longer needed.
11633 (<stddef.h>): Include, for offsetof.
11634 (<inttypes.>, <stdint.h>): Include if available.
11635 (uintptr_t): New type, if system lacks it.
11636 (CALLOC, MALLOC, REALLOC): New macros.
11637 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
11638 new macros.
11639
11640 * src/tables.c (table_size): Now int, to pacify GCC.
11641 (table_grow, table_ninf_remap): Use signed table size.
11642 (save_row): Don't bother initializing locals when not needed.
11643 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
11644 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
11645
11646 * src/vcg.h: Correct misspellings.
11647
11648 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
11649
11650
11651 * src/getargs.c (getargs): Don't assume EOF == -1.
11652
116532002-12-09 Paul Eggert <eggert@twinsun.com>
11654
11655 Change identifier spellings to avoid collisions with names
11656 that are reserved by POSIX.
11657
11658 Don't use names ending in _t, since POSIX reserves them.
11659 For consistency, remove _e and _s endings -- they're weren't
11660 needed to remove ambiguity. All uses changed.
11661 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
11662 turn was just renamed from struniq_t.
11663 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
11664 which in turn was just renamed from struniq_processor_t.
11665 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
11666 in turn was renamed from hash_compare_struniq_t.
11667 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
11668 (state_list): Renamed from state_list_t.
11669 * src/assoc.h (assoc): Renamed from assoc_t.
11670 * src/conflicts.c (enum conflict_resolution): Renamed from
11671 enum conflict_resolution_e.
11672 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
11673 (rule_list): Renamed from rule_list_t.
11674 * src/getargs.h (enum trace): Renamed from enum trace_e.
11675 (enum report): Renamed from enum report_e.
11676 * src/gram.h (item_number): Renamed from item_number_t.
11677 (rule_number): Renamed from rule_number_t.
11678 (struct rule_s): Remove the "rule_s" part; not used.
11679 (rule): Renamed from rule_t.
11680 (rule_filter): Renamed from rule_filter_t.
11681 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
11682 (goto_list): Renamed from goto_list_t.
11683 * src/lalr.h (goto_number): Renamed from goto_number_t.
11684 * src/location.h (location): Renamed from location_t.
11685 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
11686 and moved here from:
11687 * src/muscle_tab.h (muscle_entry_t): here.
11688 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
11689 (rule_list): Renamed from rule_list_t.
11690 * src/print_graph.c (static_graph): Renamed from graph.
11691 * src/reader.h (braced_code): Renamed from braced_code_t.
11692 Remove brace_code_e tag.
11693 * src/relation.h (relation_node): Renamed from relation_node_t.
11694 (relation_nodes): Renamed from relation_nodes_t.
11695 (relation): Renamed from relation_t.
11696 * src/state.h (state_number): Renamed from state_number_t.
11697 (struct state): Renamed from struct state_s.
11698 (state): Renamed from state_t.
11699 (transitions): Renamed from transitions_t. Unused (and
11700 misspelled) transtion_s tag removed.
11701 (errs): Renamed from errs_t. Unused errs_s tag removed.
11702 (reductions): Renamed from reductions_t. Unused tag
11703 reductions_s removed.
11704 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
11705 (struct symbol_list): Renamed from struct symbol_list_s.
11706 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
11707 (struct symbol): Renamed from struct symbol_s.
11708 (symbol): Renamed from symbol_t.
11709 * src/tables.c (vector_number): Renamed from vector_number_t.
11710 (action_number): Renamed from action_t.
11711 * src/tables.h (base_number): Renamed from base_t.
11712 * src/vcg.h (enum color): Renamed from enum color_e.
11713 (enum textmode): Renamed from enum textmode_e.
11714 (enum shape): Renamed from enum shape_e.
11715 (struct colorentry): Renamed from struct colorentry_s.
11716 (struct classname): Renamed from struct classname_s.
11717 (struct infoname): Renamed from struct infoname_s.
11718 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
11719 (enum decision): Renamed from enum decision_e.
11720 (enum orientation): Renamed from enum orientation_e.
11721 (enum alignment): Renamed from enum alignment_e.
11722 (enum arrow_mode): Renamed from enum arrow_mode_e.
11723 (enum crossing_type): Renamed from enum crossing_type_e.
11724 (enum view): Renamed from enum view_e.
11725 (struct node): Renamed from struct node_s.
11726 (node): Renamed from node_t.
11727 (enum linestyle): Renamed from enum linestyle_e.
11728 (enum arrowstyle): Renamed from enum arrowstyle_e.
11729 (struct edge): Renamed from struct edge.
11730 (edge): Renamed from edge_t.
11731 (struct graph): Renamed from struct graph_s.
11732 (graph): Renamed from graph_t.
11733 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
11734 Rename value_t -> value.
11735 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
11736 value_t_as_yystype -> value_as_yystype.
11737
11738 Don't include <errno.h> in the mainstream code, since it
11739 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
11740 * lib/get-errno.c, lib/get-errno.h: New files.
11741 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
11742 get-errno.c.
11743 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
11744 * src/output.c (output_skeleton): Likewise.
11745 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
11746 instead of errno.
11747 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
11748 Likewise.
11749 (handle_action_dollar, handle_action_at): Likewise.
11750 * src/system.h: Do not include <errno.h>.
11751 (TAB_EXT): Renamed from EXT_TAB.
11752 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
11753
11754 Avoid str[a-z]*, since <string.h> reserves that name space.
11755 Change all instances of "struniq" in names to "uniqstr", and
11756 likewise for "STRUNIQ" and "UNIQSTR".
11757 * src/uniqstr.c: Renamed from src/struniq.c.
11758 * src/uniqstr.h: Renamed from src/struniq.h.
11759 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
11760 * src/files.c (strsuffix): Remove; unused.
11761 (concat2): Renamed from stringappend. Now static.
11762 * src/files.h (strsuffix, stringappend): Remove; unused.
11763 * src/parse-gram.y (<chars>): Renamed from <string>.
11764 (<uniqstr>): Renamed from <struniq>.
11765 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
11766 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
11767 (struct graph_s.expand): Renamed from struct graph_s.stretch.
11768 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
11769 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
11770 (N_EXPAND): Renamed from N_STRETCH.
11771
11772 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
11773 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
11774 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
11775 Remove; unused.
11776 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
11777 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
11778 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
11779 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
11780 (BASE_MAXIMUM): Renamed from BASE_MAX.
11781 (BASE_MINIMUM): Renamed from BASE_MIN.
11782 (ACTION_MAX): Remove; unused.
11783 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
11784 Unnecessary casts removed from above defines.
11785
11786
11787 Fix misspelling in names.
11788 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
11789 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
11790 G_NODE_ALIGNEMENT.
11791
11792
11793 * lib/timevar.c (timevar_report): Renamed from time_report,
11794 for consistency with other names.
11795 * lib/timevar.h (timevar_report): New decl.
11796 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
11797
11798
11799 Sort include-file uses.
11800
11801 Reorder all include files under src to be in the order "system.h".
11802 then the ../lib include files in angle brackets (alphabetized),
11803 then the . include files in double-quotes (alphabetized). Fix
11804 dependency breakages encountered in this process, as follows:
11805 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
11806 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
11807 * src/state.h: Include "symtab.h".
11808
118092002-12-08 Paul Eggert <eggert@twinsun.com>
11810
11811 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
11812 since this causes problems when __file__ contains character
11813 sequences like "@" that are treated specially by src/scan-skel.l.
11814 Instead, just use the file's basename. This fixes the bug
11815 reported by Martin Mokrejs in
11816 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
11817
118182002-12-06 Paul Eggert <eggert@twinsun.com>
11819
11820 Add support for rules that do not have trailing semicolons, as
11821 POSIX requires. Improve the quality of locations in Bison
11822 diagnostics.
11823
11824 * src/location.c: Include <quotearg.h>.
11825 (empty_location): Now const.
11826 (location_print): New function. Follow the recommendation of the
11827 GNU Coding Standards for locations that span file boundaries.
11828 * src/location.h: Do not include <quotearg.h>; no longer needed.
11829 (boundary): New type.
11830 (location_t): Use it. This allows locations to span file boundaries.
11831 All member uses changed: file -> start.file or end.file (as needed),
11832 first_line -> start.line, first_column -> start.column,
11833 last_line -> end.line, last_column -> end.column.
11834 (equal_boundaries): New function.
11835 (LOCATION_RESET, LOCATION_STEP): Remove.
11836 (LOCATION_PRINT): Remove. All callers changed to use location_print.
11837 (empty_location): Now const.
11838 (location_print): New decl.
11839 * src/parse-gram.y (lloc_default): New function, which handles
11840 empty locations more accurately.
11841 (YYLLOC_DEFAULT): Use it.
11842 (%token COLON): Remove.
11843 (%token ID_COLON): New token.
11844 (rules): Use it.
11845 (declarations, rules): Remove trailing semicolon.
11846 (declaration, rules_or_grammar_declaration):
11847 Allow empty (";") declaration.
11848 (symbol_def): Remove empty actions; no longer needed.
11849 (rules_or_grammar_declaration): Remove trailing semicolon.
11850 (semi_colon.opt): Remove.
11851 * src/reader.h: Include location.h.
11852 (scanner_cursor): New decl.
11853 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
11854 rolling our own.
11855 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
11856 of *loc.
11857 (STEP): Remove. No longer needed, now that adjust_location does
11858 the work. All uses removed.
11859 (scanner_cursor): New var.
11860 (adjust_location): Renamed from extend_location. It now sets
11861 *loc and adjusts the scanner cursor. All uses changed.
11862 Don't bother testing for CR.
11863 (handle_syncline): Remove location arg; now updates scanner cursor.
11864 All callers changed.
11865 (unexpected_end_of_file): Now accepts start boundary of token or
11866 comment, not location. All callers changed. Update scanner cursor,
11867 not the location.
11868 (SC_AFTER_IDENTIFIER): New state.
11869 (context_state): Renamed from c_context. All uses changed.
11870 (id_loc, code_start, token_start): New local vars.
11871 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
11872 processing of Yacc white space and equivalents here.
11873 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
11874 instead of returning ID immediately, since we need to search for
11875 a subsequent colon.
11876 (<INITIAL>"'", "\""): Save token_start.
11877 (<INITIAL>"%{", "{", "%%"): Save code_start.
11878 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
11879 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
11880 BEGIN context_state at end, not INITIAL.
11881 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
11882 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
11883 Return correct token start.
11884 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
11885 the start of a character, string or multiline comment is found.
11886 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
11887 Reduction): Adjust reported locations to match the more-precise
11888 results now expected.
11889 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
11890 * tests/reduce.at (Useless Rules, Reduced Automaton,
11891 Underivable Rules): Likewise.
11892 * tests/regression.at (Invalid inputs): No longer `expecting ";"
11893 or "|"' now that so many other tokens are allowed by the new grammar.
11894
11895 * src/complain.h (current_file): Remove duplicate decl;
11896 current_file is now owned by files.h.
11897 * src/complain.c, src/scan-gram.l: Include files.h.
11898
118992002-12-06 Paul Eggert <eggert@twinsun.com>
11900
11901 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
11902 promotes to int; it might be unsigned int.
11903 * data/yacc.c (yy_reduce_print): Likewise.
11904
11905 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
11906 be #defined in the prologue, not in the Bison declarations.
11907 This fixes Debian Bug 102878, reported by Shaul Karl.
11908
119092002-12-02 Paul Eggert <eggert@twinsun.com>
11910
11911 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
11912 * lib/strtoul.c: New file, from gnulib.
11913 This fixes a porting bug reported by Peter Klein in
11914 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
11915
119162002-11-30 Paul Eggert <eggert@twinsun.com>
11917
11918 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
11919 and put only a forward declaration in the prologue. This is for
11920 consistency with the other scanner helper functions.
11921
11922 Type clashes now generate warnings, not errors, since it
11923 appears that POSIX may allow some grammars with type clashes.
11924 * src/reader.c (grammar_current_rule_check): Warn about
11925 type clashes instead of complaining.
11926 * tests/input.at (Type Clashes): Expect warnings, not complaints.
11927
11928 Add Yacc library, since POSIX requires it.
11929 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
11930 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
11931 * lib/main.c, lib/yyerror.c: New files.
11932
11933 gram_error can be static; it need not be extern.
11934 * src/reader.h (gram_error): Remove decl.
11935 * src/parse-gram.y (gram_error): Now static. Add static decl.
11936 (print_token_value): Omit parameter names from forward decl,
11937 for consistency.
11938
119392002-11-29 Paul Eggert <eggert@twinsun.com>
11940
11941 * doc/bison.texinfo: Emphasize that yylex and yyerror must
11942 be declared before being used. E.g., one should typically
11943 declare them in the prologue. Use GNU coding style in examples.
11944 Put "const" consistently after the type it modifies. Mention
11945 that C99 supports "inline". Mention that yyerror traditionally
11946 returns "int".
11947
11948 %parse-param and %lex-param now take just one argument, the
11949 declaration; the argument name is deduced from the declaration.
11950
11951 * doc/bison.texinfo (Parser Function, Pure Calling, Error
11952 Reporting, Table of Symbols): Document this.
11953 * src/parse-gram.y (add_param): New function.
11954 (COMMA): Remove.
11955 (declaration): Implement new rule for %parse-param and %lex-param.
11956 * src/scan-gram.l: "," now elicits a warning, rather than being
11957 a token; this is more compatible with byacc.
11958 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
11959
119602002-11-27 Paul Eggert <eggert@twinsun.com>
11961
11962 Rename identifiers to avoid real and potential collisions.
11963
11964 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
11965 to avoid collision with lex macro described by Bruce Lilly in
11966 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
11967 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
11968 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
11969 * src/parse-gram.y (print_token_value): Renamed from yyprint.
11970 All uses changed.
11971 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
11972 The name "yycontrol" violates the name space rules, and this stuff
11973 wasn't being used anyway.
11974 (input): Remove action; this stuff wasn't being used.
11975 (gram_error): Rename local variable yylloc -> loc.
11976 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
11977 (YY_DECL): Don't use "yy" at start of local variables.
11978 All uses changed, e.g., yylloc -> loc.
11979 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
11980 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
11981 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
11982 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
11983
11984 * src/parse-gram.y (gram_error): loc is now const *.
11985 * src/reader.h (gram_error): Likewise.
11986
119872002-11-24 Paul Eggert <eggert@twinsun.com>
11988
11989 Version 1.75c.
11990
11991 * tests/actions.at (Actions after errors): Use an output format
11992 more similar to that of the Printers and Destructors test.
11993 Test the position of the ';' token too.
11994 (Printers and Destructors): Likewise.
11995 (Printers and Destructors: %glr-parser): Remove for now, to avoid
11996 unnecessarily alarming people when the test fails.
11997
11998 * data/yacc.c (yyerrlab1): Move this label down, so that the
11999 parser does not discard the lookahead token if the user code
12000 invokes YYERROR. This change is required for POSIX conformance.
12001
12002 * lib/error.c: Sync with gnulib.
12003
120042002-11-22 Paul Eggert <eggert@twinsun.com>
12005
12006 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
12007 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
12008 * lib/xmalloc.c: Likewise.
12009
120102002-11-20 Paul Eggert <eggert@twinsun.com>
12011
12012 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
12013
120142002-11-20 Paul Eggert <eggert@twinsun.com>
12015
12016 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
12017 should use `if (! x) abort ();' rather than `assert (x);', and
12018 anyway it's one less thing to worry about configuring.
12019
12020 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
12021 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
12022 and replace all instances of assert with abort.
12023 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
12024 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
12025
12026 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
12027 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
12028 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
12029 hash_find_entry, hash_rehash, hash_insert): Likewise.
12030 * src/conflicts.c (resolve_sr_conflict): Likewise.
12031 * src/lalr.c (set_goto_map, map_goto): Likewise.
12032 * src/nullable.c (nullable_compute): Likewise.
12033 * src/output.c (prepare_rules, token_definitions_output): Likewise.
12034 * src/reader.c (packgram, reader): Likewise.
12035 * src/state.c (state_new, state_free, state_transitions_set,
12036 state_reduction_find): Likewise.
12037 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
12038 symbol_pack): Likewise.
12039 * src/tables.c (conflict_row, pack_vector): Likewise.
12040 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12041 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12042 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
12043 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
12044
12045 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
12046 (ARGMATCH_CONSTRAINT): New macro.
12047 (ARGMATCH_ASSERT): Use it.
12048
12049 * src/system.h (verify): New macro.
12050 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
12051 rather than assert.
12052 * src/tables.c (tables_generate): Likewise.
12053
12054 * src/struniq.c (struniq_assert): Now returns void, and aborts
12055 if the assertion is false.
12056 (struniq_assert_p): Remove.
12057 * src/struniq.h: Likewise.
12058
120592002-11-18 Paul Eggert <eggert@twinsun.com>
12060
12061 * data/glr.c (yygetLRActions): Replace `yyindex' with
12062 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
12063 This fixes the regression with Sun ONE Studio 7 cc that I reported in
12064 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
12065
120662002-11-18 Akim Demaille <akim@epita.fr>
12067
12068 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
12069 space.
12070 From Tim Van Holder.
12071
120722002-11-17 Paul Eggert <eggert@twinsun.com>
12073
12074 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
12075 to "SyntaxError" for consistency with my 2002-11-15 change.
12076
12077 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
12078 not define to {}, since this breaks the common use of `YYDPRINTF
12079 ((...));' if a single statement is desired (e.g. before `else').
12080 Work around GCC warnings by surrounding corresponding calls with
12081 {} if needed.
12082 (yyhasResolvedValue): Remove unused function.
12083 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
12084 loop body.
12085 (yyreportSyntaxError): Renamed from yyreportParseError.
12086 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
12087 All uses changed.
12088 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
12089 extern when possible. Remove unused initializations.
12090
120912002-11-16 Akim Demaille <akim@epita.fr>
12092
12093 Augment the similarity between GLR and LALR traces.
12094
12095 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
12096 (YY_REDUCE_PRINT): New.
12097 (yyparse): Use them.
12098 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
12099 YYDPRINT here.
12100 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
12101 state reached after the reduction/recovery, since...
12102 (yyparse, yyprocessOneStack): Report the state we are entering in.
12103
121042002-11-16 Akim Demaille <akim@epita.fr>
12105
12106 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
12107 Add support for --trace=skeleton.
12108 * src/scan-skel.l: %option debug.
12109 Scan strings of non-@ or \n instead of character by character.
12110 (scan_skel): Handle trace_skeleton.
12111 (QPUTS): New.
12112 (@output_parser_name@, @output_header_name@): ``Restore'' their
12113 support (used to be M4 macros).
12114 * data/yacc.c: Quote larger chunks, a la glr.c.
12115 * data/lalr1.cc: Likewise.
12116 The header guards are no longer available, so use some other
12117 string than `YYLSP_NEEDED'.
12118
121192002-11-16 Akim Demaille <akim@epita.fr>
12120
12121 Make the ``Printers and Destructors'' test more verbose, taking
12122 `yacc.c''s behavior as (possibly wrong) reference.
12123
12124 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
12125 instead of fprint on stdout.
12126 Set and report the last_line of the symbols.
12127 Consistently display values and locations.
12128
121292002-11-16 Paul Eggert <eggert@twinsun.com>
12130
12131 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
12132
121332002-11-15 Paul Eggert <eggert@twinsun.com>
12134
12135 * tests/actions.at (Actions after errors): New test case.
12136
12137 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
12138 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
12139 tests/action.at, tests/calc.at, tests/conflicts.at,
12140 tests/cxx-type.at, tests/regression.at:
12141 "parse error" -> "syntax error" for POSIX compatibility.
12142 "parsing stack overflow..." -> "parser stack overflow" so
12143 that code matches Bison documentation.
12144
121452002-11-15 Akim Demaille <akim@epita.fr>
12146
12147 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
12148 take two BRACED_CODE, not two string_content.
12149 Free the scanner's obstack when we are done.
12150 (code_content): New.
12151 * tests/calc.at: Adjust.
12152 * doc/bison.texinfo: Adjust.
12153 Also, make sure to include the `,' for these declarations.
12154
121552002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
12156
12157 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
12158 definition; avoids potential autoreconf problems.
12159
121602002-11-15 Akim Demaille <akim@epita.fr>
12161
12162 Always check the value returned by yyparse.
12163
12164 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
12165 returned by yyparse.
12166 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
12167 Adjust calls.
12168 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
12169 returned by yyparse.
12170
121712002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12172
12173 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
12174 on input.at test.
12175
121762002-11-14 Paul Eggert <eggert@twinsun.com>
12177
12178 * src/output.c (output_skeleton): Call xfopen instead of
12179 duplicating xfopen's body.
12180
12181 Fix bugs reported by Nelson H. F. Beebe in
12182 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
12183
12184 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
12185 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
12186 Group compiler. Instead, use "$CC -E bar.c". Include the .h
12187 file twice in the grammar, as an extra check.
12188
12189 * tests/input.at (Torturing the Scanner): Surround the
12190 backslash-newline tests with "#if 0", to make it less likely that
12191 we'll run into compiler bugs. Bring back solitary \ inside
12192 comment, but add a closing comment to work around HP C bug. Don't
12193 test backslash-newline in C character constant.
12194
121952002-11-14 Akim Demaille <akim@epita.fr>
12196
12197 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
12198 status of the compiler.
12199 Calling `exit 1' is no longer needed.
12200 Reported by Nelson H. F. Beebe.
12201
122022002-11-14 Akim Demaille <akim@epita.fr>
12203
12204 * tests/atlocal.in (CPPFLAGS): We have config.h.
12205 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
12206 New.
12207 * tests/actions.at, tests/calc.at, tests/conflicts.at,
12208 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
12209 * tests/regression.at, tests/torture.at: Use them for all the
12210 grammars that are to be compiled.
12211 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
12212 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
12213 * doc/bison.texinfo (GLR Parsers): Document `inline'.
12214
122152002-11-14 Akim Demaille <akim@epita.fr>
12216
12217 * doc/bison.texinfo: Various formatting changes (alignments in
12218 samples, additional @group/@end group, GCS in samples.
12219 Use @deffn instead of simple @table to define the directives,
12220 macros, variables etc.
12221
122222002-11-13 Paul Eggert <eggert@twinsun.com>
12223
12224 Fix some bugs reported by Albert Chin-A-Young in
12225 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
12226
12227 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
12228 -o c"; the HP C compiler chatters during compilation.
12229 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
12230 * tests/headers.at (export YYLTYPE): Likewise.
12231
12232 * tests/input.at (Torturing the Scanner): Remove lines containing
12233 solitary backslashes, as they tickle a bug in the HP C compiler.
12234
12235 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
12236 comments, since they're not portable. Use GNU coding style.
12237
122382002-11-13 Akim Demaille <akim@epita.fr>
12239
12240 * data/yacc.c: Leave bigger chunks of quoted text.
12241 (YYDSYMPRINTF): New.
12242 Use it to report symbol activities.
12243 * data/glr.c (YYDSYMPRINTF): New.
12244 Use it.
12245
122462002-11-12 Paul Eggert <eggert@twinsun.com>
12247
12248 Version 1.75b.
12249
12250 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
12251 (yyglrReduce): Return yyok, not 0.
12252 This should avoid the enumerated-type warnings reported
12253 by Nelson H. F. Beebe in
12254 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
12255
12256 * lib/bbitset.h (BITSET_INLINE): Remove.
12257 * lib/bitset.h [! BITSET_INLINE]: Remove.
12258 (bitset_set, bitset_reset, bitset_test): Rename local vars
12259 to avoid shadowing warnings by GCC.
12260
12261 * data/glr.c (inline): Remove #define. It's the user's
12262 responsibility to #define it away, just like 'const'.
12263 This fixes one of the bugs reported by Nelson H. F. Beebe in
12264 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
12265
12266 * Makefile.maint (po-check): Scan .l and .y files instead of the
12267 .c and the .h files that they generate. This fixes the bug
12268 reported by Tim Van Holder in:
12269 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
12270 Look for N_ as well as for _. Try to avoid matching #define for
12271 N_ and _.
12272 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
12273 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
12274 * src/scan-gram.l: Revamp regular expressions so that " and '
12275 do not confuse xgettext.
12276
12277 * src/struniq.h (struniq_new): Do not declare the return type
12278 to be 'const'; this violates the C standard.
12279 * src/struniq.c (struniq_new): Likewise.
12280
122812002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
12282
12283 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
12284 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
12285 linker.
12286
122872002-11-12 Akim Demaille <akim@epita.fr>
12288
12289 * Makefile.maint: Sync with Autoconf:
12290 (local_updates): New.
12291
122922002-11-12 Akim Demaille <akim@epita.fr>
12293
12294 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
12295
122962002-11-12 Akim Demaille <akim@epita.fr>
12297
12298 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
12299 locations.
12300
123012002-11-12 Akim Demaille <akim@epita.fr>
12302
12303 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
12304 not yyvalue.
12305
123062002-11-12 Akim Demaille <akim@epita.fr>
12307
12308 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
12309 Use it to test the GLR parser.
12310
123112002-11-12 Akim Demaille <akim@epita.fr>
12312
12313 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
12314 defines it.
12315 * data/glr.c (yystos): New.
12316 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
12317 (YYDSYMPRINT): New.
12318 (yyval): Don't define it, it is handled via M4.
12319 (yyrecoverParseError): Free verbosely the discarded symbols.
12320 * data/yacc.c (yysymprint): Remove, rather...
12321 (b4_yysymprint_generate): invoke.
12322 * data/c.m4 (b4_yysymprint_generate): New.
12323 Accept pointers as arguments, as opposed to the version from
12324 yacc.c.
12325 (b4_yydestruct_generate): Likewise.
12326 * tests/cations.at (Printers and Destructors): Use Bison directives
12327 instead of CPP macros.
12328 Don't rely on internal details.
12329
123302002-11-12 Akim Demaille <akim@epita.fr>
12331
12332 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
12333 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
12334 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
12335 it against YYEMPTY and so forth), work on yytoken (i.e., set
12336 it to YYEMPTY etc.).
12337 (yydestruct): Replace with a b4_yydestruct_generate invocation.
12338 (b4_symbol_actions): Remove.
12339 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
12340 for 0, end-of-input.
12341
123422002-11-12 Akim Demaille <akim@epita.fr>
12343
12344 * doc/bison.texinfo (Destructor Decl): New.
12345
123462002-11-12 Akim Demaille <akim@epita.fr>
12347
12348 * src/tables.c (tables_generate): Use free for pointers that
12349 cannot be NULL, not XFREE.
12350 (pack_vector): Use assert, not fatal, for bound violations.
12351 * src/state.c (state_new): Likewise.
12352 * src/reader.c (reader): Likewise.
12353 * src/lalr.c (set_goto_map): Likewise.
12354 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
12355 the file name.
12356
123572002-11-12 Akim Demaille <akim@epita.fr>
12358
12359 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
12360 Restore.
12361 * src/scan-gram.l (last_string): Is global to the file, not to
12362 yylex.
12363 * src/parse-gram.y (input): Don't append the epilogue here,
12364 (epilogue.opt): do it here, and free the scanner's obstack.
12365 * src/reader.c (epilogue_set): Rename as...
12366 (epilogue_augment): this.
12367 * data/c.m4 (b4_epilogue): Defaults to empty.
12368
123692002-11-12 Akim Demaille <akim@epita.fr>
12370
12371 * src/getargs.c (long_options): Remove duplicates.
12372 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
12373 Remove.
12374 * doc/bison.rnh: Remove.
12375 * doc/bison.texinfo (VMS Invocation): Remove.
12376
123772002-11-12 Akim Demaille <akim@epita.fr>
12378
12379 * src/struniq.h, src/struniq.c (struniq_t): Is const.
12380 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
12381
12382 Use struniq for symbols.
12383
12384 * src/symtab.h (symbol_t): The tag member is a struniq.
12385 (symbol_type_set): Adjust.
12386 * src/symtab.c (symbol_new): Takes a struniq.
12387 (symbol_free): Don't free the tag member.
12388 (hash_compare_symbol_t, hash_symbol_t): Rename as...
12389 (hash_compare_symbol, hash_symbol): these.
12390 Use the fact that tags as struniqs.
12391 (symbol_get): Use struniq_new.
12392 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
12393 Returns a strniq.
12394 * src/reader.h (merger_list, grammar_currentmerge_set): The name
12395 and type members are struniqs.
12396 * src/reader.c (get_merge_function)
12397 (grammar_current_rule_merge_set): Adjust.
12398 (TYPE, current_type): Are struniq.
12399
12400 Use struniq for file names.
12401
12402 * src/files.h, src/files.c (infile): Split into...
12403 (grammar_file, current_file): these.
12404 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
12405 * src/reduce.c (reduce_print): Likewise.
12406 * src/getargs.c (getargs): Likewise.
12407 * src/complain.h, src/complain.c: Likewise.
12408 * src/main.c (main): Call struniqs_new early enough to use it for
12409 file names.
12410 Don't free the input file name.
12411
124122002-11-12 Akim Demaille <akim@epita.fr>
12413
12414 * src/symtab.c (symbol_free): Remove dead deactivated code:
12415 type_name are properly removed.
12416 Don't use XFREE to free items that cannot be NULL.
12417 * src/struniq.h, src/struniq.c: New.
12418 * src/main.c (main): Initialize/free struniqs.
12419 * src/parse-gram.y (%union): Add astruniq member.
12420 (yyprint): Adjust.
12421 * src/scan-gram.l (<{tag}>): Return a struniq.
12422 Free the obstack bit that used to store it.
12423 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
12424
124252002-11-11 Paul Eggert <eggert@twinsun.com>
12426
12427 Revamp to fix many (but not all) of the C- and M4-related quoting
12428 problems. Among other things, this fixes the Bison bug reported
12429 by Jan Hubicka when processing the Bash grammar; see:
12430 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
12431
12432 Use new @ escapes consistently. Represent brackets with @{ and @}
12433 rather than @<:@ and @:>@, since this works a bit better with dumb
12434 editors like vi. Represent @ with @@, since @ is now consistently
12435 an escape. Use @oline@ and @ofile@ rather than __oline__ and
12436 __ofile__, to avoid unexpected expansions. Similarly, use @output
12437 rather than #output.
12438
12439 * data/c.m4 (b4_copyright): Omit file name from comment, since
12440 the file name could contain "*/".
12441 (b4_synclines_flag): Don't quote the 2nd argument; it should already
12442 be quoted. All uses changed.
12443
12444 * data/glr.c: Use new @ escapes consistently.
12445 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
12446 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
12447 Remove, since they couldn't handle arbitrary characters in file
12448 names.
12449 * data/lalr1.cc: Likewise.
12450 * data/yacc.c: Likewise.
12451
12452 * src/files.c (output_infix): Remove; all uses removed.
12453 * src/files.h: Likewise.
12454
12455 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
12456 mishandled funny characters in file names, and anyway it isn't
12457 needed any more.
12458 * data/yacc.c: Likewise.
12459 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
12460
12461 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
12462 * data/yacc.c: Likewise.
12463
12464 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
12465 strings now.
12466 (muscle_init): Quote filename as a C string.
12467 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
12468 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
12469 * src/output.c (escaped_file_name_output): New function.
12470 (prepare_symbols): Quote tokens for M4.
12471 (prepare): Don't insert output_infix, output_prefix,
12472 output_parser_name, output_header_name; this is now down by scan-skel.
12473 Insert skeleton as a C string.
12474
12475 * src/output.c (user_actions_output, symbol_destructors_output,
12476 symbol_printers_output): Quote filenames for C and M4.
12477 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12478
12479 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
12480 escapes other than \\ and \'; this simplifies the code.
12481 (<SC_STRING>): Likewise, for \\ and \".
12482 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
12483 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
12484 Use new escapes @{ and @} for [ and ].
12485
12486 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
12487 them with auto vars.
12488 Switch to new escape scheme, where @ is the escape character uniformly.
12489 Abort if a stray escape character is found. Avoid unbounded input
12490 buffer when parsing non-escaped text.
12491
12492 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
12493 __oline__, #output, $@, and @{ do not have unintended meanings.
12494
124952002-11-09 Paul Eggert <eggert@twinsun.com>
12496
12497 Fix the test failure due to GCC warnings described in
12498 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
12499 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
12500 evaluate to 0 if it's impossible for NINF to be in the respective
12501 table.
12502 (yygetLRActions, yyrecoverParseError): Use them.
12503
12504 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
12505 counted in the token inserted at end of file. Now takes
12506 location_t *, not location_t, so that the location can be
12507 adjusted. All uses changed.
12508
12509 * tests/regression.at (Invalid inputs): Adjust wording in
12510 diagnostic to match the new behavior.
12511
12512 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
12513 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
12514 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
12515 abort ();'. This reduces the runtime of the "Many lookaheads"
12516 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
12517 GCC 3.2.
12518
125192002-11-07 Paul Eggert <eggert@twinsun.com>
12520
12521 * src/parse-gram.y (CHARACTER): Remove unused token.
12522 All uses removed.
12523
12524 * src/scan-gram.l: Remove stack option. We no longer use the
12525 stack, since the stack was never deeper than 1; instead, use the
12526 new auto var c_context to record the stacked value.
12527
12528 Remove nounput option. At an unexpected end of file, we now unput
12529 the minimal input necessary to end cleanly; this simplifies the
12530 code.
12531
12532 Avoid unbounded token sizes where this is easy.
12533
12534 (unexpected_end_of_file): New function.
12535 Use it to systematize the error message on unexpected EOF.
12536 (last-string): Now auto, not static.
12537 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
12538 (scanner_last_string_free): Remove; not used.
12539 (percent_percent_count): Move decl to just before use.
12540 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
12541 not the (never otherwised-used) CHARACTER.
12542
125432002-11-07 Akim Demaille <akim@epita.fr>
12544
12545 Let yyerror always receive the msg as last argument, so that
12546 yyerror can be variadic.
12547
12548 * data/yacc.c (b4_yyerror_args): New.
12549 Use it when calling yyerror.
12550 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
12551 Use it when calling yyerror.
12552 * doc/bison.texinfo (Error Reporting): Adjust.
12553 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
12554 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
12555
125562002-11-06 Akim Demaille <akim@epita.fr>
12557
12558 #line should have quoted strings.
12559 Ideally, this should be done by m4_quotearg.
12560
12561 * src/scan-skel.l: Include quotearg.h.
12562 Quote __ofile__.
12563 * src/output.c (symbol_printers_output)
12564 (symbol_destructors_output): Quote the file name.
12565
125662002-11-06 Akim Demaille <akim@epita.fr>
12567
12568 * tests/regression.at (Invalid inputs): Adjust to the recent
12569 messages.
12570
125712002-11-06 Akim Demaille <akim@epita.fr>
12572
12573 Restore --no-lines.
12574 Reported by Jim Kent.
12575
12576 * data/c.m4 (b4_syncline): New.
12577 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
12578 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
12579 * src/output.c (user_actions_output): Likewise.
12580 (prepare): Define 'b4_synclines_flag'.
12581 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
12582
125832002-11-06 Akim Demaille <akim@epita.fr>
12584
12585 * src/main.c (main): Free `infile'.
12586 * src/scan-gram.l (handle_syncline): New.
12587 Recognize `#line'.
12588 * src/output.c (user_actions_output, symbol_destructors_output)
12589 (symbol_printers_output): Use the location's file name, not
12590 infile.
12591 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12592
125932002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12594
12595 * src/tables.c (matching_state): Don't allow states to match if
12596 either has GLR conflict entries.
12597
125982002-11-05 Paul Eggert <eggert@twinsun.com>
12599
12600 * src/scan-gram.l: Use more accurate diagnostics, e.g.
12601 "integer out of range" rather than "invalid value".
12602 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
12603 accordingly.
12604
12605 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
12606 Also, remove one static variable in the scanner.
12607
12608 * src/scan-gram.l (braces_level): Now auto, not static.
12609 Initialize to zero if the compiler is being picky.
12610 (INITIAL): Clear braces_level instead of incrementing it.
12611 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
12612 as POSIX 1003.1-2001 requires.
12613 * src/system.h (IF_LINT): New macro, taken from coreutils.
12614 * configure.ac: Define "lint" if --enable-gcc-warnings.
12615
126162002-11-05 Akim Demaille <akim@epita.fr>
12617
12618 * src/scan-gram.l: When it starts with `%', complain about the
12619 whole directive, not just that `invalid character: %'.
12620
126212002-11-04 Akim Demaille <akim@epita.fr>
12622
12623 * Makefile.maint: Update from Autoconf.
12624 (update, cvs-update, po-update, do-po-update): New.
12625
126262002-11-04 Akim Demaille <akim@epita.fr>
12627
12628 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
12629 and yyerror.
12630 Have yyerror `use' its arguments.
12631 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
12632 returns true when location & yacc & pure & parse-param.
12633 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
12634
126352002-11-04 Akim Demaille <akim@epita.fr>
12636
12637 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
12638 clashes.
12639 * src/scan-gram.l: Use [\'] instead of ['] to pacify
12640 font-lock-mode.
12641 Use complain_at.
12642 Use quote, not quote_n since LOCATION_PRINT no longer uses the
12643 slot 0.
12644
126452002-11-03 Paul Eggert <eggert@twinsun.com>
12646
12647 * src/reader.c (get_merge_function, grammar_current_rule_check):
12648 Use consistent diagnostics for reporting type name clashes.
12649 Quote the types with <>, for consistency with Yacc.
12650 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
12651
126522002-11-03 Akim Demaille <akim@epita.fr>
12653
12654 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
12655 New.
12656 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
12657 (b4_parse_param): Remove.
12658 Use b4_identification.
12659 Propagate b4_pure_args where needed to pass them to yyerror.
12660 * data/glr.m4 (b4_parse_param): Remove.
12661 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
12662 (b4_lpure_formals): New.
12663 Use b4_identification.
12664 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
12665 b4_user_formals and b4_user_args.
12666 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
12667 (yyreportAmbiguity): When using a pure parser, also need
12668 the location, and the parse-params.
12669 Adjust callers.
12670 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
12671 When using a pure parser, also need the parse-params.
12672 Adjust callers.
12673 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
12674 (%pure-parser + %parse-param) LALR and GLR parsers.
12675 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
12676 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
12677 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
12678 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
12679 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
12680 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
12681 * doc/bison.texinfo: Untabify the whole file.
12682 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
12683 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
12684 (Error Reporting): Adjust to these new directives.
12685 Document %error-verbose, deprecate YYERROR_VERBOSE.
12686
126872002-11-03 Akim Demaille <akim@epita.fr>
12688
12689 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
12690 AT_CHECK_CALC_GLR invocations to use % directives, instead of
12691 command line options.
12692 * tests/cxx-type.at: Formatting changes.
12693
126942002-11-03 Paul Eggert <eggert@twinsun.com>
12695
12696 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
12697 to count columns correctly, and to check for invalid inputs.
12698
12699 Use mbsnwidth to count columns correctly. Account for tabs, too.
12700 Include mbswidth.h.
12701 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
12702 (extend_location): New function.
12703 (YY_LINES): Remove.
12704
12705 Handle CRLF in C code rather than in Lex code.
12706 (YY_INPUT): New macro.
12707 (no_cr_read): New function.
12708
12709 Scan UCNs, even though we don't fully handle them yet.
12710 (convert_ucn_to_byte): New function.
12711
12712 Handle backslash-newline correctly in C code.
12713 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
12714 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
12715 all uses changed.
12716 (tag, splice): New EREs. Do not allow NUL or newline in tags.
12717 Use {splice} wherever C allows backslash-newline.
12718 YY_STEP after space, newline, vertical-tab.
12719 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
12720
12721 (letter, id): Don't assume ASCII; e.g., spell out a-z.
12722
12723 ({int}, handle_action_dollar, handle_action_at): Check for integer
12724 overflow.
12725
12726 (YY_STEP): Omit trailing semicolon, so that it's more like C.
12727
12728 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
12729 as well as \000. Check for UCHAR_MAX, not 255.
12730 Allow \x with an arbitrary positive number of digits, as in C.
12731 Check for overflow here.
12732 Allow \? and UCNs, for compatibility with C.
12733
12734 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
12735 with quote slot used by complain_at.
12736
12737 * tests/input.at: Add tests for backslash-newline, m4 quotes
12738 in symbols, long literals, and funny escapes in strings.
12739
12740 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
12741 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
12742 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
12743 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
12744 * m4/mbswidth.m4: New file, from GNU coreutils.
12745
12746 * doc/bison.texinfo (Grammar Outline): Document // comments.
12747 (Symbols): Document that trigraphs have no special meaning in Bison,
12748 nor is backslash-newline allowed.
12749 (Actions): Document that trigraphs have no special meaning.
12750
12751 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
12752 no longer used.
12753
127542002-11-02 Paul Eggert <eggert@twinsun.com>
12755
12756 * src/reader.c: Don't include quote.h; not needed.
12757 (get_merge_function): Reword warning to be consistent with
12758 type clash diagnostic in grammar_current_rule_check.
12759
12760 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
12761 bug in trigraph handling.
12762
12763 * src/output.c (prepare_symbols): When printing token names,
12764 escape "[" as "@<:@" and likewise for "]".
12765
12766 * src/system.h (errno): Remove declaration, as we are now
12767 assuming C89 or better, and C89 guarantees errno.
12768
127692002-10-30 Paul Eggert <eggert@twinsun.com>
12770
12771 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
12772 Check for close failures.
12773 * src/files.h (xfclose): Return void, not int, since it always
12774 returned zero.
12775 * src/files.c (xfclose): Likewise. Report I/O error if ferror
12776 indicates one.
12777 * src/output.c (output_skeleton): Use xfclose rather than fclose
12778 and ferror. xfclose now checks ferror.
12779
12780 * data/glr.c (YYLEFTMOST_STATE): Remove.
12781 (yyreportTree): Use a stack-based leftmost state. This avoids
12782 our continuing battles with bogus warnings about initializers.
12783
127842002-10-30 Akim Demaille <akim@epita.fr>
12785
12786 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
12787 #if.
12788
127892002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12790
12791 * tests/glr-regr1.at: New test for reported regressions.
12792 * tests/testsuite.at: Add glr-regr1.at test.
12793 * tests/Makefile.am: Add glr-regr1.at test.
12794
127952002-10-24 Paul Eggert <eggert@twinsun.com>
12796
12797 Version 1.75a.
12798
12799 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
12800 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
12801 we use malloc. Don't assume 'A' through 'Z' are contiguous.
12802 Don't assume strdup exists; POSIX says its an XSI extension.
12803 Check for buffer overflow on input.
12804
128052002-10-24 Akim Demaille <akim@epita.fr>
12806
12807 * src/output.c (output_skeleton): Don't disable M4sugar comments
12808 too soon: it results in comments being expanded.
12809 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
12810 first output.
12811
128122002-10-24 Akim Demaille <akim@epita.fr>
12813
12814 * data/yacc.c (m4_int_type): New.
12815 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
12816 char' as only yacc.c wants K&R portability.
12817 * data/glr.c (yysigned_char): Remove.
12818 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
12819 Reported by Quoc Peyrot.
12820
128212002-10-23 Paul Eggert <eggert@twinsun.com>
12822
12823 * src/main.c (main): With --trace=time, report times even if a
12824 non-fatal error occurs. Formerly, the times were reported in some
12825 such cases but not in others.
12826 * src/reader.c (reader): Just return if a complaint has been issued,
12827 instead of exiting, so that 'main' can report times.
12828
128292002-10-22 Akim Demaille <akim@epita.fr>
12830
12831 * src/system.h: Include sys/types.
12832 Reported by Bert Deknuydt.
12833
128342002-10-23 Paul Eggert <eggert@twinsun.com>
12835
12836 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
12837 Suggested by Art Haas.
12838
128392002-10-22 Paul Eggert <eggert@twinsun.com>
12840
12841 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
12842 decl; not needed any more.
12843 * src/main.c (main): Use return to exit, undoing yesterday's change.
12844 The last OS that we could find where this wouldn't work is
12845 SunOS 3.5, and that's too old to worry about now.
12846
12847 * data/glr.c (struct yyltype): Define members even when not
12848 doing locations. This is more consistent with yacc.c, and it
12849 works around the following bug reports:
12850 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
12851 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
12852
12853 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
12854 @acronym consistently. Standardize on "Yacc" instead of "YACC",
12855 "Algol" instead of "ALGOL". Give a bit more history about BNF.
12856
128572002-10-22 Akim Demaille <akim@epita.fr>
12858
12859 * data/README: New.
12860
128612002-10-21 Paul Eggert <eggert@twinsun.com>
12862
12863 Be consistent about 'bool'; the old code used an enum in one
12864 module and an int in another, and this violates the C standard.
12865 * m4/stdbool.m4: New file, from coreutils 4.5.3.
12866 * configure.ac (AC_HEADER_STDBOOL): Add.
12867 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
12868 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
12869 * src/symtab.c (hash_compare_symbol_t): Likewise.
12870 * src/system.h (bool, false, true): Use a definition consistent
12871 with ../lib/hash.c. All uses changed.
12872
12873 * src/complain.c (warning_issued): Renamed from warn_message_count,
12874 so that we needn't worry about integer overflow (!).
12875 Now of type bool. All uses changed.
12876 (complaint_issued): Renamed from complain_message_count; likewise.
12877
12878 * src/main.c (main): Use exit to exit with failure.
12879
12880 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
12881 rather than 1 and 0.
12882 * src/main.c (main): Likewise.
12883 * src/getargs.c (getargs): Likewise.
12884 * src/reader.c (reader): Likewise.
12885
12886 * src/getarg.c (getargs): Remove duplicate code for
12887 "Try `bison --help'".
12888
12889 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
12890 What was that "2" for?
12891
12892 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
12893 * src/getargs.c (usage): Likewise.
12894
12895 * src/getargs.c (getargs): When there are too few operands, report
12896 the last one. When there are too many, report the first extra
12897 one. This is how diffutils does it.
12898
128992002-10-20 Paul Eggert <eggert@twinsun.com>
12900
12901 Remove K&R vestiges.
12902 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
12903 * src/complain.c (VA_START): Remove. Assume prototypes.
12904 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
12905 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
12906 fatal): Assume prototypes.
12907 * src/complain.h: Assume prototypes.
12908 * src/system.h (PARAMS): Remove.
12909 Include <limits.h> unconditionally, since it's guaranteeed even
12910 for a freestanding C89 compiler.
12911 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
12912 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
12913
129142002-10-20 Akim Demaille <akim@epita.fr>
12915
12916 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
12917 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
12918 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
12919 (yyresolveStates, yyresolveAction, yyresolveStack)
12920 (yyprocessOneStack): Use them.
12921 (yy_reduce_print): New.
12922 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
12923
129242002-10-20 Akim Demaille <akim@epita.fr>
12925
12926 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
12927 arguments and output `void'.
12928 (b4_c_function): Rename as...
12929 (b4_c_function_def): this.
12930 (b4_c_function_decl, b4_c_ansi_function_def)
12931 (b4_c_ansi_function_decl): New.
12932 Change the interpretation of the arguments: before `int, foo', now
12933 `int foo, foo'.
12934 * data/yacc.c (yyparse): Prototype and define thanks to these.
12935 Adjust b4_c_function_def uses.
12936 * data/glr.c (yyparse): Likewise, but ANSI only.
12937
129382002-10-20 Akim Demaille <akim@epita.fr>
12939
12940 * src/output.c (prepare): Move the definition of `tokens_number',
12941 `nterms_number', `undef_token_number', `user_token_number_max'
12942 to...
12943 (prepare_tokens): Here.
12944 (prepare_tokens): Rename as...
12945 (prepare_symbols): this.
12946 (prepare): Move the definition of `rules_number' to...
12947 (prepare_rules): here.
12948 (prepare): Move the definition of `last', `final_state_number',
12949 `states_number' to...
12950 (prepare_states): here.
12951 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
12952
129532002-10-20 Akim Demaille <akim@epita.fr>
12954
12955 * src/tables.h, src/tables.c, src/output.c: Comment changes.
12956
129572002-10-20 Akim Demaille <akim@epita.fr>
12958
12959 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
12960 * data/c.m4: here.
12961
129622002-10-20 Akim Demaille <akim@epita.fr>
12963
12964 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
12965 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
12966 `pair'.
12967 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
12968 `name' to...
12969 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
12970 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
12971 These.
12972
129732002-10-19 Paul Eggert <eggert@twinsun.com>
12974
12975 Do not create a temporary file, as that involves security and
12976 cleanup headaches. Instead, use a pair of pipes.
12977 Derived from a suggestion by Florian Krohm.
12978 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
12979 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
12980 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
12981 (BISON_PREREQ_SUBPIPE): Add.
12982 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
12983 Add subpipe.h, subpipe.c.
12984 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
12985 * po/POTFILES.in: Add lib/subpipe.c.
12986 * src/output.c: Include "subpipe.h".
12987 (m4_invoke): Remove decl.
12988 (scan_skel): New decl.
12989 (output_skeleton): Use pipe rather than temporary file for m4 input.
12990 Check that m4sugar.m4 is readable, to avoid deadlock.
12991 Check for pipe I/O error.
12992 * src/scan-skel.l (readpipe): Remove decl.
12993 (scan_skel): New function, to be used in place of m4_invoke.
12994 Read from stream rather than file.
12995
12996 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
12997 float, as this generates a warning on Solaris 8 + GCC 3.2 with
12998 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
12999 this generates a more-accurate value anyway.
13000
13001 * lib/timevar.c (timervar_accumulate): Rename locals to
13002 avoid confusion with similarly-named more-global.
13003 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
13004
13005 * src/output.c (prepare): Use xstrdup to convert char const *
13006 to char *, to avoid GCC warning.
13007
130082002-10-19 Akim Demaille <akim@epita.fr>
13009
13010 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
13011 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
13012 Use them to have `calc.y' ready for %pure-parser.
13013 * data/yacc.c (YYLEX): Pass a yylex return type to
13014 b4_c_function_call.
13015
130162002-10-19 Akim Demaille <akim@epita.fr>
13017
13018 Prototype support of %lex-param and %parse-param.
13019
13020 * src/parse-gram.y: Add the definition of the %lex-param and
13021 %parse-param tokens, plus their rules.
13022 Drop the `_' version of %glr-parser.
13023 Add the "," token.
13024 * src/scan-gram.l (INITIAL): Scan them.
13025 * src/muscle_tab.c: Comment changes.
13026 (muscle_insert, muscle_find): Rename `pair' as `probe'.
13027 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
13028 (muscle_entry_s): The `value' member is no longer const.
13029 Adjust all dependencies.
13030 * src/muscle_tab.c (muscle_init): Adjust: use
13031 MUSCLE_INSERT_STRING.
13032 Initialize the obstack earlier.
13033 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
13034 (muscle_pair_list_grow): New.
13035 * data/c.m4 (b4_c_function_call, b4_c_args): New.
13036 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
13037 * tests/calc.at: Use %locations, not --locations.
13038 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
13039
130402002-10-19 Akim Demaille <akim@epita.fr>
13041
13042 * src/getargs.c (usage): Take status as argument and exit
13043 accordingly.
13044 Report the traditional `Try ... --help' message when status != 0.
13045 (usage, version): Don't take a FILE * as arg, it is pointless.
13046 (getargs): When there is an incorrect number of arguments, make it
13047 an error, and report it GNUlically thanks to `usage ()'.
13048
130492002-10-18 Paul Eggert <eggert@twinsun.com>
13050
13051 * data/glr.c (yyreportParseError): Don't assume that sprintf
13052 yields the length of the printed string, as this is not true
13053 on SunOS 4.1.4. Reported by Peter Klein.
13054
13055 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
13056 * tests/conflicts.at (%nonassoc and eof): Likewise.
13057 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
13058
130592002-10-17 Akim Demaille <akim@epita.fr>
13060
13061 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
13062 * src/getargs.c (trace_types, trace_args): Adjust.
13063 * src/reader.c (grammar_current_rule_prec_set)
13064 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
13065 Standardize error messages.
13066 And s/@prec/%prec/!
13067 (reader): Use trace_flag to enable scanner/parser debugging,
13068 instead of an adhoc scheme.
13069 * src/scan-gram.l: Remove trailing debugging code.
13070
130712002-10-16 Paul Eggert <eggert@twinsun.com>
13072
13073 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
13074 MUSCLE_TAB_H.
13075
13076 * NEWS: Officially drop support for building Bison with K&R C,
13077 since it didn't work anyway and it's not worth worrying about.
13078 * Makefile.maint (wget_files): Remove ansi2knr.c.
13079 (ansi2knr.c-url_prefix): Remove.
13080 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
13081 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13082 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13083
130842002-10-15 Paul Eggert <eggert@twinsun.com>
13085
13086 Stop using the "enum_" trick for K&R-style function definitions;
13087 it confused me, and I was the author! Instead, assume that people
13088 who want to use K&R C compilers (when using these modules in GCC,
13089 perhaps?) will run ansi2knr.
13090
13091 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
13092 All uses of "enum_" changed to "enum ".
13093 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13094 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13095
13096 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
13097 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
13098 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
13099 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
13100 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
13101 abitset_not, abitset_ones, abitset_or, abitset_or_and,
13102 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
13103 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
13104 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
13105 Use function prototypes; this removes the need for declaring
13106 static functions simply to provide their prototypes.
13107 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
13108 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
13109 bitset_count_, bitset_create, bitset_dump, bitset_first,
13110 bitset_free, bitset_init, bitset_last, bitset_next,
13111 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
13112 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
13113 bitset_print, bitset_release_memory, bitset_toggle_,
13114 bitset_type_choose, bitset_type_get, bitset_type_name_get,
13115 debug_bitset): Likewise.
13116 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
13117 * lib/bitset_stats.c (bitset_log_histogram_print,
13118 bitset_percent_histogram_print, bitset_stats_and,
13119 bitset_stats_and_cmp, bitset_stats_and_or,
13120 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
13121 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
13122 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
13123 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
13124 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
13125 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
13126 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
13127 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
13128 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
13129 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
13130 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
13131 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
13132 bitset_stats_zero): Likewise.
13133 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13134 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13135 bitsetv_dump, debug_bitsetv): Likewise.
13136 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
13137 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
13138 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
13139 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
13140 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
13141 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
13142 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
13143 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
13144 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
13145 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
13146 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
13147 Likewise.
13148 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
13149 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
13150 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
13151 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
13152 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
13153 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
13154 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
13155 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
13156 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
13157 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
13158 lbitset_xor_cmp, lbitset_zero): Likewise.
13159
131602002-10-14 Akim Demaille <akim@epita.fr>
13161
13162 Version 1.75.
13163
131642002-10-14 Akim Demaille <akim@epita.fr>
13165
13166 * tests/Makefile.am (maintainer-check-posix): New.
13167
131682002-10-14 Akim Demaille <akim@epita.fr>
13169
13170 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
13171 member.
13172
131732002-10-14 Akim Demaille <akim@epita.fr>
13174
13175 * src/tables.c (table_ninf_remap): base -> tab.
13176 Reported by Matt Rosing.
13177
131782002-10-14 Paul Eggert <eggert@twinsun.com>
13179
13180 * tests/action.at, tests/calc.at, tests/conflicts.at,
13181 tests/cxx-type.at, tests/headers.at, tests/input.at,
13182 tests/regression.at, tests/synclines.at, tests/torture.at:
13183 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
13184 so that the tests still work even if POSIXLY_CORRECT is set.
13185 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
13186
13187 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
13188 for portability to K&R hosts. Fix typo: signed char is guaranteed
13189 only to 127, not to 128.
13190 * data/glr.c (yysigned_char): New type.
13191 * data/yacc.c (yysigned_char): Likewise.
13192 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
13193
131942002-10-13 Paul Eggert <eggert@twinsun.com>
13195
13196 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
13197 true due to limited range of data type" warning from GCC.
13198
13199 * data/c.m4 (b4_token_defines): Protect against double-inclusion
13200 by wrapping enum yytokentype's definition inside #ifndef
13201 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
13202
132032002-10-13 Akim Demaille <akim@epita.fr>
13204
13205 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
13206 Un yy- yyrhs to avoid the name clash with the global YYRHS.
13207
132082002-10-13 Akim Demaille <akim@epita.fr>
13209
13210 * Makefile.maint: Update from Autoconf 2.54.
13211 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
13212
132132002-10-13 Akim Demaille <akim@epita.fr>
13214
13215 * src/print.c (print_state): Separate the list of solved conflicts
13216 from the other items.
13217 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
13218
132192002-10-13 Akim Demaille <akim@epita.fr>
13220
13221 Let nondeterministic skeletons be usable with deterministic
13222 tables.
13223
13224 With the patch, GAWK compiled by GCC without -O2 passes its test
13225 suite using a GLR parser driven by LALR tables. It fails with -O2
13226 because `struct stat' gives two different answers on my machine:
13227 88 (definition of an auto var) and later 96 (memset on this var).
13228 Hence the stack is badly corrumpted. The headers inclusion is to
13229 blame: if I move the awk.h inclusion before GLR's system header
13230 inclusion, the two struct stat have the same size.
13231
13232 * src/tables.c (pack_table): Always create conflict_table.
13233 (token_actions): Always create conflict_list.
13234 * data/glr.c (YYFLAG): Remove, unused.
13235
132362002-10-13 Akim Demaille <akim@epita.fr>
13237
13238 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
13239 (O0FLAGS): New.
13240 (VALGRIND, GXX): New.
13241 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
13242 * tests/bison.in: Run $PREBISON a pre-command.
13243 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
13244 (maintainer-check-g++): New.
13245 * Makefile.am (maintainer-check): New.
13246
132472002-10-13 Akim Demaille <akim@epita.fr>
13248
13249 * data/glr.c: Formatting changes.
13250 Tweak some trace messages to match yacc.c's.
13251
132522002-10-13 Akim Demaille <akim@epita.fr>
13253
13254 GLR parsers sometimes raise parse errors instead of performing the
13255 default reduction.
13256 Reported by Charles-Henry de Boysson.
13257
13258 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
13259 check the length of the traces when %glr.
13260 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
13261 GLR's traces.
13262 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
13263 Test GLR parsers.
13264 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
13265 (yyltype): Remove the yy prefix from the member names.
13266 (yytable): Complete its comment.
13267 (yygetLRActions): Map error action number from YYTABLE from
13268 YYTABLE_NINF to 0.
13269 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
13270 (which was a bug: it should have been YYTABEL_NINF, and yet it was
13271 not satisfying as we could compare an YYACTION computed from
13272 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
13273 only value for error actions.
13274 (yyreportParseError): In verbose parse error messages, don't issue
13275 `error' in the list of expected tokens.
13276 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
13277 next action to perform to match glr.c's decoding.
13278 (yytable): Complete its comment.
13279
132802002-10-13 Paul Eggert <eggert@twinsun.com>
13281
13282 Fix problem reported by Henrik Grubbstroem in
13283 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
13284 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
13285 because the Bison parser reads the second action before reducing
13286 the first one.
13287 * src/scan-gram.l (rule_length): New static var.
13288 Use it to keep track of the rule length in the scanner, since
13289 we can't expect the parser to be in lock-step sync with the scanner.
13290 (handle_action_dollar, handle_action_at): Use this var.
13291 * tests/actions.at (Exotic Dollars): Test for the problem.
13292
132932002-10-12 Paul Eggert <eggert@twinsun.com>
13294
13295 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
13296 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
13297 Include <sys/time.h> when checking for clock_t and struct tms.
13298 Use same include order as source.
13299 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
13300 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
13301
13302 * lib/timevar.c: Update copyright date and clarify comments.
13303 (get_time) [IN_GCC]: Keep the GCC version for reference.
13304
13305 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
13306 GCC version as of today, then merge Bison's changes.
13307 Change "GCC" to "Bison" in copyright notice. timevar.def's
13308 author is Akim, so change that too.
13309
13310 * src/reader.c (grammar_current_rule_check):
13311 Don't worry about the default action if $$ is untyped.
13312 Prevents bogus warnings reported by Jim Gifford in
13313 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
13314
13315 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
13316 * data/glr.c, data/lalr1.cc, data/yacc.c:
13317 Output token definitions before the first part of user declarations.
13318 Fixes compatibility problem reported by Jim Gifford for kbd in
13319 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
13320
133212002-10-11 Paul Eggert <eggert@twinsun.com>
13322
13323 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
13324 (yyparse): here. This undoes some of the 2002-07-25 change.
13325 Compatibility problem reported by Ralf S. Engelschall with
13326 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
13327
133282002-10-11 Akim Demaille <akim@epita.fr>
13329
13330 * tests/regression.at Characters Escapes): New.
13331 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
13332 characters.
13333 Reported by Jan Nieuwenhuizen.
13334
133352002-10-11 Akim Demaille <akim@epita.fr>
13336
13337 * po/id.po: New.
13338
133392002-10-10 Paul Eggert <eggert@twinsun.com>
13340
13341 Portability fixes for bitsets; this also avoids several GCC
13342 warnings.
13343
13344 * lib/abitset.c: Include <stddef.h>, for offsetof.
13345 * lib/lbitset.c: Likewise.
13346
13347 * lib/abitset.c (abitset_bytes): Return a size that is aligned
13348 properly for vectors of objects. Do not assume that adding a
13349 header size to a multiple of a word size yields a value that is
13350 properly aligned for the whole union.
13351 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13352
13353 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
13354 unique names for structures.
13355 * lib/ebitset.c (ebitset_bytes): Likewise.
13356 * lib/lbitset.c (lbitset_bytes): Likewise.
13357
13358 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
13359 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
13360 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
13361 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
13362 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
13363 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
13364 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
13365 to improve the type-checking that GCC can do.
13366 * lib/bitset.c (bitset_op4_cmp): Likewise.
13367 * lib/bitset_stats.c (bitset_stats_count,
13368 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
13369 bitset_stats_copy, bitset_stats_disjoint_p,
13370 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
13371 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
13372 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
13373 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
13374 bitset_stats_and_or_cmp, bitset_stats_andn_or,
13375 bitset_stats_andn_or_cmp, bitset_stats_or_and,
13376 bitset_stats_or_and_cmp): Likewise.
13377 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
13378 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
13379 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
13380 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
13381
13382 * lib/abitset.h: Include bitset.h, not bbitset.h.
13383 * lib/ebitset.h: Likewise.
13384 * lib/lbitset.h: Likewise.
13385
13386 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
13387 All instances of parameters of type enum bitset_opts are now of
13388 type enum_bitset_opts, to conform to the C Standard, and similarly
13389 for enum_bitset_type.
13390 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13391 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13392
13393 Do not use "struct bitset_struct" to mean different things in
13394 different modules. Not only is this confusing, it violates
13395 the C Standard, which requires that structure types in different
13396 modules must be compatible if one is to be passed to the other.
13397 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
13398 All instances of "struct bitset_struct *" replaced with "bitset".
13399 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
13400 (union bitset_union, struct abitset_struct, struct ebitset_struct,
13401 struct lbitset_struct, struct bitset_stats_struct): New types.
13402 All uses of struct bitset_struct changed to union bitset_union,
13403 etc.
13404 * lib/abitset.c (struct abitset_struct, abitset,
13405 struct bitset_struct): Remove.
13406 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
13407 struct bitset_struct): Remove.
13408 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
13409 bitset_struct): Remove.
13410 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
13411 Likewise.
13412
13413 Do not call a function of type T using a call that assumes the
13414 function is of a different type U. Standard C requires that a
13415 function must be called with a type that is compatible with its
13416 definition.
13417 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13418 New decls.
13419 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13420 New functions.
13421 * lib/ebitset.c (PFV): Remove.
13422 * lib/lbitset.c (PFV): Likewise.
13423 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
13424 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
13425 decls.
13426 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
13427 (ebitset_vtable): Use them.
13428 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
13429 lbitset_xor): New functions.
13430 (lbitset_vtable): Use them.
13431
13432 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
13433 Declare.
13434
13435 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
13436 GCC warning.
13437 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
13438 Use offsetof, for simplicity.
13439
134402002-10-06 Paul Eggert <eggert@twinsun.com>
13441
13442 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
13443 the same width as int. This reapplies a hunk of the 2002-08-12 patch
13444 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
13445 which was inadvertently undone by the 2002-09-30 patch.
13446 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
13447 the same width as int.
13448
134492002-10-04 Paul Eggert <eggert@twinsun.com>
13450
13451 Version 1.50.
13452
13453 * configure.ac (AC_INIT), NEWS: Increment version number.
13454
13455 * doc/bison.texinfo: Minor spelling, grammar, and white space
13456 fixes.
13457 (Symbols): Mention that any negative value returned from yylex
13458 signifies end-of-input. Warn about negative chars. Mention
13459 the portable Standard C character set.
13460
13461 The GNU coding standard says CFLAGS and YFLAGS are reserved
13462 for the installer to set.
13463 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
13464 * src/Makefile.am (AM_CFLAGS): Likewise.
13465 (AM_YFLAGS): Renamed from YFLAGS.
13466
13467 Fix some MAX and MIN problems.
13468 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
13469 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
13470 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
13471 * src/reader.c (reader): Use it.
13472
13473 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
13474 POSIX 1003.1-2001 has removed fgrep.
13475
134762002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
13477
13478 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
13479 interpreted as signed.
13480 * lib/ebitset.c (ebitset_list): Fix bug.
13481
134822002-10-01 Paul Eggert <eggert@twinsun.com>
13483
13484 More fixes for 64-bit hosts and large bitsets.
13485
13486 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
13487 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
13488 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
13489 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
13490 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
13491 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
13492 bitset_count_): Likewise.
13493 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
13494 bitset_first, bitset_last): Likewise.
13495 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
13496 bitset_stats_list_reverse, bitset_stats_size,
13497 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
13498 Likewise.
13499 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13500 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13501 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13502 bitsetv_reflexive_transitive_closure): Likewise.
13503 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
13504 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
13505 Likewise.
13506 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
13507 Likewise.
13508
13509 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
13510 Use size_t, not unsigned int, to count bytes.
13511 * lib/abitset.h (abitset_bytes): Likewise.
13512 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
13513 Likewise.
13514 * lib/bitset.h (bitset_bytes): Likewise.
13515 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
13516 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
13517 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13518 * lib/ebitset.c (ebitset_bytes): Likewise.
13519 * lib/ebitset.h (ebitset_bytes): Likewise.
13520 * lib/lbitset.c (lbitset_bytes): Likewise.
13521 * lib/lbitset.h (lbitset_bytes): Likewise.
13522
13523 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
13524 abitset_subset_p, abitset_disjoint_p, abitset_and,
13525 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
13526 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
13527 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
13528 abitset_or_and, abitset_or_and_cmp):
13529 Use bitset_windex instead of unsigned int.
13530 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13531 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
13532 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
13533 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
13534 Likewise.
13535 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
13536
13537 * lib/bitset.c (bitset_print):
13538 Use proper printf formats for widths of integer types.
13539 * lib/bitset_stats.c (bitset_percent_histogram_print,
13540 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
13541 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13542 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13543 * lib/lbitset.c (lbitset_bytes): Likewise.
13544
13545 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
13546 BITSET_SIZE_MAX): New macros.
13547 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
13548 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
13549 to BITSET_WINDEX_MAX.
13550
13551 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
13552 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
13553 since we now return the bitset_bindex type (not int).
13554
13555 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
13556 when computing sizes.
13557 * lib/ebitset.c (ebitset_elts_grow): Likewise.
13558
13559 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
13560 and avoid cast to unsigned.
13561
135622002-09-30 Akim Demaille <akim@epita.fr>
13563
13564 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
13565 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
13566 Updates from Michael Hayes.
13567
135682002-09-30 Art Haas <ahaas@neosoft.com>
13569
13570 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
13571 invocations.
13572 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
13573 defined.
13574
135752002-09-27 Akim Demaille <akim@epita.fr>
13576
13577 Version 1.49c.
13578
135792002-09-27 Akim Demaille <akim@epita.fr>
13580
13581 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
13582 (Because of AC_LIBSOURCE).
13583
135842002-09-27 Akim Demaille <akim@epita.fr>
13585
13586 Playing with Autoscan.
13587
13588 * configure.ac: Remove the old LIBOBJ tweaks.
13589 (AC_REPLACE_FUNCS): Add strrchr and strtol.
13590 * lib/strrchr.c: New.
13591 * lib/strtol.c: New, from the Coreutils 4.5.1.
13592
135932002-09-27 Akim Demaille <akim@epita.fr>
13594
13595 Playing with Autoscan.
13596
13597 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
13598 * lib/Makefile.am (libbison_a_SOURCES): No longer include
13599 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
13600 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
13601 Coreutils 4.5.1.
13602
136032002-09-24 Akim Demaille <akim@epita.fr>
13604
13605 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
13606 (Frequently Asked Questions, Parser Stack Overflow): New.
13607
136082002-09-13 Akim Demaille <akim@epita.fr>
13609
13610 Playing with autoscan.
13611
13612 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
13613 * src/files.c (skeleton_find): Remove, unused.
13614 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
13615 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
13616
136172002-09-13 Akim Demaille <akim@epita.fr>
13618
13619 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
13620 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
13621
136222002-09-13 Akim Demaille <akim@epita.fr>
13623
13624 * configure.ac: Require 2.54.
13625 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
13626 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
13627 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
13628 Remove, provided by Autoconf macros.
13629
136302002-09-12 Akim Demaille <akim@epita.fr>
13631
13632 * m4/prereq.m4: Update, from Coreutils 4.5.1.
13633
136342002-09-12 Akim Demaille <akim@epita.fr>
13635
13636 * m4/prereq.m4: Update, from Fileutils 4.1.5.
13637 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
13638 Reported by Martin Mokrejs.
13639
136402002-09-10 Akim Demaille <akim@epita.fr>
13641
13642 * src/parse-gram.y: Associate a human readable string to each
13643 token type.
13644 * tests/regression.at (Invalid inputs): Adjust.
13645
136462002-09-10 Gary V. Vaughan <gary@gnu.org>
13647
13648 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
13649 with an Autoconf-2.5x style configure.ac.
13650
136512002-09-06 Paul Eggert <eggert@twinsun.com>
13652
13653 * doc/bison.texinfo (Conditions): Make explicit that the GPL
13654 exception applies only to yacc.c. This is a modification of a
13655 patch originally suggested by Akim Demaille.
13656
136572002-09-06 Akim Demaille <akim@epita.fr>
13658
13659 * data/c.m4 (b4_copyright): Move the GPL exception comment from
13660 here to...
13661 * data/yacc.c: here.
13662
13663 * data/lalr1.cc (struct yyltype): Don't define it, since we use
13664 LocationType.
13665 (b4_ltype): Default to yy::Location from location.hh.
13666
136672002-09-04 Jim Meyering <jim@meyering.net>
13668
13669 * data/yacc.c: Guard the declaration of yytoknum also with
13670 `#ifdef YYPRINT', so it is declared only when used.
13671
136722002-09-04 Akim Demaille <akim@epita.fr>
13673
13674 * configure.in: Rename as...
13675 * configure.ac: this.
13676 Bump to 1.49c.
13677
136782002-09-04 Akim Demaille <akim@epita.fr>
13679
13680 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
13681 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
13682 translate maintainer only messages.
13683
136842002-08-12 Paul Eggert <eggert@twinsun.com>
13685
13686 Version 1.49b.
13687
13688 * Makefile.am (SUBDIRS): Remove intl.
13689 (DISTCLEANFILES): Remove.
13690 * NEWS: Mention that GNU M4 is now required. Clarify what is
13691 meant by "larger grammars". Mention the pt_BR translation.
13692 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
13693 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
13694 Bump version from 0.11.2 to 0.11.5.
13695 (BISON_PREREQ_STAGE): Remove.
13696 (AM_GNU_GETTEXT): Use external gettext.
13697 (AC_OUTPUT): Remove intl/Makefile.
13698
13699 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
13700
13701 * data/glr.c: Include string.h, for strlen.
13702 (yyreportParseError): Use size_t for yysize.
13703 (yy_yypstack): No longer nested inside yypstates, as nested
13704 functions are not portable. Do not assume size_t is the
13705 same width as int.
13706 (yypstates): Do not assume that ptrdiff_t is the same width
13707 as int, and similarly for yyposn and YYINDEX.
13708
13709 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
13710
13711 * lib/Makefile.am (INCLUDES): Do not include from the intl
13712 directory, which has been removed.
13713 * src/Makefile.am (INCLUDES): Likewise.
13714
13715 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
13716 (bitsets_sources, additional_bitsets_sources, timevars_sources):
13717 New vars.
13718
13719 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
13720 * tests/Makefile.am (EXTRA_DIST): Likewise.
13721
13722 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
13723 Do not assume that bitset_windex is the same width as unsigned.
13724
13725 * lib/abitset.c (abitset_unused_clear): Do not assume that
13726 bitset_word is the same width as int.
13727 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
13728 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
13729 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
13730 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
13731 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
13732
13733 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
13734 portability to one's complement hosts!).
13735 * lib/ebitset.c (ebitset_op1): Likewise.
13736 * lib/lbitset.c (lbitset_op1): Likewise.
13737
13738 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
13739 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
13740 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
13741 Sync with fileutils.
13742 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
13743 lib/gettext.h: Sync with diffutils.
13744
13745 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
13746 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
13747
13748 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
13749 PROTOTYPES to check for prototypes, and "defined __STDC__" to
13750 check for void *.
13751
13752 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
13753 size_t; the old version tried to do this but casted improperly.
13754 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
13755 (bitset_test): Now returns int, not unsigned long.
13756
13757 * lib/bitset_stats.c: Include "gettext.h".
13758 (_): New macro.
13759 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
13760 name locals "index", as it generates unnecessary warnings on some
13761 hosts that have an "index" function.
13762
13763 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
13764 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
13765 they need translation.
13766 * src/LR0.c (state_list_append, new_itemsets, get_state,
13767 append_states, generate_states): Likewise.
13768 * src/assoc.c (assoc_to_string): Likewise.
13769 * src/closure.c (print_closure, set_firsts, closure): Likewise.
13770 * src/gram.c (grammar_dump): Likewise.
13771 * src/injections.c (injections_compute): Likewise.
13772 * src/lalr.c (lookaheads_print): Likewise.
13773 * src/relation.c (relation_transpose): Likewise.
13774 * src/scan-gram.l: Likewise.
13775 * src/tables.c (table_grow, pack_vector): Likewise.
13776
13777 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
13778 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
13779 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
13780 * m4/mbstate_t.m4: Sync with fileutils.
13781 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
13782
13783 * po/LINGUAS: Add pt_BR.
13784 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
13785 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
13786 lib/timevar.c.
13787 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
13788 manual recommends.
13789 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
13790
13791 * src/complain.c (strerror_r): Remove decl; not needed.
13792 (strerror): Use same pattern as ../lib/error.c.
13793
13794 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
13795
13796 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
13797
13798 * src/main.c (main): Cast result of bindtextdomain and textdomain
13799 to void, to avoid a GCC warning when --disable-nls is in effect.
13800
13801 * src/scan-gram.l: Use strings rather than escapes when possible,
13802 to minimize the number of warnings from xgettext.
13803 (handle_action_dollar, handle_action_at): Don't use isdigit,
13804 as it mishandles negative chars and it may not work as expected
13805 outside the C locale.
13806
13807 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
13808 this is a GCC extension and is not portable to other compilers.
13809
13810 * src/system.h (alloca): Use same pattern as ../lib/error.c.
13811 Do not include <ctype.h>; no longer needed.
13812 Do not include <malloc.h>; no longer needed (and generates
13813 warnings on OpenBSD 3.0).
13814
13815 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
13816 it's not portable.
13817
13818 * tests/regression.at: Do not use 'cc -c input.c -o input';
13819 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
13820
13821 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
13822 exit status as failure, not just exit status 1. Sun C exits
13823 with status 2 sometimes.
13824
13825 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
13826 Use it for the two large tests.
13827
138282002-08-02 Akim Demaille <akim@epita.fr>
13829
13830 * src/conflicts.c (conflicts_output): Don't output rules never
13831 reduced here, since anyway that computation doesn't work.
13832 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
13833 (rule_useless_p, rule_never_reduced_p): New.
13834 (grammar_rules_partial_print): Use a filter instead of a range.
13835 Display the title only if needed.
13836 (grammar_rules_print): Adjust.
13837 (grammar_rules_never_reduced_report): New.
13838 * src/tables.c (action_row): Move the computation of rules never
13839 reduced to...
13840 (token_actions): here.
13841 * src/main.c (main): Make the parser before making the report, so
13842 that rules never reduced are computed.
13843 Call grammar_rules_never_reduced_report.
13844 * src/print.c (print_results): Report rules never reduced.
13845 * tests/conflicts.at, tests/reduce.at: Adjust.
13846
138472002-08-01 Akim Demaille <akim@epita.fr>
13848
13849 Instead of attaching lookaheads and duplicating the rules being
13850 reduced by a state, attach the lookaheads to the reductions.
13851
13852 * src/state.h (state_t): Remove the `lookaheads',
13853 `lookaheads_rule' member.
13854 (reductions_t): Add a `lookaheads' member.
13855 Use a regular array for the `rules'.
13856 * src/state.c (reductions_new): Initialize the lookaheads member
13857 to 0.
13858 (state_rule_lookaheads_print): Adjust.
13859 * src/state.h, src/state.c (state_reductions_find): New.
13860 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
13861 (count_rr_conflicts): Adjust.
13862 * src/lalr.c (LArule): Remove.
13863 (add_lookback_edge): Adjust.
13864 (state_lookaheads_count): New.
13865 (states_lookaheads_initialize): Merge into...
13866 (initialize_LA): this.
13867 (lalr_free): Adjust.
13868 * src/main.c (main): Don't free nullable and derives too early: it
13869 is used by --verbose.
13870 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
13871
138722002-08-01 Akim Demaille <akim@epita.fr>
13873
13874 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
13875 `rule_number_t**'.
13876 (set_derives, free_derives): Rename as...
13877 (derives_compute, derives_free): this.
13878 Adjust all dependencies.
13879 * src/nullable.c (set_nullable, free_nullable): Rename as...
13880 (nullable_compute, nullable_free): these.
13881 (rule_list_t): Store rule_t *, not rule_number_t.
13882 * src/state.c (state_rule_lookaheads_print): Directly compare rule
13883 pointers, instead of their numbers.
13884 * src/main.c (main): Call nullable_free, and derives_free earlier,
13885 as they were lo longer used.
13886
138872002-08-01 Akim Demaille <akim@epita.fr>
13888
13889 * lib/timevar.c (get_time): Include children time.
13890 * src/lalr.h (LA, LArule): Don't export them: used with the
13891 state_t.
13892 * src/lalr.c (LA, LArule): Static.
13893 * src/lalr.h, src/lalr.c (lalr_free): New.
13894 * src/main.c (main): Call it.
13895 * src/tables.c (pack_vector): Check whether loc is >= to the
13896 table_size, not >.
13897 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
13898 (tables_generate): do it, since that's also it which allocates
13899 them.
13900 Don't free LA and LArule, main does.
13901
139022002-07-31 Akim Demaille <akim@epita.fr>
13903
13904 Separate parser tables computation and output.
13905
13906 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
13907 (conflict_list, conflict_list_cnt, table, check, table_ninf)
13908 (yydefgoto, yydefact, high): Move to...
13909 * src/tables.h, src/tables.c: here.
13910 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
13911 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
13912 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
13913 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
13914 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
13915 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
13916 (action_row, save_row, token_actions, save_column, default_goto)
13917 (goto_actions, sort_actions, matching_state, pack_vector)
13918 (table_ninf_remap, pack_table, prepare_actions): Move to...
13919 * src/tables.c: here.
13920 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
13921 * src/output.c (token_actions, output_base, output_conflicts)
13922 (output_check): Merge into...
13923 (prepare_actions): this.
13924 (actions_output): Rename as...
13925 (user_actions_output): this.
13926 * src/main.c (main): Call tables_generate and tables_free.
13927
139282002-07-31 Akim Demaille <akim@epita.fr>
13929
13930 Steal GCC's --time-report support.
13931
13932 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
13933 stolen/adjusted from GCC.
13934 * m4/stage.m4: Remove time related checks.
13935 * m4/timevar.m4: New.
13936 * configure.in: Adjust.
13937 * src/system.h: Adjust to using timevar.h.
13938 * src/getargs.h, src/getargs.c: Support trace_time for
13939 --trace=time.
13940 * src/main.c (stage): Remove.
13941 (main): Replace `stage' invocations with timevar calls.
13942 * src/output.c: Insert pertinent timevar calls.
13943
139442002-07-31 Akim Demaille <akim@epita.fr>
13945
13946 Let --trace have arguments.
13947
13948 * src/getargs.h (enum trace_e): New.
13949 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
13950 (long_options, short_options): --trace/-T takes an optional
13951 argument.
13952 Change all the uses of trace_flag to reflect the new flags.
13953 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
13954
13955 Strengthen `stage' portability.
13956
13957 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
13958 * configure.in: Use it.
13959 Don't check for malloc.h and sys/times.h.
13960 * src/system.h: Include them when appropriate.
13961 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
13962 times and struct tms are available.
13963
139642002-07-30 Akim Demaille <akim@epita.fr>
13965
13966 In verbose parse error message, don't report `error' as an
13967 expected token.
13968 * tests/actions.at (Printers and Destructors): Adjust.
13969 * tests/calc.at (Calculator $1): Adjust.
13970 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
13971 error message, do not report the parser accepts the error token in
13972 that state.
13973
139742002-07-30 Akim Demaille <akim@epita.fr>
13975
13976 Normalize conflict related messages.
13977
13978 * src/complain.h, src/complain.c (warn, complain): New.
13979 * src/conflicts.c (conflicts_print): Use them.
13980 (conflict_report_yacc): New, extracted from...
13981 (conflicts_print): here.
13982 * tests/conflicts.at, tests/existing.at: Adjust.
13983
139842002-07-30 Akim Demaille <akim@epita.fr>
13985
13986 Report rules which are never reduced by the parser: those hidden
13987 by conflicts.
13988
13989 * src/LR0.c (save_reductions): Don't make the final state too
13990 different: save its reduction (accept) instead of having a state
13991 without any action (no shift or goto, no reduce).
13992 Note: the final state is now a ``regular'' state, i.e., the
13993 parsers now contain `reduce 0' as default reduction.
13994 Nevertheless, since they decide to `accept' when yystate =
13995 final_state, they still will not reduce rule 0.
13996 * src/print.c (print_actions, print_reduction): Adjust.
13997 * src/output.c (action_row): Track reduced rules.
13998 (token_actions): Report rules never reduced.
13999 * tests/conflicts.at, tests/regression.at: Adjust.
14000
140012002-07-30 Akim Demaille <akim@epita.fr>
14002
14003 `stage' was accidently included in a previous patch.
14004 Initiate its autoconfiscation.
14005
14006 * configure.in: Look for malloc.h and sys/times.h.
14007 * src/main.c (stage): Adjust.
14008 Report only when trace_flag.
14009
140102002-07-29 Akim Demaille <akim@epita.fr>
14011
14012 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
14013 state_number_t.
14014 (errs_t): symbol_t*, not symbol_number_t.
14015 (reductions_t): rule_t*, not rule_number_t.
14016 (FOR_EACH_SHIFT): New.
14017 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
14018 * src/print.c, src/print_graph.c: Adjust.
14019
140202002-07-29 Akim Demaille <akim@epita.fr>
14021
14022 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
14023
14024 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
14025 (endtoken, accept): these.
14026 * src/reader.c (reader): Set endtoken's default tag to "$end".
14027 Set undeftoken's tag to "$undefined" instead of "$undefined.".
14028 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
14029 Adjust.
14030
140312002-07-29 Akim Demaille <akim@epita.fr>
14032
14033 * src/reduce.c (reduce_grammar): When the language is empty,
14034 complain about the start symbol, not the axiom.
14035 Use its location.
14036 * tests/reduce.at (Empty Language): New.
14037
140382002-07-26 Akim Demaille <akim@epita.fr>
14039
14040 * src/reader.h, src/reader.c (gram_error): ... can't get
14041 yycontrol without making too strong assumptions on the parser
14042 itself.
14043 * src/output.c (prepare_tokens): Use the real 0th value of
14044 token_translations instead of `0'.
14045 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
14046 visible here.
14047 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
14048 for the time being: %locations ought to provide it to yyerror.
14049
140502002-07-25 Akim Demaille <akim@epita.fr>
14051
14052 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
14053 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
14054 * tests/regression.at (Web2c Actions): Adjust.
14055
140562002-07-25 Akim Demaille <akim@epita.fr>
14057
14058 Stop storing rules from 1 to nrules + 1.
14059
14060 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
14061 * src/nullable.c, src/output.c, src/print.c, src/reader.c
14062 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
14063 Iterate from 0 to nrules.
14064 Use rule_number_as_item_number and item_number_as_rule_number.
14065 Adjust to `derive' now containing possibly 0.
14066 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
14067 Handle the `- 1' part in rule numbers from/to item numbers.
14068 * src/conflicts.c (log_resolution): Fix the message which reversed
14069 shift and reduce.
14070 * src/output.c (action_row): Initialize default_rule to -1.
14071 (token_actions): Adjust.
14072 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
14073 expected output.
14074 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
14075
140762002-07-25 Akim Demaille <akim@epita.fr>
14077
14078 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
14079 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
14080 (b4_c_knr_arg_decl): New.
14081 * data/yacc.c: Use it to define yysymprint, yydestruct, and
14082 yyreport_parse_error.
14083
140842002-07-25 Akim Demaille <akim@epita.fr>
14085
14086 * data/yacc.c (yyreport_parse_error): New, extracted from...
14087 (yyparse): here.
14088 (yydestruct, yysymprint): Move above yyparse.
14089 Be K&R compliant.
14090
140912002-07-25 Akim Demaille <akim@epita.fr>
14092
14093 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
14094 replace...
14095 (b4_sint_type, b4_uint_type): these.
14096 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
14097 * tests/regression.at (Web2c Actions): Adjust.
14098
140992002-07-25 Akim Demaille <akim@epita.fr>
14100
14101 * src/gram.h (TIEM_NUMBER_MAX): New.
14102 (item_number_of_rule_number, rule_number_of_item_number): Rename
14103 as...
14104 (rule_number_as_item_number, item_number_as_rule_number): these.
14105 Adjust dependencies.
14106 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14107 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14108 (symbol_number_to_vector_number): New.
14109 (order): Of vector_number_t* type.
14110 (base_t, BASE_MAX, BASE_MIN): New.
14111 (froms, tos, width, pos, check): Of base_t type.
14112 (action_number_t, ACTION_MIN, ACTION_MAX): New.
14113 (actrow): Of action_number_t type.
14114 (conflrow): Of unsigned int type.
14115 (table_ninf, base_ninf): New.
14116 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
14117 (muscle_insert_int_table, muscle_insert_base_table)
14118 (muscle_insert_rule_number_table): New.
14119 (prepare_tokens): Output `toknum' as int_table.
14120 (action_row): Returns a rule_number_t.
14121 Use ACTION_MIN, not SHRT_MIN.
14122 (token_actions): yydefact is rule_number_t*.
14123 (table_ninf_remap): New.
14124 (pack_table): Use it for `base' and `table'.
14125 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
14126 replaced with...
14127 (YYPACT_NINF, YYTABLE_NINF): these.
14128 (yypact, yytable): Compute their types instead of hard-coded
14129 `short'.
14130 * tests/regression.at (Web2c Actions): Adjust.
14131
141322002-07-19 Akim Demaille <akim@epita.fr>
14133
14134 * src/scan-gram.l (id): Can start with an underscore.
14135
141362002-07-16 Akim Demaille <akim@epita.fr>
14137
14138 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
14139 Adjust all former `associativity' dependencies.
14140 * src/symtab.c (symbol_new): Default associativity is `undef', not
14141 `right'.
14142 (symbol_check_alias_consistence): Adjust.
14143
141442002-07-09 Akim Demaille <akim@epita.fr>
14145
14146 * doc/bison.texinfo: Properly set the ``header'' part.
14147 Use @dircategory ``GNU programming tools'' as per Texinfo's
14148 documentation.
14149 Use @copying.
14150
141512002-07-09 Akim Demaille <akim@epita.fr>
14152
14153 * lib/quotearg.h: Protect against multiple inclusions.
14154 * src/location.h (location_t): Add a `file' member.
14155 (LOCATION_RESET, LOCATION_PRINT): Adjust.
14156 * src/complain.c (warn_at, complain_at, fatal_at): Drop
14157 `error_one_per_line' support.
14158
141592002-07-09 Akim Demaille <akim@epita.fr>
14160
14161 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
14162 * src/reader.c (lineno): Remove.
14163 Adjust all dependencies.
14164 (get_merge_function): Take a location and use complain_at.
14165 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
14166 * tests/regression.at (Invalid inputs, Mixing %token styles):
14167 Adjust.
14168
141692002-07-09 Akim Demaille <akim@epita.fr>
14170
14171 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
14172 recovery rule, and forbid extensions when --yacc.
14173 (gram_error): Use complain_at.
14174 * src/reader.c (reader): Exit if there were parse errors.
14175
141762002-07-09 Akim Demaille <akim@epita.fr>
14177
14178 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
14179 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
14180 Reported by R Blake <blakers@mac.com>.
14181
141822002-07-09 Akim Demaille <akim@epita.fr>
14183
14184 * data/yacc.c: Output the copyright notive in the header.
14185
141862002-07-03 Akim Demaille <akim@epita.fr>
14187
14188 * src/output.c (froms, tos): Are state_number_t.
14189 (save_column): sp, sp1, and sp2 are state_number_t.
14190 (prepare): Rename `final' as `final_state_number', `nnts' as
14191 `nterms_number', `nrules' as `rules_number', `nstates' as
14192 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
14193 unused.
14194 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
14195 * data/lalr1.cc (nsym_): Remove, unused.
14196
141972002-07-03 Akim Demaille <akim@epita.fr>
14198
14199 * src/lalr.h, src/lalr.c (goto_number_t): New.
14200 * src/lalr.c (goto_list_t): New.
14201 Propagate them.
14202 * src/nullable.c (rule_list_t): New.
14203 Propagate.
14204 * src/types.h: Remove.
14205
142062002-07-03 Akim Demaille <akim@epita.fr>
14207
14208 * src/closure.c (print_fderives): Use rule_rhs_print.
14209 * src/derives.c (print_derives): Use rule_rhs_print.
14210 (rule_list_t): New, replaces `shorts'.
14211 (set_derives): Add comments.
14212 * tests/sets.at (Nullable, Firsts): Adjust.
14213
142142002-07-03 Akim Demaille <akim@epita.fr>
14215
14216 * src/output.c (prepare_actions): Free `tally' and `width'.
14217 (prepare_actions): Allocate and free `order'.
14218 * src/symtab.c (symbols_free): Free `symbols'.
14219 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
14220 * src/output.c (m4_invoke): Move to...
14221 * src/scan-skel.l: here.
14222 (<<EOF>>): Close yyout, and free its name.
14223
142242002-07-03 Akim Demaille <akim@epita.fr>
14225
14226 Fix some memory leaks, and fix a bug: state 0 was examined twice.
14227
14228 * src/LR0.c (new_state): Merge into...
14229 (state_list_append): this.
14230 (new_states): Merge into...
14231 (generate_states): here.
14232 (set_states): Don't ensure a proper `errs' state member here, do it...
14233 * src/conflicts.c (conflicts_solve): here.
14234 * src/state.h, src/state.c: Comment changes.
14235 (state_t): Rename member `shifts' as `transitions'.
14236 Adjust all dependencies.
14237 (errs_new): For consistency, also take the values as argument.
14238 (errs_dup): Remove.
14239 (state_errs_set): New.
14240 (state_reductions_set, state_transitions_set): Assert that no
14241 previous value was assigned.
14242 (state_free): New.
14243 (states_free): Use it.
14244 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
14245 temporary storage: use `errs' and `nerrs' as elsewhere.
14246 (set_conflicts): Allocate and free this `errs'.
14247
142482002-07-02 Akim Demaille <akim@epita.fr>
14249
14250 * lib/libiberty.h: New.
14251 * lib: Update the bitset implementation from upstream.
14252 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
14253 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
14254 * src/main.c: Adjust bitset stats calls.
14255
142562002-07-01 Paul Eggert <eggert@twinsun.com>
14257
14258 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
14259 char, so that negative chars don't collide with $.
14260
142612002-06-30 Akim Demaille <akim@epita.fr>
14262
14263 Have the GLR tests be `warning' checked, and fix the warnings.
14264
14265 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
14266 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
14267 (yyremoveDeletes): `yyi' and `yyj' are size_t.
14268 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
14269 (yyaddDeferredAction): static.
14270 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
14271 (yyreportParseError): yyprefix is const.
14272 yytokenp is used only when verbose.
14273 (yy__GNUC__): Replace with __GNUC__.
14274 (yypdumpstack): yyi is size_t.
14275 (yypreference): Un-yy local variables and arguments, to avoid
14276 clashes with `yyr1'. Anyway, we are not in the user name space.
14277 (yytname_size): be an int, as is compared with ints.
14278 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
14279 Use them.
14280 * tests/cxx-gram.at: Use quotation to protect $1.
14281 Use AT_COMPILE to enable warnings hunts.
14282 Prototype yylex and yyerror.
14283 `Use' argc.
14284 Include `string.h', not `strings.h'.
14285 Produce and prototype stmtMerge only when used.
14286 yylex takes a location.
14287
142882002-06-30 Akim Demaille <akim@epita.fr>
14289
14290 We spend a lot of time in quotearg, in particular when --verbose.
14291
14292 * src/symtab.c (symbol_get): Store a quoted version of the key.
14293 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
14294 Adjust all callers.
14295
142962002-06-30 Akim Demaille <akim@epita.fr>
14297
14298 * src/state.h (reductions_t): Rename member `nreds' as num.
14299 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
14300 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
14301
143022002-06-30 Akim Demaille <akim@epita.fr>
14303
14304 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
14305 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
14306 (shifts_to): Rename as...
14307 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
14308 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
14309 (TRANSITION_IS_DISABLED, transitions_to): these.
14310
143112002-06-30 Akim Demaille <akim@epita.fr>
14312
14313 * src/print.c (print_shifts, print_gotos): Merge into...
14314 (print_transitions): this.
14315 (print_transitions, print_errs, print_reductions): Align the
14316 lookaheads columns.
14317 (print_core, print_transitions, print_errs, print_state,
14318 print_grammar): Output empty lines separator before, not after.
14319 (state_default_rule_compute): Rename as...
14320 (state_default_rule): this.
14321 * tests/conflicts.at (Defaulted Conflicted Reduction),
14322 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
14323 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
14324
143252002-06-30 Akim Demaille <akim@epita.fr>
14326
14327 Display items as we display rules.
14328
14329 * src/gram.h, src/gram.c (rule_lhs_print): New.
14330 * src/gram.c (grammar_rules_partial_print): Use it.
14331 * src/print.c (print_core): Likewise.
14332 * tests/conflicts.at (Defaulted Conflicted Reduction),
14333 (Unresolved SR Conflicts): Adjust.
14334 (Unresolved SR Conflicts): Adjust and rename as...
14335 (Resolved SR Conflicts): this, as was meant.
14336 * tests/regression.at (Web2c Report): Adjust.
14337
143382002-06-30 Akim Demaille <akim@epita.fr>
14339
14340 * src/print.c (state_default_rule_compute): New, extracted from...
14341 (print_reductions): here.
14342 Pessimize, but clarify the code.
14343 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
14344
143452002-06-30 Akim Demaille <akim@epita.fr>
14346
14347 * src/output.c (action_row): Let default_rule be always a rule
14348 number.
14349
143502002-06-30 Akim Demaille <akim@epita.fr>
14351
14352 * src/closure.c (print_firsts, print_fderives, closure):
14353 Use BITSET_EXECUTE.
14354 * src/lalr.c (lookaheads_print): Likewise.
14355 * src/state.c (state_rule_lookaheads_print): Likewise.
14356 * src/print_graph.c (print_core): Likewise.
14357 * src/print.c (print_reductions): Likewise.
14358 * src/output.c (action_row): Likewise.
14359 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
14360
143612002-06-30 Akim Demaille <akim@epita.fr>
14362
14363 * src/print_graph.c: Use report_flag.
14364
143652002-06-30 Akim Demaille <akim@epita.fr>
14366
14367 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
14368 to...
14369 * src/relation.h, src/relation.c (traverse, relation_digraph)
14370 (relation_print, relation_transpose): New.
14371
143722002-06-30 Akim Demaille <akim@epita.fr>
14373
14374 * src/state.h, src/state.c (shifts_to): New.
14375 * src/lalr.c (build_relations): Use it.
14376
143772002-06-30 Akim Demaille <akim@epita.fr>
14378
14379 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
14380 (item_number_of_rule_number, rule_number_of_item_number): New.
14381 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
14382 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14383 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
14384 Propagate their use.
14385 Much remains to be done, in particular wrt `shorts' from types.h.
14386
143872002-06-30 Akim Demaille <akim@epita.fr>
14388
14389 * src/symtab.c (symbol_new): Initialize the `printer' member.
14390
143912002-06-30 Akim Demaille <akim@epita.fr>
14392
14393 * src/LR0.c (save_reductions): Remove, replaced by...
14394 * src/state.h, src/state.c (state_reductions_set): New.
14395 (reductions, errs): Rename as...
14396 (reductions_t, errs_t): these.
14397 Adjust all dependencies.
14398
143992002-06-30 Akim Demaille <akim@epita.fr>
14400
14401 * src/LR0.c (state_list_t, state_list_append): New.
14402 (first_state, last_state): Now symbol_list_t.
14403 (this_state): Remove.
14404 (new_itemsets, append_states, save_reductions): Take a state_t as
14405 argument.
14406 (set_states, generate_states): Adjust.
14407 (save_shifts): Remove, replaced by...
14408 * src/state.h, src/state.c (state_shifts_set): New.
14409 (shifts): Rename as...
14410 (shifts_t): this.
14411 Adjust all dependencies.
14412 * src/state.h (state_t): Remove the `next' member.
14413
144142002-06-30 Akim Demaille <akim@epita.fr>
14415
14416 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
14417 escaped in slot 0.
14418
144192002-06-30 Akim Demaille <akim@epita.fr>
14420
14421 Use hash.h for the state hash table.
14422
14423 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
14424 (allocate_storage): Use state_hash_new.
14425 (free_storage): Use state_hash_free.
14426 (new_state, get_state): Adjust.
14427 * src/lalr.h, src/lalr.c (states): Move to...
14428 * src/states.h (state_t): Remove the `link' member, no longer
14429 used.
14430 * src/states.h, src/states.c: here.
14431 (state_hash_new, state_hash_free, state_hash_lookup)
14432 (state_hash_insert, states_free): New.
14433 * src/states.c (state_table, state_compare, state_hash): New.
14434 * src/output.c (output_actions): Do not free states now, since we
14435 still need to know the final_state number in `prepare', called
14436 afterwards. Do it...
14437 * src/main.c (main): here: call states_free after `output'.
14438
144392002-06-30 Akim Demaille <akim@epita.fr>
14440
14441 * src/state.h, src/state.c (state_new): New, extracted from...
14442 * src/LR0.c (new_state): here.
14443 * src/state.h (STATE_ALLOC): Move to...
14444 * src/state.c: here.
14445 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
14446 * src/state.h, src/state.c: here.
14447
144482002-06-30 Akim Demaille <akim@epita.fr>
14449
14450 * src/reader.c (gensym): Rename as...
14451 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
14452 (getsym): Rename as...
14453 (symbol_get): this.
14454
144552002-06-30 Akim Demaille <akim@epita.fr>
14456
14457 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
14458 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
14459 * src/output.c, src/print.c, src/print_graph.c: Propagate.
14460 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
14461
144622002-06-30 Akim Demaille <akim@epita.fr>
14463
14464 Make the test suite pass with warnings checked.
14465
14466 * tests/actions.at (Printers and Destructors): Improve.
14467 Avoid unsigned vs. signed issues.
14468 * tests/calc.at: Don't exercise the scanner here, do it...
14469 * tests/input.at (Torturing the Scanner): here.
14470
144712002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14472
14473 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
14474 reorganize first lines parallel to yacc.c.
14475
144762002-06-28 Akim Demaille <akim@epita.fr>
14477
14478 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
14479 (b4_token_enum, b4_token_defines): New, factored from...
14480 * data/lalr1.cc, data/yacc.c, glr.c: here.
14481
144822002-06-28 Akim Demaille <akim@epita.fr>
14483
14484 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
14485 unused variables.
14486 * src/output.c (merger_output): static.
14487
144882002-06-28 Akim Demaille <akim@epita.fr>
14489
14490 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
14491 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
14492 pacify GCC.
14493 * src/output.c (save_row): Initialize all the variables to pacify GCC.
14494
144952002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14496
14497 Accumulated changelog for new GLR parsing features.
14498
14499 * src/conflicts.c (count_total_conflicts): Change name to
14500 conflicts_total_count.
14501 * src/conflicts.h: Ditto.
14502 * src/output.c (token_actions): Use the new name.
14503 (output_conflicts): Change conflp => conflict_list_heads, and
14504 confl => conflict_list for better readability.
14505 * data/glr.c: Use the new names.
14506 * NEWS: Add self to GLR announcement.
14507
14508 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
14509
14510 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
14511 Akim Demaille.
14512
14513 * data/bison.glr: Change name to glr.c
14514 * data/glr.c: Renamed from bison.glr.
14515 * data/Makefile.am: Add glr.c
14516
14517 * src/getargs.c:
14518
14519 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
14520 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
14521
14522 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14523
14524 * data/bison.glr: Be sure to restore the
14525 current #line when returning to the skeleton contents after having
14526 exposed the input file's #line.
14527
14528 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14529
14530 * data/bison.glr: Bring up to date with changes to bison.simple.
14531
14532 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14533
14534 * data/bison.glr: Correct definitions that use b4_prefix.
14535 Various reformatting.
14536 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
14537 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
14538 yytokenp argument; now part of stack.
14539 (yychar): Define to behave as documented.
14540 (yyclearin): Ditto.
14541
14542 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14543
14544 * src/reader.h: Add declaration for free_merger_functions.
14545
14546 * src/reader.c (merge_functions): New variable.
14547 (get_merge_function): New function.
14548 (free_merger_functions): New function.
14549 (readgram): Check for %prec that is not followed by a symbol.
14550 Handle %dprec and %merge declarations.
14551 (packgram): Initialize dprec and merger fields in rules array.
14552
14553 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
14554 conflict_list_cnt, conflict_list_free): New variables.
14555 (table_grow): Also grow conflict_table.
14556 (prepare_rules): Output dprec and merger tables.
14557 (conflict_row): New function.
14558 (action_row): Output conflict lists for GLR parser. Don't use
14559 default reduction in conflicted states for GLR parser so that there
14560 are spaces for the conflict lists.
14561 (save_row): Also save conflict information.
14562 (token_actions): Allocate conflict list.
14563 (merger_output): New function.
14564 (pack_vector): Pack conflict table, too.
14565 (output_conflicts): New function to output yyconflp and yyconfl.
14566 (output_check): Allocate conflict_tos.
14567 (output_actions): Output conflict tables, also.
14568 (output_skeleton): Output b4_mergers definition.
14569 (prepare): Output b4_max_rhs_length definition.
14570 Use 'bison.glr' as default skeleton for GLR parsers.
14571
14572 * src/gram.c (glr_parser): New flag.
14573 (grammar_free): Call free_merger_functions.
14574
14575 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
14576 all pairs of conflicting reductions, rather than just all tokens
14577 causing conflicts. Needed to size conflict tables.
14578 (conflicts_output): Modify call to count_rr_conflicts for new
14579 interface.
14580 (conflicts_print): Ditto.
14581 (count_total_conflicts): New function.
14582
14583 * src/reader.h (merger_list): New type.
14584 (merge_functions): New variable.
14585
14586 * src/lex.h (tok_dprec, tok_merge): New token types.
14587
14588 * src/gram.h (rule_s): Add dprec and merger fields.
14589 (glr_parser): New flag.
14590
14591 * src/conflicts.h (count_total_conflicts): New function.
14592
14593 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
14594
14595 * doc/bison.texinfo (Generalized LR Parsing): New section.
14596 (GLR Parsers): New section.
14597 (Language and Grammar): Mention GLR parsing.
14598 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
14599 Correct typo ("tge" -> "the").
14600
14601 * data/bison.glr: New skeleton for GLR parsing.
14602
14603 * tests/cxx-gram.at: New tests for GLR parsing.
14604
14605 * tests/testsuite.at: Include cxx-gram.at.
14606
14607 * tests/Makefile.am: Add cxx-gram.at.
14608
14609 * src/parse-gram.y:
14610
14611 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
14612
14613 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
14614
146152002-06-27 Akim Demaille <akim@epita.fr>
14616
14617 * src/options.h, src/options.c: Remove.
14618 * src/getargs.c (short_options, long_options): New.
14619
146202002-06-27 Akim Demaille <akim@epita.fr>
14621
14622 * data/bison.simple, data/bison.c++: Rename as...
14623 * data/yacc.c, data/lalr1.cc: these.
14624 * doc/bison.texinfo (Environment Variables): Remove.
14625
146262002-06-25 Raja R Harinath <harinath@cs.umn.edu>
14627
14628 * src/getargs.c (report_argmatch): Initialize strtok().
14629
146302002-06-20 Akim Demaille <akim@epita.fr>
14631
14632 * data/bison.simple (b4_symbol_actions): New, replaces...
14633 (b4_symbol_destructor, b4_symbol_printer): these.
14634 (yysymprint): Be sure to call YYPRINT only for tokens, and using
14635 user token numbers.
14636
146372002-06-20 Akim Demaille <akim@epita.fr>
14638
14639 * data/bison.simple (yydestructor): Rename as...
14640 (yydestruct): this.
14641
146422002-06-20 Akim Demaille <akim@epita.fr>
14643
14644 * src/symtab.h, src/symtab.c (symbol_type_set)
14645 (symbol_destructor_set, symbol_precedence_set): The location is
14646 the last argument.
14647 Adjust all callers.
14648
146492002-06-20 Akim Demaille <akim@epita.fr>
14650
14651 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
14652 internals.
14653 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
14654 Takes a location.
14655 * src/symtab.h, src/symtab.c (symbol_class_set)
14656 (symbol_user_token_number_set): Likewise.
14657 Adjust all callers.
14658 Promote complain_at.
14659 * tests/input.at (Type Clashes): Adjust.
14660
146612002-06-20 Akim Demaille <akim@epita.fr>
14662
14663 * data/bison.simple (YYLEX): Fix the declaration when
14664 %pure-parser.
14665
146662002-06-20 Akim Demaille <akim@epita.fr>
14667
14668 * data/bison.simple (yysymprint): Don't print the token number,
14669 just its name.
14670 * tests/actions.at (Destructors): Rename as...
14671 (Printers and Destructors): this.
14672 Also exercise %printer.
14673
146742002-06-20 Akim Demaille <akim@epita.fr>
14675
14676 * data/bison.simple (YYDSYMPRINT): New.
14677 Use it to remove many of the #if YYDEBUG/if (yydebug).
14678
146792002-06-20 Akim Demaille <akim@epita.fr>
14680
14681 * src/symtab.h, src/symtab.c (symbol_t): printer and
14682 printer_location are new members.
14683 (symbol_printer_set): New.
14684 * src/parse-gram.y (PERCENT_PRINTER): New token.
14685 Handle its associated rule.
14686 * src/scan-gram.l: Adjust.
14687 (handle_destructor_at, handle_destructor_dollar): Rename as...
14688 (handle_symbol_code_at, handle_symbol_code_dollar): these.
14689 * src/output.c (symbol_printers_output): New.
14690 (output_skeleton): Call it.
14691 * data/bison.simple (yysymprint): New. Cannot be named yyprint
14692 since there are already many grammar files with a user `yyprint'.
14693 Replace the calls to YYPRINT to calls to yysymprint.
14694 * tests/calc.at: Adjust.
14695 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
14696 taking advantage of parser very internal details (stack size!).
14697
146982002-06-20 Akim Demaille <akim@epita.fr>
14699
14700 * src/scan-gram.l: Complete the scanner with the missing patterns
14701 to pacify Flex.
14702 Use `quote' and `symbol_tag_get' where appropriate.
14703
147042002-06-19 Akim Demaille <akim@epita.fr>
14705
14706 * tests/actions.at (Destructors): Augment to test locations.
14707 * data/bison.simple (yydestructor): Pass it the current location
14708 if locations are enabled.
14709 Prototype only when __STDC__ or C++.
14710 Change the argument names to move into the yy name space: there is
14711 user code here.
14712
147132002-06-19 Akim Demaille <akim@epita.fr>
14714
14715 * data/bison.simple (b4_pure_if): New.
14716 Use it instead of #ifdef YYPURE.
14717
147182002-06-19 Akim Demaille <akim@epita.fr>
14719
14720 * data/bison.simple (b4_location_if): New.
14721 Use it instead of #ifdef YYLSP_NEEDED.
14722
147232002-06-19 Akim Demaille <akim@epita.fr>
14724
14725 Prepare @$ in %destructor, but currently don't bind it in the
14726 skeleton, as %location use is not cleaned up yet.
14727
14728 * src/scan-gram.l (handle_dollar, handle_destructor_at)
14729 (handle_action_at): New.
14730 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
14731 a braced_code_t and a location as additional arguments.
14732 (handle_destructor_dollar): Instead of requiring `b4_eval', just
14733 unquote one when outputting `b4_dollar_dollar'.
14734 Adjust callers.
14735 * data/bison.simple (b4_eval): Remove.
14736 (b4_symbol_destructor): Adjust.
14737 * tests/input.at (Invalid @n): Adjust.
14738
147392002-06-19 Zack Weinberg <zack@codesourcery.com>
14740
14741 * doc/bison.texinfo: Document ability to have multiple
14742 prologue sections.
14743
147442002-06-18 Akim Demaille <akim@epita.fr>
14745
14746 * src/files.c (compute_base_names): When computing the output file
14747 names from the input file name, strip the directory part.
14748
147492002-06-18 Akim Demaille <akim@epita.fr>
14750
14751 * data/bison.simple.new: Comment changes.
14752 Reported by Andreas Schwab.
14753
147542002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
14755
14756 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
14757 there are no `label `yyoverflowlab' defined but not used' warnings
14758 when yyoverflow is defined.
14759
147602002-06-18 Akim Demaille <akim@epita.fr>
14761
14762 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
14763 new member.
14764 (symbol_destructor_set): Adjust.
14765 * src/output.c (symbol_destructors_output): Output the destructor
14766 locations.
14767 Output the symbol name.
14768 * data/bison.simple (b4_symbol_destructor): Adjust.
14769
147702002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
14771 and Akim Demaille <akim@epita.fr>
14772
14773 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
14774 what's left on the stack when the error recovery hits EOF.
14775 * tests/actions.at (Destructors): Complete to exercise this case.
14776
147772002-06-17 Akim Demaille <akim@epita.fr>
14778
14779 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
14780 arguments is really empty, not only equal to `[]'.
14781 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
14782 member.
14783 (symbol_destructor_set): New.
14784 * src/output.c (symbol_destructors_output): New.
14785 * src/reader.h (brace_code_t, current_braced_code): New.
14786 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
14787 (handle_dollar): Rename as...
14788 (handle_action_dollar): this.
14789 (handle_destructor_dollar): New.
14790 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
14791 (grammar_declaration): Use it.
14792 * data/bison.simple (yystos): Is always defined.
14793 (yydestructor): New.
14794 * tests/actions.at (Destructors): New.
14795 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
14796
147972002-06-17 Akim Demaille <akim@epita.fr>
14798
14799 * src/symlist.h, src/symlist.c (symbol_list_length): New.
14800 * src/scan-gram.l (handle_dollar, handle_at): Compute the
14801 rule_length only when needed.
14802 * src/output.c (actions_output, token_definitions_output): Output
14803 the full M4 block.
14804 * src/symtab.c: Don't access directly to the symbol tag, use
14805 symbol_tag_get.
14806 * src/parse-gram.y: Use symbol_list_free.
14807
148082002-06-17 Akim Demaille <akim@epita.fr>
14809
14810 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
14811 (symbol_list_prepend, get_type_name): Move to...
14812 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
14813 (symbol_list_prepend, symbol_list_n_type_name_get): here.
14814 Adjust all callers.
14815 (symbol_list_free): New.
14816 * src/scan-gram.l (handle_dollar): Takes a location.
14817 * tests/input.at (Invalid $n): Adjust.
14818
148192002-06-17 Akim Demaille <akim@epita.fr>
14820
14821 * src/reader.h, src/reader.c (symbol_list_new): Export it.
14822 (symbol_list_prepend): New.
14823 * src/parse-gram.y (%union): `list' is a new member.
14824 (symbols.1): New, replaces...
14825 (terms_to_prec.1, nterms_to_type.1): these.
14826 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
14827 Take a location as additional argument.
14828 Adjust all callers.
14829
148302002-06-15 Akim Demaille <akim@epita.fr>
14831
14832 * src/parse-gram.y: Move %token in the declaration section so that
14833 we don't depend upon CVS Bison.
14834
148352002-06-15 Akim Demaille <akim@epita.fr>
14836
14837 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
14838 * src/print.c (print_core): Use it.
14839
148402002-06-15 Akim Demaille <akim@epita.fr>
14841
14842 * src/conflicts.c (log_resolution): Accept the rule involved in
14843 the sr conflicts instead of the lookahead number that points to
14844 that rule.
14845 (flush_reduce): Accept the current lookahead vector as argument,
14846 instead of the index in LA.
14847 (resolve_sr_conflict): Accept the current number of lookahead
14848 bitset to consider for the STATE, instead of the index in LA.
14849 (set_conflicts): Adjust.
14850 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
14851
148522002-06-15 Akim Demaille <akim@epita.fr>
14853
14854 * src/state.h (state_t): Replace the `lookaheadsp' member, a
14855 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
14856 Adjust all dependencies.
14857 * src/lalr.c (initialize_lookaheads): Split into...
14858 (states_lookaheads_count, states_lookaheads_initialize): these.
14859 (lalr): Adjust.
14860
148612002-06-15 Akim Demaille <akim@epita.fr>
14862
14863 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
14864 out of...
14865 (grammar_rules_print): here.
14866 * src/reduce.c (reduce_output): Use it.
14867 * tests/reduce.at (Useless Rules, Reduced Automaton)
14868 (Underivable Rules): Adjust.
14869
148702002-06-15 Akim Demaille <akim@epita.fr>
14871
14872 Copy BYacc's nice way to report the grammar.
14873
14874 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
14875 New.
14876 Don't print the rules' location, it is confusing and useless.
14877 (rule_print): Use grammar_rhs_print.
14878 * src/print.c (print_grammar): Use grammar_rules_print.
14879
148802002-06-15 Akim Demaille <akim@epita.fr>
14881
14882 Complete and rationalize `useless thing' warnings.
14883
14884 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
14885 (symbol_tag_print): New.
14886 Use them everywhere in place of accessing directly the tag member.
14887 * src/gram.h, src/gram.c (rule_print): New.
14888 Use it where a rule used to be printed `by hand'.
14889 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
14890 (reduce_grammar_tables): Report the useless rules.
14891 (reduce_print): Useless things are a warning, not an error.
14892 Report it as such.
14893 * tests/reduce.at (Useless Nonterminals, Useless Rules):
14894 (Reduced Automaton, Underivable Rules): Adjust.
14895 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
14896 * tests/conflicts.at (Unresolved SR Conflicts)
14897 (Solved SR Conflicts): Adjust.
14898
148992002-06-15 Akim Demaille <akim@epita.fr>
14900
14901 Let symbols have a location.
14902
14903 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
14904 (getsym): Adjust.
14905 Adjust all callers.
14906 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
14907 Use location_t, not int.
14908 * src/symtab.c (symbol_check_defined): Take advantage of the
14909 location.
14910 * tests/regression.at (Invalid inputs): Adjust.
14911
149122002-06-15 Akim Demaille <akim@epita.fr>
14913
14914 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
14915 (input): Don't try to initialize yylloc here, do it in the
14916 scanner.
14917 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
14918 * src/gram.h (rule_t): Change line and action_line into location
14919 and action_location, of location_t type.
14920 Adjust all dependencies.
14921 * src/location.h, src/location.c (empty_location): New.
14922 * src/reader.h, src/reader.c (grammar_start_symbol_set)
14923 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
14924 (grammar_current_rule_symbol_append)
14925 (grammar_current_rule_action_append): Expect a location as argument.
14926 * src/reader.c (grammar_midrule_action): Adjust to attach an
14927 action's location as dummy symbol location.
14928 * src/symtab.h, src/symtab.c (startsymbol_location): New.
14929 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
14930 the line numbers.
14931
149322002-06-14 Akim Demaille <akim@epita.fr>
14933
14934 Grammar declarations may be found in the grammar section.
14935
14936 * src/parse-gram.y (rules_or_grammar_declaration): New.
14937 (declarations): Each declaration may end with a semicolon, not
14938 just...
14939 (grammar_declaration): `"%union"'.
14940 (grammar): Branch to rules_or_grammar_declaration.
14941
149422002-06-14 Akim Demaille <akim@epita.fr>
14943
14944 * src/main.c (main): Invoke scanner_free.
14945
149462002-06-14 Akim Demaille <akim@epita.fr>
14947
14948 * src/output.c (m4_invoke): Extracted from...
14949 (output_skeleton): here.
14950 Free tempfile.
14951
149522002-06-14 Akim Demaille <akim@epita.fr>
14953
14954 * src/parse-gram.y (directives, directive, gram)
14955 (grammar_directives, precedence_directives, precedence_directive):
14956 Rename as...
14957 (declarations, declaration, grammar, grammar_declaration)
14958 (precedence_declaration, precedence_declarator): these.
14959 (symbol_declaration): New.
14960
149612002-06-14 Akim Demaille <akim@epita.fr>
14962
14963 * src/files.c (action_obstack): Remove, unused.
14964 (output_obstack): Remove it, and all its dependencies, as it is no
14965 longer needed.
14966 * src/reader.c (epilogue_set): Build the epilogue in the
14967 muscle_obstack.
14968 * src/output.h, src/output.c (muscle_obstack): Move to...
14969 * src/muscle_tab.h, src/muscle_tab.h: here.
14970 (muscle_init): Initialize muscle_obstack.
14971 (muscle_free): New.
14972 * src/main.c (main): Call it.
14973
149742002-06-14 Akim Demaille <akim@epita.fr>
14975
14976 * src/location.h: New, extracted from...
14977 * src/reader.h: here.
14978 * src/Makefile.am (noinst_HEADERS): Merge into
14979 (bison_SOURCES): this.
14980 Add location.h.
14981 * src/parse-gram.y: Use location_t instead of Bison's.
14982 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
14983 Use location_t instead of ints.
14984
149852002-06-14 Akim Demaille <akim@epita.fr>
14986
14987 * data/bison.simple, data/bison.c++: Be sure to restore the
14988 current #line when returning to the skeleton contents after having
14989 exposed the input file's #line.
14990
149912002-06-12 Akim Demaille <akim@epita.fr>
14992
14993 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
14994 eager.
14995 * tests/actions.at (Exotic Dollars): New.
14996
149972002-06-12 Akim Demaille <akim@epita.fr>
14998
14999 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
15000 ['"/] too eagerly.
15001 * tests/input.at (Torturing the Scanner): New.
15002
150032002-06-11 Akim Demaille <akim@epita.fr>
15004
15005 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
15006 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
15007 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
15008 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
15009 * src/reader.c (reader): Use it.
15010
150112002-06-11 Akim Demaille <akim@epita.fr>
15012
15013 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
15014 Adjust all callers.
15015 (scanner_last_string_free): New.
15016
150172002-06-11 Akim Demaille <akim@epita.fr>
15018
15019 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
15020 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
15021 (last_string, YY_OBS_FREE): New.
15022 Use them when returning an ID.
15023
150242002-06-11 Akim Demaille <akim@epita.fr>
15025
15026 Have Bison grammars parsed by a Bison grammar.
15027
15028 * src/reader.c, src/reader.h (prologue_augment): New.
15029 * src/reader.c (copy_definition): Remove.
15030
15031 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
15032 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
15033 (grammar_current_rule_prec_set, grammar_current_rule_check)
15034 (grammar_current_rule_symbol_append)
15035 (grammar_current_rule_action_append): Export.
15036 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
15037 (symbol_list_action_append): Remove.
15038 Hook the routines from reader.
15039 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
15040 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
15041
15042 * src/reader.c (read_declarations): Remove, unused.
15043
15044 * src/parse-gram.y: Handle the epilogue.
15045 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
15046 (grammar_start_symbol_set): this.
15047 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
15048 * src/reader.c (readgram): Remove, unused.
15049 (reader): Adjust to insert eoftoken and axiom where appropriate.
15050
15051 * src/reader.c (copy_dollar): Replace with...
15052 * src/scan-gram.h (handle_dollar): this.
15053 * src/parse-gram.y: Remove `%thong'.
15054
15055 * src/reader.c (copy_at): Replace with...
15056 * src/scan-gram.h (handle_at): this.
15057
15058 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
15059 New.
15060
15061 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
15062 time being.
15063
15064 * src/reader.h, src/reader.c (grammar_rule_end): New.
15065
15066 * src/parse.y (current_type, current_class): New.
15067 Implement `%nterm', `%token' support.
15068 Merge `%term' into `%token'.
15069 (string_as_id): New.
15070 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
15071 type name.
15072
15073 * src/parse-gram.y: Be sure to handle properly the beginning of
15074 rules.
15075
15076 * src/parse-gram.y: Handle %type.
15077 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
15078
15079 * src/parse-gram.y: More directives support.
15080 * src/options.c: No longer handle source directives.
15081
15082 * src/parse-gram.y: Fix %output.
15083
15084 * src/parse-gram.y: Handle %union.
15085 Use the prologue locations.
15086 * src/reader.c (parse_union_decl): Remove.
15087
15088 * src/reader.h, src/reader.c (epilogue_set): New.
15089 * src/parse-gram.y: Use it.
15090
15091 * data/bison.simple, data/bison.c++: b4_stype is now either not
15092 defined, then default to int, or to the contents of %union,
15093 without `union' itself.
15094 Adjust.
15095 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
15096
15097 * src/output.c (actions_output): Don't output braces, as they are
15098 already handled by the scanner.
15099
15100 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
15101 characters to themselves.
15102
15103 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
15104 that the epilogue has a proper #line.
15105
15106 * src/parse-gram.y: Handle precedence/associativity.
15107
15108 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
15109 a terminal.
15110 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
15111 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
15112 at all to define terminals that cannot be emitted.
15113
15114 * src/scan-gram.l: Escape M4 characters.
15115
15116 * src/scan-gram.l: Working properly with escapes in user
15117 strings/characters.
15118
15119 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
15120 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
15121 grammar.
15122 Use more modest sizes, as for the time being the parser does not
15123 release memory, and therefore the process swallows a huge amount
15124 of memory.
15125
15126 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
15127 stricter %token grammar.
15128
15129 * src/symtab.h (associativity): Add `undef_assoc'.
15130 (symbol_precedence_set): Do nothing when passed an undef_assoc.
15131 * src/symtab.c (symbol_check_alias_consistence): Adjust.
15132
15133 * tests/regression.at (Invalid %directive): Remove, as it is now
15134 meaningless.
15135 (Invalid inputs): Adjust to the new error messages.
15136 (Token definitions): The new grammar doesn't allow too many
15137 eccentricities.
15138
15139 * src/lex.h, src/lex.c: Remove.
15140 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
15141 (copy_character, copy_string2, copy_string, copy_identifier)
15142 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
15143 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
15144 (parse_action): Remove.
15145 * po/POTFILES.in: Adjust.
15146
151472002-06-11 Akim Demaille <akim@epita.fr>
15148
15149 * src/reader.c (parse_action): Don't store directly into the
15150 rule's action member: return the action as a string.
15151 Don't require `rule_length' as an argument: compute it.
15152 (grammar_current_rule_symbol_append)
15153 (grammar_current_rule_action_append): New, eved out from
15154 (readgram): here.
15155 Remove `action_flag', `rulelength', unused now.
15156
151572002-06-11 Akim Demaille <akim@epita.fr>
15158
15159 * src/reader.c (grammar_current_rule_prec_set).
15160 (grammar_current_rule_check): New, eved out from...
15161 (readgram): here.
15162 Remove `xaction', `first_rhs': useless.
15163 * tests/input.at (Type clashes): New.
15164 * tests/existing.at (GNU Cim Grammar): Adjust.
15165
151662002-06-11 Akim Demaille <akim@epita.fr>
15167
15168 * src/reader.c (grammar_midrule_action): New, Eved out from
15169 (readgram): here.
15170
151712002-06-11 Akim Demaille <akim@epita.fr>
15172
15173 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
15174 New.
15175 (readgram): Use them as replacement of inlined code, crule and
15176 crule1.
15177
151782002-06-11 Akim Demaille <akim@epita.fr>
15179
15180 * src/reader.c (grammar_end, grammar_symbol_append): New.
15181 (readgram): Use them.
15182 Make the use of `p' as local as possible.
15183
151842002-06-10 Akim Demaille <akim@epita.fr>
15185
15186 GCJ's parser requires the tokens to be defined before the prologue.
15187
15188 * data/bison.simple: Output the token definition before the user's
15189 prologue.
15190 * tests/regression.at (Braces parsing, Duplicate string)
15191 (Mixing %token styles): Check the output from bison.
15192 (Early token definitions): New.
15193
151942002-06-10 Akim Demaille <akim@epita.fr>
15195
15196 * src/symtab.c (symbol_user_token_number_set): Don't complain when
15197 assigning twice the same user number to a token, so that we can
15198 use it in...
15199 * src/lex.c (lex): here.
15200 Also use `symbol_class_set' instead of hand written code.
15201 * src/reader.c (parse_assoc_decl): Likewise.
15202
152032002-06-10 Akim Demaille <akim@epita.fr>
15204
15205 * src/symtab.c, src/symtab.c (symbol_class_set)
15206 (symbol_user_token_number_set): New.
15207 * src/reader.c (parse_token_decl): Use them.
15208 Use a switch instead of ifs.
15209 Use a single argument.
15210
152112002-06-10 Akim Demaille <akim@epita.fr>
15212
15213 Remove `%thong' support as it is undocumented, unused, duplicates
15214 `%token's job, and creates useless e-mail traffic with people who
15215 want to know what it is, why it is undocumented, unused, and
15216 duplicates `%token's job.
15217
15218 * src/reader.c (parse_thong_decl): Remove.
15219 * src/options.c (option_table): Remove "thong".
15220 * src/lex.h (tok_thong): Remove.
15221
152222002-06-10 Akim Demaille <akim@epita.fr>
15223
15224 * src/symtab.c, src/symtab.c (symbol_type_set)
15225 (symbol_precedence_set): New.
15226 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
15227 (value_components_used): Remove, unused.
15228
152292002-06-09 Akim Demaille <akim@epita.fr>
15230
15231 Move symbols handling code out of the reader.
15232
15233 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
15234 (axiom): Move to...
15235 * src/symtab.h, src/symtab.c: here.
15236
15237 * src/gram.c (start_symbol): Remove: use startsymbol->number.
15238 * src/reader.c (startval): Rename as...
15239 * src/symtab.h, src/symtab.c (startsymbol): this.
15240 * src/reader.c: Adjust.
15241
15242 * src/reader.c (symbol_check_defined, symbol_make_alias)
15243 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
15244 (token_translations_init)
15245 Move to...
15246 * src/symtab.c: here.
15247 * src/reader.c (packsymbols): Move to...
15248 * src/symtab.h, src/symtab.c (symbols_pack): here.
15249 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
15250 argument.
15251
152522002-06-03 Akim Demaille <akim@epita.fr>
15253
15254 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
15255 then statements.
15256
152572002-06-03 Akim Demaille <akim@epita.fr>
15258
15259 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
15260 structs with non literals.
15261 * src/scan-skel.l: never-interactive.
15262 * src/conflicts.c (enum conflict_resolution_e): No trailing
15263 comma.
15264 * src/getargs.c (usage): Split long literal strings.
15265 Reported by Hans Aberg.
15266
152672002-05-28 Akim Demaille <akim@epita.fr>
15268
15269 * data/bison.c++: Use C++ ostreams.
15270 (cdebug_): New member.
15271
152722002-05-28 Akim Demaille <akim@epita.fr>
15273
15274 * src/output.c (output_skeleton): Be sure to allocate enough room
15275 for `/' _and_ for `\0' in full_skeleton.
15276
152772002-05-28 Akim Demaille <akim@epita.fr>
15278
15279 * data/bison.c++: Catch up with bison.simple:
15280 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15281 and Paul Eggert <eggert@twinsun.com>: `error' handing.
15282 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
15283 and popping traces.
15284
152852002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15286
15287 * src/output.c (output_skeleton): Put an explicit path in front of
15288 the skeleton file name, rather than relying on the -I directory,
15289 to partially alleviate effects of having a skeleton file lying around
15290 in the current directory.
15291
152922002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15293
15294 * src/conflicts.c (log_resolution): Correct typo:
15295 obstack_printf should be obstack_fgrow1.
15296
152972002-05-26 Akim Demaille <akim@epita.fr>
15298
15299 * src/state.h (state_t): `solved_conflicts' is a new member.
15300 * src/LR0.c (new_state): Set it to 0.
15301 * src/conflicts.h, src/conflicts.c (print_conflicts)
15302 (free_conflicts, solve_conflicts): Rename as...
15303 (conflicts_print, conflicts_free, conflicts_solve): these.
15304 Adjust callers.
15305 * src/conflicts.c (enum conflict_resolution_e)
15306 (solved_conflicts_obstack): New, used by...
15307 (log_resolution): this.
15308 Adjust to attach the conflict resolution to each state.
15309 Complete the description with the precedence/associativity
15310 information.
15311 (resolve_sr_conflict): Adjust.
15312 * src/print.c (print_state): Output its solved_conflicts.
15313 * tests/conflicts.at (Unresolved SR Conflicts)
15314 (Solved SR Conflicts): Exercise --report=all.
15315
153162002-05-26 Akim Demaille <akim@epita.fr>
15317
15318 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15319 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
15320 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
15321 (token_number_t, item_number_as_token_number)
15322 (token_number_as_item_number, muscle_insert_token_number_table):
15323 Rename as...
15324 (symbol_number_t, item_number_as_symbol_number)
15325 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
15326 these, since it is more appropriate.
15327
153282002-05-26 Akim Demaille <akim@epita.fr>
15329
15330 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
15331 `Error:' lines.
15332 * data/bison.simple (yystos) [YYDEBUG]: New.
15333 (yyparse) [YYDEBUG]: Display the symbols which are popped during
15334 error recovery.
15335 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
15336
153372002-05-25 Akim Demaille <akim@epita.fr>
15338
15339 * doc/bison.texinfo (Debugging): Split into...
15340 (Tracing): this new section, its former contents, and...
15341 (Understanding): this new section.
15342 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
15343 by...
15344 (report_flag): this.
15345 Adjust all dependencies.
15346 (report_args, report_types, report_argmatch): New.
15347 (usage, getargs): Report/support -r, --report.
15348 * src/options.h
15349 (struct option_table_struct): Rename as..,
15350 (struct option_table_s): this.
15351 Rename the `set_flag' member to `flag' to match with getopt_long's
15352 struct.
15353 * src/options.c (option_table): Split verbose into an entry for
15354 %verbose, and another for --verbose.
15355 Support --report/-r, so remove -r from the obsolete --raw.
15356 * src/print.c: Attach full item sets and lookaheads reports to
15357 report_flag instead of trace_flag.
15358 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
15359
153602002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15361 and Paul Eggert <eggert@twinsun.com>
15362
15363 * data/bison.simple (yyparse): Correct error handling to conform to
15364 POSIX and yacc. Specifically, after syntax error is discovered,
15365 do not reduce further before shifting the error token.
15366 Clean up the code a bit by removing the labels yyerrdefault,
15367 yyerrhandle, yyerrpop.
15368 * NEWS: Document the above.
15369
153702002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15371
15372 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
15373 type; it isn't always big enough, since it doesn't necessarily
15374 include non-terminals.
15375 (yytranslate): Expand definition of yy_token_number_type, so that
15376 the latter can be removed.
15377 (yy_token_number_type): Remove, only one use.
15378 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
15379 don't use TokenNumberType as element type.
15380
15381 * tests/regression.at: Modify expected output to agree with change
15382 to yyr1 and yytranslate.
15383
153842002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
15385
15386 * src/reader.c (parse_action): Use copy_character instead of
15387 obstack_1grow.
15388
153892002-05-13 Akim Demaille <akim@epita.fr>
15390
15391 * tests/regression.at (Token definitions): Prototype yylex and
15392 yyerror.
15393
153942002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15395
15396 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
15397 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
15398 32-bit arithmetic.
15399 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
15400
154012002-05-07 Akim Demaille <akim@epita.fr>
15402
15403 * tests/synclines.at: Be sure to prototype yylex and yyerror to
15404 avoid GCC warnings.
15405
154062002-05-07 Akim Demaille <akim@epita.fr>
15407
15408 Kill GCC warnings.
15409
15410 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
15411 over the RHS of each rule.
15412 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
15413 * src/state.h (state_t): Member `nitems' is unsigned short.
15414 * src/LR0.c (get_state): Adjust.
15415 * src/reader.c (packgram): Likewise.
15416 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
15417 `Type'.
15418 (muscle_insert_int_table): Remove, unused.
15419 (prepare_rules): Remove `max'.
15420
154212002-05-06 Akim Demaille <akim@epita.fr>
15422
15423 * src/closure.c (print_firsts): Display of the symbol tags.
15424 (bitmatrix_print): Move to...
15425 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
15426 here.
15427 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
15428
154292002-05-06 Akim Demaille <akim@epita.fr>
15430
15431 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
15432 hash_do_for_each.
15433
154342002-05-06 Akim Demaille <akim@epita.fr>
15435
15436 * src/LR0.c (new_state, get_state): Instead of using the global
15437 `kernel_size' and `kernel_base', have two new arguments:
15438 `core_size' and `core'.
15439 Adjust callers.
15440
154412002-05-06 Akim Demaille <akim@epita.fr>
15442
15443 * src/reader.c (packgram): No longer end `ritem' with a 0
15444 sentinel: it is not used.
15445
154462002-05-05 Akim Demaille <akim@epita.fr>
15447
15448 New experimental feature: display the lookaheads in the report and
15449 graph.
15450
15451 * src/print (print_core): When --trace-flag, display the rules
15452 lookaheads.
15453 * src/print_graph.c (print_core): Likewise.
15454 Swap the arguments.
15455 Adjust caller.
15456
154572002-05-05 Akim Demaille <akim@epita.fr>
15458
15459 * tests/torture.at (Many lookaheads): New test.
15460
154612002-05-05 Akim Demaille <akim@epita.fr>
15462
15463 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
15464 (GENERATE_MUSCLE_INSERT_TABLE): this.
15465 (output_int_table, output_unsigned_int_table, output_short_table)
15466 (output_token_number_table, output_item_number_table): Replace with...
15467 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
15468 (muscle_insert_short_table, muscle_insert_token_number_table)
15469 (muscle_insert_item_number_table): these.
15470 Adjust all callers.
15471 (prepare_tokens): Don't free `translations', since...
15472 * src/reader.h, src/reader.c (grammar_free): do it.
15473 Move to...
15474 * src/gram.h, src/gram.c (grammar_free): here.
15475 * data/bison.simple, data/bison.c++: b4_token_number_max is now
15476 b4_translate_max.
15477
154782002-05-05 Akim Demaille <akim@epita.fr>
15479
15480 * src/output.c (output_unsigned_int_table): New.
15481 (prepare_rules): `i' is unsigned.
15482 `prhs', `rline', `r2' are unsigned int.
15483 Rename muscle `rhs_number_max' as `rhs_max'.
15484 Output muscles `prhs_max', `rline_max', and `r2_max'.
15485 Free rline and r1.
15486 * data/bison.simple, data/bison.c++: Adjust to use these muscles
15487 to compute types instead of constant types.
15488 * tests/regression.at (Web2c Actions): Adjust.
15489
154902002-05-04 Akim Demaille <akim@epita.fr>
15491
15492 * src/symtab.h (SALIAS, SUNDEF): Rename as...
15493 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
15494 Adjust dependencies.
15495 * src/output.c (token_definitions_output): Be sure not to output a
15496 `#define 'a'' when fed with `%token 'a' "a"'.
15497 * tests/regression.at (Token definitions): New.
15498
154992002-05-03 Paul Eggert <eggert@twinsun.com>
15500
15501 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
15502 for K&R C.
15503
155042002-05-03 gettextize <bug-gnu-gettext@gnu.org>
15505
15506 * Makefile.am (SUBDIRS): Remove intl.
15507 (EXTRA_DIST): Add config/config.rpath.
15508
155092002-05-03 Akim Demaille <akim@epita.fr>
15510
15511 * data/bison.simple (m4_if): Don't output empty enums.
15512 And actually, output valid enum definitions :(.
15513
155142002-05-03 Akim Demaille <akim@epita.fr>
15515
15516 * configure.bat: Remove, completely obsolete.
15517 * Makefile.am (EXTRA_DIST): Adjust.
15518 Don't distribute config.rpath...
15519 * config/Makefile.am (EXTRA_DIST): Do it.
15520
155212002-05-03 Akim Demaille <akim@epita.fr>
15522
15523 * configure.in (GETTEXT_VERSION): New.
15524 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
15525
155262002-05-03 Akim Demaille <akim@epita.fr>
15527
15528 * data/bison.simple (b4_token_enum): New.
15529 (b4_token_defines): Use it to output tokens both as #define and
15530 enums.
15531 Suggested by Paul Eggert.
15532 * src/output.c (token_definitions_output): Don't output spurious
15533 white spaces.
15534
155352002-05-03 Akim Demaille <akim@epita.fr>
15536
15537 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
15538
155392002-05-02 Robert Anisko <robert@lrde.epita.fr>
15540
15541 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
15542 Update the stack class, give a try to deque as the default container.
15543
155442002-05-02 Akim Demaille <akim@epita.fr>
15545
15546 * data/bison.simple (yyparse): Do not implement @$ = @1.
15547 (YYLLOC_DEFAULT): Adjust to do it.
15548 * doc/bison.texinfo (Location Default Action): Fix.
15549
155502002-05-02 Akim Demaille <akim@epita.fr>
15551
15552 * src/reader.c (parse_braces): Merge into...
15553 (parse_action): this.
15554
155552002-05-02 Akim Demaille <akim@epita.fr>
15556
15557 * configure.in (ALL_LINGUAS): Remove.
15558 * po/LINGUAS, hr.po: New.
15559
155602002-05-02 Akim Demaille <akim@epita.fr>
15561
15562 Remove the so called hairy (semantic) parsers.
15563
15564 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
15565 * src/gram.h, src/gram.c (semantic_parser): Remove.
15566 (rule_t): Remove the guard and guard_line members.
15567 * src/lex.h (token_t): remove tok_guard.
15568 * src/options.c (option_table): Remove %guard and %semantic_parser
15569 support.
15570 * src/output.c, src/output.h (guards_output): Remove.
15571 (prepare): Adjust.
15572 (token_definitions_output): Don't output the `T'
15573 tokens (???).
15574 (output_skeleton): Don't output the guards.
15575 * src/files.c, src/files.c (attrsfile): Remove.
15576 * src/reader.c (symbol_list): Remove the guard and guard_line
15577 members.
15578 Adjust dependencies.
15579 (parse_guard): Remove.
15580 * data/bison.hairy: Remove.
15581 * doc/bison.texinfo (Environment Variables): Remove occurrences of
15582 BISON_HAIRY.
15583
155842002-05-02 Akim Demaille <akim@epita.fr>
15585
15586 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
15587 (parse_guard): Rename the formal argument `stack_offset' as
15588 `rule_length', which is more readable.
15589 Adjust callers.
15590 (copy_at, copy_dollar): Instead of outputting the hard coded
15591 values of $$, $n and so forth, output invocation to b4_lhs_value,
15592 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
15593 Note: this patch partially drops `semantic-parser' support: it
15594 always does `rule_length - n', where semantic parsers ought to
15595 always use `-n'.
15596 * data/bison.simple, data/bison.c++ (b4_lhs_value)
15597 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
15598
155992002-05-02 Akim Demaille <akim@epita.fr>
15600
15601 * configure.in (AC_INIT): Bump to 1.49b.
15602 (AM_INIT_AUTOMAKE): Short invocation.
15603
156042002-05-02 Akim Demaille <akim@epita.fr>
15605
15606 Version 1.49a.
15607
156082002-05-01 Akim Demaille <akim@epita.fr>
15609
15610 * src/skeleton.h: Remove.
15611
156122002-05-01 Akim Demaille <akim@epita.fr>
15613
15614 * src/skeleton.h: Fix the #endif.
15615 Reported by Magnus Fromreide.
15616
156172002-04-26 Paul Eggert <eggert@twinsun.com>
15618
15619 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
15620 Define if we define YYSTYPE and YYLTYPE, respectively.
15621 (YYCOPY): Fix [] quoting problem in the non-GCC case.
15622
156232002-04-25 Robert Anisko <robert@lrde.epita.fr>
15624
15625 * src/scan-skel.l: Postprocess quadrigraphs.
15626
15627 * src/reader.c (copy_character): New function, used to output
15628 single characters while replacing `[' and `]' with quadrigraphs, to
15629 avoid troubles with M4 quotes.
15630 (copy_comment): Output characters with copy_character.
15631 (read_additionnal_code): Likewise.
15632 (copy_string2): Likewise.
15633 (copy_definition): Likewise.
15634
15635 * tests/calc.at: Exercise M4 quoting.
15636
156372002-04-25 Akim Demaille <akim@epita.fr>
15638
15639 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
15640 between `!' and the command.
15641 Reported by Paul Eggert.
15642
156432002-04-24 Robert Anisko <robert@lrde.epita.fr>
15644
15645 * tests/calc.at: Exercise prologue splitting.
15646
15647 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
15648 `b4_post_prologue' instead of `b4_prologue'.
15649
15650 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
15651 muscles.
15652 (output): Free pre_prologue_obstack and post_prologue_obstack.
15653 * src/files.h, src/files.c (attrs_obstack): Remove.
15654 (pre_prologue_obstack, post_prologue_obstack): New.
15655 * src/reader.c (copy_definition): Add a parameter to specify the
15656 obstack to fill, instead of using attrs_obstack unconditionally.
15657 (read_declarations): Pass pre_prologue_obstack to copy_definition if
15658 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
15659
156602002-04-23 Paul Eggert <eggert@twinsun.com>
15661
15662 * data/bison.simple: Remove unnecessary commentary and white
15663 space differences from 1_29-branch.
15664 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
15665
15666 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
15667 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
15668 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
15669 constructors or destructors.
15670
15671 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
15672
156732002-04-23 Akim Demaille <akim@epita.fr>
15674
15675 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
15676 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
15677 location with columns.
15678 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
15679 All reported by Paul Eggert.
15680
156812002-04-22 Akim Demaille <akim@epita.fr>
15682
15683 * src/reduce.c (dump_grammar): Move to...
15684 * src/gram.h, src/gram.c (grammar_dump): here.
15685 Be sure to separate long item numbers.
15686 Don't read the members of a rule's prec if its nil.
15687
156882002-04-22 Akim Demaille <akim@epita.fr>
15689
15690 * src/output.c (table_size, table_grow): New.
15691 (MAXTABLE): Remove, replace uses with table_size.
15692 (pack_vector): Instead of dying when the table is too big, grow it.
15693
156942002-04-22 Akim Demaille <akim@epita.fr>
15695
15696 * data/bison.simple (yyr1): Its type is that of a token number.
15697 * data/bison.c++ (r1_): Likewise.
15698 * tests/regression.at (Web2c Actions): Adjust.
15699
157002002-04-22 Akim Demaille <akim@epita.fr>
15701
15702 * src/reader.c (token_translations_init): 256 is now the default
15703 value for the error token, i.e., it will be assigned another
15704 number if the user assigned 256 to one of her tokens.
15705 (reader): Don't force 256 to error.
15706 * doc/bison.texinfo (Symbols): Adjust.
15707 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
15708 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
15709 etc. instead of 10, 20, 30 (which was used to `jump' over error
15710 (256) and undefined (2)).
15711
157122002-04-22 Akim Demaille <akim@epita.fr>
15713
15714 Propagate more token_number_t.
15715
15716 * src/gram.h (token_number_as_item_number)
15717 (item_number_as_token_number): New.
15718 * src/output.c (GENERATE_OUTPUT_TABLE): New.
15719 Use it to create output_item_number_table and
15720 output_token_number_table.
15721 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15722 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
15723 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
15724 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
15725
157262002-04-22 Akim Demaille <akim@epita.fr>
15727
15728 * src/output.h, src/output.c (get_lines_number): Remove.
15729
157302002-04-19 Akim Demaille <akim@epita.fr>
15731
15732 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
15733 as Lex/Flex'.
15734 (Debugging): More details about enabling the debugging features.
15735 (Table of Symbols): Describe $$, $n, @$, and @n.
15736 Suggested by Tim Josling.
15737
157382002-04-19 Akim Demaille <akim@epita.fr>
15739
15740 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
15741
157422002-04-10 Akim Demaille <akim@epita.fr>
15743
15744 * src/system.h: Rely on HAVE_LIMITS_H.
15745 Suggested by Paul Eggert.
15746
157472002-04-09 Akim Demaille <akim@epita.fr>
15748
15749 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
15750 full stderr, and strip it according to the bison options, instead
15751 of composing the error message from different bits.
15752 This makes it easier to check for several error messages.
15753 Adjust all the invocations.
15754 Add an invocation exercising the error token.
15755 Add an invocation demonstrating a stupid error message.
15756 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
15757 Adjust the tests.
15758 Error message are for stderr, not stdout.
15759
157602002-04-09 Akim Demaille <akim@epita.fr>
15761
15762 * src/gram.h, src/gram.c (error_token_number): Remove, use
15763 errtoken->number.
15764 * src/reader.c (reader): Don't specify the user token number (2)
15765 for $undefined, as it uselessly prevents using it.
15766 * src/gram.h (token_number_t): Move to...
15767 * src/symtab.h: here.
15768 (state_t.number): Is a token_number_t.
15769 * src/print.c, src/reader.c: Use undeftoken->number instead of
15770 hard coded 2.
15771 (Even though this 2 is not the same as above: the number of the
15772 undeftoken remains being 2, it is its user token number which
15773 might not be 2).
15774 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
15775 `user_token_number_max'.
15776 Output `undef_token_number'.
15777 * data/bison.simple, data/bison.c++: Use them.
15778 Be sure to map invalid yylex return values to
15779 `undef_token_number'. This saves us from gratuitous SEGV.
15780
15781 * tests/conflicts.at (Solved SR Conflicts)
15782 (Unresolved SR Conflicts): Adjust.
15783 * tests/regression.at (Web2c Actions): Adjust.
15784
157852002-04-08 Akim Demaille <akim@epita.fr>
15786
15787 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
15788 Adding #line.
15789 Remove the duplicate `typedefs'.
15790 (RhsNumberType): Fix the declaration and various other typos.
15791 Use __ofile__.
15792 * data/bison.simple: Use __ofile__.
15793 * src/scan-skel.l: Handle __ofile__.
15794
157952002-04-08 Akim Demaille <akim@epita.fr>
15796
15797 * src/gram.h (item_number_t): New, the type of item numbers in
15798 RITEM. Note that it must be able to code symbol numbers as
15799 positive number, and the negation of rule numbers as negative
15800 numbers.
15801 Adjust all dependencies (pretty many).
15802 * src/reduce.c (rule): Remove this `short *' pointer: use
15803 item_number_t.
15804 * src/system.h (MINSHORT, MAXSHORT): Remove.
15805 Include `limits.h'.
15806 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
15807 (shortcpy): Remove.
15808 (MAXTABLE): Move to...
15809 * src/output.c (MAXTABLE): here.
15810 (prepare_rules): Use output_int_table to output rhs.
15811 * data/bison.simple, data/bison.c++: Adjust.
15812 * tests/torture.at (Big triangle): Move the limit from 254 to
15813 500.
15814 * tests/regression.at (Web2c Actions): Ajust.
15815
15816 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
15817 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
15818 passes, but produces negative #line number, once fixed, GCC is
15819 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
15820 C), it passes.
15821 * src/state.h (state_h): Code input lines on ints, not shorts.
15822
158232002-04-08 Akim Demaille <akim@epita.fr>
15824
15825 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
15826 and then the grammar.
15827
158282002-04-08 Akim Demaille <akim@epita.fr>
15829
15830 * src/system.h: No longer using strndup.
15831
158322002-04-07 Akim Demaille <akim@epita.fr>
15833
15834 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
15835 * src/output.c (output_table_data): Return the longest number.
15836 (prepare_tokens): Output `token_number_max').
15837 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
15838 New.
15839 Use them to define yy_token_number_type/TokenNumberType.
15840 Use this type for yytranslate.
15841 * tests/torture.at (Big triangle): Push the limit from 124 to
15842 253.
15843 * tests/regression.at (Web2c Actions): Adjust.
15844
158452002-04-07 Akim Demaille <akim@epita.fr>
15846
15847 * tests/torture.at (Big triangle): New.
15848 (GNU AWK Grammar, GNU Cim Grammar): Move to...
15849 * tests/existing.at: here.
15850
158512002-04-07 Akim Demaille <akim@epita.fr>
15852
15853 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
15854 nritems.
15855 Adjust dependencies.
15856
158572002-04-07 Akim Demaille <akim@epita.fr>
15858
15859 * src/reader.c: Normalize increments to prefix form.
15860
158612002-04-07 Akim Demaille <akim@epita.fr>
15862
15863 * src/reader.c, symtab.c: Remove debugging code.
15864
158652002-04-07 Akim Demaille <akim@epita.fr>
15866
15867 Rename all the `bucket's as `symbol_t'.
15868
15869 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
15870 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
15871 * src/symtab.c, src/symtab.h (bucket): Rename as...
15872 (symbol_t): this.
15873 (symbol_list_new, bucket_check_defined, bucket_make_alias)
15874 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
15875 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
15876 (buckets_new, buckets_free, buckets_do): Rename as...
15877 (symbol_list_new, symbol_check_defined, symbol_make_alias)
15878 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
15879 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
15880 (symbols_new, symbols_free, symbols_do): these.
15881
158822002-04-07 Akim Demaille <akim@epita.fr>
15883
15884 Use lib/hash for the symbol table.
15885
15886 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
15887 EOF.
15888 * src/lex.c (lex): Set the `number' member of new terminals.
15889 * src/reader.c (bucket_check_defined, bucket_make_alias)
15890 (bucket_check_alias_consistence, bucket_translation): New.
15891 (reader, grammar_free, readgram, token_translations_init)
15892 (packsymbols): Adjust.
15893 (reader): Number the predefined tokens.
15894 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
15895 for predefined tokens.
15896 * src/symtab.h (bucket): Remove all the hash table related
15897 members.
15898 * src/symtab.c (symtab): Replace by...
15899 (bucket_table): this.
15900 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
15901 (buckets_new, buckets_do): New.
15902
159032002-04-07 Akim Demaille <akim@epita.fr>
15904
15905 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
15906 (start_symbol, max_user_token_number, semantic_parser)
15907 (error_token_number): Initialize.
15908 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
15909 Initialize.
15910 (reader): Don't.
15911 (errtoken, eoftoken, undeftoken, axiom): Extern.
15912
159132002-04-07 Akim Demaille <akim@epita.fr>
15914
15915 * src/gram.h (rule_s): prec and precsym are now pointers
15916 to the bucket giving the priority/associativity.
15917 Member `associativity' removed: useless.
15918 * src/reduce.c, src/conflicts.c: Adjust.
15919
159202002-04-07 Akim Demaille <akim@epita.fr>
15921
15922 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
15923 Properly escape the symbols' TAG when outputting them.
15924
159252002-04-07 Akim Demaille <akim@epita.fr>
15926
15927 * src/lalr.h (LA): Is a bitsetv, not bitset*.
15928
159292002-04-07 Akim Demaille <akim@epita.fr>
15930
15931 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
15932 (LArule): this, which is an array to rule_t*.
15933 * src/print.c, src/conflicts.c: Adjust.
15934
159352002-04-07 Akim Demaille <akim@epita.fr>
15936
15937 * src/gram.h (rule_t): Rename `number' as `user_number'.
15938 `number' is a new member.
15939 Adjust dependencies.
15940 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
15941
159422002-04-07 Akim Demaille <akim@epita.fr>
15943
15944 As a result of the previous patch, it is no longer needed
15945 to reorder ritem itself.
15946
15947 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
15948
159492002-04-07 Akim Demaille <akim@epita.fr>
15950
15951 Be sure never to walk through RITEMS, but use only data related to
15952 the rules themselves. RITEMS should be banished.
15953
15954 * src/output.c (output_token_translations): Rename as...
15955 (prepare_tokens): this.
15956 In addition to `translate', prepare the muscles `tname' and
15957 `toknum', which were handled by...
15958 (output_rule_data): this.
15959 Remove, and move the remainder of its outputs into...
15960 (prepare_rules): this new routines, which also merges content from
15961 (output_gram): this.
15962 (prepare_rules): Be sure never to walk through RITEMS.
15963 (output_stos): Rename as...
15964 (prepare_stos): this.
15965 (output): Always invoke prepare_states, after all, just don't use it
15966 in the output if you don't need it.
15967
159682002-04-07 Akim Demaille <akim@epita.fr>
15969
15970 * src/LR0.c (new_state): Display `nstates' as the name of the
15971 newly created state.
15972 Adjust to initialize first_state and last_state if needed.
15973 Be sure to distinguish the initial from the final state.
15974 (new_states): Create the itemset of the initial state, and use
15975 new_state.
15976 * src/closure.c (closure): Now that the initial state has its
15977 items properly set, there is no need for a special case when
15978 creating `ruleset'.
15979
15980 As a result, now the rule 0, reducing to $axiom, is visible in the
15981 outputs. Adjust the test suite.
15982
15983 * tests/conflicts.at (Solved SR Conflicts)
15984 (Unresolved SR Conflicts): Adjust.
15985 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
15986 * tests/conflicts.at (S/R in initial): New.
15987
159882002-04-07 Akim Demaille <akim@epita.fr>
15989
15990 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
15991 the RHS of the rules.
15992 * src/output.c (output_gram): Likewise.
15993
159942002-04-07 Akim Demaille <akim@epita.fr>
15995
15996 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
15997 bucket.
15998 Adjust all dependencies.
15999 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
16000 `number' of the buckets too.
16001 * src/gram.h: Include `symtab.h'.
16002 (associativity): Move to...
16003 * src/symtab.h: here.
16004 No longer include `gram.h'.
16005
160062002-04-07 Akim Demaille <akim@epita.fr>
16007
16008 * src/gram.h, src/gram.c (rules_rhs_length): New.
16009 (ritem_longest_rhs): Use it.
16010 * src/gram.h (rule_t): `number' is a new member.
16011 * src/reader.c (packgram): Set it.
16012 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
16013 the end of `rules', and count them out of `nrules'.
16014 (reduce_output, dump_grammar): Adjust.
16015 * src/print.c (print_grammar): It is no longer needed to check for
16016 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
16017 * tests/reduce.at (Reduced Automaton): New test.
16018
160192002-04-07 Akim Demaille <akim@epita.fr>
16020
16021 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
16022 lacking `+ 1' to nrules, Bison reported as useless a token if it
16023 was used solely to set the precedence of the last rule...
16024
160252002-04-07 Akim Demaille <akim@epita.fr>
16026
16027 * data/bison.c++, data/bison.simple: Don't output the current file
16028 name in #line, to avoid useless diffs between two identical
16029 outputs under different names.
16030
160312002-04-07 Akim Demaille <akim@epita.fr>
16032
16033 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
16034 Normalize loops to using `< nrules + 1', not `<= nrules'.
16035
160362002-04-07 Akim Demaille <akim@epita.fr>
16037
16038 * TODO: Update.
16039
160402002-04-07 Akim Demaille <akim@epita.fr>
16041
16042 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
16043 bucket.value as bucket.number.
16044
160452002-04-07 Akim Demaille <akim@epita.fr>
16046
16047 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
16048 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16049 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
16050 RHS, instead of being an index in RITEMS.
16051
160522002-04-04 Paul Eggert <eggert@twinsun.com>
16053
16054 * doc/bison.texinfo: Update copyright date.
16055 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
16056 (Symbols): Warn about running Bison in one character set,
16057 but compiling and/or running in an incompatible one.
16058 Warn about character code 256, too.
16059
160602002-04-03 Paul Eggert <eggert@twinsun.com>
16061
16062 * src/bison.data (YYSTACK_ALLOC): Depend on whether
16063 YYERROR_VERBOSE is nonzero, not whether it is defined.
16064
16065 Merge changes from bison-1_29-branch.
16066
160672002-03-20 Paul Eggert <eggert@twinsun.com>
16068
16069 Merge fixes from Debian bison_1.34-1.diff.
16070
16071 * configure.in (AC_PREREQ): 2.53.
16072
160732002-03-20 Akim Demaille <akim@epita.fr>
16074
16075 * src/conflicts.c (log_resolution): Argument `resolution' is const.
16076
160772002-03-19 Paul Eggert <eggert@twinsun.com>
16078
16079 * src/bison.simple (YYCOPY): New macro.
16080 (YYSTACK_RELOCATE): Use it.
16081 Remove Type arg; no longer needed. All callers changed.
16082 (yymemcpy): Remove; no longer needed.
16083
16084 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
16085 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16086
160872002-03-19 Akim Demaille <akim@epita.fr>
16088
16089 Test and fix the #line outputs.
16090
16091 * tests/atlocal.at (GCC): New.
16092 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
16093 (Prologue synch line, %union synch line, Postprologue synch line)
16094 (Action synch line, Epilogue synch line): New tests.
16095 * src/reader.c (parse_union_decl): Define the muscle stype_line.
16096 * data/bison.simple, data/bison.c++: Use it.
16097
160982002-03-19 Akim Demaille <akim@epita.fr>
16099
16100 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
16101 (Solved SR Conflicts, %expect not enough, %expect right)
16102 (%expect too much): Move to...
16103 * tests/conflicts.at: this new file.
16104
161052002-03-19 Akim Demaille <akim@epita.fr>
16106
16107 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16108 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
16109 that we can move to enums for instance.
16110 * src/output.c (token_definitions_output): Output a list of
16111 `token-name, token-number' instead of the #define.
16112 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
16113
161142002-03-14 Akim Demaille <akim@epita.fr>
16115
16116 Use Gettext 0.11.1.
16117
161182002-03-09 Robert Anisko <robert@lrde.epita.fr>
16119
16120 * data/bison.c++: Make the user able to add members to the generated
16121 parser by subclassing.
16122
161232002-03-05 Robert Anisko <robert@lrde.epita.fr>
16124
16125 * src/reader.c (read_additionnal_code): `c' should be an integer, not
16126 a character.
16127 Reported by Nicolas Tisserand and Nicolas Burrus.
16128
161292002-03-04 Robert Anisko <robert@lrde.epita.fr>
16130
16131 * src/reader.c: Warn about lacking semi-colons, do not complain.
16132
161332002-03-04 Robert Anisko <robert@lrde.epita.fr>
16134
16135 * data/bison.c++: Remove a debug line.
16136
161372002-03-04 Robert Anisko <robert@lrde.epita.fr>
16138
16139 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
16140 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
16141 provide a default implementation.
16142
161432002-03-04 Akim Demaille <akim@epita.fr>
16144
16145 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
16146 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
16147 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
16148 * tests/semantic.at (Parsing Guards): Similarly.
16149 * src/reader.at (readgram): Complain if the last rule is not ended
16150 with a semi-colon.
16151
161522002-03-04 Akim Demaille <akim@epita.fr>
16153
16154 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
16155 * src/closure.c: here.
16156 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
16157 RTC.
16158 * src/warshall.h, src/warshall.c: Remove.
16159 * tests/sets.at (Broken Closure): Adjust.
16160
161612002-03-04 Akim Demaille <akim@epita.fr>
16162
16163 * src/output.c (output_skeleton): tempdir is const.
16164 bytes_read is unused.
16165
161662002-03-04 Akim Demaille <akim@epita.fr>
16167
16168 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16169 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
16170 Update.
16171 From Michael Hayes.
16172
161732002-03-04 Akim Demaille <akim@epita.fr>
16174
16175 * src/closure.c (closure): `r' is unused.
16176
161772002-03-04 Akim Demaille <akim@epita.fr>
16178
16179 * tests/sets.at (Broken Closure): Add the ending `;'.
16180 * src/reader.at (readgram): Complain if a rule is not ended with a
16181 semi-colon.
16182
161832002-03-04 Akim Demaille <akim@epita.fr>
16184
16185 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
16186 (count_sr_conflicts): Use bitset_count.
16187 * src/reduce.c (inaccessable_symbols): Ditto.
16188 (bits_size): Remove.
16189 * src/warshall.h, src/warshall.c: Convert to bitsetv.
16190
161912002-03-04 Akim Demaille <akim@epita.fr>
16192
16193 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
16194 * src/reduce.c: Remove the `bitset_zero's following the
16195 `bitset_create's, as now it is performed by the latter.
16196
161972002-03-04 Akim Demaille <akim@epita.fr>
16198
16199 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
16200 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
16201 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
16202 latest sources from Michael.
16203
162042002-03-04 Akim Demaille <akim@epita.fr>
16205
16206 * src/output.c (output): Don't free the grammar.
16207 * src/reader.c (grammar_free): New.
16208 * src/main.c (main): Call it and don't free symtab here.
16209
162102002-03-04 Akim Demaille <akim@epita.fr>
16211
16212 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
16213 before returning.
16214 Reported by Benoit Perrot.
16215
162162002-03-04 Akim Demaille <akim@epita.fr>
16217
16218 Use bitset operations when possible, not loops over bits.
16219
16220 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
16221 bitset_or.
16222 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
16223 * src/reduce.c (useless_nonterminals): Formatting changes.
16224 * src/warshall.c (TC): Use bitset_or.
16225
162262002-03-04 Akim Demaille <akim@epita.fr>
16227
16228 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
16229 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
16230 Ditto.
16231
162322002-03-04 Akim Demaille <akim@epita.fr>
16233
16234 * src/lalr.c (F): Now a bitset*.
16235 Adjust all dependencies.
16236
162372002-03-04 Akim Demaille <akim@epita.fr>
16238
16239 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
16240 Adjust all dependencies.
16241
162422002-03-04 Akim Demaille <akim@epita.fr>
16243
16244 * src/L0.c, src/LR0.h (nstates): Be size_t.
16245 Adjust comparisons (signed vs unsigned).
16246 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
16247 bitset*.
16248 Adjust all dependencies.
16249
162502002-03-04 Akim Demaille <akim@epita.fr>
16251
16252 * src/closure.c (firsts): Now, also a bitset.
16253 Adjust all dependencies.
16254 (varsetsize): Remove, now unused.
16255 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
16256
162572002-03-04 Akim Demaille <akim@epita.fr>
16258
16259 * src/print.c: Convert to use bitset.h, not hand coded iterations
16260 over ints.
16261
162622002-03-04 Akim Demaille <akim@epita.fr>
16263
16264 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
16265
162662002-03-04 Akim Demaille <akim@epita.fr>
16267
16268 * src/closure.c (ruleset): Be a bitset.
16269 (rulesetsize): Remove.
16270
162712002-03-04 Akim Demaille <akim@epita.fr>
16272
16273 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16274 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
16275 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
16276 * src/closure.c (fderives): Be an array of bitsets.
16277
162782002-02-28 Robert Anisko <robert@lrde.epita.fr>
16279
16280 * data/bison.c++: Merge the two generated headers. Insert a copyright
16281 notice in each output file.
16282
162832002-02-28 Akim Demaille <akim@epita.fr>
16284
16285 * data/bison.c++: Copy the prologue of bison.simple to fetch
16286 useful M4 definitions, such as b4_header_guard.
16287
162882002-02-25 Akim Demaille <akim@epita.fr>
16289
16290 * src/getargs.c (version): Give the name of the authors, and use a
16291 translator friendly scheme for the bgr
16292 copyright notice.
16293
162942002-02-25 Akim Demaille <akim@epita.fr>
16295
16296 * src/output.c (header_output): Remove, now handled completely via
16297 M4.
16298
162992002-02-25 Akim Demaille <akim@epita.fr>
16300
16301 * m4/m4.m4: New, from CVS Autoconf.
16302 * configure.in: Invoke it.
16303 * src/output.c (output_skeleton): Use its result instead of the
16304 hard coded name.
16305
163062002-02-25 Akim Demaille <akim@epita.fr>
16307
16308 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
16309 Fileutils 4.1.5.
16310 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
16311 * src/output.c (output_skeleton): Use mkstemp to create a real
16312 temporary file.
16313 Move the filling of `skeleton' and its muscle to...
16314 (prepare): here.
16315 (output): Move the definition of the prologue muscle to...
16316 (prepare): here.
16317 * src/system.h (DEFAULT_TMPDIR): New.
16318
163192002-02-14 Paul Eggert <eggert@twinsun.com>
16320
16321 Remove the support for C++ namespace cleanliness; it was
16322 causing more problems than it was curing, since it didn't work
16323 properly on some nonstandard C++ compilers. This can wait
16324 for a proper C++ parser.
16325
16326 * NEWS: Document this.
16327 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
16328 of C++, as it's treated like C now.
16329 * src/bison.simple (YYSTD): Remove.
16330 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
16331 Treat C++ just like Standard C instead of trying to support
16332 namespace cleanliness.
16333
163342002-02-14 Akim Demaille <akim@epita.fr>
16335
16336 * tests/regression.at (else): Adjust to Andreas' change.
16337
163382002-02-14 Akim Demaille <akim@epita.fr>
16339
16340 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
16341
163422002-02-13 Andreas Schwab <schwab@suse.de>
16343
16344 * src/output.c (output_rule_data): Don't output NULL, it might
16345 not be defined yet.
16346
163472002-02-11 Robert Anisko <robert@lrde.epita.fr>
16348
16349 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
16350 (Copyright notice): Update.
16351
163522002-02-11 Akim Demaille <akim@epita.fr>
16353
16354 * tests/regression.at (%nonassoc and eof): Don't include
16355 nonportable headers.
16356
163572002-02-08 Robert Anisko <robert@lrde.epita.fr>
16358
16359 * data/bison.c++: Correct error recovery. Make the user able to
16360 initialize the starting location.
16361
163622002-02-07 Akim Demaille <akim@epita.fr>
16363
16364 * tests/input.at: New.
16365
163662002-02-07 Robert Anisko <robert@lrde.epita.fr>
16367
16368 * data/bison.c++: Replace some direct m4 expansions by constants. Be
16369 more consistent when naming methods and variables. Put preprocessor
16370 directives around tables only needed for debugging.
16371
163722002-02-07 Robert Anisko <robert@lrde.epita.fr>
16373
16374 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
16375 C++ parsers.
16376 (yy::b4_name::parse): Use print_.
16377
163782002-02-07 Robert Anisko <robert@lrde.epita.fr>
16379
16380 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
16381
163822002-02-07 Robert Anisko <robert@lrde.epita.fr>
16383
16384 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
16385 C++ parsers.
16386 (yy::b4_name::parse): Build verbose error messages, and use error_.
16387
163882002-02-06 Robert Anisko <robert@lrde.epita.fr>
16389
16390 * data/bison.c++: Fix m4 quoting in comments.
16391
163922002-02-06 Robert Anisko <robert@lrde.epita.fr>
16393
16394 * data/bison.c++: Adjust the parser code. Fix some muscles that were
16395 not expanded by m4.
16396
163972002-02-05 Akim Demaille <akim@epita.fr>
16398
16399 * data/bison.c++: Adjust to the M4 back end.
16400 More is certainly needed.
16401
164022002-02-05 Akim Demaille <akim@epita.fr>
16403
16404 Give a try to M4 as a back end.
16405
16406 * lib/readpipe.c: New, from wdiff.
16407 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
16408 BISON_HAIRY.
16409 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
16410 specific values. Now it is m4 that performs the lookup.
16411 * src/parse-skel.y: Remove.
16412 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
16413 * src/output.c (actions_output, guards_output)
16414 (token_definitions_output): No longer keeps track of the output
16415 line number, hence remove the second argument.
16416 (guards_output): Check against the guard member of a rule, not the
16417 action member.
16418 Adjust callers.
16419 (output_skeleton): Don't look for the skeleton location, let m4 do
16420 that.
16421 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
16422 file will be used.
16423 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
16424 (prepare): Given that for the time being changesyntax is not
16425 usable in M4, rename the muscles using `-' to `_'.
16426 Define `defines_flag', `output_parser_name' and `output_header_name'.
16427 * src/output.h (actions_output, guards_output)
16428 (token_definitions_output): Adjust prototypes.
16429 * src/scan-skel.l: Instead of scanning the skeletons, it now
16430 processes the output of m4: `__oline__' and `#output'.
16431 * data/bison.simple: Adjust to be used by M4(sugar).
16432 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
16433 to date.
16434 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
16435 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
16436 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
16437 shamelessly stolen from CVS Autoconf.
16438
164392002-02-05 Akim Demaille <akim@epita.fr>
16440
16441 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
16442 * configure.in: Check for the declarations of free and malloc.
16443 * src/muscle_tab.c: Adjust.
16444
164452002-02-05 Akim Demaille <akim@epita.fr>
16446
16447 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
16448 which have no values.
16449
164502002-02-05 Akim Demaille <akim@epita.fr>
16451
16452 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
16453 * data/: here.
16454
164552002-01-29 Paul Eggert <eggert@twinsun.com>
16456
16457 * src/bison.simple (YYSIZE_T): Do not define merely because
16458 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
16459 On some platforms, <alloca.h> does not declare YYSTD (size_t).
16460
164612002-01-27 Akim Demaille <akim@epita.fr>
16462
16463 Fix `%nonassoc and eof'.
16464
16465 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
16466 which were not properly copied! Replace
16467 memcpy (res->errs, src->errs, src->nerrs);
16468 with
16469 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
16470 !!!
16471 * tests/regression.at (%nonassoc and eof): Adjust to newest
16472 Autotest: `.' is not in the PATH.
16473
164742002-01-27 Akim Demaille <akim@epita.fr>
16475
16476 * tests/sets.at (AT_EXTRACT_SETS): New.
16477 (Nullable): Use it.
16478 (Firsts): New.
16479
164802002-01-26 Akim Demaille <akim@epita.fr>
16481
16482 * tests/actions.at, tests/calc.at, tests/headers.at,
16483 * tests/torture.at: Adjust to the newest Autotest which no longer
16484 forces `.' in the PATH.
16485
164862002-01-25 Akim Demaille <akim@epita.fr>
16487
16488 * tests/regression.at (%nonassoc and eof): New.
16489 Suggested by Robert Anisko.
16490
164912002-01-24 Akim Demaille <akim@epita.fr>
16492
16493 Bison dumps core when trying to complain about broken input files.
16494 Reported by Cris van Pelt.
16495
16496 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
16497 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
16498 into...
16499 (Invalid inputs): Strengthen: exercise parse_percent_token.
16500
165012002-01-24 Robert Anisko <robert.anisko@epita.fr>
16502
16503 * src/Makefile.am: Add bison.c++.
16504 * src/bison.c++: New skeleton.
16505
165062002-01-21 Paolo Bonzini <bonzini@gnu.org>
16507
16508 * po/it.po: New.
16509
165102002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
16511
16512 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
16513
165142002-01-20 Marc Autret <marc@gnu.org>
16515
16516 * src/files.c (compute_output_file_names): Fix
16517
165182002-01-20 Marc Autret <marc@gnu.org>
16519
16520 * tests/output.at: New test.
16521 * src/files.c (compute_base_names): Don't map extensions when
16522 the YACC flag is set, use defaults.
16523 Reported by Evgeny Stambulchik.
16524
165252002-01-20 Marc Autret <marc@gnu.org>
16526
16527 * src/system.h: Need to define __attribute__ away for non-GCC
16528 compilers as well (i.e., the vendor C compiler).
16529 Suggested by Albert Chin-A-Young.
16530
165312002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
16532
16533 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
16534 canonical definition.
16535 * src/system.h: Use the canonical definition for PARAMS (avoids
16536 a conflict with the macro from lib/hash.h).
16537
165382002-01-11 Akim Demaille <akim@epita.fr>
16539
16540 * configure.in: Use AC_FUNC_STRNLEN.
16541 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
16542
165432002-01-09 Akim Demaille <akim@epita.fr>
16544
16545 * src/files.c, src/files.h (output_infix): New.
16546 (tab_extension): Remove.
16547 (compute_base_names): Compute the former, drop the latter.
16548 * src/output.c (prepare): Insert the muscles `output-infix', and
16549 `output-suffix'.
16550 * src/parse-skel.y (string, string.1): New.
16551 (section.header): Use it.
16552 (section.yacc): Remove.
16553 (prefix): Remove too.
16554 * src/scan-skel.l: Adjust.
16555 * src/bison.simple, src/bison.hairy: Adjust.
16556
165572002-01-09 Akim Demaille <akim@epita.fr>
16558
16559 * configure.in (WERROR_CFLAGS): Compute it.
16560 * src/Makefile.am (CFLAGS): Pass it.
16561 * tests/atlocal.in (CFLAGS): Idem.
16562 * src/files.c: Fix a few warnings.
16563 (get_extension_index): Remove, unused.
16564
165652002-01-08 Akim Demaille <akim@epita.fr>
16566
16567 * src/getargs.c (AS_FILE_NAME): New.
16568 (getargs): Use it to convert DOSish file names.
16569 * src/files.c (base_name): Rename as full_base_name to avoid
16570 clashes with `base_name ()'.
16571 (filename_split): New.
16572 (compute_base_names): N-th rewrite, using filename_split.
16573
165742002-01-08 Akim Demaille <akim@epita.fr>
16575
16576 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
16577 New, stolen from the Fileutils 4.1.
16578 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16579 * configure.in: Check for the presence of memrchr, and of its
16580 prototype.
16581
165822002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
16583
16584 * lib/hash.h (__P): Added definition for this macro.
16585 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
16586 BUILT_SOURCES, to ensure they are generated first.
16587 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
16588 %error-verbose to allow bootstrapping with bison 1.30x.
16589
165902002-01-06 Akim Demaille <akim@epita.fr>
16591
16592 * src/reader.c (parse_braces): Don't fetch the next char, the
16593 convention is to fetch on entry.
16594 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
16595 'switch' without a following semicolon.
16596 * tests/regression.at (braces parsing): New.
16597
165982002-01-06 Akim Demaille <akim@epita.fr>
16599
16600 Bison is dead wrong in its RR conflict reports.
16601
16602 * tests/torture.at (GNU Cim Grammar): New.
16603 * src/conflicts.c (count_rr_conflicts): Fix.
16604
166052002-01-06 Akim Demaille <akim@epita.fr>
16606
16607 Creating package.m4 from configure.ac causes too many problems.
16608
16609 * tests/Makefile.am (package.m4): Create it by hand,
16610 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
16611
166122002-01-06 Akim Demaille <akim@epita.fr>
16613
16614 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
16615 skeleton.h.
16616
166172002-01-04 Paul Eggert <eggert@twinsun.com>
16618
16619 * doc/bison.texinfo (Debugging):
16620 Remove YYSTDERR; it's no longer defined or used.
16621 Also, s/cstdio.h/cstdio/.
16622
166232002-01-03 Akim Demaille <akim@epita.fr>
16624
16625 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
16626
166272002-01-03 Akim Demaille <akim@epita.fr>
16628
16629 * src/parse-skel.y (process_skeleton): Don't bind the parser's
16630 tracing code to --trace, wait for a better --trace option, with
16631 args.
16632
166332002-01-03 Akim Demaille <akim@epita.fr>
16634
16635 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
16636 The ISO C++ standard is extremely clear about it: stderr is
16637 considered a macro, not a regular symbol (see table 94 `Header
16638 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
16639 Therefore std:: does not apply to it. It still does with fprintf.
16640 Also, s/cstdio.h/cstdio/.
16641
166422002-01-03 Akim Demaille <akim@epita.fr>
16643
16644 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
16645 for non system headers.
16646
166472002-01-02 Akim Demaille <akim@epita.fr>
16648
16649 Equip the skeleton chain with location tracking, runtime trace,
16650 pure parser and scanner.
16651
16652 * src/parse-skel.y: Request a pure parser, locations, and prefix
16653 renaming.
16654 (%union): Having several members with the same type does not help
16655 type mismatches, simplify.
16656 (YYPRINT, yyprint): New.
16657 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
16658 (skel_error): this.
16659 Handle locations.
16660 * src/scan-skel.l: Adjust to these changes.
16661 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
16662 (LOCATION_PRINT, skel_control_t): New.
16663
166642001-12-30 Akim Demaille <akim@epita.fr>
16665
16666 * src/parse-skel.y: Get rid of the shift/reduce conflict:
16667 replace `gb' with BLANKS.
16668 * src/scan-skel.l: Adjust.
16669
166702001-12-30 Akim Demaille <akim@epita.fr>
16671
16672 * src/system.h: We don't need nor want bcopy.
16673 Throw away MS-DOS crap: we don't need getpid.
16674 * configure.in: We don't need strndup. It was even causing
16675 problems: because Flex includes the headers *before* us,
16676 _GNU_SOURCE is not defined by config.h, and therefore strndup was
16677 not visible.
16678 * lib/xstrndup.c: New.
16679 * src/scan-skel.l: Use it.
16680 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
16681 * src/parse-skel.y: Use %directives instead of #defines.
16682
166832001-12-30 Akim Demaille <akim@epita.fr>
16684
16685 * src/skeleton.h: New.
16686 * src/output.c (output_parser, output_master_parser): Remove, dead
16687 code.
16688 * src/output.h (get_lines_number, actions_output, guards_output)
16689 (token_definitions_output): Prototype them.
16690 * src/parse-skel.y: Add the license notice.
16691 Include output.h and skeleton.h.
16692 (process_skeleton): Returns void, and takes a single parameter.
16693 * src/scan-skel.l: Add the license notice.
16694 Include skeleton.h.
16695 Don't use %option yylineno: it seems that then Flex imagines
16696 REJECT has been used, and therefore it won't reallocate its
16697 buffers (which makes no other sense to me than a bug). It results
16698 in warnings for `unused: yy_flex_realloc'.
16699
167002001-12-30 Robert Anisko <robert.anisko@epita.fr>
16701
16702 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
16703 (MUSCLE_INSERT_PREFIX): ...to there.
16704 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
16705 (MUSCLE_INSERT_PREFIX): Move from here...
16706
16707 * src/bison.hairy: Add a section directive. Put braces around muscle
16708 names. This parser skeleton is still broken, but Bison should not
16709 choke on a bad muscle 'syntax'.
16710 * src/bison.simple: Add a section directive. Put braces around muscle
16711 names.
16712
16713 * src/files.h (strsuffix, stringappend): Add declarations.
16714 (tab_extension): Add declaration.
16715 (short_base_name): Add declaration.
16716
16717 * src/files.c (strsuffix, stringappend): No longer static. These
16718 functions are used in the skeleton parser.
16719 (tab_extension): New.
16720 (compute_base_names): Use the computations done in this function
16721 to guess if the generated parsers should have '.tab' in their
16722 names.
16723 (short_base_name): No longer static.
16724
16725 * src/output.c (output_skeleton): New.
16726 (output): Disable call to output_master_parser, and give a try to
16727 a new skeleton handling system.
16728 (guards_output, actions_output): No longer static.
16729 (token_definitions_output, get_lines_number): No longer static.
16730
16731 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
16732
16733 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
16734 parse-skel.y.
16735
16736 * src/parse-skel.y: New file.
16737 * src/scan-skel.l: New file.
16738
167392001-12-29 Akim Demaille <akim@epita.fr>
16740
16741 %name-prefix is broken.
16742
16743 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
16744 Adjust all dependencies.
16745 * tests/headers.at (export YYLTYPE): Strengthen this test: use
16746 %name-prefix.
16747
16748 Renaming yylval but not yylloc is not consistent. Now we do.
16749
16750 * src/bison.simple: Prefix yylloc if used.
16751 * doc/bison.texinfo (Decl Summary): Document that.
16752
167532001-12-29 Akim Demaille <akim@epita.fr>
16754
16755 * doc/bison.texinfo: Promote `%long-directive' over
16756 `%long_directive'.
16757 Remove all references to fixed-output-files, yacc is enough.
16758
167592001-12-29 Akim Demaille <akim@epita.fr>
16760
16761 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
16762 user prologue. These are defaults.
16763 * tests/actions.at (Mid-rule actions): Make sure the user can
16764 define YYDEBUG and YYERROR_VERBOSE.
16765
167662001-12-29 Akim Demaille <akim@epita.fr>
16767
16768 * src/output.c (header_output): Don't forget to export YYLTYPE and
16769 yylloc.
16770 * tests/headers.at (export YYLTYPE): New, make sure it does.
16771 * tests/regression.at (%union and --defines, Invalid CPP headers):
16772 Move to...
16773 * tests/headers.at: here.
16774
167752001-12-29 Akim Demaille <akim@epita.fr>
16776
16777 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
16778
167792001-12-29 Akim Demaille <akim@epita.fr>
16780
16781 * tests/actions.at (Mid-rule actions): Output on a single line
16782 instead of several.
16783
167842001-12-29 Akim Demaille <akim@epita.fr>
16785
16786 * doc/bison.texinfo: Formatting changes.
16787
167882001-12-29 Akim Demaille <akim@epita.fr>
16789
16790 Don't store the token defs in a muscle, just be ready to output it
16791 on command. Now possible via `symbols'. Fixes a memory leak.
16792
16793 * src/output.c (token_definitions_output): New.
16794 (output_parser, header_output): Use it.
16795 * src/reader.c (symbols_save): Remove.
16796
167972001-12-29 Akim Demaille <akim@epita.fr>
16798
16799 * src/bison.simple: Do not provide a default for YYSTYPE and
16800 YYLTYPE before the user's prologue. Otherwise it's hardly... a
16801 default.
16802
168032001-12-29 Akim Demaille <akim@epita.fr>
16804
16805 Mid-rule actions are simply... ignored!
16806
16807 * src/reader.c (readgram): Be sure to attach mid-rule actions to
16808 the empty-rule associated to the dummy symbol, not to the host
16809 rule.
16810 * tests/actions.at (Mid-rule actions): New.
16811
168122001-12-29 Akim Demaille <akim@epita.fr>
16813
16814 Memory leak.
16815
16816 * src/reader.c (reader): Free grammar.
16817
168182001-12-29 Akim Demaille <akim@epita.fr>
16819
16820 Memory leak.
16821
16822 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
16823 since it allocates it for each state, although only one is needed.
16824 (allocate_storage): Do it here.
16825
168262001-12-29 Akim Demaille <akim@epita.fr>
16827
16828 * src/options.h, src/options.c (create_long_option_table): Rename
16829 as...
16830 (long_option_table_new): this, with a clearer prototype.
16831 (percent_table): Remove, unused,
16832 * src/getargs.c (getargs): Adjust.
16833
168342001-12-29 Akim Demaille <akim@epita.fr>
16835
16836 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
16837 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
16838 as states.
16839
168402001-12-29 Akim Demaille <akim@epita.fr>
16841
16842 * src/lalr.c (build_relations): Rename `states' as `states1'.
16843 Sorry, I don't understand exactly what it is, no better name...
16844
168452001-12-29 Akim Demaille <akim@epita.fr>
16846
16847 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
16848 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
16849 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
16850 as rules.
16851
168522001-12-29 Akim Demaille <akim@epita.fr>
16853
16854 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
16855 ago.
16856
168572001-12-29 Akim Demaille <akim@epita.fr>
16858
16859 * src/reader.c, src/reader.h (user_toknums): Remove.
16860 Adjust all users to use symbols[i]->user_token_number.
16861
168622001-12-29 Akim Demaille <akim@epita.fr>
16863
16864 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
16865 Adjust all users to use symbols[i]->prec or ->assoc.
16866
168672001-12-29 Akim Demaille <akim@epita.fr>
16868
16869 * src/reader.c, src/reader.h (tags): Remove.
16870 Adjust all users to use symbols[i]->tag.
16871
168722001-12-29 Akim Demaille <akim@epita.fr>
16873
16874 * src/gram.h, src/gram.c (symbols): New, similar to state_table
16875 and rule_table.
16876 * src/reader.c (packsymbols): Fill this table.
16877 Drop sprec.
16878 * src/conflicts.c (resolve_sr_conflict): Adjust.
16879 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
16880 single table.
16881 Use symbols[i]->tag instead of tags[i].
16882
168832001-12-29 Akim Demaille <akim@epita.fr>
16884
16885 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
16886 In addition, put a comment in there, to replace...
16887 * tests/regression.at (%union and C comments): Remove.
16888
168892001-12-29 Akim Demaille <akim@epita.fr>
16890
16891 * tests/regression.at (Web2c Actions): Blindly move the actual
16892 output as expected output. The contents *seem* right to me, but I
16893 can't pretend reading perfectly parser tables... Nonetheless, all
16894 the other tests pass correctly, the table look OK, even though the
16895 presence of `$axiom' is to be noted: AFAICS it is useless (but
16896 harmless).
16897
168982001-12-29 Akim Demaille <akim@epita.fr>
16899
16900 * src/reader.c (readgram): Don't add the rule 0 if there were no
16901 rules read. In other words, add it _after_ having performed
16902 grammar sanity checks.
16903 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
16904
169052001-12-29 Akim Demaille <akim@epita.fr>
16906
16907 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
16908 visible, and some states have now a different number.
16909
169102001-12-29 Akim Demaille <akim@epita.fr>
16911
16912 * src/reader.c (readgram): Bind the initial rule's lineno to that
16913 of the first rule.
16914 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
16915 (Solved SR Conflicts): Adjust rule 0's line number.
16916
169172001-12-29 Akim Demaille <akim@epita.fr>
16918
16919 Fix the `GAWK Grammar' failure.
16920
16921 * src/LR0.c (final_state): Initialize to -1 so that we do compute
16922 the reductions of the first state which was mistakenly confused
16923 with the final state because precisely final_state was initialized
16924 to 0.
16925 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
16926 now noticed by Bison.
16927 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
16928 have a reduction on $default.
16929
169302001-12-29 Akim Demaille <akim@epita.fr>
16931
16932 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
16933 rule line numbers.
16934 * src/closure.c (print_closure): Likewise.
16935 * src/derives.c (print_derives): Likewise.
16936 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
16937 now.
16938
169392001-12-29 Akim Demaille <akim@epita.fr>
16940
16941 * src/lalr.c (lookaheads_print): New.
16942 (lalr): Call it when --trace-flag.
16943 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
16944 are dumped.
16945
169462001-12-29 Akim Demaille <akim@epita.fr>
16947
16948 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
16949 when walking through ritem, even via rule->rhs.
16950 * src/reduce.c (dump_grammar, useful_production, reduce_output)
16951 (useful_production, useless_nonterminals): Likewise.
16952 (reduce_grammar_tables): Likewise, plus update nritems.
16953 * src/nullable.c (set_nullable): Likewise.
16954 * src/lalr.c (build_relations): Likewise.
16955 * tests/sets.at (Nullable): Adjust.
16956 Fortunately, now, the $axiom is no longer nullable.
16957
169582001-12-29 Akim Demaille <akim@epita.fr>
16959
16960 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
16961 the 0-sentinel.
16962 * src/gram.c (ritem_longest_rhs): Likewise.
16963 * src/reduce.c (nonterminals_reduce): Likewise.
16964 * src/print_graph.c (print_graph): Likewise.
16965 * src/output.c (output_rule_data): Likewise.
16966 * src/nullable.c (set_nullable): Likewise.
16967
169682001-12-29 Akim Demaille <akim@epita.fr>
16969
16970 * src/output.c: Comment changes.
16971
169722001-12-27 Paul Eggert <eggert@twinsun.com>
16973
16974 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
16975 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
16976 Sparc, as they were causing more porting problems than the
16977 (minor) performance improvement was worth.
16978
16979 Also, catch up with 1.31's YYSTD.
16980
169812001-12-27 Akim Demaille <akim@epita.fr>
16982
16983 * src/output.c (output_gram): Rely on nritems, not the
16984 0-sentinel. See below.
16985 Use -1 as separator, not 0.
16986 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
16987 Rely on -1 as separator in yyrhs, instead of 0.
16988 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
16989 twice `Now at end of input', therefore there are two lines less to
16990 expect.
16991
169922001-12-27 Akim Demaille <akim@epita.fr>
16993
16994 * tests/regression.at (Unresolved SR Conflicts):
16995 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
16996 below.
16997
169982001-12-27 Akim Demaille <akim@epita.fr>
16999
17000 * src/LR0.c (new_state): Recognize the final state by the fact it
17001 is reached by eoftoken.
17002 (insert_start_shifting_state, insert_eof_shifting_state)
17003 (insert_accepting_state, augment_automaton): Remove, since now
17004 these states are automatically computed from the initial state.
17005 (generate_states): Adjust.
17006 * src/print.c: When reporting a rule number to the user, substract
17007 1, so that the axiom rule is rule 0, and the first user rule is 1.
17008 * src/reduce.c: Likewise.
17009 * src/print_graph.c (print_core): For the time being, just as for
17010 the report, depend upon --trace-flags to dump the full set of
17011 items.
17012 * src/reader.c (readgram): Once the grammar read, insert the rule
17013 0: `$axiom: START-SYMBOL $'.
17014 * tests/set.at: Adjust: rule 0 is now displayed, and since the
17015 number of the states has changed (the final state is no longer
17016 necessarily the last), catch up.
17017
170182001-12-27 Akim Demaille <akim@epita.fr>
17019
17020 Try to make the use of the eoftoken valid. Given that its value
17021 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
17022 is used instead of > 0 where appropriate, (ii), depend upon nritems
17023 instead of the 0-sentinel.
17024
17025 * src/gram.h, src/gram.c (nritems): New.
17026 Expected to be duplication of nitems, but for the time being...
17027 * src/reader.c (packgram): Assert nritems and nitems are equal.
17028 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
17029 * src/closure.c (print_closure, print_fderives): Likewise.
17030 * src/gram.c (ritem_print): Likewise.
17031 * src/print.c (print_core, print_grammar): Likewise.
17032 * src/print_graph.c: Likewise.
17033
170342001-12-27 Akim Demaille <akim@epita.fr>
17035
17036 * src/main.c (main): If there are complains after grammar
17037 reductions, then output the report anyway if requested, then die.
17038 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
17039 * src/reader.c (eoftoken): New.
17040 (parse_token_decl): If the token being defined has value `0', it
17041 is the eoftoken.
17042 (packsymbols): No longer hack `tags' to insert `$' by hand.
17043 Be sure to preserve the value of the eoftoken.
17044 (reader): Make sure eoftoken is defined.
17045 Initialize nsyms to 0: now eoftoken is created just like the others.
17046 * src/print.c (print_grammar): Don't special case the eof token.
17047 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
17048 lie anyway, albeit pleasant.
17049 * tests/calc.at: Exercise error messages with eoftoken.
17050 Change the grammar so that empty input is invalid.
17051 Adjust expectations.
17052 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
17053
170542001-12-27 Akim Demaille <akim@epita.fr>
17055
17056 * configure.in: Check the protos of strchr ans strspn.
17057 Replace strchr if needed.
17058 * src/system.h: Provide the protos of strchr, strspn and memchr if
17059 missing.
17060 * lib/strchr.c: New.
17061 * src/reader.c (symbols_save): Use strchr.
17062
170632001-12-27 Akim Demaille <akim@epita.fr>
17064
17065 * src/print.c, src/print_graph.c (escape): New.
17066 Use it to quote the TAGS outputs.
17067 * src/print_graph.c (print_state): Now errors are in red, and
17068 reductions in green.
17069 Prefer high to wide: output the state number on a line of its own.
17070
170712001-12-27 Akim Demaille <akim@epita.fr>
17072
17073 * src/state.h, src/state.c (reductions_new): New.
17074 * src/LR0.c (set_state_table): Let all the states have a
17075 `reductions', even if reduced to 0.
17076 (save_reductions): Adjust.
17077 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
17078 * src/print.c (print_reductions, print_actions): Adjust.
17079 * src/output.c (action_row): Adjust.
17080
170812001-12-27 Akim Demaille <akim@epita.fr>
17082
17083 * src/state.h, src/state.c (errs_new, errs_dup): New.
17084 * src/LR0.c (set_state_table): Let all the states have an errs,
17085 even if reduced to 0.
17086 * src/print.c (print_errs, print_reductions): Adjust.
17087 * src/output.c (output_actions, action_row): Adjust.
17088 * src/conflicts.c (resolve_sr_conflict): Adjust.
17089
170902001-12-27 Akim Demaille <akim@epita.fr>
17091
17092 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
17093
170942001-12-27 Akim Demaille <akim@epita.fr>
17095
17096 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
17097 * src/print.c: here.
17098 (lookaheadset, shiftset): New, used as additional storage by
17099 print_reductions.
17100 (print_results): Adjust.
17101 (print_shifts, print_gotos, print_errs): New, extracted from...
17102 (print_actions): here.
17103 * src/print_graph.c (print_actions): Remove dead code.
17104
171052001-12-27 Akim Demaille <akim@epita.fr>
17106
17107 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
17108 `$n' and `@n'.
17109
171102001-12-27 Akim Demaille <akim@epita.fr>
17111
17112 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
17113 (build_relations): Adjust.
17114
171152001-12-27 Akim Demaille <akim@epita.fr>
17116
17117 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
17118 duplication.
17119
171202001-12-27 Akim Demaille <akim@epita.fr>
17121
17122 * src/reader.c (packgram): Catch nitems overflows.
17123
171242001-12-27 Akim Demaille <akim@epita.fr>
17125
17126 * src/files.c, src/files.h (guard_obstack): Remove.
17127 * src/output.c (output): Adjust.
17128 * src/reader.c (parse_braces): New, factoring...
17129 (copy_action, copy_guard): these two which are renamed as...
17130 (parse_action, parse_guard): these.
17131 As a voluntary consequence, using braces around guards is now
17132 mandatory.
17133
171342001-12-27 Akim Demaille <akim@epita.fr>
17135
17136 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
17137 * src/reader.c (symbol_list): `guard' and `guard_line' are new
17138 members.
17139 (symbol_list_new): Adjust.
17140 (copy_action): action_line is the first line, not the last.
17141 (copy_guard): Just as for actions, store the `action' only, not
17142 the switch/case/break flesh.
17143 Don't parse the user action that might follow the guard, let...
17144 (readgram): do it, i.e., now, there can be an action after a
17145 guard.
17146 In other words the guard is just explicitly optional.
17147 (packgram): Adjust.
17148 * src/output.c (guards_output): New.
17149 (output_parser): Call it when needed.
17150 (output): Also free the guard and attrs obstacks.
17151 * src/files.c, src/files.h (obstack_save): Remove.
17152 (output_files): Remove.
17153 As a result, if one needs the former `.act' file, using an
17154 appropriate skeleton which requires actions and guards is now
17155 required.
17156 * src/main.c (main): Adjust.
17157 * tests/semantic.at: New.
17158 * tests/regression.at: Use `input.y' as input file name.
17159 Avoid 8+3 problems by requiring input.c when the test needs the
17160 parser.
17161
171622001-12-27 Akim Demaille <akim@epita.fr>
17163
17164 * src/reader.c (symbol_list_new): Be sure to initialize all the
17165 fields.
17166
171672001-12-27 Akim Demaille <akim@epita.fr>
17168
17169 All the hacks using a final pseudo state are now useless.
17170
17171 * src/LR0.c (set_state_table): state_table holds exactly nstates.
17172 * src/lalr.c (nLA): New.
17173 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
17174 instead of lookaheadsp from the pseudo state (nstate + 1).
17175
171762001-12-27 Akim Demaille <akim@epita.fr>
17177
17178 * src/output.c (action_row, token_actions): Use a state_t instead
17179 of a integer, and nlookaheads instead of the following state's
17180 lookaheadsp.
17181
171822001-12-27 Akim Demaille <akim@epita.fr>
17183
17184 * src/conflicts.c (log_resolution, flush_shift)
17185 (resolve_sr_conflict, set_conflicts, solve_conflicts)
17186 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
17187 (conflicts_print, print_reductions): Use a state_t instead of an
17188 integer when referring to a state.
17189 As much as possible, depend upon nlookaheads, instead of the
17190 `lookaheadsp' member of the following state (since lookaheads of
17191 successive states are successive, the difference between state n + 1
17192 and n served as the number of lookaheads for state n).
17193 * src/lalr.c (add_lookback_edge): Likewise.
17194 * src/print.c (print_core, print_actions, print_state)
17195 (print_results): Likewise.
17196 * src/print_graph.c (print_core, print_actions, print_state)
17197 (print_graph): Likewise.
17198 * src/conflicts.h: Adjust.
17199
172002001-12-27 Akim Demaille <akim@epita.fr>
17201
17202 * src/bison.hairy: Formatting/comment changes.
17203 ANSIfy.
17204 Remove `register' indications.
17205 Add plenty of `static'.
17206
172072001-12-27 Akim Demaille <akim@epita.fr>
17208
17209 * src/output.c (prepare): Drop the muscle `ntbase' which
17210 duplicates ntokens.
17211 * src/bison.simple: Formatting/comment changes.
17212 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
17213 is an undocumented synonym.
17214
172152001-12-22 Akim Demaille <akim@epita.fr>
17216
17217 * src/output.c (output_table_data): Change the prototype to use
17218 `int' for array ranges: some invocations do pass an int, not a
17219 short.
17220 Reported by Wayne Green.
17221
172222001-12-22 Akim Demaille <akim@epita.fr>
17223
17224 Some actions of web2c.y are improperly triggered.
17225 Reported by Mike Castle.
17226
17227 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
17228 * tests/regression.at (Web2c): Rename as...
17229 (Web2c Report): this.
17230 (Web2c Actions): New.
17231
172322001-12-22 Akim Demaille <akim@epita.fr>
17233
17234 Reductions in web2c.y are improperly reported.
17235 Reported by Mike Castle.
17236
17237 * src/conflicts.c (print_reductions): Fix.
17238 * tests/regression.at (Web2c): New.
17239
172402001-12-18 Akim Demaille <akim@epita.fr>
17241
17242 Some host fail on `assert (!"foo")', which expands to
17243 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
17244 Reported by Nelson Beebee.
17245
17246 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
17247 `#define it_succeeded 0' and `assert (it_succeeded)'.
17248
172492001-12-17 Marc Autret <autret_m@epita.fr>
17250
17251 * src/bison.simple: Don't hard code the skeleton line and filename.
17252 * src/output.c (output_parser): Rename 'line' as 'output_line'.
17253 New line counter 'skeleton_line' (skeleton-line muscle).
17254
172552001-12-17 Paul Eggert <eggert@twinsun.com>
17256
17257 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
17258 YYDEBUG must be defined to a nonzero value.
17259
17260 * src/bison.simple (yytname): Do not assume that the user defines
17261 YYDEBUG to a properly parenthesized expression.
17262
172632001-12-17 Akim Demaille <akim@epita.fr>
17264
17265 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
17266 nlookaheads is a new member.
17267 Adjust all users.
17268 * src/lalr.h (nlookaheads): Remove this orphan declaration.
17269 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
17270 state.
17271
172722001-12-17 Akim Demaille <akim@epita.fr>
17273
17274 * src/files.h, src/files.c (open_files, close_files): Remove.
17275 * src/main.c (main): Don't open/close files, nor invoke lex_free,
17276 let...
17277 * src/reader.c (reader): Do it.
17278
172792001-12-17 Akim Demaille <akim@epita.fr>
17280
17281 * src/conflicts.c (print_reductions): Formatting changes.
17282
172832001-12-17 Akim Demaille <akim@epita.fr>
17284
17285 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
17286 (flush_reduce): New.
17287 (resolve_sr_conflict): Adjust.
17288
172892001-12-17 Akim Demaille <akim@epita.fr>
17290
17291 * src/output.c (output_obstack): Be static and rename as...
17292 (format_obstack): this, to avoid any confusion with files.c's
17293 output_obstack.
17294 * src/reader.h (muscle_obstack): Move to...
17295 * src/output.h: here, since it's defined in output.c.
17296
172972001-12-17 Akim Demaille <akim@epita.fr>
17298
17299 * src/output.c (action_row, save_column, default_goto)
17300 (sort_actions, matching_state, pack_vector): Better variable
17301 locality.
17302
173032001-12-17 Akim Demaille <akim@epita.fr>
17304
17305 * src/output.c: Various formatting changes.
17306
173072001-12-17 Akim Demaille <akim@epita.fr>
17308
17309 * src/files.c (output_files): Free the output_obstack.
17310 * src/main.c (main): Call print and print_graph conditionally.
17311 * src/print.c (print): Work unconditionally.
17312 * src/print_graph.c (print_graph): Work unconditionally.
17313 * src/conflicts.c (log_resolution): Output only if verbose_flag.
17314
173152001-12-16 Marc Autret <autret_m@epita.fr>
17316
17317 * src/output.c (actions_output): Fix. When we use %no-lines,
17318 there is one less line per action.
17319
173202001-12-16 Marc Autret <autret_m@epita.fr>
17321
17322 * src/bison.simple: Remove a useless #line directive.
17323 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
17324 * src/output.c (get_lines_number): New.
17325 (output_parser): Adjust, now takes care about the lines of a
17326 output muscles.
17327 Fix line numbering.
17328 (actions_output): Computes the number of lines taken by actions.
17329 (output_master_parser): Insert new skeleton which is the name of
17330 the output parser file name.
17331
173322001-12-15 Marc Autret <autret_m@epita.fr>
17333
17334 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
17335
173362001-12-15 Marc Autret <autret_m@epita.fr>
17337
17338 * src/output.c (output_gram): Keep track of the hairy one.
17339
173402001-12-15 Akim Demaille <akim@epita.fr>
17341
17342 Make `make distcheck' work.
17343
17344 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
17345 system.h which uses libgettext.h.
17346
173472001-12-15 Akim Demaille <akim@epita.fr>
17348
17349 * src/nullable.c (set_nullable): Useless rules must be skipped,
17350 otherwise, since we range over their symbols, we might look at a
17351 nonterminal which no longer ``exists'', i.e., it is not counted in
17352 `nvars', hence we overflow our arrays.
17353
173542001-12-15 Akim Demaille <akim@epita.fr>
17355
17356 The header can also be produced directly, without any obstack!
17357 Yahoo!
17358
17359 * src/files.c, src/files.h (defines_obstack): Remove.
17360 (compute_header_macro): Global.
17361 (defines_obstack_save): Remove.
17362 * src/reader.c (parse_union_decl): No longer output to
17363 defines_obstack: its content can be found in the `stype' muscle
17364 anyway.
17365 (output_token_translations): Merge into...
17366 (symbols_output): this.
17367 Rename as...
17368 (symbols_save): this.
17369 (reader): Adjust.
17370 * src/output.c (header_output): New.
17371 (output): Call it.
17372
173732001-12-15 Akim Demaille <akim@epita.fr>
17374
17375 * src/reader.c (parse_union_decl): Instead of handling two obstack
17376 simultaneously, use one to define the `stype' muscle, and use the
17377 value of the latter to fill defines_obstack.
17378 (copy_comment): Remove.
17379 (copy_comment2): Work for a single obstack.
17380 Rename as...
17381 (copy_comment): this.
17382
173832001-12-15 Akim Demaille <akim@epita.fr>
17384
17385 * src/lex.c, src/lex.h (xgetc): No longer static.
17386 * src/reader.c (parse_union_decl): Revamp.
17387
173882001-12-15 Akim Demaille <akim@epita.fr>
17389
17390 Still making progress in separating Bison into (i) input, (ii)
17391 process, (iii) output: now we can directly output the parser file
17392 without using table_obstack at all.
17393
17394 * src/files.c, src/files.h (table_obstack): Bye bye.
17395 (parser_file_name): New.
17396 * src/files.c (compute_output_file_names): Compute it.
17397 * src/output.c (actions_output, output_parser)
17398 (output_master_parser): To a file instead of an obstack.
17399
174002001-12-15 Akim Demaille <akim@epita.fr>
17401
17402 Attach actions to rules, instead of pre-outputting them to
17403 actions_obstack.
17404
17405 * src/gram.h (rule_t): action and action_line are new members.
17406 * src/reader.c (symbol_list): Likewise.
17407 (copy_action): Save the actions within the rule.
17408 (packgram): Save them in rule_table.
17409 * src/output.c (actions_output): New.
17410 (output_parser): Use it on `%%actions'.
17411 (output_rule_data): Don't free rule_table.
17412 (output): Do it.
17413 (prepare): Don't save the `action' muscle.
17414 * src/bison.simple: s/%%action/%%actions/.
17415
174162001-12-15 Akim Demaille <akim@epita.fr>
17417
17418 * src/reader.c (copy_action): When --yacc, don't append a `;'
17419 to the user action: let it fail if lacking.
17420 Suggested by Arnold Robbins and Tom Tromey.
17421
174222001-12-14 Akim Demaille <akim@epita.fr>
17423
17424 * src/lex.c (literalchar): Simply return the char you decoded, non
17425 longer mess around with obstacks and int pointers.
17426 Adjust all callers.
17427
174282001-12-14 Akim Demaille <akim@epita.fr>
17429
17430 * src/lex.c (literalchar): Don't escape the special characters,
17431 just decode them, and keep them as char (before, eol was output as
17432 the 2 char string `\n' etc.).
17433 * src/output.c (output_rule_data): Use quotearg to output the
17434 token strings.
17435
174362001-12-13 Paul Eggert <eggert@twinsun.com>
17437
17438 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
17439 Do not infringe on the global user namespace when using C++.
17440 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
17441 All uses of `fprintf' and `stderr' changed.
17442
17443 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
17444
174452001-12-13 Akim Demaille <akim@epita.fr>
17446
17447 The computation of nullable is broken: it doesn't handle empty
17448 RHS's properly.
17449
17450 * tests/torture.at (GNU AWK Grammar): New.
17451 * tests/sets.at (Nullable): New.
17452 * src/nullable.c (set_nullable): Instead of blindly looping over
17453 `ritems', loop over the rules, and then over their rhs's.
17454
17455 Work around Autotest bugs.
17456
17457 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
17458 frame, because Autotest understand lines starting with a `+' as
17459 traces from the shell. Then, they are not processed properly.
17460 Admittedly an Autotest bug, but we don't have time to wait for
17461 Autotest to catch up.
17462 * tests/regression.at (Broken Closure): Adjust to the new table
17463 frames.
17464 Move to...
17465 * tests/sets.at: here.
17466
174672001-12-13 Akim Demaille <akim@epita.fr>
17468
17469 * src/closure.c (closure): Use nrules instead of playing tricks
17470 with BITS_PER_WORD.
17471
174722001-12-13 Akim Demaille <akim@epita.fr>
17473
17474 * src/print.c (print_actions): Output the handling of `$' as the
17475 traces do: shifting the token EOF. Before EOF was treated as a
17476 nonterminal.
17477 * tests/regression.at: Adjust some tests.
17478 * src/print_graph.c (print_core): Complete the set of items via
17479 closure. The next-to-final and final states are still unsatisfying,
17480 but that's to be addressed elsewhere.
17481 No longer output the rule numbers, but do output the state number.
17482 A single loop for the shifts + gotos is enough, but picked a
17483 distinct color for each.
17484 (print_graph): Initialize and finalize closure.
17485
174862001-12-13 Akim Demaille <akim@epita.fr>
17487
17488 * src/reader.c (readgram): Remove dead code, an strip useless
17489 braces.
17490 (get_type): Remove, unused.
17491
174922001-12-12 Akim Demaille <akim@epita.fr>
17493
17494 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
17495 on that of lib/error.c.
17496
174972001-12-12 Akim Demaille <akim@epita.fr>
17498
17499 Some hosts don't like `/' in includes.
17500
17501 * src/system.h: Include libgettext.h without qualifying the path.
17502 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
17503 $(top_srcdir).
17504
175052001-12-11 Marc Autret <autret_m@epita.fr>
17506
17507 * src/output.c (output_parser): Remove useless muscle.
17508
175092001-12-11 Marc Autret <autret_m@epita.fr>
17510
17511 * src/bison.simple: Remove #line just before %%epilogue. It
17512 is now handled in ...
17513 * src/reader.c (read_additionnal_code): Add the output of a
17514 #line for the epilogue.
17515
175162001-12-10 Marc Autret <autret_m@epita.fr>
17517
17518 * src/reader.c (copy_definition): Re-use CPP-outed code which
17519 replace precedent remove.
17520 * src/bison.simple: Remove #line before %%prologue because
17521 %%input-line is wrong at this time.
17522
175232001-12-10 Marc Autret <autret_m@epita.fr>
17524
17525 * src/reader.c (symbols_output): Clean up.
17526 * src/output.c (output_gram, output): Clean up.
17527
175282001-12-10 Akim Demaille <akim@epita.fr>
17529
17530 * src/lalr.c (initialize_lookaheads): New. Extracted from...
17531 * src/LR0.c (set_state_table): here.
17532 * src/lalr.c (lalr): Call it.
17533
175342001-12-10 Akim Demaille <akim@epita.fr>
17535
17536 * src/state.h (shifts): Remove the `number' member: shifts are
17537 attached to state, hence no longer need to be labelled with a
17538 state number.
17539
175402001-12-10 Akim Demaille <akim@epita.fr>
17541
17542 Now that states have a complete set of members, the linked list of
17543 shifts is useless: just fill directly the state's shifts member.
17544
17545 * src/state.h (shifts): Remove the `next' member.
17546 * src/LR0.c (first_state, last_state): Remove.
17547 Adjust the callers.
17548 (augment_automaton): Don't look for the shifts that must be added
17549 a shift on EOF: it is those of the state we looked for! But now,
17550 since shifts are attached, it is no longer needed to looking
17551 merely by its id: its number.
17552
175532001-12-10 Akim Demaille <akim@epita.fr>
17554
17555 * src/LR0.c (augment_automaton): Better variable locality.
17556 Remove an impossible branch: if there is a state corresponding to
17557 the start symbol being shifted, then there is shift for the start
17558 symbol from the initial state.
17559
175602001-12-10 Akim Demaille <akim@epita.fr>
17561
17562 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
17563 only when appropriate: when insert_start_shifting_state' is not
17564 invoked.
17565 * tests/regression.at (Rule Line Numbers): Adjust.
17566
175672001-12-10 Akim Demaille <akim@epita.fr>
17568
17569 * src/LR0.c (augment_automaton): Now that all states have shifts,
17570 merge the two cases addition shifts to the initial state.
17571
175722001-12-10 Akim Demaille <akim@epita.fr>
17573
17574 * src/lalr.c (set_state_table): Move to...
17575 * src/LR0.c: here.
17576 * src/lalr.c (lalr): Don't call it...
17577 * src/LR0.c (generate_states): do it.
17578 * src/LR0.h (first_state): Remove, only the table is used.
17579
175802001-12-10 Akim Demaille <akim@epita.fr>
17581
17582 * src/LR0.h (first_shift, first_reduction): Remove.
17583 * src/lalr.c: Don't use first_shift: find shifts through the
17584 states.
17585
175862001-12-10 Akim Demaille <akim@epita.fr>
17587
17588 * src/LR0.c: Attach shifts to states as soon as they are
17589 computed.
17590 * src/lalr.c (set_state_table): Instead of assigning shifts to
17591 state, just assert that the mapping was properly done.
17592
175932001-12-10 Akim Demaille <akim@epita.fr>
17594
17595 * src/LR0.c (insert_start_shift): Rename as...
17596 (insert_start_shifting_state): this.
17597 (insert_eof_shifting_state, insert_accepting_state): New.
17598 (augment_automaton): Adjust.
17599 Better locality of the variables.
17600 When looking if the start_symbol is shifted from the initial
17601 state, using `while (... symbol != start_symbol ...)' sounds
17602 better than `while (... symbol < start_symbol ...)': If fail
17603 to see how the order between symbols could be relevant!
17604
176052001-12-10 Akim Demaille <akim@epita.fr>
17606
17607 * src/getargs.h: Don't declare `spec_name_prefix' and
17608 `spec_file_prefix', declared by src/files.h.
17609 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
17610 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
17611 * src/output.c (prepare): Adjust.
17612 * src/reader.c (symbols_output): Likewise.
17613 * src/vmsgetargs.c: Vaguely adjust, but who cares?
17614
176152001-12-10 Akim Demaille <akim@epita.fr>
17616
17617 * src/muscle_tab.c (muscle_init): NULL is a better default than
17618 `"0"'.
17619
176202001-12-10 Akim Demaille <akim@epita.fr>
17621
17622 * src/reader.c (reader): Calling symbols_output once is enough.
17623
176242001-12-10 Akim Demaille <akim@epita.fr>
17625
17626 Now that states have a complete set of members, the linked list of
17627 reductions is useless: just fill directly the state's reductions
17628 member.
17629
17630 * src/state.h (struct reductions): Remove member `number' and
17631 `next'.
17632 * src/LR0.c (first_reduction, last_reduction): Remove.
17633 (save_reductions): Don't link the new reductions, store them in
17634 this_state.
17635 * src/lalr.c (set_state_table): No need to attach reductions to
17636 states, it's already done.
17637 * src/output.c (output_actions): No longer free the shifts, then
17638 the reductions, then the states: free all the states and their
17639 members.
17640
176412001-12-10 Akim Demaille <akim@epita.fr>
17642
17643 * src/options.c (OPTN, DRTV, BOTH): New.
17644 (option_table): Use them.
17645
17646 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
17647 the job of system.h.
17648 * src/options.c: Don't include stdio.h and xalloc.h for the same
17649 reasons.
17650
176512001-12-10 Akim Demaille <akim@epita.fr>
17652
17653 * src/output.c (output, prepare): Make sure the values of the
17654 muscles `action' and `prologue' are 0-terminated.
17655
176562001-12-10 Akim Demaille <akim@epita.fr>
17657
17658 Clean up GCC warnings.
17659
17660 * src/reader.c (copy_action): `buf' is not used.
17661 (parse_skel_decl): Be static.
17662 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
17663 * src/options.h (create_long_option_table): Have a real prototype.
17664 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
17665 (hash_delete_at): Return const void *.
17666 Adjust casts to preserve the const.
17667
176682001-12-10 Akim Demaille <akim@epita.fr>
17669
17670 * configure.in: Require 2.52g.
17671 M4 is not needed, but AUTOM4TE is.
17672 * m4/m4.m4: Remove.
17673 * tests/Makefile.am: Adjust.
17674
176752001-12-10 Akim Demaille <akim@epita.fr>
17676
17677 One structure for states is enough, even though theoretically
17678 there are LR(0) states and LALR(1) states.
17679
17680 * src/lalr.h (state_t): Remove.
17681 (state_table): Be state_t **, not state_t *.
17682 * src/state.h (core, CORE_ALLOC): Rename as...
17683 (state_t, STATE_ALLOC): this.
17684 Add the LALR(1) members: shifts, reductions, errs.
17685 * src/LR0.c (state_table): Rename as...
17686 (state_hash): this, to avoid name clashes with the global
17687 `state_table'.
17688 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
17689 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
17690
176912001-12-10 Akim Demaille <akim@epita.fr>
17692
17693 Bison dumps core on bash.y.
17694 Reported by Pascal Bart.
17695
17696 * src/warshall.c (bitmatrix_print): New.
17697 (TC): Use it.
17698 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
17699 j must be the outer loop.
17700 * tests/regression.at (Broken Closure): New.
17701
177022001-12-05 Akim Demaille <akim@epita.fr>
17703
17704 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
17705 its argument.
17706 Reported by Peter Hamorsky.
17707
177082001-12-05 Akim Demaille <akim@epita.fr>
17709
17710 * src/conflicts.c (err_table): Remove.
17711 (resolve_sr_conflict): Adjust.
17712 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
17713 Rename as...
17714 (state_t.reductions, state_t.shifts): this.
17715
177162001-12-05 Akim Demaille <akim@epita.fr>
17717
17718 * src/reduce.c (reduce_grammar_tables): No longer disable the
17719 removal of useless rules via CPP but via `if (0)', so that the
17720 compiler still check the code is valid.
17721 For instance, it should have noticed `rline' no longer exists: use
17722 the `line' member of rule_t.
17723 * src/gram.c (dummy, rline): Remove, unused.
17724
177252001-12-05 Akim Demaille <akim@epita.fr>
17726
17727 * src/output.c (pack_vector): Use assert, not berror.
17728 * src/main.c (berror): Remove, unused.
17729
177302001-12-05 Akim Demaille <akim@epita.fr>
17731
17732 New experimental feature: if --verbose --trace output all the
17733 items of a state, not only its kernel.
17734
17735 * src/print.c (print_core): If `trace_flag', then invoke closure
17736 before outputting the items of the state (print_core is no longer
17737 a correct name them).
17738 (print_results): Invoke new_closure/free_closure if needed.
17739
177402001-12-05 Akim Demaille <akim@epita.fr>
17741
17742 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
17743 * src/closure.c, src/closure.h (itemsetsize): Rename as...
17744 (nitemset): for consistency with the rest of the project.
17745
177462001-12-05 Akim Demaille <akim@epita.fr>
17747
17748 * src/closure.c (print_closure): Improve.
17749 (closure): Use it for printing input and output.
17750
177512001-12-05 Akim Demaille <akim@epita.fr>
17752
17753 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
17754 indexed by nonterminals.
17755
177562001-12-05 Akim Demaille <akim@epita.fr>
17757
17758 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
17759 what it was!).
17760 * src/warshall.h: Remove accidental duplication of the content.
17761
177622001-12-05 Akim Demaille <akim@epita.fr>
17763
17764 * src/closure.c (set_fderives): De-obfuscate.
17765
177662001-12-05 Akim Demaille <akim@epita.fr>
17767
17768 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
17769
177702001-12-05 Akim Demaille <akim@epita.fr>
17771
17772 * src/closure.c (set_firsts): De-obfuscate.
17773
177742001-12-05 Akim Demaille <akim@epita.fr>
17775
17776 * src/output.c (action_row): De-obfuscate
17777 using the good o' techniques: arrays not pointers, variable
17778 locality, BITISSET, RESETBIT etc.
17779
177802001-12-05 Akim Demaille <akim@epita.fr>
17781
17782 Pessimize the code to simplify it: from now on, all the states
17783 have a valid SHIFTS, which NSHIFTS is possibly 0.
17784
17785 * src/LR0.c (shifts_new): Be global and move to..
17786 * src/state.c, src/state.h: here.
17787 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
17788 * src/print_graph: Adjust.
17789
177902001-12-05 Akim Demaille <akim@epita.fr>
17791
17792 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
17793 * src/conflicts.c: Use it.
17794 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
17795 incorrectly ``simplified''.
17796
177972001-12-05 Akim Demaille <akim@epita.fr>
17798
17799 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
17800 using the good o' techniques: arrays not pointers, variable
17801 locality, BITISSET, RESETBIT etc.
17802
178032001-12-05 Akim Demaille <akim@epita.fr>
17804
17805 * src/state.h (SHIFT_SYMBOL): New.
17806 * src/conflicts.c: Use it to deobfuscate.
17807
178082001-12-05 Akim Demaille <akim@epita.fr>
17809
17810 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
17811 (print_reductions): De-obfuscate using the good o' techniques:
17812 arrays not pointers, variable locality, BITISSET.
17813
178142001-12-05 Akim Demaille <akim@epita.fr>
17815
17816 * src/conflicts.c (print_reductions): Arrays, not pointers.
17817 Use BITISSET.
17818
178192001-12-05 Akim Demaille <akim@epita.fr>
17820
17821 * src/conflicts.c (print_reductions): Pessimize, but clarify.
17822
178232001-12-05 Akim Demaille <akim@epita.fr>
17824
17825 * src/conflicts.c (print_reductions): Improve variable locality.
17826
178272001-12-05 Akim Demaille <akim@epita.fr>
17828
17829 * src/conflicts.c (print_reductions): Pessimize, but clarify.
17830
178312001-12-05 Akim Demaille <akim@epita.fr>
17832
17833 * src/conflicts.c (print_reductions): Improve variable locality.
17834
178352001-12-05 Akim Demaille <akim@epita.fr>
17836
17837 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
17838 * src/lalr.c: Use them.
17839
178402001-12-05 Akim Demaille <akim@epita.fr>
17841
17842 * src/LR0.c (augment_automaton): Formatting changes.
17843 Better variable locality.
17844
178452001-12-05 Akim Demaille <akim@epita.fr>
17846
17847 * src/lalr.c (matrix_print): New.
17848 (transpose): Use it.
17849 Use arrays instead of pointers.
17850
178512001-12-05 Akim Demaille <akim@epita.fr>
17852
17853 * src/lalr.c (maxrhs): Move to...
17854 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
17855 * src/lalr.c (build_relations): Adjust.
17856
178572001-12-05 Akim Demaille <akim@epita.fr>
17858
17859 * src/lalr.c (transpose): Free the memory allocated to the
17860 argument, as it is replaced by the results by the unique caller.
17861 (build_relations): Merely invoke transpose: it handles the memory
17862 deallocation.
17863 Improve variable locality.
17864 Avoid variables used as mere abbreviations.
17865 (compute_lookaheads): Use arrays instead of pointers.
17866
178672001-12-05 Akim Demaille <akim@epita.fr>
17868
17869 * src/lalr.c (initialize_F): Improve variable locality.
17870 Avoid variables used as mere abbreviations.
17871
178722001-12-05 Akim Demaille <akim@epita.fr>
17873
17874 * src/derives.c (print_derives): Display the ruleno.
17875 * src/lalr.c (initialize_F, transpose): Better variable locality
17876 to improve readability.
17877 Avoid variables used as mere abbreviations.
17878
178792001-12-05 Akim Demaille <akim@epita.fr>
17880
17881 * src/lalr.c (traverse): Use arrays instead of pointers.
17882
178832001-12-05 Akim Demaille <akim@epita.fr>
17884
17885 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
17886 the handling of squeue.
17887 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
17888
178892001-12-05 Akim Demaille <akim@epita.fr>
17890
17891 Because useless nonterminals are now kept alive (instead of being
17892 `destroyed'), we now sometimes examine them, and store information
17893 related to them. Hence we need to know their number, and adjust
17894 memory allocations.
17895
17896 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
17897 static.
17898 * src/LR0.c (allocate_itemsets): The memory allocated to
17899 `symbol_count' was used for two different purpose: once to count
17900 the number of occurrences of each symbol, and later reassigned to
17901 `shift_symbol', containing the symbol that can be shifted from a
17902 given state.
17903 Deobfuscate, i.e., allocate, use and free `symbol_count' here
17904 only, and...
17905 (new_itemsets): Allocate `shift_symbol' here.
17906 (allocate_itemsets): symbol_count includes useless nonterminals.
17907 Make room for them.
17908 (free_storage): Use `free', not `XFREE', for pointers that cannot
17909 be null.
17910
179112001-12-05 Akim Demaille <akim@epita.fr>
17912
17913 * src/nullable.c (set_nullable): Deobfuscate the handling of
17914 ritem.
17915 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
17916
179172001-12-05 Akim Demaille <akim@epita.fr>
17918
17919 * src/gram.c, src/gram.h (ritem_print): New.
17920 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
17921 (This useless function was defined only to work around VMS linkers
17922 that can't handle compilation units with variables only).
17923 * src/reduce.c (dump_grammar): Use it to trace the construction of
17924 ritem.
17925
179262001-12-04 Paul Eggert <eggert@twinsun.com>
17927
17928 * src/bison.simple (union yyalloc): Change member names
17929 to be the same as the stack names.
17930 (yyparse): yyptr is now union yyalloc *, not char *.
17931 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
17932 and may generate better code on some machines.
17933 (yystpcpy): Use prototype if __STDC__ is defined, not just
17934 if __cplusplus is defined.
17935
179362001-11-30 Akim Demaille <akim@epita.fr>
17937
17938 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
17939 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
17940 Gettext doesn't compile cleanly, and dies with -Werror.
17941 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
17942 Include WARNING_CFLAGS here.
17943 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
17944 before being defined.
17945
179462001-11-27 Paul Eggert <eggert@twinsun.com>
17947
17948 * lib/quotearg.h (quotearg_n, quotearg_n_style):
17949 First arg is int, not unsigned.
17950 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
17951 (SIZE_MAX, UINT_MAX): New macros.
17952 (quotearg_n_options): Abort if N is negative.
17953 Avoid overflow check on hosts where size_t is 64 bits and int
17954 is 32 bits, as overflow is impossible there.
17955 Fix off-by-one typo that caused unnecessary reallocation.
17956
179572001-11-29 Paul Eggert <eggert@twinsun.com>
17958
17959 Name space cleanup in generated parser.
17960
17961 * doc/bison.texinfo (Bison Parser): Discuss system headers
17962 and their effect on the user name space.
17963
17964 * src/bison.simple:
17965 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
17966 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
17967 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
17968
17969 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
17970 on user names when possible.
17971
17972 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
17973 Simplify test for whather <alloca.h> exists.
17974
17975 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
17976
17977 (<stdio.h>): Include if YYDEBUG.
17978
17979 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
17980 ! defined (yyoverflow) && ! defined (yymemcpy).
17981
17982 (yymemcpy, yyparse): Rename local variables as needed so that
17983 they all begin with 'yy'.
17984
17985 (yystrlen, yystpcpy): New functions.
17986
17987 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
17988 All uses changed.
17989
17990 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
17991 instead of relying on string.h functions. Use YYSTACK_ALLOC
17992 and YYSTACK_FREE instead of malloc and free.
17993
179942001-11-30 Akim Demaille <akim@epita.fr>
17995
17996 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
17997 before their first uses.
17998 (YYBISON, YYPURE): Move to the top of the output.
17999
180002001-11-30 Akim Demaille <akim@epita.fr>
18001
18002 * tests/reduce.at (Useless Nonterminals): Fix.
18003
180042001-11-30 Akim Demaille <akim@epita.fr>
18005
18006 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
18007 if body instead of `;' to pacify GCC's warnings.
18008
180092001-11-30 Akim Demaille <akim@epita.fr>
18010
18011 Instead of mapping the LHS of unused rules to -1, keep the LHS
18012 valid, but flag the rules as invalid.
18013
18014 * src/gram.h (rule_t): `useful' is a new member.
18015 * src/print.c (print_grammar): Adjust.
18016 * src/derives.c (set_derives): Likewise.
18017 * src/reader.c (packgram, reduce_output): Likewise.
18018 * src/reduce.c (reduce_grammar_tables): Likewise.
18019 * tests/reduce.at (Underivable Rules, Useless Rules): New.
18020
180212001-11-30 Akim Demaille <akim@epita.fr>
18022
18023 * src/reduce.c (reduce_output): Formatting changes.
18024 * src/print.c (print_results, print_grammar): Likewise.
18025 * tests/regression.at (Rule Line Numbers)
18026 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
18027
180282001-11-30 Akim Demaille <akim@epita.fr>
18029
18030 * src/reduce.c (nonterminals_reduce): Instead of throwing away
18031 useless nonterminals, move them at the end of the symbol arrays.
18032 (reduce_output): Adjust.
18033 * tests/reduce.at (Useless Nonterminals): Adjust.
18034
180352001-11-30 Akim Demaille <akim@epita.fr>
18036
18037 * src/reduce.c: Various comment/formatting changes.
18038 (nonterminals_reduce): New, extracted from...
18039 (reduce_grammar_tables): here.
18040 (reduce_grammar): Call nonterminals_reduce.
18041
180422001-11-29 Paul Eggert <eggert@twinsun.com>
18043
18044 * src/bison.simple (YYSTACK_REALLOC): Remove.
18045 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
18046 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
18047 New macros.
18048 (union yyalloc): New type.
18049 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
18050 an arbitrary restriction on hosts where size_t is wider than int.
18051
18052 (yyparse): Don't dump core if alloca or malloc fails; instead, report
18053 a parser stack overflow. Allocate just one block of memory for all
18054 three stacks, instead of allocating three blocks; this typically is
18055 faster and reduces fragmentation.
18056
18057 Do not limit the number of items in the stack to a value that fits
18058 in 'int', as this is an arbitrary limit on hosts with 64-bit
18059 size_t and 32-bit int.
18060
180612001-11-29 Marc Autret <autret_m@epita.fr>
18062
18063 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
18064 of defining YYERROR_VERBOSE.
18065 [AT_DATA]: $4 is now out of C declarations in the prologue.
18066
180672001-11-28 Marc Autret <autret_m@epita.fr>
18068
18069 * src/reader.c (parse_dquoted_param): New.
18070 (parse_skel_decl): Use it.
18071 * src/lex.h: Add its prototype.
18072 * src/lex.c (literalchar): Become not static.
18073
180742001-11-28 Marc Autret <autret_m@epita.fr>
18075
18076 * src/output.h: And put its extern declaration here.
18077 * src/output.c (error_verbose): Define here.
18078 (prepare): Echo name modification.
18079 * src/getargs.h: Clean its extern declaration.
18080 * src/getargs.c (error_verbose_flag): Remove.
18081 (getargs): Remove case 'e'.
18082 * src/options.c (option_table): 'error-verbose' is now seen as simple
18083 percent option.
18084 Include output.h.
18085
18086 * src/reader.c (read_declarations): Remove case tok_include.
18087 (parse_include_decl): Remove.
18088 * src/lex.h (token_t): Remove tok_include.
18089 * src/options.c (option_table): 'include' is now a simple command line
18090 option.
18091
180922001-11-28 Marc Autret <autret_m@epita.fr>
18093
18094 * src/bison.simple: Adjust muscle names.
18095 * src/muscle_tab.c (muscle_init): Also rename the muscles.
18096 * src/output.c (prepare): s/_/-/ for the muscles names.
18097 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
18098
180992001-11-28 Marc Autret <autret_m@epita.fr>
18100
18101 * src/bison.simple: Fix debug.
18102 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
18103
181042001-11-28 Akim Demaille <akim@epita.fr>
18105
18106 * src/LR0.c (shifts_new): New.
18107 (save_shifts, insert_start_shift, augment_automaton): Use it.
18108
181092001-11-28 Akim Demaille <akim@epita.fr>
18110
18111 * src/closure.c (closure): `b' and `ruleno' denote the same value:
18112 keep ruleno only.
18113
181142001-11-28 Akim Demaille <akim@epita.fr>
18115
18116 * src/closure.c (closure): Instead of looping over word in array
18117 then bits in words, loop over bits in array.
18118
181192001-11-28 Akim Demaille <akim@epita.fr>
18120
18121 * src/closure.c (closure): No longer optimize the special case
18122 where all the bits of `ruleset[r]' are set to 0, to make the code
18123 clearer.
18124
181252001-11-28 Akim Demaille <akim@epita.fr>
18126
18127 * src/closure.c (closure): `r' and `c' are new variables, used to
18128 de-obfuscate accesses to RULESET and CORE.
18129
181302001-11-28 Akim Demaille <akim@epita.fr>
18131
18132 * src/reduce.c (reduce_print): Use ngettext.
18133 (dump_grammar): Improve the trace accuracy.
18134
181352001-11-28 Akim Demaille <akim@epita.fr>
18136
18137 * src/reduce.c (dump_grammar): Don't translate trace messages.
18138
181392001-11-28 Akim Demaille <akim@epita.fr>
18140
18141 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
18142 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
18143 as all tags are free'ed afterwards.
18144 From Enrico Scholz.
18145
181462001-11-27 Paul Eggert <eggert@twinsun.com>
18147
18148 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
18149 use alloca when we didn't want to, and vice versa.
18150
181512001-11-27 Marc Autret <autret_m@epita.fr>
18152
18153 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
18154 initialization.
18155 * src/output.c (prepare): Remove its update.
18156
181572001-11-27 Marc Autret <autret_m@epita.fr>
18158
18159 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
18160 Use %error-verbose.
18161
181622001-11-27 Marc Autret <autret_m@epita.fr>
18163
18164 * src/bison.simple: Remove YYERROR_VERBOSE using.
18165 Use %%error_verbose.
18166 (yyparse): Likewise.
18167 * src/output.c (prepare): Give its final value.
18168 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
18169 * src/getargs.h: Add its extern declaration.
18170 * src/getargs.c (error_verbose_flag): New int.
18171 (getargs): Update to catch new case.
18172 * src/options.c (option_table): 'error-verbose' is a new option.
18173 (shortopts): Update.
18174
181752001-11-27 Akim Demaille <akim@epita.fr>
18176
18177 * src/system.h: Use intl/libgettext.h.
18178 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
18179
181802001-11-27 Akim Demaille <akim@epita.fr>
18181
18182 * tests/torture.at (Exploding the Stack Size with Malloc):
18183 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
18184
181852001-11-27 Akim Demaille <akim@epita.fr>
18186
18187 * src/files.c: Include error.h.
18188 Reported by Hans Aberg.
18189
181902001-11-26 Marc Autret <autret_m@epita.fr>
18191
18192 * src/reader.c (parse_include_decl): New, not yet implemented.
18193 (read_declarations): Add case tok_include.
18194 * src/getargs.h (include): Add its extern definition.
18195 * src/getargs.c (include): New const char *.
18196 (getargs): Add case '-I'.
18197 * src/options.c (option_table): Add include as command line and
18198 percent option.
18199 * src/lex.h (token_t): Add tok_include.
18200
182012001-11-26 Akim Demaille <akim@epita.fr>
18202
18203 * src/reader.c (readgram): Make sure rules for mid-rule actions
18204 have a lineno equal to that of their host rule.
18205 Reported by Hans Aberg.
18206 * tests/regression.at (Rule Line Numbers): New.
18207
182082001-11-26 Akim Demaille <akim@epita.fr>
18209
18210 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
18211 size_ts.
18212
182132001-11-26 Akim Demaille <akim@epita.fr>
18214
18215 * src/complain.c, src/complain.h (error): Remove, provided by
18216 lib/error.[ch].
18217
182182001-11-26 Akim Demaille <akim@epita.fr>
18219
18220 * src/reader.c (read_declarations): Don't abort on tok_illegal,
18221 issue an error message.
18222 * tests/regression.at (Invalid %directive): New.
18223 Reported by Hans Aberg.
18224
182252001-11-26 Akim Demaille <akim@epita.fr>
18226
18227 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
18228 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18229
182302001-11-26 Akim Demaille <akim@epita.fr>
18231
18232 * src/conflicts.c (conflicts_print): Don't complain at all when
18233 there are no reduce/reduce conflicts, and as many shift/reduce
18234 conflicts as expected.
18235 * tests/regression.at (%expect right): Adjust.
18236
182372001-11-23 Akim Demaille <akim@epita.fr>
18238
18239 * lib/alloca.c: Update, from fileutils.
18240
182412001-11-23 Akim Demaille <akim@epita.fr>
18242
18243 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
18244
182452001-11-23 Akim Demaille <akim@epita.fr>
18246
18247 * src/system.h: Include alloca.h.
18248 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
18249
182502001-11-23 Akim Demaille <akim@epita.fr>
18251
18252 * src/print_graph.c (print_actions): Remove `rule', unused.
18253 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
18254 pacify GCC's signed < unsigned warnings.
18255 * src/closure.c (itemsetsize): Likewise.
18256 * src/reader.c (symbol_list_new): Static.
18257
182582001-11-23 Akim Demaille <akim@epita.fr>
18259
18260 Attaching lineno to buckets is stupid, since only one copy of each
18261 symbol is kept, only the line of the first occurrence is kept too.
18262
18263 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
18264 * src/reader.c (rline_allocated): Remove, unused.
18265 (symbol_list): Have a `line' member.
18266 (symbol_list_new): New.
18267 (readgram): Use it.
18268 * src/print.c (print_grammar): Output the rule line numbers.
18269 * tests/regression.at (Solved SR Conflicts)
18270 (Unresolved SR Conflicts): Adjust.
18271 Reported by Hans Aberg.
18272
182732001-11-22 Marc Autret <autret_m@epita.fr>
18274
18275 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
18276
182772001-11-22 Marc Autret <autret_m@epita.fr>
18278
18279 * src/muscle_tab.c (muscle_init): Remove initialization of
18280 skeleton muscle.
18281 * src/output.c (output_master_parser): Do it here.
18282
182832001-11-20 Akim Demaille <akim@epita.fr>
18284
18285 * po/sv.po: New.
18286 * configure.in (ALL_LINGUAS): Adjust.
18287 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
18288 longer contains strings to translate.
18289
182902001-11-19 Akim Demaille <akim@epita.fr>
18291
18292 * src/conflicts.c (conflicts_print): Add a missing \n.
18293
182942001-11-19 Akim Demaille <akim@epita.fr>
18295
18296 * src/nullable.c (nullable_print): New.
18297 (set_nullable): Call it when tracing.
18298 Better locality of variables.
18299
183002001-11-19 Akim Demaille <akim@epita.fr>
18301
18302 * src/print.c (print_actions): Better locality of variables.
18303
183042001-11-19 Akim Demaille <akim@epita.fr>
18305
18306 * src/derives.c (print_derives): Fix and enrich.
18307 * src/closure.c (print_fderives): Likewise.
18308
183092001-11-19 Akim Demaille <akim@epita.fr>
18310
18311 * src/closure.c (itemsetend): Remove, replaced with...
18312 (itemsetsize): new.
18313
183142001-11-19 Akim Demaille <akim@epita.fr>
18315
18316 * src/LR0.c (kernel_end): Remove, replaced with...
18317 (kernel_size): new.
18318
183192001-11-19 Akim Demaille <akim@epita.fr>
18320
18321 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
18322 to clarify.
18323
183242001-11-19 Akim Demaille <akim@epita.fr>
18325
18326 * src/closure.c (closure): Use arrays instead of pointers to clarify.
18327
183282001-11-19 Akim Demaille <akim@epita.fr>
18329
18330 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
18331 trace messages.
18332 * src/LR0.c: Likewise.
18333 (allocate_itemsets): Use arrays instead of pointers to clarify.
18334
183352001-11-19 Akim Demaille <akim@epita.fr>
18336
18337 * src/getargs.c (statistics_flag): Replace with...
18338 (trace_flag): New.
18339 (longopts): Accept --trace instead of --statistics.
18340 * src/getargs.h, src/options.c: Adjust.
18341 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
18342 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
18343
183442001-11-19 Akim Demaille <akim@epita.fr>
18345
18346 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
18347 pointers to clarify the code.
18348 (save_reductions, save_shifts): Factor common parts of alternatives.
18349
183502001-11-19 Akim Demaille <akim@epita.fr>
18351
18352 * src/LR0.c (new_state, get_state): Complete TRACE code.
18353 * src/closure.c: Include `reader.h' to get `tags', needed by the
18354 trace code.
18355 Rename the conditional DEBUG as TRACE.
18356 Output consistently TRACEs to stderr, not stdout.
18357 * src/derives.c: Likewise.
18358 * src/reduce.c: (inaccessable_symbols): Using if is better style
18359 than goto.
18360 Use `#if TRACE' instead of `#if 0' for tracing code.
18361
183622001-11-19 Akim Demaille <akim@epita.fr>
18363
18364 * src/system.h (LIST_FREE, shortcpy): New.
18365 * src/LR0.c: Use them.
18366 * src/output.c (free_itemsets, free_reductions, free_shifts):
18367 Remove, replaced by LIST_FREE.
18368
183692001-11-19 Akim Demaille <akim@epita.fr>
18370
18371 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
18372 (REDUCTIONS_ALLOC): New.
18373 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
18374 allocation.
18375
183762001-11-19 Akim Demaille <akim@epita.fr>
18377
18378 * src/LR0.c (new_state): Complete trace code.
18379 * src/nullable.c (set_nullable): Don't translate traces.
18380
183812001-11-19 Akim Demaille <akim@epita.fr>
18382
18383 * src/print_graph.c (print_core): Better locality of variables.
18384 * src/print.c (print_core): Likewise.
18385
183862001-11-19 Akim Demaille <akim@epita.fr>
18387
18388 * src/vcg.c: You do the output, so you are responsible of the
18389 handling of VCG syntax, in particular: use quotearg.
18390 * src/print_graph.c: Don't.
18391 (print_actions): Don't output the actions as part of the nodes,
18392 since that's the job of the edges.
18393 (print_state): Don't output by hand: fill the node description,
18394 and ask for its output.
18395
183962001-11-19 Akim Demaille <akim@epita.fr>
18397
18398 * src/bison.simple (yyparse): When verbosely reporting an error,
18399 no longer put additional quotes around token names.
18400 * tests/calc.at: Adjust.
18401
184022001-11-19 Akim Demaille <akim@epita.fr>
18403
18404 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
18405 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
18406 * src/output.c: Adjust.
18407
184082001-11-19 Akim Demaille <akim@epita.fr>
18409
18410 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
18411 (rule_t): this.
18412 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
18413
184142001-11-19 Akim Demaille <akim@epita.fr>
18415
18416 * src/gram.h (rule_t): New.
18417 (rule_table): New.
18418 (rrhs, rlhs): Remove, part of state_t.
18419 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
18420 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
18421 * src/reader.c, src/reduce.c: Adjust.
18422
184232001-11-19 Akim Demaille <akim@epita.fr>
18424
18425 * src/reader.c (symbols_output): New, extracted from...
18426 (packsymbols): Here.
18427 (reader): Call it.
18428
184292001-11-19 Akim Demaille <akim@epita.fr>
18430
18431 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
18432 (maxrhs): this new function.
18433
184342001-11-19 Akim Demaille <akim@epita.fr>
18435
18436 * src/lalr.c (F): New macro to access the variable F.
18437 Adjust.
18438
184392001-11-19 Akim Demaille <akim@epita.fr>
18440
18441 * src/lalr.h (LA): New macro to access the variable LA.
18442 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18443 * src/lalr.c: Adjust.
18444
184452001-11-19 Akim Demaille <akim@epita.fr>
18446
18447 * src/lalr.c (initialize_LA): Only initialize LA. Let...
18448 (set_state_table): handle the `lookaheads' members.
18449
184502001-11-19 Akim Demaille <akim@epita.fr>
18451
18452 * src/lalr.h (lookaheads): Removed array, whose contents is now
18453 a member of...
18454 (state_t): this structure.
18455 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18456 Adjust.
18457
184582001-11-19 Akim Demaille <akim@epita.fr>
18459
18460 * src/lalr.h (consistent): Removed array, whose contents is now
18461 a member of...
18462 (state_t): this structure.
18463 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18464 Adjust.
18465
184662001-11-19 Akim Demaille <akim@epita.fr>
18467
18468 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
18469 contents are now members of...
18470 (state_t): this structure.
18471 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18472 Adjust.
18473
184742001-11-19 Akim Demaille <akim@epita.fr>
18475
18476 * src/lalr.h (state_t): New.
18477 (state_table): Be a state_t * instead of a core **.
18478 (accessing_symbol): Remove, part of state_t.
18479 * src/lalr.c: Adjust.
18480 (set_accessing_symbol): Merge into...
18481 (set_state_table): this.
18482 * src/print_graph.c, src/conflicts.c: Adjust.
18483
184842001-11-14 Akim Demaille <akim@epita.fr>
18485
18486 * tests/calc.at, tests/output.at, tests/regression.at,
18487 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
18488 now the tests are run in private dirs, therefore AC_CLEANUP and
18489 family can be simplified to 0-ary.
18490 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
18491 use abs. path to find config.h.
18492 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
18493 stderr, there can be way too much random noise.
18494 Instead pass -Werror to GCC and rely on the exit status.
18495 Reported by Wolfram Wagner.
18496
184972001-11-14 Akim Demaille <akim@epita.fr>
18498
18499 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
18500 defined only if yyoverflow is defined, to avoid `warning: unused
18501 variable `yyvs1''.
18502 Reported by The Test Suite.
18503
185042001-11-14 Akim Demaille <akim@epita.fr>
18505
18506 * src/print.c: Include reduce.h.
18507 Reported by Hans Aberg.
18508
185092001-11-14 Akim Demaille <akim@epita.fr>
18510
18511 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
18512 Revert a previous patch: these are really const.
18513 * src/conflicts.c (conflict_report): Additional useless pair of
18514 braces to pacify GCC's warnings for `if () if () {} else {}'.
18515 * src/lex.c (parse_percent_token): Replace equal_offset with
18516 arg_offset.
18517 arg is const.
18518 Be sure to strdup `arg' when used, since there is no reason for
18519 token_buffer not to change.
18520
185212001-11-14 Akim Demaille <akim@epita.fr>
18522
18523 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
18524 definition.
18525 * src/main.c (main): Use them.
18526 Suggested by Hans Aberg.
18527
185282001-11-12 Akim Demaille <akim@epita.fr>
18529
18530 * src/system.h (ngettext): Now that we use ngettext, be sure to
18531 provide a default definition when NLS are not used.
18532
185332001-11-12 Akim Demaille <akim@epita.fr>
18534
18535 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
18536 Use @kbd to denote user input.
18537 (Language and Grammar): ANSIfy the example.
18538 Adjust its layout for info/notinfo.
18539 (Location Tracking Calc): Output error messages to stderr.
18540 Output locations in a more GNUtically correct way.
18541 Fix a couple of Englishos.
18542 Adjust @group/@end group pairs.
18543
185442001-11-12 Akim Demaille <akim@epita.fr>
18545
18546 %expect was not functioning at all.
18547
18548 * src/conflicts.c (expected_conflicts): Set to -1.
18549 (conflict_report): Use ngettext.
18550 (conflicts_print): Check %expect and make its violation an error.
18551 * doc/bison.texinfo (Expect Decl): Adjust.
18552 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
18553 * tests/regression.at (%expect not enough, %expect right)
18554 (%expect too much): New.
18555
185562001-11-12 Akim Demaille <akim@epita.fr>
18557
18558 * tests/regression.at (Conflicts): Rename as...
18559 (Unresolved SR Conflicts): this.
18560 (Solved SR Conflicts): New.
18561
185622001-11-12 Akim Demaille <akim@epita.fr>
18563
18564 * src/reduce.c (print_results): Rename as...
18565 (reduce_output): This.
18566 Output to OUT, passed as argument, instead of output_obstack.
18567 (dump_grammar): Likewise.
18568 (reduce_free): New.
18569 Also free V1.
18570 (reduce_grammar): No longer call reduce_output, since...
18571 * src/print.c (print_results): do it.
18572 * src/main.c (main): Call reduce_free;
18573
185742001-11-12 Akim Demaille <akim@epita.fr>
18575
18576 * src/conflicts.c (print_reductions): Accept OUT as argument.
18577 Output to it, not to output_obstack.
18578 * src/print.c (print_actions): Adjust.
18579
185802001-11-12 Akim Demaille <akim@epita.fr>
18581
18582 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
18583 the result instead of using...
18584 (src_total, rrc_total, src_count, rrc_count): Remove.
18585 (any_conflicts): Remove.
18586 (print_conflicts): Split into...
18587 (conflicts_print, conflicts_output): New.
18588 * src/conflicts.h: Adjust.
18589 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
18590 * src/print.c (print_grammar): Issue `\n' between two rules.
18591 * tests/regression.at (Conflicts): New.
18592 Reported by Tom Lane.
18593
185942001-11-12 Akim Demaille <akim@epita.fr>
18595
18596 * tests/regression.at (Invalid input): Remove, duplicate with
18597 ``Invalid input: 1''.
18598
185992001-11-12 Akim Demaille <akim@epita.fr>
18600
18601 * tests/torture.at (AT_DATA_STACK_TORTURE)
18602 (Exploding the Stack Size with Alloca)
18603 (Exploding the Stack Size with Malloc): New.
18604
186052001-11-12 Akim Demaille <akim@epita.fr>
18606
18607 * src/bison.simple (YYSTACK_REALLOC): New.
18608 (yyparse) [!yyoverflow]: Use it and free the old stack.
18609 Reported by Per Allansson.
18610
186112001-11-12 Pascal Bart <pascal.bart@epita.fr>
18612
18613 * src/bison.simple: Define type yystype instead of YYSTYPE, and
18614 define CPP macro, which substitute YYSTYPE by yystype.
18615 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
18616 with yyltype/YYLTYPE. This allows inclusion of the generated
18617 header within the parser if the compiler, such as GGC, accepts
18618 multiple equivalent #defines.
18619 From Akim.
18620
186212001-11-05 Akim Demaille <akim@epita.fr>
18622
18623 * src/reader.c (symbols_output): New, extracted from...
18624 (packsymbols): here.
18625 (reader): Adjust.
18626
186272001-11-05 Akim Demaille <akim@epita.fr>
18628
18629 * src/lex.c (parse_percent_token): s/quotearg/quote/.
18630
186312001-11-05 Akim Demaille <akim@epita.fr>
18632
18633 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
18634 pattern.
18635
186362001-11-05 Akim Demaille <akim@epita.fr>
18637
18638 * src/options.h (struct option_table_struct): set_flags is void*.
18639 * src/options.c (longopts): Support `--output' and `%output'.
18640 (usage): Adjust.
18641 * src/lex.h (tok_setopt): Remove, replaced with...
18642 (tok_intopt, tok_stropt): these new guys.
18643 * src/lex.c (getopt.h): Not needed.
18644 (token_buffer, unlexed_token_buffer): Not const.
18645 (percent_table): Promote `-' over `_' in directive names.
18646 Active `%name-prefix', `file-prefix', and `output'.
18647 (parse_percent_token): Accept possible arguments to directives.
18648 Promote `-' over `_' in directive names.
18649
186502001-11-04 Akim Demaille <akim@epita.fr>
18651
18652 * doc/bison.texinfo (Decl Summary): Split the list into
18653 `directives for grammars' and `directives for bison'.
18654 Sort'em.
18655 Add description of `%name-prefix', `file-prefix', and `output'.
18656 Promote `-' over `_' in directive names.
18657 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
18658 Simplify the description of `--name-prefix'.
18659 Promote `-' over `_' in directive names.
18660 Promote `--output' over `--output-file'.
18661 Fix the description of `--defines'.
18662 * tests/output.at: Exercise %file-prefix and %output.
18663
186642001-11-02 Akim Demaille <akim@epita.fr>
18665
18666 * doc/refcard.tex: Update.
18667
186682001-11-02 Akim Demaille <akim@epita.fr>
18669
18670 * src/symtab.h (SUNDEF): New.
18671 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
18672 stand for `uninitialized', instead of 0.
18673 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
18674 * src/lex.c (lex): Adjust.
18675
18676 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
18677 Number it 0.
18678 Let yylex return it instead of a plain 0.
18679 Reported by Dick Streefland.
18680
186812001-11-02 Akim Demaille <akim@epita.fr>
18682
18683 * tests/regression.at (Mixing %token styles): New test.
18684
186852001-11-02 Akim Demaille <akim@epita.fr>
18686
18687 * src/reader.c (parse_thong_decl): Formatting changes.
18688 (token_translations_init): New, extracted from...
18689 (packsymbols): Here.
18690 Adjust.
18691
186922001-11-01 Akim Demaille <akim@epita.fr>
18693
18694 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
18695 Check that `9foo.y' produces correct cpp guards.
18696 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
18697 guards.
18698 Reported by Wwp.
18699
187002001-11-01 Akim Demaille <akim@epita.fr>
18701
18702 * tests/regression.at (Invalid input: 2): New.
18703 * src/lex.c (unlexed_token_buffer): New.
18704 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
18705 too.
18706 Reported by Wwp.
18707
187082001-11-01 Akim Demaille <akim@epita.fr>
18709
18710 * tests/calc.at: Catch up with 1.30.
18711 * configure.in: Bump to 1.49a.
18712 Adjust to newer Autotest.
18713
187142001-10-19 Pascal Bart <pascal.bart@epita.fr>
18715
18716 * src/conflicts.c: Move global variables rrc_total and src_total ...
18717 (print_conflicts): here.
18718 * src/output.c (output): Free global variable user_toknums.
18719 * src/lex.c (token_obstack): Become static.
18720
187212001-10-18 Akim Demaille <akim@epita.fr>
18722
18723 * tests/atlocal.in (GCC): Add.
18724 * tests/calc.at: s/m4_match/m4_bmatch/.
18725 s/m4_patsubst/m4_bpatsubst/.
18726 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
18727 * configure.in: AC_SUBST(GCC).
18728
187292001-10-14 Marc Autret <autret_m@epita.fr>
18730
18731 * src/options.c (create_long_option_table): Fix.
18732
187332001-10-10 Akim Demaille <akim@epita.fr>
18734
18735 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
18736
187372001-10-04 Akim Demaille <akim@epita.fr>
18738
18739 * src/reader.c (parse_union_decl): Push the caracters in
18740 union_obstack, not attrs_obstack.
18741
187422001-10-04 Akim Demaille <akim@epita.fr>
18743
18744 Merge in the branch 1.29.
18745
18746 * src/reader.c (packsymbols): Use a temporary obstack for
18747 `%%tokendef', since output_stack is already used elsewhere.
18748
18749 2001-10-02 Akim Demaille <akim@epita.fr>
18750
18751 Bump 1.29d.
18752
18753 2001-10-02 Akim Demaille <akim@epita.fr>
18754
18755 Version 1.29c.
18756
18757 2001-10-02 Akim Demaille <akim@epita.fr>
18758
18759 * tests/regression.at (Invalid CPP headers): New.
18760 From Alexander Belopolsky.
18761 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
18762
18763 2001-10-02 Akim Demaille <akim@epita.fr>
18764
18765 * tests/regression.at (Invalid input): New.
18766 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
18767 Reported by Shura.
18768
18769 2001-10-02 Akim Demaille <akim@epita.fr>
18770
18771 * tests/calc.at: Now that --debug works, the tests must be adjusted.
18772
18773 2001-10-02 Akim Demaille <akim@epita.fr>
18774
18775 * src/output.c (output_parser): Assert `skeleton'.
18776 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
18777 systems.
18778 From Shura.
18779
18780 2001-10-01 Marc Autret <autret_m@epita.fr>
18781
18782 * src/lex.h: Echo modifications.
18783 * src/lex.c (unlex): Parameter is now token_t.
18784 From Hans Aberg.
18785
18786 2001-10-01 Marc Autret <autret_m@epita.fr>
18787
18788 * src/main.c: Include lex.h.
18789 From Hans Aberg.
18790
18791 2001-09-29 Akim Demaille <akim@epita.fr>
18792
18793 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
18794
18795 2001-09-28 Akim Demaille <akim@epita.fr>
18796
18797 * tests/testsuite.at: Update to newer Autotest.
18798 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
18799
18800 2001-09-27 Akim Demaille <akim@epita.fr>
18801
18802 Position independent wrapper.
18803
18804 * tests/bison: Remove.
18805 * tests/bison.in: New.
18806 * configure.in: Adjust.
18807
18808 2001-09-27 Paul Eggert <eggert@twinsun.com>
18809
18810 Port quotearg fixes from tar 1.13.24.
18811
18812 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
18813 tm to be declared.
18814 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
18815 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
18816
18817 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
18818 * m4/mbrtowc.m4: New file.
18819 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
18820 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
18821
18822 2001-09-27 Akim Demaille <akim@epita.fr>
18823
18824 Bump to 1.29c.
18825
18826 2001-09-27 Akim Demaille <akim@epita.fr>
18827
18828 Version 1.29b.
18829
18830 2001-09-25 Akim Demaille <akim@epita.fr>
18831
18832 * src/system.h: Include `xalloc.h'.
18833 Remove it from the C files.
18834 * src/files.c (output_files): Free the obstacks.
18835 * src/lex.c (init_lex): Rename as...
18836 (lex_init): this.
18837 (lex_free): New.
18838 * src/main.c (main): Use it.
18839
18840 2001-09-24 Marc Autret <autret_m@epita.fr>
18841
18842 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
18843 to output informations in fout (FILE*).
18844 (open_graph, close_graph): Likewise.
18845 (output_graph, output_edge, output_node): Likewise.
18846 * src/vcg.h: Update function prototypes.
18847 * src/print_graph.c (print_graph): Open output graph file.
18848 (print_actions): Adjust.
18849 * src/files.h: Remove extern declaration.
18850 * src/files.c: Remove graph_obstack declaration.
18851 (open_files): Remove graph_obstack initialization.
18852 (output_files): Remove graph_obstack saving.
18853
18854 2001-09-24 Marc Autret <autret_m@epita.fr>
18855
18856 * src/files.c (compute_output_file_names): Fix.
18857
18858 2001-09-24 Marc Autret <autret_m@epita.fr>,
18859 Akim Demaille <akim@epita.fr>
18860
18861 * src/reader.c (reader): Remove call to free_symtab ().
18862 * src/main.c (main): Call it here.
18863 Include symtab.h.
18864 * src/conflicts.c (initialize_conflicts): Rename as...
18865 (solve_conflicts): this.
18866 * src/print.c (print_core, print_actions, print_state)
18867 (print_grammar): Dump to a file instead a `output_obstack'.
18868 (print_results): Dump `output_obstack', and then proceed with the
18869 FILE *.
18870 * src/files.c (compute_output_file_names, close_files): New.
18871 (output_files): Adjust.
18872 * src/main.c (main): Adjust.
18873
18874 2001-09-23 Marc Autret <autret_m@epita.fr>
18875
18876 * src/files.c (compute_header_macro): Computes header macro name
18877 from spec_defines_file when given.
18878
18879 2001-09-23 Marc Autret <autret_m@epita.fr>
18880
18881 * src/files.c (output_files): Add default extensions.
18882
18883 2001-09-22 Akim Demaille <akim@epita.fr>
18884
18885 * src/conflicts.c (finalize_conflicts): Rename as...
18886 (free_conflicts): this.
18887
18888 2001-09-22 Akim Demaille <akim@epita.fr>
18889
18890 * src/gram.c (gram_free): Rename back as...
18891 (dummy): this.
18892 (output_token_translations): Free `token_translations'.
18893 * src/symtab.c (free_symtab): Free the tag field.
18894
18895 2001-09-22 Akim Demaille <akim@epita.fr>
18896
18897 Remove `translations' as it is always set to true.
18898
18899 * src/gram.h: Adjust.
18900 * src/reader.c (packsymbols, parse_token_decl): Adjust
18901 * src/print.c (print_grammar): Adjust.
18902 * src/output.c (output_token_translations): Adjust.
18903 * src/lex.c (lex): Adjust.
18904 * src/gram.c: Be sure the set pointers to NULL.
18905 (dummy): Rename as...
18906 (gram_free): this.
18907
18908 2001-09-22 Akim Demaille <akim@epita.fr>
18909
18910 * configure.in: Invoke AM_LIB_DMALLOC.
18911 * src/system.h: Use dmalloc.
18912 * src/LR0.c: Be sure to have pointers initialized to NULL.
18913 (allocate_itemsets): Allocate kernel_items only if needed.
18914
18915 2001-09-22 Akim Demaille <akim@epita.fr>
18916
18917 * configure.in: Bump to 1.29b.
18918 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
18919 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
18920 need xmalloc.c in calc.y.
18921 From Pascal Bart.
18922
18923 2001-09-21 Akim Demaille <akim@epita.fr>
18924
18925 Version 1.29a.
18926 * Makefile.maint, config/config.guess, config/config.sub,
18927 * config/missing: Update from masters.
18928 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
18929 upon package.m4.
18930 * configure.in (ALL_LINGUAS): Add `tr'.
18931
18932 2001-09-21 Akim Demaille <akim@epita.fr>
18933
18934 * tests/Makefile.am (package.m4): Move to...
18935 ($(srcdir)/$(TESTSUITE)): here.
18936
18937 2001-09-20 Akim Demaille <akim@epita.fr>
18938
18939 * src/complain.c: No longer try to be standalone: use system.h.
18940 Don't assume __STDC__ is defined to 1. Just test if it is defined.
18941 * src/complain.h: Likewise.
18942 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
18943 Remove the unused variable `n'.
18944 From Albert Chin-A-Young.
18945
18946 2001-09-18 Marc Autret <autret_m@epita.fr>
18947
18948 * doc/bison.1: Update.
18949 * doc/bison.texinfo (Bison Options): Update --defines and --graph
18950 descriptions.
18951 (Option Cross Key): Update.
18952 Add --graph.
18953
18954 2001-09-18 Marc Autret <autret_m@epita.fr>
18955
18956 * tests/regression.at: New test (comment in %union).
18957
18958 2001-09-18 Marc Autret <autret_m@epita.fr>
18959
18960 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
18961 do that.
18962 Reported by Keith Browne.
18963
18964 2001-09-18 Marc Autret <autret_m@epita.fr>
18965
18966 * tests/output.at: Add tests for --defines and --graph.
18967
18968 2001-09-18 Marc Autret <autret_m@epita.fr>
18969
18970 * tests/output.at: Removes tests of %{header,src}_extension features.
18971
18972 2001-09-18 Akim Demaille <akim@epita.fr>
18973
18974 * tests/Makefile.am (package.m4): New.
18975 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
18976 (_AT_CHECK_CALC_ERROR): Likewise.
18977 Factor the `, ' part of verbose error messages.
18978
18979 2001-09-18 Marc Autret <autret_m@epita.fr>
18980
18981 * src/getargs.c (longopts): Declare --defines and --graph as options
18982 with optional arguments.
18983 * src/files.h: Add extern declarations.
18984 * src/files.c (spec_graph_file, spec_defines_file): New.
18985 (output_files): Update.
18986 Remove CPP-outed code.
18987
18988 2001-09-18 Marc Autret <autret_m@epita.fr>
18989
18990 Turn off %{source,header}_extension feature.
18991
18992 * src/files.c (compute_exts_from_gf): Update.
18993 (compute_exts_from_src): Update.
18994 (output_files): CPP-out useless code.
18995 * src/files.h: Remove {header,source}_extension extern declarations.
18996 * src/reader.c (parse_dquoted_param): CPP-out.
18997 (parse_header_extension_decl): Remove.
18998 (parse_source_extension_decl): Remove.
18999 (read_declarations): Remove cases tok_{hdrext,srcext}.
19000 * src/lex.c (percent_table): Remove {header,source}_extension entries.
19001 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
19002
19003 2001-09-10 Akim Demaille <akim@epita.fr>
19004
19005 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
19006 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
19007 (AT_CHECK_OUTPUT): this.
19008 Merely check ls' exit status, its output is useless.
19009
19010 2001-09-10 Akim Demaille <akim@epita.fr>
19011
19012 * tests/calc.at: Use m4_match.
19013 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
19014
19015 2001-09-10 Marc Autret <autret_m@epita.fr>,
19016 Akim Demaille <akim@epita.fr>
19017
19018 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
19019 enum color_e.
19020 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
19021 to `normal'.
19022 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
19023 * src/lex.h: Adjust prototype.
19024 (token_t): Add `tok_undef'.
19025 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
19026 (parse_percent_token): Now returns token_t.
19027 Add default statement in switch.
19028 (lex): Separate `c' as an input variable, from the token_t result
19029 part.
19030 (unlexed): Is a token_t.
19031
19032 2001-09-10 Akim Demaille <akim@epita.fr>
19033
19034 * configure.in: Bump to 1.29a.
19035
19036 2001-09-07 Akim Demaille <akim@epita.fr>
19037
19038 Version 1.29.
19039
19040 2001-08-30 Akim Demaille <akim@epita.fr>
19041
19042 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
19043 * m4/atconfig.m4: Remove.
19044 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
19045 * tests/bison: New.
19046 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
19047 m4_if, m4_patsubst, and m4_regexp.
19048 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
19049 `input' file instead of echo.
19050
19051 2001-08-29 Akim Demaille <akim@epita.fr>
19052
19053 Bump to 1.28e.
19054
19055 2001-08-29 Akim Demaille <akim@epita.fr>
19056
19057 Version 1.28d.
19058
19059 2001-08-29 Paul Eggert <eggert@twinsun.com>
19060
19061 * src/bison.simple (yyparse): Don't take the address of an
19062 item before the start of an array, as that doesn't conform to
19063 the C Standard.
19064
19065 2001-08-29 Robert Anisko <anisko_r@epita.fr>
19066
19067 * doc/bison.texinfo (Location Tracking Calc): New node.
19068
19069 2001-08-29 Paul Eggert <eggert@twinsun.com>
19070
19071 * src/output.c (output): Do not define const, as this now
19072 causes more problems than it cures.
19073
19074 2001-08-29 Akim Demaille <akim@epita.fr>
19075
19076 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
19077 the nodes.
19078 Be sure to tag the `detailmenu'.
19079
19080 2001-08-29 Akim Demaille <akim@epita.fr>
19081
19082 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
19083 download in a tmp dir.
19084
19085 2001-08-28 Marc Autret <autret_m@epita.fr>
19086
19087 * config/depcomp: New file.
19088
19089 2001-08-28 Marc Autret <autret_m@epita.fr>
19090
19091 * doc/bison.1 (mandoc): Adjust.
19092 From Juan Manuel Guerrero.
19093
19094 2001-08-28 Marc Autret <autret_m@epita.fr>
19095
19096 * src/print_graph.c (print_state): Fix.
19097
19098 2001-08-27 Marc Autret <autret_m@epita.fr>
19099
19100 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
19101 char * members.
19102 Echo modifications to the functions prototypes.
19103 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
19104
19105 2001-08-27 Marc Autret <autret_m@epita.fr>
19106
19107 * src/vcg.c: Include `xalloc.h'.
19108 (add_colorentry): New.
19109 (add_classname): New.
19110 (add_infoname): New.
19111 * src/vcg.h: Add new prototypes.
19112
19113 2001-08-27 Akim Demaille <akim@epita.fr>
19114
19115 * Makefile.maint: Sync. again with CVS Autoconf.
19116
19117 2001-08-27 Akim Demaille <akim@epita.fr>
19118
19119 * Makefile.maint: Formatting changes.
19120 (po-update, cvs-update, update): New targets.
19121 (AMTAR): Remove.
19122
19123 2001-08-27 Akim Demaille <akim@epita.fr>
19124
19125 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19126 * Makefile.maint: Sync. with CVS Autoconf.
19127
19128 2001-08-27 Marc Autret <autret_m@epita.fr>
19129
19130 * src/vcg.h (struct infoname_s): New.
19131 (struct colorentry_s): New.
19132 (graph_s): New fields {vertical,horizontal}_order in structure.
19133 Add `infoname' field.
19134 Add `colorentry' field;
19135 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
19136 (G_HORIZONTAL_ORDER): New.
19137 (G_INFONAME): New.
19138 (G_COLORENTRY): New.
19139 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
19140 Add output of `infoname'.
19141 Add output of `colorentry'.
19142
19143 2001-08-27 Marc Autret <autret_m@epita.fr>
19144
19145 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
19146 This one shadowed a global parameter.
19147
19148 2001-08-24 Marc Autret <autret_m@epita.fr>
19149
19150 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
19151 instead of `unsigned'.
19152 (print_state): Do not call obstack_object_size () in obstack_grow ()
19153 to avoid macro variables shadowing.
19154
19155 2001-08-23 Marc Autret <autret_m@epita.fr>
19156
19157 * src/lex.c (percent_table): Typo: s/naem/name/.
19158 Add graph option.
19159 Normalize new options declarations.
19160
19161 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
19162
19163 * tests/suite.at: Exercise %header_extension and %source_extension.
19164
19165 2001-08-16 Marc Autret <autret_m@epita.fr>
19166
19167 * src/reader.c (parse_dquoted_param): New.
19168 (parse_header_extension_decl): Use it.
19169 (parse_source_extension_decl): Likewise.
19170
19171 2001-08-16 Marc Autret <autret_m@epita.fr>
19172
19173 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
19174 (get_xxxx_str): Use assert () instead of complain ().
19175 Remove return invokations in default cases.
19176 (get_decision_str): Modify default behaviour. Remove second argument.
19177 Echo modifications on calls.
19178 (output_graph): Fix.
19179
19180 2001-08-16 Marc Autret <autret_m@epita.fr>
19181
19182 * src/getargs.c (usage): Update with ``-g, --graph''.
19183
19184 2001-08-16 Marc Autret <autret_m@epita.fr>
19185
19186 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
19187 (Option Cross Key): Likewise.
19188 * doc/bison.1: Update.
19189
191902001-09-25 Pascal Bart <pascal.bart@epita.fr>
19191
19192 * src/output.c (output_master_parser): Don't finish action_obstack.
19193 (output_parser): Don't care about the muscle action, here.
19194 (prepare): Copy the action_obstack in the action muscle.
19195 (output): Free action_obstack.
19196
191972001-09-23 Pascal Bart <pascal.bart@epita.fr>
19198
19199 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
19200 will contain `%union' declaration.
19201 (parse_union_decl): Delete #line directive output.
19202 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
19203 informations about %union.
19204 (parse_union_decl): Copy the union_obstack in the muscle stype.
19205 * src/bison.simple: Add new #line directive.
19206 Add typdef %%stype YYSTYPE.
19207
192082001-09-23 Pascal Bart <pascal.bart@epita.fr>
19209
19210 * src/bison.simple: Add new `#line' directive.
19211
192122001-09-22 Pascal Bart <pascal.bart@epita.fr>
19213
19214 * src/bison.simple: New `#line' directive.
19215 * src/output.c (output_parser): Support new dynamic muscle input_line.
19216
192172001-09-22 Marc Autret <autret_m@epita.fr>
19218
19219 * src/output.c (output_master_parser): New.
19220 (output_parser): Be more re-entrant.
19221
192222001-09-21 Marc Autret <autret_m@epita.fr>
19223
19224 * src/reader.c (copy_definition, parse_union_decl): Update and use
19225 `linef' muscle.
19226 (copy_action): Likewise.
19227 Use obstack_1grow ().
19228 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
19229
192302001-09-21 Marc Autret <autret_m@epita.fr>
19231
19232 * src/options.c (option_table): Adjust.
19233 * src/lex.c (parse_percent_token): Fix.
19234
192352001-09-20 Pascal Bart <pascal.bart@epita.fr>
19236
19237 * src/options.c (symtab.h): Include it, need by lex.h.
19238
192392001-09-20 Pascal Bart <pascal.bart@epita.fr>
19240
19241 * src/lex.c (parse_percent_token): Change type of variable `tx', which
19242 is now an option_table_struct*.
19243 (option_strcmp): New function option_strcmp.
19244 (parse_percent_token): Call option_strcmp.
19245 * src/getargs.c (xalloc.h, options.h): Include it.
19246 (getargs): Call create_long_option_table.
19247 (getargs): Free longopts at the end of the function.
19248 (shortopts): Move in options.c.
19249 * src/options.c (create_long_option_table): New function. Convert
19250 information from option_table to option structure.
19251 * src/reader.c (options.h): Include it.
19252
19253 * src/Makefile.am: Adjust.
19254 * src/options.c (option_table): Create from longopts and percent_table.
19255 * src/getargs.c (longopts): Delete.
19256 * src/lex.c (struct percent_table_struct): Delete.
19257 (percent_table): Delete.
19258 (options.h): Include it.
19259 * src/options.c: Create.
19260 * src/options.h: Create.
19261 Declare enum opt_access_e.
19262 Define struct option_table_struct.
19263
192642001-09-20 Marc Autret <autret_m@epita.fr>
19265
19266 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
19267 sections of Bison.
19268
192692001-09-19 Pascal Bart <pascal.bart@epita.fr>
19270
19271 * src/bison.simple: s/%%filename/%%skeleton.
19272 * src/muscle_tab.c (getargs.h): Include it.
19273 (muscle_init): Insert new muscle skeleton.
19274
192752001-09-18 Pascal Bart <pascal.bart@epita.fr>
19276
19277 * src/output.c (output_parser): Delete unused variable actions_dumped.
19278
192792001-09-07 Pascal Bart <pascal.bart@epita.fr>
19280
19281 * src/output.c (output): Delete call to reader_output_yylsp.
19282 * src/reader.c (reader): Likewise.
19283 * src/reader.h: Delete declaration of reader_output_yylsp.
19284
192852001-09-02 Marc Autret <autret_m@epita.fr>
19286
19287 * src/reader.c: Include muscle_tab.h.
19288 (parse_union_decl): Update.
19289 (parse_macro_decl): Rename parse_muscle_decl.
19290 Update to use renamed functions and variable.
19291 (read_declarations, copy_action, read_additionnal_code, : Updated
19292 with correct variables and functions names.
19293 (packsymbols, reader): Likewise.
19294
19295 * src/reader.h (muscle_obstack): Extern declaration update.
19296
19297 * src/output.c: Include muscle_tab.h
19298 In all functions using macro_insert, change by using muscle_insert ().
19299 (macro_obstack): Rename muscle_obstack.
19300 Echo modifications in the whole file.
19301 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
19302 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
19303 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
19304
19305 * src/muscle_tab.h: Update double inclusion macros.
19306 (macro_entry_s): Rename muscle_entry_s.
19307 Update prototypes.
19308
19309 * src/muscle_tab.c: Include muscle_tab.h.
19310 Rename macro_tabble to muscle_table.
19311 (mhash1, mhash2, mcmp): Use muscle_entry.
19312 (macro_init): Rename muscle_init. Update.
19313 (macro_insert): Rename muscle_insert. Update.
19314 (macro_find): Rename muscle_find. Update.
19315
19316 * src/main.c: Include muscle_tab.h.
19317 (main): Call muscle_init ().
19318 * src/Makefile.am (bison_SOURCES): Echo modifications.
19319
193202001-09-02 Marc Autret <autret_m@epita.fr>
19321
19322 Now the files macro_tab.[ch] are named muscle_tab.[ch].
19323
19324 * src/muscle_tab.c, src/muscle_tab.h: Add files.
19325
193262001-09-02 Marc Autret <autret_m@epita.fr>
19327
19328 * src/macrotab.c, src/macrotab.h: Remove.
19329
193302001-09-01 Pascal Bart <pascal.bart@epita.fr>
19331
19332 * src/reader.c (copy_guard): Use muscle to specify the `#line'
19333 filename.
19334
193352001-09-01 Marc Autret <autret_m@epita.fr>
19336
19337 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
19338 to an explicit value to activate the feature. We do it here.
19339
193402001-08-31 Pascal Bart <pascal.bart@epita.fr>
19341
19342 * src/output.c (prepare): Delete the `filename' muscule insertion.
19343 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
19344 (parse_union_decl): Likewise.
19345 * src/macrotab.c (macro_init): Initialize filename by infile.
19346
193472001-08-31 Marc Autret <autret_m@epita.fr>
19348
19349 * src/bison.simple (YYLSP_NEEDED): New definition.
19350 * src/output.c (prepare): Add macro insertion of `locations_flag'
19351
193522001-08-31 Pascal Bart <pascal.bart@epita.fr>
19353
19354 * src/output.c (prepare): Delete insertion of previous muscles,
19355 and insert the `prefix' muscles.
19356 * src/macrotab.c (macro_init): Likewise.
19357 (macro_init): Initialization prefix directive by `yy'.
19358 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
19359 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
19360 yylval, yydebug, yyerror, yynerrs and yyparse.
19361 New directive `#define' to substitute yydebug, ... with option
19362 name_prefix.
19363
193642001-08-31 Pascal Bart <pascal.bart@epita.fr>
19365
19366 * src/main.c (main): Standardize.
19367 * src/output.c (output_table_data, output_parser): Likewise.
19368 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
19369
193702001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
19371
19372 * src/reader.c (read_additionnal_code): Rename %%user_code to
19373 %%epilogue.
19374 * src/output.c (output): Rename %%declarations to %%prologue.
19375 * src/bison.simple: Echo modifications.
19376
193772001-08-31 Marc Autret <autret_m@epita.fr>
19378
19379 * src/reader.c (readgram): CleanUp.
19380 (output_token_defines): Likewise.
19381 (packsymbols): Likewise.
19382 (reader): Likewise.
19383 * src/output.c (output): CPP-out useless code.
19384
193852001-08-31 Pascal Bart <pascal.bart@epita.fr>
19386
19387 * src/reader.c (reader): Delete obsolete call to function
19388 output_trailers and output_headers.
19389 * src/output.h: Remove obsolete functions prototypes of output_headers
19390 and output_trailers.
19391
193922001-08-30 Pascal Bart <pascal.bart@epita.fr>
19393
19394 * src/main.c: Include macrotab.h.
19395 * src/macrotab.h (macro_entry_s): Constify fields.
19396 Adjust functions prototypes.
19397 * src/macrotab.c (macro_insert): Constify key and value.
19398 (macro_find): Constify key.
19399 (macro_insert): Include 'xalloc.h'
19400 (macro_insert): Use XMALLOC.
19401 (macro_find): Constify return value.
19402 * src/output.c (output_table_data): Rename table to table_data.
19403 (output_parser): Constify macro_key, macro_value.
19404
194052001-08-30 Marc Autret <autret_m@epita.fr>
19406
19407 * src/reader.c (parse_skel_decl): New.
19408 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
19409 * src/lex.h (token_t): New token `tok_skel'.
19410 * src/lex.c (percent_table): Add skeleton option entry.
19411 Standardize.
19412
194132001-08-29 Marc Autret <autret_m@epita.fr>
19414
19415 * src/bison.simple: Add %%user_code directive at the end.
19416 * src/reader.c (read_additionnal_code): New.
19417 (reader): Use it.
19418 * src/output.c (output_program): Remove.
19419 (output): Update.
19420
194212001-08-28 Marc Autret <autret_m@epita.fr>
19422
19423 * src/output.c (output_actions): Clean up.
19424 (output_gram): CPP-out useless code.
19425 * src/reader.c (reader): Clean up, CPP-out useless code.
19426
194272001-08-28 Pascal Bart <pascal.bart@epita.fr>
19428
19429 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
19430 directive.
19431 * src/bison.simple: Add `%%definitions'.
19432
194332001-08-28 Marc Autret <autret_m@epita.fr>
19434
19435 * config/depcomp: New file.
19436
194372001-08-27 Paul Eggert <eggert@twinsun.com>
19438
19439 * src/bison.simple (yyparse): Don't take the address of an
19440 item before the start of an array, as that doesn't conform to
19441 the C Standard.
19442
194432001-08-27 Robert Anisko <robert.anisko@epita.fr>
19444
19445 * src/output.c (output): Remove the initialization of the macro
19446 obstack. It was done too late here.
19447
19448 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
19449 completely wrong.
19450 (reader): Initialize the macro obstack here, since we need it to grow
19451 '%define' directives.
19452
19453 * src/reader.h: Declare the macro obstack as extern.
19454
194552001-08-27 Robert Anisko <robert.anisko@epita.fr>
19456
19457 * src/output.c (output_parser): Fix. Store single '%' characters in
19458 the output obstack instead of throwing them away.
19459
194602001-08-27 Akim Demaille <akim@epita.fr>
19461
19462 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19463
194642001-08-25 Robert Anisko <robert.anisko@epita.fr>
19465
19466 * lib/Makefile.am: Adjust.
19467
194682001-08-25 Robert Anisko <robert.anisko@epita.fr>
19469
19470 * src/bison.simple: Update and add '%%' directives.
19471
194722001-08-25 Robert Anisko <robert.anisko@epita.fr>
19473
19474 * src/reader.c (reader): Remove calls to 'output_headers' and
19475 'output_trailers'. Remove some C output.
19476 (readgram): Disable a piece of code that was writing a default
19477 definition for 'YYSTYPE'.
19478 (reader_output_yylsp): Remove.
19479 (packsymbols): Output token defintions to a macro.
19480 (copy_definition): Disable C output.
19481
19482 * src/reader.c (parse_macro_decl): New function used to parse macro
19483 declarations.
19484 (copy_string2): Put the body of copy_string into this new function.
19485 Add a parameter to let the caller choose whether he wants to copy the
19486 string delimiters or not.
19487 (copy_string): Be a simple call to copy_string2 with the last argument
19488 bound to true.
19489 (read_declarations): Add case for macro definition.
19490 (copy_identifier): New.
19491 (parse_macro_decl): Read macro identifiers using copy_identifier
19492 rather than lex.
19493
194942001-08-25 Robert Anisko <robert.anisko@epita.fr>
19495
19496 * src/output.c (prepare): Add prefixed names.
19497 (output_parser): Output semantic actions.
19498 (output_parser): Fix bug on '%%line' directives.
19499
19500 * src/output.c (output_headers): Remove. The C code printed by this
19501 function should now be in the skeletons.
19502 (output_trailers): Remove.
19503 (output): Disable call to 'reader_output_yylsp'.
19504 (output_rule_data): Do not output tables to the table obstack.
19505
19506 * src/output.c: Remove some C dedicated output.
19507 Improve the use of macro and output obstacks.
19508 (output_defines): Remove.
19509
19510 * src/output.c (output_token_translations): Associate 'translate'
19511 table with a macro. No output to the table obstack.
19512 (output_gram): Same for 'rhs' and 'prhs'.
19513 (output_stos): Same for 'stos'.
19514 (output_rule_data): Same for 'r1' and 'r2'.
19515 (token_actions): Same for 'defact'.
19516 (goto_actions): Same for 'defgoto'.
19517 (output_base): Same for 'pact' and 'pgoto'.
19518 (output_table): Same for 'table'.
19519 (output_check): Same for 'check'.
19520
19521 * src/output.c (output_table_data): New function.
19522 (output_short_table): Remove.
19523 (output_short_or_char_table): Remove.
19524
19525 * src/output.c (output_parser): Replace most of the skeleton copy code
19526 with something new. Skeletons are now processed character by character
19527 rather than line by line, and Bison looks for '%%' macros. This is the
19528 first step in making Bison's output process (a lot) more flexible.
19529 (output_parser): Use the macro table.
19530
195312001-08-25 Robert Anisko <robert.anisko@epita.fr>
19532
19533 * src/main.c (main): Initialize the macro table.
19534
195352001-08-25 Robert Anisko <robert.anisko@epita.fr>
19536
19537 * src/lex.c (percent_table): Add tok_define.
19538 * src/lex.h: Add tok_define.
19539
195402001-08-25 Robert Anisko <robert.anisko@epita.fr>
19541
19542 * src/macrotab.c: New file.
19543 * src/macrotab.h: New file.
19544 * src/Makefile.am: Update.
19545
195462001-08-25 Robert Anisko <robert.anisko@epita.fr>
19547
19548 * lib/hash.c: New file.
19549 * lib/hash.h: New file.
19550 * lib/Makefile.am: Update.
19551
195522001-08-15 Akim Demaille <akim@epita.fr>
19553
19554 Version 1.28c.
19555
195562001-08-15 Marc Autret <autret_m@epita.fr>
19557
19558 * src/reader.c (readgram): Indent output macro YYSTYPE.
19559 (packsymbols): Likewise.
19560 (output_token_defines): Likewise.
19561 * src/files.c: Standardize.
19562 (compute_header_macro): New.
19563 (defines_obstack_save): New. Use compute_header_macro.
19564 (output_files): Update. Use defines_obstack_save.
19565
195662001-08-15 Akim Demaille <akim@epita.fr>
19567
19568 * doc/bison.texinfo (Table of Symbols): Document
19569 YYSTACK_USE_ALLOCA.
19570
195712001-08-15 Akim Demaille <akim@epita.fr>
19572
19573 * missing: Update from CVS Automake.
19574 * config/config.guess, config/config.sub, config/texinfo.tex:
19575 Update from gnu.org.
19576
195772001-08-15 Akim Demaille <akim@epita.fr>
19578
19579 * Makefile.maint: Sync with CVS Autoconf.
19580
195812001-08-14 Pascal Bart <pascal.bart@epita.fr>
19582
19583 * doc/bison.texinfo: Include GNU Free Documentation License from
19584 `fdl.texi'.
19585 * doc/fdl.texi: Add to package.
19586
195872001-08-14 Marc Autret <autret_m@epita.fr>
19588
19589 Turn on %{source,header}_extension features.
19590
19591 * src/lex.c (percent_table): Un-CPP out header_extension and
19592 source_extension.
19593 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
19594 (compute_exts_from_src): Remove conditions. It restores priorities
19595 between options.
19596
195972001-08-14 Marc Autret <autret_m@epita.fr>
19598
19599 * src/files.c (compute_base_names): Add extensions computing when
19600 `--file-prefix' used.
19601 Standardize function calls.
19602
196032001-08-13 Marc Autret <autret_m@epita.fr>
19604
19605 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
19606 defining it (defined but null disables alloca).
19607
196082001-08-13 Marc Autret <autret_m@epita.fr>
19609
19610 * src/bison.simple (_yy_memcpy): CPP reformat.
19611
196122001-08-13 Pascal Bart <pascal.bart@epita.fr>
19613
19614 * tests/atconfig.in (CPPFLAGS): Fix.
19615
196162001-08-10 Pascal Bart <pascal.bart@epita.fr>
19617
19618 * doc/bison.texinfo: Include GNU General Public License from
19619 `gpl.texi'.
19620 * doc/gpl.texi: Add to package.
19621
196222001-08-10 Marc Autret <autret_m@epita.fr>
19623
19624 * src/print_graph.h: Fix.
19625 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
19626
196272001-08-10 Akim Demaille <akim@epita.fr>
19628
19629 * src/system.h: Provide default declarations for stpcpy, strndup,
19630 and strnlen.
19631
196322001-08-10 Robert Anisko <anisko_r@epita.fr>
19633
19634 * doc/bison.texinfo (Locations): Update @$ stuff.
19635
196362001-08-09 Robert Anisko <anisko_r@epita.fr>
19637
19638 * src/bison.simple (YYLLOC_DEFAULT): Update.
19639 (yyparse): Adjust.
19640
196412001-08-08 Marc Autret <autret_m@epita.fr>
19642
19643 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
19644 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
19645 Reported by Fabrice Bauzac.
19646
196472001-08-08 Marc Autret <autret_m@epita.fr>
19648
19649 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
19650 * src/vcg.c (output_node): Fix.
19651 * src/vcg.h: Cleanup.
19652 * src/print_graph.c: Add comments.
19653 (node_output_size): New global variable. Simplify the formatting of
19654 the VCG graph output.
19655 (print_actions): Unused code is now used. It notifies the final state
19656 and no action states in the VCG graph. It also give the reduce actions.
19657 The `shift and goto' edges are red and the `go to state' edges are
19658 blue.
19659 Get the current node name and node_obstack by argument.
19660 (node_obstack): New variable.
19661 (print_state): Manage node_obstack.
19662 (print_core): Use node_obstack given by argument.
19663 A node is not only computed here but in print_actions also.
19664 (print_graph): CPP out useless code instead of commenting it.
19665
196662001-08-07 Pascal Bart <pascal.bart@epita.fr>
19667
19668 * tests/atconfig.in (CPPFLAGS): Fix.
19669
196702001-08-07 Akim Demaille <akim@epita.fr>
19671
19672 * src/print_graph.c (quote): New.
19673 (print_core): Use it.
19674
196752001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
19676
19677 * src/vcg.c (complain.h): Include it.
19678 Unepitaize `return' invocations.
19679 [NDEBUG] (main): Remove.
19680 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
19681 * src/files.c (open_files): Initialize graph_obstack.
19682 * src/print_graph.c (print_actions): CPP out useless code.
19683 (print_core): Don't output the last `\n' in labels.
19684 Use `quote'.
19685 * src/files.c (output_files): Output the VCG file.
19686 * src/main.c (main): Invoke print_graph ();
19687
196882001-08-06 Marc Autret <autret_m@epita.fr>
19689
19690 Automaton VCG graph output.
19691 Using option ``-g'' or long option ``--graph'', you can generate
19692 a gram_filename.vcg file containing a VCG description of the LALR (1)
19693 automaton of your grammar.
19694
19695 * src/main.c: Call to print_graph() function.
19696 * src/getargs.h: Update.
19697 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
19698 (graph_flag): New flag.
19699 (longopts): Update.
19700 (getargs): Add case `g'.
19701 * src/files.c (graph_obstack): New obstack struct.
19702 (open_files): Initialize new obstack.
19703 (output_files): Saves graph_obstack if required.
19704 * src/files.h (graph_obstack): New extern declaration.
19705 * src/Makefile.am: Add new source files.
19706
197072001-08-06 Marc Autret <autret_m@epita.fr>
19708
19709 * src/print_graph.c, src/print_graph.h (graph): New.
19710 * src/vcg.h: New file.
19711 * src/vcg.c: New file, VCG graph handling.
19712
197132001-08-06 Marc Autret <autret_m@epita.fr>
19714
19715 Add of %source_extension and %header_extension which specify
19716 the source or/and the header output file extension.
19717
19718 * src/files.c (compute_base_names): Remove initialisation of
19719 src_extension and header_extension.
19720 (compute_exts_from_gf): Update.
19721 (compute_exts_from_src): Update.
19722 (output_files): Update.
19723 * src/reader.c (parse_header_extension_decl): New.
19724 (parse_source_extension_decl): New.
19725 (read_declarations): New case statements for the new tokens.
19726 * src/lex.c (percent_table): Add entries for %source_extension
19727 and %header_extension.
19728 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
19729
197302001-08-06 Marc Autret <autret_m@epita.fr>
19731
19732 * configure.in: Bump to 1.28c.
19733 * doc/bison.texinfo: Texinfo thingies.
19734
197352001-08-04 Pascal Bart <pascal.bart@epita.fr>
19736
19737 * tests/atconfig.in (CPPFLAGS): Add.
19738 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
19739
197402001-08-03 Akim Demaille <akim@epita.fr>
19741
19742 Version 1.28b.
19743
197442001-08-03 Akim Demaille <akim@epita.fr>
19745
19746 * tests/Makefile.am (check-local): Ship testsuite.
19747 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
19748 Include `string.h'.
19749
197502001-08-03 Akim Demaille <akim@epita.fr>
19751
19752 * configure.in: Try using -Wformat when compiling.
19753
197542001-08-03 Akim Demaille <akim@epita.fr>
19755
19756 * configure.in: Bump to 1.28b.
19757
197582001-08-03 Akim Demaille <akim@epita.fr>
19759
19760 * src/complain.c: Adjust strerror_r portability issues.
19761
197622001-08-03 Akim Demaille <akim@epita.fr>
19763
19764 Version 1.28a.
19765
197662001-08-03 Akim Demaille <akim@epita.fr>
19767
19768 * src/getargs.c, src/getarg.h (skeleton)): Constify.
19769 * src/lex.c (literalchar): Avoid name clashes on `buf'.
19770 * src/getargs.c: Include complain.h.
19771 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
19772 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
19773
197742001-08-03 Akim Demaille <akim@epita.fr>
19775
19776 * src/reader.c (readgram): Display hidden chars in error messages.
19777
197782001-08-03 Akim Demaille <akim@epita.fr>
19779
19780 Update to gettext 0.10.39.
19781
197822001-08-03 Akim Demaille <akim@epita.fr>
19783
19784 * lib/strspn.c: New.
19785
197862001-08-01 Marc Autret <autret_m@epita.fr>
19787
19788 * doc/bison.texinfo: Update.
19789 * doc/bison.1 (mandoc): Update.
19790 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
19791 * src/files.c: Support output files extensions computing.
19792 (src_extension): New static variable.
19793 (header_extension): New static variable.
19794 (tr): New function.
19795 (get_extension_index): New function, gets the index of an extension
19796 filename in a string.
19797 (compute_exts_from_gf): New function, computes extensions from the
19798 grammar file extension.
19799 (compute_exts_from_src): New functions, computes extensions from the
19800 C source file extension, file given by ``-o'' option.
19801 (compute_base_names): Update.
19802 (output_files): Update.
19803
198042001-08-01 Robert Anisko <anisko_r@epita.fr>
19805
19806 * doc/bison.texi: Document @$.
19807 (Locations): New section.
19808
198092001-07-18 Akim Demaille <akim@epita.fr>
19810
19811 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
19812 * config/prev-version.txt, config/move-if-change: New.
19813 * Makefile.am: Adjust.
19814
198152001-07-08 Pascal Bart <pascal.bart@epita.fr>
19816
19817 * src/bison.simple (yyparse): Suppress warning `comparaison
19818 between signed and unsigned'.
19819
198202001-07-05 Pascal Bart <pascal.bart@epita.fr>
19821
19822 * src/getargs.h (raw_flag): Remove.
19823 * src/getargs.c: Die on `-r'/`--raw'.
19824 * src/lex.c (parse_percent_token): Die on `%raw'.
19825 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
19826 * tests/calc.at: Suppress test with option `--raw'.
19827
198282001-07-14 Akim Demaille <akim@epita.fr>
19829
19830 * config/: New.
19831 * configure.in: Require Autoconf 2.50.
19832 Update to gettext 0.10.38.
19833
198342001-03-16 Akim Demaille <akim@epita.fr>
19835
19836 * doc/bison.texinfo: ANSIfy the examples.
19837
198382001-03-16 Akim Demaille <akim@epita.fr>
19839
19840 * getargs.c (skeleton): New variable.
19841 (longopts): --skeleton is a new option.
19842 (shortopts, getargs): -S is a new option.
19843 * getargs.h: Declare skeleton.
19844 * output.c (output_parser): Use it.
19845
198462001-03-16 Akim Demaille <akim@epita.fr>
19847
19848 * m4/strerror_r.m4: New.
19849 * m4/error.m4: Run AC_FUNC_STRERROR_R.
19850 * lib/error.h, lib/error.c: Update.
19851
198522001-03-16 Akim Demaille <akim@epita.fr>
19853
19854 * src/getargs.c (longopts): Clean up.
19855
198562001-02-21 Akim Demaille <akim@epita.fr>
19857
19858 * src/reader.c (gensym): `gensym_count' is your own.
19859 Use a static buf to create the symbol name, as token_buffer is no
19860 longer a buffer.
19861
198622001-02-08 Akim Demaille <akim@epita.fr>
19863
19864 * src/conflicts.c (conflict_report): Be sure not to append to res
19865 between two calls, which could happen if both first sprintf were
19866 skipped, but not the first cp += strlen.
19867
198682001-02-08 Akim Demaille <akim@epita.fr>
19869
19870 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
19871 New, from fileutils 4.0.37.
19872 * configure.in: Require Autoconf 2.49c. I took some time before
19873 making this decision. This is the only way out for portability
19874 issues in Bison, it would mean way too much duplicate effort to
19875 import in Bison features implemented in 2.49c since 2.13.
19876 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
19877
198782001-02-02 Akim Demaille <akim@epita.fr>
19879
19880 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
19881 * lib/xalloc.h, lib/xmalloc.c: Update.
19882
198832001-01-19 Akim Demaille <akim@epita.fr>
19884
19885 Get rid of the ad hoc handling of token_buffer in the scanner: use
19886 the obstacks.
19887
19888 * src/lex.c (token_obstack): New.
19889 (init_lex): Initialize it. No longer call...
19890 (grow_token_buffer): this. Remove it.
19891 Adjust all the places which used it to use the obstack.
19892
198932001-01-19 Akim Demaille <akim@epita.fr>
19894
19895 * src/lex.h: Rename all the tokens:
19896 s/\bENDFILE\b/tok_eof/g;
19897 s/\bIDENTIFIER\b/tok_identifier/g;
19898 etc.
19899 Let them be enums, not #define, to ease debugging.
19900 Adjust all the code.
19901
199022001-01-18 Akim Demaille <akim@epita.fr>
19903
19904 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
19905 * src/lex.c (maxtoken, grow_token_buffer): Static.
19906
199072001-01-18 Akim Demaille <akim@epita.fr>
19908
19909 Since we now use obstacks, more % directives can be enabled.
19910
19911 * src/lex.c (percent_table): Also accept `%yacc',
19912 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
19913 `%debug'.
19914 Handle the actions for `%semantic_parser' and `%pure_parser' here,
19915 instead of returning a token.
19916 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
19917 * src/reader.c (read_declarations): Adjust.
19918 * src/files.c (open_files): Don't call `compute_base_names', don't
19919 compute `attrsfile' since they depend upon data which might be
19920 *in* the input file now.
19921 (output_files): Do it here.
19922 * src/output.c (output_headers): Document the fact that this patch
19923 introduces a guaranteed SEGV for semantic parsers.
19924 * doc/bison.texinfo: Document them.
19925 * tests/suite.at: Exercise these %options.
19926
199272000-12-20 Akim Demaille <akim@epita.fr>
19928
19929 Also handle the output file (--verbose) with obstacks.
19930
19931 * files.c (foutput): Remove.
19932 (output_obstack): New.
19933 Adjust all dependencies.
19934 * src/conflicts.c: Return a string.
19935 * src/system.h (obstack_grow_string): Rename as...
19936 (obstack_sgrow): this. Be ready to work with non literals.
19937 (obstack_fgrow4): New.
19938
199392000-12-20 Akim Demaille <akim@epita.fr>
19940
19941 * src/files.c (open_files): Fix the computation of short_base_name
19942 in the case of `-o foo.tab.c'.
19943
199442000-12-20 Akim Demaille <akim@epita.fr>
19945
19946 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
19947 (copy_dollar): Now that everything uses obstacks, get rid of the
19948 FILE * parameters.
19949
199502000-12-20 Akim Demaille <akim@epita.fr>
19951
19952 * src/files.c (open_files): Actually the `.output' file is based
19953 on the short_base_name, not base_name.
19954 * tests/suite.at (Checking output file names): Adjust.
19955
199562000-12-20 Akim Demaille <akim@epita.fr>
19957
19958 * src/bison.s1: Remove, we now use directly...
19959 * src/bison.simple: this.
19960 * src/Makefile.am: Use pkgdata instead of data.
19961
199622000-12-20 Akim Demaille <akim@epita.fr>
19963
19964 * src/files.c (guard_obstack): New.
19965 (open_files): Initialize it.
19966 (output_files): Dump it...
19967 * src/files.h: Export it.
19968 * src/reader.c (copy_guard): Use it.
19969
199702000-12-19 Akim Demaille <akim@epita.fr>
19971
19972 * src/files.c (outfile, defsfile, actfile): Removed as global
19973 vars.
19974 (open_files): Don't compute them.
19975 (output_files): Adjust.
19976 (base_name, short_base_name): Be global.
19977 Adjust dependencies.
19978
199792000-12-19 Akim Demaille <akim@epita.fr>
19980
19981 * src/files.c (strsuffix): New.
19982 (stringappend): Be just like strcat but allocate.
19983 (base_names): Eve out from open_files.
19984 Try to simplify the rather hairy computation of base_name and
19985 short_base_name.
19986 (open_files): Use it.
19987 * tests/suite.at (Checking output file names): New test.
19988
199892000-12-19 Akim Demaille <akim@epita.fr>
19990
19991 * src/system.h (obstack_grow_literal_string): Rename as...
19992 (obstack_grow_string): this.
19993 * src/output.c (output_parser): Recognize `%% actions' instead of
19994 `$'.
19995 * src/bison.s1: s/$/%% actions/.
19996 * src/bison.hairy: Likewise.
19997
199982000-12-19 Akim Demaille <akim@epita.fr>
19999
20000 * src/output.c (output_parser): Compute the `#line' lines when
20001 there are.
20002 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
20003 Suggested by Hans Aberg.
20004
200052000-12-19 Akim Demaille <akim@epita.fr>
20006
20007 Let the handling of the skeleton files be local to the procedures
20008 that use it.
20009
20010 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
20011 longer static.
20012 (fparser, open_extra_files): Remove.
20013 (open_files, output_files): Don't take care of fparser.
20014 * src/files.h: Adjust.
20015 * src/output.c (output_parser): Open and close the file to the
20016 skeleton.
20017 * src/reader.c (read_declarations): When %semantic_parser, open
20018 fguard.
20019
200202000-12-19 Akim Demaille <akim@epita.fr>
20021
20022 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
20023 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
20024
200252000-12-19 Akim Demaille <akim@epita.fr>
20026
20027 * src/files.c (open_files): Yipee! We no longer need all the code
20028 looking for `/tmp' since we have no tmp file.
20029
200302000-12-19 Akim Demaille <akim@epita.fr>
20031
20032 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
20033 New macros.
20034 * src/files.c (open_files): Less dependency on MSDOS etc.
20035
200362000-12-14 Akim Demaille <akim@epita.fr>
20037
20038 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
20039 Provide a default definition.
20040 Use it when executing the default @ action.
20041 * src/reader.c (reader_output_yylsp): No longer include
20042 `timestamp' and `text' in the default YYLTYPE.
20043
200442000-12-12 Akim Demaille <akim@epita.fr>
20045
20046 * src/reader.c (copy_definition, parse_union_decl, copy_action)
20047 (copy_guard): Quote the file names.
20048 Reported by Laurent Mascherpa.
20049
200502000-12-12 Akim Demaille <akim@epita.fr>
20051
20052 * src/output.c (output_headers, output_program, output): Be sure
20053 to escape special characters when outputting filenames.
20054 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
20055 (output_headers): Don't depend on them, Use ACTSTR.
20056
200572000-11-17 Akim Demaille <akim@epita.fr>
20058
20059 * lib/obstack.h: Formatting changes.
20060 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
20061 prevents type checking.
20062 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
20063 cast the value to (void *): assigning a `foo *' to a `void *'
20064 variable is valid.
20065 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
20066 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
20067 append characters.
20068
200692000-11-17 Akim Demaille <akim@epita.fr>
20070
20071 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
20072 as...
20073 (suite.m4, regression.m4, calc.m4): these.
20074 * tests/atgeneral.m4: Update from CVS Autoconf.
20075
200762000-11-17 Akim Demaille <akim@epita.fr>
20077
20078 * tests/regression.m4 (%union and --defines): New test,
20079 demonstrating a current bug in the obstack implementation.
20080
200812000-11-17 Akim Demaille <akim@epita.fr>
20082
20083 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
20084 macros.
20085 Use them to declare the variables which are global or local to
20086 `yyparse'.
20087
200882000-11-17 Akim Demaille <akim@epita.fr>
20089
20090 * acconfig.h: Remove, no longer used.
20091
200922000-11-07 Akim Demaille <akim@epita.fr>
20093
20094 * src: s/Copyright (C)/Copyright/g.
20095
200962000-11-07 Akim Demaille <akim@epita.fr>
20097
20098 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
20099 defining.
20100 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
20101
201022000-11-07 Akim Demaille <akim@epita.fr>
20103
20104 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
20105 Merge in a single CPP if/else.
20106
201072000-11-07 Akim Demaille <akim@epita.fr>
20108
20109 * src/output.c (output): Remove useless variables.
20110 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
20111 argument `data' for consistency with the prototypes.
20112 Qualify it `const'.
20113 (obstack_copy, obstack_copy0): Rename the second argument as
20114 `address' for consistency. Qualify it `const'.
20115 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
20116 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
20117 `const' their input argument (`data' or `address').
20118 Adjust the corresponding macros to include `const' in casts.
20119
201202000-11-03 Akim Demaille <akim@epita.fr>
20121
20122 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
20123 s/PFILE1/BISON_HAIRY/.
20124 Adjust dependencies.
20125
201262000-11-03 Akim Demaille <akim@epita.fr>
20127
20128 For some reason, this was not applied.
20129
20130 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20131 `unlink': it's no longer used.
20132
201332000-11-03 Akim Demaille <akim@epita.fr>
20134
20135 * src/files.c (skeleton_find): New function, eved out of...
20136 (open_files, open_extra_files): here.
20137
201382000-11-03 Akim Demaille <akim@epita.fr>
20139
20140 Don't use `atexit'.
20141
20142 * src/files.c (obstack_save): New function.
20143 (done): Rename as...
20144 (output_files): this.
20145 Use `obstack_save'.
20146 * src/main.c (main): Don't use `atexit' to register `done', since
20147 it no longer has to remove tmp files, just call `output_files'
20148 when there are no errors.
20149
201502000-11-02 Akim Demaille <akim@epita.fr>
20151
20152 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20153 `unlink': it's no longer used.
20154 * src/files.h: Formatting changes.
20155
201562000-11-02 Akim Demaille <akim@epita.fr>
20157
20158 Remove the last uses of mktemp and unlink/delete.
20159
20160 * src/files.c (fdefines, ftable): Removed.
20161 (defines_ostack, table_obstack): New.
20162 Adjust dependencies of the former into uses of the latter.
20163 * src/output.c (output_short_or_char_table, output_short_table):
20164 Convert to using obstacks.
20165 * src/reader.c (copy_comment2): Accept one FILE * and two
20166 obstacks.
20167 (output_token_defines, reader_output_yylsp): Use obstacks.
20168 * src/system.h (obstack_fgrow3): New.
20169 * po/POTFILES.in: Adjust.
20170
201712000-11-01 Akim Demaille <akim@epita.fr>
20172
20173 Change each use of `fattrs' into a use of `attrs_obstack'.
20174
20175 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
20176 * src/files.c (fattrs): Remove.
20177 (attrs_obstack): New.
20178 Adjust all dependencies.
20179 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
20180
201812000-11-01 Akim Demaille <akim@epita.fr>
20182
20183 Introduce obstacks.
20184 Change each use of `faction' into a use of `action_obstack'.
20185
20186 * lib/obstack.h, lib/obstack.c: New files.
20187 * src/files.c (faction): Remove.
20188 (action_obstack): New.
20189 Adjust all dependencies.
20190
201912000-10-20 Akim Demaille <akim@epita.fr>
20192
20193 * lib/quote.h (PARAMS): New macro. Use it.
20194
201952000-10-16 Akim Demaille <akim@epita.fr>
20196
20197 * src/output.c (output_short_or_char_table): New function.
20198 (output_short_table, output_token_translations): Use it.
20199 (goto_actions): Use output_short_table.
20200
202012000-10-16 Akim Demaille <akim@epita.fr>
20202
20203 * src/symtab.c (bucket_new): New function.
20204 (getsym): Use it.
20205
20206 * src/output.c (output_short_table): New argument to display the
20207 comment associated with the table.
20208 Adjust dependencies.
20209 (output_gram): Use it.
20210 (output_rule_data): Nicer output layout for YYTNAME.
20211
202122000-10-16 Akim Demaille <akim@epita.fr>
20213
20214 * src/lex.c (read_typename): New function.
20215 (lex): Use it.
20216 * src/reader.c (copy_dollar): Likewise.
20217
202182000-10-16 Akim Demaille <akim@epita.fr>
20219
20220 * src/reader.c (copy_comment2): Expect the input stream to be on
20221 the `/' which is suspected to open a comment, instead of being
20222 called after `//' or `/*' was read.
20223 (copy_comment, copy_definition, parse_union_decl, copy_action)
20224 (copy_guard): Adjust.
20225
202262000-10-16 Akim Demaille <akim@epita.fr>
20227
20228 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
20229 `read_signed_integer'.
20230
202312000-10-16 Akim Demaille <akim@epita.fr>
20232
20233 * src/reader.c (copy_dollar): New function.
20234 (copy_guard, copy_action): Use it.
20235
202362000-10-16 Akim Demaille <akim@epita.fr>
20237
20238 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
20239 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
20240 New files, from Fileutils 4.0.27.
20241 * src/main.c (printable_version): Remove.
20242 * src/lex.c, src/reader.c: Use `quote'.
20243
202442000-10-04 Akim Demaille <akim@epita.fr>
20245
20246 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
20247
202482000-10-04 Akim Demaille <akim@epita.fr>
20249
20250 * doc/bison.texinfo: Various typos spotted by Neil Booth.
20251
202522000-10-04 Akim Demaille <akim@epita.fr>
20253
20254 When a literal string is used to define two different tokens,
20255 `bison -v' segfaults.
20256 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
20257
20258 * tests/regression.m4: New file.
20259 Include the core of the sample provided by Piotr Gackiewicz.
20260 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
20261 properly.
20262
202632000-10-04 Akim Demaille <akim@epita.fr>
20264
20265 * src/reader.c (parse_expect_decl): Keep `count' within the size
20266 of `buffer'.
20267 From Neil Booth.
20268
202692000-10-02 Paul Eggert <eggert@twinsun.com>
20270
20271 * bison.s1 (yyparse): Assign the default value
20272 unconditionally, to avoid a GCC warning and make the parser a
20273 tad smaller.
20274
202752000-10-02 Akim Demaille <akim@epita.fr>
20276
20277 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
20278 options.
20279
202802000-10-02 Akim Demaille <akim@epita.fr>
20281
20282 * src/derives.c, src/print.c, src/reduce.c: To ease the
20283 translation, move some `\n' out of the translated strings.
20284
202852000-10-02 Akim Demaille <akim@epita.fr>
20286
20287 The location tracking mechanism is precious for parse error
20288 messages. Nevertheless, it is enabled only when `@n' is used in
20289 the grammar, which is a different issue (you can use it in error
20290 message, but not in the grammar per se). Therefore, there should
20291 be another means to enable it.
20292
20293 * src/getargs.c (getargs): Support `--locations'.
20294 (usage): Report it.
20295 * src/getargs.h (locationsflag): Export it.
20296 * src/lex.c (percent_table): Support `%locations'.
20297 * src/reader.c (yylsp_needed): Remove this variable, now replaced
20298 with `locationsflag'.
20299 * doc/bison.texinfo: Document `--locations' and `%locations'.
20300 Sort the options.
20301 * tests/calc.m4: Test it.
20302
20303 For regularity of the names, replace each
20304 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
20305 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
20306 In addition replace each `flag' with `_flag'.
20307
203082000-10-02 Akim Demaille <akim@epita.fr>
20309
20310 Also test parse error messages, including with YYERROR_VERBOSE.
20311
20312 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
20313 associative).
20314 Use it to check the computations.
20315 Use it to check `nonassoc' is honored.
20316 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
20317 `--yyerror-verbose'.
20318 (_AT_CHECK_CALC): Adjust to this option.
20319 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
20320
203212000-10-02 Akim Demaille <akim@epita.fr>
20322
20323 Test also `--verbose', `--defines' and `--name-prefix'. Testing
20324 the latter demonstrates a flaw in the handling of non debugging
20325 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
20326 was used in order to simplify:
20327
20328 #if YYDEBUG
20329 if (yydebug)
20330 {
20331 ...
20332 }
20333 #endif
20334
20335 into
20336
20337 if (yydebug)
20338 {
20339 ...
20340 }
20341
20342 unfortunately this leads to a CPP conflict when
20343 `--name-prefix=foo' is used since it produces `#define yydebug
20344 foodebug'.
20345
20346 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
20347 (YYDPRINTF): New macro.
20348 Spread its use.
20349 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
20350 the bison options.
20351 Also test `--verbose', `--defines' and `--name-prefix'.
20352
203532000-10-02 Akim Demaille <akim@epita.fr>
20354
20355 Improve the readability of the produced parsers.
20356
20357 * src/bison.s1: Formatting changes.
20358 Improve the comment related to the `$' mark.
20359 (yydefault): Don't fall through to `yyresume': `goto' there.
20360 * src/output.c (output_parser): When the `$' is met, skip the end
20361 of its line.
20362 New variable, `number_of_dollar_signs', to check there's exactly
20363 one `$' in the parser skeleton.
20364
203652000-10-02 Akim Demaille <akim@epita.fr>
20366
20367 * lib/xstrdup.c: New file, from the fileutils.
20368 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
20369 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
20370 instead of strlen + xmalloc + strcpy.
20371 * src/symtab.c (copys): Remove, use xstrdup instead.
20372
203732000-10-02 Akim Demaille <akim@epita.fr>
20374
20375 * src/gram.h (associativity): New enum type which replaces the
20376 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
20377 `right_assoc', `left_assoc' and `non_assoc'.
20378 Adjust all dependencies.
20379 * src/reader.c: Formatting changes.
20380 (LTYPESTR): Don't define it, use it as a literal in
20381 `reader_output_yylsp'.
20382 * src/symtab.h (symbol_class): New enum type which replaces the
20383 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
20384 `sunknown', `stoken and `snterm'.
20385
203862000-10-02 Akim Demaille <akim@epita.fr>
20387
20388 * src/getargs.c (fixed_outfiles): Rename as...
20389 (yaccflag): for consistency and accuracy.
20390 Adjust dependencies.
20391
203922000-10-02 Akim Demaille <akim@epita.fr>
20393
20394 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
20395 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
20396 difficult and introduced a lot of core dump. It turns out that
20397 Bison used an implementation of `xmalloc' based on `calloc', and
20398 at various places it does depend upon the initialization to 0. I
20399 have not tried to isolate the pertinent places, and all the former
20400 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
20401 someone should address this issue.
20402
20403 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
20404 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
20405 files.
20406 Adjust dependencies.
20407 * src/warshall.h: New file.
20408 Propagate.
20409
204102000-10-02 Akim Demaille <akim@epita.fr>
20411
20412 Various anti-`extern in *.c' changes.
20413
20414 * src/system.h: Include `assert.h'.
20415
204162000-10-02 Akim Demaille <akim@epita.fr>
20417
20418 * src/state.h (nstates, final_state, first_state, first_shift)
20419 (first_reduction): Move their exportation from here...
20420 * src/LR0.h: to here.
20421 Adjust dependencies.
20422 * src/getargs.c (statisticsflag): New variable.
20423 Add support for `--statistics'.
20424 Adjust dependencies.
20425
20426 Remove a lot of now useless `extern' statements in most files.
20427
204282000-10-02 Akim Demaille <akim@epita.fr>
20429
20430 * src/LR0.h: New file.
20431 Propagate its use.
20432
204332000-10-02 Akim Demaille <akim@epita.fr>
20434
20435 * src/print.h: New file.
20436 Propagate its use.
20437 * src/print.c: Formatting and ordering changes.
20438 (verbose, terse): Replace with...
20439 (print_results): this new function.
20440 Adjust dependencies.
20441
204422000-10-02 Akim Demaille <akim@epita.fr>
20443
20444 * src/conflicts.c (conflict_report): New function.
20445 (conflict_log, verbose_conflict_log): Replace with...
20446 (print_conflicts): this function.
20447 Adjust dependencies.
20448 * src/conflicts.h: New file.
20449 Propagate its inclusion.
20450
204512000-10-02 Akim Demaille <akim@epita.fr>
20452
20453 * src/nullable.h: New file.
20454 Propagate its inclusion.
20455 * src/nullable.c: Formatting changes.
20456
204572000-10-02 Akim Demaille <akim@epita.fr>
20458
20459 * src/reduce.h: New file.
20460 Propagate its inclusion.
20461 * src/reduce.c: Topological sort and other formatting changes.
20462 (bool, TRUE, FALSE): Move their definition to...
20463 * src/system.h: here.
20464
204652000-10-02 Akim Demaille <akim@epita.fr>
20466
20467 * src/files.c: Formatting changes.
20468 (tryopen, tryclose, openfiles): Rename as...
20469 (xfopen, xfclose, open_files): this.
20470 (stringappend): static.
20471 * src/files.h: Complete the list of exported symbols.
20472 Propagate its use.
20473
204742000-10-02 Akim Demaille <akim@epita.fr>
20475
20476 * src/reader.h: New file.
20477 Propagate its use instead of tedious list of `extern' and
20478 prototypes.
20479 * src/reader.c: Formatting changes, topological sort,
20480 s/register//.
20481
204822000-10-02 Akim Demaille <akim@epita.fr>
20483
20484 * src/lex.h: Prototype `lex.c' exported functions.
20485 * src/reader.c: Adjust.
20486 * src/lex.c: Formatting changes.
20487 (safegetc): Rename as...
20488 (xgetc): this.
20489
204902000-10-02 Akim Demaille <akim@epita.fr>
20491
20492 * src/lalr.h: New file.
20493 Propagate its inclusion instead of prototypes and `extern'.
20494 * src/lalr.c: Formatting changes, topological sorting etc.
20495
204962000-10-02 Akim Demaille <akim@epita.fr>
20497
20498 * src/output.c (token_actions): Introduce a temporary array,
20499 YYDEFACT, that makes it possible for this function to use
20500 output_short_table.
20501
205022000-10-02 Akim Demaille <akim@epita.fr>
20503
20504 `user_toknums' is output as a `short[]' in `output.c', while it is
20505 defined as a `int[]' in `reader.c'. For consistency with the
20506 other output tables, `user_toknums' is now defined as a table of
20507 shorts.
20508
20509 * src/reader.c (user_toknums): Be a short table instead of an int
20510 table.
20511 Adjust dependencies.
20512
20513 Factor the short table outputs.
20514
20515 * src/output.c (output_short_table): New function.
20516 * src/output.c (output_gram, output_stos, output_rule_data)
20517 (output_base, output_table, output_check): Use it.
20518
205192000-10-02 Akim Demaille <akim@epita.fr>
20520
20521 * src/output.c (output): Topological sort of the functions, in
20522 order to get rid of the `static' prototypes.
20523 No longer use `register'.
20524 * src/output.h: New file.
20525 Propagate its inclusion in files explicitly prototyping functions
20526 from output.c.
20527
205282000-09-21 Akim Demaille <akim@epita.fr>
20529
20530 * src/atgeneral.m4: Update from Autoconf.
20531
205322000-09-21 Akim Demaille <akim@epita.fr>
20533
20534 * src/closure.h: New file.
20535 * src/closure.c: Formatting changes, topological sort over the
20536 functions, use of closure.h.
20537 (initialize_closure, finalize_closure): Rename as...
20538 (new_closure, free_closure): these. Adjust dependencies.
20539 * src/LR0.c: Formatting changes, topological sort, use of
20540 cloture.h.
20541 (initialize_states): Rename as...
20542 (new_states): this.
20543 * src/Makefile.am (noinst_HEADERS): Adjust.
20544
205452000-09-20 Akim Demaille <akim@epita.fr>
20546
20547 * src/acconfig.h: Don't protect config.h against multiple
20548 inclusion.
20549 Don't define PARAMS.
20550 * src/system.h: Define PARAMS.
20551 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
20552 purpose of config.h. system.h must not try to fix wrong
20553 definitions in config.h.
20554
205552000-09-20 Akim Demaille <akim@epita.fr>
20556
20557 * src/derives.h: New file.
20558 * src/main.c, src/derives.h: Use it.
20559 Formatting changes.
20560 * src/Makefile.am (noinst_HEADERS): Adjust.
20561
205622000-09-20 Akim Demaille <akim@epita.fr>
20563
20564 * tests/atgeneral.m4: Update from Autoconf.
20565 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
20566 (AT_CHECK_CALC): New macros.
20567 Use these macros to test bison with options `', `--raw',
20568 `--debug', `--yacc', `--yacc --debug'.
20569
205702000-09-19 Akim Demaille <akim@epita.fr>
20571
20572 * src/output.c: Formatting changes.
20573 * src/machine.h: Remove, leaving its contents in...
20574 * src/system.h: here.
20575 Include stdio.h.
20576 Adjust all dependencies on stdio.h and machine.h.
20577 * src/getargs.h: New file.
20578 Let all `extern' declarations about getargs.c be replaced with
20579 inclusion of `getargs.h'.
20580 * src/Makefile.am (noinst_HEADERS): Adjust.
20581
20582 * tests/calc.m4 (yyin): Be initialized in main, not on the global
20583 scope.
20584 (yyerror): Returns void, not int.
20585 * doc/bison.texinfo: Formatting changes.
20586
205872000-09-19 Akim Demaille <akim@epita.fr>
20588
20589 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
20590 portable.
20591
205922000-09-18 Akim Demaille <akim@epita.fr>
20593
20594 * configure.in: Append WARNING_CFLAGS to CFLAGS.
20595 * src/Makefile.am (INCLUDES): Don't.
20596 Be ready to fetch headers in lib/.
20597
205982000-09-18 Akim Demaille <akim@epita.fr>
20599
20600 * doc/bison.texinfo: Update the copyright.
20601 ANSIfy and GNUify the examples.
20602 Remove the old menu.
20603
206042000-09-18 Akim Demaille <akim@epita.fr>
20605
20606 First set of tests: use the `calc' example from the documentation.
20607
20608 * src/bison.s1 (yyparse): Condition the code using `yytname' which
20609 is defined only when YYDEBUG is.
20610 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
20611 * src/files.c (tryopen, tryclose): Formatting changes.
20612 Move to the top and be static.
20613 * src/reader.c (read_signed_integer): Likewise.
20614 * tests/calc.m4: New file.
20615 * Makefile.am, suite.m4: Adjust.
20616 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
20617
206182000-09-18 Akim Demaille <akim@epita.fr>
20619
20620 Add support for an Autotest test suite for Bison.
20621
20622 * m4/m4.m4, m4/atconfig.m4: New files.
20623 * m4/Makefile.am (EXTRA_DIST): Adjust.
20624 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
20625 files.
20626 * src/getargs.c: Display a more standard --version message.
20627 * src/reader.c (reader): Formatting changes.
20628 No longer depend upon VERSION_STRING.
20629 * configure.in: No longer use `dnl'.
20630 Set up the test suite and the new directory `tests/.
20631 (VERSION_STRING): Remove.
20632
206332000-04-14 Akim Demaille <akim@epita.fr>
20634
20635 * src/reader.c (copy_comment2): New function, same as former
20636 `copy_comment', but outputs into two FILE *.
20637 (copy_comment): Use it.
20638 (parse_union_decl): Use it.
20639 (get_type, parse_start_decl): Use the same `invalid' message.
20640 (parse_start_decl, parse_union_decl): Use the same `multiple'
20641 message.
20642 (parse_union_decl, copy_guard, copy_action): Use the same
20643 `unmatched' message.
20644 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
20645
206462000-03-31 Akim Demaille <akim@epita.fr>
20647
20648 * src/files.c (tryopen, tryclose): Move to the top.
20649 Be static.
20650
206512000-03-31 Akim Demaille <akim@epita.fr>
20652
20653 * src/main.c (main): Don't call `done', exit does it.
20654
206552000-03-31 Akim Demaille <akim@epita.fr>
20656
20657 * allocate.c: s/return (foo)/return foo/.
20658 * lalr.c: Likewise.
20659 * LR0.c: Likewise.
20660 * output.c: Likewise.
20661 * reader.c: Likewise.
20662 * symtab.c: Likewise.
20663 * vmsgetargs.c: Likewise.
20664
206652000-03-31 Akim Demaille <akim@epita.fr>
20666
20667 Clean up the error reporting functions.
20668
20669 * src/report.c: New file.
20670 * src/report.h: Likewise.
20671 * src/Makefile.am: Adjust.
20672 * m4/error.m4: New file.
20673 * m4/Makefile.am: Adjust.
20674 * configure.in (jm_PREREQ_ERROR): Call it.
20675 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
20676 Remove.
20677 (fatal, fatals): Remove. All callers use complain.c::fatal.
20678 (warn, warni, warns, warnss, warnss): Remove. All callers use
20679 complain.c::complain.
20680 (toomany): Remove, use fatal instead.
20681 * src/files.c (done): No argument, use complain_message_count.
20682 * src/main.c (main): Register `done' to `atexit'.
20683
20684 * src/getargs.c (usage): More `fputs', less `fprintf'.
20685
206862000-03-28 Akim Demaille <akim@epita.fr>
20687
20688 * lib/: New directory.
20689 * Makefile.am (SUBDIRS): Adjust.
20690 * configure.in: Adjust.
20691 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
20692 useless.
20693 * src/alloca.c: Moved to lib/.
20694 * src/getopt.c: Likewise.
20695 * src/getopt1.c: Likewise.
20696 * src/getopt.h: Likewise.
20697 * src/ansi2knr.c: Likewise.
20698 * src/ansi2knr.1: Likewise.
20699 * src/Makefile.am: Adjust.
20700 * lib/Makefile.am: New file.
20701
207022000-03-28 Akim Demaille <akim@epita.fr>
20703
20704 * src/getargs.c (usage): Refresh the help message.
20705
207062000-03-17 Akim Demaille <akim@epita.fr>
20707
20708 * src/getopt1.c: Updated from textutils 2.0e
20709 * src/getopt.c: Likewise.
20710 * src/getopt.h: Likewise.
20711
207122000-03-17 Akim Demaille <akim@epita.fr>
20713
20714 * src/Makefile.am (bison.simple): Fix the awk program: quote only
20715 the file name, not the whole `#line LINE FILE'.
20716
207172000-03-17 Akim Demaille <akim@epita.fr>
20718
20719 On syntax errors, report the token on which we choked.
20720
20721 * src/bison.s1 (yyparse): In the label yyerrlab, when
20722 YYERROR_VERBOSE, add yychar in msg.
20723
207242000-03-17 Akim Demaille <akim@epita.fr>
20725
20726 * src/reader.c (copy_at): New function.
20727 (copy_guard): Use it.
20728 (copy_action): Use it.
20729
207302000-03-17 Akim Demaille <akim@epita.fr>
20731
20732 Be kind to translators, save some useless translations.
20733
20734 * src/main.c (banner): New function.
20735 (fatal_banner): Use it.
20736 (warn_banner): Use it.
20737
207382000-03-17 Akim Demaille <akim@epita.fr>
20739
20740 * src/reader.c (copy_definition): Use copy_string and
20741 copy_comment. Removed now unused `match', `ended',
20742 `cplus_comment'.
20743 (copy_comment, copy_string): Moved, to be visible from
20744 copy_definition.
20745
207462000-03-17 Akim Demaille <akim@epita.fr>
20747
20748 * src/reader.c (copy_string): Declare `static inline'. No
20749 problems with inline, since it is checked by configure.
20750 (copy_comment): Likewise.
20751
207522000-03-17 Akim Demaille <akim@epita.fr>
20753
20754 * src/reader.c (packsymbols): Formatting changes.
20755
207562000-03-17 Akim Demaille <akim@epita.fr>
20757
20758 * src/reader.c (copy_comment): New function, factored out from:
20759 (copy_action): Use it. Removed now unused `match', `ended',
20760 `cplus_comment'.
20761 (copy_guard): Likewise.
20762
207632000-03-17 Akim Demaille <akim@epita.fr>
20764
20765 * src/reader.c (copy_string): New function, factored out from:
20766 (copy_action): Use it.
20767 (copy_guard): Likewise.
20768
207692000-03-17 Akim Demaille <akim@epita.fr>
20770
20771 Change the handling of @s so that they behave exactly like $s.
20772 There is now a pseudo variable @$ (readble and writable), location
20773 of the lhs of the rule (by default ranging from the location of
20774 the first symbol of the rhs, to the location of the last symbol,
20775 or, if the rhs is empty, YYLLOC).
20776
20777 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
20778 yyval.
20779 (yyparse): When providing a default semantic action, provide a
20780 default location action.
20781 (after the $): No longer change `*YYLSP', just stack YYLOC the
20782 same way you stack YYVAL.
20783 * src/reader.c (read_declarations): Use warns.
20784 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
20785 (copy_action, case '@'): Likewise.
20786 Use a standard error message, to save useless work from
20787 translators.
20788
207892000-03-17 Akim Demaille <akim@epita.fr>
20790
20791 * src/bison.s1: Formatting and cosmetics changes.
20792 * src/reader.c: Likewise.
20793 Update the Copyright notice.
20794
207952000-03-17 Akim Demaille <akim@epita.fr>
20796
20797 * src/bison.s1 (#line): All set to `#line' only, since the
20798 Makefile now handles them.
20799
208002000-03-16 Akim Demaille <akim@epita.fr>
20801
20802 * src/output.c (output_rule_data): Output the documentation of
20803 some of the tables.
20804 (Copyright notice): Update.
20805 Formatting changes.
20806
208072000-03-16 Akim Demaille <akim@epita.fr>
20808
20809 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
20810 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
20811 One `#if YYDEBUG' remains, since it uses variables which are
20812 defined only if `YYDEBUG != 0'.
20813
208142000-03-16 Akim Demaille <akim@epita.fr>
20815
20816 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
20817 and related variables so that the similarities are highlighted.
20818
208192000-03-16 Akim Demaille <akim@epita.fr>
20820
20821 * src/bison.s1: Properly indent CPP directives.
20822
208232000-03-16 Akim Demaille <akim@epita.fr>
20824
20825 * src/bison.s1: Properly indent the `alloca' CPP section.
20826
208272000-03-16 Akim Demaille <akim@epita.fr>
20828
20829 Do not hard code values of directories in `configure.in'.
20830 Update the `configure' tool chain.
20831
20832 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
20833 src/makefile.am.
20834 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
20835 (AC_OUTPUT): Add m4/Makefile.
20836 Bump to bison 1.28a, 1.29 has never been released.
20837 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
20838 handled via src/Makefile.am.
20839 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
20840 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
20841 autoheader.
20842 * Makefile.am (SUBDIRS): Add m4.
20843 (ACLOCAL_AM_FLAGS): New variable.
20844 (AUTOMAKE_OPTIONS): Add check-news.
20845 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
20846 the proper line number and file name.
20847 (DEFS): Propagate the location of bison library files and of the
20848 locale files.
20849 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
20850 builddir.
20851 * acinclude.m4: Remove, replaced by the directory m4.
20852 * m4/Makefile.am (EXTRA_DIST): New variable.
20853 * m4/gettext.m4: New file, from the fileutils.
20854 * m4/lcmessage.m4: Likewise
20855 * m4/progtest.m4: Likewise.
20856 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
20857
208582000-03-10 Akim Demaille <akim@epita.fr>
20859
20860 * src/closure.c:
20861 Formatting changes of various comments.
20862 Respect the GNU coding standards at various places.
20863 Don't use `_()' when no translation is needed.
20864
208651999-12-13 Jesse Thilo <jthilo@gnu.org>
20866
20867 * src/files.c:
20868 OS/2 honors TMPDIR environment variable.
20869
208701999-12-13 Jesse Thilo <jthilo@gnu.org>
20871
20872 * doc/bison.texinfo: Tweaked spelling and grammar.
20873 Updated ISBN.
20874 Removed reference to price of printed copy.
20875 Mention BISON_SIMPLE and BISON_HAIRY.
20876
208771999-12-13 Jesse Thilo <jthilo@gnu.org>
20878
20879 * configure.in, NEWS:
20880 Bison 1.29 released.
20881
208821999-10-27 Jesse Thilo <jthilo@gnu.org>
20883
20884 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
20885 Added reference card.
20886
208871999-07-26 Jesse Thilo <jthilo@gnu.org>
20888
20889 * po/ru.po: Added Russian translation.
20890
208911999-07-26 Jesse Thilo <jthilo@gnu.org>
20892
20893 * configure.in: Added Russian translation.
20894
208951999-07-06 Jesse Thilo <jthilo@gnu.org>
20896
20897 * configure.in, NEWS, README:
20898 Released version 1.28.
20899
209001999-06-14 Jesse Thilo <jthilo@gnu.org>
20901
20902 * src/system.h:
20903 Squashed redefinition warning on some systems.
20904
20905 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
20906 Have configure build version string instead of relying on ANSI string
20907 concatentation.
20908
209091999-06-14 Jesse Thilo <jthilo@gnu.org>
20910
20911 * po/POTFILES.in: Got rid of version.c.
20912
209131999-06-14 Jesse Thilo <jthilo@gnu.org>
20914
20915 * acconfig.h, configure.in:
20916 Have configure build version string instead of relying on ANSI string
20917 concatentation.
20918
209191999-06-08 Jesse Thilo <jthilo@gnu.org>
20920
20921 * doc/bison.1:
20922 Dropped mention of `+' for long-named options.
20923
209241999-05-30 Jesse Thilo <jthilo@gnu.org>
20925
20926 * src/files.c: Added <unistd.h> for unlink().
20927
20928 * src/Makefile.am, src/system.h:
20929 I18n fixes.
20930
209311999-05-30 Jesse Thilo <jthilo@gnu.org>
20932
20933 * README: Added a FAQ list.
20934
20935 * configure.in, acconfig.h:
20936 I18n fixes.
20937
209381999-05-30 Jesse Thilo <jthilo@gnu.org>
20939
20940 * doc/FAQ, doc/Makefile.am:
20941 Added a FAQ list.
20942
209431999-05-19 Jesse Thilo <jthilo@gnu.org>
20944
20945 * src/alloc.h, src/symtab.h, src/version.c:
20946 Protected inclusion of "config.h" with HAVE_CONFIG_H.
20947
209481999-04-18 Jesse Thilo <jthilo@gnu.org>
20949
20950 * src/.cvsignore, src/Makefile.am:
20951 Reorganized: sources in `src', documentation in `doc'.
20952
20953 * src/lex.c (literalchar):
20954 fixed the code for escaping double quotes (thanks
20955 Jonathan Czisny.)
20956
209571999-04-18 Jesse Thilo <jthilo@gnu.org>
20958
20959 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
20960 Adjusted paths to reflect directory reorganization.
20961
209621999-04-18 Jesse Thilo <jthilo@gnu.org>
20963
20964 * doc/.cvsignore, doc/Makefile.am:
20965 Reorganized: sources in `src', documentation in `doc'.
20966
209671999-04-18 Jesse Thilo <jthilo@gnu.org>
20968
20969 * configure.in:
20970 Updated AC_INIT file to reflect directory reorganization.
20971
20972 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
20973 Reorganized: sources in `src', documentation in `doc'.
20974
209751999-04-13 Jesse Thilo <jthilo@gnu.org>
20976
20977 * src/allocate.c:
20978 Don't declare calloc() and realloc() if not necessary.
20979
209801999-04-13 Jesse Thilo <jthilo@gnu.org>
20981
20982 * configure.in, acconfig.h, acinclude.m4:
20983 Don't declare calloc() and realloc() if not necessary.
20984
209851999-03-23 Jesse Thilo <jthilo@gnu.org>
20986
20987 * po/.cvsignore: Added i18n support.
20988
209891999-03-23 Jesse Thilo <jthilo@gnu.org>
20990
20991 * acconfig.h, configure.in, Makefile.am:
20992 Added i18n support.
20993
209941999-03-22 Jesse Thilo <jthilo@gnu.org>
20995
20996 * src/bison.s1: Fixed #line numbers.
20997
209981999-03-15 Jesse Thilo <jthilo@gnu.org>
20999
21000 * po/es.po, po/fr.po, po/nl.po, po/de.po:
21001 Added PO files from Translation Project.
21002
210031999-03-03 Jesse Thilo <jthilo@gnu.org>
21004
21005 * Makefile.am:
21006 Added support for non-ANSI compilers (ansi2knr).
21007
210081999-02-16 Jesse Thilo <jthilo@gnu.org>
21009
21010 * configure.in: Bumped version number to 1.27.
21011
21012 * Makefile.am:
21013 Added `bison.simple' to list of files removed by `make distclean'.
21014
210151999-02-12 Jesse Thilo <jthilo@gnu.org>
21016
21017 * src/files.c, src/files.h:
21018 Defined locations of parser files in config.h instead of Makefile.
21019
210201999-02-12 Jesse Thilo <jthilo@gnu.org>
21021
21022 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
21023 Defined locations of parser files in config.h instead of Makefile.
21024
210251999-02-09 Jesse Thilo <jthilo@gnu.org>
21026
21027 * Makefile.am:
21028 Removed inappropriate use of $< macro.
21029
210301999-02-05 Jesse Thilo <jthilo@gnu.org>
21031
21032 * po/Makefile.in.in, po/POTFILES.in:
21033 Add `po' directory skeleton.
21034
210351999-01-27 Jesse Thilo <jthilo@gnu.org>
21036
21037 * README: Document help-bison list.
21038
21039 * configure.in: Add check for mkstemp().
21040
210411999-01-20 Jesse Thilo <jthilo@gnu.org>
21042
21043 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
21044 Hush a few compiler warnings.
21045
21046 * src/files.c:
21047 Add tryclose(), which verifies that fclose was successful.
21048 Hush a couple of compiler warnings.
21049
210501999-01-20 Jesse Thilo <jthilo@gnu.org>
21051
21052 * Makefile.am, OChangeLog:
21053 ChangeLog is now automatically generated. Include the old version as
21054 OChangeLog.
21055
210561999-01-14 Jesse Thilo <jthilo@gnu.org>
21057
21058 * 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:
21059 Update FSF address.
21060
210611999-01-14 Jesse Thilo <jthilo@gnu.org>
21062
21063 * doc/bison.texinfo: Fix formatting glitch.
21064
21065 * doc/bison.texinfo: Update FSF address.
21066
210671999-01-14 Jesse Thilo <jthilo@gnu.org>
21068
21069 * acconfig.h: Update FSF address.
21070
210711999-01-08 Jesse Thilo <jthilo@gnu.org>
21072
21073 * src/system.h:
21074 Don't define PACKAGE here, since config.h defines it.
21075
210761998-12-30 Jesse Thilo <jthilo@gnu.org>
21077
21078 * src/reader.c: Update copyright date.
21079
21080 * src/main.c:
21081 Ditch sprintf to statically-sized buffers in fatal/warn functions in
21082 favor of output directly to stderr (avoids buffer overruns).
21083
21084 * src/reader.c: Some checks for premature EOF.
21085
21086 * 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:
21087 Use prototypes if the compiler understands them.
21088
21089 * src/files.c: Honor TMPDIR on Unix hosts.
21090 Use prototypes if the compiler understands them.
21091
21092 * src/reader.c:
21093 Fix a couple of buffer overrun bugs.
21094 Use prototypes if the compiler understands them.
21095
21096 * src/system.h: Include unistd.h and ctype.h.
21097 Use #ifdef instead of #if for NLS symbols.
21098
210991998-12-30 Jesse Thilo <jthilo@gnu.org>
21100
21101 * doc/bison.texinfo:
21102 Delete comment "consider using @set for edition number, etc..." since
21103 we now are doing so.
21104
211051998-12-30 Jesse Thilo <jthilo@gnu.org>
21106
21107 * configure.in:
21108 Use prototypes if the compiler understands them.
21109
21110 * NEWS: Document 1.26 highlights.
21111
21112 * Makefile.am: Require Automake 1.3 or later.
21113
21114 * acconfig.h:
21115 Use prototypes if the compiler understands them.
21116
211171998-12-29 Jesse Thilo <jthilo@gnu.org>
21118
21119 * src/version.c:
21120 Use VERSION symbol from automake for version number.
21121
211221998-12-29 Jesse Thilo <jthilo@gnu.org>
21123
21124 * acconfig.h, configure.in, version.cin:
21125 Use VERSION symbol from automake for version number.
21126
211271998-11-28 Jesse Thilo <jthilo@gnu.org>
21128
21129 * Makefile.am:
21130 Distribute original version of simple parser (bison.s1), not built
21131 version (bison.simple).
21132
211331998-11-28 Jesse Thilo <jthilo@gnu.org>
21134
21135 * doc/bison.texinfo: Add info dir entry.
21136
21137 * doc/bison.texinfo:
21138 Let automake put version number into documentation.
21139
211401998-11-26 Jesse Thilo <jthilo@gnu.org>
21141
21142 * src/bison.cld, src/build.com, src/vmshlp.mar:
21143 Add non-RCS files from /gd/gnu/bison.
21144
211451998-11-26 Jesse Thilo <jthilo@gnu.org>
21146
21147 * doc/bison.1:
21148 Document the BISON_HAIRY and BISON_SIMPLE variables.
21149
211501998-11-25 Jesse Thilo <jthilo@gnu.org>
21151
21152 * src/version.c: Build version.c automatically.
21153
21154 * src/reader.c:
21155 Fix token numbering (used to start at 258, not 257).
21156
21157 * src/system.h: Include config.h.
21158
21159 * src/getargs.c: Update bug report address.
21160
21161 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
21162 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
21163
211641998-11-25 Jesse Thilo <jthilo@gnu.org>
21165
21166 * Makefile.am:
21167 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21168
21169 * configure.in, version.cin:
21170 Build version.c automatically.
21171
21172 * AUTHORS: Add AUTHORS file.
21173
21174 * README: Update bug report address.
21175
21176 * bison.simple:
21177 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21178
21179 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
21180 Add automake stuff.
21181
211821998-11-25 Jesse Thilo <jthilo@gnu.org>
21183
21184 * doc/bison.texinfo: Clean up some formatting.
21185
211861998-05-05 Richard Stallman <rms@gnu.org>
21187
21188 * doc/bison.texinfo:
21189 Explain better why to make a pure parser.
21190
211911998-01-05 Richard Stallman <rms@gnu.org>
21192
21193 * src/files.c (openfiles):
21194 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
21195 find a temporary directory, if possible. Do not unlink files while
21196 they are open.
21197
211981997-08-25 Richard Stallman <rms@gnu.org>
21199
21200 * src/reader.c (stack_offset;):
21201 Change some warni to warns.
21202
21203 * src/lex.c (literalchar): Use warns, not warni.
21204
212051997-06-28 Richard Stallman <rms@gnu.org>
21206
21207 * src/bison.s1: Add a Bison version comment.
21208
21209 * src/main.c (fatal, warn, berror):
21210 Use program_name.
21211
212121997-06-28 Richard Stallman <rms@gnu.org>
21213
21214 * Makefile.in (bison_version): New variable.
21215 (dist): Use that variable.
21216 (bison.s1): Substitute the Bison version into bison.simple.
21217
21218 * bison.simple: Add a Bison version comment.
21219
212201997-06-18 Richard Stallman <rms@gnu.org>
21221
21222 * src/main.c (fatal, warn, berror):
21223 Make error messages standard.
21224 (toomany): Improve error message text.
21225
21226 * 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:
21227 new.h renamed to alloc.h.
21228
212291997-06-18 Richard Stallman <rms@gnu.org>
21230
21231 * Makefile.in: new.h renamed to alloc.h.
21232
212331997-05-24 Richard Stallman <rms@gnu.org>
21234
21235 * src/lex.c (literalchar):
21236 Fix the code for escaping \, " and '.
21237
21238 (lex): Avoid trouble when there are many chars
21239 to discard in a char literal with just several chars in it.
21240
212411997-05-17 Richard Stallman <rms@gnu.org>
21242
21243 * src/bison.s1:
21244 Use malloc, if using alloca is troublesome.
21245 (YYSTACK_USE_ALLOCA): New flag macro.
21246 Define it for some systems and compilers.
21247 (YYSTACK_ALLOC): New macro.
21248 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21249 If it was malloc'd, free it.
21250
212511997-05-17 Richard Stallman <rms@gnu.org>
21252
21253 * bison.simple:
21254 Use malloc, if using alloca is troublesome.
21255 (YYSTACK_USE_ALLOCA): New flag macro.
21256 Define it for some systems and compilers.
21257 (YYSTACK_ALLOC): New macro.
21258 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21259 If it was malloc'd, free it.
21260
212611997-04-23 Richard Stallman <rms@gnu.org>
21262
21263 * src/bison.s1:
21264 (alloca) [__hpux]: Always define as __builtin_alloca.
21265
212661997-04-23 Richard Stallman <rms@gnu.org>
21267
21268 * bison.simple:
21269 (alloca) [__hpux]: Always define as __builtin_alloca.
21270
212711997-04-22 Richard Stallman <rms@gnu.org>
21272
21273 * src/bison.s1:
21274 [__hpux]: Include alloca.h (right for HPUX 10)
21275 instead of declaring alloca (right for HPUX 9).
21276
21277 * src/bison.s1 (__yy_memcpy):
21278 Declare arg `count' as unsigned int.
21279 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21280
212811997-04-22 Richard Stallman <rms@gnu.org>
21282
21283 * bison.simple:
21284 [__hpux]: Include alloca.h (right for HPUX 10)
21285 instead of declaring alloca (right for HPUX 9).
21286
21287 * bison.simple (__yy_memcpy):
21288 Declare arg `count' as unsigned int.
21289 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21290
212911997-01-03 Richard Stallman <rms@gnu.org>
21292
21293 * src/allocate.c: [__STDC__ or _MSC_VER]:
21294 Declare calloc and realloc to return void *.
21295
212961997-01-02 Richard Stallman <rms@gnu.org>
21297
21298 * src/system.h:
21299 [_MSC_VER]: Include stdlib.h and process.h.
21300 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
21301
21302 * src/main.c (main): Return FAILURE as a value.
21303 (printable_version): Declare arg as int, not char.
21304
213051997-01-02 Richard Stallman <rms@gnu.org>
21306
21307 * Makefile.in (dist):
21308 Explicitly check for symlinks, and copy them.
21309
213101996-12-19 Richard Stallman <rms@gnu.org>
21311
21312 * src/files.c:
21313 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
21314
213151996-12-18 Paul Eggert <eggert@gnu.org>
21316
21317 * src/bison.s1 (yyparse):
21318 If __GNUC__ and YYPARSE_PARAM are both defined,
21319 declare yyparse to have a void * argument.
21320
213211996-12-18 Paul Eggert <eggert@gnu.org>
21322
21323 * bison.simple (yyparse):
21324 If __GNUC__ and YYPARSE_PARAM are both defined,
21325 declare yyparse to have a void * argument.
21326
213271996-12-17 Richard Stallman <rms@gnu.org>
21328
21329 * src/reduce.c (nbits): Add some casts.
21330
213311996-08-12 Richard Stallman <rms@gnu.org>
21332
21333 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
21334
213351996-08-12 Richard Stallman <rms@gnu.org>
21336
21337 * bison.simple: Test _MSDOS as well as _MSDOS_.
21338
213391996-07-31 Richard Stallman <rms@gnu.org>
21340
21341 * src/bison.s1:
21342 [__sun && __i386]: Include alloca.h.
21343
213441996-07-31 Richard Stallman <rms@gnu.org>
21345
21346 * bison.simple:
21347 [__sun && __i386]: Include alloca.h.
21348
213491996-07-30 Richard Stallman <rms@gnu.org>
21350
21351 * src/bison.s1: Comment change.
21352
21353 * src/bison.s1: Test _MSDOS_, not MSDOS.
21354
213551996-07-30 Richard Stallman <rms@gnu.org>
21356
21357 * bison.simple: Comment change.
21358
21359 * bison.simple: Test _MSDOS_, not MSDOS.
21360
213611996-06-01 Richard Stallman <rms@gnu.org>
21362
21363 * 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:
21364 Insert `_' macro around many string constants.
21365
21366 * src/main.c:
21367 Insert `_' macro around many string constants.
21368
21369 (main): Call setlocale, bindtextdomain and textdomain.
21370
21371 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
21372 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
21373 [ENABLE_NLS]: Include libintl.h.
21374 [ENABLE_NLS] (gettext): Define.
21375 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
21376 (N_, PACKAGE, LOCALEDIR): New macros.
21377
213781996-06-01 Richard Stallman <rms@gnu.org>
21379
21380 * POTFILES.in: New file.
21381
21382 * Makefile.in (allocate.o):
21383 Define target explicitly.
21384
21385 * Makefile.in (CFLAGS): Set to @CFLAGS@.
21386 (LDFLAGS): Set to @LDFLAGS@.
21387 (configure): Run autoconf only if preceding `cd' succeeds.
21388 (bison.s1): Redirect output to temporary file then move the
21389 temporary to the target, rather than redirecting directly to bison.s1.
21390 (clean): Remove config.status and config.log.
21391 (distclean): Don't remove config.status here.
21392
213931996-05-12 Richard Stallman <rms@gnu.org>
21394
21395 * src/bison.s1:
21396 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21397
213981996-05-12 Richard Stallman <rms@gnu.org>
21399
21400 * bison.simple:
21401 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21402
214031996-05-11 Richard Stallman <rms@gnu.org>
21404
21405 * src/bison.s1 (__yy_memcpy):
21406 Really reorder the args, as was supposedly done on Feb 14 1995.
21407 (yyparse): Calls changed accordingly.
21408
214091996-05-11 Richard Stallman <rms@gnu.org>
21410
21411 * Makefile.in (dist): Don't use $(srcdir).
21412
21413 * bison.simple (__yy_memcpy):
21414 Really reorder the args, as was supposedly done on Feb 14 1995.
21415 (yyparse): Calls changed accordingly.
21416
214171996-01-27 Richard Stallman <rms@gnu.org>
21418
21419 * src/output.c (output_rule_data):
21420 Test YYERROR_VERBOSE in the conditional
21421 around the definition of ttyname.
21422
214231995-12-29 Richard Stallman <rms@gnu.org>
21424
21425 * src/bison.s1:
21426 Fix line numbers in #line commands.
21427
214281995-12-29 Richard Stallman <rms@gnu.org>
21429
21430 * bison.simple:
21431 Fix line numbers in #line commands.
21432
214331995-12-27 Richard Stallman <rms@gnu.org>
21434
21435 * src/bison.s1 (YYPARSE_PARAM_DECL):
21436 In C++, make it always null.
21437 (YYPARSE_PARAM_ARG): New macro.
21438 (yyparse): Use YYPARSE_PARAM_ARG.
21439
214401995-12-27 Richard Stallman <rms@gnu.org>
21441
21442 * bison.simple (YYPARSE_PARAM_DECL):
21443 In C++, make it always null.
21444 (YYPARSE_PARAM_ARG): New macro.
21445 (yyparse): Use YYPARSE_PARAM_ARG.
21446
214471995-11-29 Richard Stallman <rms@gnu.org>
21448
21449 * doc/bison.texinfo:
21450 Describe literal string tokens, %raw, %no_lines, %token_table.
21451
214521995-11-29 Daniel Hagerty <hag@gnu.org>
21453
21454 * doc/bison.texinfo: Fixed update date
21455
214561995-10-16 Richard Stallman <rms@gnu.org>
21457
21458 * src/version.c: Version 1.25.
21459
214601995-10-16 Richard Stallman <rms@gnu.org>
21461
21462 * NEWS: *** empty log message ***
21463
214641995-10-16 Richard Stallman <rms@gnu.org>
21465
21466 * doc/bison.1, doc/bison.rnh:
21467 Add new options.
21468
214691995-10-15 Richard Stallman <rms@gnu.org>
21470
21471 * src/vmsgetargs.c, src/getargs.c:
21472 Added -n, -k, and -raw switches.
21473 (noparserflag, toknumflag, rawtoknumflag): New variables.
21474
21475 * src/symtab.h (SALIAS):
21476 New #define for adding aliases to %token.
21477 (struct bucket): Added `alias' field.
21478
21479 * src/reduce.c (reduce_grammar):
21480 Revise error message.
21481 (print_notices): Remove final `.' from error message.
21482
21483 * src/reader.c (reader_output_yylsp):
21484 New function.
21485 (readgram): Use `#if 0' around code that accepted %command
21486 inside grammar rules: The documentation doesn't allow it,
21487 and it will fail since the %command processors scan for the next %.
21488 (parse_token_decl): Extended the %token
21489 declaration to allow a multi-character symbol as an alias.
21490 (parse_thong_decl): New function.
21491 (read_declarations): Added %thong declarations.
21492 (read_declarations): Handle NOOP to deal with allowing
21493 % declarations as another means to specify the flags.
21494 (readgram): Allow %prec prior to semantics embedded in a rule.
21495 (skip_to_char, read_declarations, copy_definition)
21496 (parse_token_decl, parse_start_decl, parse_type_decl)
21497 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
21498 (get_type_name, copy_guard, copy_action, readgram)
21499 (get_type, packsymbols): Revised most error messages.
21500 Changed `fatal' to `warnxxx' to avoid aborting for error.
21501 Revised and use multiple warnxxx functions to avoid using VARARGS1.
21502 (read_declarations): Improve the error message for
21503 an invalid character. Do not abort.
21504 (read_declarations, copy_guard, copy_action): Use
21505 printable_version to avoid unprintable characters in printed output.
21506 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
21507 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
21508 Allow the type of a non-terminal can be given
21509 more than once, as long as all specifications give the same type.
21510
21511 * src/output.c:
21512 (output_headers, output_trailers, output, output_gram)
21513 (output_rule_data): Implement noparserflag variable.
21514 Implement toknumflag variable.
21515 (output): Call reader_output_yylsp to output LTYPESTR.
21516
21517 * src/main.c (main):
21518 If reader sees an error, don't process the grammar.
21519 (fatals): Updated to not use VARARGS1.
21520 (printable_version, int_to_string, warn, warni, warns, warnss)
21521 (warnsss): New error reporting functions. Avoid abort for error.
21522
21523 * src/lex.h:
21524 Added THONG and NOOP for alias processing.
21525 Added SETOPT for the new code that allows setting options with %flags.
21526
21527 * src/lex.c:
21528 Include getopt.h. Add some extern decls.
21529 (safegetc): New function to deal with EOF gracefully.
21530 (literalchar); new function to deal with reading \ escapes.
21531 (lex): Use literalchar.
21532 (lex): Implemented "..." tokens.
21533 (literalchar, lex, parse_percent_token): Made tokenbuffer
21534 always contain the token. This includes growing the token
21535 buffer while reading an integer.
21536 (parse_percent_token): Replaced if-else statement with percent_table.
21537 (parse_percent_token): Added % declarations as another
21538 way to specify the flags -n, -l, and -r. Also added hooks for
21539 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
21540 major changes to files.c.
21541 (lex) Retain in the incoming stream a character following
21542 an incorrect '/'.
21543 (skip_white_space, lex): Revised most error messages
21544 and changed fatal to warn to avoid aborting.
21545 (percent_table): Added %thong declarations.
21546
21547 * src/gram.h: Comment changes.
21548
21549 * src/files.c (openfiles, open_extra_files, done):
21550 Add faction flag
21551 and actfile file. Handle noparserflag. Both for -n switch.
21552
21553 * src/conflicts.c (resolve_sr_conflict):
21554 Remove use of alloca.
21555
215561995-06-01 Jim Meyering <meyering@gnu.org>
21557
21558 * doc/bison.texinfo: *** empty log message ***
21559
215601995-05-06 Richard Stallman <rms@gnu.org>
21561
21562 * src/bison.s1: Comment change.
21563
215641995-05-06 Richard Stallman <rms@gnu.org>
21565
21566 * bison.simple: Comment change.
21567
215681995-05-03 Richard Stallman <rms@gnu.org>
21569
21570 * src/version.c: Version now 1.24.
21571
21572 * src/bison.s1: Change distribution terms.
21573
21574 * src/version.c: Version now 1.23.
21575
215761995-05-03 Richard Stallman <rms@gnu.org>
21577
21578 * doc/bison.texinfo:
21579 Rewrite "Conditions for Using Bison".
21580 Update version to 1.24.
21581
215821995-05-03 Richard Stallman <rms@gnu.org>
21583
21584 * bison.simple: Change distribution terms.
21585
215861995-02-23 Richard Stallman <rms@gnu.org>
21587
21588 * src/files.c: Test __VMS_POSIX as well as VMS.
21589
215901995-02-14 Jim Meyering <meyering@gnu.org>
21591
21592 * src/bison.s1 (__yy_memcpy):
21593 Renamed from __yy_bcopy to avoid
21594 confusion. Reverse FROM and TO arguments to be consistent with
21595 those of memcpy.
21596
215971995-02-14 Jim Meyering <meyering@gnu.org>
21598
21599 * bison.simple (__yy_memcpy):
21600 Renamed from __yy_bcopy to avoid
21601 confusion. Reverse FROM and TO arguments to be consistent with
21602 those of memcpy.
21603
216041994-11-10 David J. MacKenzie <djm@gnu.org>
21605
21606 * NEWS: reformat
21607
21608 * NEWS: New file.
21609
21610 * Makefile.in (DISTFILES): Include NEWS.
21611
21612 * Makefile.in (DISTFILES):
21613 Include install-sh, not install.sh.
21614
21615 * configure.in: Update to Autoconf v2 macro names.
21616
216171994-10-05 David J. MacKenzie <djm@gnu.org>
21618
21619 * Makefile.in: fix typo
21620
21621 * Makefile.in (prefix, exec_prefix):
21622 Let configure set them.
21623
216241994-09-28 David J. MacKenzie <djm@gnu.org>
21625
21626 * Makefile.in: Set datadir to $(prefix)/share.
21627
216281994-09-15 Richard Stallman <rms@gnu.org>
21629
21630 * src/bison.s1:
21631 Update copyright notice and GPL version.
21632
216331994-09-15 Richard Stallman <rms@gnu.org>
21634
21635 * bison.simple:
21636 Update copyright notice and GPL version.
21637
216381994-07-12 Richard Stallman <rms@gnu.org>
21639
21640 * src/reduce.c, src/reader.c:
21641 entered into RCS
21642
216431994-05-05 David J. MacKenzie <djm@gnu.org>
21644
21645 * Makefile.in: entered into RCS
21646
216471994-03-26 Richard Stallman <rms@gnu.org>
21648
21649 * src/bison.s1: entered into RCS
21650
216511994-03-26 Richard Stallman <rms@gnu.org>
21652
21653 * bison.simple: entered into RCS
21654
216551994-03-25 Richard Stallman <rms@gnu.org>
21656
21657 * src/main.c: entered into RCS
21658
216591994-03-24 Richard Stallman <rms@gnu.org>
21660
21661 * src/conflicts.c: entered into RCS
21662
216631994-01-02 Richard Stallman <rms@gnu.org>
21664
21665 * Makefile.in: *** empty log message ***
21666
216671993-11-21 Richard Stallman <rms@gnu.org>
21668
21669 * src/bison.s1: *** empty log message ***
21670
216711993-11-21 Richard Stallman <rms@gnu.org>
21672
21673 * doc/bison.texinfo: entered into RCS
21674
21675 * doc/bison.texinfo: *** empty log message ***
21676
216771993-11-21 Richard Stallman <rms@gnu.org>
21678
21679 * bison.simple: *** empty log message ***
21680
216811993-10-25 David J. MacKenzie <djm@gnu.org>
21682
21683 * doc/bison.texinfo: *** empty log message ***
21684
216851993-10-19 Richard Stallman <rms@gnu.org>
21686
21687 * src/bison.s1: *** empty log message ***
21688
216891993-10-19 Richard Stallman <rms@gnu.org>
21690
21691 * bison.simple: *** empty log message ***
21692
216931993-10-14 Richard Stallman <rms@gnu.org>
21694
21695 * src/bison.s1: *** empty log message ***
21696
216971993-10-14 Richard Stallman <rms@gnu.org>
21698
21699 * bison.simple: *** empty log message ***
21700
217011993-09-14 David J. MacKenzie <djm@gnu.org>
21702
21703 * doc/bison.texinfo: *** empty log message ***
21704
217051993-09-13 Noah Friedman <friedman@gnu.org>
21706
21707 * Makefile.in: *** empty log message ***
21708
217091993-09-10 Richard Stallman <rms@gnu.org>
21710
21711 * src/conflicts.c: *** empty log message ***
21712
21713 * src/system.h: entered into RCS
21714
217151993-09-10 Richard Stallman <rms@gnu.org>
21716
21717 * doc/bison.1: entered into RCS
21718
217191993-09-06 Noah Friedman <friedman@gnu.org>
21720
21721 * src/version.c: entered into RCS
21722
217231993-09-06 Noah Friedman <friedman@gnu.org>
21724
21725 * Makefile.in: *** empty log message ***
21726
217271993-07-30 David J. MacKenzie <djm@gnu.org>
21728
21729 * Makefile.in: *** empty log message ***
21730
217311993-07-24 Richard Stallman <rms@gnu.org>
21732
21733 * src/bison.s1: *** empty log message ***
21734
217351993-07-24 Richard Stallman <rms@gnu.org>
21736
21737 * bison.simple: *** empty log message ***
21738
217391993-07-08 David J. MacKenzie <djm@gnu.org>
21740
21741 * Makefile.in: *** empty log message ***
21742
217431993-07-04 Richard Stallman <rms@gnu.org>
21744
21745 * src/bison.s1: *** empty log message ***
21746
217471993-07-04 Richard Stallman <rms@gnu.org>
21748
21749 * bison.simple: *** empty log message ***
21750
217511993-06-26 David J. MacKenzie <djm@gnu.org>
21752
21753 * src/getargs.c: entered into RCS
21754
217551993-06-26 David J. MacKenzie <djm@gnu.org>
21756
21757 * doc/bison.texinfo: *** empty log message ***
21758
21759 * doc/bison.1: New file.
21760
217611993-06-25 Richard Stallman <rms@gnu.org>
21762
21763 * src/getargs.c: New file.
21764
217651993-06-16 Richard Stallman <rms@gnu.org>
21766
21767 * src/bison.s1: *** empty log message ***
21768
217691993-06-16 Richard Stallman <rms@gnu.org>
21770
21771 * bison.simple: *** empty log message ***
21772
217731993-06-03 Richard Stallman <rms@gnu.org>
21774
21775 * src/bison.s1: New file.
21776
217771993-06-03 Richard Stallman <rms@gnu.org>
21778
21779 * doc/bison.texinfo: *** empty log message ***
21780
217811993-06-03 Richard Stallman <rms@gnu.org>
21782
21783 * bison.simple: New file.
21784
217851993-05-19 Richard Stallman <rms@gnu.org>
21786
21787 * doc/bison.texinfo: New file.
21788
217891993-05-07 Noah Friedman <friedman@gnu.org>
21790
21791 * Makefile.in: *** empty log message ***
21792
217931993-04-28 Noah Friedman <friedman@gnu.org>
21794
21795 * src/reader.c: *** empty log message ***
21796
217971993-04-23 Noah Friedman <friedman@gnu.org>
21798
21799 * src/alloc.h: entered into RCS
21800
218011993-04-20 David J. MacKenzie <djm@gnu.org>
21802
21803 * src/version.c: *** empty log message ***
21804
21805 * src/files.c, src/allocate.c:
21806 entered into RCS
21807
21808 * src/reader.c: *** empty log message ***
21809
21810 * src/lex.c: entered into RCS
21811
21812 * src/conflicts.c: New file.
21813
21814 * src/symtab.c: entered into RCS
21815
21816 * src/alloc.h: New file.
21817
21818 * src/LR0.c: entered into RCS
21819
218201993-04-18 Noah Friedman <friedman@gnu.org>
21821
21822 * src/reader.c: New file.
21823
21824 * src/version.c: *** empty log message ***
21825
218261993-04-18 Noah Friedman <friedman@gnu.org>
21827
21828 * Makefile.in: *** empty log message ***
21829
218301993-04-17 Noah Friedman <friedman@gnu.org>
21831
21832 * Makefile.in: *** empty log message ***
21833
218341993-04-15 Richard Stallman <rms@gnu.org>
21835
21836 * src/main.c, src/files.c:
21837 New file.
21838
218391993-04-15 Noah Friedman <friedman@gnu.org>
21840
21841 * configure.in: entered into RCS
21842
21843 * configure.in: *** empty log message ***
21844
21845 * configure.in: New file.
21846
218471993-04-14 Richard Stallman <rms@gnu.org>
21848
21849 * Makefile.in: New file.
21850
218511993-04-13 Richard Stallman <rms@gnu.org>
21852
21853 * src/version.c: New file.
21854
218551993-03-25 Richard Stallman <rms@gnu.org>
21856
21857 * src/output.c: entered into RCS
21858
218591992-09-25 Richard Stallman <rms@gnu.org>
21860
21861 * configure.bat: entered into RCS
21862
218631992-06-22 Richard Stallman <rms@gnu.org>
21864
21865 * src/vmsgetargs.c: entered into RCS
21866
218671992-06-22 Richard Stallman <rms@gnu.org>
21868
21869 * doc/bison.rnh: entered into RCS
21870
218711992-04-20 David J. MacKenzie <djm@gnu.org>
21872
21873 * README: entered into RCS
21874
218751992-01-22 Richard Stallman <rms@gnu.org>
21876
21877 * src/machine.h: entered into RCS
21878
218791991-12-21 Richard Stallman <rms@gnu.org>
21880
21881 * src/lalr.c, src/closure.c:
21882 entered into RCS
21883
218841991-12-20 Richard Stallman <rms@gnu.org>
21885
21886 * src/state.h: entered into RCS
21887
218881991-12-18 Richard Stallman <rms@gnu.org>
21889
21890 * src/print.c, src/nullable.c, src/derives.c:
21891 entered into RCS
21892
218931991-11-03 David J. MacKenzie <djm@gnu.org>
21894
21895 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
21896 entered into RCS
21897
218981988-09-09 Richard Stallman <rms@gnu.org>
21899
21900 * src/bison.hairy: entered into RCS
21901
219021987-12-16 Richard Stallman <rms@gnu.org>
21903
21904 * REFERENCES: entered into RCS
21905
21906
21907 -----
21908
21909 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
21910 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
21911 2007, 2008, 2009 Free Software Foundation, Inc.
21912
21913 Copying and distribution of this file, with or without
21914 modification, are permitted provided the copyright notice and this
21915 notice are preserved.